Class Token

Constructors

Accessors

Methods

Constructors

  • Parameters

    • type: TokenType

      The type of the token

    • value: any

      The value of the token

    • line: number

      The line where the token is located in the source

    • column: number

      The column where the token is located in the source

    Returns Token

Accessors

  • get column(): number
  • Return the column where the token is located in the source.

    Returns number

  • get line(): number
  • Return the line where the token is located in the source.

    Returns number

  • get value(): any
  • Return the value of the token.

    Returns any

Methods

  • Serialize the token to a Twig source.

    Returns string

  • Test the token for a type and/or a content.

    Parameters

    • type: TokenType
    • value: string | number | string[] = null

    Returns boolean

  • Return the human-readable representation of the token.

    Returns string