Yakov Lerner wrote:
On 9/2/06, Ilya <[EMAIL PROTECTED]> wrote:
Hello.

I have a question regarding syntax matching.  I have some kind of syntax
and I have some solution to highlight it, but it does not work the way I
expect it to.

What I want:  match syntax that consists of blocks (enclosed in {}),
strings (enclosed in "") and identifiers (starts with ${ and ends with
}).  Block end should also end any string that starts inside this block.

My solution:

:syn cluster Top contains=Block,String,Identifier
:syn region Block start=+{+ end=+}+ keepend extend [EMAIL PROTECTED]
:syn region String start=+"+ end=+"+ contains=Identifier
:syn region Identifier start=+\${+ end=+}+ extend

 Your 'keepend' option clearly causes '}' which is end of
identifier to terminate the enclosing block, in full accordance
with :help syn-keepend.
No, it does not because of an extend option. Here is a picture (I've already included it in my previous mail):
{ "string ${var} string" }
BBBBBBBBBBBBBBBBBBBBBBBBBB
 SSSSSSSSSSSSSS       SS
         IIIIII
B - Block region
S - String region
I - Identifier region

I got this information using synID function.
 If I read ':help syn-keepend' right, then 'keepend' does not
allow a region on which it is used to have proper subregions.
Except for 'extend' regions.  That is why Block is 'keepend' and 'extend'.

Yakov



Reply via email to