diff --git a/meta/foldhaus_meta.cpp b/meta/foldhaus_meta.cpp index 4842b80..b4f3211 100644 --- a/meta/foldhaus_meta.cpp +++ b/meta/foldhaus_meta.cpp @@ -17,14 +17,9 @@ #include #include "..\src\gs_platform.h" #include -#if 1 -#include "..\src\gs_string.h" -#else #include -#endif #include -#include "gs_meta_error.h" #include "gs_meta_lexer.h" struct error_buffer @@ -96,7 +91,6 @@ PrintAllErrors (errors Errors) } #include "foldhaus_meta_type_table.h" -error_list GlobalErrorList = {}; PLATFORM_ALLOC(StdAlloc) { @@ -233,7 +227,7 @@ GetFileSize (char* FileName) } internal s32 -ReadEntireFileAndNullTerminate (source_code_file* File) +ReadEntireFileAndNullTerminate (source_code_file* File, errors* Errors) { s32 LengthRead = 0; @@ -257,7 +251,7 @@ ReadEntireFileAndNullTerminate (source_code_file* File) } else { - LogError(&GlobalErrorList, "Could Not Read File: %.*s", StringExpand(File->Path)); + PushFError(Errors, "Could Not Read File: %S", File->Path); } return LengthRead; @@ -326,7 +320,7 @@ AddFileToSource(string RelativePath, gs_bucket* SourceFiles, e CopyStringTo(RelativePath, &File.Path); NullTerminate(&File.Path); - File.FileSize = ReadEntireFileAndNullTerminate(&File); + File.FileSize = ReadEntireFileAndNullTerminate(&File, Errors); if (File.FileSize > 0) { @@ -1348,7 +1342,6 @@ int main(int ArgCount, char** ArgV) } errors Errors = {0}; - gs_bucket SourceFiles; string CurrentWorkingDirectory = MakeString((char*)malloc(1024), 0, 1024); @@ -1364,7 +1357,6 @@ int main(int ArgCount, char** ArgV) CopyStringTo(RootPath, &CurrentWorkingDirectory); } - // NOTE(Peter): this is a temporary list of GSMetaTags. It gets copied and cleared // after use gs_bucket Tokens; @@ -1479,8 +1471,6 @@ int main(int ArgCount, char** ArgV) fclose(TypeInfoH); } - PrintErrorList(GlobalErrorList); - s64 TotalEnd = GetWallClock(); r32 TotalTime = GetSecondsElapsed(TotalStart, TotalEnd); printf("Metaprogram Preproc Time: %.*f sec\n", 6, TotalTime); diff --git a/meta/gs_meta_lexer.h b/meta/gs_meta_lexer.h index 4861cdf..0923360 100644 --- a/meta/gs_meta_lexer.h +++ b/meta/gs_meta_lexer.h @@ -258,47 +258,5 @@ GetNextToken (tokenizer* Tokenizer) Result.Text.Length += EatIdentifier(Tokenizer); } - return Result; -} - -internal s32 -FindNextMatchingToken (u32 TokenAt, u32 TokenMax, gs_bucket Tokens, token_selection_spec Spec) -{ - s32 Result = -1; - - s32 Start = (s32)TokenAt + 1; - for (s32 i = Start; i < (s32)TokenMax; i++) - { - token* Token = Tokens.GetElementAtIndex(i); - - if (Token->Text.Memory) - { - if (Spec.MatchText && StringsEqual(Spec.Text, Token->Text)) - { - Result = i; - break; - } - } - } - - return Result; -} - -internal s32 -GetNextTokenOfType (s32 TokenAtIndex, s32 Max, gs_bucket Tokens, token_type Type) -{ - s32 Result = -1; - - s32 Start = TokenAtIndex + 1; - for (s32 i = Start; i < Max; i++) - { - token* At = Tokens.GetElementAtIndex(i); - if (At->Type == Type) - { - Result = i; - break; - } - } - return Result; } \ No newline at end of file