-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Playground not working with "Uncaught TypeError: tree is not defined" #1300
Comments
I've tried setting up a playground with a very simple test grammar, and it works, so it's something unique to my grammar which is causing the issue. |
Even if I make my top-level rule something simple, like |
I've isolated the issue to my external scanner. If I remove all external scanner symbols from my grammar and move/delete the scanner.cc file out of the src directory, then the playground starts up and works without error. I can get a playground working with a simple test grammar + small external scanner, so there's something unique to this grammar's external scanner that is messing things up. |
Yeah, there are some limitations to how dynamic linking works with Emscripten, so the core library ( |
Thanks @maxbrunsfeld, removing the dependency on |
Actually it does work to start, but stops at a certain point. I get this error now:
My changes are in this branch; to repro:
|
For ease of repro, I've now set up a github page with the playground: https://tlaplus-community.github.io/tree-sitter-tlaplus/ |
All right I completely rewrote how my lexer works in my external scanner (now looks very similar to the auto-generated lexer) and somehow that fixed the issue. I don't know why. Maybe the old lexer used some newer C++ features that didn't play well with emscripten. You can see the changes to scanner.cc in this commit. |
- resolved issues encountered in tree-sitter/tree-sitter#1300 - refactored external scanner lexing code to resemble auto-generated lexing code - wrote short README - set up resources for hosting playground on github pages, see tree-sitter/tree-sitter#1299
I've been trying to get the playground to work with my grammar but when the web UI pops up in Firefox or Chrome I just get this error and nothing works:
If I type then I get this error over & over:
Am I doing something obviously wrong?
Version Info:
The text was updated successfully, but these errors were encountered: