I’m expanding the the C++ syntax highlight with new functions, classes, constants, etc. I’m following this guide because I haven’t experience with this topic.
I’m matching the new words like this:
match: \b(send|on)\b
scope: entity.name.function.c++
But, if my file has comments with that words, they will be colored too.
how can avoid this?
This is how my syntax file looks like
%YAML 1.2
---
name: newsyntax
file_extensions: [ino, pde]
scope: source.dino
contexts:
main:
- match: ''
push: Packages/C++/C++.sublime-syntax
with_prototype:
- match: \b(HIGH|LOW|INPUT|OUTPUT|INPUT_PULLUP|LED_BUILTIN)\b
scope: constant.language.c++
- match: \b(boolean|word|String|string|array|byte)\b
scope: storage.type.c++
- match: PROGRAM
scope: storage.modifier.c++
- match: \b(Serial|Stream|Keyboard|Mouse})\b
scope: entity.name.class.c++
- match: \b(send|on)\b
scope: entity.name.function.c++