Monday, December 2, 2019

Re: hightlight syntax problem

This seems to work

Capture.PNG

syn match s7JumpsOperand    /^\s\+\zs\(SPA\|SPL\|SPBNB\|SPBN\|SPBB\|SPB\|SPBI\|SPBIN\|SLW\|SPO\|SPS\|SPZ\|SPN\|SPP\|SPM\|SPPZ\|SPMZ\|SPU\|LOOP\)\ze/
syn match s7JumpsLabel      /\(SPB\s\+\)\@<=\([^; ]\+\)\ze;/




Le lundi 2 décembre 2019 16:48:10 UTC+1, Ni Va a écrit :
Effectively,  just want to match and highlight with two colors the two sentence like above:


      SPB _003;

So, the first no need to specify nextgroup I thought:
syn match s7JumpsOperand   /^\s\+\zs\(SPA\|SPL\|SPBNB\|SPBN\|SPBB\|SPB\|SPBI\|SPBIN\|SLW\|SPO\|SPS\|SPZ\|SPN\|SPP\|SPM\|SPPZ\|SPMZ\|SPU\|LOOP\)\ze/

the second has to know if it is preceeded by the first to highlight:
for example: syn match s7JumpsLabels    \(SPBNB\s\+\)\@<=\([^;]\+\)\ze;  but it has same location......


Le lundi 2 décembre 2019 16:36:08 UTC+1, Christian Brabandt a écrit :

On Mo, 02 Dez 2019, Ni Va wrote:

> Tried with 
> syn match s7JumpsOperand    /^\s\+\zs\(SPA\|SPL\|SPBNB\|SPBN\|SPBB\|SPB\|SPBI\|
> SPBIN\|SLW\|SPO\|SPS\|SPZ\|SPN\|SPP\|SPM\|SPPZ\|SPMZ\|SPU\|LOOP\)\ze/ nextgroup
> =s7JumpLabel
> syn match s7JumpsLabel      /\s\+\S\+\s\+\zs\([^;]\+\)\ze;/
>
> do that:

well, also remove the matching from the previous group. s7JumpsOperand
already matched the part before the \zs of the s7Jumpslabel, so why add
it here again? That cannot happen to match.

> Capture.PNG

please do not attach png pictures.

Best,
Christian
--
Selbst ißt der Mann.

--
--
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/86e7c540-3091-405a-a37b-ee669bf8dab9%40googlegroups.com.

No comments: