cis-ash / TEXTREME

MIT License
750 stars 41 forks source link

RegEx Syntax #5

Open WilliamRagstad opened 5 years ago

WilliamRagstad commented 5 years ago

You should have support for RegEx when defining a syntax, this would make the creation of complex syntax highlighting easier! (Please combine this with my previous issue, aka, individual syntax files.) for example inside "/syntax/javascript.txt": /(if)(?=(\t|\x20)*(.*))/,magenta

This turns all if-statements with parentheses that may be containing code into magenta. This way would be much more dynamic than just: if,magenta

joeytwiddle commented 5 years ago

You could consider TextMate syntax definitions for this task. There are already syntax files for a lot of languages, so you won't have to recreate them. And it uses regexp! Yay?

TextMate syntax is used in TextMate of course, and VSCode, and you can import TextMate syntax files into Atom.

That's all I know. https://www.google.de/search?q=textmate+syntax+parser

benjhar commented 4 years ago

The way that TEXTREME currently highlights syntax does not support regex, only string keywords, so this would require a (few) custom function(s) to implement regex.