diff options
Diffstat (limited to 'source/20-codegen-compiler/main.cpp')
-rw-r--r-- | source/20-codegen-compiler/main.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/source/20-codegen-compiler/main.cpp b/source/20-codegen-compiler/main.cpp index 5b82d02..845f2f2 100644 --- a/source/20-codegen-compiler/main.cpp +++ b/source/20-codegen-compiler/main.cpp @@ -229,17 +229,6 @@ TryConsumeDirectiveArgumentList(CodegenLexer& lexer) { return result; } -std::vector<const StbLexerToken*>* -GetDirectiveArgument(std::vector<std::vector<const StbLexerToken*>>& list, size_t idx, const char* errMsg = nullptr) { - if (idx < list.size()) { - if (errMsg) { - printf("%s", errMsg); - } - return &list[idx]; - } - return nullptr; -} - bool TryConsumeKeyword(CodegenLexer& lexer, CppKeyword keyword) { auto& token = lexer.Current(); if (token.type == CLEX_id) { @@ -1360,11 +1349,19 @@ where --output-dir=<path>: the *directory* to write generated contents to. Thi } for (auto decl : as.enumsToRevisit) { + if (!decl->generating) { + continue; + } + auto& headerOutput = decl->sourceFile->postHeaderOutput; auto& sourceOutput = decl->sourceFile->postSourceOutput; GenerateForEnum(headerOutput, sourceOutput, *decl); } for (auto decl : as.structsToRevisit) { + if (!decl->generating) { + continue; + } + auto& headerOutput = decl->sourceFile->postHeaderOutput; auto& sourceOutput = decl->sourceFile->postSourceOutput; |