Closed Simran-B closed 7 years ago
Closing this issue now. The new aql editor (3.1 and 3.0) offers syntax highlighting and also visualizes error locations.
What we have is probably sufficient. The notion of this issue was that sometimes the highlighting is not quite correct, e.g. the first count
should be blue because it is part of a language construct, but the second one is actually a variable name:
BTW: it would be great to have AQL grammer support for syntax highlighting in the documentation, using JS only works very limited.
My personal opinion is that the syntax highlighting we have is not perfect, but good enough. Maintaining the AQL grammar in the front end as a JavaScript version is probably not worth the trouble.
It would be good if we could generate standalone grammar files from the Bison grammar that we have, and use this standalone grammar for arbitrary syntax highlighters.
Gitbook seems to use Highlight.js for syntax highlighting, language definition guide: http://highlightjs.readthedocs.io/en/latest/language-guide.html
Jison is basically Bison/Flex for JavaScript and seems to use a very similar if not the same syntax: http://zaa.ch/jison/docs/
I wonder if we could use it for syntax highlighting in the web frontend. It would certainly require some work, because of the C++ coded logic in the grammar, but maybe we can just ignore that to some degree. We would need to port logic still, if we want to offer linting or similar.