Is it me or it is not possible to match indentation levels in the syntax of a language ?
For instance, I have an indentation-based language like HaML that has the following form:
@div.myclass Hello
:css
#mystuff { color: #fff }
@div.morestuff
More stuff here !
I would like to display the #mystuff part with css, which imposes-me to match a region starting by :css and ending at the next same-or-less indentation level.
I have tried stuff like begin: “(\s+):css” and end: “\1^\s]”, but it has numerous problems : it won’t detect a sudden de-indent and the first letter of the next line is eaten by the matcher, preventing @div from being matched.
How can I achieve that ?