mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Use charmaps in const expressions.
This commit is contained in:
@@ -1243,7 +1243,13 @@ const : T_ID { $$ = sym_GetConstantValue($1); }
|
||||
| T_NUMBER { $$ = $1; }
|
||||
| T_OP_HIGH '(' const ')' { $$ = ($3 >> 8) & 0xFF; }
|
||||
| T_OP_LOW '(' const ')' { $$ = $3 & 0xFF; }
|
||||
| string { $$ = str2int($1); }
|
||||
| string
|
||||
{
|
||||
char *s = $1;
|
||||
int32_t length = charmap_Convert(&s);
|
||||
$$ = str2int2(s, length);
|
||||
free(s);
|
||||
}
|
||||
| T_OP_LOGICNOT const %prec NEG { $$ = !$2; }
|
||||
| const T_OP_LOGICOR const { $$ = $1 || $3; }
|
||||
| const T_OP_LOGICAND const { $$ = $1 && $3; }
|
||||
|
||||
4
test/asm/equ-charmap.asm
Normal file
4
test/asm/equ-charmap.asm
Normal file
@@ -0,0 +1,4 @@
|
||||
SECTION "sec", ROM0
|
||||
charmap "A", 1
|
||||
_A_ EQU "A"
|
||||
db _A_
|
||||
0
test/asm/equ-charmap.out
Normal file
0
test/asm/equ-charmap.out
Normal file
1
test/asm/equ-charmap.out.bin
Normal file
1
test/asm/equ-charmap.out.bin
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user