X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fxwt%2Fjs%2FLexer.java;fp=src%2Forg%2Fxwt%2Fjs%2FLexer.java;h=5a6e02e06c06a3893e54280d29b54f3d49cccec2;hb=c2a138c3882a4bd8dce0212ac59765af5cb126c6;hp=1e2494ee605840d54868b690ced506ca43792cf6;hpb=add9c1c1765814ff41c3ae54ec0e5496aa747c6e;p=org.ibex.core.git diff --git a/src/org/xwt/js/Lexer.java b/src/org/xwt/js/Lexer.java index 1e2494e..5a6e02e 100644 --- a/src/org/xwt/js/Lexer.java +++ b/src/org/xwt/js/Lexer.java @@ -77,6 +77,7 @@ class Lexer implements Tokens { // Token Subtype Handlers ///////////////////////////////////////////////////////// + // FIXME: convert to a string switch private int getKeyword(String s) throws IOException { char c; switch (s.length()) { @@ -224,11 +225,8 @@ class Lexer implements Tokens { } } - if (!isInteger) this.number = new Double(dval); - else if (Byte.MIN_VALUE <= longval && longval <= Byte.MAX_VALUE) this.number = new Byte((byte)longval); - else if (Short.MIN_VALUE <= longval && longval <= Short.MAX_VALUE) this.number = new Short((short)longval); - else if (Integer.MIN_VALUE <= longval && longval <= Integer.MAX_VALUE) this.number = new Integer((int)longval); - else this.number = new Double(longval); + if (!isInteger) this.number = JS.N(dval); + else this.number = JS.N(longval); return NUMBER; } @@ -370,7 +368,7 @@ class Lexer implements Tokens { accumulator.append((char)lastread); } public String getString() throws IOException { - String ret = accumulator.toString(); + String ret = accumulator.toString().intern(); accumulator = null; return ret; }