From 90ce40fa89fd59ba882c739c9605064f2bfc8420 Mon Sep 17 00:00:00 2001 From: vbot Date: Fri, 10 Jun 2022 06:17:35 +0000 Subject: [PATCH] [v:master] 88d69dca7 - ci: Added docker workflow & Dockerfile --- v.c | 1426 ++++++++++++++++++++++++++++++------------------------- v_win.c | 1391 +++++++++++++++++++++++++++++------------------------ 2 files changed, 1543 insertions(+), 1274 deletions(-) diff --git a/v.c b/v.c index 65a9591..7f08c10 100644 --- a/v.c +++ b/v.c @@ -1,11 +1,11 @@ -#define V_COMMIT_HASH "5b16d5fdf" +#define V_COMMIT_HASH "88d69dca7" #ifndef V_COMMIT_HASH - #define V_COMMIT_HASH "3bc50721e" + #define V_COMMIT_HASH "5b16d5fdf" #endif #ifndef V_CURRENT_COMMIT_HASH - #define V_CURRENT_COMMIT_HASH "5b16d5f" + #define V_CURRENT_COMMIT_HASH "88d69dc" #endif #define V_USE_SIGNAL_H @@ -375,6 +375,7 @@ typedef struct _option_v__pref__Arch _option_v__pref__Arch; typedef struct _option_v__pref__Backend _option_v__pref__Backend; typedef struct _option_time__StopWatch _option_time__StopWatch; typedef struct _option_v__ast__Ident _option_v__ast__Ident; +typedef struct _option_v__ast__Attr _option_v__ast__Attr; typedef struct _option_i8 _option_i8; typedef struct _option_i16 _option_i16; typedef struct _option_u16 _option_u16; @@ -2509,12 +2510,13 @@ typedef enum { } v__pref__AssertFailureMode; typedef enum { - v__pref__GarbageCollectionMode__no_gc, // - v__pref__GarbageCollectionMode__boehm_full, // +1 - v__pref__GarbageCollectionMode__boehm_incr, // +2 - v__pref__GarbageCollectionMode__boehm_full_opt, // +3 - v__pref__GarbageCollectionMode__boehm_incr_opt, // +4 - v__pref__GarbageCollectionMode__boehm_leak, // +5 + v__pref__GarbageCollectionMode__unknown, // + v__pref__GarbageCollectionMode__no_gc, // +1 + v__pref__GarbageCollectionMode__boehm_full, // +2 + v__pref__GarbageCollectionMode__boehm_incr, // +3 + v__pref__GarbageCollectionMode__boehm_full_opt, // +4 + v__pref__GarbageCollectionMode__boehm_incr_opt, // +5 + v__pref__GarbageCollectionMode__boehm_leak, // +6 } v__pref__GarbageCollectionMode; typedef enum { @@ -4635,9 +4637,9 @@ struct v__pref__Preferences { int thread_stack_size; v__pref__OS os : 5; v__pref__Arch arch : 4; + v__pref__GarbageCollectionMode gc_mode : 3; v__pref__Backend backend : 3; v__pref__CompilerType ccompiler_type : 3; - v__pref__GarbageCollectionMode gc_mode : 3; v__pref__ColorOutput use_color : 2; v__pref__AssertFailureMode assert_failure_mode : 2; v__pref__BuildMode build_mode : 2; @@ -6508,6 +6510,7 @@ struct v__checker__Checker { bool inside_defer : 1; bool inside_fn_arg : 1; bool inside_ct_attr : 1; + bool inside_x_is_type : 1; bool inside_comptime_for_field : 1; bool skip_flags : 1; bool is_last_stmt : 1; @@ -7019,6 +7022,12 @@ struct _option_v__ast__Ident { byte data[sizeof(v__ast__Ident) > 0 ? sizeof(v__ast__Ident) : 1]; }; +struct _option_v__ast__Attr { + byte state; + IError err; + byte data[sizeof(v__ast__Attr) > 0 ? sizeof(v__ast__Attr) : 1]; +}; + struct _option_i8 { byte state; IError err; @@ -7236,6 +7245,7 @@ string strings__repeat_string(string s, int n); string strings__find_between_pair_u8(string input, u8 start, u8 end); string strings__find_between_pair_rune(string input, rune start, rune end); string strings__find_between_pair_string(string input, string start, string end); +Array_string strings__split_capital(string s); u32 _const_math__bits__de_bruijn32 = 125613361; // precomputed Array_u8 _const_math__bits__de_bruijn32tab; // inited later u64 _const_math__bits__de_bruijn64 = 285870213051353865U; // precomputed @@ -8248,6 +8258,7 @@ rune _const_os__fslash = '/'; // precomputed #define _const_os__bslash '\\' rune _const_os__dot = '.'; // precomputed rune _const_os__qmark = '?'; // precomputed +string _const_os__fslash_str; // a string literal, inited later string _const_os__dot_dot; // a string literal, inited later string _const_os__empty_str; // a string literal, inited later string _const_os__dot_str; // a string literal, inited later @@ -8257,7 +8268,6 @@ string os__norm_path(string path); _option_string os__existing_path(string path); VV_LOCAL_SYMBOL string os__clean_path(string path); VV_LOCAL_SYMBOL int os__win_volume_len(string path); -VV_LOCAL_SYMBOL string os__get_volume(string path); VV_LOCAL_SYMBOL bool os__is_slash(u8 b); VV_LOCAL_SYMBOL bool os__is_unc_path(string path); VV_LOCAL_SYMBOL bool os__has_drive_letter(string path); @@ -8588,6 +8598,7 @@ string v__vcache__CacheManager_postfix_with_key2cpath(v__vcache__CacheManager* c _option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key); _option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content); _option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key); +VV_LOCAL_SYMBOL void v__vcache__xlog(string fname, string s); VV_LOCAL_SYMBOL int v__vcache__mypid(void); _option_string v__util__diff__find_working_diff_command(void); VV_LOCAL_SYMBOL bool v__util__diff__opendiff_exists(void); @@ -9020,6 +9031,8 @@ VV_LOCAL_SYMBOL v__token__KeywordsMatcher v__ast__build_builtin_type_names_match string v__ast__Attr_debug(v__ast__Attr* a); string v__ast__Attr_str(v__ast__Attr* a); bool Array_v__ast__Attr_contains(Array_v__ast__Attr attrs, string str); +_option_v__ast__Attr Array_v__ast__Attr_find_first(Array_v__ast__Attr attrs, string aname); +_option_v__ast__Attr Array_v__ast__Attr_find_last(Array_v__ast__Attr attrs, string aname); _option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs); VV_LOCAL_SYMBOL bool v__ast__Table_has_cflag(v__ast__Table* t, v__cflag__CFlag flag); _option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines); @@ -10259,8 +10272,6 @@ static string v__ast__Enum_str(v__ast__Enum it); // auto static string indent_v__ast__Enum_str(v__ast__Enum it, int indent_count); // auto static string v__ast__ComptTimeConstValue_str(v__ast__ComptTimeConstValue x); // auto static string indent_v__ast__ComptTimeConstValue_str(v__ast__ComptTimeConstValue x, int indent_count); // auto -static string v__ast__EnumVal_str(v__ast__EnumVal it); // auto -static string indent_v__ast__EnumVal_str(v__ast__EnumVal it, int indent_count); // auto static string v__gen__c__SqlType_str(v__gen__c__SqlType it); // auto static string Array_rune_str(Array_rune a); // auto static string indent_Array_rune_str(Array_rune a, int indent_count); // auto @@ -10989,6 +11000,7 @@ void vinit_string_literals(void){ _const_semver__comparator_set_sep = _SLIT(" || "); _const_semver__hyphen_range_sep = _SLIT(" - "); _const_semver__x_range_symbols = _SLIT("Xx*"); + _const_os__fslash_str = _SLIT("/"); _const_os__dot_dot = _SLIT(".."); _const_os__empty_str = _SLIT(""); _const_os__dot_str = _SLIT("."); @@ -11183,7 +11195,6 @@ static string indent_Array_Array_v__ast__Type_str(Array_Array_v__ast__Type a, in static string v__gen__c__StrType_str(v__gen__c__StrType it) { return indent_v__gen__c__StrType_str(it, 0);} static string v__ast__Enum_str(v__ast__Enum it) { return indent_v__ast__Enum_str(it, 0);} static string v__ast__ComptTimeConstValue_str(v__ast__ComptTimeConstValue x) { return indent_v__ast__ComptTimeConstValue_str(x, 0); } -static string v__ast__EnumVal_str(v__ast__EnumVal it) { return indent_v__ast__EnumVal_str(it, 0);} static string v__gen__c__SqlType_str(v__gen__c__SqlType it) { /* gen_str_for_enum */ switch(it) { case v__gen__c__SqlType__sqlite3: return _SLIT("sqlite3"); @@ -11722,34 +11733,15 @@ static string indent_v__ast__ComptTimeConstValue_str(v__ast__ComptTimeConstValue } } -static string indent_v__ast__EnumVal_str(v__ast__EnumVal it, int indent_count) { - string indents = string_repeat(_SLIT(" "), indent_count); - string _t29 = indent_v__token__Pos_str(it.pos, indent_count + 1); - string _t30 = v__ast__Type_str(it.typ); - string res = str_intp( 23, _MOV((StrIntpData[]){ - {_SLIT("v.ast.EnumVal{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" enum_name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.enum_name}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" val: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.val}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" mod: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.mod}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t29}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t30}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, - })); - string_free(&_t30); - string_free(&_t29); - string_free(&indents); - return res; -} - static string indent_v__builder__CcompilerOptions_str(v__builder__CcompilerOptions it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t31 = Array_string_str(it.args); - string _t32 = Array_string_str(it.wargs); - string _t33 = Array_string_str(it.pre_args); - string _t34 = Array_string_str(it.o_args); - string _t35 = Array_string_str(it.source_args); - string _t36 = Array_string_str(it.post_args); - string _t37 = Array_string_str(it.linker_flags); + string _t29 = Array_string_str(it.args); + string _t30 = Array_string_str(it.wargs); + string _t31 = Array_string_str(it.pre_args); + string _t32 = Array_string_str(it.o_args); + string _t33 = Array_string_str(it.source_args); + string _t34 = Array_string_str(it.post_args); + string _t35 = Array_string_str(it.linker_flags); string res = str_intp( 67, _MOV((StrIntpData[]){ {_SLIT("v.builder.CcompilerOptions{\n"), 0, {.d_c=0}}, {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" guessed_compiler: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.guessed_compiler}}, {_SLIT("'"), 0, {.d_c=0}}, @@ -11761,235 +11753,235 @@ static string indent_v__builder__CcompilerOptions_str(v__builder__CcompilerOptio {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_cc_clang: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_cc_clang ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" env_cflags: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.env_cflags}}, {_SLIT("'"), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" env_ldflags: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.env_ldflags}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t31}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" wargs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t32}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pre_args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t33}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" o_args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t34}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" source_args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t35}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" post_args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t36}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" linker_flags: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t37}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t29}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" wargs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t30}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pre_args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t31}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" o_args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t32}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" source_args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t33}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" post_args: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t34}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" linker_flags: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t35}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t37); - string_free(&_t36); string_free(&_t35); string_free(&_t34); string_free(&_t33); string_free(&_t32); string_free(&_t31); + string_free(&_t30); + string_free(&_t29); string_free(&indents); return res; } static string indent_v__ast__OrExpr_str(v__ast__OrExpr it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t38 = indent_Array_v__ast__Stmt_str(it.stmts, indent_count + 1); - string _t39 = v__ast__OrKind_str(it.kind); - string _t40 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t36 = indent_Array_v__ast__Stmt_str(it.stmts, indent_count + 1); + string _t37 = v__ast__OrKind_str(it.kind); + string _t38 = indent_v__token__Pos_str(it.pos, indent_count + 1); string res = str_intp( 15, _MOV((StrIntpData[]){ {_SLIT("v.ast.OrExpr{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" stmts: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t38}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" kind: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t39}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t40}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" stmts: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t36}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" kind: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t37}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t38}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t40); - string_free(&_t39); string_free(&_t38); + string_free(&_t37); + string_free(&_t36); string_free(&indents); return res; } static string indent_v__ast__Aggregate_str(v__ast__Aggregate it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t41 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t42 = v__ast__Type_str(it.sum_type); - string _t43 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t39 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t40 = v__ast__Type_str(it.sum_type); + string _t41 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); string res = str_intp( 15, _MOV((StrIntpData[]){ {_SLIT("v.ast.Aggregate{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t41}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" sum_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t42}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t43}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t39}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" sum_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t40}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t41}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t43); - string_free(&_t42); string_free(&_t41); + string_free(&_t40); + string_free(&_t39); string_free(&indents); return res; } static string indent_v__ast__Alias_str(v__ast__Alias it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t44 = v__ast__Type_str(it.parent_type); - string _t45 = v__ast__Language_str(it.language); + string _t42 = v__ast__Type_str(it.parent_type); + string _t43 = v__ast__Language_str(it.language); string res = str_intp( 15, _MOV((StrIntpData[]){ {_SLIT("v.ast.Alias{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t44}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" language: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t45}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t42}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" language: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t43}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_import: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_import ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t45); - string_free(&_t44); + string_free(&_t43); + string_free(&_t42); string_free(&indents); return res; } static string indent_v__ast__Array_str(v__ast__Array it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t46 = v__ast__Type_str(it.elem_type); + string _t44 = v__ast__Type_str(it.elem_type); string res = str_intp( 11, _MOV((StrIntpData[]){ {_SLIT("v.ast.Array{\n"), 0, {.d_c=0}}, {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" nr_dims: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.nr_dims}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t46}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t44}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t46); + string_free(&_t44); string_free(&indents); return res; } static string indent_v__ast__ArrayFixed_str(v__ast__ArrayFixed it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t47 = v__ast__Expr_str(it.size_expr); - string _t48 = v__ast__Type_str(it.elem_type); + string _t45 = v__ast__Expr_str(it.size_expr); + string _t46 = v__ast__Type_str(it.elem_type); string res = str_intp( 15, _MOV((StrIntpData[]){ {_SLIT("v.ast.ArrayFixed{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" size_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t47}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" size_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t45}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" size: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.size}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t48}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t46}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t48); - string_free(&_t47); + string_free(&_t46); + string_free(&_t45); string_free(&indents); return res; } static string indent_v__ast__Chan_str(v__ast__Chan it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t49 = v__ast__Type_str(it.elem_type); + string _t47 = v__ast__Type_str(it.elem_type); string res = str_intp( 11, _MOV((StrIntpData[]){ {_SLIT("v.ast.Chan{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t49}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t47}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_mut: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); + string_free(&_t47); + string_free(&indents); + return res; +} + +static string indent_v__ast__FnType_str(v__ast__FnType it, int indent_count) { + string indents = string_repeat(_SLIT(" "), indent_count); + string _t48 = indent_v__ast__Fn_str(it.func, indent_count + 1); + string res = str_intp( 15, _MOV((StrIntpData[]){ + {_SLIT("v.ast.FnType{\n"), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" is_anon: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_anon ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" has_decl: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.has_decl ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" func: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t48}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, + })); + string_free(&_t48); + string_free(&indents); + return res; +} + +static string indent_v__ast__GenericInst_str(v__ast__GenericInst it, int indent_count) { + string indents = string_repeat(_SLIT(" "), indent_count); + string _t49 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); + string res = str_intp( 11, _MOV((StrIntpData[]){ + {_SLIT("v.ast.GenericInst{\n"), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" parent_idx: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.parent_idx}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t49}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, + })); string_free(&_t49); string_free(&indents); return res; } -static string indent_v__ast__FnType_str(v__ast__FnType it, int indent_count) { - string indents = string_repeat(_SLIT(" "), indent_count); - string _t50 = indent_v__ast__Fn_str(it.func, indent_count + 1); - string res = str_intp( 15, _MOV((StrIntpData[]){ - {_SLIT("v.ast.FnType{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" is_anon: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_anon ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" has_decl: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.has_decl ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" func: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t50}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, - })); - string_free(&_t50); - string_free(&indents); - return res; -} - -static string indent_v__ast__GenericInst_str(v__ast__GenericInst it, int indent_count) { - string indents = string_repeat(_SLIT(" "), indent_count); - string _t51 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); - string res = str_intp( 11, _MOV((StrIntpData[]){ - {_SLIT("v.ast.GenericInst{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" parent_idx: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.parent_idx}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t51}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, - })); - string_free(&_t51); - string_free(&indents); - return res; -} - static string indent_v__ast__Interface_str(v__ast__Interface it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t52 = indent_Map_int_Array_v__ast__Type_str(it.conversions, indent_count + 1); - string _t53 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); - string _t54 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t55 = indent_Array_v__ast__Fn_str(it.methods, indent_count + 1); - string _t56 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); - string _t57 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); - string _t58 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); - string _t59 = v__ast__Type_str(it.parent_type); + string _t50 = indent_Map_int_Array_v__ast__Type_str(it.conversions, indent_count + 1); + string _t51 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t52 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t53 = indent_Array_v__ast__Fn_str(it.methods, indent_count + 1); + string _t54 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); + string _t55 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); + string _t56 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); + string _t57 = v__ast__Type_str(it.parent_type); string res = str_intp( 39, _MOV((StrIntpData[]){ {_SLIT("v.ast.Interface{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" conversions: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t52}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t53}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t54}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" methods: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t55}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t56}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t57}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t58}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t59}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" conversions: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t50}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t51}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t52}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" methods: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t53}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t54}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t55}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t56}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t57}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_generic: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_generic ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t59); - string_free(&_t58); string_free(&_t57); string_free(&_t56); string_free(&_t55); string_free(&_t54); string_free(&_t53); string_free(&_t52); + string_free(&_t51); + string_free(&_t50); string_free(&indents); return res; } static string indent_v__ast__Map_str(v__ast__Map it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t60 = v__ast__Type_str(it.key_type); - string _t61 = v__ast__Type_str(it.value_type); + string _t58 = v__ast__Type_str(it.key_type); + string _t59 = v__ast__Type_str(it.value_type); string res = str_intp( 11, _MOV((StrIntpData[]){ {_SLIT("v.ast.Map{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" key_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t60}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" value_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t61}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" key_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t58}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" value_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t59}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t61); - string_free(&_t60); + string_free(&_t59); + string_free(&_t58); string_free(&indents); return res; } static string indent_v__ast__MultiReturn_str(v__ast__MultiReturn it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t62 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t60 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); string res = str_intp( 7, _MOV((StrIntpData[]){ {_SLIT("v.ast.MultiReturn{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t62}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t60}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t62); + string_free(&_t60); string_free(&indents); return res; } static string indent_v__ast__Struct_str(v__ast__Struct it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t63 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); - string _t64 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); - string _t65 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t66 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); - string _t67 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); - string _t68 = v__ast__Type_str(it.parent_type); + string _t61 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); + string _t62 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); + string _t63 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t64 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); + string _t65 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); + string _t66 = v__ast__Type_str(it.parent_type); string res = str_intp( 47, _MOV((StrIntpData[]){ {_SLIT("v.ast.Struct{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t63}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t64}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t65}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t66}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t67}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t68}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t61}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t62}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t63}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t64}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t65}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t66}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_typedef: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_typedef ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_union: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_union ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_heap: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_heap ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, @@ -11997,53 +11989,53 @@ static string indent_v__ast__Struct_str(v__ast__Struct it, int indent_count) { {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_generic: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_generic ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t68); - string_free(&_t67); string_free(&_t66); string_free(&_t65); string_free(&_t64); string_free(&_t63); + string_free(&_t62); + string_free(&_t61); string_free(&indents); return res; } static string indent_v__ast__SumType_str(v__ast__SumType it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t69 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t70 = indent_Array_v__ast__Type_str(it.variants, indent_count + 1); - string _t71 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); - string _t72 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); - string _t73 = v__ast__Type_str(it.parent_type); + string _t67 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t68 = indent_Array_v__ast__Type_str(it.variants, indent_count + 1); + string _t69 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); + string _t70 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); + string _t71 = v__ast__Type_str(it.parent_type); string res = str_intp( 35, _MOV((StrIntpData[]){ {_SLIT("v.ast.SumType{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t69}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" variants: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t70}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t71}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t72}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t73}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t67}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" variants: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t68}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t69}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t70}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t71}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" found_fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.found_fields ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_anon: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_anon ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_generic: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_generic ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t73); - string_free(&_t72); string_free(&_t71); string_free(&_t70); string_free(&_t69); + string_free(&_t68); + string_free(&_t67); string_free(&indents); return res; } static string indent_v__ast__Thread_str(v__ast__Thread it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t74 = v__ast__Type_str(it.return_type); + string _t72 = v__ast__Type_str(it.return_type); string res = str_intp( 7, _MOV((StrIntpData[]){ {_SLIT("v.ast.Thread{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" return_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t74}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" return_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t72}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t74); + string_free(&_t72); string_free(&indents); return res; } @@ -12061,66 +12053,66 @@ static string indent_v__ast__EmptyExpr_str(v__ast__EmptyExpr it, int indent_coun static string indent_v__ast__Comment_str(v__ast__Comment it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t75 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t73 = indent_v__token__Pos_str(it.pos, indent_count + 1); string res = str_intp( 19, _MOV((StrIntpData[]){ {_SLIT("v.ast.Comment{\n"), 0, {.d_c=0}}, {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" text: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.text}}, {_SLIT("'"), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_multi: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_multi ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_inline: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_inline ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t75}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t73}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t75); + string_free(&_t73); string_free(&indents); return res; } static string indent_v__ast__Param_str(v__ast__Param it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t76 = indent_v__token__Pos_str(it.pos, indent_count + 1); - string _t77 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); - string _t78 = v__ast__Type_str(it.typ); + string _t74 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t75 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); + string _t76 = v__ast__Type_str(it.typ); string res = str_intp( 31, _MOV((StrIntpData[]){ {_SLIT("v.ast.Param{\n"), 0, {.d_c=0}}, {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.name}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t76}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t77}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t78}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t74}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t75}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t76}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_mut: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_auto_rec: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_auto_rec ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_hidden: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_hidden ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t78); - string_free(&_t77); string_free(&_t76); + string_free(&_t75); + string_free(&_t74); string_free(&indents); return res; } static string indent_v__ast__StructField_str(v__ast__StructField it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t79 = indent_Array_v__ast__Comment_str(it.comments, indent_count + 1); - string _t80 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); - string _t81 = v__ast__Expr_str(it.default_expr); - string _t82 = indent_v__token__Pos_str(it.pos, indent_count + 1); - string _t83 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); - string _t84 = v__ast__Type_str(it.default_expr_typ); - string _t85 = v__ast__Type_str(it.typ); + string _t77 = indent_Array_v__ast__Comment_str(it.comments, indent_count + 1); + string _t78 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); + string _t79 = v__ast__Expr_str(it.default_expr); + string _t80 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t81 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); + string _t82 = v__ast__Type_str(it.default_expr_typ); + string _t83 = v__ast__Type_str(it.typ); string res = str_intp( 75, _MOV((StrIntpData[]){ {_SLIT("v.ast.StructField{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" comments: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t79}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t80}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" comments: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t77}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t78}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_val: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.default_val}}, {_SLIT("'"), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" deprecation_msg: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.deprecation_msg}}, {_SLIT("'"), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" deprecated_after: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.deprecated_after}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t81}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t79}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.name}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t82}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t83}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t80}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t81}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" i: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.i}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr_typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t84}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t85}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr_typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t82}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t83}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" has_default_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.has_default_expr ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_pub: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_mut: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, @@ -12129,13 +12121,13 @@ static string indent_v__ast__StructField_str(v__ast__StructField it, int indent_ {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_deprecated: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_deprecated ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t85); - string_free(&_t84); string_free(&_t83); string_free(&_t82); string_free(&_t81); string_free(&_t80); string_free(&_t79); + string_free(&_t78); + string_free(&_t77); string_free(&indents); return res; } @@ -15859,6 +15851,25 @@ string strings__find_between_pair_string(string input, string start, string end) return _SLIT(""); } +Array_string strings__split_capital(string s) { + Array_string res = __new_array_with_default(0, 0, sizeof(string), 0); + int word_start = 0; + for (int idx = 0; idx < s.len; ++idx) { + u8 c = s.str[idx]; + if (c >= 'A' && c <= 'Z') { + if (word_start != idx) { + array_push((array*)&res, _MOV((string[]){ string_substr_ni(s, word_start, idx) })); + } + word_start = idx; + continue; + } + } + if (word_start != s.len) { + array_push((array*)&res, _MOV((string[]){ string_substr_ni(s, word_start, (s).len) })); + } + return res; +} + int math__bits__leading_zeros_8(u8 x) { return 8 - math__bits__len_8(x); } @@ -30855,8 +30866,11 @@ string os__norm_path(string path) { return _t1; } bool rooted = os__is_abs_path(path); - string volume = os__get_volume(path); - int volume_len = volume.len; + int volume_len = os__win_volume_len(path); + string volume = string_substr(path, 0, volume_len); + if (volume_len != 0 && string_contains(volume, _const_os__fslash_str)) { + volume = string_replace(volume, _const_os__fslash_str, _const_os__path_separator); + } string cpath = os__clean_path(string_substr(path, volume_len, (path).len)); if (cpath.len == 0 && volume_len == 0) { string _t2 = _const_os__dot_str; @@ -31012,15 +31026,21 @@ VV_LOCAL_SYMBOL string os__clean_path(string path) { } VV_LOCAL_SYMBOL int os__win_volume_len(string path) { - int plen = path.len; - if (plen < 2) { + #if !defined(_WIN32) + { int _t1 = 0; return _t1; } - if (os__has_drive_letter(path)) { - int _t2 = 2; + #endif + int plen = path.len; + if (plen < 2) { + int _t2 = 0; return _t2; } + if (os__has_drive_letter(path)) { + int _t3 = 2; + return _t3; + } if (plen >= 5 && os__starts_w_slash_slash(path) && !os__is_slash(string_at(path, 2))) { for (int i = 3; i < plen; i++) { if (os__is_slash(string_at(path, i))) { @@ -31030,37 +31050,17 @@ VV_LOCAL_SYMBOL int os__win_volume_len(string path) { i++; for (; i < plen; i++) { if (os__is_slash(string_at(path, i))) { - int _t3 = i; - return _t3; + int _t4 = i; + return _t4; } } - int _t4 = i; - return _t4; + int _t5 = i; + return _t5; } } } - int _t5 = 0; - return _t5; -} - -VV_LOCAL_SYMBOL string os__get_volume(string path) { - #if !defined(_WIN32) - { - string _t1 = _const_os__empty_str; - return _t1; - } - #endif - string volume = string_substr(path, 0, os__win_volume_len(path)); - if (volume.len == 0) { - string _t2 = _const_os__empty_str; - return _t2; - } - if (string_at(volume, 0) == _const_os__fslash) { - string _t3 = string_replace(volume, _SLIT("/"), _SLIT("\\")); - return _t3; - } - string _t4 = volume; - return _t4; + int _t6 = 0; + return _t6; } VV_LOCAL_SYMBOL bool os__is_slash(u8 b) { @@ -35018,7 +35018,7 @@ Array_string v__depgraph__OrderedDepMap_get(v__depgraph__OrderedDepMap* o, strin *(Array_string*) _t1.data = __new_array_with_default(0, 0, sizeof(string), 0); } - Array_string res = *(Array_string*)_t1.data; + Array_string res = (*(Array_string*)_t1.data); Array_string _t3 = res; return _t3; } @@ -36035,6 +36035,7 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts) { vcache_basepath = os__join_path(os__vmodules_dir(), new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("cache")}))); } ; + ; if (!os__is_dir(vcache_basepath)) { _option_void _t1 = os__mkdir_all(vcache_basepath); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { @@ -36061,9 +36062,27 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts) { ; ; } - string original_vopts = Array_string_join(opts, _SLIT("|")); - v__vcache__CacheManager _t3 = ((v__vcache__CacheManager){.basepath = vcache_basepath,.original_vopts = original_vopts,.vopts = original_vopts,.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}); - return _t3; + Map_string_bool deduped_opts = new_map(sizeof(string), sizeof(bool), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string) + ; + for (int _t3 = 0; _t3 < opts.len; ++_t3) { + string o = ((string*)opts.data)[_t3]; + map_set(&deduped_opts, &(string[]){o}, &(bool[]) { true }); + } + Array_string _t4 = {0}; + Array_string _t4_orig = map_keys(&deduped_opts); + int _t4_len = _t4_orig.len; + _t4 = __new_array(0, _t4_len, sizeof(string)); + + for (int _t5 = 0; _t5 < _t4_len; ++_t5) { + string it = ((string*) _t4_orig.data)[_t5]; + if ((it).len != 0 && !string_starts_with(it, _SLIT("['gcboehm', "))) { + array_push((array*)&_t4, &it); + } + } + Array_string deduped_opts_keys =_t4; + string original_vopts = Array_string_join(deduped_opts_keys, _SLIT("|")); + v__vcache__CacheManager _t6 = ((v__vcache__CacheManager){.basepath = vcache_basepath,.original_vopts = original_vopts,.vopts = original_vopts,.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}); + return _t6; } void v__vcache__CacheManager_set_temporary_options(v__vcache__CacheManager* cm, Array_string new_opts) { @@ -36085,7 +36104,7 @@ string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key *(string*) _t1.data = _SLIT(""); } - string cpath = *(string*)_t1.data; + string cpath = (*(string*)_t1.data); if ((cpath).len == 0) { string hk = string__plus(cm->vopts, key); string a = u64_hex_full(hash__sum64_string(hk, 5U)); @@ -36182,6 +36201,15 @@ _option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string return _t5; } +VV_LOCAL_SYMBOL void v__vcache__xlog(string fname, string s) { + int pid = v__vcache__mypid(); + if (string_at(fname, 0) != '|') { + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> VCache | pid: "), /*100 &int*/0xfe07, {.d_i32 = pid}}, {_SLIT(" | CacheManager."), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } else { + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> VCache | pid: "), /*100 &int*/0xfe07, {.d_i32 = pid}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } +} + // Attr: [unsafe] VV_LOCAL_SYMBOL int v__vcache__mypid(void) { static int pid = 0; @@ -36867,10 +36895,14 @@ multi_return_Array_string_Array_string_Array_string Array_v__cflag__CFlag_define Array_string libs = __new_array_with_default(0, 0, sizeof(string), 0); for (int _t1 = 0; _t1 < copts_without_obj_files.len; ++_t1) { string copt = ((string*)copts_without_obj_files.data)[_t1]; - if (string_starts_with(copt, _SLIT("-l")) || string_ends_with(copt, _SLIT(".a"))) { + if (string_starts_with(copt, _SLIT("-l"))) { array_push((array*)&libs, _MOV((string[]){ string_clone(copt) })); continue; } + if (string_ends_with(copt, _SLIT(".a"))) { + array_push((array*)&libs, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = copt}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + continue; + } if (string_starts_with(copt, _SLIT("-D"))) { array_push((array*)&defines, _MOV((string[]){ string_clone(copt) })); continue; @@ -38459,7 +38491,7 @@ f64 rand__exponential(f64 lambda) { } v__pref__Preferences* v__pref__new_preferences(void) { - v__pref__Preferences* p = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.backend = 0,.ccompiler_type = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))); + v__pref__Preferences* p = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.gc_mode = v__pref__GarbageCollectionMode__unknown,.backend = 0,.ccompiler_type = 0,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))); v__pref__Preferences_fill_with_defaults(p); v__pref__Preferences* _t1 = p; return _t1; @@ -38512,6 +38544,17 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) { } string rpath_name = os__file_name(rpath); p->building_v = !p->is_repl && (string__eq(rpath_name, _SLIT("v")) || string__eq(rpath_name, _SLIT("vfmt.v"))); + if (p->gc_mode == v__pref__GarbageCollectionMode__unknown) { + if (p->backend != v__pref__Backend__c || p->building_v || p->is_bare || string__eq(p->ccompiler, _SLIT("msvc"))) { + p->gc_mode = v__pref__GarbageCollectionMode__no_gc; + _PUSH_MANY(&p->build_options, (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("-gc"), _SLIT("none")}))), _t1, Array_string); + } else { + p->gc_mode = v__pref__GarbageCollectionMode__boehm_full_opt; + v__pref__Preferences_parse_define(p, _SLIT("gcboehm")); + v__pref__Preferences_parse_define(p, _SLIT("gcboehm_full")); + v__pref__Preferences_parse_define(p, _SLIT("gcboehm_opt")); + } + } if (p->os == v__pref__OS___auto) { p->os = v__pref__get_host_os(); } @@ -38534,7 +38577,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) { } #endif } - string vhash = _SLIT("3bc50721e"); + string vhash = _SLIT("5b16d5fdf"); p->cache_manager = v__vcache__new_cache_manager(new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){string_clone(vhash), str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->sanitize ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}})), string_clone(string_trim_space(p->cflags)), string_clone(string_trim_space(p->third_party_option)), string_clone(Array_string_str(p->compile_defines_all)), string_clone(Array_string_str(p->compile_defines)), string_clone(Array_string_str(p->lookup_path))}))); if (string__eq(os__user_os(), _SLIT("windows"))) { p->use_cache = false; @@ -39106,7 +39149,7 @@ VV_LOCAL_SYMBOL void v__pref__detect_musl(v__pref__Preferences* res) { } multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors(Array_string known_external_commands, Array_string args, bool show_output) { - v__pref__Preferences* res = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.backend = 0,.ccompiler_type = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))); + v__pref__Preferences* res = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.gc_mode = v__pref__GarbageCollectionMode__unknown,.backend = 0,.ccompiler_type = 0,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))); v__pref__detect_musl(res); #if defined(TARGET_IS_64BIT) { @@ -39203,9 +39246,15 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors else if (string__eq(arg, _SLIT("-gc"))) { string gc_mode = os__cmdline__option(current_args, _SLIT("-gc"), _SLIT("")); - if (string__eq(gc_mode, _SLIT("")) || string__eq(gc_mode, _SLIT("none"))) { + if (string__eq(gc_mode, _SLIT("none"))) { res->gc_mode = v__pref__GarbageCollectionMode__no_gc; } + else if (string__eq(gc_mode, _SLIT("")) || string__eq(gc_mode, _SLIT("boehm"))) { + res->gc_mode = v__pref__GarbageCollectionMode__boehm_full_opt; + v__pref__Preferences_parse_define(res, _SLIT("gcboehm")); + v__pref__Preferences_parse_define(res, _SLIT("gcboehm_full")); + v__pref__Preferences_parse_define(res, _SLIT("gcboehm_opt")); + } else if (string__eq(gc_mode, _SLIT("boehm_full"))) { res->gc_mode = v__pref__GarbageCollectionMode__boehm_full; v__pref__Preferences_parse_define(res, _SLIT("gcboehm")); @@ -39228,12 +39277,6 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors v__pref__Preferences_parse_define(res, _SLIT("gcboehm_incr")); v__pref__Preferences_parse_define(res, _SLIT("gcboehm_opt")); } - else if (string__eq(gc_mode, _SLIT("boehm"))) { - res->gc_mode = v__pref__GarbageCollectionMode__boehm_full_opt; - v__pref__Preferences_parse_define(res, _SLIT("gcboehm")); - v__pref__Preferences_parse_define(res, _SLIT("gcboehm_full")); - v__pref__Preferences_parse_define(res, _SLIT("gcboehm_opt")); - } else if (string__eq(gc_mode, _SLIT("boehm_leak"))) { res->gc_mode = v__pref__GarbageCollectionMode__boehm_leak; v__pref__Preferences_parse_define(res, _SLIT("gcboehm")); @@ -41305,7 +41348,7 @@ Array_string v__util__cached_file2sourcelines(string path) { } if (_t1.state == 0) { - Array_string res = *(Array_string*)_t1.data; + Array_string res = (*(Array_string*)_t1.data); Array_string _t3 = res; return _t3; } @@ -41925,7 +41968,7 @@ void v__util__Timers_start(v__util__Timers* t, string name) { *(time__StopWatch*) _t1.data = time__new_stopwatch(((time__StopWatchOptions){.auto_start = true,})); } - time__StopWatch sw = *(time__StopWatch*)_t1.data; + time__StopWatch sw = (*(time__StopWatch*)_t1.data); time__StopWatch_start(&sw); (*(time__StopWatch*)map_get_and_set((map*)&t->swatches, &(string[]){name}, &(time__StopWatch[]){ (time__StopWatch){.elapsed = 0,.start = 0,.end = 0,} })) = sw; } @@ -42123,7 +42166,7 @@ _option_string v__util__resolve_env_value(string str, bool check_for_presence) { return (_option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the environment variable \""), /*115 &string*/0xfe10, {.d_s = env_lit}}, {_SLIT("\" does not exist."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - env_value = *(string*)_t6.data; + env_value = (*(string*)_t6.data); if ((env_value).len == 0) { return (_option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the environment variable \""), /*115 &string*/0xfe10, {.d_s = env_lit}}, {_SLIT("\" is empty."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } @@ -42330,7 +42373,7 @@ _option_string v__util__cached_read_source_file(string path) { } if (_t2.state == 0) { - string res = *(string*)_t2.data; + string res = (*(string*)_t2.data); #if defined(CUSTOM_DEFINE_trace_cached_read_source_file_cached) { println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cached_read_source_file cached "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); @@ -44270,9 +44313,36 @@ bool Array_v__ast__Attr_contains(Array_v__ast__Attr attrs, string str) { return _t1; } +// Attr: [direct_array_access] +_option_v__ast__Attr Array_v__ast__Attr_find_first(Array_v__ast__Attr attrs, string aname) { + for (int _t1 = 0; _t1 < attrs.len; ++_t1) { + v__ast__Attr a = ((v__ast__Attr*)attrs.data)[_t1]; + if (string__eq(a.name, aname)) { + _option_v__ast__Attr _t2; + opt_ok2(&(v__ast__Attr[]) { a }, (_option*)(&_t2), sizeof(v__ast__Attr)); + return _t2; + } + } + return (_option_v__ast__Attr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; +} + +// Attr: [direct_array_access] +_option_v__ast__Attr Array_v__ast__Attr_find_last(Array_v__ast__Attr attrs, string aname) { + for (int idx = attrs.len - 1; idx > -1; idx--) { + v__ast__Attr a = ((v__ast__Attr*)attrs.data)[idx]; + if (string__eq(a.name, aname)) { + _option_v__ast__Attr _t1; + opt_ok2(&(v__ast__Attr[]) { a }, (_option*)(&_t1), sizeof(v__ast__Attr)); + return _t1; + } + } + return (_option_v__ast__Attr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; +} + +// Attr: [direct_array_access] _option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs) { for (int idx = 0; idx < attrs.len; ++idx) { - if ((*(v__ast__Attr*)/*ee elem_sym */array_get(attrs, idx)).kind == v__ast__AttrKind__comptime_define) { + if (((v__ast__Attr*)attrs.data)[idx].kind == v__ast__AttrKind__comptime_define) { _option_int _t1; opt_ok2(&(int[]) { idx }, (_option*)(&_t1), sizeof(int)); return _t1; @@ -44919,7 +44989,7 @@ _option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* } if (_t1.state == 0) { - v__ast__ScopeStructField field = *(v__ast__ScopeStructField*)_t1.data; + v__ast__ScopeStructField field = (*(v__ast__ScopeStructField*)_t1.data); if (v__ast__Type_alias_eq(field.struct_type, struct_type) && string__eq(field.name, field_name)) { _option_v__ast__ScopeStructField _t3; opt_ok2(&(v__ast__ScopeStructField[]) { field }, (_option*)(&_t3), sizeof(v__ast__ScopeStructField)); @@ -45029,7 +45099,7 @@ void v__ast__Scope_register_struct_field(v__ast__Scope* s, string name, v__ast__ } if (_t1.state == 0) { - v__ast__ScopeStructField f = *(v__ast__ScopeStructField*)_t1.data; + v__ast__ScopeStructField f = (*(v__ast__ScopeStructField*)_t1.data); if (v__ast__Type_alias_eq(f.struct_type, field.struct_type) && string__eq(f.name, field.name)) { return; } @@ -46118,7 +46188,7 @@ _option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name) { } if (_t1.state == 0) { - v__ast__Fn f = *(v__ast__Fn*)_t1.data; + v__ast__Fn f = (*(v__ast__Fn*)_t1.data); _option_v__ast__Fn _t3; opt_ok2(&(v__ast__Fn[]) { f }, (_option*)(&_t3), sizeof(v__ast__Fn)); return _t3; @@ -47219,7 +47289,7 @@ bool v__ast__Table_register_fn_concrete_types(v__ast__Table* t, string fn_name, return _t3; } - Array_Array_v__ast__Type a = *(Array_Array_v__ast__Type*)_t1.data; + Array_Array_v__ast__Type a = (*(Array_Array_v__ast__Type*)_t1.data); if (Array_Array_v__ast__Type_contains(a, types)) { bool _t4 = false; return _t4; @@ -48212,12 +48282,12 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { for (int _t1 = 0; _t1 < t->type_symbols.len; ++_t1) { - v__ast__TypeSymbol** typ = ((v__ast__TypeSymbol**)t->type_symbols.data) + _t1; - if ((*typ)->kind == v__ast__Kind__generic_inst) { - v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast(((*typ)->info)._v__ast__GenericInst,((*typ)->info)._typ, 449) /*expected idx: 449, name: v.ast.GenericInst */ ; + v__ast__TypeSymbol** sym = ((v__ast__TypeSymbol**)t->type_symbols.data) + _t1; + if ((*sym)->kind == v__ast__Kind__generic_inst) { + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast(((*sym)->info)._v__ast__GenericInst,((*sym)->info)._typ, 449) /*expected idx: 449, name: v.ast.GenericInst */ ; v__ast__TypeSymbol* parent = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, info.parent_idx)); if (parent->kind == v__ast__Kind__placeholder) { - (*typ)->kind = v__ast__Kind__placeholder; + (*sym)->kind = v__ast__Kind__placeholder; continue; } if (parent->info._typ == 420 /* v.ast.Struct */) { @@ -48256,9 +48326,9 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { parent_info.concrete_types = array_clone_to_depth(&info.concrete_types, 0); parent_info.fields = fields; parent_info.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic); - (*typ)->info = v__ast__Struct_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__Struct, (((v__ast__Struct){parent_info.attrs,parent_info.embeds,.fields = fields,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),parent_info.is_typedef,parent_info.is_union,parent_info.is_heap,parent_info.is_minify,.is_generic = false,})))); - (*typ)->is_pub = true; - (*typ)->kind = parent->kind; + (*sym)->info = v__ast__Struct_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__Struct, (((v__ast__Struct){parent_info.attrs,parent_info.embeds,.fields = fields,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),parent_info.is_typedef,parent_info.is_union,parent_info.is_heap,parent_info.is_minify,.is_generic = false,})))); + (*sym)->is_pub = true; + (*sym)->kind = parent->kind; v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(t, parent_info.parent_type); for (int _t5 = 0; _t5 < parent_sym->methods.len; ++_t5) { v__ast__Fn method = ((v__ast__Fn*)parent_sym->methods.data)[_t5]; @@ -48316,7 +48386,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { param->typ = pt; } } - v__ast__TypeSymbol_register_method(/*diff=1*/*typ, *method); + v__ast__TypeSymbol_register_method(/*diff=1*/*sym, *method); } Array_v__ast__Fn all_methods = parent->methods; for (int _t13 = 0; _t13 < imethods.len; ++_t13) { @@ -48328,10 +48398,10 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } } } - (*typ)->info = v__ast__Interface_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__Interface, (((v__ast__Interface){parent_info.conversions,parent_info.types,.fields = fields,.methods = imethods,parent_info.embeds,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),.is_generic = false,})))); - (*typ)->is_pub = true; - (*typ)->kind = parent->kind; - (*typ)->methods = all_methods; + (*sym)->info = v__ast__Interface_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__Interface, (((v__ast__Interface){parent_info.conversions,parent_info.types,.fields = fields,.methods = imethods,parent_info.embeds,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),.is_generic = false,})))); + (*sym)->is_pub = true; + (*sym)->kind = parent->kind; + (*sym)->methods = all_methods; } else { v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of interface `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); @@ -48367,8 +48437,8 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } for (int i = 0; i < variants.len; ++i) { if (v__ast__Type_has_flag((*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), v__ast__TypeFlag__generic)) { - v__ast__TypeSymbol* sym = v__ast__Table_sym(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))); - if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))) != info.parent_idx) { + v__ast__TypeSymbol* t_sym = v__ast__Table_sym(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))); + if (t_sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))) != info.parent_idx) { array_set(&variants, i, &(v__ast__Type[]) { v__ast__Table_unwrap_generic_type(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, info.concrete_types) }); } else { _option_v__ast__Type _t18; @@ -48379,9 +48449,9 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } } } - (*typ)->info = v__ast__SumType_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__SumType, (((v__ast__SumType){.fields = fields,.variants = variants,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),parent_info.found_fields,parent_info.is_anon,.is_generic = false,})))); - (*typ)->is_pub = true; - (*typ)->kind = parent->kind; + (*sym)->info = v__ast__SumType_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__SumType, (((v__ast__SumType){.fields = fields,.variants = variants,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),parent_info.found_fields,parent_info.is_anon,.is_generic = false,})))); + (*sym)->is_pub = true; + (*sym)->kind = parent->kind; } else { v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of sumtype `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); @@ -49583,7 +49653,7 @@ string res; } if (_t1.state == 0) { - string cached_res = *(string*)_t1.data; + string cached_res = (*(string*)_t1.data); string _t3 = cached_res; return _t3; } @@ -51742,7 +51812,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ v__ast__Param param = ((v__ast__Param*)func.params.data)[i]; v__ast__Type to_set = _const_v__ast__void_type; if (node->is_method && v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__generic)) { - v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->receiver_type); + v__ast__TypeSymbol* sym = v__ast__Table_final_sym(c->table, node->receiver_type); if (sym->info._typ == 420 /* v.ast.Struct */) { if (!isnil(c->table->cur_fn) && c->table->cur_fn->generic_names.len > 0) { if (Array_string_contains(c->table->cur_fn->generic_names, gt_name) && c->table->cur_fn->generic_names.len == c->table->cur_concrete_types.len) { @@ -51993,7 +52063,7 @@ v__checker__Checker* v__checker__new_checker(v__ast__Table* table, v__pref__Pref timers_should_print = true; } #endif - v__checker__Checker* _t1 = ((v__checker__Checker*)memdup(&(v__checker__Checker){.main_fn_decl_node = (v__ast__FnDecl){.receiver = (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,},.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.params = __new_array(0, 0, sizeof(v__ast__Param)),.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.defer_stmts = __new_array(0, 0, sizeof(v__ast__DeferStmt)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.next_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.label_names = __new_array(0, 0, sizeof(string)),.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.source_file = 0,.scope = 0,.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.ctdefine_idx = -1,.idx = 0,.return_type = 0,.ninstances = 0,.is_deprecated = 0,.is_pub = 0,.is_variadic = 0,.is_anon = 0,.is_noreturn = 0,.is_manualfree = 0,.is_main = 0,.is_test = 0,.is_conditional = 0,.is_exported = 0,.is_keep_alive = 0,.is_unsafe = 0,.is_markused = 0,.is_method = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.is_direct_arr = 0,.has_return = 0,.should_be_skipped = 0,.has_await = 0,},.cur_orm_ts = (v__ast__TypeSymbol){.methods = __new_array(0, 0, sizeof(v__ast__Fn)),.name = (string){.str=(byteptr)"", .is_lit=1},.cname = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.parent_idx = 0,.idx = 0,.size = -1,.align = -1,.is_pub = 0,},.comptime_fields_type = new_map(sizeof(string), sizeof(v__ast__Type), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.errors = __new_array(0, 0, sizeof(v__errors__Error)),.warnings = __new_array(0, 0, sizeof(v__errors__Warning)),.notices = __new_array(0, 0, sizeof(v__errors__Notice)),.error_lines = __new_array(0, 0, sizeof(int)),.const_deps = __new_array(0, 0, sizeof(string)),.const_names = __new_array(0, 0, sizeof(string)),.global_names = __new_array(0, 0, sizeof(string)),.locked_names = __new_array(0, 0, sizeof(string)),.rlocked_names = __new_array(0, 0, sizeof(string)),.ct_cond_stack = __new_array(0, 0, sizeof(v__ast__Expr)),.files = __new_array(0, 0, sizeof(v__ast__File)),.error_details = __new_array(0, 0, sizeof(string)),.vweb_gen_types = __new_array(0, 0, sizeof(v__ast__Type)),.mod = (string){.str=(byteptr)"", .is_lit=1},.vmod_file_content = (string){.str=(byteptr)"", .is_lit=1},.loop_label = (string){.str=(byteptr)"", .is_lit=1},.pref = pref,.table = table,.file = 0,.const_var = ((voidptr)(0)),.timers = v__util__new_timers(((v__util__TimerParams){.should_print = timers_should_print,.label = _SLIT("checker"),})),.fn_scope = ((voidptr)(0)),.smartcast_mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.smartcast_cond_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.nr_errors = 0,.nr_warnings = 0,.nr_notices = 0,.expected_type = 0,.expected_or_type = 0,.expected_expr_type = 0,.in_for_count = 0,.fn_level = 0,.stmt_level = 0,.expr_level = 0,.comptime_fields_default_type = 0,.match_exhaustive_cutoff_limit = pref->checker_match_exhaustive_cutoff_limit,.comptime_call_pos = 0,.should_abort = 0,.returns = 0,.scope_returns = 0,.is_builtin_mod = 0,.is_just_builtin_mod = 0,.is_generated = 0,.inside_unsafe = 0,.inside_const = 0,.inside_anon_fn = 0,.inside_ref_lit = 0,.inside_defer = 0,.inside_fn_arg = 0,.inside_ct_attr = 0,.inside_comptime_for_field = 0,.skip_flags = 0,.is_last_stmt = 0,.prevent_sum_type_unwrapping_once = 0,.using_new_err_struct = 0,.need_recheck_generic_fns = 0,.inside_sql = 0,.inside_selector_expr = 0,.inside_println_arg = 0,.inside_decl_rhs = 0,.inside_if_guard = 0,}, sizeof(v__checker__Checker))); + v__checker__Checker* _t1 = ((v__checker__Checker*)memdup(&(v__checker__Checker){.main_fn_decl_node = (v__ast__FnDecl){.receiver = (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,},.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.params = __new_array(0, 0, sizeof(v__ast__Param)),.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.defer_stmts = __new_array(0, 0, sizeof(v__ast__DeferStmt)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.next_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.label_names = __new_array(0, 0, sizeof(string)),.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.source_file = 0,.scope = 0,.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.ctdefine_idx = -1,.idx = 0,.return_type = 0,.ninstances = 0,.is_deprecated = 0,.is_pub = 0,.is_variadic = 0,.is_anon = 0,.is_noreturn = 0,.is_manualfree = 0,.is_main = 0,.is_test = 0,.is_conditional = 0,.is_exported = 0,.is_keep_alive = 0,.is_unsafe = 0,.is_markused = 0,.is_method = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.is_direct_arr = 0,.has_return = 0,.should_be_skipped = 0,.has_await = 0,},.cur_orm_ts = (v__ast__TypeSymbol){.methods = __new_array(0, 0, sizeof(v__ast__Fn)),.name = (string){.str=(byteptr)"", .is_lit=1},.cname = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.parent_idx = 0,.idx = 0,.size = -1,.align = -1,.is_pub = 0,},.comptime_fields_type = new_map(sizeof(string), sizeof(v__ast__Type), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.errors = __new_array(0, 0, sizeof(v__errors__Error)),.warnings = __new_array(0, 0, sizeof(v__errors__Warning)),.notices = __new_array(0, 0, sizeof(v__errors__Notice)),.error_lines = __new_array(0, 0, sizeof(int)),.const_deps = __new_array(0, 0, sizeof(string)),.const_names = __new_array(0, 0, sizeof(string)),.global_names = __new_array(0, 0, sizeof(string)),.locked_names = __new_array(0, 0, sizeof(string)),.rlocked_names = __new_array(0, 0, sizeof(string)),.ct_cond_stack = __new_array(0, 0, sizeof(v__ast__Expr)),.files = __new_array(0, 0, sizeof(v__ast__File)),.error_details = __new_array(0, 0, sizeof(string)),.vweb_gen_types = __new_array(0, 0, sizeof(v__ast__Type)),.mod = (string){.str=(byteptr)"", .is_lit=1},.vmod_file_content = (string){.str=(byteptr)"", .is_lit=1},.loop_label = (string){.str=(byteptr)"", .is_lit=1},.pref = pref,.table = table,.file = 0,.const_var = ((voidptr)(0)),.timers = v__util__new_timers(((v__util__TimerParams){.should_print = timers_should_print,.label = _SLIT("checker"),})),.fn_scope = ((voidptr)(0)),.smartcast_mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.smartcast_cond_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.nr_errors = 0,.nr_warnings = 0,.nr_notices = 0,.expected_type = 0,.expected_or_type = 0,.expected_expr_type = 0,.in_for_count = 0,.fn_level = 0,.stmt_level = 0,.expr_level = 0,.comptime_fields_default_type = 0,.match_exhaustive_cutoff_limit = pref->checker_match_exhaustive_cutoff_limit,.comptime_call_pos = 0,.should_abort = 0,.returns = 0,.scope_returns = 0,.is_builtin_mod = 0,.is_just_builtin_mod = 0,.is_generated = 0,.inside_unsafe = 0,.inside_const = 0,.inside_anon_fn = 0,.inside_ref_lit = 0,.inside_defer = 0,.inside_fn_arg = 0,.inside_ct_attr = 0,.inside_x_is_type = 0,.inside_comptime_for_field = 0,.skip_flags = 0,.is_last_stmt = 0,.prevent_sum_type_unwrapping_once = 0,.using_new_err_struct = 0,.need_recheck_generic_fns = 0,.inside_sql = 0,.inside_selector_expr = 0,.inside_println_arg = 0,.inside_decl_rhs = 0,.inside_if_guard = 0,}, sizeof(v__checker__Checker))); return _t1; } @@ -52014,6 +52084,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_reset_checker_state_at_start_of_new_fil c->inside_defer = false; c->inside_fn_arg = false; c->inside_ct_attr = false; + c->inside_x_is_type = false; c->skip_flags = false; c->fn_level = 0; c->expr_level = 0; @@ -52290,7 +52361,7 @@ void v__checker__Checker_check_files(v__checker__Checker* c, Array_v__ast__File_ } if (!has_main_mod_file) { v__checker__Checker_error(c, _SLIT("project must include a `main` module or be a shared library (compile with `v -shared`)"), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,})); - } else if (!has_main_fn) { + } else if (!has_main_fn && !c->pref->is_o) { v__checker__Checker_error(c, _SLIT("function `main` must be declared in the main module"), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,})); } } @@ -52515,7 +52586,7 @@ Array_v__ast__InterfaceEmbedding v__checker__Checker_expand_iface_embeds(v__chec } if (_t4.state == 0) { - v__ast__InterfaceDecl iface_decl = *(v__ast__InterfaceDecl*)_t4.data; + v__ast__InterfaceDecl iface_decl = (*(v__ast__InterfaceDecl*)_t4.data); Array_v__ast__InterfaceEmbedding list = iface_decl.embeds; if (!iface_decl.are_embeds_expanded) { list = v__checker__Checker_expand_iface_embeds(c, idecl, level + 1, iface_decl.embeds); @@ -52604,19 +52675,19 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im if (v__ast__Type_has_flag(elem_type, v__ast__TypeFlag__shared_f)) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("you have to create a handle and `lock` it to modify `shared` "), /*115 &string*/0xfe10, {.d_s = kind}}, {_SLIT(" element"), 0, { .d_c = 0 }}})), v__token__Pos_extend(v__ast__Expr_pos((*expr._v__ast__IndexExpr).left), (*expr._v__ast__IndexExpr).pos)); } - multi_return_string_v__token__Pos mr_22155 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__IndexExpr).left); - to_lock = mr_22155.arg0; - pos = mr_22155.arg1; + multi_return_string_v__token__Pos mr_22286 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__IndexExpr).left); + to_lock = mr_22286.arg0; + pos = mr_22286.arg1; } else if (expr._typ == 285 /* v.ast.ParExpr */) { - multi_return_string_v__token__Pos mr_22224 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); - to_lock = mr_22224.arg0; - pos = mr_22224.arg1; + multi_return_string_v__token__Pos mr_22355 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); + to_lock = mr_22355.arg0; + pos = mr_22355.arg1; } else if (expr._typ == 287 /* v.ast.PrefixExpr */) { - multi_return_string_v__token__Pos mr_22296 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); - to_lock = mr_22296.arg0; - pos = mr_22296.arg1; + multi_return_string_v__token__Pos mr_22427 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); + to_lock = mr_22427.arg0; + pos = mr_22427.arg1; } else if (expr._typ == 290 /* v.ast.SelectorExpr */) { if ((*expr._v__ast__SelectorExpr).expr_type == 0) { @@ -52666,9 +52737,9 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im string type_str = v__ast__Table_type_to_str(c->table, (*expr._v__ast__SelectorExpr).expr_type); v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("` of struct `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); } - multi_return_string_v__token__Pos mr_23760 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); - to_lock = mr_23760.arg0; - pos = mr_23760.arg1; + multi_return_string_v__token__Pos mr_23891 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); + to_lock = mr_23891.arg0; + pos = mr_23891.arg1; } if ((to_lock).len != 0) { explicit_lock_needed = true; @@ -52774,9 +52845,9 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } else if (expr._typ == 256 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("slice"))) { - multi_return_string_v__token__Pos mr_25583 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); - to_lock = mr_25583.arg0; - pos = mr_25583.arg1; + multi_return_string_v__token__Pos mr_25714 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); + to_lock = mr_25714.arg0; + pos = mr_25714.arg1; if ((to_lock).len != 0) { explicit_lock_needed = true; } @@ -53199,9 +53270,9 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t13.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_40023 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t13.data); - field = mr_40023.arg0; - embed_types = mr_40023.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_40154 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t13.data); + field = mr_40154.arg0; + embed_types = mr_40154.arg1; node->from_embed_types = embed_types; if (sym->kind == v__ast__Kind__aggregate || sym->kind == v__ast__Kind__sum_type) { unknown_field_msg = IError_name_table[err._typ]._method_msg(err._object); @@ -53235,9 +53306,9 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t15.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_40854 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t15.data); - field = mr_40854.arg0; - embed_types = mr_40854.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_40985 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t15.data); + field = mr_40985.arg0; + embed_types = mr_40985.arg1; node->from_embed_types = embed_types; } } @@ -53642,9 +53713,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_assert_stmt(v__checker__Checker* c, v__ VV_LOCAL_SYMBOL void v__checker__Checker_block(v__checker__Checker* c, v__ast__Block node) { if (node.is_unsafe) { + bool prev_unsafe = c->inside_unsafe; c->inside_unsafe = true; v__checker__Checker_stmts(c, node.stmts); - c->inside_unsafe = false; + c->inside_unsafe = prev_unsafe; } else { v__checker__Checker_stmts(c, node.stmts); } @@ -54017,7 +54089,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ } if (_t5.state == 0) { - time__Time after_time = *(time__Time*)_t5.data; + time__Time after_time = (*(time__Time*)_t5.data); time__Time now = time__now(); string deprecation_message = (*(string*)map_get(ADDR(map, c->table->mdeprecated_msg), &(string[]){node.mod}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); v__checker__Checker_deprecate(c, _SLIT("module"), node.mod, deprecation_message, now, after_time, node.pos); @@ -54102,10 +54174,9 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_error(c, _SLIT("incorrect use of compile-time type"), (*node._v__ast__ComptimeType).pos); } else if (node._typ == 266 /* v.ast.EmptyExpr */) { + print_backtrace(); v__checker__Checker_error(c, _SLIT("checker.expr(): unhandled EmptyExpr"), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,})); - } - else if (node._typ == 255 /* v.ast.CTempVar */) { - v__ast__Type _t2 = (*node._v__ast__CTempVar).typ; + v__ast__Type _t2 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54113,8 +54184,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t2; } - else if (node._typ == 248 /* v.ast.AnonFn */) { - v__ast__Type _t3 = v__checker__Checker_anon_fn(c, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); + else if (node._typ == 255 /* v.ast.CTempVar */) { + v__ast__Type _t3 = (*node._v__ast__CTempVar).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54122,33 +54193,33 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t3; } - else if (node._typ == 249 /* v.ast.ArrayDecompose */) { - v__ast__Type typ = v__checker__Checker_expr(c, (*node._v__ast__ArrayDecompose).expr); - v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, typ); - if (type_sym->kind != v__ast__Kind__array) { - v__checker__Checker_error(c, _SLIT("decomposition can only be used on arrays"), v__ast__Expr_pos((*node._v__ast__ArrayDecompose).expr)); - v__ast__Type _t4 = _const_v__ast__void_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t4; - } - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 415) /*expected idx: 415, name: v.ast.Array */ ; - v__ast__Type elem_type = v__ast__Type_set_flag(array_info.elem_type, v__ast__TypeFlag__variadic); - (*node._v__ast__ArrayDecompose).expr_type = typ; - (*node._v__ast__ArrayDecompose).arg_type = elem_type; - v__ast__Type _t5 = elem_type; + else if (node._typ == 248 /* v.ast.AnonFn */) { + v__ast__Type _t4 = v__checker__Checker_anon_fn(c, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t5; + return _t4; } - else if (node._typ == 250 /* v.ast.ArrayInit */) { - v__ast__Type _t6 = v__checker__Checker_array_init(c, (voidptr)&/*qq*/(*node._v__ast__ArrayInit)); + else if (node._typ == 249 /* v.ast.ArrayDecompose */) { + v__ast__Type typ = v__checker__Checker_expr(c, (*node._v__ast__ArrayDecompose).expr); + v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, typ); + if (type_sym->kind != v__ast__Kind__array) { + v__checker__Checker_error(c, _SLIT("decomposition can only be used on arrays"), v__ast__Expr_pos((*node._v__ast__ArrayDecompose).expr)); + v__ast__Type _t5 = _const_v__ast__void_type; + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t5; + } + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 415) /*expected idx: 415, name: v.ast.Array */ ; + v__ast__Type elem_type = v__ast__Type_set_flag(array_info.elem_type, v__ast__TypeFlag__variadic); + (*node._v__ast__ArrayDecompose).expr_type = typ; + (*node._v__ast__ArrayDecompose).arg_type = elem_type; + v__ast__Type _t6 = elem_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54156,14 +54227,23 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t6; } + else if (node._typ == 250 /* v.ast.ArrayInit */) { + v__ast__Type _t7 = v__checker__Checker_array_init(c, (voidptr)&/*qq*/(*node._v__ast__ArrayInit)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t7; + } else if (node._typ == 251 /* v.ast.AsCast */) { (*node._v__ast__AsCast).expr_type = v__checker__Checker_expr(c, (*node._v__ast__AsCast).expr); v__ast__TypeSymbol* expr_type_sym = v__ast__Table_sym(c->table, (*node._v__ast__AsCast).expr_type); v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, (*node._v__ast__AsCast).typ); if (expr_type_sym->kind == v__ast__Kind__sum_type) { - _option_void _t7 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); - if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { - IError err = _t7.err; + _option_void _t8 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); + if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { + IError err = _t8.err; } ; @@ -54172,9 +54252,9 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__AsCast).pos); } } else if (expr_type_sym->kind == v__ast__Kind__interface_ && type_sym->kind == v__ast__Kind__interface_) { - _option_void _t8 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); - if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { - IError err = _t8.err; + _option_void _t9 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); + if (_t9.state != 0 && _t9.err._typ != _IError_None___index) { + IError err = _t9.err; } ; @@ -54185,38 +54265,29 @@ bool v__checker__Checker_expr_defer_0 = false; } v__checker__Checker_error(c, s, (*node._v__ast__AsCast).pos); } - v__ast__Type _t9 = (*node._v__ast__AsCast).typ; + v__ast__Type _t10 = (*node._v__ast__AsCast).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t9; + return _t10; } else if (node._typ == 252 /* v.ast.Assoc */) { - _option_v__ast__Var_ptr _t10 = v__ast__Scope_find_var((*node._v__ast__Assoc).scope, (*node._v__ast__Assoc).var_name); - if (_t10.state != 0) { /*or block*/ - IError err = _t10.err; + _option_v__ast__Var_ptr _t11 = v__ast__Scope_find_var((*node._v__ast__Assoc).scope, (*node._v__ast__Assoc).var_name); + if (_t11.state != 0) { /*or block*/ + IError err = _t11.err; _v_panic(IError_str(err)); VUNREACHABLE(); ; } - v__ast__Var* v = (*(v__ast__Var**)_t10.data); + v__ast__Var* v = (*(v__ast__Var**)_t11.data); for (int i = 0; i < (*node._v__ast__Assoc).fields.len; ++i) { v__checker__Checker_expr(c, (*(v__ast__Expr*)/*ee elem_sym */array_get((*node._v__ast__Assoc).exprs, i))); } (*node._v__ast__Assoc).typ = v->typ; - v__ast__Type _t11 = v->typ; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t11; - } - else if (node._typ == 254 /* v.ast.BoolLiteral */) { - v__ast__Type _t12 = _const_v__ast__bool_type; + v__ast__Type _t12 = v->typ; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54224,8 +54295,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t12; } - else if (node._typ == 257 /* v.ast.CastExpr */) { - v__ast__Type _t13 = v__checker__Checker_cast_expr(c, (voidptr)&/*qq*/(*node._v__ast__CastExpr)); + else if (node._typ == 254 /* v.ast.BoolLiteral */) { + v__ast__Type _t13 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54233,6 +54304,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t13; } + else if (node._typ == 257 /* v.ast.CastExpr */) { + v__ast__Type _t14 = v__checker__Checker_cast_expr(c, (voidptr)&/*qq*/(*node._v__ast__CastExpr)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t14; + } else if (node._typ == 256 /* v.ast.CallExpr */) { v__ast__Type ret_type = v__checker__Checker_call_expr(c, (voidptr)&/*qq*/(*node._v__ast__CallExpr)); if (!v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional) && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__result)) { @@ -54250,16 +54330,7 @@ bool v__checker__Checker_expr_defer_0 = false; ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__result); } } - v__ast__Type _t14 = ret_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t14; - } - else if (node._typ == 258 /* v.ast.ChanInit */) { - v__ast__Type _t15 = v__checker__Checker_chan_init(c, (voidptr)&/*qq*/(*node._v__ast__ChanInit)); + v__ast__Type _t15 = ret_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54267,8 +54338,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t15; } - else if (node._typ == 259 /* v.ast.CharLiteral */) { - v__ast__Type _t16 = _const_v__ast__rune_type; + else if (node._typ == 258 /* v.ast.ChanInit */) { + v__ast__Type _t16 = v__checker__Checker_chan_init(c, (voidptr)&/*qq*/(*node._v__ast__ChanInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54276,8 +54347,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t16; } - else if (node._typ == 260 /* v.ast.Comment */) { - v__ast__Type _t17 = _const_v__ast__void_type; + else if (node._typ == 259 /* v.ast.CharLiteral */) { + v__ast__Type _t17 = _const_v__ast__rune_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54285,8 +54356,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t17; } - else if (node._typ == 253 /* v.ast.AtExpr */) { - v__ast__Type _t18 = v__checker__Checker_at_expr(c, (voidptr)&/*qq*/(*node._v__ast__AtExpr)); + else if (node._typ == 260 /* v.ast.Comment */) { + v__ast__Type _t18 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54294,8 +54365,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t18; } - else if (node._typ == 261 /* v.ast.ComptimeCall */) { - v__ast__Type _t19 = v__checker__Checker_comptime_call(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); + else if (node._typ == 253 /* v.ast.AtExpr */) { + v__ast__Type _t19 = v__checker__Checker_at_expr(c, (voidptr)&/*qq*/(*node._v__ast__AtExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54303,8 +54374,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t19; } - else if (node._typ == 262 /* v.ast.ComptimeSelector */) { - v__ast__Type _t20 = v__checker__Checker_comptime_selector(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeSelector)); + else if (node._typ == 261 /* v.ast.ComptimeCall */) { + v__ast__Type _t20 = v__checker__Checker_comptime_call(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54312,8 +54383,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t20; } - else if (node._typ == 264 /* v.ast.ConcatExpr */) { - v__ast__Type _t21 = v__checker__Checker_concat_expr(c, (voidptr)&/*qq*/(*node._v__ast__ConcatExpr)); + else if (node._typ == 262 /* v.ast.ComptimeSelector */) { + v__ast__Type _t21 = v__checker__Checker_comptime_selector(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeSelector)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54321,21 +54392,21 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t21; } + else if (node._typ == 264 /* v.ast.ConcatExpr */) { + v__ast__Type _t22 = v__checker__Checker_concat_expr(c, (voidptr)&/*qq*/(*node._v__ast__ConcatExpr)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t22; + } else if (node._typ == 265 /* v.ast.DumpExpr */) { (*node._v__ast__DumpExpr).expr_type = v__checker__Checker_expr(c, (*node._v__ast__DumpExpr).expr); v__checker__Checker_check_expr_opt_call(c, (*node._v__ast__DumpExpr).expr, (*node._v__ast__DumpExpr).expr_type); int etidx = v__ast__Type_idx((*node._v__ast__DumpExpr).expr_type); if (etidx == _const_v__ast__void_type_idx) { v__checker__Checker_error(c, _SLIT("dump expression can not be void"), v__ast__Expr_pos((*node._v__ast__DumpExpr).expr)); - v__ast__Type _t22 = _const_v__ast__void_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t22; - } else if (etidx == _const_v__ast__char_type_idx && v__ast__Type_nr_muls((*node._v__ast__DumpExpr).expr_type) == 0) { - v__checker__Checker_error(c, _SLIT("`char` values cannot be dumped directly, use dump(u8(x)) or dump(int(x)) instead"), v__ast__Expr_pos((*node._v__ast__DumpExpr).expr)); v__ast__Type _t23 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54343,20 +54414,20 @@ bool v__checker__Checker_expr_defer_0 = false; } // Defer end return _t23; + } else if (etidx == _const_v__ast__char_type_idx && v__ast__Type_nr_muls((*node._v__ast__DumpExpr).expr_type) == 0) { + v__checker__Checker_error(c, _SLIT("`char` values cannot be dumped directly, use dump(u8(x)) or dump(int(x)) instead"), v__ast__Expr_pos((*node._v__ast__DumpExpr).expr)); + v__ast__Type _t24 = _const_v__ast__void_type; + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t24; } v__ast__TypeSymbol* tsym = v__ast__Table_sym(c->table, (*node._v__ast__DumpExpr).expr_type); map_set(&c->table->dumps, &(int[]){((int)((*node._v__ast__DumpExpr).expr_type))}, &(string[]) { tsym->cname }); (*node._v__ast__DumpExpr).cname = tsym->cname; - v__ast__Type _t24 = (*node._v__ast__DumpExpr).expr_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t24; - } - else if (node._typ == 267 /* v.ast.EnumVal */) { - v__ast__Type _t25 = v__checker__Checker_enum_val(c, (voidptr)&/*qq*/(*node._v__ast__EnumVal)); + v__ast__Type _t25 = (*node._v__ast__DumpExpr).expr_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54364,8 +54435,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t25; } - else if (node._typ == 268 /* v.ast.FloatLiteral */) { - v__ast__Type _t26 = _const_v__ast__float_literal_type; + else if (node._typ == 267 /* v.ast.EnumVal */) { + v__ast__Type _t26 = v__checker__Checker_enum_val(c, (voidptr)&/*qq*/(*node._v__ast__EnumVal)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54373,8 +54444,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t26; } - else if (node._typ == 269 /* v.ast.GoExpr */) { - v__ast__Type _t27 = v__checker__Checker_go_expr(c, (voidptr)&/*qq*/(*node._v__ast__GoExpr)); + else if (node._typ == 268 /* v.ast.FloatLiteral */) { + v__ast__Type _t27 = _const_v__ast__float_literal_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54382,8 +54453,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t27; } - else if (node._typ == 270 /* v.ast.Ident */) { - v__ast__Type _t28 = v__checker__Checker_ident(c, (voidptr)&/*qq*/(*node._v__ast__Ident)); + else if (node._typ == 269 /* v.ast.GoExpr */) { + v__ast__Type _t28 = v__checker__Checker_go_expr(c, (voidptr)&/*qq*/(*node._v__ast__GoExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54391,8 +54462,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t28; } - else if (node._typ == 271 /* v.ast.IfExpr */) { - v__ast__Type _t29 = v__checker__Checker_if_expr(c, (voidptr)&/*qq*/(*node._v__ast__IfExpr)); + else if (node._typ == 270 /* v.ast.Ident */) { + v__ast__Type _t29 = v__checker__Checker_ident(c, (voidptr)&/*qq*/(*node._v__ast__Ident)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54400,6 +54471,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t29; } + else if (node._typ == 271 /* v.ast.IfExpr */) { + v__ast__Type _t30 = v__checker__Checker_if_expr(c, (voidptr)&/*qq*/(*node._v__ast__IfExpr)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t30; + } else if (node._typ == 272 /* v.ast.IfGuardExpr */) { bool old_inside_if_guard = c->inside_if_guard; c->inside_if_guard = true; @@ -54427,16 +54507,7 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_error(c, _SLIT("expression should either return an option or a result"), v__ast__Expr_pos((*node._v__ast__IfGuardExpr).expr)); } } - v__ast__Type _t30 = _const_v__ast__bool_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t30; - } - else if (node._typ == 273 /* v.ast.IndexExpr */) { - v__ast__Type _t31 = v__checker__Checker_index_expr(c, (voidptr)&/*qq*/(*node._v__ast__IndexExpr)); + v__ast__Type _t31 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54444,8 +54515,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t31; } - else if (node._typ == 274 /* v.ast.InfixExpr */) { - v__ast__Type _t32 = v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*node._v__ast__InfixExpr)); + else if (node._typ == 273 /* v.ast.IndexExpr */) { + v__ast__Type _t32 = v__checker__Checker_index_expr(c, (voidptr)&/*qq*/(*node._v__ast__IndexExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54453,8 +54524,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t32; } - else if (node._typ == 275 /* v.ast.IntegerLiteral */) { - v__ast__Type _t33 = v__checker__Checker_int_lit(c, (voidptr)&/*qq*/(*node._v__ast__IntegerLiteral)); + else if (node._typ == 274 /* v.ast.InfixExpr */) { + v__ast__Type _t33 = v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*node._v__ast__InfixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54462,8 +54533,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t33; } - else if (node._typ == 278 /* v.ast.LockExpr */) { - v__ast__Type _t34 = v__checker__Checker_lock_expr(c, (voidptr)&/*qq*/(*node._v__ast__LockExpr)); + else if (node._typ == 275 /* v.ast.IntegerLiteral */) { + v__ast__Type _t34 = v__checker__Checker_int_lit(c, (voidptr)&/*qq*/(*node._v__ast__IntegerLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54471,8 +54542,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t34; } - else if (node._typ == 279 /* v.ast.MapInit */) { - v__ast__Type _t35 = v__checker__Checker_map_init(c, (voidptr)&/*qq*/(*node._v__ast__MapInit)); + else if (node._typ == 278 /* v.ast.LockExpr */) { + v__ast__Type _t35 = v__checker__Checker_lock_expr(c, (voidptr)&/*qq*/(*node._v__ast__LockExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54480,8 +54551,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t35; } - else if (node._typ == 280 /* v.ast.MatchExpr */) { - v__ast__Type _t36 = v__checker__Checker_match_expr(c, (voidptr)&/*qq*/(*node._v__ast__MatchExpr)); + else if (node._typ == 279 /* v.ast.MapInit */) { + v__ast__Type _t36 = v__checker__Checker_map_init(c, (voidptr)&/*qq*/(*node._v__ast__MapInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54489,8 +54560,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t36; } - else if (node._typ == 286 /* v.ast.PostfixExpr */) { - v__ast__Type _t37 = v__checker__Checker_postfix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PostfixExpr)); + else if (node._typ == 280 /* v.ast.MatchExpr */) { + v__ast__Type _t37 = v__checker__Checker_match_expr(c, (voidptr)&/*qq*/(*node._v__ast__MatchExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54498,8 +54569,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t37; } - else if (node._typ == 287 /* v.ast.PrefixExpr */) { - v__ast__Type _t38 = v__checker__Checker_prefix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PrefixExpr)); + else if (node._typ == 286 /* v.ast.PostfixExpr */) { + v__ast__Type _t38 = v__checker__Checker_postfix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PostfixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54507,8 +54578,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t38; } - else if (node._typ == 282 /* v.ast.None */) { - v__ast__Type _t39 = _const_v__ast__none_type; + else if (node._typ == 287 /* v.ast.PrefixExpr */) { + v__ast__Type _t39 = v__checker__Checker_prefix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PrefixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54516,8 +54587,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t39; } - else if (node._typ == 284 /* v.ast.OrExpr */) { - v__ast__Type _t40 = _const_v__ast__void_type; + else if (node._typ == 282 /* v.ast.None */) { + v__ast__Type _t40 = _const_v__ast__none_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54525,11 +54596,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t40; } - else if (node._typ == 285 /* v.ast.ParExpr */) { - if (((*node._v__ast__ParExpr).expr)._typ == 285 /* v.ast.ParExpr */) { - v__checker__Checker_warn(c, _SLIT("redundant parentheses are used"), (*node._v__ast__ParExpr).pos); - } - v__ast__Type _t41 = v__checker__Checker_expr(c, (*node._v__ast__ParExpr).expr); + else if (node._typ == 284 /* v.ast.OrExpr */) { + v__ast__Type _t41 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54537,8 +54605,11 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t41; } - else if (node._typ == 288 /* v.ast.RangeExpr */) { - v__ast__Type _t42 = _const_v__ast__void_type; + else if (node._typ == 285 /* v.ast.ParExpr */) { + if (((*node._v__ast__ParExpr).expr)._typ == 285 /* v.ast.ParExpr */) { + v__checker__Checker_warn(c, _SLIT("redundant parentheses are used"), (*node._v__ast__ParExpr).pos); + } + v__ast__Type _t42 = v__checker__Checker_expr(c, (*node._v__ast__ParExpr).expr); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54546,8 +54617,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t42; } - else if (node._typ == 289 /* v.ast.SelectExpr */) { - v__ast__Type _t43 = v__checker__Checker_select_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectExpr)); + else if (node._typ == 288 /* v.ast.RangeExpr */) { + v__ast__Type _t43 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54555,8 +54626,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t43; } - else if (node._typ == 290 /* v.ast.SelectorExpr */) { - v__ast__Type _t44 = v__checker__Checker_selector_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectorExpr)); + else if (node._typ == 289 /* v.ast.SelectExpr */) { + v__ast__Type _t44 = v__checker__Checker_select_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54564,11 +54635,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t44; } - else if (node._typ == 291 /* v.ast.SizeOf */) { - if (!(*node._v__ast__SizeOf).is_type) { - (*node._v__ast__SizeOf).typ = v__checker__Checker_expr(c, (*node._v__ast__SizeOf).expr); - } - v__ast__Type _t45 = _const_v__ast__u32_type; + else if (node._typ == 290 /* v.ast.SelectorExpr */) { + v__ast__Type _t45 = v__checker__Checker_selector_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectorExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54576,11 +54644,11 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t45; } - else if (node._typ == 276 /* v.ast.IsRefType */) { - if (!(*node._v__ast__IsRefType).is_type) { - (*node._v__ast__IsRefType).typ = v__checker__Checker_expr(c, (*node._v__ast__IsRefType).expr); + else if (node._typ == 291 /* v.ast.SizeOf */) { + if (!(*node._v__ast__SizeOf).is_type) { + (*node._v__ast__SizeOf).typ = v__checker__Checker_expr(c, (*node._v__ast__SizeOf).expr); } - v__ast__Type _t46 = _const_v__ast__bool_type; + v__ast__Type _t46 = _const_v__ast__u32_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54588,8 +54656,11 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t46; } - else if (node._typ == 283 /* v.ast.OffsetOf */) { - v__ast__Type _t47 = v__checker__Checker_offset_of(c, (*node._v__ast__OffsetOf)); + else if (node._typ == 276 /* v.ast.IsRefType */) { + if (!(*node._v__ast__IsRefType).is_type) { + (*node._v__ast__IsRefType).typ = v__checker__Checker_expr(c, (*node._v__ast__IsRefType).expr); + } + v__ast__Type _t47 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54597,8 +54668,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t47; } - else if (node._typ == 292 /* v.ast.SqlExpr */) { - v__ast__Type _t48 = v__checker__Checker_sql_expr(c, (voidptr)&/*qq*/(*node._v__ast__SqlExpr)); + else if (node._typ == 283 /* v.ast.OffsetOf */) { + v__ast__Type _t48 = v__checker__Checker_offset_of(c, (*node._v__ast__OffsetOf)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54606,26 +54677,26 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t48; } - else if (node._typ == 294 /* v.ast.StringLiteral */) { - if ((*node._v__ast__StringLiteral).language == v__ast__Language__c) { - v__ast__Type _t49 = v__ast__Type_set_nr_muls(_const_v__ast__byte_type, 1); - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t49; - } - v__ast__Type _t50 = v__checker__Checker_string_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringLiteral)); + else if (node._typ == 292 /* v.ast.SqlExpr */) { + v__ast__Type _t49 = v__checker__Checker_sql_expr(c, (voidptr)&/*qq*/(*node._v__ast__SqlExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t50; + return _t49; } - else if (node._typ == 293 /* v.ast.StringInterLiteral */) { - v__ast__Type _t51 = v__checker__Checker_string_inter_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringInterLiteral)); + else if (node._typ == 294 /* v.ast.StringLiteral */) { + if ((*node._v__ast__StringLiteral).language == v__ast__Language__c) { + v__ast__Type _t50 = v__ast__Type_set_nr_muls(_const_v__ast__byte_type, 1); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t50; + } + v__ast__Type _t51 = v__checker__Checker_string_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54633,26 +54704,26 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t51; } - else if (node._typ == 295 /* v.ast.StructInit */) { - if ((*node._v__ast__StructInit).unresolved) { - v__ast__Type _t52 = v__checker__Checker_expr(c, v__ast__resolve_init((*node._v__ast__StructInit), v__checker__Checker_unwrap_generic(c, (*node._v__ast__StructInit).typ), c->table)); - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t52; - } - v__ast__Type _t53 = v__checker__Checker_struct_init(c, (voidptr)&/*qq*/(*node._v__ast__StructInit)); + else if (node._typ == 293 /* v.ast.StringInterLiteral */) { + v__ast__Type _t52 = v__checker__Checker_string_inter_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringInterLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t53; + return _t52; } - else if (node._typ == 296 /* v.ast.TypeNode */) { - v__ast__Type _t54 = (*node._v__ast__TypeNode).typ; + else if (node._typ == 295 /* v.ast.StructInit */) { + if ((*node._v__ast__StructInit).unresolved) { + v__ast__Type _t53 = v__checker__Checker_expr(c, v__ast__resolve_init((*node._v__ast__StructInit), v__checker__Checker_unwrap_generic(c, (*node._v__ast__StructInit).typ), c->table)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t53; + } + v__ast__Type _t54 = v__checker__Checker_struct_init(c, (voidptr)&/*qq*/(*node._v__ast__StructInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54660,9 +54731,11 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t54; } - else if (node._typ == 297 /* v.ast.TypeOf */) { - (*node._v__ast__TypeOf).expr_type = v__checker__Checker_expr(c, (*node._v__ast__TypeOf).expr); - v__ast__Type _t55 = _const_v__ast__string_type; + else if (node._typ == 296 /* v.ast.TypeNode */) { + if (!c->inside_x_is_type && v__ast__Type_has_flag((*node._v__ast__TypeNode).typ, v__ast__TypeFlag__generic) && c->table->cur_fn != 0 && c->table->cur_fn->generic_names.len == 0) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected generic variable in non-generic function `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__TypeNode).pos); + } + v__ast__Type _t55 = (*node._v__ast__TypeNode).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54670,8 +54743,9 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t55; } - else if (node._typ == 298 /* v.ast.UnsafeExpr */) { - v__ast__Type _t56 = v__checker__Checker_unsafe_expr(c, (voidptr)&/*qq*/(*node._v__ast__UnsafeExpr)); + else if (node._typ == 297 /* v.ast.TypeOf */) { + (*node._v__ast__TypeOf).expr_type = v__checker__Checker_expr(c, (*node._v__ast__TypeOf).expr); + v__ast__Type _t56 = _const_v__ast__string_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -54679,6 +54753,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t56; } + else if (node._typ == 298 /* v.ast.UnsafeExpr */) { + v__ast__Type _t57 = v__checker__Checker_unsafe_expr(c, (voidptr)&/*qq*/(*node._v__ast__UnsafeExpr)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t57; + } else if (node._typ == 277 /* v.ast.Likely */) { v__ast__Type ltype = v__checker__Checker_expr(c, (*node._v__ast__Likely).expr); if (!v__checker__Checker_check_types(c, ltype, _const_v__ast__bool_type)) { @@ -54686,22 +54769,22 @@ bool v__checker__Checker_expr_defer_0 = false; string lname = ((*node._v__ast__Likely).is_likely ? (_SLIT("_likely_")) : (_SLIT("_unlikely_"))); v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = lname}}, {_SLIT("()` expects a boolean expression, instead it got `"), /*115 &string*/0xfe10, {.d_s = ltype_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__Likely).pos); } - v__ast__Type _t57 = _const_v__ast__bool_type; + v__ast__Type _t58 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t57; + return _t58; } ; - v__ast__Type _t58 = _const_v__ast__void_type; + v__ast__Type _t59 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t58; + return _t59; } v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastExpr* node) { @@ -54871,7 +54954,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE } if (_t3.state == 0) { - v__ast__EnumDecl enum_decl = *(v__ast__EnumDecl*)_t3.data; + v__ast__EnumDecl enum_decl = (*(v__ast__EnumDecl*)_t3.data); bool in_range = false; if (enum_decl.is_flag) { int max_val = (1 << enum_decl.fields.len) - 1; @@ -55550,8 +55633,8 @@ v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__Po string typ_str = v__ast__Table_type_to_str(c->table, typ); v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid operation: "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" (non-numeric type `"), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); } else { - multi_return_string_v__token__Pos mr_97509 = v__checker__Checker_fail_if_immutable(c, node->expr); - node->auto_locked = mr_97509.arg0; + multi_return_string_v__token__Pos mr_97972 = v__checker__Checker_fail_if_immutable(c, node->expr); + node->auto_locked = mr_97972.arg0; } v__ast__Type _t1 = typ; return _t1; @@ -56294,7 +56377,9 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr } VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Checker* c, v__ast__ComptimeCall* node) { - node->left_type = v__checker__Checker_expr(c, node->left); + if ((node->left)._typ != 266 /* v.ast.EmptyExpr */) { + node->left_type = v__checker__Checker_expr(c, node->left); + } if (string__eq(node->method_name, _SLIT("compile_error"))) { v__checker__Checker_error(c, node->args_var, node->pos); v__ast__Type _t1 = _const_v__ast__void_type; @@ -56339,7 +56424,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check if (node->is_vweb) { v__ast__FnDecl* save_cur_fn = c->table->cur_fn; v__pref__Preferences *pref_ = HEAP(v__pref__Preferences, (*c->pref)); - v__pref__Preferences* pref2 = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){(*(pref_)).cache_manager,(*(pref_)).profile_fns,(*(pref_)).lookup_path,(*(pref_)).run_only,(*(pref_)).compile_defines,(*(pref_)).compile_defines_all,(*(pref_)).run_args,(*(pref_)).printfn_list,(*(pref_)).cleanup_files,(*(pref_)).build_options,(*(pref_)).test_runner,(*(pref_)).profile_file,(*(pref_)).dump_c_flags,(*(pref_)).dump_modules,(*(pref_)).dump_files,(*(pref_)).cflags,(*(pref_)).ccompiler,(*(pref_)).third_party_option,(*(pref_)).bare_builtin_dir,(*(pref_)).custom_prelude,(*(pref_)).cmain,(*(pref_)).vroot,(*(pref_)).out_name_c,(*(pref_)).out_name,(*(pref_)).path,(*(pref_)).message_limit,(*(pref_)).checker_match_exhaustive_cutoff_limit,(*(pref_)).thread_stack_size,(*(pref_)).os,(*(pref_)).arch,(*(pref_)).backend,(*(pref_)).ccompiler_type,(*(pref_)).gc_mode,(*(pref_)).use_color,(*(pref_)).assert_failure_mode,(*(pref_)).build_mode,(*(pref_)).output_mode,(*(pref_)).is_verbose,(*(pref_)).is_glibc,(*(pref_)).is_musl,(*(pref_)).is_test,(*(pref_)).is_script,(*(pref_)).is_vsh,(*(pref_)).is_livemain,(*(pref_)).is_liveshared,(*(pref_)).is_shared,(*(pref_)).is_o,(*(pref_)).is_prof,(*(pref_)).is_prod,(*(pref_)).is_repl,(*(pref_)).is_run,(*(pref_)).is_crun,(*(pref_)).is_debug,(*(pref_)).is_vlines,(*(pref_)).is_stats,(*(pref_)).is_fmt,(*(pref_)).is_vet,.is_vweb = true,(*(pref_)).is_ios_simulator,(*(pref_)).is_apk,(*(pref_)).is_help,(*(pref_)).is_cstrict,(*(pref_)).profile_no_inline,(*(pref_)).translated,(*(pref_)).obfuscate,(*(pref_)).sanitize,(*(pref_)).sourcemap,(*(pref_)).sourcemap_inline,(*(pref_)).sourcemap_src_included,(*(pref_)).show_cc,(*(pref_)).show_c_output,(*(pref_)).show_callgraph,(*(pref_)).show_depgraph,(*(pref_)).use_cache,(*(pref_)).retry_compilation,(*(pref_)).m64,(*(pref_)).building_v,(*(pref_)).autofree,(*(pref_)).compress,(*(pref_)).no_builtin,(*(pref_)).enable_globals,(*(pref_)).is_bare,(*(pref_)).no_preludes,(*(pref_)).output_cross_c,(*(pref_)).output_es5,(*(pref_)).prealloc,(*(pref_)).print_v_files,(*(pref_)).skip_running,(*(pref_)).skip_warnings,(*(pref_)).warn_impure_v,(*(pref_)).warns_are_errors,(*(pref_)).fatal_errors,(*(pref_)).reuse_tmpc,(*(pref_)).no_rsp,(*(pref_)).no_std,(*(pref_)).no_parallel,(*(pref_)).only_check_syntax,(*(pref_)).check_only,(*(pref_)).experimental,(*(pref_)).skip_unused,(*(pref_)).show_timings,(*(pref_)).nofloat,}, sizeof(v__pref__Preferences))); + v__pref__Preferences* pref2 = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){(*(pref_)).cache_manager,(*(pref_)).profile_fns,(*(pref_)).lookup_path,(*(pref_)).run_only,(*(pref_)).compile_defines,(*(pref_)).compile_defines_all,(*(pref_)).run_args,(*(pref_)).printfn_list,(*(pref_)).cleanup_files,(*(pref_)).build_options,(*(pref_)).test_runner,(*(pref_)).profile_file,(*(pref_)).dump_c_flags,(*(pref_)).dump_modules,(*(pref_)).dump_files,(*(pref_)).cflags,(*(pref_)).ccompiler,(*(pref_)).third_party_option,(*(pref_)).bare_builtin_dir,(*(pref_)).custom_prelude,(*(pref_)).cmain,(*(pref_)).vroot,(*(pref_)).out_name_c,(*(pref_)).out_name,(*(pref_)).path,(*(pref_)).message_limit,(*(pref_)).checker_match_exhaustive_cutoff_limit,(*(pref_)).thread_stack_size,(*(pref_)).os,(*(pref_)).arch,(*(pref_)).gc_mode,(*(pref_)).backend,(*(pref_)).ccompiler_type,(*(pref_)).use_color,(*(pref_)).assert_failure_mode,(*(pref_)).build_mode,(*(pref_)).output_mode,(*(pref_)).is_verbose,(*(pref_)).is_glibc,(*(pref_)).is_musl,(*(pref_)).is_test,(*(pref_)).is_script,(*(pref_)).is_vsh,(*(pref_)).is_livemain,(*(pref_)).is_liveshared,(*(pref_)).is_shared,(*(pref_)).is_o,(*(pref_)).is_prof,(*(pref_)).is_prod,(*(pref_)).is_repl,(*(pref_)).is_run,(*(pref_)).is_crun,(*(pref_)).is_debug,(*(pref_)).is_vlines,(*(pref_)).is_stats,(*(pref_)).is_fmt,(*(pref_)).is_vet,.is_vweb = true,(*(pref_)).is_ios_simulator,(*(pref_)).is_apk,(*(pref_)).is_help,(*(pref_)).is_cstrict,(*(pref_)).profile_no_inline,(*(pref_)).translated,(*(pref_)).obfuscate,(*(pref_)).sanitize,(*(pref_)).sourcemap,(*(pref_)).sourcemap_inline,(*(pref_)).sourcemap_src_included,(*(pref_)).show_cc,(*(pref_)).show_c_output,(*(pref_)).show_callgraph,(*(pref_)).show_depgraph,(*(pref_)).use_cache,(*(pref_)).retry_compilation,(*(pref_)).m64,(*(pref_)).building_v,(*(pref_)).autofree,(*(pref_)).compress,(*(pref_)).no_builtin,(*(pref_)).enable_globals,(*(pref_)).is_bare,(*(pref_)).no_preludes,(*(pref_)).output_cross_c,(*(pref_)).output_es5,(*(pref_)).prealloc,(*(pref_)).print_v_files,(*(pref_)).skip_running,(*(pref_)).skip_warnings,(*(pref_)).warn_impure_v,(*(pref_)).warns_are_errors,(*(pref_)).fatal_errors,(*(pref_)).reuse_tmpc,(*(pref_)).no_rsp,(*(pref_)).no_std,(*(pref_)).no_parallel,(*(pref_)).only_check_syntax,(*(pref_)).check_only,(*(pref_)).experimental,(*(pref_)).skip_unused,(*(pref_)).show_timings,(*(pref_)).nofloat,}, sizeof(v__pref__Preferences))); v__checker__Checker* c2 = v__checker__new_checker(c->table, pref2); c2->comptime_call_pos = node->pos.pos; v__checker__Checker_check(c2, (voidptr)&/*qq*/node->vweb_tmpl); @@ -56462,8 +56547,8 @@ VV_LOCAL_SYMBOL _option_v__ast__ComptTimeConstValue v__checker__Checker_eval_com return _t2; } else if (expr._typ == 291 /* v.ast.SizeOf */) { - multi_return_int_int mr_4820 = v__ast__Table_type_size(c->table, (*expr._v__ast__SizeOf).typ); - int s = mr_4820.arg0; + multi_return_int_int mr_4858 = v__ast__Table_type_size(c->table, (*expr._v__ast__SizeOf).typ); + int s = mr_4858.arg0; _option_v__ast__ComptTimeConstValue _t3; opt_ok2(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(&s) }, (_option*)(&_t3), sizeof(v__ast__ComptTimeConstValue)); return _t3; @@ -57650,10 +57735,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_verify_all_vweb_routes(v__checker__Chec for (int _t2 = 0; _t2 < sym_app->methods.len; ++_t2) { v__ast__Fn m = ((v__ast__Fn*)sym_app->methods.data)[_t2]; if (m.return_type == typ_vweb_result) { - multi_return_bool_int_int mr_10935 = v__checker__Checker_verify_vweb_params_for_method(c, m); - bool is_ok = mr_10935.arg0; - int nroute_attributes = mr_10935.arg1; - int nargs = mr_10935.arg2; + multi_return_bool_int_int mr_10973 = v__checker__Checker_verify_vweb_params_for_method(c, m); + bool is_ok = mr_10973.arg0; + int nroute_attributes = mr_10973.arg1; + int nargs = mr_10973.arg2; if (!is_ok) { v__ast__FnDecl* f = ((v__ast__FnDecl*)(m.source_fn)); if (isnil(f)) { @@ -58851,7 +58936,11 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr; if ((expr)._typ == 296 /* v.ast.TypeNode */) { - v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, (*expr._v__ast__TypeNode).typ)); + v__ast__Type unwrapped_typ = v__checker__Checker_unwrap_generic(c, (*expr._v__ast__TypeNode).typ); + if (v__ast__Table_sym(c->table, (*expr._v__ast__TypeNode).typ)->kind == v__ast__Kind__struct_ && v__ast__Type_has_flag((*expr._v__ast__TypeNode).typ, v__ast__TypeFlag__generic)) { + unwrapped_typ = v__ast__Table_unwrap_generic_type(c->table, (*expr._v__ast__TypeNode).typ, c->table->cur_fn->generic_names, c->table->cur_concrete_types); + } + v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, unwrapped_typ); if (v__ast__Table_known_type(c->table, sym->name) && sym->kind != v__ast__Kind__placeholder) { v__ast__Kind kind = sym->kind; if ((sym->info)._typ == 436 /* v.ast.Alias */) { @@ -59188,9 +59277,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("function with `shared` arguments cannot be called inside `lock`/`rlock` block"), call_arg->pos); } if (call_arg->is_mut) { - multi_return_string_v__token__Pos mr_28998 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); - string to_lock = mr_28998.arg0; - v__token__Pos pos = mr_28998.arg1; + multi_return_string_v__token__Pos mr_29240 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); + string to_lock = mr_29240.arg0; + v__token__Pos pos = mr_29240.arg1; if (!v__ast__Expr_is_lvalue(call_arg->expr)) { v__checker__Checker_error(c, _SLIT("cannot pass expression as `mut`"), v__ast__Expr_pos(call_arg->expr)); } @@ -59230,7 +59319,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } continue; } - if (v__ast__Type_is_ptr(param.typ) && !param.is_mut && !v__ast__Type_is_real_pointer(call_arg->typ) && v__ast__Expr_is_literal(call_arg->expr) && func.language == v__ast__Language__v) { + if (v__ast__Type_is_ptr(param.typ) && !param.is_mut && !v__ast__Type_is_real_pointer(call_arg->typ) && v__ast__Expr_is_literal(call_arg->expr) && func.language == v__ast__Language__v && !c->pref->translated) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("literal argument cannot be passed as reference parameter `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, param.typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); } _option_void _t32 = v__checker__Checker_check_expected_call_arg(c, arg_typ, v__checker__Checker_unwrap_generic(c, param.typ), node->language, *call_arg); @@ -59506,14 +59595,14 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal has_method = true; } else { IError err = _t17.err; - if (left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_) { + if (final_left_sym->kind == v__ast__Kind__struct_ || final_left_sym->kind == v__ast__Kind__sum_type || final_left_sym->kind == v__ast__Kind__interface_) { v__ast__Type parent_type = _const_v__ast__void_type; - if ((left_sym->info)._typ == 420 /* v.ast.Struct */) { - parent_type = (*left_sym->info._v__ast__Struct).parent_type; - } else if ((left_sym->info)._typ == 440 /* v.ast.SumType */) { - parent_type = (*left_sym->info._v__ast__SumType).parent_type; - } else if ((left_sym->info)._typ == 439 /* v.ast.Interface */) { - parent_type = (*left_sym->info._v__ast__Interface).parent_type; + if ((final_left_sym->info)._typ == 420 /* v.ast.Struct */) { + parent_type = (*final_left_sym->info._v__ast__Struct).parent_type; + } else if ((final_left_sym->info)._typ == 440 /* v.ast.SumType */) { + parent_type = (*final_left_sym->info._v__ast__SumType).parent_type; + } else if ((final_left_sym->info)._typ == 439 /* v.ast.Interface */) { + parent_type = (*final_left_sym->info._v__ast__Interface).parent_type; } if (parent_type != 0) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, parent_type); @@ -59529,7 +59618,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (!has_method) { has_method = true; Array_v__ast__Type embed_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - _option_multi_return_v__ast__Fn_Array_v__ast__Type _t19 = v__ast__Table_find_method_from_embeds(c->table, left_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t19 = v__ast__Table_find_method_from_embeds(c->table, final_left_sym, method_name); if (_t19.state != 0) { /*or block*/ IError err = _t19.err; if ((IError_name_table[err._typ]._method_msg(err._object)).len != 0) { @@ -59539,20 +59628,20 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal *(multi_return_v__ast__Fn_Array_v__ast__Type*) _t19.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_43216 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t19.data); - method = mr_43216.arg0; - embed_types = mr_43216.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_43522 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t19.data); + method = mr_43522.arg0; + embed_types = mr_43522.arg1; if (embed_types.len != 0) { is_method_from_embed = true; node->from_embed_types = embed_types; } } - if (left_sym->kind == v__ast__Kind__aggregate) { + if (final_left_sym->kind == v__ast__Kind__aggregate) { unknown_method_msg = IError_name_table[err._typ]._method_msg(err._object); } } if (has_method) { - v__ast__TypeSymbol* rec_sym = v__ast__Table_sym(c->table, node->left_type); + v__ast__TypeSymbol* rec_sym = v__ast__Table_final_sym(c->table, node->left_type); bool rec_is_generic = v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic); Array_v__ast__Type rec_concrete_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); if ((rec_sym->info)._typ == 420 /* v.ast.Struct */) { @@ -59589,9 +59678,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__checker__Checker_error(c, _SLIT("method with `shared` receiver cannot be called inside `lock`/`rlock` block"), node->pos); } if ((*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).is_mut) { - multi_return_string_v__token__Pos mr_45526 = v__checker__Checker_fail_if_immutable(c, node->left); - string to_lock = mr_45526.arg0; - v__token__Pos pos = mr_45526.arg1; + multi_return_string_v__token__Pos mr_45850 = v__checker__Checker_fail_if_immutable(c, node->left); + string to_lock = mr_45850.arg0; + v__token__Pos pos = mr_45850.arg1; if (!v__ast__Expr_is_lvalue(node->left)) { v__checker__Checker_error(c, _SLIT("cannot pass expression as `mut`"), v__ast__Expr_pos(node->left)); } @@ -59699,9 +59788,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__checker__Checker_error(c, _SLIT("method with `shared` arguments cannot be called inside `lock`/`rlock` block"), arg->pos); } if (arg->is_mut) { - multi_return_string_v__token__Pos mr_49428 = v__checker__Checker_fail_if_immutable(c, arg->expr); - string to_lock = mr_49428.arg0; - v__token__Pos pos = mr_49428.arg1; + multi_return_string_v__token__Pos mr_49752 = v__checker__Checker_fail_if_immutable(c, arg->expr); + string to_lock = mr_49752.arg0; + v__token__Pos pos = mr_49752.arg1; if (!param_is_mut) { string tok = v__ast__ShareType_str(arg->share); v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` is not `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("`, `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("` is not needed`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); @@ -59751,7 +59840,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } continue; } - if (v__ast__Type_is_ptr(param.typ) && !v__ast__Type_is_real_pointer(arg->typ) && v__ast__Expr_is_literal(arg->expr)) { + if (v__ast__Type_is_ptr(param.typ) && !v__ast__Type_is_real_pointer(arg->typ) && v__ast__Expr_is_literal(arg->expr) && !c->pref->translated) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("literal argument cannot be passed as reference parameter `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, param.typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); } _option_void _t31 = v__checker__Checker_check_expected_call_arg(c, got_arg_typ, exp_arg_typ, node->language, *arg); @@ -59888,8 +59977,8 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal return _t44; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_56878 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t43.data); - node->from_embed_types = mr_56878.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_57228 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t43.data); + node->from_embed_types = mr_57228.arg1; v__ast__Type _t45 = info.func.return_type; return _t45; } @@ -60510,9 +60599,11 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_stmt(v__checker__Checker* c, v__ast c->in_for_count++; string prev_loop_label = c->loop_label; c->expected_type = _const_v__ast__bool_type; - v__ast__Type typ = v__checker__Checker_expr(c, node->cond); - if (!node->is_inf && v__ast__Type_idx(typ) != _const_v__ast__bool_type_idx && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, _SLIT("non-bool used as for condition"), node->pos); + if ((node->cond)._typ != 266 /* v.ast.EmptyExpr */) { + v__ast__Type typ = v__checker__Checker_expr(c, node->cond); + if (!node->is_inf && v__ast__Type_idx(typ) != _const_v__ast__bool_type_idx && !c->pref->translated && !c->file->is_translated) { + v__checker__Checker_error(c, _SLIT("non-bool used as for condition"), node->pos); + } } if ((node->cond)._typ == 274 /* v.ast.InfixExpr */) { if ((*node->cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { @@ -60861,7 +60952,13 @@ v__ast__Type former_expected_type; v__ast__Type left_type = v__checker__Checker_expr(c, node->left); node->left_type = left_type; c->expected_type = left_type; + if (node->op == v__token__Kind__key_is) { + c->inside_x_is_type = true; + } v__ast__Type right_type = v__checker__Checker_expr(c, node->right); + if (node->op == v__token__Kind__key_is) { + c->inside_x_is_type = false; + } node->right_type = right_type; if (v__ast__Type_is_number(left_type) && !v__ast__Type_is_ptr(left_type) && (v__ast__Type_alias_eq(right_type, _const_v__ast__int_literal_type) || v__ast__Type_alias_eq(right_type, _const_v__ast__float_literal_type))) { node->right_type = left_type; @@ -60943,10 +61040,10 @@ v__ast__Type former_expected_type; v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("negative value cannot be compared with `"), /*115 &string*/0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node->left._v__ast__IntegerLiteral).pos); } } else if (is_left_type_signed != is_right_type_signed && left_type != _const_v__ast__int_literal_type_idx && right_type != _const_v__ast__int_literal_type_idx) { - multi_return_int_int mr_3899 = v__ast__Table_type_size(c->table, left_type); - int ls = mr_3899.arg0; - multi_return_int_int mr_3942 = v__ast__Table_type_size(c->table, right_type); - int rs = mr_3942.arg0; + multi_return_int_int mr_4013 = v__ast__Table_type_size(c->table, left_type); + int ls = mr_4013.arg0; + multi_return_int_int mr_4056 = v__ast__Table_type_size(c->table, right_type); + int rs = mr_4056.arg0; if (!c->pref->translated && ((is_left_type_signed && ls < rs) || (is_right_type_signed && rs < ls))) { string lt = v__ast__Table_sym(c->table, left_type)->name; string rt = v__ast__Table_sym(c->table, right_type)->name; @@ -61220,8 +61317,8 @@ v__ast__Type former_expected_type; v__checker__Checker_error(c, _SLIT("array append cannot be used in an expression"), node->pos); } v__checker__Checker_check_expr_opt_call(c, node->right, right_type); - multi_return_string_v__token__Pos mr_14744 = v__checker__Checker_fail_if_immutable(c, node->left); - node->auto_locked = mr_14744.arg0; + multi_return_string_v__token__Pos mr_14858 = v__checker__Checker_fail_if_immutable(c, node->left); + node->auto_locked = mr_14858.arg0; v__ast__Type left_value_type = v__ast__Table_value_type(c->table, v__checker__Checker_unwrap_generic(c, left_type)); v__ast__TypeSymbol* left_value_sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, left_value_type)); if (left_value_sym->kind == v__ast__Kind__interface_) { @@ -61696,7 +61793,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac } if (_t8.state == 0) { - v__ast__InterfaceDecl embed_decl = *(v__ast__InterfaceDecl*)_t8.data; + v__ast__InterfaceDecl embed_decl = (*(v__ast__InterfaceDecl*)_t8.data); for (int _t10 = 0; _t10 < embed_decl.fields.len; ++_t10) { v__ast__StructField f = ((v__ast__StructField*)embed_decl.fields.data)[_t10]; if (_IN_MAP(ADDR(string, f.name), ADDR(map, efnames))) { @@ -63734,7 +63831,7 @@ VV_LOCAL_SYMBOL bool v__transformer__IndexState_safe_access(v__transformer__Inde return _t5; } - int old = *(int*)_t3.data; + int old = (*(int*)_t3.data); if (_v_new > old) { if (old < -1) { ; @@ -63775,7 +63872,7 @@ VV_LOCAL_SYMBOL int v__transformer__IndexState_safe_offset(v__transformer__Index *(int*) _t4.data = -1; } - int _t3 = *(int*)_t4.data; + int _t3 = (*(int*)_t4.data); return _t3; } @@ -65322,7 +65419,7 @@ bool v__markused__mark_used_defer_0 = false; *(Array_v__ast__Type*) _t40.data = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); } - Array_v__ast__Type orm_connection_implementations = *(Array_v__ast__Type*)_t40.data; + Array_v__ast__Type orm_connection_implementations = (*(Array_v__ast__Type*)_t40.data); if (orm_connection_implementations.len > 0) { int _t43 = all_fns.key_values.len; for (int _t42 = 0; _t42 < _t43; ++_t42 ) { @@ -65561,7 +65658,7 @@ void v__markused__Walker_mark_const_as_used(v__markused__Walker* w, string ckey) return; } - v__ast__ConstField cfield = *(v__ast__ConstField*)_t1.data; + v__ast__ConstField cfield = (*(v__ast__ConstField*)_t1.data); v__markused__Walker_expr(w, cfield.expr); } @@ -65588,7 +65685,7 @@ void v__markused__Walker_mark_global_as_used(v__markused__Walker* w, string ckey return; } - v__ast__GlobalField gfield = *(v__ast__GlobalField*)_t1.data; + v__ast__GlobalField gfield = (*(v__ast__GlobalField*)_t1.data); v__markused__Walker_expr(w, gfield.expr); } @@ -66125,7 +66222,7 @@ void v__markused__Walker_call_expr(v__markused__Walker* w, v__ast__CallExpr* nod return; } - v__ast__FnDecl stmt = *(v__ast__FnDecl*)_t2.data; + v__ast__FnDecl stmt = (*(v__ast__FnDecl*)_t2.data); if (string__eq(stmt.name, node->name)) { if (!node->is_method || (v__ast__Type_alias_eq(node->receiver_type, stmt.receiver.typ))) { v__markused__Walker_stmts(w, stmt.stmts); @@ -66150,7 +66247,7 @@ void v__markused__Walker_fn_by_name(v__markused__Walker* w, string fn_name) { return; } - v__ast__FnDecl stmt = *(v__ast__FnDecl*)_t1.data; + v__ast__FnDecl stmt = (*(v__ast__FnDecl*)_t1.data); v__markused__Walker_mark_fn_as_used(w, fn_name); v__markused__Walker_stmts(w, stmt.stmts); } @@ -66394,7 +66491,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ } if (is_default_array) { v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_expr(g, node.default_expr); + v__gen__c__Gen_write(g, v__gen__c__Gen_type_default(g, node.elem_type)); v__gen__c__Gen_write(g, _SLIT("}[0])")); } else if (node.has_len && v__ast__Type_alias_eq(node.elem_type, _const_v__ast__string_type)) { v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); @@ -66512,8 +66609,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal g->infix_left_var_name = _SLIT(""); g->indent++; } - v__ast__Type left_type = (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) ? (v__ast__Type_deref(v__ast__Type_clear_flag(node.left_type, v__ast__TypeFlag__shared_f))) : (node.left_type)); + v__ast__Type left_type = (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) ? (v__ast__Type_deref(v__ast__Type_clear_flag(node.left_type, v__ast__TypeFlag__shared_f))) : v__ast__Type_is_ptr(node.left_type) ? (v__ast__Type_deref(node.left_type)) : (node.left_type)); v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, left_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + if (!v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) && v__ast__Type_is_ptr(node.left_type)) { + v__gen__c__Gen_write(g, _SLIT("*")); + } v__gen__c__Gen_expr(g, node.left); if (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("->val")); @@ -67535,7 +67635,7 @@ string sref_name; *(v__ast__Type*) _t1.data = var_type; } - var_type = *(v__ast__Type*)_t1.data; + var_type = (*(v__ast__Type*)_t1.data); (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = var_type; } } @@ -67554,7 +67654,7 @@ string sref_name; *(v__ast__Type*) _t3.data = var_type; } - var_type = *(v__ast__Type*)_t3.data; + var_type = (*(v__ast__Type*)_t3.data); (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = var_type; } is_auto_heap = (*(*left->_v__ast__Ident).obj._v__ast__Var).is_auto_heap; @@ -72080,7 +72180,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { ; } - v__ast__Stmt* x = *(v__ast__Stmt**)_t1.data; + v__ast__Stmt* x = (*(v__ast__Stmt**)_t1.data); if (x->_typ == 311 /* v.ast.ForCStmt */) { if (v__ast__Scope_contains((*x->_v__ast__ForCStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); @@ -72472,7 +72572,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex v__gen__c__Gen_expr(g, expr); return; } - if ((exp_sym->info)._typ == 439 /* v.ast.Interface */ && v__ast__Type_idx(got_type) != v__ast__Type_idx(expected_type) && !v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional)) { + if ((got_sym->info)._typ != 439 /* v.ast.Interface */ && (exp_sym->info)._typ == 439 /* v.ast.Interface */ && v__ast__Type_idx(got_type) != v__ast__Type_idx(expected_type) && !v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional)) { if ((expr)._typ == 295 /* v.ast.StructInit */ && !v__ast__Type_is_ptr(got_type)) { g->inside_cast_in_heap++; string got_styp = v__gen__c__Gen_cc_type(g, v__ast__Type_ref(got_type), true); @@ -73617,7 +73717,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel *(v__ast__Type*) _t1.data = name_type; } - name_type = *(v__ast__Type*)_t1.data; + name_type = (*(v__ast__Type*)_t1.data); } } } @@ -73959,11 +74059,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit string value_typ_str = v__gen__c__Gen_typ(g, unwrap_val_typ); v__ast__TypeSymbol* value_sym = v__ast__Table_sym(g->table, unwrap_val_typ); v__ast__TypeSymbol* key_sym = v__ast__Table_final_sym(g->table, unwrap_key_typ); - multi_return_string_string_string_string mr_108643 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); - string hash_fn = mr_108643.arg0; - string key_eq_fn = mr_108643.arg1; - string clone_fn = mr_108643.arg2; - string free_fn = mr_108643.arg3; + multi_return_string_string_string_string mr_108677 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); + string hash_fn = mr_108677.arg0; + string key_eq_fn = mr_108677.arg1; + string clone_fn = mr_108677.arg2; + string free_fn = mr_108677.arg3; int size = node.vals.len; string shared_styp = _SLIT(""); string styp = _SLIT(""); @@ -74268,30 +74368,32 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t2.data; - if (Array_v__ast__Attr_contains(f.attrs, _SLIT("c"))) { - name = (*(v__ast__Attr*)/*ee elem_sym */array_get(f.attrs, 0)).arg; + _option_v__ast__Attr _t3; + if (_t3 = Array_v__ast__Attr_find_first(f.attrs, _SLIT("c")), _t3.state == 0) { + v__ast__Attr cattr = *(v__ast__Attr*)_t3.data; + name = cattr.arg; } } } if (g->pref->obfuscate && string__eq(g->cur_mod.name, _SLIT("main")) && string_starts_with(name, _SLIT("main__"))) { string key = node.name; v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf identfn: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); - string* _t4 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); - _option_string _t3 = {0}; - if (_t4) { - *((string*)&_t3.data) = *((string*)_t4); + string* _t5 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); + _option_string _t4 = {0}; + if (_t5) { + *((string*)&_t4.data) = *((string*)_t5); } else { - _t3.state = 2; _t3.err = _v_error(_SLIT("array index out of range")); + _t4.state = 2; _t4.err = _v_error(_SLIT("array index out of range")); } ; - if (_t3.state != 0) { /*or block*/ - IError err = _t3.err; + if (_t4.state != 0) { /*or block*/ + IError err = _t4.err; _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } - name = *(string*)_t3.data; + name = (*(string*)_t4.data); } } v__gen__c__Gen_write(g, v__gen__c__Gen_get_ternary_name(g, name)); @@ -74768,7 +74870,14 @@ bool v__gen__c__Gen_const_decl_defer_0 = false; } } string name = v__gen__c__c_name(field.name); - string const_name = (Array_v__ast__Attr_contains(node.attrs, _SLIT("export")) && !g->is_builtin_mod ? ((*(v__ast__Attr*)/*ee elem_sym */array_get(node.attrs, 0)).arg) : (string__plus(_SLIT("_const_"), name))); + string const_name = string__plus(_SLIT("_const_"), name); + if (!g->is_builtin_mod) { + _option_v__ast__Attr _t2; + if (_t2 = Array_v__ast__Attr_find_first(node.attrs, _SLIT("export")), _t2.state == 0) { + v__ast__Attr cattr = *(v__ast__Attr*)_t2.data; + const_name = cattr.arg; + } + } v__ast__Expr field_expr = field.expr; if (field.expr._typ == 250 /* v.ast.ArrayInit */) { if ((*field.expr._v__ast__ArrayInit).is_fixed) { @@ -74804,9 +74913,9 @@ bool v__gen__c__Gen_const_decl_defer_0 = false; else { bool use_cache_mode = g->pref->build_mode == v__pref__BuildMode__build_module || g->pref->use_cache; if (!use_cache_mode) { - _option_v__ast__ComptTimeConstValue _t2; - if (_t2 = v__ast__ConstField_comptime_expr_value(&field), _t2.state == 0) { - v__ast__ComptTimeConstValue ct_value = *(v__ast__ComptTimeConstValue*)_t2.data; + _option_v__ast__ComptTimeConstValue _t3; + if (_t3 = v__ast__ConstField_comptime_expr_value(&field), _t3.state == 0) { + v__ast__ComptTimeConstValue ct_value = *(v__ast__ComptTimeConstValue*)_t3.data; if (v__gen__c__Gen_const_decl_precomputed(g, field.mod, name, ct_value, field.typ)) { continue; } @@ -75008,7 +75117,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_global_decl(v__gen__c__Gen* g, v__ast__Globa if (field.has_expr || cinit) { if (g->pref->translated) { strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))); - } else if ((v__ast__Expr_is_literal(field.expr) && should_init) || cinit) { + } else if ((v__ast__Expr_is_literal(field.expr) && should_init) || cinit || ((field.expr)._typ == 250 /* v.ast.ArrayInit */ && (/* as */ *(v__ast__ArrayInit*)__as_cast((field.expr)._v__ast__ArrayInit,(field.expr)._typ, 250) /*expected idx: 250, name: v.ast.ArrayInit */ ).is_fixed)) { strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { strings__Builder_writeln(&g->global_init, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT("; // 3global"), 0, { .d_c = 0 }}}))); @@ -75251,9 +75360,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ for (int _t3 = 0; _t3 < (*sym->info._v__ast__Struct).fields.len; ++_t3) { v__ast__StructField field = ((v__ast__StructField*)(*sym->info._v__ast__Struct).fields.data)[_t3]; if (v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__optional)) { - multi_return_string_string mr_148992 = v__gen__c__Gen_optional_type_name(g, field.typ); - string styp = mr_148992.arg0; - string base = mr_148992.arg1; + multi_return_string_string mr_149065 = v__gen__c__Gen_optional_type_name(g, field.typ); + string styp = mr_149065.arg0; + string base = mr_149065.arg1; sync__RwMutex_lock(&g->done_optionals->mtx); /*lock*/ { if (!Array_string_contains(g->done_optionals->val, base)) { @@ -75548,11 +75657,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false; if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) { string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { - multi_return_int_string_string_string mr_158856 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_158856.arg0; - string pafile = mr_158856.arg1; - string pamod = mr_158856.arg2; - string pafn = mr_158856.arg3; + multi_return_int_string_string_string mr_158929 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_158929.arg0; + string pafile = mr_158929.arg1; + string pamod = mr_158929.arg2; + string pafn = mr_158929.arg3; v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_result_not_set("), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); @@ -75575,11 +75684,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false; if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) { string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { - multi_return_int_string_string_string mr_160126 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_160126.arg0; - string pafile = mr_160126.arg1; - string pamod = mr_160126.arg2; - string pafn = mr_160126.arg3; + multi_return_int_string_string_string mr_160199 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_160199.arg0; + string pafile = mr_160199.arg1; + string pamod = mr_160199.arg2; + string pafn = mr_160199.arg3; v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_optional_not_set( "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); @@ -75689,11 +75798,11 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty { v__ast__Map info = v__ast__TypeSymbol_map_info(sym); v__ast__TypeSymbol* key_typ = v__ast__Table_sym(g->table, info.key_type); - multi_return_string_string_string_string mr_162734 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); - string hash_fn = mr_162734.arg0; - string key_eq_fn = mr_162734.arg1; - string clone_fn = mr_162734.arg2; - string free_fn = mr_162734.arg3; + multi_return_string_string_string_string mr_162807 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); + string hash_fn = mr_162807.arg0; + string key_eq_fn = mr_162807.arg1; + string clone_fn = mr_162807.arg2; + string free_fn = mr_162807.arg3; string noscan_key = v__gen__c__Gen_check_noscan(g, info.key_type); string noscan_value = v__gen__c__Gen_check_noscan(g, info.value_type); string noscan = (noscan_key.len != 0 || noscan_value.len != 0 ? (_SLIT("_noscan")) : (_SLIT(""))); @@ -75872,8 +75981,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_size_of(v__gen__c__Gen* g, v__ast__SizeOf no VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_val(v__gen__c__Gen* g, v__ast__EnumVal node) { string styp = v__gen__c__Gen_typ(g, v__ast__Table_unaliased_type(g->table, node.typ)); if (g->pref->translated && v__ast__Type_is_number(node.typ)) { - v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.typ); - v__gen__c__Gen_write(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("/* "), /*115 &v.ast.EnumVal*/0xfe10, {.d_s = v__ast__EnumVal_str(node)}}, {_SLIT(" enum val is_number "), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT(" styp="), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" sym="), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(sym)}}}))}}, {_SLIT("*/_const_main__"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_main__"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("__"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } @@ -76202,7 +76310,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { for (int _t25 = 0; _t25 < methods.len; ++_t25) { v__ast__Fn method = ((v__ast__Fn*)methods.data)[_t25]; string name = method.name; - if (v__ast__Type_has_flag(inter_info.parent_type, v__ast__TypeFlag__generic)) { + if (method.generic_names.len > 0 && v__ast__Type_has_flag(inter_info.parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, inter_info.parent_type); if (parent_sym->info._typ == 420 /* v.ast.Struct */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__Struct).concrete_types, method.name, false); @@ -76222,7 +76330,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { continue; } if ((st_sym->info)._typ == 420 /* v.ast.Struct */) { - if (v__ast__Type_has_flag((*st_sym->info._v__ast__Struct).parent_type, v__ast__TypeFlag__generic)) { + if (method.generic_names.len > 0 && v__ast__Type_has_flag((*st_sym->info._v__ast__Struct).parent_type, v__ast__TypeFlag__generic)) { name = v__gen__c__Gen_generic_fn_name(g, (*st_sym->info._v__ast__Struct).concrete_types, method.name, false); } } @@ -76235,8 +76343,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { int params_start_pos = g->out.len; Array_v__ast__Param params = array_clone_to_depth(&method.params, 0); array_set(¶ms, 0, &(v__ast__Param[]) { ((v__ast__Param){(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).name,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).type_pos,.typ = v__ast__Type_set_nr_muls(st, 1),(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_mut,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_auto_rec,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_hidden,}) }); - multi_return_Array_string_Array_string_Array_bool mr_177692 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); - Array_string fargs = mr_177692.arg0; + multi_return_Array_string_Array_string_Array_bool mr_177871 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); + Array_string fargs = mr_177871.arg0; string parameter_name = strings__Builder_cut_last(&g->out, g->out.len - params_start_pos); if (v__ast__Type_is_ptr(st)) { parameter_name = string_trim_string_left(parameter_name, _SLIT("__shared__")); @@ -76253,8 +76361,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { *(multi_return_v__ast__Fn_Array_v__ast__Type*) _t26.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_178156 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); - Array_v__ast__Type embed_types = mr_178156.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_178335 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); + Array_v__ast__Type embed_types = mr_178335.arg1; if (embed_types.len > 0 && !Array_string_contains(method_names, method.name)) { v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types))); string method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = embed_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); @@ -78193,7 +78301,7 @@ int ctmp; ; } - name = *(string*)_t7.data; + name = (*(string*)_t7.data); } if (is_livemain) { array_push((array*)&g->hotcode_fn_names, _MOV((string[]){ string_clone(name) })); @@ -78437,12 +78545,16 @@ VV_LOCAL_SYMBOL _option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__as if (node->generic_names.len > 0) { name = v__gen__c__Gen_generic_fn_name(g, g->cur_concrete_types, name, true); } - if ((g->pref->translated || g->file->is_translated) && Array_v__ast__Attr_contains(node->attrs, _SLIT("c"))) { - name = (*(v__ast__Attr*)/*ee elem_sym */array_get(node->attrs, 0)).arg; + if (g->pref->translated || g->file->is_translated) { + _option_v__ast__Attr _t2; + if (_t2 = Array_v__ast__Attr_find_first(node->attrs, _SLIT("c")), _t2.state == 0) { + v__ast__Attr cattr = *(v__ast__Attr*)_t2.data; + name = cattr.arg; + } } - _option_string _t2; - opt_ok2(&(string[]) { name }, (_option*)(&_t2), sizeof(string)); - return _t2; + _option_string _t3; + opt_ok2(&(string[]) { name }, (_option*)(&_t3), sizeof(string)); + return _t3; } VV_LOCAL_SYMBOL string v__gen__c__closure_ctx(v__ast__FnDecl node) { @@ -78920,7 +79032,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE *(v__ast__Type*) _t10.data = rec_type; } - rec_type = *(v__ast__Type*)_t10.data; + rec_type = (*(v__ast__Type*)_t10.data); v__gen__c__Gen_gen_expr_to_string(g, node.left, rec_type); return; } @@ -78952,6 +79064,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE return; } } + } else if ((node.left)._typ == 282 /* v.ast.None */) { + v__gen__c__Gen_gen_expr_to_string(g, node.left, _const_v__ast__none_type); + return; } v__gen__c__Gen_get_str_fn(g, rec_type); } else if (string__eq(node.name, _SLIT("free"))) { @@ -79019,7 +79134,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE ; } - name = *(string*)_t13.data; + name = (*(string*)_t13.data); } bool is_range_slice = false; if (v__ast__Type_is_ptr(node.receiver_type) && !v__ast__Type_is_ptr(node.left_type)) { @@ -79214,35 +79329,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t2.data; - if (Array_v__ast__Attr_contains(f.attrs, _SLIT("c"))) { - name = (*(v__ast__Attr*)/*ee elem_sym */array_get(f.attrs, 0)).arg; + _option_v__ast__Attr _t3; + if (_t3 = Array_v__ast__Attr_find_first(f.attrs, _SLIT("c")), _t3.state == 0) { + v__ast__Attr cattr = *(v__ast__Attr*)_t3.data; + name = cattr.arg; } } } if (g->pref->obfuscate && string__eq(g->cur_mod.name, _SLIT("main")) && string_starts_with(name, _SLIT("main__"))) { string key = node.name; v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf call: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); - string* _t4 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); - _option_string _t3 = {0}; - if (_t4) { - *((string*)&_t3.data) = *((string*)_t4); + string* _t5 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); + _option_string _t4 = {0}; + if (_t5) { + *((string*)&_t4.data) = *((string*)_t5); } else { - _t3.state = 2; _t3.err = _v_error(_SLIT("array index out of range")); + _t4.state = 2; _t4.err = _v_error(_SLIT("array index out of range")); } ; - if (_t3.state != 0) { /*or block*/ - IError err = _t3.err; + if (_t4.state != 0) { /*or block*/ + IError err = _t4.err; _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } - name = *(string*)_t3.data; + name = (*(string*)_t4.data); } if (!is_selector_call) { - _option_v__ast__Fn _t5; - if (_t5 = v__ast__Table_find_fn(g->table, node.name), _t5.state == 0) { - v__ast__Fn func = *(v__ast__Fn*)_t5.data; + _option_v__ast__Fn _t6; + if (_t6 = v__ast__Table_find_fn(g->table, node.name), _t6.state == 0) { + v__ast__Fn func = *(v__ast__Fn*)_t6.data; if (func.generic_names.len > 0) { if (g->comptime_for_field_type != 0 && g->inside_comptime_for_field) { name = v__gen__c__Gen_generic_fn_name(g, new_array_from_c_array(1, 1, sizeof(v__ast__Type), _MOV((v__ast__Type[1]){g->comptime_for_field_type})), name, false); @@ -79284,28 +79401,28 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr if (((*expr._v__ast__ComptimeSelector).field_expr)._typ == 290 /* v.ast.SelectorExpr */) { if (((*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 270 /* v.ast.Ident */) { string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); - v__ast__Type* _t7 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); - _option_v__ast__Type _t6 = {0}; - if (_t7) { - *((v__ast__Type*)&_t6.data) = *((v__ast__Type*)_t7); + v__ast__Type* _t8 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); + _option_v__ast__Type _t7 = {0}; + if (_t8) { + *((v__ast__Type*)&_t7.data) = *((v__ast__Type*)_t8); } else { - _t6.state = 2; _t6.err = _v_error(_SLIT("array index out of range")); + _t7.state = 2; _t7.err = _v_error(_SLIT("array index out of range")); } ; - if (_t6.state != 0) { /*or block*/ - IError err = _t6.err; - *(v__ast__Type*) _t6.data = typ; + if (_t7.state != 0) { /*or block*/ + IError err = _t7.err; + *(v__ast__Type*) _t7.data = typ; } - typ = *(v__ast__Type*)_t6.data; + typ = (*(v__ast__Type*)_t7.data); } } } else if ((expr)._typ == 261 /* v.ast.ComptimeCall */) { if (string__eq((*expr._v__ast__ComptimeCall).method_name, _SLIT("method"))) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, (*expr._v__ast__ComptimeCall).left_type)); - _option_v__ast__Fn _t8; - if (_t8 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method), _t8.state == 0) { - v__ast__Fn m = *(v__ast__Fn*)_t8.data; + _option_v__ast__Fn _t9; + if (_t9 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method), _t9.state == 0) { + v__ast__Fn m = *(v__ast__Fn*)_t9.data; typ = m.return_type; } } @@ -79329,22 +79446,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr } if (!print_auto_str) { if (g->pref->is_debug && string__eq(node.name, _SLIT("panic"))) { - multi_return_int_string_string_string mr_39829 = v__gen__c__Gen_panic_debug_info(g, node.pos); - int paline = mr_39829.arg0; - string pafile = mr_39829.arg1; - string pamod = mr_39829.arg2; - string pafn = mr_39829.arg3; + multi_return_int_string_string_string mr_39946 = v__gen__c__Gen_panic_debug_info(g, node.pos); + int paline = mr_39946.arg0; + string pafile = mr_39946.arg1; + string pamod = mr_39946.arg2; + string pafn = mr_39946.arg3; v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_call_args(g, node); v__gen__c__Gen_write(g, _SLIT(")")); } else { bool is_fn_var = false; - _option_v__ast__ScopeObject _t9; - if (_t9 = v__ast__Scope_find(node.scope, node.name), _t9.state == 0) { - v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t9.data; + _option_v__ast__ScopeObject _t10; + if (_t10 = v__ast__Scope_find(node.scope, node.name), _t10.state == 0) { + v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t10.data; if (obj._typ == 328 /* v.ast.Var */) { if ((*obj._v__ast__Var).smartcasts.len > 0) { - for (int _t10 = 0; _t10 < (*obj._v__ast__Var).smartcasts.len; ++_t10) { + for (int _t11 = 0; _t11 < (*obj._v__ast__Var).smartcasts.len; ++_t11) { v__gen__c__Gen_write(g, _SLIT("(*")); } for (int i = 0; i < (*obj._v__ast__Var).smartcasts.len; ++i) { @@ -79708,7 +79825,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no ; } - name = *(string*)_t1.data; + name = (*(string*)_t1.data); } g->empty_line = true; v__gen__c__Gen_writeln(g, _SLIT("// start go")); @@ -81184,7 +81301,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde if (!node.is_option) { v__gen__c__Gen_or_block(g, tmp_opt, node.or_expr, elem_type); } - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT("*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); } } } @@ -81945,7 +82062,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_interface_is_op(v__gen__c__Gen* g, v__as *(Array_v__ast__Type*) _t1.data = c; } - Array_v__ast__Type common_variants = *(Array_v__ast__Type*)_t1.data; + Array_v__ast__Type common_variants = (*(Array_v__ast__Type*)_t1.data); left_sym->info = v__ast__Interface_to_sumtype_v__ast__TypeInfo(&info); if (common_variants.len == 0) { v__gen__c__Gen_write(g, _SLIT("false")); @@ -88931,7 +89048,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { } if (_t19.state == 0) { - v__ast__Fn existing = *(v__ast__Fn*)_t19.data; + v__ast__Fn existing = (*(v__ast__Fn*)_t19.data); if ((existing.name).len != 0) { if (file_mode == v__ast__Language__v && existing.file_mode != v__ast__Language__v) { if (!p->pref->is_fmt) { @@ -91151,7 +91268,7 @@ bool v__parser__parse_stmt_defer_0 = false; eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> "), /*115 &string*/0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = _SLIT("parse_stmt")}}, {_SLIT(" text: "), /*115 &string*/0xfe10, {.d_s = text}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif - v__parser__Parser p = ((v__parser__Parser){.imports = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.imported_symbols = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.prev_tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.peek_tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.script_mode_start_token = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ast_imports = __new_array(0, 0, sizeof(v__ast__Import)),.used_imports = __new_array(0, 0, sizeof(string)),.auto_imports = __new_array(0, 0, sizeof(string)),.label_names = __new_array(0, 0, sizeof(string)),.global_labels = __new_array(0, 0, sizeof(string)),.defer_vars = __new_array(0, 0, sizeof(v__ast__Ident)),.struct_init_generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.if_cond_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.errors = __new_array(0, 0, sizeof(v__errors__Error)),.warnings = __new_array(0, 0, sizeof(v__errors__Warning)),.notices = __new_array(0, 0, sizeof(v__errors__Notice)),.vet_errors = __new_array(0, 0, sizeof(v__vet__Error)),.file_base = (string){.str=(byteptr)"", .is_lit=1},.file_name = (string){.str=(byteptr)"", .is_lit=1},.file_name_dir = (string){.str=(byteptr)"", .is_lit=1},.unique_prefix = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.expr_mod = (string){.str=(byteptr)"", .is_lit=1},.cur_fn_name = (string){.str=(byteptr)"", .is_lit=1},.codegen_text = (string){.str=(byteptr)"", .is_lit=1},.pref = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.backend = 0,.ccompiler_type = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))),.table = table,.scope = scope,.scanner = v__scanner__new_scanner(text, v__scanner__CommentsMode__skip_comments, ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.backend = 0,.ccompiler_type = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences)))),.expr_level = 0,.n_asm = 0,.file_backend_mode = 0,.language = 0,.fn_language = 0,.comments_mode = v__scanner__CommentsMode__skip_comments,.inside_vlib_file = 0,.inside_test_file = true,.inside_if = 0,.inside_if_expr = 0,.inside_if_cond = 0,.inside_ct_if_expr = 0,.inside_or_expr = 0,.inside_for = 0,.inside_fn = 0,.inside_fn_return = 0,.inside_unsafe_fn = 0,.inside_str_interp = 0,.inside_array_lit = 0,.inside_in_array = 0,.inside_match = 0,.inside_select = 0,.inside_match_case = 0,.inside_match_body = 0,.inside_unsafe = 0,.inside_sum_type = 0,.inside_asm_template = 0,.inside_asm = 0,.inside_defer = 0,.inside_generic_params = 0,.inside_receiver_param = 0,.inside_struct_field_decl = 0,.or_is_handled = 0,.builtin_mod = 0,.is_manualfree = 0,.has_globals = 0,.is_generated = 0,.is_translated = 0,.is_amp = 0,.returns = 0,.is_stmt_ident = 0,.expecting_type = 0,.name_error = 0,.comptime_if_cond = 0,.should_abort = 0,.script_mode = 0,}); + v__parser__Parser p = ((v__parser__Parser){.imports = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.imported_symbols = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.prev_tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.peek_tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.script_mode_start_token = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ast_imports = __new_array(0, 0, sizeof(v__ast__Import)),.used_imports = __new_array(0, 0, sizeof(string)),.auto_imports = __new_array(0, 0, sizeof(string)),.label_names = __new_array(0, 0, sizeof(string)),.global_labels = __new_array(0, 0, sizeof(string)),.defer_vars = __new_array(0, 0, sizeof(v__ast__Ident)),.struct_init_generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.if_cond_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.errors = __new_array(0, 0, sizeof(v__errors__Error)),.warnings = __new_array(0, 0, sizeof(v__errors__Warning)),.notices = __new_array(0, 0, sizeof(v__errors__Notice)),.vet_errors = __new_array(0, 0, sizeof(v__vet__Error)),.file_base = (string){.str=(byteptr)"", .is_lit=1},.file_name = (string){.str=(byteptr)"", .is_lit=1},.file_name_dir = (string){.str=(byteptr)"", .is_lit=1},.unique_prefix = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.expr_mod = (string){.str=(byteptr)"", .is_lit=1},.cur_fn_name = (string){.str=(byteptr)"", .is_lit=1},.codegen_text = (string){.str=(byteptr)"", .is_lit=1},.pref = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.gc_mode = v__pref__GarbageCollectionMode__unknown,.backend = 0,.ccompiler_type = 0,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))),.table = table,.scope = scope,.scanner = v__scanner__new_scanner(text, v__scanner__CommentsMode__skip_comments, ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.gc_mode = v__pref__GarbageCollectionMode__unknown,.backend = 0,.ccompiler_type = 0,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences)))),.expr_level = 0,.n_asm = 0,.file_backend_mode = 0,.language = 0,.fn_language = 0,.comments_mode = v__scanner__CommentsMode__skip_comments,.inside_vlib_file = 0,.inside_test_file = true,.inside_if = 0,.inside_if_expr = 0,.inside_if_cond = 0,.inside_ct_if_expr = 0,.inside_or_expr = 0,.inside_for = 0,.inside_fn = 0,.inside_fn_return = 0,.inside_unsafe_fn = 0,.inside_str_interp = 0,.inside_array_lit = 0,.inside_in_array = 0,.inside_match = 0,.inside_select = 0,.inside_match_case = 0,.inside_match_body = 0,.inside_unsafe = 0,.inside_sum_type = 0,.inside_asm_template = 0,.inside_asm = 0,.inside_defer = 0,.inside_generic_params = 0,.inside_receiver_param = 0,.inside_struct_field_decl = 0,.or_is_handled = 0,.builtin_mod = 0,.is_manualfree = 0,.has_globals = 0,.is_generated = 0,.is_translated = 0,.is_amp = 0,.returns = 0,.is_stmt_ident = 0,.expecting_type = 0,.name_error = 0,.comptime_if_cond = 0,.should_abort = 0,.script_mode = 0,}); v__parser__Parser_init_parse_fns(&p); v__util__timing_start(_SLIT("PARSE stmt")); v__parser__parse_stmt_defer_0 = true; @@ -93714,7 +93831,7 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { *(string*) _t22.data = v__parser__Parser_prepend_mod(p, enum_name); } - enum_name = *(string*)_t22.data; + enum_name = (*(string*)_t22.data); } v__parser__Parser_check(p, v__token__Kind__dot); string val = v__parser__Parser_check_name(p); @@ -97290,6 +97407,19 @@ VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__build } return; } + if (res.exit_code != 0 && v->pref->gc_mode != v__pref__GarbageCollectionMode__no_gc && string_contains(res.output, _SLIT("libgc.a"))) { + #if defined(_WIN32) + { + v__builder__verror(_SLIT("Your V installation may be out-of-date. Try removing `thirdparty\\tcc\\` and running `.\\make.bat`")); + VUNREACHABLE(); + } + #else + { + v__builder__verror(_SLIT("Your V installation may be out-of-date. Try removing `thirdparty/tcc/` and running `make`")); + VUNREACHABLE(); + } + #endif + } Array_string _t3 = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){string_clone(_const_v__builder__c_verror_message_marker), _SLIT("error: include file ")})); for (int _t4 = 0; _t4 < _t3.len; ++_t4) { string emsg_marker = ((string*)_t3.data)[_t4]; @@ -97504,10 +97634,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_ccompiler_options(v__builder__Bui Array_string only_o_files = Array_v__cflag__CFlag_c_options_only_object_files(cflags); _PUSH_MANY(&ccoptions.o_args, (only_o_files), _t40, Array_string); } - multi_return_Array_string_Array_string_Array_string mr_11728 = Array_v__cflag__CFlag_defines_others_libs(cflags); - Array_string defines = mr_11728.arg0; - Array_string others = mr_11728.arg1; - Array_string libs = mr_11728.arg2; + multi_return_Array_string_Array_string_Array_string mr_12063 = Array_v__cflag__CFlag_defines_others_libs(cflags); + Array_string defines = mr_12063.arg0; + Array_string others = mr_12063.arg1; + Array_string libs = mr_12063.arg2; _PUSH_MANY(&ccoptions.pre_args, (defines), _t41, Array_string); _PUSH_MANY(&ccoptions.pre_args, (others), _t42, Array_string); _PUSH_MANY(&ccoptions.linker_flags, (libs), _t43, Array_string); @@ -97911,10 +98041,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) v__builder__Builder_ensure_linuxroot_exists(b, sysroot); string obj_file = string__plus(b->out_name_c, _SLIT(".o")); Array_v__cflag__CFlag cflags = v__builder__Builder_get_os_cflags(b); - multi_return_Array_string_Array_string_Array_string mr_22971 = Array_v__cflag__CFlag_defines_others_libs(cflags); - Array_string defines = mr_22971.arg0; - Array_string others = mr_22971.arg1; - Array_string libs = mr_22971.arg2; + multi_return_Array_string_Array_string_Array_string mr_23306 = Array_v__cflag__CFlag_defines_others_libs(cflags); + Array_string defines = mr_23306.arg0; + Array_string others = mr_23306.arg1; + Array_string libs = mr_23306.arg2; Array_string cc_args = __new_array_with_default(0, 0, sizeof(string), 0); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-w")) })); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-fPIC")) })); diff --git a/v_win.c b/v_win.c index a1a188c..1967c07 100644 --- a/v_win.c +++ b/v_win.c @@ -1,11 +1,11 @@ -#define V_COMMIT_HASH "5b16d5fdf" +#define V_COMMIT_HASH "88d69dca7" #ifndef V_COMMIT_HASH - #define V_COMMIT_HASH "3bc50721e" + #define V_COMMIT_HASH "5b16d5fdf" #endif #ifndef V_CURRENT_COMMIT_HASH - #define V_CURRENT_COMMIT_HASH "5b16d5f" + #define V_CURRENT_COMMIT_HASH "88d69dc" #endif #define V_USE_SIGNAL_H @@ -391,6 +391,7 @@ typedef struct _option_v__pref__Arch _option_v__pref__Arch; typedef struct _option_v__pref__Backend _option_v__pref__Backend; typedef struct _option_time__StopWatch _option_time__StopWatch; typedef struct _option_v__ast__Ident _option_v__ast__Ident; +typedef struct _option_v__ast__Attr _option_v__ast__Attr; typedef struct _option_i8 _option_i8; typedef struct _option_i16 _option_i16; typedef struct _option_u16 _option_u16; @@ -1960,12 +1961,13 @@ typedef enum { } v__pref__AssertFailureMode; typedef enum { - v__pref__GarbageCollectionMode__no_gc, // - v__pref__GarbageCollectionMode__boehm_full, // +1 - v__pref__GarbageCollectionMode__boehm_incr, // +2 - v__pref__GarbageCollectionMode__boehm_full_opt, // +3 - v__pref__GarbageCollectionMode__boehm_incr_opt, // +4 - v__pref__GarbageCollectionMode__boehm_leak, // +5 + v__pref__GarbageCollectionMode__unknown, // + v__pref__GarbageCollectionMode__no_gc, // +1 + v__pref__GarbageCollectionMode__boehm_full, // +2 + v__pref__GarbageCollectionMode__boehm_incr, // +3 + v__pref__GarbageCollectionMode__boehm_full_opt, // +4 + v__pref__GarbageCollectionMode__boehm_incr_opt, // +5 + v__pref__GarbageCollectionMode__boehm_leak, // +6 } v__pref__GarbageCollectionMode; typedef enum { @@ -4231,9 +4233,9 @@ struct v__pref__Preferences { int thread_stack_size; v__pref__OS os; v__pref__Arch arch; + v__pref__GarbageCollectionMode gc_mode; v__pref__Backend backend; v__pref__CompilerType ccompiler_type; - v__pref__GarbageCollectionMode gc_mode; v__pref__ColorOutput use_color; v__pref__AssertFailureMode assert_failure_mode; v__pref__BuildMode build_mode; @@ -6141,6 +6143,7 @@ struct v__checker__Checker { bool inside_defer; bool inside_fn_arg; bool inside_ct_attr; + bool inside_x_is_type; bool inside_comptime_for_field; bool skip_flags; bool is_last_stmt; @@ -6658,6 +6661,12 @@ struct _option_v__ast__Ident { byte data[sizeof(v__ast__Ident) > 0 ? sizeof(v__ast__Ident) : 1]; }; +struct _option_v__ast__Attr { + byte state; + IError err; + byte data[sizeof(v__ast__Attr) > 0 ? sizeof(v__ast__Attr) : 1]; +}; + struct _option_i8 { byte state; IError err; @@ -6875,6 +6884,7 @@ string strings__repeat_string(string s, int n); string strings__find_between_pair_u8(string input, u8 start, u8 end); string strings__find_between_pair_rune(string input, rune start, rune end); string strings__find_between_pair_string(string input, string start, string end); +Array_string strings__split_capital(string s); u32 _const_math__bits__de_bruijn32 = 125613361; // precomputed Array_u8 _const_math__bits__de_bruijn32tab; // inited later u64 _const_math__bits__de_bruijn64 = 285870213051353865U; // precomputed @@ -8015,6 +8025,7 @@ rune _const_os__fslash = '/'; // precomputed #define _const_os__bslash '\\' rune _const_os__dot = '.'; // precomputed rune _const_os__qmark = '?'; // precomputed +string _const_os__fslash_str; // a string literal, inited later string _const_os__dot_dot; // a string literal, inited later string _const_os__empty_str; // a string literal, inited later string _const_os__dot_str; // a string literal, inited later @@ -8024,7 +8035,6 @@ string os__norm_path(string path); _option_string os__existing_path(string path); VV_LOCAL_SYMBOL string os__clean_path(string path); VV_LOCAL_SYMBOL int os__win_volume_len(string path); -VV_LOCAL_SYMBOL string os__get_volume(string path); VV_LOCAL_SYMBOL bool os__is_slash(u8 b); VV_LOCAL_SYMBOL bool os__is_unc_path(string path); VV_LOCAL_SYMBOL bool os__has_drive_letter(string path); @@ -8032,6 +8042,7 @@ VV_LOCAL_SYMBOL bool os__starts_w_slash_slash(string path); VV_LOCAL_SYMBOL bool os__is_drive_rooted(string path); VV_LOCAL_SYMBOL bool os__is_normal_path(string path); VV_LOCAL_SYMBOL bool os__is_curr_dir_ref(int byte_one, int byte_two, int byte_three); +string os__windows_volume(string path); u32 os__FilePermission_bitmask(os__FilePermission p); u32 os__FileMode_bitmask(os__FileMode m); os__FileMode os__inode(string path); @@ -8344,6 +8355,7 @@ string v__vcache__CacheManager_postfix_with_key2cpath(v__vcache__CacheManager* c _option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key); _option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content); _option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key); +VV_LOCAL_SYMBOL void v__vcache__xlog(string fname, string s); VV_LOCAL_SYMBOL int v__vcache__mypid(void); _option_string v__util__diff__find_working_diff_command(void); VV_LOCAL_SYMBOL bool v__util__diff__opendiff_exists(void); @@ -8776,6 +8788,8 @@ VV_LOCAL_SYMBOL v__token__KeywordsMatcher v__ast__build_builtin_type_names_match string v__ast__Attr_debug(v__ast__Attr* a); string v__ast__Attr_str(v__ast__Attr* a); bool Array_v__ast__Attr_contains(Array_v__ast__Attr attrs, string str); +_option_v__ast__Attr Array_v__ast__Attr_find_first(Array_v__ast__Attr attrs, string aname); +_option_v__ast__Attr Array_v__ast__Attr_find_last(Array_v__ast__Attr attrs, string aname); _option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs); VV_LOCAL_SYMBOL bool v__ast__Table_has_cflag(v__ast__Table* t, v__cflag__CFlag flag); _option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines); @@ -10005,8 +10019,6 @@ static string Array_v__ast__Attr_str(Array_v__ast__Attr a); // auto static string indent_Array_v__ast__Attr_str(Array_v__ast__Attr a, int indent_count); // auto static string v__token__Pos_str(v__token__Pos it); // auto static string indent_v__token__Pos_str(v__token__Pos it, int indent_count); // auto -static string v__ast__EnumVal_str(v__ast__EnumVal it); // auto -static string indent_v__ast__EnumVal_str(v__ast__EnumVal it, int indent_count); // auto static string v__gen__c__SqlType_str(v__gen__c__SqlType it); // auto static string Array_rune_str(Array_rune a); // auto static string indent_Array_rune_str(Array_rune a, int indent_count); // auto @@ -10731,6 +10743,7 @@ void vinit_string_literals(void){ _const_semver__comparator_set_sep = _SLIT(" || "); _const_semver__hyphen_range_sep = _SLIT(" - "); _const_semver__x_range_symbols = _SLIT("Xx*"); + _const_os__fslash_str = _SLIT("/"); _const_os__dot_dot = _SLIT(".."); _const_os__empty_str = _SLIT(""); _const_os__dot_str = _SLIT("."); @@ -10887,7 +10900,6 @@ static string indent_Array_v__ast__Attr_str(Array_v__ast__Attr a, int indent_cou return res; } static string v__token__Pos_str(v__token__Pos it) { return indent_v__token__Pos_str(it, 0);} -static string v__ast__EnumVal_str(v__ast__EnumVal it) { return indent_v__ast__EnumVal_str(it, 0);} static string v__gen__c__SqlType_str(v__gen__c__SqlType it) { /* gen_str_for_enum */ switch(it) { case v__gen__c__SqlType__sqlite3: return _SLIT("sqlite3"); @@ -11319,134 +11331,144 @@ static string indent_v__token__Pos_str(v__token__Pos it, int indent_count) { return res; } -static string indent_v__ast__EnumVal_str(v__ast__EnumVal it, int indent_count) { +static string indent_v__ast__OrExpr_str(v__ast__OrExpr it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t27 = indent_v__token__Pos_str(it.pos, indent_count + 1); - string _t28 = v__ast__Type_str(it.typ); - string res = str_intp( 23, _MOV((StrIntpData[]){ - {_SLIT("v.ast.EnumVal{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" enum_name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.enum_name}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" val: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.val}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" mod: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.mod}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t27}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t28}}, {_SLIT(""), 0, {.d_c=0}}, + string _t27 = indent_Array_v__ast__Stmt_str(it.stmts, indent_count + 1); + string _t28 = v__ast__OrKind_str(it.kind); + string _t29 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string res = str_intp( 15, _MOV((StrIntpData[]){ + {_SLIT("v.ast.OrExpr{\n"), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" stmts: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t27}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" kind: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t28}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t29}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); + string_free(&_t29); string_free(&_t28); string_free(&_t27); string_free(&indents); return res; } -static string indent_v__ast__OrExpr_str(v__ast__OrExpr it, int indent_count) { - string indents = string_repeat(_SLIT(" "), indent_count); - string _t29 = indent_Array_v__ast__Stmt_str(it.stmts, indent_count + 1); - string _t30 = v__ast__OrKind_str(it.kind); - string _t31 = indent_v__token__Pos_str(it.pos, indent_count + 1); - string res = str_intp( 15, _MOV((StrIntpData[]){ - {_SLIT("v.ast.OrExpr{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" stmts: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t29}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" kind: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t30}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t31}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, - })); - string_free(&_t31); - string_free(&_t30); - string_free(&_t29); - string_free(&indents); - return res; -} - static string indent_v__ast__Aggregate_str(v__ast__Aggregate it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t32 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t33 = v__ast__Type_str(it.sum_type); - string _t34 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t30 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t31 = v__ast__Type_str(it.sum_type); + string _t32 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); string res = str_intp( 15, _MOV((StrIntpData[]){ {_SLIT("v.ast.Aggregate{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t32}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" sum_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t33}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t34}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t30}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" sum_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t31}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t32}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t34); - string_free(&_t33); string_free(&_t32); + string_free(&_t31); + string_free(&_t30); string_free(&indents); return res; } static string indent_v__ast__Alias_str(v__ast__Alias it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t35 = v__ast__Type_str(it.parent_type); - string _t36 = v__ast__Language_str(it.language); + string _t33 = v__ast__Type_str(it.parent_type); + string _t34 = v__ast__Language_str(it.language); string res = str_intp( 15, _MOV((StrIntpData[]){ {_SLIT("v.ast.Alias{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t35}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" language: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t36}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t33}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" language: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t34}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_import: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_import ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t36); - string_free(&_t35); + string_free(&_t34); + string_free(&_t33); string_free(&indents); return res; } static string indent_v__ast__Array_str(v__ast__Array it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t37 = v__ast__Type_str(it.elem_type); + string _t35 = v__ast__Type_str(it.elem_type); string res = str_intp( 11, _MOV((StrIntpData[]){ {_SLIT("v.ast.Array{\n"), 0, {.d_c=0}}, {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" nr_dims: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.nr_dims}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t37}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t35}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t37); + string_free(&_t35); string_free(&indents); return res; } static string indent_v__ast__ArrayFixed_str(v__ast__ArrayFixed it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t38 = v__ast__Expr_str(it.size_expr); - string _t39 = v__ast__Type_str(it.elem_type); + string _t36 = v__ast__Expr_str(it.size_expr); + string _t37 = v__ast__Type_str(it.elem_type); string res = str_intp( 15, _MOV((StrIntpData[]){ {_SLIT("v.ast.ArrayFixed{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" size_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t38}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" size_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t36}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" size: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.size}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t39}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t37}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t39); - string_free(&_t38); + string_free(&_t37); + string_free(&_t36); string_free(&indents); return res; } static string indent_v__ast__Chan_str(v__ast__Chan it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t40 = v__ast__Type_str(it.elem_type); + string _t38 = v__ast__Type_str(it.elem_type); string res = str_intp( 11, _MOV((StrIntpData[]){ {_SLIT("v.ast.Chan{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t40}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t38}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_mut: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); + string_free(&_t38); + string_free(&indents); + return res; +} + +static string indent_v__ast__Enum_str(v__ast__Enum it, int indent_count) { + string indents = string_repeat(_SLIT(" "), indent_count); + string _t39 = Array_string_str(it.vals); + string res = str_intp( 19, _MOV((StrIntpData[]){ + {_SLIT("v.ast.Enum{\n"), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" vals: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t39}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_flag: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_flag ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_multi_allowed: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_multi_allowed ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" uses_exprs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.uses_exprs ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, + })); + string_free(&_t39); + string_free(&indents); + return res; +} + +static string indent_v__ast__FnType_str(v__ast__FnType it, int indent_count) { + string indents = string_repeat(_SLIT(" "), indent_count); + string _t40 = indent_v__ast__Fn_str(it.func, indent_count + 1); + string res = str_intp( 15, _MOV((StrIntpData[]){ + {_SLIT("v.ast.FnType{\n"), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" is_anon: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_anon ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" has_decl: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.has_decl ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" func: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t40}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, + })); string_free(&_t40); string_free(&indents); return res; } -static string indent_v__ast__Enum_str(v__ast__Enum it, int indent_count) { +static string indent_v__ast__GenericInst_str(v__ast__GenericInst it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t41 = Array_string_str(it.vals); - string res = str_intp( 19, _MOV((StrIntpData[]){ - {_SLIT("v.ast.Enum{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" vals: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t41}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_flag: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_flag ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_multi_allowed: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_multi_allowed ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" uses_exprs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.uses_exprs ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, + string _t41 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); + string res = str_intp( 11, _MOV((StrIntpData[]){ + {_SLIT("v.ast.GenericInst{\n"), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" parent_idx: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.parent_idx}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t41}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); string_free(&_t41); @@ -11454,115 +11476,86 @@ static string indent_v__ast__Enum_str(v__ast__Enum it, int indent_count) { return res; } -static string indent_v__ast__FnType_str(v__ast__FnType it, int indent_count) { - string indents = string_repeat(_SLIT(" "), indent_count); - string _t42 = indent_v__ast__Fn_str(it.func, indent_count + 1); - string res = str_intp( 15, _MOV((StrIntpData[]){ - {_SLIT("v.ast.FnType{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" is_anon: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_anon ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" has_decl: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.has_decl ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" func: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t42}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, - })); - string_free(&_t42); - string_free(&indents); - return res; -} - -static string indent_v__ast__GenericInst_str(v__ast__GenericInst it, int indent_count) { - string indents = string_repeat(_SLIT(" "), indent_count); - string _t43 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); - string res = str_intp( 11, _MOV((StrIntpData[]){ - {_SLIT("v.ast.GenericInst{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" parent_idx: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.parent_idx}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t43}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, - })); - string_free(&_t43); - string_free(&indents); - return res; -} - static string indent_v__ast__Interface_str(v__ast__Interface it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t44 = indent_Map_int_Array_v__ast__Type_str(it.conversions, indent_count + 1); - string _t45 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); - string _t46 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t47 = indent_Array_v__ast__Fn_str(it.methods, indent_count + 1); - string _t48 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); - string _t49 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); - string _t50 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); - string _t51 = v__ast__Type_str(it.parent_type); + string _t42 = indent_Map_int_Array_v__ast__Type_str(it.conversions, indent_count + 1); + string _t43 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t44 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t45 = indent_Array_v__ast__Fn_str(it.methods, indent_count + 1); + string _t46 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); + string _t47 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); + string _t48 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); + string _t49 = v__ast__Type_str(it.parent_type); string res = str_intp( 39, _MOV((StrIntpData[]){ {_SLIT("v.ast.Interface{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" conversions: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t44}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t45}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t46}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" methods: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t47}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t48}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t49}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t50}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t51}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" conversions: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t42}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t43}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t44}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" methods: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t45}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t46}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t47}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t48}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t49}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_generic: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_generic ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t51); - string_free(&_t50); string_free(&_t49); string_free(&_t48); string_free(&_t47); string_free(&_t46); string_free(&_t45); string_free(&_t44); + string_free(&_t43); + string_free(&_t42); string_free(&indents); return res; } static string indent_v__ast__Map_str(v__ast__Map it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t52 = v__ast__Type_str(it.key_type); - string _t53 = v__ast__Type_str(it.value_type); + string _t50 = v__ast__Type_str(it.key_type); + string _t51 = v__ast__Type_str(it.value_type); string res = str_intp( 11, _MOV((StrIntpData[]){ {_SLIT("v.ast.Map{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" key_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t52}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" value_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t53}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" key_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t50}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" value_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t51}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t53); - string_free(&_t52); + string_free(&_t51); + string_free(&_t50); string_free(&indents); return res; } static string indent_v__ast__MultiReturn_str(v__ast__MultiReturn it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t54 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t52 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); string res = str_intp( 7, _MOV((StrIntpData[]){ {_SLIT("v.ast.MultiReturn{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t54}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t52}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t54); + string_free(&_t52); string_free(&indents); return res; } static string indent_v__ast__Struct_str(v__ast__Struct it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t55 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); - string _t56 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); - string _t57 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t58 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); - string _t59 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); - string _t60 = v__ast__Type_str(it.parent_type); + string _t53 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); + string _t54 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); + string _t55 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t56 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); + string _t57 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); + string _t58 = v__ast__Type_str(it.parent_type); string res = str_intp( 47, _MOV((StrIntpData[]){ {_SLIT("v.ast.Struct{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t55}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t56}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t57}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t58}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t59}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t60}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t53}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t54}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t55}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t56}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t57}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t58}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_typedef: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_typedef ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_union: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_union ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_heap: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_heap ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, @@ -11570,119 +11563,119 @@ static string indent_v__ast__Struct_str(v__ast__Struct it, int indent_count) { {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_generic: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_generic ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t60); - string_free(&_t59); string_free(&_t58); string_free(&_t57); string_free(&_t56); string_free(&_t55); + string_free(&_t54); + string_free(&_t53); string_free(&indents); return res; } static string indent_v__ast__SumType_str(v__ast__SumType it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t61 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t62 = indent_Array_v__ast__Type_str(it.variants, indent_count + 1); - string _t63 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); - string _t64 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); - string _t65 = v__ast__Type_str(it.parent_type); + string _t59 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t60 = indent_Array_v__ast__Type_str(it.variants, indent_count + 1); + string _t61 = indent_Array_v__ast__Type_str(it.generic_types, indent_count + 1); + string _t62 = indent_Array_v__ast__Type_str(it.concrete_types, indent_count + 1); + string _t63 = v__ast__Type_str(it.parent_type); string res = str_intp( 35, _MOV((StrIntpData[]){ {_SLIT("v.ast.SumType{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t61}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" variants: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t62}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t63}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t64}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t65}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t59}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" variants: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t60}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" generic_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t61}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" concrete_types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t62}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" parent_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t63}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" found_fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.found_fields ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_anon: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_anon ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_generic: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_generic ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t65); - string_free(&_t64); string_free(&_t63); string_free(&_t62); string_free(&_t61); + string_free(&_t60); + string_free(&_t59); string_free(&indents); return res; } static string indent_v__ast__Thread_str(v__ast__Thread it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t66 = v__ast__Type_str(it.return_type); + string _t64 = v__ast__Type_str(it.return_type); string res = str_intp( 7, _MOV((StrIntpData[]){ {_SLIT("v.ast.Thread{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" return_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t66}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" return_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t64}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t66); + string_free(&_t64); string_free(&indents); return res; } static string indent_v__ast__Comment_str(v__ast__Comment it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t67 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t65 = indent_v__token__Pos_str(it.pos, indent_count + 1); string res = str_intp( 19, _MOV((StrIntpData[]){ {_SLIT("v.ast.Comment{\n"), 0, {.d_c=0}}, {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" text: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.text}}, {_SLIT("'"), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_multi: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_multi ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_inline: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_inline ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t67}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t65}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t67); + string_free(&_t65); string_free(&indents); return res; } static string indent_v__ast__Param_str(v__ast__Param it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t68 = indent_v__token__Pos_str(it.pos, indent_count + 1); - string _t69 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); - string _t70 = v__ast__Type_str(it.typ); + string _t66 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t67 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); + string _t68 = v__ast__Type_str(it.typ); string res = str_intp( 31, _MOV((StrIntpData[]){ {_SLIT("v.ast.Param{\n"), 0, {.d_c=0}}, {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.name}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t68}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t69}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t70}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t66}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t67}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t68}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_mut: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_auto_rec: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_auto_rec ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_hidden: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_hidden ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t70); - string_free(&_t69); string_free(&_t68); + string_free(&_t67); + string_free(&_t66); string_free(&indents); return res; } static string indent_v__ast__StructField_str(v__ast__StructField it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t71 = indent_Array_v__ast__Comment_str(it.comments, indent_count + 1); - string _t72 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); - string _t73 = v__ast__Expr_str(it.default_expr); - string _t74 = indent_v__token__Pos_str(it.pos, indent_count + 1); - string _t75 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); - string _t76 = v__ast__Type_str(it.default_expr_typ); - string _t77 = v__ast__Type_str(it.typ); + string _t69 = indent_Array_v__ast__Comment_str(it.comments, indent_count + 1); + string _t70 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); + string _t71 = v__ast__Expr_str(it.default_expr); + string _t72 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t73 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); + string _t74 = v__ast__Type_str(it.default_expr_typ); + string _t75 = v__ast__Type_str(it.typ); string res = str_intp( 75, _MOV((StrIntpData[]){ {_SLIT("v.ast.StructField{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" comments: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t71}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t72}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" comments: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t69}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t70}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_val: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.default_val}}, {_SLIT("'"), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" deprecation_msg: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.deprecation_msg}}, {_SLIT("'"), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" deprecated_after: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.deprecated_after}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t73}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t71}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.name}}, {_SLIT("'"), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t74}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t75}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t72}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t73}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" i: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.i}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr_typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t76}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t77}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr_typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t74}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t75}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" has_default_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.has_default_expr ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_pub: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_mut: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, @@ -11691,13 +11684,13 @@ static string indent_v__ast__StructField_str(v__ast__StructField it, int indent_ {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_deprecated: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_deprecated ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t77); - string_free(&_t76); string_free(&_t75); string_free(&_t74); string_free(&_t73); string_free(&_t72); string_free(&_t71); + string_free(&_t70); + string_free(&_t69); string_free(&indents); return res; } @@ -15421,6 +15414,25 @@ string strings__find_between_pair_string(string input, string start, string end) return _SLIT(""); } +Array_string strings__split_capital(string s) { + Array_string res = __new_array_with_default(0, 0, sizeof(string), 0); + int word_start = 0; + for (int idx = 0; idx < s.len; ++idx) { + u8 c = s.str[idx]; + if (c >= 'A' && c <= 'Z') { + if (word_start != idx) { + array_push((array*)&res, _MOV((string[]){ string_substr_ni(s, word_start, idx) })); + } + word_start = idx; + continue; + } + } + if (word_start != s.len) { + array_push((array*)&res, _MOV((string[]){ string_substr_ni(s, word_start, (s).len) })); + } + return res; +} + int math__bits__leading_zeros_8(u8 x) { return 8 - math__bits__len_8(x); } @@ -30112,8 +30124,11 @@ string os__norm_path(string path) { return _t1; } bool rooted = os__is_abs_path(path); - string volume = os__get_volume(path); - int volume_len = volume.len; + int volume_len = os__win_volume_len(path); + string volume = string_substr(path, 0, volume_len); + if (volume_len != 0 && string_contains(volume, _const_os__fslash_str)) { + volume = string_replace(volume, _const_os__fslash_str, _const_os__path_separator); + } string cpath = os__clean_path(string_substr(path, volume_len, (path).len)); if (cpath.len == 0 && volume_len == 0) { string _t2 = _const_os__dot_str; @@ -30292,20 +30307,6 @@ VV_LOCAL_SYMBOL int os__win_volume_len(string path) { return _t5; } -VV_LOCAL_SYMBOL string os__get_volume(string path) { - string volume = string_substr(path, 0, os__win_volume_len(path)); - if (volume.len == 0) { - string _t1 = _const_os__empty_str; - return _t1; - } - if (string_at(volume, 0) == _const_os__fslash) { - string _t2 = string_replace(volume, _SLIT("/"), _SLIT("\\")); - return _t2; - } - string _t3 = volume; - return _t3; -} - VV_LOCAL_SYMBOL bool os__is_slash(u8 b) { bool _t1 = b == _const_os__bslash || b == _const_os__fslash; return _t1; @@ -30352,6 +30353,16 @@ VV_LOCAL_SYMBOL bool os__is_curr_dir_ref(int byte_one, int byte_two, int byte_th return _t2; } +string os__windows_volume(string path) { + int volume_len = os__win_volume_len(path); + if (volume_len == 0) { + string _t1 = _const_os__empty_str; + return _t1; + } + string _t2 = string_substr(path, 0, volume_len); + return _t2; +} + u32 os__FilePermission_bitmask(os__FilePermission p) { u32 mask = ((u32)(0U)); if (p.read) { @@ -33410,7 +33421,7 @@ Array_string v__depgraph__OrderedDepMap_get(v__depgraph__OrderedDepMap* o, strin *(Array_string*) _t1.data = __new_array_with_default(0, 0, sizeof(string), 0); } - Array_string res = *(Array_string*)_t1.data; + Array_string res = (*(Array_string*)_t1.data); Array_string _t3 = res; return _t3; } @@ -34370,6 +34381,7 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts) { vcache_basepath = os__join_path(os__vmodules_dir(), new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("cache")}))); } ; + ; if (!os__is_dir(vcache_basepath)) { _option_void _t1 = os__mkdir_all(vcache_basepath); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { @@ -34396,9 +34408,27 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts) { ; ; } - string original_vopts = Array_string_join(opts, _SLIT("|")); - v__vcache__CacheManager _t3 = ((v__vcache__CacheManager){.basepath = vcache_basepath,.original_vopts = original_vopts,.vopts = original_vopts,.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}); - return _t3; + Map_string_bool deduped_opts = new_map(sizeof(string), sizeof(bool), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string) + ; + for (int _t3 = 0; _t3 < opts.len; ++_t3) { + string o = ((string*)opts.data)[_t3]; + map_set(&deduped_opts, &(string[]){o}, &(bool[]) { true }); + } + Array_string _t4 = {0}; + Array_string _t4_orig = map_keys(&deduped_opts); + int _t4_len = _t4_orig.len; + _t4 = __new_array(0, _t4_len, sizeof(string)); + + for (int _t5 = 0; _t5 < _t4_len; ++_t5) { + string it = ((string*) _t4_orig.data)[_t5]; + if ((it).len != 0 && !string_starts_with(it, _SLIT("['gcboehm', "))) { + array_push((array*)&_t4, &it); + } + } + Array_string deduped_opts_keys =_t4; + string original_vopts = Array_string_join(deduped_opts_keys, _SLIT("|")); + v__vcache__CacheManager _t6 = ((v__vcache__CacheManager){.basepath = vcache_basepath,.original_vopts = original_vopts,.vopts = original_vopts,.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}); + return _t6; } void v__vcache__CacheManager_set_temporary_options(v__vcache__CacheManager* cm, Array_string new_opts) { @@ -34420,7 +34450,7 @@ string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key *(string*) _t1.data = _SLIT(""); } - string cpath = *(string*)_t1.data; + string cpath = (*(string*)_t1.data); if ((cpath).len == 0) { string hk = string__plus(cm->vopts, key); string a = u64_hex_full(hash__sum64_string(hk, 5U)); @@ -34517,6 +34547,15 @@ _option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string return _t5; } +VV_LOCAL_SYMBOL void v__vcache__xlog(string fname, string s) { + int pid = v__vcache__mypid(); + if (string_at(fname, 0) != '|') { + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> VCache | pid: "), /*100 &int*/0xfe07, {.d_i32 = pid}}, {_SLIT(" | CacheManager."), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } else { + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> VCache | pid: "), /*100 &int*/0xfe07, {.d_i32 = pid}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } +} + // Attr: [unsafe] VV_LOCAL_SYMBOL int v__vcache__mypid(void) { static int pid = 0; @@ -35165,10 +35204,14 @@ multi_return_Array_string_Array_string_Array_string Array_v__cflag__CFlag_define Array_string libs = __new_array_with_default(0, 0, sizeof(string), 0); for (int _t1 = 0; _t1 < copts_without_obj_files.len; ++_t1) { string copt = ((string*)copts_without_obj_files.data)[_t1]; - if (string_starts_with(copt, _SLIT("-l")) || string_ends_with(copt, _SLIT(".a"))) { + if (string_starts_with(copt, _SLIT("-l"))) { array_push((array*)&libs, _MOV((string[]){ string_clone(copt) })); continue; } + if (string_ends_with(copt, _SLIT(".a"))) { + array_push((array*)&libs, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = copt}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + continue; + } if (string_starts_with(copt, _SLIT("-D"))) { array_push((array*)&defines, _MOV((string[]){ string_clone(copt) })); continue; @@ -36763,7 +36806,7 @@ f64 rand__exponential(f64 lambda) { } v__pref__Preferences* v__pref__new_preferences(void) { - v__pref__Preferences* p = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.backend = 0,.ccompiler_type = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))); + v__pref__Preferences* p = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.gc_mode = v__pref__GarbageCollectionMode__unknown,.backend = 0,.ccompiler_type = 0,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))); v__pref__Preferences_fill_with_defaults(p); v__pref__Preferences* _t1 = p; return _t1; @@ -36816,6 +36859,17 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) { } string rpath_name = os__file_name(rpath); p->building_v = !p->is_repl && (string__eq(rpath_name, _SLIT("v")) || string__eq(rpath_name, _SLIT("vfmt.v"))); + if (p->gc_mode == v__pref__GarbageCollectionMode__unknown) { + if (p->backend != v__pref__Backend__c || p->building_v || p->is_bare || string__eq(p->ccompiler, _SLIT("msvc"))) { + p->gc_mode = v__pref__GarbageCollectionMode__no_gc; + _PUSH_MANY(&p->build_options, (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("-gc"), _SLIT("none")}))), _t1, Array_string); + } else { + p->gc_mode = v__pref__GarbageCollectionMode__boehm_full_opt; + v__pref__Preferences_parse_define(p, _SLIT("gcboehm")); + v__pref__Preferences_parse_define(p, _SLIT("gcboehm_full")); + v__pref__Preferences_parse_define(p, _SLIT("gcboehm_opt")); + } + } if (p->os == v__pref__OS___auto) { p->os = v__pref__get_host_os(); } @@ -36831,7 +36885,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) { if ((p->third_party_option).len == 0) { p->third_party_option = p->cflags; } - string vhash = _SLIT("3bc50721e"); + string vhash = _SLIT("5b16d5fdf"); p->cache_manager = v__vcache__new_cache_manager(new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){string_clone(vhash), str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = p->sanitize ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}})), string_clone(string_trim_space(p->cflags)), string_clone(string_trim_space(p->third_party_option)), string_clone(Array_string_str(p->compile_defines_all)), string_clone(Array_string_str(p->compile_defines)), string_clone(Array_string_str(p->lookup_path))}))); if (string__eq(os__user_os(), _SLIT("windows"))) { p->use_cache = false; @@ -37259,7 +37313,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args(Array_string kn } multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors(Array_string known_external_commands, Array_string args, bool show_output) { - v__pref__Preferences* res = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.backend = 0,.ccompiler_type = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))); + v__pref__Preferences* res = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.gc_mode = v__pref__GarbageCollectionMode__unknown,.backend = 0,.ccompiler_type = 0,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))); ; #if defined(TARGET_IS_64BIT) { @@ -37356,9 +37410,15 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors else if (string__eq(arg, _SLIT("-gc"))) { string gc_mode = os__cmdline__option(current_args, _SLIT("-gc"), _SLIT("")); - if (string__eq(gc_mode, _SLIT("")) || string__eq(gc_mode, _SLIT("none"))) { + if (string__eq(gc_mode, _SLIT("none"))) { res->gc_mode = v__pref__GarbageCollectionMode__no_gc; } + else if (string__eq(gc_mode, _SLIT("")) || string__eq(gc_mode, _SLIT("boehm"))) { + res->gc_mode = v__pref__GarbageCollectionMode__boehm_full_opt; + v__pref__Preferences_parse_define(res, _SLIT("gcboehm")); + v__pref__Preferences_parse_define(res, _SLIT("gcboehm_full")); + v__pref__Preferences_parse_define(res, _SLIT("gcboehm_opt")); + } else if (string__eq(gc_mode, _SLIT("boehm_full"))) { res->gc_mode = v__pref__GarbageCollectionMode__boehm_full; v__pref__Preferences_parse_define(res, _SLIT("gcboehm")); @@ -37381,12 +37441,6 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors v__pref__Preferences_parse_define(res, _SLIT("gcboehm_incr")); v__pref__Preferences_parse_define(res, _SLIT("gcboehm_opt")); } - else if (string__eq(gc_mode, _SLIT("boehm"))) { - res->gc_mode = v__pref__GarbageCollectionMode__boehm_full_opt; - v__pref__Preferences_parse_define(res, _SLIT("gcboehm")); - v__pref__Preferences_parse_define(res, _SLIT("gcboehm_full")); - v__pref__Preferences_parse_define(res, _SLIT("gcboehm_opt")); - } else if (string__eq(gc_mode, _SLIT("boehm_leak"))) { res->gc_mode = v__pref__GarbageCollectionMode__boehm_leak; v__pref__Preferences_parse_define(res, _SLIT("gcboehm")); @@ -39410,7 +39464,7 @@ Array_string v__util__cached_file2sourcelines(string path) { } if (_t1.state == 0) { - Array_string res = *(Array_string*)_t1.data; + Array_string res = (*(Array_string*)_t1.data); Array_string _t3 = res; return _t3; } @@ -40025,7 +40079,7 @@ void v__util__Timers_start(v__util__Timers* t, string name) { *(time__StopWatch*) _t1.data = time__new_stopwatch(((time__StopWatchOptions){.auto_start = true,})); } - time__StopWatch sw = *(time__StopWatch*)_t1.data; + time__StopWatch sw = (*(time__StopWatch*)_t1.data); time__StopWatch_start(&sw); (*(time__StopWatch*)map_get_and_set((map*)&t->swatches, &(string[]){name}, &(time__StopWatch[]){ (time__StopWatch){.elapsed = 0,.start = 0,.end = 0,} })) = sw; } @@ -40223,7 +40277,7 @@ _option_string v__util__resolve_env_value(string str, bool check_for_presence) { return (_option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the environment variable \""), /*115 &string*/0xfe10, {.d_s = env_lit}}, {_SLIT("\" does not exist."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - env_value = *(string*)_t6.data; + env_value = (*(string*)_t6.data); if ((env_value).len == 0) { return (_option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the environment variable \""), /*115 &string*/0xfe10, {.d_s = env_lit}}, {_SLIT("\" is empty."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } @@ -40410,7 +40464,7 @@ _option_string v__util__cached_read_source_file(string path) { } if (_t2.state == 0) { - string res = *(string*)_t2.data; + string res = (*(string*)_t2.data); _option_string _t4; opt_ok2(&(string[]) { res }, (_option*)(&_t4), sizeof(string)); return _t4; @@ -42331,9 +42385,36 @@ bool Array_v__ast__Attr_contains(Array_v__ast__Attr attrs, string str) { return _t1; } +// Attr: [direct_array_access] +_option_v__ast__Attr Array_v__ast__Attr_find_first(Array_v__ast__Attr attrs, string aname) { + for (int _t1 = 0; _t1 < attrs.len; ++_t1) { + v__ast__Attr a = ((v__ast__Attr*)attrs.data)[_t1]; + if (string__eq(a.name, aname)) { + _option_v__ast__Attr _t2; + opt_ok2(&(v__ast__Attr[]) { a }, (_option*)(&_t2), sizeof(v__ast__Attr)); + return _t2; + } + } + return (_option_v__ast__Attr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; +} + +// Attr: [direct_array_access] +_option_v__ast__Attr Array_v__ast__Attr_find_last(Array_v__ast__Attr attrs, string aname) { + for (int idx = attrs.len - 1; idx > -1; idx--) { + v__ast__Attr a = ((v__ast__Attr*)attrs.data)[idx]; + if (string__eq(a.name, aname)) { + _option_v__ast__Attr _t1; + opt_ok2(&(v__ast__Attr[]) { a }, (_option*)(&_t1), sizeof(v__ast__Attr)); + return _t1; + } + } + return (_option_v__ast__Attr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; +} + +// Attr: [direct_array_access] _option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs) { for (int idx = 0; idx < attrs.len; ++idx) { - if ((*(v__ast__Attr*)/*ee elem_sym */array_get(attrs, idx)).kind == v__ast__AttrKind__comptime_define) { + if (((v__ast__Attr*)attrs.data)[idx].kind == v__ast__AttrKind__comptime_define) { _option_int _t1; opt_ok2(&(int[]) { idx }, (_option*)(&_t1), sizeof(int)); return _t1; @@ -42980,7 +43061,7 @@ _option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* } if (_t1.state == 0) { - v__ast__ScopeStructField field = *(v__ast__ScopeStructField*)_t1.data; + v__ast__ScopeStructField field = (*(v__ast__ScopeStructField*)_t1.data); if (v__ast__Type_alias_eq(field.struct_type, struct_type) && string__eq(field.name, field_name)) { _option_v__ast__ScopeStructField _t3; opt_ok2(&(v__ast__ScopeStructField[]) { field }, (_option*)(&_t3), sizeof(v__ast__ScopeStructField)); @@ -43090,7 +43171,7 @@ void v__ast__Scope_register_struct_field(v__ast__Scope* s, string name, v__ast__ } if (_t1.state == 0) { - v__ast__ScopeStructField f = *(v__ast__ScopeStructField*)_t1.data; + v__ast__ScopeStructField f = (*(v__ast__ScopeStructField*)_t1.data); if (v__ast__Type_alias_eq(f.struct_type, field.struct_type) && string__eq(f.name, field.name)) { return; } @@ -44179,7 +44260,7 @@ _option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name) { } if (_t1.state == 0) { - v__ast__Fn f = *(v__ast__Fn*)_t1.data; + v__ast__Fn f = (*(v__ast__Fn*)_t1.data); _option_v__ast__Fn _t3; opt_ok2(&(v__ast__Fn[]) { f }, (_option*)(&_t3), sizeof(v__ast__Fn)); return _t3; @@ -45244,7 +45325,7 @@ bool v__ast__Table_register_fn_concrete_types(v__ast__Table* t, string fn_name, return _t3; } - Array_Array_v__ast__Type a = *(Array_Array_v__ast__Type*)_t1.data; + Array_Array_v__ast__Type a = (*(Array_Array_v__ast__Type*)_t1.data); if (Array_Array_v__ast__Type_contains(a, types)) { bool _t4 = false; return _t4; @@ -46232,12 +46313,12 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { for (int _t1 = 0; _t1 < t->type_symbols.len; ++_t1) { - v__ast__TypeSymbol** typ = ((v__ast__TypeSymbol**)t->type_symbols.data) + _t1; - if ((*typ)->kind == v__ast__Kind__generic_inst) { - v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast(((*typ)->info)._v__ast__GenericInst,((*typ)->info)._typ, 488) /*expected idx: 488, name: v.ast.GenericInst */ ; + v__ast__TypeSymbol** sym = ((v__ast__TypeSymbol**)t->type_symbols.data) + _t1; + if ((*sym)->kind == v__ast__Kind__generic_inst) { + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast(((*sym)->info)._v__ast__GenericInst,((*sym)->info)._typ, 488) /*expected idx: 488, name: v.ast.GenericInst */ ; v__ast__TypeSymbol* parent = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, info.parent_idx)); if (parent->kind == v__ast__Kind__placeholder) { - (*typ)->kind = v__ast__Kind__placeholder; + (*sym)->kind = v__ast__Kind__placeholder; continue; } if (parent->info._typ == 459 /* v.ast.Struct */) { @@ -46276,9 +46357,9 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { parent_info.concrete_types = array_clone_to_depth(&info.concrete_types, 0); parent_info.fields = fields; parent_info.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic); - (*typ)->info = v__ast__Struct_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__Struct, (((v__ast__Struct){parent_info.attrs,parent_info.embeds,.fields = fields,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),parent_info.is_typedef,parent_info.is_union,parent_info.is_heap,parent_info.is_minify,.is_generic = false,})))); - (*typ)->is_pub = true; - (*typ)->kind = parent->kind; + (*sym)->info = v__ast__Struct_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__Struct, (((v__ast__Struct){parent_info.attrs,parent_info.embeds,.fields = fields,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),parent_info.is_typedef,parent_info.is_union,parent_info.is_heap,parent_info.is_minify,.is_generic = false,})))); + (*sym)->is_pub = true; + (*sym)->kind = parent->kind; v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(t, parent_info.parent_type); for (int _t5 = 0; _t5 < parent_sym->methods.len; ++_t5) { v__ast__Fn method = ((v__ast__Fn*)parent_sym->methods.data)[_t5]; @@ -46336,7 +46417,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { param->typ = pt; } } - v__ast__TypeSymbol_register_method(/*diff=1*/*typ, *method); + v__ast__TypeSymbol_register_method(/*diff=1*/*sym, *method); } Array_v__ast__Fn all_methods = parent->methods; for (int _t13 = 0; _t13 < imethods.len; ++_t13) { @@ -46348,10 +46429,10 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } } } - (*typ)->info = v__ast__Interface_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__Interface, (((v__ast__Interface){parent_info.conversions,parent_info.types,.fields = fields,.methods = imethods,parent_info.embeds,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),.is_generic = false,})))); - (*typ)->is_pub = true; - (*typ)->kind = parent->kind; - (*typ)->methods = all_methods; + (*sym)->info = v__ast__Interface_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__Interface, (((v__ast__Interface){parent_info.conversions,parent_info.types,.fields = fields,.methods = imethods,parent_info.embeds,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),.is_generic = false,})))); + (*sym)->is_pub = true; + (*sym)->kind = parent->kind; + (*sym)->methods = all_methods; } else { v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of interface `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); @@ -46387,8 +46468,8 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } for (int i = 0; i < variants.len; ++i) { if (v__ast__Type_has_flag((*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), v__ast__TypeFlag__generic)) { - v__ast__TypeSymbol* sym = v__ast__Table_sym(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))); - if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))) != info.parent_idx) { + v__ast__TypeSymbol* t_sym = v__ast__Table_sym(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))); + if (t_sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))) != info.parent_idx) { array_set(&variants, i, &(v__ast__Type[]) { v__ast__Table_unwrap_generic_type(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, info.concrete_types) }); } else { _option_v__ast__Type _t18; @@ -46399,9 +46480,9 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } } } - (*typ)->info = v__ast__SumType_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__SumType, (((v__ast__SumType){.fields = fields,.variants = variants,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),parent_info.found_fields,parent_info.is_anon,.is_generic = false,})))); - (*typ)->is_pub = true; - (*typ)->kind = parent->kind; + (*sym)->info = v__ast__SumType_to_sumtype_v__ast__TypeInfo(ADDR(v__ast__SumType, (((v__ast__SumType){.fields = fields,.variants = variants,parent_info.generic_types,.concrete_types = array_clone_to_depth(&info.concrete_types, 0),.parent_type = v__ast__Type_set_flag(v__ast__new_type(info.parent_idx), v__ast__TypeFlag__generic),parent_info.found_fields,parent_info.is_anon,.is_generic = false,})))); + (*sym)->is_pub = true; + (*sym)->kind = parent->kind; } else { v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of sumtype `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); @@ -47603,7 +47684,7 @@ string res; } if (_t1.state == 0) { - string cached_res = *(string*)_t1.data; + string cached_res = (*(string*)_t1.data); string _t3 = cached_res; return _t3; } @@ -49762,7 +49843,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ v__ast__Param param = ((v__ast__Param*)func.params.data)[i]; v__ast__Type to_set = _const_v__ast__void_type; if (node->is_method && v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__generic)) { - v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->receiver_type); + v__ast__TypeSymbol* sym = v__ast__Table_final_sym(c->table, node->receiver_type); if (sym->info._typ == 459 /* v.ast.Struct */) { if (!isnil(c->table->cur_fn) && c->table->cur_fn->generic_names.len > 0) { if (Array_string_contains(c->table->cur_fn->generic_names, gt_name) && c->table->cur_fn->generic_names.len == c->table->cur_concrete_types.len) { @@ -50008,7 +50089,7 @@ VV_LOCAL_SYMBOL Array_string v__checker__all_valid_comptime_idents(void) { v__checker__Checker* v__checker__new_checker(v__ast__Table* table, v__pref__Preferences* pref) { bool timers_should_print = false; - v__checker__Checker* _t1 = ((v__checker__Checker*)memdup(&(v__checker__Checker){.main_fn_decl_node = (v__ast__FnDecl){.receiver = (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,},.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.params = __new_array(0, 0, sizeof(v__ast__Param)),.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.defer_stmts = __new_array(0, 0, sizeof(v__ast__DeferStmt)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.next_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.label_names = __new_array(0, 0, sizeof(string)),.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.source_file = 0,.scope = 0,.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.ctdefine_idx = -1,.idx = 0,.return_type = 0,.ninstances = 0,.is_deprecated = 0,.is_pub = 0,.is_variadic = 0,.is_anon = 0,.is_noreturn = 0,.is_manualfree = 0,.is_main = 0,.is_test = 0,.is_conditional = 0,.is_exported = 0,.is_keep_alive = 0,.is_unsafe = 0,.is_markused = 0,.is_method = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.is_direct_arr = 0,.has_return = 0,.should_be_skipped = 0,.has_await = 0,},.cur_orm_ts = (v__ast__TypeSymbol){.methods = __new_array(0, 0, sizeof(v__ast__Fn)),.name = (string){.str=(byteptr)"", .is_lit=1},.cname = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.parent_idx = 0,.idx = 0,.size = -1,.align = -1,.is_pub = 0,},.comptime_fields_type = new_map(sizeof(string), sizeof(v__ast__Type), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.errors = __new_array(0, 0, sizeof(v__errors__Error)),.warnings = __new_array(0, 0, sizeof(v__errors__Warning)),.notices = __new_array(0, 0, sizeof(v__errors__Notice)),.error_lines = __new_array(0, 0, sizeof(int)),.const_deps = __new_array(0, 0, sizeof(string)),.const_names = __new_array(0, 0, sizeof(string)),.global_names = __new_array(0, 0, sizeof(string)),.locked_names = __new_array(0, 0, sizeof(string)),.rlocked_names = __new_array(0, 0, sizeof(string)),.ct_cond_stack = __new_array(0, 0, sizeof(v__ast__Expr)),.files = __new_array(0, 0, sizeof(v__ast__File)),.error_details = __new_array(0, 0, sizeof(string)),.vweb_gen_types = __new_array(0, 0, sizeof(v__ast__Type)),.mod = (string){.str=(byteptr)"", .is_lit=1},.vmod_file_content = (string){.str=(byteptr)"", .is_lit=1},.loop_label = (string){.str=(byteptr)"", .is_lit=1},.pref = pref,.table = table,.file = 0,.const_var = ((voidptr)(0)),.timers = v__util__new_timers(((v__util__TimerParams){.should_print = timers_should_print,.label = _SLIT("checker"),})),.fn_scope = ((voidptr)(0)),.smartcast_mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.smartcast_cond_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.nr_errors = 0,.nr_warnings = 0,.nr_notices = 0,.expected_type = 0,.expected_or_type = 0,.expected_expr_type = 0,.in_for_count = 0,.fn_level = 0,.stmt_level = 0,.expr_level = 0,.comptime_fields_default_type = 0,.match_exhaustive_cutoff_limit = pref->checker_match_exhaustive_cutoff_limit,.comptime_call_pos = 0,.should_abort = 0,.returns = 0,.scope_returns = 0,.is_builtin_mod = 0,.is_just_builtin_mod = 0,.is_generated = 0,.inside_unsafe = 0,.inside_const = 0,.inside_anon_fn = 0,.inside_ref_lit = 0,.inside_defer = 0,.inside_fn_arg = 0,.inside_ct_attr = 0,.inside_comptime_for_field = 0,.skip_flags = 0,.is_last_stmt = 0,.prevent_sum_type_unwrapping_once = 0,.using_new_err_struct = 0,.need_recheck_generic_fns = 0,.inside_sql = 0,.inside_selector_expr = 0,.inside_println_arg = 0,.inside_decl_rhs = 0,.inside_if_guard = 0,}, sizeof(v__checker__Checker))); + v__checker__Checker* _t1 = ((v__checker__Checker*)memdup(&(v__checker__Checker){.main_fn_decl_node = (v__ast__FnDecl){.receiver = (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,},.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.params = __new_array(0, 0, sizeof(v__ast__Param)),.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.defer_stmts = __new_array(0, 0, sizeof(v__ast__DeferStmt)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.next_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.label_names = __new_array(0, 0, sizeof(string)),.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.source_file = 0,.scope = 0,.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.ctdefine_idx = -1,.idx = 0,.return_type = 0,.ninstances = 0,.is_deprecated = 0,.is_pub = 0,.is_variadic = 0,.is_anon = 0,.is_noreturn = 0,.is_manualfree = 0,.is_main = 0,.is_test = 0,.is_conditional = 0,.is_exported = 0,.is_keep_alive = 0,.is_unsafe = 0,.is_markused = 0,.is_method = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.is_direct_arr = 0,.has_return = 0,.should_be_skipped = 0,.has_await = 0,},.cur_orm_ts = (v__ast__TypeSymbol){.methods = __new_array(0, 0, sizeof(v__ast__Fn)),.name = (string){.str=(byteptr)"", .is_lit=1},.cname = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.parent_idx = 0,.idx = 0,.size = -1,.align = -1,.is_pub = 0,},.comptime_fields_type = new_map(sizeof(string), sizeof(v__ast__Type), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.errors = __new_array(0, 0, sizeof(v__errors__Error)),.warnings = __new_array(0, 0, sizeof(v__errors__Warning)),.notices = __new_array(0, 0, sizeof(v__errors__Notice)),.error_lines = __new_array(0, 0, sizeof(int)),.const_deps = __new_array(0, 0, sizeof(string)),.const_names = __new_array(0, 0, sizeof(string)),.global_names = __new_array(0, 0, sizeof(string)),.locked_names = __new_array(0, 0, sizeof(string)),.rlocked_names = __new_array(0, 0, sizeof(string)),.ct_cond_stack = __new_array(0, 0, sizeof(v__ast__Expr)),.files = __new_array(0, 0, sizeof(v__ast__File)),.error_details = __new_array(0, 0, sizeof(string)),.vweb_gen_types = __new_array(0, 0, sizeof(v__ast__Type)),.mod = (string){.str=(byteptr)"", .is_lit=1},.vmod_file_content = (string){.str=(byteptr)"", .is_lit=1},.loop_label = (string){.str=(byteptr)"", .is_lit=1},.pref = pref,.table = table,.file = 0,.const_var = ((voidptr)(0)),.timers = v__util__new_timers(((v__util__TimerParams){.should_print = timers_should_print,.label = _SLIT("checker"),})),.fn_scope = ((voidptr)(0)),.smartcast_mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.smartcast_cond_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.nr_errors = 0,.nr_warnings = 0,.nr_notices = 0,.expected_type = 0,.expected_or_type = 0,.expected_expr_type = 0,.in_for_count = 0,.fn_level = 0,.stmt_level = 0,.expr_level = 0,.comptime_fields_default_type = 0,.match_exhaustive_cutoff_limit = pref->checker_match_exhaustive_cutoff_limit,.comptime_call_pos = 0,.should_abort = 0,.returns = 0,.scope_returns = 0,.is_builtin_mod = 0,.is_just_builtin_mod = 0,.is_generated = 0,.inside_unsafe = 0,.inside_const = 0,.inside_anon_fn = 0,.inside_ref_lit = 0,.inside_defer = 0,.inside_fn_arg = 0,.inside_ct_attr = 0,.inside_x_is_type = 0,.inside_comptime_for_field = 0,.skip_flags = 0,.is_last_stmt = 0,.prevent_sum_type_unwrapping_once = 0,.using_new_err_struct = 0,.need_recheck_generic_fns = 0,.inside_sql = 0,.inside_selector_expr = 0,.inside_println_arg = 0,.inside_decl_rhs = 0,.inside_if_guard = 0,}, sizeof(v__checker__Checker))); return _t1; } @@ -50029,6 +50110,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_reset_checker_state_at_start_of_new_fil c->inside_defer = false; c->inside_fn_arg = false; c->inside_ct_attr = false; + c->inside_x_is_type = false; c->skip_flags = false; c->fn_level = 0; c->expr_level = 0; @@ -50280,7 +50362,7 @@ void v__checker__Checker_check_files(v__checker__Checker* c, Array_v__ast__File_ } if (!has_main_mod_file) { v__checker__Checker_error(c, _SLIT("project must include a `main` module or be a shared library (compile with `v -shared`)"), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,})); - } else if (!has_main_fn) { + } else if (!has_main_fn && !c->pref->is_o) { v__checker__Checker_error(c, _SLIT("function `main` must be declared in the main module"), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,})); } } @@ -50505,7 +50587,7 @@ Array_v__ast__InterfaceEmbedding v__checker__Checker_expand_iface_embeds(v__chec } if (_t4.state == 0) { - v__ast__InterfaceDecl iface_decl = *(v__ast__InterfaceDecl*)_t4.data; + v__ast__InterfaceDecl iface_decl = (*(v__ast__InterfaceDecl*)_t4.data); Array_v__ast__InterfaceEmbedding list = iface_decl.embeds; if (!iface_decl.are_embeds_expanded) { list = v__checker__Checker_expand_iface_embeds(c, idecl, level + 1, iface_decl.embeds); @@ -50594,19 +50676,19 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im if (v__ast__Type_has_flag(elem_type, v__ast__TypeFlag__shared_f)) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("you have to create a handle and `lock` it to modify `shared` "), /*115 &string*/0xfe10, {.d_s = kind}}, {_SLIT(" element"), 0, { .d_c = 0 }}})), v__token__Pos_extend(v__ast__Expr_pos((*expr._v__ast__IndexExpr).left), (*expr._v__ast__IndexExpr).pos)); } - multi_return_string_v__token__Pos mr_22155 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__IndexExpr).left); - to_lock = mr_22155.arg0; - pos = mr_22155.arg1; + multi_return_string_v__token__Pos mr_22286 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__IndexExpr).left); + to_lock = mr_22286.arg0; + pos = mr_22286.arg1; } else if (expr._typ == 324 /* v.ast.ParExpr */) { - multi_return_string_v__token__Pos mr_22224 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); - to_lock = mr_22224.arg0; - pos = mr_22224.arg1; + multi_return_string_v__token__Pos mr_22355 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); + to_lock = mr_22355.arg0; + pos = mr_22355.arg1; } else if (expr._typ == 326 /* v.ast.PrefixExpr */) { - multi_return_string_v__token__Pos mr_22296 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); - to_lock = mr_22296.arg0; - pos = mr_22296.arg1; + multi_return_string_v__token__Pos mr_22427 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); + to_lock = mr_22427.arg0; + pos = mr_22427.arg1; } else if (expr._typ == 329 /* v.ast.SelectorExpr */) { if ((*expr._v__ast__SelectorExpr).expr_type == 0) { @@ -50656,9 +50738,9 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im string type_str = v__ast__Table_type_to_str(c->table, (*expr._v__ast__SelectorExpr).expr_type); v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("` of struct `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); } - multi_return_string_v__token__Pos mr_23760 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); - to_lock = mr_23760.arg0; - pos = mr_23760.arg1; + multi_return_string_v__token__Pos mr_23891 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); + to_lock = mr_23891.arg0; + pos = mr_23891.arg1; } if ((to_lock).len != 0) { explicit_lock_needed = true; @@ -50764,9 +50846,9 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } else if (expr._typ == 295 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("slice"))) { - multi_return_string_v__token__Pos mr_25583 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); - to_lock = mr_25583.arg0; - pos = mr_25583.arg1; + multi_return_string_v__token__Pos mr_25714 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); + to_lock = mr_25714.arg0; + pos = mr_25714.arg1; if ((to_lock).len != 0) { explicit_lock_needed = true; } @@ -51184,9 +51266,9 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t13.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_40023 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t13.data); - field = mr_40023.arg0; - embed_types = mr_40023.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_40154 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t13.data); + field = mr_40154.arg0; + embed_types = mr_40154.arg1; node->from_embed_types = embed_types; if (sym->kind == v__ast__Kind__aggregate || sym->kind == v__ast__Kind__sum_type) { unknown_field_msg = IError_name_table[err._typ]._method_msg(err._object); @@ -51220,9 +51302,9 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t15.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.deprecation_msg = (string){.str=(byteptr)"", .is_lit=1},.deprecated_after = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,.is_deprecated = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_40854 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t15.data); - field = mr_40854.arg0; - embed_types = mr_40854.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_40985 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t15.data); + field = mr_40985.arg0; + embed_types = mr_40985.arg1; node->from_embed_types = embed_types; } } @@ -51621,9 +51703,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_assert_stmt(v__checker__Checker* c, v__ VV_LOCAL_SYMBOL void v__checker__Checker_block(v__checker__Checker* c, v__ast__Block node) { if (node.is_unsafe) { + bool prev_unsafe = c->inside_unsafe; c->inside_unsafe = true; v__checker__Checker_stmts(c, node.stmts); - c->inside_unsafe = false; + c->inside_unsafe = prev_unsafe; } else { v__checker__Checker_stmts(c, node.stmts); } @@ -51996,7 +52079,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ } if (_t5.state == 0) { - time__Time after_time = *(time__Time*)_t5.data; + time__Time after_time = (*(time__Time*)_t5.data); time__Time now = time__now(); string deprecation_message = (*(string*)map_get(ADDR(map, c->table->mdeprecated_msg), &(string[]){node.mod}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); v__checker__Checker_deprecate(c, _SLIT("module"), node.mod, deprecation_message, now, after_time, node.pos); @@ -52081,10 +52164,9 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_error(c, _SLIT("incorrect use of compile-time type"), (*node._v__ast__ComptimeType).pos); } else if (node._typ == 305 /* v.ast.EmptyExpr */) { + print_backtrace(); v__checker__Checker_error(c, _SLIT("checker.expr(): unhandled EmptyExpr"), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,})); - } - else if (node._typ == 294 /* v.ast.CTempVar */) { - v__ast__Type _t2 = (*node._v__ast__CTempVar).typ; + v__ast__Type _t2 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52092,8 +52174,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t2; } - else if (node._typ == 287 /* v.ast.AnonFn */) { - v__ast__Type _t3 = v__checker__Checker_anon_fn(c, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); + else if (node._typ == 294 /* v.ast.CTempVar */) { + v__ast__Type _t3 = (*node._v__ast__CTempVar).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52101,33 +52183,33 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t3; } - else if (node._typ == 288 /* v.ast.ArrayDecompose */) { - v__ast__Type typ = v__checker__Checker_expr(c, (*node._v__ast__ArrayDecompose).expr); - v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, typ); - if (type_sym->kind != v__ast__Kind__array) { - v__checker__Checker_error(c, _SLIT("decomposition can only be used on arrays"), v__ast__Expr_pos((*node._v__ast__ArrayDecompose).expr)); - v__ast__Type _t4 = _const_v__ast__void_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t4; - } - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 454) /*expected idx: 454, name: v.ast.Array */ ; - v__ast__Type elem_type = v__ast__Type_set_flag(array_info.elem_type, v__ast__TypeFlag__variadic); - (*node._v__ast__ArrayDecompose).expr_type = typ; - (*node._v__ast__ArrayDecompose).arg_type = elem_type; - v__ast__Type _t5 = elem_type; + else if (node._typ == 287 /* v.ast.AnonFn */) { + v__ast__Type _t4 = v__checker__Checker_anon_fn(c, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t5; + return _t4; } - else if (node._typ == 289 /* v.ast.ArrayInit */) { - v__ast__Type _t6 = v__checker__Checker_array_init(c, (voidptr)&/*qq*/(*node._v__ast__ArrayInit)); + else if (node._typ == 288 /* v.ast.ArrayDecompose */) { + v__ast__Type typ = v__checker__Checker_expr(c, (*node._v__ast__ArrayDecompose).expr); + v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, typ); + if (type_sym->kind != v__ast__Kind__array) { + v__checker__Checker_error(c, _SLIT("decomposition can only be used on arrays"), v__ast__Expr_pos((*node._v__ast__ArrayDecompose).expr)); + v__ast__Type _t5 = _const_v__ast__void_type; + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t5; + } + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 454) /*expected idx: 454, name: v.ast.Array */ ; + v__ast__Type elem_type = v__ast__Type_set_flag(array_info.elem_type, v__ast__TypeFlag__variadic); + (*node._v__ast__ArrayDecompose).expr_type = typ; + (*node._v__ast__ArrayDecompose).arg_type = elem_type; + v__ast__Type _t6 = elem_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52135,14 +52217,23 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t6; } + else if (node._typ == 289 /* v.ast.ArrayInit */) { + v__ast__Type _t7 = v__checker__Checker_array_init(c, (voidptr)&/*qq*/(*node._v__ast__ArrayInit)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t7; + } else if (node._typ == 290 /* v.ast.AsCast */) { (*node._v__ast__AsCast).expr_type = v__checker__Checker_expr(c, (*node._v__ast__AsCast).expr); v__ast__TypeSymbol* expr_type_sym = v__ast__Table_sym(c->table, (*node._v__ast__AsCast).expr_type); v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, (*node._v__ast__AsCast).typ); if (expr_type_sym->kind == v__ast__Kind__sum_type) { - _option_void _t7 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); - if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { - IError err = _t7.err; + _option_void _t8 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); + if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { + IError err = _t8.err; } ; @@ -52151,9 +52242,9 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__AsCast).pos); } } else if (expr_type_sym->kind == v__ast__Kind__interface_ && type_sym->kind == v__ast__Kind__interface_) { - _option_void _t8 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); - if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { - IError err = _t8.err; + _option_void _t9 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); + if (_t9.state != 0 && _t9.err._typ != _IError_None___index) { + IError err = _t9.err; } ; @@ -52164,38 +52255,29 @@ bool v__checker__Checker_expr_defer_0 = false; } v__checker__Checker_error(c, s, (*node._v__ast__AsCast).pos); } - v__ast__Type _t9 = (*node._v__ast__AsCast).typ; + v__ast__Type _t10 = (*node._v__ast__AsCast).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t9; + return _t10; } else if (node._typ == 291 /* v.ast.Assoc */) { - _option_v__ast__Var_ptr _t10 = v__ast__Scope_find_var((*node._v__ast__Assoc).scope, (*node._v__ast__Assoc).var_name); - if (_t10.state != 0) { /*or block*/ - IError err = _t10.err; + _option_v__ast__Var_ptr _t11 = v__ast__Scope_find_var((*node._v__ast__Assoc).scope, (*node._v__ast__Assoc).var_name); + if (_t11.state != 0) { /*or block*/ + IError err = _t11.err; _v_panic(IError_str(err)); VUNREACHABLE(); ; } - v__ast__Var* v = (*(v__ast__Var**)_t10.data); + v__ast__Var* v = (*(v__ast__Var**)_t11.data); for (int i = 0; i < (*node._v__ast__Assoc).fields.len; ++i) { v__checker__Checker_expr(c, (*(v__ast__Expr*)/*ee elem_sym */array_get((*node._v__ast__Assoc).exprs, i))); } (*node._v__ast__Assoc).typ = v->typ; - v__ast__Type _t11 = v->typ; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t11; - } - else if (node._typ == 293 /* v.ast.BoolLiteral */) { - v__ast__Type _t12 = _const_v__ast__bool_type; + v__ast__Type _t12 = v->typ; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52203,8 +52285,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t12; } - else if (node._typ == 296 /* v.ast.CastExpr */) { - v__ast__Type _t13 = v__checker__Checker_cast_expr(c, (voidptr)&/*qq*/(*node._v__ast__CastExpr)); + else if (node._typ == 293 /* v.ast.BoolLiteral */) { + v__ast__Type _t13 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52212,6 +52294,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t13; } + else if (node._typ == 296 /* v.ast.CastExpr */) { + v__ast__Type _t14 = v__checker__Checker_cast_expr(c, (voidptr)&/*qq*/(*node._v__ast__CastExpr)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t14; + } else if (node._typ == 295 /* v.ast.CallExpr */) { v__ast__Type ret_type = v__checker__Checker_call_expr(c, (voidptr)&/*qq*/(*node._v__ast__CallExpr)); if (!v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional) && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__result)) { @@ -52229,16 +52320,7 @@ bool v__checker__Checker_expr_defer_0 = false; ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__result); } } - v__ast__Type _t14 = ret_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t14; - } - else if (node._typ == 297 /* v.ast.ChanInit */) { - v__ast__Type _t15 = v__checker__Checker_chan_init(c, (voidptr)&/*qq*/(*node._v__ast__ChanInit)); + v__ast__Type _t15 = ret_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52246,8 +52328,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t15; } - else if (node._typ == 298 /* v.ast.CharLiteral */) { - v__ast__Type _t16 = _const_v__ast__rune_type; + else if (node._typ == 297 /* v.ast.ChanInit */) { + v__ast__Type _t16 = v__checker__Checker_chan_init(c, (voidptr)&/*qq*/(*node._v__ast__ChanInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52255,8 +52337,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t16; } - else if (node._typ == 299 /* v.ast.Comment */) { - v__ast__Type _t17 = _const_v__ast__void_type; + else if (node._typ == 298 /* v.ast.CharLiteral */) { + v__ast__Type _t17 = _const_v__ast__rune_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52264,8 +52346,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t17; } - else if (node._typ == 292 /* v.ast.AtExpr */) { - v__ast__Type _t18 = v__checker__Checker_at_expr(c, (voidptr)&/*qq*/(*node._v__ast__AtExpr)); + else if (node._typ == 299 /* v.ast.Comment */) { + v__ast__Type _t18 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52273,8 +52355,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t18; } - else if (node._typ == 300 /* v.ast.ComptimeCall */) { - v__ast__Type _t19 = v__checker__Checker_comptime_call(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); + else if (node._typ == 292 /* v.ast.AtExpr */) { + v__ast__Type _t19 = v__checker__Checker_at_expr(c, (voidptr)&/*qq*/(*node._v__ast__AtExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52282,8 +52364,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t19; } - else if (node._typ == 301 /* v.ast.ComptimeSelector */) { - v__ast__Type _t20 = v__checker__Checker_comptime_selector(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeSelector)); + else if (node._typ == 300 /* v.ast.ComptimeCall */) { + v__ast__Type _t20 = v__checker__Checker_comptime_call(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52291,8 +52373,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t20; } - else if (node._typ == 303 /* v.ast.ConcatExpr */) { - v__ast__Type _t21 = v__checker__Checker_concat_expr(c, (voidptr)&/*qq*/(*node._v__ast__ConcatExpr)); + else if (node._typ == 301 /* v.ast.ComptimeSelector */) { + v__ast__Type _t21 = v__checker__Checker_comptime_selector(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeSelector)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52300,21 +52382,21 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t21; } + else if (node._typ == 303 /* v.ast.ConcatExpr */) { + v__ast__Type _t22 = v__checker__Checker_concat_expr(c, (voidptr)&/*qq*/(*node._v__ast__ConcatExpr)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t22; + } else if (node._typ == 304 /* v.ast.DumpExpr */) { (*node._v__ast__DumpExpr).expr_type = v__checker__Checker_expr(c, (*node._v__ast__DumpExpr).expr); v__checker__Checker_check_expr_opt_call(c, (*node._v__ast__DumpExpr).expr, (*node._v__ast__DumpExpr).expr_type); int etidx = v__ast__Type_idx((*node._v__ast__DumpExpr).expr_type); if (etidx == _const_v__ast__void_type_idx) { v__checker__Checker_error(c, _SLIT("dump expression can not be void"), v__ast__Expr_pos((*node._v__ast__DumpExpr).expr)); - v__ast__Type _t22 = _const_v__ast__void_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t22; - } else if (etidx == _const_v__ast__char_type_idx && v__ast__Type_nr_muls((*node._v__ast__DumpExpr).expr_type) == 0) { - v__checker__Checker_error(c, _SLIT("`char` values cannot be dumped directly, use dump(u8(x)) or dump(int(x)) instead"), v__ast__Expr_pos((*node._v__ast__DumpExpr).expr)); v__ast__Type _t23 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52322,20 +52404,20 @@ bool v__checker__Checker_expr_defer_0 = false; } // Defer end return _t23; + } else if (etidx == _const_v__ast__char_type_idx && v__ast__Type_nr_muls((*node._v__ast__DumpExpr).expr_type) == 0) { + v__checker__Checker_error(c, _SLIT("`char` values cannot be dumped directly, use dump(u8(x)) or dump(int(x)) instead"), v__ast__Expr_pos((*node._v__ast__DumpExpr).expr)); + v__ast__Type _t24 = _const_v__ast__void_type; + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t24; } v__ast__TypeSymbol* tsym = v__ast__Table_sym(c->table, (*node._v__ast__DumpExpr).expr_type); map_set(&c->table->dumps, &(int[]){((int)((*node._v__ast__DumpExpr).expr_type))}, &(string[]) { tsym->cname }); (*node._v__ast__DumpExpr).cname = tsym->cname; - v__ast__Type _t24 = (*node._v__ast__DumpExpr).expr_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t24; - } - else if (node._typ == 306 /* v.ast.EnumVal */) { - v__ast__Type _t25 = v__checker__Checker_enum_val(c, (voidptr)&/*qq*/(*node._v__ast__EnumVal)); + v__ast__Type _t25 = (*node._v__ast__DumpExpr).expr_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52343,8 +52425,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t25; } - else if (node._typ == 307 /* v.ast.FloatLiteral */) { - v__ast__Type _t26 = _const_v__ast__float_literal_type; + else if (node._typ == 306 /* v.ast.EnumVal */) { + v__ast__Type _t26 = v__checker__Checker_enum_val(c, (voidptr)&/*qq*/(*node._v__ast__EnumVal)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52352,8 +52434,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t26; } - else if (node._typ == 308 /* v.ast.GoExpr */) { - v__ast__Type _t27 = v__checker__Checker_go_expr(c, (voidptr)&/*qq*/(*node._v__ast__GoExpr)); + else if (node._typ == 307 /* v.ast.FloatLiteral */) { + v__ast__Type _t27 = _const_v__ast__float_literal_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52361,8 +52443,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t27; } - else if (node._typ == 309 /* v.ast.Ident */) { - v__ast__Type _t28 = v__checker__Checker_ident(c, (voidptr)&/*qq*/(*node._v__ast__Ident)); + else if (node._typ == 308 /* v.ast.GoExpr */) { + v__ast__Type _t28 = v__checker__Checker_go_expr(c, (voidptr)&/*qq*/(*node._v__ast__GoExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52370,8 +52452,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t28; } - else if (node._typ == 310 /* v.ast.IfExpr */) { - v__ast__Type _t29 = v__checker__Checker_if_expr(c, (voidptr)&/*qq*/(*node._v__ast__IfExpr)); + else if (node._typ == 309 /* v.ast.Ident */) { + v__ast__Type _t29 = v__checker__Checker_ident(c, (voidptr)&/*qq*/(*node._v__ast__Ident)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52379,6 +52461,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t29; } + else if (node._typ == 310 /* v.ast.IfExpr */) { + v__ast__Type _t30 = v__checker__Checker_if_expr(c, (voidptr)&/*qq*/(*node._v__ast__IfExpr)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t30; + } else if (node._typ == 311 /* v.ast.IfGuardExpr */) { bool old_inside_if_guard = c->inside_if_guard; c->inside_if_guard = true; @@ -52406,16 +52497,7 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_error(c, _SLIT("expression should either return an option or a result"), v__ast__Expr_pos((*node._v__ast__IfGuardExpr).expr)); } } - v__ast__Type _t30 = _const_v__ast__bool_type; - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t30; - } - else if (node._typ == 312 /* v.ast.IndexExpr */) { - v__ast__Type _t31 = v__checker__Checker_index_expr(c, (voidptr)&/*qq*/(*node._v__ast__IndexExpr)); + v__ast__Type _t31 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52423,8 +52505,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t31; } - else if (node._typ == 313 /* v.ast.InfixExpr */) { - v__ast__Type _t32 = v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*node._v__ast__InfixExpr)); + else if (node._typ == 312 /* v.ast.IndexExpr */) { + v__ast__Type _t32 = v__checker__Checker_index_expr(c, (voidptr)&/*qq*/(*node._v__ast__IndexExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52432,8 +52514,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t32; } - else if (node._typ == 314 /* v.ast.IntegerLiteral */) { - v__ast__Type _t33 = v__checker__Checker_int_lit(c, (voidptr)&/*qq*/(*node._v__ast__IntegerLiteral)); + else if (node._typ == 313 /* v.ast.InfixExpr */) { + v__ast__Type _t33 = v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*node._v__ast__InfixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52441,8 +52523,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t33; } - else if (node._typ == 317 /* v.ast.LockExpr */) { - v__ast__Type _t34 = v__checker__Checker_lock_expr(c, (voidptr)&/*qq*/(*node._v__ast__LockExpr)); + else if (node._typ == 314 /* v.ast.IntegerLiteral */) { + v__ast__Type _t34 = v__checker__Checker_int_lit(c, (voidptr)&/*qq*/(*node._v__ast__IntegerLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52450,8 +52532,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t34; } - else if (node._typ == 318 /* v.ast.MapInit */) { - v__ast__Type _t35 = v__checker__Checker_map_init(c, (voidptr)&/*qq*/(*node._v__ast__MapInit)); + else if (node._typ == 317 /* v.ast.LockExpr */) { + v__ast__Type _t35 = v__checker__Checker_lock_expr(c, (voidptr)&/*qq*/(*node._v__ast__LockExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52459,8 +52541,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t35; } - else if (node._typ == 319 /* v.ast.MatchExpr */) { - v__ast__Type _t36 = v__checker__Checker_match_expr(c, (voidptr)&/*qq*/(*node._v__ast__MatchExpr)); + else if (node._typ == 318 /* v.ast.MapInit */) { + v__ast__Type _t36 = v__checker__Checker_map_init(c, (voidptr)&/*qq*/(*node._v__ast__MapInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52468,8 +52550,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t36; } - else if (node._typ == 325 /* v.ast.PostfixExpr */) { - v__ast__Type _t37 = v__checker__Checker_postfix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PostfixExpr)); + else if (node._typ == 319 /* v.ast.MatchExpr */) { + v__ast__Type _t37 = v__checker__Checker_match_expr(c, (voidptr)&/*qq*/(*node._v__ast__MatchExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52477,8 +52559,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t37; } - else if (node._typ == 326 /* v.ast.PrefixExpr */) { - v__ast__Type _t38 = v__checker__Checker_prefix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PrefixExpr)); + else if (node._typ == 325 /* v.ast.PostfixExpr */) { + v__ast__Type _t38 = v__checker__Checker_postfix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PostfixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52486,8 +52568,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t38; } - else if (node._typ == 321 /* v.ast.None */) { - v__ast__Type _t39 = _const_v__ast__none_type; + else if (node._typ == 326 /* v.ast.PrefixExpr */) { + v__ast__Type _t39 = v__checker__Checker_prefix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PrefixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52495,8 +52577,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t39; } - else if (node._typ == 323 /* v.ast.OrExpr */) { - v__ast__Type _t40 = _const_v__ast__void_type; + else if (node._typ == 321 /* v.ast.None */) { + v__ast__Type _t40 = _const_v__ast__none_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52504,11 +52586,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t40; } - else if (node._typ == 324 /* v.ast.ParExpr */) { - if (((*node._v__ast__ParExpr).expr)._typ == 324 /* v.ast.ParExpr */) { - v__checker__Checker_warn(c, _SLIT("redundant parentheses are used"), (*node._v__ast__ParExpr).pos); - } - v__ast__Type _t41 = v__checker__Checker_expr(c, (*node._v__ast__ParExpr).expr); + else if (node._typ == 323 /* v.ast.OrExpr */) { + v__ast__Type _t41 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52516,8 +52595,11 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t41; } - else if (node._typ == 327 /* v.ast.RangeExpr */) { - v__ast__Type _t42 = _const_v__ast__void_type; + else if (node._typ == 324 /* v.ast.ParExpr */) { + if (((*node._v__ast__ParExpr).expr)._typ == 324 /* v.ast.ParExpr */) { + v__checker__Checker_warn(c, _SLIT("redundant parentheses are used"), (*node._v__ast__ParExpr).pos); + } + v__ast__Type _t42 = v__checker__Checker_expr(c, (*node._v__ast__ParExpr).expr); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52525,8 +52607,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t42; } - else if (node._typ == 328 /* v.ast.SelectExpr */) { - v__ast__Type _t43 = v__checker__Checker_select_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectExpr)); + else if (node._typ == 327 /* v.ast.RangeExpr */) { + v__ast__Type _t43 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52534,8 +52616,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t43; } - else if (node._typ == 329 /* v.ast.SelectorExpr */) { - v__ast__Type _t44 = v__checker__Checker_selector_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectorExpr)); + else if (node._typ == 328 /* v.ast.SelectExpr */) { + v__ast__Type _t44 = v__checker__Checker_select_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52543,11 +52625,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t44; } - else if (node._typ == 330 /* v.ast.SizeOf */) { - if (!(*node._v__ast__SizeOf).is_type) { - (*node._v__ast__SizeOf).typ = v__checker__Checker_expr(c, (*node._v__ast__SizeOf).expr); - } - v__ast__Type _t45 = _const_v__ast__u32_type; + else if (node._typ == 329 /* v.ast.SelectorExpr */) { + v__ast__Type _t45 = v__checker__Checker_selector_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectorExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52555,11 +52634,11 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t45; } - else if (node._typ == 315 /* v.ast.IsRefType */) { - if (!(*node._v__ast__IsRefType).is_type) { - (*node._v__ast__IsRefType).typ = v__checker__Checker_expr(c, (*node._v__ast__IsRefType).expr); + else if (node._typ == 330 /* v.ast.SizeOf */) { + if (!(*node._v__ast__SizeOf).is_type) { + (*node._v__ast__SizeOf).typ = v__checker__Checker_expr(c, (*node._v__ast__SizeOf).expr); } - v__ast__Type _t46 = _const_v__ast__bool_type; + v__ast__Type _t46 = _const_v__ast__u32_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52567,8 +52646,11 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t46; } - else if (node._typ == 322 /* v.ast.OffsetOf */) { - v__ast__Type _t47 = v__checker__Checker_offset_of(c, (*node._v__ast__OffsetOf)); + else if (node._typ == 315 /* v.ast.IsRefType */) { + if (!(*node._v__ast__IsRefType).is_type) { + (*node._v__ast__IsRefType).typ = v__checker__Checker_expr(c, (*node._v__ast__IsRefType).expr); + } + v__ast__Type _t47 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52576,8 +52658,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t47; } - else if (node._typ == 331 /* v.ast.SqlExpr */) { - v__ast__Type _t48 = v__checker__Checker_sql_expr(c, (voidptr)&/*qq*/(*node._v__ast__SqlExpr)); + else if (node._typ == 322 /* v.ast.OffsetOf */) { + v__ast__Type _t48 = v__checker__Checker_offset_of(c, (*node._v__ast__OffsetOf)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52585,26 +52667,26 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t48; } - else if (node._typ == 333 /* v.ast.StringLiteral */) { - if ((*node._v__ast__StringLiteral).language == v__ast__Language__c) { - v__ast__Type _t49 = v__ast__Type_set_nr_muls(_const_v__ast__byte_type, 1); - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t49; - } - v__ast__Type _t50 = v__checker__Checker_string_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringLiteral)); + else if (node._typ == 331 /* v.ast.SqlExpr */) { + v__ast__Type _t49 = v__checker__Checker_sql_expr(c, (voidptr)&/*qq*/(*node._v__ast__SqlExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t50; + return _t49; } - else if (node._typ == 332 /* v.ast.StringInterLiteral */) { - v__ast__Type _t51 = v__checker__Checker_string_inter_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringInterLiteral)); + else if (node._typ == 333 /* v.ast.StringLiteral */) { + if ((*node._v__ast__StringLiteral).language == v__ast__Language__c) { + v__ast__Type _t50 = v__ast__Type_set_nr_muls(_const_v__ast__byte_type, 1); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t50; + } + v__ast__Type _t51 = v__checker__Checker_string_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52612,26 +52694,26 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t51; } - else if (node._typ == 334 /* v.ast.StructInit */) { - if ((*node._v__ast__StructInit).unresolved) { - v__ast__Type _t52 = v__checker__Checker_expr(c, v__ast__resolve_init((*node._v__ast__StructInit), v__checker__Checker_unwrap_generic(c, (*node._v__ast__StructInit).typ), c->table)); - // Defer begin - if (v__checker__Checker_expr_defer_0) { - c->expr_level--; - } - // Defer end - return _t52; - } - v__ast__Type _t53 = v__checker__Checker_struct_init(c, (voidptr)&/*qq*/(*node._v__ast__StructInit)); + else if (node._typ == 332 /* v.ast.StringInterLiteral */) { + v__ast__Type _t52 = v__checker__Checker_string_inter_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringInterLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t53; + return _t52; } - else if (node._typ == 335 /* v.ast.TypeNode */) { - v__ast__Type _t54 = (*node._v__ast__TypeNode).typ; + else if (node._typ == 334 /* v.ast.StructInit */) { + if ((*node._v__ast__StructInit).unresolved) { + v__ast__Type _t53 = v__checker__Checker_expr(c, v__ast__resolve_init((*node._v__ast__StructInit), v__checker__Checker_unwrap_generic(c, (*node._v__ast__StructInit).typ), c->table)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t53; + } + v__ast__Type _t54 = v__checker__Checker_struct_init(c, (voidptr)&/*qq*/(*node._v__ast__StructInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52639,9 +52721,11 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t54; } - else if (node._typ == 336 /* v.ast.TypeOf */) { - (*node._v__ast__TypeOf).expr_type = v__checker__Checker_expr(c, (*node._v__ast__TypeOf).expr); - v__ast__Type _t55 = _const_v__ast__string_type; + else if (node._typ == 335 /* v.ast.TypeNode */) { + if (!c->inside_x_is_type && v__ast__Type_has_flag((*node._v__ast__TypeNode).typ, v__ast__TypeFlag__generic) && c->table->cur_fn != 0 && c->table->cur_fn->generic_names.len == 0) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected generic variable in non-generic function `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__TypeNode).pos); + } + v__ast__Type _t55 = (*node._v__ast__TypeNode).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52649,8 +52733,9 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t55; } - else if (node._typ == 337 /* v.ast.UnsafeExpr */) { - v__ast__Type _t56 = v__checker__Checker_unsafe_expr(c, (voidptr)&/*qq*/(*node._v__ast__UnsafeExpr)); + else if (node._typ == 336 /* v.ast.TypeOf */) { + (*node._v__ast__TypeOf).expr_type = v__checker__Checker_expr(c, (*node._v__ast__TypeOf).expr); + v__ast__Type _t56 = _const_v__ast__string_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; @@ -52658,6 +52743,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t56; } + else if (node._typ == 337 /* v.ast.UnsafeExpr */) { + v__ast__Type _t57 = v__checker__Checker_unsafe_expr(c, (voidptr)&/*qq*/(*node._v__ast__UnsafeExpr)); + // Defer begin + if (v__checker__Checker_expr_defer_0) { + c->expr_level--; + } + // Defer end + return _t57; + } else if (node._typ == 316 /* v.ast.Likely */) { v__ast__Type ltype = v__checker__Checker_expr(c, (*node._v__ast__Likely).expr); if (!v__checker__Checker_check_types(c, ltype, _const_v__ast__bool_type)) { @@ -52665,22 +52759,22 @@ bool v__checker__Checker_expr_defer_0 = false; string lname = ((*node._v__ast__Likely).is_likely ? (_SLIT("_likely_")) : (_SLIT("_unlikely_"))); v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = lname}}, {_SLIT("()` expects a boolean expression, instead it got `"), /*115 &string*/0xfe10, {.d_s = ltype_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__Likely).pos); } - v__ast__Type _t57 = _const_v__ast__bool_type; + v__ast__Type _t58 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t57; + return _t58; } ; - v__ast__Type _t58 = _const_v__ast__void_type; + v__ast__Type _t59 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { c->expr_level--; } // Defer end - return _t58; + return _t59; } v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastExpr* node) { @@ -52850,7 +52944,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE } if (_t3.state == 0) { - v__ast__EnumDecl enum_decl = *(v__ast__EnumDecl*)_t3.data; + v__ast__EnumDecl enum_decl = (*(v__ast__EnumDecl*)_t3.data); bool in_range = false; if (enum_decl.is_flag) { int max_val = (1 << enum_decl.fields.len) - 1; @@ -53529,8 +53623,8 @@ v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__Po string typ_str = v__ast__Table_type_to_str(c->table, typ); v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid operation: "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" (non-numeric type `"), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); } else { - multi_return_string_v__token__Pos mr_97509 = v__checker__Checker_fail_if_immutable(c, node->expr); - node->auto_locked = mr_97509.arg0; + multi_return_string_v__token__Pos mr_97972 = v__checker__Checker_fail_if_immutable(c, node->expr); + node->auto_locked = mr_97972.arg0; } v__ast__Type _t1 = typ; return _t1; @@ -54265,7 +54359,9 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr } VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Checker* c, v__ast__ComptimeCall* node) { - node->left_type = v__checker__Checker_expr(c, node->left); + if ((node->left)._typ != 305 /* v.ast.EmptyExpr */) { + node->left_type = v__checker__Checker_expr(c, node->left); + } if (string__eq(node->method_name, _SLIT("compile_error"))) { v__checker__Checker_error(c, node->args_var, node->pos); v__ast__Type _t1 = _const_v__ast__void_type; @@ -54310,7 +54406,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check if (node->is_vweb) { v__ast__FnDecl* save_cur_fn = c->table->cur_fn; v__pref__Preferences *pref_ = HEAP(v__pref__Preferences, (*c->pref)); - v__pref__Preferences* pref2 = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){(*(pref_)).cache_manager,(*(pref_)).profile_fns,(*(pref_)).lookup_path,(*(pref_)).run_only,(*(pref_)).compile_defines,(*(pref_)).compile_defines_all,(*(pref_)).run_args,(*(pref_)).printfn_list,(*(pref_)).cleanup_files,(*(pref_)).build_options,(*(pref_)).test_runner,(*(pref_)).profile_file,(*(pref_)).dump_c_flags,(*(pref_)).dump_modules,(*(pref_)).dump_files,(*(pref_)).cflags,(*(pref_)).ccompiler,(*(pref_)).third_party_option,(*(pref_)).bare_builtin_dir,(*(pref_)).custom_prelude,(*(pref_)).cmain,(*(pref_)).vroot,(*(pref_)).out_name_c,(*(pref_)).out_name,(*(pref_)).path,(*(pref_)).message_limit,(*(pref_)).checker_match_exhaustive_cutoff_limit,(*(pref_)).thread_stack_size,(*(pref_)).os,(*(pref_)).arch,(*(pref_)).backend,(*(pref_)).ccompiler_type,(*(pref_)).gc_mode,(*(pref_)).use_color,(*(pref_)).assert_failure_mode,(*(pref_)).build_mode,(*(pref_)).output_mode,(*(pref_)).is_verbose,(*(pref_)).is_glibc,(*(pref_)).is_musl,(*(pref_)).is_test,(*(pref_)).is_script,(*(pref_)).is_vsh,(*(pref_)).is_livemain,(*(pref_)).is_liveshared,(*(pref_)).is_shared,(*(pref_)).is_o,(*(pref_)).is_prof,(*(pref_)).is_prod,(*(pref_)).is_repl,(*(pref_)).is_run,(*(pref_)).is_crun,(*(pref_)).is_debug,(*(pref_)).is_vlines,(*(pref_)).is_stats,(*(pref_)).is_fmt,(*(pref_)).is_vet,.is_vweb = true,(*(pref_)).is_ios_simulator,(*(pref_)).is_apk,(*(pref_)).is_help,(*(pref_)).is_cstrict,(*(pref_)).profile_no_inline,(*(pref_)).translated,(*(pref_)).obfuscate,(*(pref_)).sanitize,(*(pref_)).sourcemap,(*(pref_)).sourcemap_inline,(*(pref_)).sourcemap_src_included,(*(pref_)).show_cc,(*(pref_)).show_c_output,(*(pref_)).show_callgraph,(*(pref_)).show_depgraph,(*(pref_)).use_cache,(*(pref_)).retry_compilation,(*(pref_)).m64,(*(pref_)).building_v,(*(pref_)).autofree,(*(pref_)).compress,(*(pref_)).no_builtin,(*(pref_)).enable_globals,(*(pref_)).is_bare,(*(pref_)).no_preludes,(*(pref_)).output_cross_c,(*(pref_)).output_es5,(*(pref_)).prealloc,(*(pref_)).print_v_files,(*(pref_)).skip_running,(*(pref_)).skip_warnings,(*(pref_)).warn_impure_v,(*(pref_)).warns_are_errors,(*(pref_)).fatal_errors,(*(pref_)).reuse_tmpc,(*(pref_)).no_rsp,(*(pref_)).no_std,(*(pref_)).no_parallel,(*(pref_)).only_check_syntax,(*(pref_)).check_only,(*(pref_)).experimental,(*(pref_)).skip_unused,(*(pref_)).show_timings,(*(pref_)).nofloat,}, sizeof(v__pref__Preferences))); + v__pref__Preferences* pref2 = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){(*(pref_)).cache_manager,(*(pref_)).profile_fns,(*(pref_)).lookup_path,(*(pref_)).run_only,(*(pref_)).compile_defines,(*(pref_)).compile_defines_all,(*(pref_)).run_args,(*(pref_)).printfn_list,(*(pref_)).cleanup_files,(*(pref_)).build_options,(*(pref_)).test_runner,(*(pref_)).profile_file,(*(pref_)).dump_c_flags,(*(pref_)).dump_modules,(*(pref_)).dump_files,(*(pref_)).cflags,(*(pref_)).ccompiler,(*(pref_)).third_party_option,(*(pref_)).bare_builtin_dir,(*(pref_)).custom_prelude,(*(pref_)).cmain,(*(pref_)).vroot,(*(pref_)).out_name_c,(*(pref_)).out_name,(*(pref_)).path,(*(pref_)).message_limit,(*(pref_)).checker_match_exhaustive_cutoff_limit,(*(pref_)).thread_stack_size,(*(pref_)).os,(*(pref_)).arch,(*(pref_)).gc_mode,(*(pref_)).backend,(*(pref_)).ccompiler_type,(*(pref_)).use_color,(*(pref_)).assert_failure_mode,(*(pref_)).build_mode,(*(pref_)).output_mode,(*(pref_)).is_verbose,(*(pref_)).is_glibc,(*(pref_)).is_musl,(*(pref_)).is_test,(*(pref_)).is_script,(*(pref_)).is_vsh,(*(pref_)).is_livemain,(*(pref_)).is_liveshared,(*(pref_)).is_shared,(*(pref_)).is_o,(*(pref_)).is_prof,(*(pref_)).is_prod,(*(pref_)).is_repl,(*(pref_)).is_run,(*(pref_)).is_crun,(*(pref_)).is_debug,(*(pref_)).is_vlines,(*(pref_)).is_stats,(*(pref_)).is_fmt,(*(pref_)).is_vet,.is_vweb = true,(*(pref_)).is_ios_simulator,(*(pref_)).is_apk,(*(pref_)).is_help,(*(pref_)).is_cstrict,(*(pref_)).profile_no_inline,(*(pref_)).translated,(*(pref_)).obfuscate,(*(pref_)).sanitize,(*(pref_)).sourcemap,(*(pref_)).sourcemap_inline,(*(pref_)).sourcemap_src_included,(*(pref_)).show_cc,(*(pref_)).show_c_output,(*(pref_)).show_callgraph,(*(pref_)).show_depgraph,(*(pref_)).use_cache,(*(pref_)).retry_compilation,(*(pref_)).m64,(*(pref_)).building_v,(*(pref_)).autofree,(*(pref_)).compress,(*(pref_)).no_builtin,(*(pref_)).enable_globals,(*(pref_)).is_bare,(*(pref_)).no_preludes,(*(pref_)).output_cross_c,(*(pref_)).output_es5,(*(pref_)).prealloc,(*(pref_)).print_v_files,(*(pref_)).skip_running,(*(pref_)).skip_warnings,(*(pref_)).warn_impure_v,(*(pref_)).warns_are_errors,(*(pref_)).fatal_errors,(*(pref_)).reuse_tmpc,(*(pref_)).no_rsp,(*(pref_)).no_std,(*(pref_)).no_parallel,(*(pref_)).only_check_syntax,(*(pref_)).check_only,(*(pref_)).experimental,(*(pref_)).skip_unused,(*(pref_)).show_timings,(*(pref_)).nofloat,}, sizeof(v__pref__Preferences))); v__checker__Checker* c2 = v__checker__new_checker(c->table, pref2); c2->comptime_call_pos = node->pos.pos; v__checker__Checker_check(c2, (voidptr)&/*qq*/node->vweb_tmpl); @@ -54433,8 +54529,8 @@ VV_LOCAL_SYMBOL _option_v__ast__ComptTimeConstValue v__checker__Checker_eval_com return _t2; } else if (expr._typ == 330 /* v.ast.SizeOf */) { - multi_return_int_int mr_4820 = v__ast__Table_type_size(c->table, (*expr._v__ast__SizeOf).typ); - int s = mr_4820.arg0; + multi_return_int_int mr_4858 = v__ast__Table_type_size(c->table, (*expr._v__ast__SizeOf).typ); + int s = mr_4858.arg0; _option_v__ast__ComptTimeConstValue _t3; opt_ok2(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(&s) }, (_option*)(&_t3), sizeof(v__ast__ComptTimeConstValue)); return _t3; @@ -55621,10 +55717,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_verify_all_vweb_routes(v__checker__Chec for (int _t2 = 0; _t2 < sym_app->methods.len; ++_t2) { v__ast__Fn m = ((v__ast__Fn*)sym_app->methods.data)[_t2]; if (m.return_type == typ_vweb_result) { - multi_return_bool_int_int mr_10935 = v__checker__Checker_verify_vweb_params_for_method(c, m); - bool is_ok = mr_10935.arg0; - int nroute_attributes = mr_10935.arg1; - int nargs = mr_10935.arg2; + multi_return_bool_int_int mr_10973 = v__checker__Checker_verify_vweb_params_for_method(c, m); + bool is_ok = mr_10973.arg0; + int nroute_attributes = mr_10973.arg1; + int nargs = mr_10973.arg2; if (!is_ok) { v__ast__FnDecl* f = ((v__ast__FnDecl*)(m.source_fn)); if (isnil(f)) { @@ -56815,7 +56911,11 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr; if ((expr)._typ == 335 /* v.ast.TypeNode */) { - v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, (*expr._v__ast__TypeNode).typ)); + v__ast__Type unwrapped_typ = v__checker__Checker_unwrap_generic(c, (*expr._v__ast__TypeNode).typ); + if (v__ast__Table_sym(c->table, (*expr._v__ast__TypeNode).typ)->kind == v__ast__Kind__struct_ && v__ast__Type_has_flag((*expr._v__ast__TypeNode).typ, v__ast__TypeFlag__generic)) { + unwrapped_typ = v__ast__Table_unwrap_generic_type(c->table, (*expr._v__ast__TypeNode).typ, c->table->cur_fn->generic_names, c->table->cur_concrete_types); + } + v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, unwrapped_typ); if (v__ast__Table_known_type(c->table, sym->name) && sym->kind != v__ast__Kind__placeholder) { v__ast__Kind kind = sym->kind; if ((sym->info)._typ == 475 /* v.ast.Alias */) { @@ -57152,9 +57252,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("function with `shared` arguments cannot be called inside `lock`/`rlock` block"), call_arg->pos); } if (call_arg->is_mut) { - multi_return_string_v__token__Pos mr_28998 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); - string to_lock = mr_28998.arg0; - v__token__Pos pos = mr_28998.arg1; + multi_return_string_v__token__Pos mr_29240 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); + string to_lock = mr_29240.arg0; + v__token__Pos pos = mr_29240.arg1; if (!v__ast__Expr_is_lvalue(call_arg->expr)) { v__checker__Checker_error(c, _SLIT("cannot pass expression as `mut`"), v__ast__Expr_pos(call_arg->expr)); } @@ -57194,7 +57294,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } continue; } - if (v__ast__Type_is_ptr(param.typ) && !param.is_mut && !v__ast__Type_is_real_pointer(call_arg->typ) && v__ast__Expr_is_literal(call_arg->expr) && func.language == v__ast__Language__v) { + if (v__ast__Type_is_ptr(param.typ) && !param.is_mut && !v__ast__Type_is_real_pointer(call_arg->typ) && v__ast__Expr_is_literal(call_arg->expr) && func.language == v__ast__Language__v && !c->pref->translated) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("literal argument cannot be passed as reference parameter `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, param.typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); } _option_void _t32 = v__checker__Checker_check_expected_call_arg(c, arg_typ, v__checker__Checker_unwrap_generic(c, param.typ), node->language, *call_arg); @@ -57470,14 +57570,14 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal has_method = true; } else { IError err = _t17.err; - if (left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_) { + if (final_left_sym->kind == v__ast__Kind__struct_ || final_left_sym->kind == v__ast__Kind__sum_type || final_left_sym->kind == v__ast__Kind__interface_) { v__ast__Type parent_type = _const_v__ast__void_type; - if ((left_sym->info)._typ == 459 /* v.ast.Struct */) { - parent_type = (*left_sym->info._v__ast__Struct).parent_type; - } else if ((left_sym->info)._typ == 479 /* v.ast.SumType */) { - parent_type = (*left_sym->info._v__ast__SumType).parent_type; - } else if ((left_sym->info)._typ == 478 /* v.ast.Interface */) { - parent_type = (*left_sym->info._v__ast__Interface).parent_type; + if ((final_left_sym->info)._typ == 459 /* v.ast.Struct */) { + parent_type = (*final_left_sym->info._v__ast__Struct).parent_type; + } else if ((final_left_sym->info)._typ == 479 /* v.ast.SumType */) { + parent_type = (*final_left_sym->info._v__ast__SumType).parent_type; + } else if ((final_left_sym->info)._typ == 478 /* v.ast.Interface */) { + parent_type = (*final_left_sym->info._v__ast__Interface).parent_type; } if (parent_type != 0) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, parent_type); @@ -57493,7 +57593,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (!has_method) { has_method = true; Array_v__ast__Type embed_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - _option_multi_return_v__ast__Fn_Array_v__ast__Type _t19 = v__ast__Table_find_method_from_embeds(c->table, left_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t19 = v__ast__Table_find_method_from_embeds(c->table, final_left_sym, method_name); if (_t19.state != 0) { /*or block*/ IError err = _t19.err; if ((IError_name_table[err._typ]._method_msg(err._object)).len != 0) { @@ -57503,20 +57603,20 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal *(multi_return_v__ast__Fn_Array_v__ast__Type*) _t19.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_43216 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t19.data); - method = mr_43216.arg0; - embed_types = mr_43216.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_43522 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t19.data); + method = mr_43522.arg0; + embed_types = mr_43522.arg1; if (embed_types.len != 0) { is_method_from_embed = true; node->from_embed_types = embed_types; } } - if (left_sym->kind == v__ast__Kind__aggregate) { + if (final_left_sym->kind == v__ast__Kind__aggregate) { unknown_method_msg = IError_name_table[err._typ]._method_msg(err._object); } } if (has_method) { - v__ast__TypeSymbol* rec_sym = v__ast__Table_sym(c->table, node->left_type); + v__ast__TypeSymbol* rec_sym = v__ast__Table_final_sym(c->table, node->left_type); bool rec_is_generic = v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic); Array_v__ast__Type rec_concrete_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); if ((rec_sym->info)._typ == 459 /* v.ast.Struct */) { @@ -57553,9 +57653,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__checker__Checker_error(c, _SLIT("method with `shared` receiver cannot be called inside `lock`/`rlock` block"), node->pos); } if ((*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).is_mut) { - multi_return_string_v__token__Pos mr_45526 = v__checker__Checker_fail_if_immutable(c, node->left); - string to_lock = mr_45526.arg0; - v__token__Pos pos = mr_45526.arg1; + multi_return_string_v__token__Pos mr_45850 = v__checker__Checker_fail_if_immutable(c, node->left); + string to_lock = mr_45850.arg0; + v__token__Pos pos = mr_45850.arg1; if (!v__ast__Expr_is_lvalue(node->left)) { v__checker__Checker_error(c, _SLIT("cannot pass expression as `mut`"), v__ast__Expr_pos(node->left)); } @@ -57663,9 +57763,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__checker__Checker_error(c, _SLIT("method with `shared` arguments cannot be called inside `lock`/`rlock` block"), arg->pos); } if (arg->is_mut) { - multi_return_string_v__token__Pos mr_49428 = v__checker__Checker_fail_if_immutable(c, arg->expr); - string to_lock = mr_49428.arg0; - v__token__Pos pos = mr_49428.arg1; + multi_return_string_v__token__Pos mr_49752 = v__checker__Checker_fail_if_immutable(c, arg->expr); + string to_lock = mr_49752.arg0; + v__token__Pos pos = mr_49752.arg1; if (!param_is_mut) { string tok = v__ast__ShareType_str(arg->share); v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` is not `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("`, `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("` is not needed`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); @@ -57715,7 +57815,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } continue; } - if (v__ast__Type_is_ptr(param.typ) && !v__ast__Type_is_real_pointer(arg->typ) && v__ast__Expr_is_literal(arg->expr)) { + if (v__ast__Type_is_ptr(param.typ) && !v__ast__Type_is_real_pointer(arg->typ) && v__ast__Expr_is_literal(arg->expr) && !c->pref->translated) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("literal argument cannot be passed as reference parameter `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, param.typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); } _option_void _t31 = v__checker__Checker_check_expected_call_arg(c, got_arg_typ, exp_arg_typ, node->language, *arg); @@ -57852,8 +57952,8 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal return _t44; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_56878 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t43.data); - node->from_embed_types = mr_56878.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_57228 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t43.data); + node->from_embed_types = mr_57228.arg1; v__ast__Type _t45 = info.func.return_type; return _t45; } @@ -58462,9 +58562,11 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_stmt(v__checker__Checker* c, v__ast c->in_for_count++; string prev_loop_label = c->loop_label; c->expected_type = _const_v__ast__bool_type; - v__ast__Type typ = v__checker__Checker_expr(c, node->cond); - if (!node->is_inf && v__ast__Type_idx(typ) != _const_v__ast__bool_type_idx && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, _SLIT("non-bool used as for condition"), node->pos); + if ((node->cond)._typ != 305 /* v.ast.EmptyExpr */) { + v__ast__Type typ = v__checker__Checker_expr(c, node->cond); + if (!node->is_inf && v__ast__Type_idx(typ) != _const_v__ast__bool_type_idx && !c->pref->translated && !c->file->is_translated) { + v__checker__Checker_error(c, _SLIT("non-bool used as for condition"), node->pos); + } } if ((node->cond)._typ == 313 /* v.ast.InfixExpr */) { if ((*node->cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { @@ -58813,7 +58915,13 @@ v__ast__Type former_expected_type; v__ast__Type left_type = v__checker__Checker_expr(c, node->left); node->left_type = left_type; c->expected_type = left_type; + if (node->op == v__token__Kind__key_is) { + c->inside_x_is_type = true; + } v__ast__Type right_type = v__checker__Checker_expr(c, node->right); + if (node->op == v__token__Kind__key_is) { + c->inside_x_is_type = false; + } node->right_type = right_type; if (v__ast__Type_is_number(left_type) && !v__ast__Type_is_ptr(left_type) && (v__ast__Type_alias_eq(right_type, _const_v__ast__int_literal_type) || v__ast__Type_alias_eq(right_type, _const_v__ast__float_literal_type))) { node->right_type = left_type; @@ -58895,10 +59003,10 @@ v__ast__Type former_expected_type; v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("negative value cannot be compared with `"), /*115 &string*/0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node->left._v__ast__IntegerLiteral).pos); } } else if (is_left_type_signed != is_right_type_signed && left_type != _const_v__ast__int_literal_type_idx && right_type != _const_v__ast__int_literal_type_idx) { - multi_return_int_int mr_3899 = v__ast__Table_type_size(c->table, left_type); - int ls = mr_3899.arg0; - multi_return_int_int mr_3942 = v__ast__Table_type_size(c->table, right_type); - int rs = mr_3942.arg0; + multi_return_int_int mr_4013 = v__ast__Table_type_size(c->table, left_type); + int ls = mr_4013.arg0; + multi_return_int_int mr_4056 = v__ast__Table_type_size(c->table, right_type); + int rs = mr_4056.arg0; if (!c->pref->translated && ((is_left_type_signed && ls < rs) || (is_right_type_signed && rs < ls))) { string lt = v__ast__Table_sym(c->table, left_type)->name; string rt = v__ast__Table_sym(c->table, right_type)->name; @@ -59172,8 +59280,8 @@ v__ast__Type former_expected_type; v__checker__Checker_error(c, _SLIT("array append cannot be used in an expression"), node->pos); } v__checker__Checker_check_expr_opt_call(c, node->right, right_type); - multi_return_string_v__token__Pos mr_14744 = v__checker__Checker_fail_if_immutable(c, node->left); - node->auto_locked = mr_14744.arg0; + multi_return_string_v__token__Pos mr_14858 = v__checker__Checker_fail_if_immutable(c, node->left); + node->auto_locked = mr_14858.arg0; v__ast__Type left_value_type = v__ast__Table_value_type(c->table, v__checker__Checker_unwrap_generic(c, left_type)); v__ast__TypeSymbol* left_value_sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, left_value_type)); if (left_value_sym->kind == v__ast__Kind__interface_) { @@ -59648,7 +59756,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac } if (_t8.state == 0) { - v__ast__InterfaceDecl embed_decl = *(v__ast__InterfaceDecl*)_t8.data; + v__ast__InterfaceDecl embed_decl = (*(v__ast__InterfaceDecl*)_t8.data); for (int _t10 = 0; _t10 < embed_decl.fields.len; ++_t10) { v__ast__StructField f = ((v__ast__StructField*)embed_decl.fields.data)[_t10]; if (_IN_MAP(ADDR(string, f.name), ADDR(map, efnames))) { @@ -61654,7 +61762,7 @@ VV_LOCAL_SYMBOL bool v__transformer__IndexState_safe_access(v__transformer__Inde return _t4; } - int old = *(int*)_t2.data; + int old = (*(int*)_t2.data); if (_v_new > old) { if (old < -1) { ; @@ -61689,7 +61797,7 @@ VV_LOCAL_SYMBOL int v__transformer__IndexState_safe_offset(v__transformer__Index *(int*) _t3.data = -1; } - int _t2 = *(int*)_t3.data; + int _t2 = (*(int*)_t3.data); return _t2; } @@ -63226,7 +63334,7 @@ bool v__markused__mark_used_defer_0 = false; *(Array_v__ast__Type*) _t40.data = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); } - Array_v__ast__Type orm_connection_implementations = *(Array_v__ast__Type*)_t40.data; + Array_v__ast__Type orm_connection_implementations = (*(Array_v__ast__Type*)_t40.data); if (orm_connection_implementations.len > 0) { int _t43 = all_fns.key_values.len; for (int _t42 = 0; _t42 < _t43; ++_t42 ) { @@ -63429,7 +63537,7 @@ void v__markused__Walker_mark_const_as_used(v__markused__Walker* w, string ckey) return; } - v__ast__ConstField cfield = *(v__ast__ConstField*)_t1.data; + v__ast__ConstField cfield = (*(v__ast__ConstField*)_t1.data); v__markused__Walker_expr(w, cfield.expr); } @@ -63451,7 +63559,7 @@ void v__markused__Walker_mark_global_as_used(v__markused__Walker* w, string ckey return; } - v__ast__GlobalField gfield = *(v__ast__GlobalField*)_t1.data; + v__ast__GlobalField gfield = (*(v__ast__GlobalField*)_t1.data); v__markused__Walker_expr(w, gfield.expr); } @@ -63983,7 +64091,7 @@ void v__markused__Walker_call_expr(v__markused__Walker* w, v__ast__CallExpr* nod return; } - v__ast__FnDecl stmt = *(v__ast__FnDecl*)_t2.data; + v__ast__FnDecl stmt = (*(v__ast__FnDecl*)_t2.data); if (string__eq(stmt.name, node->name)) { if (!node->is_method || (v__ast__Type_alias_eq(node->receiver_type, stmt.receiver.typ))) { v__markused__Walker_stmts(w, stmt.stmts); @@ -64008,7 +64116,7 @@ void v__markused__Walker_fn_by_name(v__markused__Walker* w, string fn_name) { return; } - v__ast__FnDecl stmt = *(v__ast__FnDecl*)_t1.data; + v__ast__FnDecl stmt = (*(v__ast__FnDecl*)_t1.data); v__markused__Walker_mark_fn_as_used(w, fn_name); v__markused__Walker_stmts(w, stmt.stmts); } @@ -64252,7 +64360,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ } if (is_default_array) { v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_expr(g, node.default_expr); + v__gen__c__Gen_write(g, v__gen__c__Gen_type_default(g, node.elem_type)); v__gen__c__Gen_write(g, _SLIT("}[0])")); } else if (node.has_len && v__ast__Type_alias_eq(node.elem_type, _const_v__ast__string_type)) { v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); @@ -64370,8 +64478,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal g->infix_left_var_name = _SLIT(""); g->indent++; } - v__ast__Type left_type = (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) ? (v__ast__Type_deref(v__ast__Type_clear_flag(node.left_type, v__ast__TypeFlag__shared_f))) : (node.left_type)); + v__ast__Type left_type = (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) ? (v__ast__Type_deref(v__ast__Type_clear_flag(node.left_type, v__ast__TypeFlag__shared_f))) : v__ast__Type_is_ptr(node.left_type) ? (v__ast__Type_deref(node.left_type)) : (node.left_type)); v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, left_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + if (!v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) && v__ast__Type_is_ptr(node.left_type)) { + v__gen__c__Gen_write(g, _SLIT("*")); + } v__gen__c__Gen_expr(g, node.left); if (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("->val")); @@ -65393,7 +65504,7 @@ string sref_name; *(v__ast__Type*) _t1.data = var_type; } - var_type = *(v__ast__Type*)_t1.data; + var_type = (*(v__ast__Type*)_t1.data); (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = var_type; } } @@ -65412,7 +65523,7 @@ string sref_name; *(v__ast__Type*) _t3.data = var_type; } - var_type = *(v__ast__Type*)_t3.data; + var_type = (*(v__ast__Type*)_t3.data); (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = var_type; } is_auto_heap = (*(*left->_v__ast__Ident).obj._v__ast__Var).is_auto_heap; @@ -69814,7 +69925,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { ; } - v__ast__Stmt* x = *(v__ast__Stmt**)_t1.data; + v__ast__Stmt* x = (*(v__ast__Stmt**)_t1.data); if (x->_typ == 350 /* v.ast.ForCStmt */) { if (v__ast__Scope_contains((*x->_v__ast__ForCStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); @@ -70206,7 +70317,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex v__gen__c__Gen_expr(g, expr); return; } - if ((exp_sym->info)._typ == 478 /* v.ast.Interface */ && v__ast__Type_idx(got_type) != v__ast__Type_idx(expected_type) && !v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional)) { + if ((got_sym->info)._typ != 478 /* v.ast.Interface */ && (exp_sym->info)._typ == 478 /* v.ast.Interface */ && v__ast__Type_idx(got_type) != v__ast__Type_idx(expected_type) && !v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional)) { if ((expr)._typ == 334 /* v.ast.StructInit */ && !v__ast__Type_is_ptr(got_type)) { g->inside_cast_in_heap++; string got_styp = v__gen__c__Gen_cc_type(g, v__ast__Type_ref(got_type), true); @@ -71351,7 +71462,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel *(v__ast__Type*) _t1.data = name_type; } - name_type = *(v__ast__Type*)_t1.data; + name_type = (*(v__ast__Type*)_t1.data); } } } @@ -71693,11 +71804,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit string value_typ_str = v__gen__c__Gen_typ(g, unwrap_val_typ); v__ast__TypeSymbol* value_sym = v__ast__Table_sym(g->table, unwrap_val_typ); v__ast__TypeSymbol* key_sym = v__ast__Table_final_sym(g->table, unwrap_key_typ); - multi_return_string_string_string_string mr_108643 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); - string hash_fn = mr_108643.arg0; - string key_eq_fn = mr_108643.arg1; - string clone_fn = mr_108643.arg2; - string free_fn = mr_108643.arg3; + multi_return_string_string_string_string mr_108677 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); + string hash_fn = mr_108677.arg0; + string key_eq_fn = mr_108677.arg1; + string clone_fn = mr_108677.arg2; + string free_fn = mr_108677.arg3; int size = node.vals.len; string shared_styp = _SLIT(""); string styp = _SLIT(""); @@ -72002,30 +72113,32 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t2.data; - if (Array_v__ast__Attr_contains(f.attrs, _SLIT("c"))) { - name = (*(v__ast__Attr*)/*ee elem_sym */array_get(f.attrs, 0)).arg; + _option_v__ast__Attr _t3; + if (_t3 = Array_v__ast__Attr_find_first(f.attrs, _SLIT("c")), _t3.state == 0) { + v__ast__Attr cattr = *(v__ast__Attr*)_t3.data; + name = cattr.arg; } } } if (g->pref->obfuscate && string__eq(g->cur_mod.name, _SLIT("main")) && string_starts_with(name, _SLIT("main__"))) { string key = node.name; v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf identfn: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); - string* _t4 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); - _option_string _t3 = {0}; - if (_t4) { - *((string*)&_t3.data) = *((string*)_t4); + string* _t5 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); + _option_string _t4 = {0}; + if (_t5) { + *((string*)&_t4.data) = *((string*)_t5); } else { - _t3.state = 2; _t3.err = _v_error(_SLIT("array index out of range")); + _t4.state = 2; _t4.err = _v_error(_SLIT("array index out of range")); } ; - if (_t3.state != 0) { /*or block*/ - IError err = _t3.err; + if (_t4.state != 0) { /*or block*/ + IError err = _t4.err; _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } - name = *(string*)_t3.data; + name = (*(string*)_t4.data); } } v__gen__c__Gen_write(g, v__gen__c__Gen_get_ternary_name(g, name)); @@ -72497,7 +72610,14 @@ bool v__gen__c__Gen_const_decl_defer_0 = false; } } string name = v__gen__c__c_name(field.name); - string const_name = (Array_v__ast__Attr_contains(node.attrs, _SLIT("export")) && !g->is_builtin_mod ? ((*(v__ast__Attr*)/*ee elem_sym */array_get(node.attrs, 0)).arg) : (string__plus(_SLIT("_const_"), name))); + string const_name = string__plus(_SLIT("_const_"), name); + if (!g->is_builtin_mod) { + _option_v__ast__Attr _t2; + if (_t2 = Array_v__ast__Attr_find_first(node.attrs, _SLIT("export")), _t2.state == 0) { + v__ast__Attr cattr = *(v__ast__Attr*)_t2.data; + const_name = cattr.arg; + } + } v__ast__Expr field_expr = field.expr; if (field.expr._typ == 289 /* v.ast.ArrayInit */) { if ((*field.expr._v__ast__ArrayInit).is_fixed) { @@ -72533,9 +72653,9 @@ bool v__gen__c__Gen_const_decl_defer_0 = false; else { bool use_cache_mode = g->pref->build_mode == v__pref__BuildMode__build_module || g->pref->use_cache; if (!use_cache_mode) { - _option_v__ast__ComptTimeConstValue _t2; - if (_t2 = v__ast__ConstField_comptime_expr_value(&field), _t2.state == 0) { - v__ast__ComptTimeConstValue ct_value = *(v__ast__ComptTimeConstValue*)_t2.data; + _option_v__ast__ComptTimeConstValue _t3; + if (_t3 = v__ast__ConstField_comptime_expr_value(&field), _t3.state == 0) { + v__ast__ComptTimeConstValue ct_value = *(v__ast__ComptTimeConstValue*)_t3.data; if (v__gen__c__Gen_const_decl_precomputed(g, field.mod, name, ct_value, field.typ)) { continue; } @@ -72727,7 +72847,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_global_decl(v__gen__c__Gen* g, v__ast__Globa if (field.has_expr || cinit) { if (g->pref->translated) { strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))); - } else if ((v__ast__Expr_is_literal(field.expr) && should_init) || cinit) { + } else if ((v__ast__Expr_is_literal(field.expr) && should_init) || cinit || ((field.expr)._typ == 289 /* v.ast.ArrayInit */ && (/* as */ *(v__ast__ArrayInit*)__as_cast((field.expr)._v__ast__ArrayInit,(field.expr)._typ, 289) /*expected idx: 289, name: v.ast.ArrayInit */ ).is_fixed)) { strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { strings__Builder_writeln(&g->global_init, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT("; // 3global"), 0, { .d_c = 0 }}}))); @@ -72970,9 +73090,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ for (int _t3 = 0; _t3 < (*sym->info._v__ast__Struct).fields.len; ++_t3) { v__ast__StructField field = ((v__ast__StructField*)(*sym->info._v__ast__Struct).fields.data)[_t3]; if (v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__optional)) { - multi_return_string_string mr_148992 = v__gen__c__Gen_optional_type_name(g, field.typ); - string styp = mr_148992.arg0; - string base = mr_148992.arg1; + multi_return_string_string mr_149065 = v__gen__c__Gen_optional_type_name(g, field.typ); + string styp = mr_149065.arg0; + string base = mr_149065.arg1; sync__RwMutex_lock(&g->done_optionals->mtx); /*lock*/ { if (!Array_string_contains(g->done_optionals->val, base)) { @@ -73267,11 +73387,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false; if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) { string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { - multi_return_int_string_string_string mr_158856 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_158856.arg0; - string pafile = mr_158856.arg1; - string pamod = mr_158856.arg2; - string pafn = mr_158856.arg3; + multi_return_int_string_string_string mr_158929 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_158929.arg0; + string pafile = mr_158929.arg1; + string pamod = mr_158929.arg2; + string pafn = mr_158929.arg3; v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_result_not_set("), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); @@ -73294,11 +73414,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false; if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) { string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { - multi_return_int_string_string_string mr_160126 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_160126.arg0; - string pafile = mr_160126.arg1; - string pamod = mr_160126.arg2; - string pafn = mr_160126.arg3; + multi_return_int_string_string_string mr_160199 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_160199.arg0; + string pafile = mr_160199.arg1; + string pamod = mr_160199.arg2; + string pafn = mr_160199.arg3; v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_optional_not_set( "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); @@ -73408,11 +73528,11 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty { v__ast__Map info = v__ast__TypeSymbol_map_info(sym); v__ast__TypeSymbol* key_typ = v__ast__Table_sym(g->table, info.key_type); - multi_return_string_string_string_string mr_162734 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); - string hash_fn = mr_162734.arg0; - string key_eq_fn = mr_162734.arg1; - string clone_fn = mr_162734.arg2; - string free_fn = mr_162734.arg3; + multi_return_string_string_string_string mr_162807 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); + string hash_fn = mr_162807.arg0; + string key_eq_fn = mr_162807.arg1; + string clone_fn = mr_162807.arg2; + string free_fn = mr_162807.arg3; string noscan_key = v__gen__c__Gen_check_noscan(g, info.key_type); string noscan_value = v__gen__c__Gen_check_noscan(g, info.value_type); string noscan = (noscan_key.len != 0 || noscan_value.len != 0 ? (_SLIT("_noscan")) : (_SLIT(""))); @@ -73591,8 +73711,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_size_of(v__gen__c__Gen* g, v__ast__SizeOf no VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_val(v__gen__c__Gen* g, v__ast__EnumVal node) { string styp = v__gen__c__Gen_typ(g, v__ast__Table_unaliased_type(g->table, node.typ)); if (g->pref->translated && v__ast__Type_is_number(node.typ)) { - v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.typ); - v__gen__c__Gen_write(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("/* "), /*115 &v.ast.EnumVal*/0xfe10, {.d_s = v__ast__EnumVal_str(node)}}, {_SLIT(" enum val is_number "), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT(" styp="), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" sym="), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(sym)}}}))}}, {_SLIT("*/_const_main__"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_main__"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("__"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } @@ -73916,7 +74035,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { for (int _t25 = 0; _t25 < methods.len; ++_t25) { v__ast__Fn method = ((v__ast__Fn*)methods.data)[_t25]; string name = method.name; - if (v__ast__Type_has_flag(inter_info.parent_type, v__ast__TypeFlag__generic)) { + if (method.generic_names.len > 0 && v__ast__Type_has_flag(inter_info.parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, inter_info.parent_type); if (parent_sym->info._typ == 459 /* v.ast.Struct */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__Struct).concrete_types, method.name, false); @@ -73936,7 +74055,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { continue; } if ((st_sym->info)._typ == 459 /* v.ast.Struct */) { - if (v__ast__Type_has_flag((*st_sym->info._v__ast__Struct).parent_type, v__ast__TypeFlag__generic)) { + if (method.generic_names.len > 0 && v__ast__Type_has_flag((*st_sym->info._v__ast__Struct).parent_type, v__ast__TypeFlag__generic)) { name = v__gen__c__Gen_generic_fn_name(g, (*st_sym->info._v__ast__Struct).concrete_types, method.name, false); } } @@ -73949,8 +74068,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { int params_start_pos = g->out.len; Array_v__ast__Param params = array_clone_to_depth(&method.params, 0); array_set(¶ms, 0, &(v__ast__Param[]) { ((v__ast__Param){(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).name,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).type_pos,.typ = v__ast__Type_set_nr_muls(st, 1),(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_mut,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_auto_rec,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_hidden,}) }); - multi_return_Array_string_Array_string_Array_bool mr_177692 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); - Array_string fargs = mr_177692.arg0; + multi_return_Array_string_Array_string_Array_bool mr_177871 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); + Array_string fargs = mr_177871.arg0; string parameter_name = strings__Builder_cut_last(&g->out, g->out.len - params_start_pos); if (v__ast__Type_is_ptr(st)) { parameter_name = string_trim_string_left(parameter_name, _SLIT("__shared__")); @@ -73967,8 +74086,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { *(multi_return_v__ast__Fn_Array_v__ast__Type*) _t26.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_178156 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); - Array_v__ast__Type embed_types = mr_178156.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_178335 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); + Array_v__ast__Type embed_types = mr_178335.arg1; if (embed_types.len > 0 && !Array_string_contains(method_names, method.name)) { v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types))); string method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = embed_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); @@ -75867,7 +75986,7 @@ int ctmp; ; } - name = *(string*)_t7.data; + name = (*(string*)_t7.data); } if (is_livemain) { array_push((array*)&g->hotcode_fn_names, _MOV((string[]){ string_clone(name) })); @@ -76111,12 +76230,16 @@ VV_LOCAL_SYMBOL _option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__as if (node->generic_names.len > 0) { name = v__gen__c__Gen_generic_fn_name(g, g->cur_concrete_types, name, true); } - if ((g->pref->translated || g->file->is_translated) && Array_v__ast__Attr_contains(node->attrs, _SLIT("c"))) { - name = (*(v__ast__Attr*)/*ee elem_sym */array_get(node->attrs, 0)).arg; + if (g->pref->translated || g->file->is_translated) { + _option_v__ast__Attr _t2; + if (_t2 = Array_v__ast__Attr_find_first(node->attrs, _SLIT("c")), _t2.state == 0) { + v__ast__Attr cattr = *(v__ast__Attr*)_t2.data; + name = cattr.arg; + } } - _option_string _t2; - opt_ok2(&(string[]) { name }, (_option*)(&_t2), sizeof(string)); - return _t2; + _option_string _t3; + opt_ok2(&(string[]) { name }, (_option*)(&_t3), sizeof(string)); + return _t3; } VV_LOCAL_SYMBOL string v__gen__c__closure_ctx(v__ast__FnDecl node) { @@ -76588,7 +76711,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE *(v__ast__Type*) _t10.data = rec_type; } - rec_type = *(v__ast__Type*)_t10.data; + rec_type = (*(v__ast__Type*)_t10.data); v__gen__c__Gen_gen_expr_to_string(g, node.left, rec_type); return; } @@ -76620,6 +76743,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE return; } } + } else if ((node.left)._typ == 321 /* v.ast.None */) { + v__gen__c__Gen_gen_expr_to_string(g, node.left, _const_v__ast__none_type); + return; } v__gen__c__Gen_get_str_fn(g, rec_type); } else if (string__eq(node.name, _SLIT("free"))) { @@ -76687,7 +76813,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE ; } - name = *(string*)_t13.data; + name = (*(string*)_t13.data); } bool is_range_slice = false; if (v__ast__Type_is_ptr(node.receiver_type) && !v__ast__Type_is_ptr(node.left_type)) { @@ -76882,35 +77008,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t2.data; - if (Array_v__ast__Attr_contains(f.attrs, _SLIT("c"))) { - name = (*(v__ast__Attr*)/*ee elem_sym */array_get(f.attrs, 0)).arg; + _option_v__ast__Attr _t3; + if (_t3 = Array_v__ast__Attr_find_first(f.attrs, _SLIT("c")), _t3.state == 0) { + v__ast__Attr cattr = *(v__ast__Attr*)_t3.data; + name = cattr.arg; } } } if (g->pref->obfuscate && string__eq(g->cur_mod.name, _SLIT("main")) && string_starts_with(name, _SLIT("main__"))) { string key = node.name; v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf call: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); - string* _t4 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); - _option_string _t3 = {0}; - if (_t4) { - *((string*)&_t3.data) = *((string*)_t4); + string* _t5 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); + _option_string _t4 = {0}; + if (_t5) { + *((string*)&_t4.data) = *((string*)_t5); } else { - _t3.state = 2; _t3.err = _v_error(_SLIT("array index out of range")); + _t4.state = 2; _t4.err = _v_error(_SLIT("array index out of range")); } ; - if (_t3.state != 0) { /*or block*/ - IError err = _t3.err; + if (_t4.state != 0) { /*or block*/ + IError err = _t4.err; _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } - name = *(string*)_t3.data; + name = (*(string*)_t4.data); } if (!is_selector_call) { - _option_v__ast__Fn _t5; - if (_t5 = v__ast__Table_find_fn(g->table, node.name), _t5.state == 0) { - v__ast__Fn func = *(v__ast__Fn*)_t5.data; + _option_v__ast__Fn _t6; + if (_t6 = v__ast__Table_find_fn(g->table, node.name), _t6.state == 0) { + v__ast__Fn func = *(v__ast__Fn*)_t6.data; if (func.generic_names.len > 0) { if (g->comptime_for_field_type != 0 && g->inside_comptime_for_field) { name = v__gen__c__Gen_generic_fn_name(g, new_array_from_c_array(1, 1, sizeof(v__ast__Type), _MOV((v__ast__Type[1]){g->comptime_for_field_type})), name, false); @@ -76952,28 +77080,28 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr if (((*expr._v__ast__ComptimeSelector).field_expr)._typ == 329 /* v.ast.SelectorExpr */) { if (((*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 309 /* v.ast.Ident */) { string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); - v__ast__Type* _t7 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); - _option_v__ast__Type _t6 = {0}; - if (_t7) { - *((v__ast__Type*)&_t6.data) = *((v__ast__Type*)_t7); + v__ast__Type* _t8 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); + _option_v__ast__Type _t7 = {0}; + if (_t8) { + *((v__ast__Type*)&_t7.data) = *((v__ast__Type*)_t8); } else { - _t6.state = 2; _t6.err = _v_error(_SLIT("array index out of range")); + _t7.state = 2; _t7.err = _v_error(_SLIT("array index out of range")); } ; - if (_t6.state != 0) { /*or block*/ - IError err = _t6.err; - *(v__ast__Type*) _t6.data = typ; + if (_t7.state != 0) { /*or block*/ + IError err = _t7.err; + *(v__ast__Type*) _t7.data = typ; } - typ = *(v__ast__Type*)_t6.data; + typ = (*(v__ast__Type*)_t7.data); } } } else if ((expr)._typ == 300 /* v.ast.ComptimeCall */) { if (string__eq((*expr._v__ast__ComptimeCall).method_name, _SLIT("method"))) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, (*expr._v__ast__ComptimeCall).left_type)); - _option_v__ast__Fn _t8; - if (_t8 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method), _t8.state == 0) { - v__ast__Fn m = *(v__ast__Fn*)_t8.data; + _option_v__ast__Fn _t9; + if (_t9 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method), _t9.state == 0) { + v__ast__Fn m = *(v__ast__Fn*)_t9.data; typ = m.return_type; } } @@ -76997,22 +77125,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr } if (!print_auto_str) { if (g->pref->is_debug && string__eq(node.name, _SLIT("panic"))) { - multi_return_int_string_string_string mr_39829 = v__gen__c__Gen_panic_debug_info(g, node.pos); - int paline = mr_39829.arg0; - string pafile = mr_39829.arg1; - string pamod = mr_39829.arg2; - string pafn = mr_39829.arg3; + multi_return_int_string_string_string mr_39946 = v__gen__c__Gen_panic_debug_info(g, node.pos); + int paline = mr_39946.arg0; + string pafile = mr_39946.arg1; + string pamod = mr_39946.arg2; + string pafn = mr_39946.arg3; v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_call_args(g, node); v__gen__c__Gen_write(g, _SLIT(")")); } else { bool is_fn_var = false; - _option_v__ast__ScopeObject _t9; - if (_t9 = v__ast__Scope_find(node.scope, node.name), _t9.state == 0) { - v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t9.data; + _option_v__ast__ScopeObject _t10; + if (_t10 = v__ast__Scope_find(node.scope, node.name), _t10.state == 0) { + v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t10.data; if (obj._typ == 367 /* v.ast.Var */) { if ((*obj._v__ast__Var).smartcasts.len > 0) { - for (int _t10 = 0; _t10 < (*obj._v__ast__Var).smartcasts.len; ++_t10) { + for (int _t11 = 0; _t11 < (*obj._v__ast__Var).smartcasts.len; ++_t11) { v__gen__c__Gen_write(g, _SLIT("(*")); } for (int i = 0; i < (*obj._v__ast__Var).smartcasts.len; ++i) { @@ -77376,7 +77504,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no ; } - name = *(string*)_t1.data; + name = (*(string*)_t1.data); } g->empty_line = true; v__gen__c__Gen_writeln(g, _SLIT("// start go")); @@ -78852,7 +78980,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde if (!node.is_option) { v__gen__c__Gen_or_block(g, tmp_opt, node.or_expr, elem_type); } - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT("*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); } } } @@ -79613,7 +79741,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_interface_is_op(v__gen__c__Gen* g, v__as *(Array_v__ast__Type*) _t1.data = c; } - Array_v__ast__Type common_variants = *(Array_v__ast__Type*)_t1.data; + Array_v__ast__Type common_variants = (*(Array_v__ast__Type*)_t1.data); left_sym->info = v__ast__Interface_to_sumtype_v__ast__TypeInfo(&info); if (common_variants.len == 0) { v__gen__c__Gen_write(g, _SLIT("false")); @@ -86529,7 +86657,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { } if (_t19.state == 0) { - v__ast__Fn existing = *(v__ast__Fn*)_t19.data; + v__ast__Fn existing = (*(v__ast__Fn*)_t19.data); if ((existing.name).len != 0) { if (file_mode == v__ast__Language__v && existing.file_mode != v__ast__Language__v) { if (!p->pref->is_fmt) { @@ -88744,7 +88872,7 @@ v__ast__Type v__parser__Parser_parse_generic_inst_type(v__parser__Parser* p, str v__ast__Stmt v__parser__parse_stmt(string text, v__ast__Table* table, v__ast__Scope* scope) { bool v__parser__parse_stmt_defer_0 = false; - v__parser__Parser p = ((v__parser__Parser){.imports = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.imported_symbols = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.prev_tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.peek_tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.script_mode_start_token = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ast_imports = __new_array(0, 0, sizeof(v__ast__Import)),.used_imports = __new_array(0, 0, sizeof(string)),.auto_imports = __new_array(0, 0, sizeof(string)),.label_names = __new_array(0, 0, sizeof(string)),.global_labels = __new_array(0, 0, sizeof(string)),.defer_vars = __new_array(0, 0, sizeof(v__ast__Ident)),.struct_init_generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.if_cond_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.errors = __new_array(0, 0, sizeof(v__errors__Error)),.warnings = __new_array(0, 0, sizeof(v__errors__Warning)),.notices = __new_array(0, 0, sizeof(v__errors__Notice)),.vet_errors = __new_array(0, 0, sizeof(v__vet__Error)),.file_base = (string){.str=(byteptr)"", .is_lit=1},.file_name = (string){.str=(byteptr)"", .is_lit=1},.file_name_dir = (string){.str=(byteptr)"", .is_lit=1},.unique_prefix = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.expr_mod = (string){.str=(byteptr)"", .is_lit=1},.cur_fn_name = (string){.str=(byteptr)"", .is_lit=1},.codegen_text = (string){.str=(byteptr)"", .is_lit=1},.pref = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.backend = 0,.ccompiler_type = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))),.table = table,.scope = scope,.scanner = v__scanner__new_scanner(text, v__scanner__CommentsMode__skip_comments, ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.backend = 0,.ccompiler_type = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences)))),.expr_level = 0,.n_asm = 0,.file_backend_mode = 0,.language = 0,.fn_language = 0,.comments_mode = v__scanner__CommentsMode__skip_comments,.inside_vlib_file = 0,.inside_test_file = true,.inside_if = 0,.inside_if_expr = 0,.inside_if_cond = 0,.inside_ct_if_expr = 0,.inside_or_expr = 0,.inside_for = 0,.inside_fn = 0,.inside_fn_return = 0,.inside_unsafe_fn = 0,.inside_str_interp = 0,.inside_array_lit = 0,.inside_in_array = 0,.inside_match = 0,.inside_select = 0,.inside_match_case = 0,.inside_match_body = 0,.inside_unsafe = 0,.inside_sum_type = 0,.inside_asm_template = 0,.inside_asm = 0,.inside_defer = 0,.inside_generic_params = 0,.inside_receiver_param = 0,.inside_struct_field_decl = 0,.or_is_handled = 0,.builtin_mod = 0,.is_manualfree = 0,.has_globals = 0,.is_generated = 0,.is_translated = 0,.is_amp = 0,.returns = 0,.is_stmt_ident = 0,.expecting_type = 0,.name_error = 0,.comptime_if_cond = 0,.should_abort = 0,.script_mode = 0,}); + v__parser__Parser p = ((v__parser__Parser){.imports = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.imported_symbols = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.prev_tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.peek_tok = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.script_mode_start_token = (v__token__Token){.lit = (string){.str=(byteptr)"", .is_lit=1},.line_nr = 0,.col = 0,.pos = 0,.len = 0,.tidx = 0,},.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ast_imports = __new_array(0, 0, sizeof(v__ast__Import)),.used_imports = __new_array(0, 0, sizeof(string)),.auto_imports = __new_array(0, 0, sizeof(string)),.label_names = __new_array(0, 0, sizeof(string)),.global_labels = __new_array(0, 0, sizeof(string)),.defer_vars = __new_array(0, 0, sizeof(v__ast__Ident)),.struct_init_generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.if_cond_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.errors = __new_array(0, 0, sizeof(v__errors__Error)),.warnings = __new_array(0, 0, sizeof(v__errors__Warning)),.notices = __new_array(0, 0, sizeof(v__errors__Notice)),.vet_errors = __new_array(0, 0, sizeof(v__vet__Error)),.file_base = (string){.str=(byteptr)"", .is_lit=1},.file_name = (string){.str=(byteptr)"", .is_lit=1},.file_name_dir = (string){.str=(byteptr)"", .is_lit=1},.unique_prefix = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.expr_mod = (string){.str=(byteptr)"", .is_lit=1},.cur_fn_name = (string){.str=(byteptr)"", .is_lit=1},.codegen_text = (string){.str=(byteptr)"", .is_lit=1},.pref = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.gc_mode = v__pref__GarbageCollectionMode__unknown,.backend = 0,.ccompiler_type = 0,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences))),.table = table,.scope = scope,.scanner = v__scanner__new_scanner(text, v__scanner__CommentsMode__skip_comments, ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.cache_manager = (v__vcache__CacheManager){.basepath = (string){.str=(byteptr)"", .is_lit=1},.original_vopts = (string){.str=(byteptr)"", .is_lit=1},.vopts = (string){.str=(byteptr)"", .is_lit=1},.k2cpath = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),},.profile_fns = __new_array(0, 0, sizeof(string)),.lookup_path = __new_array(0, 0, sizeof(string)),.run_only = __new_array(0, 0, sizeof(string)),.compile_defines = __new_array(0, 0, sizeof(string)),.compile_defines_all = __new_array(0, 0, sizeof(string)),.run_args = __new_array(0, 0, sizeof(string)),.printfn_list = __new_array(0, 0, sizeof(string)),.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.dump_modules = (string){.str=(byteptr)"", .is_lit=1},.dump_files = (string){.str=(byteptr)"", .is_lit=1},.cflags = (string){.str=(byteptr)"", .is_lit=1},.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.cmain = (string){.str=(byteptr)"", .is_lit=1},.vroot = (string){.str=(byteptr)"", .is_lit=1},.out_name_c = (string){.str=(byteptr)"", .is_lit=1},.out_name = (string){.str=(byteptr)"", .is_lit=1},.path = (string){.str=(byteptr)"", .is_lit=1},.message_limit = 100,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,.os = 0,.arch = 0,.gc_mode = v__pref__GarbageCollectionMode__unknown,.backend = 0,.ccompiler_type = 0,.use_color = 0,.assert_failure_mode = 0,.build_mode = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 0,.is_glibc = 0,.is_musl = 0,.is_test = 0,.is_script = 0,.is_vsh = 0,.is_livemain = 0,.is_liveshared = 0,.is_shared = 0,.is_o = 0,.is_prof = 0,.is_prod = 0,.is_repl = 0,.is_run = 0,.is_crun = 0,.is_debug = 0,.is_vlines = 0,.is_stats = 0,.is_fmt = 0,.is_vet = 0,.is_vweb = 0,.is_ios_simulator = 0,.is_apk = 0,.is_help = 0,.is_cstrict = 0,.profile_no_inline = 0,.translated = 0,.obfuscate = 0,.sanitize = 0,.sourcemap = 0,.sourcemap_inline = true,.sourcemap_src_included = 0,.show_cc = 0,.show_c_output = 0,.show_callgraph = 0,.show_depgraph = 0,.use_cache = 0,.retry_compilation = true,.m64 = 0,.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_bare = 0,.no_preludes = 0,.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.print_v_files = 0,.skip_running = 0,.skip_warnings = 0,.warn_impure_v = 0,.warns_are_errors = 0,.fatal_errors = 0,.reuse_tmpc = 0,.no_rsp = 0,.no_std = 0,.no_parallel = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.nofloat = 0,}, sizeof(v__pref__Preferences)))),.expr_level = 0,.n_asm = 0,.file_backend_mode = 0,.language = 0,.fn_language = 0,.comments_mode = v__scanner__CommentsMode__skip_comments,.inside_vlib_file = 0,.inside_test_file = true,.inside_if = 0,.inside_if_expr = 0,.inside_if_cond = 0,.inside_ct_if_expr = 0,.inside_or_expr = 0,.inside_for = 0,.inside_fn = 0,.inside_fn_return = 0,.inside_unsafe_fn = 0,.inside_str_interp = 0,.inside_array_lit = 0,.inside_in_array = 0,.inside_match = 0,.inside_select = 0,.inside_match_case = 0,.inside_match_body = 0,.inside_unsafe = 0,.inside_sum_type = 0,.inside_asm_template = 0,.inside_asm = 0,.inside_defer = 0,.inside_generic_params = 0,.inside_receiver_param = 0,.inside_struct_field_decl = 0,.or_is_handled = 0,.builtin_mod = 0,.is_manualfree = 0,.has_globals = 0,.is_generated = 0,.is_translated = 0,.is_amp = 0,.returns = 0,.is_stmt_ident = 0,.expecting_type = 0,.name_error = 0,.comptime_if_cond = 0,.should_abort = 0,.script_mode = 0,}); v__parser__Parser_init_parse_fns(&p); v__util__timing_start(_SLIT("PARSE stmt")); v__parser__parse_stmt_defer_0 = true; @@ -91277,7 +91405,7 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { *(string*) _t22.data = v__parser__Parser_prepend_mod(p, enum_name); } - enum_name = *(string*)_t22.data; + enum_name = (*(string*)_t22.data); } v__parser__Parser_check(p, v__token__Kind__dot); string val = v__parser__Parser_check_name(p); @@ -94816,6 +94944,17 @@ VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__build } return; } + if (res.exit_code != 0 && v->pref->gc_mode != v__pref__GarbageCollectionMode__no_gc && string_contains(res.output, _SLIT("libgc.a"))) { + #if defined(_WIN32) + { + v__builder__verror(_SLIT("Your V installation may be out-of-date. Try removing `thirdparty\\tcc\\` and running `.\\make.bat`")); + VUNREACHABLE(); + } + #else + { + } + #endif + } Array_string _t3 = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){string_clone(_const_v__builder__c_verror_message_marker), _SLIT("error: include file ")})); for (int _t4 = 0; _t4 < _t3.len; ++_t4) { string emsg_marker = ((string*)_t3.data)[_t4]; @@ -95016,10 +95155,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_ccompiler_options(v__builder__Bui Array_string only_o_files = Array_v__cflag__CFlag_c_options_only_object_files(cflags); _PUSH_MANY(&ccoptions.o_args, (only_o_files), _t39, Array_string); } - multi_return_Array_string_Array_string_Array_string mr_11728 = Array_v__cflag__CFlag_defines_others_libs(cflags); - Array_string defines = mr_11728.arg0; - Array_string others = mr_11728.arg1; - Array_string libs = mr_11728.arg2; + multi_return_Array_string_Array_string_Array_string mr_12063 = Array_v__cflag__CFlag_defines_others_libs(cflags); + Array_string defines = mr_12063.arg0; + Array_string others = mr_12063.arg1; + Array_string libs = mr_12063.arg2; _PUSH_MANY(&ccoptions.pre_args, (defines), _t40, Array_string); _PUSH_MANY(&ccoptions.pre_args, (others), _t41, Array_string); _PUSH_MANY(&ccoptions.linker_flags, (libs), _t42, Array_string); @@ -95378,10 +95517,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) v__builder__Builder_ensure_linuxroot_exists(b, sysroot); string obj_file = string__plus(b->out_name_c, _SLIT(".o")); Array_v__cflag__CFlag cflags = v__builder__Builder_get_os_cflags(b); - multi_return_Array_string_Array_string_Array_string mr_22971 = Array_v__cflag__CFlag_defines_others_libs(cflags); - Array_string defines = mr_22971.arg0; - Array_string others = mr_22971.arg1; - Array_string libs = mr_22971.arg2; + multi_return_Array_string_Array_string_Array_string mr_23306 = Array_v__cflag__CFlag_defines_others_libs(cflags); + Array_string defines = mr_23306.arg0; + Array_string others = mr_23306.arg1; + Array_string libs = mr_23306.arg2; Array_string cc_args = __new_array_with_default(0, 0, sizeof(string), 0); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-w")) })); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-fPIC")) }));