Skip to content
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

Random idea: plugin to serialize moo lexers to syntax plugins for various editors #94

Open
kach opened this issue Aug 19, 2018 · 2 comments

Comments

@kach
Copy link
Collaborator

kach commented Aug 19, 2018

I did some looking and couldn't find a tool that generated syntax highlighting plugins for Emacs/Vim/TextMate/CodeMirror/Atom/your-favorite-editor-here. It would be neat if you could take an existing moo lexer, maybe add some config, and suddenly get plugins for a bunch of editors.

Based on some quick reading, most editors have a similar format for specifying syntaxes. But there are a few gotchas that might make this infeasible (e.g. Vim doesn't support states as far as I can tell, whereas Emacs has a messy special-cased configuration for multiline comments/strings).

@prodrammer
Copy link

I found this recently: https://eeyo.io/iro/

@mattfysh
Copy link

I'm going through this exercise now, manually converting a moo-based lexer into a textmate grammar - and it does not appear that this is something you could automate. The textmate grammars don't just tokenize, but they also need the grammar rules e.g. your mylang.ne file if using nearley.js

Take a look at this javascript textmate grammar for vscode 😳
https://github.com/microsoft/vscode-textmate/blob/main/benchmark/JavaScript.tmLanguage.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants