comparison src/luan/interp/ConstExpr.java @ 108:3c404a296995

make Package module more standard; return _ENV by default; add "import" statement; git-svn-id: https://luan-java.googlecode.com/svn/trunk@109 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Fri, 23 May 2014 03:21:54 +0000
parents 8ede219cd111
children 14281d5bd36f
comparison
equal deleted inserted replaced
107:dbf459397217 108:3c404a296995
1 package luan.interp; 1 package luan.interp;
2 2
3 import luan.LuanSource; 3 import luan.LuanSource;
4 4
5 5
6 final class ConstExpr implements Expr { 6 final class ConstExpr extends CodeImpl implements Expr {
7 private final Object obj; 7 private final Object obj;
8 8
9 ConstExpr(Object obj) { 9 ConstExpr(Object obj) {
10 this(null,obj);
11 }
12
13 ConstExpr(LuanSource.Element se,Object obj) {
14 super(se);
10 this.obj = obj; 15 this.obj = obj;
11 } 16 }
12 17
13 @Override public Object eval(LuanStateImpl luan) { 18 @Override public Object eval(LuanStateImpl luan) {
14 return obj; 19 return obj;
15 } 20 }
16
17 @Override public final LuanSource.Element se() {
18 return null;
19 }
20 } 21 }