-
Notifications
You must be signed in to change notification settings - Fork 57
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
1 Language Grammar to Rule Them All #222
Comments
Possibly related to #220 |
@konsumer If the "grammar" you're talking about is just the lexical contents (i.e., highlighted tokens), I suppose it's quite easy to write a CodeMirror syntax definition file by hand. If you find a syntax definition file for Go, its adaptation for Umka will be straightforward. Having a set of syntax definition files in Umka distributions would be a plus, but only for the most popular editors, like VSCode, Sublime Text, or Vim. If the "grammar" is a set of syntactic rules, it's defined in the EBNF form in the language specification: https://github.com/vtereshkov/umka-lang/blob/master/spec.md#appendix-language-grammar |
My thinking is a central format that can produce other formats. For example, I want codemirror live-web-editor for umka (for playground) but I'd need to make the grammar for that by hand (which I am not great at.) I also think it would be useful to have vscode, sublime, etc. If it was all made from the same syntax-hilighting grammar source, we could keep that high quality, and just generate whatever was needed for lots of different targets. |
I completely agree |
that said, EBNF format seems enough |
I'll write a converter application |
Yep, agreed, I didn't know about this when I initially asked. I guess all I mean is "let's not maintain like 5 separate grammars, let's make a central one that can be converted into the others programmatically."
Lemme know if I can help. If you can generate a few good ones, I can probly port that to codemirror and ace. Having syntax-hilighting in playground would be sick! |
I would really like to make a live, syntax-highlighting web editor for umka, but I need a grammar definition for codemirror (or any other similar editor.)
I saw the sublime language file, and tried it in sublime (pretty decent) and the textmate grammar file in the VSCode plugin, and the vim def but none of the automatic converters I found worked with those.
I think a central simple format that can convert to other things like this would make it easier to generate grammars for other things, and here is a nice live-editor for the grammar, but I think it's a bit beyond me.
Related comic:
![XKCD Standards](https://camo.githubusercontent.com/5cfeabd464c5831016375c3d4905df5e7577b5e5dbcb4b4c2f72caf01ef16619/68747470733a2f2f696d67732e786b63642e636f6d2f636f6d6963732f7374616e64617264735f32782e706e67)
The text was updated successfully, but these errors were encountered: