annotate core/src/luan/impl/GetUpVar.java @ 586:a140be489a72

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 24 Aug 2015 02:17:46 -0600
parents 0742ac78fa69
children 859c0dedc8b6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
166
4eaee12f6c65 move luan/interp to impl
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 78
diff changeset
1 package luan.impl;
17
09d41f7490a8 add local variables
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
2
460
b48cfa14ba60 improve stack trace
Franklin Schmidt <fschmidt@gmail.com>
parents: 171
diff changeset
3 import luan.LuanElement;
40
e3624b7cd603 implement stack trace
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 32
diff changeset
4
17
09d41f7490a8 add local variables
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
5
40
e3624b7cd603 implement stack trace
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 32
diff changeset
6 final class GetUpVar extends CodeImpl implements Expr {
17
09d41f7490a8 add local variables
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
7 private final int index;
09d41f7490a8 add local variables
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
8
460
b48cfa14ba60 improve stack trace
Franklin Schmidt <fschmidt@gmail.com>
parents: 171
diff changeset
9 GetUpVar(LuanElement se,int index) {
40
e3624b7cd603 implement stack trace
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 32
diff changeset
10 super(se);
584
0742ac78fa69 add Luan.load_theme
Franklin Schmidt <fschmidt@gmail.com>
parents: 460
diff changeset
11 if( index < 0 ) throw new RuntimeException();
17
09d41f7490a8 add local variables
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
12 this.index = index;
09d41f7490a8 add local variables
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
13 }
09d41f7490a8 add local variables
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
14
49
8ede219cd111 add WebShell
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 48
diff changeset
15 @Override public Object eval(LuanStateImpl luan) {
78
7c08b611125d better deep cloning
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents: 49
diff changeset
16 return luan.closure().upValues()[index].get();
17
09d41f7490a8 add local variables
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
17 }
09d41f7490a8 add local variables
fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
parents:
diff changeset
18 }