Mercurial Hosting > luan
changeset 533:8e51d6071b67
restore LuanTable.hasJava
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 27 May 2015 23:40:09 -0600 |
parents | 9bf9ad733827 |
children | 115cae4ac8fd |
files | core/src/luan/LuanTable.java core/src/luan/impl/LuanParser.java core/src/luan/impl/LuanStateImpl.java |
diffstat | 3 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
diff -r 9bf9ad733827 -r 8e51d6071b67 core/src/luan/LuanTable.java --- a/core/src/luan/LuanTable.java Wed May 27 22:19:46 2015 -0600 +++ b/core/src/luan/LuanTable.java Wed May 27 23:40:09 2015 -0600 @@ -22,6 +22,7 @@ private Map map = null; private List list = null; private LuanTable metatable = null; + public boolean hasJava = false; public LuanTable() {} @@ -80,6 +81,7 @@ } if( metatable != null ) clone.metatable = (LuanTable)cloner.get(metatable); + clone.hasJava = hasJava; } public boolean isList() {
diff -r 9bf9ad733827 -r 8e51d6071b67 core/src/luan/impl/LuanParser.java --- a/core/src/luan/impl/LuanParser.java Wed May 27 22:19:46 2015 -0600 +++ b/core/src/luan/impl/LuanParser.java Wed May 27 23:40:09 2015 -0600 @@ -25,10 +25,10 @@ final List<String> upValueSymbols = new ArrayList<String>(); final List<UpValue.Getter> upValueGetters = new ArrayList<UpValue.Getter>(); - Frame() { + Frame(LuanTable java) { this.parent = null; upValueSymbols.add(JAVA); - upValueGetters.add(new UpValue.ValueGetter(false)); + upValueGetters.add(new UpValue.ValueGetter(java)); } Frame(Frame parent) { @@ -103,7 +103,7 @@ LuanParser(LuanSource source,LuanTable env) { this.source = source; - this.frame = new Frame(); + this.frame = new Frame( env!=null ? env : new LuanTable() ); this.parser = new Parser(source); if( env != null ) addVar(_ENV,env);
diff -r 9bf9ad733827 -r 8e51d6071b67 core/src/luan/impl/LuanStateImpl.java --- a/core/src/luan/impl/LuanStateImpl.java Wed May 27 22:19:46 2015 -0600 +++ b/core/src/luan/impl/LuanStateImpl.java Wed May 27 23:40:09 2015 -0600 @@ -111,11 +111,11 @@ @Override public boolean hasJava() { if( frame==null ) return false; - return (Boolean)frame.closure.upValues()[0].get(); + return ((LuanTable)frame.closure.upValues()[0].get()).hasJava; } @Override public void setJava() { - frame.closure.upValues()[0].set(true); + ((LuanTable)frame.closure.upValues()[0].get()).hasJava = true; } @Override public LuanSource currentSource(){