-
Notifications
You must be signed in to change notification settings - Fork 57
JavaScriptNext language doesn't work #77
Comments
first-mate doesn't support |
@thomasjo That's actually what I do - I load my grammar via let grammar = grammarRegistry.createGrammar(null, plist.parse(grammarString));
grammarRegistry.addGrammar(grammar); Unfortunately, it then fails to properly tokenize my lines :( |
I've been able to track down the issue to this regexp (and others similar): (?x)
!(?!=)| # logical-not right-to-left right
\|\| | # logical-or left-to-right both As you can see, these regexp have a trailing pipe that make them match everything. I'm not sure what to do - on one hand, it's obviously a coding mistake to leave this trailing pipe, but on the other hand it seems to work fine with both SublimeText and TextMate (I guess they discard every matching rule with 0-tokens as "not matching"), on a quite popular grammar. What do you think? |
Related issue on VSCode side: microsoft/vscode-textmate#9 |
My bad, the issue is actually in the YAML files themselves. |
@bottleofwater I ran into the exact same issue. Removing the trailing |
Answering my own question, this line seems to have been the other problem, though I'm still not sure why. It contains this regex: (?<!\.)\b(exports|module(?:(\.)(children|exports|filename|id|loaded|parent)))?\b (note that I'm working with a fork of the repo @bottleofwater is using) |
It's effectively matching |
I've also been faced with this issue, so I've opened a PR here: babel/babel-sublime#303 I'll backport your fix there, but I encourage you to manifest your interest for merging this feature in the upstream repository - I haven't had any feedback yet :( |
I've tried feeding the following file into FirstMate, but unfortunately it fails with the following message (one for each line in the source code):
What happens? Is there an incompatibility between FirstMate and some grammars?
The text was updated successfully, but these errors were encountered: