Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Token

Hierarchy

  • Token

Index

Constructors

Accessors

Methods

Constructors

constructor

  • new Token(type: TokenType, value: any, line: number, column: number): Token
  • constructor

    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

column

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

    Returns number

line

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

    Returns number

type

value

  • get value(): any

Methods

serialize

  • serialize(): string
  • Serialize the token to a Twig source.

    Returns string

test

  • test(type: TokenType, value?: string | string[] | number): boolean
  • Test the token for a type and/or a content.

    Parameters

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

    Returns boolean

toString

  • toString(): string
  • Return the human-readable representation of the token.

    Returns string

Generated using TypeDoc