Re: Content of syntax regions

2022-08-24 Thread BPJ
I have found that using patterns with lookahead/lookbehind works reasonably
well in most cases (for this syntax at least). It feels like overkill
though and is harder to maintain because I may need to change patterns in
two or more places instead of one.


Den tis 23 aug. 2022 20:45M  skrev:

>
> вт, 23 авг. 2022 г. в 20:02, Charles Campbell :
>
>> BPJ wrote:
>> > 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
>> >
>> Good luck with getting this! I've asked for it over a decade ago. Bottom
>> line: currently, you can't.
>>
>> Uses: region would start properly but, since its a region, would allow
>> it to be folded, syntax changed (perl/tex/sh) for start/end patterns, etc.
>>
>> Chip Campbell
>>
>> --
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/vim_use/8baf4165-1e94-9032-3d83-15aee8a82f61%40drchip.org
>> .
>>
>
> What if you define dslFoo after both dslBar and dslBaz? Won't it be enough?
>
> Kind regards,
> Matvey
>
> --
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_use/CAFsTB%2BLNgaMqk5Epkpqi%3DCcPGESXPxcM8M8p1jH_Sqwg6R%2B0Jg%40mail.gmail.com
> 
> .
>

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CADAJKhA2CQcM9NBd%3D8WFq7pyPdyuZ4Jm0DJPzqt-RsqapOj1Og%40mail.gmail.com.


Re: Content of syntax regions

2022-08-23 Thread M
вт, 23 авг. 2022 г. в 20:02, Charles Campbell :

> BPJ wrote:
> > 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
> >
> Good luck with getting this! I've asked for it over a decade ago. Bottom
> line: currently, you can't.
>
> Uses: region would start properly but, since its a region, would allow
> it to be folded, syntax changed (perl/tex/sh) for start/end patterns, etc.
>
> Chip Campbell
>
> --
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_use/8baf4165-1e94-9032-3d83-15aee8a82f61%40drchip.org
> .
>

What if you define dslFoo after both dslBar and dslBaz? Won't it be enough?

Kind regards,
Matvey

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CAFsTB%2BLNgaMqk5Epkpqi%3DCcPGESXPxcM8M8p1jH_Sqwg6R%2B0Jg%40mail.gmail.com.


Re: Content of syntax regions

2022-08-23 Thread Charles Campbell

BPJ wrote:
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

Good luck with getting this! I've asked for it over a decade ago. Bottom 
line: currently, you can't.


Uses: region would start properly but, since its a region, would allow 
it to be folded, syntax changed (perl/tex/sh) for start/end patterns, etc.


Chip Campbell

--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/8baf4165-1e94-9032-3d83-15aee8a82f61%40drchip.org.


Content of syntax regions

2022-08-23 Thread BPJ
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  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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CADAJKhCodC6WofAu%2BBJWFvOd2PvP1vOroYkteh5r75GET_pseg%40mail.gmail.com.