diff core/src/luan/impl/SetTableEntry.java @ 511:e3fb9768dbb3

better error messages
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 22 May 2015 10:47:56 -0600
parents 92c3d22745b8
children f1601a4ce1aa
line wrap: on
line diff
--- a/core/src/luan/impl/SetTableEntry.java	Fri May 22 02:28:15 2015 -0600
+++ b/core/src/luan/impl/SetTableEntry.java	Fri May 22 10:47:56 2015 -0600
@@ -6,6 +6,7 @@
 import luan.LuanFunction;
 import luan.LuanElement;
 import luan.LuanMeta;
+import luan.LuanBit;
 import luan.modules.JavaLuan;
 
 
@@ -29,10 +30,11 @@
 			tbl.put(luan,key,value);
 			return;
 		}
+		LuanBit bit = luan.bit(el());
 		if( t != null && luan.hasJava() )
-			JavaLuan.__new_index(luan,t,key,value);
+			JavaLuan.__new_index(bit,t,key,value);
 		else
-			throw luan.bit(el).exception( "attempt to index '"+tableExpr.el().text()+"' (a " + Luan.type(t) + " value)" );
+			throw bit.exception( "attempt to index a " + Luan.type(t) + " value in '"+bit.el.text()+"'" );
 	}
 
 }