Skip to content

RegExp: Nested subtractions are translated wrongly to Alex #256

@andreasabel

Description

@andreasabel

LBNF does not support nested subtraction in regexps, like in

token Name (char - [ "(){};.@\"" ] - [ " \n\t" ]) + ;

It works with parentheses:

token Name ((char - [ "(){};.@\"" ]) - [ " \n\t" ]) + ;

This is translated to Alex as

(($u # [\( \) \{ \} \; \. \@ \"]) # [\  \n \t]) +

which is rejected by Alex. However, Alex supports it without parentheses:

($u # [\( \) \{ \} \; \. \@ \"] # [\  \n \t]) +

Both BNFC and Alex are behaving silly here, I must say.

Metadata

Metadata

Assignees

Labels

HaskellLBNFConcerning the LBNF syntax and its checkingbuglexerConcerning the generated lexer

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions