mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-22 19:22:05 +00:00
Change FOREACH to FOR (#680)
This commit is contained in:
@@ -310,7 +310,7 @@ static inline void failAssertMsg(enum AssertionType type, char const *msg)
|
||||
int32_t start;
|
||||
int32_t stop;
|
||||
int32_t step;
|
||||
} foreachArgs;
|
||||
} forArgs;
|
||||
struct StrFmtArgList strfmtArgs;
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ static inline void failAssertMsg(enum AssertionType type, char const *msg)
|
||||
%token T_POP_ENDM
|
||||
%token T_POP_RSRESET T_POP_RSSET
|
||||
%token T_POP_UNION T_POP_NEXTU T_POP_ENDU
|
||||
%token T_POP_INCBIN T_POP_REPT T_POP_FOREACH
|
||||
%token T_POP_INCBIN T_POP_REPT T_POP_FOR
|
||||
%token T_POP_CHARMAP
|
||||
%token T_POP_NEWCHARMAP
|
||||
%token T_POP_SETCHARMAP
|
||||
@@ -431,7 +431,7 @@ static inline void failAssertMsg(enum AssertionType type, char const *msg)
|
||||
%type <sectMod> sectmod
|
||||
%type <macroArg> macroargs
|
||||
|
||||
%type <foreachArgs> foreach_args
|
||||
%type <forArgs> for_args
|
||||
|
||||
%token T_Z80_ADC T_Z80_ADD T_Z80_AND
|
||||
%token T_Z80_BIT
|
||||
@@ -634,7 +634,7 @@ simple_pseudoop : include
|
||||
| popc
|
||||
| load
|
||||
| rept
|
||||
| foreach
|
||||
| for
|
||||
| shift
|
||||
| fail
|
||||
| warn
|
||||
@@ -758,15 +758,15 @@ rept : T_POP_REPT uconst {
|
||||
}
|
||||
;
|
||||
|
||||
foreach : T_POP_FOREACH T_ID T_COMMA foreach_args {
|
||||
for : T_POP_FOR T_ID T_COMMA for_args {
|
||||
uint32_t nDefinitionLineNo = lexer_GetLineNo();
|
||||
char *body;
|
||||
size_t size;
|
||||
lexer_CaptureRept(&body, &size);
|
||||
fstk_RunForeach($2, $4.start, $4.stop, $4.step, nDefinitionLineNo, body, size);
|
||||
fstk_RunFor($2, $4.start, $4.stop, $4.step, nDefinitionLineNo, body, size);
|
||||
}
|
||||
|
||||
foreach_args : const {
|
||||
for_args : const {
|
||||
$$.start = 0;
|
||||
$$.stop = $1;
|
||||
$$.step = 1;
|
||||
|
||||
Reference in New Issue
Block a user