Mercurial Hosting > luan
changeset 211:284eddd599b1
fix parsing bug
git-svn-id: https://luan-java.googlecode.com/svn/trunk@212 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Tue, 08 Jul 2014 19:31:05 +0000 |
parents | e84655b4c45e |
children | 5b9726553ac8 |
files | core/src/luan/impl/LuanParser.java dist/luan-core-trunk.jar dist/luan-logging-trunk.jar dist/luan-web-trunk.jar |
diffstat | 4 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/core/src/luan/impl/LuanParser.java Tue Jul 08 19:05:27 2014 +0000 +++ b/core/src/luan/impl/LuanParser.java Tue Jul 08 19:31:05 2014 +0000 @@ -188,7 +188,7 @@ FnDef Expression() throws ParseException { Spaces(In.NOTHING); int start = parser.begin(); - Expressions expr = Expr(In.NOTHING); + Expressions expr = ExprZ(In.NOTHING); if( expr != null && parser.endOfInput() ) { Stmt stmt = new ReturnStmt( se(start), expr ); return parser.success(newFnDef(start,stmt)); @@ -569,7 +569,7 @@ private Stmt ExpressionsStmt() throws ParseException { parser.begin(); - Expressions exp = Expr(In.NOTHING); + Expressions exp = ExprZ(In.NOTHING); if( exp instanceof FnCall || exp instanceof AndExpr || exp instanceof OrExpr ) return parser.success( new ExpressionsStmt(exp) ); return parser.failure(null); @@ -585,10 +585,10 @@ private Expressions RequiredExpr(In in) throws ParseException { parser.begin(); - return parser.success(required(Expr(in),"Bad expression")); + return parser.success(required(ExprZ(in),"Bad expression")); } - private Expressions Expr(In in) throws ParseException { + private Expressions ExprZ(In in) throws ParseException { parser.begin(); Expressions exp; return (exp = VarArgs(in)) != null @@ -833,7 +833,7 @@ Spaces(inParens); List<TableExpr.Field> fields = new ArrayList<TableExpr.Field>(); List<Expressions> builder = new ArrayList<Expressions>(); - while( Field(fields,builder,in) && FieldSep(inParens) ); + while( Field(fields,builder,inParens) && FieldSep(inParens) ); if( !parser.match('}') ) throw parser.exception("Expected table element or '}'"); Spaces(in); @@ -854,11 +854,11 @@ exp = NameExpr(in); if( exp!=null && parser.match('=') ) { Spaces(in); - fields.add( new TableExpr.Field( exp, required(expr(Expr(in))) ) ); + fields.add( new TableExpr.Field( exp, required(expr(ExprZ(in))) ) ); return parser.success(); } parser.rollback(); - Expressions exprs = Expr(in); + Expressions exprs = ExprZ(in); if( exprs != null ) { builder.add(exprs); return parser.success(); @@ -1042,7 +1042,7 @@ builder.add(exp); return parser.success(); } - exp = Expr(in); + exp = ExprZ(in); if( exp==null ) return parser.failure(); builder.add(exp);