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

2227RE: [jasspa] Addition to bad 'C' hilighting

Expand Messages
  • Phillips, Steven
    Feb 26, 2007
    • 0 Attachment
      Im not sure how this works because it shouldn't, the hilighting does not support words in groups only single letters - following is a correction:
              hilight .hilight.c 2 "\\s\\{if[ \t]*([ \t]*\\w+[ \t]*=[ \t]*\\w+[ \t]*)" .scheme.hlred
              hilight .hilight.c 2 "\\s\\{while[ \t]*([ \t]*\\w+[ \t]*=[ \t]*\\w+[ \t]*)" .scheme.hlred
      Note I have changed the [a-zA-Z_0-9] to a \w as they are equivalent, however I wonder whether this should be simply testing for  'if ( a = S', this would spot things like 'if(a=b-1)' and any assignment in an if/while can avoid this hilighting and compile warning by using double brackets, i.e. 'if((a=b-1))'

      From: jasspa@yahoogroups.com [mailto:jasspa@yahoogroups.com] On Behalf Of Jon Green
      Sent: Sunday, February 25, 2007 3:41 PM
      To: jasspa@yahoogroups.com
      Subject: [jasspa] Addition to bad 'C' hilighting

      Follows an extension to the 'Bad 'C' (also C++/Java) highlighting in
      hkc.emf in the "; Pick up bogus 'C' constructs extension" block.

      ; Pick up a bad assignment in a conditional statement. e.g.
      ; if (a = SOME_CONST)
      ; while (a = SOME_CONST)
      hilight .hilight.c 2 "\\s\\(if\\| while\\)[ \t]*([ \t]*\\w+[ \t]*=[
      \t]*[a-zA-Z_ 0-9]+[ \t]*)" .scheme.hlred

      Seems to pick up bad assignments and not cause any miss highlighting.
      Will only pick up a simple expression.


    • Show all 3 messages in this topic