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

41450RE: c.vim bug

Expand Messages
  • Michael Geddes
    Jul 2, 2003
    • 0 Attachment
      Sorry Bram, your reply got buried.

      Yes, it is c++ only. But I'm sure <:: isn't valid in C anytime anyway,
      unless it is <::>

      Strictly, this could be extended to match <::> explicitly by doing this:

      syn region cBracket transparent start='\[\|<:\(:[^>]\)\@!'

      And then it won't pick up <::x>, which is invalid C syntax, as a
      bracket, so it won't break c++ hilighting. But
      it would pick up <::> as a pair of brackets, which WOULD be valid C

      However the net effect of either is pretty much the same except if you
      change the hilighting for cBracket - which is a good enough reason to
      change it, I guess.


      -----Original Message-----
      From: Bram Moolenaar [mailto:Bram@...]
      Sent: Thursday, 3 July 2003 6:15 AM
      To: Michael Geddes
      Cc: vim@...
      Subject: Re: c.vim bug

      Michael Geddes wrote:

      > Hey Bram, been getting some wierdnesses in hilighting in lines like
      > this:
      > some_type<::AnotherType> {}

      Is that valid C or is this C++?

      > Where the {} are hilighted as cppErrInParen
      > As mainter of the c.vim file, could you tell me what the line:
      > syn region cBracket transparent start='\[\|<:'
      > end=']\|:>'
      > contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppStr
      > ing
      > is meant to be doing??

      You can use <: and :> in place of [ and ] in the C99 standard. This
      remark applies:

      " also accept <% for {, %> for }, <: for [ and :> for ] (C99)

      > In my cpp files. If you REALLY need to support <: :> (and I have
      > idea what this means), could you please add a :\@! or a equivalent?

      > As
      > in:
      > syn region cBracket transparent start='\[\|<::\@!'
      > end=']\|:>'
      > contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppStr
      > ing

      Yes, that should work.

      "Intelligence has much less practical application than you'd think."
      -- Scott Adams, Dilbert.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net
      /// Creator of Vim - Vi IMproved -- http://www.Vim.org
      \\\ Project leader for A-A-P -- http://www.A-A-P.org
      \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html
    • Show all 3 messages in this topic