X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FLexer.java;fp=src%2Forg%2Fxwt%2Fjs%2FLexer.java;h=f4c386e2e79ab8808ca96ee8e225dd620fe3bba8;hb=d5f0e6ca91a3359b09352d3df367d6b6bd22f096;hp=4752c649561208234fb369a6a00eeffe2009053c;hpb=c3a9a6282c52e242c06d8e47660ab7aea09bdca4;p=org.ibex.core.git diff --git a/src/org/xwt/js/Lexer.java b/src/org/xwt/js/Lexer.java index 4752c64..f4c386e 100644 --- a/src/org/xwt/js/Lexer.java +++ b/src/org/xwt/js/Lexer.java @@ -17,6 +17,8 @@ * Contributor(s): Roger Lawrence, Mike McCabe */ +// FIXME: mark lots of these methods 'final' so they get inlined + package org.xwt.js; import java.io.*; @@ -32,6 +34,9 @@ class Lexer implements Tokens { /** the token that was just parsed */ protected int op; + + /** the most recently parsed token, regardless of pushbacks */ + protected int mostRecentlyReadToken; /** if the token just parsed was a NUMBER, this is the numeric value */ protected Number number = null; @@ -400,7 +405,10 @@ class Lexer implements Tokens { public int getToken() throws IOException { number = null; string = null; - if (pushBackDepth == 0) return op = _getToken(); + if (pushBackDepth == 0) { + mostRecentlyReadToken = op; + return op = _getToken(); + } pushBackDepth--; op = pushBackInts[pushBackDepth]; if (pushBackObjects[pushBackDepth] != null) {