From 623046dda82afac9aece37145c25c6a8bc50fa64 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 27 Jul 2012 12:53:15 +0200 Subject: [PATCH] the comma is now in the operator list --- lexer.h | 2 ++ parser.c | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lexer.h b/lexer.h index c23f944..ae8812b 100644 --- a/lexer.h +++ b/lexer.h @@ -183,6 +183,8 @@ static const oper_info operators[] = { { "&=", 2, opid2('&','='), ASSOC_RIGHT, 2, 0 }, { "^=", 2, opid2('^','='), ASSOC_RIGHT, 2, 0 }, { "|=", 2, opid2('|','='), ASSOC_RIGHT, 2, 0 }, + + { ",", 2, opid1(','), ASSOC_LEFT, 1, 0 } }; static const size_t operator_count = (sizeof(operators) / sizeof(operators[0])); diff --git a/parser.c b/parser.c index 56f20f2..75c6911 100644 --- a/parser.c +++ b/parser.c @@ -458,12 +458,6 @@ static ast_expression* parser_expression(parser_t *parser) goto onerr; } } - else if (parser->tok == ',') { - if (!shunt_ops_add(&sy, syparen(parser_ctx(parser), ','))) { - parseerror(parser, "out of memory"); - goto onerr; - } - } else if (parser->tok == ')') { /* we do expect an operator next */ /* closing an opening paren */ -- 2.39.2