Browse Source

Allow empty ()

Required for lambdas
kindlich 4 years ago
parent
commit
e11d51a9a9
No known key found for this signature in database

+ 3
- 0
Parser/src/main/java/org/openzen/zenscript/parser/expression/ParsedExpression.java View File

508
 				parser.next();
508
 				parser.next();
509
 				List<ParsedExpression> expressions = new ArrayList<>();
509
 				List<ParsedExpression> expressions = new ArrayList<>();
510
 				do {
510
 				do {
511
+					if(parser.peek().type == T_BRCLOSE) {
512
+						break;
513
+					}
511
 					expressions.add(readAssignExpression(parser, options));
514
 					expressions.add(readAssignExpression(parser, options));
512
 				} while (parser.optional(ZSTokenType.T_COMMA) != null);
515
 				} while (parser.optional(ZSTokenType.T_COMMA) != null);
513
 				parser.required(T_BRCLOSE, ") expected");
516
 				parser.required(T_BRCLOSE, ") expected");

Loading…
Cancel
Save