JSDOC/TokenReader.vala
[gnome.introspection-doc-generator] / JSDOC / TokenReader.vala
index 66034d1..631fe34 100644 (file)
@@ -242,9 +242,9 @@ namespace JSDOC {
          */
         public bool read_punc (TokenStream stream, TokenArray tokens)
         {
-            var found = "";
+            string found = "";
             var name;
-            while (!stream.look().eof && Lang.punc(found + stream.look())) {
+            while (!stream.look().eof && Lang.punc(found + stream.look()).length > 0) {
                 found += stream.next();
             }
             
@@ -261,11 +261,11 @@ namespace JSDOC {
                 if (this.ignoreBadGrammer) {
                     print("\n" + this.filename + ':' + this.line + " Error - comma found before " + found);
                 } else {
-                    
-                    throw {
-                        name : "ArgumentError", 
-                        message: "\n" + this.filename + ':' + this.line + " Error - comma found before " + found
-                    }
+                    throw new TokenReader_Error.ArgumentError(
+                                this.filename + ":" + this.line + "  comma found before " + found
+                  
+                    );
+                     
                 }
             }