Mercurial Hosting > luan
comparison core/src/luan/impl/LuanParser.java @ 324:b24a35612947
minor parsing improvement
git-svn-id: https://luan-java.googlecode.com/svn/trunk@325 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Mon, 09 Feb 2015 23:15:42 +0000 |
parents | 7f7708e8fdd4 |
children | db37d6aee4db |
comparison
equal
deleted
inserted
replaced
323:cd2924a1052c | 324:b24a35612947 |
---|---|
81 this.parens = parens; | 81 this.parens = parens; |
82 this.template = template; | 82 this.template = template; |
83 } | 83 } |
84 | 84 |
85 In parens() { | 85 In parens() { |
86 return parens ? this : new In(true,template); | 86 return parens ? this : new In(true,false); |
87 } | 87 } |
88 | 88 |
89 In template() { | 89 In template() { |
90 return template ? this : new In(parens,true); | 90 return template ? this : new In(false,true); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 private static final String _ENV = "_ENV"; | 94 private static final String _ENV = "_ENV"; |
95 private static final UpValue.Getter[] NO_UP_VALUE_GETTERS = new UpValue.Getter[0]; | 95 private static final UpValue.Getter[] NO_UP_VALUE_GETTERS = new UpValue.Getter[0]; |
792 In inParens = in.parens(); | 792 In inParens = in.parens(); |
793 Spaces(inParens); | 793 Spaces(inParens); |
794 List<TableExpr.Field> fields = new ArrayList<TableExpr.Field>(); | 794 List<TableExpr.Field> fields = new ArrayList<TableExpr.Field>(); |
795 List<Expressions> builder = new ArrayList<Expressions>(); | 795 List<Expressions> builder = new ArrayList<Expressions>(); |
796 while( Field(fields,builder,inParens) && FieldSep(inParens) ); | 796 while( Field(fields,builder,inParens) && FieldSep(inParens) ); |
797 Expressions exp = TemplateExpressions(in); | 797 Expressions exp = TemplateExpressions(inParens); |
798 if( exp != null ) | 798 if( exp != null ) |
799 builder.add(exp); | 799 builder.add(exp); |
800 if( !parser.match('}') ) | 800 if( !parser.match('}') ) |
801 throw parser.exception("Expected table element or '}'"); | 801 throw parser.exception("Expected table element or '}'"); |
802 Spaces(in); | 802 Spaces(in); |