Options
All
  • Public
  • Public/Protected
  • All
Menu

twig-lexer

Index

Variables

Const bracketPairs

bracketPairs: [string, string][] = [['(', ')'], ['{', '}'], ['[', ']']]

The characters pairs recognized as brackets.

Const doubleQuotedStringContentPattern

doubleQuotedStringContentPattern: string = "[^#"\\]*(?:(?:\\\\.|#(?!{))[^#"\\]*)*"

The regular expression pattern used to identify a double quoted string content.

Const doubleQuotedStringDelimiterPattern

doubleQuotedStringDelimiterPattern: string = """

The regular expression pattern used to identify a double quoted string delimiter.

Const lineSeparators

lineSeparators: string[] = ['\\r\\n', '\\r', '\\n']

The characters recognized as line separators.

Const namePattern

namePattern: string = "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"

The regular expression pattern used to identify a name.

Const numberPattern

numberPattern: string = "[0-9]+(?:\.[0-9]+)?"

The regular expression pattern used to identify a number.

Const punctuationPattern

punctuationPattern: string = "[?:.,|]"

The regular expression pattern used to identify a punctuation.

Const stringPattern

stringPattern: string = "(")([^#"\\]*(?:\\.[^#"\\]*)*)(")|^(')([^'\\]*(?:\\.[^'\\]*)*)(')"

The regular expression pattern used to identify a string.

Const whitespacePattern

whitespacePattern: string = "[ \r\n\t\f\v]+"

The regular expression pattern used to identify a whitespace.

Functions

Const astVisitor

typeToString

  • typeToString(type: TokenType, short?: boolean): string
  • Returns the human representation of a token type.

    Parameters

    • type: TokenType

      The token type

    • Default value short: boolean = false

      Whether to return a short representation or not

    Returns string

    The string representation

Generated using TypeDoc