I’m trying to create a basic syntax highlighting to work with Laravel Blade template language (on top of HTML language). Found just an example how to create some custom highlighting using MatchDecorator, but it’s too simple for what I need.
I think I understand the way MatchDecorator works, but I need an advice for a more complex usage.
Let’s say I need to highlight this string:
@if ( $value === 'something' )
I want to highlight @if / $value / ‘something’ using different classes (colors). Is it possible to achieve it using one single MatchDecorator, or what is the right way in CM6 to do it? Create multiple MatchDecorators with different regular expressions and somehow combine it into a single ViewPlugin?
What I have right now is a single MatchDecorator that is able to highlight @if using a tags.typeName class (so I’m using the built-in classes), but I’m stuck because I can’t find any other example how to create more complex highlighting.
Thanks for any advice.