Interface IndentationTokenBuilderOptions<TerminalName, KeywordName>

interface IndentationTokenBuilderOptions<TerminalName, KeywordName> {
    dedentTokenName: TerminalName;
    ignoreIndentationDelimiters: IndentationAwareDelimiter<TerminalName | KeywordName>[];
    indentTokenName: TerminalName;
    whitespaceTokenName: TerminalName;
}

Type Parameters

  • TerminalName extends string = string
  • KeywordName extends string = string

Properties

dedentTokenName: TerminalName

The name of the token used to denote deindentation in the grammar. A possible definition in the grammar could look like this:

terminal DEDENT: ':synthetic-dedent:';
'DEDENT'
ignoreIndentationDelimiters: IndentationAwareDelimiter<TerminalName | KeywordName>[]

The delimiter tokens inside of which indentation should be ignored and treated as normal whitespace. For example, Python doesn't treat any whitespace between ( and ) as significant.

Can be either terminal tokens or keyword tokens.

[]
indentTokenName: TerminalName

The name of the token used to denote indentation in the grammar. A possible definition in the grammar could look like this:

terminal INDENT: ':synthetic-indent:';
'INDENT'
whitespaceTokenName: TerminalName

The name of the token used to denote whitespace other than indentation and newlines in the grammar. A possible definition in the grammar could look like this:

hidden terminal WS: /[ \t]+/;
'WS'