projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2003/05/12 05:02:44
[org.ibex.core.git]
/
src
/
org
/
xwt
/
js
/
Lexer.java
diff --git
a/src/org/xwt/js/Lexer.java
b/src/org/xwt/js/Lexer.java
index
93586ed
..
dfc83e0
100644
(file)
--- a/
src/org/xwt/js/Lexer.java
+++ b/
src/org/xwt/js/Lexer.java
@@
-1,5
+1,4
@@
-// This file was derived from org.mozilla.javascript.TokenStream; it
-// is covered by the NPL 1.1.
+// Derived from org.mozilla.javascript.TokenStream [NPL]
/**
* The contents of this file are subject to the Netscape Public
/**
* The contents of this file are subject to the Netscape Public
@@
-33,13
+32,15
@@
class Lexer {
private SmartReader in;
private boolean pushedBack = false;
private SmartReader in;
private boolean pushedBack = false;
- private int op;
+ public int op;
+ public int twoBack;
public Number number;
public String string;
public Lexer(Reader r) throws IOException { in = new SmartReader(r); }
public int peekToken() throws IOException { int ret = getToken(); pushBackToken(); return ret; }
public Number number;
public String string;
public Lexer(Reader r) throws IOException { in = new SmartReader(r); }
public int peekToken() throws IOException { int ret = getToken(); pushBackToken(); return ret; }
- public void pushBackToken() { if (pushedBack) throw new Error("can't push back twice"); pushedBack = true; }
+ public void pushBackToken() { pushBackToken(op); }
+ public void pushBackToken(int i) { if (pushedBack) throw new Error("can't push back twice"); pushedBack = true; op = i; }
// Token Constants //////////////////////////////////////////////////////////
// Token Constants //////////////////////////////////////////////////////////
@@
-373,7
+374,11
@@
class Lexer {
public int getToken() throws IOException {
if (pushedBack) { pushedBack = false; return op; }
public int getToken() throws IOException {
if (pushedBack) { pushedBack = false; return op; }
- return (op = _getToken());
+ do {
+ if (op != EOL) twoBack = op;
+ op = _getToken();
+ } while (op == EOL); // FIXME
+ return op;
}
public int _getToken() throws IOException {
}
public int _getToken() throws IOException {