Tuesday, August 23, 2022

Content of syntax regions

For my DSL I have a syntax region for text between a pair of delimiters inside which other syntax items should come in a specific order, say first dslFoo, then dslBar, then dslBaz.
I can use nextgroup=dslBar to declare which item should come after dslFoo and so on, but how do I declare that the first item inside the region must be a dslFoo? Is there a better approach than defining the opening delimiter as a match item to be followed by a dslFoo item and so on, but doesn't that prevent me from using contains and containedin? I wish I could do something like firstcontained=dslFoo on the region.

What is the best way to do this?

/bpj

Den lör 18 juni 2022 14:58BPJ <bpj@melroch.se> skrev:
The subject line says it all: I'm trying to use syntax clusters and wonder if clusters may contain other clusters, i.e. should this work?

syn cluster mydslAnyValue contains=@mydslValue,@mydslContainer
syn cluster mydslAllValues contains=@mydslAnyValue,mydslConstant

TIA,

/bpj

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CADAJKhCodC6WofAu%2BBJWFvOd2PvP1vOroYkteh5r75GET_pseg%40mail.gmail.com.

No comments: