Loading ...
Sorry, an error occurred while loading the content.

Re: Charles E. Campbell, Jr.

Expand Messages
  • Dominique Pellé
    ... 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
    Message 1 of 8 , Mar 8, 2010
    • 0 Attachment
      Dominique Pellé wrote:

      > On Mon, Mar 8, 2010 at 12:07 AM, Charles E Campbell Jr
      > <drchip@...> 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
    Your message has been successfully submitted and would be delivered to recipients shortly.