sbnf
sbnf copied to clipboard
A BNF-style language for writing sublime-syntax files
From searching around it seems like Sublime's regex engine is probably implemented this way on purpose for performance reasons, but then this makes me wonder how to do what the...
I was experiencing some strange issues trying to build a syntax, and narrowed it down to this example grammar. The only thing it recognizes are "import statements", which are the...
Currently, literals accept options such as scope names, but rules don't. Seems like an omission. It would be very useful to define a rule and instantiate it with different scopes...
Allows using visually descriptive symbols to convey meaning that's very obvious like ``` ± = '[+-]' # sign regex S± = 'keyword.operator.arithmetic' # scope for ↑ ``` and then have...
Currently SBNF doesn't seem to support inheritance or imports between syntaxes (unlike `.sublime-syntax` with `extends`). For some syntaxes, this would be quite a useful feature. Currently SBNF requires all definitions...
Given the mandate of UPPERCASE for the vars, these should add more benefits - like allowing using them within`{scope}` without having to `{#[INTERPOLATE]}` ``` main : ( ~( foo |...
> SBNF ... Due to the complexities of regex, a branch point is only created with equivalent regexes. Could an alternative solution to manually fixing the regexes to be equivalent...
``` main : (~test )* ; test {#[ZO]} : '"' ~ '"' ; # scope applied test {#[ZO]} : '"' ~ '"' | '"'{#[Z]}; # branching, scope NOT applied to...
I've been bitten by the inability to use rules in regexes, requiring to fallback to a composition of literal regexes https://github.com/BenjaminSchaaf/sbnf/issues/12, also read a couple of more tangenially related issues...
For some recursive or mutually recursive rules, the resulting code has redundancies that a human-written version wouldn't have. Unfortunately I'm too inexperienced to tell whether it's SBNF or my rules....