comparison core/src/luan/impl/LuanParser.java @ 700:61b36d5895df

fix parser bugs
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 02 May 2016 21:54:24 -0600
parents b620b8e1010f
children 77e0c859c8a3
comparison
equal deleted inserted replaced
699:aef51c3ebe50 700:61b36d5895df
1361 return parser.success(); 1361 return parser.success();
1362 } 1362 }
1363 exp = ExprZ(in); 1363 exp = ExprZ(in);
1364 if( exp==null ) 1364 if( exp==null )
1365 return parser.failure(); 1365 return parser.failure();
1366 exp.addNewLines();
1366 builder.add(exp); 1367 builder.add(exp);
1367 while( parser.match(',') ) { 1368 while( parser.match(',') ) {
1368 Spaces(); 1369 Spaces();
1369 exp = TemplateExpressions(in); 1370 exp = TemplateExpressions(in);
1370 if( exp != null ) { 1371 if( exp != null ) {
1371 builder.add(exp); 1372 builder.add(exp);
1372 return parser.success(); 1373 return parser.success();
1373 } 1374 }
1374 builder.add( RequiredExpr(in) ); 1375 exp = RequiredExpr(in);
1376 exp.addNewLines();
1377 builder.add(exp);
1375 } 1378 }
1376 return parser.success(); 1379 return parser.success();
1377 } 1380 }
1378 1381
1379 private Expr SubExpr(In in) throws ParseException { 1382 private Expr SubExpr(In in) throws ParseException {
1739 while( parser.anyOf(" \t") || Comment() || ContinueOnNextLine() ); 1742 while( parser.anyOf(" \t") || Comment() || ContinueOnNextLine() );
1740 } 1743 }
1741 1744
1742 private boolean ContinueOnNextLine() { 1745 private boolean ContinueOnNextLine() {
1743 parser.begin(); 1746 parser.begin();
1744 return parser.match('\\') && EndOfLine() ? parser.success() : parser.failure(); 1747 if( parser.match('\\') && EndOfLine() ) {
1748 parser.upSb();
1749 return parser.success();
1750 } else
1751 return parser.failure();
1745 } 1752 }
1746 1753
1747 private boolean Comment() throws ParseException { 1754 private boolean Comment() throws ParseException {
1748 if( LongComment() ) 1755 if( LongComment() )
1749 return true; 1756 return true;