I have a custom Perl syntax file for Sublime Text 3 and I would like to add an highlighting support for embedded C++ code.
The inline C++ code always starts with __CPP__ and ends with __END__ among the perl code.
I’m using the ‘embed/match/escape’ approach but the syntax highliting of the C++ code won’t change (getting the scope with ctrl-alt-shift-p it still appears as source.perl).
Here the rule I’m using in my syntax file:
contexts:
main:
- include: inline-cpp
...lot of rules...
inline-cpp:
- match: '__CPP__'
embed: scope:source.c++
embed_scope: source.c++.embedded
escape: '__XXX__'
Please could someone help me figure out what I’m doing wrong?