diff src/luan/interp/LuaParser.java @ 35:e51906de0f11

implement metatables git-svn-id: https://luan-java.googlecode.com/svn/trunk@36 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Tue, 18 Dec 2012 07:05:58 +0000
parents 0cdc1da466ee
children e3624b7cd603
line wrap: on
line diff
--- a/src/luan/interp/LuaParser.java	Sun Dec 16 09:23:56 2012 +0000
+++ b/src/luan/interp/LuaParser.java	Tue Dec 18 07:05:58 2012 +0000
@@ -23,7 +23,6 @@
 
 class LuaParser extends BaseParser<Object> {
 
-	static final String _G = "_G";
 	static final String _ENV = "_ENV";
 
 	static final class Frame {
@@ -37,8 +36,6 @@
 
 		Frame() {
 			this.parent = null;
-			upValueSymbols.add(_G);
-			upValueGetters.add(UpValue.globalGetter);
 			upValueSymbols.add(_ENV);
 			upValueGetters.add(UpValue.globalGetter);
 		}
@@ -673,7 +670,7 @@
 			return true;
 		Object obj1 = pop();
 		if( obj1 != null )
-			return push( new GetExpr( expr(obj1), expr(obj2) ) );
+			return push( new IndexExpr( expr(obj1), expr(obj2) ) );
 		String name = (String)obj2;
 		int index = stackIndex(name);
 		if( index != -1 )
@@ -681,7 +678,7 @@
 		index = upValueIndex(name);
 		if( index != -1 )
 			return push( new GetUpVar(index) );
-		return push( new GetExpr( env(), new ConstExpr(name) ) );
+		return push( new IndexExpr( env(), new ConstExpr(name) ) );
 	}
 
 	// function should be on top of the stack