1

I try to inline one syntax in another syntax (to be explicit: CSS in JS template strings). I'd like to build on top of the existing CSS definitions and not create new ones.

Question: Is it possible to access previously defined syntax matches/keywords for access in other syntax definitions?




Example:

Imagine the following definition:

syn keyword cssPseudoClassId contained link visited active
syn match   cssPseudoClassId contained "\<first-\(line\|letter\)\>"

How do I access cssPseudoClassId to include it in another syntax definition to not re-write it manually.

syn region customWhatever transparent fold
        \ start=":".cssPseudoClassId end="\ze\(,\|;\|...\)"
        \ skip="\\\(`\|\$\)" ...
        \ contains=css.*Prop,...



Any other tips are highly appreciated. 😊 🙇

1
  • To resolve this particular issue I may get by, by adding cssPseudoClassId to the contains-section. But the general question would still be interesting to have answered.
    – fleischie
    Commented Sep 23, 2017 at 6:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.