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:
4c648df
)
JSDOC/TokenReader.vala
author
Alan Knowles
<alan@roojs.com>
Thu, 10 Sep 2015 10:44:30 +0000
(18:44 +0800)
committer
Alan Knowles
<alan@roojs.com>
Thu, 10 Sep 2015 10:44:30 +0000
(18:44 +0800)
JSDOC/TokenReader.vala
patch
|
blob
|
history
diff --git
a/JSDOC/TokenReader.vala
b/JSDOC/TokenReader.vala
index
a971019
..
9827db3
100644
(file)
--- a/
JSDOC/TokenReader.vala
+++ b/
JSDOC/TokenReader.vala
@@
-173,27
+173,32
@@
namespace JSDOC {
/**
@returns {Boolean} Was the token found?
*/
/**
@returns {Boolean} Was the token found?
*/
- public bool read_word (TokenStream stream, TokenArray tokens) {
- var found = "";
+ public bool read_word (TokenStream stream, TokenArray tokens)
+ {
+ string found = "";
while (!stream.lookEOF() && Lang.isWordChar(stream.look())) {
found += stream.next();
}
while (!stream.lookEOF() && Lang.isWordChar(stream.look())) {
found += stream.next();
}
- if (found ==
=
"") {
+ if (found == "") {
return false;
}
return false;
}
- var name;
- if ((name = Lang.keyword(found))) {
- if (found == 'return' && tokens.lastSym().data == ')') {
+ var name = Lang.keyword(found);
+ if (name) {
+
+ // look for () return ?? why ???
+
+ if (found == "return" && tokens.lastSym().data == ")") {
//Seed.print('@' + tokens.length);
//Seed.print('@' + tokens.length);
- var n = this.findPuncToken(tokens,
')'
);
+ var n = this.findPuncToken(tokens,
")"
);
//Seed.print(')@' + n);
//Seed.print(')@' + n);
- n = this.findPuncToken(tokens,
'('
, n-1);
+ n = this.findPuncToken(tokens,
"("
, n-1);
//Seed.print('(@' + n);
var lt = this.lastSym(tokens, n);
//Seed.print('(@' + n);
var lt = this.lastSym(tokens, n);
- print(JSON.stringify(lt));
+
+ //print(JSON.stringify(lt));
if (lt.type != 'KEYW' || ['IF', 'WHILE'].indexOf(lt.name) < -1) {
if (!this.ignoreBadGrammer) {
throw {
if (lt.type != 'KEYW' || ['IF', 'WHILE'].indexOf(lt.name) < -1) {
if (!this.ignoreBadGrammer) {
throw {