projects
/
gnome.introspection-doc-generator
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8d3da5a
)
JSDOC/TokenReader.js
author
Alan Knowles
<alan@akbkhome.com>
Tue, 10 Aug 2010 02:33:27 +0000
(10:33 +0800)
committer
Alan Knowles
<alan@akbkhome.com>
Tue, 10 Aug 2010 02:33:27 +0000
(10:33 +0800)
JSDOC/TokenReader.js
patch
|
blob
|
history
diff --git
a/JSDOC/TokenReader.js
b/JSDOC/TokenReader.js
index
e367849
..
41513a1
100644
(file)
--- a/
JSDOC/TokenReader.js
+++ b/
JSDOC/TokenReader.js
@@
-40,8
+40,10
@@
TokenReader = XObject.define(
tokenize : function(/**JSDOC.TextStream*/stream) {
this.line =1;
var tokens = [];
tokenize : function(/**JSDOC.TextStream*/stream) {
this.line =1;
var tokens = [];
- /**@ignore*/ tokens.last = function() { return tokens[tokens.length-1]; }
- /**@ignore*/ tokens.lastSym = function() {
+ /**@ignore*/
+ tokens.last = function() { return tokens[tokens.length-1]; }
+ /**@ignore*/
+ tokens.lastSym = function() {
for (var i = tokens.length-1; i >= 0; i--) {
if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i];
}
for (var i = tokens.length-1; i >= 0; i--) {
if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i];
}
@@
-115,13
+117,23
@@
TokenReader = XObject.define(
found += stream.next();
}
found += stream.next();
}
+
if (found === "") {
return false;
}
if (found === "") {
return false;
}
- else {
- tokens.push(new Token(found, "PUNC", Lang.punc(found), this.line));
- return true;
+
+ if ((found == '}' || found == ']') && tokens.lastSym().data == ',') {
+ //print("Error - comma found before " + found);
+ //print(JSON.stringify(tokens.lastSym(), null,4));
+ throw {
+ name : "ArgumentError",
+ message: "Error - comma found before " + found + " on line " + this.line + "\n"
+ }
}
}
+
+ tokens.push(new Token(found, "PUNC", Lang.punc(found), this.line));
+ return true;
+
},
/**
},
/**