/**
@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();
}
- if (found === "") {
+ if (found == "") {
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);
- var n = this.findPuncToken(tokens, ')');
+ var n = this.findPuncToken(tokens, ")");
//Seed.print(')@' + n);
- n = this.findPuncToken(tokens, '(', n-1);
+ n = this.findPuncToken(tokens, "(", n-1);
//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 {