If I try to add a keyword in filetypes.langage.conf who start by the symbol, @, he will not be colored. For example, the Zig language use builtins function who start by @, but I can't color them. I used C coloration as base for custom Zig coloration, but with Rust lexer and tag parser, maybe a ctag problem ? I don't know. I join my configuration file if you want to try. [filetypes.ZigBasicSupport.zip](https://github.com/geany/geany/files/14948356/filetypes.ZigBasicSupport.zip) And also, is it possible to define a coloration for every u or i followed by a number ? Zig can use them to specify any size of integer.
who start by @, but I can't color them.
The Rust lexer does not detect them as identifiers, its identifier code is:
```c++ static bool IsIdentifierStart(int ch) { return (IsASCII(ch) && (isalpha(ch) || ch == '_')) || !IsASCII(ch); }
/* This isn't quite right for Unicode identifiers */ static bool IsIdentifierContinue(int ch) { return (IsASCII(ch) && (isalnum(ch) || ch == '_')) || !IsASCII(ch); } ```
That is because Rust doesn't allow identifiers to start with `@`
And also, is it possible to define a coloration for every u or i followed by a number ?
That matches the definition of identifier above, so any that exist in one of the keyword lists will be styled for that list, but not any u or i followed by a random number.
but with Rust lexer and tag parser, maybe a ctag problem ?
You are running into the problem with custom types, lexers and tag parsers are intended for a specific language and will only work for a custom type to the extent that your language is the same. Colouring is not a ctags problem, but symbols in the sidebar will be.
Closed #3830 as completed.
Thanks for your very clear answer. So, if I want to color correctly Zig, I have to write a specific lexer. Because it is not a bug but just me who want to do what I can't do, I close it.
github-comments@lists.geany.org