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:
Rangi42
2025-07-18 14:03:23 -04:00
parent b80b30fba1
commit e7d63f5f6b
9 changed files with 72 additions and 76 deletions

View File

@@ -15,11 +15,16 @@ extern bool verbose;
} \
} while (0)
enum MissingInclude {
INC_ERROR, // A missing included file is an error that halts assembly
GEN_EXIT, // A missing included file is assumed to be generated; exit normally
GEN_CONTINUE, // A missing included file is assumed to be generated; continue assembling
};
extern FILE *dependFile;
extern std::string targetFileName;
extern bool continueAfterMissingIncludes;
extern bool generatedMissingIncludes;
extern bool failedOnMissingInclude;
extern MissingInclude missingIncludeState;
extern bool generatePhonyDeps;
extern bool failedOnMissingInclude;
#endif // RGBDS_ASM_MAIN_HPP