Conflicts in Grammar Files (example: Jade)


This is in reference to a few bugs that cropped up in the package. After a little testing, it turns out that there is a rule inside the grammar file that, despite being later in the instructions, seems to be overriding a previous rule. I will try to dig a bit deeper, but commenting that entire rule out fixes the issues (see

Not entirely sure if this is a plugin-specific issue or something much closer to the atom core. Any suggestions??


I would suggest making tests that reproduce the issue by calling the tokenizer directly. Once the exact problem is characterized, then it’ll be easier to figure out where the place to fix it should be.

I don’t think though that one should assume that rules at the same level are applied in any particular order. I’ve never seen any documentation to that effect. It may just be that the grammar should be rewritten to make it less ambiguous.


Gotcha! I think I assumed there was an order due to it being in an array, but it makes sense to remove any ambiguity. I think it’s pulled from the original textmate bundle, so I’ll check sublime text’s version to see if any edits had to be made! Thanks.


I did a fresh conversion of the sublime text/textmate bundle found at and it came back with the same output, same ambiguity selector. Is responsible for the actual tokenization? I might check in with folks there too, see if they have any thoughts if it’s an appropriate space.


Just an FYI, I posted a request in the first-mate repo to see if those folks have any additional insight: