Commits

Lars Yencken  committed 4281c85

Support shell and python blocks.

  • Participants
  • Parent commits 6893cb2

Comments (0)

Files changed (1)

File syntax/drake.vim

 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 match drakeTargets "[^<;, ][^<;, ]*\(, [^<;, ][^<;, ]*\)*" contained nextgroup=drakeRuleIdentifier contains=drakeString,drakeSourceSep
 syn match drakeSources "[^<;, ][^<;, ]*\(, [^<;, ][^<;, ]*\)*" contained contains=drakeString,drakeSourceSep
 syn match drakeRuleIdentifier " <- " contained nextgroup=drakeSources
-"syn region drakeActionBlock start="^[ \t]" end="^$" contains=@Shell
 syn match drakeSourceSep ", " contained containedin=drakeTargets,drakeSources
 
 " Todos in comments
 hi link drakeSourceSep Delimiter
 
 " Embedded shell region in block
-syn region drakeActionBlock matchgroup=Snip start='^[ ][ ]*' end='^$' containedin=@Drake contains=@Shell
+syn region drakeDefaultShBlock matchgroup=Snip start='^[ \t][ \t]*' end='^$' containedin=drakeBlock contains=@Shell
+syn region drakeShBlock matchgroup=Snip start=' \[shell\]$' end='^$' containedin=drakeBlock contains=@Shell
+syn region drakePyBlock matchgroup=Snip start=' \[python\]$' end='^$' containedin=drakeBlock contains=@Python
 
 " Embedded shell regions in strings
 syn region shellBrackets matchgroup=SnipBraces start='\$(' end=')' containedin=drakeString contains=@Shell