[KSS-checkins] r44159 - kukit/kukit.js/trunk/kukit

reebalazs at codespeak.net reebalazs at codespeak.net
Tue Jun 12 13:20:01 CEST 2007


Author: reebalazs
Date: Tue Jun 12 13:20:00 2007
New Revision: 44159

Modified:
   kukit/kukit.js/trunk/kukit/kssparser.js
   kukit/kukit.js/trunk/kukit/tokenizer.js
Log:
Fix some commentification fixes that I forgot previously.

Modified: kukit/kukit.js/trunk/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/kssparser.js	(original)
+++ kukit/kukit.js/trunk/kukit/kssparser.js	Tue Jun 12 13:20:00 2007
@@ -316,8 +316,8 @@
     if (this.ifToken(cursor, kukit.kssp.String)) {
         // The previous txt must be all whitespace.
         if (txt) {
-            ;;; this.emitError('Excess characters before the string in property value');
-            this.emitError('');
+            ;;; kukit.E = 'Excess characters before the string in property value';
+            this.emitError(kukit.E);
         }
         // the next one must be a string.
         this.expectToken(cursor, kukit.kssp.String);
@@ -325,8 +325,8 @@
     } else if (this.ifToken(cursor, kukit.kssp.MethodArgs)) {
         // see if not empty and has no spaces in it 
         if (! txt || txt.indexOf(' ') != -1) {
-            ;;; this.emitError('Method property value must have a one-word method name');
-            this.emitError('');
+            ;;; kukit.E = 'Method property value must have a one-word method name';
+            this.emitError(kukit.E);
         }
         // the next one must be the params
         this.expectToken(cursor, kukit.kssp.MethodArgs);
@@ -334,8 +334,8 @@
     } else {
         // not a string or method: check if we allowed multiword.
         if (! this.multiword_allowed && txt.indexOf(' ') != -1) {
-            ;;; this.emitError('Property value must be one word');
-            this.emitError('');
+            ;;; kukit.E = 'Property value must be one word';
+            this.emitError(kukit.E);
         }
         this.produceTxt(txt);
     }
@@ -344,8 +344,8 @@
         this.digestTxt(cursor, kukit.tk.Fraction, kukit.kssp.Comment);
         // we have to be at the end and have no text after
         if (cursor.next < this.result.length || cursor.txt) {
-            ;;; this.emitError('Excess characters after the property value');
-            this.emitError('');
+            ;;; kukit.E = 'Excess characters after the property value';
+            this.emitError(kukit.E);
         }
     }
     this.result = [];
@@ -436,8 +436,8 @@
     var src = this.src;
     var length = src.text.length;
     if (length < src.pos + 1) {
-        ;;; this.emitError('Missing character after backslash');
-        this.emitError('');
+        ;;; kukit.E = 'Missing character after backslash';
+        this.emitError(kukit.E);
     } else { 
         this.result.push(new kukit.tk.Fraction(src, src.pos+1));
         this.src.pos += 1;
@@ -475,8 +475,8 @@
         } else {
             // Just a value, must be one word then.
             if (value.indexOf(' ') != -1) {
-                ;;; this.emitError('Argument value must be one word or a string');
-                this.emitError('');
+                ;;; kukit.E = 'Argument value must be one word or a string';
+                this.emitError(kukit.E);
             }
         }
         this.args.push(value);
@@ -517,8 +517,8 @@
                     tokenindex -= 1;
                 } else {
                     // Error.
-                    ;;; this.emitError('Kss event selector must end with an event qualifier :event or :event(id)');
-                    this.emitError('');
+                    ;;; kukit.E = 'Kss event selector must end with an event qualifier :event or :event(id)';
+                    this.emitError(kukit.E);
                 }
             } break;
             case kukit.kssp.Comment.prototype.symbol: {
@@ -535,8 +535,8 @@
             || this.result[tokenindex+2].symbol != kukit.kssp.PropValueInPseudo.prototype.symbol
             || this.result[tokenindex+1].symbol != kukit.kssp.colon.prototype.symbol
             || this.result[tokenindex].symbol != kukit.tk.Fraction.prototype.symbol) {
-        ;;; this.emitError('Kss event selector must end with an event qualifier :event or :event(id)');
-        this.emitError('');
+        ;;; kukit.E = 'Kss event selector must end with an event qualifier :event or :event(id)';
+        this.emitError(kukit.E);
     }
     // See that the last fraction does not end with space.
     var lasttoken = this.result[tokenindex];
