Author: dda
Date: 2008-01-27 14:33:43 -0800 (Sun, 27 Jan 2008)
New Revision: 7900
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
Log:
Change 20080126-dda-x by [EMAIL PROTECTED] on 2008-01-26 17:11:08 EST
in /Users/dda/laszlo/src/svn/openlaszlo/branches/devildog
for http://svn.openlaszlo.org/openlaszlo/branches/devildog
Summary: devildog: Fixed more unparser errors causing problems with DHTML.
New Features:
Bugs Fixed: LPP-5234
Technical Reviewer: ptw (pending)
QA Reviewer: promanik (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Related to r7892.
The new unparser adds annotations to the text that is eventually removed.
There were a few more cases where the annotated text was used
(in particular with comparisons with "", or checking first or last
characters).
These cases fixed to use the unannotated text.
Tests:
`
demo/weather, demo/lzpix
SWF8+DHTML
smokecheck
SWF8+DHTML
swf9/hello
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
===================================================================
---
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
2008-01-27 22:29:38 UTC (rev 7899)
+++
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
2008-01-27 22:33:43 UTC (rev 7900)
@@ -128,7 +128,7 @@
body = elideSemi(body);
// NEWLINE is for debug/readability, so our code is not _all_ on
// one line
- return "{" + NEWLINE + elideSemi(body) + (body.endsWith("}") ? "" :
NEWLINE) + "}";
+ return "{" + NEWLINE + elideSemi(body) + (unannotate(body).endsWith("}") ?
"" : NEWLINE) + "}";
}
public static String join(String token, String[] strings) {
@@ -173,10 +173,11 @@
for (int x = 0; x < l; x++) {
String child = children[x];
// Elide empty nodes
- if (! "".equals(child)) {
+ String childRaw = unannotate(child);
+ if (! "".equals(childRaw)) {
sb.append(sep);
sb.append(child);
- if (! child.endsWith(SEMI)) {
+ if (! childRaw.endsWith(SEMI)) {
sep = SEMI + (compress ? SPACE : NEWLINE);
} else {
sep = (compress ? SPACE : NEWLINE);
@@ -188,10 +189,11 @@
if (node instanceof ASTStatement) {
assert children.length == 1;
String child = children[0];
+ String childRaw = unannotate(child);
// Ensure an expression becomes a statement by appending an
// explicit semicolon
- if ((! "".equals(child)) &&
- (! child.endsWith(SEMI))) {
+ if ((! "".equals(childRaw)) &&
+ (! childRaw.endsWith(SEMI))) {
return lnum(node, child + SEMI);
} else {
return lnum(node, child);
@@ -668,9 +670,10 @@
}
String op = children[1];
- char opChar = op.charAt(op.length() - 1);
+ String opRaw = unannotate(op);
+ char opChar = opRaw.charAt(opRaw.length() - 1);
StringBuffer sb = new StringBuffer();
- boolean required = java.lang.Character.isLetter(op.charAt(0));
+ boolean required = java.lang.Character.isLetter(opRaw.charAt(0));
String space = required?" ":SPACE;
sb.append(children[0]);
for (int x = 2; x < (children.length); x++) {
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins