ebnf-parser
ebnf-parser copied to clipboard
Allow leading underscores?
I noticed that lex-parser allows leading underscores in names, but ebnf-parser doesn't. Is it intentional that nonterminal names shouldn't be able have leading underscores?
AFAICT: no.
It's probably a slip-up in keeping the various lexers & parsers in sync: there's a similar 'problem' (you almost never encounter it, until...) with grammar tokens being allowed to end with a - hyphen according to some regexes, then not to some others.
Related material (WARNING these are commit refs in my fork; some (for possibly large sums of 'some' ;-) ) of the bugs mentioned there do not manifest in the mainline; nevertheless... there's quite a bit of overlap too):
- SHA-1: 35b2fcc1620f62e42c3fe961a8cbf42e9df5a309 * unify IDs vs. NAMEs across the board: IDs are
[a-zA-Z_][a-zA-Z0-9_]*while NAMES are that too, but also accept '-' in the middle, e.g.a_bis an ID (and a NAME), whilea-bis a NAME, but not an ID.$names are ID-based as they appear inside code so allowing a '-' in there would be confusing as it would permit $ labels like this one:$a-1which is a legal NAMEa-1rather than being read as expression$a - 1 - SHA-1: a0987b161ca360cd89e2a271f7bf435d7b7aa155 * Allow for leading underscores in identifiers
(Last commit there was merged from you yourself)
@GerHobbelt It's true that that last commit is from me, but it's not in this logical repository; it's only present in my fork.