From 17156bffedfe3f19740e974c90fc412605a4bf51 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 2 Aug 2003 19:46:22 +0000 Subject: [PATCH] Fix parsing of WRT operator (it takes two operands, not one). svn path=/trunk/yasm/; revision=1027 --- modules/parsers/nasm/nasm-bison.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/parsers/nasm/nasm-bison.y b/modules/parsers/nasm/nasm-bison.y index 293f0c3e..6c8c120a 100644 --- a/modules/parsers/nasm/nasm-bison.y +++ b/modules/parsers/nasm/nasm-bison.y @@ -26,7 +26,7 @@ */ %{ #include -RCSID("$IdPath: yasm/modules/parsers/nasm/nasm-bison.y,v 1.93 2003/05/04 22:15:09 peter Exp $"); +RCSID("$IdPath$"); #define YASM_LIB_INTERNAL #define YASM_EXPR_INTERNAL @@ -441,7 +441,7 @@ dvexpr: INTNUM { $$ = p_expr_new_ident(yasm_expr_int($1)); } /*| '!' dvexpr { $$ = p_expr_new_branch(YASM_EXPR_LNOT, $2); }*/ | '~' dvexpr %prec UNARYOP { $$ = p_expr_new_branch(YASM_EXPR_NOT, $2); } | SEG dvexpr { $$ = p_expr_new_branch(YASM_EXPR_SEG, $2); } - | WRT dvexpr { $$ = p_expr_new_branch(YASM_EXPR_WRT, $2); } + | dvexpr WRT dvexpr { $$ = p_expr_new_tree($1, YASM_EXPR_WRT, $3); } | '(' dvexpr ')' { $$ = $2; } ; @@ -483,7 +483,7 @@ expr: INTNUM { $$ = p_expr_new_ident(yasm_expr_int($1)); } /*| '!' expr { $$ = p_expr_new_branch(YASM_EXPR_LNOT, $2); }*/ | '~' expr %prec UNARYOP { $$ = p_expr_new_branch(YASM_EXPR_NOT, $2); } | SEG expr { $$ = p_expr_new_branch(YASM_EXPR_SEG, $2); } - | WRT expr { $$ = p_expr_new_branch(YASM_EXPR_WRT, $2); } + | expr WRT expr { $$ = p_expr_new_tree($1, YASM_EXPR_WRT, $3); } | expr ':' expr { $$ = p_expr_new_tree($1, YASM_EXPR_SEGOFF, $3); } | '(' expr ')' { $$ = $2; } ;