Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oh hell yeah. Stoked to see something like this in TS. I enjoy making a toy DSL here and there, but it's a lot of friction to relearn Lex and Yacc every time. The editor looks great too, really like the visualizations.

For anybody already using this, what's your workflow like for getting from this to IDE syntax highlighting?



I experimented with an Ohm/CodeMirror bridge that would map an Ohm grammar to CodeMirror classes for marks and syntax highlighting.

It might be an interesting starting point for you: https://observablehq.com/@ajbouh/editor


The last time I needed a parser that supports lex/yacc experience, jison https://gerhobbelt.github.io/jison/docs/ worked fine for me.

I don’t find PEGs more useful or clear, tbh. Mostly because how precedence works.


I could swear I recently saw an article about a peg-tool that came with lsp support - sadly I can't find it. The closest I come is pest which has an ide-tools crate and some plugins for lsp/ide/editor support:

https://github.com/pest-parser


I have been on the lookout for something that code help me with Jinja files and it seems like a plausible candidate. Extra bonus points if I could actually embed the Python in the same grammar but at this point even having the code blocks segregated from the literal parts is a good start

https://pest.rs/?g=N4Ig5gTghgtjURALhAMwJYBsCmACAvLsLgMoDyAkr...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: