mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 10:42:07 +00:00
Implement BITWIDTH and TZCOUNT functions (#1450)
This commit is contained in:
@@ -174,6 +174,8 @@
|
||||
%type <int32_t> opt_q_arg
|
||||
|
||||
%token OP_HIGH "HIGH" OP_LOW "LOW"
|
||||
%token OP_BITWIDTH "BITWIDTH"
|
||||
%token OP_TZCOUNT "TZCOUNT"
|
||||
%token OP_ISCONST "ISCONST"
|
||||
|
||||
%token OP_STRCMP "STRCMP"
|
||||
@@ -1349,6 +1351,12 @@ relocexpr_no_str:
|
||||
| OP_LOW LPAREN relocexpr RPAREN {
|
||||
$$.makeUnaryOp(RPN_LOW, std::move($3));
|
||||
}
|
||||
| OP_BITWIDTH LPAREN relocexpr RPAREN {
|
||||
$$.makeUnaryOp(RPN_BITWIDTH, std::move($3));
|
||||
}
|
||||
| OP_TZCOUNT LPAREN relocexpr RPAREN {
|
||||
$$.makeUnaryOp(RPN_TZCOUNT, std::move($3));
|
||||
}
|
||||
| OP_ISCONST LPAREN relocexpr RPAREN {
|
||||
$$.makeNumber($3.isKnown());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user