mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 03:02:06 +00:00
Add syntax to push and modify stacks in one line (#1421)
This commit is contained in:
@@ -545,6 +545,7 @@ directive:
|
||||
| setcharmap
|
||||
| pushc
|
||||
| popc
|
||||
| pushc_setcharmap
|
||||
| load
|
||||
| shift
|
||||
| fail
|
||||
@@ -561,6 +562,7 @@ directive:
|
||||
| purge
|
||||
| pops
|
||||
| pushs
|
||||
| pushs_section
|
||||
| endsection
|
||||
| popo
|
||||
| pusho
|
||||
@@ -664,7 +666,16 @@ popo:
|
||||
pusho:
|
||||
POP_PUSHO {
|
||||
opt_Push();
|
||||
// Parsing 'optional_opt_list' will restore the lexer's normal mode
|
||||
lexer_SetMode(LEXER_RAW);
|
||||
} optional_opt_list
|
||||
;
|
||||
|
||||
optional_opt_list:
|
||||
%empty {
|
||||
lexer_SetMode(LEXER_NORMAL);
|
||||
}
|
||||
| opt_list
|
||||
;
|
||||
|
||||
pops:
|
||||
@@ -1067,6 +1078,13 @@ pushc:
|
||||
}
|
||||
;
|
||||
|
||||
pushc_setcharmap:
|
||||
POP_PUSHC ID {
|
||||
charmap_Push();
|
||||
charmap_Set($2);
|
||||
}
|
||||
;
|
||||
|
||||
popc:
|
||||
POP_POPC {
|
||||
charmap_Pop();
|
||||
@@ -1536,6 +1554,13 @@ section:
|
||||
}
|
||||
;
|
||||
|
||||
pushs_section:
|
||||
POP_PUSHS sect_mod string COMMA sect_type sect_org sect_attrs {
|
||||
sect_PushSection();
|
||||
sect_NewSection($3, (SectionType)$5, $6, $7, $2);
|
||||
}
|
||||
;
|
||||
|
||||
sect_mod:
|
||||
%empty {
|
||||
$$ = SECTION_NORMAL;
|
||||
|
||||
Reference in New Issue
Block a user