On Thu, Sep 16, 2010 at 11:44 AM, Alin Marin Elena
<[email protected]> wrote:
> Hi All,
>
> I try to develop a syntax highlighter for the input files of cp2k (a science
> sw).
>
> I did few steps into that direction and solved some issues with the help of
> people in #vim http://gitorious.org/cp2k-vim/
>
> Now I have the following case that fails to be correctly highlighted (charge
> is wrongly highlighted as a keyword when it should be a constant). Any ideas
> welcomed.
> a...@felix:~/playground/cp2k-vim> cat example/fail.inp
> !!cp2k!!
> &charge charge
>  charge charge
> &end charge
>
> !!!! when charge has & or &end should be a section
> !!!! when charge is the first word on a line should be a keyword
> !!!! when charge second or more should be a constant
> _____________________________________________________________________
> Alin Marin ELENA

I've made some changes to make it a bit cleaner (I think)
http://sitaktif.kollok.org/docs/cp2k.vim

The following example is quite ok except for the operator/parenthesis,
that you have to define as a "middleware region" :)

! BEGINNING OF EXAMPLE
!!cp2k!!
@if coucou

!! Add the management of parenthesis and operators, like <, <=, > &&
|| etc.. if needed
&charge charge charge (charge < charge)  !! My comment
 charge charge charge(1234) !! Another one
 charge (12 + 45) * (-12)
&end charge

@endif
! END OF EXAMPLE

Best,
Romain

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui