From 3e31e78d1f4d138497a6eb33a631cc6ab22f9271 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Tue, 1 Oct 2019 15:03:21 -0700 Subject: [PATCH] Fixed lexer for preprocssor directives completely; fixed up build paths some more --- 4ed_coroutine.cpp | 8 +- 4ed_coroutine.h | 2 +- custom/bin/build_one_time.bat | 2 +- custom/languages/4coder_lex_gen_cpp.cpp | 20 +- custom/languages/4coder_lexer_cpp_test.cpp | 8 +- custom/languages/generated_lexer_cpp.cpp | 1038 +++++++++-------- .../lexer_generator/4coder_lex_gen_main.cpp | 27 +- platform_win32/win32_4ed.cpp | 3 + project.4coder | 14 +- 9 files changed, 611 insertions(+), 511 deletions(-) diff --git a/4ed_coroutine.cpp b/4ed_coroutine.cpp index 31212df0..8048bde3 100644 --- a/4ed_coroutine.cpp +++ b/4ed_coroutine.cpp @@ -46,9 +46,9 @@ coroutine_main(void *ptr){ } Assert(me->type != CoroutineType_Root); Assert(me->yield_ctx != 0); - Assert(me->function != 0); + Assert(me->func != 0); - me->function(me); + me->func(me); // NOTE(allen): Wake up the caller and set this coroutine back to being dead. Coroutine *other = me->yield_ctx; @@ -56,7 +56,7 @@ coroutine_main(void *ptr){ Assert(other->state == CoroutineState_Waiting); coroutine__pass_control(me, other, CoroutineState_Dead, CoroutinePassControl_ExitMe); - me->function = 0; + me->func = 0; } } @@ -124,7 +124,7 @@ internal Coroutine* coroutine_create(Coroutine_Group *coroutines, Coroutine_Function *func){ Coroutine *result = coroutine_system_alloc(coroutines); Assert(result->state == CoroutineState_Dead); - result->function = func; + result->func = func; return(result); } diff --git a/4ed_coroutine.h b/4ed_coroutine.h index 066f26a4..bffd3567 100644 --- a/4ed_coroutine.h +++ b/4ed_coroutine.h @@ -37,7 +37,7 @@ struct Coroutine{ System_Thread thread; System_Condition_Variable cv; struct Coroutine_Group *sys; - Coroutine_Function *function; + Coroutine_Function *func; Coroutine *yield_ctx; Coroutine_State state; Coroutine_Type type; diff --git a/custom/bin/build_one_time.bat b/custom/bin/build_one_time.bat index 236c5854..05c2262a 100644 --- a/custom/bin/build_one_time.bat +++ b/custom/bin/build_one_time.bat @@ -35,7 +35,7 @@ set opts=%opts% /I%custom_root% set opts=%opts% %mode% pushd %dst% -call cl /I"%code_home%" %opts% %full_target% /Fegenerator +call cl /I"%code_home%" %opts% %full_target% /Feone_time popd diff --git a/custom/languages/4coder_lex_gen_cpp.cpp b/custom/languages/4coder_lex_gen_cpp.cpp index b555fff5..1aabd407 100644 --- a/custom/languages/4coder_lex_gen_cpp.cpp +++ b/custom/languages/4coder_lex_gen_cpp.cpp @@ -311,6 +311,7 @@ build_language_model(void){ AddState(ULL_number); AddState(pp_directive_whitespace); + AddState(pp_directive_first); AddState(pp_directive); AddState(pp_directive_emit); @@ -774,13 +775,12 @@ build_language_model(void){ //// sm_select_state(pp_directive_whitespace); - sm_delim_mark_first(); sm_case(" \t\f\v", pp_directive_whitespace); - sm_case("abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "_" - "0123456789", - pp_directive); + sm_case_peek("abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "_" + "0123456789", + pp_directive_first); { Emit_Rule *emit = sm_emit_rule(); sm_emit_handler_direct("LexError"); @@ -789,8 +789,14 @@ build_language_model(void){ //// - sm_select_state(pp_directive); + sm_select_state(pp_directive_first); + sm_delim_mark_first(); sm_set_flag(is_pp_body, true); + sm_fallback_peek(pp_directive); + + //// + + sm_select_state(pp_directive); sm_case("abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "_" diff --git a/custom/languages/4coder_lexer_cpp_test.cpp b/custom/languages/4coder_lexer_cpp_test.cpp index d50a5972..d32a6a61 100644 --- a/custom/languages/4coder_lexer_cpp_test.cpp +++ b/custom/languages/4coder_lexer_cpp_test.cpp @@ -408,6 +408,12 @@ R"bar(foo )bar" #error ``` Foo bar is bad news bears! ``` +# define foo bar +# define bar baz +#define baz bish + +# error wishy washy +#define swish(x,y,...) switch(x){ y(__VA_ARGS__) } #endif @@ -438,7 +444,7 @@ print_token_list(Token_List *list, String_Const_u8 text){ token_base_kind_names[token->kind], token_cpp_kind_names[token->sub_kind], token->flags, token->sub_flags); - printf("\t:%.*s:\n", token->size, text.str + token->pos); + printf("\t:%.*s:\n", (i32)token->size, text.str + token->pos); } } } diff --git a/custom/languages/generated_lexer_cpp.cpp b/custom/languages/generated_lexer_cpp.cpp index 79eb5fdf..c4364929 100644 --- a/custom/languages/generated_lexer_cpp.cpp +++ b/custom/languages/generated_lexer_cpp.cpp @@ -43,439 +43,439 @@ lexeme_table_lookup(u64 *hash_array, String_Const_u8 *key_array, } #endif -u64 main_keys_hash_array[123] = { -0x0000000000000000,0x6f4a79edb9a5533f,0xe5852ac396610dc5,0x0000000000000000, -0x0000000000000000,0x0000000000000000,0xa2a5dfeb017ed5bd,0xcd6340d166644e7f, -0x8408b482fc52169f,0x0000000000000000,0xcedf49ae63560b69,0x0000000000000000, -0x0000000000000000,0x0000000000000000,0xe75cf7ee7286ec9d,0x0000000000000000, -0x8408b482c15279f5,0x0000000000000000,0xe5852ab101aa40f9,0x0000000000000000, +u64 main_keys_hash_array[125] = { +0x700852e79b454ee5,0x8c830d6a28ceb049,0x0000000000000000,0x0000000000000000, +0x6a5261911c284809,0x8c830d43e3275797,0x6a52616f1a9da7e1,0x830a70dc81713c85, +0x0000000000000000,0x0000000000000000,0x1a3681ef26e3ccad,0x0000000000000000, +0xb833330811f3610b,0x1a3681ef3ce3456d,0x1a3681ef46ce3dfd,0x0000000000000000, +0x0000000000000000,0x448b87bc4189c8e7,0x6a526197ffdd649b,0x0000000000000000, +0x0000000000000000,0x448a11254db0b517,0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x121c872318b7c6e5,0x0000000000000000,0x1a3681ef26e6c9e1, +0x0000000000000000,0x0000000000000000,0x8c833b93b4c9ef53,0x6a52616feb6b3f9b, +0x0000000000000000,0x44905fe81e403a17,0x6a52616f19c87465,0x4490205dcb72c823, +0x830a70dc9f6ffd5f,0x0000000000000000,0x1a3681ef1917cddf,0x0000000000000000, +0x0000000000000000,0x6192823f0f8de38f,0x0000000000000000,0x448b80d341864807, +0x830a70dc8169e9a9,0x6192823f0f8b6563,0x1a3681ef26f6cb9d,0x77b7eaa76c0be197, +0x0000000000000000,0x449094d2e6ba3109,0x830a70dc808206e5,0x6a52616f19ef79b9, +0x0000000000000000,0x830a70dc9f6da93f,0x0000000000000000,0x0000000000000000, +0x6a52616f19e4395f,0x448a28191fdfcbf9,0x0000000000000000,0x448b8d25acd441b9, +0x0000000000000000,0x0000000000000000,0x1a3681f04e6e8a17,0x8c830b5d6484087b, 0x0000000000000000,0x0000000000000000,0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000,0xcede45b28f565327,0x0000000000000000, -0x0000000000000000,0x3cb9f5ca3e080c89,0x0000000000000000,0x0000000000000000, -0xe5852ac24b661f2d,0xe5852ab17aec8db7,0x0000000000000000,0xcd6340d166659c89, -0x0000000000000000,0x0000000000000000,0x8408b482facd5b93,0x12cbed639027df6f, -0xcedeb002ce9cbaf7,0xcee7dcc940536a31,0x0000000000000000,0x3cb9f5ca3e080c1d, -0x0000000000000000,0xe5852ac3c0cbc80d,0xcede5b51ee94b7c1,0x9a20703d4bd687c5, -0x8408b4828b3f4029,0x0000000000000000,0x0000000000000000,0xcedf9451bda57031, -0xe5852ac394d6e7af,0x44af72658a8ddf6f,0xe5852ab45a7e4877,0x0000000000000000, -0x3cb9f115b38586fd,0xe5852aeaff3b438d,0x666eef765675122f,0x0000000000000000, -0x8408b482cd76ef71,0xcd6340d1662d7e9f,0x0000000000000000,0x0000000000000000, -0xa2a5dfeb017e0e17,0x0000000000000000,0x0000000000000000,0x0000000000000000, -0xcd6340d166330431,0x0000000000000000,0x0000000000000000,0xcede1b147919cf71, -0x0000000000000000,0xe5852ab14f69af13,0x0000000000000000,0x0000000000000000, -0x0000000000000000,0xbe87c88e9f25c76f,0xe5852ac371f40231,0x0000000000000000, -0x6fcb06cae6e806ff,0x0000000000000000,0x8408b482fa970537,0x3cb9f05f96b9d771, -0xe5852ab17aadebb5,0x23945d1e642d9f6f,0xe75cf7ee7286f2a7,0x0000000000000000, -0x0000000000000000,0x3cb9f6891369547f,0xcd6340d16634823f,0x0000000000000000, -0xe5852ab1ac65f55f,0x8408b482caf244cd,0xcd6340d1629b9d0f,0x0000000000000000, -0x0000000000000000,0x0000000000000000,0x8408b482fa83e8a9,0x3cb9cc3692b7c61b, -0xcede1b03b4c5ebb7,0x3cb9f5df428aa011,0xa2a5dfeb017fd991,0x0000000000000000, -0xcd6340d16794567f,0xcd6340d166781707,0x0000000000000000,0xcedf6504dde4ee5f, -0x8408b482fc53d937,0xe5852ab148ad9eb1,0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000,0x0000000000000000,0xcd6340d16639a18b, -0xcd6340d1662d6e7f,0xcee7dfce15a7a951,0xa2a5dfeb017136ed,0x8408b482ca53786f, -0x0000000000000000,0xe5852ab148e5344f,0xa2a5dfeb01710e1d, +0x9d212a3c13a54ee5,0x0000000000000000,0x0000000000000000,0x0000000000000000, +0x1a3681ef1733fc95,0x8c830b3dc4805c87,0x6a52619a663bf267,0x830a70dc9f6d3697, +0x0000000000000000,0x0000000000000000,0x830a70dc9f6f3e9f,0x6a526197fe1cb39d, +0x0000000000000000,0x6a52616f2406c68d,0x0000000000000000,0x8c830d43e327595d, +0x6192823f0f841d49,0x0000000000000000,0x0000000000000000,0xb462f1e7539735f5, +0x0000000000000000,0x0000000000000000,0x6a52619a762a54df,0x0000000000000000, +0xb833330811f37f25,0x6a526190914c290d,0x1a3681ef25760079,0x0000000000000000, +0x830a70dc9f0ae53d,0xd865a3fc4b9231d1,0x448a08a5bd2f7f5f,0x830a70dc9f0bd097, +0x6192823f0f8d0ee3,0x0000000000000000,0x0000000000000000,0x0000000000000000, +0x75755f3faf6f6c99,0x6a526197fa77becd,0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x1a3681ef3b0d0fc7,0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x448577168c810e8f,0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x830a70dc9e9d0a45,0x8c833a5293cc5311,0x0000000000000000, +0x6a52614e6040116f,0x45e6d99f13f026e5,0x0000000000000000,0x0000000000000000, +0x6192823f0f84d19d, }; -u8 main_keys_key_array_1[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,}; -u8 main_keys_key_array_2[] = {0x65,0x78,0x70,0x6f,0x72,0x74,}; -u8 main_keys_key_array_6[] = {0x74,0x72,0x79,}; -u8 main_keys_key_array_7[] = {0x74,0x72,0x75,0x65,}; -u8 main_keys_key_array_8[] = {0x66,0x61,0x6c,0x73,0x65,}; -u8 main_keys_key_array_10[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,}; -u8 main_keys_key_array_14[] = {0x69,0x66,}; -u8 main_keys_key_array_16[] = {0x73,0x68,0x6f,0x72,0x74,}; -u8 main_keys_key_array_18[] = {0x70,0x75,0x62,0x6c,0x69,0x63,}; -u8 main_keys_key_array_26[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,}; -u8 main_keys_key_array_29[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,}; -u8 main_keys_key_array_32[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,}; -u8 main_keys_key_array_33[] = {0x73,0x69,0x67,0x6e,0x65,0x64,}; -u8 main_keys_key_array_35[] = {0x74,0x68,0x69,0x73,}; -u8 main_keys_key_array_38[] = {0x63,0x61,0x74,0x63,0x68,}; -u8 main_keys_key_array_39[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; -u8 main_keys_key_array_40[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,}; -u8 main_keys_key_array_41[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,}; -u8 main_keys_key_array_43[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,}; -u8 main_keys_key_array_45[] = {0x66,0x72,0x69,0x65,0x6e,0x64,}; -u8 main_keys_key_array_46[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,}; -u8 main_keys_key_array_47[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,}; -u8 main_keys_key_array_48[] = {0x62,0x72,0x65,0x61,0x6b,}; -u8 main_keys_key_array_51[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,}; -u8 main_keys_key_array_52[] = {0x65,0x78,0x74,0x65,0x72,0x6e,}; -u8 main_keys_key_array_53[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; -u8 main_keys_key_array_54[] = {0x74,0x79,0x70,0x65,0x69,0x64,}; -u8 main_keys_key_array_56[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,}; -u8 main_keys_key_array_57[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,}; -u8 main_keys_key_array_58[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,}; -u8 main_keys_key_array_60[] = {0x77,0x68,0x69,0x6c,0x65,}; -u8 main_keys_key_array_61[] = {0x65,0x6c,0x73,0x65,}; -u8 main_keys_key_array_64[] = {0x61,0x73,0x6d,}; -u8 main_keys_key_array_68[] = {0x63,0x68,0x61,0x72,}; -u8 main_keys_key_array_71[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,}; -u8 main_keys_key_array_73[] = {0x73,0x77,0x69,0x74,0x63,0x68,}; -u8 main_keys_key_array_77[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,}; -u8 main_keys_key_array_78[] = {0x64,0x65,0x6c,0x65,0x74,0x65,}; -u8 main_keys_key_array_80[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,}; -u8 main_keys_key_array_82[] = {0x63,0x6f,0x6e,0x73,0x74,}; -u8 main_keys_key_array_83[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,}; -u8 main_keys_key_array_84[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,}; -u8 main_keys_key_array_85[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,}; -u8 main_keys_key_array_86[] = {0x64,0x6f,}; -u8 main_keys_key_array_89[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,}; -u8 main_keys_key_array_90[] = {0x63,0x61,0x73,0x65,}; -u8 main_keys_key_array_92[] = {0x72,0x65,0x74,0x75,0x72,0x6e,}; -u8 main_keys_key_array_93[] = {0x75,0x6e,0x69,0x6f,0x6e,}; -u8 main_keys_key_array_94[] = {0x6c,0x6f,0x6e,0x67,}; -u8 main_keys_key_array_98[] = {0x63,0x6c,0x61,0x73,0x73,}; -u8 main_keys_key_array_99[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,}; -u8 main_keys_key_array_100[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,}; -u8 main_keys_key_array_101[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,}; -u8 main_keys_key_array_102[] = {0x66,0x6f,0x72,}; -u8 main_keys_key_array_104[] = {0x62,0x6f,0x6f,0x6c,}; -u8 main_keys_key_array_105[] = {0x76,0x6f,0x69,0x64,}; -u8 main_keys_key_array_107[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,}; -u8 main_keys_key_array_108[] = {0x66,0x6c,0x6f,0x61,0x74,}; -u8 main_keys_key_array_109[] = {0x73,0x74,0x61,0x74,0x69,0x63,}; -u8 main_keys_key_array_115[] = {0x67,0x6f,0x74,0x6f,}; -u8 main_keys_key_array_116[] = {0x65,0x6e,0x75,0x6d,}; -u8 main_keys_key_array_117[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,}; -u8 main_keys_key_array_118[] = {0x6e,0x65,0x77,}; -u8 main_keys_key_array_119[] = {0x75,0x73,0x69,0x6e,0x67,}; -u8 main_keys_key_array_121[] = {0x73,0x74,0x72,0x75,0x63,0x74,}; -u8 main_keys_key_array_122[] = {0x69,0x6e,0x74,}; -String_Const_u8 main_keys_key_array[123] = { -{0, 0}, -{main_keys_key_array_1, 9}, -{main_keys_key_array_2, 6}, +u8 main_keys_key_array_0[] = {0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; +u8 main_keys_key_array_1[] = {0x64,0x65,0x66,0x61,0x75,0x6c,0x74,}; +u8 main_keys_key_array_4[] = {0x74,0x79,0x70,0x65,0x69,0x64,}; +u8 main_keys_key_array_5[] = {0x61,0x6c,0x69,0x67,0x6e,0x6f,0x66,}; +u8 main_keys_key_array_6[] = {0x73,0x77,0x69,0x74,0x63,0x68,}; +u8 main_keys_key_array_7[] = {0x67,0x6f,0x74,0x6f,}; +u8 main_keys_key_array_10[] = {0x63,0x6f,0x6e,0x73,0x74,}; +u8 main_keys_key_array_12[] = {0x69,0x66,}; +u8 main_keys_key_array_13[] = {0x75,0x73,0x69,0x6e,0x67,}; +u8 main_keys_key_array_14[] = {0x73,0x68,0x6f,0x72,0x74,}; +u8 main_keys_key_array_17[] = {0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,}; +u8 main_keys_key_array_18[] = {0x65,0x78,0x74,0x65,0x72,0x6e,}; +u8 main_keys_key_array_21[] = {0x63,0x6f,0x6e,0x74,0x69,0x6e,0x75,0x65,}; +u8 main_keys_key_array_25[] = {0x63,0x6f,0x6e,0x73,0x74,0x5f,0x63,0x61,0x73,0x74,}; +u8 main_keys_key_array_27[] = {0x63,0x61,0x74,0x63,0x68,}; +u8 main_keys_key_array_30[] = {0x6e,0x75,0x6c,0x6c,0x70,0x74,0x72,}; +u8 main_keys_key_array_31[] = {0x72,0x65,0x74,0x75,0x72,0x6e,}; +u8 main_keys_key_array_33[] = {0x76,0x6f,0x6c,0x61,0x74,0x69,0x6c,0x65,}; +u8 main_keys_key_array_34[] = {0x73,0x74,0x72,0x75,0x63,0x74,}; +u8 main_keys_key_array_35[] = {0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,}; +u8 main_keys_key_array_36[] = {0x65,0x6c,0x73,0x65,}; +u8 main_keys_key_array_38[] = {0x66,0x61,0x6c,0x73,0x65,}; +u8 main_keys_key_array_41[] = {0x61,0x73,0x6d,}; +u8 main_keys_key_array_43[] = {0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,}; +u8 main_keys_key_array_44[] = {0x76,0x6f,0x69,0x64,}; +u8 main_keys_key_array_45[] = {0x74,0x72,0x79,}; +u8 main_keys_key_array_46[] = {0x63,0x6c,0x61,0x73,0x73,}; +u8 main_keys_key_array_47[] = {0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,}; +u8 main_keys_key_array_49[] = {0x6e,0x6f,0x65,0x78,0x63,0x65,0x70,0x74,}; +u8 main_keys_key_array_50[] = {0x6c,0x6f,0x6e,0x67,}; +u8 main_keys_key_array_51[] = {0x73,0x69,0x67,0x6e,0x65,0x64,}; +u8 main_keys_key_array_53[] = {0x63,0x68,0x61,0x72,}; +u8 main_keys_key_array_56[] = {0x73,0x69,0x7a,0x65,0x6f,0x66,}; +u8 main_keys_key_array_57[] = {0x65,0x78,0x70,0x6c,0x69,0x63,0x69,0x74,}; +u8 main_keys_key_array_59[] = {0x75,0x6e,0x73,0x69,0x67,0x6e,0x65,0x64,}; +u8 main_keys_key_array_62[] = {0x77,0x68,0x69,0x6c,0x65,}; +u8 main_keys_key_array_63[] = {0x74,0x79,0x70,0x65,0x64,0x65,0x66,}; +u8 main_keys_key_array_68[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x63,0x61,0x73,0x74,}; +u8 main_keys_key_array_72[] = {0x62,0x72,0x65,0x61,0x6b,}; +u8 main_keys_key_array_73[] = {0x70,0x72,0x69,0x76,0x61,0x74,0x65,}; +u8 main_keys_key_array_74[] = {0x64,0x65,0x6c,0x65,0x74,0x65,}; +u8 main_keys_key_array_75[] = {0x63,0x61,0x73,0x65,}; +u8 main_keys_key_array_78[] = {0x65,0x6e,0x75,0x6d,}; +u8 main_keys_key_array_79[] = {0x65,0x78,0x70,0x6f,0x72,0x74,}; +u8 main_keys_key_array_81[] = {0x73,0x74,0x61,0x74,0x69,0x63,}; +u8 main_keys_key_array_83[] = {0x61,0x6c,0x69,0x67,0x6e,0x61,0x73,}; +u8 main_keys_key_array_84[] = {0x6e,0x65,0x77,}; +u8 main_keys_key_array_87[] = {0x73,0x74,0x61,0x74,0x69,0x63,0x5f,0x61,0x73,0x73,0x65,0x72,0x74,}; +u8 main_keys_key_array_90[] = {0x64,0x6f,0x75,0x62,0x6c,0x65,}; +u8 main_keys_key_array_92[] = {0x64,0x6f,}; +u8 main_keys_key_array_93[] = {0x70,0x75,0x62,0x6c,0x69,0x63,}; +u8 main_keys_key_array_94[] = {0x66,0x6c,0x6f,0x61,0x74,}; +u8 main_keys_key_array_96[] = {0x74,0x68,0x69,0x73,}; +u8 main_keys_key_array_97[] = {0x74,0x68,0x72,0x65,0x61,0x64,0x5f,0x6c,0x6f,0x63,0x61,0x6c,}; +u8 main_keys_key_array_98[] = {0x64,0x65,0x63,0x6c,0x74,0x79,0x70,0x65,}; +u8 main_keys_key_array_99[] = {0x74,0x72,0x75,0x65,}; +u8 main_keys_key_array_100[] = {0x66,0x6f,0x72,}; +u8 main_keys_key_array_104[] = {0x70,0x72,0x6f,0x74,0x65,0x63,0x74,0x65,0x64,}; +u8 main_keys_key_array_105[] = {0x66,0x72,0x69,0x65,0x6e,0x64,}; +u8 main_keys_key_array_109[] = {0x75,0x6e,0x69,0x6f,0x6e,}; +u8 main_keys_key_array_113[] = {0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,}; +u8 main_keys_key_array_117[] = {0x62,0x6f,0x6f,0x6c,}; +u8 main_keys_key_array_118[] = {0x76,0x69,0x72,0x74,0x75,0x61,0x6c,}; +u8 main_keys_key_array_120[] = {0x69,0x6e,0x6c,0x69,0x6e,0x65,}; +u8 main_keys_key_array_121[] = {0x72,0x65,0x69,0x6e,0x74,0x65,0x72,0x70,0x72,0x65,0x74,0x5f,0x63,0x61,0x73,0x74,}; +u8 main_keys_key_array_124[] = {0x69,0x6e,0x74,}; +String_Const_u8 main_keys_key_array[125] = { +{main_keys_key_array_0, 12}, +{main_keys_key_array_1, 7}, {0, 0}, {0, 0}, -{0, 0}, -{main_keys_key_array_6, 3}, +{main_keys_key_array_4, 6}, +{main_keys_key_array_5, 7}, +{main_keys_key_array_6, 6}, {main_keys_key_array_7, 4}, -{main_keys_key_array_8, 5}, -{0, 0}, -{main_keys_key_array_10, 8}, {0, 0}, {0, 0}, +{main_keys_key_array_10, 5}, {0, 0}, -{main_keys_key_array_14, 2}, +{main_keys_key_array_12, 2}, +{main_keys_key_array_13, 5}, +{main_keys_key_array_14, 5}, {0, 0}, -{main_keys_key_array_16, 5}, {0, 0}, +{main_keys_key_array_17, 8}, {main_keys_key_array_18, 6}, {0, 0}, {0, 0}, +{main_keys_key_array_21, 8}, {0, 0}, {0, 0}, {0, 0}, +{main_keys_key_array_25, 10}, +{0, 0}, +{main_keys_key_array_27, 5}, {0, 0}, {0, 0}, -{main_keys_key_array_26, 8}, -{0, 0}, -{0, 0}, -{main_keys_key_array_29, 7}, -{0, 0}, -{0, 0}, -{main_keys_key_array_32, 6}, -{main_keys_key_array_33, 6}, -{0, 0}, -{main_keys_key_array_35, 4}, +{main_keys_key_array_30, 7}, +{main_keys_key_array_31, 6}, {0, 0}, +{main_keys_key_array_33, 8}, +{main_keys_key_array_34, 6}, +{main_keys_key_array_35, 8}, +{main_keys_key_array_36, 4}, {0, 0}, {main_keys_key_array_38, 5}, -{main_keys_key_array_39, 11}, -{main_keys_key_array_40, 8}, -{main_keys_key_array_41, 8}, -{0, 0}, -{main_keys_key_array_43, 7}, -{0, 0}, -{main_keys_key_array_45, 6}, -{main_keys_key_array_46, 8}, -{main_keys_key_array_47, 13}, -{main_keys_key_array_48, 5}, {0, 0}, {0, 0}, -{main_keys_key_array_51, 8}, -{main_keys_key_array_52, 6}, -{main_keys_key_array_53, 12}, -{main_keys_key_array_54, 6}, +{main_keys_key_array_41, 3}, {0, 0}, -{main_keys_key_array_56, 7}, -{main_keys_key_array_57, 6}, -{main_keys_key_array_58, 12}, +{main_keys_key_array_43, 8}, +{main_keys_key_array_44, 4}, +{main_keys_key_array_45, 3}, +{main_keys_key_array_46, 5}, +{main_keys_key_array_47, 9}, {0, 0}, -{main_keys_key_array_60, 5}, -{main_keys_key_array_61, 4}, +{main_keys_key_array_49, 8}, +{main_keys_key_array_50, 4}, +{main_keys_key_array_51, 6}, +{0, 0}, +{main_keys_key_array_53, 4}, {0, 0}, {0, 0}, -{main_keys_key_array_64, 3}, +{main_keys_key_array_56, 6}, +{main_keys_key_array_57, 8}, +{0, 0}, +{main_keys_key_array_59, 8}, +{0, 0}, +{0, 0}, +{main_keys_key_array_62, 5}, +{main_keys_key_array_63, 7}, {0, 0}, {0, 0}, {0, 0}, -{main_keys_key_array_68, 4}, {0, 0}, -{0, 0}, -{main_keys_key_array_71, 8}, -{0, 0}, -{main_keys_key_array_73, 6}, +{main_keys_key_array_68, 11}, {0, 0}, {0, 0}, {0, 0}, -{main_keys_key_array_77, 16}, -{main_keys_key_array_78, 6}, +{main_keys_key_array_72, 5}, +{main_keys_key_array_73, 7}, +{main_keys_key_array_74, 6}, +{main_keys_key_array_75, 4}, {0, 0}, -{main_keys_key_array_80, 9}, {0, 0}, -{main_keys_key_array_82, 5}, +{main_keys_key_array_78, 4}, +{main_keys_key_array_79, 6}, +{0, 0}, +{main_keys_key_array_81, 6}, +{0, 0}, {main_keys_key_array_83, 7}, -{main_keys_key_array_84, 6}, -{main_keys_key_array_85, 10}, -{main_keys_key_array_86, 2}, +{main_keys_key_array_84, 3}, {0, 0}, {0, 0}, -{main_keys_key_array_89, 7}, -{main_keys_key_array_90, 4}, +{main_keys_key_array_87, 13}, {0, 0}, -{main_keys_key_array_92, 6}, -{main_keys_key_array_93, 5}, -{main_keys_key_array_94, 4}, +{0, 0}, +{main_keys_key_array_90, 6}, +{0, 0}, +{main_keys_key_array_92, 2}, +{main_keys_key_array_93, 6}, +{main_keys_key_array_94, 5}, +{0, 0}, +{main_keys_key_array_96, 4}, +{main_keys_key_array_97, 12}, +{main_keys_key_array_98, 8}, +{main_keys_key_array_99, 4}, +{main_keys_key_array_100, 3}, {0, 0}, {0, 0}, {0, 0}, -{main_keys_key_array_98, 5}, -{main_keys_key_array_99, 7}, -{main_keys_key_array_100, 8}, -{main_keys_key_array_101, 7}, -{main_keys_key_array_102, 3}, -{0, 0}, -{main_keys_key_array_104, 4}, -{main_keys_key_array_105, 4}, -{0, 0}, -{main_keys_key_array_107, 8}, -{main_keys_key_array_108, 5}, -{main_keys_key_array_109, 6}, +{main_keys_key_array_104, 9}, +{main_keys_key_array_105, 6}, {0, 0}, {0, 0}, {0, 0}, +{main_keys_key_array_109, 5}, {0, 0}, {0, 0}, -{main_keys_key_array_115, 4}, -{main_keys_key_array_116, 4}, -{main_keys_key_array_117, 8}, -{main_keys_key_array_118, 3}, -{main_keys_key_array_119, 5}, {0, 0}, -{main_keys_key_array_121, 6}, -{main_keys_key_array_122, 3}, +{main_keys_key_array_113, 8}, +{0, 0}, +{0, 0}, +{0, 0}, +{main_keys_key_array_117, 4}, +{main_keys_key_array_118, 7}, +{0, 0}, +{main_keys_key_array_120, 6}, +{main_keys_key_array_121, 16}, +{0, 0}, +{0, 0}, +{main_keys_key_array_124, 3}, }; -Lexeme_Table_Value main_keys_value_array[123] = { +Lexeme_Table_Value main_keys_value_array[125] = { +{4, TokenCppKind_DynamicCast}, +{4, TokenCppKind_Default}, {0, 0}, +{0, 0}, +{4, TokenCppKind_TypeID}, +{4, TokenCppKind_AlignOf}, +{4, TokenCppKind_Switch}, +{4, TokenCppKind_Goto}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Const}, +{0, 0}, +{4, TokenCppKind_If}, +{4, TokenCppKind_Using}, +{4, TokenCppKind_Short}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Typename}, +{4, TokenCppKind_Extern}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Continue}, +{0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_ConstCast}, +{0, 0}, +{4, TokenCppKind_Catch}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_NullPtr}, +{4, TokenCppKind_Return}, +{0, 0}, +{4, TokenCppKind_Volatile}, +{4, TokenCppKind_Struct}, +{4, TokenCppKind_Operator}, +{4, TokenCppKind_Else}, +{0, 0}, +{8, TokenCppKind_LiteralFalse}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Asm}, +{0, 0}, +{4, TokenCppKind_Template}, +{4, TokenCppKind_Void}, +{4, TokenCppKind_Try}, +{4, TokenCppKind_Class}, {4, TokenCppKind_Namespace}, +{0, 0}, +{4, TokenCppKind_NoExcept}, +{4, TokenCppKind_Long}, +{4, TokenCppKind_Signed}, +{0, 0}, +{4, TokenCppKind_Char}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_SizeOf}, +{4, TokenCppKind_Explicit}, +{0, 0}, +{4, TokenCppKind_Unsigned}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_While}, +{4, TokenCppKind_Typedef}, +{0, 0}, +{0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_StaticCast}, +{0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Break}, +{4, TokenCppKind_Private}, +{4, TokenCppKind_Delete}, +{4, TokenCppKind_Case}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Enum}, {4, TokenCppKind_Export}, {0, 0}, +{4, TokenCppKind_Static}, +{0, 0}, +{4, TokenCppKind_AlignAs}, +{4, TokenCppKind_New}, {0, 0}, {0, 0}, -{4, TokenCppKind_Try}, +{4, TokenCppKind_StaticAssert}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Double}, +{0, 0}, +{4, TokenCppKind_Do}, +{4, TokenCppKind_Public}, +{4, TokenCppKind_Float}, +{0, 0}, +{4, TokenCppKind_This}, +{4, TokenCppKind_ThreadLocal}, +{4, TokenCppKind_DeclType}, {8, TokenCppKind_LiteralTrue}, -{8, TokenCppKind_LiteralFalse}, +{4, TokenCppKind_For}, +{0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Protected}, +{4, TokenCppKind_Friend}, +{0, 0}, +{0, 0}, +{0, 0}, +{4, TokenCppKind_Union}, +{0, 0}, +{0, 0}, {0, 0}, {4, TokenCppKind_Register}, {0, 0}, {0, 0}, {0, 0}, -{4, TokenCppKind_If}, -{0, 0}, -{4, TokenCppKind_Short}, -{0, 0}, -{4, TokenCppKind_Public}, -{0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Explicit}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_AlignAs}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Double}, -{4, TokenCppKind_Signed}, -{0, 0}, -{4, TokenCppKind_This}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Catch}, -{4, TokenCppKind_StaticCast}, -{4, TokenCppKind_Continue}, -{4, TokenCppKind_Operator}, -{0, 0}, -{4, TokenCppKind_AlignOf}, -{0, 0}, -{4, TokenCppKind_Friend}, -{4, TokenCppKind_DeclType}, -{4, TokenCppKind_StaticAssert}, -{4, TokenCppKind_Break}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Template}, -{4, TokenCppKind_Extern}, -{4, TokenCppKind_DynamicCast}, -{4, TokenCppKind_TypeID}, -{0, 0}, -{4, TokenCppKind_Typedef}, -{4, TokenCppKind_Inline}, -{4, TokenCppKind_ThreadLocal}, -{0, 0}, -{4, TokenCppKind_While}, -{4, TokenCppKind_Else}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Asm}, -{0, 0}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Char}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Volatile}, -{0, 0}, -{4, TokenCppKind_Switch}, -{0, 0}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_ReinterpretCast}, -{4, TokenCppKind_Delete}, -{0, 0}, -{4, TokenCppKind_Protected}, -{0, 0}, -{4, TokenCppKind_Const}, -{4, TokenCppKind_Private}, -{4, TokenCppKind_SizeOf}, -{4, TokenCppKind_ConstCast}, -{4, TokenCppKind_Do}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Virtual}, -{4, TokenCppKind_Case}, -{0, 0}, -{4, TokenCppKind_Return}, -{4, TokenCppKind_Union}, -{4, TokenCppKind_Long}, -{0, 0}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Class}, -{4, TokenCppKind_NullPtr}, -{4, TokenCppKind_Unsigned}, -{4, TokenCppKind_Default}, -{4, TokenCppKind_For}, -{0, 0}, {4, TokenCppKind_Bool}, -{4, TokenCppKind_Void}, +{4, TokenCppKind_Virtual}, {0, 0}, -{4, TokenCppKind_Typename}, -{4, TokenCppKind_Float}, -{4, TokenCppKind_Static}, +{4, TokenCppKind_Inline}, +{4, TokenCppKind_ReinterpretCast}, {0, 0}, {0, 0}, -{0, 0}, -{0, 0}, -{0, 0}, -{4, TokenCppKind_Goto}, -{4, TokenCppKind_Enum}, -{4, TokenCppKind_NoExcept}, -{4, TokenCppKind_New}, -{4, TokenCppKind_Using}, -{0, 0}, -{4, TokenCppKind_Struct}, {4, TokenCppKind_Int}, }; -i32 main_keys_slot_count = 123; -u64 main_keys_seed = 0xf38c04110edf5c20; -u64 pp_directives_hash_array[25] = { -0x6b2525b7e6f87877,0x0000000000000000,0xb6682cd11ed9fd9f,0x6b2525b40373aacb, -0xb6682cd11ea5bda7,0x0000000000000000,0x0000000000000000,0x0d56a51c5ba8244b, -0x0000000000000000,0x6b2525b7e6f864c5,0xb6682cd10cf54325,0x0dbf8cd197510b47, -0x83d780e616d1416b,0x0000000000000000,0x83d7ee6ef708249b,0x83d780e1399294e1, -0x0000000000000000,0xb6682cd10c14755f,0x6c3839b38ad2ee53,0x0000000000000000, -0x83d7ee6e1191055f,0xb6682d358a49de5f,0x0000000000000000,0x0000000000000000, -0x0000000000000000, +i32 main_keys_slot_count = 125; +u64 main_keys_seed = 0x65d4ee5afb605179; +u64 pp_directives_hash_array[23] = { +0x66ec96a515368a07,0x0000000000000000,0x66ec969fa4988beb,0x0ccd12d311788e3f, +0x0000000000000000,0xf5600c3dd4206a07,0xf5600c382e9e6de9,0xf5600c3e40f6633f, +0x0000000000000000,0x0000000000000000,0xf5600c3e40fb9327,0x66ec964191fce1af, +0x0000000000000000,0xd81cb5325ced5fb3,0x86a338b9318dc21f,0x0ccd12d317b77e6b, +0x0000000000000000,0xf5600c3e26aeea07,0x66ec9699d3540a79,0x0000000000000000, +0x0ccd12d31179771b,0x0000000000000000,0xd81ceb25bd0dceb3, }; -u8 pp_directives_key_array_0[] = {0x23,0x65,0x6c,0x69,0x66,}; -u8 pp_directives_key_array_2[] = {0x23,0x65,0x72,0x72,0x6f,0x72,}; -u8 pp_directives_key_array_3[] = {0x23,0x6c,0x69,0x6e,0x65,}; -u8 pp_directives_key_array_4[] = {0x23,0x65,0x6e,0x64,0x69,0x66,}; -u8 pp_directives_key_array_7[] = {0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,}; -u8 pp_directives_key_array_9[] = {0x23,0x65,0x6c,0x73,0x65,}; -u8 pp_directives_key_array_10[] = {0x23,0x75,0x73,0x69,0x6e,0x67,}; -u8 pp_directives_key_array_11[] = {0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,}; -u8 pp_directives_key_array_12[] = {0x23,0x64,0x65,0x66,0x69,0x6e,0x65,}; -u8 pp_directives_key_array_14[] = {0x23,0x69,0x6d,0x70,0x6f,0x72,0x74,}; -u8 pp_directives_key_array_15[] = {0x23,0x70,0x72,0x61,0x67,0x6d,0x61,}; -u8 pp_directives_key_array_17[] = {0x23,0x75,0x6e,0x64,0x65,0x66,}; -u8 pp_directives_key_array_18[] = {0x23,0x69,0x66,}; -u8 pp_directives_key_array_20[] = {0x23,0x69,0x66,0x6e,0x64,0x65,0x66,}; -u8 pp_directives_key_array_21[] = {0x23,0x69,0x66,0x64,0x65,0x66,}; -String_Const_u8 pp_directives_key_array[25] = { -{pp_directives_key_array_0, 5}, +u8 pp_directives_key_array_0[] = {0x69,0x66,0x6e,0x64,0x65,0x66,}; +u8 pp_directives_key_array_2[] = {0x64,0x65,0x66,0x69,0x6e,0x65,}; +u8 pp_directives_key_array_3[] = {0x65,0x6c,0x69,0x66,}; +u8 pp_directives_key_array_5[] = {0x75,0x6e,0x64,0x65,0x66,}; +u8 pp_directives_key_array_6[] = {0x75,0x73,0x69,0x6e,0x67,}; +u8 pp_directives_key_array_7[] = {0x65,0x6e,0x64,0x69,0x66,}; +u8 pp_directives_key_array_10[] = {0x65,0x72,0x72,0x6f,0x72,}; +u8 pp_directives_key_array_11[] = {0x70,0x72,0x61,0x67,0x6d,0x61,}; +u8 pp_directives_key_array_13[] = {0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,}; +u8 pp_directives_key_array_14[] = {0x69,0x66,}; +u8 pp_directives_key_array_15[] = {0x6c,0x69,0x6e,0x65,}; +u8 pp_directives_key_array_17[] = {0x69,0x66,0x64,0x65,0x66,}; +u8 pp_directives_key_array_18[] = {0x69,0x6d,0x70,0x6f,0x72,0x74,}; +u8 pp_directives_key_array_20[] = {0x65,0x6c,0x73,0x65,}; +u8 pp_directives_key_array_22[] = {0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,}; +String_Const_u8 pp_directives_key_array[23] = { +{pp_directives_key_array_0, 6}, {0, 0}, {pp_directives_key_array_2, 6}, -{pp_directives_key_array_3, 5}, -{pp_directives_key_array_4, 6}, +{pp_directives_key_array_3, 4}, +{0, 0}, +{pp_directives_key_array_5, 5}, +{pp_directives_key_array_6, 5}, +{pp_directives_key_array_7, 5}, {0, 0}, {0, 0}, -{pp_directives_key_array_7, 8}, +{pp_directives_key_array_10, 5}, +{pp_directives_key_array_11, 6}, {0, 0}, -{pp_directives_key_array_9, 5}, -{pp_directives_key_array_10, 6}, -{pp_directives_key_array_11, 8}, -{pp_directives_key_array_12, 7}, -{0, 0}, -{pp_directives_key_array_14, 7}, -{pp_directives_key_array_15, 7}, -{0, 0}, -{pp_directives_key_array_17, 6}, -{pp_directives_key_array_18, 3}, -{0, 0}, -{pp_directives_key_array_20, 7}, -{pp_directives_key_array_21, 6}, +{pp_directives_key_array_13, 7}, +{pp_directives_key_array_14, 2}, +{pp_directives_key_array_15, 4}, {0, 0}, +{pp_directives_key_array_17, 5}, +{pp_directives_key_array_18, 6}, {0, 0}, +{pp_directives_key_array_20, 4}, {0, 0}, +{pp_directives_key_array_22, 7}, }; -Lexeme_Table_Value pp_directives_value_array[25] = { +Lexeme_Table_Value pp_directives_value_array[23] = { +{5, TokenCppKind_PPIfNDef}, +{0, 0}, +{5, TokenCppKind_PPDefine}, {5, TokenCppKind_PPElIf}, {0, 0}, -{5, TokenCppKind_PPError}, -{5, TokenCppKind_PPLine}, +{5, TokenCppKind_PPUndef}, +{5, TokenCppKind_PPUsing}, {5, TokenCppKind_PPEndIf}, {0, 0}, {0, 0}, -{5, TokenCppKind_PPInclude}, -{0, 0}, -{5, TokenCppKind_PPElse}, -{5, TokenCppKind_PPUsing}, -{5, TokenCppKind_PPVersion}, -{5, TokenCppKind_PPDefine}, -{0, 0}, -{5, TokenCppKind_PPImport}, +{5, TokenCppKind_PPError}, {5, TokenCppKind_PPPragma}, {0, 0}, -{5, TokenCppKind_PPUndef}, +{5, TokenCppKind_PPVersion}, {5, TokenCppKind_PPIf}, +{5, TokenCppKind_PPLine}, {0, 0}, -{5, TokenCppKind_PPIfNDef}, {5, TokenCppKind_PPIfDef}, +{5, TokenCppKind_PPImport}, {0, 0}, +{5, TokenCppKind_PPElse}, {0, 0}, -{0, 0}, +{5, TokenCppKind_PPInclude}, }; -i32 pp_directives_slot_count = 25; -u64 pp_directives_seed = 0x2bbd5804bccb85e6; +i32 pp_directives_slot_count = 23; +u64 pp_directives_seed = 0x0669c8484a95bd75; u64 pp_keys_hash_array[2] = { -0x0000000000000000,0x89659c00a323190b, +0x0000000000000000,0x2b917779bf88e3f3, }; u8 pp_keys_key_array_1[] = {0x64,0x65,0x66,0x69,0x6e,0x65,0x64,}; String_Const_u8 pp_keys_key_array[2] = { @@ -487,7 +487,7 @@ Lexeme_Table_Value pp_keys_value_array[2] = { {4, TokenCppKind_PPDefined}, }; i32 pp_keys_slot_count = 2; -u64 pp_keys_seed = 0xc87165e79dc2fa67; +u64 pp_keys_seed = 0x8a8bdc07090ff36f; internal Token_List lex_full_input_cpp(Arena *arena, String_Const_u8 input){ Token_List list = {}; @@ -562,26 +562,25 @@ goto state_label_3; // whitespace case 0x21: { ptr += 1; -goto state_label_59; // op stage +goto state_label_60; // op stage }break; case 0x22: { if ((HasFlag(flags_KF0, 0x1))){ ptr += 1; -goto state_label_25; // include_quotes +goto state_label_26; // include_quotes } ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x23: { if ((!HasFlag(flags_KB0, 0x1))){ ptr += 1; -flags_KB0 |= 0x1; -goto state_label_23; // pp_directive +goto state_label_23; // pp_directive_whitespace } ptr += 1; -goto state_label_66; // op stage +goto state_label_67; // op stage }break; default: { @@ -591,18 +590,18 @@ goto state_label_2; // identifier case 0x25: { ptr += 1; -goto state_label_63; // op stage +goto state_label_64; // op stage }break; case 0x26: { ptr += 1; -goto state_label_60; // op stage +goto state_label_61; // op stage }break; case 0x27: { ptr += 1; flags_ZF0 |= 0x40; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x28: { @@ -643,12 +642,12 @@ goto state_label_1; // root case 0x2a: { ptr += 1; -goto state_label_62; // op stage +goto state_label_63; // op stage }break; case 0x2b: { ptr += 1; -goto state_label_52; // op stage +goto state_label_53; // op stage }break; case 0x2c: { @@ -671,7 +670,7 @@ goto state_label_1; // root case 0x2d: { ptr += 1; -goto state_label_53; // op stage +goto state_label_54; // op stage }break; case 0x2e: { @@ -697,7 +696,7 @@ goto state_label_8; // number case 0x3a: { ptr += 1; -goto state_label_51; // op stage +goto state_label_52; // op stage }break; case 0x3b: { @@ -721,20 +720,20 @@ case 0x3c: { if ((!HasFlag(flags_KF0, 0x1))){ ptr += 1; -goto state_label_55; // op stage +goto state_label_56; // op stage } ptr += 1; -goto state_label_24; // include_pointy +goto state_label_25; // include_pointy }break; case 0x3d: { ptr += 1; -goto state_label_58; // op stage +goto state_label_59; // op stage }break; case 0x3e: { ptr += 1; -goto state_label_56; // op stage +goto state_label_57; // op stage }break; case 0x3f: { @@ -758,18 +757,18 @@ case 0x4c: { ptr += 1; flags_ZF0 |= 0x4; -goto state_label_26; // pre_L +goto state_label_27; // pre_L }break; case 0x52: { ptr += 1; -goto state_label_30; // pre_R +goto state_label_31; // pre_R }break; case 0x55: { ptr += 1; flags_ZF0 |= 0x20; -goto state_label_28; // pre_U +goto state_label_29; // pre_U }break; case 0x5b: { @@ -834,7 +833,7 @@ case 0x75: { ptr += 1; flags_ZF0 |= 0x10; -goto state_label_27; // pre_u +goto state_label_28; // pre_u }break; case 0x7b: { @@ -857,7 +856,7 @@ goto state_label_1; // root case 0x7c: { ptr += 1; -goto state_label_61; // op stage +goto state_label_62; // op stage }break; case 0x7d: { @@ -1194,7 +1193,7 @@ goto state_label_1; // root case 0x2e: { ptr += 1; -goto state_label_67; // op stage +goto state_label_68; // op stage }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39: @@ -1245,12 +1244,12 @@ goto state_label_1; // root case 0x2a: { ptr += 1; -goto state_label_48; // comment_block +goto state_label_49; // comment_block }break; case 0x2f: { ptr += 1; -goto state_label_50; // comment_line +goto state_label_51; // comment_line }break; case 0x3d: { @@ -2453,7 +2452,7 @@ goto state_label_1; // root } } { -state_label_23: // pp_directive +state_label_23: // pp_directive_whitespace if (ptr == opl_ptr){ if ((true)){ { @@ -2462,7 +2461,68 @@ token.pos = (i64)(emit_ptr - input.str); token.size = (i64)(ptr - emit_ptr); token.flags = flags_KB0; do{ -Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, emit_ptr, token.size); +token.sub_kind = TokenCppKind_LexError; +token.kind = 2; +}while(0); +token_list_push(arena, &list, &token); +emit_ptr = ptr; +} +flags_ZF0 = 0; +goto state_label_1; // root +} +} +switch (*ptr){ +default: +{ +{ +Token token = {}; +token.pos = (i64)(emit_ptr - input.str); +token.size = (i64)(ptr - emit_ptr); +token.flags = flags_KB0; +do{ +token.sub_kind = TokenCppKind_LexError; +token.kind = 2; +}while(0); +token_list_push(arena, &list, &token); +emit_ptr = ptr; +} +flags_ZF0 = 0; +goto state_label_1; // root +}break; +case 0x09:case 0x0b:case 0x0c:case 0x20: +{ +ptr += 1; +goto state_label_23; // pp_directive_whitespace +}break; +case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: +case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: +case 0x45:case 0x46:case 0x47:case 0x48:case 0x49:case 0x4a:case 0x4b: +case 0x4c:case 0x4d:case 0x4e:case 0x4f:case 0x50:case 0x51:case 0x52: +case 0x53:case 0x54:case 0x55:case 0x56:case 0x57:case 0x58:case 0x59: +case 0x5a:case 0x5f:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: +case 0x66:case 0x67:case 0x68:case 0x69:case 0x6a:case 0x6b:case 0x6c: +case 0x6d:case 0x6e:case 0x6f:case 0x70:case 0x71:case 0x72:case 0x73: +case 0x74:case 0x75:case 0x76:case 0x77:case 0x78:case 0x79:case 0x7a: +{ +delim_first = ptr; +flags_KB0 |= 0x1; +ptr += 1; +goto state_label_24; // pp_directive +}break; +} +} +{ +state_label_24: // pp_directive +if (ptr == opl_ptr){ +if ((true)){ +delim_one_past_last = ptr; +{ +Token token = {}; +token.pos = (i64)(emit_ptr - input.str); +token.size = (i64)(ptr - emit_ptr); +token.flags = flags_KB0; +do{ +Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, delim_first, (delim_one_past_last - delim_first)); if (lookup.found_match){ token.kind = lookup.base_kind; token.sub_kind = lookup.sub_kind; @@ -2491,13 +2551,14 @@ goto state_label_1; // root switch (*ptr){ default: { +delim_one_past_last = ptr; { Token token = {}; token.pos = (i64)(emit_ptr - input.str); token.size = (i64)(ptr - emit_ptr); token.flags = flags_KB0; do{ -Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, emit_ptr, token.size); +Lexeme_Table_Lookup lookup = lexeme_table_lookup(pp_directives_hash_array, pp_directives_key_array, pp_directives_value_array, pp_directives_slot_count, pp_directives_seed, delim_first, (delim_one_past_last - delim_first)); if (lookup.found_match){ token.kind = lookup.base_kind; token.sub_kind = lookup.sub_kind; @@ -2533,13 +2594,12 @@ case 0x6d:case 0x6e:case 0x6f:case 0x70:case 0x71:case 0x72:case 0x73: case 0x74:case 0x75:case 0x76:case 0x77:case 0x78:case 0x79:case 0x7a: { ptr += 1; -flags_KB0 |= 0x1; -goto state_label_23; // pp_directive +goto state_label_24; // pp_directive }break; } } { -state_label_24: // include_pointy +state_label_25: // include_pointy if (ptr == opl_ptr){ if ((true)){ { @@ -2588,7 +2648,7 @@ case 0x70:case 0x71:case 0x72:case 0x73:case 0x74:case 0x75:case 0x76: case 0x77:case 0x78:case 0x79:case 0x7a: { ptr += 1; -goto state_label_24; // include_pointy +goto state_label_25; // include_pointy }break; case 0x3e: { @@ -2611,7 +2671,7 @@ goto state_label_1; // root } } { -state_label_25: // include_quotes +state_label_26: // include_quotes if (ptr == opl_ptr){ if ((true)){ { @@ -2660,7 +2720,7 @@ case 0x70:case 0x71:case 0x72:case 0x73:case 0x74:case 0x75:case 0x76: case 0x77:case 0x78:case 0x79:case 0x7a: { ptr += 1; -goto state_label_25; // include_quotes +goto state_label_26; // include_quotes }break; case 0x22: { @@ -2683,7 +2743,7 @@ goto state_label_1; // root } } { -state_label_26: // pre_L +state_label_27: // pre_L if (ptr == opl_ptr){ if ((true)){ goto state_label_2; // identifier @@ -2697,17 +2757,17 @@ goto state_label_2; // identifier case 0x22: { ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x52: { ptr += 1; -goto state_label_30; // pre_R +goto state_label_31; // pre_R }break; } } { -state_label_27: // pre_u +state_label_28: // pre_u if (ptr == opl_ptr){ if ((true)){ goto state_label_2; // identifier @@ -2721,23 +2781,23 @@ goto state_label_2; // identifier case 0x22: { ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x38: { ptr += 1; flags_ZF0 |= 0x8; -goto state_label_29; // pre_u8 +goto state_label_30; // pre_u8 }break; case 0x52: { ptr += 1; -goto state_label_30; // pre_R +goto state_label_31; // pre_R }break; } } { -state_label_28: // pre_U +state_label_29: // pre_U if (ptr == opl_ptr){ if ((true)){ goto state_label_2; // identifier @@ -2751,17 +2811,17 @@ goto state_label_2; // identifier case 0x22: { ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x52: { ptr += 1; -goto state_label_30; // pre_R +goto state_label_31; // pre_R }break; } } { -state_label_29: // pre_u8 +state_label_30: // pre_u8 if (ptr == opl_ptr){ if ((true)){ goto state_label_2; // identifier @@ -2775,17 +2835,17 @@ goto state_label_2; // identifier case 0x22: { ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x52: { ptr += 1; -goto state_label_30; // pre_R +goto state_label_31; // pre_R }break; } } { -state_label_30: // pre_R +state_label_31: // pre_R if (ptr == opl_ptr){ if ((true)){ goto state_label_2; // identifier @@ -2800,12 +2860,12 @@ case 0x22: { ptr += 1; delim_first = ptr; -goto state_label_44; // raw_string_get_delim +goto state_label_45; // raw_string_get_delim }break; } } { -state_label_31: // string +state_label_32: // string if (ptr == opl_ptr){ if ((true)){ { @@ -2828,7 +2888,7 @@ switch (*ptr){ default: { ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x0a: { @@ -2887,7 +2947,7 @@ flags_ZF0 = 0; goto state_label_1; // root } ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x27: { @@ -2929,17 +2989,17 @@ flags_ZF0 = 0; goto state_label_1; // root } ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x5c: { ptr += 1; -goto state_label_32; // string_esc +goto state_label_33; // string_esc }break; } } { -state_label_32: // string_esc +state_label_33: // string_esc if (ptr == opl_ptr){ if ((true)){ { @@ -2975,82 +3035,82 @@ switch (*ptr){ default: { ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37: { ptr += 1; -goto state_label_33; // string_esc_oct2 +goto state_label_34; // string_esc_oct2 }break; case 0x55: { ptr += 1; -goto state_label_36; // string_esc_universal_8 +goto state_label_37; // string_esc_universal_8 }break; case 0x75: { ptr += 1; -goto state_label_40; // string_esc_universal_4 +goto state_label_41; // string_esc_universal_4 }break; case 0x78: { ptr += 1; -goto state_label_35; // string_esc_hex +goto state_label_36; // string_esc_hex }break; } } { -state_label_33: // string_esc_oct2 +state_label_34: // string_esc_oct2 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37: { ptr += 1; -goto state_label_34; // string_esc_oct1 +goto state_label_35; // string_esc_oct1 }break; } } { -state_label_34: // string_esc_oct1 +state_label_35: // string_esc_oct1 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37: { ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; } } { -state_label_35: // string_esc_hex +state_label_36: // string_esc_hex if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: @@ -3058,21 +3118,21 @@ case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: case 0x66: { ptr += 1; -goto state_label_35; // string_esc_hex +goto state_label_36; // string_esc_hex }break; } } { -state_label_36: // string_esc_universal_8 +state_label_37: // string_esc_universal_8 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: @@ -3080,21 +3140,21 @@ case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: case 0x66: { ptr += 1; -goto state_label_37; // string_esc_universal_7 +goto state_label_38; // string_esc_universal_7 }break; } } { -state_label_37: // string_esc_universal_7 +state_label_38: // string_esc_universal_7 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: @@ -3102,21 +3162,21 @@ case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: case 0x66: { ptr += 1; -goto state_label_38; // string_esc_universal_6 +goto state_label_39; // string_esc_universal_6 }break; } } { -state_label_38: // string_esc_universal_6 +state_label_39: // string_esc_universal_6 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: @@ -3124,21 +3184,21 @@ case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: case 0x66: { ptr += 1; -goto state_label_39; // string_esc_universal_5 +goto state_label_40; // string_esc_universal_5 }break; } } { -state_label_39: // string_esc_universal_5 +state_label_40: // string_esc_universal_5 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: @@ -3146,21 +3206,21 @@ case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: case 0x66: { ptr += 1; -goto state_label_40; // string_esc_universal_4 +goto state_label_41; // string_esc_universal_4 }break; } } { -state_label_40: // string_esc_universal_4 +state_label_41: // string_esc_universal_4 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: @@ -3168,21 +3228,21 @@ case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: case 0x66: { ptr += 1; -goto state_label_41; // string_esc_universal_3 +goto state_label_42; // string_esc_universal_3 }break; } } { -state_label_41: // string_esc_universal_3 +state_label_42: // string_esc_universal_3 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: @@ -3190,21 +3250,21 @@ case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: case 0x66: { ptr += 1; -goto state_label_42; // string_esc_universal_2 +goto state_label_43; // string_esc_universal_2 }break; } } { -state_label_42: // string_esc_universal_2 +state_label_43: // string_esc_universal_2 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: @@ -3212,21 +3272,21 @@ case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: case 0x66: { ptr += 1; -goto state_label_43; // string_esc_universal_1 +goto state_label_44; // string_esc_universal_1 }break; } } { -state_label_43: // string_esc_universal_1 +state_label_44: // string_esc_universal_1 if (ptr == opl_ptr){ if ((true)){ -goto state_label_31; // string +goto state_label_32; // string } } switch (*ptr){ default: { -goto state_label_31; // string +goto state_label_32; // string }break; case 0x30:case 0x31:case 0x32:case 0x33:case 0x34:case 0x35:case 0x36: case 0x37:case 0x38:case 0x39:case 0x41:case 0x42:case 0x43:case 0x44: @@ -3234,12 +3294,12 @@ case 0x45:case 0x46:case 0x61:case 0x62:case 0x63:case 0x64:case 0x65: case 0x66: { ptr += 1; -goto state_label_31; // string +goto state_label_32; // string }break; } } { -state_label_44: // raw_string_get_delim +state_label_45: // raw_string_get_delim if (ptr == opl_ptr){ if ((true)){ { @@ -3275,7 +3335,7 @@ switch (*ptr){ default: { ptr += 1; -goto state_label_44; // raw_string_get_delim +goto state_label_45; // raw_string_get_delim }break; case 0x20:case 0x29:case 0x5c: { @@ -3299,12 +3359,12 @@ case 0x28: { delim_one_past_last = ptr; ptr += 1; -goto state_label_45; // raw_string_find_close +goto state_label_46; // raw_string_find_close }break; } } { -state_label_45: // raw_string_find_close +state_label_46: // raw_string_find_close if (ptr == opl_ptr){ if ((true)){ { @@ -3340,46 +3400,46 @@ switch (*ptr){ default: { ptr += 1; -goto state_label_45; // raw_string_find_close +goto state_label_46; // raw_string_find_close }break; case 0x29: { ptr += 1; -goto state_label_46; // raw_string_try_delim +goto state_label_47; // raw_string_try_delim }break; } } { -state_label_46: // raw_string_try_delim +state_label_47: // raw_string_try_delim umem delim_length = delim_one_past_last - delim_first; umem parse_length = 0; for (;;){ if (parse_length == delim_length){ -goto state_label_47; // raw_string_try_quote +goto state_label_48; // raw_string_try_quote } if (ptr == opl_ptr){ -goto state_label_47; // raw_string_try_quote +goto state_label_48; // raw_string_try_quote } if (*ptr == delim_first[parse_length]){ ptr += 1; parse_length += 1; } else{ -goto state_label_45; // raw_string_find_close +goto state_label_46; // raw_string_find_close } } } { -state_label_47: // raw_string_try_quote +state_label_48: // raw_string_try_quote if (ptr == opl_ptr){ if ((true)){ -goto state_label_45; // raw_string_find_close +goto state_label_46; // raw_string_find_close } } switch (*ptr){ default: { -goto state_label_45; // raw_string_find_close +goto state_label_46; // raw_string_find_close }break; case 0x22: { @@ -3422,7 +3482,7 @@ goto state_label_1; // root } } { -state_label_48: // comment_block +state_label_49: // comment_block if (ptr == opl_ptr){ if ((true)){ { @@ -3458,24 +3518,24 @@ switch (*ptr){ default: { ptr += 1; -goto state_label_48; // comment_block +goto state_label_49; // comment_block }break; case 0x0a: { ptr += 1; flags_KB0 &= ~(0x1); flags_KF0 &= ~(0x1); -goto state_label_48; // comment_block +goto state_label_49; // comment_block }break; case 0x2a: { ptr += 1; -goto state_label_49; // comment_block_try_close +goto state_label_50; // comment_block_try_close }break; } } { -state_label_49: // comment_block_try_close +state_label_50: // comment_block_try_close if (ptr == opl_ptr){ if ((true)){ { @@ -3511,12 +3571,12 @@ switch (*ptr){ default: { ptr += 1; -goto state_label_48; // comment_block +goto state_label_49; // comment_block }break; case 0x2a: { ptr += 1; -goto state_label_49; // comment_block_try_close +goto state_label_50; // comment_block_try_close }break; case 0x2f: { @@ -3539,7 +3599,7 @@ goto state_label_1; // root } } { -state_label_50: // comment_line +state_label_51: // comment_line if (ptr == opl_ptr){ if ((true)){ { @@ -3562,7 +3622,7 @@ switch (*ptr){ default: { ptr += 1; -goto state_label_50; // comment_line +goto state_label_51; // comment_line }break; case 0x0a: { @@ -3584,7 +3644,7 @@ goto state_label_1; // root } } { -state_label_51: // op stage +state_label_52: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -3642,7 +3702,7 @@ goto state_label_1; // root } } { -state_label_52: // op stage +state_label_53: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -3718,7 +3778,7 @@ goto state_label_1; // root } } { -state_label_53: // op stage +state_label_54: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -3794,12 +3854,12 @@ goto state_label_1; // root case 0x3e: { ptr += 1; -goto state_label_54; // op stage +goto state_label_55; // op stage }break; } } { -state_label_54: // op stage +state_label_55: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -3857,7 +3917,7 @@ goto state_label_1; // root } } { -state_label_55: // op stage +state_label_56: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -3897,17 +3957,17 @@ goto state_label_1; // root case 0x3c: { ptr += 1; -goto state_label_64; // op stage +goto state_label_65; // op stage }break; case 0x3d: { ptr += 1; -goto state_label_57; // op stage +goto state_label_58; // op stage }break; } } { -state_label_56: // op stage +state_label_57: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -3965,12 +4025,12 @@ goto state_label_1; // root case 0x3e: { ptr += 1; -goto state_label_65; // op stage +goto state_label_66; // op stage }break; } } { -state_label_57: // op stage +state_label_58: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4028,7 +4088,7 @@ goto state_label_1; // root } } { -state_label_58: // op stage +state_label_59: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4086,7 +4146,7 @@ goto state_label_1; // root } } { -state_label_59: // op stage +state_label_60: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4144,7 +4204,7 @@ goto state_label_1; // root } } { -state_label_60: // op stage +state_label_61: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4202,7 +4262,7 @@ goto state_label_1; // root } } { -state_label_61: // op stage +state_label_62: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4260,7 +4320,7 @@ goto state_label_1; // root } } { -state_label_62: // op stage +state_label_63: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4318,7 +4378,7 @@ goto state_label_1; // root } } { -state_label_63: // op stage +state_label_64: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4376,7 +4436,7 @@ goto state_label_1; // root } } { -state_label_64: // op stage +state_label_65: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4434,7 +4494,7 @@ goto state_label_1; // root } } { -state_label_65: // op stage +state_label_66: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4492,7 +4552,7 @@ goto state_label_1; // root } } { -state_label_66: // op stage +state_label_67: // op stage if (ptr == opl_ptr){ if ((true)){ { @@ -4550,7 +4610,7 @@ goto state_label_1; // root } } { -state_label_67: // op stage +state_label_68: // op stage if (ptr == opl_ptr){ if ((true)){ { diff --git a/custom/lexer_generator/4coder_lex_gen_main.cpp b/custom/lexer_generator/4coder_lex_gen_main.cpp index 6ccd18ee..ff78b8d3 100644 --- a/custom/lexer_generator/4coder_lex_gen_main.cpp +++ b/custom/lexer_generator/4coder_lex_gen_main.cpp @@ -1399,7 +1399,7 @@ sm_emit_handler_keys(Keyword_Set *set){ internal void sm_emit_handler_keys_delim(Flag *flag_check, Keyword_Set *set){ Emit_Rule *rule = helper_ctx.selected_emit_rule; - smi_emit_handler(helper_ctx.arena, rule, set, flag_check); + smi_emit_handler_delim(helper_ctx.arena, rule, set, flag_check); } internal void @@ -2419,6 +2419,7 @@ opt_emit_rule_match(Emit_Rule *rule_a, Emit_Rule *rule_b){ } }break; case EmitHandlerKind_Keywords: + case EmitHandlerKind_KeywordsDelim: { if (handler_a->keywords != handler_b->keywords){ result = false; @@ -3470,6 +3471,30 @@ gen_SLOW_action_list__cont_flow(Arena *scratch, Token_Kind_Set tokens, Flag_Set keep_looping = false; } }break; + + case EmitHandlerKind_KeywordsDelim: + { + Keyword_Set *keywords = handler->keywords; + fprintf(out, "Lexeme_Table_Lookup lookup = " + "lexeme_table_lookup(%.*s_hash_array, %.*s_key_array, " + "%.*s_value_array, %.*s_slot_count, %.*s_seed, " + "delim_first, (delim_one_past_last - delim_first));\n", + string_expand(keywords->pretty_name), + string_expand(keywords->pretty_name), + string_expand(keywords->pretty_name), + string_expand(keywords->pretty_name), + string_expand(keywords->pretty_name)); + fprintf(out, "if (lookup.found_match){\n"); + fprintf(out, "token.kind = lookup.base_kind;\n"); + fprintf(out, "token.sub_kind = lookup.sub_kind;\n"); + fprintf(out, "break;\n"); + fprintf(out, "}\n"); + if (handler->keywords->has_fallback_token_kind){ + gen_emit__direct(scratch, tokens, + keywords->fallback_name, out); + keep_looping = false; + } + }break; } if (handler->flag_check != 0){ diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index dd388873..8a5d70bf 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -46,7 +46,10 @@ #include "4ed_render_target.h" #include "4ed.h" +#undef function #include +#define function static + #include "win32_gl.h" ////////////////////////////// diff --git a/project.4coder b/project.4coder index 306fa0bf..f90df81f 100644 --- a/project.4coder +++ b/project.4coder @@ -22,16 +22,16 @@ load_paths = { { load_paths_only, .os = "mac" }, }; -build_x86_win32 = "echo build: x86 & build.bat /DDEV_BUILD_X86"; -build_x86_linux = "echo build: x86 & ./build.sh -DDEV_BUILD_X86"; -build_x86_mac = "echo build: x86 & ./build.sh -DDEV_BUILD_X86"; +build_x64_win32 = "echo build: x64 & bin\\build.bat"; +build_x64_linux = "echo build: x64 & bin/build.sh"; +build_x64_mac = "echo build: x64 & bin/build.sh"; command_list = { { .name = "build x64", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, - .cmd = { {"echo build: x64 & bin\\build.bat" , .os = "win" }, - {"echo build: x64 & bin/build.sh", .os = "linux"}, - {"echo build: x64 & bin/build.sh", .os = "mac" }, }, }, + .cmd = { {build_x64_win32, .os = "win" }, + {build_x64_linux, .os = "linux"}, + {build_x64_max , .os = "mac" }, }, }, { .name = "run one time", .out = "*run*", .footer_panel = false, .save_dirty_files = false, @@ -43,7 +43,7 @@ command_list = { { .name = "build token tester", .out = "*compilation*", .footer_panel = true, .save_dirty_files = true, - .cmd = { { "custom\\bin\\build_one_time languages\\4coder_lexer_cpp_test.cpp ..\\build", .os = "win" }, }, } + .cmd = { { "custom\\bin\\build_one_time custom\\languages\\4coder_lexer_cpp_test.cpp ..\\build", .os = "win" }, }, } }; fkey_command[1] = "build x64";