Commits

Lars Yencken committed 0961c73

Add support for method blocks.

  • Participants
  • Parent commits aa66d35

Comments (0)

Files changed (1)

 syn match drakeComment ";.*$" contains=drakeTodo
 
 " Variable definitions
-syn match drakeSetVariable "^[a-zA-Z-_][a-zA-Z-_]*=[^ ,]*$" contains=drakeVariable
-syn match drakeVariable "^[a-zA-Z-_][a-zA-Z-_]*" nextgroup=drakeSetIdentifier containedin=drakeVariable
-syn match drakeSetIdentifier "=" nextgroup=drakeString
-syn match drakeString "[^ ,]*" contained contains=drakeVariableRef containedin=drakeSetVariable
+syn match drakeSetVariable "^[a-zA-Z-_][a-zA-Z-_]*=[^,]*$" contains=drakeVariable
+syn match drakeVariable "^[a-zA-Z-_][a-zA-Z-_]*" contained nextgroup=drakeSetIdentifier containedin=drakeVariable
+syn match drakeSetIdentifier "=" nextgroup=drakeSetValue
+syn match drakeSetValue ".*$" contained contains=drakeString
+syn match drakeString "[^ ,]*" contained contains=drakeVariableRef containedin=drakeSetValue
+
+" Method blocks
+syn region drakeMethodBlock start="^[a-zA-Z-][a-zA-Z0-9-]*()" end="^$" contains=drakeMethodSignature
+syn match drakeMethodSignature "^[a-zA-Z-][a-zA-Z0-9-]*" contained nextgroup=drakeMethodBraces
+syn match drakeMethodBraces "()" contained nextgroup=drakeDefaultShBlock,drakeShBlock,drakePyBlock
 
 " Variable references in strings
 syn region drakeVariableRef matchgroup=VarBraces start='\$\[' end='\]' contained containedin=drakeString contains=drakeVariableName
 hi link drakeSourceSep Delimiter
 
 " Embedded shell region in block
-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
+syn region drakeDefaultShBlock matchgroup=Snip start='^[ \t][ \t]*' end='^$' containedin=drakeBlock,drakeMethodBlock contains=@Shell
+syn region drakeShBlock matchgroup=Snip start=' \[shell\]$' end='^$' containedin=drakeBlock,drakeMethodBlock contains=@Shell
+syn region drakePyBlock matchgroup=Snip start=' \[python\]$' end='^$' containedin=drakeBlock,drakeMethodBlock contains=@Python
 
 " Embedded shell regions in strings
 syn region shellBrackets matchgroup=SnipBraces start='\$(' end=')' containedin=drakeString contains=@Shell
 hi link Snip SpecialComment
 hi link SnipBraces SpecialComment
 hi link drakeVariableRef Identifier
+hi link drakeMethodSignature Identifier
+hi link drakeMethodBraces SpecialComment
 
 let b:current_syntax = 'drake'