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

Add support for ignoreCase attribute for StringLiterals #22

Closed jsm174 closed 4 years ago

jsm174 commented 4 years ago

This PR is related to https://github.com/lys-lang/node-ebnf/issues/17 + https://github.com/lys-lang/node-ebnf/issues/20. It adds support for an ignoreCase=true attribute for StringLiterals.

Keyword ::= 'And' | 'Or'

generates the following regexps:

\A\, \n\, \d\ and \O\, \r\

Keyword ::= 'And' | 'Or' {ignoreCase=true}

generates the following regexps:

\[Aa]\, \[Nn]\, \[Dd]\ and \[Oo]\, \[Rr]\

menduz commented 4 years ago

Thanks!

jsm174 commented 4 years ago

Awesome. Will this be ebnf@1.7.2?

menduz commented 4 years ago

ebnf@1.7.3