4 ms·
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. T
by RickS 2y ago
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?
- adamb 2y agoI 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 https://observablehq.com/@ajbouh/editor
- e12e 2y agoI 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 https://github.com/pest-parser
- mdaniel 2y agoI 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=N4Ig5gTghgtjURALhAMwJYBsCmACAvLsLgMoDyAkrgH64AUALtgB4O4A%2BuAxgPYAmeTgAcI6AHYMAlACoauAKKVcAXwA6Y3gIJFcDAPoAjTDy4BrPTyHYxc8WOwRDxs3P1GT5rsYDOeWgHUACQoAFXk9EgAFAEEAYXlZNTERcTZCYn0UiQsrG1o7Bz0stlpM0WyvHl85INDwqLiElXV1JlZtDJZ9LgALAGpmiS69Xu09YgBCRicPHOt2MtS5sUk5aIA5AE1B9QLHdxd03D2ZsxH%2BwZODzx6x4nUAegfcbAA3a10engBXMFuGHrobzHYFQXAAdy%2BOFw3gY5TAuEw6CY0Ewj2eAKBuBE-G%2BXAY6B4NlhWEwuCJmAAnrh4AxethgRZ7NweggoPjCuoJm5nJ4fH5cBtNuokrsxPZHMUOsdxYViucBkkTvLRoRxrhuUVyt1%2BWstjtstdltoACTAVQgYAAUgtcgtAFoLQB%2BQY82aVaqEM0O512kBWtQgA2LbKWD5e82WyN%2Bx0gF1JEM6qp4CM%2BuN%2B5SBwYgAA0IHEQm%2BDGQIAAPD0GDBMAA%2BdTW%2B24Aw8Ay4e0Buv3EBQTBCVm2zMdhsWgzYBhggdiUsPCtV6u5kC%2BHAcvgAJW%2BOBLPxRIGUQA#editor https://pest.rs/?g=N4Ig5gTghgtjURALhAMwJYBsCmACAvLsLgMoDyAkr...
- wruza 2y agoThe last time I needed a parser that supports lex/yacc experience, jison https://gerhobbelt.github.io/jison/docs/ 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.