TabScript - v2.0.2
    Preparing search index...

    Class State

    Index

    Constructors

    Properties

    errors: ParseError[] = []
    options: Options

    Accessors

    • get inLine(): number

      Current input line number

      Returns number

    Methods

    • Read and emit token(s). Returns undefined if not matched.

      Parameters

      • what: string | RegExp

      Returns string

    • Read and emit token(s). Returns undefined if not matched.

      Parameters

      • ...whats: (string | RegExp)[]

      Returns string[]

    • Read and emit token only if not stripping types. Can also wrap a function call to strip its output when stripping types.

      Type Parameters

      • T
      • A extends any[]

      Parameters

      • func: (...args: A) => T
      • ...args: A

      Returns T

    • Read and emit token only if not stripping types. Can also wrap a function call to strip its output when stripping types.

      Parameters

      • what: string | RegExp

      Returns string

    • Read and emit token only if not stripping types. Can also wrap a function call to strip its output when stripping types.

      Parameters

      • ...whats: (string | RegExp)[]

      Returns string[]

    • Clear the target position used for source mapping. Called after header parsing to ensure next token gets correct position.

      Returns void

    • Emit output text. Automatically handles source mapping based on last read position. Numbers are treated as explicit position markers. false means the next arg should not have an automatic position emitted. true means the next arg should have an automatic position emitted, but it should not be used for source mapping, and the next token will get the same automatic position again.

      Parameters

      • ...args: (string | number | boolean)[]

      Returns void

    • Format the output tokens into a final string with proper whitespace.

      Returns { code: string; errors: ParseError[]; map: { in: number[]; out: number[] } }

    • Check if more input remains to be parsed

      Returns boolean

    • Check if we're at the start of a new line (for breaking operator processing).

      Returns boolean

    • Check if the character before current position is not a space. Used to distinguish function calls foo(x) from spaced expressions foo (x).

      Returns boolean

    • Require a value to be truthy, throwing ParseError otherwise.

      Type Parameters

      • T extends string | true

      Parameters

      • result: false | T | (() => false | T)

      Returns T

    • Check if the last emitted output ends with the given string. Useful for conditionally emitting closing tokens.

      Parameters

      • str: string

      Returns boolean

    • Peek at token(s) without consuming them.

      Parameters

      • ...whats: (string | RegExp)[]

      Returns any

    • Read token(s) from input, consuming them. Returns undefined if not matched. RegExp arguments must have the /y (sticky) flag.

      Parameters

      • what: string | RegExp

      Returns string

    • Read token(s) from input, consuming them. Returns undefined if not matched. RegExp arguments must have the /y (sticky) flag.

      Parameters

      • ...whats: (string | RegExp)[]

      Returns string[]

    • Read a newline token (including handling indent changes). This is public because the Main parser loop needs it.

      Returns boolean

    • Attempt to recover from errors during parsing.

      Parameters

      • func: () => any

      Returns any