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

interactive feedback on currently open grammar file ? #2

Open
asmodehn opened this issue May 21, 2018 · 2 comments
Open

interactive feedback on currently open grammar file ? #2

asmodehn opened this issue May 21, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@asmodehn
Copy link

Would it be feasible to add a feature for the user to check his grammar in the editor ?

I am thinking something along the lines of https://omrelli.ug/nearley-playground/
that provides an interactive feedback to the user creating a grammar, via examples.
Or maybe being able to use the lark for syntax highlighting in other open files...

Of course, many kind of visualisations are possible (showing parse trees, etc.).
The point here is to get some bare minimum of interactive feedback directly in the editor, without having to code anything.

@danmou
Copy link
Member

danmou commented May 21, 2018

I think what you're suggesting with using a lark grammar for syntax highlighting in another file would be a very nice feature, but right now this package just contains a simple definition of the lark syntax. What you're proposing would require actually running lark on the test file and then somehow bypassing Sublime's own syntax highlighting. Another option would be attempting to convert the lark grammar into a Sublime syntax definition and applying that syntax to the test file, but I think that conversion would be quite difficult.

Regarding the other suggestions, automatically generating examples and such, it wouldn't really need to be a Sublime-specific feature so I would suggest asking in the main lark repository to see if anyone has any good ideas.

@asmodehn
Copy link
Author

Given that this repo is about sublime, we should probably focus this issue on the "cleanest" option :

Another option would be attempting to convert the lark grammar into a Sublime syntax definition and applying that syntax to the test file, but I think that conversion would be quite difficult.

It would be indeed a nice feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants