A slightly modified version of Brian Gugliemetti fix for bad interaction in TokenStream.getToken()/peekTokenSameLine() when dealing with EOL.
This commit is contained in:
igor%mir2.org 2003-06-30 19:18:31 +00:00
Родитель ed3d11ddae
Коммит 6d1229405a
1 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -719,11 +719,7 @@ public class TokenStream {
public final int peekTokenSameLine() throws IOException {
flags |= TSF_NEWLINES; // SCAN_NEWLINES from jsscan.h
int result = getToken();
if (result == EOL) {
this.pushbackToken = EOF;
} else {
this.pushbackToken = result;
}
this.pushbackToken = result;
tokenno--;
flags &= ~TSF_NEWLINES; // HIDE_NEWLINES from jsscan.h
return result;
@ -737,7 +733,9 @@ public class TokenStream {
if (this.pushbackToken != EOF) {
int result = this.pushbackToken;
this.pushbackToken = EOF;
return result;
if (result != EOL || (flags & TSF_NEWLINES) != 0) {
return result;
}
}
retry: