Author: ptw
Date: 2007-07-16 17:49:01 -0700 (Mon, 16 Jul 2007)
New Revision: 5681

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/LzDebug.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/LzMessage.lzs
   
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
Log:
Change 20070713-ptw-7 by [EMAIL PROTECTED] on 2007-07-13 07:38:57 EDT
    in /Users/ptw/OpenLaszlo/legals
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Include unique ID in Debug.write output

Bugs Fixed:
LPP-4278 'Debug.write() output should include UID or some marker so
instances are identifiable'
LPP-4283 'text format test fails in DHTML'

Technical Reviewer: ben (Message-Id: <[EMAIL PROTECTED]>)
QA Reviewer: eliot (pending)

Details:
    LzMessage: request uinique ID from __String

    LzDebug: Document unique param of __String

    LzFormatter: %#w should be the same as Debug.write  (Left in some
    commented-out code for 'extra' arg to %-directives as possible
    future extension.)

    Compiler: Correct precedence for call parameters

Tests:
    ant lztest, smokecheck



Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/compiler/LzFormatter.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/compiler/LzFormatter.lzs 
2007-07-16 23:52:06 UTC (rev 5680)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/compiler/LzFormatter.lzs 
2007-07-17 00:49:01 UTC (rev 5681)
@@ -237,6 +237,7 @@
       var length = '';
       var precision = null;
       var directive = null;
+//       var extra = null;
       while ((start < limit) &&
              // swf7 (! directive)
              (directive == null)) {
@@ -278,6 +279,16 @@
             break;
           case '.': precision = ''; break;
           case 'h': case 'l': break;
+//           case '{':
+//             // Look for a match
+//             var close = ctrl.indexOf('}', start);
+//             if (close > start) {
+//               extra = ctrl.substring(start, close);
+//               start = close + 1;
+//               end = start + 1;
+//               break;
+//             }
+//             // Otherwise fall through
           default:
             directive = char;
             break;
@@ -352,7 +363,10 @@
         case 'w':
           if ($debug) {
             var width = decimals || Debug.printLength;
-            out.appendInternal(this.pad(Debug.__String(value, (! alternate), 
width),
+            // alternate => Debug.write => pretty but unique (see
+            // LzMessage.append)
+            // We let __String abbreviate, for best legibility
+            out.appendInternal(this.pad(Debug.__String(value, true, width, 
alternate),
                                         length, null, pad, sign, radix, force),
                                value);
             argno++;                  // consume value

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/LzDebug.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/LzDebug.lzs     
2007-07-16 23:52:06 UTC (rev 5680)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/LzDebug.lzs     
2007-07-17 00:49:01 UTC (rev 5681)
@@ -153,12 +153,14 @@
   * @param Boolean pretty: return a 'prettier' (but possibly ambiguous)
   * representation, default false.
   * @param Number limit: don't return a string longer than, default
-  * Debug.pringLength
+  * Debug.printLength
+  * @param Boolean unique: disambiguate representations by attaching a
+  * unique identifier, default (! pretty)
   * @return String representation of the thing
   *
   * @access private
   */
-Debug.__String = function (thing, pretty, limit) { return String(thing); }
+  Debug.__String = function (thing, pretty, limit, unique) { return 
String(thing); }
 
 /**
   * Make a hyperlink to display an object by id, if id is not supplied,

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/LzMessage.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/LzMessage.lzs   
2007-07-16 23:52:06 UTC (rev 5680)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/debugger/LzMessage.lzs   
2007-07-17 00:49:01 UTC (rev 5681)
@@ -178,8 +178,8 @@
     var arg = arguments[i];
     // annotate objects and things you have ID'd
     if ((arg instanceof Object) || (Debug.IDForObject(arg) != null)) {
-      // pretty, no limit
-      var str = Debug.__String(arg, true, Infinity);
+      // pretty, no limit, but unique; for write-compatibility
+      var str = Debug.__String(arg, true, Infinity, true);
       this.appendInternal(str, arg);
     } else {
       this.appendInternal(String(arg));

Modified: 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
===================================================================
--- 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
   2007-07-16 23:52:06 UTC (rev 5680)
+++ 
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
   2007-07-17 00:49:01 UTC (rev 5681)
@@ -783,7 +783,6 @@
     String OPTIONAL_SEMI;
     String OPENCURLY;
     String CLOSECURLY;
-    Map Joins;
 
     public ParseTreePrinter() {
       this(false, false);
@@ -810,10 +809,6 @@
       this.OPTIONAL_SEMI = (compress && "\n".equals(NEWLINE)) ? NEWLINE : SEMI;
       this.OPENCURLY = "{" + NEWLINE;
       this.CLOSECURLY = NEWLINE + "}";
-      // Set Joins
-      Joins = new HashMap();
-      Joins.put(ASTFormalParameterList.class, COMMA);
-      Joins.put(ASTFunctionCallParameters.class, COMMA);
     }
 
     public void print(SimpleNode node, OutputStream output) {
@@ -865,9 +860,6 @@
       }
 
       Class nt = node.getClass();
-      if (Joins.containsKey(nt)) {
-        return join((String)Joins.get(nt), children);
-      }
 
       // Are we doing OOP yet?
       if (node instanceof ASTProgram ||
@@ -980,7 +972,9 @@
       if (node instanceof ASTBinaryExpressionSequence) {
         return visitBinaryExpressionSequence(node, children);
       }
-      if (node instanceof ASTExpressionList) {
+      if (node instanceof ASTExpressionList ||
+          node instanceof ASTFunctionCallParameters ||
+          node instanceof ASTFormalParameterList) {
         return visitExpressionList(node, children);
       }
       if (node instanceof ASTAndExpressionSequence) {


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to