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

Interesting. You should look into adopting Lpeg to do your syntax parsing and coloring, rather than defining all languages yourself.

http://www.inf.puc-rio.br/~roberto/lpeg/

http://peterodding.com/code/lua/lxsh

http://foicica.com/scintillua/

http://leafo.net/guides/parsing-expression-grammars.html



Belated update, but thanks for the tip.

In the end I did indeed add syntax-highlighting via the use of the LPEG library.


As another person writing an Emacs-like Lua-based fork of antirez's original text editor, I'm not convinced that's the right way to go. The vast majority of language definitions will work fine with antirez's much simpler solution. And even if something more complex is needed, I'm not sure that requiring language authors to learn LPeg is a good idea.




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

Search: