{
string found = "";
var name;
- while (!stream.look().eof && Lang.punc(found + stream.look()).length > 0) {
+ while (!stream.lookEOF() && Lang.punc(found + stream.look()).length > 0) {
found += stream.next();
}
tokens.push(new Token(found, "PUNC", Lang.punc(found), this.line));
return true;
- },
+ }
/**
@returns {Boolean} Was the token found?
*/
- read_space : function(/**JSDOC.TokenStream*/stream, tokens) {
+ public bool read_space (TokenStream stream, TokenArray tokens)
+ {
var found = "";
- while (!stream.look().eof && Lang.isSpace(stream.look()) && !Lang.isNewline(stream.look())) {
+ while (!stream.lookEOF() && Lang.isSpace(stream.look()) && !Lang.isNewline(stream.look())) {
found += stream.next();
}
if (found === "") {
return false;
}
- //print("WHITE = " + JSON.stringify(found));
- if (this.collapseWhite) found = " ";
- if (this.keepWhite) tokens.push(new Token(found, "WHIT", "SPACE", this.line));
+ //print("WHITE = " + JSON.stringify(found));
+
+ // if we found a new line, then we could check if previous character was a ';' - if so we can drop it.
+ // otherwise generally keep it.. in which case it should reduce our issue with stripping new lines..
+
+ if (this.collapseWhite) {
+ found = " "; // this might work better if it was a '\n' ???
+ }
+ if (this.keepWhite) {
+ tokens.push(new Token(found, "WHIT", "SPACE", this.line));
+ }
return true;
},
/**
@returns {Boolean} Was the token found?
*/
- read_newline : function(/**JSDOC.TokenStream*/stream, tokens) {
+ public bool read_newline (TokenStream stream, TokenArray tokens)
var found = "";
var line = this.line;
while (!stream.look().eof && Lang.isNewline(stream.look())) {