Class TokenUcrx

Charge receiver that always accepts all values.

Hierarchy

  • TokenUcrx

Implements

Constructors

Accessors

Methods

Constructors

Accessors

Methods

  • Parameters

    • value: unknown
    • mode: UctxMode = UctxMode$Default
    • encodeString: ((token) => string) = encodeURIPart
        • (token): string
        • Parameters

          • token: string

          Returns string

    Returns undefined | string

  • Charges big integer value.

    Typically called from raw when the raw value interpreted as bigint, i.e. when it starts with 0n or -0n prefix.

    Parameters

    • value: bigint

      Charged value.

    Returns 1

    Either 1 if charge succeed, or 0 for unexpected big integer.

  • Charges boolean value.

    Called directly for true value (!), or from raw when the raw value interpreted as false, i.e. it is -.

    Parameters

    • value: boolean

      Charged value.

    Returns 1

    Either 1 if charge succeed, or 0 for unexpected boolean.

  • Finishes list charge.

    Always called after and call(s).

    May also be called for single values. I.e. without preceding call to and. This is not guaranteed though.

    Returns void

  • Charges opaque (unrecognized) entity.

    Called for unhandled entities.

    Parameters

    • name: string

      Charged entity name.

    Returns 1

    Either 1 if charge succeed, or 0 for unexpected entity.

  • Charges opaque (unrecognized) formatted data.

    Parameters

    • format: string

      Charged data format name.

    • data: readonly UcToken[]

      Charged data tokens.

    Returns 1

    Either 1 if charge succeed, or 0 for unexpected data.

  • Called to start inset tokenization.

    Parameters

    • id: string | number

      Inset format identifier.

    • emit: ((token) => void)

      Emitter function called each time a token is found.

        • (token): void
        • Parameters

          Returns void

    Returns UcLexer

    Either input lexer, or undefined if inset is not expected..

  • Finishes map charge.

    Called after all map entries charged, unless the map is empty.

    The returned 0 makes sense for empty maps only. Otherwise, a preceding call to for has to return 0, which prevents the map charge.

    Returns 1

    1 if charge succeed, or 0 for unexpected map.

  • Charges null value.

    Typically called from raw when the raw value interpreted as null, i.e. when it is --.

    Returns 1

    Either 1 if charge succeed, or ``0for unexpectednull`.

  • Charges number value.

    Typically called from raw when the raw value interpreted as number, i.e. when it starts with digit.

    Parameters

    • value: number

      Charged value.

    Returns 1

    Either 1 if charge succeed, or 0 for unexpected number.

  • Charges raw value.

    In contrast to str method, this one is called for strings that look like numbers or start with hyphen ("-" (U+002D)).

    By default, calls big, bol, nul, num, or str depending on value prefix.

    Parameters

    • value: string

      Charged value.

    Returns 1

    Either 1 if charge succeed, or 0 for unexpected number.

  • Charges string value.

    Always called directly for quoted strings. May be called from raw, unless the raw value interpreted otherwise.

    Parameters

    • value: string

      Charged value.

    Returns 1

    Either 1 if charge succeed, or 0 for unexpected number.

Generated using TypeDoc