@@ -544,16 +544,16 @@
     var pseudotoken = this.result[tokenindex+2];
     var txt = lasttoken.txt;
     if (txt.match(/[\r\n\t ]$/) != null) {
-        ;;; this.emitError('In kss event selector no space can be before the colon');
-        this.emitError('');
+        ;;; kukit.E = 'In kss event selector no space can be before the colon';
+        this.emitError(kukit.E);
     }
     if (! pseudotoken.value.methodname) {
-        ;;; this.emitError('Kss event selector must have a one-word name after the colon');
-        this.emitError('');
+        ;;; kukit.E = 'Kss event selector must have a one-word name after the colon';
+        this.emitError(kukit.E);
     }
     if (pseudotoken.value.args.length > 1) {
-        ;;; this.emitError('Kss pseudo value must not have more then one parameters');
-        this.emitError('');
+        ;;; kukit.E = 'Kss pseudo value must not have more then one parameters';
+        this.emitError(kukit.E);
     }
     css = this.src.text.substring(this.startpos, commatoken.startpos);
     //print ('>>' + css + ':' + pseudotoken.value.methodname);
@@ -577,8 +577,8 @@
     var splitname = name.split('-');
     var namespace = null;
     if (splitname.length > 2) {
-        ;;; this.emitError('Kss event selector must be name or namespace-name but no more dashes, "' + name + '"');
-        this.emitError('');
+        ;;; kukit.E = 'Kss event selector must be name or namespace-name but no more dashes, "' + name + '"';
+        this.emitError(kukit.E);
     } else if (splitname.length == 2) { 
         name = splitname[1];
         namespace = splitname[0];

Modified: kukit/kukit.js/trunk/kukit/tokenizer.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/tokenizer.js	(original)
+++ kukit/kukit.js/trunk/kukit/tokenizer.js	Tue Jun 12 13:20:00 2007
@@ -40,8 +40,8 @@
         if (eofOk) {
             this.finished = true;
         } else {
-            ;;; this.emitError('Unexpected EOF');
-            this.emitError('');
+            ;;; kukit.E = 'Unexpected EOF';
+            this.emitError(kukit.E);
         }
     }
 };
@@ -109,16 +109,16 @@
     if (token) {
         var symbol = token.prototype.symbol;
         if (i >= this.result.length) {
-            ;;; this.emitError('Expected [' + symbol + ']');
-            this.emitError('');
+            ;;; kukit.E = 'Expected [' + symbol + ']';
+            this.emitError(kukit.E);
         } else if (this.result[i].symbol != symbol) {
-            ;;; this.emitError('Expected [' + symbol + '], found [' + this.result[i].symbol + ']');
-            this.emitError('');
+            ;;; kukit.E = 'Expected [' + symbol + '], found [' + this.result[i].symbol + ']';
+            this.emitError(kukit.E);
         }
     } else {
         if (i >= this.result.length) {
-            ;;; this.emitError('Expected token');
-            this.emitError('');
+            ;;; kukit.E = 'Expected token';
+            this.emitError(kukit.E);
         }
     }
     cursor.token = this.result[i];
@@ -193,8 +193,8 @@
         this.src = src;
         this.startpos = src.pos;
         if (src.text.substr(src.pos, txt.length) != txt) {
-            ;;; this.emitError('Expected "' + txt + '", found "' + src.text.substr(src.pos, txt.length) + '"');
-            this.emitError('');
+            ;;; kukit.E = 'Expected "' + txt + '", found "' + src.text.substr(src.pos, txt.length) + '"';
+            this.emitError(kukit.E);
         } else {
             src.pos += txt.length;
             this.finished = true;


More information about the Kukit-checkins mailing list