lys-lang / node-ebnf

Create AST PEG Parsers from formal grammars in JavaScript
https://menduz.com/ebnf-highlighter/
MIT License
104 stars 9 forks source link

Is there a plan to support difference? #24

Closed cuixiping closed 4 years ago

cuixiping commented 4 years ago

Error: Difference not supported yet

ALL_CHARS    ::= [#x20-#xffff]
NON_QUOTE  ::= ALL_CHARS - '"'

I know we can split it to two parts. But it's simpler if '-' is supported.

menduz commented 4 years ago

You can mock that behavior with a negative look ahead

ALL_CHARS    ::= [#x20-#xffff]
NON_QUOTE    ::= !'"' ALL_CHARS
cuixiping commented 4 years ago

You can mock that behavior with a negative look ahead

ALL_CHARS    ::= [#x20-#xffff]
NON_QUOTE    ::= !'"' ALL_CHARS

Thank you!