[EMAIL PROTECTED] wrote:
> I'm looking for a way to define a few :syn-match'es before the definitions
> from cpp.vim, but after those of c.vim.
Well it seems it was not necessary in my precise case. I still have some
troubles with priorities.
Given my problem of enforcing good practices by highlighting c++ catches made by
value (instead of reference), I'm almost done. I'm able to highlight "catch(T)"
but neither "catch(...)" nor "catch(T&anything)". I'm even able to not
highlight text I'm typing ("catch(Typ<cursor>)"). So far so good.
However, "catch(T const E)" is correctly highlighted, but "catch(const T e)" is
never highlighted as it should.
Does anybody sees why in my :syn definitions ? I guess the definition of the
syn-Keyword for "const" is the root of my problem. But I don't see how to fix
it.
---------- >% -----------
if !exists("cpp_no_catch_by_reference")
" In C++, we should always catch by reference (and throw by value)
" The complex regex tells to match an expression without "&" except "...".
syn match cppBadCatch
\ /\(catch\s*(\s*\)\@<=\(\s*\.\.\.\s*\)[EMAIL PROTECTED]&)]*\()\)[EMAIL
PROTECTED]/
" Accept what is currently typed
syn match cppEditedCatch
\ /\(catch\s*(\s*\)\@<=[a-zA-Z:_]\+\%#\(\s*)\)[EMAIL PROTECTED]/
syn match cppEditedCatch
\
/\(catch\s*(\s*\)\@<=\(\%[const]\|const\s*[a-zA-Z:_]\+\s*\)\%#\(\s*)\)[EMAIL
PROTECTED]/
syn match cppEditedCatch
\ /\(catch\s*(\s*\)\@<=[a-zA-Z:_]\+\s*\%[const]\=\%#\(\s*)\)[EMAIL
PROTECTED]/
hi def link cppBadCatch SpellBad
" hi def link cppEditedCatch xxxx
endif
---------- >% -----------
Thanks in advance
--
Luc Hermitte
http://hermitte.free.fr/vim/