From dd7157447b9c5f23d14fb1c2809ea8504a1dc6c6 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 3 Sep 2008 12:00:26 -0400 Subject: [PATCH] Support &=, !=, &==, and !== notations --- syntax/haml.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/syntax/haml.vim b/syntax/haml.vim index 395600a..04457be 100644 --- a/syntax/haml.vim +++ b/syntax/haml.vim @@ -24,7 +24,7 @@ syn cluster hamlComponent contains=hamlAttributes,hamlClassChar,hamlIdChar,ha syn cluster hamlEmbeddedRuby contains=hamlAttributes,hamlObject,hamlRuby,hamlRubyFilter syn cluster hamlTop contains=hamlBegin,hamlPlainFilter,hamlRubyFilter,hamlSassFilter,hamlComment,hamlHtmlComment -syn match hamlBegin "^\s*[<>&]\@!" nextgroup=hamlTag,hamlAttributes,hamlClassChar,hamlIdChar,hamlObject,hamlRuby,hamlPlainChar,hamlInterpolatable +syn match hamlBegin "^\s*\%([<>]\|&[^=~]\)\@!" nextgroup=hamlTag,hamlAttributes,hamlClassChar,hamlIdChar,hamlObject,hamlRuby,hamlPlainChar,hamlInterpolatable syn match hamlTag "%\w\+" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent syn region hamlAttributes matchgroup=hamlAttributesDelimiter start="{" end="}" contained contains=@hamlRubyTop nextgroup=@hamlComponent @@ -37,10 +37,11 @@ syn match hamlClass "\%(\w\|-\)\+" contained nextgroup=@hamlComponent syn match hamlId "\%(\w\|-\)\+" contained nextgroup=@hamlComponent syn region hamlDocType start="^\s*!!!" end="$" -syn region hamlRuby matchgroup=hamlRubyOutputChar start="[=~]" end="$" contained contains=@hamlRubyTop keepend -syn region hamlRuby matchgroup=hamlRubyChar start="-" end="$" contained contains=@hamlRubyTop keepend +syn region hamlRuby matchgroup=hamlRubyOutputChar start="[!&]\==\|\~" end="$" contained contains=@hamlRubyTop keepend +syn region hamlRuby matchgroup=hamlRubyChar start="-" end="$" contained contains=@hamlRubyTop keepend syn match hamlPlainChar "\\" contained -syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="==" end="$" keepend contained contains=hamlInterpolation +syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="!\===" end="$" keepend contained contains=hamlInterpolation,@hamlHtmlTop +syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="&==" end="$" keepend contained contains=hamlInterpolation syn region hamlInterpolation matchgroup=hamlInterpolationDelimiter start="#{" end="}" contained contains=@hamlRubyTop syn region hamlErbInterpolation matchgroup=hamlInterpolationDelimiter start="<%[=-]\=" end="-\=%>" contained contains=@hamlRubyTop