Alhadis / language-grammars

Syntax highlighting for ABNF/BNF/EBNF, Yacc, and other language-related languages.
https://atom.io/packages/language-grammars
ISC License
19 stars 5 forks source link

ebnf.cson has invalid regexes #6

Closed lildude closed 3 years ago

lildude commented 3 years ago

👋 I'm in the process of updating the grammars for v7.15.0 and noticed the source.ebnf grammar now has invalid regexes:

- [ ] repository `vendor/grammars/language-grammars` (from https://github.com/Alhadis/language-grammars) (2 errors)
    - [ ] Invalid regex in grammar: `source.ebnf` (in `grammars/ebnf.cson`) contains a malformed regex (regex "`"(?!")|(?=^\s+*\S+?\s+::{0,2}=\s`...": nothing to repeat (at offset 14))
    - [ ] Invalid regex in grammar: `source.ebnf` (in `grammars/ebnf.cson`) contains a malformed regex (regex "`'(?!')|(?=^\s+*\S+?\s+::{0,2}=\s`...": nothing to repeat (at offset 14))
Alhadis commented 3 years ago

Oops. I never noticed the +* mixup locally, because it seems like Oniguruma (used in Atom) fixed it on-the-fly:

λ language-grammars (master): irb
>>  /"(?!")|(?=^\s+*\S+?\s+::{0,2}=\s|\s+\|)/
(irb):1: warning: nested repeat operator '+' and '*' was replaced with '*' in regular expression: /"(?!")|(?=^\s+*\S+?\s+::{0,2}=\s|\s+\|)/

Not cool.