added '|=' implementation
authorkramm <kramm>
Tue, 6 Jan 2009 21:34:44 +0000 (21:34 +0000)
committerkramm <kramm>
Tue, 6 Jan 2009 21:34:44 +0000 (21:34 +0000)
lib/as3/parser.y

index d2188ef..1558aa4 100644 (file)
 %token<token> T_NEE "!=="
 %token<token> T_LE "<="
 %token<token> T_GE ">="
+%token<token> T_ORBY "|=" 
 %token<token> T_DIVBY "/=" 
 %token<token> T_MODBY "%="
 %token<token> T_MULBY "*="
 %right '?' ':'
 %left "||"
 %left "&&"
-%nonassoc '|'
+%left '|'
 %nonassoc '^'
 %nonassoc '&'
 %nonassoc "==" "!=" "===" "!=="
@@ -2399,6 +2400,12 @@ E : E "/=" E {
                $$.c = toreadwrite($1.c, c, 0, 0);
                $$.t = $1.t;
               }
+E : E "|=" E { 
+               code_t*c = abc_bitor($3.c);
+               c=converttype(c, TYPE_INT, $1.t);
+               $$.c = toreadwrite($1.c, c, 0, 0);
+               $$.t = $1.t;
+              }
 E : E "+=" E { 
                code_t*c = $3.c;
                if(TYPE_IS_INT($3.t) || TYPE_IS_UINT($3.t)) {