syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Tokenizer: Pass matched RegExp groups as variables

Open DmitrySoshnikov opened this issue 9 years ago • 0 comments

Currently there is no way to refer a specific matched group in the lex rule handler. We need to support them as variables: $1, $2, etc. Example:

[`\\n( *)`, `yytext = $1; return 'INDENT'`]

DmitrySoshnikov avatar Jan 05 '17 08:01 DmitrySoshnikov