From 7dc483c8f66b747032ec2bc3e77c8ac799d5ae89 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Mon, 30 Jan 2017 12:30:03 -0500 Subject: [PATCH] site fixup --- 4ed_site.ctm | Bin 948 -> 1060 bytes meta/build.cpp | 2 -- meta/meta_parser.cpp | 1 - site/build.bat | 3 ++- site/sitegen.cpp | 29 +++++++++++++++++------------ 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/4ed_site.ctm b/4ed_site.ctm index bf940c13e94d2e4b27c01c92bc3df6e5821117fe..02ad508c04c238243b70acc4c13ff8f8d657e4f9 100644 GIT binary patch delta 120 zcmdnOzJz1L7UqHw|E+7KsxL7zGcYhTb22b|dZMNw3*<8b`57Dx3>M`Ix-kBGZ3c$K ne2=*xK1ls{AaUSN`4Skv38;VPTuEj*sQgACe|x-Y88ROL?Asq7 delta 7 OcmZ3&v4wrZ7G?ko&H~Q> diff --git a/meta/build.cpp b/meta/build.cpp index 0134e9e6..96d75f6a 100644 --- a/meta/build.cpp +++ b/meta/build.cpp @@ -462,10 +462,8 @@ site_build(char *cdir, u32 flags){ { BEGIN_TIME_SECTION(); - DECL_STR(cmd, "../build/site/sitegen . ../site_resources site/source_material ../site"); systemf("%s", cmd); - END_TIME_SECTION("run sitegen"); } } diff --git a/meta/meta_parser.cpp b/meta/meta_parser.cpp index df139e8e..70d70e26 100644 --- a/meta/meta_parser.cpp +++ b/meta/meta_parser.cpp @@ -1220,7 +1220,6 @@ compile_meta_unit(Partition *part, char *code_directory, char **files, Meta_Keyw } } - if (all_files_lexed){ // TODO(allen): This stage counts nested structs and unions which is not correct. Luckily it only means we over allocate by a few items, but fixing it to be exactly correct would be nice. for (int32_t J = 0; J < unit.count; ++J){ diff --git a/site/build.bat b/site/build.bat index 7bfe409f..428c6bed 100644 --- a/site/build.bat +++ b/site/build.bat @@ -15,4 +15,5 @@ popd ..\build\build if %ERRORLEVEL% neq 0 (set FirstError=1) -call "ctime" -end 4ed_site.ctm %FirstError% \ No newline at end of file +call "ctime" -end 4ed_site.ctm %FirstError% + diff --git a/site/sitegen.cpp b/site/sitegen.cpp index 03e30a2f..d30a187d 100644 --- a/site/sitegen.cpp +++ b/site/sitegen.cpp @@ -21,6 +21,8 @@ #include #include "../4tech_defines.h" +#include "../meta/4tech_meta_defines.h" + #include "../4coder_API/version.h" #define FSTRING_IMPLEMENTATION #include "../4coder_lib/4coder_string.h" @@ -185,22 +187,21 @@ generate_4coder_docs(Document_System *doc_system, Partition *part, char *code_di Enriched_Text *introduction = push_struct(part, Enriched_Text); Enriched_Text *lexer_introduction = push_struct(part, Enriched_Text); - // NOTE(allen): Parse the important code. - *custom_types_unit = compile_meta_unit(part, code_directory, "4coder_types.h", ExpandArray(meta_keywords)); + // NOTE(allen): Parse the code. + *custom_types_unit = compile_meta_unit(part, code_directory, "4coder_API/types.h", ExpandArray(meta_keywords)); + Assert(custom_types_unit->count != 0); - *lexer_funcs_unit = compile_meta_unit(part, code_directory, "4cpp_lexer.h", ExpandArray(meta_keywords)); + *lexer_funcs_unit = compile_meta_unit(part, code_directory, "4cpp/4cpp_lexer.h", ExpandArray(meta_keywords)); + Assert(lexer_funcs_unit->count != 0); - *lexer_types_unit = compile_meta_unit(part, code_directory, "4cpp_lexer_types.h", ExpandArray(meta_keywords)); + *lexer_types_unit = compile_meta_unit(part, code_directory, "4cpp/4cpp_lexer_types.h", ExpandArray(meta_keywords)); + Assert(lexer_types_unit->count != 0); - *string_unit = compile_meta_unit(part, code_directory, "internal_4coder_string.cpp", ExpandArray(meta_keywords)); + *string_unit = compile_meta_unit(part, code_directory, "string/internal_4coder_string.cpp", ExpandArray(meta_keywords)); + Assert(string_unit->count != 0); - static char *functions_files[] = { - "4ed_api_implementation.cpp", - "win32_api_impl.cpp", - 0 - }; - - *custom_funcs_unit = compile_meta_unit(part, code_directory, functions_files, ExpandArray(meta_keywords)); + *custom_funcs_unit = compile_meta_unit(part, code_directory, "4ed_api_implementation.cpp", ExpandArray(meta_keywords)); + Assert(custom_funcs_unit->count != 0); // NOTE(allen): Compute and store variations of the custom function names @@ -456,9 +457,13 @@ generate_site(char *code_directory, char *asset_directory, char *src_directory, } int main(int argc, char **argv){ + META_BEGIN(); + if (argc == 5){ generate_site(argv[1], argv[2], argv[3], argv[4]); } + + META_FINISH(); } // BOTTOM