Index: src/org/openlaszlo/sc/Compiler.java
===================================================================
--- src/org/openlaszlo/sc/Compiler.java	(revision 1338)
+++ src/org/openlaszlo/sc/Compiler.java	(working copy)
@@ -899,7 +899,15 @@
           // Elide empty nodes
           if (! "".equals(child)) {
             sb.append(child);
-            sb.append(child.endsWith("}") ? NEWLINE : (OPTIONAL_SEMI) );
+            if (child.endsWith("}")) {
+              sb.append(NEWLINE);
+            } else if (x  < l && children[x + 1].startsWith("(")) {
+              // Must have a semi, or the parenthesized expression
+              // following makes this look like a function call
+              sb.append(SEMI);
+            } else {
+              sb.append(OPTIONAL_SEMI);
+            }
           }
         }
         if (l >= 0) {
