Mercurial Hosting > luan
comparison core/src/luan/impl/LuanParser.java @ 533:8e51d6071b67
restore LuanTable.hasJava
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 27 May 2015 23:40:09 -0600 |
parents | 92c3d22745b8 |
children | 115cae4ac8fd |
comparison
equal
deleted
inserted
replaced
532:9bf9ad733827 | 533:8e51d6071b67 |
---|---|
23 int loops = 0; | 23 int loops = 0; |
24 boolean isVarArg = false; | 24 boolean isVarArg = false; |
25 final List<String> upValueSymbols = new ArrayList<String>(); | 25 final List<String> upValueSymbols = new ArrayList<String>(); |
26 final List<UpValue.Getter> upValueGetters = new ArrayList<UpValue.Getter>(); | 26 final List<UpValue.Getter> upValueGetters = new ArrayList<UpValue.Getter>(); |
27 | 27 |
28 Frame() { | 28 Frame(LuanTable java) { |
29 this.parent = null; | 29 this.parent = null; |
30 upValueSymbols.add(JAVA); | 30 upValueSymbols.add(JAVA); |
31 upValueGetters.add(new UpValue.ValueGetter(false)); | 31 upValueGetters.add(new UpValue.ValueGetter(java)); |
32 } | 32 } |
33 | 33 |
34 Frame(Frame parent) { | 34 Frame(Frame parent) { |
35 this.parent = parent; | 35 this.parent = parent; |
36 if( upValueIndex(JAVA) != 0 ) | 36 if( upValueIndex(JAVA) != 0 ) |
101 private Frame frame; | 101 private Frame frame; |
102 private final Parser parser; | 102 private final Parser parser; |
103 | 103 |
104 LuanParser(LuanSource source,LuanTable env) { | 104 LuanParser(LuanSource source,LuanTable env) { |
105 this.source = source; | 105 this.source = source; |
106 this.frame = new Frame(); | 106 this.frame = new Frame( env!=null ? env : new LuanTable() ); |
107 this.parser = new Parser(source); | 107 this.parser = new Parser(source); |
108 if( env != null ) | 108 if( env != null ) |
109 addVar(_ENV,env); | 109 addVar(_ENV,env); |
110 } | 110 } |
111 | 111 |