On Thu, Dec 9, 2010 at 8:14 PM, Andres Perera <[email protected]> wrote:
> On Thu, Dec 9, 2010 at 11:33 AM, Alexander Ivaniuk <[email protected]> wrote:
>>
>> But then I find that I need to define a variable that consist of a
>> quad of floats.
>> Do I really need to define the syntax in the following way or is there
>> a better alternative?
>>
>> syntax match   FloatQuad                "\(\<[0-9]\+\.[0-9]*\s\)\{,4}"
>
> :let float = '\<\d\+\.\d*\>'
>
> :exe 'syn match Float     /'   . float . '/'
> :exe 'syn match FloatQuad /\(' . float . '\s*\)\{,4}/'

Although, I think it's much more comfortable to write with m4 instead
of straight up VimL:

define(`RE', `\<\d\+\.\d*\>')dnl
:syn match Float      /RE/
:syn match FloatQuad  /\(RE\s*\){,4}/

And the RE for Float will also match `0.', which I don't think is your
intention.

-- 
You received this message from the "vim_use" 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

Reply via email to