Mercurial Hosting > luan
diff core/src/luan/impl/$Luan.java @ 651:140cc5191b7a
start compiling statements
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 01 Apr 2016 17:24:44 -0600 |
parents | d658eab7bf4c |
children | 067d9470184d |
line wrap: on
line diff
--- a/core/src/luan/impl/$Luan.java Thu Mar 31 22:43:51 2016 -0600 +++ b/core/src/luan/impl/$Luan.java Fri Apr 01 17:24:44 2016 -0600 @@ -27,6 +27,19 @@ } + private static List<Stmt> listStmt = new ArrayList<Stmt>(); + + static int addStmt(Stmt stmt) { + int i = listStmt.size(); + listStmt.add(stmt); + return i; + } + + public static Stmt getStmt(int i) { + return listStmt.get(i); + } + + public static Object first(Object obj) { return Luan.first(obj); } @@ -59,8 +72,12 @@ throw new LuanException("attempt to perform arithmetic on a "+Luan.type(o)+" value"); } + public static boolean checkBoolean(Object o) throws LuanException { + return Luan.checkBoolean(o); + } + public static boolean not(Object o) throws LuanException { - return !Luan.checkBoolean(o); + return !checkBoolean(o); } private static Object arithmetic(LuanState luan,String op,Object o1,Object o2) throws LuanException { @@ -175,4 +192,6 @@ return !(o == null || Boolean.FALSE.equals(o)); } + public static void nop(Object o) {} + }