mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
A slightly modified version of Brian Gugliemetti fix for bad interaction in TokenStream.getToken()/peekTokenSameLine() when dealing with EOL.
This commit is contained in:
parent
ed3d11ddae
commit
6d1229405a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user