[KSS-checkins] r49857 - kukit/kukit.js/branch/finish-closures/kukit

gotcha at codespeak.net gotcha at codespeak.net
Sun Dec 16 23:53:35 CET 2007


Author: gotcha
Date: Sun Dec 16 23:53:35 2007
New Revision: 49857

Modified:
   kukit/kukit.js/branch/finish-closures/kukit/kssparser.js
Log:
class closures - step 3

Modified: kukit/kukit.js/branch/finish-closures/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/branch/finish-closures/kukit/kssparser.js	(original)
+++ kukit/kukit.js/branch/finish-closures/kukit/kssparser.js	Sun Dec 16 23:53:35 2007
@@ -557,41 +557,50 @@
 /*
 * class String
 */
-kssp.String = kukit.tk.mkParser('string', {
+var _String = function() {
+    this.process = function() {
+        // collect up the value of the string, omitting the quotes
+        this.txt = '';
+        for (var i=1; i<this.result.length-1; i++) {
+            this.txt += this.result[i].txt;
+        }
+    };
+};
+kssp.String = kukit.tk.mkParserBis('string', {
     "'": 'this.emitAndReturn(new kukit.kssp.quote(this.cursor))',
     '\x5c': 'new kukit.kssp.Backslashed(this.cursor, kukit.kssp.backslash)'
-    });
-kssp.String.prototype.process = function() {
-    // collect up the value of the string, omitting the quotes
-    this.txt = '';
-    for (var i=1; i<this.result.length-1; i++) {
-        this.txt += this.result[i].txt;
-    }
-};
+    },
+    _String
+    );
 
 /*
 * class String2
 */
-kssp.String2 = kukit.tk.mkParser('string', {
+kssp.String2 = kukit.tk.mkParserBis('string', {
     '"': 'this.emitAndReturn(new kukit.kssp.dquote(this.cursor))',
     '\x5c': 'new kukit.kssp.Backslashed(this.cursor, kukit.kssp.backslash)'
-    });
-kssp.String2.prototype.process = kssp.String.prototype.process; 
+    },
+    _String
+    );
 
 /*
 * class StringInSelector
 */
+var _StringInSelector = function() {
+    this.process = function() {
+        // collect up the value of the string, including the quotes
+        this.txt = '';
+        for (var i=0; i<this.result.length; i++) {
+            this.txt += this.result[i].txt;
+        }
+    };
+};
 kssp.StringInSelector = kukit.tk.mkParser('string', {
     "'": 'this.emitAndReturn(new kukit.kssp.quote(this.cursor))',
     '\x5c': 'new kukit.kssp.Backslashed(this.cursor, kukit.kssp.backslash)'
-    });
-kssp.StringInSelector.prototype.process = function() {
-    // collect up the value of the string, including the quotes
-    this.txt = '';
-    for (var i=0; i<this.result.length; i++) {
-        this.txt += this.result[i].txt;
-    }
-};
+    },
+    _StringInSelector
+    );
 
 /*
 * class String2InSelector
@@ -599,8 +608,9 @@
 kssp.String2InSelector = kukit.tk.mkParser('string', {
     '"': 'this.emitAndReturn(new kukit.kssp.dquote(this.cursor))',
     '\x5c': 'new kukit.kssp.Backslashed(this.cursor, kukit.kssp.backslash)'
-    });
-kssp.String2InSelector.prototype.process = kssp.StringInSelector.prototype.process; 
+    },
+    _String
+    );
 
 /*
 * class Backslashed


More information about the Kukit-checkins mailing list