• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

      • next /
      • Kipper API /
      • Module /
      • @kipper/core /
      • compiler
    Kipper Docs
    • next
    • latest
    • 0.11.0
    • 0.10.4
    • 0.9.2
    • Overview

    • Quickstart

    • Goals for Kipper

    • Supported platforms

    • Usage Examples

      • Overview

    • Variables

      • Overview

      • String Type

      • Number Type

      • Boolean Type

      • Void Type

      • Null Type

      • Undefined Type

      • Array Type

      • Overview

      • Tangled Expression

      • Arithmetic Expression

      • Assignment Expression

      • Conditional Expressions

      • Logical Expressions

      • Bitwise Expression

      • Relational Expressions

      • Convert Or Cast Expression

      • F-String Expression

      • Member Access Expression

      • Function Call Expression

      • Lambda Expression

      • Matches Expression

      • Overview

      • Expression Statement

      • If Statement

      • While Loop

      • Do-While Loop

      • For Loop

      • Compound Statement

      • Jump Statement

    • Functions

    • Interfaces

    • Classes

    • Comments

    • Built-in Functions

      • Overview

      • Compiler Setup

        • Overview

          • index

          • compiler

          • errors

          • logger

          • utils

          • config

          • index

          • index

        • Overview

        • new

        • run

        • compile

        • help

        • version

      • next /
      • Kipper API /
      • Module /
      • @kipper/core /
      • compiler
    • next /
    • Kipper API /
    • Module /
    • @kipper/core /
    • compiler

    Edit page

    Class: KipperSemanticsAsserter

    compiler.KipperSemanticsAsserter

    Kipper Asserter, which is used to assert certain truths and throw KipperErrors in case that any logical issue is found.

    Since

    0.7.0

    Hierarchy

    • KipperSemanticErrorHandler

      ↳ KipperSemanticsAsserter

      ↳↳ KipperSemanticChecker

      ↳↳ KipperTypeChecker

    Table of contents

    Constructors

    • constructor

    Properties

    • col
    • ctx
    • filePath
    • line
    • programCtx
    • stream

    Methods

    • assertError
    • error
    • notImplementedError
    • setTracebackData

    Constructors

    constructor

    • Protected new KipperSemanticsAsserter(programCtx)

    Parameters

    Name Type
    programCtx KipperProgramContext

    Overrides

    KipperSemanticErrorHandler.constructor

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-asserter.ts:20

    Properties

    col

    • Protected col: undefined | number

    Inherited from

    KipperSemanticErrorHandler.col

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-error-handler.ts:16


    ctx

    • Protected ctx: undefined | CompilableASTNode<SemanticData, TypeData>

    Inherited from

    KipperSemanticErrorHandler.ctx

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-error-handler.ts:17


    filePath

    • Protected filePath: undefined | string

    Inherited from

    KipperSemanticErrorHandler.filePath

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-error-handler.ts:18


    line

    • Protected line: undefined | number

    Inherited from

    KipperSemanticErrorHandler.line

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-error-handler.ts:15


    programCtx

    • Readonly programCtx: KipperProgramContext

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-asserter.ts:18


    stream

    • Protected stream: undefined | KipperFileStream

    Inherited from

    KipperSemanticErrorHandler.stream

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-error-handler.ts:19

    Methods

    assertError

    ▸ Protected assertError(error, overwriteCtx?): KipperError

    Updates the given error and adds the proper traceback data, and returns it.

    Parameters

    Name Type Description
    error KipperError The error to update.
    overwriteCtx? CompilableASTNode<SemanticData, TypeData> The context to overwrite the current context with. This is used when a parent checks children semantics in order to provide the correct traceback data and errors occur in the children.

    Returns

    KipperError

    The Kipper error.

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-asserter.ts:33


    error

    ▸ Protected error(error): KipperError

    Updates the error and adds the proper traceback data, and returns it.

    This function also automatically logs the error.

    Parameters

    Name Type Description
    error KipperError The error to update.

    Returns

    KipperError

    The Kipper error.

    Inherited from

    KipperSemanticErrorHandler.error

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-error-handler.ts:52


    notImplementedError

    ▸ notImplementedError(error): KipperNotImplementedError

    Modifies the metadata for a KipperNotImplementedError

    Since

    0.7.0

    Parameters

    Name Type Description
    error KipperNotImplementedError The KipperNotImplementedError instance.

    Returns

    KipperNotImplementedError

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-asserter.ts:54


    setTracebackData

    ▸ setTracebackData(data): void

    Sets the traceback related metadata that will be used to create a traceback for an KipperError instance.

    In case that data.ctx is set and other fields are missing, these fields will be filled up using the data in the data.ctx AST node ctx instance.

    Since

    0.8.0

    Parameters

    Name Type Description
    data Object The traceback data that will be used to initialise an KipperError instance.
    data.col? number -
    data.ctx? CompilableASTNode<SemanticData, TypeData> -
    data.filePath? string -
    data.line? number -
    data.stream? KipperFileStream -

    Returns

    void

    Inherited from

    KipperSemanticErrorHandler.setTracebackData

    Defined in

    kipper/core/src/compiler/semantics/analyser/err-handler/semantics-error-handler.ts:29

  • Developed at:

    • Releases
    • GitHub
    • Security
    • Issue Tracker
    • License
  • Copyright © 2021-2026 Luna Klatzer, 2024-2025 Lorenz Holzbauer & Fabian Baitura.
    Kipper is licensed under the GPL-3.0-or-later license.