diff options
author | volth <volth@volth.com> | 2018-05-12T16·50+0000 |
---|---|---|
committer | volth <volth@volth.com> | 2018-05-12T16·50+0000 |
commit | 8a6a14e1f5006543f63117fb1f0a81a0b1024ebd (patch) | |
tree | 1c3993411faefa9ab8588f6b53c0198005320178 /src/libexpr/parser.y | |
parent | 1ad19232c4bbecb06e6acbb2a3a538544a28e1f2 (diff) |
add `mod' and bitwise builtins
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r-- | src/libexpr/parser.y | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index eee48887dc22..6beb28868e8a 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -338,6 +338,13 @@ expr_op | expr_op '-' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__sub")), $1), $3); } | expr_op '*' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__mul")), $1), $3); } | expr_op '/' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__div")), $1), $3); } + | expr_op '%' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__mod")), $1), $3); } + | expr_op '&' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__bin_and")), $1), $3); } + | expr_op '|' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__bin_or")), $1), $3); } + | expr_op '^' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__bin_xor")), $1), $3); } + | expr_op '<<' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__bin_shl")), $1), $3); } + | expr_op '>>>' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__bin_unsigned_shr")), $1), $3); } + | expr_op '>>' expr_op { $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.create("__bin_signed_shr")), $1), $3); } | expr_op CONCAT expr_op { $$ = new ExprOpConcatLists(CUR_POS, $1, $3); } | expr_app ; |