projects
/
org.ibex.core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ab37ce
)
2003/05/02 13:30:51
author
megacz
<megacz@xwt.org>
Fri, 30 Jan 2004 06:59:42 +0000
(06:59 +0000)
committer
megacz
<megacz@xwt.org>
Fri, 30 Jan 2004 06:59:42 +0000
(06:59 +0000)
darcs-hash:
20040130065942
-2ba56-
090b97b8a606c0800c145fdb032db57d98de01cb
.gz
src/org/xwt/js/Lexer.java
patch
|
blob
|
history
diff --git
a/src/org/xwt/js/Lexer.java
b/src/org/xwt/js/Lexer.java
index
93586ed
..
92cb4a6
100644
(file)
--- a/
src/org/xwt/js/Lexer.java
+++ b/
src/org/xwt/js/Lexer.java
@@
-33,13
+33,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
+375,12
@@
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
+ //if (op == SEMI) throw new Error();
+ return op;
}
public int _getToken() throws IOException {
}
public int _getToken() throws IOException {