• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

      • latest /
      • Kipper API /
      • Module /
      • @kipper/target-js /
      • index
    Kipper Docs
    • next
    • latest
    • 0.11.0
    • 0.10.4
    • 0.9.2
    • Overview

    • Quickstart

    • Goals for Kipper

    • Supported platforms

    • Usage Examples

      • Overview

      • Type Consistency

      • Runtime Type Casting

      • Strict Compiler Inspection

      • Integrated Runtime Library

    • 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

      • latest /
      • Kipper API /
      • Module /
      • @kipper/target-js /
      • index
    • latest /
    • Kipper API /
    • Module /
    • @kipper/target-js /
    • index

    Edit page

    @kipper/target-js

    Table of contents

    Classes

    • JavaScriptTargetBuiltInGenerator
    • JavaScriptTargetCodeGenerator
    • JavaScriptTargetSemanticAnalyser
    • KipperJavaScriptTarget
    • RuntimeTypesGenerator

    Variables

    • TargetJS
    • author
    • github
    • license
    • name
    • version

    Functions

    • createJSFunctionSignature
    • genJSFunction
    • genJSVariable
    • getJSFunctionSignature
    • indentLines
    • removeBraces

    Variables

    TargetJS

    • Const TargetJS: typeof KipperJavaScriptTarget = KipperJavaScriptTarget

    The JavaScript translation target for the Kipper language.

    Alias for KipperJavaScriptTarget.

    Since

    0.10.0

    Defined in

    kipper/target-js/src/target.ts:140


    author

    • Const author: "Luna Klatzer"

    Defined in

    kipper/target-js/src/index.ts:19


    github

    • Const github: "https://github.com/Kipper-Lang/Kipper"

    Defined in

    kipper/target-js/src/index.ts:23


    license

    • Const license: "GPL-3.0-or-later"

    Defined in

    kipper/target-js/src/index.ts:21


    name

    • Const name: "\@kipper/target-js"

    Defined in

    kipper/target-js/src/index.ts:15


    version

    • Const version: "0.12.1"

    Defined in

    kipper/target-js/src/index.ts:17

    Functions

    createJSFunctionSignature

    ▸ createJSFunctionSignature(signature, ignoreParams?): string

    Generates the JavaScript function signature, based on the signature metadata.

    Since

    0.10.0

    Parameters

    Name Type Default value Description
    signature Object undefined The function signature metadata.
    signature.identifier string undefined -
    signature.params string[] undefined -
    ignoreParams boolean false Whether or not to ignore the parameters of the function.

    Returns

    string

    Defined in

    kipper/target-js/src/tools.ts:45


    genJSFunction

    ▸ genJSFunction(signature, body, ignoreParams?): TranslatedCodeLine[]

    Generates a JavaScript function from the given signature and body.

    Since

    0.10.0

    Parameters

    Name Type Default value Description
    signature Object undefined The signature of the function.
    signature.identifier string undefined -
    signature.params string[] undefined -
    body string undefined The body of the function.
    ignoreParams boolean false Whether or not to ignore the parameters of the function.

    Returns

    TranslatedCodeLine[]

    Defined in

    kipper/target-js/src/built-in-generator.ts:24


    genJSVariable

    ▸ genJSVariable(varSpec, value): TranslatedCodeLine

    Generates a JavaScript local or global variable from the given variable and value.

    Parameters

    Name Type Description
    varSpec BuiltInVariable The variable to generate.
    value string The value of the variable.

    Returns

    TranslatedCodeLine

    Defined in

    kipper/target-js/src/built-in-generator.ts:37


    getJSFunctionSignature

    ▸ getJSFunctionSignature(funcSpec): Object

    Generates the signature for the function based on the funcSpec, which can be used in an JavaScript env.

    Since

    0.10.0

    Parameters

    Name Type Description
    funcSpec any The function spec object containing the metadata of the function.

    Returns

    Object

    Name Type
    identifier string
    params string[]

    Defined in

    kipper/target-js/src/tools.ts:20


    indentLines

    ▸ indentLines(arr, spaces?): TranslatedCodeLine[]

    Indents the lines of the arr with the specified number of spaces.

    Since

    0.10.0

    Parameters

    Name Type Default value Description
    arr TranslatedCodeLine[] undefined The array of code lines.
    spaces number 2 The number of spaces to add at the start of every line.

    Returns

    TranslatedCodeLine[]

    Defined in

    kipper/target-js/src/tools.ts:59


    removeBraces

    ▸ removeBraces(arr): TranslatedCodeLine[]

    Removes the first braces around the given code lines that were generated by translating a CompoundStatement.

    Since

    0.10.0

    Parameters

    Name Type Description
    arr TranslatedCodeLine[] The array of code lines that.

    Returns

    TranslatedCodeLine[]

    Defined in

    kipper/target-js/src/tools.ts:71

  • Developed at:

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