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

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

Expand Messages
  • Phillips, Steven
    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
    Message 1 of 3 , 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))'
       
      Steve 
       
       

      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.

      Jon.

    • Jon Green
      ... Yep - darned must have not executed it again when I added the while (final trimming that killed the turkey). I like the S will give this a try. Sorry.
      Message 2 of 3 , Feb 26, 2007
      • 0 Attachment
        Phillips, Steven wrote:
        > 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 <file://\\s\\{if>[ \t]*([
        > \t]*\\w+[ \t]*=[ \t]*\\w+[ \t]*)" .scheme.hlred
        > hilight .hilight.c 2 "\\s\\{while <file://\\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))'
        >
        > Steve
        >

        Yep - darned must have not executed it again when I added the while
        (final trimming that killed the turkey).

        I like the \S will give this a try.

        Sorry.
        Jon.
      Your message has been successfully submitted and would be delivered to recipients shortly.