You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably a fairly complicated task, but an immensely useful one.
A tool for the syntax highlighting must be chosen. Mindcode grammar is primarily defined in ANTLR4 format, so a tool that would be capable of using this format directly would be strongly preferred. If that's not possible, we'll create a separate definition for the syntax highlighting in any other format that would be needed.
The text was updated successfully, but these errors were encountered:
I believe the easiest way of doing this is by using a code editor library, which enables syntax highlighting as well as other features like autocompletion.
The three libraries that I found adequate for this are:
CodeMirror. I have been experimenting with this one to make a playground for mlogls
Monaco Editor. This is the one mlogjs uses for its editor
Ace Editor. I am only aware that this one exists, never used it though
Out of all of them I would recommend CodeMirror, since it has very good mobile support (Monaco doesn't) and is very lightweight as well.
According to the documentation the preferred way to do syntax highlighting is by writing a lezer grammar since those support incremental parsing, but this article also contains a demonstration on how to integrate antlr grammar with codemirror.
Thank you a lot! At a quick glance, CodeMirror looks promising. I think the ANTLR grammar could be rewritten in the lezer grammar, although it will be some work. I'll try it out.
This is probably a fairly complicated task, but an immensely useful one.
A tool for the syntax highlighting must be chosen. Mindcode grammar is primarily defined in ANTLR4 format, so a tool that would be capable of using this format directly would be strongly preferred. If that's not possible, we'll create a separate definition for the syntax highlighting in any other format that would be needed.
The text was updated successfully, but these errors were encountered: