-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Visualizer: Shareable grammars as URL #58
Comments
+1 |
Done. Give it a try and let me know what you think! |
Wow! First report: It completely crashed my (Chrome) browser! All the windows, all tabs (100+). :-/ |
Oh, btw. I always like a "default grammar" when you came to the visualizer instead of an empty canvas. |
Well, and the encoding for the URL is somewhat verbose. One character - in example or grammar - results in ~4 characters in the URL. Not that pleasant for (real) grammars like ES5, etc. |
Uh...very weird. I did test with the ES5 grammar and a very large input string, no problems. And it should be totally ignoring your grammar in localStorage...I decided not to try to load them, because it would just be some code that would be temporary that we'd want to delete later...and I figured it wasn't worth it. |
This reverts the changes made for #58. The feature didn't seem to work properly in Firefox or Safari, probably due to the ridiculously long URLs that were generated (the ES5 grammar is ~23k chars long).
Re-opening as the previous fix didn't work properly in Firefox and Safari. Given the length of some "real" grammars (e.g., the ES6 grammar is >23k chars), we will probably need to implement this with a real backend. |
It's nice that the visualizer currently remembers the lasted grammar I worked on and the example I used with it (in local storage).
I would love to see a generated URL in the style of:
http://esprima.org/demo/parse.html?code=var%20my%20%3D%20Grammar%3B
(I would rather like to see
#
instead of?
but that's the general idea)to share my grammar (and examples) with others and remember multiple grammars in my bookmarks. It's also a neat thing when reporting bugs for Ohm.
The text was updated successfully, but these errors were encountered: