Commits

Lars Yencken committed 995f047

Correctly highlight blocks with no inputs.

Comments (0)

Files changed (1)

 syn match drakeVariableName "[a-zA-Z-_][a-zA-Z-_]*" contained containedin=drakeVariableRef
 
 " Rule blocks
-syn region drakeBlock start="[^<;, ][^<;, ]*\(, [^<;, ][^<;, ]*\)* <- [^<;, ][^<;, ]*\(, [^<;, ][^<;, ]*\)*" end="^$" contains=drakeRule
-syn match drakeRule "[^<;, ][^<;, ]*\(, [^<;, ][^<;, ]*\)* <- [^<;, ][^<;, ]*\(, [^<;, ][^<;, ]*\)*" contains=drakeTargets
+syn region drakeBlock start="[^<;, ][^<;, ]*\(, [^<;, ][^<;, ]*\)* <-" end="^$" contains=drakeRule
+syn match drakeRule "[^<;, ].* <-\( [^[<; ][^<; ]*\)*" contains=drakeTargets nextgroup=drakeDefaultShBlock,drakeShBlock,drakePyBlock
 syn match drakeTargets "[^<;, ][^<;, ]*\(, [^<;, ][^<;, ]*\)*" contained nextgroup=drakeRuleIdentifier contains=drakeString,drakeSourceSep
-syn match drakeSources "[^<;, ][^<;, ]*\(, [^<;, ][^<;, ]*\)*" contained contains=drakeString,drakeSourceSep
-syn match drakeRuleIdentifier " <- " contained nextgroup=drakeSources
-syn match drakeSourceSep ", " contained containedin=drakeTargets,drakeSources
+syn match drakeSources "\( ,?[^<[;, ][^<;, ]*\)*" contained contains=drakeString,drakeSourceSep
+syn match drakeRuleIdentifier " <-" contained nextgroup=drakeSources
+syn match drakeTargetSep ", " contained containedin=drakeTargets
+syn match drakeSourceSep ", " contained containedin=drakeSources
 
 " Todos in comments
 syn keyword drakeTodo contained TODO NOTE FIXME XXX
 hi link drakeString String
 hi link drakeVariableName Identifier
 hi link VarBraces SpecialComment
+hi link drakeTargetSep Delimiter
 hi link drakeSourceSep Delimiter
 
 " Embedded shell region in block