Author: ptw
Date: 2007-10-21 16:16:22 -0700 (Sun, 21 Oct 2007)
New Revision: 6942
Modified:
openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
Log:
Change 20071019-ptw-j by [EMAIL PROTECTED] on 2007-10-19 14:11:18 EDT
in /Users/ptw/OpenLaszlo/ringding-2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Permit arbitrary escapes in strings
Bugs Fixed:
LPP-4940 'Trouble parsing strings with backslashes'
Technical Reviewer: [EMAIL PROTECTED] (Message-Id: <[EMAIL PROTECTED]>)
QA Reviewer: hminsky (pending)
Details:
Permit any character after '\' (while still ensuring that '\0',
'\u', and '\x' escapes are valid).
Tests:
Test case no longer gives parse error:
lzx> "Foo\/"
'Foo/'
lzx>
Modified:
openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
2007-10-21 21:46:39 UTC (rev 6941)
+++ openlaszlo/trunk/WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
2007-10-21 23:16:22 UTC (rev 6942)
@@ -216,10 +216,13 @@
)*
"'"
>
-| // The Octal escapes are not in the spec, but rhino accepts them
+| // any single char can be escaped although "n","t","b","r","f","v"
+ // have special meanings
+ // The Octal escapes are not in the spec, but rhino accepts them;
+ // the x and u specs ensure they are valid
< #ESCAPE_SEQUENCE:
"\\"
- ( ["n","t","b","r","f","v","\\","'","\""]
+ ( (~["0"-"7","x","u"])
| (["0"-"3"])? (["0"-"7"])? ["0"-"7"]
| ["x"] ["0"-"9","a"-"f","A"-"F"] ["0"-"9","a"-"f","A"-"F"]
| ["u"] ["0"-"9","a"-"f","A"-"F"] ["0"-"9","a"-"f","A"-"F"]
["0"-"9","a"-"f","A"-"F"] ["0"-"9","a"-"f","A"-"F"]
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins