-- 1
compose X of A1 A2 end;
-- 2
cases x:
xx -> aaa,
yy -> bbb,
zz -> ccc
end;
In the first case the word 'end' should be green (like 'compose' and
'of'), because is a type definition (the word appear between the word
'compose' and the character ';').
In the second case the word 'end' should be yellow (like 'cases'),
because is a statement (the word appear between the word 'cases' and
the character ';').
I try do that:
syn match xCompose /compose/ nextgroup=xAuxCo skipwhite
syn match xAuxCo /[^{end}]*/ contained nextgroup=xEndCo skipwhite
syn match xEndCo /end/ contained
syn match xCases /cases/ nextgroup=xAuxCa skipwhite
syn match xAuxCa /[^{end}]*/ contained nextgroup=xEndCa skipwhite
syn match xEndCa /end/ contained
hi link vdmCompose Type
hi link vdmEndC Type
hi link vdmCases Statement
hi link vdmEndCa Statement
But this doesn't work.
Anybody can help me?
Thanks
First the highligthing-groups for which you define the syntax
expressions differ from the groups, which you actually link in the last
paragraph.
Second, this pattern /[^{end}]*/ matches anything but the characters
{,},n,e,d
.
andy
Try :help syn-region
syntax region cases keepend start="cases" end="end"
syntax region compose keepend start="compose" end="end"
syntax keyword compose_end end containedin=compose
syntax keyword cases_end end containedin=cases
hi link compose_end Type
hi link cases_end Statement