[Top][All Lists]
[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: |
anonymous |
Subject: |
[bug-enscript] [bug #26774] sh.st - hash/pound within a string mishandled |
Date: |
Wed, 10 Jun 2009 15:46:32 +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 |
URL:
<http://savannah.gnu.org/bugs/?26774>
Summary: sh.st - hash/pound within a string mishandled
Project: GNU Enscript
Submitted by: None
Submitted on: Wed 10 Jun 2009 03:46:31 PM UTC
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Lines like the following are improperly parsed by enscript 1.6.4:
sed 's/^\s*#*\s*PORT=[1-9][0-9]*/PORT=1691/' $SYSEDGE_INIT~ | uniq >
$SYSEDGE_INIT
Everything after the hash/pound in the regex gets pretty-printed as though it
were a comment. On my system, I copied c_string.st to a new state, which I
called sh_string.st:
/*
* Read one sh-string. sh-styled strings are needed in many languages.
* Therefore it is implemented in a separate file to ease its reusing.
*/
state sh_string extends Highlight
{
/\\\\./ {
language_print ($0);
}
/\"|'/ {
language_print ($0);
return;
}
}
/*
Local variables:
mode: sh
End:
*/
Then I changed sh.st to call sh_string instead of c_string:
/* String constants. */
/\"|'/ {
string_face (true);
language_print ($0);
call (sh_string);
string_face (false);
}
This seems to be an imperfect solution, but it works for the time being.
JZ
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?26774>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug-enscript] [bug #26774] sh.st - hash/pound within a string mishandled,
anonymous <=