-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update ace syntax to fix lua 5.3 bitwise op parse errors #9
Comments
I think we are up-to-date in terms of what Ace has for lua syntax. Looks to me like this would need to be fixed at the ace level (it doesn't seem like there's a https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/lua/luaparse.js#L545 |
well that is a bummer. i wonder how much effort it would be to roll our own build (with some enhancements) and then submit the changes back to the Ace repo... |
It looks like the react-ace component uses brace which embeds a version of ace (there are a bunch of commits with messages like "update to using ace 1.2.9". So I went to look there and that's how I happened upon the line above in the ace lib's lua mode files. brace seems to have its own (different?) parsing stuff...which also doesn't mention the shifting ops https://github.com/thlorenz/brace/blob/master/mode/lua.js#L139 -- Both what we'd change and how we'd roll our own is a little unclear on this one, and I feel like this one might be a bit of a rabbit-hole. Also could be totally possible I'm making this harder than it actually is. I think some further investigation could be good, but unfortunately, I don't think this one is going to be as easy as bump the package.json version :/ |
doing a bit more digging, i think the bit we want to see update is https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/lua/luaparse.js#L544-L546 (EDIT: @jlmitch5 already noted this... consider it doubly confirmed! 😀) |
i think the fix is actually easy; the tough part is integrating it. (i'm looking at #78 which is harder than you'd think 😬; in this case, we'd have to clobber the custom worker that does the annotating and replace it with our own that uses a modified parser. investigating.) |
Another 5.3 feature that Ace doesn't handle correctly is the (Mainly mentioning this here so if someone else searches for this error, this issue is more likely to come up.) |
At this point I’d be happy to just maintain a local fork of the lua syntax if someone could figure out how to get ace to load it instead of the built in. |
I'm wondering if this would be a solution, found from the Ace website: Configure dynamic loading of modes and themesBy default ace detcts the url for dynamic loading by finding the script node for ace.js. This doesn't work if ace.js is not loaded with a separate script tag, and in this case it is required to set url explicitely
Maybe we could create a fork on github like suggested above, and just point the config there? |
hey @tlubke. i would love if this turned out to be possible. TBH i can't recall if i tried but it sure feels promising. as for the syntax fixes proper, i'm happy to help shepherd them in (and really we should just upstream them while we're at it). cheers! |
(oh wait, i'm remembering now: maybe this is not as straight-forward because ace is bundled in a react wrapper?) |
...oldest ticket on the list, back from the dead. on a whim i looked to see if the
i'm going to push forward and see if i can get the maiden's dark mode working as well. |
seems to be using an earlier version of lua. for example, sees bit shifting as an error.
The text was updated successfully, but these errors were encountered: