bug-enscript
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-enscript] [bug #26774] sh.st - hash/pound within a string mishandle


From: Josh Zenker
Subject: [bug-enscript] [bug #26774] sh.st - hash/pound within a string mishandled
Date: Thu, 11 Jun 2009 14:19:22 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.30 Safari/530.5

Follow-up Comment #4, bug #26774 (project enscript):

Ok, I think I have a working solution.  I got rid of the separate sh_string
state I created and instead mimicked what Andy Eskilsson did in his python
state:


state sh_string extends Highlight
{
  /\\./ {
    language_print ($0);
  }
  sh_string_end {
    language_print ($0);
    return;
  }
}


Then I have sh_string_end set to a regular expression.


state sh extends HighlightEntry
{
  <snip>
  /* String constants. */
  /"|'/ {
    sh_string_end = regexp($0);
    string_face (true);
    language_print ($0);
    call (sh_string);
    string_face (false);
  }
  <snip>
}


This correctly highlights nested single and double quotes, as well as
hash/pound symbols inside quotes.  See the attached state file for more
details.

(file #18250)
    _______________________________________________________

Additional Item Attachment:

File name: sh.st                          Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?26774>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]