cpp lexer adjustments #111
-
I'm trying to make some adjustments to the cpp lexer and ran into some problems. I'd like to remove the highlight for Related to this question, I also want to highlight custom types at the end of a scope chain. E.g. in lex:add_rule('custom_type', lex:tag(lexer.TYPE .. '.custom', '::' * lexer.word * -S('(:'))) The problem is that this also matches the leading Some other questions that might make sense for the default lexer as well.
Lastly, are there still plans to use treesitter over or maybe alongside lua lexers? @orbitalquark |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To match 'std::' but not highlight it, you could do something like this:
For the related question, maybe
? I'm not sure I understand exactly what you're trying to do. You can highlight angle braces using
(Basically, overriding https://github.com/orbitalquark/textadept/blob/81180915559448f60101f1d3da61819b40591e83/modules/textadept/editing.lua#L104-L110) It would be nice to highlight As for treesitter, I experimented with Scintilla and treesitter (https://github.com/orbitalquark/tslexia), but nothing has come of it. A majority of compiled grammar shared objects are larger than 1MB in size each. Compare that to Scintillua lexers, which are between 1-5KB on average. All 100+ of them cumulatively total 1MB in size. Once I realized this, I kind of lost interest in trying to further explore this. Also, last I checked, developing and compiling treesitter grammars requires node.JS, which feels so dirty. |
Beta Was this translation helpful? Give feedback.
To match 'std::' but not highlight it, you could do something like this:
For the related question, maybe
? I'm not sure I understand exactly what you're trying to do.
You can highlight angle braces using
lexer.property['scintillua.angle.braces'] = '1'
as you've found. You can disable auto-pairing by adding to your ~/.textadept/init.lua:(Basically, ov…