From 7af92c4b5682186c394334607f7508b123143caf Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Thu, 3 Oct 2019 16:06:42 -0700 Subject: [PATCH] Fixed auto-indent crash bug; also progress on whatever --- 4ed_api_definition.cpp | 4 +- 4ed_api_parser.cpp | 7 --- custom/4coder_auto_indent.cpp | 74 +++++++++++++++-------------- custom/generated/command_metadata.h | 8 ++-- project.4coder | 2 +- 5 files changed, 46 insertions(+), 49 deletions(-) diff --git a/4ed_api_definition.cpp b/4ed_api_definition.cpp index 9b94089f..defb58b9 100644 --- a/4ed_api_definition.cpp +++ b/4ed_api_definition.cpp @@ -73,11 +73,11 @@ api_get_api(Arena *arena, API_Definition_List *list, String_Const_u8 name){ function void generate_api_master_list(Arena *scratch, API_Definition *api, FILE *out){ - fprintf(out, "// %.*s\n", string_expand(api->name)); for (API_Call *call = api->first; call != 0; call = call->next){ - fprintf(out, "%.*s %.*s(", + fprintf(out, "api(%.*s) function %.*s %.*s(", + string_expand(api->name), string_expand(call->return_type), string_expand(call->name)); if (call->params.count == 0){ diff --git a/4ed_api_parser.cpp b/4ed_api_parser.cpp index 0fbb49b7..e8ef35fb 100644 --- a/4ed_api_parser.cpp +++ b/4ed_api_parser.cpp @@ -212,13 +212,6 @@ int main(int argc, char **argv){ Arena arena = make_arena_malloc(); - char *hack[] = { - "nothing", - "../code/4ed_api_implementation.cpp" - }; - argv = hack; - argc = 2; - if (argc < 2){ printf("usage: