Charles E. Campbell, Jr. <drchip@campbellfamily.biz>

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Charles E. Campbell, Jr. <drchip@campbellfamily.biz>

Dominique Pellé
Hi

Attached patch fixes a syntax highlighting problem in Vim-7.2.385
when opening the attached flex file "foo.l".

Notice how syntax hightlighting is wrong right after
"<def_mode>{ID}" in the first screenshot.

http://dominique.pelle.free.fr/pic/flex-syntax-highlighting-before.png
http://dominique.pelle.free.fr/pic/flex-syntax-highlighting-after.png

Cheers
-- Dominique

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

foo.l (188 bytes) Download Attachment
syntax-lex.vim.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Charles E. Campbell, Jr. <drchip@campbellfamily.biz>

Charles E Campbell Jr
Dominique Pellé wrote:

> Hi
>
> Attached patch fixes a syntax highlighting problem in Vim-7.2.385
> when opening the attached flex file "foo.l".
>
> Notice how syntax hightlighting is wrong right after
> "<def_mode>{ID}" in the first screenshot.
>
> http://dominique.pelle.free.fr/pic/flex-syntax-highlighting-before.png
> http://dominique.pelle.free.fr/pic/flex-syntax-highlighting-after.png
>  
Unfortunately this patch destroys the capability to handle "start
condition scopes".

<SCs>{
  list of rules (ith <SCs> prefixes automatically applied)
 }

A SCs is a list of one or more start conditions.  See
http://dinosaur.compilertools.net/flex/manpage.html .

Regards,
Chip Campbell

--
You received this message from the "vim_dev" 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 | Threaded
Open this post in threaded view
|

Re: Charles E. Campbell, Jr. <drchip@campbellfamily.biz>

Tony Mechelynck
On 08/03/10 00:07, Charles E Campbell Jr wrote:
> Dominique Pellé wrote:
[...]
> Regards,
> Chip Campbell
>

Hi Chip! Your system clock (or your timezone) seems to be two hours or
more in the future.


Best regards,
Tony.
--
If you push the "extra ice" button on the soft drink vending machine,
you won't get any ice.  If you push the "no ice" button, you'll get
ice, but no cup.

--
You received this message from the "vim_dev" 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 | Threaded
Open this post in threaded view
|

Re: Charles E. Campbell, Jr. <drchip@campbellfamily.biz>

Nazri Ramliy
On Mon, Mar 8, 2010 at 5:25 AM, Tony Mechelynck
<[hidden email]> wrote:

> Hi Chip! Your system clock (or your timezone) seems to be two hours or more
> in the future.
>
>
> Best regards,
> Tony.

Ah, you seem to forget the fact that all astronauts live in the future!

:)

nazri

--
You received this message from the "vim_dev" 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 | Threaded
Open this post in threaded view
|

Re: Charles E. Campbell, Jr. <drchip@campbellfamily.biz>

Charles Campbell
Nazri Ramliy wrote:

> On Mon, Mar 8, 2010 at 5:25 AM, Tony Mechelynck
> <[hidden email]> wrote:
>
>  
>> Hi Chip! Your system clock (or your timezone) seems to be two hours or more
>> in the future.
>>
>>
>> Best regards,
>> Tony.
>>    
>
> Ah, you seem to forget the fact that all astronauts live in the future!
>  
Maybe I should buy a Wall Street Journal!  A two hour lead time isn't
much, but maybe its enough.  Any of you in the past want to collaborate? :)

Regards,
Chip

--
You received this message from the "vim_dev" 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 | Threaded
Open this post in threaded view
|

Re: Charles E. Campbell, Jr. <drchip@campbellfamily.biz>

Tony Mechelynck
On 08/03/10 15:14, Charles Campbell wrote:

> Nazri Ramliy wrote:
>> On Mon, Mar 8, 2010 at 5:25 AM, Tony Mechelynck
>> <[hidden email]> wrote:
>>
>>> Hi Chip! Your system clock (or your timezone) seems to be two hours
>>> or more
>>> in the future.
>>>
>>>
>>> Best regards,
>>> Tony.
>>
>> Ah, you seem to forget the fact that all astronauts live in the future!
> Maybe I should buy a Wall Street Journal! A two hour lead time isn't
> much, but maybe its enough. Any of you in the past want to collaborate? :)
>
> Regards,
> Chip
>

No thanks. I've heard too many stories of people (including one of my
great-uncles) losing fortunes by buying stocks long or short based on
other people telling them that their price "was bound" to change this
way or that. :-P

Best regards,
Tony.
--
Lunatic Asylum, n.:
        The place where optimism most flourishes.

--
You received this message from the "vim_dev" 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 | Threaded
Open this post in threaded view
|

Re: Charles E. Campbell, Jr. <drchip@campbellfamily.biz>

Dominique Pellé
In reply to this post by Charles E Campbell Jr
On Mon, Mar 8, 2010 at 12:07 AM, Charles E Campbell Jr
<[hidden email]> wrote:

> Dominique Pellé wrote:
>>
>> Hi
>>
>> Attached patch fixes a syntax highlighting problem in Vim-7.2.385
>> when opening the attached flex file "foo.l".
>>
>> Notice how syntax hightlighting is wrong right after
>> "<def_mode>{ID}" in the first screenshot.
>>
>> http://dominique.pelle.free.fr/pic/flex-syntax-highlighting-before.png
>> http://dominique.pelle.free.fr/pic/flex-syntax-highlighting-after.png
>>
>
> Unfortunately this patch destroys the capability to handle "start condition
> scopes".
>
> <SCs>{
>  list of rules (ith <SCs> prefixes automatically applied)
> }
>
> A SCs is a list of one or more start conditions.  See
> http://dinosaur.compilertools.net/flex/manpage.html .


You're right.  I was aware of the "start conditions" (my sample
flex file which showed broken syntax highlighting in Vim
contained one) but I was not aware of the "start condition
scopes".  Hmmm, it's harder to fix the highlighting problem
then. Curly braces are used for all kind of things in flex files:
- in regexes to match something n times: (e.g. r{2,5})
- in references to name definitions (e.g. {DIGIT})
- for start condition scopes, which can be nested
  multiple times (e.g.  <SCs>{ ... })
- to delimit the action (these should always have space(s)
  before them according to your link)

I'm don't really know vim syntax file enough yet to fix.
Time to read ":help syntax"...

-- Dominique

--
You received this message from the "vim_dev" 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 | Threaded
Open this post in threaded view
|

Re: Charles E. Campbell, Jr. <drchip@campbellfamily.biz>

Dominique Pellé
Dominique Pellé wrote:

> On Mon, Mar 8, 2010 at 12:07 AM, Charles E Campbell Jr
> <[hidden email]> wrote:
>
>> Dominique Pellé wrote:
>>>
>>> Hi
>>>
>>> Attached patch fixes a syntax highlighting problem in Vim-7.2.385
>>> when opening the attached flex file "foo.l".
>>>
>>> Notice how syntax hightlighting is wrong right after
>>> "<def_mode>{ID}" in the first screenshot.
>>>
>>> http://dominique.pelle.free.fr/pic/flex-syntax-highlighting-before.png
>>> http://dominique.pelle.free.fr/pic/flex-syntax-highlighting-after.png
>>>
>>
>> Unfortunately this patch destroys the capability to handle "start condition
>> scopes".
>>
>> <SCs>{
>>  list of rules (ith <SCs> prefixes automatically applied)
>> }
>>
>> A SCs is a list of one or more start conditions.  See
>> http://dinosaur.compilertools.net/flex/manpage.html .
>
>
> You're right.  I was aware of the "start conditions" (my sample
> flex file which showed broken syntax highlighting in Vim
> contained one) but I was not aware of the "start condition
> scopes".  Hmmm, it's harder to fix the highlighting problem
> then. Curly braces are used for all kind of things in flex files:
> - in regexes to match something n times: (e.g. r{2,5})
> - in references to name definitions (e.g. {DIGIT})
> - for start condition scopes, which can be nested
>  multiple times (e.g.  <SCs>{ ... })
> - to delimit the action (these should always have space(s)
>  before them according to your link)
>
> I'm don't really know vim syntax file enough yet to fix.
> Time to read ":help syntax"...
>
> -- Dominique

What about the new attached patch?

It adds a the syntax group lexPatAbbrRef for references
to name definitions (i.e. things like {ID} for example).

With attached patch, Vim correctly hightlights the following
sample flex file (incorrectly highlighted without patch):

ID [a-zA-Z0-9_]+
%x def_mode
%%

<def_mode>{
  foo { /* just a comment */ }
}
<def_mode>{ID} { /* just a comment */ }

%%
/* Just a comment */

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

lex.vim.patch (5K) Download Attachment