Add syntax to push and modify stacks in one line (#1421)

This commit is contained in:
Sylvie
2024-07-25 17:14:59 -04:00
committed by GitHub
parent 1d89d75381
commit e179ba5fd3
9 changed files with 73 additions and 14 deletions

View File

@@ -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;