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/Scope.js
[gnome.introspection-doc-generator]
/
JSDOC
/
TokenStream.js
diff --git
a/JSDOC/TokenStream.js
b/JSDOC/TokenStream.js
index
8438da7
..
a660873
100644
(file)
--- a/
JSDOC/TokenStream.js
+++ b/
JSDOC/TokenStream.js
@@
-1,13
+1,13
@@
//<script type="text/javscript">
//<script type="text/javscript">
-XObject = imports.XObject.XObject;
+
const
XObject = imports.XObject.XObject;
-console = imports.console.console;
-Token = imports.Token.Token;
-Lang = imports.Lang.Lang;
+cons
t cons
ole = imports.console.console;
+
const
Token = imports.Token.Token;
+
const
Lang = imports.Lang.Lang;
/**
/**
@@
-21,7
+21,7
@@
Lang = imports.Lang.Lang;
*/
*/
-TokenStream = XObject.define(
+
const
TokenStream = XObject.define(
/**
* @constructor
/**
* @constructor
@@
-114,7
+114,10
@@
TokenStream = XObject.define(
// print(i);
if (i < 0) {
if (n > -1) {
// print(i);
if (i < 0) {
if (n > -1) {
- i = 0; continue;
+ i = 0;
+ count++;
+ continue;
+
}
return new Token("", "VOID", "END_OF_STREAM");
}
}
return new Token("", "VOID", "END_OF_STREAM");
}
@@
-138,6
+141,7
@@
TokenStream = XObject.define(
/**
* @return {Token|null}
/**
* @return {Token|null}
+ * next token (with white space)
*/
*/
@@
-185,16
+189,19
@@
TokenStream = XObject.define(
*/
balance : function(/**String*/start, /**String*/stop) {
*/
balance : function(/**String*/start, /**String*/stop) {
- start = typeof(Lang.matching(start)) == 'undefined' ? Lang.punc(start) : start;
+
+ start = typeof(Lang.punc(start)) == 'undefined' ? start : Lang.punc(start);
if (!stop) stop = Lang.matching(start);
var depth = 0;
var got = [];
var started = false;
if (!stop) stop = Lang.matching(start);
var depth = 0;
var got = [];
var started = false;
- Seed.print("STOP:" + stop);
+ //Seed.print("START:" + start);
+ //Seed.print("STOP:" + stop);
while ((token = this.look())) {
if (token.is(start)) {
while ((token = this.look())) {
if (token.is(start)) {
+ // Seed.print("balance: START : " + depth + " " + token.data);
depth++;
started = true;
}
depth++;
started = true;
}
@@
-205,10
+212,12
@@
TokenStream = XObject.define(
if (token.is(stop)) {
depth--;
if (token.is(stop)) {
depth--;
- if (depth == 0) return got;
+ // Seed.print("balance: STOP: " + depth + " " + token.data);
+ if (depth < 1) return got;
}
if (!this.next()) break;
}
}
if (!this.next()) break;
}
+ return false;
},
getMatchingToken : function(/**String*/start, /**String*/stop) {
},
getMatchingToken : function(/**String*/start, /**String*/stop) {
@@
-232,6
+241,7
@@
TokenStream = XObject.define(
}
cursor++;
}
}
cursor++;
}
+ return false;
},
insertAhead : function(/**JSDOC.Token*/token) {
},
insertAhead : function(/**JSDOC.Token*/token) {
@@
-264,9
+274,10
@@
TokenStream = XObject.define(
end = Math.min(end || this.tokens.length, this.tokens.length);
var out='';
for (var i =start;i < end; i++) {
end = Math.min(end || this.tokens.length, this.tokens.length);
var out='';
for (var i =start;i < end; i++) {
- out += this.tokens[i].data;
+
+ out += (this.tokens[i].outData == false) ? this.tokens[i].data : this.tokens[i].outData;
};
print(out);
}
});
};
print(out);
}
});
-
\ No newline at end of file
+