From 14b71b81728494dba8a0f3a493ece6e31a13bb47 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 25 Oct 2019 16:33:50 -0700 Subject: [PATCH] TIghtene dup the listers a lot a lot more --- 4ed.cpp | 27 +- 4ed_api_implementation.cpp | 51 +- 4ed_app_models.h | 2 +- 4ed_coroutine.h | 1 + 4ed_view.cpp | 11 +- custom/4coder_combined_write_commands.cpp | 74 ++- custom/4coder_default_framework.h | 4 +- custom/4coder_default_hooks.cpp | 2 +- custom/4coder_function_list.cpp | 15 +- custom/4coder_helper.cpp | 2 +- custom/4coder_jump_lister.cpp | 129 ++--- custom/4coder_jump_lister.h | 10 + custom/4coder_lister_base.cpp | 218 +++---- custom/4coder_lister_base.h | 23 +- custom/4coder_lists.cpp | 418 +++++++------- custom/4coder_project_commands.cpp | 52 +- custom/4coder_project_commands.h | 7 + custom/4coder_scope_commands.cpp | 22 +- custom/generated/command_metadata.h | 36 +- custom/generated/custom_api.cpp | 2 + custom/generated/custom_api.h | 5 + custom/generated/custom_api_master_list.h | 1 + custom/generated/lexer_cpp.cpp | 660 +++++++++++----------- 23 files changed, 902 insertions(+), 870 deletions(-) diff --git a/4ed.cpp b/4ed.cpp index 0d25b42f..8bb0b3cc 100644 --- a/4ed.cpp +++ b/4ed.cpp @@ -7,7 +7,6 @@ * */ - // TOP internal void @@ -345,21 +344,21 @@ App_Init_Sig(app_init){ // NOTE(allen): live set Arena *arena = models->arena; { - models->live_set.count = 0; - models->live_set.max = MAX_VIEWS; - models->live_set.views = push_array(arena, View, models->live_set.max); + models->view_set.count = 0; + models->view_set.max = MAX_VIEWS; + models->view_set.views = push_array(arena, View, models->view_set.max); //dll_init_sentinel - models->live_set.free_sentinel.next = &models->live_set.free_sentinel; - models->live_set.free_sentinel.prev = &models->live_set.free_sentinel; + models->view_set.free_sentinel.next = &models->view_set.free_sentinel; + models->view_set.free_sentinel.prev = &models->view_set.free_sentinel; - i32 max = models->live_set.max; - View *view = models->live_set.views; + i32 max = models->view_set.max; + View *view = models->view_set.views; for (i32 i = 0; i < max; ++i, ++view){ - //dll_insert(&models->live_set.free_sentinel, view); - view->next = models->live_set.free_sentinel.next; - view->prev = &models->live_set.free_sentinel; - models->live_set.free_sentinel.next = view; + //dll_insert(&models->view_set.free_sentinel, view); + view->next = models->view_set.free_sentinel.next; + view->prev = &models->view_set.free_sentinel; + models->view_set.free_sentinel.next = view; view->next->prev = view; } } @@ -436,7 +435,7 @@ App_Init_Sig(app_init){ // NOTE(allen): setup first panel { Panel *panel = layout_initialize(arena, &models->layout); - View *new_view = live_set_alloc_view(&models->lifetime_allocator, &models->live_set, panel); + View *new_view = live_set_alloc_view(&models->lifetime_allocator, &models->view_set, panel); view_init(tctx, models, new_view, models->scratch_buffer, models->view_event_handler); } @@ -833,7 +832,7 @@ App_Step_Sig(app_step){ begin_render_section(target, models->frame_counter, literal_dt, animation_dt); models->in_render_mode = true; - Live_Views *live_views = &models->live_set; + Live_Views *live_views = &models->view_set; for (Node *node = layout->open_panels.next; node != &layout->open_panels; node = node->next){ diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index c5adb3b1..3218588f 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -966,7 +966,7 @@ get_view_next(Application_Links *app, View_ID view_id, Access_Flag access) } View_ID result = 0; if (view != 0){ - result = view_get_id(&models->live_set, view); + result = view_get_id(&models->view_set, view); } return(result); } @@ -983,7 +983,24 @@ get_view_prev(Application_Links *app, View_ID view_id, Access_Flag access) } View_ID result = 0; if (view != 0){ - result = view_get_id(&models->live_set, view); + result = view_get_id(&models->view_set, view); + } + return(result); +} + +api(custom) function View_ID +get_this_ctx_view(Application_Links *app, Access_Flag access) +{ + Models *models = (Models*)app->cmd_context; + Thread_Context *tctx = app->tctx; + Thread_Context_Extra_Info *tctx_info = (Thread_Context_Extra_Info*)tctx->user_data; + View_ID result = 0; + if (tctx_info->coroutine != 0){ + Coroutine *coroutine = (Coroutine*)tctx_info->coroutine; + View *view = (View*)coroutine->user_data; + if (view != 0){ + result = view_get_id(&models->view_set, view); + } } return(result); } @@ -998,7 +1015,7 @@ get_active_view(Application_Links *app, Access_Flag access) Assert(view != 0); View_ID result = 0; if (api_check_view(view, access)){ - result = view_get_id(&models->live_set, view); + result = view_get_id(&models->view_set, view); } return(result); } @@ -1119,7 +1136,7 @@ panel_get_view(Application_Links *app, Panel_ID panel_id, Access_Flag access){ if (panel->kind == PanelKind_Final){ View *view = panel->view; if (api_check_view(view, access)){ - result = view_get_id(&models->live_set, view); + result = view_get_id(&models->view_set, view); } } } @@ -1162,9 +1179,9 @@ panel_split(Application_Links *app, Panel_ID panel_id, Dimension split_dim){ Panel *new_panel = 0; if (layout_split_panel(layout, panel, (split_dim == Dimension_X), &new_panel)){ - Live_Views *live_set = &models->live_set; + Live_Views *view_set = &models->view_set; View *new_view = live_set_alloc_view(&models->lifetime_allocator, - live_set, new_panel); + view_set, new_panel); view_init(app->tctx, models, new_view, models->scratch_buffer, models->view_event_handler); result = true; @@ -2031,20 +2048,18 @@ get_next_input(Application_Links *app, Event_Property get_properties, Event_Prop User_Input result = {}; if (tctx_info->coroutine != 0){ Coroutine *coroutine = (Coroutine*)tctx_info->coroutine; - if (coroutine != 0){ - Co_Out *out = (Co_Out*)coroutine->out; - out->request = CoRequest_None; - out->get_flags = get_properties; - out->abort_flags = abort_properties; - coroutine_yield(coroutine); - Co_In *in = (Co_In*)coroutine->in; - result = in->user_input; - } - else{ + Co_Out *out = (Co_Out*)coroutine->out; + out->request = CoRequest_None; + out->get_flags = get_properties; + out->abort_flags = abort_properties; + coroutine_yield(coroutine); + Co_In *in = (Co_In*)coroutine->in; + result = in->user_input; + } + else{ #define M "ERROR: get_next_input called in a hook that may not make calls to blocking APIs" - print_message(app, string_u8_litexpr(M)); + print_message(app, string_u8_litexpr(M)); #undef M - } } return(result); } diff --git a/4ed_app_models.h b/4ed_app_models.h index cdf8b1d1..1e67131d 100644 --- a/4ed_app_models.h +++ b/4ed_app_models.h @@ -68,7 +68,7 @@ struct Models{ Layout layout; Working_Set working_set; - Live_Views live_set; + Live_Views view_set; Global_History global_history; Text_Layout_Container text_layouts; Font_Set font_set; diff --git a/4ed_coroutine.h b/4ed_coroutine.h index 2169cd89..6844579f 100644 --- a/4ed_coroutine.h +++ b/4ed_coroutine.h @@ -41,6 +41,7 @@ struct Coroutine{ Coroutine *yield_ctx; Coroutine_State state; Coroutine_Type type; + void *user_data; }; struct Coroutine_Group{ diff --git a/4ed_view.cpp b/4ed_view.cpp index 0cdd3dc1..66afe58d 100644 --- a/4ed_view.cpp +++ b/4ed_view.cpp @@ -156,7 +156,7 @@ view_get_buffer_rect(Thread_Context *tctx, Models *models, View *view){ Application_Links app = {}; app.tctx = tctx; app.cmd_context = models; - sub_region = models->buffer_region(&app, view_get_id(&models->live_set, view), sub_region); + sub_region = models->buffer_region(&app, view_get_id(&models->view_set, view), sub_region); region.p0 = rect.p0 + sub_region.p0; region.p1 = rect.p0 + sub_region.p1; region.x1 = clamp_top(region.x1, rect.x1); @@ -526,6 +526,7 @@ view_init(Thread_Context *tctx, Models *models, View *view, Editing_File *initia view_push_context(view, &first_ctx); view->co = coroutine_create(&models->coroutines, view_event_context_base__inner); + view->co->user_data = view; Co_In in = {}; in.models = models; in.event_context_base = event_context_base; @@ -539,7 +540,7 @@ view_close(Models *models, View *view){ Layout *layout = &models->layout; b32 result = false; if (layout_close_panel(layout, view->panel)){ - live_set_free_view(&models->lifetime_allocator, &models->live_set, view); + live_set_free_view(&models->lifetime_allocator, &models->view_set, view); result = true; } return(result); @@ -745,11 +746,11 @@ finalize_color(Color_Table color_table, FColor fcolor){ internal View* imp_get_view(Models *models, View_ID view_id){ - Live_Views *live_set = &models->live_set; + Live_Views *view_set = &models->view_set; View *view = 0; view_id -= 1; - if (0 <= view_id && view_id < live_set->max){ - view = live_set->views + view_id; + if (0 <= view_id && view_id < view_set->max){ + view = view_set->views + view_id; if (!view->in_use){ view = 0; } diff --git a/custom/4coder_combined_write_commands.cpp b/custom/4coder_combined_write_commands.cpp index 58c2451e..e950444f 100644 --- a/custom/4coder_combined_write_commands.cpp +++ b/custom/4coder_combined_write_commands.cpp @@ -195,46 +195,58 @@ static Snippet default_snippets[] = { #endif }; -static Lister_Activation_Code -activate_snippet(Application_Links *app, View_ID view, Lister *lister, String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ - i32 index = (i32)PtrAsInt(user_data); - Snippet_Array snippets = *(Snippet_Array*)lister->user_data; - if (0 <= index && index < snippets.count){ - Snippet snippet = snippets.snippets[index]; - lister_default(app, view, lister, ListerActivation_Finished); - Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible); - i64 pos = view_get_cursor_pos(app, view); - buffer_replace_range(app, buffer, Ii64(pos), SCu8(snippet.text)); - view_set_cursor_and_preferred_x(app, view, seek_pos(pos + snippet.cursor_offset)); - view_set_mark(app, view, seek_pos(pos + snippet.mark_offset)); - } - else{ - lister_default(app, view, lister, ListerActivation_Finished); - } - return(ListerActivation_Finished); +function void +write_snippet(Application_Links *app, View_ID view, Buffer_ID buffer, + i64 pos, Snippet *snippet){ + String_Const_u8 snippet_text = SCu8(snippet->text); + buffer_replace_range(app, buffer, Ii64(pos), snippet_text); + i64 new_cursor = pos + snippet->cursor_offset; + view_set_cursor_and_preferred_x(app, view, seek_pos(new_cursor)); + i64 new_mark = pos + snippet->mark_offset; + view_set_mark(app, view, seek_pos(new_mark)); + auto_indent_buffer(app, buffer, Ii64_size(pos, snippet_text.size)); } -static void -snippet_lister__parameterized(Application_Links *app, Snippet_Array snippet_array){ - View_ID view = get_active_view(app, Access_Always); +function Snippet* +get_snippet_from_user(Application_Links *app, Snippet *snippets, i32 snippet_count, + String_Const_u8 query){ Scratch_Block scratch(app, Scratch_Share); - i32 option_count = snippet_array.count; - Lister_Option *options = push_array(scratch, Lister_Option, option_count); - for (i32 i = 0; i < snippet_array.count; i += 1){ - options[i].string = SCu8(snippet_array.snippets[i].name); - options[i].status = SCu8(snippet_array.snippets[i].text); - options[i].user_data = IntAsPtr(i); + Lister *lister = begin_lister(app, scratch); + lister_set_query(lister, query); + lister->handlers = lister_get_default_handlers(); + + Snippet *snippet = snippets; + for (i32 i = 0; i < snippet_count; i += 1, snippet += 1){ + lister_add_item(lister, SCu8(snippet->name), SCu8(snippet->text), snippet, 0); } - run_lister_with_options_array(app, "Snippet:", activate_snippet, &snippet_array, sizeof(snippet_array), options, option_count, 0, view); + Lister_Result l_result = run_lister(app, lister); + Snippet *result = 0; + if (!l_result.canceled){ + result = (Snippet*)l_result.user_data; + } + return(result); +} + + +function Snippet* +get_snippet_from_user(Application_Links *app, Snippet *snippets, i32 snippet_count, + char *query){ + return(get_snippet_from_user(app, snippets, snippet_count, SCu8(query))); } CUSTOM_COMMAND_SIG(snippet_lister) CUSTOM_DOC("Opens a snippet lister for inserting whole pre-written snippets of text.") { - Snippet_Array snippet_array = {}; - snippet_array.snippets = default_snippets; - snippet_array.count = ArrayCount(default_snippets); - snippet_lister__parameterized(app, snippet_array); + View_ID view = get_this_ctx_view(app, Access_ReadWrite); + if (view != 0){ + Snippet *snippet = get_snippet_from_user(app, default_snippets, + ArrayCount(default_snippets), + "Snippet:"); + + Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible); + i64 pos = view_get_cursor_pos(app, view); + write_snippet(app, view, buffer, pos, snippet); + } } // BOTTOM diff --git a/custom/4coder_default_framework.h b/custom/4coder_default_framework.h index 8ccef7e5..020d58f0 100644 --- a/custom/4coder_default_framework.h +++ b/custom/4coder_default_framework.h @@ -73,10 +73,10 @@ typedef void View_Render_Hook(Application_Links *app, View_ID view, Frame_Info f //////////////////////////////// function b32 -do_gui_sure_to_kill(Application_Links *app, Buffer_ID buffer, View_ID view); +do_buffer_kill_user_check(Application_Links *app, Buffer_ID buffer, View_ID view); function b32 -do_gui_sure_to_close_4coder(Application_Links *app, View_ID view); +do_4coder_close_user_check(Application_Links *app, View_ID view); #endif diff --git a/custom/4coder_default_hooks.cpp b/custom/4coder_default_hooks.cpp index 2e4667cd..8731558f 100644 --- a/custom/4coder_default_hooks.cpp +++ b/custom/4coder_default_hooks.cpp @@ -38,7 +38,7 @@ CUSTOM_DOC("Default command for responding to a try-exit event") } if (has_unsaved_changes){ View_ID view = get_active_view(app, Access_Always); - do_exit = do_gui_sure_to_close_4coder(app, view); + do_exit = do_4coder_close_user_check(app, view); } } if (do_exit){ diff --git a/custom/4coder_function_list.cpp b/custom/4coder_function_list.cpp index 0e3419d6..1fcce23c 100644 --- a/custom/4coder_function_list.cpp +++ b/custom/4coder_function_list.cpp @@ -282,7 +282,13 @@ CUSTOM_DOC("Creates a lister of locations that look like function definitions an if (buffer != 0){ list_all_functions(app, buffer); view = get_active_view(app, Access_Always); - open_jump_lister(app, &global_heap, view, buffer, JumpListerActivation_OpenInUIView, 0); + buffer = view_get_buffer(app, view, Access_Always); + Marker_List *list = get_marker_list_for_buffer(buffer); + if (list != 0){ + Jump_Lister_Result jump = get_jump_index_from_user(app, list, + "Function:"); + jump_to_jump_lister_result(app, view, list, &jump); + } } } @@ -298,7 +304,12 @@ CUSTOM_DOC("Creates a lister of locations that look like function definitions an list_all_functions(app, 0); View_ID view = get_active_view(app, Access_Always); Buffer_ID buffer = view_get_buffer(app, view, Access_Always); - open_jump_lister(app, &global_heap, view, buffer, JumpListerActivation_OpenInUIView, 0); + Marker_List *list = get_marker_list_for_buffer(buffer); + if (list != 0){ + Jump_Lister_Result jump = get_jump_index_from_user(app, list, + "Function:"); + jump_to_jump_lister_result(app, view, list, &jump); + } } // BOTTOM diff --git a/custom/4coder_helper.cpp b/custom/4coder_helper.cpp index 64ab1f00..f235ce7e 100644 --- a/custom/4coder_helper.cpp +++ b/custom/4coder_helper.cpp @@ -1803,7 +1803,7 @@ internal Buffer_Kill_Result try_buffer_kill(Application_Links *app, Buffer_ID buffer, View_ID gui_view_id, Buffer_Kill_Flag flags){ Buffer_Kill_Result result = buffer_kill(app, buffer, flags); if (result == BufferKillResult_Dirty){ - if (do_gui_sure_to_kill(app, buffer, gui_view_id)){ + if (do_buffer_kill_user_check(app, buffer, gui_view_id)){ result = buffer_kill(app, buffer, BufferKill_AlwaysKill); } } diff --git a/custom/4coder_jump_lister.cpp b/custom/4coder_jump_lister.cpp index 1c5edaf4..d81cca76 100644 --- a/custom/4coder_jump_lister.cpp +++ b/custom/4coder_jump_lister.cpp @@ -4,100 +4,55 @@ // TOP -static Lister_Activation_Code -activate_jump(Application_Links *app, - View_ID view, Lister *lister, - String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ - Lister_Activation_Code result_code = ListerActivation_Finished; - i32 list_index = (i32)PtrAsInt(user_data); - Jump_Lister_Parameters *params = (Jump_Lister_Parameters*)lister->user_data; - Marker_List *list = get_marker_list_for_buffer(params->list_buffer_id); +function Jump_Lister_Result +get_jump_index_from_user(Application_Links *app, Marker_List *list, + String_Const_u8 query){ + Jump_Lister_Result result = {}; if (list != 0){ - View_ID target_view = {}; - switch (params->activation_rule){ - case JumpListerActivation_OpenInUIView: - { - target_view = view; - result_code = ListerActivation_Finished; - }break; - - case JumpListerActivation_OpenInTargetViewKeepUI: - { - target_view = params->target_view_id;; - result_code = ListerActivation_Continue; - }break; - - case JumpListerActivation_OpenInTargetViewCloseUI: - { - target_view = params->target_view_id; - result_code = ListerActivation_Finished; - }break; - - case JumpListerActivation_OpenInNextViewKeepUI: - { - target_view = view; - target_view = get_next_view_looped_primary_panels(app, target_view, - Access_Always); - result_code = ListerActivation_Continue; - }break; - - case JumpListerActivation_OpenInNextViewCloseUI: - { - target_view = view; - target_view = get_next_view_looped_primary_panels(app, target_view, - Access_Always); - result_code = ListerActivation_Finished; - }break; - } - - ID_Pos_Jump_Location location = {}; - if (get_jump_from_list(app, list, list_index, &location)){ - Buffer_ID buffer = {}; - if (get_jump_buffer(app, &buffer, &location)){ - view_set_active(app, target_view); - jump_to_location(app, target_view, buffer, location); - } - } - - } - lister_default(app, view, lister, result_code); - return(result_code); -} - -static void -open_jump_lister(Application_Links *app, Heap *heap, View_ID ui_view, Buffer_ID list_buffer_id, Jump_Lister_Activation_Rule activation_rule, View_ID optional_target_view){ - - Marker_List *list = get_or_make_list_for_buffer(app, heap, list_buffer_id); - if (list != 0){ - i32 estimated_string_space_size = 0; Scratch_Block scratch(app); + Lister *lister = begin_lister(app, scratch); + lister_set_query(lister, query); + lister->handlers = lister_get_default_handlers(); + + Buffer_ID list_buffer = list->buffer_id; + i32 option_count = list->jump_count; - Lister_Option *options = push_array(scratch, Lister_Option, option_count); Managed_Object stored_jumps = list->jump_array; for (i32 i = 0; i < option_count; i += 1){ Sticky_Jump_Stored stored = {}; managed_object_load_data(app, stored_jumps, i, 1, &stored); - String_Const_u8 line = push_buffer_line(app, scratch, list_buffer_id, stored.list_line); - options[i].string = line; - block_zero_struct(&options[i].status); - options[i].user_data = IntAsPtr(i); - i32 aligned_size = ((i32)line.size) + 1 + 7; - aligned_size = aligned_size - aligned_size%8; - estimated_string_space_size += aligned_size; + String_Const_u8 line = push_buffer_line(app, scratch, list_buffer, + stored.list_line); + lister_add_item(lister, line, SCu8(), IntAsPtr(i), 0); } - Jump_Lister_Parameters jump_lister_params = {}; - jump_lister_params.list_buffer_id = list_buffer_id; - jump_lister_params.activation_rule = activation_rule; - if (optional_target_view != 0){ - jump_lister_params.target_view_id = optional_target_view; + Lister_Result l_result = run_lister(app, lister); + if (!l_result.canceled){ + result.success = true; + result.index = (i32)PtrAsInt(l_result.user_data); + } + } + + return(result); +} + +function Jump_Lister_Result +get_jump_index_from_user(Application_Links *app, Marker_List *list, char *query){ + return(get_jump_index_from_user(app, list, SCu8(query))); +} + +function void +jump_to_jump_lister_result(Application_Links *app, View_ID view, + Marker_List *list, Jump_Lister_Result *jump){ + if (jump->success){ + ID_Pos_Jump_Location location = {}; + if (get_jump_from_list(app, list, jump->index, &location)){ + Buffer_ID jump_dst_buffer = {}; + if (get_jump_buffer(app, &jump_dst_buffer, &location)){ + view_set_active(app, view); + jump_to_location(app, view, jump_dst_buffer, location); + } } - - run_lister_with_options_array(app, "Jump:", activate_jump, - &jump_lister_params, sizeof(jump_lister_params), - options, option_count, - estimated_string_space_size, - ui_view); } } @@ -106,7 +61,11 @@ CUSTOM_DOC("When executed on a buffer with jumps, creates a persistent lister fo { View_ID view = get_active_view(app, Access_Always); Buffer_ID buffer = view_get_buffer(app, view, Access_Always); - open_jump_lister(app, &global_heap, view, buffer, JumpListerActivation_OpenInNextViewKeepUI, 0); + Marker_List *list = get_marker_list_for_buffer(buffer); + if (list != 0){ + Jump_Lister_Result jump = get_jump_index_from_user(app, list, "Jump:"); + jump_to_jump_lister_result(app, view, list, &jump); + } } // BOTTOM diff --git a/custom/4coder_jump_lister.h b/custom/4coder_jump_lister.h index 379c7a60..f134b4cd 100644 --- a/custom/4coder_jump_lister.h +++ b/custom/4coder_jump_lister.h @@ -4,6 +4,9 @@ // TOP +#if !defined(FCODER_JUMP_LISTER_H) +#define FCODER_JUMP_LISTER_H + typedef i32 Jump_Lister_Activation_Rule; enum{ JumpListerActivation_OpenInUIView = 0, @@ -19,4 +22,11 @@ struct Jump_Lister_Parameters{ View_ID target_view_id; }; +struct Jump_Lister_Result{ + b32 success; + i32 index; +}; + +#endif + // BOTTOM \ No newline at end of file diff --git a/custom/4coder_lister_base.cpp b/custom/4coder_lister_base.cpp index 8ef03298..9d2c24b1 100644 --- a/custom/4coder_lister_base.cpp +++ b/custom/4coder_lister_base.cpp @@ -58,18 +58,13 @@ lister_set_map(Lister *lister, Mapping *mapping, Command_Map_ID map){ } function Lister* -begin_lister(Application_Links *app, Arena *arena, View_ID view, - void *user_data, umem user_data_size){ +begin_lister(Application_Links *app, Arena *arena){ Lister *lister = push_array_zero(arena, Lister, 1); lister->arena = arena; lister->query = Su8(lister->query_space, 0, sizeof(lister->query_space)); lister->text_field = Su8(lister->text_field_space, 0, sizeof(lister->text_field_space)); lister->key_string = Su8(lister->key_string_space, 0, sizeof(lister->key_string_space)); - lister->user_data = user_data; - lister->user_data_size = user_data_size; - if (user_data == 0){ - lister->user_data = push_array_zero(arena, u8, user_data_size); - } + View_ID view = get_this_ctx_view(app, Access_Always); global_lister_state[view - 1] = lister; lister->restore_all_point = begin_temp(lister->arena); View_Context ctx = view_current_context(app, view); @@ -196,6 +191,7 @@ lister_render(Application_Links *app, Frame_Info frame_info, View_ID view){ V2f32(text_field_rect.x0 + 3.f, text_field_rect.y0)); } + Range_f32 x = rect_range_x(list_rect); draw_set_clip(app, list_rect); @@ -363,7 +359,7 @@ lister_update_selection_values(Lister *lister){ } function void -lister_update_filtered_list(Application_Links *app, View_ID view, Lister *lister){ +lister_update_filtered_list(Application_Links *app, Lister *lister){ Scratch_Block scratch(app, Scratch_Share); Lister_Filtered filtered = lister_get_filtered(scratch, lister); @@ -400,45 +396,19 @@ lister_update_filtered_list(Application_Links *app, View_ID view, Lister *lister } function void -lister_call_refresh_handler(Application_Links *app, View_ID view, Lister *lister){ +lister_call_refresh_handler(Application_Links *app, Lister *lister){ if (lister->handlers.refresh != 0){ lister->handlers.refresh(app, lister); lister->filter_restore_point = begin_temp(lister->arena); - lister_update_filtered_list(app, view, lister); + lister_update_filtered_list(app, lister); } } function void -lister_default(Application_Links *app, View_ID view, Lister *lister, Lister_Activation_Code code){ - switch (code){ - case ListerActivation_Finished: - {}break; - - case ListerActivation_Continue: - {}break; - - case ListerActivation_ContinueAndRefresh: - { - lister->item_index = 0; - lister_call_refresh_handler(app, view, lister); - }break; - } -} - -function Lister_Activation_Code -lister_call_activate_handler(Application_Links *app, View_ID view, Lister *lister, - void *user_data, b32 activated_by_mouse){ - Lister_Activation_Code result = ListerActivation_Finished; - if (lister->handlers.activate != 0){ - result = lister->handlers.activate(app, view, lister, lister->text_field.string, - user_data, activated_by_mouse); - } - else{ - lister_default(app, view, lister, ListerActivation_Finished); - } +lister_activate(Application_Links *app, Lister *lister, void *user_data, b32 mouse){ + lister->out.activated_by_click = mouse; + lister->out.text_field = lister->text_field.string; lister->out.user_data = user_data; - lister->out.activated_by_click = activated_by_mouse; - return(result); } function void* @@ -478,10 +448,11 @@ lister_user_data_at_p(Application_Links *app, View_ID view, Lister *lister, Vec2 } function Lister_Result -run_lister(Application_Links *app, View_ID view, Lister *lister){ +run_lister(Application_Links *app, Lister *lister){ lister->filter_restore_point = begin_temp(lister->arena); - lister_update_filtered_list(app, view, lister); + lister_update_filtered_list(app, lister); + View_ID view = get_this_ctx_view(app, Access_Always);; View_Context ctx = view_current_context(app, view); ctx.render_caller = lister_render; ctx.hides_buffer = true; @@ -517,8 +488,8 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){ lister->raw_item_index < lister->options.count){ user_data = lister_get_user_data(lister, lister->raw_item_index); } - result = lister_call_activate_handler(app, view, lister, - user_data, false); + lister_activate(app, lister, user_data, false); + result = ListerActivation_Finished; }break; case KeyCode_Backspace: @@ -539,6 +510,9 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){ if (lister->handlers.navigate != 0){ lister->handlers.navigate(app, view, lister, -1); } + else if (lister->handlers.key_stroke != 0){ + result = lister->handlers.key_stroke(app); + } else{ handled = false; } @@ -549,6 +523,9 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){ if (lister->handlers.navigate != 0){ lister->handlers.navigate(app, view, lister, 1); } + else if (lister->handlers.key_stroke != 0){ + result = lister->handlers.key_stroke(app); + } else{ handled = false; } @@ -560,6 +537,9 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){ lister->handlers.navigate(app, view, lister, -lister->visible_count); } + else if (lister->handlers.key_stroke != 0){ + result = lister->handlers.key_stroke(app); + } else{ handled = false; } @@ -571,6 +551,9 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){ lister->handlers.navigate(app, view, lister, lister->visible_count); } + else if (lister->handlers.key_stroke != 0){ + result = lister->handlers.key_stroke(app); + } else{ handled = false; } @@ -614,8 +597,8 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){ Vec2_f32 p = V2f32(in.event.mouse.p); void *clicked = lister_user_data_at_p(app, view, lister, p); if (lister->hot_user_data == clicked){ - result = lister_call_activate_handler(app, view, lister, - clicked, true); + lister_activate(app, lister, clicked, true); + result = ListerActivation_Finished; } } lister->hot_user_data = 0; @@ -632,13 +615,13 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){ { Mouse_State mouse = get_mouse_state(app); lister->scroll.target.y += mouse.wheel; - lister_update_filtered_list(app, view, lister); + lister_update_filtered_list(app, lister); }break; case InputEventKind_MouseMove: case InputEventKind_Core: { - lister_update_filtered_list(app, view, lister); + lister_update_filtered_list(app, lister); }break; default: @@ -652,7 +635,6 @@ run_lister(Application_Links *app, View_ID view, Lister *lister){ } if (!handled){ - // TODO(allen): dedup this stuff. Mapping *mapping = lister->mapping; Command_Map *map = lister->map; if (ui_fallback_command_dispatch(app, view, mapping, map, &in)){ @@ -729,7 +711,7 @@ lister__write_string__default(Application_Links *app){ lister_append_key(lister, string); lister->item_index = 0; lister_zero_scroll(lister); - lister_update_filtered_list(app, view, lister); + lister_update_filtered_list(app, lister); } } } @@ -743,7 +725,7 @@ lister__backspace_text_field__default(Application_Links *app){ lister->key_string.string = backspace_utf8(lister->key_string.string); lister->item_index = 0; lister_zero_scroll(lister); - lister_update_filtered_list(app, view, lister); + lister_update_filtered_list(app, lister); } } @@ -765,34 +747,6 @@ lister__navigate__default(Application_Links *app, View_ID view, Lister *lister, lister_update_selection_values(lister); } -function Lister_Activation_Code -lister__key_stroke__fixed_list(Application_Links *app){ - Lister_Activation_Code result = ListerActivation_Continue; - View_ID view = get_active_view(app, Access_Always); - Lister *lister = view_get_lister(view); - if (lister != 0){ - User_Input in = get_current_input(app); - if (in.event.kind == InputEventKind_KeyStroke){ - void *user_data = 0; - b32 did_shortcut_key = false; - for (Lister_Node *node = lister->options.first; - node != 0; - node = node->next){ - Key_Code *key_code = (Key_Code*)(node + 1); - if (*key_code == in.event.key.code){ - user_data = node->user_data; - did_shortcut_key = true; - break; - } - } - if (did_shortcut_key){ - result = lister_call_activate_handler(app, view, lister, user_data, false); - } - } - } - return(result); -} - function Lister_Handlers lister_get_default_handlers(void){ Lister_Handlers handlers = {}; @@ -805,45 +759,47 @@ lister_get_default_handlers(void){ //////////////////////////////// function Lister_Result -run_lister_with_refresh_handler(Application_Links *app, String_Const_u8 query, - Lister_Handlers handlers, - void *user_data, i32 user_data_size, View_ID view){ - Scratch_Block scratch(app); +run_lister_with_refresh_handler(Application_Links *app, Arena *arena, + String_Const_u8 query, Lister_Handlers handlers){ Lister_Result result = {}; if (handlers.refresh != 0){ - Lister *lister = begin_lister(app, scratch, view, user_data, user_data_size); + Lister *lister = begin_lister(app, arena); lister_set_query(lister, query); lister->handlers = handlers; handlers.refresh(app, lister); - result = run_lister(app, view, lister); + result = run_lister(app, lister); } else{ #define M "ERROR: No refresh handler specified for lister (query_string = \"%.*s\")\n" - String_Const_u8 str = push_u8_stringf(scratch, M, string_expand(query)); + String_Const_u8 str = push_u8_stringf(arena, M, string_expand(query)); #undef M print_message(app, str); + result.canceled = true; } return(result); } function Lister_Result -run_lister_with_options_array(Application_Links *app, char *query_string, - Lister_Activation_Type *activate, - void *user_data, i32 user_data_size, - Lister_Option *options, i32 option_count, - i32 estimated_string_space_size, - View_ID view){ +run_lister_with_refresh_handler(Application_Links *app, String_Const_u8 query, + Lister_Handlers handlers){ Scratch_Block scratch(app); - Lister *lister = begin_lister(app, scratch, view, user_data, user_data_size); - for (i32 i = 0; i < option_count; i += 1){ - lister_add_item(lister, options[i].string, options[i].status, options[i].user_data, 0); - } - lister_set_query(lister, query_string); - lister->handlers = lister_get_default_handlers(); - lister->handlers.activate = activate; - return(run_lister(app, view, lister)); + return(run_lister_with_refresh_handler(app, scratch, query, handlers)); } +function Lister_Result +run_lister_with_refresh_handler(Application_Links *app, Arena *arena, + char *query, Lister_Handlers handlers){ + return(run_lister_with_refresh_handler(app, arena, SCu8(query), handlers)); +} + +function Lister_Result +run_lister_with_refresh_handler(Application_Links *app, + char *query, Lister_Handlers handlers){ + return(run_lister_with_refresh_handler(app, SCu8(query), handlers)); +} + +//////////////////////////////// + function void lister_choice(Arena *arena, Lister_Choice_List *list, String_Const_u8 string, String_Const_u8 status, @@ -878,12 +834,68 @@ lister_choice(Arena *arena, Lister_Choice_List *list, (u64)PtrAsInt(user_data)); } +function void +lister_choice(Arena *arena, Lister_Choice_List *list, + String_Const_u8 string, String_Const_u8 status, + Key_Code code, void *user_data){ + lister_choice(arena, list, string, status, code, (u64)PtrAsInt(user_data)); +} + +function void +lister_choice(Arena *arena, Lister_Choice_List *list, + char *string, String_Const_u8 status, + Key_Code code, void *user_data){ + lister_choice(arena, list, string, status, code, (u64)PtrAsInt(user_data)); +} + +function void +lister_choice(Arena *arena, Lister_Choice_List *list, + String_Const_u8 string, char *status, + Key_Code code, void *user_data){ + lister_choice(arena, list, string, status, code, (u64)PtrAsInt(user_data)); +} + +function void +lister_choice(Arena *arena, Lister_Choice_List *list, + char *string, char *status, + Key_Code code, void *user_data){ + lister_choice(arena, list, string, status, code, (u64)PtrAsInt(user_data)); +} + +function Lister_Activation_Code +lister__key_stroke__choice_list(Application_Links *app){ + Lister_Activation_Code result = ListerActivation_Continue; + View_ID view = get_active_view(app, Access_Always); + Lister *lister = view_get_lister(view); + if (lister != 0){ + User_Input in = get_current_input(app); + if (in.event.kind == InputEventKind_KeyStroke){ + void *user_data = 0; + b32 did_shortcut_key = false; + for (Lister_Node *node = lister->options.first; + node != 0; + node = node->next){ + Key_Code *key_code = (Key_Code*)(node + 1); + if (*key_code == in.event.key.code){ + user_data = node->user_data; + did_shortcut_key = true; + break; + } + } + if (did_shortcut_key){ + lister_activate(app, lister, user_data, false); + result = ListerActivation_Finished; + } + } + } + return(result); +} + function Lister_Choice* get_choice_from_user(Application_Links *app, String_Const_u8 query, Lister_Choice_List list){ Scratch_Block scratch(app); - View_ID view = get_active_view(app, Access_Always); - Lister *lister = begin_lister(app, scratch, view, 0, 0); + Lister *lister = begin_lister(app, scratch); for (Lister_Choice *choice = list.first; choice != 0; choice = choice->next){ @@ -895,11 +907,11 @@ get_choice_from_user(Application_Links *app, String_Const_u8 query, lister_set_query(lister, query); Lister_Handlers handlers = {}; handlers.navigate = lister__navigate__default; - handlers.key_stroke = lister__key_stroke__fixed_list; + handlers.key_stroke = lister__key_stroke__choice_list; lister->handlers = handlers; lister->handlers.refresh = 0; - Lister_Result l_result = run_lister(app, view, lister); + Lister_Result l_result = run_lister(app, lister); Lister_Choice *result = 0; if (!l_result.canceled){ result = (Lister_Choice*)l_result.user_data; diff --git a/custom/4coder_lister_base.h b/custom/4coder_lister_base.h index 65565a7e..c38cc666 100644 --- a/custom/4coder_lister_base.h +++ b/custom/4coder_lister_base.h @@ -14,9 +14,6 @@ enum{ ListerActivation_ContinueAndRefresh = 2, }; -typedef Lister_Activation_Code Lister_Activation_Type(Application_Links *app, View_ID view, struct Lister *lister, - String_Const_u8 text_field, void *user_data, b32 activated_by_mouse); - typedef void Lister_Regenerate_List_Function_Type(Application_Links *app, struct Lister *lister); struct Lister_Node{ @@ -48,7 +45,6 @@ typedef void Lister_Navigate_Function(Application_Links *app, i32 index_delta); struct Lister_Handlers{ - Lister_Activation_Type *activate; Lister_Regenerate_List_Function_Type *refresh; Custom_Command_Function *write_character; Custom_Command_Function *backspace; @@ -57,9 +53,10 @@ struct Lister_Handlers{ }; struct Lister_Result{ - void *user_data; - b32 activated_by_click; b32 canceled; + b32 activated_by_click; + String_Const_u8 text_field; + void *user_data; }; struct Lister{ @@ -71,9 +68,6 @@ struct Lister{ Mapping *mapping; Command_Map *map; - void *user_data; - umem user_data_size; - u8 query_space[256]; u8 text_field_space[256]; u8 key_string_space[256]; @@ -109,18 +103,15 @@ struct Lister_Filtered{ //////////////////////////////// -struct Lister_Option{ - String_Const_u8 string; - String_Const_u8 status; - void *user_data; -}; - struct Lister_Choice{ Lister_Choice *next; String_Const_u8 string; String_Const_u8 status; Key_Code key_code; - u64 user_data; + union{ + u64 user_data; + void *user_data_ptr; + }; }; struct Lister_Choice_List{ diff --git a/custom/4coder_lists.cpp b/custom/4coder_lists.cpp index f8b41255..ee3ebfdd 100644 --- a/custom/4coder_lists.cpp +++ b/custom/4coder_lists.cpp @@ -79,11 +79,9 @@ generate_all_buffers_list(Application_Links *app, Lister *lister){ function Buffer_ID get_buffer_from_user(Application_Links *app, String_Const_u8 query){ - View_ID view = get_active_view(app, Access_Always); Lister_Handlers handlers = lister_get_default_handlers(); handlers.refresh = generate_all_buffers_list; - Lister_Result l_result = run_lister_with_refresh_handler(app, query, handlers, - 0, 0, view); + Lister_Result l_result = run_lister_with_refresh_handler(app, query, handlers); Buffer_ID result = 0; if (!l_result.canceled){ result = (Buffer_ID)(PtrAsInt(l_result.user_data)); @@ -98,9 +96,60 @@ get_buffer_from_user(Application_Links *app, char *query){ //////////////////////////////// +function Custom_Command_Function* +get_command_from_user(Application_Links *app, String_Const_u8 query, + i32 *command_ids, i32 command_id_count){ + if (command_ids == 0){ + command_id_count = command_one_past_last_id; + } + + Scratch_Block scratch(app, Scratch_Share); + Lister *lister = begin_lister(app, scratch); + lister_set_query(lister, query); + lister->handlers = lister_get_default_handlers(); + + for (i32 i = 0; i < command_id_count; i += 1){ + i32 j = i; + if (command_ids != 0){ + j = command_ids[i]; + } + j = clamp(0, j, command_one_past_last_id); + lister_add_item(lister, + SCu8(fcoder_metacmd_table[j].name), + SCu8(fcoder_metacmd_table[j].description), + (void*)fcoder_metacmd_table[j].proc, 0); + } + + Lister_Result l_result = run_lister(app, lister); + + Custom_Command_Function *result = 0; + if (!l_result.canceled){ + result = (Custom_Command_Function*)l_result.user_data; + } + return(result); +} + +function Custom_Command_Function* +get_command_from_user(Application_Links *app, String_Const_u8 query){ + return(get_command_from_user(app, query, 0, 0)); +} + +function Custom_Command_Function* +get_command_from_user(Application_Links *app, char *query, + i32 *command_ids, i32 command_id_count){ + return(get_command_from_user(app, SCu8(query), command_ids, command_id_count)); +} + +function Custom_Command_Function* +get_command_from_user(Application_Links *app, char *query){ + return(get_command_from_user(app, SCu8(query), 0, 0)); +} + +//////////////////////////////// + function void lister__write_character__file_path(Application_Links *app){ - View_ID view = get_active_view(app, Access_Always); + View_ID view = get_this_ctx_view(app, Access_Always); Lister *lister = view_get_lister(view); if (lister != 0){ User_Input in = get_current_input(app); @@ -112,18 +161,18 @@ lister__write_character__file_path(Application_Links *app){ if (character_is_slash(string.str[0])){ String_Const_u8 new_hot = lister->text_field.string; set_hot_directory(app, new_hot); - lister_call_refresh_handler(app, view, lister); + lister_call_refresh_handler(app, lister); } lister->item_index = 0; lister_zero_scroll(lister); - lister_update_filtered_list(app, view, lister); + lister_update_filtered_list(app, lister); } } } function void lister__backspace_text_field__file_path(Application_Links *app){ - View_ID view = get_active_view(app, Access_Always); + View_ID view = get_this_ctx_view(app, Access_Always); Lister *lister = view_get_lister(view); if (lister != 0){ if (lister->text_field.size > 0){ @@ -142,7 +191,7 @@ lister__backspace_text_field__file_path(Application_Links *app){ // TODO(allen): We have to protect against lister_call_refresh_handler // changing the text_field here. Clean this up. String_u8 dingus = lister->text_field; - lister_call_refresh_handler(app, view, lister); + lister_call_refresh_handler(app, lister); lister->text_field = dingus; } else{ @@ -153,7 +202,7 @@ lister__backspace_text_field__file_path(Application_Links *app){ lister->item_index = 0; lister_zero_scroll(lister); - lister_update_filtered_list(app, view, lister); + lister_update_filtered_list(app, lister); } } } @@ -226,17 +275,52 @@ generate_hot_directory_file_list(Application_Links *app, Lister *lister){ } } -function void -run_lister_file_system_list(Application_Links *app, char *query_string, - Lister_Activation_Type *activate_procedure, - void *user_data, i32 user_data_size, View_ID target_view){ +struct File_Name_Result{ + b32 canceled; + b32 clicked; + b32 is_folder; + String_Const_u8 file_name_activated; + String_Const_u8 file_name_in_text_field; + String_Const_u8 path_in_text_field; +}; + +function File_Name_Result +get_file_name_from_user(Application_Links *app, Arena *arena, String_Const_u8 query, + View_ID view){ Lister_Handlers handlers = lister_get_default_handlers(); - handlers.activate = activate_procedure; handlers.refresh = generate_hot_directory_file_list; handlers.write_character = lister__write_character__file_path; handlers.backspace = lister__backspace_text_field__file_path; - run_lister_with_refresh_handler(app, SCu8(query_string), handlers, - user_data, user_data_size, target_view); + + Lister_Result l_result = + run_lister_with_refresh_handler(app, arena, query, handlers); + + File_Name_Result result = {}; + result.canceled = l_result.canceled; + if (!l_result.canceled){ + result.clicked = l_result.activated_by_click; + if (l_result.user_data != 0){ + String_Const_u8 name = SCu8((u8*)l_result.user_data); + result.file_name_activated = name; + result.is_folder = + character_is_slash(string_get_character(name, name.size -1 )); + } + result.file_name_in_text_field = string_front_of_path(l_result.text_field); + + String_Const_u8 path = string_remove_front_of_path(l_result.text_field); + if (character_is_slash(string_get_character(path, path.size - 1))){ + path = string_chop(path, 1); + } + result.path_in_text_field = path; + } + + return(result); +} + +function File_Name_Result +get_file_name_from_user(Application_Links *app, Arena *arena, char *query, + View_ID view){ + return(get_file_name_from_user(app, arena, SCu8(query), view)); } //////////////////////////////// @@ -249,7 +333,7 @@ enum{ }; function b32 -do_gui_sure_to_kill(Application_Links *app, Buffer_ID buffer, View_ID view){ +do_buffer_kill_user_check(Application_Links *app, Buffer_ID buffer, View_ID view){ Scratch_Block scratch(app); Lister_Choice_List list = {}; lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No); @@ -290,35 +374,8 @@ do_gui_sure_to_kill(Application_Links *app, Buffer_ID buffer, View_ID view){ return(do_kill); } -function Lister_Activation_Code -activate_confirm_close_4coder(Application_Links *app, - View_ID view, Lister *lister, - String_Const_u8 text_field, void *user_data, b32 clicked){ - i32 behavior = (i32)PtrAsInt(user_data); - b32 *do_exit = (b32*)user_data; - switch (behavior){ - case SureToKill_No: - {}break; - - case SureToKill_Yes: - { - allow_immediate_close_without_checking_for_changes = true; - *do_exit = true; - }break; - - case SureToKill_Save: - { - save_all_dirty_buffers(app); - allow_immediate_close_without_checking_for_changes = true; - *do_exit = true; - }break; - } - lister_default(app, view, lister, ListerActivation_Finished); - return(ListerActivation_Finished); -} - function b32 -do_gui_sure_to_close_4coder(Application_Links *app, View_ID view){ +do_4coder_close_user_check(Application_Links *app, View_ID view){ Scratch_Block scratch(app); Lister_Choice_List list = {}; lister_choice(scratch, &list, "(N)o" , "", KeyCode_N, SureToKill_No); @@ -356,59 +413,32 @@ do_gui_sure_to_close_4coder(Application_Links *app, View_ID view){ //////////////////////////////// -#if 0 -function Lister_Activation_Code -activate_switch_buffer(Application_Links *app, - View_ID view, Lister *lister, - String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ - if (user_data != 0){ - Buffer_ID buffer_id = (Buffer_ID)(PtrAsInt(user_data)); - view_set_buffer(app, view, buffer_id, SetBuffer_KeepOriginalGUI); - } - lister_default(app, view, lister, ListerActivation_Finished); - return(ListerActivation_Finished); -} -#endif - CUSTOM_UI_COMMAND_SIG(interactive_switch_buffer) CUSTOM_DOC("Interactively switch to an open buffer.") { View_ID view = get_active_view(app, Access_Always); - //run_lister_buffer_list(app, "Switch:", activate_switch_buffer, 0, 0, view); - Buffer_ID buffer = get_buffer_from_user(app, "Switch: "); + Buffer_ID buffer = get_buffer_from_user(app, "Switch:"); if (buffer != 0){ view_set_buffer(app, view, buffer, 0); } } -#if 0 -function Lister_Activation_Code -activate_kill_buffer(Application_Links *app, - View_ID view, Lister *lister, - String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ - lister_default(app, view, lister, ListerActivation_Finished); - if (user_data != 0){ - Buffer_ID buffer = (Buffer_ID)(PtrAsInt(user_data)); - try_buffer_kill(app, buffer, view, 0); - } - return(ListerActivation_Finished); -} -#endif - CUSTOM_UI_COMMAND_SIG(interactive_kill_buffer) CUSTOM_DOC("Interactively kill an open buffer.") { View_ID view = get_active_view(app, Access_Always); - //run_lister_buffer_list(app, "Kill:", activate_kill_buffer, 0, 0, view); - Buffer_ID buffer = get_buffer_from_user(app, "Kill: "); + Buffer_ID buffer = get_buffer_from_user(app, "Kill:"); if (buffer != 0){ try_buffer_kill(app, buffer, view, 0); } } +//////////////////////////////// + function Lister_Activation_Code activate_open_or_new__generic(Application_Links *app, View_ID view, - String_Const_u8 path, String_Const_u8 file_name, b32 is_folder, + String_Const_u8 path, String_Const_u8 file_name, + b32 is_folder, Buffer_Create_Flag flags){ Lister_Activation_Code result = 0; @@ -441,174 +471,122 @@ activate_open_or_new__generic(Application_Links *app, View_ID view, return(result); } -function Lister_Activation_Code -activate_open_or_new(Application_Links *app, - View_ID view, Lister *lister, - String_Const_u8 text_field, void *user_data, b32 clicked){ - Lister_Activation_Code result = 0; - String_Const_u8 file_name = {}; - if (user_data == 0){ - file_name = string_front_of_path(text_field); - } - else{ - file_name = SCu8((u8*)user_data); - } - if (file_name.size == 0){ - result = ListerActivation_Finished; - } - else{ - String_Const_u8 path = lister->text_field.string; - if (!character_is_slash(string_get_character(path, path.size - 1))){ - path = string_remove_last_folder(path); - } - b32 is_folder = (character_is_slash(string_get_character(file_name, file_name.size - 1)) && - user_data != 0); - Buffer_Create_Flag flags = 0; - result = activate_open_or_new__generic(app, view, path, file_name, is_folder, flags); - } - lister_default(app, view, lister, result); - return(result); -} - CUSTOM_UI_COMMAND_SIG(interactive_open_or_new) CUSTOM_DOC("Interactively open a file out of the file system.") { - View_ID view = get_active_view(app, Access_Always); - run_lister_file_system_list(app, "Open:", activate_open_or_new, 0, 0, view); -} - -function Lister_Activation_Code -activate_new(Application_Links *app, - View_ID view, Lister *lister, - String_Const_u8 text_field, void *user_data, b32 clicked){ - Lister_Activation_Code result = 0; - String_Const_u8 file_name = string_front_of_path(text_field); - if (user_data != 0){ - String_Const_u8 item_name = SCu8((u8*)user_data); - if (item_name.str[item_name.size - 1] == '/'){ - file_name = item_name; + for (;;){ + Scratch_Block scratch(app); + View_ID view = get_this_ctx_view(app, Access_Always); + File_Name_Result result = get_file_name_from_user(app, scratch, "Open:", + view); + if (result.canceled) break; + + String_Const_u8 file_name = result.file_name_activated; + if (file_name.size == 0){ + file_name = result.file_name_in_text_field; } - else if (clicked){ - file_name = item_name; + if (file_name.size == 0) break; + + String_Const_u8 path = result.path_in_text_field; + String_Const_u8 full_file_name = + push_u8_stringf(scratch, "%.*s/%.*s", + string_expand(path), string_expand(file_name)); + + if (result.is_folder){ + set_hot_directory(app, full_file_name); + continue; } - } - if (file_name.size == 0){ - result = ListerActivation_Finished; - } - else{ - String_Const_u8 path = lister->text_field.string; - if (character_is_slash(string_get_character(path, path.size - 1))){ - path = string_remove_last_folder(path); + + Buffer_ID buffer = create_buffer(app, full_file_name, 0); + if (buffer != 0){ + view_set_buffer(app, view, buffer, 0); } - b32 is_folder = (character_is_slash(string_get_character(file_name, file_name.size - 1)) && - user_data != 0); - Buffer_Create_Flag flags = BufferCreate_AlwaysNew; - result = activate_open_or_new__generic(app, view, path, file_name, is_folder, flags); + break; } - lister_default(app, view, lister, result); - return(result); } CUSTOM_UI_COMMAND_SIG(interactive_new) CUSTOM_DOC("Interactively creates a new file.") { - View_ID view = get_active_view(app, Access_Always); - run_lister_file_system_list(app, "New:", activate_new, 0, 0, view); -} - -function Lister_Activation_Code -activate_open(Application_Links *app, - View_ID view, Lister *lister, - String_Const_u8 text_field, void *user_data, b32 clicked){ - Lister_Activation_Code result = 0; - String_Const_u8 file_name = {}; - if (user_data != 0){ - file_name = SCu8((u8*)user_data); - } - if (file_name.size == 0){ - result = ListerActivation_Finished; - } - else{ - String_Const_u8 path = lister->text_field.string; - if (!character_is_slash(string_get_character(path, path.size - 1))){ - path = string_remove_last_folder(path); + for (;;){ + Scratch_Block scratch(app); + View_ID view = get_this_ctx_view(app, Access_Always); + File_Name_Result result = get_file_name_from_user(app, scratch, "New:", + view); + if (result.canceled) break; + + // NOTE(allen): file_name from the text field always + // unless this is a folder or a mouse click. + String_Const_u8 file_name = result.file_name_in_text_field; + if (result.is_folder || result.clicked){ + file_name = result.file_name_activated; } - b32 is_folder = (character_is_slash(string_get_character(file_name, file_name.size - 1)) && - user_data != 0); - Buffer_Create_Flag flags = BufferCreate_NeverNew; - result = activate_open_or_new__generic(app, view, path, file_name, is_folder, flags); + if (file_name.size == 0) break; + + String_Const_u8 path = result.path_in_text_field; + String_Const_u8 full_file_name = + push_u8_stringf(scratch, "%.*s/%.*s", + string_expand(path), string_expand(file_name)); + + if (result.is_folder){ + set_hot_directory(app, full_file_name); + continue; + } + + Buffer_Create_Flag flags = BufferCreate_AlwaysNew; + Buffer_ID buffer = create_buffer(app, full_file_name, flags); + if (buffer != 0){ + view_set_buffer(app, view, buffer, 0); + } + break; } - lister_default(app, view, lister, result); - return(result); } CUSTOM_UI_COMMAND_SIG(interactive_open) CUSTOM_DOC("Interactively opens a file.") { - View_ID view = get_active_view(app, Access_Always); - run_lister_file_system_list(app, "Open:", activate_open, 0, 0, view); + for (;;){ + Scratch_Block scratch(app); + View_ID view = get_this_ctx_view(app, Access_Always); + File_Name_Result result = get_file_name_from_user(app, scratch, "Open:", + view); + if (result.canceled) break; + + String_Const_u8 file_name = result.file_name_activated; + if (file_name.size == 0) break; + + String_Const_u8 path = result.path_in_text_field; + String_Const_u8 full_file_name = + push_u8_stringf(scratch, "%.*s/%.*s", + string_expand(path), string_expand(file_name)); + + if (result.is_folder){ + set_hot_directory(app, full_file_name); + continue; + } + + Buffer_Create_Flag flags = BufferCreate_NeverNew; + Buffer_ID buffer = create_buffer(app, full_file_name, flags); + if (buffer != 0){ + view_set_buffer(app, view, buffer, 0); + } + break; + } } -#if 0 -function Lister_Activation_Code -activate_select_theme(Application_Links *app, - View_ID view, struct Lister *lister, - String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ - change_theme_by_index(app, (i32)PtrAsInt(user_data)); - lister_default(app, scratch, view, state, ListerActivation_Finished); - return(ListerActivation_Finished); -} - -CUSTOM_COMMAND_SIG(open_color_tweaker) -CUSTOM_DOC("Opens the 4coder theme selector list.") -{ - -} -#endif - //////////////////////////////// -function Lister_Activation_Code -activate_command(Application_Links *app, - View_ID view, Lister *lister, - String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ - (*(Custom_Command_Function**)lister->user_data) = (Custom_Command_Function*)user_data; - lister_default(app, view, lister, ListerActivation_Finished); - return(ListerActivation_Finished); -} - -function void -launch_custom_command_lister(Application_Links *app, i32 *command_ids, i32 command_id_count){ - if (command_ids == 0){ - command_id_count = command_one_past_last_id; - } - - Scratch_Block scratch(app, Scratch_Share); - View_ID view = get_active_view(app, Access_Always); - Lister_Option *options = push_array(scratch, Lister_Option, command_id_count); - for (i32 i = 0; i < command_id_count; i += 1){ - i32 j = i; - if (command_ids != 0){ - j = command_ids[i]; - } - j = clamp(0, j, command_one_past_last_id); - options[i].string = SCu8(fcoder_metacmd_table[j].name); - options[i].status = SCu8(fcoder_metacmd_table[j].description); - options[i].user_data = (void*)fcoder_metacmd_table[j].proc; - } - Custom_Command_Function *custom_cmd = 0; - run_lister_with_options_array(app, "Command:", activate_command, &custom_cmd, sizeof(custom_cmd), - options, command_id_count, 0, view); - if (custom_cmd != 0){ - animate_in_n_milliseconds(app, 0); - custom_cmd(app); - } -} - CUSTOM_UI_COMMAND_SIG(command_lister) CUSTOM_DOC("Opens an interactive list of all registered commands.") { - launch_custom_command_lister(app, 0, 0); + Custom_Command_Function *func = get_command_from_user(app, "Command:"); + if (func != 0){ + View_ID view = get_this_ctx_view(app, Access_Always); + Managed_Scope scope = view_get_managed_scope(app, view); + Custom_Command_Function **call_next = + scope_attachment(app, scope, view_call_next, Custom_Command_Function*); + *call_next = func; + } } // BOTTOM diff --git a/custom/4coder_project_commands.cpp b/custom/4coder_project_commands.cpp index ff721972..5814d312 100644 --- a/custom/4coder_project_commands.cpp +++ b/custom/4coder_project_commands.cpp @@ -1343,31 +1343,47 @@ CUSTOM_DOC("Queries the user for several configuration options and initializes a /////////////////////////////// -function Lister_Activation_Code -activate_project_command(Application_Links *app, View_ID view, Lister *lister, String_Const_u8 text_field, void *user_data, b32 activated_by_mouse){ - i32 command_index = (i32)PtrAsInt(user_data); - exec_project_command_by_index(app, command_index); - lister_default(app, view, lister, ListerActivation_Finished); - return(ListerActivation_Finished); +function Project_Command_Lister_Result +get_project_command_from_user(Application_Links *app, Project *project, + String_Const_u8 query){ + Project_Command_Lister_Result result = {}; + if (project != 0){ + Scratch_Block scratch(app); + Lister *lister = begin_lister(app, scratch); + lister_set_query(lister, query); + lister->handlers = lister_get_default_handlers(); + + Project_Command *proj_cmd = project->command_array.commands; + i32 count = project->command_array.count; + for (i32 i = 0; i < count; i += 1, proj_cmd += 1){ + lister_add_item(lister, proj_cmd->name, proj_cmd->cmd, IntAsPtr(i), 0); + } + + Lister_Result l_result = run_lister(app, lister); + if (!l_result.canceled){ + result.success = true; + result.index = (i32)PtrAsInt(l_result.user_data); + } + } + + return(result); +} + + +function Project_Command_Lister_Result +get_project_command_from_user(Application_Links *app, Project *project, char *query){ + return(get_project_command_from_user(app, project, SCu8(query))); } CUSTOM_COMMAND_SIG(project_command_lister) CUSTOM_DOC("Open a lister of all commands in the currently loaded project.") { if (current_project.loaded){ - Scratch_Block scratch(app, Scratch_Share); - - View_ID view = get_active_view(app, Access_Always); - i32 option_count = current_project.command_array.count; - Lister_Option *options = push_array(scratch, Lister_Option, option_count); - for (i32 i = 0; - i < current_project.command_array.count; - i += 1){ - options[i].string = push_string_copy(scratch, current_project.command_array.commands[i].name); - options[i].status = push_string_copy(scratch, current_project.command_array.commands[i].cmd); - options[i].user_data = IntAsPtr(i); + Project_Command_Lister_Result proj_cmd = + get_project_command_from_user(app, ¤t_project, "Command:"); + if (proj_cmd.success){ + exec_project_command_by_index(app, proj_cmd.index); } - run_lister_with_options_array(app, "Command:", activate_project_command, 0, 0, options, option_count, 0, view); } } diff --git a/custom/4coder_project_commands.h b/custom/4coder_project_commands.h index afd284fe..18e36e02 100644 --- a/custom/4coder_project_commands.h +++ b/custom/4coder_project_commands.h @@ -90,6 +90,13 @@ struct Project_Key_Strings{ String_Const_u8 binary_file; }; +/////////////////////////////// + +struct Project_Command_Lister_Result{ + b32 success; + i32 index; +}; + #endif // BOTTOM diff --git a/custom/4coder_scope_commands.cpp b/custom/4coder_scope_commands.cpp index 1da52f28..4020f409 100644 --- a/custom/4coder_scope_commands.cpp +++ b/custom/4coder_scope_commands.cpp @@ -18,6 +18,12 @@ select_next_scope_after_pos(Application_Links *app, View_ID view, Buffer_ID buff } } +function b32 +range_is_scope_selection(Application_Links *app, Buffer_ID buffer, Range_i64 range){ + return (buffer_get_char(app, buffer, range.min) == '{' && + buffer_get_char(app, buffer, range.max - 1) == '}'); +} + CUSTOM_COMMAND_SIG(select_surrounding_scope) CUSTOM_DOC("Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.") { @@ -58,12 +64,19 @@ CUSTOM_DOC("Finds the first scope started by '{' after the cursor and puts the c } CUSTOM_COMMAND_SIG(select_next_scope_after_current) -CUSTOM_DOC("Finds the first scope started by '{' after the mark and puts the cursor and mark on the '{' and '}'. This command is meant to be used after a scope is already selected so that it will have the effect of selecting the next scope after the current scope.") +CUSTOM_DOC("If a scope is selected, find first scope that starts after the selected scope. Otherwise find the first scope that starts after the cursor.") { View_ID view = get_active_view(app, Access_ReadVisible); Buffer_ID buffer = view_get_buffer(app, view, Access_ReadVisible); - i64 pos = view_get_mark_pos(app, view); - select_next_scope_after_pos(app, view, buffer, pos); + i64 cursor_pos = view_get_cursor_pos(app, view); + i64 mark_pos = view_get_mark_pos(app, view); + Range_i64 range = Ii64(cursor_pos, mark_pos); + if (range_is_scope_selection(app, buffer, range)){ + select_next_scope_after_pos(app, view, buffer, range.max); + } + else{ + select_next_scope_after_pos(app, view, buffer, cursor_pos); + } } CUSTOM_COMMAND_SIG(select_prev_scope_absolute) @@ -103,8 +116,7 @@ CUSTOM_DOC("Deletes the braces surrounding the currently selected scope. Leaves Buffer_ID buffer = view_get_buffer(app, view, Access_ReadWriteVisible); Range_i64 range = get_view_range(app, view); - if (buffer_get_char(app, buffer, range.min) == '{' && - buffer_get_char(app, buffer, range.max - 1) == '}'){ + if (range_is_scope_selection(app, buffer, range)){ i32 top_len = 1; i32 bot_len = 1; if (buffer_get_char(app, buffer, range.min - 1) == '\n'){ diff --git a/custom/generated/command_metadata.h b/custom/generated/command_metadata.h index 7f3128c7..94a84cc2 100644 --- a/custom/generated/command_metadata.h +++ b/custom/generated/command_metadata.h @@ -358,12 +358,12 @@ static Command_Metadata fcoder_metacmd_table[213] = { { PROC_LINKS(set_eol_mode_to_lf, 0), false, "set_eol_mode_to_lf", 18, "Puts the buffer in lf line ending mode.", 39, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 93 }, { PROC_LINKS(set_eol_mode_to_binary, 0), false, "set_eol_mode_to_binary", 22, "Puts the buffer in bin line ending mode.", 40, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 104 }, { PROC_LINKS(set_eol_mode_from_contents, 0), false, "set_eol_mode_from_contents", 26, "Sets the buffer's line ending mode to match the contents of the buffer.", 71, "w:\\4ed\\code\\custom\\4coder_eol.cpp", 33, 115 }, -{ PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 373 }, -{ PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 398 }, -{ PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 473 }, -{ PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 512 }, +{ PROC_LINKS(interactive_switch_buffer, 0), true, "interactive_switch_buffer", 25, "Interactively switch to an open buffer.", 39, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 416 }, +{ PROC_LINKS(interactive_kill_buffer, 0), true, "interactive_kill_buffer", 23, "Interactively kill an open buffer.", 34, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 426 }, +{ PROC_LINKS(interactive_open_or_new, 0), true, "interactive_open_or_new", 23, "Interactively open a file out of the file system.", 49, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 474 }, +{ PROC_LINKS(interactive_new, 0), true, "interactive_new", 15, "Interactively creates a new file.", 33, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 508 }, { PROC_LINKS(interactive_open, 0), true, "interactive_open", 16, "Interactively opens a file.", 27, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 545 }, -{ PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 608 }, +{ PROC_LINKS(command_lister, 0), true, "command_lister", 14, "Opens an interactive list of all registered commands.", 53, "w:\\4ed\\code\\custom\\4coder_lists.cpp", 35, 579 }, { PROC_LINKS(auto_indent_whole_file, 0), false, "auto_indent_whole_file", 22, "Audo-indents the entire current buffer.", 39, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 368 }, { PROC_LINKS(auto_indent_line_at_cursor, 0), false, "auto_indent_line_at_cursor", 26, "Auto-indents the line on which the cursor sits.", 47, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 377 }, { PROC_LINKS(auto_indent_range, 0), false, "auto_indent_range", 17, "Auto-indents the range between the cursor and the mark.", 55, "w:\\4ed\\code\\custom\\4coder_auto_indent.cpp", 41, 387 }, @@ -389,7 +389,7 @@ static Command_Metadata fcoder_metacmd_table[213] = { { PROC_LINKS(goto_first_jump_same_panel_sticky, 0), false, "goto_first_jump_same_panel_sticky", 33, "If a buffer containing jump locations has been locked in, goes to the first jump in the buffer and views the buffer in the panel where the jump list was.", 153, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 540 }, { PROC_LINKS(if_read_only_goto_position, 0), false, "if_read_only_goto_position", 26, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor.", 106, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 562 }, { PROC_LINKS(if_read_only_goto_position_same_panel, 0), false, "if_read_only_goto_position_same_panel", 37, "If the buffer in the active view is writable, inserts a character, otherwise performs goto_jump_at_cursor_same_panel.", 117, "w:\\4ed\\code\\custom\\4coder_jump_sticky.cpp", 41, 579 }, -{ PROC_LINKS(view_jump_list_with_lister, 0), false, "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "w:\\4ed\\code\\custom\\4coder_jump_lister.cpp", 41, 104 }, +{ PROC_LINKS(view_jump_list_with_lister, 0), false, "view_jump_list_with_lister", 26, "When executed on a buffer with jumps, creates a persistent lister for all the jumps", 83, "w:\\4ed\\code\\custom\\4coder_jump_lister.cpp", 41, 59 }, { PROC_LINKS(show_the_log_graph, 0), true, "show_the_log_graph", 18, "Parses *log* and displays the 'log graph' UI", 44, "w:\\4ed\\code\\custom\\4coder_log_parser.cpp", 40, 995 }, { PROC_LINKS(copy, 0), false, "copy", 4, "Copy the text in the range from the cursor to the mark onto the clipboard.", 74, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 19 }, { PROC_LINKS(cut, 0), false, "cut", 3, "Cut the text in the range from the cursor to the mark onto the clipboard.", 73, "w:\\4ed\\code\\custom\\4coder_clipboard.cpp", 39, 28 }, @@ -413,19 +413,19 @@ static Command_Metadata fcoder_metacmd_table[213] = { { PROC_LINKS(setup_build_bat, 0), false, "setup_build_bat", 15, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1326 }, { PROC_LINKS(setup_build_sh, 0), false, "setup_build_sh", 14, "Queries the user for several configuration options and initializes a new build shell script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1332 }, { PROC_LINKS(setup_build_bat_and_sh, 0), false, "setup_build_bat_and_sh", 22, "Queries the user for several configuration options and initializes a new build batch script.", 92, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1338 }, -{ PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1354 }, +{ PROC_LINKS(project_command_lister, 0), false, "project_command_lister", 22, "Open a lister of all commands in the currently loaded project.", 62, "w:\\4ed\\code\\custom\\4coder_project_commands.cpp", 46, 1378 }, { PROC_LINKS(list_all_functions_current_buffer, 0), false, "list_all_functions_current_buffer", 33, "Creates a jump list of lines of the current buffer that appear to define or declare functions.", 94, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 267 }, { PROC_LINKS(list_all_functions_current_buffer_lister, 0), false, "list_all_functions_current_buffer_lister", 40, "Creates a lister of locations that look like function definitions and declarations in the buffer.", 97, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 277 }, -{ PROC_LINKS(list_all_functions_all_buffers, 0), false, "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 289 }, -{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), false, "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 295 }, -{ PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 21 }, -{ PROC_LINKS(select_surrounding_scope_maximal, 0), false, "select_surrounding_scope_maximal", 32, "Selects the top-most scope that surrounds the cursor.", 53, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 33 }, -{ PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 51 }, -{ PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "Finds the first scope started by '{' after the mark and puts the cursor and mark on the '{' and '}'. This command is meant to be used after a scope is already selected so that it will have the effect of selecting the next scope after the current scope.", 253, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 60 }, -{ PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 69 }, -{ PROC_LINKS(select_prev_top_most_scope, 0), false, "select_prev_top_most_scope", 26, "Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.", 108, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 86 }, -{ PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 93 }, -{ PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 99 }, +{ PROC_LINKS(list_all_functions_all_buffers, 0), false, "list_all_functions_all_buffers", 30, "Creates a jump list of lines from all buffers that appear to define or declare functions.", 89, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 295 }, +{ PROC_LINKS(list_all_functions_all_buffers_lister, 0), false, "list_all_functions_all_buffers_lister", 37, "Creates a lister of locations that look like function definitions and declarations all buffers.", 95, "w:\\4ed\\code\\custom\\4coder_function_list.cpp", 43, 301 }, +{ PROC_LINKS(select_surrounding_scope, 0), false, "select_surrounding_scope", 24, "Finds the scope enclosed by '{' '}' surrounding the cursor and puts the cursor and mark on the '{' and '}'.", 107, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 27 }, +{ PROC_LINKS(select_surrounding_scope_maximal, 0), false, "select_surrounding_scope_maximal", 32, "Selects the top-most scope that surrounds the cursor.", 53, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 39 }, +{ PROC_LINKS(select_next_scope_absolute, 0), false, "select_next_scope_absolute", 26, "Finds the first scope started by '{' after the cursor and puts the cursor and mark on the '{' and '}'.", 102, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 57 }, +{ PROC_LINKS(select_next_scope_after_current, 0), false, "select_next_scope_after_current", 31, "If a scope is selected, find first scope that starts after the selected scope. Otherwise find the first scope that starts after the cursor.", 139, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 66 }, +{ PROC_LINKS(select_prev_scope_absolute, 0), false, "select_prev_scope_absolute", 26, "Finds the first scope started by '{' before the cursor and puts the cursor and mark on the '{' and '}'.", 103, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 82 }, +{ PROC_LINKS(select_prev_top_most_scope, 0), false, "select_prev_top_most_scope", 26, "Finds the first scope that starts before the cursor, then finds the top most scope that contains that scope.", 108, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 99 }, +{ PROC_LINKS(place_in_scope, 0), false, "place_in_scope", 14, "Wraps the code contained in the range between cursor and mark with a new curly brace scope.", 91, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 106 }, +{ PROC_LINKS(delete_current_scope, 0), false, "delete_current_scope", 20, "Deletes the braces surrounding the currently selected scope. Leaves the contents within the scope.", 99, "w:\\4ed\\code\\custom\\4coder_scope_commands.cpp", 44, 112 }, { PROC_LINKS(open_long_braces, 0), false, "open_long_braces", 16, "At the cursor, insert a '{' and '}' separated by a blank line.", 62, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 46 }, { PROC_LINKS(open_long_braces_semicolon, 0), false, "open_long_braces_semicolon", 26, "At the cursor, insert a '{' and '};' separated by a blank line.", 63, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 54 }, { PROC_LINKS(open_long_braces_break, 0), false, "open_long_braces_break", 22, "At the cursor, insert a '{' and '}break;' separated by a blank line.", 68, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 62 }, @@ -438,7 +438,7 @@ static Command_Metadata fcoder_metacmd_table[213] = { { PROC_LINKS(comment_line, 0), false, "comment_line", 12, "Insert '//' at the beginning of the line after leading whitespace.", 66, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 125 }, { PROC_LINKS(uncomment_line, 0), false, "uncomment_line", 14, "If present, delete '//' at the beginning of the line after leading whitespace.", 78, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 137 }, { PROC_LINKS(comment_line_toggle, 0), false, "comment_line_toggle", 19, "Turns uncommented lines into commented lines and vice versa for comments starting with '//'.", 92, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 149 }, -{ PROC_LINKS(snippet_lister, 0), false, "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 231 }, +{ PROC_LINKS(snippet_lister, 0), false, "snippet_lister", 14, "Opens a snippet lister for inserting whole pre-written snippets of text.", 72, "w:\\4ed\\code\\custom\\4coder_combined_write_commands.cpp", 53, 237 }, { PROC_LINKS(miblo_increment_basic, 0), false, "miblo_increment_basic", 21, "Increment an integer under the cursor by one.", 45, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 29 }, { PROC_LINKS(miblo_decrement_basic, 0), false, "miblo_decrement_basic", 21, "Decrement an integer under the cursor by one.", 45, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 44 }, { PROC_LINKS(miblo_increment_time_stamp, 0), false, "miblo_increment_time_stamp", 26, "Increment a time stamp under the cursor by one second. (format [m]m:ss or h:mm:ss", 81, "w:\\4ed\\code\\custom\\4coder_miblo_numbers.cpp", 43, 231 }, diff --git a/custom/generated/custom_api.cpp b/custom/generated/custom_api.cpp index 6d68bff1..28fafbc4 100644 --- a/custom/generated/custom_api.cpp +++ b/custom/generated/custom_api.cpp @@ -54,6 +54,7 @@ vtable->buffer_get_file_attributes = buffer_get_file_attributes; vtable->get_file_attributes = get_file_attributes; vtable->get_view_next = get_view_next; vtable->get_view_prev = get_view_prev; +vtable->get_this_ctx_view = get_this_ctx_view; vtable->get_active_view = get_active_view; vtable->get_active_panel = get_active_panel; vtable->view_exists = view_exists; @@ -228,6 +229,7 @@ buffer_get_file_attributes = vtable->buffer_get_file_attributes; get_file_attributes = vtable->get_file_attributes; get_view_next = vtable->get_view_next; get_view_prev = vtable->get_view_prev; +get_this_ctx_view = vtable->get_this_ctx_view; get_active_view = vtable->get_active_view; get_active_panel = vtable->get_active_panel; view_exists = vtable->view_exists; diff --git a/custom/generated/custom_api.h b/custom/generated/custom_api.h index ee08bf67..4aeea7e6 100644 --- a/custom/generated/custom_api.h +++ b/custom/generated/custom_api.h @@ -52,6 +52,7 @@ #define custom_get_file_attributes_sig() File_Attributes custom_get_file_attributes(Application_Links* app, String_Const_u8 file_name) #define custom_get_view_next_sig() View_ID custom_get_view_next(Application_Links* app, View_ID view_id, Access_Flag access) #define custom_get_view_prev_sig() View_ID custom_get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access) +#define custom_get_this_ctx_view_sig() View_ID custom_get_this_ctx_view(Application_Links* app, Access_Flag access) #define custom_get_active_view_sig() View_ID custom_get_active_view(Application_Links* app, Access_Flag access) #define custom_get_active_panel_sig() Panel_ID custom_get_active_panel(Application_Links* app) #define custom_view_exists_sig() b32 custom_view_exists(Application_Links* app, View_ID view_id) @@ -222,6 +223,7 @@ typedef File_Attributes custom_buffer_get_file_attributes_type(Application_Links typedef File_Attributes custom_get_file_attributes_type(Application_Links* app, String_Const_u8 file_name); typedef View_ID custom_get_view_next_type(Application_Links* app, View_ID view_id, Access_Flag access); typedef View_ID custom_get_view_prev_type(Application_Links* app, View_ID view_id, Access_Flag access); +typedef View_ID custom_get_this_ctx_view_type(Application_Links* app, Access_Flag access); typedef View_ID custom_get_active_view_type(Application_Links* app, Access_Flag access); typedef Panel_ID custom_get_active_panel_type(Application_Links* app); typedef b32 custom_view_exists_type(Application_Links* app, View_ID view_id); @@ -393,6 +395,7 @@ custom_buffer_get_file_attributes_type *buffer_get_file_attributes; custom_get_file_attributes_type *get_file_attributes; custom_get_view_next_type *get_view_next; custom_get_view_prev_type *get_view_prev; +custom_get_this_ctx_view_type *get_this_ctx_view; custom_get_active_view_type *get_active_view; custom_get_active_panel_type *get_active_panel; custom_view_exists_type *view_exists; @@ -565,6 +568,7 @@ internal File_Attributes buffer_get_file_attributes(Application_Links* app, Buff internal File_Attributes get_file_attributes(Application_Links* app, String_Const_u8 file_name); internal View_ID get_view_next(Application_Links* app, View_ID view_id, Access_Flag access); internal View_ID get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access); +internal View_ID get_this_ctx_view(Application_Links* app, Access_Flag access); internal View_ID get_active_view(Application_Links* app, Access_Flag access); internal Panel_ID get_active_panel(Application_Links* app); internal b32 view_exists(Application_Links* app, View_ID view_id); @@ -737,6 +741,7 @@ global custom_buffer_get_file_attributes_type *buffer_get_file_attributes = 0; global custom_get_file_attributes_type *get_file_attributes = 0; global custom_get_view_next_type *get_view_next = 0; global custom_get_view_prev_type *get_view_prev = 0; +global custom_get_this_ctx_view_type *get_this_ctx_view = 0; global custom_get_active_view_type *get_active_view = 0; global custom_get_active_panel_type *get_active_panel = 0; global custom_view_exists_type *view_exists = 0; diff --git a/custom/generated/custom_api_master_list.h b/custom/generated/custom_api_master_list.h index 09d0e77c..b2651d5b 100644 --- a/custom/generated/custom_api_master_list.h +++ b/custom/generated/custom_api_master_list.h @@ -52,6 +52,7 @@ api(custom) function File_Attributes buffer_get_file_attributes(Application_Link api(custom) function File_Attributes get_file_attributes(Application_Links* app, String_Const_u8 file_name); api(custom) function View_ID get_view_next(Application_Links* app, View_ID view_id, Access_Flag access); api(custom) function View_ID get_view_prev(Application_Links* app, View_ID view_id, Access_Flag access); +api(custom) function View_ID get_this_ctx_view(Application_Links* app, Access_Flag access); api(custom) function View_ID get_active_view(Application_Links* app, Access_Flag access); api(custom) function Panel_ID get_active_panel(Application_Links* app); api(custom) function b32 view_exists(Application_Links* app, View_ID view_id); diff --git a/custom/generated/lexer_cpp.cpp b/custom/generated/lexer_cpp.cpp index be5b7847..c213b746 100644 --- a/custom/generated/lexer_cpp.cpp +++ b/custom/generated/lexer_cpp.cpp @@ -44,434 +44,434 @@ lexeme_table_lookup(u64 *hash_array, String_Const_u8 *key_array, #endif u64 main_keys_hash_array[121] = { -0xd7d4c38040a2a51b,0xdf638ad4b9cf69f1,0x0000000000000000,0x49161f88607bb631, -0x536665a889795331,0xac2560d906339023,0x0000000000000000,0x0000000000000000, -0x9df913c598e7c12f,0x0000000000000000,0x30a1e151f231a23d,0x0000000000000000, -0xdf638ad451f403ad,0xdf63897bcdc00091,0xb02f5667f4aa212d,0x0000000000000000, -0x0000000000000000,0x0000000000000000,0x0000000000000000,0xac2560d9187f0241, -0x0000000000000000,0xdf638adf7971e675,0xb2eaca38e283efad,0x0000000000000000, -0xdf638ad318e5d1ff,0xdf638ad080551679,0x0000000000000000,0x0000000000000000, -0xdf638ad206456083,0x0000000000000000,0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000,0xac2560dad36752fb,0x0000000000000000, -0x536665a889463469,0xb2ea03bb268a134f,0x0000000000000000,0xb2e835e1b80e6623, -0xd7d4c38040add1c7,0x0000000000000000,0x0000000000000000,0x0000000000000000, -0xdf638ad4bed34c65,0x9df9cfb653425513,0xd7d4c38040ae41d1,0x0000000000000000, -0x947a68a4ac1c1501,0x6d88621e3e0beb01,0x0000000000000000,0x536665a88ceccda5, -0x0000000000000000,0x536665a88ccb6129,0x0000000000000000,0x0000000000000000, -0x536665a8896b20ab,0x0000000000000000,0x0000000000000000,0xb07367b671947053, -0xb2ea3109b4b43533,0x536665a889437cc3,0x0000000000000000,0x0000000000000000, -0xac2560d91bdcfc25,0x9df91c40ba8cd527,0x0000000000000000,0x536665a889769513, -0xdf638979523c12d1,0x0000000000000000,0x0000000000000000,0xb2c5e55df6610773, -0x0000000000000000,0x536665a8894345fb,0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000,0x0000000000000000,0xac2560daec0e3851, -0x0000000000000000,0xb2c54a9d3317afb5,0xac2560d919a44b01,0x0000000000000000, -0xb77ddd8b9e414ce1,0x0000000000000000,0x18f86466c464cb01,0x0000000000000000, -0x0000000000000000,0xd7d4c38040a2854f,0x9df9ce6f49907115,0xac2560d90e3e3341, -0xdf63897b933beefb,0x0000000000000000,0x9df9cfb6534252e9,0xb2ea06e728b259ed, -0x0000000000000000,0x0000000000000000,0xb2ea5877c412647b,0x0000000000000000, -0xac2560d90618b725,0x34cb86f3fc1ca901,0xdf638ad4a65162c3,0x0000000000000000, -0x536665a88c2a1c41,0x49161f88607ba867,0xb2ead185c7065f1b,0x9df91f79b4ec2e9b, -0x0000000000000000,0xdf638ad4bf72e239,0xac2560dad9a93d8b,0xdf638979520bcfbf, -0xac2560dada9feda1,0x0000000000000000,0x0000000000000000,0x536665a88cc8be73, -0xdf63897b8855fa1b,0xb2c5e570be19f85b,0x9df91ccc8c85f8ed,0xd7d4c38040adb35d, +0xbfcba771fdc3ff37,0x0000000000000000,0x482b4e92d9750a9d,0x9cd567764c09a875, +0x2ddccf057a6f0469,0xe68abf205eb2e863,0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000,0xd6aa0bac121748eb,0xd6aa0bac1109048d, +0x0000000000000000,0xd6aa0bac11196a39,0xd6aa0bac12221e01,0x0000000000000000, +0xe68aac478bd4d0db,0xbfcbab347eb1538b,0x0000000000000000,0x8f60fef7e554164b, +0xd6aa0bac10fe54db,0x9cd567764c0e1c93,0x8f60feee11d7dd39,0x0000000000000000, +0x0000000000000000,0x482b4e92d1dc4f83,0x0000000000000000,0xd6aa0bac12177a23, +0x482b4e93169498b9,0x8f60fefc139c5187,0xbfcbab625d9024fd,0x0000000000000000, +0x8f60feed59f98803,0x482b4e92d2f527c3,0x0000000000000000,0x9cd567764c0e7049, +0xa11bf1f9effe8ff5,0x482b4e92d9410e2b,0xbfcba7fab26f1df3,0x0000000000000000, +0xb2c2203ec742c8f9,0x0000000000000000,0x0000000000000000,0x0000000000000000, +0x482b4e9313bc8ef9,0x0000000000000000,0x0000000000000000,0x0000000000000000, +0xbfcbab347eb17811,0x0000000000000000,0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000,0xe68b93f55069f805,0x0000000000000000, +0x8f60fef7e54b83e5,0x0000000000000000,0x0000000000000000,0x0000000000000000, +0xd6aa0bac12244e49,0xbfcba7dfbc5d3575,0x0000000000000000,0x0000000000000000, +0x0000000000000000,0xe6f47c713b150d87,0x8f60feefdaffe809,0x0000000000000000, +0xe68b8cadaf88313b,0x0000000000000000,0x0000000000000000,0xe68aa235a8c8f37d, +0x482b4e93102aeddd,0x0000000000000000,0x0000000000000000,0x496c5c19e3ebd8b9, +0xe68b8be5cd1165b3,0x9bb247cc8a92628f,0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000,0x0000000000000000,0xe68b8c5878fdf7e5, +0x9cd567764c09163f,0x06ce5e2ad58e50b9,0xe6f44f88499927eb,0x0000000000000000, +0x0000000000000000,0x0000000000000000,0x0000000000000000,0xd6aa0bac122eeac3, +0x8f60fef796abac39,0x8f60feffda51df2d,0x8f60fef797eb8201,0xe68b89d89c6dd7c3, +0x0000000000000000,0x8f60fefded2bd701,0x482b4e92af827e09,0x9cd567764c099b97, +0xce45dbf5e933e8f9,0x8f60fef79fcb7fdd,0x0000000000000000,0xd6aa0bac10fe3491, +0xbfcba797d431f6ff,0x0000000000000000,0x8f60feee76a24423,0x8f60feefdaac9887, +0x0000000000000000,0xd6aa0bac122e92eb,0x8f60feeebfaa1a5b,0xa1f16a0b9a90fcab, +0x0000000000000000,0x482b4e92d003f5d9,0x0000000000000000,0x9bb247cc8a9263a9, +0x482b4e9313a45d19,0x0000000000000000,0x0000000000000000,0x7f82e4d7b9ad98b5, 0x0000000000000000, }; -u8 main_keys_key_array_0[] = {0x61,0x73,0x6d,}; -u8 main_keys_key_array_1[] = {0x73,0x74,0x72,0x75,0x63,0x74,}; -u8 main_keys_key_array_3[] = {0x64,0x6f,}; -u8 main_keys_key_array_4[] = {0x67,0x6f,0x74,0x6f,}; -u8 main_keys_key_array_5[] = {0x66,0x61,0x6c,0x73,0x65,}; -u8 main_keys_key_array_8[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,}; -u8 main_keys_key_array_10[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,}; -u8 main_keys_key_array_12[] = {0x73,0x69,0x67,0x6e,0x65,0x64,}; -u8 main_keys_key_array_13[] = {0x66,0x72,0x69,0x65,0x6e,0x64,}; -u8 main_keys_key_array_14[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,}; -u8 main_keys_key_array_19[] = {0x63,0x6f,0x6e,0x73,0x74,}; -u8 main_keys_key_array_21[] = {0x74,0x79,0x70,0x65,0x69,0x64,}; -u8 main_keys_key_array_22[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,}; -u8 main_keys_key_array_24[] = {0x72,0x65,0x74,0x75,0x72,0x6e,}; -u8 main_keys_key_array_25[] = {0x70,0x75,0x62,0x6c,0x69,0x63,}; -u8 main_keys_key_array_28[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,}; -u8 main_keys_key_array_34[] = {0x77,0x68,0x69,0x6c,0x65,}; -u8 main_keys_key_array_36[] = {0x62,0x6f,0x6f,0x6c,}; -u8 main_keys_key_array_37[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,}; -u8 main_keys_key_array_39[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,}; -u8 main_keys_key_array_40[] = {0x74,0x72,0x79,}; -u8 main_keys_key_array_44[] = {0x73,0x77,0x69,0x74,0x63,0x68,}; -u8 main_keys_key_array_45[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,}; -u8 main_keys_key_array_46[] = {0x69,0x6e,0x74,}; -u8 main_keys_key_array_48[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,}; -u8 main_keys_key_array_49[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; -u8 main_keys_key_array_51[] = {0x76,0x6f,0x69,0x64,}; -u8 main_keys_key_array_53[] = {0x74,0x68,0x69,0x73,}; -u8 main_keys_key_array_56[] = {0x63,0x68,0x61,0x72,}; -u8 main_keys_key_array_59[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,}; -u8 main_keys_key_array_60[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,}; -u8 main_keys_key_array_61[] = {0x65,0x6c,0x73,0x65,}; -u8 main_keys_key_array_64[] = {0x63,0x61,0x74,0x63,0x68,}; -u8 main_keys_key_array_65[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,}; -u8 main_keys_key_array_67[] = {0x63,0x61,0x73,0x65,}; -u8 main_keys_key_array_68[] = {0x65,0x78,0x70,0x6f,0x72,0x74,}; -u8 main_keys_key_array_71[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,}; -u8 main_keys_key_array_73[] = {0x65,0x6e,0x75,0x6d,}; -u8 main_keys_key_array_79[] = {0x73,0x68,0x6f,0x72,0x74,}; -u8 main_keys_key_array_81[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,}; -u8 main_keys_key_array_82[] = {0x63,0x6c,0x61,0x73,0x73,}; -u8 main_keys_key_array_84[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,}; -u8 main_keys_key_array_86[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; -u8 main_keys_key_array_89[] = {0x66,0x6f,0x72,}; -u8 main_keys_key_array_90[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,}; -u8 main_keys_key_array_91[] = {0x62,0x72,0x65,0x61,0x6b,}; -u8 main_keys_key_array_92[] = {0x64,0x65,0x6c,0x65,0x74,0x65,}; -u8 main_keys_key_array_94[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,}; -u8 main_keys_key_array_95[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,}; -u8 main_keys_key_array_98[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,}; -u8 main_keys_key_array_100[] = {0x66,0x6c,0x6f,0x61,0x74,}; -u8 main_keys_key_array_101[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,}; -u8 main_keys_key_array_102[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,}; -u8 main_keys_key_array_104[] = {0x6c,0x6f,0x6e,0x67,}; -u8 main_keys_key_array_105[] = {0x69,0x66,}; -u8 main_keys_key_array_106[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,}; -u8 main_keys_key_array_107[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,}; -u8 main_keys_key_array_109[] = {0x73,0x74,0x61,0x74,0x69,0x63,}; -u8 main_keys_key_array_110[] = {0x75,0x6e,0x69,0x6f,0x6e,}; -u8 main_keys_key_array_111[] = {0x65,0x78,0x74,0x65,0x72,0x6e,}; -u8 main_keys_key_array_112[] = {0x75,0x73,0x69,0x6e,0x67,}; -u8 main_keys_key_array_115[] = {0x74,0x72,0x75,0x65,}; -u8 main_keys_key_array_116[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,}; -u8 main_keys_key_array_117[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,}; -u8 main_keys_key_array_118[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,}; -u8 main_keys_key_array_119[] = {0x6e,0x65,0x77,}; +u8 main_keys_key_array_0[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,}; +u8 main_keys_key_array_2[] = {0x66,0x6c,0x6f,0x61,0x74,}; +u8 main_keys_key_array_3[] = {0x6e,0x65,0x77,}; +u8 main_keys_key_array_4[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,}; +u8 main_keys_key_array_5[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,}; +u8 main_keys_key_array_10[] = {0x63,0x61,0x73,0x65,}; +u8 main_keys_key_array_11[] = {0x76,0x6f,0x69,0x64,}; +u8 main_keys_key_array_13[] = {0x6c,0x6f,0x6e,0x67,}; +u8 main_keys_key_array_14[] = {0x62,0x6f,0x6f,0x6c,}; +u8 main_keys_key_array_16[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,}; +u8 main_keys_key_array_17[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,}; +u8 main_keys_key_array_19[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,}; +u8 main_keys_key_array_20[] = {0x74,0x72,0x75,0x65,}; +u8 main_keys_key_array_21[] = {0x61,0x73,0x6d,}; +u8 main_keys_key_array_22[] = {0x66,0x72,0x69,0x65,0x6e,0x64,}; +u8 main_keys_key_array_25[] = {0x75,0x6e,0x69,0x6f,0x6e,}; +u8 main_keys_key_array_27[] = {0x63,0x68,0x61,0x72,}; +u8 main_keys_key_array_28[] = {0x62,0x72,0x65,0x61,0x6b,}; +u8 main_keys_key_array_29[] = {0x72,0x65,0x74,0x75,0x72,0x6e,}; +u8 main_keys_key_array_30[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,}; +u8 main_keys_key_array_32[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,}; +u8 main_keys_key_array_33[] = {0x77,0x68,0x69,0x6c,0x65,}; +u8 main_keys_key_array_35[] = {0x69,0x6e,0x74,}; +u8 main_keys_key_array_36[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,}; +u8 main_keys_key_array_37[] = {0x66,0x61,0x6c,0x73,0x65,}; +u8 main_keys_key_array_38[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,}; +u8 main_keys_key_array_40[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,}; +u8 main_keys_key_array_44[] = {0x63,0x6f,0x6e,0x73,0x74,}; +u8 main_keys_key_array_48[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,}; +u8 main_keys_key_array_54[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,}; +u8 main_keys_key_array_56[] = {0x73,0x69,0x67,0x6e,0x65,0x64,}; +u8 main_keys_key_array_60[] = {0x67,0x6f,0x74,0x6f,}; +u8 main_keys_key_array_61[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,}; +u8 main_keys_key_array_65[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,}; +u8 main_keys_key_array_66[] = {0x65,0x78,0x70,0x6f,0x72,0x74,}; +u8 main_keys_key_array_68[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,}; +u8 main_keys_key_array_71[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,}; +u8 main_keys_key_array_72[] = {0x63,0x61,0x74,0x63,0x68,}; +u8 main_keys_key_array_75[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; +u8 main_keys_key_array_76[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,}; +u8 main_keys_key_array_77[] = {0x69,0x66,}; +u8 main_keys_key_array_83[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,}; +u8 main_keys_key_array_84[] = {0x74,0x72,0x79,}; +u8 main_keys_key_array_85[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; +u8 main_keys_key_array_86[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,}; +u8 main_keys_key_array_91[] = {0x65,0x6e,0x75,0x6d,}; +u8 main_keys_key_array_92[] = {0x73,0x74,0x72,0x75,0x63,0x74,}; +u8 main_keys_key_array_93[] = {0x74,0x79,0x70,0x65,0x69,0x64,}; +u8 main_keys_key_array_94[] = {0x73,0x74,0x61,0x74,0x69,0x63,}; +u8 main_keys_key_array_95[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,}; +u8 main_keys_key_array_97[] = {0x70,0x75,0x62,0x6c,0x69,0x63,}; +u8 main_keys_key_array_98[] = {0x73,0x68,0x6f,0x72,0x74,}; +u8 main_keys_key_array_99[] = {0x66,0x6f,0x72,}; +u8 main_keys_key_array_100[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,}; +u8 main_keys_key_array_101[] = {0x73,0x77,0x69,0x74,0x63,0x68,}; +u8 main_keys_key_array_103[] = {0x74,0x68,0x69,0x73,}; +u8 main_keys_key_array_104[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,}; +u8 main_keys_key_array_106[] = {0x64,0x65,0x6c,0x65,0x74,0x65,}; +u8 main_keys_key_array_107[] = {0x65,0x78,0x74,0x65,0x72,0x6e,}; +u8 main_keys_key_array_109[] = {0x65,0x6c,0x73,0x65,}; +u8 main_keys_key_array_110[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,}; +u8 main_keys_key_array_111[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,}; +u8 main_keys_key_array_113[] = {0x75,0x73,0x69,0x6e,0x67,}; +u8 main_keys_key_array_115[] = {0x64,0x6f,}; +u8 main_keys_key_array_116[] = {0x63,0x6c,0x61,0x73,0x73,}; +u8 main_keys_key_array_119[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,}; String_Const_u8 main_keys_key_array[121] = { -{main_keys_key_array_0, 3}, -{main_keys_key_array_1, 6}, +{main_keys_key_array_0, 7}, {0, 0}, -{main_keys_key_array_3, 2}, -{main_keys_key_array_4, 4}, -{main_keys_key_array_5, 5}, -{0, 0}, -{0, 0}, -{main_keys_key_array_8, 7}, -{0, 0}, -{main_keys_key_array_10, 12}, -{0, 0}, -{main_keys_key_array_12, 6}, -{main_keys_key_array_13, 6}, -{main_keys_key_array_14, 9}, +{main_keys_key_array_2, 5}, +{main_keys_key_array_3, 3}, +{main_keys_key_array_4, 13}, +{main_keys_key_array_5, 8}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, -{main_keys_key_array_19, 5}, +{main_keys_key_array_10, 4}, +{main_keys_key_array_11, 4}, {0, 0}, -{main_keys_key_array_21, 6}, -{main_keys_key_array_22, 8}, +{main_keys_key_array_13, 4}, +{main_keys_key_array_14, 4}, {0, 0}, -{main_keys_key_array_24, 6}, -{main_keys_key_array_25, 6}, +{main_keys_key_array_16, 8}, +{main_keys_key_array_17, 7}, +{0, 0}, +{main_keys_key_array_19, 6}, +{main_keys_key_array_20, 4}, +{main_keys_key_array_21, 3}, +{main_keys_key_array_22, 6}, {0, 0}, {0, 0}, -{main_keys_key_array_28, 6}, +{main_keys_key_array_25, 5}, +{0, 0}, +{main_keys_key_array_27, 4}, +{main_keys_key_array_28, 5}, +{main_keys_key_array_29, 6}, +{main_keys_key_array_30, 7}, +{0, 0}, +{main_keys_key_array_32, 6}, +{main_keys_key_array_33, 5}, +{0, 0}, +{main_keys_key_array_35, 3}, +{main_keys_key_array_36, 9}, +{main_keys_key_array_37, 5}, +{main_keys_key_array_38, 7}, +{0, 0}, +{main_keys_key_array_40, 16}, +{0, 0}, +{0, 0}, +{0, 0}, +{main_keys_key_array_44, 5}, +{0, 0}, +{0, 0}, +{0, 0}, +{main_keys_key_array_48, 7}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, -{main_keys_key_array_34, 5}, +{main_keys_key_array_54, 8}, {0, 0}, -{main_keys_key_array_36, 4}, -{main_keys_key_array_37, 8}, -{0, 0}, -{main_keys_key_array_39, 8}, -{main_keys_key_array_40, 3}, +{main_keys_key_array_56, 6}, {0, 0}, {0, 0}, {0, 0}, -{main_keys_key_array_44, 6}, -{main_keys_key_array_45, 7}, -{main_keys_key_array_46, 3}, -{0, 0}, -{main_keys_key_array_48, 16}, -{main_keys_key_array_49, 11}, -{0, 0}, -{main_keys_key_array_51, 4}, -{0, 0}, -{main_keys_key_array_53, 4}, +{main_keys_key_array_60, 4}, +{main_keys_key_array_61, 7}, {0, 0}, {0, 0}, -{main_keys_key_array_56, 4}, {0, 0}, +{main_keys_key_array_65, 8}, +{main_keys_key_array_66, 6}, {0, 0}, -{main_keys_key_array_59, 9}, -{main_keys_key_array_60, 8}, -{main_keys_key_array_61, 4}, -{0, 0}, -{0, 0}, -{main_keys_key_array_64, 5}, -{main_keys_key_array_65, 7}, -{0, 0}, -{main_keys_key_array_67, 4}, -{main_keys_key_array_68, 6}, +{main_keys_key_array_68, 8}, {0, 0}, {0, 0}, {main_keys_key_array_71, 8}, +{main_keys_key_array_72, 5}, {0, 0}, -{main_keys_key_array_73, 4}, +{0, 0}, +{main_keys_key_array_75, 11}, +{main_keys_key_array_76, 8}, +{main_keys_key_array_77, 2}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, -{main_keys_key_array_79, 5}, -{0, 0}, -{main_keys_key_array_81, 8}, -{main_keys_key_array_82, 5}, -{0, 0}, -{main_keys_key_array_84, 13}, -{0, 0}, -{main_keys_key_array_86, 12}, +{main_keys_key_array_83, 8}, +{main_keys_key_array_84, 3}, +{main_keys_key_array_85, 12}, +{main_keys_key_array_86, 8}, {0, 0}, {0, 0}, -{main_keys_key_array_89, 3}, -{main_keys_key_array_90, 7}, -{main_keys_key_array_91, 5}, +{0, 0}, +{0, 0}, +{main_keys_key_array_91, 4}, {main_keys_key_array_92, 6}, -{0, 0}, -{main_keys_key_array_94, 7}, +{main_keys_key_array_93, 6}, +{main_keys_key_array_94, 6}, {main_keys_key_array_95, 8}, {0, 0}, +{main_keys_key_array_97, 6}, +{main_keys_key_array_98, 5}, +{main_keys_key_array_99, 3}, +{main_keys_key_array_100, 10}, +{main_keys_key_array_101, 6}, {0, 0}, -{main_keys_key_array_98, 8}, +{main_keys_key_array_103, 4}, +{main_keys_key_array_104, 7}, {0, 0}, -{main_keys_key_array_100, 5}, -{main_keys_key_array_101, 10}, -{main_keys_key_array_102, 6}, +{main_keys_key_array_106, 6}, +{main_keys_key_array_107, 6}, {0, 0}, -{main_keys_key_array_104, 4}, -{main_keys_key_array_105, 2}, -{main_keys_key_array_106, 8}, -{main_keys_key_array_107, 7}, +{main_keys_key_array_109, 4}, +{main_keys_key_array_110, 6}, +{main_keys_key_array_111, 9}, {0, 0}, -{main_keys_key_array_109, 6}, -{main_keys_key_array_110, 5}, -{main_keys_key_array_111, 6}, -{main_keys_key_array_112, 5}, +{main_keys_key_array_113, 5}, +{0, 0}, +{main_keys_key_array_115, 2}, +{main_keys_key_array_116, 5}, {0, 0}, {0, 0}, -{main_keys_key_array_115, 4}, -{main_keys_key_array_116, 6}, -{main_keys_key_array_117, 8}, -{main_keys_key_array_118, 7}, -{main_keys_key_array_119, 3}, +{main_keys_key_array_119, 12}, {0, 0}, }; Lexeme_Table_Value main_keys_value_array[121] = { -{4, TokenCppKind_Asm}, -{4, TokenCppKind_Struct}, -{0, 0}, -{4, TokenCppKind_Do}, -{4, TokenCppKind_Goto}, -{8, TokenCppKind_LiteralFalse}, -{0, 0}, -{0, 0}, {4, TokenCppKind_Typedef}, {0, 0}, -{4, TokenCppKind_ThreadLocal}, +{4, TokenCppKind_Float}, +{4, TokenCppKind_New}, +{4, TokenCppKind_StaticAssert}, +{4, TokenCppKind_DeclType}, {0, 0}, -{4, TokenCppKind_Signed}, +{0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Case}, +{4, TokenCppKind_Void}, +{0, 0}, +{4, TokenCppKind_Long}, +{4, TokenCppKind_Bool}, +{0, 0}, +{4, TokenCppKind_Continue}, +{4, TokenCppKind_AlignOf}, +{0, 0}, +{4, TokenCppKind_SizeOf}, +{8, TokenCppKind_LiteralTrue}, +{4, TokenCppKind_Asm}, {4, TokenCppKind_Friend}, -{4, TokenCppKind_Protected}, {0, 0}, {0, 0}, +{4, TokenCppKind_Union}, +{0, 0}, +{4, TokenCppKind_Char}, +{4, TokenCppKind_Break}, +{4, TokenCppKind_Return}, +{4, TokenCppKind_Default}, +{0, 0}, +{4, TokenCppKind_Double}, +{4, TokenCppKind_While}, +{0, 0}, +{4, TokenCppKind_Int}, +{4, TokenCppKind_Protected}, +{8, TokenCppKind_LiteralFalse}, +{4, TokenCppKind_Private}, +{0, 0}, +{4, TokenCppKind_ReinterpretCast}, +{0, 0}, {0, 0}, {0, 0}, {4, TokenCppKind_Const}, {0, 0}, -{4, TokenCppKind_TypeID}, -{4, TokenCppKind_Unsigned}, {0, 0}, -{4, TokenCppKind_Return}, -{4, TokenCppKind_Public}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Inline}, -{0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_While}, -{0, 0}, -{4, TokenCppKind_Bool}, -{4, TokenCppKind_Operator}, -{0, 0}, -{4, TokenCppKind_Typename}, -{4, TokenCppKind_Try}, -{0, 0}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Switch}, -{4, TokenCppKind_AlignOf}, -{4, TokenCppKind_Int}, -{0, 0}, -{4, TokenCppKind_ReinterpretCast}, -{4, TokenCppKind_StaticCast}, -{0, 0}, -{4, TokenCppKind_Void}, -{0, 0}, -{4, TokenCppKind_This}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Char}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Namespace}, -{4, TokenCppKind_Register}, -{4, TokenCppKind_Else}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Catch}, -{4, TokenCppKind_NullPtr}, -{0, 0}, -{4, TokenCppKind_Case}, -{4, TokenCppKind_Export}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Continue}, -{0, 0}, -{4, TokenCppKind_Enum}, -{0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Short}, -{0, 0}, -{4, TokenCppKind_Explicit}, -{4, TokenCppKind_Class}, -{0, 0}, -{4, TokenCppKind_StaticAssert}, -{0, 0}, -{4, TokenCppKind_DynamicCast}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_For}, -{4, TokenCppKind_Default}, -{4, TokenCppKind_Break}, -{4, TokenCppKind_Delete}, {0, 0}, {4, TokenCppKind_AlignAs}, +{0, 0}, +{0, 0}, +{0, 0}, +{0, 0}, +{0, 0}, {4, TokenCppKind_NoExcept}, {0, 0}, +{4, TokenCppKind_Signed}, {0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Goto}, +{4, TokenCppKind_Virtual}, +{0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Operator}, +{4, TokenCppKind_Export}, +{0, 0}, +{4, TokenCppKind_Typename}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Explicit}, +{4, TokenCppKind_Catch}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_StaticCast}, +{4, TokenCppKind_Template}, +{4, TokenCppKind_If}, +{0, 0}, +{0, 0}, +{0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Unsigned}, +{4, TokenCppKind_Try}, +{4, TokenCppKind_DynamicCast}, +{4, TokenCppKind_Register}, +{0, 0}, +{0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Enum}, +{4, TokenCppKind_Struct}, +{4, TokenCppKind_TypeID}, +{4, TokenCppKind_Static}, {4, TokenCppKind_Volatile}, {0, 0}, -{4, TokenCppKind_Float}, +{4, TokenCppKind_Public}, +{4, TokenCppKind_Short}, +{4, TokenCppKind_For}, {4, TokenCppKind_ConstCast}, -{4, TokenCppKind_SizeOf}, +{4, TokenCppKind_Switch}, {0, 0}, -{4, TokenCppKind_Long}, -{4, TokenCppKind_If}, -{4, TokenCppKind_Template}, -{4, TokenCppKind_Private}, +{4, TokenCppKind_This}, +{4, TokenCppKind_NullPtr}, {0, 0}, -{4, TokenCppKind_Static}, -{4, TokenCppKind_Union}, +{4, TokenCppKind_Delete}, {4, TokenCppKind_Extern}, +{0, 0}, +{4, TokenCppKind_Else}, +{4, TokenCppKind_Inline}, +{4, TokenCppKind_Namespace}, +{0, 0}, {4, TokenCppKind_Using}, {0, 0}, +{4, TokenCppKind_Do}, +{4, TokenCppKind_Class}, {0, 0}, -{8, TokenCppKind_LiteralTrue}, -{4, TokenCppKind_Double}, -{4, TokenCppKind_DeclType}, -{4, TokenCppKind_Virtual}, -{4, TokenCppKind_New}, +{0, 0}, +{4, TokenCppKind_ThreadLocal}, {0, 0}, }; i32 main_keys_slot_count = 121; -u64 main_keys_seed = 0xc6a99799e45617dd; +u64 main_keys_seed = 0x25509496d6df2725; u64 pp_directives_hash_array[25] = { -0xfa6a010b7dbbde13,0x0000000000000000,0xce2f38db2af5366d,0xfa6a010b7d62d06d, -0xcc962e54221688f9,0x0000000000000000,0x03b5dc5556efc84d,0xfa6a010b0bc317e5, -0x0000000000000000,0xcaa053e8a98a24b9,0xcaa053e8a98a2085,0xcc9620cd74b482d5, -0x0000000000000000,0x0000000000000000,0x0000000000000000,0x0000000000000000, -0xce2f38da33096dd7,0xce2f38dbf3d6ad6d,0xfa6a010b0bd76809,0x0000000000000000, -0xfa6a010b0edd496d,0xce2f38e88510d3c9,0x0000000000000000,0xcaa053e8aa33abcd, -0x0000000000000000, +0x0000000000000000,0xa14a48a955ec8363,0x0000000000000000,0x7136ce53f348205b, +0x37ce6c4c8b78b22f,0x37ce6c4cbe897123,0x0000000000000000,0x0000000000000000, +0x34cc7d0370d48693,0x0000000000000000,0x85a685922339fb23,0x0000000000000000, +0xa14a48a95710f7e3,0x0000000000000000,0x34cc7d0370d49bc9,0x34cc7d0370df735f, +0x713637c0adca7df7,0x0000000000000000,0x0000000000000000,0xa14a48a9743d0c09, +0x37ce6c4c19255fdf,0xa14a48aa88a0f2e3,0x0000000000000000,0xa14a48a958e03643, +0x37ce6c4e49825775, }; -u8 pp_directives_key_array_0[] = {0x75,0x73,0x69,0x6e,0x67,}; -u8 pp_directives_key_array_2[] = {0x64,0x65,0x66,0x69,0x6e,0x65,}; -u8 pp_directives_key_array_3[] = {0x75,0x6e,0x64,0x65,0x66,}; -u8 pp_directives_key_array_4[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,}; -u8 pp_directives_key_array_6[] = {0x69,0x66,}; -u8 pp_directives_key_array_7[] = {0x65,0x6e,0x64,0x69,0x66,}; -u8 pp_directives_key_array_9[] = {0x65,0x6c,0x73,0x65,}; -u8 pp_directives_key_array_10[] = {0x65,0x6c,0x69,0x66,}; -u8 pp_directives_key_array_11[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,}; -u8 pp_directives_key_array_16[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,}; -u8 pp_directives_key_array_17[] = {0x69,0x66,0x6e,0x64,0x65,0x66,}; -u8 pp_directives_key_array_18[] = {0x65,0x72,0x72,0x6f,0x72,}; -u8 pp_directives_key_array_20[] = {0x69,0x66,0x64,0x65,0x66,}; -u8 pp_directives_key_array_21[] = {0x70,0x72,0x61,0x67,0x6d,0x61,}; -u8 pp_directives_key_array_23[] = {0x6c,0x69,0x6e,0x65,}; +u8 pp_directives_key_array_1[] = {0x69,0x66,0x64,0x65,0x66,}; +u8 pp_directives_key_array_3[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,}; +u8 pp_directives_key_array_4[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,}; +u8 pp_directives_key_array_5[] = {0x69,0x66,0x6e,0x64,0x65,0x66,}; +u8 pp_directives_key_array_8[] = {0x65,0x6c,0x69,0x66,}; +u8 pp_directives_key_array_10[] = {0x69,0x66,}; +u8 pp_directives_key_array_12[] = {0x65,0x6e,0x64,0x69,0x66,}; +u8 pp_directives_key_array_14[] = {0x65,0x6c,0x73,0x65,}; +u8 pp_directives_key_array_15[] = {0x6c,0x69,0x6e,0x65,}; +u8 pp_directives_key_array_16[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,}; +u8 pp_directives_key_array_19[] = {0x75,0x73,0x69,0x6e,0x67,}; +u8 pp_directives_key_array_20[] = {0x64,0x65,0x66,0x69,0x6e,0x65,}; +u8 pp_directives_key_array_21[] = {0x75,0x6e,0x64,0x65,0x66,}; +u8 pp_directives_key_array_23[] = {0x65,0x72,0x72,0x6f,0x72,}; +u8 pp_directives_key_array_24[] = {0x70,0x72,0x61,0x67,0x6d,0x61,}; String_Const_u8 pp_directives_key_array[25] = { -{pp_directives_key_array_0, 5}, {0, 0}, -{pp_directives_key_array_2, 6}, -{pp_directives_key_array_3, 5}, -{pp_directives_key_array_4, 7}, +{pp_directives_key_array_1, 5}, {0, 0}, -{pp_directives_key_array_6, 2}, -{pp_directives_key_array_7, 5}, -{0, 0}, -{pp_directives_key_array_9, 4}, -{pp_directives_key_array_10, 4}, -{pp_directives_key_array_11, 7}, +{pp_directives_key_array_3, 7}, +{pp_directives_key_array_4, 6}, +{pp_directives_key_array_5, 6}, {0, 0}, {0, 0}, +{pp_directives_key_array_8, 4}, +{0, 0}, +{pp_directives_key_array_10, 2}, +{0, 0}, +{pp_directives_key_array_12, 5}, +{0, 0}, +{pp_directives_key_array_14, 4}, +{pp_directives_key_array_15, 4}, +{pp_directives_key_array_16, 7}, {0, 0}, {0, 0}, -{pp_directives_key_array_16, 6}, -{pp_directives_key_array_17, 6}, -{pp_directives_key_array_18, 5}, -{0, 0}, -{pp_directives_key_array_20, 5}, -{pp_directives_key_array_21, 6}, -{0, 0}, -{pp_directives_key_array_23, 4}, +{pp_directives_key_array_19, 5}, +{pp_directives_key_array_20, 6}, +{pp_directives_key_array_21, 5}, {0, 0}, +{pp_directives_key_array_23, 5}, +{pp_directives_key_array_24, 6}, }; Lexeme_Table_Value pp_directives_value_array[25] = { -{5, TokenCppKind_PPUsing}, {0, 0}, -{5, TokenCppKind_PPDefine}, -{5, TokenCppKind_PPUndef}, -{5, TokenCppKind_PPInclude}, +{5, TokenCppKind_PPIfDef}, +{0, 0}, +{5, TokenCppKind_PPVersion}, +{5, TokenCppKind_PPImport}, +{5, TokenCppKind_PPIfNDef}, +{0, 0}, +{0, 0}, +{5, TokenCppKind_PPElIf}, {0, 0}, {5, TokenCppKind_PPIf}, +{0, 0}, {5, TokenCppKind_PPEndIf}, {0, 0}, {5, TokenCppKind_PPElse}, -{5, TokenCppKind_PPElIf}, -{5, TokenCppKind_PPVersion}, -{0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{5, TokenCppKind_PPImport}, -{5, TokenCppKind_PPIfNDef}, -{5, TokenCppKind_PPError}, -{0, 0}, -{5, TokenCppKind_PPIfDef}, -{5, TokenCppKind_PPPragma}, -{0, 0}, {5, TokenCppKind_PPLine}, +{5, TokenCppKind_PPInclude}, {0, 0}, +{0, 0}, +{5, TokenCppKind_PPUsing}, +{5, TokenCppKind_PPDefine}, +{5, TokenCppKind_PPUndef}, +{0, 0}, +{5, TokenCppKind_PPError}, +{5, TokenCppKind_PPPragma}, }; i32 pp_directives_slot_count = 25; -u64 pp_directives_seed = 0x7dd6fc44901da387; +u64 pp_directives_seed = 0x6a6565df267ce22a; u64 pp_keys_hash_array[2] = { -0x0000000000000000,0x3eb4becea6185ce7, +0x0000000000000000,0xa92d334d98f81307, }; u8 pp_keys_key_array_1[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,}; String_Const_u8 pp_keys_key_array[2] = { @@ -483,7 +483,7 @@ Lexeme_Table_Value pp_keys_value_array[2] = { {4, TokenCppKind_PPDefined}, }; i32 pp_keys_slot_count = 2; -u64 pp_keys_seed = 0x62441372bace9443; +u64 pp_keys_seed = 0x0a7073ccb09f1aa3; struct Lex_State_Cpp{ u32 flags_ZF0; u32 flags_KF0;