On 9/5/06, Peter Hodge <[EMAIL PROTECTED]> wrote:
Hello all,
Given the following text:
inte
integ
intege
integer
inter
interv
interva
interval
is there any easy way to make these two commands work?
syntax match Error /int\%[eger]/
syntax match Error /int\%[erval]/
The second match begins taking priority as soon as the word is 'inte', and
prevents 'integer' from being matched correctly.
Your problem is that both patterns match int and inte, resulting in ambiguity.
I think solution is to separate 'int' and 'inte' as separate matches,
whcih results in unambiguous matching:
syntax match Error /integ\%[er]/
syntax match Error /inter\%[val]/
syntax match Error /\<int\%[e]\>/
(untested)
Even better would be use syn keyword:
syn keyword Error int inte integ intege integer inter interv
interva interval
On the other hand, both of your 'syn match'es use same group, so
why 2nd match taking over would be a problem anyway ?
Yakov