Fix parsing of WRT operator (it takes two operands, not one).

svn path=/trunk/yasm/; revision=1027
0.3
Peter Johnson 22 years ago
parent 0e8c56a4ed
commit 17156bffed
  1. 6
      modules/parsers/nasm/nasm-bison.y

@ -26,7 +26,7 @@
*/ */
%{ %{
#include <util.h> #include <util.h>
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_LIB_INTERNAL
#define YASM_EXPR_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 { $$ = p_expr_new_branch(YASM_EXPR_LNOT, $2); }*/
| '~' dvexpr %prec UNARYOP { $$ = p_expr_new_branch(YASM_EXPR_NOT, $2); } | '~' dvexpr %prec UNARYOP { $$ = p_expr_new_branch(YASM_EXPR_NOT, $2); }
| SEG dvexpr { $$ = p_expr_new_branch(YASM_EXPR_SEG, $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; } | '(' 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 { $$ = p_expr_new_branch(YASM_EXPR_LNOT, $2); }*/
| '~' expr %prec UNARYOP { $$ = p_expr_new_branch(YASM_EXPR_NOT, $2); } | '~' expr %prec UNARYOP { $$ = p_expr_new_branch(YASM_EXPR_NOT, $2); }
| SEG expr { $$ = p_expr_new_branch(YASM_EXPR_SEG, $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 ':' expr { $$ = p_expr_new_tree($1, YASM_EXPR_SEGOFF, $3); }
| '(' expr ')' { $$ = $2; } | '(' expr ')' { $$ = $2; }
; ;

Loading…
Cancel
Save