Mercurial Hosting > luan
comparison src/luan/impl/GetUpVar.java @ 166:4eaee12f6c65
move luan/interp to impl
git-svn-id: https://luan-java.googlecode.com/svn/trunk@167 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Sun, 22 Jun 2014 04:17:38 +0000 |
parents | src/luan/interp/GetUpVar.java@7c08b611125d |
children |
comparison
equal
deleted
inserted
replaced
165:94bbc4cbc106 | 166:4eaee12f6c65 |
---|---|
1 package luan.impl; | |
2 | |
3 import luan.LuanSource; | |
4 | |
5 | |
6 final class GetUpVar extends CodeImpl implements Expr { | |
7 private final int index; | |
8 | |
9 GetUpVar(LuanSource.Element se,int index) { | |
10 super(se); | |
11 this.index = index; | |
12 } | |
13 | |
14 @Override public Object eval(LuanStateImpl luan) { | |
15 return luan.closure().upValues()[index].get(); | |
16 } | |
17 } |