I have Smalltalk sublime-syntax file (YAML) for Sublime Text 3 and I would like to add an highlighting support for embedded C code.
The inline C
(which always starts with ^%\{
and ends with %\}$
) code among the smalltalk code.
A simple example (not much C
but wanted a simple case):
sigABRT
"return the signal number for SIGABRT - 0 if not supported by OS
(the numeric value is not the same across unix-systems)"
%{ /* NOCONTEXT */
#ifdef SIGABRT
RETURN ( __mkSmallInteger(SIGABRT) );
#else
RETURN ( __mkSmallInteger(0) );
#endif
%}
!
There is new feature embed
in Sublime text (with even an example).
I tried to do something like this:
- match: '^%\{'
embed: scope:source.c
embed_scope: meta.environment.embedded.c.smalltalk source.c.embedded
escape: '%\}$'
However, I was unable to correctly incorporate it into my current highlighting file. Could someone help me with that
Does anyone know how to correctly embed one language to another?