projects
/
gnome.introspection-doc-generator
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JSDOC/TokenReader.js
[gnome.introspection-doc-generator]
/
JSDOC
/
Collapse.js
diff --git
a/JSDOC/Collapse.js
b/JSDOC/Collapse.js
index
a0312c0
..
af58a91
100644
(file)
--- a/
JSDOC/Collapse.js
+++ b/
JSDOC/Collapse.js
@@
-1,11
+1,12
@@
//<script type="text/javscript">
//<script type="text/javscript">
-XObject = imports.XObject.XObject;
+
const
XObject = imports.XObject.XObject;
-console = imports.console.console;
+cons
t cons
ole = imports.console.console;
// make sure parent is loaded..
// make sure parent is loaded..
-TokenStream = imports.TokenStream.TokenStream;
+const TokenStream = imports.TokenStream.TokenStream;
+
/**
*
* base class for parsing segments of token array..
/**
*
* base class for parsing segments of token array..
@@
-31,14
+32,13
@@
TokenStream = imports.TokenStream.TokenStream;
*
*/
*
*/
-Collapse = XObject.define(
+
const
Collapse = XObject.define(
function (ar)
{
function (ar)
{
-
Collapse.superclass.constructor.call(this, ar);
this.spaces();
Collapse.superclass.constructor.call(this, ar);
this.spaces();
-
var
ar = this.collapse(this.tokens);
+ ar = this.collapse(this.tokens);
this.tokens = ar;
this.tokens = ar;
@@
-113,9
+113,9
@@
Collapse = XObject.define(
st.next(1);
var add = st.balance(tok.data);
if (!add) {
st.next(1);
var add = st.balance(tok.data);
if (!add) {
-
console.dump
(tok);
-
console.dump
(start + '...' + st.cursor);
-
console.dump
(st.tokens);
+
Seed.print
(tok);
+
Seed.print
(start + '...' + st.cursor);
+
Seed.print
(st.tokens);
}
if (add) {
}
if (add) {
@@
-194,6
+194,12
@@
Collapse = XObject.define(
g.push(ar[i]);
continue;
}
g.push(ar[i]);
continue;
}
+ // var a=..., b =...
+ if ((ar[i].data != ';') && g.length && (g[0].name == "VAR")) {;
+ g.push(ar[i]);
+ continue;
+ }
+
g.push(ar[i]);
ret.push(g);
g = [];
g.push(ar[i]);
ret.push(g);
g = [];
@@
-239,8
+245,9
@@
Collapse = XObject.define(
}
}
}
}
- // last..
- if (k.length) {
+ // last.. - if g.val.length is 0 then it's a trailing ','...
+ // we should really throw a syntax error in that case..
+ if (k.length && g.val.length) {
ret[k] = g;
}
return ret;
ret[k] = g;
}
return ret;
@@
-250,4
+257,4
@@
Collapse = XObject.define(
-});
\ No newline at end of file
+});