Hi Sebastian,

I think I've found another treecompiler failure: when a block node is not the
first (or the only) child of another node, it should be separated from its
preceding sibling by a semicolon (except when its preceding sibling is a block
too), but the treecompiler simply attaches the two nodes without any
separator in between.

For example:

var x = 3;
{
   var y = 2;
   x *= y;
}


becomes

var x=3{var y=2;x*=2}

which produces a syntax error, since it is missing a ";" between "3" and "{".

I think the simplest solution in include "block" type nodes among
separators for child nodes. As usual I attach a simple patch for you to
evaluate and apply if you feel so.

Cheers,
Alessandro
--- treecompiler.orig.py        2006-09-20 20:11:06.000000000 +0200
+++ treecompiler.py     2006-09-23 19:49:20.000000000 +0200
@@ -246,8 +246,8 @@
         childrenNumber += 1
 
     previousType = None
-    separators = [ "assignment", "call", "operation", "definition", 
"definitionList", "return", "loop", "switch", "break", "continue", "default", 
"case", "delete", "accessor", "instantiation", "throw", "variable", "function" ]
-    not_after = [ "case", "default" ]
+    separators = [ "assignment", "block", "call", "operation", "definition", 
"definitionList", "return", "loop", "switch", "break", "continue", "default", 
"case", "delete", "accessor", "instantiation", "throw", "variable", "function" ]
+    not_after = [ "block", "case", "default" ]
     not_in = [ "definitionList", "statementList", "params", "variable", 
"array" ]
 
 
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to