Apologies for the somewhat vague topic. I am developing a loosely lisp language, and have added basic highlighting for it in a modified tmLanguage file. What I’m trying to do is highlight these separately:
1 - keywords: define, lambda etc
2 - function calls: hash etc
3 - parentheses
(define moo (lambda ...)
(hash "somestring")
(moo ...)
In the above example, I would like the parens to be one colour, the keywords to have their own colour, and the calls to hash/moo to have their own colouring as well (donsn’t need to recognise that moo is a defined function, just that it’s the first thing to come up after the paren
Now I tried a simple
\(\b([A-Za-z_.]*)
and that happily finds the function call examples, as long as it’s above the check for parens. However, it matches the paren too. It also clobbers the keywords regardless of where I put them in order in the file.
I’m hoping that if I can do the match but return only the matched text (excluding the paren), then that should allow me to keep the paren / keyword matching intact - or should I be looking elsewhere?