Merge pull request #490 from ISSOtm/const

Implement `ISCONST`, reporting compile-time constness
This commit is contained in:
Eldred Habert
2020-03-21 23:20:01 +01:00
committed by GitHub
8 changed files with 64 additions and 1 deletions

View File

@@ -543,6 +543,7 @@ static void strsubUTF8(char *dest, const char *src, uint32_t pos, uint32_t len)
%left T_OP_FLOOR
%token T_OP_HIGH T_OP_LOW
%token T_OP_ISCONST
%left T_OP_STRCMP
%left T_OP_STRIN
@@ -1301,6 +1302,7 @@ relocexpr_no_str : scoped_id { rpn_Symbol(&$$, $1); }
| T_OP_NOT relocexpr %prec NEG { rpn_UNNOT(&$$, &$2); }
| T_OP_HIGH '(' relocexpr ')' { rpn_HIGH(&$$, &$3); }
| T_OP_LOW '(' relocexpr ')' { rpn_LOW(&$$, &$3); }
| T_OP_ISCONST '(' relocexpr ')'{ rpn_ISCONST(&$$, &$3); }
| T_OP_BANK '(' scoped_id ')' {
/* '@' is also a T_ID, it is handled here. */
rpn_BankSymbol(&$$, $3);