Hello everyone, I'm new to this list.
I'm writing a syntax file for vim 7.0 and ran into a couple of problems,
please help me.
1) The language defines a control statement
if(expr)do
else
endif
but also two functions
if(...) possibly after a = or an operator and possibly before an
operator
and
do(...) ditto
Is there a way to highlight the control statement differently than the
if and do functions?
2) I'm having problems highlighting operators when there are no spaces.
For instance for operators + ++ XOR I'm using
syn case ignore
syn keyword OPER xor
syn match OPER "\V\.\s\*\zs+\ze\s\*\."
syn match OPER "\V\.\s\*\zs++\ze\s\*\."
The resulting highlighting is fine for
a + b
a ++ b
but there's no highlight for
a+b
and only the second + is highlighted for
a++b
notice that if I enter ex mode and type
:echo matchstr("a++b","\V\.\s\*\zs++\ze\s\*\.")
I get '++' as output, which is what I'd expect. It is only in the syntax
file that the highlighting/match is wrong when there are no spaces.
Thanks in advance.