From ec03b55d1a81b425afdb9ff708a5c3d146c385dd Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Sat, 16 Nov 2013 14:34:24 +0100 Subject: [PATCH] now it parses and has the desired precedence --- lexer.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lexer.h b/lexer.h index 2b5a741..ee9be17 100644 --- a/lexer.h +++ b/lexer.h @@ -185,13 +185,12 @@ static const oper_info c_operators[] = { { "++", 1, opid3('+','+','P'), ASSOC_RIGHT, 16, OP_PREFIX, false}, { "--", 1, opid3('-','-','P'), ASSOC_RIGHT, 16, OP_PREFIX, false}, - { "!", 1, opid2('!','P'), ASSOC_RIGHT, 15, OP_PREFIX, true}, - { "~", 1, opid2('~','P'), ASSOC_RIGHT, 15, OP_PREFIX, true}, - { "+", 1, opid2('+','P'), ASSOC_RIGHT, 15, OP_PREFIX, false}, - { "-", 1, opid2('-','P'), ASSOC_RIGHT, 15, OP_PREFIX, true}, -/* { "&", 1, opid2('&','P'), ASSOC_RIGHT, 15, OP_PREFIX, false}, */ - { "**", 2, opid2('*','*'), ASSOC_RIGHT, 14, 0, true}, + { "!", 1, opid2('!','P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, + { "~", 1, opid2('~','P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, + { "+", 1, opid2('+','P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, + { "-", 1, opid2('-','P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, +/* { "&", 1, opid2('&','P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, */ { "*", 2, opid1('*'), ASSOC_LEFT, 13, 0, true}, { "/", 2, opid1('/'), ASSOC_LEFT, 13, 0, true}, -- 2.39.2