Mercurial Hosting > luan
comparison src/luan/interp/UpValue.java @ 49:8ede219cd111
add WebShell
git-svn-id: https://luan-java.googlecode.com/svn/trunk@50 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 28 Dec 2012 19:35:04 +0000 |
parents | 64ecb7a3aad7 |
children | f86e4f77ef32 |
comparison
equal
deleted
inserted
replaced
48:64ecb7a3aad7 | 49:8ede219cd111 |
---|---|
34 isClosed = true; | 34 isClosed = true; |
35 stack = null; | 35 stack = null; |
36 } | 36 } |
37 | 37 |
38 static interface Getter { | 38 static interface Getter { |
39 public UpValue get(LuanStateImpl lua); | 39 public UpValue get(LuanStateImpl luan); |
40 } | 40 } |
41 | 41 |
42 static final class StackGetter implements Getter { | 42 static final class StackGetter implements Getter { |
43 private final int index; | 43 private final int index; |
44 | 44 |
45 StackGetter(int index) { | 45 StackGetter(int index) { |
46 this.index = index; | 46 this.index = index; |
47 } | 47 } |
48 | 48 |
49 public UpValue get(LuanStateImpl lua) { | 49 public UpValue get(LuanStateImpl luan) { |
50 return lua.getUpValue(index); | 50 return luan.getUpValue(index); |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 static final class NestedGetter implements Getter { | 54 static final class NestedGetter implements Getter { |
55 private final int index; | 55 private final int index; |
56 | 56 |
57 NestedGetter(int index) { | 57 NestedGetter(int index) { |
58 this.index = index; | 58 this.index = index; |
59 } | 59 } |
60 | 60 |
61 public UpValue get(LuanStateImpl lua) { | 61 public UpValue get(LuanStateImpl luan) { |
62 return lua.closure().upValues[index]; | 62 return luan.closure().upValues[index]; |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 static final Getter globalGetter = new Getter() { | 66 static final Getter globalGetter = new Getter() { |
67 public UpValue get(LuanStateImpl lua) { | 67 public UpValue get(LuanStateImpl luan) { |
68 return new UpValue(lua.global()); | 68 return new UpValue(luan.global()); |
69 } | 69 } |
70 }; | 70 }; |
71 | 71 |
72 } | 72 } |