mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 10:42:07 +00:00
Refactor code that handles when included files are missing
- Single unified routine for erroring out or handling missing dependencies - Single three-state enum instead of two Booleans for missing dependencies (this causes `-MC` to imply `-MG` instead of needing `-MG -MC`) - Functions than can miss included files return a Boolean for whether the parser should `YYACCEPT` and exit
This commit is contained in:
@@ -1139,8 +1139,7 @@ export_def:
|
||||
|
||||
include:
|
||||
label POP_INCLUDE string endofline {
|
||||
fstk_RunInclude($3, false);
|
||||
if (failedOnMissingInclude && !continueAfterMissingIncludes) {
|
||||
if (fstk_RunInclude($3)) {
|
||||
YYACCEPT;
|
||||
}
|
||||
}
|
||||
@@ -1148,20 +1147,17 @@ include:
|
||||
|
||||
incbin:
|
||||
POP_INCBIN string {
|
||||
sect_BinaryFile($2, 0);
|
||||
if (failedOnMissingInclude && !continueAfterMissingIncludes) {
|
||||
if (sect_BinaryFile($2, 0)) {
|
||||
YYACCEPT;
|
||||
}
|
||||
}
|
||||
| POP_INCBIN string COMMA uconst {
|
||||
sect_BinaryFile($2, $4);
|
||||
if (failedOnMissingInclude && !continueAfterMissingIncludes) {
|
||||
if (sect_BinaryFile($2, $4)) {
|
||||
YYACCEPT;
|
||||
}
|
||||
}
|
||||
| POP_INCBIN string COMMA uconst COMMA uconst {
|
||||
sect_BinaryFileSlice($2, $4, $6);
|
||||
if (failedOnMissingInclude && !continueAfterMissingIncludes) {
|
||||
if (sect_BinaryFileSlice($2, $4, $6)) {
|
||||
YYACCEPT;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user