From 73298627b0e05962c2cb5acaaca0b17d84cc6b6f Mon Sep 17 00:00:00 2001 From: vbot Date: Sat, 30 Apr 2022 14:28:06 +0000 Subject: [PATCH] [v:master] 91a9137b3 - all: rename result to _result (#14232) --- v.c | 12122 ++++++++++++++++++++++++++++-------------------------- v_win.c | 11867 ++++++++++++++++++++++++++-------------------------- 2 files changed, 12292 insertions(+), 11697 deletions(-) diff --git a/v.c b/v.c index a202aeb..4184079 100644 --- a/v.c +++ b/v.c @@ -1,11 +1,11 @@ -#define V_COMMIT_HASH "455a52e74" +#define V_COMMIT_HASH "91a9137b3" #ifndef V_COMMIT_HASH - #define V_COMMIT_HASH "9b1f7f5e9" + #define V_COMMIT_HASH "455a52e74" #endif #ifndef V_CURRENT_COMMIT_HASH - #define V_CURRENT_COMMIT_HASH "455a52e" + #define V_CURRENT_COMMIT_HASH "91a9137" #endif // V comptime_definitions: @@ -92,6 +92,7 @@ typedef struct Error Error; typedef struct MessageError MessageError; typedef struct None__ None__; typedef struct Option Option; +typedef struct _result _result; typedef struct VMemoryBlock VMemoryBlock; typedef struct SortedMap SortedMap; typedef struct mapnode mapnode; @@ -528,18 +529,30 @@ static inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (in #define __IRQHANDLER __attribute__((interrupt)) #define __V_architecture 0 -#if defined(__x86_64__) +#if defined(__x86_64__) || defined(_M_AMD64) #define __V_amd64 1 #undef __V_architecture #define __V_architecture 1 #endif -#if defined(__aarch64__) || defined(__arm64__) +#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) #define __V_arm64 1 #undef __V_architecture #define __V_architecture 2 #endif +#if defined(__arm__) || defined(_M_ARM) + #define __V_arm32 1 + #undef __V_architecture + #define __V_architecture 3 +#endif + +#if defined(__i386__) || defined(_M_IX86) + #define __V_x86 1 + #undef __V_architecture + #define __V_architecture 6 +#endif + // Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too: #ifdef __GNUC__ #define __V_GCC__ @@ -589,11 +602,6 @@ static inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (in #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0)) #endif -// returns the number of CPU registers that TYPE takes up -#define _REG_WIDTH(T) (((sizeof(T) + sizeof(void*) - 1) & ~(sizeof(void*) - 1)) / sizeof(void*)) -// parameters of size <= 2 registers are spilled across those two registers; larger types are passed as one pointer to some stack location -#define _REG_WIDTH_BOUNDED(T) (_REG_WIDTH(T) <= 2 ? _REG_WIDTH(T) : 1) - #define OPTION_CAST(x) (x) #ifndef V64_PRINTFORMAT @@ -2625,7 +2633,8 @@ typedef enum { typedef enum { v__ast__OrKind__absent, // v__ast__OrKind__block, // +1 - v__ast__OrKind__propagate, // +2 + v__ast__OrKind__propagate_option, // +2 + v__ast__OrKind__propagate_result, // +3 } v__ast__OrKind; typedef enum { @@ -2658,10 +2667,11 @@ typedef enum { typedef enum { v__ast__TypeFlag__optional, // - v__ast__TypeFlag__variadic, // +1 - v__ast__TypeFlag__generic, // +2 - v__ast__TypeFlag__shared_f, // +3 - v__ast__TypeFlag__atomic_f, // +4 + v__ast__TypeFlag__result, // +1 + v__ast__TypeFlag__variadic, // +2 + v__ast__TypeFlag__generic, // +3 + v__ast__TypeFlag__shared_f, // +4 + v__ast__TypeFlag__atomic_f, // +5 } v__ast__TypeFlag; typedef enum { @@ -2847,6 +2857,13 @@ struct Option { }; + +struct _result { + bool is_error; + IError err; +}; + + typedef array Array_string; typedef array Array_u8; typedef array Array_int; @@ -2988,8 +3005,8 @@ typedef array Array_v__ast__SelectorExpr; typedef array Array_v__pref__GarbageCollectionMode; typedef array Array_v__gen__c__Gen_ptr; typedef array Array_v__ast__Struct; -typedef array Array_v__pref__Arch; typedef array Array_v__ast__CallExpr; +typedef array Array_v__pref__Arch; typedef array Array_v__pref__OS; typedef u8 byte; typedef int i32; @@ -3132,9 +3149,9 @@ struct v__vmod__ModFileAndFolder { // Union sum type v__ast__TypeDecl = -// | 240 = v__ast__AliasTypeDecl -// | 241 = v__ast__FnTypeDecl -// | 242 = v__ast__SumTypeDecl +// | 241 = v__ast__AliasTypeDecl +// | 242 = v__ast__FnTypeDecl +// | 243 = v__ast__SumTypeDecl struct v__ast__TypeDecl { union { v__ast__AliasTypeDecl* _v__ast__AliasTypeDecl; @@ -3150,57 +3167,57 @@ struct v__ast__TypeDecl { // Union sum type v__ast__Expr = -// | 244 = v__ast__AnonFn -// | 245 = v__ast__ArrayDecompose -// | 246 = v__ast__ArrayInit -// | 247 = v__ast__AsCast -// | 248 = v__ast__Assoc -// | 249 = v__ast__AtExpr -// | 250 = v__ast__BoolLiteral -// | 251 = v__ast__CTempVar -// | 252 = v__ast__CallExpr -// | 253 = v__ast__CastExpr -// | 254 = v__ast__ChanInit -// | 255 = v__ast__CharLiteral -// | 256 = v__ast__Comment -// | 257 = v__ast__ComptimeCall -// | 258 = v__ast__ComptimeSelector -// | 259 = v__ast__ComptimeType -// | 260 = v__ast__ConcatExpr -// | 261 = v__ast__DumpExpr -// | 262 = v__ast__EmptyExpr -// | 263 = v__ast__EnumVal -// | 264 = v__ast__FloatLiteral -// | 265 = v__ast__GoExpr -// | 266 = v__ast__Ident -// | 267 = v__ast__IfExpr -// | 268 = v__ast__IfGuardExpr -// | 269 = v__ast__IndexExpr -// | 270 = v__ast__InfixExpr -// | 271 = v__ast__IntegerLiteral -// | 272 = v__ast__IsRefType -// | 273 = v__ast__Likely -// | 274 = v__ast__LockExpr -// | 275 = v__ast__MapInit -// | 276 = v__ast__MatchExpr -// | 277 = v__ast__NodeError -// | 278 = v__ast__None -// | 279 = v__ast__OffsetOf -// | 280 = v__ast__OrExpr -// | 281 = v__ast__ParExpr -// | 282 = v__ast__PostfixExpr -// | 283 = v__ast__PrefixExpr -// | 284 = v__ast__RangeExpr -// | 285 = v__ast__SelectExpr -// | 286 = v__ast__SelectorExpr -// | 287 = v__ast__SizeOf -// | 288 = v__ast__SqlExpr -// | 289 = v__ast__StringInterLiteral -// | 290 = v__ast__StringLiteral -// | 291 = v__ast__StructInit -// | 292 = v__ast__TypeNode -// | 293 = v__ast__TypeOf -// | 294 = v__ast__UnsafeExpr +// | 245 = v__ast__AnonFn +// | 246 = v__ast__ArrayDecompose +// | 247 = v__ast__ArrayInit +// | 248 = v__ast__AsCast +// | 249 = v__ast__Assoc +// | 250 = v__ast__AtExpr +// | 251 = v__ast__BoolLiteral +// | 252 = v__ast__CTempVar +// | 253 = v__ast__CallExpr +// | 254 = v__ast__CastExpr +// | 255 = v__ast__ChanInit +// | 256 = v__ast__CharLiteral +// | 257 = v__ast__Comment +// | 258 = v__ast__ComptimeCall +// | 259 = v__ast__ComptimeSelector +// | 260 = v__ast__ComptimeType +// | 261 = v__ast__ConcatExpr +// | 262 = v__ast__DumpExpr +// | 263 = v__ast__EmptyExpr +// | 264 = v__ast__EnumVal +// | 265 = v__ast__FloatLiteral +// | 266 = v__ast__GoExpr +// | 267 = v__ast__Ident +// | 268 = v__ast__IfExpr +// | 269 = v__ast__IfGuardExpr +// | 270 = v__ast__IndexExpr +// | 271 = v__ast__InfixExpr +// | 272 = v__ast__IntegerLiteral +// | 273 = v__ast__IsRefType +// | 274 = v__ast__Likely +// | 275 = v__ast__LockExpr +// | 276 = v__ast__MapInit +// | 277 = v__ast__MatchExpr +// | 278 = v__ast__NodeError +// | 279 = v__ast__None +// | 280 = v__ast__OffsetOf +// | 281 = v__ast__OrExpr +// | 282 = v__ast__ParExpr +// | 283 = v__ast__PostfixExpr +// | 284 = v__ast__PrefixExpr +// | 285 = v__ast__RangeExpr +// | 286 = v__ast__SelectExpr +// | 287 = v__ast__SelectorExpr +// | 288 = v__ast__SizeOf +// | 289 = v__ast__SqlExpr +// | 290 = v__ast__StringInterLiteral +// | 291 = v__ast__StringLiteral +// | 292 = v__ast__StructInit +// | 293 = v__ast__TypeNode +// | 294 = v__ast__TypeOf +// | 295 = v__ast__UnsafeExpr struct v__ast__Expr { union { v__ast__AnonFn* _v__ast__AnonFn; @@ -3260,33 +3277,33 @@ struct v__ast__Expr { // Union sum type v__ast__Stmt = -// | 296 = v__ast__AsmStmt -// | 297 = v__ast__AssertStmt -// | 298 = v__ast__AssignStmt -// | 299 = v__ast__Block -// | 300 = v__ast__BranchStmt -// | 301 = v__ast__ComptimeFor -// | 302 = v__ast__ConstDecl -// | 303 = v__ast__DeferStmt -// | 304 = v__ast__EmptyStmt -// | 305 = v__ast__EnumDecl -// | 306 = v__ast__ExprStmt -// | 183 = v__ast__FnDecl -// | 307 = v__ast__ForCStmt -// | 308 = v__ast__ForInStmt -// | 309 = v__ast__ForStmt -// | 310 = v__ast__GlobalDecl -// | 311 = v__ast__GotoLabel -// | 312 = v__ast__GotoStmt -// | 313 = v__ast__HashStmt -// | 314 = v__ast__Import -// | 315 = v__ast__InterfaceDecl -// | 316 = v__ast__Module -// | 277 = v__ast__NodeError -// | 317 = v__ast__Return -// | 318 = v__ast__SqlStmt -// | 319 = v__ast__StructDecl -// | 243 = v__ast__TypeDecl +// | 297 = v__ast__AsmStmt +// | 298 = v__ast__AssertStmt +// | 299 = v__ast__AssignStmt +// | 300 = v__ast__Block +// | 301 = v__ast__BranchStmt +// | 302 = v__ast__ComptimeFor +// | 303 = v__ast__ConstDecl +// | 304 = v__ast__DeferStmt +// | 305 = v__ast__EmptyStmt +// | 306 = v__ast__EnumDecl +// | 307 = v__ast__ExprStmt +// | 184 = v__ast__FnDecl +// | 308 = v__ast__ForCStmt +// | 309 = v__ast__ForInStmt +// | 310 = v__ast__ForStmt +// | 311 = v__ast__GlobalDecl +// | 312 = v__ast__GotoLabel +// | 313 = v__ast__GotoStmt +// | 314 = v__ast__HashStmt +// | 315 = v__ast__Import +// | 316 = v__ast__InterfaceDecl +// | 317 = v__ast__Module +// | 278 = v__ast__NodeError +// | 318 = v__ast__Return +// | 319 = v__ast__SqlStmt +// | 320 = v__ast__StructDecl +// | 244 = v__ast__TypeDecl struct v__ast__Stmt { union { v__ast__AsmStmt* _v__ast__AsmStmt; @@ -3323,10 +3340,10 @@ struct v__ast__Stmt { // Union sum type v__ast__ScopeObject = -// | 321 = v__ast__AsmRegister -// | 322 = v__ast__ConstField -// | 323 = v__ast__GlobalField -// | 324 = v__ast__Var +// | 322 = v__ast__AsmRegister +// | 323 = v__ast__ConstField +// | 324 = v__ast__GlobalField +// | 325 = v__ast__Var struct v__ast__ScopeObject { union { v__ast__AsmRegister* _v__ast__AsmRegister; @@ -3341,22 +3358,22 @@ struct v__ast__ScopeObject { // Union sum type v__ast__Node = -// | 326 = v__ast__CallArg -// | 322 = v__ast__ConstField -// | 327 = v__ast__EmptyNode -// | 328 = v__ast__EnumField -// | 295 = v__ast__Expr -// | 174 = v__ast__File -// | 323 = v__ast__GlobalField -// | 329 = v__ast__IfBranch -// | 330 = v__ast__MatchBranch -// | 277 = v__ast__NodeError -// | 331 = v__ast__Param -// | 325 = v__ast__ScopeObject -// | 332 = v__ast__SelectBranch -// | 320 = v__ast__Stmt -// | 333 = v__ast__StructField -// | 334 = v__ast__StructInitField +// | 327 = v__ast__CallArg +// | 323 = v__ast__ConstField +// | 328 = v__ast__EmptyNode +// | 329 = v__ast__EnumField +// | 296 = v__ast__Expr +// | 175 = v__ast__File +// | 324 = v__ast__GlobalField +// | 330 = v__ast__IfBranch +// | 331 = v__ast__MatchBranch +// | 278 = v__ast__NodeError +// | 332 = v__ast__Param +// | 326 = v__ast__ScopeObject +// | 333 = v__ast__SelectBranch +// | 321 = v__ast__Stmt +// | 334 = v__ast__StructField +// | 335 = v__ast__StructInitField struct v__ast__Node { union { v__ast__CallArg* _v__ast__CallArg; @@ -3381,7 +3398,7 @@ struct v__ast__Node { // Union sum type v__ast__ComptTimeConstValue = -// | 262 = v__ast__EmptyExpr +// | 263 = v__ast__EmptyExpr // | 15 = f32 // | 16 = f64 // | 6 = i16 @@ -3415,8 +3432,8 @@ struct v__ast__ComptTimeConstValue { // Union sum type v__ast__IdentInfo = -// | 375 = v__ast__IdentFn -// | 376 = v__ast__IdentVar +// | 376 = v__ast__IdentFn +// | 377 = v__ast__IdentVar struct v__ast__IdentInfo { union { v__ast__IdentFn* _v__ast__IdentFn; @@ -3427,14 +3444,14 @@ struct v__ast__IdentInfo { // Union sum type v__ast__AsmArg = -// | 396 = v__ast__AsmAddressing -// | 397 = v__ast__AsmAlias -// | 398 = v__ast__AsmDisp -// | 321 = v__ast__AsmRegister -// | 250 = v__ast__BoolLiteral -// | 255 = v__ast__CharLiteral -// | 264 = v__ast__FloatLiteral -// | 271 = v__ast__IntegerLiteral +// | 397 = v__ast__AsmAddressing +// | 398 = v__ast__AsmAlias +// | 399 = v__ast__AsmDisp +// | 322 = v__ast__AsmRegister +// | 251 = v__ast__BoolLiteral +// | 256 = v__ast__CharLiteral +// | 265 = v__ast__FloatLiteral +// | 272 = v__ast__IntegerLiteral // | 20 = string struct v__ast__AsmArg { union { @@ -3453,20 +3470,20 @@ struct v__ast__AsmArg { // Union sum type v__ast__TypeInfo = -// | 429 = v__ast__Aggregate -// | 431 = v__ast__Alias -// | 411 = v__ast__Array -// | 439 = v__ast__ArrayFixed -// | 440 = v__ast__Chan -// | 445 = v__ast__Enum -// | 443 = v__ast__FnType -// | 444 = v__ast__GenericInst -// | 434 = v__ast__Interface -// | 412 = v__ast__Map -// | 442 = v__ast__MultiReturn -// | 416 = v__ast__Struct -// | 435 = v__ast__SumType -// | 441 = v__ast__Thread +// | 430 = v__ast__Aggregate +// | 432 = v__ast__Alias +// | 412 = v__ast__Array +// | 440 = v__ast__ArrayFixed +// | 441 = v__ast__Chan +// | 446 = v__ast__Enum +// | 444 = v__ast__FnType +// | 445 = v__ast__GenericInst +// | 435 = v__ast__Interface +// | 413 = v__ast__Map +// | 443 = v__ast__MultiReturn +// | 417 = v__ast__Struct +// | 436 = v__ast__SumType +// | 442 = v__ast__Thread struct v__ast__TypeInfo { union { v__ast__Aggregate* _v__ast__Aggregate; @@ -6298,6 +6315,7 @@ struct v__gen__c__Gen { strings__Builder shared_types; strings__Builder shared_functions; strings__Builder options; + strings__Builder out_results; strings__Builder json_forward_decls; strings__Builder sql_buf; v__ast__File* file; @@ -6324,6 +6342,7 @@ struct v__gen__c__Gen { bool is_cc_msvc; string vlines_path; Map_string_string optionals; + Map_string_string results; __shared__Array_string* done_optionals; Map_string_string chan_pop_optionals; Map_string_string chan_push_optionals; @@ -7177,6 +7196,8 @@ struct Option_v__builder__VsInstallation { }; +// V result_xxx definitions: + // V json forward decls: // V definitions: @@ -7634,6 +7655,7 @@ VV_LOCAL_SYMBOL string None___str(None__ _d1); IError _v_error(string message); IError error_with_code(string message, int code); VV_LOCAL_SYMBOL void opt_ok(voidptr data, Option* option, int size); +VV_LOCAL_SYMBOL void _result_ok(voidptr data, _result* res, int size); string none_str(none _d2); #define _const_prealloc_block_size 16777216 VMemoryBlock* g_memory_block; // global4 @@ -9483,6 +9505,7 @@ Array_int _const_v__ast__pointer_type_idxs; // inited later Array_int _const_v__ast__string_type_idxs; // inited later v__ast__Type _const_v__ast__void_type; // inited later v__ast__Type _const_v__ast__ovoid_type; // inited later +v__ast__Type _const_v__ast__rvoid_type; // inited later v__ast__Type _const_v__ast__voidptr_type; // inited later v__ast__Type _const_v__ast__byteptr_type; // inited later v__ast__Type _const_v__ast__charptr_type; // inited later @@ -9822,6 +9845,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_default(v__gen__c__Gen* g, v__ast__T VV_LOCAL_SYMBOL string v__gen__c__Gen_get_str_fn(v__gen__c__Gen* g, v__ast__Type typ); VV_LOCAL_SYMBOL void v__gen__c__Gen_final_gen_str(v__gen__c__Gen* g, v__gen__c__StrType typ); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_option(v__gen__c__Gen* g, v__ast__Type typ, string styp, string str_fn_name); +VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_result(v__gen__c__Gen* g, v__ast__Type typ, string styp, string str_fn_name); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_alias(v__gen__c__Gen* g, v__ast__Alias info, string styp, string str_fn_name); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_multi_return(v__gen__c__Gen* g, v__ast__MultiReturn info, string styp, string str_fn_name); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_enum(v__gen__c__Gen* g, v__ast__Enum info, string styp, string str_fn_name); @@ -9843,6 +9867,7 @@ Array_string _const_v__gen__c__c_reserved; // inited later Map_string_bool _const_v__gen__c__c_reserved_map; // inited later Array_string _const_v__gen__c__cmp_str; // inited later Array_string _const_v__gen__c__cmp_rev; // inited later +string _const_v__gen__c__result_name; // a string literal, inited later VV_LOCAL_SYMBOL Map_string_bool v__gen__c__string_array_to_map(Array_string a); string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pref__Preferences* pref); VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__PoolProcessor* p, int idx, int wid); @@ -9859,9 +9884,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_expr_string(v__gen__c__Gen* g, v__ast__Exp VV_LOCAL_SYMBOL string v__gen__c__Gen_expr_string_with_cast(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type typ, v__ast__Type exp); VV_LOCAL_SYMBOL string v__gen__c__Gen_expr_string_surround(v__gen__c__Gen* g, string prepend, v__ast__Expr expr, string append); VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_optional_type_name(v__gen__c__Gen* g, v__ast__Type t); +VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_result_type_name(v__gen__c__Gen* g, v__ast__Type t); VV_LOCAL_SYMBOL string v__gen__c__Gen_optional_type_text(v__gen__c__Gen* g, string styp, string base); +VV_LOCAL_SYMBOL string v__gen__c__Gen_result_type_text(v__gen__c__Gen* g, string styp, string base); VV_LOCAL_SYMBOL string v__gen__c__Gen_register_optional(v__gen__c__Gen* g, v__ast__Type t); +VV_LOCAL_SYMBOL string v__gen__c__Gen_register_result(v__gen__c__Gen* g, v__ast__Type t); VV_LOCAL_SYMBOL void v__gen__c__Gen_write_optionals(v__gen__c__Gen* g); +VV_LOCAL_SYMBOL void v__gen__c__Gen_write_results(v__gen__c__Gen* g); VV_LOCAL_SYMBOL string v__gen__c__Gen_find_or_register_shared(v__gen__c__Gen* g, v__ast__Type t, string base); VV_LOCAL_SYMBOL void v__gen__c__Gen_write_shareds(v__gen__c__Gen* g); VV_LOCAL_SYMBOL void v__gen__c__Gen_register_thread_void_wait_call(v__gen__c__Gen* g); @@ -9929,6 +9958,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) VV_LOCAL_SYMBOL void v__gen__c__Gen_cast_expr(v__gen__c__Gen* g, v__ast__CastExpr node); VV_LOCAL_SYMBOL void v__gen__c__Gen_concat_expr(v__gen__c__Gen* g, v__ast__ConcatExpr node); VV_LOCAL_SYMBOL bool v__gen__c__Gen_expr_is_multi_return_call(v__gen__c__Gen* g, v__ast__Expr expr); +VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_result_error(v__gen__c__Gen* g, v__ast__Type target_type, v__ast__Expr expr); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_optional_error(v__gen__c__Gen* g, v__ast__Type target_type, v__ast__Expr expr); VV_LOCAL_SYMBOL void v__gen__c__Gen_return_stmt(v__gen__c__Gen* g, v__ast__Return node); VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl(v__gen__c__Gen* g, v__ast__ConstDecl node); @@ -9972,9 +10002,6 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_check_noscan(v__gen__c__Gen* g, v__ast__Ty string _const_v__gen__c__c_commit_hash_default; // a string literal, inited later string _const_v__gen__c__c_current_commit_hash_default; // a string literal, inited later string _const_v__gen__c__c_concurrency_helpers; // a string literal, inited later -VV_LOCAL_SYMBOL string v__gen__c__arm64_bytes(int nargs); -VV_LOCAL_SYMBOL string v__gen__c__arm32_bytes(int nargs); -VV_LOCAL_SYMBOL string v__gen__c__amd64_bytes(int nargs); VV_LOCAL_SYMBOL string v__gen__c__c_closure_helpers(v__pref__Preferences* pref); string _const_v__gen__c__c_common_macros; // a string literal, inited later string _const_v__gen__c__c_unsigned_comparison_functions; // a string literal, inited later @@ -10017,7 +10044,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_decl(v__gen__c__Gen* g, v__ast__FnDecl no VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_fn_decl(v__gen__c__Gen* g, v__ast__FnDecl* node, bool skip); VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast__FnDecl* node); string _const_v__gen__c__closure_ctx; // a string literal, inited later -VV_LOCAL_SYMBOL string v__gen__c__closure_ctx_struct(v__ast__FnDecl node); +VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__closure_ctx(v__ast__FnDecl node); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn(v__gen__c__Gen* g, v__ast__AnonFn* node); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn_decl(v__gen__c__Gen* g, v__ast__AnonFn* node); VV_LOCAL_SYMBOL string v__gen__c__Gen_defer_flag_var(v__gen__c__Gen* g, v__ast__DeferStmt* stmt); @@ -10452,7 +10479,8 @@ 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__pref__Arch_str(v__pref__Arch it); // 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 @@ -11040,10 +11068,11 @@ void vinit_string_literals(void){ _const_v__checker__vroot_is_deprecated_message = _SLIT("@VROOT is deprecated, use @VMODROOT or @VEXEROOT instead"); _const_v__checker__unicode_lit_overflow_message = _SLIT("unicode character exceeds max allowed value of 0x10ffff, consider using a unicode literal (\\u####)"); _const_v__gen__c__si_s_code = _SLIT("0xfe10"); + _const_v__gen__c__result_name = _SLIT("_result"); _const_v__gen__c__c_commit_hash_default = _SLIT("\n#ifndef V_COMMIT_HASH\n\011#define V_COMMIT_HASH \"@@@\"\n#endif\n"); _const_v__gen__c__c_current_commit_hash_default = _SLIT("\n#ifndef V_CURRENT_COMMIT_HASH\n\011#define V_CURRENT_COMMIT_HASH \"@@@\"\n#endif\n"); _const_v__gen__c__c_concurrency_helpers = _SLIT("\ntypedef struct __shared_map __shared_map;\nstruct __shared_map {\n\011sync__RwMutex mtx;\n\011map val;\n};\nstatic inline voidptr __dup_shared_map(voidptr src, int sz) {\n\011__shared_map* dest = memdup(src, sz);\n\011sync__RwMutex_init(&dest->mtx);\n\011return dest;\n}\ntypedef struct __shared_array __shared_array;\nstruct __shared_array {\n\011sync__RwMutex mtx;\n\011array val;\n};\nstatic inline voidptr __dup_shared_array(voidptr src, int sz) {\n\011__shared_array* dest = memdup(src, sz);\n\011sync__RwMutex_init(&dest->mtx);\n\011return dest;\n}\nstatic inline void __sort_ptr(uintptr_t a[], bool b[], int l) {\n\011for (int i=1; i0 && a[j-1] > ins) {\n\011\011\011a[j] = a[j-1];\n\011\011\011b[j] = b[j-1];\n\011\011\011j--;\n\011\011}\n\011\011a[j] = ins;\n\011\011b[j] = insb;\n\011}\n}\n"); - _const_v__gen__c__c_common_macros = _SLIT("\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__)\n\011#define __V_amd64 1\n\011#undef __V_architecture\n\011#define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__)\n\011#define __V_arm64 1\n\011#undef __V_architecture\n\011#define __V_architecture 2\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n\011#define __V_GCC__\n#endif\n#ifdef __TINYC__\n\011#undef __V_GCC__\n#endif\n#ifdef __cplusplus\n\011#undef __V_GCC__\n#endif\n#ifdef __clang__\n\011#undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n\011#undef __V_GCC__\n\011#undef EMPTY_STRUCT_INITIALIZATION\n\011#define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n\011#define _Atomic volatile\n\011#undef EMPTY_STRUCT_DECLARATION\n\011#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n\011#undef EMPTY_ARRAY_OF_ELEMS\n\011#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n\011#undef __NOINLINE\n\011#undef __IRQHANDLER\n\011// tcc does not support inlining at all\n\011#define __NOINLINE\n\011#define __IRQHANDLER\n\011#undef TCCSKIP\n\011#define TCCSKIP(x)\n\011// #include \n\011#ifndef _WIN32\n\011\011#include \n\011\011int tcc_backtrace(const char *fmt, ...);\n\011#endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n\011#define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n\011#define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n// returns the number of CPU registers that TYPE takes up\n#define _REG_WIDTH(T) (((sizeof(T) + sizeof(void*) - 1) & ~(sizeof(void*) - 1)) / sizeof(void*))\n// parameters of size <= 2 registers are spilled across those two registers; larger types are passed as one pointer to some stack location\n#define _REG_WIDTH_BOUNDED(T) (_REG_WIDTH(T) <= 2 ? _REG_WIDTH(T) : 1)\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n\011#ifdef PRIx64\n\011\011#define V64_PRINTFORMAT \"0x%\"PRIx64\n\011#elif defined(__WIN32__)\n\011\011#define V64_PRINTFORMAT \"0x%I64x\"\n\011#elif defined(__linux__) && defined(__LP64__)\n\011\011#define V64_PRINTFORMAT \"0x%lx\"\n\011#else\n\011\011#define V64_PRINTFORMAT \"0x%llx\"\n\011#endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n\011#define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n\011#define VV_LOCAL_SYMBOL static\n#else\n\011// 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n\011// and does not support __has_attribute(visibility) ...\n\011#ifndef __has_attribute\n\011\011#define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n\011#endif\n\011#if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n\011\011#ifdef ARM\n\011\011\011#define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n\011\011#else\n\011\011\011#define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n\011\011#endif\n\011\011#if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n\011\011\011#define VV_LOCAL_SYMBOL static\n\011\011#else\n\011\011\011#define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n\011\011#endif\n\011#else\n\011\011#define VV_EXPORTED_SYMBOL extern\n\011\011#define VV_LOCAL_SYMBOL static\n\011#endif\n#endif\n\n#ifdef __cplusplus\n\011#include \n\011#define _MOV std::move\n#else\n\011#define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n\011#define VWEAK __attribute__((weak))\n\011#ifdef _MSC_VER\n\011\011#undef VWEAK\n\011\011#define VWEAK\n\011#endif\n#endif\n\n#if !defined(VNORETURN)\n\011#if defined(__TINYC__)\n\011\011#include \n\011\011#define VNORETURN noreturn\n\011#endif\n\011# if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n\011# define VNORETURN _Noreturn\n\011# elif defined(__GNUC__) && __GNUC__ >= 2\n\011# define VNORETURN __attribute__((noreturn))\n\011# endif\n\011#ifndef VNORETURN\n\011\011#define VNORETURN\n\011#endif\n#endif\n\n#if !defined(VUNREACHABLE)\n\011#if defined(__GNUC__) && !defined(__clang__)\n\011\011#define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n\011\011#if (V_GCC_VERSION >= 40500L)\n\011\011\011#define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n\011\011#endif\n\011#endif\n\011#if defined(__clang__) && defined(__has_builtin)\n\011\011#if __has_builtin(__builtin_unreachable)\n\011\011\011#define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n\011\011#endif\n\011#endif\n\011#ifndef VUNREACHABLE\n\011\011#define VUNREACHABLE() do { } while (0)\n\011#endif\n\011#if defined(__FreeBSD__) && defined(__TINYC__)\n\011\011#define VUNREACHABLE() do { } while (0)\n\011#endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n\011#define _likely_(x) __builtin_expect(x,1)\n\011#define _unlikely_(x) __builtin_expect(x,0)\n#else\n\011#define _likely_(x) (x)\n\011#define _unlikely_(x) (x)\n#endif\n\n"); + _const_v__gen__c__c_common_macros = _SLIT("\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__) || defined(_M_AMD64)\n\011#define __V_amd64 1\n\011#undef __V_architecture\n\011#define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)\n\011#define __V_arm64 1\n\011#undef __V_architecture\n\011#define __V_architecture 2\n#endif\n\n#if defined(__arm__) || defined(_M_ARM)\n\011#define __V_arm32 1\n\011#undef __V_architecture\n\011#define __V_architecture 3\n#endif\n\n#if defined(__i386__) || defined(_M_IX86)\n\011#define __V_x86 1\n\011#undef __V_architecture\n\011#define __V_architecture 6\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n\011#define __V_GCC__\n#endif\n#ifdef __TINYC__\n\011#undef __V_GCC__\n#endif\n#ifdef __cplusplus\n\011#undef __V_GCC__\n#endif\n#ifdef __clang__\n\011#undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n\011#undef __V_GCC__\n\011#undef EMPTY_STRUCT_INITIALIZATION\n\011#define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n\011#define _Atomic volatile\n\011#undef EMPTY_STRUCT_DECLARATION\n\011#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n\011#undef EMPTY_ARRAY_OF_ELEMS\n\011#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n\011#undef __NOINLINE\n\011#undef __IRQHANDLER\n\011// tcc does not support inlining at all\n\011#define __NOINLINE\n\011#define __IRQHANDLER\n\011#undef TCCSKIP\n\011#define TCCSKIP(x)\n\011// #include \n\011#ifndef _WIN32\n\011\011#include \n\011\011int tcc_backtrace(const char *fmt, ...);\n\011#endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n\011#define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n\011#define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n\011#ifdef PRIx64\n\011\011#define V64_PRINTFORMAT \"0x%\"PRIx64\n\011#elif defined(__WIN32__)\n\011\011#define V64_PRINTFORMAT \"0x%I64x\"\n\011#elif defined(__linux__) && defined(__LP64__)\n\011\011#define V64_PRINTFORMAT \"0x%lx\"\n\011#else\n\011\011#define V64_PRINTFORMAT \"0x%llx\"\n\011#endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n\011#define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n\011#define VV_LOCAL_SYMBOL static\n#else\n\011// 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n\011// and does not support __has_attribute(visibility) ...\n\011#ifndef __has_attribute\n\011\011#define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n\011#endif\n\011#if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n\011\011#ifdef ARM\n\011\011\011#define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n\011\011#else\n\011\011\011#define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n\011\011#endif\n\011\011#if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n\011\011\011#define VV_LOCAL_SYMBOL static\n\011\011#else\n\011\011\011#define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n\011\011#endif\n\011#else\n\011\011#define VV_EXPORTED_SYMBOL extern\n\011\011#define VV_LOCAL_SYMBOL static\n\011#endif\n#endif\n\n#ifdef __cplusplus\n\011#include \n\011#define _MOV std::move\n#else\n\011#define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n\011#define VWEAK __attribute__((weak))\n\011#ifdef _MSC_VER\n\011\011#undef VWEAK\n\011\011#define VWEAK\n\011#endif\n#endif\n\n#if !defined(VNORETURN)\n\011#if defined(__TINYC__)\n\011\011#include \n\011\011#define VNORETURN noreturn\n\011#endif\n\011# if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n\011# define VNORETURN _Noreturn\n\011# elif defined(__GNUC__) && __GNUC__ >= 2\n\011# define VNORETURN __attribute__((noreturn))\n\011# endif\n\011#ifndef VNORETURN\n\011\011#define VNORETURN\n\011#endif\n#endif\n\n#if !defined(VUNREACHABLE)\n\011#if defined(__GNUC__) && !defined(__clang__)\n\011\011#define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n\011\011#if (V_GCC_VERSION >= 40500L)\n\011\011\011#define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n\011\011#endif\n\011#endif\n\011#if defined(__clang__) && defined(__has_builtin)\n\011\011#if __has_builtin(__builtin_unreachable)\n\011\011\011#define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n\011\011#endif\n\011#endif\n\011#ifndef VUNREACHABLE\n\011\011#define VUNREACHABLE() do { } while (0)\n\011#endif\n\011#if defined(__FreeBSD__) && defined(__TINYC__)\n\011\011#define VUNREACHABLE() do { } while (0)\n\011#endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n\011#define _likely_(x) __builtin_expect(x,1)\n\011#define _unlikely_(x) __builtin_expect(x,0)\n#else\n\011#define _likely_(x) (x)\n\011#define _unlikely_(x) (x)\n#endif\n\n"); _const_v__gen__c__c_unsigned_comparison_functions = _SLIT("\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n"); _const_v__gen__c__c_helper_macros = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n"); _const_v__gen__c__c_builtin_types = _SLIT("\n//================================== builtin types ================================*/\ntypedef int64_t i64;\ntypedef int16_t i16;\ntypedef int8_t i8;\ntypedef uint64_t u64;\ntypedef uint32_t u32;\ntypedef uint8_t u8;\ntypedef uint16_t u16;\n//typedef uint8_t byte;\ntypedef uint32_t rune;\ntypedef size_t usize;\ntypedef ptrdiff_t isize;\n#ifndef VNOFLOAT\ntypedef float f32;\ntypedef double f64;\n#else\ntypedef int32_t f32;\ntypedef int64_t f64;\n#endif\ntypedef int64_t int_literal;\n#ifndef VNOFLOAT\ntypedef double float_literal;\n#else\ntypedef int64_t float_literal;\n#endif\ntypedef unsigned char* byteptr;\ntypedef void* voidptr;\ntypedef char* charptr;\ntypedef u8 array_fixed_byte_300 [300];\n\ntypedef struct sync__Channel* chan;\n\n#ifndef __cplusplus\n\011#ifndef bool\n\011\011#ifdef CUSTOM_DEFINE_4bytebool\n\011\011\011typedef int bool;\n\011\011#else\n\011\011\011typedef u8 bool;\n\011\011#endif\n\011\011#define true 1\n\011\011#define false 0\n\011#endif\n#endif\n\ntypedef u64 (*MapHashFn)(voidptr);\ntypedef bool (*MapEqFn)(voidptr, voidptr);\ntypedef void (*MapCloneFn)(voidptr, voidptr);\ntypedef void (*MapFreeFn)(voidptr);\n"); @@ -11212,22 +11241,7 @@ 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__pref__Arch_str(v__pref__Arch it) { /* gen_str_for_enum */ - switch(it) { - case v__pref__Arch___auto: return _SLIT("_auto"); - case v__pref__Arch__amd64: return _SLIT("amd64"); - case v__pref__Arch__arm64: return _SLIT("arm64"); - case v__pref__Arch__arm32: return _SLIT("arm32"); - case v__pref__Arch__rv64: return _SLIT("rv64"); - case v__pref__Arch__rv32: return _SLIT("rv32"); - case v__pref__Arch__i386: return _SLIT("i386"); - case v__pref__Arch__js_node: return _SLIT("js_node"); - case v__pref__Arch__js_browser: return _SLIT("js_browser"); - case v__pref__Arch__js_freestanding: return _SLIT("js_freestanding"); - case v__pref__Arch___max: return _SLIT("_max"); - default: return _SLIT("unknown enum value"); - } -} +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"); @@ -11410,7 +11424,8 @@ static string v__ast__OrKind_str(v__ast__OrKind it) { /* gen_str_for_enum */ switch(it) { case v__ast__OrKind__absent: return _SLIT("absent"); case v__ast__OrKind__block: return _SLIT("block"); - case v__ast__OrKind__propagate: return _SLIT("propagate"); + case v__ast__OrKind__propagate_option: return _SLIT("propagate_option"); + case v__ast__OrKind__propagate_result: return _SLIT("propagate_result"); default: return _SLIT("unknown enum value"); } } @@ -11546,59 +11561,59 @@ static string indent_v__ast__CallExpr_str(v__ast__CallExpr it, int indent_count) static string indent_v__ast__TypeInfo_str(v__ast__TypeInfo x, int indent_count) { switch(x._typ) { - case 429: return str_intp(2, _MOV((StrIntpData[]){ + case 430: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Aggregate_str(*(v__ast__Aggregate*)x._v__ast__Aggregate, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 431: return str_intp(2, _MOV((StrIntpData[]){ + case 432: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Alias_str(*(v__ast__Alias*)x._v__ast__Alias, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 411: return str_intp(2, _MOV((StrIntpData[]){ + case 412: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Array_str(*(v__ast__Array*)x._v__ast__Array, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 439: return str_intp(2, _MOV((StrIntpData[]){ + case 440: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__ArrayFixed_str(*(v__ast__ArrayFixed*)x._v__ast__ArrayFixed, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 440: return str_intp(2, _MOV((StrIntpData[]){ + case 441: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Chan_str(*(v__ast__Chan*)x._v__ast__Chan, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 445: return str_intp(2, _MOV((StrIntpData[]){ + case 446: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Enum_str(*(v__ast__Enum*)x._v__ast__Enum, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 443: return str_intp(2, _MOV((StrIntpData[]){ + case 444: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__FnType_str(*(v__ast__FnType*)x._v__ast__FnType, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 444: return str_intp(2, _MOV((StrIntpData[]){ + case 445: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__GenericInst_str(*(v__ast__GenericInst*)x._v__ast__GenericInst, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 434: return str_intp(2, _MOV((StrIntpData[]){ + case 435: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Interface_str(*(v__ast__Interface*)x._v__ast__Interface, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 412: return str_intp(2, _MOV((StrIntpData[]){ + case 413: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Map_str(*(v__ast__Map*)x._v__ast__Map, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 442: return str_intp(2, _MOV((StrIntpData[]){ + case 443: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__MultiReturn_str(*(v__ast__MultiReturn*)x._v__ast__MultiReturn, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 416: return str_intp(2, _MOV((StrIntpData[]){ + case 417: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Struct_str(*(v__ast__Struct*)x._v__ast__Struct, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 435: return str_intp(2, _MOV((StrIntpData[]){ + case 436: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__SumType_str(*(v__ast__SumType*)x._v__ast__SumType, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 441: return str_intp(2, _MOV((StrIntpData[]){ + case 442: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Thread_str(*(v__ast__Thread*)x._v__ast__Thread, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); @@ -11708,7 +11723,7 @@ static string indent_v__ast__Enum_str(v__ast__Enum it, int indent_count) { static string indent_v__ast__ComptTimeConstValue_str(v__ast__ComptTimeConstValue x, int indent_count) { switch(x._typ) { - case 262: return str_intp(2, _MOV((StrIntpData[]){ + case 263: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.ComptTimeConstValue("), 0xfe10, {.d_s = indent_v__ast__EmptyExpr_str(*(v__ast__EmptyExpr*)x._v__ast__EmptyExpr, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); @@ -11764,15 +11779,34 @@ 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 _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 _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 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}}, @@ -11784,288 +11818,288 @@ 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=_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(" 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("}"), 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 _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 _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 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=_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}}, + {_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}}, {_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 _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 _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 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=_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}}, + {_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}}, {_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 _t42 = v__ast__Type_str(it.parent_type); - string _t43 = v__ast__Language_str(it.language); + string _t44 = v__ast__Type_str(it.parent_type); + string _t45 = 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=_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}}, + {_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}}, {_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(&_t43); - string_free(&_t42); + string_free(&_t45); + string_free(&_t44); 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 _t44 = v__ast__Type_str(it.elem_type); + string _t46 = 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=_t44}}, {_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(&_t44); + string_free(&_t46); 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 _t45 = v__ast__Expr_str(it.size_expr); - string _t46 = v__ast__Type_str(it.elem_type); + string _t47 = v__ast__Expr_str(it.size_expr); + string _t48 = 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: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.size}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 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(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t46}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" size_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t47}}, {_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("}"), 0, {.d_c=0}}, })); - string_free(&_t46); - string_free(&_t45); + string_free(&_t48); + string_free(&_t47); 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 _t47 = v__ast__Type_str(it.elem_type); + string _t49 = 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=_t47}}, {_SLIT(""), 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}}, {_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__Interface_str(v__ast__Interface it, int indent_count) { +static string indent_v__ast__FnType_str(v__ast__FnType it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t50 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); - string _t51 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t52 = indent_Array_v__ast__Fn_str(it.methods, indent_count + 1); - string _t53 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); - string _t54 = indent_Map_int_Array_v__ast__Type_str(it.conversions, 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(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t50}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t51}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" methods: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t52}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t53}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" conversions: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t54}}, {_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(" 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}}, + 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_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t53 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t54 = indent_Array_v__ast__Fn_str(it.methods, indent_count + 1); + string _t55 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); + string _t56 = indent_Map_int_Array_v__ast__Type_str(it.conversions, 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 res = str_intp( 39, _MOV((StrIntpData[]){ + {_SLIT("v.ast.Interface{\n"), 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(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t53}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" methods: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t54}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t55}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" conversions: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t56}}, {_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(" 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}}, + {_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 _t58 = v__ast__Type_str(it.key_type); - string _t59 = v__ast__Type_str(it.value_type); + string _t60 = v__ast__Type_str(it.key_type); + string _t61 = 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=_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}}, + {_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}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t59); - string_free(&_t58); + string_free(&_t61); + string_free(&_t60); 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 _t60 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t62 = 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=_t60}}, {_SLIT(""), 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}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t60); + string_free(&_t62); 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 _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 _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 res = str_intp( 43, _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=_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}}, + {_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(" 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}}, {_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(" 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(" 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}}, {_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 _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 _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 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=_t67}}, {_SLIT(""), 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(" 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(" 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(" 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}}, {_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 _t72 = v__ast__Type_str(it.return_type); + string _t74 = 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=_t72}}, {_SLIT(""), 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}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t72); + string_free(&_t74); string_free(&indents); return res; } @@ -12083,289 +12117,289 @@ 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 _t73 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t75 = 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=_t73}}, {_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("}"), 0, {.d_c=0}}, })); - string_free(&_t73); + string_free(&_t75); 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 _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 _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 res = str_intp( 31, _MOV((StrIntpData[]){ {_SLIT("v.ast.Param{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t74}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 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(" name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.name}}, {_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(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t75}}, {_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(" 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(" 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=_t78}}, {_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 _t77 = indent_v__token__Pos_str(it.pos, indent_count + 1); - string _t78 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); - 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 = v__ast__Type_str(it.default_expr_typ); - string _t83 = v__ast__Type_str(it.typ); + string _t79 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t80 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); + string _t81 = indent_Array_v__ast__Comment_str(it.comments, indent_count + 1); + string _t82 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); + string _t83 = v__ast__Expr_str(it.default_expr); + string _t84 = v__ast__Type_str(it.default_expr_typ); + string _t85 = v__ast__Type_str(it.typ); string res = str_intp( 59, _MOV((StrIntpData[]){ {_SLIT("v.ast.StructField{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t77}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t78}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" comments: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t79}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t79}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t80}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" comments: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t81}}, {_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(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t80}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t82}}, {_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(" 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(" 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_global: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_global ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_volatile: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_volatile ? _SLIT("true") : _SLIT("false")}}, {_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_typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t82}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t83}}, {_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(" name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.name}}, {_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(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t85}}, {_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; } static inline v__ast__Expr v__ast__EmptyExpr_to_sumtype_v__ast__Expr(v__ast__EmptyExpr* x) { v__ast__EmptyExpr* ptr = memdup(x, sizeof(v__ast__EmptyExpr)); - return (v__ast__Expr){ ._v__ast__EmptyExpr = ptr, ._typ = 262}; + return (v__ast__Expr){ ._v__ast__EmptyExpr = ptr, ._typ = 263}; } static inline v__ast__Stmt v__ast__EmptyStmt_to_sumtype_v__ast__Stmt(v__ast__EmptyStmt* x) { v__ast__EmptyStmt* ptr = memdup(x, sizeof(v__ast__EmptyStmt)); - return (v__ast__Stmt){ ._v__ast__EmptyStmt = ptr, ._typ = 304, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EmptyStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__EmptyStmt = ptr, ._typ = 305, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EmptyStmt, pos))}; } static inline v__ast__Node v__ast__EmptyNode_to_sumtype_v__ast__Node(v__ast__EmptyNode* x) { v__ast__EmptyNode* ptr = memdup(x, sizeof(v__ast__EmptyNode)); - return (v__ast__Node){ ._v__ast__EmptyNode = ptr, ._typ = 327}; + return (v__ast__Node){ ._v__ast__EmptyNode = ptr, ._typ = 328}; } static inline v__ast__Node v__ast__Expr_to_sumtype_v__ast__Node(v__ast__Expr* x) { v__ast__Expr* ptr = memdup(x, sizeof(v__ast__Expr)); - return (v__ast__Node){ ._v__ast__Expr = ptr, ._typ = 295}; + return (v__ast__Node){ ._v__ast__Expr = ptr, ._typ = 296}; } static inline v__ast__Node v__ast__Stmt_to_sumtype_v__ast__Node(v__ast__Stmt* x) { v__ast__Stmt* ptr = memdup(x, sizeof(v__ast__Stmt)); - return (v__ast__Node){ ._v__ast__Stmt = ptr, ._typ = 320}; + return (v__ast__Node){ ._v__ast__Stmt = ptr, ._typ = 321}; } static inline v__ast__Node v__ast__StructInitField_to_sumtype_v__ast__Node(v__ast__StructInitField* x) { v__ast__StructInitField* ptr = memdup(x, sizeof(v__ast__StructInitField)); - return (v__ast__Node){ ._v__ast__StructInitField = ptr, ._typ = 334}; + return (v__ast__Node){ ._v__ast__StructInitField = ptr, ._typ = 335}; } static inline v__ast__Stmt v__ast__FnDecl_to_sumtype_v__ast__Stmt(v__ast__FnDecl* x) { v__ast__FnDecl* ptr = memdup(x, sizeof(v__ast__FnDecl)); - return (v__ast__Stmt){ ._v__ast__FnDecl = ptr, ._typ = 183, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__FnDecl = ptr, ._typ = 184, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnDecl, pos))}; } static inline v__ast__Node v__ast__CallArg_to_sumtype_v__ast__Node(v__ast__CallArg* x) { v__ast__CallArg* ptr = memdup(x, sizeof(v__ast__CallArg)); - return (v__ast__Node){ ._v__ast__CallArg = ptr, ._typ = 326}; + return (v__ast__Node){ ._v__ast__CallArg = ptr, ._typ = 327}; } static inline v__ast__Expr v__ast__OrExpr_to_sumtype_v__ast__Expr(v__ast__OrExpr* x) { v__ast__OrExpr* ptr = memdup(x, sizeof(v__ast__OrExpr)); - return (v__ast__Expr){ ._v__ast__OrExpr = ptr, ._typ = 280}; + return (v__ast__Expr){ ._v__ast__OrExpr = ptr, ._typ = 281}; } static inline v__ast__Node v__ast__IfBranch_to_sumtype_v__ast__Node(v__ast__IfBranch* x) { v__ast__IfBranch* ptr = memdup(x, sizeof(v__ast__IfBranch)); - return (v__ast__Node){ ._v__ast__IfBranch = ptr, ._typ = 329}; + return (v__ast__Node){ ._v__ast__IfBranch = ptr, ._typ = 330}; } static inline v__ast__Node v__ast__MatchBranch_to_sumtype_v__ast__Node(v__ast__MatchBranch* x) { v__ast__MatchBranch* ptr = memdup(x, sizeof(v__ast__MatchBranch)); - return (v__ast__Node){ ._v__ast__MatchBranch = ptr, ._typ = 330}; + return (v__ast__Node){ ._v__ast__MatchBranch = ptr, ._typ = 331}; } static inline v__ast__Node v__ast__SelectBranch_to_sumtype_v__ast__Node(v__ast__SelectBranch* x) { v__ast__SelectBranch* ptr = memdup(x, sizeof(v__ast__SelectBranch)); - return (v__ast__Node){ ._v__ast__SelectBranch = ptr, ._typ = 332}; + return (v__ast__Node){ ._v__ast__SelectBranch = ptr, ._typ = 333}; } static inline v__ast__Node v__ast__StructField_to_sumtype_v__ast__Node(v__ast__StructField* x) { v__ast__StructField* ptr = memdup(x, sizeof(v__ast__StructField)); - return (v__ast__Node){ ._v__ast__StructField = ptr, ._typ = 333}; + return (v__ast__Node){ ._v__ast__StructField = ptr, ._typ = 334}; } static inline v__ast__Node v__ast__GlobalField_to_sumtype_v__ast__Node(v__ast__GlobalField* x) { v__ast__GlobalField* ptr = memdup(x, sizeof(v__ast__GlobalField)); - return (v__ast__Node){ ._v__ast__GlobalField = ptr, ._typ = 323}; + return (v__ast__Node){ ._v__ast__GlobalField = ptr, ._typ = 324}; } static inline v__ast__Node v__ast__ConstField_to_sumtype_v__ast__Node(v__ast__ConstField* x) { v__ast__ConstField* ptr = memdup(x, sizeof(v__ast__ConstField)); - return (v__ast__Node){ ._v__ast__ConstField = ptr, ._typ = 322}; + return (v__ast__Node){ ._v__ast__ConstField = ptr, ._typ = 323}; } static inline v__ast__Node v__ast__EnumField_to_sumtype_v__ast__Node(v__ast__EnumField* x) { v__ast__EnumField* ptr = memdup(x, sizeof(v__ast__EnumField)); - return (v__ast__Node){ ._v__ast__EnumField = ptr, ._typ = 328}; + return (v__ast__Node){ ._v__ast__EnumField = ptr, ._typ = 329}; } static inline v__ast__Node v__ast__Param_to_sumtype_v__ast__Node(v__ast__Param* x) { v__ast__Param* ptr = memdup(x, sizeof(v__ast__Param)); - return (v__ast__Node){ ._v__ast__Param = ptr, ._typ = 331}; + return (v__ast__Node){ ._v__ast__Param = ptr, ._typ = 332}; } static inline v__ast__Expr v__ast__TypeNode_to_sumtype_v__ast__Expr(v__ast__TypeNode* x) { v__ast__TypeNode* ptr = memdup(x, sizeof(v__ast__TypeNode)); - return (v__ast__Expr){ ._v__ast__TypeNode = ptr, ._typ = 292}; + return (v__ast__Expr){ ._v__ast__TypeNode = ptr, ._typ = 293}; } static inline v__ast__ScopeObject v__ast__AsmRegister_to_sumtype_v__ast__ScopeObject(v__ast__AsmRegister* x) { v__ast__AsmRegister* ptr = memdup(x, sizeof(v__ast__AsmRegister)); - return (v__ast__ScopeObject){ ._v__ast__AsmRegister = ptr, ._typ = 321, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmRegister, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmRegister, typ))}; + return (v__ast__ScopeObject){ ._v__ast__AsmRegister = ptr, ._typ = 322, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmRegister, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmRegister, typ))}; } static inline v__ast__ComptTimeConstValue v__ast__EmptyExpr_to_sumtype_v__ast__ComptTimeConstValue(v__ast__EmptyExpr* x) { v__ast__EmptyExpr* ptr = memdup(x, sizeof(v__ast__EmptyExpr)); - return (v__ast__ComptTimeConstValue){ ._v__ast__EmptyExpr = ptr, ._typ = 262}; + return (v__ast__ComptTimeConstValue){ ._v__ast__EmptyExpr = ptr, ._typ = 263}; } static inline v__ast__Expr v__ast__ArrayInit_to_sumtype_v__ast__Expr(v__ast__ArrayInit* x) { v__ast__ArrayInit* ptr = memdup(x, sizeof(v__ast__ArrayInit)); - return (v__ast__Expr){ ._v__ast__ArrayInit = ptr, ._typ = 246}; + return (v__ast__Expr){ ._v__ast__ArrayInit = ptr, ._typ = 247}; } static inline v__ast__Expr v__ast__StringLiteral_to_sumtype_v__ast__Expr(v__ast__StringLiteral* x) { v__ast__StringLiteral* ptr = memdup(x, sizeof(v__ast__StringLiteral)); - return (v__ast__Expr){ ._v__ast__StringLiteral = ptr, ._typ = 290}; + return (v__ast__Expr){ ._v__ast__StringLiteral = ptr, ._typ = 291}; } static inline v__ast__Expr v__ast__MapInit_to_sumtype_v__ast__Expr(v__ast__MapInit* x) { v__ast__MapInit* ptr = memdup(x, sizeof(v__ast__MapInit)); - return (v__ast__Expr){ ._v__ast__MapInit = ptr, ._typ = 275}; + return (v__ast__Expr){ ._v__ast__MapInit = ptr, ._typ = 276}; } static inline v__ast__Expr v__ast__StructInit_to_sumtype_v__ast__Expr(v__ast__StructInit* x) { v__ast__StructInit* ptr = memdup(x, sizeof(v__ast__StructInit)); - return (v__ast__Expr){ ._v__ast__StructInit = ptr, ._typ = 291}; + return (v__ast__Expr){ ._v__ast__StructInit = ptr, ._typ = 292}; } static inline v__ast__TypeInfo v__ast__SumType_to_sumtype_v__ast__TypeInfo(v__ast__SumType* x) { v__ast__SumType* ptr = memdup(x, sizeof(v__ast__SumType)); - return (v__ast__TypeInfo){ ._v__ast__SumType = ptr, ._typ = 435}; + return (v__ast__TypeInfo){ ._v__ast__SumType = ptr, ._typ = 436}; } static inline v__ast__TypeInfo v__ast__Chan_to_sumtype_v__ast__TypeInfo(v__ast__Chan* x) { v__ast__Chan* ptr = memdup(x, sizeof(v__ast__Chan)); - return (v__ast__TypeInfo){ ._v__ast__Chan = ptr, ._typ = 440}; + return (v__ast__TypeInfo){ ._v__ast__Chan = ptr, ._typ = 441}; } static inline v__ast__TypeInfo v__ast__Map_to_sumtype_v__ast__TypeInfo(v__ast__Map* x) { v__ast__Map* ptr = memdup(x, sizeof(v__ast__Map)); - return (v__ast__TypeInfo){ ._v__ast__Map = ptr, ._typ = 412}; + return (v__ast__TypeInfo){ ._v__ast__Map = ptr, ._typ = 413}; } static inline v__ast__TypeInfo v__ast__Thread_to_sumtype_v__ast__TypeInfo(v__ast__Thread* x) { v__ast__Thread* ptr = memdup(x, sizeof(v__ast__Thread)); - return (v__ast__TypeInfo){ ._v__ast__Thread = ptr, ._typ = 441}; + return (v__ast__TypeInfo){ ._v__ast__Thread = ptr, ._typ = 442}; } static inline v__ast__TypeInfo v__ast__Struct_to_sumtype_v__ast__TypeInfo(v__ast__Struct* x) { v__ast__Struct* ptr = memdup(x, sizeof(v__ast__Struct)); - return (v__ast__TypeInfo){ ._v__ast__Struct = ptr, ._typ = 416}; + return (v__ast__TypeInfo){ ._v__ast__Struct = ptr, ._typ = 417}; } static inline v__ast__TypeInfo v__ast__Array_to_sumtype_v__ast__TypeInfo(v__ast__Array* x) { v__ast__Array* ptr = memdup(x, sizeof(v__ast__Array)); - return (v__ast__TypeInfo){ ._v__ast__Array = ptr, ._typ = 411}; + return (v__ast__TypeInfo){ ._v__ast__Array = ptr, ._typ = 412}; } static inline v__ast__TypeInfo v__ast__ArrayFixed_to_sumtype_v__ast__TypeInfo(v__ast__ArrayFixed* x) { v__ast__ArrayFixed* ptr = memdup(x, sizeof(v__ast__ArrayFixed)); - return (v__ast__TypeInfo){ ._v__ast__ArrayFixed = ptr, ._typ = 439}; + return (v__ast__TypeInfo){ ._v__ast__ArrayFixed = ptr, ._typ = 440}; } static inline v__ast__TypeInfo v__ast__MultiReturn_to_sumtype_v__ast__TypeInfo(v__ast__MultiReturn* x) { v__ast__MultiReturn* ptr = memdup(x, sizeof(v__ast__MultiReturn)); - return (v__ast__TypeInfo){ ._v__ast__MultiReturn = ptr, ._typ = 442}; + return (v__ast__TypeInfo){ ._v__ast__MultiReturn = ptr, ._typ = 443}; } static inline v__ast__TypeInfo v__ast__FnType_to_sumtype_v__ast__TypeInfo(v__ast__FnType* x) { v__ast__FnType* ptr = memdup(x, sizeof(v__ast__FnType)); - return (v__ast__TypeInfo){ ._v__ast__FnType = ptr, ._typ = 443}; + return (v__ast__TypeInfo){ ._v__ast__FnType = ptr, ._typ = 444}; } static inline v__ast__Expr v__ast__None_to_sumtype_v__ast__Expr(v__ast__None* x) { v__ast__None* ptr = memdup(x, sizeof(v__ast__None)); - return (v__ast__Expr){ ._v__ast__None = ptr, ._typ = 278}; + return (v__ast__Expr){ ._v__ast__None = ptr, ._typ = 279}; } static inline v__ast__TypeInfo v__ast__Interface_to_sumtype_v__ast__TypeInfo(v__ast__Interface* x) { v__ast__Interface* ptr = memdup(x, sizeof(v__ast__Interface)); - return (v__ast__TypeInfo){ ._v__ast__Interface = ptr, ._typ = 434}; + return (v__ast__TypeInfo){ ._v__ast__Interface = ptr, ._typ = 435}; } static inline v__ast__IdentInfo v__ast__IdentVar_to_sumtype_v__ast__IdentInfo(v__ast__IdentVar* x) { v__ast__IdentVar* ptr = memdup(x, sizeof(v__ast__IdentVar)); - return (v__ast__IdentInfo){ ._v__ast__IdentVar = ptr, ._typ = 376}; + return (v__ast__IdentInfo){ ._v__ast__IdentVar = ptr, ._typ = 377}; } static inline v__ast__Expr v__ast__InfixExpr_to_sumtype_v__ast__Expr(v__ast__InfixExpr* x) { v__ast__InfixExpr* ptr = memdup(x, sizeof(v__ast__InfixExpr)); - return (v__ast__Expr){ ._v__ast__InfixExpr = ptr, ._typ = 270}; + return (v__ast__Expr){ ._v__ast__InfixExpr = ptr, ._typ = 271}; } static inline v__ast__Expr v__ast__CastExpr_to_sumtype_v__ast__Expr(v__ast__CastExpr* x) { v__ast__CastExpr* ptr = memdup(x, sizeof(v__ast__CastExpr)); - return (v__ast__Expr){ ._v__ast__CastExpr = ptr, ._typ = 253}; + return (v__ast__Expr){ ._v__ast__CastExpr = ptr, ._typ = 254}; } static inline v__ast__AsmArg v__ast__AsmRegister_to_sumtype_v__ast__AsmArg(v__ast__AsmRegister* x) { v__ast__AsmRegister* ptr = memdup(x, sizeof(v__ast__AsmRegister)); - return (v__ast__AsmArg){ ._v__ast__AsmRegister = ptr, ._typ = 321}; + return (v__ast__AsmArg){ ._v__ast__AsmRegister = ptr, ._typ = 322}; } static inline v__ast__ScopeObject v__ast__Var_to_sumtype_v__ast__ScopeObject(v__ast__Var* x) { v__ast__Var* ptr = memdup(x, sizeof(v__ast__Var)); - return (v__ast__ScopeObject){ ._v__ast__Var = ptr, ._typ = 324, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Var, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Var, typ))}; + return (v__ast__ScopeObject){ ._v__ast__Var = ptr, ._typ = 325, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Var, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Var, typ))}; } static inline v__ast__IdentInfo v__ast__IdentFn_to_sumtype_v__ast__IdentInfo(v__ast__IdentFn* x) { v__ast__IdentFn* ptr = memdup(x, sizeof(v__ast__IdentFn)); - return (v__ast__IdentInfo){ ._v__ast__IdentFn = ptr, ._typ = 375}; + return (v__ast__IdentInfo){ ._v__ast__IdentFn = ptr, ._typ = 376}; } static inline v__ast__Expr v__ast__IndexExpr_to_sumtype_v__ast__Expr(v__ast__IndexExpr* x) { v__ast__IndexExpr* ptr = memdup(x, sizeof(v__ast__IndexExpr)); - return (v__ast__Expr){ ._v__ast__IndexExpr = ptr, ._typ = 269}; + return (v__ast__Expr){ ._v__ast__IndexExpr = ptr, ._typ = 270}; } static inline v__ast__ComptTimeConstValue int_to_sumtype_v__ast__ComptTimeConstValue(int* x) { @@ -12430,402 +12464,402 @@ static inline v__ast__ComptTimeConstValue f32_to_sumtype_v__ast__ComptTimeConstV static inline v__ast__Stmt v__ast__Return_to_sumtype_v__ast__Stmt(v__ast__Return* x) { v__ast__Return* ptr = memdup(x, sizeof(v__ast__Return)); - return (v__ast__Stmt){ ._v__ast__Return = ptr, ._typ = 317, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Return, pos))}; + return (v__ast__Stmt){ ._v__ast__Return = ptr, ._typ = 318, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Return, pos))}; } static inline v__ast__TypeInfo v__ast__Aggregate_to_sumtype_v__ast__TypeInfo(v__ast__Aggregate* x) { v__ast__Aggregate* ptr = memdup(x, sizeof(v__ast__Aggregate)); - return (v__ast__TypeInfo){ ._v__ast__Aggregate = ptr, ._typ = 429}; + return (v__ast__TypeInfo){ ._v__ast__Aggregate = ptr, ._typ = 430}; } static inline v__ast__Expr v__ast__Ident_to_sumtype_v__ast__Expr(v__ast__Ident* x) { v__ast__Ident* ptr = memdup(x, sizeof(v__ast__Ident)); - return (v__ast__Expr){ ._v__ast__Ident = ptr, ._typ = 266}; + return (v__ast__Expr){ ._v__ast__Ident = ptr, ._typ = 267}; } static inline v__ast__Stmt v__ast__AssertStmt_to_sumtype_v__ast__Stmt(v__ast__AssertStmt* x) { v__ast__AssertStmt* ptr = memdup(x, sizeof(v__ast__AssertStmt)); - return (v__ast__Stmt){ ._v__ast__AssertStmt = ptr, ._typ = 297, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssertStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AssertStmt = ptr, ._typ = 298, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssertStmt, pos))}; } static inline v__ast__Expr v__ast__IfExpr_to_sumtype_v__ast__Expr(v__ast__IfExpr* x) { v__ast__IfExpr* ptr = memdup(x, sizeof(v__ast__IfExpr)); - return (v__ast__Expr){ ._v__ast__IfExpr = ptr, ._typ = 267}; + return (v__ast__Expr){ ._v__ast__IfExpr = ptr, ._typ = 268}; } static inline v__ast__Expr v__ast__BoolLiteral_to_sumtype_v__ast__Expr(v__ast__BoolLiteral* x) { v__ast__BoolLiteral* ptr = memdup(x, sizeof(v__ast__BoolLiteral)); - return (v__ast__Expr){ ._v__ast__BoolLiteral = ptr, ._typ = 250}; + return (v__ast__Expr){ ._v__ast__BoolLiteral = ptr, ._typ = 251}; } static inline v__ast__Expr v__ast__MatchExpr_to_sumtype_v__ast__Expr(v__ast__MatchExpr* x) { v__ast__MatchExpr* ptr = memdup(x, sizeof(v__ast__MatchExpr)); - return (v__ast__Expr){ ._v__ast__MatchExpr = ptr, ._typ = 276}; + return (v__ast__Expr){ ._v__ast__MatchExpr = ptr, ._typ = 277}; } static inline v__ast__Stmt v__ast__ForCStmt_to_sumtype_v__ast__Stmt(v__ast__ForCStmt* x) { v__ast__ForCStmt* ptr = memdup(x, sizeof(v__ast__ForCStmt)); - return (v__ast__Stmt){ ._v__ast__ForCStmt = ptr, ._typ = 307, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForCStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForCStmt = ptr, ._typ = 308, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForCStmt, pos))}; } static inline v__ast__Stmt v__ast__ForStmt_to_sumtype_v__ast__Stmt(v__ast__ForStmt* x) { v__ast__ForStmt* ptr = memdup(x, sizeof(v__ast__ForStmt)); - return (v__ast__Stmt){ ._v__ast__ForStmt = ptr, ._typ = 309, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForStmt = ptr, ._typ = 310, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForStmt, pos))}; } static inline v__ast__Stmt v__ast__InterfaceDecl_to_sumtype_v__ast__Stmt(v__ast__InterfaceDecl* x) { v__ast__InterfaceDecl* ptr = memdup(x, sizeof(v__ast__InterfaceDecl)); - return (v__ast__Stmt){ ._v__ast__InterfaceDecl = ptr, ._typ = 315, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__InterfaceDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__InterfaceDecl = ptr, ._typ = 316, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__InterfaceDecl, pos))}; } static inline v__ast__Expr v__ast__CallExpr_to_sumtype_v__ast__Expr(v__ast__CallExpr* x) { v__ast__CallExpr* ptr = memdup(x, sizeof(v__ast__CallExpr)); - return (v__ast__Expr){ ._v__ast__CallExpr = ptr, ._typ = 252}; + return (v__ast__Expr){ ._v__ast__CallExpr = ptr, ._typ = 253}; } static inline v__ast__Expr v__ast__IntegerLiteral_to_sumtype_v__ast__Expr(v__ast__IntegerLiteral* x) { v__ast__IntegerLiteral* ptr = memdup(x, sizeof(v__ast__IntegerLiteral)); - return (v__ast__Expr){ ._v__ast__IntegerLiteral = ptr, ._typ = 271}; + return (v__ast__Expr){ ._v__ast__IntegerLiteral = ptr, ._typ = 272}; } static inline v__ast__Expr v__ast__FloatLiteral_to_sumtype_v__ast__Expr(v__ast__FloatLiteral* x) { v__ast__FloatLiteral* ptr = memdup(x, sizeof(v__ast__FloatLiteral)); - return (v__ast__Expr){ ._v__ast__FloatLiteral = ptr, ._typ = 264}; + return (v__ast__Expr){ ._v__ast__FloatLiteral = ptr, ._typ = 265}; } static inline v__ast__Expr v__ast__SqlExpr_to_sumtype_v__ast__Expr(v__ast__SqlExpr* x) { v__ast__SqlExpr* ptr = memdup(x, sizeof(v__ast__SqlExpr)); - return (v__ast__Expr){ ._v__ast__SqlExpr = ptr, ._typ = 288}; + return (v__ast__Expr){ ._v__ast__SqlExpr = ptr, ._typ = 289}; } static inline v__ast__Expr v__ast__CTempVar_to_sumtype_v__ast__Expr(v__ast__CTempVar* x) { v__ast__CTempVar* ptr = memdup(x, sizeof(v__ast__CTempVar)); - return (v__ast__Expr){ ._v__ast__CTempVar = ptr, ._typ = 251}; + return (v__ast__Expr){ ._v__ast__CTempVar = ptr, ._typ = 252}; } static inline v__ast__Expr v__ast__SelectorExpr_to_sumtype_v__ast__Expr(v__ast__SelectorExpr* x) { v__ast__SelectorExpr* ptr = memdup(x, sizeof(v__ast__SelectorExpr)); - return (v__ast__Expr){ ._v__ast__SelectorExpr = ptr, ._typ = 286}; + return (v__ast__Expr){ ._v__ast__SelectorExpr = ptr, ._typ = 287}; } static inline v__ast__Stmt v__ast__ForInStmt_to_sumtype_v__ast__Stmt(v__ast__ForInStmt* x) { v__ast__ForInStmt* ptr = memdup(x, sizeof(v__ast__ForInStmt)); - return (v__ast__Stmt){ ._v__ast__ForInStmt = ptr, ._typ = 308, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForInStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForInStmt = ptr, ._typ = 309, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForInStmt, pos))}; } static inline v__ast__Stmt v__ast__ExprStmt_to_sumtype_v__ast__Stmt(v__ast__ExprStmt* x) { v__ast__ExprStmt* ptr = memdup(x, sizeof(v__ast__ExprStmt)); - return (v__ast__Stmt){ ._v__ast__ExprStmt = ptr, ._typ = 306, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ExprStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ExprStmt = ptr, ._typ = 307, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ExprStmt, pos))}; } static inline v__ast__Stmt v__ast__NodeError_to_sumtype_v__ast__Stmt(v__ast__NodeError* x) { v__ast__NodeError* ptr = memdup(x, sizeof(v__ast__NodeError)); - return (v__ast__Stmt){ ._v__ast__NodeError = ptr, ._typ = 277, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__NodeError, pos))}; + return (v__ast__Stmt){ ._v__ast__NodeError = ptr, ._typ = 278, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__NodeError, pos))}; } static inline v__ast__Stmt v__ast__AssignStmt_to_sumtype_v__ast__Stmt(v__ast__AssignStmt* x) { v__ast__AssignStmt* ptr = memdup(x, sizeof(v__ast__AssignStmt)); - return (v__ast__Stmt){ ._v__ast__AssignStmt = ptr, ._typ = 298, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssignStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AssignStmt = ptr, ._typ = 299, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssignStmt, pos))}; } static inline v__ast__Expr v__ast__ComptimeCall_to_sumtype_v__ast__Expr(v__ast__ComptimeCall* x) { v__ast__ComptimeCall* ptr = memdup(x, sizeof(v__ast__ComptimeCall)); - return (v__ast__Expr){ ._v__ast__ComptimeCall = ptr, ._typ = 257}; + return (v__ast__Expr){ ._v__ast__ComptimeCall = ptr, ._typ = 258}; } static inline v__ast__Expr v__ast__ComptimeSelector_to_sumtype_v__ast__Expr(v__ast__ComptimeSelector* x) { v__ast__ComptimeSelector* ptr = memdup(x, sizeof(v__ast__ComptimeSelector)); - return (v__ast__Expr){ ._v__ast__ComptimeSelector = ptr, ._typ = 258}; + return (v__ast__Expr){ ._v__ast__ComptimeSelector = ptr, ._typ = 259}; } static inline v__ast__Expr v__ast__NodeError_to_sumtype_v__ast__Expr(v__ast__NodeError* x) { v__ast__NodeError* ptr = memdup(x, sizeof(v__ast__NodeError)); - return (v__ast__Expr){ ._v__ast__NodeError = ptr, ._typ = 277}; + return (v__ast__Expr){ ._v__ast__NodeError = ptr, ._typ = 278}; } static inline v__ast__Expr v__ast__Comment_to_sumtype_v__ast__Expr(v__ast__Comment* x) { v__ast__Comment* ptr = memdup(x, sizeof(v__ast__Comment)); - return (v__ast__Expr){ ._v__ast__Comment = ptr, ._typ = 256}; + return (v__ast__Expr){ ._v__ast__Comment = ptr, ._typ = 257}; } static inline v__ast__Expr v__ast__EnumVal_to_sumtype_v__ast__Expr(v__ast__EnumVal* x) { v__ast__EnumVal* ptr = memdup(x, sizeof(v__ast__EnumVal)); - return (v__ast__Expr){ ._v__ast__EnumVal = ptr, ._typ = 263}; + return (v__ast__Expr){ ._v__ast__EnumVal = ptr, ._typ = 264}; } static inline v__ast__Expr v__ast__AtExpr_to_sumtype_v__ast__Expr(v__ast__AtExpr* x) { v__ast__AtExpr* ptr = memdup(x, sizeof(v__ast__AtExpr)); - return (v__ast__Expr){ ._v__ast__AtExpr = ptr, ._typ = 249}; + return (v__ast__Expr){ ._v__ast__AtExpr = ptr, ._typ = 250}; } static inline v__ast__Expr v__ast__ComptimeType_to_sumtype_v__ast__Expr(v__ast__ComptimeType* x) { v__ast__ComptimeType* ptr = memdup(x, sizeof(v__ast__ComptimeType)); - return (v__ast__Expr){ ._v__ast__ComptimeType = ptr, ._typ = 259}; + return (v__ast__Expr){ ._v__ast__ComptimeType = ptr, ._typ = 260}; } static inline v__ast__Expr v__ast__CharLiteral_to_sumtype_v__ast__Expr(v__ast__CharLiteral* x) { v__ast__CharLiteral* ptr = memdup(x, sizeof(v__ast__CharLiteral)); - return (v__ast__Expr){ ._v__ast__CharLiteral = ptr, ._typ = 255}; + return (v__ast__Expr){ ._v__ast__CharLiteral = ptr, ._typ = 256}; } static inline v__ast__Expr v__ast__GoExpr_to_sumtype_v__ast__Expr(v__ast__GoExpr* x) { v__ast__GoExpr* ptr = memdup(x, sizeof(v__ast__GoExpr)); - return (v__ast__Expr){ ._v__ast__GoExpr = ptr, ._typ = 265}; + return (v__ast__Expr){ ._v__ast__GoExpr = ptr, ._typ = 266}; } static inline v__ast__Expr v__ast__SelectExpr_to_sumtype_v__ast__Expr(v__ast__SelectExpr* x) { v__ast__SelectExpr* ptr = memdup(x, sizeof(v__ast__SelectExpr)); - return (v__ast__Expr){ ._v__ast__SelectExpr = ptr, ._typ = 285}; + return (v__ast__Expr){ ._v__ast__SelectExpr = ptr, ._typ = 286}; } static inline v__ast__Expr v__ast__ParExpr_to_sumtype_v__ast__Expr(v__ast__ParExpr* x) { v__ast__ParExpr* ptr = memdup(x, sizeof(v__ast__ParExpr)); - return (v__ast__Expr){ ._v__ast__ParExpr = ptr, ._typ = 281}; + return (v__ast__Expr){ ._v__ast__ParExpr = ptr, ._typ = 282}; } static inline v__ast__Expr v__ast__UnsafeExpr_to_sumtype_v__ast__Expr(v__ast__UnsafeExpr* x) { v__ast__UnsafeExpr* ptr = memdup(x, sizeof(v__ast__UnsafeExpr)); - return (v__ast__Expr){ ._v__ast__UnsafeExpr = ptr, ._typ = 294}; + return (v__ast__Expr){ ._v__ast__UnsafeExpr = ptr, ._typ = 295}; } static inline v__ast__Expr v__ast__LockExpr_to_sumtype_v__ast__Expr(v__ast__LockExpr* x) { v__ast__LockExpr* ptr = memdup(x, sizeof(v__ast__LockExpr)); - return (v__ast__Expr){ ._v__ast__LockExpr = ptr, ._typ = 274}; + return (v__ast__Expr){ ._v__ast__LockExpr = ptr, ._typ = 275}; } static inline v__ast__Expr v__ast__IsRefType_to_sumtype_v__ast__Expr(v__ast__IsRefType* x) { v__ast__IsRefType* ptr = memdup(x, sizeof(v__ast__IsRefType)); - return (v__ast__Expr){ ._v__ast__IsRefType = ptr, ._typ = 272}; + return (v__ast__Expr){ ._v__ast__IsRefType = ptr, ._typ = 273}; } static inline v__ast__Expr v__ast__SizeOf_to_sumtype_v__ast__Expr(v__ast__SizeOf* x) { v__ast__SizeOf* ptr = memdup(x, sizeof(v__ast__SizeOf)); - return (v__ast__Expr){ ._v__ast__SizeOf = ptr, ._typ = 287}; + return (v__ast__Expr){ ._v__ast__SizeOf = ptr, ._typ = 288}; } static inline v__ast__Expr v__ast__TypeOf_to_sumtype_v__ast__Expr(v__ast__TypeOf* x) { v__ast__TypeOf* ptr = memdup(x, sizeof(v__ast__TypeOf)); - return (v__ast__Expr){ ._v__ast__TypeOf = ptr, ._typ = 293}; + return (v__ast__Expr){ ._v__ast__TypeOf = ptr, ._typ = 294}; } static inline v__ast__Expr v__ast__DumpExpr_to_sumtype_v__ast__Expr(v__ast__DumpExpr* x) { v__ast__DumpExpr* ptr = memdup(x, sizeof(v__ast__DumpExpr)); - return (v__ast__Expr){ ._v__ast__DumpExpr = ptr, ._typ = 261}; + return (v__ast__Expr){ ._v__ast__DumpExpr = ptr, ._typ = 262}; } static inline v__ast__Expr v__ast__OffsetOf_to_sumtype_v__ast__Expr(v__ast__OffsetOf* x) { v__ast__OffsetOf* ptr = memdup(x, sizeof(v__ast__OffsetOf)); - return (v__ast__Expr){ ._v__ast__OffsetOf = ptr, ._typ = 279}; + return (v__ast__Expr){ ._v__ast__OffsetOf = ptr, ._typ = 280}; } static inline v__ast__Expr v__ast__Likely_to_sumtype_v__ast__Expr(v__ast__Likely* x) { v__ast__Likely* ptr = memdup(x, sizeof(v__ast__Likely)); - return (v__ast__Expr){ ._v__ast__Likely = ptr, ._typ = 273}; + return (v__ast__Expr){ ._v__ast__Likely = ptr, ._typ = 274}; } static inline v__ast__Expr v__ast__AnonFn_to_sumtype_v__ast__Expr(v__ast__AnonFn* x) { v__ast__AnonFn* ptr = memdup(x, sizeof(v__ast__AnonFn)); - return (v__ast__Expr){ ._v__ast__AnonFn = ptr, ._typ = 244}; + return (v__ast__Expr){ ._v__ast__AnonFn = ptr, ._typ = 245}; } static inline v__ast__Expr v__ast__AsCast_to_sumtype_v__ast__Expr(v__ast__AsCast* x) { v__ast__AsCast* ptr = memdup(x, sizeof(v__ast__AsCast)); - return (v__ast__Expr){ ._v__ast__AsCast = ptr, ._typ = 247}; + return (v__ast__Expr){ ._v__ast__AsCast = ptr, ._typ = 248}; } static inline v__ast__Expr v__ast__PostfixExpr_to_sumtype_v__ast__Expr(v__ast__PostfixExpr* x) { v__ast__PostfixExpr* ptr = memdup(x, sizeof(v__ast__PostfixExpr)); - return (v__ast__Expr){ ._v__ast__PostfixExpr = ptr, ._typ = 282}; + return (v__ast__Expr){ ._v__ast__PostfixExpr = ptr, ._typ = 283}; } static inline v__ast__Expr v__ast__PrefixExpr_to_sumtype_v__ast__Expr(v__ast__PrefixExpr* x) { v__ast__PrefixExpr* ptr = memdup(x, sizeof(v__ast__PrefixExpr)); - return (v__ast__Expr){ ._v__ast__PrefixExpr = ptr, ._typ = 283}; + return (v__ast__Expr){ ._v__ast__PrefixExpr = ptr, ._typ = 284}; } static inline v__ast__Expr v__ast__ArrayDecompose_to_sumtype_v__ast__Expr(v__ast__ArrayDecompose* x) { v__ast__ArrayDecompose* ptr = memdup(x, sizeof(v__ast__ArrayDecompose)); - return (v__ast__Expr){ ._v__ast__ArrayDecompose = ptr, ._typ = 245}; + return (v__ast__Expr){ ._v__ast__ArrayDecompose = ptr, ._typ = 246}; } static inline v__ast__Expr v__ast__IfGuardExpr_to_sumtype_v__ast__Expr(v__ast__IfGuardExpr* x) { v__ast__IfGuardExpr* ptr = memdup(x, sizeof(v__ast__IfGuardExpr)); - return (v__ast__Expr){ ._v__ast__IfGuardExpr = ptr, ._typ = 268}; + return (v__ast__Expr){ ._v__ast__IfGuardExpr = ptr, ._typ = 269}; } static inline v__ast__Expr v__ast__RangeExpr_to_sumtype_v__ast__Expr(v__ast__RangeExpr* x) { v__ast__RangeExpr* ptr = memdup(x, sizeof(v__ast__RangeExpr)); - return (v__ast__Expr){ ._v__ast__RangeExpr = ptr, ._typ = 284}; + return (v__ast__Expr){ ._v__ast__RangeExpr = ptr, ._typ = 285}; } static inline v__ast__TypeInfo v__ast__GenericInst_to_sumtype_v__ast__TypeInfo(v__ast__GenericInst* x) { v__ast__GenericInst* ptr = memdup(x, sizeof(v__ast__GenericInst)); - return (v__ast__TypeInfo){ ._v__ast__GenericInst = ptr, ._typ = 444}; + return (v__ast__TypeInfo){ ._v__ast__GenericInst = ptr, ._typ = 445}; } static inline v__ast__Stmt v__ast__Module_to_sumtype_v__ast__Stmt(v__ast__Module* x) { v__ast__Module* ptr = memdup(x, sizeof(v__ast__Module)); - return (v__ast__Stmt){ ._v__ast__Module = ptr, ._typ = 316, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Module, pos))}; + return (v__ast__Stmt){ ._v__ast__Module = ptr, ._typ = 317, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Module, pos))}; } static inline v__ast__Stmt v__ast__Import_to_sumtype_v__ast__Stmt(v__ast__Import* x) { v__ast__Import* ptr = memdup(x, sizeof(v__ast__Import)); - return (v__ast__Stmt){ ._v__ast__Import = ptr, ._typ = 314, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Import, pos))}; + return (v__ast__Stmt){ ._v__ast__Import = ptr, ._typ = 315, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Import, pos))}; } static inline v__ast__Stmt v__ast__ConstDecl_to_sumtype_v__ast__Stmt(v__ast__ConstDecl* x) { v__ast__ConstDecl* ptr = memdup(x, sizeof(v__ast__ConstDecl)); - return (v__ast__Stmt){ ._v__ast__ConstDecl = ptr, ._typ = 302, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__ConstDecl = ptr, ._typ = 303, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstDecl, pos))}; } static inline v__ast__Stmt v__ast__StructDecl_to_sumtype_v__ast__Stmt(v__ast__StructDecl* x) { v__ast__StructDecl* ptr = memdup(x, sizeof(v__ast__StructDecl)); - return (v__ast__Stmt){ ._v__ast__StructDecl = ptr, ._typ = 319, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__StructDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__StructDecl = ptr, ._typ = 320, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__StructDecl, pos))}; } static inline v__ast__Stmt v__ast__EnumDecl_to_sumtype_v__ast__Stmt(v__ast__EnumDecl* x) { v__ast__EnumDecl* ptr = memdup(x, sizeof(v__ast__EnumDecl)); - return (v__ast__Stmt){ ._v__ast__EnumDecl = ptr, ._typ = 305, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EnumDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__EnumDecl = ptr, ._typ = 306, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EnumDecl, pos))}; } static inline v__ast__Stmt v__ast__TypeDecl_to_sumtype_v__ast__Stmt(v__ast__TypeDecl* x) { v__ast__TypeDecl* ptr = memdup(x, sizeof(v__ast__TypeDecl)); - return (v__ast__Stmt){ ._v__ast__TypeDecl = ptr, ._typ = 243, .pos = ptr->pos}; + return (v__ast__Stmt){ ._v__ast__TypeDecl = ptr, ._typ = 244, .pos = ptr->pos}; } static inline v__ast__Stmt v__ast__AsmStmt_to_sumtype_v__ast__Stmt(v__ast__AsmStmt* x) { v__ast__AsmStmt* ptr = memdup(x, sizeof(v__ast__AsmStmt)); - return (v__ast__Stmt){ ._v__ast__AsmStmt = ptr, ._typ = 296, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AsmStmt = ptr, ._typ = 297, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmStmt, pos))}; } static inline v__ast__Stmt v__ast__GlobalDecl_to_sumtype_v__ast__Stmt(v__ast__GlobalDecl* x) { v__ast__GlobalDecl* ptr = memdup(x, sizeof(v__ast__GlobalDecl)); - return (v__ast__Stmt){ ._v__ast__GlobalDecl = ptr, ._typ = 310, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__GlobalDecl = ptr, ._typ = 311, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalDecl, pos))}; } static inline v__ast__Stmt v__ast__HashStmt_to_sumtype_v__ast__Stmt(v__ast__HashStmt* x) { v__ast__HashStmt* ptr = memdup(x, sizeof(v__ast__HashStmt)); - return (v__ast__Stmt){ ._v__ast__HashStmt = ptr, ._typ = 313, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__HashStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__HashStmt = ptr, ._typ = 314, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__HashStmt, pos))}; } static inline v__ast__Stmt v__ast__Block_to_sumtype_v__ast__Stmt(v__ast__Block* x) { v__ast__Block* ptr = memdup(x, sizeof(v__ast__Block)); - return (v__ast__Stmt){ ._v__ast__Block = ptr, ._typ = 299, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Block, pos))}; + return (v__ast__Stmt){ ._v__ast__Block = ptr, ._typ = 300, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Block, pos))}; } static inline v__ast__Stmt v__ast__SqlStmt_to_sumtype_v__ast__Stmt(v__ast__SqlStmt* x) { v__ast__SqlStmt* ptr = memdup(x, sizeof(v__ast__SqlStmt)); - return (v__ast__Stmt){ ._v__ast__SqlStmt = ptr, ._typ = 318, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SqlStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__SqlStmt = ptr, ._typ = 319, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SqlStmt, pos))}; } static inline v__ast__Stmt v__ast__GotoLabel_to_sumtype_v__ast__Stmt(v__ast__GotoLabel* x) { v__ast__GotoLabel* ptr = memdup(x, sizeof(v__ast__GotoLabel)); - return (v__ast__Stmt){ ._v__ast__GotoLabel = ptr, ._typ = 311, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoLabel, pos))}; + return (v__ast__Stmt){ ._v__ast__GotoLabel = ptr, ._typ = 312, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoLabel, pos))}; } static inline v__ast__Stmt v__ast__ComptimeFor_to_sumtype_v__ast__Stmt(v__ast__ComptimeFor* x) { v__ast__ComptimeFor* ptr = memdup(x, sizeof(v__ast__ComptimeFor)); - return (v__ast__Stmt){ ._v__ast__ComptimeFor = ptr, ._typ = 301, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ComptimeFor, pos))}; + return (v__ast__Stmt){ ._v__ast__ComptimeFor = ptr, ._typ = 302, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ComptimeFor, pos))}; } static inline v__ast__Stmt v__ast__BranchStmt_to_sumtype_v__ast__Stmt(v__ast__BranchStmt* x) { v__ast__BranchStmt* ptr = memdup(x, sizeof(v__ast__BranchStmt)); - return (v__ast__Stmt){ ._v__ast__BranchStmt = ptr, ._typ = 300, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__BranchStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__BranchStmt = ptr, ._typ = 301, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__BranchStmt, pos))}; } static inline v__ast__Stmt v__ast__DeferStmt_to_sumtype_v__ast__Stmt(v__ast__DeferStmt* x) { v__ast__DeferStmt* ptr = memdup(x, sizeof(v__ast__DeferStmt)); - return (v__ast__Stmt){ ._v__ast__DeferStmt = ptr, ._typ = 303, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__DeferStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__DeferStmt = ptr, ._typ = 304, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__DeferStmt, pos))}; } static inline v__ast__Stmt v__ast__GotoStmt_to_sumtype_v__ast__Stmt(v__ast__GotoStmt* x) { v__ast__GotoStmt* ptr = memdup(x, sizeof(v__ast__GotoStmt)); - return (v__ast__Stmt){ ._v__ast__GotoStmt = ptr, ._typ = 312, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__GotoStmt = ptr, ._typ = 313, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoStmt, pos))}; } static inline v__ast__AsmArg v__ast__FloatLiteral_to_sumtype_v__ast__AsmArg(v__ast__FloatLiteral* x) { v__ast__FloatLiteral* ptr = memdup(x, sizeof(v__ast__FloatLiteral)); - return (v__ast__AsmArg){ ._v__ast__FloatLiteral = ptr, ._typ = 264}; + return (v__ast__AsmArg){ ._v__ast__FloatLiteral = ptr, ._typ = 265}; } static inline v__ast__AsmArg v__ast__AsmDisp_to_sumtype_v__ast__AsmArg(v__ast__AsmDisp* x) { v__ast__AsmDisp* ptr = memdup(x, sizeof(v__ast__AsmDisp)); - return (v__ast__AsmArg){ ._v__ast__AsmDisp = ptr, ._typ = 398}; + return (v__ast__AsmArg){ ._v__ast__AsmDisp = ptr, ._typ = 399}; } static inline v__ast__AsmArg v__ast__IntegerLiteral_to_sumtype_v__ast__AsmArg(v__ast__IntegerLiteral* x) { v__ast__IntegerLiteral* ptr = memdup(x, sizeof(v__ast__IntegerLiteral)); - return (v__ast__AsmArg){ ._v__ast__IntegerLiteral = ptr, ._typ = 271}; + return (v__ast__AsmArg){ ._v__ast__IntegerLiteral = ptr, ._typ = 272}; } static inline v__ast__AsmArg v__ast__CharLiteral_to_sumtype_v__ast__AsmArg(v__ast__CharLiteral* x) { v__ast__CharLiteral* ptr = memdup(x, sizeof(v__ast__CharLiteral)); - return (v__ast__AsmArg){ ._v__ast__CharLiteral = ptr, ._typ = 255}; + return (v__ast__AsmArg){ ._v__ast__CharLiteral = ptr, ._typ = 256}; } static inline v__ast__AsmArg v__ast__AsmAddressing_to_sumtype_v__ast__AsmArg(v__ast__AsmAddressing* x) { v__ast__AsmAddressing* ptr = memdup(x, sizeof(v__ast__AsmAddressing)); - return (v__ast__AsmArg){ ._v__ast__AsmAddressing = ptr, ._typ = 396}; + return (v__ast__AsmArg){ ._v__ast__AsmAddressing = ptr, ._typ = 397}; } static inline v__ast__AsmArg v__ast__AsmAlias_to_sumtype_v__ast__AsmArg(v__ast__AsmAlias* x) { v__ast__AsmAlias* ptr = memdup(x, sizeof(v__ast__AsmAlias)); - return (v__ast__AsmArg){ ._v__ast__AsmAlias = ptr, ._typ = 397}; + return (v__ast__AsmArg){ ._v__ast__AsmAlias = ptr, ._typ = 398}; } static inline v__ast__Expr v__ast__ConcatExpr_to_sumtype_v__ast__Expr(v__ast__ConcatExpr* x) { v__ast__ConcatExpr* ptr = memdup(x, sizeof(v__ast__ConcatExpr)); - return (v__ast__Expr){ ._v__ast__ConcatExpr = ptr, ._typ = 260}; + return (v__ast__Expr){ ._v__ast__ConcatExpr = ptr, ._typ = 261}; } static inline v__ast__Expr v__ast__ChanInit_to_sumtype_v__ast__Expr(v__ast__ChanInit* x) { v__ast__ChanInit* ptr = memdup(x, sizeof(v__ast__ChanInit)); - return (v__ast__Expr){ ._v__ast__ChanInit = ptr, ._typ = 254}; + return (v__ast__Expr){ ._v__ast__ChanInit = ptr, ._typ = 255}; } static inline v__ast__Expr v__ast__StringInterLiteral_to_sumtype_v__ast__Expr(v__ast__StringInterLiteral* x) { v__ast__StringInterLiteral* ptr = memdup(x, sizeof(v__ast__StringInterLiteral)); - return (v__ast__Expr){ ._v__ast__StringInterLiteral = ptr, ._typ = 289}; + return (v__ast__Expr){ ._v__ast__StringInterLiteral = ptr, ._typ = 290}; } static inline v__ast__ScopeObject v__ast__ConstField_to_sumtype_v__ast__ScopeObject(v__ast__ConstField* x) { v__ast__ConstField* ptr = memdup(x, sizeof(v__ast__ConstField)); - return (v__ast__ScopeObject){ ._v__ast__ConstField = ptr, ._typ = 322, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstField, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstField, typ))}; + return (v__ast__ScopeObject){ ._v__ast__ConstField = ptr, ._typ = 323, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstField, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstField, typ))}; } static inline v__ast__ScopeObject v__ast__GlobalField_to_sumtype_v__ast__ScopeObject(v__ast__GlobalField* x) { v__ast__GlobalField* ptr = memdup(x, sizeof(v__ast__GlobalField)); - return (v__ast__ScopeObject){ ._v__ast__GlobalField = ptr, ._typ = 323, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalField, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalField, typ))}; + return (v__ast__ScopeObject){ ._v__ast__GlobalField = ptr, ._typ = 324, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalField, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalField, typ))}; } static inline v__ast__TypeInfo v__ast__Enum_to_sumtype_v__ast__TypeInfo(v__ast__Enum* x) { v__ast__Enum* ptr = memdup(x, sizeof(v__ast__Enum)); - return (v__ast__TypeInfo){ ._v__ast__Enum = ptr, ._typ = 445}; + return (v__ast__TypeInfo){ ._v__ast__Enum = ptr, ._typ = 446}; } static inline v__ast__TypeDecl v__ast__FnTypeDecl_to_sumtype_v__ast__TypeDecl(v__ast__FnTypeDecl* x) { v__ast__FnTypeDecl* ptr = memdup(x, sizeof(v__ast__FnTypeDecl)); - return (v__ast__TypeDecl){ ._v__ast__FnTypeDecl = ptr, ._typ = 241, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, comments))}; + return (v__ast__TypeDecl){ ._v__ast__FnTypeDecl = ptr, ._typ = 242, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, comments))}; } static inline v__ast__TypeDecl v__ast__AliasTypeDecl_to_sumtype_v__ast__TypeDecl(v__ast__AliasTypeDecl* x) { v__ast__AliasTypeDecl* ptr = memdup(x, sizeof(v__ast__AliasTypeDecl)); - return (v__ast__TypeDecl){ ._v__ast__AliasTypeDecl = ptr, ._typ = 240, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, comments))}; + return (v__ast__TypeDecl){ ._v__ast__AliasTypeDecl = ptr, ._typ = 241, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, comments))}; } static inline v__ast__TypeDecl v__ast__SumTypeDecl_to_sumtype_v__ast__TypeDecl(v__ast__SumTypeDecl* x) { v__ast__SumTypeDecl* ptr = memdup(x, sizeof(v__ast__SumTypeDecl)); - return (v__ast__TypeDecl){ ._v__ast__SumTypeDecl = ptr, ._typ = 242, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, comments))}; + return (v__ast__TypeDecl){ ._v__ast__SumTypeDecl = ptr, ._typ = 243, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, comments))}; } static inline v__ast__TypeInfo v__ast__Alias_to_sumtype_v__ast__TypeInfo(v__ast__Alias* x) { v__ast__Alias* ptr = memdup(x, sizeof(v__ast__Alias)); - return (v__ast__TypeInfo){ ._v__ast__Alias = ptr, ._typ = 431}; + return (v__ast__TypeInfo){ ._v__ast__Alias = ptr, ._typ = 432}; } static inline v__ast__Node v__ast__File_to_sumtype_v__ast__Node(v__ast__File* x) { v__ast__File* ptr = memdup(x, sizeof(v__ast__File)); - return (v__ast__Node){ ._v__ast__File = ptr, ._typ = 174}; + return (v__ast__Node){ ._v__ast__File = ptr, ._typ = 175}; } static bool Array_string_contains(Array_string a, string v) { @@ -13109,16 +13143,16 @@ static int v_typeof_interface_idx_IError(int sidx) { /* IError */ if (sidx == _IError_None___index) return 65610; if (sidx == _IError_Error_index) return 75; if (sidx == _IError_MessageError_index) return 76; - if (sidx == _IError_os__FileNotOpenedError_index) return 65647; - if (sidx == _IError_os__SizeOfTypeIs0Error_index) return 65648; - if (sidx == _IError_os__ExecutableNotFoundError_index) return 65661; - if (sidx == _IError_flag__UnkownFlagError_index) return 66095; - if (sidx == _IError_flag__ArgsCountError_index) return 66096; - if (sidx == _IError_semver__InvalidComparatorFormatError_index) return 66106; - if (sidx == _IError_semver__EmptyInputError_index) return 66108; - if (sidx == _IError_semver__InvalidVersionFormatError_index) return 66109; - if (sidx == _IError_time__TimeParseError_index) return 220; - if (sidx == _IError_v__gen__c__UnsupportedAssertCtempTransform_index) return 498; + if (sidx == _IError_os__FileNotOpenedError_index) return 65648; + if (sidx == _IError_os__SizeOfTypeIs0Error_index) return 65649; + if (sidx == _IError_os__ExecutableNotFoundError_index) return 65662; + if (sidx == _IError_flag__UnkownFlagError_index) return 66096; + if (sidx == _IError_flag__ArgsCountError_index) return 66097; + if (sidx == _IError_semver__InvalidComparatorFormatError_index) return 66107; + if (sidx == _IError_semver__EmptyInputError_index) return 66109; + if (sidx == _IError_semver__InvalidVersionFormatError_index) return 66110; + if (sidx == _IError_time__TimeParseError_index) return 221; + if (sidx == _IError_v__gen__c__UnsupportedAssertCtempTransform_index) return 499; return 29; } static char * v_typeof_interface_rand__PRNG(int sidx) { /* rand.PRNG */ @@ -13127,90 +13161,89 @@ static char * v_typeof_interface_rand__PRNG(int sidx) { /* rand.PRNG */ } static int v_typeof_interface_idx_rand__PRNG(int sidx) { /* rand.PRNG */ - if (sidx == _rand__PRNG_rand__wyrand__WyRandRNG_index) return 65736; - return 196; + if (sidx == _rand__PRNG_rand__wyrand__WyRandRNG_index) return 65737; + return 197; } static char * v_typeof_sumtype_v__ast__TypeDecl(int sidx) { /* v.ast.TypeDecl */ switch(sidx) { - case 243: return "v.ast.TypeDecl"; - case 240: return "v.ast.AliasTypeDecl"; - case 241: return "v.ast.FnTypeDecl"; - case 242: return "v.ast.SumTypeDecl"; + case 244: return "v.ast.TypeDecl"; + case 241: return "v.ast.AliasTypeDecl"; + case 242: return "v.ast.FnTypeDecl"; + case 243: return "v.ast.SumTypeDecl"; default: return "unknown v.ast.TypeDecl"; } } static int v_typeof_sumtype_idx_v__ast__TypeDecl(int sidx) { /* v.ast.TypeDecl */ switch(sidx) { - case 243: return 243; - case 240: return 240; + case 244: return 244; case 241: return 241; case 242: return 242; - default: return 243; + case 243: return 243; + default: return 244; } } static char * v_typeof_sumtype_v__ast__Expr(int sidx) { /* v.ast.Expr */ switch(sidx) { - case 295: return "v.ast.Expr"; - case 244: return "v.ast.AnonFn"; - case 245: return "v.ast.ArrayDecompose"; - case 246: return "v.ast.ArrayInit"; - case 247: return "v.ast.AsCast"; - case 248: return "v.ast.Assoc"; - case 249: return "v.ast.AtExpr"; - case 250: return "v.ast.BoolLiteral"; - case 251: return "v.ast.CTempVar"; - case 252: return "v.ast.CallExpr"; - case 253: return "v.ast.CastExpr"; - case 254: return "v.ast.ChanInit"; - case 255: return "v.ast.CharLiteral"; - case 256: return "v.ast.Comment"; - case 257: return "v.ast.ComptimeCall"; - case 258: return "v.ast.ComptimeSelector"; - case 259: return "v.ast.ComptimeType"; - case 260: return "v.ast.ConcatExpr"; - case 261: return "v.ast.DumpExpr"; - case 262: return "v.ast.EmptyExpr"; - case 263: return "v.ast.EnumVal"; - case 264: return "v.ast.FloatLiteral"; - case 265: return "v.ast.GoExpr"; - case 266: return "v.ast.Ident"; - case 267: return "v.ast.IfExpr"; - case 268: return "v.ast.IfGuardExpr"; - case 269: return "v.ast.IndexExpr"; - case 270: return "v.ast.InfixExpr"; - case 271: return "v.ast.IntegerLiteral"; - case 272: return "v.ast.IsRefType"; - case 273: return "v.ast.Likely"; - case 274: return "v.ast.LockExpr"; - case 275: return "v.ast.MapInit"; - case 276: return "v.ast.MatchExpr"; - case 277: return "v.ast.NodeError"; - case 278: return "v.ast.None"; - case 279: return "v.ast.OffsetOf"; - case 280: return "v.ast.OrExpr"; - case 281: return "v.ast.ParExpr"; - case 282: return "v.ast.PostfixExpr"; - case 283: return "v.ast.PrefixExpr"; - case 284: return "v.ast.RangeExpr"; - case 285: return "v.ast.SelectExpr"; - case 286: return "v.ast.SelectorExpr"; - case 287: return "v.ast.SizeOf"; - case 288: return "v.ast.SqlExpr"; - case 289: return "v.ast.StringInterLiteral"; - case 290: return "v.ast.StringLiteral"; - case 291: return "v.ast.StructInit"; - case 292: return "v.ast.TypeNode"; - case 293: return "v.ast.TypeOf"; - case 294: return "v.ast.UnsafeExpr"; + case 296: return "v.ast.Expr"; + case 245: return "v.ast.AnonFn"; + case 246: return "v.ast.ArrayDecompose"; + case 247: return "v.ast.ArrayInit"; + case 248: return "v.ast.AsCast"; + case 249: return "v.ast.Assoc"; + case 250: return "v.ast.AtExpr"; + case 251: return "v.ast.BoolLiteral"; + case 252: return "v.ast.CTempVar"; + case 253: return "v.ast.CallExpr"; + case 254: return "v.ast.CastExpr"; + case 255: return "v.ast.ChanInit"; + case 256: return "v.ast.CharLiteral"; + case 257: return "v.ast.Comment"; + case 258: return "v.ast.ComptimeCall"; + case 259: return "v.ast.ComptimeSelector"; + case 260: return "v.ast.ComptimeType"; + case 261: return "v.ast.ConcatExpr"; + case 262: return "v.ast.DumpExpr"; + case 263: return "v.ast.EmptyExpr"; + case 264: return "v.ast.EnumVal"; + case 265: return "v.ast.FloatLiteral"; + case 266: return "v.ast.GoExpr"; + case 267: return "v.ast.Ident"; + case 268: return "v.ast.IfExpr"; + case 269: return "v.ast.IfGuardExpr"; + case 270: return "v.ast.IndexExpr"; + case 271: return "v.ast.InfixExpr"; + case 272: return "v.ast.IntegerLiteral"; + case 273: return "v.ast.IsRefType"; + case 274: return "v.ast.Likely"; + case 275: return "v.ast.LockExpr"; + case 276: return "v.ast.MapInit"; + case 277: return "v.ast.MatchExpr"; + case 278: return "v.ast.NodeError"; + case 279: return "v.ast.None"; + case 280: return "v.ast.OffsetOf"; + case 281: return "v.ast.OrExpr"; + case 282: return "v.ast.ParExpr"; + case 283: return "v.ast.PostfixExpr"; + case 284: return "v.ast.PrefixExpr"; + case 285: return "v.ast.RangeExpr"; + case 286: return "v.ast.SelectExpr"; + case 287: return "v.ast.SelectorExpr"; + case 288: return "v.ast.SizeOf"; + case 289: return "v.ast.SqlExpr"; + case 290: return "v.ast.StringInterLiteral"; + case 291: return "v.ast.StringLiteral"; + case 292: return "v.ast.StructInit"; + case 293: return "v.ast.TypeNode"; + case 294: return "v.ast.TypeOf"; + case 295: return "v.ast.UnsafeExpr"; default: return "unknown v.ast.Expr"; } } static int v_typeof_sumtype_idx_v__ast__Expr(int sidx) { /* v.ast.Expr */ switch(sidx) { - case 295: return 295; - case 244: return 244; + case 296: return 296; case 245: return 245; case 246: return 246; case 247: return 247; @@ -13261,47 +13294,47 @@ static int v_typeof_sumtype_idx_v__ast__Expr(int sidx) { /* v.ast.Expr */ case 292: return 292; case 293: return 293; case 294: return 294; - default: return 295; + case 295: return 295; + default: return 296; } } static char * v_typeof_sumtype_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ switch(sidx) { - case 320: return "v.ast.Stmt"; - case 296: return "v.ast.AsmStmt"; - case 297: return "v.ast.AssertStmt"; - case 298: return "v.ast.AssignStmt"; - case 299: return "v.ast.Block"; - case 300: return "v.ast.BranchStmt"; - case 301: return "v.ast.ComptimeFor"; - case 302: return "v.ast.ConstDecl"; - case 303: return "v.ast.DeferStmt"; - case 304: return "v.ast.EmptyStmt"; - case 305: return "v.ast.EnumDecl"; - case 306: return "v.ast.ExprStmt"; - case 183: return "v.ast.FnDecl"; - case 307: return "v.ast.ForCStmt"; - case 308: return "v.ast.ForInStmt"; - case 309: return "v.ast.ForStmt"; - case 310: return "v.ast.GlobalDecl"; - case 311: return "v.ast.GotoLabel"; - case 312: return "v.ast.GotoStmt"; - case 313: return "v.ast.HashStmt"; - case 314: return "v.ast.Import"; - case 315: return "v.ast.InterfaceDecl"; - case 316: return "v.ast.Module"; - case 277: return "v.ast.NodeError"; - case 317: return "v.ast.Return"; - case 318: return "v.ast.SqlStmt"; - case 319: return "v.ast.StructDecl"; - case 243: return "v.ast.TypeDecl"; + case 321: return "v.ast.Stmt"; + case 297: return "v.ast.AsmStmt"; + case 298: return "v.ast.AssertStmt"; + case 299: return "v.ast.AssignStmt"; + case 300: return "v.ast.Block"; + case 301: return "v.ast.BranchStmt"; + case 302: return "v.ast.ComptimeFor"; + case 303: return "v.ast.ConstDecl"; + case 304: return "v.ast.DeferStmt"; + case 305: return "v.ast.EmptyStmt"; + case 306: return "v.ast.EnumDecl"; + case 307: return "v.ast.ExprStmt"; + case 184: return "v.ast.FnDecl"; + case 308: return "v.ast.ForCStmt"; + case 309: return "v.ast.ForInStmt"; + case 310: return "v.ast.ForStmt"; + case 311: return "v.ast.GlobalDecl"; + case 312: return "v.ast.GotoLabel"; + case 313: return "v.ast.GotoStmt"; + case 314: return "v.ast.HashStmt"; + case 315: return "v.ast.Import"; + case 316: return "v.ast.InterfaceDecl"; + case 317: return "v.ast.Module"; + case 278: return "v.ast.NodeError"; + case 318: return "v.ast.Return"; + case 319: return "v.ast.SqlStmt"; + case 320: return "v.ast.StructDecl"; + case 244: return "v.ast.TypeDecl"; default: return "unknown v.ast.Stmt"; } } static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ switch(sidx) { - case 320: return 320; - case 296: return 296; + case 321: return 321; case 297: return 297; case 298: return 298; case 299: return 299; @@ -13312,8 +13345,8 @@ static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ case 304: return 304; case 305: return 305; case 306: return 306; - case 183: return 183; case 307: return 307; + case 184: return 184; case 308: return 308; case 309: return 309; case 310: return 310; @@ -13323,84 +13356,85 @@ static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ case 314: return 314; case 315: return 315; case 316: return 316; - case 277: return 277; case 317: return 317; + case 278: return 278; case 318: return 318; case 319: return 319; - case 243: return 243; - default: return 320; + case 320: return 320; + case 244: return 244; + default: return 321; } } static char * v_typeof_sumtype_v__ast__ScopeObject(int sidx) { /* v.ast.ScopeObject */ switch(sidx) { - case 325: return "v.ast.ScopeObject"; - case 321: return "v.ast.AsmRegister"; - case 322: return "v.ast.ConstField"; - case 323: return "v.ast.GlobalField"; - case 324: return "v.ast.Var"; + case 326: return "v.ast.ScopeObject"; + case 322: return "v.ast.AsmRegister"; + case 323: return "v.ast.ConstField"; + case 324: return "v.ast.GlobalField"; + case 325: return "v.ast.Var"; default: return "unknown v.ast.ScopeObject"; } } static int v_typeof_sumtype_idx_v__ast__ScopeObject(int sidx) { /* v.ast.ScopeObject */ switch(sidx) { - case 325: return 325; - case 321: return 321; + case 326: return 326; case 322: return 322; case 323: return 323; case 324: return 324; - default: return 325; + case 325: return 325; + default: return 326; } } static char * v_typeof_sumtype_v__ast__Node(int sidx) { /* v.ast.Node */ switch(sidx) { - case 335: return "v.ast.Node"; - case 326: return "v.ast.CallArg"; - case 322: return "v.ast.ConstField"; - case 327: return "v.ast.EmptyNode"; - case 328: return "v.ast.EnumField"; - case 295: return "v.ast.Expr"; - case 174: return "v.ast.File"; - case 323: return "v.ast.GlobalField"; - case 329: return "v.ast.IfBranch"; - case 330: return "v.ast.MatchBranch"; - case 277: return "v.ast.NodeError"; - case 331: return "v.ast.Param"; - case 325: return "v.ast.ScopeObject"; - case 332: return "v.ast.SelectBranch"; - case 320: return "v.ast.Stmt"; - case 333: return "v.ast.StructField"; - case 334: return "v.ast.StructInitField"; + case 336: return "v.ast.Node"; + case 327: return "v.ast.CallArg"; + case 323: return "v.ast.ConstField"; + case 328: return "v.ast.EmptyNode"; + case 329: return "v.ast.EnumField"; + case 296: return "v.ast.Expr"; + case 175: return "v.ast.File"; + case 324: return "v.ast.GlobalField"; + case 330: return "v.ast.IfBranch"; + case 331: return "v.ast.MatchBranch"; + case 278: return "v.ast.NodeError"; + case 332: return "v.ast.Param"; + case 326: return "v.ast.ScopeObject"; + case 333: return "v.ast.SelectBranch"; + case 321: return "v.ast.Stmt"; + case 334: return "v.ast.StructField"; + case 335: return "v.ast.StructInitField"; default: return "unknown v.ast.Node"; } } static int v_typeof_sumtype_idx_v__ast__Node(int sidx) { /* v.ast.Node */ switch(sidx) { - case 335: return 335; - case 326: return 326; - case 322: return 322; + case 336: return 336; case 327: return 327; - case 328: return 328; - case 295: return 295; - case 174: return 174; case 323: return 323; + case 328: return 328; case 329: return 329; + case 296: return 296; + case 175: return 175; + case 324: return 324; case 330: return 330; - case 277: return 277; case 331: return 331; - case 325: return 325; + case 278: return 278; case 332: return 332; - case 320: return 320; + case 326: return 326; case 333: return 333; + case 321: return 321; case 334: return 334; - default: return 335; + case 335: return 335; + default: return 336; } } static char * v_typeof_sumtype_v__ast__ComptTimeConstValue(int sidx) { /* v.ast.ComptTimeConstValue */ switch(sidx) { - case 349: return "v.ast.ComptTimeConstValue"; - case 262: return "v.ast.EmptyExpr"; + case 350: return "v.ast.ComptTimeConstValue"; + case 263: return "v.ast.EmptyExpr"; case 15: return "f32"; case 16: return "f64"; case 6: return "i16"; @@ -13419,8 +13453,8 @@ static char * v_typeof_sumtype_v__ast__ComptTimeConstValue(int sidx) { /* v.ast. static int v_typeof_sumtype_idx_v__ast__ComptTimeConstValue(int sidx) { /* v.ast.ComptTimeConstValue */ switch(sidx) { - case 349: return 349; - case 262: return 262; + case 350: return 350; + case 263: return 263; case 15: return 15; case 16: return 16; case 6: return 6; @@ -13433,37 +13467,37 @@ static int v_typeof_sumtype_idx_v__ast__ComptTimeConstValue(int sidx) { /* v.ast case 12: return 12; case 13: return 13; case 10: return 10; - default: return 349; + default: return 350; } } static char * v_typeof_sumtype_v__ast__IdentInfo(int sidx) { /* v.ast.IdentInfo */ switch(sidx) { - case 377: return "v.ast.IdentInfo"; - case 375: return "v.ast.IdentFn"; - case 376: return "v.ast.IdentVar"; + case 378: return "v.ast.IdentInfo"; + case 376: return "v.ast.IdentFn"; + case 377: return "v.ast.IdentVar"; default: return "unknown v.ast.IdentInfo"; } } static int v_typeof_sumtype_idx_v__ast__IdentInfo(int sidx) { /* v.ast.IdentInfo */ switch(sidx) { - case 377: return 377; - case 375: return 375; + case 378: return 378; case 376: return 376; - default: return 377; + case 377: return 377; + default: return 378; } } static char * v_typeof_sumtype_v__ast__AsmArg(int sidx) { /* v.ast.AsmArg */ switch(sidx) { - case 394: return "v.ast.AsmArg"; - case 396: return "v.ast.AsmAddressing"; - case 397: return "v.ast.AsmAlias"; - case 398: return "v.ast.AsmDisp"; - case 321: return "v.ast.AsmRegister"; - case 250: return "v.ast.BoolLiteral"; - case 255: return "v.ast.CharLiteral"; - case 264: return "v.ast.FloatLiteral"; - case 271: return "v.ast.IntegerLiteral"; + case 395: return "v.ast.AsmArg"; + case 397: return "v.ast.AsmAddressing"; + case 398: return "v.ast.AsmAlias"; + case 399: return "v.ast.AsmDisp"; + case 322: return "v.ast.AsmRegister"; + case 251: return "v.ast.BoolLiteral"; + case 256: return "v.ast.CharLiteral"; + case 265: return "v.ast.FloatLiteral"; + case 272: return "v.ast.IntegerLiteral"; case 20: return "string"; default: return "unknown v.ast.AsmArg"; } @@ -13471,58 +13505,58 @@ static char * v_typeof_sumtype_v__ast__AsmArg(int sidx) { /* v.ast.AsmArg */ static int v_typeof_sumtype_idx_v__ast__AsmArg(int sidx) { /* v.ast.AsmArg */ switch(sidx) { - case 394: return 394; - case 396: return 396; + case 395: return 395; case 397: return 397; case 398: return 398; - case 321: return 321; - case 250: return 250; - case 255: return 255; - case 264: return 264; - case 271: return 271; + case 399: return 399; + case 322: return 322; + case 251: return 251; + case 256: return 256; + case 265: return 265; + case 272: return 272; case 20: return 20; - default: return 394; + default: return 395; } } static char * v_typeof_sumtype_v__ast__TypeInfo(int sidx) { /* v.ast.TypeInfo */ switch(sidx) { - case 446: return "v.ast.TypeInfo"; - case 429: return "v.ast.Aggregate"; - case 431: return "v.ast.Alias"; - case 411: return "v.ast.Array"; - case 439: return "v.ast.ArrayFixed"; - case 440: return "v.ast.Chan"; - case 445: return "v.ast.Enum"; - case 443: return "v.ast.FnType"; - case 444: return "v.ast.GenericInst"; - case 434: return "v.ast.Interface"; - case 412: return "v.ast.Map"; - case 442: return "v.ast.MultiReturn"; - case 416: return "v.ast.Struct"; - case 435: return "v.ast.SumType"; - case 441: return "v.ast.Thread"; + case 447: return "v.ast.TypeInfo"; + case 430: return "v.ast.Aggregate"; + case 432: return "v.ast.Alias"; + case 412: return "v.ast.Array"; + case 440: return "v.ast.ArrayFixed"; + case 441: return "v.ast.Chan"; + case 446: return "v.ast.Enum"; + case 444: return "v.ast.FnType"; + case 445: return "v.ast.GenericInst"; + case 435: return "v.ast.Interface"; + case 413: return "v.ast.Map"; + case 443: return "v.ast.MultiReturn"; + case 417: return "v.ast.Struct"; + case 436: return "v.ast.SumType"; + case 442: return "v.ast.Thread"; default: return "unknown v.ast.TypeInfo"; } } static int v_typeof_sumtype_idx_v__ast__TypeInfo(int sidx) { /* v.ast.TypeInfo */ switch(sidx) { - case 446: return 446; - case 429: return 429; - case 431: return 431; - case 411: return 411; - case 439: return 439; - case 440: return 440; - case 445: return 445; - case 443: return 443; - case 444: return 444; - case 434: return 434; + case 447: return 447; + case 430: return 430; + case 432: return 432; case 412: return 412; - case 442: return 442; - case 416: return 416; - case 435: return 435; + case 440: return 440; case 441: return 441; - default: return 446; + case 446: return 446; + case 444: return 444; + case 445: return 445; + case 435: return 435; + case 413: return 413; + case 443: return 443; + case 417: return 417; + case 436: return 436; + case 442: return 442; + default: return 447; } } static char * v_typeof_interface_hash__Hasher(int sidx) { /* hash.Hasher */ @@ -13530,21 +13564,21 @@ static char * v_typeof_interface_hash__Hasher(int sidx) { /* hash.Hasher */ } static int v_typeof_interface_idx_hash__Hasher(int sidx) { /* hash.Hasher */ - return 493; + return 494; } static char * v_typeof_interface_hash__Hash32er(int sidx) { /* hash.Hash32er */ return "unknown hash.Hash32er"; } static int v_typeof_interface_idx_hash__Hash32er(int sidx) { /* hash.Hash32er */ - return 494; + return 495; } static char * v_typeof_interface_hash__Hash64er(int sidx) { /* hash.Hash64er */ return "unknown hash.Hash64er"; } static int v_typeof_interface_idx_hash__Hash64er(int sidx) { /* hash.Hash64er */ - return 495; + return 496; } static char * v_typeof_interface_v__ast__walker__Visitor(int sidx) { /* v.ast.walker.Visitor */ if (sidx == _v__ast__walker__Visitor_v__ast__walker__Inspector_index) return "v.ast.walker.Inspector"; @@ -13553,9 +13587,9 @@ static char * v_typeof_interface_v__ast__walker__Visitor(int sidx) { /* v.ast.wa } static int v_typeof_interface_idx_v__ast__walker__Visitor(int sidx) { /* v.ast.walker.Visitor */ - if (sidx == _v__ast__walker__Visitor_v__ast__walker__Inspector_index) return 533; - if (sidx == _v__ast__walker__Visitor_v__callgraph__Mapper_index) return 66022; - return 531; + if (sidx == _v__ast__walker__Visitor_v__ast__walker__Inspector_index) return 534; + if (sidx == _v__ast__walker__Visitor_v__callgraph__Mapper_index) return 66023; + return 532; } // << typeof() support for sum types @@ -14720,16 +14754,16 @@ Option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool e if (err != 0 && (error_on_non_digit || error_on_high_digit)) { if (err == (-1)) { - return (Option_u64){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: wrong base "), 0xfe07, {.d_i32 = _base}}, {_SLIT(" for "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_u64){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: wrong base "), /*100 &int*/0xfe07, {.d_i32 = _base}}, {_SLIT(" for "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (err == (-2)) { - return (Option_u64){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: wrong bit size "), 0xfe07, {.d_i32 = _bit_size}}, {_SLIT(" for "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_u64){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: wrong bit size "), /*100 &int*/0xfe07, {.d_i32 = _bit_size}}, {_SLIT(" for "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (err == (-3)) { - return (Option_u64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: integer overflow "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_u64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: integer overflow "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else { - return (Option_u64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: syntax error "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_u64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: syntax error "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; } Option_u64 _t5; @@ -14867,21 +14901,21 @@ Option_i64 strconv__parse_int(string _s, int base, int _bit_size) { Option_int strconv__atoi(string s) { if ((s).len == 0) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), 0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if ((_const_strconv__int_size == 32 && (0 < s.len && s.len < 10)) || (_const_strconv__int_size == 64 && (0 < s.len && s.len < 19))) { int start_idx = 0; if (string_at(s, 0) == '-' || string_at(s, 0) == '+') { start_idx++; if (s.len - start_idx < 1) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), 0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } int n = 0; for (int i = start_idx; i < s.len; ++i) { rune ch = string_at(s, i) - '0'; if (ch > 9) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), 0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } n = n * 10 + ((int)(ch)); } @@ -15956,7 +15990,7 @@ inline string strconv__ftoa_long_32(f32 f) { string strconv__format_int(i64 n, int radix) { { // Unsafe block if (radix < 2 || radix > 36) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid radix: "), 0xfe07, {.d_i32 = radix}}, {_SLIT(" . It should be => 2 and <= 36"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid radix: "), /*100 &int*/0xfe07, {.d_i32 = radix}}, {_SLIT(" . It should be => 2 and <= 36"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (n == 0) { @@ -15993,7 +16027,7 @@ string strconv__format_int(i64 n, int radix) { string strconv__format_uint(u64 n, int radix) { { // Unsafe block if (radix < 2 || radix > 36) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid radix: "), 0xfe07, {.d_i32 = radix}}, {_SLIT(" . It should be => 2 and <= 36"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid radix: "), /*100 &int*/0xfe07, {.d_i32 = radix}}, {_SLIT(" . It should be => 2 and <= 36"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (n == 0U) { @@ -16920,7 +16954,7 @@ strings__Builder res; i++; } if (p_index != pt.len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = p_index}}, {_SLIT(" % conversion specifiers, but given "), 0xfe07, {.d_i32 = pt.len}}, {_SLIT(" args"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = p_index}}, {_SLIT(" % conversion specifiers, but given "), /*100 &int*/0xfe07, {.d_i32 = pt.len}}, {_SLIT(" args"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } string _t1 = strings__Builder_str(&res); @@ -16935,7 +16969,7 @@ strings__Builder res; // Attr: [inline] inline VV_LOCAL_SYMBOL void strconv__v_sprintf_panic(int idx, int len) { if (idx >= len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = idx + 1}}, {_SLIT(" % conversion specifiers, but given only "), 0xfe07, {.d_i32 = len}}, {_SLIT(" args"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = idx + 1}}, {_SLIT(" % conversion specifiers, but given only "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(" args"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17277,7 +17311,7 @@ array array_repeat(array a, int count) { // Attr: [unsafe] array array_repeat_to_depth(array a, int count, int depth) { if (count < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("array.repeat: count is negative: "), 0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("array.repeat: count is negative: "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } int size = count * a.len * a.element_size; @@ -17302,7 +17336,7 @@ void array_insert(array* a, int i, voidptr val) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i > a->len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.insert: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.insert: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17322,7 +17356,7 @@ VV_LOCAL_SYMBOL void array_insert_many(array* a, int i, voidptr val, int size) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i > a->len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.insert_many: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.insert_many: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17354,8 +17388,8 @@ void array_delete_many(array* a, int i, int size) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i + size > a->len) { - string endidx = (size > 1 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT(".."), 0xfe07, {.d_i32 = i + size}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); - _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("array.delete: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0xfe10, {.d_s = endidx}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + string endidx = (size > 1 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT(".."), /*100 &int*/0xfe07, {.d_i32 = i + size}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); + _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("array.delete: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = endidx}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17413,7 +17447,7 @@ VV_LOCAL_SYMBOL voidptr array_get(array a, int i) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i >= a.len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.get: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.get: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17493,15 +17527,15 @@ VV_LOCAL_SYMBOL array array_slice(array a, int start, int _end) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (start > end) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.slice: invalid slice index ("), 0xfe07, {.d_i32 = start}}, {_SLIT(" > "), 0xfe07, {.d_i32 = end}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.slice: invalid slice index ("), /*100 &int*/0xfe07, {.d_i32 = start}}, {_SLIT(" > "), /*100 &int*/0xfe07, {.d_i32 = end}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (end > a.len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.slice: slice bounds out of range ("), 0xfe07, {.d_i32 = end}}, {_SLIT(" >= "), 0xfe07, {.d_i32 = a.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.slice: slice bounds out of range ("), /*100 &int*/0xfe07, {.d_i32 = end}}, {_SLIT(" >= "), /*100 &int*/0xfe07, {.d_i32 = a.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (start < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("array.slice: slice bounds out of range ("), 0xfe07, {.d_i32 = start}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("array.slice: slice bounds out of range ("), /*100 &int*/0xfe07, {.d_i32 = start}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17589,7 +17623,7 @@ VV_LOCAL_SYMBOL void array_set(array* a, int i, voidptr val) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i >= a->len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.set: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.set: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17821,11 +17855,11 @@ VNORETURN VV_LOCAL_SYMBOL void panic_debug(int line_no, string file, string mod, #else { eprintln(_SLIT("================ V panic ================")); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" module: "), 0xfe10, {.d_s = mod}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" function: "), 0xfe10, {.d_s = fn_name}}, {_SLIT("()"), 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" message: "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" file: "), 0xfe10, {.d_s = file}}, {_SLIT(":"), 0xfe07, {.d_i32 = line_no}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" v hash: "), 0xfe10, {.d_s = vcommithash()}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" module: "), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" function: "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("()"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" message: "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" file: "), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = line_no}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" v hash: "), /*115 &string*/0xfe10, {.d_s = vcommithash()}}, {_SLIT0, 0, { .d_c = 0 }}}))); eprintln(_SLIT("=========================================")); #if defined(CUSTOM_DEFINE_exit_after_panic_message) { @@ -17873,7 +17907,7 @@ VNORETURN VV_LOCAL_SYMBOL void panic_debug(int line_no, string file, string mod, // Attr: [noreturn] VNORETURN void panic_optional_not_set(string s) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("optional not set ("), 0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("optional not set ("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); while(1); } @@ -17887,7 +17921,7 @@ VNORETURN void _v_panic(string s) { { eprint(_SLIT("V panic: ")); eprintln(s); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v hash: "), 0xfe10, {.d_s = vcommithash()}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v hash: "), /*115 &string*/0xfe10, {.d_s = vcommithash()}}, {_SLIT0, 0, { .d_c = 0 }}}))); #if defined(CUSTOM_DEFINE_exit_after_panic_message) { exit(1); @@ -18120,7 +18154,7 @@ VV_LOCAL_SYMBOL void _write_buf_to_fd(int fd, u8* buf, int buf_len) { // Attr: [unsafe] u8* _v_malloc(int n) { if (n <= 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc("), 0xfe07, {.d_i32 = n}}, {_SLIT(" <= 0)"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(" <= 0)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } #if defined(CUSTOM_DEFINE_vplayground) @@ -18161,7 +18195,7 @@ u8* _v_malloc(int n) { } #endif if (res == 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc("), 0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } #if defined(CUSTOM_DEFINE_debug_malloc) @@ -18175,7 +18209,7 @@ u8* _v_malloc(int n) { // Attr: [unsafe] u8* malloc_noscan(int n) { if (n <= 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc_noscan("), 0xfe07, {.d_i32 = n}}, {_SLIT(" <= 0)"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc_noscan("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(" <= 0)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } #if defined(CUSTOM_DEFINE_vplayground) @@ -18226,7 +18260,7 @@ u8* malloc_noscan(int n) { } #endif if (res == 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc_noscan("), 0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc_noscan("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } #if defined(CUSTOM_DEFINE_debug_malloc) @@ -18263,7 +18297,7 @@ u8* v_realloc(u8* b, int n) { } #endif if (new_ptr == 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("realloc("), 0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("realloc("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } return new_ptr; @@ -18304,7 +18338,7 @@ u8* realloc_data(u8* old_data, int old_size, int new_size) { } #endif if (nptr == 0) { - _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("realloc_data("), 0xfe11, {.d_p = (void*)(old_data)}}, {_SLIT(", "), 0xfe07, {.d_i32 = old_size}}, {_SLIT(", "), 0xfe07, {.d_i32 = new_size}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("realloc_data("), /*117 &u8*/0xfe11, {.d_p = (void*)(old_data)}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = old_size}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = new_size}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } return nptr; @@ -18312,7 +18346,7 @@ u8* realloc_data(u8* old_data, int old_size, int new_size) { u8* vcalloc(int n) { if (n < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("calloc("), 0xfe07, {.d_i32 = n}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("calloc("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (n == 0) { return ((u8*)(0)); @@ -18361,7 +18395,7 @@ u8* vcalloc_noscan(int n) { } #endif if (n < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("calloc_noscan("), 0xfe07, {.d_i32 = n}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("calloc_noscan("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } #if defined(CUSTOM_DEFINE_gcboehm_opt) @@ -18429,7 +18463,7 @@ inline VV_LOCAL_SYMBOL int v_fixed_index(int i, int len) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i >= len) { - string s = str_intp(3, _MOV((StrIntpData[]){{_SLIT("fixed array index out of range (index: "), 0xfe07, {.d_i32 = i}}, {_SLIT(", len: "), 0xfe07, {.d_i32 = len}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string s = str_intp(3, _MOV((StrIntpData[]){{_SLIT("fixed array index out of range (index: "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", len: "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(")"), 0, { .d_c = 0 }}})); _v_panic(s); VUNREACHABLE(); } @@ -18479,7 +18513,7 @@ VV_LOCAL_SYMBOL voidptr __as_cast(voidptr obj, int obj_type, int expected_type) expected_name = string_clone(x.tname); } } - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("as cast: cannot cast `"), 0xfe10, {.d_s = obj_name}}, {_SLIT("` to `"), 0xfe10, {.d_s = expected_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("as cast: cannot cast `"), /*115 &string*/0xfe10, {.d_s = obj_name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = expected_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } return obj; @@ -18501,13 +18535,13 @@ void VAssertMetaInfo_free(VAssertMetaInfo* ami) { } VV_LOCAL_SYMBOL void __print_assert_failure(VAssertMetaInfo* i) { - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = i->fpath}}, {_SLIT(":"), 0xfe07, {.d_i32 = i->line_nr + 1}}, {_SLIT(": FAIL: fn "), 0xfe10, {.d_s = i->fn_name}}, {_SLIT(": assert "), 0xfe10, {.d_s = i->src}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = i->fpath}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = i->line_nr + 1}}, {_SLIT(": FAIL: fn "), /*115 &string*/0xfe10, {.d_s = i->fn_name}}, {_SLIT(": assert "), /*115 &string*/0xfe10, {.d_s = i->src}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i->op.len > 0 && !string__eq(i->op, _SLIT("call"))) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" left value: "), 0xfe10, {.d_s = i->llabel}}, {_SLIT(" = "), 0xfe10, {.d_s = i->lvalue}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" left value: "), /*115 &string*/0xfe10, {.d_s = i->llabel}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = i->lvalue}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (string__eq(i->rlabel, i->rvalue)) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" right value: "), 0xfe10, {.d_s = i->rlabel}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" right value: "), /*115 &string*/0xfe10, {.d_s = i->rlabel}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" right value: "), 0xfe10, {.d_s = i->rlabel}}, {_SLIT(" = "), 0xfe10, {.d_s = i->rvalue}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" right value: "), /*115 &string*/0xfe10, {.d_s = i->rlabel}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = i->rvalue}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -18541,7 +18575,7 @@ VV_LOCAL_SYMBOL bool print_backtrace_skipping_top_frames(int xskipframes) { } #else { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("print_backtrace_skipping_top_frames is not implemented. skipframes: "), 0xfe07, {.d_i32 = skipframes}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("print_backtrace_skipping_top_frames is not implemented. skipframes: "), /*100 &int*/0xfe07, {.d_i32 = skipframes}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif } @@ -18618,7 +18652,7 @@ VV_LOCAL_SYMBOL bool print_backtrace_skipping_top_frames_linux(int skipframes) { string executable = string_all_before(sframe, _SLIT("(")); string addr = string_all_before(string_all_after(sframe, _SLIT("[")), _SLIT("]")); string beforeaddr = string_all_before(sframe, _SLIT("[")); - string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT("addr2line -e "), 0xfe10, {.d_s = executable}}, {_SLIT(" "), 0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}})); + string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT("addr2line -e "), /*115 &string*/0xfe10, {.d_s = executable}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}})); voidptr f = popen(((char*)(cmd.str)), "r"); if (isnil(f)) { eprintln(sframe); @@ -18642,7 +18676,7 @@ VV_LOCAL_SYMBOL bool print_backtrace_skipping_top_frames_linux(int skipframes) { output = _SLIT(""); } output = string_replace(output, _SLIT(" (discriminator"), _SLIT(": (d.")); - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x6efe10, {.d_s = output}}, {_SLIT(" | "), 0x1cfe30, {.d_s = addr}}, {_SLIT(" | "), 0xfe10, {.d_s = beforeaddr}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x6efe10, {.d_s = output}}, {_SLIT(" | "), /*115 &string*/0x1cfe30, {.d_s = addr}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = beforeaddr}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } #endif @@ -19377,7 +19411,7 @@ Option_rune Array_u8_byterune(Array_u8 b) { string u8_repeat(u8 b, int count) { if (count < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("byte.repeat: count is negative: "), 0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("byte.repeat: count is negative: "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (count == 0) { return _SLIT(""); @@ -20059,7 +20093,7 @@ string IError_str(IError err) { } else { - _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = charptr_vstring_literal( /* IError */ v_typeof_interface_IError( (err)._typ ))}}, {_SLIT(": "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* IError */ v_typeof_interface_IError( (err)._typ ))}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})); } return _t2; } @@ -20108,6 +20142,13 @@ VV_LOCAL_SYMBOL void opt_ok(voidptr data, Option* option, int size) { } } +VV_LOCAL_SYMBOL void _result_ok(voidptr data, _result* res, int size) { + { // Unsafe block + *res = ((_result){.is_error = 0,.err = _const_none__,}); + vmemcpy(((u8*)(&res->err)) + sizeof(IError), data, size); + } +} + string none_str(none _d2) { return _SLIT("none"); } @@ -20164,10 +20205,10 @@ VV_LOCAL_SYMBOL void prealloc_vcleanup(void) { for (;;) { if (!(mb != 0)) break; nr_mallocs += mb->mallocs; - eprintln( str_intp(8, _MOV((StrIntpData[]){{_SLIT("> freeing mb.id: "), 0x6fe27, {.d_i32 = mb->id}}, {_SLIT(" | cap: "), 0xefe27, {.d_i32 = mb->cap}}, {_SLIT(" | rem: "), 0xefe27, {.d_i32 = mb->remaining}}, {_SLIT(" | start: "), 0xfe11, {.d_p = (void*)(((voidptr)(mb->start)))}}, {_SLIT(" | current: "), 0xfe11, {.d_p = (void*)(((voidptr)(mb->current)))}}, {_SLIT(" | diff: "), 0xefe28, {.d_u64 = ((u64)(mb->current)) - ((u64)(mb->start))}}, {_SLIT(" bytes | mallocs: "), 0xfe07, {.d_i32 = mb->mallocs}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(8, _MOV((StrIntpData[]){{_SLIT("> freeing mb.id: "), /*100 &int*/0x6fe27, {.d_i32 = mb->id}}, {_SLIT(" | cap: "), /*100 &int*/0xefe27, {.d_i32 = mb->cap}}, {_SLIT(" | rem: "), /*100 &int*/0xefe27, {.d_i32 = mb->remaining}}, {_SLIT(" | start: "), /*112 &voidptr*/0xfe11, {.d_p = (void*)(((voidptr)(mb->start)))}}, {_SLIT(" | current: "), /*112 &voidptr*/0xfe11, {.d_p = (void*)(((voidptr)(mb->current)))}}, {_SLIT(" | diff: "), /*117 &u64*/0xefe28, {.d_u64 = ((u64)(mb->current)) - ((u64)(mb->start))}}, {_SLIT(" bytes | mallocs: "), /*100 &int*/0xfe07, {.d_i32 = mb->mallocs}}, {_SLIT0, 0, { .d_c = 0 }}}))); mb = mb->previous; } - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> nr_mallocs: "), 0xfe09, {.d_i64 = nr_mallocs}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> nr_mallocs: "), /*100 &i64*/0xfe09, {.d_i64 = nr_mallocs}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif { // Unsafe block @@ -20214,7 +20255,7 @@ string Array_rune_string(Array_rune ra) { string rune_repeat(rune c, int count) { if (count < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("rune.repeat: count is negative: "), 0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("rune.repeat: count is negative: "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (count == 0) { return _SLIT(""); @@ -21230,7 +21271,7 @@ string string_substr(string s, int start, int end) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (start > end || start > s.len || end > s.len || start < 0 || end < 0) { - _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("substr("), 0xfe07, {.d_i32 = start}}, {_SLIT(", "), 0xfe07, {.d_i32 = end}}, {_SLIT(") out of bounds (len="), 0xfe07, {.d_i32 = s.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("substr("), /*100 &int*/0xfe07, {.d_i32 = start}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = end}}, {_SLIT(") out of bounds (len="), /*100 &int*/0xfe07, {.d_i32 = s.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -21254,7 +21295,7 @@ string string_substr(string s, int start, int end) { // Attr: [direct_array_access] Option_string string_substr_with_check(string s, int start, int end) { if (start > end || start > s.len || end > s.len || start < 0 || end < 0) { - return (Option_string){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT("substr("), 0xfe07, {.d_i32 = start}}, {_SLIT(", "), 0xfe07, {.d_i32 = end}}, {_SLIT(") out of bounds (len="), 0xfe07, {.d_i32 = s.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT("substr("), /*100 &int*/0xfe07, {.d_i32 = start}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = end}}, {_SLIT(") out of bounds (len="), /*100 &int*/0xfe07, {.d_i32 = s.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int len = end - start; if (len == s.len) { @@ -21864,7 +21905,7 @@ VV_LOCAL_SYMBOL byte string_at(string s, int idx) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (idx < 0 || idx >= s.len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("string index out of range: "), 0xfe07, {.d_i32 = idx}}, {_SLIT(" / "), 0xfe07, {.d_i32 = s.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("string index out of range: "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT(" / "), /*100 &int*/0xfe07, {.d_i32 = s.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -22090,7 +22131,7 @@ Array_u8 string_bytes(string s) { string string_repeat(string s, int count) { if (count < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("string.repeat: count is negative: "), 0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("string.repeat: count is negative: "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (count == 0) { return _SLIT(""); @@ -22969,22 +23010,22 @@ string str_intp(int data_len, voidptr in_data) { // Attr: [inline] inline string str_intp_sq(string in_str) { - return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"\'\"), "), 0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = in_str}}, {_SLIT("}},{_SLIT(\"\'\"), 0, {.d_c = 0 }}}))"), 0, { .d_c = 0 }}})); + return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT("}},{_SLIT(\"\'\"), 0, {.d_c = 0 }}}))"), 0, { .d_c = 0 }}})); } // Attr: [inline] inline string str_intp_rune(string in_str) { - return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"`\"), "), 0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = in_str}}, {_SLIT("}},{_SLIT(\"`\"), 0, {.d_c = 0 }}}))"), 0, { .d_c = 0 }}})); + return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"`\"), "), /*115 &string*/0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT("}},{_SLIT(\"`\"), 0, {.d_c = 0 }}}))"), 0, { .d_c = 0 }}})); } // Attr: [inline] inline string str_intp_g32(string in_str) { - return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), 0xfe10, {.d_s = _const_si_g32_code}}, {_SLIT(", {.d_f32 = "), 0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); + return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_si_g32_code}}, {_SLIT(", {.d_f32 = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); } // Attr: [inline] inline string str_intp_g64(string in_str) { - return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), 0xfe10, {.d_s = _const_si_g64_code}}, {_SLIT(", {.d_f64 = "), 0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); + return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_si_g64_code}}, {_SLIT(", {.d_f64 = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); } // Attr: [manualfree] @@ -23003,12 +23044,12 @@ string str_intp_sub(string base_str, string in_str) { string st_str = string_substr(base_str, 0, index); if (index + 2 < base_str.len) { string en_str = string_substr(base_str, index + 2, (base_str).len); - string res_str = str_intp(5, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\""), 0xfe10, {.d_s = st_str}}, {_SLIT("\"), "), 0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = in_str}}, {_SLIT(" }},{_SLIT(\""), 0xfe10, {.d_s = en_str}}, {_SLIT("\"), 0, {.d_c = 0}}}))"), 0, { .d_c = 0 }}})); + string res_str = str_intp(5, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = st_str}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT(" }},{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = en_str}}, {_SLIT("\"), 0, {.d_c = 0}}}))"), 0, { .d_c = 0 }}})); string_free(&st_str); string_free(&en_str); return res_str; } - string res2_str = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\""), 0xfe10, {.d_s = st_str}}, {_SLIT("\"), "), 0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); + string res2_str = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = st_str}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); string_free(&st_str); return res2_str; } @@ -23449,7 +23490,7 @@ u16* kw; int os__setenv(string name, string value, bool overwrite) { #if defined(_WIN32) { - string format = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("="), 0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}})); + string format = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("="), /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}})); if (overwrite) { { // Unsafe block int _t1 = _putenv(((char*)(format.str))); @@ -23480,7 +23521,7 @@ int os__setenv(string name, string value, bool overwrite) { int os__unsetenv(string name) { #if defined(_WIN32) { - string format = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("="), 0, { .d_c = 0 }}})); + string format = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("="), 0, { .d_c = 0 }}})); int _t1 = _putenv(((char*)(format.str))); return _t1; } @@ -23666,7 +23707,7 @@ Option_os__File os__open_file(string path, string mode, Array_int options) { } FILE* cfile = fdopen(fd, ((char*)(mode.str))); if (isnil(cfile)) { - return (Option_os__File){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to open or create file \""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_os__File){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to open or create file \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_os__File _t4; opt_ok(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (Option*)(&_t4), sizeof(os__File)); @@ -24259,7 +24300,7 @@ FILE* fp; } int len = ((int)(fsize)); if (((i64)(len)) < fsize) { - Option_Array_u8 _t5 = (Option_Array_u8){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = fsize}}, {_SLIT(" cast to int results in "), 0xfe07, {.d_i32 = ((int)(fsize))}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + Option_Array_u8 _t5 = (Option_Array_u8){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = fsize}}, {_SLIT(" cast to int results in "), /*100 &int*/0xfe07, {.d_i32 = ((int)(fsize))}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -24326,7 +24367,7 @@ FILE* fp; rewind(fp); int allocate = ((int)(fsize)); if (((i64)(allocate)) < fsize) { - Option_string _t5 = (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = fsize}}, {_SLIT(" cast to int results in "), 0xfe07, {.d_i32 = ((int)(fsize))}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + Option_string _t5 = (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = fsize}}, {_SLIT(" cast to int results in "), /*100 &int*/0xfe07, {.d_i32 = ((int)(fsize))}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -24498,14 +24539,14 @@ Option_void os__mv(string src, string dst) { string w_dst = string_replace(rdst, _SLIT("/"), _SLIT("\\")); int ret = _wrename(string_to_wide(w_src), string_to_wide(w_dst)); if (ret != 0) { - return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to rename "), 0xfe10, {.d_s = src}}, {_SLIT(" to "), 0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(ret))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to rename "), /*115 &string*/0xfe10, {.d_s = src}}, {_SLIT(" to "), /*115 &string*/0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(ret))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } #else { int ret = rename(((char*)(src.str)), ((char*)(rdst.str))); if (ret != 0) { - return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to rename "), 0xfe10, {.d_s = src}}, {_SLIT(" to "), 0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ret), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to rename "), /*115 &string*/0xfe10, {.d_s = src}}, {_SLIT(" to "), /*115 &string*/0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ret), .data={EMPTY_STRUCT_INITIALIZATION} }; } } #endif @@ -24519,19 +24560,19 @@ Option_void os__cp(string src, string dst) { string w_dst = string_replace(dst, _SLIT("/"), _SLIT("\\")); if (CopyFile(string_to_wide(w_src), string_to_wide(w_dst), false) == 0) { u32 result = GetLastError(); - return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to copy "), 0xfe10, {.d_s = src}}, {_SLIT(" to "), 0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(result))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to copy "), /*115 &string*/0xfe10, {.d_s = src}}, {_SLIT(" to "), /*115 &string*/0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(result))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } #else { int fp_from = open(((char*)(src.str)), O_RDONLY, 0); if (fp_from < 0) { - return (Option_void){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cp: failed to open "), 0xfe10, {.d_s = src}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(fp_from))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cp: failed to open "), /*115 &string*/0xfe10, {.d_s = src}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(fp_from))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int fp_to = open(((char*)(dst.str)), ((O_WRONLY | O_CREAT) | O_TRUNC), (S_IWUSR | S_IRUSR)); if (fp_to < 0) { close(fp_from); - return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cp (permission): failed to write to "), 0xfe10, {.d_s = dst}}, {_SLIT(" (fp_to: "), 0xfe07, {.d_i32 = fp_to}}, {_SLIT(")"), 0, { .d_c = 0 }}})), ((int)(fp_to))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cp (permission): failed to write to "), /*115 &string*/0xfe10, {.d_s = dst}}, {_SLIT(" (fp_to: "), /*100 &int*/0xfe07, {.d_i32 = fp_to}}, {_SLIT(")"), 0, { .d_c = 0 }}})), ((int)(fp_to))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Array_fixed_u8_1024 buf = {0}; int count = 0; @@ -24543,7 +24584,7 @@ Option_void os__cp(string src, string dst) { if (write(fp_to, &buf[0], count) < 0) { close(fp_to); close(fp_from); - return (Option_void){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cp: failed to write to "), 0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(-1))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cp: failed to write to "), /*115 &string*/0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(-1))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } struct stat from_attr; @@ -24551,7 +24592,7 @@ Option_void os__cp(string src, string dst) { if (chmod(((char*)(dst.str)), from_attr.st_mode) < 0) { close(fp_to); close(fp_from); - return (Option_void){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to set permissions for "), 0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(-1))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to set permissions for "), /*115 &string*/0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(-1))), .data={EMPTY_STRUCT_INITIALIZATION} }; } close(fp_to); close(fp_from); @@ -24575,7 +24616,7 @@ Option_FILE_ptr os__vfopen(string path, string mode) { } #endif if (isnil(fp)) { - return (Option_FILE_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to open file \""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_FILE_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to open file \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else { Option_FILE_ptr _t3; opt_ok(&(FILE*[]) { fp }, (Option*)(&_t3), sizeof(FILE*)); @@ -24672,7 +24713,7 @@ int os__system(string cmd) { int ret = 0; #if defined(_WIN32) { - string wcmd = (cmd.len > 1 && string_at(cmd, 0) == '"' && string_at(cmd, 1) != '"' ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = cmd}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) : (cmd)); + string wcmd = (cmd.len > 1 && string_at(cmd, 0) == '"' && string_at(cmd, 1) != '"' ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) : (cmd)); { // Unsafe block ret = _wsystem(string_to_wide(wcmd)); } @@ -24710,7 +24751,7 @@ int os__system(string cmd) { int pret = mr_9929.arg0; bool is_signaled = mr_9929.arg1; if (is_signaled) { - println(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Terminated by signal "), 0x4fe27, {.d_i32 = ret}}, {_SLIT(" ("), 0, { .d_c = 0 }}})), os__sigint_to_signal_name(pret)), _SLIT(")"))); + println(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Terminated by signal "), /*100 &int*/0x4fe27, {.d_i32 = ret}}, {_SLIT(" ("), 0, { .d_c = 0 }}})), os__sigint_to_signal_name(pret)), _SLIT(")"))); } ret = pret; } @@ -24814,7 +24855,7 @@ Option_void os__rm(string path) { } #endif if (rc == -1) { - return (Option_void){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to remove \""), 0xfe10, {.d_s = path}}, {_SLIT("\": "), 0, { .d_c = 0 }}})), os__posix_get_error_msg(errno))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to remove \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\": "), 0, { .d_c = 0 }}})), os__posix_get_error_msg(errno))), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; } @@ -24824,7 +24865,7 @@ Option_void os__rmdir(string path) { { int rc = RemoveDirectory(string_to_wide(path)); if (rc == 0) { - return (Option_void){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to remove \""), 0xfe10, {.d_s = path}}, {_SLIT("\": "), 0, { .d_c = 0 }}})), os__posix_get_error_msg(errno))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to remove \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\": "), 0, { .d_c = 0 }}})), os__posix_get_error_msg(errno))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } #else @@ -24841,7 +24882,7 @@ Option_void os__rmdir(string path) { VV_LOCAL_SYMBOL void os__print_c_errno(void) { int e = errno; string se = tos_clone(((u8*)(strerror(e)))); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("errno="), 0xfe07, {.d_i32 = e}}, {_SLIT(" err="), 0xfe10, {.d_s = se}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("errno="), /*100 &int*/0xfe07, {.d_i32 = e}}, {_SLIT(" err="), /*115 &string*/0xfe10, {.d_s = se}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string os__get_raw_line(void) { @@ -25037,7 +25078,7 @@ string sret; int pid = getpid(); int ret = proc_pidpath(pid, result, _const_os__max_path_len); if (ret <= 0) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("os.executable() failed at calling proc_pidpath with pid: "), 0xfe07, {.d_i32 = pid}}, {_SLIT(" . proc_pidpath returned "), 0xfe07, {.d_i32 = ret}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("os.executable() failed at calling proc_pidpath with pid: "), /*100 &int*/0xfe07, {.d_i32 = pid}}, {_SLIT(" . proc_pidpath returned "), /*100 &int*/0xfe07, {.d_i32 = ret}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); string _t3 = os__executable_fallback(); // Defer begin if (os__executable_defer_3) { @@ -25761,7 +25802,7 @@ Option_os__File os__open_append(string path) { } #endif if (isnil(file.cfile)) { - return (Option_os__File){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to create(append) file \""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_os__File){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to create(append) file \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } file.is_opened = true; Option_os__File _t2; @@ -26746,7 +26787,7 @@ Option_void os__mkdir_all(string opath) { Option_bool _t2 = os__mkdir(p); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("folder: "), 0xfe10, {.d_s = p}}, {_SLIT(", error: "), 0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("folder: "), /*115 &string*/0xfe10, {.d_s = p}}, {_SLIT(", error: "), /*115 &IError*/0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } (*(bool*)_t2.data); @@ -26882,8 +26923,8 @@ string os__resource_abs_path(string path) { os__Result os__execute_or_panic(string cmd) { os__Result res = os__execute(cmd); if (res.exit_code != 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed code: "), 0xfe07, {.d_i32 = res.exit_code}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed code: "), /*100 &int*/0xfe07, {.d_i32 = res.exit_code}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_panic(res.output); VUNREACHABLE(); } @@ -26894,8 +26935,8 @@ os__Result os__execute_or_panic(string cmd) { os__Result os__execute_or_exit(string cmd) { os__Result res = os__execute(cmd); if (res.exit_code != 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed code: "), 0xfe07, {.d_i32 = res.exit_code}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed code: "), /*100 &int*/0xfe07, {.d_i32 = res.exit_code}}, {_SLIT0, 0, { .d_c = 0 }}}))); eprintln(res.output); _v_exit(1); VUNREACHABLE(); @@ -26907,12 +26948,12 @@ os__Result os__execute_or_exit(string cmd) { string os__quoted_path(string path) { #if defined(_WIN32) { - string _t1 = (string_ends_with(path, _const_os__path_separator) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = string__plus(path, _const_os__path_separator)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}})))); + string _t1 = (string_ends_with(path, _const_os__path_separator) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = string__plus(path, _const_os__path_separator)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}})))); return _t1; } #else { - string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = path}}, {_SLIT("'"), 0, { .d_c = 0 }}})); + string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("'"), 0, { .d_c = 0 }}})); return _t2; } #endif @@ -26980,8 +27021,8 @@ VV_LOCAL_SYMBOL Array_string os__glob_match(string dir, string pattern, string n if (!string__eq(next_pattern, pattern) && (next_pattern).len != 0) { for (int _t4 = 0; _t4 < files.len; ++_t4) { string file = ((string*)files.data)[_t4]; - if (os__is_dir( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT("/"), 0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}})))) { - array_push((array*)&subdirs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT("/"), 0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + if (os__is_dir( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}})))) { + array_push((array*)&subdirs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } Array_string _t6 = subdirs; @@ -27011,7 +27052,7 @@ VV_LOCAL_SYMBOL Array_string os__glob_match(string dir, string pattern, string n Array_string pathwalk = string_split(file, _const_os__path_separator); _t8 = (*(string*)/*ee elem_sym */array_get(pathwalk, pathwalk.len - 1)); } else { - fpath = (string__eq(dir, _SLIT(".")) ? (file) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT("/"), 0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}})))); + fpath = (string__eq(dir, _SLIT(".")) ? (file) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}})))); _t8 = file; } string f = _t8; @@ -27043,7 +27084,7 @@ VV_LOCAL_SYMBOL Array_string os__glob_match(string dir, string pattern, string n if (os__is_dir(fpath)) { array_push((array*)&subdirs, _MOV((string[]){ string_clone(fpath) })); if (string__eq(next_pattern, pattern) && (next_pattern).len != 0) { - array_push((array*)matches, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fpath}}, {_SLIT0, 0xfe10, {.d_s = _const_os__path_separator}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)matches, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fpath}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_os__path_separator}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } else { array_push((array*)matches, _MOV((string[]){ string_clone(fpath) })); @@ -27064,8 +27105,8 @@ VV_LOCAL_SYMBOL Option_void os__native_glob_pattern(string pattern, Array_string if ((step).len == 0) { continue; } - if (os__is_dir( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cwd}}, {_SLIT0, 0xfe10, {.d_s = _const_os__path_separator}}, {_SLIT0, 0xfe10, {.d_s = step}}, {_SLIT0, 0, { .d_c = 0 }}})))) { - string dd = (string__eq(cwd, _SLIT("/")) ? (step) : ((string__eq(cwd, _SLIT(".")) || (cwd).len == 0 ? (step) : ((string__eq(step, _SLIT(".")) || string__eq(step, _SLIT("/")) ? (cwd) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cwd}}, {_SLIT("/"), 0xfe10, {.d_s = step}}, {_SLIT0, 0, { .d_c = 0 }}})))))))); + if (os__is_dir( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cwd}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_os__path_separator}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = step}}, {_SLIT0, 0, { .d_c = 0 }}})))) { + string dd = (string__eq(cwd, _SLIT("/")) ? (step) : ((string__eq(cwd, _SLIT(".")) || (cwd).len == 0 ? (step) : ((string__eq(step, _SLIT(".")) || string__eq(step, _SLIT("/")) ? (cwd) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cwd}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = step}}, {_SLIT0, 0, { .d_c = 0 }}})))))))); if (i + 1 != steps.len) { if (!Array_string_contains(subdirs, dd)) { array_push((array*)&subdirs, _MOV((string[]){ string_clone(dd) })); @@ -27075,7 +27116,7 @@ VV_LOCAL_SYMBOL Option_void os__native_glob_pattern(string pattern, Array_string Array_string subs = __new_array_with_default(0, 0, sizeof(string), 0); for (int _t2 = 0; _t2 < subdirs.len; ++_t2) { string sd = ((string*)subdirs.data)[_t2]; - string d = (string__eq(cwd, _SLIT("/")) ? (sd) : ((string__eq(cwd, _SLIT(".")) || (cwd).len == 0 ? (sd) : ((string__eq(sd, _SLIT(".")) || string__eq(sd, _SLIT("/")) ? (cwd) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cwd}}, {_SLIT("/"), 0xfe10, {.d_s = sd}}, {_SLIT0, 0, { .d_c = 0 }}})))))))); + string d = (string__eq(cwd, _SLIT("/")) ? (sd) : ((string__eq(cwd, _SLIT(".")) || (cwd).len == 0 ? (sd) : ((string__eq(sd, _SLIT(".")) || string__eq(sd, _SLIT("/")) ? (cwd) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cwd}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = sd}}, {_SLIT0, 0, { .d_c = 0 }}})))))))); _PUSH_MANY(&subs, (os__glob_match(string_replace(d, _SLIT("//"), _SLIT("/")), step, step2, matches)), _t3, Array_string); } subdirs = array_clone_to_depth(&subs, 0); @@ -27150,7 +27191,7 @@ Option_Array_string os__ls(string path) { Array_string res = __new_array_with_default(0, 50, sizeof(string), 0); DIR* dir = opendir(((char*)(path.str))); if (isnil(dir)) { - return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ls() couldnt open dir \""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ls() couldnt open dir \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } struct dirent* ent = ((struct dirent*)(0)); for (;;) { @@ -27194,11 +27235,11 @@ bool os__execute_defer_0 = false; string pcmd; bool os__execute_defer_1 = false; strings__Builder res; - pcmd = (string_contains(cmd, _SLIT("2>")) ? (string_clone(cmd)) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cmd}}, {_SLIT(" 2>&1"), 0, { .d_c = 0 }}})))); + pcmd = (string_contains(cmd, _SLIT("2>")) ? (string_clone(cmd)) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT(" 2>&1"), 0, { .d_c = 0 }}})))); os__execute_defer_0 = true; voidptr f = os__vpopen(pcmd); if (isnil(f)) { - os__Result _t1 = ((os__Result){.exit_code = -1,.output = str_intp(2, _MOV((StrIntpData[]){{_SLIT("exec(\""), 0xfe10, {.d_s = cmd}}, {_SLIT("\") failed"), 0, { .d_c = 0 }}})),}); + os__Result _t1 = ((os__Result){.exit_code = -1,.output = str_intp(2, _MOV((StrIntpData[]){{_SLIT("exec(\""), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT("\") failed"), 0, { .d_c = 0 }}})),}); // Defer begin if (os__execute_defer_0) { string_free(&pcmd); @@ -27244,7 +27285,7 @@ string pcmd; os__Command_start_defer_0 = true; c->f = os__vpopen(pcmd); if (isnil(c->f)) { - Option_void _t1 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("exec(\""), 0xfe10, {.d_s = c->path}}, {_SLIT("\") failed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + Option_void _t1 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("exec(\""), /*115 &string*/0xfe10, {.d_s = c->path}}, {_SLIT("\") failed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__Command_start_defer_0) { string_free(&pcmd); @@ -27363,7 +27404,7 @@ Option_bool os__is_writable_folder(string folder) { bool os__is_writable_folder_defer_0 = false; string tmp_perm_check; if (!os__exists(folder)) { - return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = folder}}, {_SLIT("` does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = folder}}, {_SLIT("` does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__is_dir(folder)) { return (Option_bool){ .state=2, .err=_v_error(_SLIT("`folder` is not a folder")), .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -27373,7 +27414,7 @@ string tmp_perm_check; { // Unsafe block int x = mkstemp(((char*)(tmp_perm_check.str))); if (-1 == x) { - Option_bool _t3 = (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("folder `"), 0xfe10, {.d_s = folder}}, {_SLIT("` is not writable"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + Option_bool _t3 = (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("folder `"), /*115 &string*/0xfe10, {.d_s = folder}}, {_SLIT("` is not writable"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__is_writable_folder_defer_0) { string_free(&tmp_perm_check); @@ -27549,7 +27590,7 @@ VV_LOCAL_SYMBOL int os__Process__spawn(os__Process* p) { string k = /*key*/ *(string*)DenseArray_key(¤t_environment.key_values, _t1); k = string_clone(k); string v = (*(string*)DenseArray_value(¤t_environment.key_values, _t1)); - array_push((array*)&p->env, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = k}}, {_SLIT("="), 0xfe10, {.d_s = v}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&p->env, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = k}}, {_SLIT("="), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } int pid = 0; @@ -27669,11 +27710,11 @@ string os__Process_stderr_read(os__Process* p) { VV_LOCAL_SYMBOL void os__Process__check_redirection_call(os__Process* p, string fn_name) { if (!p->use_stdio_ctl) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Call p.set_redirect_stdio() before calling p."), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Call p.set_redirect_stdio() before calling p."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (p->status == os__ProcessState__not_started) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Call p."), 0xfe10, {.d_s = fn_name}}, {_SLIT("() after you have called p.run()"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Call p."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("() after you have called p.run()"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -27792,7 +27833,7 @@ void os__Process_set_environment(os__Process* p, Map_string_string envs) { string k = /*key*/ *(string*)DenseArray_key(&envs.key_values, _t1); k = string_clone(k); string v = (*(string*)DenseArray_value(&envs.key_values, _t1)); - array_push((array*)&p->env, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = k}}, {_SLIT("="), 0xfe10, {.d_s = v}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&p->env, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = k}}, {_SLIT("="), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } return; } @@ -27875,7 +27916,7 @@ VV_LOCAL_SYMBOL void os__Process_unix_wait(os__Process* p) { bool is_signaled = mr_2291.arg1; if (is_signaled) { p->status = os__ProcessState__aborted; - p->err = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Terminated by signal "), 0x4fe27, {.d_i32 = ret}}, {_SLIT(" ("), 0xfe10, {.d_s = os__sigint_to_signal_name(pret)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + p->err = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Terminated by signal "), /*100 &int*/0x4fe27, {.d_i32 = ret}}, {_SLIT(" ("), /*115 &string*/0xfe10, {.d_s = os__sigint_to_signal_name(pret)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); } else { p->status = os__ProcessState__exited; } @@ -27899,7 +27940,7 @@ VV_LOCAL_SYMBOL bool os__Process_unix_is_alive(os__Process* p) { bool is_signaled = mr_2724.arg1; if (is_signaled) { p->status = os__ProcessState__aborted; - p->err = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Terminated by signal "), 0x4fe27, {.d_i32 = ret}}, {_SLIT(" ("), 0xfe10, {.d_s = os__sigint_to_signal_name(pret)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + p->err = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Terminated by signal "), /*100 &int*/0x4fe27, {.d_i32 = ret}}, {_SLIT(" ("), /*115 &string*/0xfe10, {.d_s = os__sigint_to_signal_name(pret)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); } else { p->status = os__ProcessState__exited; } @@ -27984,9 +28025,9 @@ Option_void os__open_uri(string uri) { if ((vopen_uri_cmd).len == 0) { return (Option_void){ .state=2, .err=_v_error(_SLIT("unsupported platform")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - os__Result result = os__execute( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = vopen_uri_cmd}}, {_SLIT(" \""), 0xfe10, {.d_s = uri}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + os__Result result = os__execute( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = vopen_uri_cmd}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = uri}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); if (result.exit_code != 0) { - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to open url: "), 0xfe10, {.d_s = result.output}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to open url: "), /*115 &string*/0xfe10, {.d_s = result.output}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; } @@ -28228,11 +28269,11 @@ v__token__KeywordsMatcher v__token__new_keywords_matcher_T_v__token__Kind(Map_st qsort(km.words[v_fixed_index(i, 20)].data, km.words[v_fixed_index(i, 20)].len, km.words[v_fixed_index(i, 20)].element_size, (int (*)(const void *, const void *))&compare_186646746980636166_v__token__WIndex_by_word); #if defined(CUSTOM_DEFINE_trace_keyword_matcher_initialisation) { - print( str_intp(2, _MOV((StrIntpData[]){{_SLIT("word len: "), 0x6fe27, {.d_i32 = i}}, {_SLIT(" | words: "), 0, { .d_c = 0 }}}))); + print( str_intp(2, _MOV((StrIntpData[]){{_SLIT("word len: "), /*100 &int literal*/0x6fe27, {.d_i32 = i}}, {_SLIT(" | words: "), 0, { .d_c = 0 }}}))); Array_v__token__WIndex _t4 = km.words[v_fixed_index(i, 20)]; for (int _t5 = 0; _t5 < _t4.len; ++_t5) { v__token__WIndex w = ((v__token__WIndex*)_t4.data)[_t5]; - print( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = w.word}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + print( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = w.word}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); } println(_SLIT("")); } @@ -28266,11 +28307,11 @@ v__token__KeywordsMatcher v__token__new_keywords_matcher_T_int(Map_string_int kw qsort(km.words[v_fixed_index(i, 20)].data, km.words[v_fixed_index(i, 20)].len, km.words[v_fixed_index(i, 20)].element_size, (int (*)(const void *, const void *))&compare_186646746980636166_v__token__WIndex_by_word); #if defined(CUSTOM_DEFINE_trace_keyword_matcher_initialisation) { - print( str_intp(2, _MOV((StrIntpData[]){{_SLIT("word len: "), 0x6fe27, {.d_i32 = i}}, {_SLIT(" | words: "), 0, { .d_c = 0 }}}))); + print( str_intp(2, _MOV((StrIntpData[]){{_SLIT("word len: "), /*100 &int literal*/0x6fe27, {.d_i32 = i}}, {_SLIT(" | words: "), 0, { .d_c = 0 }}}))); Array_v__token__WIndex _t4 = km.words[v_fixed_index(i, 20)]; for (int _t5 = 0; _t5 < _t4.len; ++_t5) { v__token__WIndex w = ((v__token__WIndex*)_t4.data)[_t5]; - print( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = w.word}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + print( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = w.word}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); } println(_SLIT("")); } @@ -28283,7 +28324,7 @@ v__token__KeywordsMatcher v__token__new_keywords_matcher_T_int(Map_string_int kw VV_LOCAL_SYMBOL void v__token__KeywordsMatcher_add_word(v__token__KeywordsMatcher* km, string word, int kind) { if (word.len >= _const_v__token__max_keyword_len) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("increase max_keyword_len to > "), 0xfe07, {.d_i32 = word.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("increase max_keyword_len to > "), /*100 &int*/0xfe07, {.d_i32 = word.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (km->len_max < word.len) { @@ -28336,7 +28377,7 @@ void v__token__Pos_free(v__token__Pos* p) { } string v__token__Pos_line_str(v__token__Pos p) { - string _t1 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("{l: "), 0xafe27, {.d_i32 = p.line_nr + 1}}, {_SLIT(", c: "), 0x6fe27, {.d_i32 = p.col}}, {_SLIT(", p: "), 0xafe27, {.d_i32 = p.pos}}, {_SLIT(", ll: "), 0xafe27, {.d_i32 = p.last_line + 1}}, {_SLIT("}"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("{l: "), /*100 &int*/0xafe27, {.d_i32 = p.line_nr + 1}}, {_SLIT(", c: "), /*100 &int*/0x6fe27, {.d_i32 = p.col}}, {_SLIT(", p: "), /*100 &int*/0xafe27, {.d_i32 = p.pos}}, {_SLIT(", ll: "), /*100 &int*/0xafe27, {.d_i32 = p.last_line + 1}}, {_SLIT("}"), 0, { .d_c = 0 }}})); return _t1; } @@ -28491,7 +28532,7 @@ VV_LOCAL_SYMBOL Array_string v__token__build_token_str(void) { for (int k = 0; k < s.len; ++k) { string v = ((string*)s.data)[k]; if ((v).len == 0) { - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT(">>> "), 0xfe10, {.d_s = _SLIT("v.token")}}, {_SLIT("."), 0xfe10, {.d_s = _SLIT("build_token_str")}}, {_SLIT(" missing k: "), 0xfe07, {.d_i32 = k}}, {_SLIT(" | ."), 0xfe10, {.d_s = v__token__kind_to_string(((v__token__Kind)(k)))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT(">>> "), /*115 &string*/0xfe10, {.d_s = _SLIT("v.token")}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = _SLIT("build_token_str")}}, {_SLIT(" missing k: "), /*100 &int*/0xfe07, {.d_i32 = k}}, {_SLIT(" | ."), /*115 &string*/0xfe10, {.d_s = v__token__kind_to_string(((v__token__Kind)(k)))}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -28529,14 +28570,14 @@ string v__token__Token_str(v__token__Token t) { if (s.len == 0) { eprintln(_SLIT("missing token kind string")); } else if (!u8_is_letter(string_at(s, 0))) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("token `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("token `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } if (v__token__is_key(t.lit)) { s = _SLIT("keyword"); } if ((t.lit).len != 0) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" `"), 0xfe10, {.d_s = t.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = t.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } string _t2 = s; return _t2; @@ -28545,7 +28586,7 @@ string v__token__Token_str(v__token__Token t) { string v__token__Token_debug(v__token__Token t) { string ks = v__token__kind_to_string(t.kind); string s = ((t.lit).len == 0 ? (v__token__Kind_str(t.kind)) : (t.lit)); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("tok: ."), 0x18fe10, {.d_s = ks}}, {_SLIT(" | lit: `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("tok: ."), /*115 &string*/0x18fe10, {.d_s = ks}}, {_SLIT(" | lit: `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } @@ -28624,7 +28665,7 @@ inline bool v__token__Kind_is_relational(v__token__Kind tok) { // Attr: [inline] inline bool v__token__Kind_is_start_of_type(v__token__Kind k) { - bool _t1 = (k == v__token__Kind__name || k == v__token__Kind__lpar || k == v__token__Kind__amp || k == v__token__Kind__lsbr || k == v__token__Kind__question || k == v__token__Kind__key_shared); + bool _t1 = (k == v__token__Kind__name || k == v__token__Kind__lpar || k == v__token__Kind__amp || k == v__token__Kind__lsbr || k == v__token__Kind__question || k == v__token__Kind__key_shared || k == v__token__Kind__not); return _t1; } @@ -29603,12 +29644,12 @@ void v__dotgraph__start_digraph(void) { v__dotgraph__DotGraph* v__dotgraph__new(string name, string label, string color) { v__dotgraph__DotGraph* res = ((v__dotgraph__DotGraph*)memdup(&(v__dotgraph__DotGraph){.sb = strings__new_builder(1024),}, sizeof(v__dotgraph__DotGraph))); - v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" subgraph cluster_"), 0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" subgraph cluster_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); v__dotgraph__DotGraph_writeln(res, _SLIT("\tedge [fontname=\"Helvetica\",fontsize=\"10\",labelfontname=\"Helvetica\",labelfontsize=\"10\",style=\"solid\",color=\"black\"];")); v__dotgraph__DotGraph_writeln(res, _SLIT("\tnode [fontname=\"Helvetica\",fontsize=\"10\",style=\"filled\",fontcolor=\"black\",fillcolor=\"white\",color=\"black\",shape=\"box\"];")); v__dotgraph__DotGraph_writeln(res, _SLIT("\trankdir=\"LR\";")); - v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tcolor=\""), 0xfe10, {.d_s = color}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); - v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tlabel=\""), 0xfe10, {.d_s = label}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tcolor=\""), /*115 &string*/0xfe10, {.d_s = color}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tlabel=\""), /*115 &string*/0xfe10, {.d_s = label}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); v__dotgraph__DotGraph* _t1 = res; return _t1; } @@ -29628,9 +29669,9 @@ void v__dotgraph__DotGraph_new_node(v__dotgraph__DotGraph* d, string nlabel, v__ nname = cfg.node_name; } if (cfg.should_highlight) { - v__dotgraph__DotGraph_writeln(d, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = nname}}, {_SLIT(" [label=\""), 0xfe10, {.d_s = nlabel}}, {_SLIT("\",color=\"blue\",height=0.2,width=0.4,fillcolor=\"#00FF00\",tooltip=\""), 0xfe10, {.d_s = cfg.tooltip}}, {_SLIT("\",shape=oval];"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(d, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = nname}}, {_SLIT(" [label=\""), /*115 &string*/0xfe10, {.d_s = nlabel}}, {_SLIT("\",color=\"blue\",height=0.2,width=0.4,fillcolor=\"#00FF00\",tooltip=\""), /*115 &string*/0xfe10, {.d_s = cfg.tooltip}}, {_SLIT("\",shape=oval];"), 0, { .d_c = 0 }}}))); } else { - v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = nname}}, {_SLIT(" [shape=\"box\",label=\""), 0xfe10, {.d_s = nlabel}}, {_SLIT("\"];"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = nname}}, {_SLIT(" [shape=\"box\",label=\""), /*115 &string*/0xfe10, {.d_s = nlabel}}, {_SLIT("\"];"), 0, { .d_c = 0 }}}))); } } @@ -29638,9 +29679,9 @@ void v__dotgraph__DotGraph_new_edge(v__dotgraph__DotGraph* d, string source, str string nsource = cfg.name2node_fn(source, cfg.ctx); string ntarget = cfg.name2node_fn(target, cfg.ctx); if (cfg.should_highlight) { - v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = nsource}}, {_SLIT(" -> "), 0xfe10, {.d_s = ntarget}}, {_SLIT(" [color=\"blue\"];"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = nsource}}, {_SLIT(" -> "), /*115 &string*/0xfe10, {.d_s = ntarget}}, {_SLIT(" [color=\"blue\"];"), 0, { .d_c = 0 }}}))); } else { - v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = nsource}}, {_SLIT(" -> "), 0xfe10, {.d_s = ntarget}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = nsource}}, {_SLIT(" -> "), /*115 &string*/0xfe10, {.d_s = ntarget}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } @@ -29794,19 +29835,19 @@ inline u64 hash__fnv1a__sum64_bytes(u8* data, int data_len) { } VV_LOCAL_SYMBOL string flag__UnkownFlagError_msg(flag__UnkownFlagError err) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unknown flag `"), 0xfe10, {.d_s = err.flag}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unknown flag `"), /*115 &string*/0xfe10, {.d_s = err.flag}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } VV_LOCAL_SYMBOL string flag__ArgsCountError_msg(flag__ArgsCountError err) { if (err.want == 0) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Expected no arguments, but got "), 0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Expected no arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } else if (err.got > err.want) { - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Expected at most "), 0xfe07, {.d_i32 = err.want}}, {_SLIT(" arguments, but got "), 0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Expected at most "), /*100 &int*/0xfe07, {.d_i32 = err.want}}, {_SLIT(" arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } else { - string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Expected at least "), 0xfe07, {.d_i32 = err.want}}, {_SLIT(" arguments, but got "), 0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Expected at least "), /*100 &int*/0xfe07, {.d_i32 = err.want}}, {_SLIT(" arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } return (string){.str=(byteptr)"", .is_lit=1}; @@ -29822,7 +29863,7 @@ VV_LOCAL_SYMBOL void flag__Flag_free(flag__Flag* f) { } string flag__Flag_str(flag__Flag f) { - string _t1 = string__plus(string__plus(string__plus(string__plus(_SLIT(" flag:\n"), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" name: "), 0xfe10, {.d_s = f.name}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" abbr: `"), 0xfe10, {.d_s = u8_ascii_str(f.abbr)}}, {_SLIT("`\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" usag: "), 0xfe10, {.d_s = f.usage}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" desc: "), 0xfe10, {.d_s = f.val_desc}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string _t1 = string__plus(string__plus(string__plus(string__plus(_SLIT(" flag:\n"), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" name: "), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" abbr: `"), /*115 &string*/0xfe10, {.d_s = u8_ascii_str(f.abbr)}}, {_SLIT("`\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" usag: "), /*115 &string*/0xfe10, {.d_s = f.usage}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" desc: "), /*115 &string*/0xfe10, {.d_s = f.val_desc}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t1; } @@ -29894,7 +29935,7 @@ void flag__FlagParser_description(flag__FlagParser* fs, string desc) { if (fs->application_description.len == 0) { fs->application_description = desc; } else { - fs->application_description = /*f*/string__plus(fs->application_description, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = desc}}, {_SLIT0, 0, { .d_c = 0 }}}))); + fs->application_description = /*f*/string__plus(fs->application_description, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = desc}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -29916,7 +29957,7 @@ bool flag__FlagParser_parse_value_defer_0 = false; string full; bool flag__FlagParser_parse_value_defer_1 = false; Array_int to_delete; - full = str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), 0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); + full = str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), /*115 &string*/0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); flag__FlagParser_parse_value_defer_0 = true; Array_string found_entries = __new_array_with_default(0, 0, sizeof(string), 0); to_delete = __new_array_with_default(0, 0, sizeof(int), 0); @@ -29972,7 +30013,7 @@ Array_int to_delete; should_skip_one = true; continue; } - if (arg.len > full.len + 1 && string__eq(string_substr(arg, 0, full.len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = full}}, {_SLIT("="), 0, { .d_c = 0 }}})))) { + if (arg.len > full.len + 1 && string__eq(string_substr(arg, 0, full.len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = full}}, {_SLIT("="), 0, { .d_c = 0 }}})))) { array_push((array*)&found_entries, _MOV((string[]){ string_clone(string_substr(arg, full.len + 1, (arg).len)) })); array_push((array*)&to_delete, _MOV((int[]){ i })); continue; @@ -29998,7 +30039,7 @@ Array_int to_delete; VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser* fs, string longhand, u8 shorthand) { { - string full = str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), 0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); + string full = str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), /*115 &string*/0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); for (int i = 0; i < fs->args.len; ++i) { string arg = ((string*)fs->args.data)[i]; if (arg.len == 0) { @@ -30022,7 +30063,7 @@ VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser return _t2; } } - if (arg.len > full.len + 1 && string__eq(string_substr(arg, 0, full.len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = full}}, {_SLIT("="), 0, { .d_c = 0 }}})))) { + if (arg.len > full.len + 1 && string__eq(string_substr(arg, 0, full.len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = full}}, {_SLIT("="), 0, { .d_c = 0 }}})))) { string val = string_substr(arg, full.len + 1, (arg).len); array_delete(&fs->args, i); Option_string _t3; @@ -30036,7 +30077,7 @@ VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser } } } - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = longhand}}, {_SLIT("' not found"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = longhand}}, {_SLIT("' not found"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { @@ -30046,7 +30087,7 @@ Option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr Option_string _t1 = flag__FlagParser_parse_bool_value(fs, name, abbr); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string parsed = (*(string*)_t1.data); @@ -30088,7 +30129,7 @@ Option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, flag__FlagParser_add_flag(fs, name, abbr, usage, _SLIT("")); Array_string parsed = flag__FlagParser_parse_value(fs, name, abbr); if (parsed.len == 0) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string parsed0 = (*(string*)/*ee elem_sym */array_get(parsed, 0)); res = string_int(parsed0); @@ -30129,7 +30170,7 @@ Option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr flag__FlagParser_add_flag(fs, name, abbr, usage, _SLIT("")); Array_string parsed = flag__FlagParser_parse_value(fs, name, abbr); if (parsed.len == 0) { - return (Option_f64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_f64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } res = string_f64((*(string*)/*ee elem_sym */array_get(parsed, 0))); } @@ -30163,7 +30204,7 @@ Option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 flag__FlagParser_add_flag(fs, name, abbr, usage, _SLIT("")); Array_string parsed = flag__FlagParser_parse_value(fs, name, abbr); if (parsed.len == 0) { - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } res = (*(string*)/*ee elem_sym */array_get(parsed, 0)); } @@ -30187,7 +30228,7 @@ string flag__FlagParser_string(flag__FlagParser* fs, string name, u8 abbr, strin Option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, int n) { if (n > _const_flag__max_args_number) { - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args_to_at_least expect n to be smaller than "), 0xfe07, {.d_i32 = _const_flag__max_args_number}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args_to_at_least expect n to be smaller than "), /*100 &int literal*/0xfe07, {.d_i32 = _const_flag__max_args_number}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (n <= 0) { return (Option_void){ .state=2, .err=_v_error(_SLIT("flag.limit_free_args_to_at_least expect n to be a positive number")), .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -30198,7 +30239,7 @@ Option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, i Option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, int n) { if (n > _const_flag__max_args_number) { - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args_to_exactly expect n to be smaller than "), 0xfe07, {.d_i32 = _const_flag__max_args_number}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args_to_exactly expect n to be smaller than "), /*100 &int literal*/0xfe07, {.d_i32 = _const_flag__max_args_number}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (n < 0) { return (Option_void){ .state=2, .err=_v_error(_SLIT("flag.limit_free_args_to_exactly expect n to be a non negative number")), .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -30210,7 +30251,7 @@ Option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, in Option_void flag__FlagParser_limit_free_args(flag__FlagParser* fs, int min, int max) { if (min > max) { - return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args expect min < max, got "), 0xfe07, {.d_i32 = min}}, {_SLIT(" >= "), 0xfe07, {.d_i32 = max}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args expect min < max, got "), /*100 &int*/0xfe07, {.d_i32 = min}}, {_SLIT(" >= "), /*100 &int*/0xfe07, {.d_i32 = max}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } fs->min_free_args = min; fs->max_free_args = max; @@ -30231,24 +30272,24 @@ string flag__FlagParser_usage(flag__FlagParser* fs) { } Array_string use = __new_array_with_default(0, 0, sizeof(string), 0); if ((fs->application_version).len != 0) { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), 0xfe10, {.d_s = fs->application_version}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_flag__underline}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fs->application_version}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_flag__underline}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (fs->usage_examples.len == 0) { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Usage: "), 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" [options] "), 0xfe10, {.d_s = adesc}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Usage: "), /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" [options] "), /*115 &string*/0xfe10, {.d_s = adesc}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else { for (int i = 0; i < fs->usage_examples.len; ++i) { string example = ((string*)fs->usage_examples.data)[i]; if (i == 0) { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Usage: "), 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), 0xfe10, {.d_s = example}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Usage: "), /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = example}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" or: "), 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), 0xfe10, {.d_s = example}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" or: "), /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = example}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } } array_push((array*)&use, _MOV((string[]){ string_clone(_SLIT("")) })); if ((fs->application_description).len != 0) { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Description: "), 0xfe10, {.d_s = fs->application_description}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Description: "), /*115 &string*/0xfe10, {.d_s = fs->application_description}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); array_push((array*)&use, _MOV((string[]){ string_clone(_SLIT("")) })); } if (positive_min_arg || positive_max_arg || no_arguments) { @@ -30258,16 +30299,16 @@ string flag__FlagParser_usage(flag__FlagParser* fs) { } else { Array_string s = __new_array_with_default(0, 0, sizeof(string), 0); if (positive_min_arg) { - array_push((array*)&s, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("at least "), 0xfe07, {.d_i32 = fs->min_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&s, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("at least "), /*100 &int*/0xfe07, {.d_i32 = fs->min_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (positive_max_arg) { - array_push((array*)&s, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("at most "), 0xfe07, {.d_i32 = fs->max_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&s, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("at most "), /*100 &int*/0xfe07, {.d_i32 = fs->max_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (positive_min_arg && positive_max_arg && fs->min_free_args == fs->max_free_args) { - s = new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("exactly "), 0xfe07, {.d_i32 = fs->min_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))})); + s = new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("exactly "), /*100 &int*/0xfe07, {.d_i32 = fs->min_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))})); } string sargs = Array_string_join(s, _SLIT(" and ")); - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("The arguments should be "), 0xfe10, {.d_s = sargs}}, {_SLIT(" in number."), 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("The arguments should be "), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(" in number."), 0, { .d_c = 0 }}}))) })); array_push((array*)&use, _MOV((string[]){ string_clone(_SLIT("")) })); } } @@ -30277,23 +30318,23 @@ string flag__FlagParser_usage(flag__FlagParser* fs) { flag__Flag f = ((flag__Flag*)fs->flags.data)[_t16]; Array_string onames = __new_array_with_default(0, 0, sizeof(string), 0); if (f.abbr != 0) { - array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0xfe10, {.d_s = u8_ascii_str(f.abbr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*115 &string*/0xfe10, {.d_s = u8_ascii_str(f.abbr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((f.name).len != 0) { if (!string_contains(f.val_desc, _SLIT(""))) { - array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("--"), 0xfe10, {.d_s = f.name}}, {_SLIT(" "), 0xfe10, {.d_s = f.val_desc}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("--"), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = f.val_desc}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else { - array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), 0xfe10, {.d_s = f.name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } string option_names = string__plus(_SLIT(" "), Array_string_join(onames, _SLIT(", "))); string xspace = _SLIT(""); if (option_names.len > _const_flag__space.len - 2) { - xspace = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = _const_flag__space}}, {_SLIT0, 0, { .d_c = 0 }}})); + xspace = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = _const_flag__space}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { xspace = string_substr(_const_flag__space, option_names.len, (_const_flag__space).len); } - string fdesc = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = option_names}}, {_SLIT0, 0xfe10, {.d_s = xspace}}, {_SLIT0, 0xfe10, {.d_s = f.usage}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fdesc = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = option_names}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = xspace}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = f.usage}}, {_SLIT0, 0, { .d_c = 0 }}})); array_push((array*)&use, _MOV((string[]){ string_clone(fdesc) })); } } @@ -30340,7 +30381,7 @@ VV_LOCAL_SYMBOL void flag__FlagParser_handle_builtin_options(flag__FlagParser* f VUNREACHABLE(); } if (show_version) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), 0xfe10, {.d_s = fs->application_version}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fs->application_version}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(0); VUNREACHABLE(); } @@ -30514,7 +30555,7 @@ VV_LOCAL_SYMBOL bool semver__RawVersion_is_missing(semver__RawVersion ver, int t VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_coerce(semver__RawVersion raw_ver) { semver__RawVersion ver = semver__RawVersion_complete(raw_ver); if (!semver__is_valid_number((*(string*)/*ee elem_sym */array_get(ver.raw_ints, _const_semver__ver_major)))) { - return (Option_semver__Version){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid major version: "), 0xfe10, {.d_s = Array_string_str(ver.raw_ints)}}, {_SLIT("[ver_major]"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_semver__Version){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid major version: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(ver.raw_ints)}}, {_SLIT("[ver_major]"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_semver__Version _t2; opt_ok(&(semver__Version[]) { semver__RawVersion_to_version(ver) }, (Option*)(&_t2), sizeof(semver__Version)); @@ -30625,7 +30666,7 @@ VV_LOCAL_SYMBOL Option_semver__Range semver__parse_range(string input) { VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__parse_comparator_set(string input) { Array_string raw_comparators = string_split(input, _const_semver__comparator_sep); if (raw_comparators.len > 2) { - return (Option_semver__ComparatorSet){ .state=2, .err=/*&IError*/I_semver__InvalidComparatorFormatError_to_Interface_IError(((semver__InvalidComparatorFormatError*)memdup(&(semver__InvalidComparatorFormatError){.MessageError = ((MessageError){.msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid format of comparator set for input \""), 0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}})),.code = 0,}),}, sizeof(semver__InvalidComparatorFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_semver__ComparatorSet){ .state=2, .err=/*&IError*/I_semver__InvalidComparatorFormatError_to_Interface_IError(((semver__InvalidComparatorFormatError*)memdup(&(semver__InvalidComparatorFormatError){.MessageError = ((MessageError){.msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid format of comparator set for input \""), /*115 &string*/0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}})),.code = 0,}),}, sizeof(semver__InvalidComparatorFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Array_semver__Comparator comparators = __new_array_with_default(0, 0, sizeof(semver__Comparator), 0); for (int _t2 = 0; _t2 < raw_comparators.len; ++_t2) { @@ -30633,7 +30674,7 @@ VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__parse_comparator_set(string Option_semver__Comparator _t3 = semver__parse_comparator(raw_comp); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_semver__ComparatorSet){ .state=2, .err=/*&IError*/I_semver__InvalidComparatorFormatError_to_Interface_IError(((semver__InvalidComparatorFormatError*)memdup(&(semver__InvalidComparatorFormatError){.MessageError = ((MessageError){.msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Invalid comparator \""), 0xfe10, {.d_s = raw_comp}}, {_SLIT("\" in input \""), 0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}})),.code = 0,}),}, sizeof(semver__InvalidComparatorFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_semver__ComparatorSet){ .state=2, .err=/*&IError*/I_semver__InvalidComparatorFormatError_to_Interface_IError(((semver__InvalidComparatorFormatError*)memdup(&(semver__InvalidComparatorFormatError){.MessageError = ((MessageError){.msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Invalid comparator \""), /*115 &string*/0xfe10, {.d_s = raw_comp}}, {_SLIT("\" in input \""), /*115 &string*/0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}})),.code = 0,}),}, sizeof(semver__InvalidComparatorFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Comparator c = (*(semver__Comparator*)_t3.data); @@ -30848,7 +30889,7 @@ string semver__EmptyInputError_msg(semver__EmptyInputError err) { } string semver__InvalidVersionFormatError_msg(semver__InvalidVersionFormatError err) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid version format for input \""), 0xfe10, {.d_s = err.input}}, {_SLIT("\""), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid version format for input \""), /*115 &string*/0xfe10, {.d_s = err.input}}, {_SLIT("\""), 0, { .d_c = 0 }}})); return _t1; } @@ -30910,10 +30951,10 @@ bool semver__Version_le(semver__Version v1, semver__Version v2) { } string semver__Version_str(semver__Version ver) { - string common_string = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ver.major}}, {_SLIT("."), 0xfe07, {.d_i32 = ver.minor}}, {_SLIT("."), 0xfe07, {.d_i32 = ver.patch}}, {_SLIT0, 0, { .d_c = 0 }}})); - string prerelease_string = (ver.prerelease.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0xfe10, {.d_s = ver.prerelease}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); - string metadata_string = (ver.metadata.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), 0xfe10, {.d_s = ver.metadata}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = common_string}}, {_SLIT0, 0xfe10, {.d_s = prerelease_string}}, {_SLIT0, 0xfe10, {.d_s = metadata_string}}, {_SLIT0, 0, { .d_c = 0 }}})); + string common_string = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ver.major}}, {_SLIT("."), /*100 &int*/0xfe07, {.d_i32 = ver.minor}}, {_SLIT("."), /*100 &int*/0xfe07, {.d_i32 = ver.patch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string prerelease_string = (ver.prerelease.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*115 &string*/0xfe10, {.d_s = ver.prerelease}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); + string metadata_string = (ver.metadata.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), /*115 &string*/0xfe10, {.d_s = ver.metadata}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = common_string}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = prerelease_string}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = metadata_string}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -30940,7 +30981,7 @@ inline VV_LOCAL_SYMBOL Option_semver__Version semver__coerce_version(string inpu Option_semver__Version _t1 = semver__RawVersion_coerce(raw_ver); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__Version){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid version for input \""), 0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_semver__Version){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid version for input \""), /*115 &string*/0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version ver = (*(semver__Version*)_t1.data); @@ -31050,12 +31091,12 @@ i64 sync__stdatomic__load_i64(i64* ptr) { #if !defined(_WIN32) && !defined(__ANDROID__) #endif string term__format(string msg, string open, string close) { - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = open}}, {_SLIT("m"), 0xfe10, {.d_s = msg}}, {_SLIT("["), 0xfe10, {.d_s = close}}, {_SLIT("m"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = open}}, {_SLIT("m"), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = close}}, {_SLIT("m"), 0, { .d_c = 0 }}})); return _t1; } string term__format_rgb(int r, int g, int b, string msg, string open, string close) { - string _t1 = str_intp(7, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = open}}, {_SLIT(";2;"), 0xfe07, {.d_i32 = r}}, {_SLIT(";"), 0xfe07, {.d_i32 = g}}, {_SLIT(";"), 0xfe07, {.d_i32 = b}}, {_SLIT("m"), 0xfe10, {.d_s = msg}}, {_SLIT("["), 0xfe10, {.d_s = close}}, {_SLIT("m"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(7, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = open}}, {_SLIT(";2;"), /*100 &int*/0xfe07, {.d_i32 = r}}, {_SLIT(";"), /*100 &int*/0xfe07, {.d_i32 = g}}, {_SLIT(";"), /*100 &int*/0xfe07, {.d_i32 = b}}, {_SLIT("m"), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = close}}, {_SLIT("m"), 0, { .d_c = 0 }}})); return _t1; } @@ -31285,16 +31326,16 @@ string term__bright_bg_white(string msg) { } string term__highlight_command(string command) { - string _t1 = term__bright_white(term__bg_cyan( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = command}}, {_SLIT(" "), 0, { .d_c = 0 }}})))); + string _t1 = term__bright_white(term__bg_cyan( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = command}}, {_SLIT(" "), 0, { .d_c = 0 }}})))); return _t1; } void term__set_cursor_position(term__Coord c) { - print(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), 0xfe07, {.d_i32 = c.y}}, {_SLIT(";"), 0xfe07, {.d_i32 = c.x}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("H"))); + print(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = c.y}}, {_SLIT(";"), /*100 &int*/0xfe07, {.d_i32 = c.x}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("H"))); } void term__move(int n, string direction) { - print( str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), 0xfe07, {.d_i32 = n}}, {_SLIT0, 0xfe10, {.d_s = direction}}, {_SLIT0, 0, { .d_c = 0 }}}))); + print( str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = direction}}, {_SLIT0, 0, { .d_c = 0 }}}))); } void term__cursor_up(int n) { @@ -31382,7 +31423,7 @@ string term__failed(string s) { string term__ok_message(string s) { if (term__can_show_color_on_stdout()) { - string _t1 = term__green( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + string _t1 = term__green( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); return _t1; } string _t2 = s; @@ -31390,13 +31431,13 @@ string term__ok_message(string s) { } string term__fail_message(string s) { - string _t1 = term__failed( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + string _t1 = term__failed( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); return _t1; } string term__warn_message(string s) { if (term__can_show_color_on_stdout()) { - string _t1 = term__bright_yellow( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + string _t1 = term__bright_yellow( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); return _t1; } string _t2 = s; @@ -31485,7 +31526,7 @@ string term__header_left(string text, string divider) { string hstart = string_substr(string_repeat(relement, 4), 0, 4); int remaining_cols = term__imax(0, (cols - (hstart.len + 1 + plain_text.len + 1))); string hend = string_substr(string_repeat(relement, (remaining_cols + 1) / relement.len), 0, remaining_cols); - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = hstart}}, {_SLIT(" "), 0xfe10, {.d_s = text}}, {_SLIT(" "), 0xfe10, {.d_s = hend}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = hstart}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = text}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = hend}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -31747,17 +31788,17 @@ string v__util__version__full_hash(void) { string _t1 = build_hash; return _t1; } - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = build_hash}}, {_SLIT("."), 0xfe10, {.d_s = current_hash}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = build_hash}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = current_hash}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } string v__util__version__full_v_version(bool is_verbose) { if (is_verbose) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("V "), 0xfe10, {.d_s = _const_v__util__version__v_version}}, {_SLIT(" "), 0xfe10, {.d_s = v__util__version__full_hash()}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("V "), /*115 &string*/0xfe10, {.d_s = _const_v__util__version__v_version}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__util__version__full_hash()}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string hash = v__util__version__githash(false); - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("V "), 0xfe10, {.d_s = _const_v__util__version__v_version}}, {_SLIT(" "), 0xfe10, {.d_s = hash}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("V "), /*115 &string*/0xfe10, {.d_s = _const_v__util__version__v_version}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = hash}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } @@ -32109,7 +32150,7 @@ VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content( Array_string vals = __new_array_with_default(0, 0, sizeof(string), 0); int idx = st_idx; if ((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx)).typ != v__vmod__TokenKind__labr) { - return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" not a valid array, at line "), 0xfe07, {.d_i32 = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx)).line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" not a valid array, at line "), /*100 &int*/0xfe07, {.d_i32 = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx)).line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } idx++; for (;;) { @@ -32118,7 +32159,7 @@ VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content( if (tok.typ == (v__vmod__TokenKind__str)) { array_push((array*)&vals, _MOV((string[]){ string_clone(tok.val) })); if (!((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).typ == v__vmod__TokenKind__comma || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).typ == v__vmod__TokenKind__rabr)) { - return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid separator \""), 0xfe10, {.d_s = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).val}}, {_SLIT("\", at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid separator \""), /*115 &string*/0xfe10, {.d_s = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).val}}, {_SLIT("\", at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } idx += ((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).typ == v__vmod__TokenKind__comma ? (2) : (1)); } @@ -32127,7 +32168,7 @@ VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content( break; } else { - return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid token \""), 0xfe10, {.d_s = tok.val}}, {_SLIT("\", at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid token \""), /*115 &string*/0xfe10, {.d_s = tok.val}}, {_SLIT("\", at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; } Option_multi_return_Array_string_int _t5; @@ -32137,13 +32178,13 @@ VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content( VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* p) { if (p->scanner.text.len == 0) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" no content."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" no content."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__vmod__Scanner_scan_all(&p->scanner); Array_v__vmod__Token tokens = p->scanner.tokens; v__vmod__Manifest mn = ((v__vmod__Manifest){.name = (string){.str=(byteptr)"", .is_lit=1},.version = (string){.str=(byteptr)"", .is_lit=1},.description = (string){.str=(byteptr)"", .is_lit=1},.dependencies = __new_array(0, 0, sizeof(string)),.license = (string){.str=(byteptr)"", .is_lit=1},.repo_url = (string){.str=(byteptr)"", .is_lit=1},.author = (string){.str=(byteptr)"", .is_lit=1},.unknown = new_map(sizeof(string), sizeof(Array_string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}); if ((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, 0)).typ != v__vmod__TokenKind__module_keyword) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" v.mod files should start with Module, at line "), 0xfe07, {.d_i32 = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, 0)).line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" v.mod files should start with Module, at line "), /*100 &int*/0xfe07, {.d_i32 = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, 0)).line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int i = 1; for (;;) { @@ -32152,7 +32193,7 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* if (tok.typ == (v__vmod__TokenKind__lcbr)) { if (!((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__field_key || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__rcbr)) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid content after opening brace, at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid content after opening brace, at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } i++; continue; @@ -32163,7 +32204,7 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* else if (tok.typ == (v__vmod__TokenKind__field_key)) { string field_name = string_trim_right(tok.val, _SLIT(":")); if (!((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__str || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__labr)) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" value of field \""), 0xfe10, {.d_s = field_name}}, {_SLIT("\" must be either string or an array of strings, at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" value of field \""), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("\" must be either string or an array of strings, at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string field_value = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).val; @@ -32223,13 +32264,13 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* } else if (tok.typ == (v__vmod__TokenKind__comma)) { if (!((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i - 1)).typ == v__vmod__TokenKind__str || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i - 1)).typ == v__vmod__TokenKind__rabr) || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ != v__vmod__TokenKind__field_key) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid comma placement, at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid comma placement, at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } i++; continue; } else { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid token \""), 0xfe10, {.d_s = tok.val}}, {_SLIT("\", at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid token \""), /*115 &string*/0xfe10, {.d_s = tok.val}}, {_SLIT("\", at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; } Option_v__vmod__Manifest _t11; @@ -32260,7 +32301,7 @@ void v__vmod__ModFileCacher_debug(v__vmod__ModFileCacher* mcache) { string k = /*key*/ *(string*)DenseArray_key(&_t1.key_values, _t2); k = string_clone(k); v__vmod__ModFileAndFolder v = (*(v__vmod__ModFileAndFolder*)DenseArray_value(&_t1.key_values, _t2)); - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(" K: "), 0x40fe10, {.d_s = k}}, {_SLIT(" | V: \""), 0x40fe30, {.d_s = v.vmod_file}}, {_SLIT("\" | \""), 0x40fe30, {.d_s = v.vmod_folder}}, {_SLIT("\" "), 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(" K: "), /*115 &string*/0x40fe10, {.d_s = k}}, {_SLIT(" | V: \""), /*115 &string*/0x40fe30, {.d_s = v.vmod_file}}, {_SLIT("\" | \""), /*115 &string*/0x40fe30, {.d_s = v.vmod_folder}}, {_SLIT("\" "), 0, { .d_c = 0 }}}))); } eprintln(_SLIT("\011 ModFileCacher.folder_files:")); Map_string_Array_string _t5 = mcache->folder_files; @@ -32276,7 +32317,7 @@ void v__vmod__ModFileCacher_debug(v__vmod__ModFileCacher* mcache) { string k = /*key*/ *(string*)DenseArray_key(&_t5.key_values, _t6); k = string_clone(k); Array_string v = (*(Array_string*)DenseArray_value(&_t5.key_values, _t6)); - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" K: "), 0x40fe10, {.d_s = k}}, {_SLIT(" | V: "), 0xfe10, {.d_s = Array_string_str(v)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" K: "), /*115 &string*/0x40fe10, {.d_s = k}}, {_SLIT(" | V: "), /*115 &string*/0xfe10, {.d_s = Array_string_str(v)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } #endif @@ -32404,7 +32445,7 @@ void v__util__recompilation__must_be_enabled(string vroot, string error_message) string file = v__util__recompilation__disabling_file(vroot); bool is_recompilation_disabled = os__exists(file); if (is_recompilation_disabled) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Recompilation is disabled, since there is a \""), 0xfe10, {.d_s = file}}, {_SLIT("\" file present."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Recompilation is disabled, since there is a \""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\" file present."), 0, { .d_c = 0 }}}))); eprintln(error_message); _v_exit(1); VUNREACHABLE(); @@ -32458,7 +32499,7 @@ Array_string v__depgraph__OrderedDepMap_get(v__depgraph__OrderedDepMap* o, strin void v__depgraph__OrderedDepMap_delete(v__depgraph__OrderedDepMap* o, string name) { if (!_IN_MAP(ADDR(string, name), ADDR(map, o->data))) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("delete: no such key: "), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("delete: no such key: "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } for (int i = 0; i < o->keys.len; ++i) { @@ -32554,7 +32595,7 @@ string v__depgraph__DepGraph_display(v__depgraph__DepGraph* graph) { v__depgraph__DepGraphNode node = ((v__depgraph__DepGraphNode*)graph->nodes.data)[_t1]; for (int _t2 = 0; _t2 < node.deps.len; ++_t2) { string dep = ((string*)node.deps.data)[_t2]; - array_push((array*)&out, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" * "), 0xfe10, {.d_s = node.name}}, {_SLIT(" -> "), 0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&out, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" * "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT(" -> "), /*115 &string*/0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } string _t4 = Array_string_join(out, _SLIT("\n")); @@ -32631,7 +32672,7 @@ VV_LOCAL_SYMBOL multi_return_bool_Array_string v__depgraph__NodeNames_is_part_of } void v__depgraph__show(v__depgraph__DepGraph* graph, string path) { - v__dotgraph__DotGraph* dg = v__dotgraph__new(_SLIT("ModGraph"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("ModGraph for "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("blue")); + v__dotgraph__DotGraph* dg = v__dotgraph__new(_SLIT("ModGraph"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("ModGraph for "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("blue")); string mbuiltin = _SLIT("builtin"); for (int _t1 = 0; _t1 < graph->nodes.len; ++_t1) { v__depgraph__DepGraphNode node = ((v__depgraph__DepGraphNode*)graph->nodes.data)[_t1]; @@ -32650,7 +32691,7 @@ void v__depgraph__show(v__depgraph__DepGraph* graph, string path) { } string v__cflag__CFlag_str(v__cflag__CFlag* c) { - string _t1 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("CFlag{ name: \""), 0xfe10, {.d_s = c->name}}, {_SLIT("\" value: \""), 0xfe10, {.d_s = c->value}}, {_SLIT("\" mod: \""), 0xfe10, {.d_s = c->mod}}, {_SLIT("\" os: \""), 0xfe10, {.d_s = c->os}}, {_SLIT("\" cached: \""), 0xfe10, {.d_s = c->cached}}, {_SLIT("\" }"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("CFlag{ name: \""), /*115 &string*/0xfe10, {.d_s = c->name}}, {_SLIT("\" value: \""), /*115 &string*/0xfe10, {.d_s = c->value}}, {_SLIT("\" mod: \""), /*115 &string*/0xfe10, {.d_s = c->mod}}, {_SLIT("\" os: \""), /*115 &string*/0xfe10, {.d_s = c->os}}, {_SLIT("\" cached: \""), /*115 &string*/0xfe10, {.d_s = c->cached}}, {_SLIT("\" }"), 0, { .d_c = 0 }}})); return _t1; } @@ -32682,7 +32723,7 @@ string v__cflag__CFlag_eval(v__cflag__CFlag* cf) { goto cflag_eval_outer_loop__continue; } } - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> error: none of the paths "), 0xfe10, {.d_s = Array_string_str(svalues)}}, {_SLIT(" exist"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> error: none of the paths "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(svalues)}}, {_SLIT(" exist"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); continue; } @@ -32703,13 +32744,13 @@ string v__cflag__CFlag_format(v__cflag__CFlag* cf) { value = v__cflag__CFlag_eval(cf); } if ((string__eq(cf->name, _SLIT("-l")) || string__eq(cf->name, _SLIT("-Wa")) || string__eq(cf->name, _SLIT("-Wl")) || string__eq(cf->name, _SLIT("-Wp"))) && value.len > 0) { - string _t1 = string_trim_space( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cf->name}}, {_SLIT0, 0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string _t1 = string_trim_space( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cf->name}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t1; } if (string__eq(cf->name, _SLIT("-I")) || string__eq(cf->name, _SLIT("-L")) || string_ends_with(value, _SLIT(".o"))) { value = string__plus(string__plus(_SLIT("\""), os__real_path(value)), _SLIT("\"")); } - string _t2 = string_trim_space( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cf->name}}, {_SLIT(" "), 0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string _t2 = string_trim_space( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cf->name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t2; } @@ -33976,7 +34017,7 @@ inline f64 math__degrees(f64 radians) { Array_int math__digits(i64 num, math__DigitParams params) { int b = params.base; if (b < 2) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("digits: Cannot find digits of n with base "), 0xfe07, {.d_i32 = b}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("digits: Cannot find digits of n with base "), /*100 &int*/0xfe07, {.d_i32 = b}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } i64 n = num; @@ -34841,7 +34882,7 @@ Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { string d = (*(string*)_t2.data); string pad = strings__repeat(' ', 20 - mod.len); - m->res = /*f*/string__plus(m->res, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod}}, {_SLIT(" "), 0xfe10, {.d_s = pad}}, {_SLIT(" "), 0xfe10, {.d_s = d}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + m->res = /*f*/string__plus(m->res, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = pad}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = d}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); } } else { m->res = Array_string_join(modules, _SLIT("\n")); @@ -34965,14 +35006,14 @@ VV_LOCAL_SYMBOL string v__pkgconfig__filter(Array_string libs, string prefix, st for (int _t1 = 0; _t1 < libs.len; ++_t1) { string lib = ((string*)libs.data)[_t1]; if (!string_starts_with(lib, prefix) && !string_starts_with(lib, prefix2)) { - res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = lib}}, {_SLIT0, 0, { .d_c = 0 }}}))); + res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = lib}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } else { for (int _t2 = 0; _t2 < libs.len; ++_t2) { string lib = ((string*)libs.data)[_t2]; if (string_starts_with(lib, prefix)) { - res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = lib}}, {_SLIT0, 0, { .d_c = 0 }}}))); + res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = lib}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -35051,7 +35092,7 @@ VV_LOCAL_SYMBOL string v__pkgconfig__PkgConfig_parse_line(v__pkgconfig__PkgConfi int tok1 = (*(int*)_t2.data); tok1 += tok0; string v = string_substr(r, tok0 + 2, tok1); - r = string_replace(r, str_intp(2, _MOV((StrIntpData[]){{_SLIT("${"), 0xfe10, {.d_s = v}}, {_SLIT("}"), 0, { .d_c = 0 }}})), (*(string*)map_get(ADDR(map, pc->vars), &(string[]){v}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} }))); + r = string_replace(r, str_intp(2, _MOV((StrIntpData[]){{_SLIT("${"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("}"), 0, { .d_c = 0 }}})), (*(string*)map_get(ADDR(map, pc->vars), &(string[]){v}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} }))); } string _t3 = string_trim_space(r); return _t3; @@ -35136,7 +35177,7 @@ VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgC } for (int _t3 = 0; _t3 < pc->paths.len; ++_t3) { string path = ((string*)pc->paths.data)[_t3]; - string file = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path}}, {_SLIT("/"), 0xfe10, {.d_s = pkgname}}, {_SLIT(".pc"), 0, { .d_c = 0 }}})); + string file = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = pkgname}}, {_SLIT(".pc"), 0, { .d_c = 0 }}})); if (os__exists(file)) { Option_string _t4; opt_ok(&(string[]) { file }, (Option*)(&_t4), sizeof(string)); @@ -35144,7 +35185,7 @@ VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgC } } } - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Cannot find \""), 0xfe10, {.d_s = pkgname}}, {_SLIT("\" pkgconfig file"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Cannot find \""), /*115 &string*/0xfe10, {.d_s = pkgname}}, {_SLIT("\" pkgconfig file"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__pkgconfig__atleast(string v) { @@ -35243,14 +35284,14 @@ VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__P if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (pc->options.debug) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot resolve "), 0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot resolve "), /*115 &string*/0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not resolve dependency "), 0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not resolve dependency "), /*115 &string*/0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string depfile = (*(string*)_t1.data); if (!v__pkgconfig__PkgConfig_parse(&pcdep, depfile)) { - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("required file \""), 0xfe10, {.d_s = depfile}}, {_SLIT("\" could not be parsed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("required file \""), /*115 &string*/0xfe10, {.d_s = depfile}}, {_SLIT("\" could not be parsed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_void _t4 = v__pkgconfig__PkgConfig_load_requires(&pcdep); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { @@ -35314,7 +35355,7 @@ Option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconf string file = (*(string*)_t1.data); if (!v__pkgconfig__PkgConfig_parse(pc, file)) { - return (Option_v__pkgconfig__PkgConfig_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("file \""), 0xfe10, {.d_s = file}}, {_SLIT("\" could not be parsed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__pkgconfig__PkgConfig_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("file \""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\" could not be parsed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!options.norecurse) { Option_void _t4 = v__pkgconfig__PkgConfig_load_requires(pc); @@ -35499,25 +35540,25 @@ string time__Time_md(time__Time t) { VV_LOCAL_SYMBOL string time__ordinal_suffix(int n) { if (n > 3 && n < 21) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("th"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("th"), 0, { .d_c = 0 }}})); return _t1; } int _t2 = n % 10; if (_t2 == (1)) { - string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("st"), 0, { .d_c = 0 }}})); + string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("st"), 0, { .d_c = 0 }}})); return _t3; } else if (_t2 == (2)) { - string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("nd"), 0, { .d_c = 0 }}})); + string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("nd"), 0, { .d_c = 0 }}})); return _t4; } else if (_t2 == (3)) { - string _t5 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("rd"), 0, { .d_c = 0 }}})); + string _t5 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("rd"), 0, { .d_c = 0 }}})); return _t5; } else { - string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("th"), 0, { .d_c = 0 }}})); + string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("th"), 0, { .d_c = 0 }}})); return _t6; }; return (string){.str=(byteptr)"", .is_lit=1}; @@ -35546,7 +35587,7 @@ string time__Time_custom_format(time__Time t, string s) { strings__Builder_write_string(&sb, int_str(t.month)); } else if (string__eq(token, _SLIT("MM"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.month}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("Mo"))) { strings__Builder_write_string(&sb, time__ordinal_suffix(t.month)); @@ -35561,7 +35602,7 @@ string time__Time_custom_format(time__Time t, string s) { strings__Builder_write_string(&sb, int_str(t.day)); } else if (string__eq(token, _SLIT("DD"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("Do"))) { strings__Builder_write_string(&sb, time__ordinal_suffix(t.day)); @@ -35570,7 +35611,7 @@ string time__Time_custom_format(time__Time t, string s) { strings__Builder_write_string(&sb, int_str((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]))); } else if (string__eq(token, _SLIT("DDDD"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8006fe27, {.d_i32 = t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8006fe27, {.d_i32 = t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("DDDo"))) { strings__Builder_write_string(&sb, time__ordinal_suffix(t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0])); @@ -35597,52 +35638,52 @@ string time__Time_custom_format(time__Time t, string s) { strings__Builder_write_string(&sb, int_str(t.hour)); } else if (string__eq(token, _SLIT("HH"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("h"))) { strings__Builder_write_string(&sb, int_str((t.hour % 12))); } else if (string__eq(token, _SLIT("hh"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = (t.hour % 12)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = (t.hour % 12)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("m"))) { strings__Builder_write_string(&sb, int_str(t.minute)); } else if (string__eq(token, _SLIT("mm"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("s"))) { strings__Builder_write_string(&sb, int_str(t.second)); } else if (string__eq(token, _SLIT("ss"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.second}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("k"))) { strings__Builder_write_string(&sb, int_str((t.hour + 1))); } else if (string__eq(token, _SLIT("kk"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = (t.hour + 1)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = (t.hour + 1)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("w"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x1000f, {.d_f64 = math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*103 &f64*/0x1000f, {.d_f64 = math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("ww"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8005002f, {.d_f64 = math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*103 &f64*/0x8005002f, {.d_f64 = math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("wo"))) { strings__Builder_write_string(&sb, time__ordinal_suffix(((int)(math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7))))); } else if (string__eq(token, _SLIT("Q"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = (t.month % 4) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = (t.month % 4) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("QQ"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = (t.month % 4) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = (t.month % 4) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("Qo"))) { strings__Builder_write_string(&sb, time__ordinal_suffix((t.month % 4) + 1)); } else if (string__eq(token, _SLIT("c"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = time__Time_day_of_week(&t) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = time__Time_day_of_week(&t) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("N"))) { strings__Builder_write_string(&sb, _SLIT("AD")); @@ -35653,28 +35694,28 @@ string time__Time_custom_format(time__Time t, string s) { else if (string__eq(token, _SLIT("Z"))) { int hours = time__offset() / _const_time__seconds_per_hour; if (hours >= 0) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), 0xfe07, {.d_i32 = hours}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), /*100 &int*/0xfe07, {.d_i32 = hours}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { hours = -hours; - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0xfe07, {.d_i32 = hours}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*100 &int*/0xfe07, {.d_i32 = hours}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } else if (string__eq(token, _SLIT("ZZ"))) { int hours = time__offset() / _const_time__seconds_per_hour; if (hours >= 0) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), 0x8004fe27, {.d_i32 = hours}}, {_SLIT("00"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), /*100 &int*/0x8004fe27, {.d_i32 = hours}}, {_SLIT("00"), 0, { .d_c = 0 }}}))); } else { hours = -hours; - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0x8004fe27, {.d_i32 = hours}}, {_SLIT("00"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*100 &int*/0x8004fe27, {.d_i32 = hours}}, {_SLIT("00"), 0, { .d_c = 0 }}}))); } } else if (string__eq(token, _SLIT("ZZZ"))) { int hours = time__offset() / _const_time__seconds_per_hour; if (hours >= 0) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), 0x8004fe27, {.d_i32 = hours}}, {_SLIT(":00"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), /*100 &int*/0x8004fe27, {.d_i32 = hours}}, {_SLIT(":00"), 0, { .d_c = 0 }}}))); } else { hours = -hours; - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0x8004fe27, {.d_i32 = hours}}, {_SLIT(":00"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*100 &int*/0x8004fe27, {.d_i32 = hours}}, {_SLIT(":00"), 0, { .d_c = 0 }}}))); } } else if (string__eq(token, _SLIT("a"))) { @@ -35738,38 +35779,38 @@ string time__Time_get_fmt_time_str(time__Time t, time__FormatTime fmt_time) { switch (fmt_time) { case time__FormatTime__hhmm12: { - _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = hour_}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(" "), 0xfe10, {.d_s = tp}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = hour_}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tp}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmm24: { - _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmmss12: { - _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = hour_}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT(" "), 0xfe10, {.d_s = tp}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = hour_}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tp}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmmss24: { - _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmmss24_milli: { - _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT("."), 0x8006fe27, {.d_i32 = (t.microsecond / 1000)}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT("."), /*100 &int*/0x8006fe27, {.d_i32 = (t.microsecond / 1000)}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmmss24_micro: { - _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT("."), 0x800cfe27, {.d_i32 = t.microsecond}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT("."), /*100 &int*/0x800cfe27, {.d_i32 = t.microsecond}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__no_time: default: { - _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enumeration "), 0xfe10, {.d_s = time__FormatTime_str(fmt_time)}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enumeration "), /*115 &time.FormatTime*/0xfe10, {.d_s = time__FormatTime_str(fmt_time)}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } } @@ -35783,63 +35824,63 @@ string time__Time_get_fmt_date_str(time__Time t, time__FormatDelimiter fmt_dlmtr return _t1; } string month = time__Time_smonth(&t); - string year = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = (t.year % 100)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string year = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = (t.year % 100)}}, {_SLIT0, 0, { .d_c = 0 }}})); string _t2 = (string){.str=(byteptr)"", .is_lit=1}; switch (fmt_date) { case time__FormatDate__ddmmyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*115 &string*/0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__ddmmyyyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmddyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*115 &string*/0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmddyyyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*100 &int*/0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmmd: { - _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = month}}, {_SLIT("|"), 0xfe07, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = month}}, {_SLIT("|"), /*100 &int*/0xfe07, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmmdd: { - _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmmddyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*115 &string*/0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmmddyyyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*100 &int*/0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__yyyymmdd: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8008fe27, {.d_i32 = t.year}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8008fe27, {.d_i32 = t.year}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__yymmdd: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = year}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = year}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__no_date: default: { - _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enumeration "), 0xfe10, {.d_s = time__FormatDate_str(fmt_date)}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enumeration "), /*115 &time.FormatDate*/0xfe10, {.d_s = time__FormatDate_str(fmt_date)}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } } @@ -35863,7 +35904,7 @@ string time__Time_get_fmt_str(time__Time t, time__FormatDelimiter fmt_dlmtr, tim if (fmt_time != time__FormatTime__no_time) { string dstr = time__Time_get_fmt_date_str(t, fmt_dlmtr, fmt_date); string tstr = time__Time_get_fmt_time_str(t, fmt_time); - string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dstr}}, {_SLIT(" "), 0xfe10, {.d_s = tstr}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dstr}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tstr}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } else { string _t4 = time__Time_get_fmt_date_str(t, fmt_dlmtr, fmt_date); @@ -35876,7 +35917,7 @@ string time__Time_get_fmt_str(time__Time t, time__FormatDelimiter fmt_dlmtr, tim string time__Time_utc_string(time__Time t) { string day_str = time__Time_weekday_str(&t); string month_str = time__Time_smonth(&t); - string utc_string = str_intp(8, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = day_str}}, {_SLIT(", "), 0xfe07, {.d_i32 = t.day}}, {_SLIT(" "), 0xfe10, {.d_s = month_str}}, {_SLIT(" "), 0xfe07, {.d_i32 = t.year}}, {_SLIT(" "), 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT(" UTC"), 0, { .d_c = 0 }}})); + string utc_string = str_intp(8, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = day_str}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = t.day}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = month_str}}, {_SLIT(" "), /*100 &int*/0xfe07, {.d_i32 = t.year}}, {_SLIT(" "), /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT(" UTC"), 0, { .d_c = 0 }}})); string _t1 = utc_string; return _t1; } @@ -36209,7 +36250,7 @@ VV_LOCAL_SYMBOL Option_multi_return_int_int_int_int_i64_bool time__parse_iso8601 } string time__TimeParseError_msg(time__TimeParseError err) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid time format code: "), 0xfe07, {.d_i32 = err.code}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid time format code: "), /*100 &int*/0xfe07, {.d_i32 = err.code}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -36467,7 +36508,7 @@ string time__Time_relative(time__Time* t) { string _t3 = _SLIT("1 minute ago"); return _t3; } - string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = m}}, {_SLIT(" minutes ago"), 0, { .d_c = 0 }}})); + string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = m}}, {_SLIT(" minutes ago"), 0, { .d_c = 0 }}})); return _t4; } if (secs < 86400) { @@ -36476,7 +36517,7 @@ string time__Time_relative(time__Time* t) { string _t5 = _SLIT("1 hour ago"); return _t5; } - string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = h}}, {_SLIT(" hours ago"), 0, { .d_c = 0 }}})); + string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = h}}, {_SLIT(" hours ago"), 0, { .d_c = 0 }}})); return _t6; } if (secs < 432000) { @@ -36485,7 +36526,7 @@ string time__Time_relative(time__Time* t) { string _t7 = _SLIT("1 day ago"); return _t7; } - string _t8 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = d}}, {_SLIT(" days ago"), 0, { .d_c = 0 }}})); + string _t8 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = d}}, {_SLIT(" days ago"), 0, { .d_c = 0 }}})); return _t8; } if (secs > 864000000) { @@ -36508,15 +36549,15 @@ string time__Time_relative_short(time__Time* t) { return _t2; } if (secs < 3600) { - string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = secs / 60}}, {_SLIT("m"), 0, { .d_c = 0 }}})); + string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = secs / 60}}, {_SLIT("m"), 0, { .d_c = 0 }}})); return _t3; } if (secs < 86400) { - string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = secs / 3600}}, {_SLIT("h"), 0, { .d_c = 0 }}})); + string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = secs / 3600}}, {_SLIT("h"), 0, { .d_c = 0 }}})); return _t4; } if (secs < 432000) { - string _t5 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = secs / 3600 / 24}}, {_SLIT("d"), 0, { .d_c = 0 }}})); + string _t5 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = secs / 3600 / 24}}, {_SLIT("d"), 0, { .d_c = 0 }}})); return _t5; } if (secs > 864000000) { @@ -36563,7 +36604,7 @@ bool time__is_leap_year(int year) { Option_int time__days_in_month(int month, int year) { if (month > 12 || month < 1) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid month: "), 0xfe07, {.d_i32 = month}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid month: "), /*100 &int*/0xfe07, {.d_i32 = month}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int extra = (month == 2 && time__is_leap_year(year) ? (1) : (0)); int res = (*(int*)/*ee elem_sym */array_get(_const_time__month_days, month - 1)) + extra; @@ -36573,7 +36614,7 @@ Option_int time__days_in_month(int month, int year) { } string time__Time_debug(time__Time* t) { - string _t1 = str_intp(9, _MOV((StrIntpData[]){{_SLIT("Time{ year: "), 0x8008fe27, {.d_i32 = t->year}}, {_SLIT(" month: "), 0x8004fe27, {.d_i32 = t->month}}, {_SLIT(" day: "), 0x8004fe27, {.d_i32 = t->day}}, {_SLIT(" hour: "), 0x8004fe27, {.d_i32 = t->hour}}, {_SLIT(" minute: "), 0x8004fe27, {.d_i32 = t->minute}}, {_SLIT(" second: "), 0x8004fe27, {.d_i32 = t->second}}, {_SLIT(" microsecond: "), 0x800cfe27, {.d_i32 = t->microsecond}}, {_SLIT(" unix: "), 0x800efe29, {.d_i64 = t->_v_unix}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(9, _MOV((StrIntpData[]){{_SLIT("Time{ year: "), /*100 &int*/0x8008fe27, {.d_i32 = t->year}}, {_SLIT(" month: "), /*100 &int*/0x8004fe27, {.d_i32 = t->month}}, {_SLIT(" day: "), /*100 &int*/0x8004fe27, {.d_i32 = t->day}}, {_SLIT(" hour: "), /*100 &int*/0x8004fe27, {.d_i32 = t->hour}}, {_SLIT(" minute: "), /*100 &int*/0x8004fe27, {.d_i32 = t->minute}}, {_SLIT(" second: "), /*100 &int*/0x8004fe27, {.d_i32 = t->second}}, {_SLIT(" microsecond: "), /*100 &int*/0x800cfe27, {.d_i32 = t->microsecond}}, {_SLIT(" unix: "), /*100 &i64*/0x800efe29, {.d_i64 = t->_v_unix}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); return _t1; } @@ -36632,26 +36673,26 @@ string time__Duration_str(time__Duration d) { t -= us * _const_time__microsecond; i64 ns = t; if (hr > 0) { - string _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = hr}}, {_SLIT(":"), 0x8004fe29, {.d_i64 = min}}, {_SLIT(":"), 0x8004fe29, {.d_i64 = sec}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = hr}}, {_SLIT(":"), /*100 &i64*/0x8004fe29, {.d_i64 = min}}, {_SLIT(":"), /*100 &i64*/0x8004fe29, {.d_i64 = sec}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } if (min > 0) { - string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = min}}, {_SLIT(":"), 0x8004fe29, {.d_i64 = sec}}, {_SLIT("."), 0x8006fe29, {.d_i64 = ms}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = min}}, {_SLIT(":"), /*100 &i64*/0x8004fe29, {.d_i64 = sec}}, {_SLIT("."), /*100 &i64*/0x8006fe29, {.d_i64 = ms}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } if (sec > 0) { - string _t4 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = sec}}, {_SLIT("."), 0x8006fe29, {.d_i64 = ms}}, {_SLIT("s"), 0, { .d_c = 0 }}})); + string _t4 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = sec}}, {_SLIT("."), /*100 &i64*/0x8006fe29, {.d_i64 = ms}}, {_SLIT("s"), 0, { .d_c = 0 }}})); return _t4; } if (ms > 0) { - string _t5 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = ms}}, {_SLIT("."), 0x8006fe29, {.d_i64 = us}}, {_SLIT("ms"), 0, { .d_c = 0 }}})); + string _t5 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = ms}}, {_SLIT("."), /*100 &i64*/0x8006fe29, {.d_i64 = us}}, {_SLIT("ms"), 0, { .d_c = 0 }}})); return _t5; } if (us > 0) { - string _t6 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = us}}, {_SLIT("."), 0x8006fe29, {.d_i64 = ns}}, {_SLIT("us"), 0, { .d_c = 0 }}})); + string _t6 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = us}}, {_SLIT("."), /*100 &i64*/0x8006fe29, {.d_i64 = ns}}, {_SLIT("us"), 0, { .d_c = 0 }}})); return _t6; } - string _t7 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = ns}}, {_SLIT("ns"), 0, { .d_c = 0 }}})); + string _t7 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = ns}}, {_SLIT("ns"), 0, { .d_c = 0 }}})); return _t7; } @@ -36931,7 +36972,7 @@ Option_string v__util__diff__find_working_diff_command(void) { string env_diffopts = os__getenv(_SLIT("VDIFF_OPTIONS")); if ((env_difftool).len != 0) { Option_string _t1; - opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = env_difftool}}, {_SLIT(" "), 0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t1), sizeof(string)); + opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = env_difftool}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t1), sizeof(string)); return _t1; } Array_string known_diff_tools = __new_array_with_default(0, 0, sizeof(string), 0); @@ -36949,21 +36990,21 @@ Option_string v__util__diff__find_working_diff_command(void) { } continue; } - os__Result p = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = diffcmd}}, {_SLIT(" --version"), 0, { .d_c = 0 }}}))); + os__Result p = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" --version"), 0, { .d_c = 0 }}}))); if (p.exit_code < 0) { continue; } if (p.exit_code == 127 && string__eq(diffcmd, env_difftool)) { - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not find specified VDIFF_TOOL "), 0xfe10, {.d_s = diffcmd}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not find specified VDIFF_TOOL "), /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (p.exit_code == 0) { if (string__eq(diffcmd, _SLIT("code")) || string__eq(diffcmd, _SLIT("code.cmd"))) { Option_string _t7; - opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), 0xfe10, {.d_s = env_diffopts}}, {_SLIT(" -d"), 0, { .d_c = 0 }}})) }, (Option*)(&_t7), sizeof(string)); + opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT(" -d"), 0, { .d_c = 0 }}})) }, (Option*)(&_t7), sizeof(string)); return _t7; } Option_string _t8; - opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), 0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t8), sizeof(string)); + opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t8), sizeof(string)); return _t8; } } @@ -36988,10 +37029,10 @@ VV_LOCAL_SYMBOL bool v__util__diff__opendiff_exists(void) { string v__util__diff__color_compare_files(string diff_cmd, string file1, string file2) { if ((diff_cmd).len != 0) { - string full_cmd = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = diff_cmd}}, {_SLIT(" --minimal --text --unified=2 --show-function-line=\"fn \" "), 0xfe10, {.d_s = os__quoted_path(file1)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(file2)}}, {_SLIT(" "), 0, { .d_c = 0 }}})); + string full_cmd = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = diff_cmd}}, {_SLIT(" --minimal --text --unified=2 --show-function-line=\"fn \" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(file1)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(file2)}}, {_SLIT(" "), 0, { .d_c = 0 }}})); os__Result x = os__execute(full_cmd); if (x.exit_code < 0) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("comparison command: `"), 0xfe10, {.d_s = full_cmd}}, {_SLIT("` not found"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("comparison command: `"), /*115 &string*/0xfe10, {.d_s = full_cmd}}, {_SLIT("` not found"), 0, { .d_c = 0 }}})); return _t1; } string _t2 = string_trim_right(x.output, _SLIT("\r\n")); @@ -37010,8 +37051,8 @@ string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefi (*(bool*)_t1.data); u64 ctime = time__sys_mono_now(); - string e_file = os__join_path_single(cdir, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe08, {.d_u64 = ctime}}, {_SLIT(".expected.txt"), 0, { .d_c = 0 }}}))); - string f_file = os__join_path_single(cdir, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe08, {.d_u64 = ctime}}, {_SLIT(".found.txt"), 0, { .d_c = 0 }}}))); + string e_file = os__join_path_single(cdir, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*117 &u64*/0xfe08, {.d_u64 = ctime}}, {_SLIT(".expected.txt"), 0, { .d_c = 0 }}}))); + string f_file = os__join_path_single(cdir, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*117 &u64*/0xfe08, {.d_u64 = ctime}}, {_SLIT(".found.txt"), 0, { .d_c = 0 }}}))); Option_void _t2 = os__write_file(e_file, expected); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; @@ -37854,7 +37895,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) { } string target_dir = (os__is_dir(rpath) ? (rpath) : (os__dir(rpath))); p->out_name = os__join_path(target_dir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){base}))); - if (string__eq(rpath, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = p->vroot}}, {_SLIT("/cmd/v"), 0, { .d_c = 0 }}}))) && os__is_dir(_SLIT("vlib/compiler"))) { + if (string__eq(rpath, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = p->vroot}}, {_SLIT("/cmd/v"), 0, { .d_c = 0 }}}))) && os__is_dir(_SLIT("vlib/compiler"))) { println(_SLIT("Saving the resulting V executable in `./v2`")); println(_SLIT("Use `v -o v cmd/v` if you want to replace current V executable.")); p->out_name = _SLIT("v2"); @@ -37884,8 +37925,8 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) { } #endif } - string vhash = _SLIT("9b1f7f5e9"); - 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, 0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), 0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), 0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), 0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), 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))}))); + string vhash = _SLIT("455a52e74"); + 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; } @@ -37962,11 +38003,11 @@ void v__pref__Preferences_default_c_compiler(v__pref__Preferences* p) { #if !defined(__TARGET_IOS__) { string ios_sdk = (p->is_ios_simulator ? (_SLIT("iphonesimulator")) : (_SLIT("iphoneos"))); - os__Result ios_sdk_path_res = os__execute_or_exit( str_intp(2, _MOV((StrIntpData[]){{_SLIT("xcrun --sdk "), 0xfe10, {.d_s = ios_sdk}}, {_SLIT(" --show-sdk-path"), 0, { .d_c = 0 }}}))); + os__Result ios_sdk_path_res = os__execute_or_exit( str_intp(2, _MOV((StrIntpData[]){{_SLIT("xcrun --sdk "), /*115 &string*/0xfe10, {.d_s = ios_sdk}}, {_SLIT(" --show-sdk-path"), 0, { .d_c = 0 }}}))); string isysroot = string_replace(ios_sdk_path_res.output, _SLIT("\n"), _SLIT("")); string arch = (p->is_ios_simulator ? (_SLIT("-arch x86_64 -arch arm64")) : (_SLIT("-arch armv7 -arch armv7s -arch arm64"))); p->ccompiler = _SLIT("/usr/bin/cc"); - p->cflags = string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("-isysroot "), 0xfe10, {.d_s = isysroot}}, {_SLIT(" "), 0xfe10, {.d_s = arch}}, {_SLIT0, 0, { .d_c = 0 }}})), p->cflags); + p->cflags = string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("-isysroot "), /*115 &string*/0xfe10, {.d_s = isysroot}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arch}}, {_SLIT0, 0, { .d_c = 0 }}})), p->cflags); return; } #endif @@ -38022,7 +38063,7 @@ string v__pref__Preferences_vcross_compiler_name(v__pref__Preferences* p) { if (p->backend == v__pref__Backend__c && !string_ends_with(p->out_name, _SLIT(".c"))) { eprintln(_SLIT("Note: V can only cross compile to windows and linux for now by default.")); eprintln(_SLIT("It will use `cc` as a cross compiler for now, although that will probably fail.")); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Set `VCROSS_COMPILER_NAME` to the name of your cross compiler, for your target OS: "), 0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Set `VCROSS_COMPILER_NAME` to the name of your cross compiler, for your target OS: "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); } string _t5 = _SLIT("cc"); return _t5; @@ -38156,7 +38197,7 @@ Option_v__pref__OS v__pref__os_from_string(string os_str) { return _t25; } else { - return (Option_v__pref__OS){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("bad OS "), 0xfe10, {.d_s = os_str}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__pref__OS){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("bad OS "), /*115 &string*/0xfe10, {.d_s = os_str}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_v__pref__OS){0}; } @@ -38444,7 +38485,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors Option_v__pref__Arch _t3 = v__pref__arch_from_string(target_arch); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown architecture target `"), 0xfe10, {.d_s = target_arch}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown architecture target `"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); ; @@ -38452,7 +38493,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors v__pref__Arch target_arch_kind = (*(v__pref__Arch*)_t3.data); res->arch = target_arch_kind; - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else if (string__eq(arg, _SLIT("-assert"))) { string assert_mode = os__cmdline__option(current_args, _SLIT("-assert"), _SLIT("")); @@ -38464,7 +38505,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors res->assert_failure_mode = v__pref__AssertFailureMode__backtraces; } else { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown assert mode `-gc "), 0xfe10, {.d_s = assert_mode}}, {_SLIT("`, supported modes are:`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown assert mode `-gc "), /*115 &string*/0xfe10, {.d_s = assert_mode}}, {_SLIT("`, supported modes are:`"), 0, { .d_c = 0 }}}))); eprintln(_SLIT(" `-assert aborts` .... calls abort() after assertion failure")); eprintln(_SLIT(" `-assert backtraces` .... calls print_backtrace() after assertion failure")); _v_exit(1); @@ -38550,7 +38591,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors v__pref__Preferences_parse_define(res, _SLIT("gcboehm_leak")); } else { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown garbage collection mode `-gc "), 0xfe10, {.d_s = gc_mode}}, {_SLIT("`, supported modes are:`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown garbage collection mode `-gc "), /*115 &string*/0xfe10, {.d_s = gc_mode}}, {_SLIT("`, supported modes are:`"), 0, { .d_c = 0 }}}))); eprintln(_SLIT(" `-gc boehm` ............ default GC-mode (currently `boehm_full_opt`)")); eprintln(_SLIT(" `-gc boehm_full` ....... classic full collection")); eprintln(_SLIT(" `-gc boehm_incr` ....... incremental collection")); @@ -38575,7 +38616,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-debug-tcc"))) { res->ccompiler = _SLIT("tcc"); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = res->ccompiler}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = res->ccompiler}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); res->retry_compilation = false; res->show_cc = true; res->show_c_output = true; @@ -38641,7 +38682,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors else if (string__eq(arg, _SLIT("-prof")) || string__eq(arg, _SLIT("-profile"))) { res->profile_file = os__cmdline__option(current_args, arg, _SLIT("-")); res->is_prof = true; - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = res->profile_file}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = res->profile_file}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); i++; } else if (string__eq(arg, _SLIT("-profile-fns"))) { @@ -38676,7 +38717,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-m32")) || string__eq(arg, _SLIT("-m64"))) { res->m64 = string_at(arg, 2) == '6'; - res->cflags = /*f*/string__plus(res->cflags, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}}))); + res->cflags = /*f*/string__plus(res->cflags, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(arg, _SLIT("-color"))) { res->use_color = v__pref__ColorOutput__always; @@ -38764,7 +38805,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors res->output_cross_c = true; continue; } - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown operating system target `"), 0xfe10, {.d_s = target_os}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown operating system target `"), /*115 &string*/0xfe10, {.d_s = target_os}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); ; @@ -38775,7 +38816,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors res->is_bare = true; } res->os = target_os_kind; - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = target_os}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = target_os}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else if (string__eq(arg, _SLIT("-printfn"))) { _PUSH_MANY(&res->printfn_list, (string_split(os__cmdline__option(current_args, _SLIT("-printfn"), _SLIT("")), _SLIT(","))), _t22, Array_string); @@ -38783,7 +38824,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-cflags"))) { res->cflags = /*f*/string__plus(res->cflags, string__plus(_SLIT(" "), os__cmdline__option(current_args, _SLIT("-cflags"), _SLIT("")))); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = string_trim_space(res->cflags)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = string_trim_space(res->cflags)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); i++; } else if (string__eq(arg, _SLIT("-d")) || string__eq(arg, _SLIT("-define"))) { @@ -38803,7 +38844,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-cc"))) { res->ccompiler = os__cmdline__option(current_args, _SLIT("-cc"), _SLIT("cc")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = res->ccompiler}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = res->ccompiler}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); i++; } else if (string__eq(arg, _SLIT("-checker-match-exhaustive-cutoff-limit"))) { @@ -38825,7 +38866,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-b")) || string__eq(arg, _SLIT("-backend"))) { string sbackend = os__cmdline__option(current_args, arg, _SLIT("c")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = sbackend}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sbackend}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); Option_v__pref__Backend _t26 = v__pref__backend_from_string(sbackend); if (_t26.state != 0) { /*or block*/ IError err = _t26.err; @@ -38844,23 +38885,23 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-path"))) { string path = os__cmdline__option(current_args, _SLIT("-path"), _SLIT("")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); res->lookup_path = string_split(string_replace(path, _SLIT("|"), _const_os__path_delimiter), _const_os__path_delimiter); i++; } else if (string__eq(arg, _SLIT("-bare-builtin-dir"))) { string bare_builtin_dir = os__cmdline__option(current_args, arg, _SLIT("")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = bare_builtin_dir}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = bare_builtin_dir}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); res->bare_builtin_dir = bare_builtin_dir; i++; } else if (string__eq(arg, _SLIT("-custom-prelude"))) { string path = os__cmdline__option(current_args, _SLIT("-custom-prelude"), _SLIT("")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); Option_string _t30 = os__read_file(path); if (_t30.state != 0) { /*or block*/ IError err = _t30.err; - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot open custom prelude file: "), 0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot open custom prelude file: "), /*115 &IError*/0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); ; @@ -38872,7 +38913,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else { if (string__eq(command, _SLIT("build")) && v__pref__is_source_file(arg)) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Use `v "), 0xfe10, {.d_s = arg}}, {_SLIT("` instead."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Use `v "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT("` instead."), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -38903,8 +38944,8 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors if ((command).len != 0 && !string__eq(command, _SLIT("build-module"))) { continue; } - string extension = (command.len == 0 ? (_SLIT("")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" for command `"), 0xfe10, {.d_s = command}}, {_SLIT("`"), 0, { .d_c = 0 }}})))); - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Unknown argument `"), 0xfe10, {.d_s = arg}}, {_SLIT("`"), 0xfe10, {.d_s = extension}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string extension = (command.len == 0 ? (_SLIT("")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" for command `"), /*115 &string*/0xfe10, {.d_s = command}}, {_SLIT("`"), 0, { .d_c = 0 }}})))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Unknown argument `"), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT("`"), /*115 &string*/0xfe10, {.d_s = extension}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); }; @@ -38936,15 +38977,15 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors string tmp_exe_file_path = res->out_name; string output_option = _SLIT(""); if ((tmp_exe_file_path).len == 0) { - tmp_exe_file_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_file_path}}, {_SLIT(".exe"), 0, { .d_c = 0 }}})); - output_option = str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), 0xfe10, {.d_s = os__quoted_path(tmp_exe_file_path)}}, {_SLIT(" "), 0, { .d_c = 0 }}})); + tmp_exe_file_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_file_path}}, {_SLIT(".exe"), 0, { .d_c = 0 }}})); + output_option = str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(tmp_exe_file_path)}}, {_SLIT(" "), 0, { .d_c = 0 }}})); } - string tmp_v_file_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_file_path}}, {_SLIT(".v"), 0, { .d_c = 0 }}})); + string tmp_v_file_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_file_path}}, {_SLIT(".v"), 0, { .d_c = 0 }}})); string contents = os__get_raw_lines_joined(); Option_void _t32 = os__write_file(tmp_v_file_path, contents); if (_t32.state != 0 && _t32.err._typ != _IError_None___index) { IError err = _t32.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to create temporary file "), 0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to create temporary file "), /*115 &string*/0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -38954,12 +38995,12 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors Array_string _t33; string command_options = Array_string_join((_t33 = os__cmdline__options_after(args, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("run")}))), array_slice(_t33, 1, _t33.len)), _SLIT(" ")); string vexe = v__pref__vexe_path(); - string tmp_cmd = str_intp(6, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), 0xfe10, {.d_s = output_option}}, {_SLIT(" "), 0xfe10, {.d_s = run_options}}, {_SLIT(" run "), 0xfe10, {.d_s = os__quoted_path(tmp_v_file_path)}}, {_SLIT(" "), 0xfe10, {.d_s = command_options}}, {_SLIT0, 0, { .d_c = 0 }}})); - v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("tmp_cmd: "), 0xfe10, {.d_s = tmp_cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string tmp_cmd = str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = output_option}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = run_options}}, {_SLIT(" run "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(tmp_v_file_path)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = command_options}}, {_SLIT0, 0, { .d_c = 0 }}})); + v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("tmp_cmd: "), /*115 &string*/0xfe10, {.d_s = tmp_cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); int tmp_result = os__system(tmp_cmd); - v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("exit code: "), 0xfe07, {.d_i32 = tmp_result}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("exit code: "), /*100 &int*/0xfe07, {.d_i32 = tmp_result}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (output_option.len != 0) { - v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove tmp exe file: "), 0xfe10, {.d_s = tmp_exe_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove tmp exe file: "), /*115 &string*/0xfe10, {.d_s = tmp_exe_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); Option_void _t34 = os__rm(tmp_exe_file_path); if (_t34.state != 0 && _t34.err._typ != _IError_None___index) { IError err = _t34.err; @@ -38967,7 +39008,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors ; } - v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove tmp v file: "), 0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove tmp v file: "), /*115 &string*/0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); Option_void _t35 = os__rm(tmp_v_file_path); if (_t35.state != 0 && _t35.err._typ != _IError_None___index) { IError err = _t35.err; @@ -38979,7 +39020,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } v__pref__must_exist(res->path); if (!string_ends_with(res->path, _SLIT(".v")) && os__is_executable(res->path) && os__is_file(res->path) && os__is_file(string__plus(res->path, _SLIT(".v")))) { - v__pref__eprintln_cond(show_output, str_intp(3, _MOV((StrIntpData[]){{_SLIT("It looks like you wanted to run \""), 0xfe10, {.d_s = res->path}}, {_SLIT(".v\", so we went ahead and did that since \""), 0xfe10, {.d_s = res->path}}, {_SLIT("\" is an executable."), 0, { .d_c = 0 }}}))); + v__pref__eprintln_cond(show_output, str_intp(3, _MOV((StrIntpData[]){{_SLIT("It looks like you wanted to run \""), /*115 &string*/0xfe10, {.d_s = res->path}}, {_SLIT(".v\", so we went ahead and did that since \""), /*115 &string*/0xfe10, {.d_s = res->path}}, {_SLIT("\" is an executable."), 0, { .d_c = 0 }}}))); res->path = /*f*/string__plus(res->path, _SLIT(".v")); } } else if (v__pref__is_source_file(command)) { @@ -39005,7 +39046,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors res->run_args = (_t37 = args, array_slice(_t37, command_pos + 2, _t37.len)); v__pref__must_exist(res->path); if (!string_ends_with(res->path, _SLIT(".v")) && os__is_executable(res->path) && os__is_file(res->path) && os__is_file(string__plus(res->path, _SLIT(".v")))) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("It looks like you wanted to run \""), 0xfe10, {.d_s = res->path}}, {_SLIT(".v\", so we went ahead and did that since \""), 0xfe10, {.d_s = res->path}}, {_SLIT("\" is an executable."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("It looks like you wanted to run \""), /*115 &string*/0xfe10, {.d_s = res->path}}, {_SLIT(".v\", so we went ahead and did that since \""), /*115 &string*/0xfe10, {.d_s = res->path}}, {_SLIT("\" is an executable."), 0, { .d_c = 0 }}}))); res->path = /*f*/string__plus(res->path, _SLIT(".v")); } } @@ -39037,7 +39078,7 @@ void v__pref__eprintln_cond(bool condition, string s) { void v__pref__Preferences_vrun_elog(v__pref__Preferences* pref, string s) { if (pref->is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> v run -, "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> v run -, "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -39099,14 +39140,14 @@ Option_v__pref__Arch v__pref__arch_from_string(string arch_str) { return _t10; } else { - return (Option_v__pref__Arch){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid arch: "), 0xfe10, {.d_s = arch_str}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__pref__Arch){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid arch: "), /*115 &string*/0xfe10, {.d_s = arch_str}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_v__pref__Arch){0}; } VV_LOCAL_SYMBOL void v__pref__must_exist(string path) { if (!os__exists(path)) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v expects that `"), 0xfe10, {.d_s = path}}, {_SLIT("` exists, but it does not"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v expects that `"), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("` exists, but it does not"), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -39156,7 +39197,7 @@ Option_v__pref__Backend v__pref__backend_from_string(string s) { return _t7; } else { - return (Option_v__pref__Backend){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unknown backend type "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__pref__Backend){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unknown backend type "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_v__pref__Backend){0}; } @@ -39206,7 +39247,7 @@ v__pref__Arch v__pref__get_host_arch(void) { VV_LOCAL_SYMBOL void v__pref__Preferences_parse_define(v__pref__Preferences* prefs, string define) { Array_string define_parts = string_split(define, _SLIT("=")); if (!(prefs->is_debug && string__eq(define, _SLIT("debug")))) { - array_push((array*)&prefs->build_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-d "), 0xfe10, {.d_s = define}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&prefs->build_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-d "), /*115 &string*/0xfe10, {.d_s = define}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (define_parts.len == 1) { array_push((array*)&prefs->compile_defines, _MOV((string[]){ string_clone(define) })); @@ -39223,13 +39264,13 @@ VV_LOCAL_SYMBOL void v__pref__Preferences_parse_define(v__pref__Preferences* pre array_push((array*)&prefs->compile_defines, _MOV((string[]){ string_clone((*(string*)/*ee elem_sym */array_get(define_parts, 0))) })); } else { - println(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("V error: Unknown define argument value `"), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(define_parts, 1))}}, {_SLIT("` for "), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(define_parts, 0))}}, {_SLIT("."), 0, { .d_c = 0 }}})), _SLIT(" Expected `0` or `1`."))); + println(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("V error: Unknown define argument value `"), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(define_parts, 1))}}, {_SLIT("` for "), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(define_parts, 0))}}, {_SLIT("."), 0, { .d_c = 0 }}})), _SLIT(" Expected `0` or `1`."))); _v_exit(1); VUNREACHABLE(); }; return; } - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("V error: Unknown define argument: "), 0xfe10, {.d_s = define}}, {_SLIT(". Expected at most one `=`."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("V error: Unknown define argument: "), /*115 &string*/0xfe10, {.d_s = define}}, {_SLIT(". Expected at most one `=`."), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -39272,7 +39313,7 @@ Array_string v__pref__Preferences_should_compile_filtered_files(v__pref__Prefere bool allowed = false; for (int _t2 = 0; _t2 < prefs->compile_defines.len; ++_t2) { string cdefine = ((string*)prefs->compile_defines.data)[_t2]; - Array_string file_postfixes = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d_"), 0xfe10, {.d_s = cdefine}}, {_SLIT(".v"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d_"), 0xfe10, {.d_s = cdefine}}, {_SLIT(".c.v"), 0, { .d_c = 0 }}}))})); + Array_string file_postfixes = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT(".v"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT(".c.v"), 0, { .d_c = 0 }}}))})); for (int _t3 = 0; _t3 < file_postfixes.len; ++_t3) { string file_postfix = ((string*)file_postfixes.data)[_t3]; if (string_ends_with(file, file_postfix)) { @@ -39292,7 +39333,7 @@ Array_string v__pref__Preferences_should_compile_filtered_files(v__pref__Prefere bool allowed = true; for (int _t4 = 0; _t4 < prefs->compile_defines.len; ++_t4) { string cdefine = ((string*)prefs->compile_defines.data)[_t4]; - Array_string file_postfixes = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("_notd_"), 0xfe10, {.d_s = cdefine}}, {_SLIT(".v"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_notd_"), 0xfe10, {.d_s = cdefine}}, {_SLIT(".c.v"), 0, { .d_c = 0 }}}))})); + Array_string file_postfixes = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("_notd_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT(".v"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_notd_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT(".c.v"), 0, { .d_c = 0 }}}))})); for (int _t5 = 0; _t5 < file_postfixes.len; ++_t5) { string file_postfix = ((string*)file_postfixes.data)[_t5]; if (string_ends_with(file, file_postfix)) { @@ -39329,14 +39370,14 @@ Array_string v__pref__Preferences_should_compile_filtered_files(v__pref__Prefere string no_postfix_key = v__pref__fname_without_platform_postfix(file); if (_IN_MAP(ADDR(string, no_postfix_key), ADDR(map, fnames_no_postfixes))) { if (prefs->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">>> should_compile_filtered_files: skipping _default.c.v file "), 0xfe10, {.d_s = file}}, {_SLIT(" ; the specialized versions are: "), 0xfe10, {.d_s = Array_string_str((*(Array_string*)map_get(ADDR(map, fnames_no_postfixes), &(string[]){no_postfix_key}, &(Array_string[]){ __new_array(0, 0, sizeof(string)) })))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">>> should_compile_filtered_files: skipping _default.c.v file "), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT(" ; the specialized versions are: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str((*(Array_string*)map_get(ADDR(map, fnames_no_postfixes), &(string[]){no_postfix_key}, &(Array_string[]){ __new_array(0, 0, sizeof(string)) })))}}, {_SLIT0, 0, { .d_c = 0 }}}))); } continue; } array_push((array*)&res, _MOV((string[]){ string_clone(file) })); } if (prefs->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> should_compile_filtered_files: res: "), 0xfe10, {.d_s = Array_string_str(res)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> should_compile_filtered_files: res: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(res)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } Array_string _t13 = res; return _t13; @@ -39558,7 +39599,7 @@ VV_LOCAL_SYMBOL sync__Channel* sync__new_channel_st_noscan(u32 n, u32 st) { } string sync__Channel_auto_str(sync__Channel* ch, string _v_typename) { - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("chan "), 0xfe10, {.d_s = _v_typename}}, {_SLIT("{cap: "), 0xfe06, {.d_u32 = ch->cap}}, {_SLIT(", closed: "), 0xfe04, {.d_u16 = ch->closed}}, {_SLIT("}"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("chan "), /*115 &string*/0xfe10, {.d_s = _v_typename}}, {_SLIT("{cap: "), /*117 &u32*/0xfe06, {.d_u32 = ch->cap}}, {_SLIT(", closed: "), /*117 &u16*/0xfe04, {.d_u16 = ch->closed}}, {_SLIT("}"), 0, { .d_c = 0 }}})); return _t1; } @@ -40445,7 +40486,7 @@ void help__print_and_exit(string topic) { _v_exit(0); VUNREACHABLE(); } - string target_topic = os__join_path(topicdir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT(".txt"), 0, { .d_c = 0 }}}))}))); + string target_topic = os__join_path(topicdir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(".txt"), 0, { .d_c = 0 }}}))}))); Option_string _t2 = os__read_file(target_topic); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; @@ -40555,13 +40596,13 @@ string v__util__formatted_error(string kind, string omsg, string filepath, v__to path = string_replace_once(path, _const_v__util__normalised_workdir, _SLIT("")); } } - string position = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path}}, {_SLIT(":"), 0xfe07, {.d_i32 = pos.line_nr + 1}}, {_SLIT(":"), 0xfe07, {.d_i32 = v__mathutil__max_T_int(1, pos.col + 1)}}, {_SLIT(":"), 0, { .d_c = 0 }}})); + string position = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = pos.line_nr + 1}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = v__mathutil__max_T_int(1, pos.col + 1)}}, {_SLIT(":"), 0, { .d_c = 0 }}})); string scontext = Array_string_join(v__util__source_file_context(kind, filepath, pos), _SLIT("\n")); string final_position = v__util__bold(position); string final_kind = v__util__bold(v__util__color(kind, kind)); string final_msg = emsg; - string final_context = (scontext.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = scontext}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); - string _t1 = string_trim_space( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = final_position}}, {_SLIT(" "), 0xfe10, {.d_s = final_kind}}, {_SLIT(" "), 0xfe10, {.d_s = final_msg}}, {_SLIT0, 0xfe10, {.d_s = final_context}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string final_context = (scontext.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = scontext}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); + string _t1 = string_trim_space( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = final_position}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = final_kind}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = final_msg}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = final_context}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t1; } @@ -40613,7 +40654,7 @@ Array_string v__util__source_file_context(string kind, string filepath, v__token int start_column = v__mathutil__max_T_int(0, v__mathutil__min_T_int(pos.col, sline.len)); int end_column = v__mathutil__max_T_int(0, v__mathutil__min_T_int(pos.col + v__mathutil__max_T_int(0, pos.len), sline.len)); string cline = (iline == pos.line_nr ? (string__plus(string__plus(string_substr(sline, 0, start_column), v__util__color(kind, string_substr(sline, start_column, end_column))), string_substr(sline, end_column, (sline).len))) : (sline)); - array_push((array*)&clines, _MOV((string[]){ string_clone(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xafe27, {.d_i32 = iline + 1}}, {_SLIT(" | "), 0, { .d_c = 0 }}})), string_replace(cline, _SLIT("\t"), tab_spaces))) })); + array_push((array*)&clines, _MOV((string[]){ string_clone(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xafe27, {.d_i32 = iline + 1}}, {_SLIT(" | "), 0, { .d_c = 0 }}})), string_replace(cline, _SLIT("\t"), tab_spaces))) })); if (iline == pos.line_nr) { strings__Builder pointerline_builder = strings__new_builder(sline.len); for (int i = 0; i < start_column; ) { @@ -40640,7 +40681,7 @@ Array_string v__util__source_file_context(string kind, string filepath, v__token // Attr: [noreturn] VNORETURN void v__util__verror(string kind, string s) { string final_kind = v__util__bold(v__util__color(kind, kind)); - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = final_kind}}, {_SLIT(": "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = final_kind}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); while(1); @@ -40991,7 +41032,7 @@ string v__util__Suggestion_say(v__util__Suggestion s, string msg) { if (top_posibility.similarity > 0.5) { string val = top_posibility.value; if (!string_starts_with(val, _SLIT("[]"))) { - res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\nDid you mean `"), 0xfe10, {.d_s = v__util__highlight_suggestion(val)}}, {_SLIT("`?"), 0, { .d_c = 0 }}}))); + res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\nDid you mean `"), /*115 &string*/0xfe10, {.d_s = v__util__highlight_suggestion(val)}}, {_SLIT("`?"), 0, { .d_c = 0 }}}))); found = true; } } @@ -41005,15 +41046,15 @@ string v__util__Suggestion_say(v__util__Suggestion s, string msg) { for (int _t2 = 0; _t2 < _t1_len; ++_t2) { v__util__Possibility it = ((v__util__Possibility*) _t1_orig.data)[_t2]; - string ti = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__util__highlight_suggestion(it.svalue)}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string ti = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v__util__highlight_suggestion(it.svalue)}}, {_SLIT("`"), 0, { .d_c = 0 }}})); array_push((array*)&_t1, &ti); } Array_string values =_t1; qsort(values.data, values.len, values.element_size, (int (*)(const void *, const void *))&compare_6907021362050549619_string); if (values.len == 1) { - res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\n1 possibility: "), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(values, 0))}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\n1 possibility: "), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(values, 0))}}, {_SLIT("."), 0, { .d_c = 0 }}}))); } else if (values.len < 25) { - res = /*f*/string__plus(res, string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\n"), 0xfe07, {.d_i32 = values.len}}, {_SLIT(" possibilities: "), 0, { .d_c = 0 }}})), Array_string_join(values, _SLIT(", "))), _SLIT("."))); + res = /*f*/string__plus(res, string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\n"), /*100 &int*/0xfe07, {.d_i32 = values.len}}, {_SLIT(" possibilities: "), 0, { .d_c = 0 }}})), Array_string_join(values, _SLIT(", "))), _SLIT("."))); } } } @@ -41033,7 +41074,7 @@ string v__util__short_module_name(string name) { } string mname = (*(string*)/*ee elem_sym */array_get(vals, vals.len - 2)); string symname = (*(string*)/*ee elem_sym */array_get(vals, vals.len - 1)); - string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mname}}, {_SLIT("."), 0xfe10, {.d_s = symname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mname}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = symname}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } @@ -41151,7 +41192,7 @@ void v__util__Surrounder_free(v__util__Surrounder* s) { v__util__Timers* v__util__new_timers(v__util__TimerParams params) { #if defined(CUSTOM_DEFINE_trace_timers_creation) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">>>> new_timers, should_print: "), 0xfe10, {.d_s = params.should_print ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | label: "), 0xfe10, {.d_s = params.label}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">>>> new_timers, should_print: "), /*115 &bool*/0xfe10, {.d_s = params.should_print ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | label: "), /*115 &string*/0xfe10, {.d_s = params.label}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__util__Timers* _t1 = ((v__util__Timers*)memdup(&(v__util__Timers){.label = params.label,.swatches = new_map(sizeof(string), sizeof(time__StopWatch), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.should_print = params.should_print,.already_shown = __new_array_with_default(0, 100, sizeof(string), 0),}, sizeof(v__util__Timers))); @@ -41202,9 +41243,9 @@ void v__util__Timers_start(v__util__Timers* t, string name) { i64 v__util__Timers_measure(v__util__Timers* t, string name) { if (!_IN_MAP(ADDR(string, name), ADDR(map, t->swatches))) { Array_string timer_keys = map_keys(&t->swatches); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Timer `"), 0xfe10, {.d_s = name}}, {_SLIT("` was NOT started."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Timer `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` was NOT started."), 0, { .d_c = 0 }}}))); eprintln(_SLIT("> Available timers:")); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> "), 0xfe10, {.d_s = Array_string_str(timer_keys)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(timer_keys)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } i64 ms = time__Duration_microseconds(time__StopWatch_elapsed((*(time__StopWatch*)map_get(ADDR(map, t->swatches), &(string[]){name}, &(time__StopWatch[]){ (time__StopWatch){.elapsed = 0,.start = 0,.end = 0,} })))); i64 _t1 = ms; @@ -41244,8 +41285,8 @@ void v__util__Timers_measure_resume(v__util__Timers* t, string name) { string v__util__Timers_message(v__util__Timers* t, string name) { f64 ms = ((f64)(v__util__Timers_measure(t, name))) / 1000.0; - string value = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x10060d, {.d_f64 = ms}}, {_SLIT0, 0, { .d_c = 0 }}}))); - string formatted_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = value}}, {_SLIT(" ms "), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string value = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*102 &f64*/0x10060d, {.d_f64 = ms}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string formatted_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT(" ms "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); string _t1 = formatted_message; return _t1; } @@ -41342,7 +41383,7 @@ Option_string v__util__resolve_vmodroot(string str, string dir) { v__vmod__ModFileCacher* mcache = v__vmod__get_cache(); v__vmod__ModFileAndFolder vmod_file_location = v__vmod__ModFileCacher_get_by_folder(mcache, dir); if (vmod_file_location.vmod_file.len == 0) { - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("To use @VMODROOT, you need to have a \"v.mod\" file in "), 0xfe10, {.d_s = dir}}, {_SLIT(", or in one of its parent folders."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("To use @VMODROOT, you need to have a \"v.mod\" file in "), /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(", or in one of its parent folders."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string vmod_path = vmod_file_location.vmod_folder; Option_string _t2; @@ -41355,7 +41396,7 @@ Option_string v__util__resolve_env_value(string str, bool check_for_presence) { Option_int _t1 = string_index(str, env_ident); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_string){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("no \""), 0xfe10, {.d_s = env_ident}}, {_SLIT0, 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("...\')\" could be found in \""), 0xfe10, {.d_s = str}}, {_SLIT("\"."), 0, { .d_c = 0 }}})))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("no \""), /*115 &string*/0xfe10, {.d_s = env_ident}}, {_SLIT0, 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("...\')\" could be found in \""), /*115 &string*/0xfe10, {.d_s = str}}, {_SLIT("\"."), 0, { .d_c = 0 }}})))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int at = (*(int*)_t1.data); @@ -41370,7 +41411,7 @@ Option_string v__util__resolve_env_value(string str, bool check_for_presence) { if (ch == '$') { return (Option_string){ .state=2, .err=_v_error(_SLIT("cannot use string interpolation in compile time $env() expression")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid environment variable name in \""), 0xfe10, {.d_s = str}}, {_SLIT("\", invalid character \""), 0xfe10, {.d_s = u8_ascii_str(ch)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid environment variable name in \""), /*115 &string*/0xfe10, {.d_s = str}}, {_SLIT("\", invalid character \""), /*115 &string*/0xfe10, {.d_s = u8_ascii_str(ch)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } } @@ -41389,12 +41430,12 @@ Option_string v__util__resolve_env_value(string str, bool check_for_presence) { ; if (_t6.state != 0) { /*or block*/ IError err = _t6.err; - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the environment variable \""), 0xfe10, {.d_s = env_lit}}, {_SLIT("\" does not exist."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + 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; if ((env_value).len == 0) { - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the environment variable \""), 0xfe10, {.d_s = env_lit}}, {_SLIT("\" is empty."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + 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} }; } } else { env_value = os__getenv(env_lit); @@ -41427,17 +41468,17 @@ VNORETURN void v__util__launch_tool(bool is_verbose, string tool_name, Array_str tool_source = string__plus(tool_basename, _SLIT(".v")); } if (is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool vexe : "), 0xfe10, {.d_s = vexe}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool vroot : "), 0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_source : "), 0xfe10, {.d_s = tool_source}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_exe : "), 0xfe10, {.d_s = tool_exe}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_args : "), 0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool vexe : "), /*115 &string*/0xfe10, {.d_s = vexe}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool vroot : "), /*115 &string*/0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_source : "), /*115 &string*/0xfe10, {.d_s = tool_source}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_exe : "), /*115 &string*/0xfe10, {.d_s = tool_exe}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_args : "), /*115 &string*/0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string disabling_file = v__util__recompilation__disabling_file(vroot); bool is_recompilation_disabled = os__exists(disabling_file); bool should_compile = !is_recompilation_disabled && v__util__should_recompile_tool(vexe, tool_source, tool_name, tool_exe); if (is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool should_compile: "), 0xfe10, {.d_s = should_compile ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool should_compile: "), /*115 &bool*/0xfe10, {.d_s = should_compile ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (should_compile) { Array_string emodules = (*(Array_string*)map_get(ADDR(map, _const_v__util__external_module_dependencies_for_tool), &(string[]){tool_name}, &(Array_string[]){ __new_array(0, 0, sizeof(string)) })); @@ -41453,7 +41494,7 @@ VNORETURN void v__util__launch_tool(bool is_verbose, string tool_name, Array_str (*(bool*)_t2.data); } - string compilation_command = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" -skip-unused "), 0, { .d_c = 0 }}})); + string compilation_command = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" -skip-unused "), 0, { .d_c = 0 }}})); if (string__eq(tool_name, _SLIT("vself")) || string__eq(tool_name, _SLIT("vup")) || string__eq(tool_name, _SLIT("vdoctor")) || string__eq(tool_name, _SLIT("vsymlink"))) { compilation_command = /*f*/string__plus(compilation_command, _SLIT(" -g ")); } @@ -41462,23 +41503,23 @@ VNORETURN void v__util__launch_tool(bool is_verbose, string tool_name, Array_str } compilation_command = /*f*/string__plus(compilation_command, os__quoted_path(tool_source)); if (is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Compiling "), 0xfe10, {.d_s = tool_name}}, {_SLIT(" with: \""), 0xfe10, {.d_s = compilation_command}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Compiling "), /*115 &string*/0xfe10, {.d_s = tool_name}}, {_SLIT(" with: \""), /*115 &string*/0xfe10, {.d_s = compilation_command}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } os__Result tool_compilation = os__execute_or_exit(compilation_command); if (tool_compilation.exit_code != 0) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot compile `"), 0xfe10, {.d_s = tool_source}}, {_SLIT("`: \n"), 0xfe10, {.d_s = tool_compilation.output}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot compile `"), /*115 &string*/0xfe10, {.d_s = tool_source}}, {_SLIT("`: \n"), /*115 &string*/0xfe10, {.d_s = tool_compilation.output}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } } #if defined(_WIN32) { - _v_exit(os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(tool_exe)}}, {_SLIT(" "), 0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}})))); + _v_exit(os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(tool_exe)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}})))); VUNREACHABLE(); } #elif defined(_VJS) { - _v_exit(os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tool_exe}}, {_SLIT(" "), 0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}})))); + _v_exit(os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tool_exe}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}})))); VUNREACHABLE(); } #else @@ -41602,7 +41643,7 @@ Option_string v__util__cached_read_source_file(string path) { Option_string _t5 = os__read_file(path); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to open "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to open "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string raw_text = (*(string*)_t5.data); @@ -41659,24 +41700,24 @@ VV_LOCAL_SYMBOL Array_string v__util__non_empty(Array_string arg) { Option_bool v__util__check_module_is_installed(string modulename, bool is_verbose) { string mpath = os__join_path_single(os__vmodules_dir(), modulename); string mod_v_file = os__join_path_single(mpath, _SLIT("v.mod")); - string murl = str_intp(2, _MOV((StrIntpData[]){{_SLIT("https://github.com/vlang/"), 0xfe10, {.d_s = modulename}}, {_SLIT0, 0, { .d_c = 0 }}})); + string murl = str_intp(2, _MOV((StrIntpData[]){{_SLIT("https://github.com/vlang/"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT0, 0, { .d_c = 0 }}})); if (is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: mpath: "), 0xfe10, {.d_s = mpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: mod_v_file: "), 0xfe10, {.d_s = mod_v_file}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: murl: "), 0xfe10, {.d_s = murl}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: mpath: "), /*115 &string*/0xfe10, {.d_s = mpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: mod_v_file: "), /*115 &string*/0xfe10, {.d_s = mod_v_file}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: murl: "), /*115 &string*/0xfe10, {.d_s = murl}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (os__exists(mod_v_file)) { string vexe = v__pref__vexe_path(); - string update_cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" update '"), 0xfe10, {.d_s = modulename}}, {_SLIT("'"), 0, { .d_c = 0 }}})); + string update_cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" update '"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT("'"), 0, { .d_c = 0 }}})); if (is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: updating with "), 0xfe10, {.d_s = update_cmd}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: updating with "), /*115 &string*/0xfe10, {.d_s = update_cmd}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } os__Result update_res = os__execute(update_cmd); if (update_res.exit_code < 0) { - return (Option_bool){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("can not start "), 0xfe10, {.d_s = update_cmd}}, {_SLIT(", error: "), 0xfe10, {.d_s = update_res.output}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("can not start "), /*115 &string*/0xfe10, {.d_s = update_cmd}}, {_SLIT(", error: "), /*115 &string*/0xfe10, {.d_s = update_res.output}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (update_res.exit_code != 0) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Warning: `"), 0xfe10, {.d_s = modulename}}, {_SLIT("` exists, but is not updated.\nV will continue, since updates can fail due to temporary network problems,\nand the existing module `"), 0xfe10, {.d_s = modulename}}, {_SLIT("` may still work."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Warning: `"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT("` exists, but is not updated.\nV will continue, since updates can fail due to temporary network problems,\nand the existing module `"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT("` may still work."), 0, { .d_c = 0 }}}))); if (is_verbose) { eprintln(_SLIT("Details:")); eprintln(update_res.output); @@ -41688,17 +41729,17 @@ Option_bool v__util__check_module_is_installed(string modulename, bool is_verbos return _t2; } if (is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: cloning from "), 0xfe10, {.d_s = murl}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: cloning from "), /*115 &string*/0xfe10, {.d_s = murl}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } - os__Result cloning_res = os__execute( str_intp(3, _MOV((StrIntpData[]){{_SLIT("git clone "), 0xfe10, {.d_s = os__quoted_path(murl)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(mpath)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + os__Result cloning_res = os__execute( str_intp(3, _MOV((StrIntpData[]){{_SLIT("git clone "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(murl)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(mpath)}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (cloning_res.exit_code < 0) { - return (Option_bool){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("git is not installed, error: "), 0xfe10, {.d_s = cloning_res.output}}, {_SLIT0, 0, { .d_c = 0 }}})), cloning_res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("git is not installed, error: "), /*115 &string*/0xfe10, {.d_s = cloning_res.output}}, {_SLIT0, 0, { .d_c = 0 }}})), cloning_res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (cloning_res.exit_code != 0) { - return (Option_bool){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cloning failed, details: "), 0xfe10, {.d_s = cloning_res.output}}, {_SLIT0, 0, { .d_c = 0 }}})), cloning_res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cloning failed, details: "), /*115 &string*/0xfe10, {.d_s = cloning_res.output}}, {_SLIT0, 0, { .d_c = 0 }}})), cloning_res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__exists(mod_v_file)) { - return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("even after cloning, "), 0xfe10, {.d_s = mod_v_file}}, {_SLIT(" is still missing"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("even after cloning, "), /*115 &string*/0xfe10, {.d_s = mod_v_file}}, {_SLIT(" is still missing"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (is_verbose) { eprintln(_SLIT("check_module_is_installed: done")); @@ -41722,7 +41763,7 @@ void v__util__ensure_modules_for_all_tools_are_installed(bool is_verbose) { tool_name = string_clone(tool_name); Array_string tool_modules = (*(Array_string*)DenseArray_value(&_const_v__util__external_module_dependencies_for_tool.key_values, _t1)); if (is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Installing modules for tool: "), 0xfe10, {.d_s = tool_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Installing modules for tool: "), /*115 &string*/0xfe10, {.d_s = tool_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } for (int _t4 = 0; _t4 < tool_modules.len; ++_t4) { string emodule = ((string*)tool_modules.data)[_t4]; @@ -41787,15 +41828,15 @@ void v__util__prepare_tool_when_needed(string source_name) { } void v__util__recompile_file(string vexe, string file) { - string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(file)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(file)}}, {_SLIT0, 0, { .d_c = 0 }}})); #if defined(CUSTOM_DEFINE_trace_recompilation) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("recompilation command: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("recompilation command: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif int recompile_result = os__system(cmd); if (recompile_result != 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not recompile "), 0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not recompile "), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(2); VUNREACHABLE(); } @@ -41808,7 +41849,7 @@ string v__util__get_vtmp_folder(void) { return _t1; } int uid = os__getuid(); - vtmp = os__join_path_single(os__temp_dir(), str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_"), 0xfe07, {.d_i32 = uid}}, {_SLIT0, 0, { .d_c = 0 }}}))); + vtmp = os__join_path_single(os__temp_dir(), str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_"), /*100 &int*/0xfe07, {.d_i32 = uid}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (!os__exists(vtmp) || !os__is_dir(vtmp)) { Option_void _t2 = os__mkdir_all(vtmp); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { @@ -41840,10 +41881,10 @@ Option_Array_string v__util__find_all_v_files(Array_string roots) { continue; } if (!string_ends_with(file, _SLIT(".v")) && !string_ends_with(file, _SLIT(".vv")) && !string_ends_with(file, _SLIT(".vsh"))) { - return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v fmt can only be used on .v files.\nOffending file: \""), 0xfe10, {.d_s = file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v fmt can only be used on .v files.\nOffending file: \""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__exists(file)) { - return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = file}}, {_SLIT("\" does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\" does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } array_push((array*)&files, _MOV((string[]){ string_clone(file) })); } @@ -42048,10 +42089,10 @@ v__ast__Node v__ast__empty_node(void) { Option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e) { v__ast__Expr root = e->expr; for (;;) { - if (!((root)._typ == 286 /* v.ast.SelectorExpr */)) break; + if (!((root)._typ == 287 /* v.ast.SelectorExpr */)) break; root = (*root._v__ast__SelectorExpr).expr; } - if ((root)._typ == 266 /* v.ast.Ident */) { + if ((root)._typ == 267 /* v.ast.Ident */) { Option_v__ast__Ident _t1; opt_ok(&(v__ast__Ident[]) { (*root._v__ast__Ident) }, (Option*)(&_t1), sizeof(v__ast__Ident)); return _t1; @@ -42084,19 +42125,19 @@ void v__ast__File_free(v__ast__File* f) { // TypeDecl bool v__ast__Ident_is_mut(v__ast__Ident* i) { - if (i->obj._typ == 324 /* v.ast.Var */) { + if (i->obj._typ == 325 /* v.ast.Var */) { bool _t1 = (*i->obj._v__ast__Var).is_mut; return _t1; } - else if (i->obj._typ == 322 /* v.ast.ConstField */) { + else if (i->obj._typ == 323 /* v.ast.ConstField */) { bool _t2 = false; return _t2; } - else if (i->obj._typ == 321 /* v.ast.AsmRegister */) { + else if (i->obj._typ == 322 /* v.ast.AsmRegister */) { bool _t3 = true; return _t3; } - else if (i->obj._typ == 323 /* v.ast.GlobalField */) { + else if (i->obj._typ == 324 /* v.ast.GlobalField */) { bool _t4 = true; return _t4; } @@ -42105,7 +42146,7 @@ bool v__ast__Ident_is_mut(v__ast__Ident* i) { } v__ast__IdentVar v__ast__Ident_var_info(v__ast__Ident* i) { - if (i->info._typ == 376 /* v.ast.IdentVar */) { + if (i->info._typ == 377 /* v.ast.IdentVar */) { v__ast__IdentVar _t1 = (*i->info._v__ast__IdentVar); return _t1; } @@ -42121,7 +42162,7 @@ v__ast__IdentVar v__ast__Ident_var_info(v__ast__Ident* i) { // TypeDecl // Attr: [inline] inline bool v__ast__Expr_is_blank_ident(v__ast__Expr expr) { - if ((expr)._typ == 266 /* v.ast.Ident */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { bool _t1 = (*expr._v__ast__Ident).kind == v__ast__IdentKind__blank_ident; return _t1; } @@ -42130,199 +42171,199 @@ inline bool v__ast__Expr_is_blank_ident(v__ast__Expr expr) { } v__token__Pos v__ast__Expr_pos(v__ast__Expr expr) { - if (expr._typ == 244 /* v.ast.AnonFn */) { + if (expr._typ == 245 /* v.ast.AnonFn */) { v__token__Pos _t1 = (*expr._v__ast__AnonFn).decl.pos; return _t1; } - else if (expr._typ == 251 /* v.ast.CTempVar */) { + else if (expr._typ == 252 /* v.ast.CTempVar */) { v__token__Pos _t2 = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); return _t2; } - else if (expr._typ == 262 /* v.ast.EmptyExpr */) { + else if (expr._typ == 263 /* v.ast.EmptyExpr */) { v__token__Pos _t3 = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); return _t3; } - else if (expr._typ == 277 /* v.ast.NodeError */) { + else if (expr._typ == 278 /* v.ast.NodeError */) { v__token__Pos _t4 = (*expr._v__ast__NodeError).pos; return _t4; } - else if (expr._typ == 245 /* v.ast.ArrayDecompose */) { + else if (expr._typ == 246 /* v.ast.ArrayDecompose */) { v__token__Pos _t5 = (*expr._v__ast__ArrayDecompose).pos; return _t5; } - else if (expr._typ == 246 /* v.ast.ArrayInit */) { + else if (expr._typ == 247 /* v.ast.ArrayInit */) { v__token__Pos _t6 = (*expr._v__ast__ArrayInit).pos; return _t6; } - else if (expr._typ == 247 /* v.ast.AsCast */) { + else if (expr._typ == 248 /* v.ast.AsCast */) { v__token__Pos _t7 = (*expr._v__ast__AsCast).pos; return _t7; } - else if (expr._typ == 248 /* v.ast.Assoc */) { + else if (expr._typ == 249 /* v.ast.Assoc */) { v__token__Pos _t8 = (*expr._v__ast__Assoc).pos; return _t8; } - else if (expr._typ == 249 /* v.ast.AtExpr */) { + else if (expr._typ == 250 /* v.ast.AtExpr */) { v__token__Pos _t9 = (*expr._v__ast__AtExpr).pos; return _t9; } - else if (expr._typ == 250 /* v.ast.BoolLiteral */) { + else if (expr._typ == 251 /* v.ast.BoolLiteral */) { v__token__Pos _t10 = (*expr._v__ast__BoolLiteral).pos; return _t10; } - else if (expr._typ == 252 /* v.ast.CallExpr */) { + else if (expr._typ == 253 /* v.ast.CallExpr */) { v__token__Pos _t11 = (*expr._v__ast__CallExpr).pos; return _t11; } - else if (expr._typ == 253 /* v.ast.CastExpr */) { + else if (expr._typ == 254 /* v.ast.CastExpr */) { v__token__Pos _t12 = (*expr._v__ast__CastExpr).pos; return _t12; } - else if (expr._typ == 254 /* v.ast.ChanInit */) { + else if (expr._typ == 255 /* v.ast.ChanInit */) { v__token__Pos _t13 = (*expr._v__ast__ChanInit).pos; return _t13; } - else if (expr._typ == 255 /* v.ast.CharLiteral */) { + else if (expr._typ == 256 /* v.ast.CharLiteral */) { v__token__Pos _t14 = (*expr._v__ast__CharLiteral).pos; return _t14; } - else if (expr._typ == 260 /* v.ast.ConcatExpr */) { + else if (expr._typ == 261 /* v.ast.ConcatExpr */) { v__token__Pos _t15 = (*expr._v__ast__ConcatExpr).pos; return _t15; } - else if (expr._typ == 256 /* v.ast.Comment */) { + else if (expr._typ == 257 /* v.ast.Comment */) { v__token__Pos _t16 = (*expr._v__ast__Comment).pos; return _t16; } - else if (expr._typ == 257 /* v.ast.ComptimeCall */) { + else if (expr._typ == 258 /* v.ast.ComptimeCall */) { v__token__Pos _t17 = (*expr._v__ast__ComptimeCall).pos; return _t17; } - else if (expr._typ == 258 /* v.ast.ComptimeSelector */) { + else if (expr._typ == 259 /* v.ast.ComptimeSelector */) { v__token__Pos _t18 = (*expr._v__ast__ComptimeSelector).pos; return _t18; } - else if (expr._typ == 263 /* v.ast.EnumVal */) { + else if (expr._typ == 264 /* v.ast.EnumVal */) { v__token__Pos _t19 = (*expr._v__ast__EnumVal).pos; return _t19; } - else if (expr._typ == 261 /* v.ast.DumpExpr */) { + else if (expr._typ == 262 /* v.ast.DumpExpr */) { v__token__Pos _t20 = (*expr._v__ast__DumpExpr).pos; return _t20; } - else if (expr._typ == 264 /* v.ast.FloatLiteral */) { + else if (expr._typ == 265 /* v.ast.FloatLiteral */) { v__token__Pos _t21 = (*expr._v__ast__FloatLiteral).pos; return _t21; } - else if (expr._typ == 265 /* v.ast.GoExpr */) { + else if (expr._typ == 266 /* v.ast.GoExpr */) { v__token__Pos _t22 = (*expr._v__ast__GoExpr).pos; return _t22; } - else if (expr._typ == 266 /* v.ast.Ident */) { + else if (expr._typ == 267 /* v.ast.Ident */) { v__token__Pos _t23 = (*expr._v__ast__Ident).pos; return _t23; } - else if (expr._typ == 267 /* v.ast.IfExpr */) { + else if (expr._typ == 268 /* v.ast.IfExpr */) { v__token__Pos _t24 = (*expr._v__ast__IfExpr).pos; return _t24; } - else if (expr._typ == 271 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { v__token__Pos _t25 = (*expr._v__ast__IntegerLiteral).pos; return _t25; } - else if (expr._typ == 272 /* v.ast.IsRefType */) { + else if (expr._typ == 273 /* v.ast.IsRefType */) { v__token__Pos _t26 = (*expr._v__ast__IsRefType).pos; return _t26; } - else if (expr._typ == 273 /* v.ast.Likely */) { + else if (expr._typ == 274 /* v.ast.Likely */) { v__token__Pos _t27 = (*expr._v__ast__Likely).pos; return _t27; } - else if (expr._typ == 274 /* v.ast.LockExpr */) { + else if (expr._typ == 275 /* v.ast.LockExpr */) { v__token__Pos _t28 = (*expr._v__ast__LockExpr).pos; return _t28; } - else if (expr._typ == 275 /* v.ast.MapInit */) { + else if (expr._typ == 276 /* v.ast.MapInit */) { v__token__Pos _t29 = (*expr._v__ast__MapInit).pos; return _t29; } - else if (expr._typ == 276 /* v.ast.MatchExpr */) { + else if (expr._typ == 277 /* v.ast.MatchExpr */) { v__token__Pos _t30 = (*expr._v__ast__MatchExpr).pos; return _t30; } - else if (expr._typ == 278 /* v.ast.None */) { + else if (expr._typ == 279 /* v.ast.None */) { v__token__Pos _t31 = (*expr._v__ast__None).pos; return _t31; } - else if (expr._typ == 279 /* v.ast.OffsetOf */) { + else if (expr._typ == 280 /* v.ast.OffsetOf */) { v__token__Pos _t32 = (*expr._v__ast__OffsetOf).pos; return _t32; } - else if (expr._typ == 280 /* v.ast.OrExpr */) { + else if (expr._typ == 281 /* v.ast.OrExpr */) { v__token__Pos _t33 = (*expr._v__ast__OrExpr).pos; return _t33; } - else if (expr._typ == 281 /* v.ast.ParExpr */) { + else if (expr._typ == 282 /* v.ast.ParExpr */) { v__token__Pos _t34 = (*expr._v__ast__ParExpr).pos; return _t34; } - else if (expr._typ == 282 /* v.ast.PostfixExpr */) { + else if (expr._typ == 283 /* v.ast.PostfixExpr */) { v__token__Pos _t35 = (*expr._v__ast__PostfixExpr).pos; return _t35; } - else if (expr._typ == 283 /* v.ast.PrefixExpr */) { + else if (expr._typ == 284 /* v.ast.PrefixExpr */) { v__token__Pos _t36 = (*expr._v__ast__PrefixExpr).pos; return _t36; } - else if (expr._typ == 284 /* v.ast.RangeExpr */) { + else if (expr._typ == 285 /* v.ast.RangeExpr */) { v__token__Pos _t37 = (*expr._v__ast__RangeExpr).pos; return _t37; } - else if (expr._typ == 285 /* v.ast.SelectExpr */) { + else if (expr._typ == 286 /* v.ast.SelectExpr */) { v__token__Pos _t38 = (*expr._v__ast__SelectExpr).pos; return _t38; } - else if (expr._typ == 286 /* v.ast.SelectorExpr */) { + else if (expr._typ == 287 /* v.ast.SelectorExpr */) { v__token__Pos _t39 = (*expr._v__ast__SelectorExpr).pos; return _t39; } - else if (expr._typ == 287 /* v.ast.SizeOf */) { + else if (expr._typ == 288 /* v.ast.SizeOf */) { v__token__Pos _t40 = (*expr._v__ast__SizeOf).pos; return _t40; } - else if (expr._typ == 288 /* v.ast.SqlExpr */) { + else if (expr._typ == 289 /* v.ast.SqlExpr */) { v__token__Pos _t41 = (*expr._v__ast__SqlExpr).pos; return _t41; } - else if (expr._typ == 289 /* v.ast.StringInterLiteral */) { + else if (expr._typ == 290 /* v.ast.StringInterLiteral */) { v__token__Pos _t42 = (*expr._v__ast__StringInterLiteral).pos; return _t42; } - else if (expr._typ == 290 /* v.ast.StringLiteral */) { + else if (expr._typ == 291 /* v.ast.StringLiteral */) { v__token__Pos _t43 = (*expr._v__ast__StringLiteral).pos; return _t43; } - else if (expr._typ == 291 /* v.ast.StructInit */) { + else if (expr._typ == 292 /* v.ast.StructInit */) { v__token__Pos _t44 = (*expr._v__ast__StructInit).pos; return _t44; } - else if (expr._typ == 292 /* v.ast.TypeNode */) { + else if (expr._typ == 293 /* v.ast.TypeNode */) { v__token__Pos _t45 = (*expr._v__ast__TypeNode).pos; return _t45; } - else if (expr._typ == 293 /* v.ast.TypeOf */) { + else if (expr._typ == 294 /* v.ast.TypeOf */) { v__token__Pos _t46 = (*expr._v__ast__TypeOf).pos; return _t46; } - else if (expr._typ == 294 /* v.ast.UnsafeExpr */) { + else if (expr._typ == 295 /* v.ast.UnsafeExpr */) { v__token__Pos _t47 = (*expr._v__ast__UnsafeExpr).pos; return _t47; } - else if (expr._typ == 259 /* v.ast.ComptimeType */) { + else if (expr._typ == 260 /* v.ast.ComptimeType */) { v__token__Pos _t48 = (*expr._v__ast__ComptimeType).pos; return _t48; } - else if (expr._typ == 269 /* v.ast.IndexExpr */) { + else if (expr._typ == 270 /* v.ast.IndexExpr */) { if ((*expr._v__ast__IndexExpr).or_expr.kind != v__ast__OrKind__absent) { v__token__Pos _t49 = (*expr._v__ast__IndexExpr).or_expr.pos; return _t49; @@ -42330,11 +42371,11 @@ v__token__Pos v__ast__Expr_pos(v__ast__Expr expr) { v__token__Pos _t50 = (*expr._v__ast__IndexExpr).pos; return _t50; } - else if (expr._typ == 268 /* v.ast.IfGuardExpr */) { + else if (expr._typ == 269 /* v.ast.IfGuardExpr */) { v__token__Pos _t51 = v__ast__Expr_pos((*expr._v__ast__IfGuardExpr).expr); return _t51; } - else if (expr._typ == 270 /* v.ast.InfixExpr */) { + else if (expr._typ == 271 /* v.ast.InfixExpr */) { v__token__Pos left_pos = v__ast__Expr_pos((*expr._v__ast__InfixExpr).left); v__token__Pos right_pos = v__ast__Expr_pos((*expr._v__ast__InfixExpr).right); v__token__Pos _t52 = ((v__token__Pos){.len = right_pos.pos - left_pos.pos + right_pos.len,.line_nr = (*expr._v__ast__InfixExpr).pos.line_nr,.pos = left_pos.pos,.col = left_pos.col,.last_line = right_pos.last_line,}); @@ -42345,27 +42386,27 @@ v__token__Pos v__ast__Expr_pos(v__ast__Expr expr) { } bool v__ast__Expr_is_lvalue(v__ast__Expr expr) { - if (expr._typ == 266 /* v.ast.Ident */) { + if (expr._typ == 267 /* v.ast.Ident */) { bool _t1 = true; return _t1; } - else if (expr._typ == 251 /* v.ast.CTempVar */) { + else if (expr._typ == 252 /* v.ast.CTempVar */) { bool _t2 = true; return _t2; } - else if (expr._typ == 269 /* v.ast.IndexExpr */) { + else if (expr._typ == 270 /* v.ast.IndexExpr */) { bool _t3 = v__ast__Expr_is_lvalue((*expr._v__ast__IndexExpr).left); return _t3; } - else if (expr._typ == 286 /* v.ast.SelectorExpr */) { + else if (expr._typ == 287 /* v.ast.SelectorExpr */) { bool _t4 = v__ast__Expr_is_lvalue((*expr._v__ast__SelectorExpr).expr); return _t4; } - else if (expr._typ == 281 /* v.ast.ParExpr */) { + else if (expr._typ == 282 /* v.ast.ParExpr */) { bool _t5 = v__ast__Expr_is_lvalue((*expr._v__ast__ParExpr).expr); return _t5; } - else if (expr._typ == 283 /* v.ast.PrefixExpr */) { + else if (expr._typ == 284 /* v.ast.PrefixExpr */) { bool _t6 = v__ast__Expr_is_lvalue((*expr._v__ast__PrefixExpr).right); return _t6; } @@ -42378,19 +42419,19 @@ bool v__ast__Expr_is_lvalue(v__ast__Expr expr) { } bool v__ast__Expr_is_expr(v__ast__Expr expr) { - if (expr._typ == 267 /* v.ast.IfExpr */) { + if (expr._typ == 268 /* v.ast.IfExpr */) { bool _t1 = (*expr._v__ast__IfExpr).is_expr; return _t1; } - else if (expr._typ == 274 /* v.ast.LockExpr */) { + else if (expr._typ == 275 /* v.ast.LockExpr */) { bool _t2 = (*expr._v__ast__LockExpr).is_expr; return _t2; } - else if (expr._typ == 276 /* v.ast.MatchExpr */) { + else if (expr._typ == 277 /* v.ast.MatchExpr */) { bool _t3 = (*expr._v__ast__MatchExpr).is_expr; return _t3; } - else if (expr._typ == 285 /* v.ast.SelectExpr */) { + else if (expr._typ == 286 /* v.ast.SelectExpr */) { bool _t4 = (*expr._v__ast__SelectExpr).is_expr; return _t4; } @@ -42403,20 +42444,20 @@ bool v__ast__Expr_is_expr(v__ast__Expr expr) { } bool v__ast__Expr_is_lit(v__ast__Expr expr) { - bool _t1 = ((expr._typ == 250 /* v.ast.BoolLiteral */) ? (true) : (expr._typ == 255 /* v.ast.CharLiteral */) ? (true) : (expr._typ == 290 /* v.ast.StringLiteral */) ? (true) : (expr._typ == 271 /* v.ast.IntegerLiteral */) ? (true) : (false)); + bool _t1 = ((expr._typ == 251 /* v.ast.BoolLiteral */) ? (true) : (expr._typ == 256 /* v.ast.CharLiteral */) ? (true) : (expr._typ == 291 /* v.ast.StringLiteral */) ? (true) : (expr._typ == 272 /* v.ast.IntegerLiteral */) ? (true) : (false)); return _t1; } bool v__ast__Expr_is_auto_deref_var(v__ast__Expr expr) { - if (expr._typ == 266 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if (expr._typ == 267 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { if ((*(*expr._v__ast__Ident).obj._v__ast__Var).is_auto_deref) { bool _t1 = true; return _t1; } } } - else if (expr._typ == 283 /* v.ast.PrefixExpr */) { + else if (expr._typ == 284 /* v.ast.PrefixExpr */) { if ((*expr._v__ast__PrefixExpr).op == v__token__Kind__amp && v__ast__Expr_is_auto_deref_var((*expr._v__ast__PrefixExpr).right)) { bool _t2 = true; return _t2; @@ -42431,11 +42472,11 @@ bool v__ast__Expr_is_auto_deref_var(v__ast__Expr expr) { } bool v__ast__Expr_is_lockable(v__ast__Expr* e) { - if (e->_typ == 266 /* v.ast.Ident */) { + if (e->_typ == 267 /* v.ast.Ident */) { bool _t1 = true; return _t1; } - else if (e->_typ == 286 /* v.ast.SelectorExpr */) { + else if (e->_typ == 287 /* v.ast.SelectorExpr */) { bool _t2 = v__ast__Expr_is_lockable(&(*e->_v__ast__SelectorExpr).expr); return _t2; } @@ -42449,55 +42490,55 @@ bool v__ast__Expr_is_lockable(v__ast__Expr* e) { } Option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt) { - if (stmt._typ == 298 /* v.ast.AssignStmt */) { + if (stmt._typ == 299 /* v.ast.AssignStmt */) { return (Option_void){0}; } - else if (stmt._typ == 307 /* v.ast.ForCStmt */) { + else if (stmt._typ == 308 /* v.ast.ForCStmt */) { return (Option_void){0}; } - else if (stmt._typ == 308 /* v.ast.ForInStmt */) { + else if (stmt._typ == 309 /* v.ast.ForInStmt */) { return (Option_void){0}; } - else if (stmt._typ == 309 /* v.ast.ForStmt */) { + else if (stmt._typ == 310 /* v.ast.ForStmt */) { return (Option_void){0}; } - else if (stmt._typ == 306 /* v.ast.ExprStmt */) { + else if (stmt._typ == 307 /* v.ast.ExprStmt */) { if (v__ast__Expr_is_expr((*stmt._v__ast__ExprStmt).expr)) { return (Option_void){0}; } - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsupported statement (`"), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( ((*stmt._v__ast__ExprStmt).expr)._typ ))}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsupported statement (`"), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( ((*stmt._v__ast__ExprStmt).expr)._typ ))}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else { } ; - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsupported statement (`"), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (stmt)._typ ))}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsupported statement (`"), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (stmt)._typ ))}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__token__Pos v__ast__Node_pos(v__ast__Node node) { - if (node._typ == 277 /* v.ast.NodeError */) { + if (node._typ == 278 /* v.ast.NodeError */) { v__token__Pos _t1 = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); return _t1; } - else if (node._typ == 327 /* v.ast.EmptyNode */) { + else if (node._typ == 328 /* v.ast.EmptyNode */) { v__token__Pos _t2 = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); return _t2; } - else if (node._typ == 320 /* v.ast.Stmt */) { + else if (node._typ == 321 /* v.ast.Stmt */) { v__token__Pos pos = (*((*node._v__ast__Stmt).pos)); - if (((*node._v__ast__Stmt))._typ == 314 /* v.ast.Import */) { + if (((*node._v__ast__Stmt))._typ == 315 /* v.ast.Import */) { for (int _t3 = 0; _t3 < (*(*node._v__ast__Stmt)._v__ast__Import).syms.len; ++_t3) { v__ast__ImportSymbol sym = ((v__ast__ImportSymbol*)(*(*node._v__ast__Stmt)._v__ast__Import).syms.data)[_t3]; pos = v__token__Pos_extend(pos, sym.pos); } - } else if (((*node._v__ast__Stmt))._typ == 243 /* v.ast.TypeDecl */) { - if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 241 /* v.ast.FnTypeDecl */) { + } else if (((*node._v__ast__Stmt))._typ == 244 /* v.ast.TypeDecl */) { + if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 242 /* v.ast.FnTypeDecl */) { pos = v__token__Pos_extend(pos, (*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__FnTypeDecl).type_pos); } - else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 240 /* v.ast.AliasTypeDecl */) { + else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 241 /* v.ast.AliasTypeDecl */) { pos = v__token__Pos_extend(pos, (*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__AliasTypeDecl).type_pos); } - else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 242 /* v.ast.SumTypeDecl */) { + else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 243 /* v.ast.SumTypeDecl */) { for (int _t4 = 0; _t4 < (*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__SumTypeDecl).variants.len; ++_t4) { v__ast__TypeNode variant = ((v__ast__TypeNode*)(*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__SumTypeDecl).variants.data)[_t4]; pos = v__token__Pos_extend(pos, variant.pos); @@ -42505,81 +42546,81 @@ v__token__Pos v__ast__Node_pos(v__ast__Node node) { } ; } - if (((*node._v__ast__Stmt))._typ == 298 /* v.ast.AssignStmt */) { + if (((*node._v__ast__Stmt))._typ == 299 /* v.ast.AssignStmt */) { v__token__Pos _t5 = v__token__Pos_extend(pos, v__ast__Expr_pos((*(v__ast__Expr*)array_last((*(*node._v__ast__Stmt)._v__ast__AssignStmt).right)))); return _t5; } - if (((*node._v__ast__Stmt))._typ == 297 /* v.ast.AssertStmt */) { + if (((*node._v__ast__Stmt))._typ == 298 /* v.ast.AssertStmt */) { v__token__Pos _t6 = v__token__Pos_extend(pos, v__ast__Expr_pos((*(*node._v__ast__Stmt)._v__ast__AssertStmt).expr)); return _t6; } v__token__Pos _t7 = pos; return _t7; } - else if (node._typ == 295 /* v.ast.Expr */) { + else if (node._typ == 296 /* v.ast.Expr */) { v__token__Pos _t8 = v__ast__Expr_pos((*node._v__ast__Expr)); return _t8; } - else if (node._typ == 333 /* v.ast.StructField */) { + else if (node._typ == 334 /* v.ast.StructField */) { v__token__Pos _t9 = v__token__Pos_extend((*node._v__ast__StructField).pos, (*node._v__ast__StructField).type_pos); return _t9; } - else if (node._typ == 330 /* v.ast.MatchBranch */) { + else if (node._typ == 331 /* v.ast.MatchBranch */) { v__token__Pos _t10 = (*node._v__ast__MatchBranch).pos; return _t10; } - else if (node._typ == 332 /* v.ast.SelectBranch */) { + else if (node._typ == 333 /* v.ast.SelectBranch */) { v__token__Pos _t11 = (*node._v__ast__SelectBranch).pos; return _t11; } - else if (node._typ == 328 /* v.ast.EnumField */) { + else if (node._typ == 329 /* v.ast.EnumField */) { v__token__Pos _t12 = (*node._v__ast__EnumField).pos; return _t12; } - else if (node._typ == 322 /* v.ast.ConstField */) { + else if (node._typ == 323 /* v.ast.ConstField */) { v__token__Pos _t13 = (*node._v__ast__ConstField).pos; return _t13; } - else if (node._typ == 334 /* v.ast.StructInitField */) { + else if (node._typ == 335 /* v.ast.StructInitField */) { v__token__Pos _t14 = (*node._v__ast__StructInitField).pos; return _t14; } - else if (node._typ == 323 /* v.ast.GlobalField */) { + else if (node._typ == 324 /* v.ast.GlobalField */) { v__token__Pos _t15 = (*node._v__ast__GlobalField).pos; return _t15; } - else if (node._typ == 326 /* v.ast.CallArg */) { + else if (node._typ == 327 /* v.ast.CallArg */) { v__token__Pos _t16 = (*node._v__ast__CallArg).pos; return _t16; } - else if (node._typ == 331 /* v.ast.Param */) { + else if (node._typ == 332 /* v.ast.Param */) { v__token__Pos _t17 = v__token__Pos_extend((*node._v__ast__Param).pos, (*node._v__ast__Param).type_pos); return _t17; } - else if (node._typ == 329 /* v.ast.IfBranch */) { + else if (node._typ == 330 /* v.ast.IfBranch */) { v__token__Pos _t18 = v__token__Pos_extend((*node._v__ast__IfBranch).pos, (*node._v__ast__IfBranch).body_pos); return _t18; } - else if (node._typ == 325 /* v.ast.ScopeObject */) { - if ((*node._v__ast__ScopeObject)._typ == 322 /* v.ast.ConstField */) { + else if (node._typ == 326 /* v.ast.ScopeObject */) { + if ((*node._v__ast__ScopeObject)._typ == 323 /* v.ast.ConstField */) { v__token__Pos _t19 = (*(*node._v__ast__ScopeObject)._v__ast__ConstField).pos; return _t19; } - else if ((*node._v__ast__ScopeObject)._typ == 323 /* v.ast.GlobalField */) { + else if ((*node._v__ast__ScopeObject)._typ == 324 /* v.ast.GlobalField */) { v__token__Pos _t20 = (*(*node._v__ast__ScopeObject)._v__ast__GlobalField).pos; return _t20; } - else if ((*node._v__ast__ScopeObject)._typ == 324 /* v.ast.Var */) { + else if ((*node._v__ast__ScopeObject)._typ == 325 /* v.ast.Var */) { v__token__Pos _t21 = (*(*node._v__ast__ScopeObject)._v__ast__Var).pos; return _t21; } - else if ((*node._v__ast__ScopeObject)._typ == 321 /* v.ast.AsmRegister */) { + else if ((*node._v__ast__ScopeObject)._typ == 322 /* v.ast.AsmRegister */) { v__token__Pos _t22 = ((v__token__Pos){.len = -1,.line_nr = -1,.pos = -1,.col = -1,.last_line = -1,}); return _t22; } ; } - else if (node._typ == 174 /* v.ast.File */) { + else if (node._typ == 175 /* v.ast.File */) { v__token__Pos pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); if ((*node._v__ast__File).stmts.len > 0) { v__token__Pos first_pos = (*((*(v__ast__Stmt*)array_first((*node._v__ast__File).stmts)).pos)); @@ -42595,8 +42636,8 @@ v__token__Pos v__ast__Node_pos(v__ast__Node node) { Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node children = __new_array_with_default(0, 0, sizeof(v__ast__Node), 0); - if ((node)._typ == 295 /* v.ast.Expr */) { - if ((*node._v__ast__Expr)._typ == 289 /* v.ast.StringInterLiteral */) { + if ((node)._typ == 296 /* v.ast.Expr */) { + if ((*node._v__ast__Expr)._typ == 290 /* v.ast.StringInterLiteral */) { Array_v__ast__Node _t2 = {0}; Array_v__ast__Expr _t2_orig = (*(*node._v__ast__Expr)._v__ast__StringInterLiteral).exprs; int _t2_len = _t2_orig.len; @@ -42610,7 +42651,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t1 =_t2; return _t1; } - else if ((*node._v__ast__Expr)._typ == 248 /* v.ast.Assoc */) { + else if ((*node._v__ast__Expr)._typ == 249 /* v.ast.Assoc */) { Array_v__ast__Node _t5 = {0}; Array_v__ast__Expr _t5_orig = (*(*node._v__ast__Expr)._v__ast__Assoc).exprs; int _t5_len = _t5_orig.len; @@ -42624,7 +42665,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t4 =_t5; return _t4; } - else if ((*node._v__ast__Expr)._typ == 246 /* v.ast.ArrayInit */) { + else if ((*node._v__ast__Expr)._typ == 247 /* v.ast.ArrayInit */) { Array_v__ast__Node _t8 = {0}; Array_v__ast__Expr _t8_orig = (*(*node._v__ast__Expr)._v__ast__ArrayInit).exprs; int _t8_len = _t8_orig.len; @@ -42638,37 +42679,37 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t7 =_t8; return _t7; } - else if ((*node._v__ast__Expr)._typ == 286 /* v.ast.SelectorExpr */) { + else if ((*node._v__ast__Expr)._typ == 287 /* v.ast.SelectorExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__SelectorExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 282 /* v.ast.PostfixExpr */) { + else if ((*node._v__ast__Expr)._typ == 283 /* v.ast.PostfixExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__PostfixExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 294 /* v.ast.UnsafeExpr */) { + else if ((*node._v__ast__Expr)._typ == 295 /* v.ast.UnsafeExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__UnsafeExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 247 /* v.ast.AsCast */) { + else if ((*node._v__ast__Expr)._typ == 248 /* v.ast.AsCast */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__AsCast).expr) })); } - else if ((*node._v__ast__Expr)._typ == 281 /* v.ast.ParExpr */) { + else if ((*node._v__ast__Expr)._typ == 282 /* v.ast.ParExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ParExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 268 /* v.ast.IfGuardExpr */) { + else if ((*node._v__ast__Expr)._typ == 269 /* v.ast.IfGuardExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__IfGuardExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 287 /* v.ast.SizeOf */) { + else if ((*node._v__ast__Expr)._typ == 288 /* v.ast.SizeOf */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__SizeOf).expr) })); } - else if ((*node._v__ast__Expr)._typ == 273 /* v.ast.Likely */) { + else if ((*node._v__ast__Expr)._typ == 274 /* v.ast.Likely */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__Likely).expr) })); } - else if ((*node._v__ast__Expr)._typ == 293 /* v.ast.TypeOf */) { + else if ((*node._v__ast__Expr)._typ == 294 /* v.ast.TypeOf */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__TypeOf).expr) })); } - else if ((*node._v__ast__Expr)._typ == 245 /* v.ast.ArrayDecompose */) { + else if ((*node._v__ast__Expr)._typ == 246 /* v.ast.ArrayDecompose */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ArrayDecompose).expr) })); } - else if ((*node._v__ast__Expr)._typ == 274 /* v.ast.LockExpr */) { + else if ((*node._v__ast__Expr)._typ == 275 /* v.ast.LockExpr */) { Array_v__ast__Node _t21 = {0}; Array_v__ast__Stmt _t21_orig = (*(*node._v__ast__Expr)._v__ast__LockExpr).stmts; int _t21_len = _t21_orig.len; @@ -42682,7 +42723,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t20 =_t21; return _t20; } - else if ((*node._v__ast__Expr)._typ == 280 /* v.ast.OrExpr */) { + else if ((*node._v__ast__Expr)._typ == 281 /* v.ast.OrExpr */) { Array_v__ast__Node _t24 = {0}; Array_v__ast__Stmt _t24_orig = (*(*node._v__ast__Expr)._v__ast__OrExpr).stmts; int _t24_len = _t24_orig.len; @@ -42696,7 +42737,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t23 =_t24; return _t23; } - else if ((*node._v__ast__Expr)._typ == 291 /* v.ast.StructInit */) { + else if ((*node._v__ast__Expr)._typ == 292 /* v.ast.StructInit */) { Array_v__ast__Node _t27 = {0}; Array_v__ast__StructInitField _t27_orig = (*(*node._v__ast__Expr)._v__ast__StructInit).fields; int _t27_len = _t27_orig.len; @@ -42710,10 +42751,10 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t26 =_t27; return _t26; } - else if ((*node._v__ast__Expr)._typ == 244 /* v.ast.AnonFn */) { + else if ((*node._v__ast__Expr)._typ == 245 /* v.ast.AnonFn */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Stmt_to_sumtype_v__ast__Node(ADDR(v__ast__Stmt, (v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*(*node._v__ast__Expr)._v__ast__AnonFn).decl)))) })); } - else if ((*node._v__ast__Expr)._typ == 252 /* v.ast.CallExpr */) { + else if ((*node._v__ast__Expr)._typ == 253 /* v.ast.CallExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__CallExpr).left) })); Array_v__ast__Node _t32 = {0}; Array_v__ast__CallArg _t32_orig = (*(*node._v__ast__Expr)._v__ast__CallExpr).args; @@ -42728,18 +42769,18 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { _PUSH_MANY(&children, (_t32), _t31, Array_v__ast__Node); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(ADDR(v__ast__Expr, (v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*(*node._v__ast__Expr)._v__ast__CallExpr).or_block)))) })); } - else if ((*node._v__ast__Expr)._typ == 270 /* v.ast.InfixExpr */) { + else if ((*node._v__ast__Expr)._typ == 271 /* v.ast.InfixExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__InfixExpr).left) })); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__InfixExpr).right) })); } - else if ((*node._v__ast__Expr)._typ == 283 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__Expr)._typ == 284 /* v.ast.PrefixExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__PrefixExpr).right) })); } - else if ((*node._v__ast__Expr)._typ == 269 /* v.ast.IndexExpr */) { + else if ((*node._v__ast__Expr)._typ == 270 /* v.ast.IndexExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__IndexExpr).left) })); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__IndexExpr).index) })); } - else if ((*node._v__ast__Expr)._typ == 267 /* v.ast.IfExpr */) { + else if ((*node._v__ast__Expr)._typ == 268 /* v.ast.IfExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__IfExpr).left) })); Array_v__ast__Node _t42 = {0}; Array_v__ast__IfBranch _t42_orig = (*(*node._v__ast__Expr)._v__ast__IfExpr).branches; @@ -42753,7 +42794,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t42), _t41, Array_v__ast__Node); } - else if ((*node._v__ast__Expr)._typ == 276 /* v.ast.MatchExpr */) { + else if ((*node._v__ast__Expr)._typ == 277 /* v.ast.MatchExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__MatchExpr).cond) })); Array_v__ast__Node _t46 = {0}; Array_v__ast__MatchBranch _t46_orig = (*(*node._v__ast__Expr)._v__ast__MatchExpr).branches; @@ -42767,7 +42808,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t46), _t45, Array_v__ast__Node); } - else if ((*node._v__ast__Expr)._typ == 285 /* v.ast.SelectExpr */) { + else if ((*node._v__ast__Expr)._typ == 286 /* v.ast.SelectExpr */) { Array_v__ast__Node _t49 = {0}; Array_v__ast__SelectBranch _t49_orig = (*(*node._v__ast__Expr)._v__ast__SelectExpr).branches; int _t49_len = _t49_orig.len; @@ -42781,10 +42822,10 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t48 =_t49; return _t48; } - else if ((*node._v__ast__Expr)._typ == 254 /* v.ast.ChanInit */) { + else if ((*node._v__ast__Expr)._typ == 255 /* v.ast.ChanInit */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ChanInit).cap_expr) })); } - else if ((*node._v__ast__Expr)._typ == 275 /* v.ast.MapInit */) { + else if ((*node._v__ast__Expr)._typ == 276 /* v.ast.MapInit */) { Array_v__ast__Node _t53 = {0}; Array_v__ast__Expr _t53_orig = (*(*node._v__ast__Expr)._v__ast__MapInit).keys; int _t53_len = _t53_orig.len; @@ -42808,15 +42849,15 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t56), _t55, Array_v__ast__Node); } - else if ((*node._v__ast__Expr)._typ == 284 /* v.ast.RangeExpr */) { + else if ((*node._v__ast__Expr)._typ == 285 /* v.ast.RangeExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__RangeExpr).low) })); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__RangeExpr).high) })); } - else if ((*node._v__ast__Expr)._typ == 253 /* v.ast.CastExpr */) { + else if ((*node._v__ast__Expr)._typ == 254 /* v.ast.CastExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__CastExpr).expr) })); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__CastExpr).arg) })); } - else if ((*node._v__ast__Expr)._typ == 260 /* v.ast.ConcatExpr */) { + else if ((*node._v__ast__Expr)._typ == 261 /* v.ast.ConcatExpr */) { Array_v__ast__Node _t63 = {0}; Array_v__ast__Expr _t63_orig = (*(*node._v__ast__Expr)._v__ast__ConcatExpr).vals; int _t63_len = _t63_orig.len; @@ -42830,18 +42871,18 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t62 =_t63; return _t62; } - else if ((*node._v__ast__Expr)._typ == 257 /* v.ast.ComptimeCall */) { + else if ((*node._v__ast__Expr)._typ == 258 /* v.ast.ComptimeCall */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ComptimeCall).left) })); } - else if ((*node._v__ast__Expr)._typ == 258 /* v.ast.ComptimeSelector */) { + else if ((*node._v__ast__Expr)._typ == 259 /* v.ast.ComptimeSelector */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ComptimeSelector).left) })); } else { } ; - } else if ((node)._typ == 320 /* v.ast.Stmt */) { - if ((*node._v__ast__Stmt)._typ == 299 /* v.ast.Block */) { + } else if ((node)._typ == 321 /* v.ast.Stmt */) { + if ((*node._v__ast__Stmt)._typ == 300 /* v.ast.Block */) { Array_v__ast__Node _t68 = {0}; Array_v__ast__Stmt _t68_orig = (*(*node._v__ast__Stmt)._v__ast__Block).stmts; int _t68_len = _t68_orig.len; @@ -42855,7 +42896,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t67 =_t68; return _t67; } - else if ((*node._v__ast__Stmt)._typ == 303 /* v.ast.DeferStmt */) { + else if ((*node._v__ast__Stmt)._typ == 304 /* v.ast.DeferStmt */) { Array_v__ast__Node _t71 = {0}; Array_v__ast__Stmt _t71_orig = (*(*node._v__ast__Stmt)._v__ast__DeferStmt).stmts; int _t71_len = _t71_orig.len; @@ -42869,7 +42910,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t70 =_t71; return _t70; } - else if ((*node._v__ast__Stmt)._typ == 307 /* v.ast.ForCStmt */) { + else if ((*node._v__ast__Stmt)._typ == 308 /* v.ast.ForCStmt */) { Array_v__ast__Node _t74 = {0}; Array_v__ast__Stmt _t74_orig = (*(*node._v__ast__Stmt)._v__ast__ForCStmt).stmts; int _t74_len = _t74_orig.len; @@ -42883,7 +42924,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t73 =_t74; return _t73; } - else if ((*node._v__ast__Stmt)._typ == 308 /* v.ast.ForInStmt */) { + else if ((*node._v__ast__Stmt)._typ == 309 /* v.ast.ForInStmt */) { Array_v__ast__Node _t77 = {0}; Array_v__ast__Stmt _t77_orig = (*(*node._v__ast__Stmt)._v__ast__ForInStmt).stmts; int _t77_len = _t77_orig.len; @@ -42897,7 +42938,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t76 =_t77; return _t76; } - else if ((*node._v__ast__Stmt)._typ == 309 /* v.ast.ForStmt */) { + else if ((*node._v__ast__Stmt)._typ == 310 /* v.ast.ForStmt */) { Array_v__ast__Node _t80 = {0}; Array_v__ast__Stmt _t80_orig = (*(*node._v__ast__Stmt)._v__ast__ForStmt).stmts; int _t80_len = _t80_orig.len; @@ -42911,7 +42952,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t79 =_t80; return _t79; } - else if ((*node._v__ast__Stmt)._typ == 301 /* v.ast.ComptimeFor */) { + else if ((*node._v__ast__Stmt)._typ == 302 /* v.ast.ComptimeFor */) { Array_v__ast__Node _t83 = {0}; Array_v__ast__Stmt _t83_orig = (*(*node._v__ast__Stmt)._v__ast__ComptimeFor).stmts; int _t83_len = _t83_orig.len; @@ -42925,13 +42966,13 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t82 =_t83; return _t82; } - else if ((*node._v__ast__Stmt)._typ == 306 /* v.ast.ExprStmt */) { + else if ((*node._v__ast__Stmt)._typ == 307 /* v.ast.ExprStmt */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Stmt)._v__ast__ExprStmt).expr) })); } - else if ((*node._v__ast__Stmt)._typ == 297 /* v.ast.AssertStmt */) { + else if ((*node._v__ast__Stmt)._typ == 298 /* v.ast.AssertStmt */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Stmt)._v__ast__AssertStmt).expr) })); } - else if ((*node._v__ast__Stmt)._typ == 315 /* v.ast.InterfaceDecl */) { + else if ((*node._v__ast__Stmt)._typ == 316 /* v.ast.InterfaceDecl */) { Array_v__ast__Node _t88 = {0}; Array_v__ast__FnDecl _t88_orig = (*(*node._v__ast__Stmt)._v__ast__InterfaceDecl).methods; int _t88_len = _t88_orig.len; @@ -42955,7 +42996,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t91), _t90, Array_v__ast__Node); } - else if ((*node._v__ast__Stmt)._typ == 298 /* v.ast.AssignStmt */) { + else if ((*node._v__ast__Stmt)._typ == 299 /* v.ast.AssignStmt */) { Array_v__ast__Node _t94 = {0}; Array_v__ast__Expr _t94_orig = (*(*node._v__ast__Stmt)._v__ast__AssignStmt).left; int _t94_len = _t94_orig.len; @@ -42979,7 +43020,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t97), _t96, Array_v__ast__Node); } - else if ((*node._v__ast__Stmt)._typ == 317 /* v.ast.Return */) { + else if ((*node._v__ast__Stmt)._typ == 318 /* v.ast.Return */) { Array_v__ast__Node _t100 = {0}; Array_v__ast__Expr _t100_orig = (*(*node._v__ast__Stmt)._v__ast__Return).exprs; int _t100_len = _t100_orig.len; @@ -42993,7 +43034,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t99 =_t100; return _t99; } - else if ((*node._v__ast__Stmt)._typ == 319 /* v.ast.StructDecl */) { + else if ((*node._v__ast__Stmt)._typ == 320 /* v.ast.StructDecl */) { Array_v__ast__Node _t103 = {0}; Array_v__ast__StructField _t103_orig = (*(*node._v__ast__Stmt)._v__ast__StructDecl).fields; int _t103_len = _t103_orig.len; @@ -43007,7 +43048,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t102 =_t103; return _t102; } - else if ((*node._v__ast__Stmt)._typ == 310 /* v.ast.GlobalDecl */) { + else if ((*node._v__ast__Stmt)._typ == 311 /* v.ast.GlobalDecl */) { Array_v__ast__Node _t106 = {0}; Array_v__ast__GlobalField _t106_orig = (*(*node._v__ast__Stmt)._v__ast__GlobalDecl).fields; int _t106_len = _t106_orig.len; @@ -43021,7 +43062,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t105 =_t106; return _t105; } - else if ((*node._v__ast__Stmt)._typ == 302 /* v.ast.ConstDecl */) { + else if ((*node._v__ast__Stmt)._typ == 303 /* v.ast.ConstDecl */) { Array_v__ast__Node _t109 = {0}; Array_v__ast__ConstField _t109_orig = (*(*node._v__ast__Stmt)._v__ast__ConstDecl).fields; int _t109_len = _t109_orig.len; @@ -43035,7 +43076,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t108 =_t109; return _t108; } - else if ((*node._v__ast__Stmt)._typ == 305 /* v.ast.EnumDecl */) { + else if ((*node._v__ast__Stmt)._typ == 306 /* v.ast.EnumDecl */) { Array_v__ast__Node _t112 = {0}; Array_v__ast__EnumField _t112_orig = (*(*node._v__ast__Stmt)._v__ast__EnumDecl).fields; int _t112_len = _t112_orig.len; @@ -43049,7 +43090,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t111 =_t112; return _t111; } - else if ((*node._v__ast__Stmt)._typ == 183 /* v.ast.FnDecl */) { + else if ((*node._v__ast__Stmt)._typ == 184 /* v.ast.FnDecl */) { if ((*(*node._v__ast__Stmt)._v__ast__FnDecl).is_method) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__StructField_to_sumtype_v__ast__Node(&(*(*node._v__ast__Stmt)._v__ast__FnDecl).receiver) })); } @@ -43076,8 +43117,8 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t119), _t118, Array_v__ast__Node); } - else if ((*node._v__ast__Stmt)._typ == 243 /* v.ast.TypeDecl */) { - if (((*(*node._v__ast__Stmt)._v__ast__TypeDecl))._typ == 242 /* v.ast.SumTypeDecl */) { + else if ((*node._v__ast__Stmt)._typ == 244 /* v.ast.TypeDecl */) { + if (((*(*node._v__ast__Stmt)._v__ast__TypeDecl))._typ == 243 /* v.ast.SumTypeDecl */) { Array_v__ast__Node _t122 = {0}; Array_v__ast__TypeNode _t122_orig = (*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__SumTypeDecl).variants; int _t122_len = _t122_orig.len; @@ -43095,36 +43136,36 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { else { } ; - } else if ((node)._typ == 325 /* v.ast.ScopeObject */) { - if ((*node._v__ast__ScopeObject)._typ == 323 /* v.ast.GlobalField */) { + } else if ((node)._typ == 326 /* v.ast.ScopeObject */) { + if ((*node._v__ast__ScopeObject)._typ == 324 /* v.ast.GlobalField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__ScopeObject)._v__ast__GlobalField).expr) })); } - else if ((*node._v__ast__ScopeObject)._typ == 322 /* v.ast.ConstField */) { + else if ((*node._v__ast__ScopeObject)._typ == 323 /* v.ast.ConstField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__ScopeObject)._v__ast__ConstField).expr) })); } - else if ((*node._v__ast__ScopeObject)._typ == 324 /* v.ast.Var */) { + else if ((*node._v__ast__ScopeObject)._typ == 325 /* v.ast.Var */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__ScopeObject)._v__ast__Var).expr) })); } - else if ((*node._v__ast__ScopeObject)._typ == 321 /* v.ast.AsmRegister */) { + else if ((*node._v__ast__ScopeObject)._typ == 322 /* v.ast.AsmRegister */) { } ; } else { - if (node._typ == 323 /* v.ast.GlobalField */) { + if (node._typ == 324 /* v.ast.GlobalField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__GlobalField).expr) })); } - else if (node._typ == 322 /* v.ast.ConstField */) { + else if (node._typ == 323 /* v.ast.ConstField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__ConstField).expr) })); } - else if (node._typ == 328 /* v.ast.EnumField */) { + else if (node._typ == 329 /* v.ast.EnumField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__EnumField).expr) })); } - else if (node._typ == 334 /* v.ast.StructInitField */) { + else if (node._typ == 335 /* v.ast.StructInitField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__StructInitField).expr) })); } - else if (node._typ == 326 /* v.ast.CallArg */) { + else if (node._typ == 327 /* v.ast.CallArg */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__CallArg).expr) })); } - else if (node._typ == 332 /* v.ast.SelectBranch */) { + else if (node._typ == 333 /* v.ast.SelectBranch */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Stmt_to_sumtype_v__ast__Node(&(*node._v__ast__SelectBranch).stmt) })); Array_v__ast__Node _t134 = {0}; Array_v__ast__Stmt _t134_orig = (*node._v__ast__SelectBranch).stmts; @@ -43138,7 +43179,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t134), _t133, Array_v__ast__Node); } - else if (node._typ == 329 /* v.ast.IfBranch */) { + else if (node._typ == 330 /* v.ast.IfBranch */) { Array_v__ast__Node _t137 = {0}; Array_v__ast__Stmt _t137_orig = (*node._v__ast__IfBranch).stmts; int _t137_len = _t137_orig.len; @@ -43152,7 +43193,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t136 =_t137; return _t136; } - else if (node._typ == 174 /* v.ast.File */) { + else if (node._typ == 175 /* v.ast.File */) { Array_v__ast__Node _t140 = {0}; Array_v__ast__Stmt _t140_orig = (*node._v__ast__File).stmts; int _t140_len = _t140_orig.len; @@ -43166,7 +43207,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t139 =_t140; return _t139; } - else if (node._typ == 330 /* v.ast.MatchBranch */) { + else if (node._typ == 331 /* v.ast.MatchBranch */) { Array_v__ast__Node _t143 = {0}; Array_v__ast__Stmt _t143_orig = (*node._v__ast__MatchBranch).stmts; int _t143_len = _t143_orig.len; @@ -43201,7 +43242,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { void v__ast__IndexExpr_recursive_mapset_is_setter(v__ast__IndexExpr* lx, bool val) { lx->is_setter = val; - if ((lx->left)._typ == 269 /* v.ast.IndexExpr */) { + if ((lx->left)._typ == 270 /* v.ast.IndexExpr */) { if ((*lx->left._v__ast__IndexExpr).is_map) { v__ast__IndexExpr_recursive_mapset_is_setter(&(*lx->left._v__ast__IndexExpr), val); } @@ -43210,10 +43251,10 @@ void v__ast__IndexExpr_recursive_mapset_is_setter(v__ast__IndexExpr* lx, bool va void v__ast__IndexExpr_recursive_arraymap_set_is_setter(v__ast__IndexExpr* lx) { lx->is_setter = true; - if ((lx->left)._typ == 269 /* v.ast.IndexExpr */) { + if ((lx->left)._typ == 270 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*lx->left._v__ast__IndexExpr)); - } else if ((lx->left)._typ == 286 /* v.ast.SelectorExpr */) { - if (((*lx->left._v__ast__SelectorExpr).expr)._typ == 269 /* v.ast.IndexExpr */) { + } else if ((lx->left)._typ == 287 /* v.ast.SelectorExpr */) { + if (((*lx->left._v__ast__SelectorExpr).expr)._typ == 270 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*(*lx->left._v__ast__SelectorExpr).expr._v__ast__IndexExpr)); } } @@ -43274,7 +43315,7 @@ Map_string_v__ast__ScopeObject v__ast__all_registers(v__ast__Table* t, v__pref__ } int hash_index = (*(int*)_t11.data); - string assembled_name = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = string_substr(name, 0, hash_index)}}, {_SLIT0, 0xfe07, {.d_i32 = i}}, {_SLIT0, 0xfe10, {.d_s = string_substr(name, hash_index + 1, (name).len)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string assembled_name = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(name, 0, hash_index)}}, {_SLIT0, /*100 &int literal*/0xfe07, {.d_i32 = i}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(name, hash_index + 1, (name).len)}}, {_SLIT0, 0, { .d_c = 0 }}})); map_set(&res, &(string[]){assembled_name}, &(v__ast__ScopeObject[]) { v__ast__AsmRegister_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__AsmRegister, (((v__ast__AsmRegister){.name = assembled_name,.typ = v__ast__Table_bitsize_to_type(t, bit_size),.size = bit_size,})))) }); } } @@ -43402,7 +43443,7 @@ VV_LOCAL_SYMBOL Map_string_v__ast__ScopeObject v__ast__gen_all_registers(v__ast_ } int hash_index = (*(int*)_t5.data); - string assembled_name = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = string_substr(name, 0, hash_index)}}, {_SLIT0, 0xfe07, {.d_i32 = i}}, {_SLIT0, 0xfe10, {.d_s = string_substr(name, hash_index + 1, (name).len)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string assembled_name = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(name, 0, hash_index)}}, {_SLIT0, /*100 &int literal*/0xfe07, {.d_i32 = i}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(name, hash_index + 1, (name).len)}}, {_SLIT0, 0, { .d_c = 0 }}})); map_set(&res, &(string[]){assembled_name}, &(v__ast__ScopeObject[]) { v__ast__AsmRegister_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__AsmRegister, (((v__ast__AsmRegister){.name = assembled_name,.typ = v__ast__Table_bitsize_to_type(t, bit_size),.size = bit_size,})))) }); } } @@ -43411,43 +43452,43 @@ VV_LOCAL_SYMBOL Map_string_v__ast__ScopeObject v__ast__gen_all_registers(v__ast_ } bool v__ast__Expr_is_literal(v__ast__Expr expr) { - if (expr._typ == 250 /* v.ast.BoolLiteral */) { + if (expr._typ == 251 /* v.ast.BoolLiteral */) { bool _t1 = true; return _t1; } - else if (expr._typ == 255 /* v.ast.CharLiteral */) { + else if (expr._typ == 256 /* v.ast.CharLiteral */) { bool _t2 = true; return _t2; } - else if (expr._typ == 264 /* v.ast.FloatLiteral */) { + else if (expr._typ == 265 /* v.ast.FloatLiteral */) { bool _t3 = true; return _t3; } - else if (expr._typ == 271 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { bool _t4 = true; return _t4; } - else if (expr._typ == 283 /* v.ast.PrefixExpr */) { + else if (expr._typ == 284 /* v.ast.PrefixExpr */) { bool _t5 = v__ast__Expr_is_literal((*expr._v__ast__PrefixExpr).right); return _t5; } - else if (expr._typ == 270 /* v.ast.InfixExpr */) { + else if (expr._typ == 271 /* v.ast.InfixExpr */) { bool _t6 = v__ast__Expr_is_literal((*expr._v__ast__InfixExpr).left) && v__ast__Expr_is_literal((*expr._v__ast__InfixExpr).right); return _t6; } - else if (expr._typ == 281 /* v.ast.ParExpr */) { + else if (expr._typ == 282 /* v.ast.ParExpr */) { bool _t7 = v__ast__Expr_is_literal((*expr._v__ast__ParExpr).expr); return _t7; } - else if (expr._typ == 253 /* v.ast.CastExpr */) { + else if (expr._typ == 254 /* v.ast.CastExpr */) { bool _t8 = !(*expr._v__ast__CastExpr).has_arg && v__ast__Expr_is_literal((*expr._v__ast__CastExpr).expr) && (v__ast__Type_is_ptr((*expr._v__ast__CastExpr).typ) || v__ast__Type_is_pointer((*expr._v__ast__CastExpr).typ) || (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i8_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i16_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__int_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i64_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__byte_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u16_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u32_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u64_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__f32_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__f64_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__char_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__bool_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__rune_type))); return _t8; } - else if (expr._typ == 287 /* v.ast.SizeOf */) { + else if (expr._typ == 288 /* v.ast.SizeOf */) { bool _t9 = (*expr._v__ast__SizeOf).is_type || v__ast__Expr_is_literal((*expr._v__ast__SizeOf).expr); return _t9; } - else if (expr._typ == 272 /* v.ast.IsRefType */) { + else if (expr._typ == 273 /* v.ast.IsRefType */) { bool _t10 = (*expr._v__ast__IsRefType).is_type || v__ast__Expr_is_literal((*expr._v__ast__IsRefType).expr); return _t10; } @@ -43487,7 +43528,7 @@ VV_LOCAL_SYMBOL v__token__KeywordsMatcher v__ast__build_builtin_type_names_match } string v__ast__Attr_debug(v__ast__Attr* a) { - string _t1 = str_intp(8, _MOV((StrIntpData[]){{_SLIT("Attr{ name: \""), 0xfe10, {.d_s = a->name}}, {_SLIT("\", has_arg: "), 0xfe10, {.d_s = a->has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", arg: \""), 0xfe10, {.d_s = a->arg}}, {_SLIT("\", kind: "), 0xfe10, {.d_s = v__ast__AttrKind_str(a->kind)}}, {_SLIT(", ct_expr: "), 0xfe10, {.d_s = v__ast__Expr_str(a->ct_expr)}}, {_SLIT(", ct_opt: "), 0xfe10, {.d_s = a->ct_opt ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", ct_skip: "), 0xfe10, {.d_s = a->ct_skip ? _SLIT("true") : _SLIT("false")}}, {_SLIT("}"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(8, _MOV((StrIntpData[]){{_SLIT("Attr{ name: \""), /*115 &string*/0xfe10, {.d_s = a->name}}, {_SLIT("\", has_arg: "), /*115 &bool*/0xfe10, {.d_s = a->has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", arg: \""), /*115 &string*/0xfe10, {.d_s = a->arg}}, {_SLIT("\", kind: "), /*115 &v.ast.AttrKind*/0xfe10, {.d_s = v__ast__AttrKind_str(a->kind)}}, {_SLIT(", ct_expr: "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(a->ct_expr)}}, {_SLIT(", ct_opt: "), /*115 &bool*/0xfe10, {.d_s = a->ct_opt ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", ct_skip: "), /*115 &bool*/0xfe10, {.d_s = a->ct_skip ? _SLIT("true") : _SLIT("false")}}, {_SLIT("}"), 0, { .d_c = 0 }}})); return _t1; } @@ -43495,13 +43536,13 @@ string v__ast__Attr_str(v__ast__Attr* a) { string s = _SLIT(""); string _t1; /* if prepend */ if (a->has_arg) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = a->name}}, {_SLIT(": "), 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = a->name}}, {_SLIT(": "), 0, { .d_c = 0 }}}))); _t1 = a->arg; } else { _t1 = a->name; } string arg = _t1; - s = /*f*/string__plus(s, ((a->kind == (v__ast__AttrKind__plain) || a->kind == (v__ast__AttrKind__number) || a->kind == (v__ast__AttrKind__bool)) ? (arg) : (a->kind == (v__ast__AttrKind__string)) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = arg}}, {_SLIT("'"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("if "), 0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}}))))); + s = /*f*/string__plus(s, ((a->kind == (v__ast__AttrKind__plain) || a->kind == (v__ast__AttrKind__number) || a->kind == (v__ast__AttrKind__bool)) ? (arg) : (a->kind == (v__ast__AttrKind__string)) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT("'"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("if "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}}))))); string _t2 = s; return _t2; } @@ -43614,7 +43655,7 @@ Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, } if (((string__eq(name, _SLIT("-I")) || string__eq(name, _SLIT("-l")) || string__eq(name, _SLIT("-L")))) && (value).len == 0) { string hint = (string__eq(name, _SLIT("-l")) ? (_SLIT("library name")) : (_SLIT("path"))); - return (Option_bool){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT("bad #flag `"), 0xfe10, {.d_s = flag_orig}}, {_SLIT("`: missing "), 0xfe10, {.d_s = hint}}, {_SLIT(" after `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT("bad #flag `"), /*115 &string*/0xfe10, {.d_s = flag_orig}}, {_SLIT("`: missing "), /*115 &string*/0xfe10, {.d_s = hint}}, {_SLIT(" after `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__cflag__CFlag cf = ((v__cflag__CFlag){.mod = mod,.os = fos,.name = name,.value = value,.cached = (string){.str=(byteptr)"", .is_lit=1},}); if (!v__ast__Table_has_cflag(t, cf)) { @@ -43753,7 +43794,7 @@ Option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val) { opt_ok(&(i64[]) { ((int)((*val._rune))) }, (Option*)(&_t12), sizeof(i64)); return _t12; } - else if (val._typ == 262 /* v.ast.EmptyExpr */) { + else if (val._typ == 263 /* v.ast.EmptyExpr */) { } ; return (Option_i64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -43880,7 +43921,7 @@ Option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val) { } else if (val._typ == 21 /* rune */) { } - else if (val._typ == 262 /* v.ast.EmptyExpr */) { + else if (val._typ == 263 /* v.ast.EmptyExpr */) { } ; return (Option_u64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -43958,7 +43999,7 @@ Option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val) { } else if (val._typ == 21 /* rune */) { } - else if (val._typ == 262 /* v.ast.EmptyExpr */) { + else if (val._typ == 263 /* v.ast.EmptyExpr */) { } ; return (Option_f64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -44025,14 +44066,14 @@ Option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val opt_ok(&(string[]) { (*val._string) }, (Option*)(&_t12), sizeof(string)); return _t12; } - else if (val._typ == 262 /* v.ast.EmptyExpr */) { + else if (val._typ == 263 /* v.ast.EmptyExpr */) { } ; return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast__ConstField* obj) { - if ((obj->comptime_expr_value)._typ != 262 /* v.ast.EmptyExpr */) { + if ((obj->comptime_expr_value)._typ != 263 /* v.ast.EmptyExpr */) { Option_v__ast__ComptTimeConstValue _t1; opt_ok(&(v__ast__ComptTimeConstValue[]) { obj->comptime_expr_value }, (Option*)(&_t1), sizeof(v__ast__ComptTimeConstValue)); return _t1; @@ -44041,12 +44082,12 @@ Option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast } bool v__ast__ConstField_is_simple_define_const(v__ast__ConstField* obj) { - bool _t1 = ((obj->expr._typ == 255 /* v.ast.CharLiteral */) ? (true) : (obj->expr._typ == 264 /* v.ast.FloatLiteral */) ? (true) : (obj->expr._typ == 271 /* v.ast.IntegerLiteral */) ? (true) : (false)); + bool _t1 = ((obj->expr._typ == 256 /* v.ast.CharLiteral */) ? (true) : (obj->expr._typ == 265 /* v.ast.FloatLiteral */) ? (true) : (obj->expr._typ == 272 /* v.ast.IntegerLiteral */) ? (true) : (false)); return _t1; } bool v__ast__ScopeObject_is_simple_define_const(v__ast__ScopeObject obj) { - if ((obj)._typ == 322 /* v.ast.ConstField */) { + if ((obj)._typ == 323 /* v.ast.ConstField */) { bool _t1 = v__ast__ConstField_is_simple_define_const(&(*obj._v__ast__ConstField)); return _t1; } @@ -44055,14 +44096,14 @@ bool v__ast__ScopeObject_is_simple_define_const(v__ast__ScopeObject obj) { } u64 v__ast__EmbeddedFile_hash(v__ast__EmbeddedFile e) { - u64 _t1 = hash__fnv1a__sum64_string( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = e.apath}}, {_SLIT(", "), 0xfe10, {.d_s = e.compression_type}}, {_SLIT(", "), 0xfe10, {.d_s = e.is_compressed ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0xfe07, {.d_i32 = e.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); + u64 _t1 = hash__fnv1a__sum64_string( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = e.apath}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = e.compression_type}}, {_SLIT(", "), /*115 &bool*/0xfe10, {.d_s = e.is_compressed ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = e.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t1; } v__ast__Expr v__ast__resolve_init(v__ast__StructInit node, v__ast__Type typ, v__ast__Table* t) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(t, typ); if (type_sym->kind == v__ast__Kind__array) { - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; bool has_len = false; bool has_cap = false; bool has_default = false; @@ -44112,7 +44153,7 @@ v__ast__Expr v__ast__resolve_init(v__ast__StructInit node, v__ast__Type typ, v__ })))); return _t3; } else if (type_sym->kind == v__ast__Kind__map) { - v__ast__Map map_info = /* as */ *(v__ast__Map*)__as_cast((type_sym->info)._v__ast__Map,(type_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map map_info = /* as */ *(v__ast__Map*)__as_cast((type_sym->info)._v__ast__Map,(type_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; Array_v__ast__Expr keys = __new_array_with_default(0, 0, sizeof(v__ast__Expr), 0); Array_v__ast__Expr vals = __new_array_with_default(0, 0, sizeof(v__ast__Expr), 0); for (int _t4 = 0; _t4 < node.fields.len; ++_t4) { @@ -44188,7 +44229,7 @@ Option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name) { Option_v__ast__ScopeObject _t1; if (_t1 = v__ast__Scope_find(s, name), _t1.state == 0) { v__ast__ScopeObject* obj = HEAP(v__ast__ScopeObject, *(v__ast__ScopeObject*)_t1.data); - if ((*(obj))._typ == 324 /* v.ast.Var */) { + if ((*(obj))._typ == 325 /* v.ast.Var */) { Option_v__ast__Var_ptr _t2; opt_ok(&(v__ast__Var*[]) { &(*((obj->_v__ast__Var))) }, (Option*)(&_t2), sizeof(v__ast__Var*)); return _t2; @@ -44205,7 +44246,7 @@ Option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, strin Option_v__ast__ScopeObject _t1; if (_t1 = v__ast__Scope_find(s, name), _t1.state == 0) { v__ast__ScopeObject* obj = HEAP(v__ast__ScopeObject, *(v__ast__ScopeObject*)_t1.data); - if ((*(obj))._typ == 323 /* v.ast.GlobalField */) { + if ((*(obj))._typ == 324 /* v.ast.GlobalField */) { Option_v__ast__GlobalField_ptr _t2; opt_ok(&(v__ast__GlobalField*[]) { &(*((obj->_v__ast__GlobalField))) }, (Option*)(&_t2), sizeof(v__ast__GlobalField*)); return _t2; @@ -44222,7 +44263,7 @@ Option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string Option_v__ast__ScopeObject _t1; if (_t1 = v__ast__Scope_find(s, name), _t1.state == 0) { v__ast__ScopeObject* obj = HEAP(v__ast__ScopeObject, *(v__ast__ScopeObject*)_t1.data); - if ((*(obj))._typ == 322 /* v.ast.ConstField */) { + if ((*(obj))._typ == 323 /* v.ast.ConstField */) { Option_v__ast__ConstField_ptr _t2; opt_ok(&(v__ast__ConstField*[]) { &(*((obj->_v__ast__ConstField))) }, (Option*)(&_t2), sizeof(v__ast__ConstField*)); return _t2; @@ -44263,7 +44304,7 @@ bool v__ast__Scope_known_const(v__ast__Scope* s, string name) { void v__ast__Scope_update_var_type(v__ast__Scope* s, string name, v__ast__Type typ) { v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)map_get(ADDR(map, s->objects), &(string[]){name}, &(v__ast__ScopeObject[]){ {0} })); - if ((obj)._typ == 324 /* v.ast.Var */) { + if ((obj)._typ == 325 /* v.ast.Var */) { if (!v__ast__Type_alias_eq((*obj._v__ast__Var).typ, typ)) { (*obj._v__ast__Var).typ = typ; } @@ -44341,7 +44382,7 @@ bool v__ast__Scope_has_inherited_vars(v__ast__Scope* s) { } if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)DenseArray_value(&_t1.key_values, _t2)); - if ((obj)._typ == 324 /* v.ast.Var */) { + if ((obj)._typ == 325 /* v.ast.Var */) { if ((*obj._v__ast__Var).is_inherited) { bool _t5 = true; return _t5; @@ -44359,7 +44400,7 @@ v__ast__Scope* sc = HEAP(v__ast__Scope, _v_toheap_sc); for (int _t1 = 0; _t1 < depth * 4; ++_t1) { indent = /*f*/string__plus(indent, _SLIT(" ")); } - out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = indent}}, {_SLIT("# "), 0xfe07, {.d_i32 = (*(sc)).start_pos}}, {_SLIT(" - "), 0xfe07, {.d_i32 = (*(sc)).end_pos}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = indent}}, {_SLIT("# "), /*100 &int*/0xfe07, {.d_i32 = (*(sc)).start_pos}}, {_SLIT(" - "), /*100 &int*/0xfe07, {.d_i32 = (*(sc)).end_pos}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); Map_string_v__ast__ScopeObject _t2 = (*(sc)).objects; int _t4 = _t2.key_values.len; for (int _t3 = 0; _t3 < _t4; ++_t3 ) { @@ -44371,11 +44412,11 @@ v__ast__Scope* sc = HEAP(v__ast__Scope, _v_toheap_sc); } if (!DenseArray_has_index(&_t2.key_values, _t3)) {continue;} v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)DenseArray_value(&_t2.key_values, _t3)); - if (obj._typ == 322 /* v.ast.ConstField */) { - out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = indent}}, {_SLIT(" * const: "), 0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT(" - "), 0xfe10, {.d_s = v__ast__Type_str((*obj._v__ast__ConstField).typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + if (obj._typ == 323 /* v.ast.ConstField */) { + out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = indent}}, {_SLIT(" * const: "), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT(" - "), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str((*obj._v__ast__ConstField).typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); } - else if (obj._typ == 324 /* v.ast.Var */) { - out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = indent}}, {_SLIT(" * var: "), 0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT(" - "), 0xfe10, {.d_s = v__ast__Type_str((*obj._v__ast__Var).typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + else if (obj._typ == 325 /* v.ast.Var */) { + out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = indent}}, {_SLIT(" * var: "), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT(" - "), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str((*obj._v__ast__Var).typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); } else { @@ -44393,7 +44434,7 @@ v__ast__Scope* sc = HEAP(v__ast__Scope, _v_toheap_sc); } if (!DenseArray_has_index(&_t6.key_values, _t7)) {continue;} v__ast__ScopeStructField field = (*(v__ast__ScopeStructField*)DenseArray_value(&_t6.key_values, _t7)); - out = /*f*/string__plus(out, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = indent}}, {_SLIT(" * struct_field: "), 0xfe10, {.d_s = v__ast__Type_str(field.struct_type)}}, {_SLIT(" "), 0xfe10, {.d_s = field.name}}, {_SLIT(" - "), 0xfe10, {.d_s = v__ast__Type_str(field.typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + out = /*f*/string__plus(out, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = indent}}, {_SLIT(" * struct_field: "), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(field.struct_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" - "), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(field.typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); } if (max_depth == 0 || depth < max_depth - 1) { for (int i = 0; i < (*(sc)).children.len; ++i) { @@ -44425,7 +44466,7 @@ string v__ast__FnDecl_modname(v__ast__FnDecl* node) { string v__ast__FnDecl_fkey(v__ast__FnDecl* node) { if (node->is_method) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(node->receiver.typ))}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(node->receiver.typ))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string _t2 = node->name; @@ -44434,7 +44475,7 @@ string v__ast__FnDecl_fkey(v__ast__FnDecl* node) { string v__ast__Fn_fkey(v__ast__Fn* node) { if (node->is_method) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(node->receiver_type))}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(node->receiver_type))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string _t2 = node->name; @@ -44443,7 +44484,7 @@ string v__ast__Fn_fkey(v__ast__Fn* node) { string v__ast__CallExpr_fkey(v__ast__CallExpr* node) { if (node->is_method) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(node->receiver_type))}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(node->receiver_type))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string _t2 = node->name; @@ -44507,7 +44548,7 @@ VV_LOCAL_SYMBOL void v__ast__stringify_fn_after_name(v__ast__FnDecl* node, strin if (node->generic_names.len > 0) { if (node->is_method) { v__ast__TypeSymbol* sym = v__ast__Table_sym(t, (*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 0)).typ); - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { Array_string _t1 = {0}; Array_v__ast__Type _t1_orig = (*sym->info._v__ast__Struct).generic_types; int _t1_len = _t1_orig.len; @@ -44628,24 +44669,24 @@ multi_return_string_bool v__ast__StringInterLiteral_get_fspec_braces(v__ast__Str if (!needs_braces) { v__ast__Expr sub_expr = (*(v__ast__Expr*)/*ee elem_sym */array_get(lit->exprs, i)); for (;;) { - if (sub_expr._typ == 266 /* v.ast.Ident */) { + if (sub_expr._typ == 267 /* v.ast.Ident */) { if (string_at((*sub_expr._v__ast__Ident).name, 0) == '@') { needs_braces = true; } break; } - else if (sub_expr._typ == 252 /* v.ast.CallExpr */) { - if ((*sub_expr._v__ast__CallExpr).args.len != 0 || (*sub_expr._v__ast__CallExpr).concrete_types.len != 0 || (*sub_expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate || (*sub_expr._v__ast__CallExpr).or_block.stmts.len > 0) { + else if (sub_expr._typ == 253 /* v.ast.CallExpr */) { + if ((*sub_expr._v__ast__CallExpr).args.len != 0 || (*sub_expr._v__ast__CallExpr).concrete_types.len != 0 || (*sub_expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option || (*sub_expr._v__ast__CallExpr).or_block.stmts.len > 0) { needs_braces = true; - } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 252 /* v.ast.CallExpr */) { + } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 253 /* v.ast.CallExpr */) { sub_expr = (*sub_expr._v__ast__CallExpr).left; continue; - } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 253 /* v.ast.CastExpr */ || ((*sub_expr._v__ast__CallExpr).left)._typ == 269 /* v.ast.IndexExpr */) { + } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 254 /* v.ast.CastExpr */ || ((*sub_expr._v__ast__CallExpr).left)._typ == 270 /* v.ast.IndexExpr */) { needs_braces = true; } break; } - else if (sub_expr._typ == 286 /* v.ast.SelectorExpr */) { + else if (sub_expr._typ == 287 /* v.ast.SelectorExpr */) { if (string_at((*sub_expr._v__ast__SelectorExpr).field_name, 0) == '@') { needs_braces = true; break; @@ -44670,112 +44711,112 @@ multi_return_string_bool v__ast__StringInterLiteral_get_fspec_braces(v__ast__Str array_push((array*)&res, _MOV((string[]){ string_clone(_SLIT("0")) })); } if ((*(int*)/*ee elem_sym */array_get(lit->fwidths, i)) != 0) { - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = (*(int*)/*ee elem_sym */array_get(lit->fwidths, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = (*(int*)/*ee elem_sym */array_get(lit->fwidths, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((*(int*)/*ee elem_sym */array_get(lit->precisions, i)) != 987698) { - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe07, {.d_i32 = (*(int*)/*ee elem_sym */array_get(lit->precisions, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*100 &int*/0xfe07, {.d_i32 = (*(int*)/*ee elem_sym */array_get(lit->precisions, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((*(bool*)/*ee elem_sym */array_get(lit->need_fmts, i))) { - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe01, {.d_c = (*(u8*)/*ee elem_sym */array_get(lit->fmts, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*99 &u8*/0xfe01, {.d_c = (*(u8*)/*ee elem_sym */array_get(lit->fmts, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } return (multi_return_string_bool){.arg0=Array_string_join(res, _SLIT("")), .arg1=needs_braces}; } string v__ast__Expr_str(v__ast__Expr x) { - if (x._typ == 244 /* v.ast.AnonFn */) { + if (x._typ == 245 /* v.ast.AnonFn */) { string _t1 = _SLIT("anon_fn"); return _t1; } - else if (x._typ == 259 /* v.ast.ComptimeType */) { + else if (x._typ == 260 /* v.ast.ComptimeType */) { string _t2 = v__ast__ComptimeType_str((*x._v__ast__ComptimeType)); return _t2; } - else if (x._typ == 261 /* v.ast.DumpExpr */) { - string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("dump("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__DumpExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 262 /* v.ast.DumpExpr */) { + string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("dump("), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__DumpExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t3; } - else if (x._typ == 246 /* v.ast.ArrayInit */) { + else if (x._typ == 247 /* v.ast.ArrayInit */) { Array_string fields = __new_array_with_default(0, 0, sizeof(string), 0); if ((*x._v__ast__ArrayInit).has_len) { - array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("len: "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).len_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("len: "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).len_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((*x._v__ast__ArrayInit).has_cap) { - array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cap: "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).cap_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cap: "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).cap_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((*x._v__ast__ArrayInit).has_default) { - array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("init: "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).default_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("init: "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).default_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (fields.len > 0) { - string _t7 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[]T{"), 0xfe10, {.d_s = Array_string_join(fields, _SLIT(", "))}}, {_SLIT("}"), 0, { .d_c = 0 }}})); + string _t7 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[]T{"), /*115 &string*/0xfe10, {.d_s = Array_string_join(fields, _SLIT(", "))}}, {_SLIT("}"), 0, { .d_c = 0 }}})); return _t7; } else { string _t8 = Array_v__ast__Expr_str((*x._v__ast__ArrayInit).exprs); return _t8; } } - else if (x._typ == 247 /* v.ast.AsCast */) { - string _t9 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__AsCast).expr)}}, {_SLIT(" as "), 0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__AsCast).typ)}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 248 /* v.ast.AsCast */) { + string _t9 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__AsCast).expr)}}, {_SLIT(" as "), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__AsCast).typ)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t9; } - else if (x._typ == 249 /* v.ast.AtExpr */) { - string _t10 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__AtExpr).val}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 250 /* v.ast.AtExpr */) { + string _t10 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__AtExpr).val}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t10; } - else if (x._typ == 251 /* v.ast.CTempVar */) { + else if (x._typ == 252 /* v.ast.CTempVar */) { string _t11 = v__ast__Expr_str((*x._v__ast__CTempVar).orig); return _t11; } - else if (x._typ == 250 /* v.ast.BoolLiteral */) { + else if (x._typ == 251 /* v.ast.BoolLiteral */) { string _t12 = bool_str((*x._v__ast__BoolLiteral).val); return _t12; } - else if (x._typ == 253 /* v.ast.CastExpr */) { - string _t13 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CastExpr).typname}}, {_SLIT("("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__CastExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 254 /* v.ast.CastExpr */) { + string _t13 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CastExpr).typname}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__CastExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t13; } - else if (x._typ == 252 /* v.ast.CallExpr */) { + else if (x._typ == 253 /* v.ast.CallExpr */) { string sargs = v__ast__args2str((*x._v__ast__CallExpr).args); - string propagate_suffix = ((*x._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate ? (_SLIT(" ?")) : (_SLIT(""))); + string propagate_suffix = ((*x._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option ? (_SLIT(" ?")) : (_SLIT(""))); if ((*x._v__ast__CallExpr).is_method) { - string _t14 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__CallExpr).left)}}, {_SLIT("."), 0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t14 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__CallExpr).left)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t14; } - if (string_starts_with((*x._v__ast__CallExpr).name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CallExpr).mod}}, {_SLIT("."), 0, { .d_c = 0 }}})))) { - string _t15 = v__util__strip_main_name( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + if (string_starts_with((*x._v__ast__CallExpr).name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).mod}}, {_SLIT("."), 0, { .d_c = 0 }}})))) { + string _t15 = v__util__strip_main_name( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t15; } if (((*x._v__ast__CallExpr).mod).len == 0 && ((*x._v__ast__CallExpr).name).len == 0) { - string _t16 = string__plus(v__ast__Expr_str((*x._v__ast__CallExpr).left), str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string _t16 = string__plus(v__ast__Expr_str((*x._v__ast__CallExpr).left), str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t16; } if (string_contains((*x._v__ast__CallExpr).name, _SLIT("."))) { - string _t17 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t17 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t17; } - string _t18 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CallExpr).mod}}, {_SLIT("."), 0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t18 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t18; } - else if (x._typ == 255 /* v.ast.CharLiteral */) { - string _t19 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*x._v__ast__CharLiteral).val}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + else if (x._typ == 256 /* v.ast.CharLiteral */) { + string _t19 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CharLiteral).val}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t19; } - else if (x._typ == 256 /* v.ast.Comment */) { + else if (x._typ == 257 /* v.ast.Comment */) { if ((*x._v__ast__Comment).is_multi) { Array_string lines = string_split_into_lines((*x._v__ast__Comment).text); - string _t20 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* "), 0xfe07, {.d_i32 = lines.len}}, {_SLIT(" lines comment */"), 0, { .d_c = 0 }}})); + string _t20 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* "), /*100 &int*/0xfe07, {.d_i32 = lines.len}}, {_SLIT(" lines comment */"), 0, { .d_c = 0 }}})); return _t20; } else { string text = string_trim_space(string_trim((*x._v__ast__Comment).text, _SLIT("\001"))); - string _t21 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("´// "), 0xfe10, {.d_s = text}}, {_SLIT("´"), 0, { .d_c = 0 }}})); + string _t21 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("´// "), /*115 &string*/0xfe10, {.d_s = text}}, {_SLIT("´"), 0, { .d_c = 0 }}})); return _t21; } } - else if (x._typ == 258 /* v.ast.ComptimeSelector */) { - string _t22 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ComptimeSelector).left)}}, {_SLIT(".$"), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ComptimeSelector).field_expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 259 /* v.ast.ComptimeSelector */) { + string _t22 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ComptimeSelector).left)}}, {_SLIT(".$"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ComptimeSelector).field_expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t22; } - else if (x._typ == 260 /* v.ast.ConcatExpr */) { + else if (x._typ == 261 /* v.ast.ConcatExpr */) { Array_string _t24 = {0}; Array_v__ast__Expr _t24_orig = (*x._v__ast__ConcatExpr).vals; int _t24_len = _t24_orig.len; @@ -44789,36 +44830,36 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t23 = Array_string_join(_t24, _SLIT(",")); return _t23; } - else if (x._typ == 263 /* v.ast.EnumVal */) { - string _t26 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = (*x._v__ast__EnumVal).val}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 264 /* v.ast.EnumVal */) { + string _t26 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__EnumVal).val}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t26; } - else if (x._typ == 264 /* v.ast.FloatLiteral */) { + else if (x._typ == 265 /* v.ast.FloatLiteral */) { string _t27 = (*x._v__ast__FloatLiteral).val; return _t27; } - else if (x._typ == 271 /* v.ast.IntegerLiteral */) { + else if (x._typ == 272 /* v.ast.IntegerLiteral */) { string _t28 = (*x._v__ast__IntegerLiteral).val; return _t28; } - else if (x._typ == 265 /* v.ast.GoExpr */) { - string _t29 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("go "), 0xfe10, {.d_s = v__ast__CallExpr_str((*x._v__ast__GoExpr).call_expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 266 /* v.ast.GoExpr */) { + string _t29 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("go "), /*115 &v.ast.CallExpr*/0xfe10, {.d_s = v__ast__CallExpr_str((*x._v__ast__GoExpr).call_expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t29; } - else if (x._typ == 266 /* v.ast.Ident */) { + else if (x._typ == 267 /* v.ast.Ident */) { string _t30 = (*x._v__ast__Ident).name; return _t30; } - else if (x._typ == 267 /* v.ast.IfExpr */) { + else if (x._typ == 268 /* v.ast.IfExpr */) { Array_string parts = __new_array_with_default(0, 0, sizeof(string), 0); string dollar = ((*x._v__ast__IfExpr).is_comptime ? (_SLIT("$")) : (_SLIT(""))); for (int i = 0; i < (*x._v__ast__IfExpr).branches.len; ++i) { v__ast__IfBranch branch = ((v__ast__IfBranch*)(*x._v__ast__IfExpr).branches.data)[i]; if (i != 0) { - array_push((array*)&parts, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" } "), 0xfe10, {.d_s = dollar}}, {_SLIT("else "), 0, { .d_c = 0 }}}))) })); + array_push((array*)&parts, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" } "), /*115 &string*/0xfe10, {.d_s = dollar}}, {_SLIT("else "), 0, { .d_c = 0 }}}))) })); } if (i < (*x._v__ast__IfExpr).branches.len - 1 || !(*x._v__ast__IfExpr).has_else) { - array_push((array*)&parts, _MOV((string[]){ string_clone(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = dollar}}, {_SLIT("if "), 0, { .d_c = 0 }}})), v__ast__Expr_str(branch.cond)), _SLIT(" { "))) })); + array_push((array*)&parts, _MOV((string[]){ string_clone(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dollar}}, {_SLIT("if "), 0, { .d_c = 0 }}})), v__ast__Expr_str(branch.cond)), _SLIT(" { "))) })); } for (int _t33 = 0; _t33 < branch.stmts.len; ++_t33) { v__ast__Stmt stmt = ((v__ast__Stmt*)branch.stmts.data)[_t33]; @@ -44829,72 +44870,72 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t36 = Array_string_join(parts, _SLIT("")); return _t36; } - else if (x._typ == 269 /* v.ast.IndexExpr */) { - string _t37 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__IndexExpr).left)}}, {_SLIT("["), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__IndexExpr).index)}}, {_SLIT("]"), 0, { .d_c = 0 }}})); + else if (x._typ == 270 /* v.ast.IndexExpr */) { + string _t37 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__IndexExpr).left)}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__IndexExpr).index)}}, {_SLIT("]"), 0, { .d_c = 0 }}})); return _t37; } - else if (x._typ == 270 /* v.ast.InfixExpr */) { - string _t38 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__InfixExpr).left)}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str((*x._v__ast__InfixExpr).op)}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__InfixExpr).right)}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 271 /* v.ast.InfixExpr */) { + string _t38 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__InfixExpr).left)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str((*x._v__ast__InfixExpr).op)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__InfixExpr).right)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t38; } - else if (x._typ == 275 /* v.ast.MapInit */) { + else if (x._typ == 276 /* v.ast.MapInit */) { Array_string pairs = __new_array_with_default(0, 0, sizeof(string), 0); for (int ik = 0; ik < (*x._v__ast__MapInit).keys.len; ++ik) { v__ast__Expr kv = ((v__ast__Expr*)(*x._v__ast__MapInit).keys.data)[ik]; string mv = v__ast__Expr_str((*(v__ast__Expr*)/*ee elem_sym */array_get((*x._v__ast__MapInit).vals, ik))); - array_push((array*)&pairs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(kv)}}, {_SLIT(": "), 0xfe10, {.d_s = mv}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&pairs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(kv)}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = mv}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } - string _t40 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("map{ "), 0xfe10, {.d_s = Array_string_join(pairs, _SLIT(" "))}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); + string _t40 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("map{ "), /*115 &string*/0xfe10, {.d_s = Array_string_join(pairs, _SLIT(" "))}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); return _t40; } - else if (x._typ == 281 /* v.ast.ParExpr */) { - string _t41 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ParExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 282 /* v.ast.ParExpr */) { + string _t41 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ParExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t41; } - else if (x._typ == 282 /* v.ast.PostfixExpr */) { + else if (x._typ == 283 /* v.ast.PostfixExpr */) { if ((*x._v__ast__PostfixExpr).op == v__token__Kind__question) { - string _t42 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__PostfixExpr).expr)}}, {_SLIT(" ?"), 0, { .d_c = 0 }}})); + string _t42 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__PostfixExpr).expr)}}, {_SLIT(" ?"), 0, { .d_c = 0 }}})); return _t42; } - string _t43 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__PostfixExpr).expr)}}, {_SLIT0, 0xfe10, {.d_s = v__token__Kind_str((*x._v__ast__PostfixExpr).op)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t43 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__PostfixExpr).expr)}}, {_SLIT0, /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str((*x._v__ast__PostfixExpr).op)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t43; } - else if (x._typ == 283 /* v.ast.PrefixExpr */) { + else if (x._typ == 284 /* v.ast.PrefixExpr */) { string _t44 = string__plus(v__token__Kind_str((*x._v__ast__PrefixExpr).op), v__ast__Expr_str((*x._v__ast__PrefixExpr).right)); return _t44; } - else if (x._typ == 284 /* v.ast.RangeExpr */) { + else if (x._typ == 285 /* v.ast.RangeExpr */) { string s = _SLIT(".."); if ((*x._v__ast__RangeExpr).has_low) { - s = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__RangeExpr).low)}}, {_SLIT(" "), 0, { .d_c = 0 }}})), s); + s = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__RangeExpr).low)}}, {_SLIT(" "), 0, { .d_c = 0 }}})), s); } if ((*x._v__ast__RangeExpr).has_high) { - s = string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__RangeExpr).high)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + s = string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__RangeExpr).high)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string _t45 = s; return _t45; } - else if (x._typ == 285 /* v.ast.SelectExpr */) { + else if (x._typ == 286 /* v.ast.SelectExpr */) { string _t46 = _SLIT("ast.SelectExpr"); return _t46; } - else if (x._typ == 286 /* v.ast.SelectorExpr */) { - string _t47 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__SelectorExpr).expr)}}, {_SLIT("."), 0xfe10, {.d_s = (*x._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 287 /* v.ast.SelectorExpr */) { + string _t47 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__SelectorExpr).expr)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t47; } - else if (x._typ == 287 /* v.ast.SizeOf */) { + else if (x._typ == 288 /* v.ast.SizeOf */) { if ((*x._v__ast__SizeOf).is_type) { - string _t48 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__SizeOf).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string _t48 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__SizeOf).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t48; } - string _t49 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__SizeOf).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string _t49 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__SizeOf).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t49; } - else if (x._typ == 279 /* v.ast.OffsetOf */) { - string _t50 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__offsetof("), 0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__OffsetOf).struct_type)}}, {_SLIT(", "), 0xfe10, {.d_s = (*x._v__ast__OffsetOf).field}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 280 /* v.ast.OffsetOf */) { + string _t50 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__offsetof("), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__OffsetOf).struct_type)}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__OffsetOf).field}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t50; } - else if (x._typ == 289 /* v.ast.StringInterLiteral */) { + else if (x._typ == 290 /* v.ast.StringInterLiteral */) { strings__Builder res = strings__new_builder(50); strings__Builder_write_string(&res, _SLIT("'")); for (int i = 0; i < (*x._v__ast__StringInterLiteral).vals.len; ++i) { @@ -44904,9 +44945,9 @@ string v__ast__Expr_str(v__ast__Expr x) { break; } strings__Builder_write_string(&res, _SLIT("$")); - multi_return_string_bool mr_10119 = v__ast__StringInterLiteral_get_fspec_braces(&(*x._v__ast__StringInterLiteral), i); - string fspec_str = mr_10119.arg0; - bool needs_braces = mr_10119.arg1; + multi_return_string_bool mr_10139 = v__ast__StringInterLiteral_get_fspec_braces(&(*x._v__ast__StringInterLiteral), i); + string fspec_str = mr_10139.arg0; + bool needs_braces = mr_10139.arg1; if (needs_braces) { strings__Builder_write_string(&res, _SLIT("{")); strings__Builder_write_string(&res, v__ast__Expr_str((*(v__ast__Expr*)/*ee elem_sym */array_get((*x._v__ast__StringInterLiteral).exprs, i)))); @@ -44920,35 +44961,35 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t51 = strings__Builder_str(&res); return _t51; } - else if (x._typ == 290 /* v.ast.StringLiteral */) { - string _t52 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = (*x._v__ast__StringLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}})); + else if (x._typ == 291 /* v.ast.StringLiteral */) { + string _t52 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__StringLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}})); return _t52; } - else if (x._typ == 292 /* v.ast.TypeNode */) { - string _t53 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("TypeNode("), 0xfe10, {.d_s = v__ast__Type_str((*x._v__ast__TypeNode).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 293 /* v.ast.TypeNode */) { + string _t53 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("TypeNode("), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str((*x._v__ast__TypeNode).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t53; } - else if (x._typ == 293 /* v.ast.TypeOf */) { - string _t54 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typeof("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__TypeOf).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 294 /* v.ast.TypeOf */) { + string _t54 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typeof("), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__TypeOf).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t54; } - else if (x._typ == 273 /* v.ast.Likely */) { - string _t55 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_likely_("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__Likely).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 274 /* v.ast.Likely */) { + string _t55 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_likely_("), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__Likely).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t55; } - else if (x._typ == 294 /* v.ast.UnsafeExpr */) { - string _t56 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsafe { "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__UnsafeExpr).expr)}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); + else if (x._typ == 295 /* v.ast.UnsafeExpr */) { + string _t56 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsafe { "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__UnsafeExpr).expr)}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); return _t56; } - else if (x._typ == 278 /* v.ast.None */) { + else if (x._typ == 279 /* v.ast.None */) { string _t57 = _SLIT("none"); return _t57; } - else if (x._typ == 272 /* v.ast.IsRefType */) { + else if (x._typ == 273 /* v.ast.IsRefType */) { string _t58 = string__plus(string__plus(_SLIT("isreftype("), ((*x._v__ast__IsRefType).is_type ? (v__ast__Table_type_to_str(global_table, (*x._v__ast__IsRefType).typ)) : (v__ast__Expr_str((*x._v__ast__IsRefType).expr)))), _SLIT(")")); return _t58; } - else if (x._typ == 268 /* v.ast.IfGuardExpr */) { + else if (x._typ == 269 /* v.ast.IfGuardExpr */) { string s = _SLIT(""); for (int i = 0; i < (*x._v__ast__IfGuardExpr).vars.len; ++i) { v__ast__IfGuardVar var = ((v__ast__IfGuardVar*)(*x._v__ast__IfGuardExpr).vars.data)[i]; @@ -44960,62 +45001,62 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t59 = string__plus(string__plus(s, _SLIT(" := ")), v__ast__Expr_str((*x._v__ast__IfGuardExpr).expr)); return _t59; } - else if (x._typ == 291 /* v.ast.StructInit */) { + else if (x._typ == 292 /* v.ast.StructInit */) { string sname = v__ast__Table_sym(global_table, (*x._v__ast__StructInit).typ)->name; - string _t60 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sname}}, {_SLIT("{....}"), 0, { .d_c = 0 }}})); + string _t60 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sname}}, {_SLIT("{....}"), 0, { .d_c = 0 }}})); return _t60; } - else if (x._typ == 245 /* v.ast.ArrayDecompose */) { + else if (x._typ == 246 /* v.ast.ArrayDecompose */) { string _t61 = _SLIT("ast.ArrayDecompose"); return _t61; } - else if (x._typ == 248 /* v.ast.Assoc */) { + else if (x._typ == 249 /* v.ast.Assoc */) { string _t62 = _SLIT("ast.Assoc"); return _t62; } - else if (x._typ == 254 /* v.ast.ChanInit */) { + else if (x._typ == 255 /* v.ast.ChanInit */) { string _t63 = _SLIT("ast.ChanInit"); return _t63; } - else if (x._typ == 257 /* v.ast.ComptimeCall */) { + else if (x._typ == 258 /* v.ast.ComptimeCall */) { string _t64 = _SLIT("ast.ComptimeCall"); return _t64; } - else if (x._typ == 262 /* v.ast.EmptyExpr */) { + else if (x._typ == 263 /* v.ast.EmptyExpr */) { string _t65 = _SLIT("ast.EmptyExpr"); return _t65; } - else if (x._typ == 274 /* v.ast.LockExpr */) { + else if (x._typ == 275 /* v.ast.LockExpr */) { string _t66 = _SLIT("ast.LockExpr"); return _t66; } - else if (x._typ == 276 /* v.ast.MatchExpr */) { + else if (x._typ == 277 /* v.ast.MatchExpr */) { string _t67 = _SLIT("ast.MatchExpr"); return _t67; } - else if (x._typ == 277 /* v.ast.NodeError */) { + else if (x._typ == 278 /* v.ast.NodeError */) { string _t68 = _SLIT("ast.NodeError"); return _t68; } - else if (x._typ == 280 /* v.ast.OrExpr */) { + else if (x._typ == 281 /* v.ast.OrExpr */) { string _t69 = _SLIT("ast.OrExpr"); return _t69; } - else if (x._typ == 288 /* v.ast.SqlExpr */) { + else if (x._typ == 289 /* v.ast.SqlExpr */) { string _t70 = _SLIT("ast.SqlExpr"); return _t70; } ; - string _t71 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[unhandled expr type "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (x)._typ ))}}, {_SLIT("]"), 0, { .d_c = 0 }}})); + string _t71 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[unhandled expr type "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (x)._typ ))}}, {_SLIT("]"), 0, { .d_c = 0 }}})); return _t71; } string v__ast__CallArg_str(v__ast__CallArg a) { if (a.is_mut) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("mut "), 0xfe10, {.d_s = v__ast__Expr_str(a.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("mut "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str(a.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } - string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(a.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str(a.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } @@ -45030,24 +45071,24 @@ string v__ast__args2str(Array_v__ast__CallArg args) { } string v__ast__BranchStmt_str(v__ast__BranchStmt* node) { - string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__token__Kind_str(node->kind)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->kind)}}, {_SLIT0, 0, { .d_c = 0 }}})); if (node->label.len > 0) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = node->label}}, {_SLIT0, 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = node->label}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string _t1 = s; return _t1; } string v__ast__Stmt_str(v__ast__Stmt node) { - if (node._typ == 297 /* v.ast.AssertStmt */) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("assert "), 0xfe10, {.d_s = v__ast__Expr_str((*node._v__ast__AssertStmt).expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + if (node._typ == 298 /* v.ast.AssertStmt */) { + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("assert "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*node._v__ast__AssertStmt).expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } - else if (node._typ == 298 /* v.ast.AssignStmt */) { + else if (node._typ == 299 /* v.ast.AssignStmt */) { string out = _SLIT(""); for (int i = 0; i < (*node._v__ast__AssignStmt).left.len; ++i) { v__ast__Expr left = ((v__ast__Expr*)(*node._v__ast__AssignStmt).left.data)[i]; - if ((left)._typ == 266 /* v.ast.Ident */) { + if ((left)._typ == 267 /* v.ast.Ident */) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*left._v__ast__Ident)); if (var_info.is_mut) { out = /*f*/string__plus(out, _SLIT("mut ")); @@ -45058,7 +45099,7 @@ string v__ast__Stmt_str(v__ast__Stmt node) { out = /*f*/string__plus(out, _SLIT(",")); } } - out = /*f*/string__plus(out, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str((*node._v__ast__AssignStmt).op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + out = /*f*/string__plus(out, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str((*node._v__ast__AssignStmt).op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); for (int i = 0; i < (*node._v__ast__AssignStmt).right.len; ++i) { v__ast__Expr val = ((v__ast__Expr*)(*node._v__ast__AssignStmt).right.data)[i]; out = /*f*/string__plus(out, v__ast__Expr_str(val)); @@ -45069,11 +45110,11 @@ string v__ast__Stmt_str(v__ast__Stmt node) { string _t2 = out; return _t2; } - else if (node._typ == 300 /* v.ast.BranchStmt */) { + else if (node._typ == 301 /* v.ast.BranchStmt */) { string _t3 = v__ast__BranchStmt_str(&(*node._v__ast__BranchStmt)); return _t3; } - else if (node._typ == 302 /* v.ast.ConstDecl */) { + else if (node._typ == 303 /* v.ast.ConstDecl */) { Array_string _t4 = {0}; Array_v__ast__ConstField _t4_orig = (*node._v__ast__ConstDecl).fields; int _t4_len = _t4_orig.len; @@ -45085,40 +45126,40 @@ string v__ast__Stmt_str(v__ast__Stmt node) { array_push((array*)&_t4, &ti); } Array_string fields =_t4; - string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("const ("), 0xfe10, {.d_s = Array_string_join(fields, _SLIT(" "))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("const ("), /*115 &string*/0xfe10, {.d_s = Array_string_join(fields, _SLIT(" "))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t6; } - else if (node._typ == 306 /* v.ast.ExprStmt */) { + else if (node._typ == 307 /* v.ast.ExprStmt */) { string _t7 = v__ast__Expr_str((*node._v__ast__ExprStmt).expr); return _t7; } - else if (node._typ == 183 /* v.ast.FnDecl */) { - string _t8 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn "), 0xfe10, {.d_s = (*node._v__ast__FnDecl).name}}, {_SLIT("( "), 0xfe07, {.d_i32 = (*node._v__ast__FnDecl).params.len}}, {_SLIT(" params ) { "), 0xfe07, {.d_i32 = (*node._v__ast__FnDecl).stmts.len}}, {_SLIT(" stmts }"), 0, { .d_c = 0 }}})); + else if (node._typ == 184 /* v.ast.FnDecl */) { + string _t8 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__FnDecl).name}}, {_SLIT("( "), /*100 &int*/0xfe07, {.d_i32 = (*node._v__ast__FnDecl).params.len}}, {_SLIT(" params ) { "), /*100 &int*/0xfe07, {.d_i32 = (*node._v__ast__FnDecl).stmts.len}}, {_SLIT(" stmts }"), 0, { .d_c = 0 }}})); return _t8; } - else if (node._typ == 305 /* v.ast.EnumDecl */) { - string _t9 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("enum "), 0xfe10, {.d_s = (*node._v__ast__EnumDecl).name}}, {_SLIT(" { "), 0xfe07, {.d_i32 = (*node._v__ast__EnumDecl).fields.len}}, {_SLIT(" fields }"), 0, { .d_c = 0 }}})); + else if (node._typ == 306 /* v.ast.EnumDecl */) { + string _t9 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("enum "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__EnumDecl).name}}, {_SLIT(" { "), /*100 &int*/0xfe07, {.d_i32 = (*node._v__ast__EnumDecl).fields.len}}, {_SLIT(" fields }"), 0, { .d_c = 0 }}})); return _t9; } - else if (node._typ == 316 /* v.ast.Module */) { - string _t10 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("module "), 0xfe10, {.d_s = (*node._v__ast__Module).name}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (node._typ == 317 /* v.ast.Module */) { + string _t10 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("module "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__Module).name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t10; } - else if (node._typ == 314 /* v.ast.Import */) { - string out = str_intp(2, _MOV((StrIntpData[]){{_SLIT("import "), 0xfe10, {.d_s = (*node._v__ast__Import).mod}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (node._typ == 315 /* v.ast.Import */) { + string out = str_intp(2, _MOV((StrIntpData[]){{_SLIT("import "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__Import).mod}}, {_SLIT0, 0, { .d_c = 0 }}})); if ((*node._v__ast__Import).alias.len > 0) { - out = /*f*/string__plus(out, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" as "), 0xfe10, {.d_s = (*node._v__ast__Import).alias}}, {_SLIT0, 0, { .d_c = 0 }}}))); + out = /*f*/string__plus(out, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" as "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__Import).alias}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string _t11 = out; return _t11; } - else if (node._typ == 319 /* v.ast.StructDecl */) { - string _t12 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = (*node._v__ast__StructDecl).name}}, {_SLIT(" { "), 0xfe07, {.d_i32 = (*node._v__ast__StructDecl).fields.len}}, {_SLIT(" fields }"), 0, { .d_c = 0 }}})); + else if (node._typ == 320 /* v.ast.StructDecl */) { + string _t12 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__StructDecl).name}}, {_SLIT(" { "), /*100 &int*/0xfe07, {.d_i32 = (*node._v__ast__StructDecl).fields.len}}, {_SLIT(" fields }"), 0, { .d_c = 0 }}})); return _t12; } else { - string _t13 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[unhandled stmt str type: "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (node)._typ ))}}, {_SLIT(" ]"), 0, { .d_c = 0 }}})); + string _t13 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[unhandled stmt str type: "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (node)._typ ))}}, {_SLIT(" ]"), 0, { .d_c = 0 }}})); return _t13; } ; @@ -45127,7 +45168,7 @@ string v__ast__Stmt_str(v__ast__Stmt node) { VV_LOCAL_SYMBOL string v__ast__field_to_string(v__ast__ConstField f) { string x = string_trim_string_left(f.name, string__plus(f.mod, _SLIT("."))); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = x}}, {_SLIT(" = "), 0xfe10, {.d_s = v__ast__Expr_str(f.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT(" = "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(f.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -45278,9 +45319,9 @@ string v__ast__Table_fn_type_signature(v__ast__Table* t, v__ast__Fn* f) { v__ast__TypeSymbol* sym = v__ast__Table_sym(t, f->return_type); string opt = (v__ast__Type_has_flag(f->return_type, v__ast__TypeFlag__optional) ? (_SLIT("option_")) : (_SLIT(""))); if (sym->kind == v__ast__Kind__alias) { - sig = /*f*/string__plus(sig, str_intp(3, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = opt}}, {_SLIT0, 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(3, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - sig = /*f*/string__plus(sig, str_intp(3, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = opt}}, {_SLIT0, 0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(3, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT0, /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } string _t1 = sig; @@ -45295,7 +45336,7 @@ string v__ast__Table_fn_type_source_signature(v__ast__Table* t, v__ast__Fn* f) { sig = /*f*/string__plus(sig, _SLIT("mut ")); } if (t->is_fmt && arg.name.len > 0) { - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg.name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } v__ast__TypeSymbol* arg_type_sym = v__ast__Table_sym(t, arg.typ); sig = /*f*/string__plus(sig, arg_type_sym->name); @@ -45306,12 +45347,16 @@ string v__ast__Table_fn_type_source_signature(v__ast__Table* t, v__ast__Fn* f) { sig = /*f*/string__plus(sig, _SLIT(")")); if (v__ast__Type_alias_eq(f->return_type, _const_v__ast__ovoid_type)) { sig = /*f*/string__plus(sig, _SLIT(" ?")); + } else if (v__ast__Type_alias_eq(f->return_type, _const_v__ast__rvoid_type)) { + sig = /*f*/string__plus(sig, _SLIT(" !")); } else if (!v__ast__Type_alias_eq(f->return_type, _const_v__ast__void_type)) { v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, f->return_type); if (v__ast__Type_has_flag(f->return_type, v__ast__TypeFlag__optional)) { - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" ?"), 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" ?"), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } else if (v__ast__Type_has_flag(f->return_type, v__ast__TypeFlag__result)) { + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" !"), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } string _t1 = sig; @@ -45321,11 +45366,11 @@ string v__ast__Table_fn_type_source_signature(v__ast__Table* t, v__ast__Fn* f) { string v__ast__Table_is_same_method(v__ast__Table* t, v__ast__Fn* f, v__ast__Fn* func) { if (!v__ast__Type_alias_eq(f->return_type, func->return_type)) { string s = v__ast__Table_type_to_str(t, f->return_type); - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected return type `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected return type `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } if (f->params.len != func->params.len) { - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = f->params.len}}, {_SLIT(" parameter(s), not "), 0xfe07, {.d_i32 = func->params.len}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = f->params.len}}, {_SLIT(" parameter(s), not "), /*100 &int*/0xfe07, {.d_i32 = func->params.len}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } for (int i = 0; i < f->params.len; ++i) { @@ -45341,10 +45386,10 @@ string v__ast__Table_is_same_method(v__ast__Table* t, v__ast__Fn* f, v__ast__Fn* string exps = v__ast__Table_type_to_str(t, (*(v__ast__Param*)/*ee elem_sym */array_get(f->params, i)).typ); string gots = v__ast__Table_type_to_str(t, (*(v__ast__Param*)/*ee elem_sym */array_get(func->params, i)).typ); if (has_unexpected_type) { - string _t4 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = exps}}, {_SLIT("`, not `"), 0xfe10, {.d_s = gots}}, {_SLIT("` for parameter "), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t4 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = exps}}, {_SLIT("`, not `"), /*115 &string*/0xfe10, {.d_s = gots}}, {_SLIT("` for parameter "), /*100 &int literal*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t4; } else { - string _t5 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = exps}}, {_SLIT("` which is immutable, not `mut "), 0xfe10, {.d_s = gots}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t5 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = exps}}, {_SLIT("` which is immutable, not `mut "), /*115 &string*/0xfe10, {.d_s = gots}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t5; } } @@ -45418,9 +45463,9 @@ int v__ast__TypeSymbol_register_method(v__ast__TypeSymbol* t, v__ast__Fn new_fn) Option_v__ast__Fn v__ast__Table_register_aggregate_method(v__ast__Table* t, v__ast__TypeSymbol* sym, string name) { if (sym->kind != v__ast__Kind__aggregate) { - v__ast__Table_panic(t, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unexpected type symbol: "), 0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__ast__Table_panic(t, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unexpected type symbol: "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 429) /*expected idx: 429, name: v.ast.Aggregate */ ; + v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 430) /*expected idx: 430, name: v.ast.Aggregate */ ; bool found_once = false; v__ast__Fn new_fn = ((v__ast__Fn){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}); for (int _t1 = 0; _t1 < agg_info.types.len; ++_t1) { @@ -45433,11 +45478,11 @@ Option_v__ast__Fn v__ast__Table_register_aggregate_method(v__ast__Table* t, v__a found_once = true; new_fn = type_method; } else if (!v__ast__Fn_method_equals(&new_fn, (voidptr)&/*qq*/type_method)) { - return (Option_v__ast__Fn){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT("` signature is different"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Fn){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` signature is different"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } else { IError err = _t2.err; - return (Option_v__ast__Fn){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown method: `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Fn){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown method: `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } v__ast__TypeSymbol_register_method(sym, new_fn); @@ -45483,8 +45528,8 @@ Option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol Array_Array_v__ast__Type v__ast__Table_get_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, v__ast__GetEmbedsOptions options) { Array_Array_v__ast__Type embeds = __new_array_with_default(0, 0, sizeof(Array_v__ast__Type), 0); - v__ast__TypeSymbol* unalias_sym = ((sym->info)._typ == 431 /* v.ast.Alias */ ? (v__ast__Table_sym(t, (*sym->info._v__ast__Alias).parent_type)) : (sym)); - if ((unalias_sym->info)._typ == 416 /* v.ast.Struct */) { + v__ast__TypeSymbol* unalias_sym = ((sym->info)._typ == 432 /* v.ast.Alias */ ? (v__ast__Table_sym(t, (*sym->info._v__ast__Alias).parent_type)) : (sym)); + if ((unalias_sym->info)._typ == 417 /* v.ast.Struct */) { for (int _t1 = 0; _t1 < (*unalias_sym->info._v__ast__Struct).embeds.len; ++_t1) { v__ast__Type embed = ((v__ast__Type*)(*unalias_sym->info._v__ast__Struct).embeds.data)[_t1]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(t, embed); @@ -45501,7 +45546,7 @@ Array_Array_v__ast__Type v__ast__Table_get_embeds(v__ast__Table* t, v__ast__Type } Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name) { - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { Array_v__ast__Fn found_methods = __new_array_with_default(0, 0, sizeof(v__ast__Fn), 0); Array_v__ast__Type embed_of_found_methods = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); for (int _t1 = 0; _t1 < (*sym->info._v__ast__Struct).embeds.len; ++_t1) { @@ -45520,9 +45565,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from continue; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_12290 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t5.data); - v__ast__Fn method = mr_12290.arg0; - Array_v__ast__Type types = mr_12290.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_12435 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t5.data); + v__ast__Fn method = mr_12435.arg0; + Array_v__ast__Type types = mr_12435.arg1; array_push((array*)&found_methods, _MOV((v__ast__Fn[]){ method })); array_push((array*)&embed_of_found_methods, _MOV((v__ast__Type[]){ embed })); _PUSH_MANY(&embed_of_found_methods, (types), _t8, Array_v__ast__Type); @@ -45533,9 +45578,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from opt_ok(&(multi_return_v__ast__Fn_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=(*(v__ast__Fn*)/*ee elem_sym */array_get(found_methods, 0)), .arg1=embed_of_found_methods} }, (Option*)(&_t9), sizeof(multi_return_v__ast__Fn_Array_v__ast__Type)); return _t9; } else if (found_methods.len > 1) { - return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous method `"), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous method `"), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - } else if ((sym->info)._typ == 434 /* v.ast.Interface */) { + } else if ((sym->info)._typ == 435 /* v.ast.Interface */) { Array_v__ast__Fn found_methods = __new_array_with_default(0, 0, sizeof(v__ast__Fn), 0); Array_v__ast__Type embed_of_found_methods = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); for (int _t11 = 0; _t11 < (*sym->info._v__ast__Interface).embeds.len; ++_t11) { @@ -45554,9 +45599,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from continue; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_12948 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t15.data); - v__ast__Fn method = mr_12948.arg0; - Array_v__ast__Type types = mr_12948.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_13093 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t15.data); + v__ast__Fn method = mr_13093.arg0; + Array_v__ast__Type types = mr_13093.arg1; array_push((array*)&found_methods, _MOV((v__ast__Fn[]){ method })); array_push((array*)&embed_of_found_methods, _MOV((v__ast__Type[]){ embed })); _PUSH_MANY(&embed_of_found_methods, (types), _t18, Array_v__ast__Type); @@ -45567,9 +45612,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from opt_ok(&(multi_return_v__ast__Fn_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=(*(v__ast__Fn*)/*ee elem_sym */array_get(found_methods, 0)), .arg1=embed_of_found_methods} }, (Option*)(&_t19), sizeof(multi_return_v__ast__Fn_Array_v__ast__Type)); return _t19; } else if (found_methods.len > 1) { - return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous method `"), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous method `"), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - } else if ((sym->info)._typ == 429 /* v.ast.Aggregate */) { + } else if ((sym->info)._typ == 430 /* v.ast.Aggregate */) { for (int _t21 = 0; _t21 < (*sym->info._v__ast__Aggregate).types.len; ++_t21) { v__ast__Type typ = ((v__ast__Type*)(*sym->info._v__ast__Aggregate).types.data)[_t21]; v__ast__TypeSymbol* agg_sym = v__ast__Table_sym(t, typ); @@ -45579,9 +45624,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from continue; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_13411 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t22.data); - v__ast__Fn method = mr_13411.arg0; - Array_v__ast__Type embed_types = mr_13411.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_13556 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t22.data); + v__ast__Fn method = mr_13556.arg0; + Array_v__ast__Type embed_types = mr_13556.arg1; if (embed_types.len != 0) { Option_multi_return_v__ast__Fn_Array_v__ast__Type _t23; opt_ok(&(multi_return_v__ast__Fn_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=method, .arg1=embed_types} }, (Option*)(&_t23), sizeof(multi_return_v__ast__Fn_Array_v__ast__Type)); @@ -45608,8 +45653,8 @@ Option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast return (Option_v__ast__Fn){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_13872 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t3.data); - v__ast__Fn func = mr_13872.arg0; + multi_return_v__ast__Fn_Array_v__ast__Type mr_14017 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t3.data); + v__ast__Fn func = mr_14017.arg0; Option_v__ast__Fn _t5; opt_ok(&(v__ast__Fn[]) { func }, (Option*)(&_t5), sizeof(v__ast__Fn)); return _t5; @@ -45619,7 +45664,7 @@ Option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast Array_v__ast__Fn v__ast__Table_get_embed_methods(v__ast__Table* t, v__ast__TypeSymbol* sym) { Array_v__ast__Fn methods = __new_array_with_default(0, 0, sizeof(v__ast__Fn), 0); - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { for (int _t1 = 0; _t1 < (*sym->info._v__ast__Struct).embeds.len; ++_t1) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Struct).embeds.data)[_t1]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(t, embed); @@ -45633,9 +45678,9 @@ Array_v__ast__Fn v__ast__Table_get_embed_methods(v__ast__Table* t, v__ast__TypeS VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Table_register_aggregate_field(v__ast__Table* t, v__ast__TypeSymbol* sym, string name) { if (sym->kind != v__ast__Kind__aggregate) { - v__ast__Table_panic(t, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unexpected type symbol: "), 0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__ast__Table_panic(t, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unexpected type symbol: "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 429) /*expected idx: 429, name: v.ast.Aggregate */ ; + v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 430) /*expected idx: 430, name: v.ast.Aggregate */ ; bool found_once = false; v__ast__StructField new_field = ((v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}); for (int _t1 = 0; _t1 < agg_info.types.len; ++_t1) { @@ -45648,12 +45693,12 @@ VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Table_register_aggregate_fiel found_once = true; new_field = type_field; } else if (!v__ast__Type_alias_eq(new_field.typ, type_field.typ)) { - return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT("` type is different"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` type is different"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } new_field = ((v__ast__StructField){new_field.pos,new_field.type_pos,new_field.comments,new_field.has_default_expr,new_field.attrs,.is_pub = new_field.is_pub && type_field.is_pub,new_field.default_val,.is_mut = new_field.is_mut && type_field.is_mut,new_field.is_global,new_field.is_volatile,new_field.default_expr,new_field.default_expr_typ,new_field.name,new_field.typ,}); } else { IError err = _t2.err; - return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("` has no field or method `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("` has no field or method `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } array_push((array*)&agg_info.fields, _MOV((v__ast__StructField[]){ new_field })); @@ -45677,7 +45722,7 @@ bool v__ast__Table_struct_has_field(v__ast__Table* t, v__ast__TypeSymbol* struct Array_v__ast__StructField v__ast__Table_struct_fields(v__ast__Table* t, v__ast__TypeSymbol* sym) { Array_v__ast__StructField fields = __new_array_with_default(0, 0, sizeof(v__ast__StructField), 0); - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { _PUSH_MANY(&fields, ((*sym->info._v__ast__Struct).fields), _t1, Array_v__ast__StructField); for (int _t2 = 0; _t2 < (*sym->info._v__ast__Struct).embeds.len; ++_t2) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Struct).embeds.data)[_t2]; @@ -45692,7 +45737,7 @@ Array_v__ast__StructField v__ast__Table_struct_fields(v__ast__Table* t, v__ast__ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { v__ast__TypeSymbol* ts = s; for (;;) { - if (ts->info._typ == 416 /* v.ast.Struct */) { + if (ts->info._typ == 417 /* v.ast.Struct */) { Option_v__ast__StructField _t1; if (_t1 = v__ast__Struct_find_field(&(*ts->info._v__ast__Struct), name), _t1.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t1.data; @@ -45701,7 +45746,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty return _t2; } } - else if (ts->info._typ == 429 /* v.ast.Aggregate */) { + else if (ts->info._typ == 430 /* v.ast.Aggregate */) { Option_v__ast__StructField _t3; if (_t3 = v__ast__Aggregate_find_field(&(*ts->info._v__ast__Aggregate), name), _t3.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t3.data; @@ -45720,7 +45765,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t7), sizeof(v__ast__StructField)); return _t7; } - else if (ts->info._typ == 434 /* v.ast.Interface */) { + else if (ts->info._typ == 435 /* v.ast.Interface */) { Option_v__ast__StructField _t8; if (_t8 = v__ast__Interface_find_field(&(*ts->info._v__ast__Interface), name), _t8.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t8.data; @@ -45729,7 +45774,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty return _t9; } } - else if (ts->info._typ == 435 /* v.ast.SumType */) { + else if (ts->info._typ == 436 /* v.ast.SumType */) { v__ast__Table_resolve_common_sumtype_fields(t, ts); Option_v__ast__StructField _t10; if (_t10 = v__ast__SumType_find_field(&(*ts->info._v__ast__SumType), name), _t10.state == 0) { @@ -45738,7 +45783,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t11), sizeof(v__ast__StructField)); return _t11; } - return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = name}}, {_SLIT("` does not exist or have the same type in all sumtype variants"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` does not exist or have the same type in all sumtype variants"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else { @@ -45753,7 +45798,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty } Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_field_from_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name) { - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { Array_v__ast__StructField found_fields = __new_array_with_default(0, 0, sizeof(v__ast__StructField), 0); Array_v__ast__Type embeds_of_found_fields = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); for (int _t1 = 0; _t1 < (*sym->info._v__ast__Struct).embeds.len; ++_t1) { @@ -45772,9 +45817,9 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi continue; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_17119 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t5.data); - v__ast__StructField field = mr_17119.arg0; - Array_v__ast__Type types = mr_17119.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_17264 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t5.data); + v__ast__StructField field = mr_17264.arg0; + Array_v__ast__Type types = mr_17264.arg1; array_push((array*)&found_fields, _MOV((v__ast__StructField[]){ field })); array_push((array*)&embeds_of_found_fields, _MOV((v__ast__Type[]){ embed })); _PUSH_MANY(&embeds_of_found_fields, (types), _t8, Array_v__ast__Type); @@ -45785,9 +45830,9 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi opt_ok(&(multi_return_v__ast__StructField_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=(*(v__ast__StructField*)/*ee elem_sym */array_get(found_fields, 0)), .arg1=embeds_of_found_fields} }, (Option*)(&_t9), sizeof(multi_return_v__ast__StructField_Array_v__ast__Type)); return _t9; } else if (found_fields.len > 1) { - return (Option_multi_return_v__ast__StructField_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous field `"), 0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_v__ast__StructField_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous field `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - } else if ((sym->info)._typ == 429 /* v.ast.Aggregate */) { + } else if ((sym->info)._typ == 430 /* v.ast.Aggregate */) { for (int _t11 = 0; _t11 < (*sym->info._v__ast__Aggregate).types.len; ++_t11) { v__ast__Type typ = ((v__ast__Type*)(*sym->info._v__ast__Aggregate).types.data)[_t11]; v__ast__TypeSymbol* agg_sym = v__ast__Table_sym(t, typ); @@ -45797,16 +45842,16 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi continue; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_17572 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t12.data); - v__ast__StructField field = mr_17572.arg0; - Array_v__ast__Type embed_types = mr_17572.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_17717 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t12.data); + v__ast__StructField field = mr_17717.arg0; + Array_v__ast__Type embed_types = mr_17717.arg1; if (embed_types.len > 0) { Option_multi_return_v__ast__StructField_Array_v__ast__Type _t13; opt_ok(&(multi_return_v__ast__StructField_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=field, .arg1=embed_types} }, (Option*)(&_t13), sizeof(multi_return_v__ast__StructField_Array_v__ast__Type)); return _t13; } } - } else if ((sym->info)._typ == 431 /* v.ast.Alias */) { + } else if ((sym->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* unalias_sym = v__ast__Table_sym(t, (*sym->info._v__ast__Alias).parent_type); Option_multi_return_v__ast__StructField_Array_v__ast__Type _t14 = v__ast__Table_find_field_from_embeds(t, unalias_sym, field_name); return _t14; @@ -45830,8 +45875,8 @@ Option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t return (Option_v__ast__StructField){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_18170 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t3.data); - v__ast__StructField field = mr_18170.arg0; + multi_return_v__ast__StructField_Array_v__ast__Type mr_18315 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t3.data); + v__ast__StructField field = mr_18315.arg0; Option_v__ast__StructField _t5; opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t5), sizeof(v__ast__StructField)); return _t5; @@ -45841,7 +45886,7 @@ Option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t void v__ast__Table_resolve_common_sumtype_fields(v__ast__Table* t, v__ast__TypeSymbol* sym_) { v__ast__TypeSymbol* sym = sym_; - v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ; if (info.found_fields) { return; } @@ -45851,10 +45896,10 @@ void v__ast__Table_resolve_common_sumtype_fields(v__ast__Table* t, v__ast__TypeS v__ast__Type variant = ((v__ast__Type*)info.variants.data)[_t1]; v__ast__TypeSymbol* v_sym = v__ast__Table_final_sym(t, variant); Array_v__ast__StructField _t2 = __new_array(0, 0, sizeof(v__ast__StructField)); - if (v_sym->info._typ == 416 /* v.ast.Struct */) { + if (v_sym->info._typ == 417 /* v.ast.Struct */) { _t2 = v__ast__Table_struct_fields(t, v_sym); } - else if (v_sym->info._typ == 435 /* v.ast.SumType */) { + else if (v_sym->info._typ == 436 /* v.ast.SumType */) { v__ast__Table_resolve_common_sumtype_fields(t, v_sym); _t2 = (*v_sym->info._v__ast__SumType).fields; } @@ -45931,7 +45976,7 @@ v__ast__TypeSymbol* v__ast__Table_sym(v__ast__Table* t, v__ast__Type typ) { v__ast__TypeSymbol* _t1 = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)); return _t1; } - v__ast__Table_panic(t, str_intp(3, _MOV((StrIntpData[]){{_SLIT("sym: invalid type (typ="), 0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT(" idx="), 0xfe07, {.d_i32 = idx}}, {_SLIT("). Compiler bug. This should never happen. Please report the bug using `v bug file.v`.\n"), 0, { .d_c = 0 }}}))); + v__ast__Table_panic(t, str_intp(3, _MOV((StrIntpData[]){{_SLIT("sym: invalid type (typ="), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT(" idx="), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("). Compiler bug. This should never happen. Please report the bug using `v bug file.v`.\n"), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* _t2 = _const_v__ast__invalid_type_symbol; return _t2; } @@ -45942,12 +45987,12 @@ inline v__ast__TypeSymbol* v__ast__Table_final_sym(v__ast__Table* t, v__ast__Typ if (idx > 0) { v__ast__TypeSymbol* current_symbol = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)); if (current_symbol->kind == v__ast__Kind__alias) { - idx = v__ast__Type_idx((/* as */ *(v__ast__Alias*)__as_cast((current_symbol->info)._v__ast__Alias,(current_symbol->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type); + idx = v__ast__Type_idx((/* as */ *(v__ast__Alias*)__as_cast((current_symbol->info)._v__ast__Alias,(current_symbol->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type); } v__ast__TypeSymbol* _t1 = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)); return _t1; } - v__ast__Table_panic(t, str_intp(3, _MOV((StrIntpData[]){{_SLIT("final_sym: invalid type (typ="), 0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT(" idx="), 0xfe07, {.d_i32 = idx}}, {_SLIT("). Compiler bug. This should never happen. Please report the bug using `v bug file.v`."), 0, { .d_c = 0 }}}))); + v__ast__Table_panic(t, str_intp(3, _MOV((StrIntpData[]){{_SLIT("final_sym: invalid type (typ="), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT(" idx="), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("). Compiler bug. This should never happen. Please report the bug using `v bug file.v`."), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* _t2 = _const_v__ast__invalid_type_symbol; return _t2; } @@ -45963,7 +46008,7 @@ inline string v__ast__Table_get_type_name(v__ast__Table* t, v__ast__Type typ) { inline v__ast__Type v__ast__Table_unalias_num_type(v__ast__Table* t, v__ast__Type typ) { v__ast__TypeSymbol* sym = v__ast__Table_sym(t, typ); if (sym->kind == v__ast__Kind__alias) { - v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type; + v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; if (pt <= _const_v__ast__char_type && pt >= _const_v__ast__void_type) { v__ast__Type _t1 = pt; return _t1; @@ -45977,7 +46022,7 @@ inline v__ast__Type v__ast__Table_unalias_num_type(v__ast__Table* t, v__ast__Typ inline v__ast__Type v__ast__Table_unaliased_type(v__ast__Table* t, v__ast__Type typ) { v__ast__TypeSymbol* sym = v__ast__Table_sym(t, typ); if (sym->kind == v__ast__Kind__alias) { - v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type; + v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; v__ast__Type _t1 = pt; return _t1; } @@ -45989,7 +46034,7 @@ VV_LOCAL_SYMBOL int v__ast__Table_rewrite_already_registered_symbol(v__ast__Tabl v__ast__TypeSymbol* existing_symbol = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, existing_idx)); #if defined(CUSTOM_DEFINE_trace_rewrite_already_registered_symbol) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(">> rewrite_already_registered_symbol sym: "), 0xfe10, {.d_s = typ.name}}, {_SLIT(" | existing_idx: "), 0xfe07, {.d_i32 = existing_idx}}, {_SLIT(" | existing_symbol: "), 0xfe10, {.d_s = existing_symbol->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(">> rewrite_already_registered_symbol sym: "), /*115 &string*/0xfe10, {.d_s = typ.name}}, {_SLIT(" | existing_idx: "), /*100 &int*/0xfe07, {.d_i32 = existing_idx}}, {_SLIT(" | existing_symbol: "), /*115 &string*/0xfe10, {.d_s = existing_symbol->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif if (existing_symbol->kind == v__ast__Kind__placeholder) { @@ -46030,7 +46075,7 @@ int idx; // Defer begin if (v__ast__Table_register_sym_defer_0) { #if defined(CUSTOM_DEFINE_trace_register_sym) - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> register_sym: "), 0x78fe10, {.d_s = sym.name}}, {_SLIT(" | idx: "), 0xfe07, {.d_i32 = idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> register_sym: "), /*115 &string*/0x78fe10, {.d_s = sym.name}}, {_SLIT(" | idx: "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); #endif } @@ -46047,7 +46092,7 @@ int idx; // Defer begin if (v__ast__Table_register_sym_defer_0) { #if defined(CUSTOM_DEFINE_trace_register_sym) - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> register_sym: "), 0x78fe10, {.d_s = sym.name}}, {_SLIT(" | idx: "), 0xfe07, {.d_i32 = idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> register_sym: "), /*115 &string*/0x78fe10, {.d_s = sym.name}}, {_SLIT(" | idx: "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); #endif } @@ -46064,7 +46109,7 @@ int idx; // Defer begin if (v__ast__Table_register_sym_defer_0) { #if defined(CUSTOM_DEFINE_trace_register_sym) - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> register_sym: "), 0x78fe10, {.d_s = sym.name}}, {_SLIT(" | idx: "), 0xfe07, {.d_i32 = idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> register_sym: "), /*115 &string*/0x78fe10, {.d_s = sym.name}}, {_SLIT(" | idx: "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); #endif } @@ -46102,15 +46147,15 @@ bool v__ast__Table_known_type_idx(v__ast__Table* t, v__ast__Type typ) { return _t2; } else if (sym->kind == (v__ast__Kind__array)) { - bool _t3 = v__ast__Table_known_type_idx(t, (/* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ).elem_type); + bool _t3 = v__ast__Table_known_type_idx(t, (/* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ).elem_type); return _t3; } else if (sym->kind == (v__ast__Kind__array_fixed)) { - bool _t4 = v__ast__Table_known_type_idx(t, (/* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ).elem_type); + bool _t4 = v__ast__Table_known_type_idx(t, (/* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ).elem_type); return _t4; } else if (sym->kind == (v__ast__Kind__map)) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; bool _t5 = v__ast__Table_known_type_idx(t, info.key_type) && v__ast__Table_known_type_idx(t, info.value_type); return _t5; } @@ -46124,7 +46169,7 @@ bool v__ast__Table_known_type_idx(v__ast__Table* t, v__ast__Type typ) { inline string v__ast__Table_array_name(v__ast__Table* t, v__ast__Type elem_type) { v__ast__TypeSymbol* elem_type_sym = v__ast__Table_sym(t, elem_type); string ptr = (v__ast__Type_is_ptr(elem_type) ? (string_repeat(_SLIT("&"), v__ast__Type_nr_muls(elem_type))) : (_SLIT(""))); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("[]"), 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("[]"), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -46137,10 +46182,10 @@ inline string v__ast__Table_array_cname(v__ast__Table* t, v__ast__Type elem_type } if (string_contains(elem_type_sym->cname, _SLIT("<"))) { string type_name = string_replace_each(elem_type_sym->cname, new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("<"), _SLIT("_T_"), _SLIT(", "), _SLIT("_"), _SLIT(">"), _SLIT("")}))); - string _t1 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), 0xfe10, {.d_s = type_name}}, {_SLIT0, 0, { .d_c = 0 }}})), res); + string _t1 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT0, 0, { .d_c = 0 }}})), res); return _t1; } else { - string _t2 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), 0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), res); + string _t2 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), /*115 &string*/0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), res); return _t2; } return (string){.str=(byteptr)"", .is_lit=1}; @@ -46150,8 +46195,8 @@ inline string v__ast__Table_array_cname(v__ast__Table* t, v__ast__Type elem_type inline string v__ast__Table_array_fixed_name(v__ast__Table* t, v__ast__Type elem_type, int size, v__ast__Expr size_expr) { v__ast__TypeSymbol* elem_type_sym = v__ast__Table_sym(t, elem_type); string ptr = (v__ast__Type_is_ptr(elem_type) ? (string_repeat(_SLIT("&"), v__ast__Type_nr_muls(elem_type))) : (_SLIT(""))); - string size_str = ((size_expr)._typ == 262 /* v.ast.EmptyExpr */ || size != 987654321 ? (int_str(size)) : (v__ast__Expr_str(size_expr))); - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = size_str}}, {_SLIT("]"), 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string size_str = ((size_expr)._typ == 263 /* v.ast.EmptyExpr */ || size != 987654321 ? (int_str(size)) : (v__ast__Expr_str(size_expr))); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = size_str}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -46160,9 +46205,9 @@ inline string v__ast__Table_array_fixed_cname(v__ast__Table* t, v__ast__Type ele v__ast__TypeSymbol* elem_type_sym = v__ast__Table_sym(t, elem_type); string res = _SLIT(""); if (v__ast__Type_is_ptr(elem_type)) { - res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_ptr"), 0xfe07, {.d_i32 = v__ast__Type_nr_muls(elem_type)}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_ptr"), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_nr_muls(elem_type)}}, {_SLIT0, 0, { .d_c = 0 }}})); } - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("Array_fixed_"), 0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0xfe10, {.d_s = res}}, {_SLIT("_"), 0xfe07, {.d_i32 = size}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("Array_fixed_"), /*115 &string*/0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -46175,7 +46220,7 @@ inline string v__ast__Table_chan_name(v__ast__Table* t, v__ast__Type elem_type, } else if (v__ast__Type_is_ptr(elem_type)) { ptr = _SLIT("&"); } - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("chan "), 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("chan "), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -46188,7 +46233,7 @@ inline string v__ast__Table_chan_cname(v__ast__Table* t, v__ast__Type elem_type, } else if (v__ast__Type_is_ptr(elem_type)) { suffix = _SLIT("_ptr"); } - string _t1 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("chan_"), 0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), suffix); + string _t1 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("chan_"), /*115 &string*/0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), suffix); return _t1; } @@ -46199,7 +46244,7 @@ inline string v__ast__Table_promise_name(v__ast__Table* t, v__ast__Type return_t return _t1; } v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, return_type); - string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Promise<"), 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT(", JS.Any>"), 0, { .d_c = 0 }}})); + string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Promise<"), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT(", JS.Any>"), 0, { .d_c = 0 }}})); return _t2; } @@ -46210,7 +46255,7 @@ inline string v__ast__Table_promise_cname(v__ast__Table* t, v__ast__Type return_ return _t1; } v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, return_type); - string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Promise_"), 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT("_Any"), 0, { .d_c = 0 }}})); + string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Promise_"), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT("_Any"), 0, { .d_c = 0 }}})); return _t2; } @@ -46228,7 +46273,7 @@ inline string v__ast__Table_thread_name(v__ast__Table* t, v__ast__Type return_ty v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, return_type); string ptr = (v__ast__Type_is_ptr(return_type) ? (_SLIT("&")) : (_SLIT(""))); string opt = (v__ast__Type_has_flag(return_type, v__ast__TypeFlag__optional) ? (_SLIT("?")) : (_SLIT(""))); - string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("thread "), 0xfe10, {.d_s = opt}}, {_SLIT0, 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("thread "), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } @@ -46246,7 +46291,7 @@ inline string v__ast__Table_thread_cname(v__ast__Table* t, v__ast__Type return_t v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, return_type); string suffix = (v__ast__Type_is_ptr(return_type) ? (_SLIT("_ptr")) : (_SLIT(""))); string prefix = (v__ast__Type_has_flag(return_type, v__ast__TypeFlag__optional) ? (_SLIT("Option_")) : (_SLIT(""))); - string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), 0xfe10, {.d_s = prefix}}, {_SLIT0, 0xfe10, {.d_s = return_type_sym->cname}}, {_SLIT0, 0xfe10, {.d_s = suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), /*115 &string*/0xfe10, {.d_s = prefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = return_type_sym->cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } @@ -46255,7 +46300,7 @@ inline string v__ast__Table_map_name(v__ast__Table* t, v__ast__Type key_type, v_ v__ast__TypeSymbol* key_type_sym = v__ast__Table_sym(t, key_type); v__ast__TypeSymbol* value_type_sym = v__ast__Table_sym(t, value_type); string ptr = (v__ast__Type_is_ptr(value_type) ? (_SLIT("&")) : (_SLIT(""))); - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("map["), 0xfe10, {.d_s = key_type_sym->name}}, {_SLIT("]"), 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = value_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("map["), /*115 &string*/0xfe10, {.d_s = key_type_sym->name}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = value_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -46264,7 +46309,7 @@ inline string v__ast__Table_map_cname(v__ast__Table* t, v__ast__Type key_type, v v__ast__TypeSymbol* key_type_sym = v__ast__Table_sym(t, key_type); v__ast__TypeSymbol* value_type_sym = v__ast__Table_sym(t, value_type); string suffix = (v__ast__Type_is_ptr(value_type) ? (_SLIT("_ptr")) : (_SLIT(""))); - string _t1 = string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Map_"), 0xfe10, {.d_s = key_type_sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = value_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), suffix); + string _t1 = string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Map_"), /*115 &string*/0xfe10, {.d_s = key_type_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = value_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), suffix); return _t1; } @@ -46361,11 +46406,11 @@ int v__ast__Table_find_or_register_multi_return(v__ast__Table* t, Array_v__ast__ for (int i = 0; i < mr_typs.len; ++i) { v__ast__Type mr_typ = ((v__ast__Type*)mr_typs.data)[i]; v__ast__TypeSymbol* mr_type_sym = v__ast__Table_sym(t, v__ast__mktyp(mr_typ)); - multi_return_string_string mr_31228 = (v__ast__Type_is_ptr(mr_typ) ? ((multi_return_string_string){.arg0=_SLIT("&"),.arg1=_SLIT("ref_")}) : ((multi_return_string_string){.arg0=_SLIT(""),.arg1=_SLIT("")})); - string ref = mr_31228.arg0; - string cref = mr_31228.arg1; - name = /*f*/string__plus(name, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ref}}, {_SLIT0, 0xfe10, {.d_s = mr_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); - cname = /*f*/string__plus(cname, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = cref}}, {_SLIT0, 0xfe10, {.d_s = mr_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + multi_return_string_string mr_31373 = (v__ast__Type_is_ptr(mr_typ) ? ((multi_return_string_string){.arg0=_SLIT("&"),.arg1=_SLIT("ref_")}) : ((multi_return_string_string){.arg0=_SLIT(""),.arg1=_SLIT("")})); + string ref = mr_31373.arg0; + string cref = mr_31373.arg1; + name = /*f*/string__plus(name, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ref}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + cname = /*f*/string__plus(cname, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cref}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i < mr_typs.len - 1) { name = /*f*/string__plus(name, _SLIT(", ")); } @@ -46382,8 +46427,8 @@ int v__ast__Table_find_or_register_multi_return(v__ast__Table* t, Array_v__ast__ } int v__ast__Table_find_or_register_fn_type(v__ast__Table* t, string mod, v__ast__Fn f, bool is_anon, bool has_decl) { - string name = (f.name.len == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("fn "), 0xfe10, {.d_s = v__ast__Table_fn_type_source_signature(t, (voidptr)&/*qq*/f)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (string_clone(f.name))); - string cname = (f.name.len == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("anon_fn_"), 0xfe10, {.d_s = v__ast__Table_fn_type_signature(t, (voidptr)&/*qq*/f)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (v__util__no_dots(string_clone(f.name)))); + string name = (f.name.len == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("fn "), /*115 &string*/0xfe10, {.d_s = v__ast__Table_fn_type_source_signature(t, (voidptr)&/*qq*/f)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (string_clone(f.name))); + string cname = (f.name.len == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("anon_fn_"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_fn_type_signature(t, (voidptr)&/*qq*/f)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (v__util__no_dots(string_clone(f.name)))); bool anon = f.name.len == 0 || is_anon; int existing_idx = (*(int*)map_get(ADDR(map, t->type_idxs), &(string[]){name}, &(int[]){ 0 })); if (existing_idx > 0 && (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, existing_idx))->kind != v__ast__Kind__placeholder) { @@ -46408,22 +46453,22 @@ int v__ast__Table_add_placeholder_type(v__ast__Table* t, string name, v__ast__La inline v__ast__Type v__ast__Table_value_type(v__ast__Table* t, v__ast__Type typ) { v__ast__TypeSymbol* sym = v__ast__Table_final_sym(t, typ); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Type _t1 = array_info.elem_type; return _t1; } if (sym->kind == v__ast__Kind__array) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Type _t2 = info.elem_type; return _t2; } if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; v__ast__Type _t3 = info.elem_type; return _t3; } if (sym->kind == v__ast__Kind__map) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; v__ast__Type _t4 = info.value_type; return _t4; } @@ -46476,7 +46521,7 @@ bool v__ast__Table_register_fn_concrete_types(v__ast__Table* t, string fn_name, bool v__ast__Table_sumtype_has_variant(v__ast__Table* t, v__ast__Type parent, v__ast__Type variant, bool is_as) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(t, parent); if (parent_sym->kind == v__ast__Kind__sum_type) { - v__ast__SumType parent_info = /* as */ *(v__ast__SumType*)__as_cast((parent_sym->info)._v__ast__SumType,(parent_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ; + v__ast__SumType parent_info = /* as */ *(v__ast__SumType*)__as_cast((parent_sym->info)._v__ast__SumType,(parent_sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ; v__ast__TypeSymbol* var_sym = v__ast__Table_sym(t, variant); if (var_sym->kind == (v__ast__Kind__aggregate)) { @@ -46509,7 +46554,7 @@ VV_LOCAL_SYMBOL bool v__ast__Table_sumtype_check_variant_in_type(v__ast__Table* } VV_LOCAL_SYMBOL bool v__ast__Table_sumtype_check_aggregate_variant(v__ast__Table* t, v__ast__Type parent_type, v__ast__Type* aggregate_type, bool is_as) { - v__ast__Aggregate aggregate_sym = /* as */ *(v__ast__Aggregate*)__as_cast((v__ast__Table_sym(t, *aggregate_type)->info)._v__ast__Aggregate,(v__ast__Table_sym(t, *aggregate_type)->info)._typ, 429) /*expected idx: 429, name: v.ast.Aggregate */ ; + v__ast__Aggregate aggregate_sym = /* as */ *(v__ast__Aggregate*)__as_cast((v__ast__Table_sym(t, *aggregate_type)->info)._v__ast__Aggregate,(v__ast__Table_sym(t, *aggregate_type)->info)._typ, 430) /*expected idx: 430, name: v.ast.Aggregate */ ; for (int _t1 = 0; _t1 < aggregate_sym.types.len; ++_t1) { v__ast__Type var_type = ((v__ast__Type*)aggregate_sym.types.data)[_t1]; if (!v__ast__Table_sumtype_has_variant(t, parent_type, var_type, is_as)) { @@ -46522,9 +46567,9 @@ VV_LOCAL_SYMBOL bool v__ast__Table_sumtype_check_aggregate_variant(v__ast__Table } VV_LOCAL_SYMBOL bool v__ast__Table_sumtype_check_alias_variant(v__ast__Table* t, v__ast__Type parent_type, v__ast__Type alias_type, bool is_as) { - v__ast__SumType parent_sym = /* as */ *(v__ast__SumType*)__as_cast((v__ast__Table_sym(t, parent_type)->info)._v__ast__SumType,(v__ast__Table_sym(t, parent_type)->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ; + v__ast__SumType parent_sym = /* as */ *(v__ast__SumType*)__as_cast((v__ast__Table_sym(t, parent_type)->info)._v__ast__SumType,(v__ast__Table_sym(t, parent_type)->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ; if (!v__ast__Table_sumtype_check_variant_in_type(t, parent_sym, alias_type, is_as)) { - v__ast__Alias alias_info = /* as */ *(v__ast__Alias*)__as_cast((v__ast__Table_sym(t, alias_type)->info)._v__ast__Alias,(v__ast__Table_sym(t, alias_type)->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ; + v__ast__Alias alias_info = /* as */ *(v__ast__Alias*)__as_cast((v__ast__Table_sym(t, alias_type)->info)._v__ast__Alias,(v__ast__Table_sym(t, alias_type)->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ; bool _t1 = v__ast__Type_alias_eq(parent_type, alias_info.parent_type) || v__ast__Table_sumtype_has_variant(t, parent_type, alias_info.parent_type, is_as); return _t1; } @@ -46567,7 +46612,7 @@ Array_string v__ast__Table_known_type_names(v__ast__Table* t) { } bool v__ast__Table_has_deep_child_no_ref(v__ast__Table* t, v__ast__TypeSymbol* ts, string name) { - if ((ts->info)._typ == 416 /* v.ast.Struct */) { + if ((ts->info)._typ == 417 /* v.ast.Struct */) { for (int _t1 = 0; _t1 < (*ts->info._v__ast__Struct).fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)(*ts->info._v__ast__Struct).fields.data)[_t1]; v__ast__TypeSymbol* sym = v__ast__Table_sym(t, field.typ); @@ -46610,7 +46655,7 @@ bool v__ast__Table_complete_interface_check_defer_0 = false; if (v__ast__Table_does_type_implement_interface(t, tk, idecl->typ)) { #if defined(CUSTOM_DEFINE_trace_types_implementing_each_interface) { - eprintln( str_intp(6, _MOV((StrIntpData[]){{_SLIT(">>> tsym.mod: "), 0xfe10, {.d_s = (*tsym)->mod}}, {_SLIT(" | tsym.name: "), 0xfe10, {.d_s = (*tsym)->name}}, {_SLIT(" | tk: "), 0xfe07, {.d_i32 = tk}}, {_SLIT(" | idecl.name: "), 0xfe10, {.d_s = idecl->name}}, {_SLIT(" | idecl.typ: "), 0xfe10, {.d_s = v__ast__Type_str(idecl->typ)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(6, _MOV((StrIntpData[]){{_SLIT(">>> tsym.mod: "), /*115 &string*/0xfe10, {.d_s = (*tsym)->mod}}, {_SLIT(" | tsym.name: "), /*115 &string*/0xfe10, {.d_s = (*tsym)->name}}, {_SLIT(" | tk: "), /*100 &int*/0xfe07, {.d_i32 = tk}}, {_SLIT(" | idecl.name: "), /*115 &string*/0xfe10, {.d_s = idecl->name}}, {_SLIT(" | idecl.typ: "), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(idecl->typ)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif array_push((array*)&(*(Array_v__ast__Type*)map_get_and_set((map*)&t->iface_types, &(string[]){idecl->name}, &(Array_v__ast__Type[]){ __new_array(0, 0, sizeof(v__ast__Type)) })), _MOV((v__ast__Type[]){ tk })); @@ -46666,7 +46711,7 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type bool _t3 = false; return _t3; } - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { bool _t4 = false; return _t4; @@ -46677,7 +46722,7 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type bool _t5 = false; return _t5; } - if ((inter_sym->info)._typ == 434 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 435 /* v.ast.Interface */) { Array_v__ast__Attr attrs = (*(v__ast__InterfaceDecl*)map_get(ADDR(map, t->interfaces), &(int[]){inter_typ}, &(v__ast__InterfaceDecl[]){ (v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,} })).attrs; for (int _t6 = 0; _t6 < attrs.len; ++_t6) { v__ast__Attr attr = ((v__ast__Attr*)attrs.data)[_t6]; @@ -46765,12 +46810,12 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, return _t4; } } - if (sym->info._typ == 411 /* v.ast.Array */) { + if (sym->info._typ == 412 /* v.ast.Array */) { v__ast__Type elem_type = (*sym->info._v__ast__Array).elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(t, elem_type); int dims = 1; for (;;) { - if (!((elem_sym->info)._typ == 411 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 412 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; @@ -46790,7 +46835,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 439 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 440 /* v.ast.ArrayFixed */) { Option_v__ast__Type _t8; if (_t8 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__ArrayFixed).elem_type, generic_names, concrete_types), _t8.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t8.data; @@ -46806,7 +46851,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 440 /* v.ast.Chan */) { + else if (sym->info._typ == 441 /* v.ast.Chan */) { Option_v__ast__Type _t11; if (_t11 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Chan).elem_type, generic_names, concrete_types), _t11.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t11.data; @@ -46822,7 +46867,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 443 /* v.ast.FnType */) { + else if (sym->info._typ == 444 /* v.ast.FnType */) { v__ast__Fn func = (*sym->info._v__ast__FnType).func; bool has_generic = false; if (v__ast__Type_has_flag(func.return_type, v__ast__TypeFlag__generic)) { @@ -46861,7 +46906,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, return _t18; } } - else if (sym->info._typ == 442 /* v.ast.MultiReturn */) { + else if (sym->info._typ == 443 /* v.ast.MultiReturn */) { Array_v__ast__Type types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); bool type_changed = false; for (int _t19 = 0; _t19 < (*sym->info._v__ast__MultiReturn).types.len; ++_t19) { @@ -46899,7 +46944,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 412 /* v.ast.Map */) { + else if (sym->info._typ == 413 /* v.ast.Map */) { bool type_changed = false; v__ast__Type unwrapped_key_type = (*sym->info._v__ast__Map).key_type; v__ast__Type unwrapped_value_type = (*sym->info._v__ast__Map).value_type; @@ -46928,9 +46973,9 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 416 /* v.ast.Struct */) { + else if (sym->info._typ == 417 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { - string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*sym->info._v__ast__Struct).generic_types.len; ++i) { Option_v__ast__Type _t31; if (_t31 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*sym->info._v__ast__Struct).generic_types, i)), generic_names, concrete_types), _t31.state == 0) { @@ -46952,9 +46997,9 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, return _t32; } } - else if (sym->info._typ == 434 /* v.ast.Interface */) { + else if (sym->info._typ == 435 /* v.ast.Interface */) { if ((*sym->info._v__ast__Interface).is_generic) { - string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*sym->info._v__ast__Interface).generic_types.len; ++i) { Option_v__ast__Type _t33; if (_t33 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*sym->info._v__ast__Interface).generic_types, i)), generic_names, concrete_types), _t33.state == 0) { @@ -46976,9 +47021,9 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, return _t34; } } - else if (sym->info._typ == 435 /* v.ast.SumType */) { + else if (sym->info._typ == 436 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { - string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*sym->info._v__ast__SumType).generic_types.len; ++i) { Option_v__ast__Type _t35; if (_t35 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*sym->info._v__ast__SumType).generic_types, i)), generic_names, concrete_types), _t35.state == 0) { @@ -47014,12 +47059,12 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty string nrt = _SLIT(""); string c_nrt = _SLIT(""); v__ast__TypeSymbol* ts = v__ast__Table_sym(t, typ); - if (ts->info._typ == 411 /* v.ast.Array */) { + if (ts->info._typ == 412 /* v.ast.Array */) { v__ast__Type elem_type = (*ts->info._v__ast__Array).elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(t, elem_type); int dims = 1; for (;;) { - if (!((elem_sym->info)._typ == 411 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 412 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; @@ -47029,32 +47074,32 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty v__ast__Type _t1 = v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), typ), v__ast__TypeFlag__generic); return _t1; } - else if (ts->info._typ == 439 /* v.ast.ArrayFixed */) { + else if (ts->info._typ == 440 /* v.ast.ArrayFixed */) { v__ast__Type unwrap_typ = v__ast__Table_unwrap_generic_type(t, (*ts->info._v__ast__ArrayFixed).elem_type, generic_names, concrete_types); int idx = v__ast__Table_find_or_register_array_fixed(t, unwrap_typ, (*ts->info._v__ast__ArrayFixed).size, v__ast__None_to_sumtype_v__ast__Expr(ADDR(v__ast__None, (((v__ast__None){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}))))); v__ast__Type _t2 = v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), typ), v__ast__TypeFlag__generic); return _t2; } - else if (ts->info._typ == 440 /* v.ast.Chan */) { + else if (ts->info._typ == 441 /* v.ast.Chan */) { v__ast__Type unwrap_typ = v__ast__Table_unwrap_generic_type(t, (*ts->info._v__ast__Chan).elem_type, generic_names, concrete_types); int idx = v__ast__Table_find_or_register_chan(t, unwrap_typ, v__ast__Type_nr_muls(unwrap_typ) > 0); v__ast__Type _t3 = v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), typ), v__ast__TypeFlag__generic); return _t3; } - else if (ts->info._typ == 412 /* v.ast.Map */) { + else if (ts->info._typ == 413 /* v.ast.Map */) { v__ast__Type unwrap_key_type = v__ast__Table_unwrap_generic_type(t, (*ts->info._v__ast__Map).key_type, generic_names, concrete_types); v__ast__Type unwrap_value_type = v__ast__Table_unwrap_generic_type(t, (*ts->info._v__ast__Map).value_type, generic_names, concrete_types); int idx = v__ast__Table_find_or_register_map(t, unwrap_key_type, unwrap_value_type); v__ast__Type _t4 = v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), typ), v__ast__TypeFlag__generic); return _t4; } - else if (ts->info._typ == 416 /* v.ast.Struct */) { + else if (ts->info._typ == 417 /* v.ast.Struct */) { if (!(*ts->info._v__ast__Struct).is_generic) { v__ast__Type _t5 = typ; return _t5; } - nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); - c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); + nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*ts->info._v__ast__Struct).generic_types.len; ++i) { Option_v__ast__Type _t6; if (_t6 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*ts->info._v__ast__Struct).generic_types, i)), generic_names, concrete_types), _t6.state == 0) { @@ -47116,13 +47161,13 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } } - else if (ts->info._typ == 434 /* v.ast.Interface */) { + else if (ts->info._typ == 435 /* v.ast.Interface */) { if (!(*ts->info._v__ast__Interface).is_generic) { v__ast__Type _t14 = typ; return _t14; } - nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); - c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); + nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*ts->info._v__ast__Interface).generic_types.len; ++i) { Option_v__ast__Type _t15; if (_t15 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*ts->info._v__ast__Interface).generic_types, i)), generic_names, concrete_types), _t15.state == 0) { @@ -47184,13 +47229,13 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } } - else if (ts->info._typ == 435 /* v.ast.SumType */) { + else if (ts->info._typ == 436 /* v.ast.SumType */) { if (!(*ts->info._v__ast__SumType).is_generic) { v__ast__Type _t23 = typ; return _t23; } - nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); - c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); + nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*ts->info._v__ast__SumType).generic_types.len; ++i) { Option_v__ast__Type _t24; if (_t24 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*ts->info._v__ast__SumType).generic_types, i)), generic_names, concrete_types), _t24.state == 0) { @@ -47256,7 +47301,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty else { } ; - if (ts->info._typ == 416 /* v.ast.Struct */) { + if (ts->info._typ == 417 /* v.ast.Struct */) { v__ast__Struct info = (*ts->info._v__ast__Struct); info.is_generic = false; info.concrete_types = final_concrete_types; @@ -47270,7 +47315,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty v__ast__Type _t33 = v__ast__Type_clear_flag(v__ast__Type_derive(v__ast__new_type(new_idx), typ), v__ast__TypeFlag__generic); return _t33; } - else if (ts->info._typ == 435 /* v.ast.SumType */) { + else if (ts->info._typ == 436 /* v.ast.SumType */) { Array_v__ast__Type variants = array_clone_to_depth(&(*ts->info._v__ast__SumType).variants, 0); 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)) { @@ -47300,7 +47345,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty v__ast__Type _t36 = v__ast__Type_clear_flag(v__ast__Type_derive(v__ast__new_type(new_idx), typ), v__ast__TypeFlag__generic); return _t36; } - else if (ts->info._typ == 434 /* v.ast.Interface */) { + else if (ts->info._typ == 435 /* v.ast.Interface */) { Array_v__ast__Fn imethods = array_clone_to_depth(&(*ts->info._v__ast__Interface).methods, 0); for (int _t37 = 0; _t37 < imethods.len; ++_t37) { v__ast__Fn* method = ((v__ast__Fn*)imethods.data) + _t37; @@ -47353,29 +47398,29 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Array_v__ast__Type generic_types) { v__ast__TypeSymbol* ts = v__ast__Table_sym(t, typ); - if (ts->info._typ == 411 /* v.ast.Array */) { + if (ts->info._typ == 412 /* v.ast.Array */) { v__ast__Type elem_type = (*ts->info._v__ast__Array).elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(t, elem_type); int dims = 1; for (;;) { - if (!((elem_sym->info)._typ == 411 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 412 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; } v__ast__Table_replace_generic_type(t, elem_type, generic_types); } - else if (ts->info._typ == 439 /* v.ast.ArrayFixed */) { + else if (ts->info._typ == 440 /* v.ast.ArrayFixed */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__ArrayFixed).elem_type, generic_types); } - else if (ts->info._typ == 440 /* v.ast.Chan */) { + else if (ts->info._typ == 441 /* v.ast.Chan */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__Chan).elem_type, generic_types); } - else if (ts->info._typ == 412 /* v.ast.Map */) { + else if (ts->info._typ == 413 /* v.ast.Map */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__Map).key_type, generic_types); v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__Map).value_type, generic_types); } - else if (ts->info._typ == 416 /* v.ast.Struct */) { + else if (ts->info._typ == 417 /* v.ast.Struct */) { Array_string _t1 = {0}; Array_v__ast__Type _t1_orig = (*ts->info._v__ast__Struct).generic_types; int _t1_len = _t1_orig.len; @@ -47398,7 +47443,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra } (*ts->info._v__ast__Struct).generic_types = generic_types; } - else if (ts->info._typ == 434 /* v.ast.Interface */) { + else if (ts->info._typ == 435 /* v.ast.Interface */) { Array_string _t4 = {0}; Array_v__ast__Type _t4_orig = (*ts->info._v__ast__Interface).generic_types; int _t4_len = _t4_orig.len; @@ -47421,7 +47466,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra } (*ts->info._v__ast__Interface).generic_types = generic_types; } - else if (ts->info._typ == 435 /* v.ast.SumType */) { + else if (ts->info._typ == 436 /* v.ast.SumType */) { Array_string _t7 = {0}; Array_v__ast__Type _t7_orig = (*ts->info._v__ast__SumType).generic_types; int _t7_len = _t7_orig.len; @@ -47454,16 +47499,16 @@ 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, 444) /*expected idx: 444, name: v.ast.GenericInst */ ; + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast(((*typ)->info)._v__ast__GenericInst,((*typ)->info)._typ, 445) /*expected idx: 445, 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; continue; } - if (parent->info._typ == 416 /* v.ast.Struct */) { + if (parent->info._typ == 417 /* v.ast.Struct */) { v__ast__Struct parent_info = (*parent->info._v__ast__Struct); if (!parent_info.is_generic) { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); + v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); continue; } @@ -47507,14 +47552,14 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } } } else { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of struct `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); + v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of struct `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } - else if (parent->info._typ == 434 /* v.ast.Interface */) { + else if (parent->info._typ == 435 /* v.ast.Interface */) { v__ast__Interface parent_info = (*parent->info._v__ast__Interface); if (!parent_info.is_generic) { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); + v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); continue; } @@ -47573,14 +47618,14 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { (*typ)->kind = parent->kind; (*typ)->methods = all_methods; } else { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of interface `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); + 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(); } } - else if (parent->info._typ == 435 /* v.ast.SumType */) { + else if (parent->info._typ == 436 /* v.ast.SumType */) { v__ast__SumType parent_info = (*parent->info._v__ast__SumType); if (!parent_info.is_generic) { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("sumtype `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); + v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("sumtype `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); continue; } @@ -47623,7 +47668,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { (*typ)->is_pub = true; (*typ)->kind = parent->kind; } else { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of sumtype `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); + 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(); } } @@ -47858,7 +47903,7 @@ inline v__ast__Type v__ast__Type_ref(v__ast__Type t) { inline v__ast__Type v__ast__Type_deref(v__ast__Type t) { int nr_muls = ((((int)(t)) >> 16) & 0xff); if (nr_muls == 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("deref: type `"), 0xfe10, {.d_s = v__ast__Type_str(t)}}, {_SLIT("` is not a pointer"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("deref: type `"), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(t)}}, {_SLIT("` is not a pointer"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__ast__Type _t1 = ((((int)(t)) & 0xff00ffff) | ((int)(((u32)(nr_muls - 1)) << 16U))); @@ -47892,7 +47937,7 @@ inline bool v__ast__Type_has_flag(v__ast__Type t, v__ast__TypeFlag flag) { Array_string v__ast__TypeSymbol_debug(v__ast__TypeSymbol* ts) { Array_string res = __new_array_with_default(0, 0, sizeof(string), 0); v__ast__TypeSymbol_dbg_common(ts, &/*arr*/res); - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("info: "), 0xfe10, {.d_s = v__ast__TypeInfo_str(ts->info)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("info: "), /*115 &v.ast.TypeInfo*/0xfe10, {.d_s = v__ast__TypeInfo_str(ts->info)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); Array_string _t3 = {0}; Array_v__ast__Fn _t3_orig = ts->methods; int _t3_len = _t3_orig.len; @@ -47903,7 +47948,7 @@ Array_string v__ast__TypeSymbol_debug(v__ast__TypeSymbol* ts) { string ti = v__ast__Fn_str(it); array_push((array*)&_t3, &ti); } - array_push((array*)&res, _MOV((string[]){ string_clone(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("methods ("), 0xfe07, {.d_i32 = ts->methods.len}}, {_SLIT("): "), 0, { .d_c = 0 }}})), Array_string_join(_t3, _SLIT(", ")))) })); + array_push((array*)&res, _MOV((string[]){ string_clone(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("methods ("), /*100 &int*/0xfe07, {.d_i32 = ts->methods.len}}, {_SLIT("): "), 0, { .d_c = 0 }}})), Array_string_join(_t3, _SLIT(", ")))) })); Array_string _t5 = res; return _t5; } @@ -47916,18 +47961,18 @@ Array_string v__ast__TypeSymbol_dbg(v__ast__TypeSymbol* ts) { } VV_LOCAL_SYMBOL void v__ast__TypeSymbol_dbg_common(v__ast__TypeSymbol* ts, Array_string* res) { - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("idx: 0x"), 0xfe10, {.d_s = int_hex(ts->idx)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parent_idx: 0x"), 0xfe10, {.d_s = int_hex(ts->parent_idx)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("mod: "), 0xfe10, {.d_s = ts->mod}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("name: "), 0xfe10, {.d_s = ts->name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cname: "), 0xfe10, {.d_s = ts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("kind: "), 0xfe10, {.d_s = v__ast__Kind_str(ts->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("is_pub: "), 0xfe10, {.d_s = ts->is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("language: "), 0xfe10, {.d_s = v__ast__Language_str(ts->language)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("idx: 0x"), /*115 &string*/0xfe10, {.d_s = int_hex(ts->idx)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parent_idx: 0x"), /*115 &string*/0xfe10, {.d_s = int_hex(ts->parent_idx)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("mod: "), /*115 &string*/0xfe10, {.d_s = ts->mod}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("name: "), /*115 &string*/0xfe10, {.d_s = ts->name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cname: "), /*115 &string*/0xfe10, {.d_s = ts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("kind: "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(ts->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("is_pub: "), /*115 &bool*/0xfe10, {.d_s = ts->is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("language: "), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(ts->language)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } string v__ast__Type_str(v__ast__Type t) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("ast.Type(0x"), 0xfe10, {.d_s = int_hex(t)}}, {_SLIT(" = "), 0xfe06, {.d_u32 = ((u32)(t))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("ast.Type(0x"), /*115 &string*/0xfe10, {.d_s = int_hex(t)}}, {_SLIT(" = "), /*117 &u32*/0xfe06, {.d_u32 = ((u32)(t))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t1; } @@ -47938,9 +47983,9 @@ string v__ast__Table_type_str(v__ast__Table* t, v__ast__Type typ) { Array_string v__ast__Type_debug(v__ast__Type t) { Array_string res = __new_array_with_default(0, 0, sizeof(string), 0); - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("idx: 0x"), 0x10fe10, {.d_s = int_hex(v__ast__Type_idx(t))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("type: 0x"), 0x10fe10, {.d_s = int_hex(t)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("nr_muls: "), 0xfe07, {.d_i32 = v__ast__Type_nr_muls(t)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("idx: 0x"), /*115 &string*/0x10fe10, {.d_s = int_hex(v__ast__Type_idx(t))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("type: 0x"), /*115 &string*/0x10fe10, {.d_s = int_hex(t)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("nr_muls: "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_nr_muls(t)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); if (v__ast__Type_has_flag(t, v__ast__TypeFlag__optional)) { array_push((array*)&res, _MOV((string[]){ string_clone(_SLIT("optional")) })); } @@ -48116,20 +48161,20 @@ string v__ast__TypeSymbol_str(v__ast__TypeSymbol* t) { // Attr: [noreturn] VNORETURN VV_LOCAL_SYMBOL void v__ast__TypeSymbol_no_info_panic(v__ast__TypeSymbol* t, string fname) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fname}}, {_SLIT(": no info for type: "), 0xfe10, {.d_s = t->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT(": no info for type: "), /*115 &string*/0xfe10, {.d_s = t->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); while(1); } // Attr: [inline] inline v__ast__Enum v__ast__TypeSymbol_enum_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 445 /* v.ast.Enum */) { + if ((t->info)._typ == 446 /* v.ast.Enum */) { v__ast__Enum _t1 = (*t->info._v__ast__Enum); return _t1; } - if ((t->info)._typ == 431 /* v.ast.Alias */) { + if ((t->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 445 /* v.ast.Enum */) { + if ((fsym->info)._typ == 446 /* v.ast.Enum */) { v__ast__Enum _t2 = (*fsym->info._v__ast__Enum); return _t2; } @@ -48141,13 +48186,13 @@ inline v__ast__Enum v__ast__TypeSymbol_enum_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__MultiReturn v__ast__TypeSymbol_mr_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 442 /* v.ast.MultiReturn */) { + if ((t->info)._typ == 443 /* v.ast.MultiReturn */) { v__ast__MultiReturn _t1 = (*t->info._v__ast__MultiReturn); return _t1; } - if ((t->info)._typ == 431 /* v.ast.Alias */) { + if ((t->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 442 /* v.ast.MultiReturn */) { + if ((fsym->info)._typ == 443 /* v.ast.MultiReturn */) { v__ast__MultiReturn _t2 = (*fsym->info._v__ast__MultiReturn); return _t2; } @@ -48159,13 +48204,13 @@ inline v__ast__MultiReturn v__ast__TypeSymbol_mr_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__Array v__ast__TypeSymbol_array_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 411 /* v.ast.Array */) { + if ((t->info)._typ == 412 /* v.ast.Array */) { v__ast__Array _t1 = (*t->info._v__ast__Array); return _t1; } - if ((t->info)._typ == 431 /* v.ast.Alias */) { + if ((t->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 411 /* v.ast.Array */) { + if ((fsym->info)._typ == 412 /* v.ast.Array */) { v__ast__Array _t2 = (*fsym->info._v__ast__Array); return _t2; } @@ -48177,13 +48222,13 @@ inline v__ast__Array v__ast__TypeSymbol_array_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__ArrayFixed v__ast__TypeSymbol_array_fixed_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 439 /* v.ast.ArrayFixed */) { + if ((t->info)._typ == 440 /* v.ast.ArrayFixed */) { v__ast__ArrayFixed _t1 = (*t->info._v__ast__ArrayFixed); return _t1; } - if ((t->info)._typ == 431 /* v.ast.Alias */) { + if ((t->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 439 /* v.ast.ArrayFixed */) { + if ((fsym->info)._typ == 440 /* v.ast.ArrayFixed */) { v__ast__ArrayFixed _t2 = (*fsym->info._v__ast__ArrayFixed); return _t2; } @@ -48195,13 +48240,13 @@ inline v__ast__ArrayFixed v__ast__TypeSymbol_array_fixed_info(v__ast__TypeSymbol // Attr: [inline] inline v__ast__Chan v__ast__TypeSymbol_chan_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 440 /* v.ast.Chan */) { + if ((t->info)._typ == 441 /* v.ast.Chan */) { v__ast__Chan _t1 = (*t->info._v__ast__Chan); return _t1; } - if ((t->info)._typ == 431 /* v.ast.Alias */) { + if ((t->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 440 /* v.ast.Chan */) { + if ((fsym->info)._typ == 441 /* v.ast.Chan */) { v__ast__Chan _t2 = (*fsym->info._v__ast__Chan); return _t2; } @@ -48213,13 +48258,13 @@ inline v__ast__Chan v__ast__TypeSymbol_chan_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__Thread v__ast__TypeSymbol_thread_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 441 /* v.ast.Thread */) { + if ((t->info)._typ == 442 /* v.ast.Thread */) { v__ast__Thread _t1 = (*t->info._v__ast__Thread); return _t1; } - if ((t->info)._typ == 431 /* v.ast.Alias */) { + if ((t->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 441 /* v.ast.Thread */) { + if ((fsym->info)._typ == 442 /* v.ast.Thread */) { v__ast__Thread _t2 = (*fsym->info._v__ast__Thread); return _t2; } @@ -48231,13 +48276,13 @@ inline v__ast__Thread v__ast__TypeSymbol_thread_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__Map v__ast__TypeSymbol_map_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 412 /* v.ast.Map */) { + if ((t->info)._typ == 413 /* v.ast.Map */) { v__ast__Map _t1 = (*t->info._v__ast__Map); return _t1; } - if ((t->info)._typ == 431 /* v.ast.Alias */) { + if ((t->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 412 /* v.ast.Map */) { + if ((fsym->info)._typ == 413 /* v.ast.Map */) { v__ast__Map _t2 = (*fsym->info._v__ast__Map); return _t2; } @@ -48249,13 +48294,13 @@ inline v__ast__Map v__ast__TypeSymbol_map_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__Struct v__ast__TypeSymbol_struct_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 416 /* v.ast.Struct */) { + if ((t->info)._typ == 417 /* v.ast.Struct */) { v__ast__Struct _t1 = (*t->info._v__ast__Struct); return _t1; } - if ((t->info)._typ == 431 /* v.ast.Alias */) { + if ((t->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 416 /* v.ast.Struct */) { + if ((fsym->info)._typ == 417 /* v.ast.Struct */) { v__ast__Struct _t2 = (*fsym->info._v__ast__Struct); return _t2; } @@ -48267,13 +48312,13 @@ inline v__ast__Struct v__ast__TypeSymbol_struct_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__SumType v__ast__TypeSymbol_sumtype_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 435 /* v.ast.SumType */) { + if ((t->info)._typ == 436 /* v.ast.SumType */) { v__ast__SumType _t1 = (*t->info._v__ast__SumType); return _t1; } - if ((t->info)._typ == 435 /* v.ast.SumType */) { + if ((t->info)._typ == 436 /* v.ast.SumType */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__SumType).parent_type); - if ((fsym->info)._typ == 435 /* v.ast.SumType */) { + if ((fsym->info)._typ == 436 /* v.ast.SumType */) { v__ast__SumType _t2 = (*fsym->info._v__ast__SumType); return _t2; } @@ -48285,7 +48330,7 @@ inline v__ast__SumType v__ast__TypeSymbol_sumtype_info(v__ast__TypeSymbol* t) { bool v__ast__TypeSymbol_is_heap(v__ast__TypeSymbol* t) { if (t->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((t->info)._v__ast__Struct,(t->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((t->info)._v__ast__Struct,(t->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; bool _t1 = info.is_heap; return _t1; } else { @@ -48339,7 +48384,7 @@ inline bool v__ast__TypeSymbol_is_pointer(v__ast__TypeSymbol* t) { inline bool v__ast__TypeSymbol_is_int(v__ast__TypeSymbol* t) { bool res = (t->kind == v__ast__Kind__i8 || t->kind == v__ast__Kind__i16 || t->kind == v__ast__Kind__int || t->kind == v__ast__Kind__i64 || t->kind == v__ast__Kind__isize || t->kind == v__ast__Kind__u8 || t->kind == v__ast__Kind__u16 || t->kind == v__ast__Kind__u32 || t->kind == v__ast__Kind__u64 || t->kind == v__ast__Kind__usize || t->kind == v__ast__Kind__int_literal || t->kind == v__ast__Kind__rune); if (!res && t->kind == v__ast__Kind__alias) { - bool _t1 = v__ast__Type_is_number((/* as */ *(v__ast__Alias*)__as_cast((t->info)._v__ast__Alias,(t->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type); + bool _t1 = v__ast__Type_is_number((/* as */ *(v__ast__Alias*)__as_cast((t->info)._v__ast__Alias,(t->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type); return _t1; } bool _t2 = res; @@ -48447,7 +48492,7 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { } case v__ast__Kind__alias: { - int _t9 = v__ast__Table_type_size(t, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type); + int _t9 = v__ast__Table_type_size(t, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type); return _t9; break; } @@ -48458,7 +48503,7 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { int max_alignment = 0; int total_size = 0; Array_v__ast__Type _t10; /* if prepend */ - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { Array_v__ast__Type _t11 = {0}; Array_v__ast__StructField _t11_orig = (*sym->info._v__ast__Struct).fields; int _t11_len = _t11_orig.len; @@ -48471,7 +48516,7 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { } _t10 =_t11; } else { - _t10 = (/* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 442) /*expected idx: 442, name: v.ast.MultiReturn */ ).types; + _t10 = (/* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ).types; } Array_v__ast__Type types = _t10; for (int _t13 = 0; _t13 < types.len; ++_t13) { @@ -48491,15 +48536,15 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { case v__ast__Kind__interface_: case v__ast__Kind__aggregate: { - if (sym->info._typ == 435 /* v.ast.SumType */) { + if (sym->info._typ == 436 /* v.ast.SumType */) { int _t15 = ((*sym->info._v__ast__SumType).fields.len + 2) * t->pointer_size; return _t15; } - else if (sym->info._typ == 429 /* v.ast.Aggregate */) { + else if (sym->info._typ == 430 /* v.ast.Aggregate */) { int _t16 = ((*sym->info._v__ast__Aggregate).fields.len + 2) * t->pointer_size; return _t16; } - else if (sym->info._typ == 434 /* v.ast.Interface */) { + else if (sym->info._typ == 435 /* v.ast.Interface */) { int res = ((*sym->info._v__ast__Interface).fields.len + 2) * t->pointer_size; for (int _t17 = 0; _t17 < (*sym->info._v__ast__Interface).embeds.len; ++_t17) { v__ast__Type etyp = ((v__ast__Type*)(*sym->info._v__ast__Interface).embeds.data)[_t17]; @@ -48518,7 +48563,7 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { } case v__ast__Kind__array_fixed: { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; int _t20 = info.size * v__ast__Table_type_size(t, info.elem_type); return _t20; break; @@ -48834,9 +48879,9 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { res = v__ast__Table_type_to_str_using_aliases(t, v__ast__Table_value_type(t, typ), import_aliases); } else { - if ((sym->info)._typ == 411 /* v.ast.Array */) { + if ((sym->info)._typ == 412 /* v.ast.Array */) { string elem_str = v__ast__Table_type_to_str_using_aliases(t, (*sym->info._v__ast__Array).elem_type, import_aliases); - res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[]"), 0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[]"), /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { res = _SLIT("array"); } @@ -48845,19 +48890,19 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } case v__ast__Kind__array_fixed: { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; string elem_str = v__ast__Table_type_to_str_using_aliases(t, info.elem_type, import_aliases); - if ((info.size_expr)._typ == 262 /* v.ast.EmptyExpr */) { - res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), 0xfe07, {.d_i32 = info.size}}, {_SLIT("]"), 0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + if ((info.size_expr)._typ == 263 /* v.ast.EmptyExpr */) { + res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { - res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = v__ast__Expr_str(info.size_expr)}}, {_SLIT("]"), 0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(info.size_expr)}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } break; } case v__ast__Kind__chan: { if (!string__eq(sym->mod, _SLIT("builtin")) && !string__eq(sym->name, _SLIT("chan"))) { - v__ast__Chan info = /* as */ *(v__ast__Chan*)__as_cast((sym->info)._v__ast__Chan,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.Chan */ ; + v__ast__Chan info = /* as */ *(v__ast__Chan*)__as_cast((sym->info)._v__ast__Chan,(sym->info)._typ, 441) /*expected idx: 441, name: v.ast.Chan */ ; v__ast__Type elem_type = info.elem_type; string mut_str = _SLIT(""); if (info.is_mut) { @@ -48865,13 +48910,13 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty elem_type = v__ast__Type_set_nr_muls(elem_type, v__ast__Type_nr_muls(elem_type) - 1); } string elem_str = v__ast__Table_type_to_str_using_aliases(t, elem_type, import_aliases); - res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("chan "), 0xfe10, {.d_s = mut_str}}, {_SLIT0, 0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("chan "), /*115 &string*/0xfe10, {.d_s = mut_str}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } break; } case v__ast__Kind__function: { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; if (!t->is_fmt) { res = v__ast__Table_fn_signature(t, (voidptr)&/*qq*/info.func, ((v__ast__FnSignatureOpts){.skip_receiver = 0,.type_only = true,})); } else { @@ -48900,16 +48945,16 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty string _t4 = _SLIT("map"); return _t4; } - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; string key_str = v__ast__Table_type_to_str_using_aliases(t, info.key_type, import_aliases); string val_str = v__ast__Table_type_to_str_using_aliases(t, info.value_type, import_aliases); - res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("map["), 0xfe10, {.d_s = key_str}}, {_SLIT("]"), 0xfe10, {.d_s = val_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("map["), /*115 &string*/0xfe10, {.d_s = key_str}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = val_str}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case v__ast__Kind__multi_return: { res = _SLIT("("); - v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 442) /*expected idx: 442, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; for (int i = 0; i < info.types.len; ++i) { v__ast__Type typ2 = ((v__ast__Type*)info.types.data)[i]; if (i > 0) { @@ -48925,7 +48970,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty case v__ast__Kind__sum_type: { if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - if (sym->info._typ == 416 /* v.ast.Struct */) { + if (sym->info._typ == 417 /* v.ast.Struct */) { res = /*f*/string__plus(res, _SLIT("<")); for (int i = 0; i < (*sym->info._v__ast__Struct).generic_types.len; ++i) { v__ast__Type gtyp = ((v__ast__Type*)(*sym->info._v__ast__Struct).generic_types.data)[i]; @@ -48936,7 +48981,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } res = /*f*/string__plus(res, _SLIT(">")); } - else if (sym->info._typ == 434 /* v.ast.Interface */) { + else if (sym->info._typ == 435 /* v.ast.Interface */) { res = /*f*/string__plus(res, _SLIT("<")); for (int i = 0; i < (*sym->info._v__ast__Interface).generic_types.len; ++i) { v__ast__Type gtyp = ((v__ast__Type*)(*sym->info._v__ast__Interface).generic_types.data)[i]; @@ -48947,7 +48992,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } res = /*f*/string__plus(res, _SLIT(">")); } - else if (sym->info._typ == 435 /* v.ast.SumType */) { + else if (sym->info._typ == 436 /* v.ast.SumType */) { res = /*f*/string__plus(res, _SLIT("<")); for (int i = 0; i < (*sym->info._v__ast__SumType).generic_types.len; ++i) { v__ast__Type gtyp = ((v__ast__Type*)(*sym->info._v__ast__SumType).generic_types.data)[i]; @@ -48962,7 +49007,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty else { } ; - } else if ((sym->info)._typ == 435 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ).is_anon) { + } else if ((sym->info)._typ == 436 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ).is_anon) { Array_string _t5 = {0}; Array_v__ast__Type _t5_orig = (*sym->info._v__ast__SumType).variants; int _t5_len = _t5_orig.len; @@ -48974,7 +49019,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty array_push((array*)&_t5, &ti); } Array_string variant_names =_t5; - res = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = Array_string_join(variant_names, _SLIT(" | "))}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = Array_string_join(variant_names, _SLIT(" | "))}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { res = v__ast__Table_shorten_user_defined_typenames(t, res, import_aliases); } @@ -48982,7 +49027,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } case v__ast__Kind__generic_inst: { - v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast((sym->info)._v__ast__GenericInst,(sym->info)._typ, 444) /*expected idx: 444, name: v.ast.GenericInst */ ; + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast((sym->info)._v__ast__GenericInst,(sym->info)._typ, 445) /*expected idx: 445, name: v.ast.GenericInst */ ; res = v__ast__Table_shorten_user_defined_typenames(t, string_all_before(sym->name, _SLIT("<")), import_aliases); res = /*f*/string__plus(res, _SLIT("<")); for (int i = 0; i < info.concrete_types.len; ++i) { @@ -49001,8 +49046,12 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty string _t7 = _SLIT("?"); return _t7; } - string _t8 = _SLIT("void"); - return _t8; + if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__result)) { + string _t8 = _SLIT("!"); + return _t8; + } + string _t9 = _SLIT("void"); + return _t9; break; } case v__ast__Kind__thread: @@ -49040,10 +49089,13 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty res = string__plus(strings__repeat('&', nr_muls), res); } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__optional)) { - res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("?"), 0xfe10, {.d_s = res}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("?"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT0, 0, { .d_c = 0 }}})); } - string _t9 = res; - return _t9; + if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__result)) { + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT0, 0, { .d_c = 0 }}})); + } + string _t10 = res; + return _t10; } VV_LOCAL_SYMBOL string v__ast__Table_shorten_user_defined_typenames(v__ast__Table* t, string originalname, Map_string_string import_aliases) { @@ -49197,13 +49249,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ return _t2; } v__ast__Table* table = global_table; - if (t->info._typ == 416 /* v.ast.Struct */) { + if (t->info._typ == 417 /* v.ast.Struct */) { if (v__ast__Type_has_flag((*t->info._v__ast__Struct).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(table, (*t->info._v__ast__Struct).parent_type); Option_v__ast__Fn _t3; if (_t3 = v__ast__TypeSymbol_find_method(parent_sym, name), _t3.state == 0) { v__ast__Fn x = *(v__ast__Fn*)_t3.data; - if (parent_sym->info._typ == 416 /* v.ast.Struct */) { + if (parent_sym->info._typ == 417 /* v.ast.Struct */) { v__ast__Fn method = x; Array_string _t4 = {0}; Array_v__ast__Type _t4_orig = (*parent_sym->info._v__ast__Struct).generic_types; @@ -49240,7 +49292,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t9), sizeof(v__ast__Fn)); return _t9; } - else if (parent_sym->info._typ == 434 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 435 /* v.ast.Interface */) { v__ast__Fn method = x; Array_string _t10 = {0}; Array_v__ast__Type _t10_orig = (*parent_sym->info._v__ast__Interface).generic_types; @@ -49277,7 +49329,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t15), sizeof(v__ast__Fn)); return _t15; } - else if (parent_sym->info._typ == 435 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 436 /* v.ast.SumType */) { v__ast__Fn method = x; Array_string _t16 = {0}; Array_v__ast__Type _t16_orig = (*parent_sym->info._v__ast__SumType).generic_types; @@ -49321,13 +49373,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ } } } - else if (t->info._typ == 434 /* v.ast.Interface */) { + else if (t->info._typ == 435 /* v.ast.Interface */) { if (v__ast__Type_has_flag((*t->info._v__ast__Interface).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(table, (*t->info._v__ast__Interface).parent_type); Option_v__ast__Fn _t22; if (_t22 = v__ast__TypeSymbol_find_method(parent_sym, name), _t22.state == 0) { v__ast__Fn x = *(v__ast__Fn*)_t22.data; - if (parent_sym->info._typ == 416 /* v.ast.Struct */) { + if (parent_sym->info._typ == 417 /* v.ast.Struct */) { v__ast__Fn method = x; Array_string _t23 = {0}; Array_v__ast__Type _t23_orig = (*parent_sym->info._v__ast__Struct).generic_types; @@ -49364,7 +49416,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t28), sizeof(v__ast__Fn)); return _t28; } - else if (parent_sym->info._typ == 434 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 435 /* v.ast.Interface */) { v__ast__Fn method = x; Array_string _t29 = {0}; Array_v__ast__Type _t29_orig = (*parent_sym->info._v__ast__Interface).generic_types; @@ -49401,7 +49453,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t34), sizeof(v__ast__Fn)); return _t34; } - else if (parent_sym->info._typ == 435 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 436 /* v.ast.SumType */) { v__ast__Fn method = x; Array_string _t35 = {0}; Array_v__ast__Type _t35_orig = (*parent_sym->info._v__ast__SumType).generic_types; @@ -49445,13 +49497,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ } } } - else if (t->info._typ == 435 /* v.ast.SumType */) { + else if (t->info._typ == 436 /* v.ast.SumType */) { if (v__ast__Type_has_flag((*t->info._v__ast__SumType).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(table, (*t->info._v__ast__SumType).parent_type); Option_v__ast__Fn _t41; if (_t41 = v__ast__TypeSymbol_find_method(parent_sym, name), _t41.state == 0) { v__ast__Fn x = *(v__ast__Fn*)_t41.data; - if (parent_sym->info._typ == 416 /* v.ast.Struct */) { + if (parent_sym->info._typ == 417 /* v.ast.Struct */) { v__ast__Fn method = x; Array_string _t42 = {0}; Array_v__ast__Type _t42_orig = (*parent_sym->info._v__ast__Struct).generic_types; @@ -49488,7 +49540,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t47), sizeof(v__ast__Fn)); return _t47; } - else if (parent_sym->info._typ == 434 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 435 /* v.ast.Interface */) { v__ast__Fn method = x; Array_string _t48 = {0}; Array_v__ast__Type _t48_orig = (*parent_sym->info._v__ast__Interface).generic_types; @@ -49525,7 +49577,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t53), sizeof(v__ast__Fn)); return _t53; } - else if (parent_sym->info._typ == 435 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 436 /* v.ast.SumType */) { v__ast__Fn method = x; Array_string _t54 = {0}; Array_v__ast__Type _t54_orig = (*parent_sym->info._v__ast__SumType).generic_types; @@ -49590,7 +49642,7 @@ bool v__ast__TypeSymbol_is_js_compatible(v__ast__TypeSymbol* t) { bool _t3 = true; return _t3; } - if (t->info._typ == 435 /* v.ast.SumType */) { + if (t->info._typ == 436 /* v.ast.SumType */) { for (int _t4 = 0; _t4 < (*t->info._v__ast__SumType).variants.len; ++_t4) { v__ast__Type variant = ((v__ast__Type*)(*t->info._v__ast__SumType).variants.data)[_t4]; v__ast__TypeSymbol* sym = v__ast__Table_final_sym(table, variant); @@ -49628,19 +49680,19 @@ multi_return_bool_bool_int v__ast__TypeSymbol_str_method_info(v__ast__TypeSymbol } Option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name) { - if (t->info._typ == 429 /* v.ast.Aggregate */) { + if (t->info._typ == 430 /* v.ast.Aggregate */) { Option_v__ast__StructField _t1 = v__ast__Aggregate_find_field(&(*t->info._v__ast__Aggregate), name); return _t1; } - else if (t->info._typ == 416 /* v.ast.Struct */) { + else if (t->info._typ == 417 /* v.ast.Struct */) { Option_v__ast__StructField _t2 = v__ast__Struct_find_field(&(*t->info._v__ast__Struct), name); return _t2; } - else if (t->info._typ == 434 /* v.ast.Interface */) { + else if (t->info._typ == 435 /* v.ast.Interface */) { Option_v__ast__StructField _t3 = v__ast__Interface_find_field(&(*t->info._v__ast__Interface), name); return _t3; } - else if (t->info._typ == 435 /* v.ast.SumType */) { + else if (t->info._typ == 436 /* v.ast.SumType */) { Option_v__ast__StructField _t4 = v__ast__SumType_find_field(&(*t->info._v__ast__SumType), name); return _t4; } @@ -49724,7 +49776,7 @@ v__ast__StructField v__ast__Struct_get_field(v__ast__Struct* s, string name) { v__ast__StructField _t2 = field; return _t2; } - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown field `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); return (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}; } @@ -49766,8 +49818,8 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__ast__Type right_type0 = _const_v__ast__void_type; for (int i = 0; i < node->right.len; ++i) { v__ast__Expr* right = ((v__ast__Expr*)node->right.data) + i; - if ((right)->_typ == 252 /* v.ast.CallExpr */ || (right)->_typ == 267 /* v.ast.IfExpr */ || (right)->_typ == 274 /* v.ast.LockExpr */ || (right)->_typ == 276 /* v.ast.MatchExpr */) { - if (((right)->_typ == 267 /* v.ast.IfExpr */ || (right)->_typ == 276 /* v.ast.MatchExpr */) && node->left.len == node->right.len && !is_decl && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 266 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 286 /* v.ast.SelectorExpr */) && !v__ast__Expr_is_blank_ident((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))) { + if ((right)->_typ == 253 /* v.ast.CallExpr */ || (right)->_typ == 268 /* v.ast.IfExpr */ || (right)->_typ == 275 /* v.ast.LockExpr */ || (right)->_typ == 277 /* v.ast.MatchExpr */) { + if (((right)->_typ == 268 /* v.ast.IfExpr */ || (right)->_typ == 277 /* v.ast.MatchExpr */) && node->left.len == node->right.len && !is_decl && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 267 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 287 /* v.ast.SelectorExpr */) && !v__ast__Expr_is_blank_ident((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))) { c->expected_type = v__checker__Checker_expr(c, (*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i))); } v__ast__Type right_type = v__checker__Checker_expr(c, *right); @@ -49779,7 +49831,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__ast__TypeSymbol* right_type_sym = v__ast__Table_sym(c->table, right_type); if (right_type_sym->kind == v__ast__Kind__multi_return) { if (node->right.len > 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use multi-value "), 0xfe10, {.d_s = right_type_sym->name}}, {_SLIT(" in single-value context"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*right)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use multi-value "), /*115 &string*/0xfe10, {.d_s = right_type_sym->name}}, {_SLIT(" in single-value context"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*right)); } node->right_types = v__ast__TypeSymbol_mr_info(right_type_sym).types; right_len = node->right_types.len; @@ -49787,22 +49839,22 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; right_len = 0; } } - if ((right)->_typ == 270 /* v.ast.InfixExpr */) { + if ((right)->_typ == 271 /* v.ast.InfixExpr */) { if ((*right->_v__ast__InfixExpr).op == v__token__Kind__arrow) { v__checker__Checker_error(c, _SLIT("cannot use `<-` on the right-hand side of an assignment, as it does not return any values"), (*right->_v__ast__InfixExpr).pos); } } - if ((right)->_typ == 266 /* v.ast.Ident */) { + if ((right)->_typ == 267 /* v.ast.Ident */) { if ((*right->_v__ast__Ident).is_mut) { v__checker__Checker_error(c, _SLIT("unexpected `mut` on right-hand side of assignment"), (*right->_v__ast__Ident).mut_pos); } } - if ((right)->_typ == 278 /* v.ast.None */) { + if ((right)->_typ == 279 /* v.ast.None */) { v__checker__Checker_error(c, _SLIT("you can not assign a `none` value to a variable"), (*right->_v__ast__None).pos); } } if (node->left.len != right_len) { - if ((right_first)._typ == 252 /* v.ast.CallExpr */) { + if ((right_first)._typ == 253 /* v.ast.CallExpr */) { if (node->left_types.len > 0 && v__ast__Type_alias_eq((*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, 0)), _const_v__ast__void_type)) { // Defer begin if (v__checker__Checker_assign_stmt_defer_0) { @@ -49811,9 +49863,9 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; // Defer end return; } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("assignment mismatch: "), 0xfe07, {.d_i32 = node->left.len}}, {_SLIT(" variable(s) but `"), 0xfe10, {.d_s = (*right_first._v__ast__CallExpr).name}}, {_SLIT("()` returns "), 0xfe07, {.d_i32 = right_len}}, {_SLIT(" value(s)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("assignment mismatch: "), /*100 &int*/0xfe07, {.d_i32 = node->left.len}}, {_SLIT(" variable(s) but `"), /*115 &string*/0xfe10, {.d_s = (*right_first._v__ast__CallExpr).name}}, {_SLIT("()` returns "), /*100 &int*/0xfe07, {.d_i32 = right_len}}, {_SLIT(" value(s)"), 0, { .d_c = 0 }}})), node->pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("assignment mismatch: "), 0xfe07, {.d_i32 = node->left.len}}, {_SLIT(" variable(s) "), 0xfe07, {.d_i32 = right_len}}, {_SLIT(" value(s)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("assignment mismatch: "), /*100 &int*/0xfe07, {.d_i32 = node->left.len}}, {_SLIT(" variable(s) "), /*100 &int*/0xfe07, {.d_i32 = right_len}}, {_SLIT(" value(s)"), 0, { .d_c = 0 }}})), node->pos); } // Defer begin if (v__checker__Checker_assign_stmt_defer_0) { @@ -49824,21 +49876,21 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } for (int i = 0; i < node->left.len; ++i) { v__ast__Expr* left = ((v__ast__Expr*)node->left.data) + i; - if ((left)->_typ == 252 /* v.ast.CallExpr */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot call function `"), 0xfe10, {.d_s = (*left->_v__ast__CallExpr).name}}, {_SLIT("()` on the left side of an assignment"), 0, { .d_c = 0 }}})), (*left->_v__ast__CallExpr).pos); - } else if ((left)->_typ == 283 /* v.ast.PrefixExpr */) { - if (((*left->_v__ast__PrefixExpr).right)._typ == 252 /* v.ast.CallExpr */ && (*left->_v__ast__PrefixExpr).op == v__token__Kind__mul) { + if ((left)->_typ == 253 /* v.ast.CallExpr */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot call function `"), /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__CallExpr).name}}, {_SLIT("()` on the left side of an assignment"), 0, { .d_c = 0 }}})), (*left->_v__ast__CallExpr).pos); + } else if ((left)->_typ == 284 /* v.ast.PrefixExpr */) { + if (((*left->_v__ast__PrefixExpr).right)._typ == 253 /* v.ast.CallExpr */ && (*left->_v__ast__PrefixExpr).op == v__token__Kind__mul) { v__checker__Checker_error(c, _SLIT("cannot dereference a function call on the left side of an assignment, use a temporary variable"), (*left->_v__ast__PrefixExpr).pos); } - } else if ((left)->_typ == 269 /* v.ast.IndexExpr */) { - if (((*left->_v__ast__IndexExpr).index)._typ == 284 /* v.ast.RangeExpr */) { + } else if ((left)->_typ == 270 /* v.ast.IndexExpr */) { + if (((*left->_v__ast__IndexExpr).index)._typ == 285 /* v.ast.RangeExpr */) { v__checker__Checker_error(c, _SLIT("cannot reassign using range expression on the left side of an assignment"), (*left->_v__ast__IndexExpr).pos); } } bool is_blank_ident = v__ast__Expr_is_blank_ident(/*rec*/*left); v__ast__Type left_type = _const_v__ast__void_type; if (!is_decl && !is_blank_ident) { - if ((left)->_typ == 266 /* v.ast.Ident */ || (left)->_typ == 286 /* v.ast.SelectorExpr */) { + if ((left)->_typ == 267 /* v.ast.Ident */ || (left)->_typ == 287 /* v.ast.SelectorExpr */) { c->prevent_sum_type_unwrapping_once = true; } left_type = v__checker__Checker_expr(c, *left); @@ -49846,8 +49898,8 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } if (node->right_types.len < node->left.len) { bool old_inside_ref_lit = c->inside_ref_lit; - if ((left)->_typ == 266 /* v.ast.Ident */) { - if (((*left->_v__ast__Ident).info)._typ == 376 /* v.ast.IdentVar */) { + if ((left)->_typ == 267 /* v.ast.Ident */) { + if (((*left->_v__ast__Ident).info)._typ == 377 /* v.ast.IdentVar */) { c->inside_ref_lit = c->inside_ref_lit || (*(*left->_v__ast__Ident).info._v__ast__IdentVar).share == v__ast__ShareType__shared_t; } } @@ -49861,9 +49913,9 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } v__ast__Expr right = (i < node->right.len ? ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->right, i))) : ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->right, 0)))); v__ast__Type right_type = (*(v__ast__Type*)/*ee elem_sym */array_get(node->right_types, i)); - if ((right)._typ == 266 /* v.ast.Ident */) { + if ((right)._typ == 267 /* v.ast.Ident */) { v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); - if ((right_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((right_sym->info)._typ == 417 /* v.ast.Struct */) { if ((*right_sym->info._v__ast__Struct).generic_types.len > 0) { Option_v__ast__ScopeObject _t2; if (_t2 = v__ast__Scope_find((*right._v__ast__Ident).scope, (*right._v__ast__Ident).name), _t2.state == 0) { @@ -49872,17 +49924,17 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } } - } else if ((right)._typ == 258 /* v.ast.ComptimeSelector */) { + } else if ((right)._typ == 259 /* v.ast.ComptimeSelector */) { right_type = c->comptime_fields_default_type; } if (is_decl) { - if ((right)._typ == 291 /* v.ast.StructInit */) { + if ((right)._typ == 292 /* v.ast.StructInit */) { if (v__ast__Type_has_flag((*right._v__ast__StructInit).typ, v__ast__TypeFlag__generic)) { v__checker__Checker_expr(c, right); right_type = (*right._v__ast__StructInit).typ; } - } else if ((right)._typ == 283 /* v.ast.PrefixExpr */) { - if ((*right._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*right._v__ast__PrefixExpr).right)._typ == 291 /* v.ast.StructInit */) { + } else if ((right)._typ == 284 /* v.ast.PrefixExpr */) { + if ((*right._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*right._v__ast__PrefixExpr).right)._typ == 292 /* v.ast.StructInit */) { right_type = v__checker__Checker_expr(c, right); } } @@ -49892,7 +49944,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; left_type = v__ast__mktyp(right_type); } if (v__ast__Type_alias_eq(left_type, _const_v__ast__int_type)) { - if ((right)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((right)._typ == 272 /* v.ast.IntegerLiteral */) { bool is_large = (*right._v__ast__IntegerLiteral).val.len > 13; if (!is_large && (*right._v__ast__IntegerLiteral).val.len > 8) { i64 val = string_i64((*right._v__ast__IntegerLiteral).val); @@ -49907,8 +49959,8 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__checker__Checker_fail_if_immutable(c, *left); } if (v__ast__Type_is_ptr(right_type) && v__ast__Type_is_ptr(left_type)) { - if ((right)._typ == 266 /* v.ast.Ident */) { - if (((*right._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((right)._typ == 267 /* v.ast.Ident */) { + if (((*right._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { v__ast__Var* obj = &(*(*right._v__ast__Ident).obj._v__ast__Var); if (c->fn_scope != ((voidptr)(0))) { Option_v__ast__Var_ptr _t3 = v__ast__Scope_find_var(c->fn_scope, (*(*right._v__ast__Ident).obj._v__ast__Var).name); @@ -49922,37 +49974,37 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; if (obj->is_stack_obj && !c->inside_unsafe) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, v__ast__Type_set_nr_muls(obj->typ, 0)); if (!v__ast__TypeSymbol_is_heap(type_sym) && !c->pref->translated && !c->file->is_translated) { - string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*right._v__ast__Ident).name}}, {_SLIT("` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), 0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*right._v__ast__Ident).pos); + string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*right._v__ast__Ident).name}}, {_SLIT("` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), /*115 &string*/0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*right._v__ast__Ident).pos); } } } } } - if (!is_decl && (left)->_typ == 266 /* v.ast.Ident */ && !is_blank_ident && !v__ast__Type_is_real_pointer(left_type) && v__ast__Type_is_real_pointer(right_type) && !v__ast__Type_has_flag(right_type, v__ast__TypeFlag__shared_f)) { + if (!is_decl && (left)->_typ == 267 /* v.ast.Ident */ && !is_blank_ident && !v__ast__Type_is_real_pointer(left_type) && v__ast__Type_is_real_pointer(right_type) && !v__ast__Type_has_flag(right_type, v__ast__TypeFlag__shared_f)) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, left_type); if (left_sym->kind != v__ast__Kind__function) { - v__checker__Checker_warn(c, string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign a reference to a value (this will be an error soon) left="), 0xfe10, {.d_s = v__ast__Table_type_str(c->table, left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Type_is_ptr(left_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" "), 0, { .d_c = 0 }}})), str_intp(4, _MOV((StrIntpData[]){{_SLIT("right="), 0xfe10, {.d_s = v__ast__Table_type_str(c->table, right_type)}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Type_is_real_pointer(right_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" ptr="), 0xfe10, {.d_s = v__ast__Type_is_ptr(right_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))), node->pos); + v__checker__Checker_warn(c, string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign a reference to a value (this will be an error soon) left="), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_str(c->table, left_type)}}, {_SLIT(" "), /*115 &bool*/0xfe10, {.d_s = v__ast__Type_is_ptr(left_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" "), 0, { .d_c = 0 }}})), str_intp(4, _MOV((StrIntpData[]){{_SLIT("right="), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_str(c->table, right_type)}}, {_SLIT(" "), /*115 &bool*/0xfe10, {.d_s = v__ast__Type_is_real_pointer(right_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" ptr="), /*115 &bool*/0xfe10, {.d_s = v__ast__Type_is_ptr(right_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))), node->pos); } } array_push((array*)&node->left_types, _MOV((v__ast__Type[]){ left_type })); - if (left->_typ == 266 /* v.ast.Ident */) { + if (left->_typ == 267 /* v.ast.Ident */) { if ((*left->_v__ast__Ident).kind == v__ast__IdentKind__blank_ident) { left_type = right_type; (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i)) = right_type; if (!(node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign)) { v__checker__Checker_error(c, _SLIT("cannot modify blank `_` identifier"), (*left->_v__ast__Ident).pos); } - } else if (((*left->_v__ast__Ident).info)._typ != 376 /* v.ast.IdentVar */) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to "), 0xfe10, {.d_s = v__ast__IdentKind_str((*left->_v__ast__Ident).kind)}}, {_SLIT(" `"), 0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); + } else if (((*left->_v__ast__Ident).info)._typ != 377 /* v.ast.IdentVar */) { + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to "), /*115 &v.ast.IdentKind*/0xfe10, {.d_s = v__ast__IdentKind_str((*left->_v__ast__Ident).kind)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); } else { if (is_decl) { v__checker__Checker_check_valid_snake_case(c, (*left->_v__ast__Ident).name, _SLIT("variable name"), (*left->_v__ast__Ident).pos); if (Array_string_contains(_const_v__checker__reserved_type_names, (*left->_v__ast__Ident).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), 0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT("` as a variable name"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT("` as a variable name"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); } } - v__ast__IdentVar ident_var_info = /* as */ *(v__ast__IdentVar*)__as_cast(((*left->_v__ast__Ident).info)._v__ast__IdentVar,((*left->_v__ast__Ident).info)._typ, 376) /*expected idx: 376, name: v.ast.IdentVar */ ; + v__ast__IdentVar ident_var_info = /* as */ *(v__ast__IdentVar*)__as_cast(((*left->_v__ast__Ident).info)._v__ast__IdentVar,((*left->_v__ast__Ident).info)._typ, 377) /*expected idx: 377, name: v.ast.IdentVar */ ; if (ident_var_info.share == v__ast__ShareType__shared_t) { left_type = v__ast__Type_set_flag(left_type, v__ast__TypeFlag__shared_f); if (is_decl) { @@ -49971,7 +50023,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; ident_var_info.typ = left_type; (*left->_v__ast__Ident).info = v__ast__IdentVar_to_sumtype_v__ast__IdentInfo(&ident_var_info); if (left_type != 0) { - if ((*left->_v__ast__Ident).obj._typ == 324 /* v.ast.Var */) { + if ((*left->_v__ast__Ident).obj._typ == 325 /* v.ast.Var */) { (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = left_type; if ((*(*left->_v__ast__Ident).obj._v__ast__Var).is_auto_deref) { (*(*left->_v__ast__Ident).obj._v__ast__Var).is_used = true; @@ -49982,14 +50034,14 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } if (Array_int_contains(_const_v__ast__unsigned_integer_type_idxs, left_type)) { - if ((right)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((right)._typ == 272 /* v.ast.IntegerLiteral */) { if (string_at((*right._v__ast__IntegerLiteral).val, 0) == '-') { v__checker__Checker_error(c, _SLIT("Cannot assign negative value to unsigned integer type"), (*right._v__ast__IntegerLiteral).pos); } } } } - else if ((*left->_v__ast__Ident).obj._typ == 323 /* v.ast.GlobalField */) { + else if ((*left->_v__ast__Ident).obj._typ == 324 /* v.ast.GlobalField */) { (*(*left->_v__ast__Ident).obj._v__ast__GlobalField).typ = left_type; } @@ -49998,23 +50050,23 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; ; } if (is_decl) { - string full_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*left->_v__ast__Ident).mod}}, {_SLIT("."), 0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string full_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__Ident).mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_v__ast__ScopeObject _t5; if (_t5 = v__ast__Scope_find(c->file->global_scope, full_name), _t5.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t5.data; - if ((obj)._typ == 322 /* v.ast.ConstField */) { - v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate of a const name `"), 0xfe10, {.d_s = full_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); + if ((obj)._typ == 323 /* v.ast.ConstField */) { + v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate of a const name `"), /*115 &string*/0xfe10, {.d_s = full_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); } } } } } - else if (left->_typ == 283 /* v.ast.PrefixExpr */) { + else if (left->_typ == 284 /* v.ast.PrefixExpr */) { if ((*left->_v__ast__PrefixExpr).op == v__token__Kind__mul) { if (!c->inside_unsafe && !c->pref->translated && !c->file->is_translated) { v__checker__Checker_error(c, _SLIT("modifying variables via dereferencing can only be done in `unsafe` blocks"), node->pos); - } else if (((*left->_v__ast__PrefixExpr).right)._typ == 266 /* v.ast.Ident */) { - if (((*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + } else if (((*left->_v__ast__PrefixExpr).right)._typ == 267 /* v.ast.Ident */) { + if (((*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { (*(*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj._v__ast__Var).is_used = true; } } @@ -50023,8 +50075,8 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__checker__Checker_error(c, _SLIT("non-name on the left side of `:=`"), (*left->_v__ast__PrefixExpr).pos); } } - else if (left->_typ == 286 /* v.ast.SelectorExpr */) { - if (((*left->_v__ast__SelectorExpr).expr)._typ == 269 /* v.ast.IndexExpr */) { + else if (left->_typ == 287 /* v.ast.SelectorExpr */) { + if (((*left->_v__ast__SelectorExpr).expr)._typ == 270 /* v.ast.IndexExpr */) { if ((*(*left->_v__ast__SelectorExpr).expr._v__ast__IndexExpr).is_map) { (*(*left->_v__ast__SelectorExpr).expr._v__ast__IndexExpr).is_setter = true; } @@ -50032,13 +50084,13 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } else { - if ((left)->_typ == 269 /* v.ast.IndexExpr */) { + if ((left)->_typ == 270 /* v.ast.IndexExpr */) { if ((*left->_v__ast__IndexExpr).is_map && (*left->_v__ast__IndexExpr).is_setter) { v__ast__IndexExpr_recursive_mapset_is_setter(&(*left->_v__ast__IndexExpr), true); } } if (is_decl) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-name `"), 0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("` on left side of `:=`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-name `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("` on left side of `:=`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } } ; @@ -50055,26 +50107,26 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, left_type_unwrapped); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type_unwrapped); - if (left_sym->kind == v__ast__Kind__array && !c->inside_unsafe && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__array && (left)->_typ == 266 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 266 /* v.ast.Ident */) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("use `array2 "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" array1.clone()` instead of `array2 "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" array1` (or use `unsafe`)"), 0, { .d_c = 0 }}})), node->pos); + if (left_sym->kind == v__ast__Kind__array && !c->inside_unsafe && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__array && (left)->_typ == 267 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 267 /* v.ast.Ident */) { + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("use `array2 "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" array1.clone()` instead of `array2 "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" array1` (or use `unsafe`)"), 0, { .d_c = 0 }}})), node->pos); } if (left_sym->kind == v__ast__Kind__array && right_sym->kind == v__ast__Kind__array) { - v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Type left_elem_type = v__ast__Table_unaliased_type(c->table, left_info.elem_type); - v__ast__Array right_info = /* as */ *(v__ast__Array*)__as_cast((right_sym->info)._v__ast__Array,(right_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array right_info = /* as */ *(v__ast__Array*)__as_cast((right_sym->info)._v__ast__Array,(right_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Type right_elem_type = v__ast__Table_unaliased_type(c->table, right_info.elem_type); if (v__ast__Type_nr_muls(left_type_unwrapped) == v__ast__Type_nr_muls(right_type_unwrapped) && left_info.nr_dims == right_info.nr_dims && v__ast__Type_alias_eq(left_elem_type, right_elem_type)) { continue; } } - if (left_sym->kind == v__ast__Kind__array_fixed && !c->inside_unsafe && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__array_fixed && (left)->_typ == 266 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 266 /* v.ast.Ident */) { - if ((right_sym->info)._typ == 439 /* v.ast.ArrayFixed */) { + if (left_sym->kind == v__ast__Kind__array_fixed && !c->inside_unsafe && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__array_fixed && (left)->_typ == 267 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 267 /* v.ast.Ident */) { + if ((right_sym->info)._typ == 440 /* v.ast.ArrayFixed */) { if (v__ast__Type_is_ptr((*right_sym->info._v__ast__ArrayFixed).elem_type)) { v__checker__Checker_error(c, _SLIT("assignment from one fixed array to another with a pointer element type is prohibited outside of `unsafe`"), node->pos); } } } - if (left_sym->kind == v__ast__Kind__map && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__map && !v__ast__Expr_is_blank_ident(/*rec*/*left) && v__ast__Expr_is_lvalue(right) && (!v__ast__Type_is_ptr(right_type) || ((right)._typ == 266 /* v.ast.Ident */ && v__ast__Expr_is_auto_deref_var(right)))) { + if (left_sym->kind == v__ast__Kind__map && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__map && !v__ast__Expr_is_blank_ident(/*rec*/*left) && v__ast__Expr_is_lvalue(right) && (!v__ast__Type_is_ptr(right_type) || ((right)._typ == 267 /* v.ast.Ident */ && v__ast__Expr_is_auto_deref_var(right)))) { v__checker__Checker_error(c, _SLIT("cannot copy map: call `move` or `clone` method (or use a reference)"), v__ast__Expr_pos(right)); } bool left_is_ptr = v__ast__Type_is_ptr(left_type) || v__ast__TypeSymbol_is_pointer(left_sym); @@ -50084,16 +50136,16 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } bool right_is_ptr = v__ast__Type_is_ptr(right_type) || v__ast__TypeSymbol_is_pointer(right_sym); if (!right_is_ptr && node->op == v__token__Kind__assign && v__ast__Type_is_number(right_type_unwrapped)) { - v__checker__Checker_error(c, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot assign to `"), 0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("`: "), 0, { .d_c = 0 }}})), v__checker__Checker_expected_msg(c, right_type_unwrapped, left_type_unwrapped)), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot assign to `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("`: "), 0, { .d_c = 0 }}})), v__checker__Checker_expected_msg(c, right_type_unwrapped, left_type_unwrapped)), v__ast__Expr_pos(right)); } - if (!v__ast__TypeSymbol_is_number(right_sym) && !v__ast__Type_has_flag(left_type, v__ast__TypeFlag__shared_f) && ((right)._typ == 291 /* v.ast.StructInit */ || !right_is_ptr)) { + if (!v__ast__TypeSymbol_is_number(right_sym) && !v__ast__Type_has_flag(left_type, v__ast__TypeFlag__shared_f) && ((right)._typ == 292 /* v.ast.StructInit */ || !right_is_ptr)) { string left_name = v__ast__Table_type_to_str(c->table, left_type_unwrapped); v__ast__Type rtype = right_type_unwrapped; if (v__ast__Type_is_ptr(rtype)) { rtype = v__ast__Type_deref(rtype); } string right_name = v__ast__Table_type_to_str(c->table, rtype); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } @@ -50102,29 +50154,29 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; else if (node->op == (v__token__Kind__plus_assign) || node->op == (v__token__Kind__minus_assign)) { if (v__ast__Type_alias_eq(left_type, _const_v__ast__string_type)) { if (node->op != v__token__Kind__plus_assign) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` not defined on left operand type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` not defined on left operand type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } if (!v__ast__Type_alias_eq(right_type, _const_v__ast__string_type)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid right operand: "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" "), 0xfe10, {.d_s = right_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid right operand: "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } } else if (!v__ast__TypeSymbol_is_number(left_sym) && !(left_sym->kind == v__ast__Kind__byteptr || left_sym->kind == v__ast__Kind__charptr || left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__alias)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` not defined on left operand type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` not defined on left operand type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } else if (!v__ast__TypeSymbol_is_number(right_sym) && !(left_sym->kind == v__ast__Kind__byteptr || left_sym->kind == v__ast__Kind__charptr || left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__alias)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid right operand: "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" "), 0xfe10, {.d_s = right_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid right operand: "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } } else if (node->op == (v__token__Kind__mult_assign) || node->op == (v__token__Kind__div_assign)) { if (!v__ast__TypeSymbol_is_number(left_sym) && !v__ast__TypeSymbol_is_int(v__ast__Table_final_sym(c->table, left_type_unwrapped)) && !(left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__alias)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on left operand type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on left operand type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } else if (!v__ast__TypeSymbol_is_number(right_sym) && !v__ast__TypeSymbol_is_int(v__ast__Table_final_sym(c->table, left_type_unwrapped)) && !(left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__alias)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on right operand type `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on right operand type `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } } else if (node->op == (v__token__Kind__and_assign) || node->op == (v__token__Kind__or_assign) || node->op == (v__token__Kind__xor_assign) || node->op == (v__token__Kind__mod_assign) || node->op == (v__token__Kind__left_shift_assign) || node->op == (v__token__Kind__right_shift_assign)) { if (!v__ast__TypeSymbol_is_int(left_sym) && !v__ast__TypeSymbol_is_int(v__ast__Table_final_sym(c->table, left_type_unwrapped))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on left operand type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on left operand type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } else if (!v__ast__TypeSymbol_is_int(right_sym) && !v__ast__TypeSymbol_is_int(v__ast__Table_final_sym(c->table, right_type_unwrapped))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on right operand type `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on right operand type `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } } else if (node->op == (v__token__Kind__unsigned_right_shift_assign)) { @@ -50133,7 +50185,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } int _t6; /* if prepend */ if (!v__ast__Type_is_int(left_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, left_type)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, left_type)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); _t6 = _const_v__ast__void_type_idx; } else if (v__ast__Type_is_int_literal(left_type)) { _t6 = _const_v__ast__u32_type_idx; @@ -50179,7 +50231,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; string right_name = v__ast__Table_type_to_str(c->table, right_type_unwrapped); v__ast__TypeSymbol* parent_sym = v__ast__Table_final_sym(c->table, left_type_unwrapped); if (left_sym->kind == v__ast__Kind__alias && right_sym->kind != v__ast__Kind__alias) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } string _t7 = (string){.str=(byteptr)"", .is_lit=1}; @@ -50201,24 +50253,24 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; else { _t7 = _SLIT("unknown op"); }string extracted_op = _t7; - if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).generic_types.len > 0) { + if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).generic_types.len > 0) { continue; } Option_v__ast__Fn _t8; if (_t8 = v__ast__TypeSymbol_find_method(left_sym, extracted_op), _t8.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t8.data; if (!v__ast__Type_alias_eq(method.return_type, left_type_unwrapped)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), 0xfe10, {.d_s = extracted_op}}, {_SLIT("` must return `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` to be used as an assignment operator"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), /*115 &string*/0xfe10, {.d_s = extracted_op}}, {_SLIT("` must return `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` to be used as an assignment operator"), 0, { .d_c = 0 }}})), node->pos); } } else { IError err = _t8.err; if (v__ast__TypeSymbol_is_primitive(parent_sym)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use operator methods on type alias for `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use operator methods on type alias for `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = extracted_op}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = extracted_op}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -50231,7 +50283,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__checker__Checker_warn(c, _SLIT("pointer arithmetic is only allowed in `unsafe` blocks"), node->pos); } } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to `"), 0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("`: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("`: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } ; } @@ -50246,13 +50298,13 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } } - if ((right_first)._typ == 283 /* v.ast.PrefixExpr */) { + if ((right_first)._typ == 284 /* v.ast.PrefixExpr */) { v__ast__PrefixExpr right_node = (*right_first._v__ast__PrefixExpr); v__ast__Expr left_first = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, 0)); - if ((left_first)._typ == 266 /* v.ast.Ident */) { + if ((left_first)._typ == 267 /* v.ast.Ident */) { v__ast__Ident assigned_var = (*left_first._v__ast__Ident); bool is_shared = false; - if (((*left_first._v__ast__Ident).info)._typ == 376 /* v.ast.IdentVar */) { + if (((*left_first._v__ast__Ident).info)._typ == 377 /* v.ast.IdentVar */) { is_shared = (*(*left_first._v__ast__Ident).info._v__ast__IdentVar).share == v__ast__ShareType__shared_t; } bool old_inside_ref_lit = c->inside_ref_lit; @@ -50260,13 +50312,13 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__checker__Checker_expr(c, right_node.right); c->inside_ref_lit = old_inside_ref_lit; if (right_node.op == v__token__Kind__amp) { - if ((right_node.right)._typ == 266 /* v.ast.Ident */) { - if (((*right_node.right._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((right_node.right)._typ == 267 /* v.ast.Ident */) { + if (((*right_node.right._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { v__ast__Var v = (*(*right_node.right._v__ast__Ident).obj._v__ast__Var); right_type0 = v.typ; } if (!c->inside_unsafe && v__ast__Ident_is_mut(&assigned_var) && !v__ast__Ident_is_mut(&(*right_node.right._v__ast__Ident))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*right_node.right._v__ast__Ident).name}}, {_SLIT("` is immutable, cannot have a mutable reference to it"), 0, { .d_c = 0 }}})), right_node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*right_node.right._v__ast__Ident).name}}, {_SLIT("` is immutable, cannot have a mutable reference to it"), 0, { .d_c = 0 }}})), right_node.pos); } } } @@ -50276,7 +50328,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; if (right_sym->kind == v__ast__Kind__chan) { v__ast__Chan chan_info = v__ast__TypeSymbol_chan_info(right_sym); if (v__ast__Type_is_ptr(chan_info.elem_type) && !chan_info.is_mut) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot have a mutable reference to object from `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot have a mutable reference to object from `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_node.pos); } } } @@ -50379,12 +50431,12 @@ bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v bool _t15 = true; return _t15; } - if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional)) { + if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(expected, v__ast__TypeFlag__result)) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, got); - if (sym->idx == _const_v__ast__error_type_idx || (v__ast__Type_alias_eq(got, _const_v__ast__none_type) || v__ast__Type_alias_eq(got, _const_v__ast__error_type))) { + if (((sym->idx == _const_v__ast__error_type_idx || (v__ast__Type_alias_eq(got, _const_v__ast__none_type) || v__ast__Type_alias_eq(got, _const_v__ast__error_type))) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional)) || ((sym->idx == _const_v__ast__error_type_idx || v__ast__Type_alias_eq(got, _const_v__ast__error_type)) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__result))) { bool _t16 = true; return _t16; - } else if (!v__checker__Checker_check_basic(c, got, v__ast__Type_clear_flag(expected, v__ast__TypeFlag__optional))) { + } else if (!v__checker__Checker_check_basic(c, got, v__ast__Type_clear_flag(v__ast__Type_clear_flag(expected, v__ast__TypeFlag__optional), v__ast__TypeFlag__result))) { bool _t17 = false; return _t17; } @@ -50421,7 +50473,7 @@ Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type expected = expected_; if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__variadic)) { v__ast__TypeSymbol* exp_type_sym = v__ast__Table_sym(c->table, expected_); - v__ast__Array exp_info = /* as */ *(v__ast__Array*)__as_cast((exp_type_sym->info)._v__ast__Array,(exp_type_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array exp_info = /* as */ *(v__ast__Array*)__as_cast((exp_type_sym->info)._v__ast__Array,(exp_type_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; expected = exp_info.elem_type; } if (language == v__ast__Language__c) { @@ -50473,12 +50525,12 @@ Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, string expected_typ_str = v__ast__Table_type_to_str(c->table, v__ast__Type_clear_flag(expected, v__ast__TypeFlag__variadic)); if (string__eq(v__ast__TypeSymbol_symbol_name_except_generic(got_typ_sym), v__ast__TypeSymbol_symbol_name_except_generic(expected_typ_sym))) { if ((v__ast__Type_is_ptr(got) != v__ast__Type_is_ptr(expected)) || !v__checker__Checker_check_same_module(/*rec*/*c, got, expected)) { - return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = got_typ_str}}, {_SLIT("` as `"), 0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = got_typ_str}}, {_SLIT("` as `"), /*115 &string*/0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; } if (!v__ast__Type_alias_eq(got, _const_v__ast__void_type)) { - return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = got_typ_str}}, {_SLIT("` as `"), 0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = got_typ_str}}, {_SLIT("` as `"), /*115 &string*/0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; } @@ -50585,8 +50637,8 @@ bool v__checker__Checker_check_basic(v__checker__Checker* c, v__ast__Type got, v } bool v__checker__Checker_check_matching_function_symbols(v__checker__Checker* c, v__ast__TypeSymbol* got_type_sym, v__ast__TypeSymbol* exp_type_sym) { - v__ast__FnType got_info = /* as */ *(v__ast__FnType*)__as_cast((got_type_sym->info)._v__ast__FnType,(got_type_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; - v__ast__FnType exp_info = /* as */ *(v__ast__FnType*)__as_cast((exp_type_sym->info)._v__ast__FnType,(exp_type_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType got_info = /* as */ *(v__ast__FnType*)__as_cast((got_type_sym->info)._v__ast__FnType,(got_type_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__ast__FnType exp_info = /* as */ *(v__ast__FnType*)__as_cast((exp_type_sym->info)._v__ast__FnType,(exp_type_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; v__ast__Fn got_fn = got_info.func; v__ast__Fn exp_fn = exp_info.func; if (got_fn.params.len != exp_fn.params.len) { @@ -50609,7 +50661,7 @@ bool v__checker__Checker_check_matching_function_symbols(v__checker__Checker* c, if (exp_arg_is_ptr != got_arg_is_ptr) { string exp_arg_pointedness = (exp_arg_is_ptr ? (_SLIT("a pointer")) : (_SLIT("NOT a pointer"))); string got_arg_pointedness = (got_arg_is_ptr ? (_SLIT("a pointer")) : (_SLIT("NOT a pointer"))); - v__checker__Checker_add_error_detail(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = exp_fn.name}}, {_SLIT("`\'s expected fn argument: `"), 0xfe10, {.d_s = exp_arg.name}}, {_SLIT("` is "), 0xfe10, {.d_s = exp_arg_pointedness}}, {_SLIT(", but the passed fn argument: `"), 0xfe10, {.d_s = got_arg.name}}, {_SLIT("` is "), 0xfe10, {.d_s = got_arg_pointedness}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__checker__Checker_add_error_detail(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = exp_fn.name}}, {_SLIT("`\'s expected fn argument: `"), /*115 &string*/0xfe10, {.d_s = exp_arg.name}}, {_SLIT("` is "), /*115 &string*/0xfe10, {.d_s = exp_arg_pointedness}}, {_SLIT(", but the passed fn argument: `"), /*115 &string*/0xfe10, {.d_s = got_arg.name}}, {_SLIT("` is "), /*115 &string*/0xfe10, {.d_s = got_arg_pointedness}}, {_SLIT0, 0, { .d_c = 0 }}}))); bool _t4 = false; return _t4; } else if (exp_arg_is_ptr && got_arg_is_ptr) { @@ -50627,7 +50679,7 @@ bool v__checker__Checker_check_matching_function_symbols(v__checker__Checker* c, VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker* c, v__ast__InfixExpr* node, v__ast__Type left_type, v__ast__Type right_type) { if (!v__ast__Type_is_int(left_type)) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, left_type); - if (left_sym->kind == v__ast__Kind__alias && v__ast__Type_is_int((/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type)) { + if (left_sym->kind == v__ast__Kind__alias && v__ast__Type_is_int((/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type)) { v__ast__Type _t1 = left_type; return _t1; } @@ -50635,14 +50687,14 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker v__ast__Type _t2 = _const_v__ast__int_type; return _t2; } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); v__ast__Type _t3 = _const_v__ast__void_type; return _t3; } if (!v__ast__Type_is_int(right_type) && !c->pref->translated) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, left_type); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot shift non-integer type `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` into type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot shift non-integer type `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` into type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); v__ast__Type _t4 = _const_v__ast__void_type; return _t4; } @@ -50667,10 +50719,10 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker v__ast__TypeSymbol* left_sym_final = v__ast__Table_final_sym(c->table, left_type); v__ast__Type left_type_final = ((left_sym_final->idx)); if (node->op == v__token__Kind__left_shift && v__ast__Type_is_signed(left_type_final) && !(c->inside_unsafe && c->is_generated)) { - v__checker__Checker_note(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("shifting a value from a signed type `"), 0xfe10, {.d_s = left_sym_final->name}}, {_SLIT("` can change the sign"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_note(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("shifting a value from a signed type `"), /*115 &string*/0xfe10, {.d_s = left_sym_final->name}}, {_SLIT("` can change the sign"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); } if (node->ct_right_value_evaled) { - if ((node->ct_right_value)._typ != 262 /* v.ast.EmptyExpr */) { + if ((node->ct_right_value)._typ != 263 /* v.ast.EmptyExpr */) { Option_i64 _t7 = v__ast__ComptTimeConstValue_i64(node->ct_right_value); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; @@ -50685,7 +50737,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker } int moffset = ((left_type_final == (_const_v__ast__char_type)) ? (7) : (left_type_final == (_const_v__ast__i8_type)) ? (7) : (left_type_final == (_const_v__ast__i16_type)) ? (15) : (left_type_final == (_const_v__ast__int_type)) ? (31) : (left_type_final == (_const_v__ast__i64_type)) ? (63) : (left_type_final == (_const_v__ast__byte_type)) ? (7) : (left_type_final == (_const_v__ast__u16_type)) ? (15) : (left_type_final == (_const_v__ast__u32_type)) ? (31) : (left_type_final == (_const_v__ast__u64_type)) ? (63) : (64)); if (ival > moffset && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("shift count for type `"), 0xfe10, {.d_s = left_sym_final->name}}, {_SLIT("` too large (maximum: "), 0xfe07, {.d_i32 = moffset}}, {_SLIT(" bits)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("shift count for type `"), /*115 &string*/0xfe10, {.d_s = left_sym_final->name}}, {_SLIT("` too large (maximum: "), /*100 &int*/0xfe07, {.d_i32 = moffset}}, {_SLIT(" bits)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); v__ast__Type _t9 = left_type; return _t9; } @@ -50707,7 +50759,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker } } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown shift operator: "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown shift operator: "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t13 = left_type; return _t13; }; @@ -50754,10 +50806,10 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_promote_num(v__checker__Checker v__ast__Type type_hi = left_type; v__ast__Type type_lo = right_type; if (v__ast__Type_idx(type_hi) < v__ast__Type_idx(type_lo)) { - v__ast__Type _var_16786 = type_hi; - v__ast__Type _var_16795 = type_lo; - type_hi = _var_16795; - type_lo = _var_16786; + v__ast__Type _var_16973 = type_hi; + v__ast__Type _var_16982 = type_lo; + type_hi = _var_16982; + type_lo = _var_16973; } int idx_hi = v__ast__Type_idx(type_hi); int idx_lo = v__ast__Type_idx(type_lo); @@ -50814,7 +50866,7 @@ Option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__T VV_LOCAL_SYMBOL string v__checker__Checker_expected_msg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected) { string exps = v__ast__Table_type_to_str(c->table, expected); string gots = v__ast__Table_type_to_str(c->table, got); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = exps}}, {_SLIT("`, not `"), 0xfe10, {.d_s = gots}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = exps}}, {_SLIT("`, not `"), /*115 &string*/0xfe10, {.d_s = gots}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } @@ -50849,7 +50901,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ 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); - if (sym->info._typ == 416 /* v.ast.Struct */) { + if (sym->info._typ == 417 /* v.ast.Struct */) { if (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) { int idx = Array_string_index(c->table->cur_fn->generic_names, gt_name); @@ -50873,7 +50925,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } - else if (sym->info._typ == 434 /* v.ast.Interface */) { + else if (sym->info._typ == 435 /* v.ast.Interface */) { if (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) { int idx = Array_string_index(c->table->cur_fn->generic_names, gt_name); @@ -50897,7 +50949,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } - else if (sym->info._typ == 435 /* v.ast.SumType */) { + else if (sym->info._typ == 436 /* v.ast.SumType */) { if (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) { int idx = Array_string_index(c->table->cur_fn->generic_names, gt_name); @@ -50936,7 +50988,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ if (v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__generic) && string__eq(param_type_sym->name, gt_name)) { to_set = v__ast__mktyp(arg.typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, arg.typ); - if ((sym->info)._typ == 443 /* v.ast.FnType */) { + if ((sym->info)._typ == 444 /* v.ast.FnType */) { v__ast__Fn func_ = (*sym->info._v__ast__FnType).func; func_.name = _SLIT(""); int idx = v__ast__Table_find_or_register_fn_type(c->table, c->mod, func_, true, false); @@ -50956,15 +51008,15 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ if (v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__variadic)) { to_set = v__ast__mktyp(arg.typ); } else if (arg_sym->kind == v__ast__Kind__array && param_type_sym->kind == v__ast__Kind__array) { - v__ast__Array arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_sym->info)._v__ast__Array,(arg_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; - v__ast__Array param_elem_info = /* as */ *(v__ast__Array*)__as_cast((param_type_sym->info)._v__ast__Array,(param_type_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_sym->info)._v__ast__Array,(arg_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array param_elem_info = /* as */ *(v__ast__Array*)__as_cast((param_type_sym->info)._v__ast__Array,(param_type_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__TypeSymbol* arg_elem_sym = v__ast__Table_sym(c->table, arg_elem_info.elem_type); v__ast__TypeSymbol* param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); for (;;) { if (arg_elem_sym->kind == v__ast__Kind__array && param_elem_sym->kind == v__ast__Kind__array && !Array_string_contains(c->table->cur_fn->generic_names, param_elem_sym->name)) { - arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_elem_sym->info)._v__ast__Array,(arg_elem_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_elem_sym->info)._v__ast__Array,(arg_elem_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; arg_elem_sym = v__ast__Table_sym(c->table, arg_elem_info.elem_type); - param_elem_info = /* as */ *(v__ast__Array*)__as_cast((param_elem_sym->info)._v__ast__Array,(param_elem_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + param_elem_info = /* as */ *(v__ast__Array*)__as_cast((param_elem_sym->info)._v__ast__Array,(param_elem_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); } else { to_set = arg_elem_info.elem_type; @@ -50972,15 +51024,15 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } else if (arg_sym->kind == v__ast__Kind__array_fixed && param_type_sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_sym->info)._v__ast__ArrayFixed,(arg_sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; - v__ast__ArrayFixed param_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((param_type_sym->info)._v__ast__ArrayFixed,(param_type_sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_sym->info)._v__ast__ArrayFixed,(arg_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed param_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((param_type_sym->info)._v__ast__ArrayFixed,(param_type_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; v__ast__TypeSymbol* arg_elem_sym = v__ast__Table_sym(c->table, arg_elem_info.elem_type); v__ast__TypeSymbol* param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); for (;;) { if (arg_elem_sym->kind == v__ast__Kind__array_fixed && param_elem_sym->kind == v__ast__Kind__array_fixed && !Array_string_contains(c->table->cur_fn->generic_names, param_elem_sym->name)) { - arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_elem_sym->info)._v__ast__ArrayFixed,(arg_elem_sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_elem_sym->info)._v__ast__ArrayFixed,(arg_elem_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; arg_elem_sym = v__ast__Table_sym(c->table, arg_elem_info.elem_type); - param_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((param_elem_sym->info)._v__ast__ArrayFixed,(param_elem_sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + param_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((param_elem_sym->info)._v__ast__ArrayFixed,(param_elem_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); } else { to_set = arg_elem_info.elem_type; @@ -50988,8 +51040,8 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } else if (arg_sym->kind == v__ast__Kind__map && param_type_sym->kind == v__ast__Kind__map) { - v__ast__Map arg_map_info = /* as */ *(v__ast__Map*)__as_cast((arg_sym->info)._v__ast__Map,(arg_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; - v__ast__Map param_map_info = /* as */ *(v__ast__Map*)__as_cast((param_type_sym->info)._v__ast__Map,(param_type_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map arg_map_info = /* as */ *(v__ast__Map*)__as_cast((arg_sym->info)._v__ast__Map,(arg_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map param_map_info = /* as */ *(v__ast__Map*)__as_cast((param_type_sym->info)._v__ast__Map,(param_type_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; if (v__ast__Type_has_flag(param_map_info.key_type, v__ast__TypeFlag__generic) && string__eq(v__ast__Table_sym(c->table, param_map_info.key_type)->name, gt_name)) { typ = arg_map_info.key_type; } @@ -50999,15 +51051,15 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } else if (arg_sym->kind == v__ast__Kind__struct_ || arg_sym->kind == v__ast__Kind__interface_ || arg_sym->kind == v__ast__Kind__sum_type) { Array_v__ast__Type generic_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); Array_v__ast__Type concrete_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - if (arg_sym->info._typ == 416 /* v.ast.Struct */) { + if (arg_sym->info._typ == 417 /* v.ast.Struct */) { generic_types = (*arg_sym->info._v__ast__Struct).generic_types; concrete_types = (*arg_sym->info._v__ast__Struct).concrete_types; } - else if (arg_sym->info._typ == 434 /* v.ast.Interface */) { + else if (arg_sym->info._typ == 435 /* v.ast.Interface */) { generic_types = (*arg_sym->info._v__ast__Interface).generic_types; concrete_types = (*arg_sym->info._v__ast__Interface).concrete_types; } - else if (arg_sym->info._typ == 435 /* v.ast.SumType */) { + else if (arg_sym->info._typ == 436 /* v.ast.SumType */) { generic_types = (*arg_sym->info._v__ast__SumType).generic_types; concrete_types = (*arg_sym->info._v__ast__SumType).concrete_types; } @@ -51041,19 +51093,19 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } if (!v__checker__Checker_check_types(c, typ, to_set)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("inferred generic type `"), 0xfe10, {.d_s = gt_name}}, {_SLIT("` is ambiguous: got `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, to_set)->name}}, {_SLIT("`, expected `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, typ)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg.pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("inferred generic type `"), /*115 &string*/0xfe10, {.d_s = gt_name}}, {_SLIT("` is ambiguous: got `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, to_set)->name}}, {_SLIT("`, expected `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, typ)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg.pos); } } typ = to_set; } } if (v__ast__Type_alias_eq(typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not infer generic type `"), 0xfe10, {.d_s = gt_name}}, {_SLIT("` in call to `"), 0xfe10, {.d_s = func.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not infer generic type `"), /*115 &string*/0xfe10, {.d_s = gt_name}}, {_SLIT("` in call to `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); return; } if (c->pref->is_verbose) { string s = v__ast__Table_type_to_str(c->table, typ); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("inferred `"), 0xfe10, {.d_s = func.name}}, {_SLIT("<"), 0xfe10, {.d_s = s}}, {_SLIT(">`"), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("inferred `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("<"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(">`"), 0, { .d_c = 0 }}}))); } array_push((array*)&inferred_types, _MOV((v__ast__Type[]){ typ })); array_push((array*)&node->concrete_types, _MOV((v__ast__Type[]){ typ })); @@ -51127,19 +51179,19 @@ void v__checker__Checker_check(v__checker__Checker* c, v__ast__File* ast_file_) v__ast__ImportSymbol sym = ((v__ast__ImportSymbol*)ast_import.syms.data)[_t1]; string full_name = string__plus(string__plus(ast_import.mod, _SLIT(".")), sym.name); if (Array_string_contains(c->const_names, full_name)) { - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("cannot selectively import constant `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` from `"), 0xfe10, {.d_s = ast_import.mod}}, {_SLIT("`, import `"), 0xfe10, {.d_s = ast_import.mod}}, {_SLIT("` and use `"), 0xfe10, {.d_s = full_name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("cannot selectively import constant `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` from `"), /*115 &string*/0xfe10, {.d_s = ast_import.mod}}, {_SLIT("`, import `"), /*115 &string*/0xfe10, {.d_s = ast_import.mod}}, {_SLIT("` and use `"), /*115 &string*/0xfe10, {.d_s = full_name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), sym.pos); } } for (int j = 0; j < i; ++j) { if (string__eq(ast_import.mod, (*(v__ast__Import*)/*ee elem_sym */array_get(ast_file->imports, j)).mod)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = ast_import.mod}}, {_SLIT("` was already imported on line "), 0xfe07, {.d_i32 = (*(v__ast__Import*)/*ee elem_sym */array_get(ast_file->imports, j)).mod_pos.line_nr + 1}}, {_SLIT0, 0, { .d_c = 0 }}})), ast_import.mod_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = ast_import.mod}}, {_SLIT("` was already imported on line "), /*100 &int*/0xfe07, {.d_i32 = (*(v__ast__Import*)/*ee elem_sym */array_get(ast_file->imports, j)).mod_pos.line_nr + 1}}, {_SLIT0, 0, { .d_c = 0 }}})), ast_import.mod_pos); } } } c->stmt_level = 0; for (int _t2 = 0; _t2 < ast_file->stmts.len; ++_t2) { v__ast__Stmt* stmt = ((v__ast__Stmt*)ast_file->stmts.data) + _t2; - if ((stmt)->_typ == 302 /* v.ast.ConstDecl */ || (stmt)->_typ == 306 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 303 /* v.ast.ConstDecl */ || (stmt)->_typ == 307 /* v.ast.ExprStmt */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -51150,7 +51202,7 @@ void v__checker__Checker_check(v__checker__Checker* c, v__ast__File* ast_file_) c->stmt_level = 0; for (int _t3 = 0; _t3 < ast_file->stmts.len; ++_t3) { v__ast__Stmt* stmt = ((v__ast__Stmt*)ast_file->stmts.data) + _t3; - if ((stmt)->_typ == 310 /* v.ast.GlobalDecl */) { + if ((stmt)->_typ == 311 /* v.ast.GlobalDecl */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -51161,7 +51213,7 @@ void v__checker__Checker_check(v__checker__Checker* c, v__ast__File* ast_file_) c->stmt_level = 0; for (int _t4 = 0; _t4 < ast_file->stmts.len; ++_t4) { v__ast__Stmt* stmt = ((v__ast__Stmt*)ast_file->stmts.data) + _t4; - if ((stmt)->_typ != 302 /* v.ast.ConstDecl */ && (stmt)->_typ != 310 /* v.ast.GlobalDecl */ && (stmt)->_typ != 306 /* v.ast.ExprStmt */) { + if ((stmt)->_typ != 303 /* v.ast.ConstDecl */ && (stmt)->_typ != 311 /* v.ast.GlobalDecl */ && (stmt)->_typ != 307 /* v.ast.ExprStmt */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -51185,9 +51237,9 @@ void v__checker__Checker_check_scope_vars(v__checker__Checker* c, v__ast__Scope* } if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)DenseArray_value(&_t1.key_values, _t2)); - if (obj._typ == 324 /* v.ast.Var */) { + if (obj._typ == 325 /* v.ast.Var */) { if (!(*obj._v__ast__Var).is_used && string_at((*obj._v__ast__Var).name, 0) != '_') { - v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unused variable: `"), 0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*obj._v__ast__Var).pos); + v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unused variable: `"), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*obj._v__ast__Var).pos); } if ((*obj._v__ast__Var).is_mut && !(*obj._v__ast__Var).is_changed && !c->is_builtin_mod && !string__eq((*obj._v__ast__Var).name, _SLIT("it"))) { } @@ -51227,7 +51279,7 @@ void v__checker__Checker_check_files(v__checker__Checker* c, Array_v__ast__File_ Array_v__ast__File_ptr files_from_main_module = __new_array_with_default(0, 0, sizeof(v__ast__File*), 0); for (int i = 0; i < ast_files.len; ++i) { v__ast__File* file = (*(v__ast__File**)/*ee elem_sym */array_get(ast_files, i)); - v__util__Timers_start(c->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker_check "), 0xfe10, {.d_s = file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_start(c->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker_check "), /*115 &string*/0xfe10, {.d_s = file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__checker__Checker_check(c, file); if (string__eq(file->mod.name, _SLIT("main"))) { array_push((array*)&files_from_main_module, _MOV((v__ast__File*[]){ file })); @@ -51236,7 +51288,7 @@ void v__checker__Checker_check_files(v__checker__Checker* c, Array_v__ast__File_ has_main_fn = true; } } - v__util__Timers_show(c->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker_check "), 0xfe10, {.d_s = file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_show(c->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker_check "), /*115 &string*/0xfe10, {.d_s = file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (has_main_mod_file && !has_main_fn && files_from_main_module.len > 0) { if (c->pref->is_script && !c->pref->is_test) { @@ -51302,7 +51354,7 @@ void v__checker__Checker_check_files(v__checker__Checker* c, Array_v__ast__File_ for (;;) { #if defined(CUSTOM_DEFINE_trace_post_process_generic_fns_loop) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>>>>>>>> recheck_generic_fns loop iteration: "), 0xfe07, {.d_i32 = post_process_generic_fns_iterations}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>>>>>>>> recheck_generic_fns loop iteration: "), /*100 &int*/0xfe07, {.d_i32 = post_process_generic_fns_iterations}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif for (int _t3 = 0; _t3 < ast_files.len; ++_t3) { @@ -51320,7 +51372,7 @@ void v__checker__Checker_check_files(v__checker__Checker* c, Array_v__ast__File_ string ti = it->name; array_push((array*)&_t4, &ti); } - eprintln(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> file.path: "), 0x50fe10, {.d_s = file->path}}, {_SLIT(" | file.generic_fns:"), 0, { .d_c = 0 }}})), Array_string_str(_t4))); + eprintln(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> file.path: "), /*115 &string*/0x50fe10, {.d_s = file->path}}, {_SLIT(" | file.generic_fns:"), 0, { .d_c = 0 }}})), Array_string_str(_t4))); } #endif v__checker__Checker_change_current_file(c, file); @@ -51335,7 +51387,7 @@ void v__checker__Checker_check_files(v__checker__Checker* c, Array_v__ast__File_ } #if defined(CUSTOM_DEFINE_trace_post_process_generic_fns_loop) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>>>>>>>> recheck_generic_fns loop done, iteration: "), 0xfe07, {.d_i32 = post_process_generic_fns_iterations}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>>>>>>>> recheck_generic_fns loop done, iteration: "), /*100 &int*/0xfe07, {.d_i32 = post_process_generic_fns_iterations}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__checker__Checker_change_current_file(c, last_file); @@ -51387,7 +51439,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_file_has_main_fn(v__checker__Checker* c bool has_main_fn = false; for (int _t1 = 0; _t1 < file->stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)file->stmts.data)[_t1]; - if ((stmt)._typ == 183 /* v.ast.FnDecl */) { + if ((stmt)._typ == 184 /* v.ast.FnDecl */) { if (string__eq((*stmt._v__ast__FnDecl).name, _SLIT("main.main"))) { if (has_main_fn) { v__checker__Checker_error(c, _SLIT("function `main` is already defined"), (*stmt._v__ast__FnDecl).pos); @@ -51416,10 +51468,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_valid_snake_case(v__checker__Chec return; } if (!c->pref->is_vweb && name.len > 0 && (string_at(name, 0) == '_' || string_contains(name, _SLIT("._")))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = identifier}}, {_SLIT(" `"), 0xfe10, {.d_s = name}}, {_SLIT("` cannot start with `_`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = identifier}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` cannot start with `_`"), 0, { .d_c = 0 }}})), pos); } if (!c->pref->experimental && v__util__contains_capital(name)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = identifier}}, {_SLIT(" `"), 0xfe10, {.d_s = name}}, {_SLIT("` cannot contain uppercase letters, use snake_case instead"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = identifier}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` cannot contain uppercase letters, use snake_case instead"), 0, { .d_c = 0 }}})), pos); } } @@ -51438,18 +51490,18 @@ VV_LOCAL_SYMBOL string v__checker__stripped_name(string name) { VV_LOCAL_SYMBOL void v__checker__Checker_check_valid_pascal_case(v__checker__Checker* c, string name, string identifier, v__token__Pos pos) { string sname = v__checker__stripped_name(name); if (sname.len > 0 && !u8_is_capital(string_at(sname, 0)) && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = identifier}}, {_SLIT(" `"), 0xfe10, {.d_s = name}}, {_SLIT("` must begin with capital letter"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = identifier}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` must begin with capital letter"), 0, { .d_c = 0 }}})), pos); } } void v__checker__Checker_type_decl(v__checker__Checker* c, v__ast__TypeDecl node) { - if (node._typ == 240 /* v.ast.AliasTypeDecl */) { + if (node._typ == 241 /* v.ast.AliasTypeDecl */) { v__checker__Checker_alias_type_decl(c, (*node._v__ast__AliasTypeDecl)); } - else if (node._typ == 241 /* v.ast.FnTypeDecl */) { + else if (node._typ == 242 /* v.ast.FnTypeDecl */) { v__checker__Checker_fn_type_decl(c, (*node._v__ast__FnTypeDecl)); } - else if (node._typ == 242 /* v.ast.SumTypeDecl */) { + else if (node._typ == 243 /* v.ast.SumTypeDecl */) { v__checker__Checker_sum_type_decl(c, (*node._v__ast__SumTypeDecl)); } ; @@ -51468,10 +51520,10 @@ void v__checker__Checker_alias_type_decl(v__checker__Checker* c, v__ast__AliasTy ; v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, node.parent_type); if (typ_sym->kind == v__ast__Kind__placeholder || typ_sym->kind == v__ast__Kind__int_literal || typ_sym->kind == v__ast__Kind__float_literal) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.type_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.type_pos); } else if (typ_sym->kind == v__ast__Kind__alias) { - v__ast__TypeSymbol* orig_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((typ_sym->info)._v__ast__Alias,(typ_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = v__ast__TypeSymbol_str(typ_sym)}}, {_SLIT("` is an alias, use the original alias type `"), 0xfe10, {.d_s = orig_sym->name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), node.type_pos); + v__ast__TypeSymbol* orig_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((typ_sym->info)._v__ast__Alias,(typ_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_str(typ_sym)}}, {_SLIT("` is an alias, use the original alias type `"), /*115 &string*/0xfe10, {.d_s = orig_sym->name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), node.type_pos); } else if (typ_sym->kind == v__ast__Kind__chan) { v__checker__Checker_error(c, _SLIT("aliases of `chan` types are not allowed."), node.type_pos); } @@ -51480,7 +51532,7 @@ void v__checker__Checker_alias_type_decl(v__checker__Checker* c, v__ast__AliasTy void v__checker__Checker_fn_type_decl(v__checker__Checker* c, v__ast__FnTypeDecl node) { v__checker__Checker_check_valid_pascal_case(c, node.name, _SLIT("fn type"), node.pos); v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, node.typ); - v__ast__FnType fn_typ_info = /* as */ *(v__ast__FnType*)__as_cast((typ_sym->info)._v__ast__FnType,(typ_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType fn_typ_info = /* as */ *(v__ast__FnType*)__as_cast((typ_sym->info)._v__ast__FnType,(typ_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; v__ast__Fn fn_info = fn_typ_info.func; Option_void _t1 = v__checker__Checker_ensure_type_exists(c, fn_info.return_type, fn_info.return_type_pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { @@ -51490,7 +51542,7 @@ void v__checker__Checker_fn_type_decl(v__checker__Checker* c, v__ast__FnTypeDecl ; v__ast__TypeSymbol* ret_sym = v__ast__Table_sym(c->table, fn_info.return_type); if (ret_sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = ret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), fn_info.return_type_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = ret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), fn_info.return_type_pos); } for (int _t2 = 0; _t2 < fn_info.params.len; ++_t2) { v__ast__Param arg = ((v__ast__Param*)fn_info.params.data)[_t2]; @@ -51503,7 +51555,7 @@ void v__checker__Checker_fn_type_decl(v__checker__Checker* c, v__ast__FnTypeDecl ; v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(c->table, arg.typ); if (arg_sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = arg_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg.type_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = arg_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg.type_pos); } } } @@ -51524,9 +51576,9 @@ void v__checker__Checker_sum_type_decl(v__checker__Checker* c, v__ast__SumTypeDe ; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, variant.typ); if (Array_string_contains(names_used, sym->name)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("sum type "), 0xfe10, {.d_s = node.name}}, {_SLIT(" cannot hold the type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` more than once"), 0, { .d_c = 0 }}})), variant.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("sum type "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT(" cannot hold the type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` more than once"), 0, { .d_c = 0 }}})), variant.pos); } else if (sym->kind == v__ast__Kind__placeholder || sym->kind == v__ast__Kind__int_literal || sym->kind == v__ast__Kind__float_literal) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), variant.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), variant.pos); } else if (sym->kind == v__ast__Kind__interface_ && sym->language != v__ast__Language__js) { v__checker__Checker_error(c, _SLIT("sum type cannot hold an interface"), variant.pos); } else if (sym->kind == v__ast__Kind__struct_ && sym->language == v__ast__Language__js) { @@ -51541,7 +51593,7 @@ void v__checker__Checker_sum_type_decl(v__checker__Checker* c, v__ast__SumTypeDe Array_v__ast__InterfaceEmbedding v__checker__Checker_expand_iface_embeds(v__checker__Checker* c, v__ast__InterfaceDecl* idecl, int level, Array_v__ast__InterfaceEmbedding iface_embeds) { if (level > _const_v__checker__iface_level_cutoff_limit) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("too many interface embedding levels: "), 0xfe07, {.d_i32 = level}}, {_SLIT(", for interface `"), 0xfe10, {.d_s = idecl->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), idecl->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("too many interface embedding levels: "), /*100 &int*/0xfe07, {.d_i32 = level}}, {_SLIT(", for interface `"), /*115 &string*/0xfe10, {.d_s = idecl->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), idecl->pos); Array_v__ast__InterfaceEmbedding _t1 = __new_array_with_default(0, 0, sizeof(v__ast__InterfaceEmbedding), 0); return _t1; } @@ -51593,19 +51645,19 @@ Array_v__ast__InterfaceEmbedding v__checker__Checker_expand_iface_embeds(v__chec } VV_LOCAL_SYMBOL void v__checker__Checker_check_div_mod_by_zero(v__checker__Checker* c, v__ast__Expr expr, v__token__Kind op_kind) { - if (expr._typ == 264 /* v.ast.FloatLiteral */) { + if (expr._typ == 265 /* v.ast.FloatLiteral */) { if (string_f64((*expr._v__ast__FloatLiteral).val) == 0.0) { string oper = (op_kind == v__token__Kind__div ? (_SLIT("division")) : (_SLIT("modulo"))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__FloatLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__FloatLiteral).pos); } } - else if (expr._typ == 271 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { if (string_int((*expr._v__ast__IntegerLiteral).val) == 0) { string oper = (op_kind == v__token__Kind__div ? (_SLIT("division")) : (_SLIT("modulo"))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__IntegerLiteral).pos); } } - else if (expr._typ == 253 /* v.ast.CastExpr */) { + else if (expr._typ == 254 /* v.ast.CastExpr */) { v__checker__Checker_check_div_mod_by_zero(c, (*expr._v__ast__CastExpr).expr, op_kind); } @@ -51641,24 +51693,24 @@ v__ast__Type former_expected_type; if (!c->pref->translated && ((v__ast__Type_is_any_kind_of_pointer(right_type) && node->op != v__token__Kind__minus) || (!v__ast__Type_is_any_kind_of_pointer(right_type) && !(node->op == v__token__Kind__plus || node->op == v__token__Kind__minus)))) { string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else if (node->op == v__token__Kind__plus || node->op == v__token__Kind__minus) { if (!c->inside_unsafe && !v__ast__Expr_is_auto_deref_var(node->left) && !v__ast__Expr_is_auto_deref_var(node->right)) { v__checker__Checker_warn(c, _SLIT("pointer arithmetic is only allowed in `unsafe` blocks"), left_right_pos); } - if (v__ast__Type_alias_eq(left_type, _const_v__ast__voidptr_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be used with `voidptr`"), 0, { .d_c = 0 }}})), left_pos); + if (v__ast__Type_alias_eq(left_type, _const_v__ast__voidptr_type) && !c->pref->translated) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be used with `voidptr`"), 0, { .d_c = 0 }}})), left_pos); } } } v__ast__Type return_type = left_type; if (node->op != v__token__Kind__key_is) { - if (node->left._typ == 266 /* v.ast.Ident */) { + if (node->left._typ == 267 /* v.ast.Ident */) { if ((*node->left._v__ast__Ident).is_mut) { v__checker__Checker_error(c, _SLIT("the `mut` keyword is invalid here"), (*node->left._v__ast__Ident).mut_pos); } } - else if (node->left._typ == 286 /* v.ast.SelectorExpr */) { + else if (node->left._typ == 287 /* v.ast.SelectorExpr */) { if ((*node->left._v__ast__SelectorExpr).is_mut) { v__checker__Checker_error(c, _SLIT("the `mut` keyword is invalid here"), (*node->left._v__ast__SelectorExpr).mut_pos); } @@ -51668,12 +51720,12 @@ v__ast__Type former_expected_type; } ; } - if (node->right._typ == 266 /* v.ast.Ident */) { + if (node->right._typ == 267 /* v.ast.Ident */) { if ((*node->right._v__ast__Ident).is_mut) { v__checker__Checker_error(c, _SLIT("the `mut` keyword is invalid here"), (*node->right._v__ast__Ident).mut_pos); } } - else if (node->right._typ == 286 /* v.ast.SelectorExpr */) { + else if (node->right._typ == 287 /* v.ast.SelectorExpr */) { if ((*node->right._v__ast__SelectorExpr).is_mut) { v__checker__Checker_error(c, _SLIT("the `mut` keyword is invalid here"), (*node->right._v__ast__SelectorExpr).mut_pos); } @@ -51689,19 +51741,19 @@ v__ast__Type former_expected_type; { bool is_mismatch = (left_sym->kind == v__ast__Kind__alias && (right_sym->kind == v__ast__Kind__struct_ || right_sym->kind == v__ast__Kind__array || right_sym->kind == v__ast__Kind__sum_type)) || (right_sym->kind == v__ast__Kind__alias && (left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__array || left_sym->kind == v__ast__Kind__sum_type)); if (is_mismatch) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("possible type mismatch of compared values of `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` operation"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("possible type mismatch of compared values of `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` operation"), 0, { .d_c = 0 }}})), left_right_pos); } else if (Array_int_contains(_const_v__ast__integer_type_idxs, left_type) && Array_int_contains(_const_v__ast__integer_type_idxs, right_type)) { bool is_left_type_signed = Array_int_contains(_const_v__ast__signed_integer_type_idxs, left_type); bool is_right_type_signed = Array_int_contains(_const_v__ast__signed_integer_type_idxs, right_type); - if (!is_left_type_signed && (node->right)._typ == 271 /* v.ast.IntegerLiteral */) { + if (!is_left_type_signed && (node->right)._typ == 272 /* v.ast.IntegerLiteral */) { if (string_int((*node->right._v__ast__IntegerLiteral).val) < 0 && Array_int_contains(_const_v__ast__int_promoted_type_idxs, left_type)) { string lt = v__ast__Table_sym(c->table, left_type)->name; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = lt}}, {_SLIT("` cannot be compared with negative value"), 0, { .d_c = 0 }}})), (*node->right._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = lt}}, {_SLIT("` cannot be compared with negative value"), 0, { .d_c = 0 }}})), (*node->right._v__ast__IntegerLiteral).pos); } - } else if (!is_right_type_signed && (node->left)._typ == 271 /* v.ast.IntegerLiteral */) { + } else if (!is_right_type_signed && (node->left)._typ == 272 /* v.ast.IntegerLiteral */) { if (string_int((*node->left._v__ast__IntegerLiteral).val) < 0 && Array_int_contains(_const_v__ast__int_promoted_type_idxs, right_type)) { string rt = v__ast__Table_sym(c->table, right_type)->name; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("negative value cannot be compared with `"), 0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node->left._v__ast__IntegerLiteral).pos); + 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) { int ls = v__ast__Table_type_size(c->table, left_type); @@ -51709,7 +51761,7 @@ v__ast__Type former_expected_type; if ((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; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = lt}}, {_SLIT("` cannot be compared with `"), 0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = lt}}, {_SLIT("` cannot be compared with `"), /*115 &string*/0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -51725,7 +51777,7 @@ v__ast__Type former_expected_type; Option_void _t1 = v__checker__Checker_check_expected(c, left_type, elem_type); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the array element type: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the array element type: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); ; } @@ -51737,7 +51789,7 @@ v__ast__Type former_expected_type; Option_void _t2 = v__checker__Checker_check_expected(c, left_type, map_info.key_type); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the map key type: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the map key type: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); ; } @@ -51750,7 +51802,7 @@ v__ast__Type former_expected_type; Option_void _t3 = v__checker__Checker_check_expected(c, left_type, elem_type); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the fixed array element type: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the fixed array element type: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); ; } @@ -51758,7 +51810,7 @@ v__ast__Type former_expected_type; } } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` can only be used with arrays and maps"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` can only be used with arrays and maps"), 0, { .d_c = 0 }}})), node->pos); }; v__ast__Type _t4 = _const_v__ast__bool_type; // Defer begin @@ -51778,15 +51830,15 @@ v__ast__Type former_expected_type; case v__token__Kind__amp: case v__token__Kind__pipe: { - if ((right_sym->info)._typ == 431 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).language != v__ast__Language__c && string__eq(c->mod, (*(string*)/*ee elem_sym */array_get(string_split(v__ast__Table_type_to_str(c->table, right_type), _SLIT(".")), 0))) && v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type))) { - right_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type); + if ((right_sym->info)._typ == 432 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).language != v__ast__Language__c && string__eq(c->mod, (*(string*)/*ee elem_sym */array_get(string_split(v__ast__Table_type_to_str(c->table, right_type), _SLIT(".")), 0))) && v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type))) { + right_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type); } - if ((left_sym->info)._typ == 431 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).language != v__ast__Language__c && string__eq(c->mod, (*(string*)/*ee elem_sym */array_get(string_split(v__ast__Table_type_to_str(c->table, left_type), _SLIT(".")), 0))) && v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type))) { - left_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type); + if ((left_sym->info)._typ == 432 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).language != v__ast__Language__c && string__eq(c->mod, (*(string*)/*ee elem_sym */array_get(string_split(v__ast__Table_type_to_str(c->table, left_type), _SLIT(".")), 0))) && v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type))) { + left_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type); } if (c->pref->translated && (node->op == v__token__Kind__plus || node->op == v__token__Kind__minus || node->op == v__token__Kind__mul) && v__ast__Type_is_any_kind_of_pointer(left_type) && v__ast__Type_is_any_kind_of_pointer(right_type)) { return_type = left_type; - } else if (!c->pref->translated && left_sym->kind == v__ast__Kind__alias && (left_sym->info)._typ == 431 /* v.ast.Alias */ && !(v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type)))) { + } else if (!c->pref->translated && left_sym->kind == v__ast__Kind__alias && (left_sym->info)._typ == 432 /* v.ast.Alias */ && !(v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type)))) { if (v__ast__TypeSymbol_has_method(left_sym, v__token__Kind_str(node->op))) { Option_v__ast__Fn _t5; if (_t5 = v__ast__TypeSymbol_find_method(left_sym, v__token__Kind_str(node->op)), _t5.state == 0) { @@ -51800,12 +51852,12 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } - } else if (!c->pref->translated && right_sym->kind == v__ast__Kind__alias && (right_sym->info)._typ == 431 /* v.ast.Alias */ && !(v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type)))) { + } else if (!c->pref->translated && right_sym->kind == v__ast__Kind__alias && (right_sym->info)._typ == 432 /* v.ast.Alias */ && !(v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type)))) { if (v__ast__TypeSymbol_has_method(right_sym, v__token__Kind_str(node->op))) { Option_v__ast__Fn _t6; if (_t6 = v__ast__TypeSymbol_find_method(right_sym, v__token__Kind_str(node->op)), _t6.state == 0) { @@ -51819,9 +51871,9 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } } @@ -51839,9 +51891,9 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } } else if (!c->pref->translated && (right_sym->kind == v__ast__Kind__array || right_sym->kind == v__ast__Kind__array_fixed || right_sym->kind == v__ast__Kind__map || right_sym->kind == v__ast__Kind__struct_)) { @@ -51858,9 +51910,9 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } } else if (v__ast__Expr_is_auto_deref_var(node->left) || v__ast__Expr_is_auto_deref_var(node->right)) { @@ -51869,7 +51921,7 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, v__ast__mktyp(deref_left_type)); string right_name = v__ast__Table_type_to_str(c->table, v__ast__mktyp(deref_right_type)); if (!string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } else { v__ast__Type unaliased_left_type = v__ast__Table_unalias_num_type(c->table, left_type); @@ -51882,10 +51934,10 @@ v__ast__Type former_expected_type; if (v__ast__Type_idx(promoted_type) == _const_v__ast__void_type_idx) { string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else if (v__ast__Type_has_flag(promoted_type, v__ast__TypeFlag__optional)) { string s = v__ast__Table_type_to_str(c->table, promoted_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be used with `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be used with `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_is_float(promoted_type)) { if (node->op == v__token__Kind__mod || node->op == v__token__Kind__xor || node->op == v__token__Kind__amp || node->op == v__token__Kind__pipe) { string side = (v__ast__Type_alias_eq(left_type, promoted_type) ? (_SLIT("left")) : (_SLIT("right"))); @@ -51894,7 +51946,7 @@ v__ast__Type former_expected_type; if (node->op == v__token__Kind__mod) { v__checker__Checker_error(c, _SLIT("float modulo not allowed, use math.fmod() instead"), pos); } else { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = side}}, {_SLIT(" type of `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be non-integer type `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = side}}, {_SLIT(" type of `"), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be non-integer type `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } } } @@ -51912,7 +51964,7 @@ v__ast__Type former_expected_type; { if ((left_sym->kind == v__ast__Kind__array || left_sym->kind == v__ast__Kind__array_fixed) && (right_sym->kind == v__ast__Kind__array || right_sym->kind == v__ast__Kind__array_fixed)) { v__checker__Checker_error(c, _SLIT("only `==` and `!=` are defined on arrays"), node->pos); - } else if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).generic_types.len > 0) { + } else if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).generic_types.len > 0) { v__ast__Type _t9 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_infix_expr_defer_0) { @@ -51926,16 +51978,16 @@ v__ast__Type former_expected_type; string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { if (!(node->op == v__token__Kind__lt && c->pref->translated)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } } if (left_sym->kind == v__ast__Kind__struct_ && right_sym->kind == v__ast__Kind__struct_) { if (!v__ast__TypeSymbol_has_method(left_sym, _SLIT("<")) && (node->op == v__token__Kind__ge || node->op == v__token__Kind__le)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` as `<` operator method is not defined"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` as `<` operator method is not defined"), 0, { .d_c = 0 }}})), left_right_pos); } else if (!v__ast__TypeSymbol_has_method(left_sym, _SLIT("<")) && node->op == v__token__Kind__gt) { v__checker__Checker_error(c, _SLIT("cannot use `>` as `<=` operator method is not defined"), left_right_pos); } @@ -51944,7 +51996,7 @@ v__ast__Type former_expected_type; v__ast__TypeSymbol* gen_sym = v__ast__Table_sym(c->table, left_gen_type); bool need_overload = (gen_sym->kind == v__ast__Kind__struct_ || gen_sym->kind == v__ast__Kind__interface_); if (need_overload && !v__ast__TypeSymbol_has_method_with_generic_parent(gen_sym, _SLIT("<")) && (node->op == v__token__Kind__ge || node->op == v__token__Kind__le)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` as `<` operator method is not defined"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` as `<` operator method is not defined"), 0, { .d_c = 0 }}})), left_right_pos); } else if (need_overload && !v__ast__TypeSymbol_has_method_with_generic_parent(gen_sym, _SLIT("<")) && node->op == v__token__Kind__gt) { v__checker__Checker_error(c, _SLIT("cannot use `>` as `<=` operator method is not defined"), left_right_pos); } @@ -51953,13 +52005,13 @@ v__ast__Type former_expected_type; bool is_right_type_signed = Array_int_contains(_const_v__ast__signed_integer_type_idxs, right_type) || right_type == _const_v__ast__int_literal_type_idx; if (is_left_type_signed != is_right_type_signed) { if (is_right_type_signed) { - if ((node->right)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((node->right)._typ == 272 /* v.ast.IntegerLiteral */) { if (string_int((*node->right._v__ast__IntegerLiteral).val) < 0) { v__checker__Checker_error(c, _SLIT("unsigned integer cannot be compared with negative value"), (*node->right._v__ast__IntegerLiteral).pos); } } } else if (is_left_type_signed) { - if ((node->left)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((node->left)._typ == 272 /* v.ast.IntegerLiteral */) { if (string_int((*node->left._v__ast__IntegerLiteral).val) < 0) { v__checker__Checker_error(c, _SLIT("unsigned integer cannot be compared with negative value"), (*node->left._v__ast__IntegerLiteral).pos); } @@ -51978,8 +52030,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_33844 = v__checker__Checker_fail_if_immutable(c, node->left); - node->auto_locked = mr_33844.arg0; + multi_return_string_v__token__Pos mr_33942 = v__checker__Checker_fail_if_immutable(c, node->left); + node->auto_locked = mr_33942.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_) { @@ -52002,12 +52054,12 @@ v__ast__Type former_expected_type; } else if (left_value_sym->kind == v__ast__Kind__sum_type) { if (right_final->kind != v__ast__Kind__array) { if (!v__ast__Table_is_sumtype_or_in_variant(c->table, left_value_type, v__ast__mktyp(right_type))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); } } else { v__ast__Type right_value_type = v__ast__Table_value_type(c->table, right_type); if (!v__ast__Table_is_sumtype_or_in_variant(c->table, left_value_type, v__ast__mktyp(right_value_type))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); } } v__ast__Type _t11 = _const_v__ast__void_type; @@ -52038,7 +52090,7 @@ v__ast__Type former_expected_type; // Defer end return _t13; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); v__ast__Type _t14 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_infix_expr_defer_0) { @@ -52072,7 +52124,7 @@ v__ast__Type former_expected_type; { int _t17; /* if prepend */ if (!v__ast__Type_is_int(left_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, left_type)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, left_type)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); _t17 = _const_v__ast__void_type_idx; } else if (v__ast__Type_is_int_literal(left_type)) { _t17 = _const_v__ast__u32_type_idx; @@ -52120,15 +52172,15 @@ v__ast__Type former_expected_type; { v__ast__Expr right_expr = node->right; v__ast__Type _t20 = 0; - if (right_expr._typ == 292 /* v.ast.TypeNode */) { + if (right_expr._typ == 293 /* v.ast.TypeNode */) { _t20 = (*right_expr._v__ast__TypeNode).typ; } - else if (right_expr._typ == 278 /* v.ast.None */) { + else if (right_expr._typ == 279 /* v.ast.None */) { _t20 = _const_v__ast__none_type_idx; } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), 0xfe10, {.d_s = v__ast__Expr_str(right_expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(right_expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); _t20 = ((v__ast__Type)(0)); } v__ast__Type typ = _t20; @@ -52136,17 +52188,17 @@ v__ast__Type former_expected_type; v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, typ); string op = v__token__Kind_str(node->op); if (typ_sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = op}}, {_SLIT(": type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not exist"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = op}}, {_SLIT(": type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not exist"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); } if (left_sym->kind == v__ast__Kind__aggregate) { - v__ast__Type parent_left_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 429) /*expected idx: 429, name: v.ast.Aggregate */ ).sum_type; + v__ast__Type parent_left_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 430) /*expected idx: 430, name: v.ast.Aggregate */ ).sum_type; left_sym = v__ast__Table_sym(c->table, parent_left_type); } if (!(left_sym->kind == v__ast__Kind__interface_ || left_sym->kind == v__ast__Kind__sum_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = op}}, {_SLIT("` can only be used with interfaces and sum types"), 0, { .d_c = 0 }}})), node->pos); - } else if ((left_sym->info)._typ == 435 /* v.ast.SumType */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = op}}, {_SLIT("` can only be used with interfaces and sum types"), 0, { .d_c = 0 }}})), node->pos); + } else if ((left_sym->info)._typ == 436 /* v.ast.SumType */) { if (!Array_v__ast__Type_contains((*left_sym->info._v__ast__SumType).variants, typ)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("` has no variant `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("` has no variant `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -52165,17 +52217,17 @@ v__ast__Type former_expected_type; v__ast__Chan chan_info = v__ast__TypeSymbol_chan_info(left_sym); v__ast__Type elem_type = chan_info.elem_type; if (!v__checker__Checker_check_types(c, right_type, elem_type)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot push `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` on `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot push `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` on `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); } if (chan_info.is_mut) { v__checker__Checker_fail_if_immutable(c, node->right); } if (v__ast__Type_is_ptr(elem_type) && !v__ast__Type_is_ptr(right_type)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot push non-reference `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` on `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot push non-reference `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` on `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); } v__checker__Checker_stmts_ending_with_expression(c, node->or_block.stmts); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot push on non-channel `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot push on non-channel `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); } v__ast__Type _t22 = _const_v__ast__void_type; // Defer begin @@ -52191,13 +52243,13 @@ v__ast__Type former_expected_type; { if (!c->pref->translated && !c->file->is_translated) { if (node->left_type != _const_v__ast__bool_type_idx) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("left operand for `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` is not a boolean"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("left operand for `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` is not a boolean"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); } if (node->right_type != _const_v__ast__bool_type_idx) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("right operand for `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` is not a boolean"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("right operand for `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` is not a boolean"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); } } - if ((node->left)._typ == 270 /* v.ast.InfixExpr */) { + if ((node->left)._typ == 271 /* v.ast.InfixExpr */) { if ((*node->left._v__ast__InfixExpr).op != node->op && ((*node->left._v__ast__InfixExpr).op == v__token__Kind__logical_or || (*node->left._v__ast__InfixExpr).op == v__token__Kind__and)) { v__checker__Checker_error(c, _SLIT("ambiguous boolean expression. use `()` to ensure correct order of operations"), node->pos); } @@ -52306,8 +52358,8 @@ v__ast__Type former_expected_type; } else if (v__ast__Type_alias_eq(left_type, _const_v__ast__string_type) && !(node->op == v__token__Kind__plus || node->op == v__token__Kind__eq || node->op == v__token__Kind__ne || node->op == v__token__Kind__lt || node->op == v__token__Kind__gt || node->op == v__token__Kind__le || node->op == v__token__Kind__ge)) { v__checker__Checker_error(c, _SLIT("string types only have the following operators defined: `==`, `!=`, `<`, `>`, `<=`, `>=`, and `+`"), node->pos); } else if (left_sym->kind == v__ast__Kind__enum_ && right_sym->kind == v__ast__Kind__enum_ && !eq_ne) { - v__ast__Enum left_enum = /* as */ *(v__ast__Enum*)__as_cast((left_sym->info)._v__ast__Enum,(left_sym->info)._typ, 445) /*expected idx: 445, name: v.ast.Enum */ ; - v__ast__Enum right_enum = /* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 445) /*expected idx: 445, name: v.ast.Enum */ ; + v__ast__Enum left_enum = /* as */ *(v__ast__Enum*)__as_cast((left_sym->info)._v__ast__Enum,(left_sym->info)._typ, 446) /*expected idx: 446, name: v.ast.Enum */ ; + v__ast__Enum right_enum = /* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 446) /*expected idx: 446, name: v.ast.Enum */ ; if (left_enum.is_flag && right_enum.is_flag) { if (!(node->op == v__token__Kind__pipe || node->op == v__token__Kind__amp)) { v__checker__Checker_error(c, _SLIT("only `==`, `!=`, `|` and `&` are defined on `[flag]` tagged `enum`, use an explicit cast to `int` if needed"), node->pos); @@ -52317,9 +52369,9 @@ v__ast__Type former_expected_type; } } if (v__ast__Table_type_kind(c->table, left_type) == v__ast__Kind__sum_type && !eq_ne) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` with `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` with `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Table_type_kind(c->table, right_type) == v__ast__Kind__sum_type && !eq_ne) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` with `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` with `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } bool left_is_optional = v__ast__Type_has_flag(left_type, v__ast__TypeFlag__optional); bool right_is_optional = v__ast__Type_has_flag(right_type, v__ast__TypeFlag__optional); @@ -52345,7 +52397,7 @@ v__ast__Type former_expected_type; // Defer end return _t24; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("infix expr: cannot use `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` (right expression) as `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("infix expr: cannot use `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` (right expression) as `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } v__ast__Type _t25 = (v__token__Kind_is_relational(node->op) ? (_const_v__ast__bool_type) : (return_type)); // Defer begin @@ -52361,50 +52413,50 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im v__token__Pos pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); bool explicit_lock_needed = false; v__ast__Expr expr = expr_; - if (expr._typ == 253 /* v.ast.CastExpr */) { + if (expr._typ == 254 /* v.ast.CastExpr */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 258 /* v.ast.ComptimeSelector */) { + else if (expr._typ == 259 /* v.ast.ComptimeSelector */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 266 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + else if (expr._typ == 267 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { if (!(*(*expr._v__ast__Ident).obj._v__ast__Var).is_mut && !c->pref->translated && !c->file->is_translated && !c->inside_unsafe) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("` is immutable, declare it with `mut` to make it mutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("` is immutable, declare it with `mut` to make it mutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } (*(*expr._v__ast__Ident).obj._v__ast__Var).is_changed = true; if (v__ast__Type_share((*(*expr._v__ast__Ident).obj._v__ast__Var).typ) == v__ast__ShareType__shared_t) { if (!Array_string_contains(c->locked_names, (*expr._v__ast__Ident).name)) { if (c->locked_names.len > 0 || c->rlocked_names.len > 0) { if (Array_string_contains(c->rlocked_names, (*expr._v__ast__Ident).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT(" has an `rlock` but needs a `lock`"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT(" has an `rlock` but needs a `lock`"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT(" must be added to the `lock` list above"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT(" must be added to the `lock` list above"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } } to_lock = (*expr._v__ast__Ident).name; pos = (*expr._v__ast__Ident).pos; } } - } else if (((*expr._v__ast__Ident).obj)._typ == 322 /* v.ast.ConstField */ && Array_string_contains(c->const_names, (*expr._v__ast__Ident).name)) { + } else if (((*expr._v__ast__Ident).obj)._typ == 323 /* v.ast.ConstField */ && Array_string_contains(c->const_names, (*expr._v__ast__Ident).name)) { if (!c->inside_unsafe) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot modify constant `"), 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot modify constant `"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } } } - else if (expr._typ == 269 /* v.ast.IndexExpr */) { + else if (expr._typ == 270 /* v.ast.IndexExpr */) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, (*expr._v__ast__IndexExpr).left_type); v__ast__Type elem_type = ((v__ast__Type)(0)); string kind = _SLIT(""); - if (left_sym->info._typ == 411 /* v.ast.Array */) { + if (left_sym->info._typ == 412 /* v.ast.Array */) { elem_type = (*left_sym->info._v__ast__Array).elem_type; kind = _SLIT("array"); } - else if (left_sym->info._typ == 439 /* v.ast.ArrayFixed */) { + else if (left_sym->info._typ == 440 /* v.ast.ArrayFixed */) { elem_type = (*left_sym->info._v__ast__ArrayFixed).elem_type; kind = _SLIT("fixed array"); } - else if (left_sym->info._typ == 412 /* v.ast.Map */) { + else if (left_sym->info._typ == 413 /* v.ast.Map */) { elem_type = (*left_sym->info._v__ast__Map).value_type; kind = _SLIT("map"); } @@ -52413,23 +52465,23 @@ 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` "), 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)); + 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_44242 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__IndexExpr).left); - to_lock = mr_44242.arg0; - pos = mr_44242.arg1; + multi_return_string_v__token__Pos mr_44340 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__IndexExpr).left); + to_lock = mr_44340.arg0; + pos = mr_44340.arg1; } - else if (expr._typ == 281 /* v.ast.ParExpr */) { - multi_return_string_v__token__Pos mr_44311 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); - to_lock = mr_44311.arg0; - pos = mr_44311.arg1; + else if (expr._typ == 282 /* v.ast.ParExpr */) { + multi_return_string_v__token__Pos mr_44409 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); + to_lock = mr_44409.arg0; + pos = mr_44409.arg1; } - else if (expr._typ == 283 /* v.ast.PrefixExpr */) { - multi_return_string_v__token__Pos mr_44383 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); - to_lock = mr_44383.arg0; - pos = mr_44383.arg1; + else if (expr._typ == 284 /* v.ast.PrefixExpr */) { + multi_return_string_v__token__Pos mr_44481 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); + to_lock = mr_44481.arg0; + pos = mr_44481.arg1; } - else if (expr._typ == 286 /* v.ast.SelectorExpr */) { + else if (expr._typ == 287 /* v.ast.SelectorExpr */) { if ((*expr._v__ast__SelectorExpr).expr_type == 0) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } @@ -52455,17 +52507,17 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im v__ast__StructField field_info = (*(v__ast__StructField*)_t6.data); if (!has_field) { 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("unknown field `"), 0xfe10, {.d_s = type_str}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } if (v__ast__Type_has_flag(field_info.typ, v__ast__TypeFlag__shared_f)) { - string expr_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr)}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string expr_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!Array_string_contains(c->locked_names, expr_name)) { if (c->locked_names.len > 0 || c->rlocked_names.len > 0) { if (Array_string_contains(c->rlocked_names, expr_name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = expr_name}}, {_SLIT(" has an `rlock` but needs a `lock`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = expr_name}}, {_SLIT(" has an `rlock` but needs a `lock`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = expr_name}}, {_SLIT(" must be added to the `lock` list above"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = expr_name}}, {_SLIT(" must be added to the `lock` list above"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); } return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; } @@ -52475,11 +52527,11 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } else { if (!field_info.is_mut && !c->pref->translated && !c->file->is_translated) { 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 `"), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("` of struct `"), 0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + 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_45847 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); - to_lock = mr_45847.arg0; - pos = mr_45847.arg1; + multi_return_string_v__token__Pos mr_45945 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); + to_lock = mr_45945.arg0; + pos = mr_45945.arg1; } if ((to_lock).len != 0) { explicit_lock_needed = true; @@ -52488,19 +52540,19 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } case v__ast__Kind__interface_: { - v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; Option_v__ast__StructField _t9 = v__ast__Interface_find_field(&interface_info, (*expr._v__ast__SelectorExpr).field_name); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; 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("unknown field `"), 0xfe10, {.d_s = type_str}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } v__ast__StructField field_info = (*(v__ast__StructField*)_t9.data); if (!field_info.is_mut) { 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 `"), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + 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 interface `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; } v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); @@ -52508,19 +52560,19 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } case v__ast__Kind__sum_type: { - v__ast__SumType sumtype_info = /* as */ *(v__ast__SumType*)__as_cast((typ_sym->info)._v__ast__SumType,(typ_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ; + v__ast__SumType sumtype_info = /* as */ *(v__ast__SumType*)__as_cast((typ_sym->info)._v__ast__SumType,(typ_sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ; Option_v__ast__StructField _t12 = v__ast__SumType_find_field(&sumtype_info, (*expr._v__ast__SelectorExpr).field_name); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; 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("unknown field `"), 0xfe10, {.d_s = type_str}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } v__ast__StructField field_info = (*(v__ast__StructField*)_t12.data); if (!field_info.is_mut) { 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 `"), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("` of sumtype `"), 0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + 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 sumtype `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; } v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); @@ -52531,7 +52583,7 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im { bool inside_builtin = string__eq(c->file->mod.name, _SLIT("builtin")); if (!inside_builtin && !c->inside_unsafe) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__ast__Kind_str(typ_sym->kind)}}, {_SLIT("` can not be modified"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(typ_sym->kind)}}, {_SLIT("` can not be modified"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; } break; @@ -52576,43 +52628,43 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im case v__ast__Kind__thread: default: { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected symbol `"), 0xfe10, {.d_s = v__ast__Kind_str(typ_sym->kind)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected symbol `"), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(typ_sym->kind)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; break; } } ; } - else if (expr._typ == 252 /* v.ast.CallExpr */) { + else if (expr._typ == 253 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("slice"))) { - multi_return_string_v__token__Pos mr_47670 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); - to_lock = mr_47670.arg0; - pos = mr_47670.arg1; + multi_return_string_v__token__Pos mr_47768 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); + to_lock = mr_47768.arg0; + pos = mr_47768.arg1; if ((to_lock).len != 0) { explicit_lock_needed = true; } } } - else if (expr._typ == 246 /* v.ast.ArrayInit */) { + else if (expr._typ == 247 /* v.ast.ArrayInit */) { v__checker__Checker_error(c, _SLIT("array literal can not be modified"), (*expr._v__ast__ArrayInit).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 291 /* v.ast.StructInit */) { + else if (expr._typ == 292 /* v.ast.StructInit */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 270 /* v.ast.InfixExpr */) { + else if (expr._typ == 271 /* v.ast.InfixExpr */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } else { if (!v__ast__Expr_is_lit(expr)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected expression `"), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected expression `"), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } } ; if (explicit_lock_needed) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = to_lock}}, {_SLIT("` is `shared` and needs explicit lock for `"), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = to_lock}}, {_SLIT("` is `shared` and needs explicit lock for `"), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); to_lock = _SLIT(""); } return (multi_return_string_v__token__Pos){.arg0=to_lock, .arg1=pos}; @@ -52625,7 +52677,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, } #if defined(CUSTOM_DEFINE_debug_interface_type_implements) { - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> type_implements typ: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(typ))}}, {_SLIT(" (`"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, typ)}}, {_SLIT("`) | inter_typ: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(interface_type))}}, {_SLIT(" (`"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, interface_type)}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> type_implements typ: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(typ))}}, {_SLIT(" (`"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, typ)}}, {_SLIT("`) | inter_typ: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(interface_type))}}, {_SLIT(" (`"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, interface_type)}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))); } #endif v__ast__Type utyp = v__checker__Checker_unwrap_generic(c, typ); @@ -52635,12 +52687,12 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, bool _t2 = true; return _t2; } - if ((inter_sym->info)._typ == 434 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 435 /* v.ast.Interface */) { v__ast__Type generic_type = interface_type; v__ast__Interface generic_info = (*inter_sym->info._v__ast__Interface); if (v__ast__Type_has_flag((*inter_sym->info._v__ast__Interface).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(c->table, (*inter_sym->info._v__ast__Interface).parent_type); - if ((parent_sym->info)._typ == 434 /* v.ast.Interface */) { + if ((parent_sym->info)._typ == 435 /* v.ast.Interface */) { generic_type = (*inter_sym->info._v__ast__Interface).parent_type; generic_info = (*parent_sym->info._v__ast__Interface); } @@ -52662,7 +52714,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, return _t5; } } - if ((inter_sym->info)._typ == 434 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 435 /* v.ast.Interface */) { for (int _t6 = 0; _t6 < (*inter_sym->info._v__ast__Interface).types.len; ++_t6) { v__ast__Type t = ((v__ast__Type*)(*inter_sym->info._v__ast__Interface).types.data)[_t6]; if (v__ast__Type_idx(t) == v__ast__Type_idx(utyp)) { @@ -52681,9 +52733,9 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, return _t9; } if (typ_sym->kind == v__ast__Kind__interface_ && inter_sym->kind == v__ast__Kind__interface_ && !string_starts_with(styp, _SLIT("JS.")) && !string_starts_with(inter_sym->name, _SLIT("JS."))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot implement interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("` with a different interface `"), 0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot implement interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("` with a different interface `"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } - Array_v__ast__Fn imethods = (inter_sym->kind == v__ast__Kind__interface_ ? ((/* as */ *(v__ast__Interface*)__as_cast((inter_sym->info)._v__ast__Interface,(inter_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ).methods) : (inter_sym->methods)); + Array_v__ast__Fn imethods = (inter_sym->kind == v__ast__Kind__interface_ ? ((/* as */ *(v__ast__Interface*)__as_cast((inter_sym->info)._v__ast__Interface,(inter_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ).methods) : (inter_sym->methods)); if (!v__ast__Type_alias_eq(utyp, _const_v__ast__voidptr_type)) { for (int _t10 = 0; _t10 < imethods.len; ++_t10) { v__ast__Fn imethod = ((v__ast__Fn*)imethods.data)[_t10]; @@ -52691,13 +52743,13 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, if (_t11.state != 0) { /*or block*/ IError err = _t11.err; if (inter_sym->idx == _const_v__ast__error_type_idx && (string__eq(imethod.name, _SLIT("msg")) || string__eq(imethod.name, _SLIT("code")))) { - v__checker__Checker_note(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`. The usage of fields is being deprecated in favor of methods."), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_note(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`. The usage of fields is being deprecated in favor of methods."), 0, { .d_c = 0 }}})), pos); continue; } Option_v__ast__Fn _t12 = v__ast__TypeSymbol_find_method_with_generic_parent(typ_sym, imethod.name); if (_t12.state != 0) { /*or block*/ err = _t12.err; - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); continue; } @@ -52709,15 +52761,15 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, if (msg.len > 0) { string sig = v__ast__Table_fn_signature(c->table, (voidptr)&/*qq*/imethod, ((v__ast__FnSignatureOpts){.skip_receiver = false,.type_only = 0,})); string typ_sig = v__ast__Table_fn_signature(c->table, (voidptr)&/*qq*/method, ((v__ast__FnSignatureOpts){.skip_receiver = false,.type_only = 0,})); - v__checker__Checker_add_error_detail(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = inter_sym->name}}, {_SLIT(" has `"), 0xfe10, {.d_s = sig}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); - v__checker__Checker_add_error_detail(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT(" has `"), 0xfe10, {.d_s = typ_sig}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`: "), 0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + v__checker__Checker_add_error_detail(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT(" has `"), /*115 &string*/0xfe10, {.d_s = sig}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__checker__Checker_add_error_detail(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT(" has `"), /*115 &string*/0xfe10, {.d_s = typ_sig}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`: "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); bool _t13 = false; return _t13; } } } - if ((inter_sym->info)._typ == 434 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 435 /* v.ast.Interface */) { for (int _t14 = 0; _t14 < (*inter_sym->info._v__ast__Interface).fields.len; ++_t14) { v__ast__StructField ifield = ((v__ast__StructField*)(*inter_sym->info._v__ast__Interface).fields.data)[_t14]; Option_v__ast__StructField _t15; @@ -52726,11 +52778,11 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { string exp = v__ast__Table_type_to_str(c->table, ifield.typ); string got = v__ast__Table_type_to_str(c->table, field.typ); - v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements field `"), 0xfe10, {.d_s = ifield.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`, expected `"), 0xfe10, {.d_s = exp}}, {_SLIT("`, got `"), 0xfe10, {.d_s = got}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements field `"), /*115 &string*/0xfe10, {.d_s = ifield.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`, expected `"), /*115 &string*/0xfe10, {.d_s = exp}}, {_SLIT("`, got `"), /*115 &string*/0xfe10, {.d_s = got}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); bool _t16 = false; return _t16; } else if (ifield.is_mut && !(field.is_mut || field.is_global)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`, field `"), 0xfe10, {.d_s = ifield.name}}, {_SLIT("` must be mutable"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`, field `"), /*115 &string*/0xfe10, {.d_s = ifield.name}}, {_SLIT("` must be mutable"), 0, { .d_c = 0 }}})), pos); bool _t17 = false; return _t17; } @@ -52739,7 +52791,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, if (!v__ast__Type_alias_eq(utyp, _const_v__ast__voidptr_type)) { if (inter_sym->idx == _const_v__ast__error_type_idx && (string__eq(ifield.name, _SLIT("msg")) || string__eq(ifield.name, _SLIT("code")))) { } else { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement field `"), 0xfe10, {.d_s = ifield.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement field `"), /*115 &string*/0xfe10, {.d_s = ifield.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } } } @@ -52750,27 +52802,29 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, } v__ast__Type v__checker__Checker_check_expr_opt_call(v__checker__Checker* c, v__ast__Expr expr, v__ast__Type ret_type) { - if ((expr)._typ == 252 /* v.ast.CallExpr */) { - if (v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional)) { + if ((expr)._typ == 253 /* v.ast.CallExpr */) { + if (v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) || v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__result)) { + string return_modifier_kind = (v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) ? (_SLIT("an option")) : (_SLIT("a result"))); + string return_modifier = (v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) ? (_SLIT("?")) : (_SLIT("!"))); if ((*expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__absent) { if (c->inside_defer) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("() returns an option, so it should have an `or {}` block at the end"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("() returns "), /*115 &string*/0xfe10, {.d_s = return_modifier_kind}}, {_SLIT(", so it should have an `or {}` block at the end"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("() returns an option, so it should have either an `or {}` block, or `?` at the end"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("() returns "), /*115 &string*/0xfe10, {.d_s = return_modifier_kind}}, {_SLIT(", so it should have either an `or {}` block, or `"), /*115 &string*/0xfe10, {.d_s = return_modifier}}, {_SLIT("` at the end"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).pos); } } else { - v__checker__Checker_check_or_expr(c, (*expr._v__ast__CallExpr).or_block, ret_type, v__ast__Type_clear_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional)); + v__checker__Checker_check_or_expr(c, (*expr._v__ast__CallExpr).or_block, ret_type, (*expr._v__ast__CallExpr).return_type); } v__ast__Type _t1 = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional); return _t1; } else if ((*expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__block) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `or` block, the function `"), 0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).or_block.pos); - } else if ((*expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `?`, the function `"), 0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).or_block.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `or` block, the function `"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("` does neither return an optional nor a result"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).or_block.pos); + } else if ((*expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `?`, the function `"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).or_block.pos); } - } else if ((expr)._typ == 269 /* v.ast.IndexExpr */) { + } else if ((expr)._typ == 270 /* v.ast.IndexExpr */) { if ((*expr._v__ast__IndexExpr).or_expr.kind != v__ast__OrKind__absent) { - v__checker__Checker_check_or_expr(c, (*expr._v__ast__IndexExpr).or_expr, ret_type, ret_type); + v__checker__Checker_check_or_expr(c, (*expr._v__ast__IndexExpr).or_expr, ret_type, v__ast__Type_set_flag(ret_type, v__ast__TypeFlag__optional)); } } v__ast__Type _t2 = ret_type; @@ -52778,9 +52832,21 @@ v__ast__Type v__checker__Checker_check_expr_opt_call(v__checker__Checker* c, v__ } void v__checker__Checker_check_or_expr(v__checker__Checker* c, v__ast__OrExpr node, v__ast__Type ret_type, v__ast__Type expr_return_type) { - if (node.kind == v__ast__OrKind__propagate) { + if (node.kind == v__ast__OrKind__propagate_option) { if (!v__ast__Type_has_flag(c->table->cur_fn->return_type, v__ast__TypeFlag__optional) && !string__eq(c->table->cur_fn->name, _SLIT("main.main")) && !c->inside_const) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the optional call, `"), 0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an optional"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the call, `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an optional type"), 0, { .d_c = 0 }}})), node.pos); + } + if (!v__ast__Type_has_flag(expr_return_type, v__ast__TypeFlag__optional)) { + v__checker__Checker_error(c, _SLIT("to propagate an option, the call must also return an optional type"), node.pos); + } + return; + } + if (node.kind == v__ast__OrKind__propagate_result) { + if (!v__ast__Type_has_flag(c->table->cur_fn->return_type, v__ast__TypeFlag__result) && !string__eq(c->table->cur_fn->name, _SLIT("main.main")) && !c->inside_const) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the call, `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an result type"), 0, { .d_c = 0 }}})), node.pos); + } + if (!v__ast__Type_has_flag(expr_return_type, v__ast__TypeFlag__result)) { + v__checker__Checker_error(c, _SLIT("to propagate a result, the call must also return a result type"), node.pos); } return; } @@ -52792,12 +52858,12 @@ void v__checker__Checker_check_or_expr(v__checker__Checker* c, v__ast__OrExpr no return; } v__ast__Stmt last_stmt = (*(v__ast__Stmt*)/*ee elem_sym */array_get(node.stmts, stmts_len - 1)); - v__checker__Checker_check_or_last_stmt(c, last_stmt, ret_type, expr_return_type); + v__checker__Checker_check_or_last_stmt(c, last_stmt, ret_type, v__ast__Type_clear_flag(v__ast__Type_clear_flag(expr_return_type, v__ast__TypeFlag__optional), v__ast__TypeFlag__result)); } VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* c, v__ast__Stmt stmt, v__ast__Type ret_type, v__ast__Type expr_return_type) { if (!v__ast__Type_alias_eq(ret_type, _const_v__ast__void_type)) { - if (stmt._typ == 306 /* v.ast.ExprStmt */) { + if (stmt._typ == 307 /* v.ast.ExprStmt */) { c->expected_type = ret_type; c->expected_or_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional); v__ast__Type last_stmt_typ = v__checker__Checker_expr(c, (*stmt._v__ast__ExprStmt).expr); @@ -52809,47 +52875,47 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* } string expected_type_name = v__ast__Table_type_to_str(c->table, v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional)); if (v__ast__Type_alias_eq((*stmt._v__ast__ExprStmt).typ, _const_v__ast__void_type)) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 267 /* v.ast.IfExpr */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 268 /* v.ast.IfExpr */) { for (int _t1 = 0; _t1 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.len; ++_t1) { v__ast__IfBranch branch = ((v__ast__IfBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.data)[_t1]; v__checker__Checker_check_or_last_stmt(c, (*(v__ast__Stmt*)array_last(branch.stmts)), ret_type, expr_return_type); } return; - } else if (((*stmt._v__ast__ExprStmt).expr)._typ == 276 /* v.ast.MatchExpr */) { + } else if (((*stmt._v__ast__ExprStmt).expr)._typ == 277 /* v.ast.MatchExpr */) { for (int _t2 = 0; _t2 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.len; ++_t2) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.data)[_t2]; v__checker__Checker_check_or_last_stmt(c, (*(v__ast__Stmt*)array_last(branch.stmts)), ret_type, expr_return_type); } return; } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`or` block must provide a default value of type `"), 0xfe10, {.d_s = expected_type_name}}, {_SLIT("`, or return/continue/break or call a [noreturn] function like panic(err) or exit(1)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`or` block must provide a default value of type `"), /*115 &string*/0xfe10, {.d_s = expected_type_name}}, {_SLIT("`, or return/continue/break or call a [noreturn] function like panic(err) or exit(1)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); } else { string type_name = v__ast__Table_type_to_str(c->table, last_stmt_typ); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong return type `"), 0xfe10, {.d_s = type_name}}, {_SLIT("` in the `or {}` block, expected `"), 0xfe10, {.d_s = expected_type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong return type `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("` in the `or {}` block, expected `"), /*115 &string*/0xfe10, {.d_s = expected_type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); } } - else if (stmt._typ == 300 /* v.ast.BranchStmt */) { + else if (stmt._typ == 301 /* v.ast.BranchStmt */) { if (!((*stmt._v__ast__BranchStmt).kind == v__token__Kind__key_continue || (*stmt._v__ast__BranchStmt).kind == v__token__Kind__key_break)) { v__checker__Checker_error(c, _SLIT("only break/continue is allowed as a branch statement in the end of an `or {}` block"), (*stmt._v__ast__BranchStmt).pos); return; } } - else if (stmt._typ == 317 /* v.ast.Return */) { + else if (stmt._typ == 318 /* v.ast.Return */) { } else { string expected_type_name = v__ast__Table_type_to_str(c->table, v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional)); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("last statement in the `or {}` block should be an expression of type `"), 0xfe10, {.d_s = expected_type_name}}, {_SLIT("` or exit parent scope"), 0, { .d_c = 0 }}})), (*(stmt.pos))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("last statement in the `or {}` block should be an expression of type `"), /*115 &string*/0xfe10, {.d_s = expected_type_name}}, {_SLIT("` or exit parent scope"), 0, { .d_c = 0 }}})), (*(stmt.pos))); } ; - } else if ((stmt)._typ == 306 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).expr._typ == 267 /* v.ast.IfExpr */) { + } else if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 268 /* v.ast.IfExpr */) { for (int _t3 = 0; _t3 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.len; ++_t3) { v__ast__IfBranch branch = ((v__ast__IfBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.data)[_t3]; v__checker__Checker_check_or_last_stmt(c, (*(v__ast__Stmt*)array_last(branch.stmts)), ret_type, expr_return_type); } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 276 /* v.ast.MatchExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 277 /* v.ast.MatchExpr */) { for (int _t4 = 0; _t4 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.len; ++_t4) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.data)[_t4]; v__checker__Checker_check_or_last_stmt(c, (*(v__ast__Stmt*)array_last(branch.stmts)), ret_type, expr_return_type); @@ -52868,7 +52934,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* } string type_name = v__ast__Table_type_to_str(c->table, (*stmt._v__ast__ExprStmt).typ); string expr_return_type_name = v__ast__Table_type_to_str(c->table, expr_return_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("the default expression type in the `or` block should be `"), 0xfe10, {.d_s = expr_return_type_name}}, {_SLIT("`, instead you gave a value of type `"), 0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("the default expression type in the `or` block should be `"), /*115 &string*/0xfe10, {.d_s = expr_return_type_name}}, {_SLIT("`, instead you gave a value of type `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); } ; } @@ -52878,18 +52944,18 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S bool prevent_sum_type_unwrapping_once = c->prevent_sum_type_unwrapping_once; c->prevent_sum_type_unwrapping_once = false; bool using_new_err_struct_save = c->using_new_err_struct; - if (string__eq( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(node->expr)}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("err"))) { + if (string__eq( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node->expr)}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("err"))) { c->using_new_err_struct = true; } int name_type = 0; - if (node->expr._typ == 266 /* v.ast.Ident */) { + if (node->expr._typ == 267 /* v.ast.Ident */) { string name = (*node->expr._v__ast__Ident).name; bool valid_generic = v__util__is_generic_type_name(name) && Array_string_contains(c->table->cur_fn->generic_names, name); if (valid_generic) { name_type = v__ast__Type_set_flag(((v__ast__Table_find_type_idx(c->table, name))), v__ast__TypeFlag__generic); } } - else if (node->expr._typ == 293 /* v.ast.TypeOf */) { + else if (node->expr._typ == 294 /* v.ast.TypeOf */) { name_type = v__checker__Checker_expr(c, (*node->expr._v__ast__TypeOf).expr); } @@ -52915,7 +52981,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S v__ast__Type _t4 = _const_v__ast__int_type; return _t4; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid field `."), 0xfe10, {.d_s = node->field_name}}, {_SLIT("` for type `"), 0xfe10, {.d_s = v__ast__Expr_str(node->expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid field `."), /*115 &string*/0xfe10, {.d_s = node->field_name}}, {_SLIT("` for type `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node->expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t5 = _const_v__ast__string_type; return _t5; }; @@ -52924,8 +52990,8 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S c->inside_selector_expr = true; v__ast__Type typ = v__checker__Checker_expr(c, node->expr); if (v__ast__Expr_is_auto_deref_var(node->expr)) { - if ((node->expr)._typ == 266 /* v.ast.Ident */) { - if (((*node->expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((node->expr)._typ == 267 /* v.ast.Ident */) { + if (((*node->expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { typ = (*(*node->expr._v__ast__Ident).obj._v__ast__Var).typ; } } @@ -52937,7 +53003,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S return _t6; } node->expr_type = typ; - if (v__ast__Type_has_flag(node->expr_type, v__ast__TypeFlag__optional) && !((node->expr)._typ == 266 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->expr)._v__ast__Ident,(node->expr)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ).kind == v__ast__IdentKind__constant)) { + if (v__ast__Type_has_flag(node->expr_type, v__ast__TypeFlag__optional) && !((node->expr)._typ == 267 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->expr)._v__ast__Ident,(node->expr)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ).kind == v__ast__IdentKind__constant)) { v__checker__Checker_error(c, _SLIT("cannot access fields of an optional, handle the error with `or {...}` or propagate it with `?`"), node->pos); } string field_name = node->field_name; @@ -52958,10 +53024,10 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S return _t9; } } - string unknown_field_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` has no field named `"), 0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string unknown_field_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has no field named `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); bool has_field = false; v__ast__StructField field = ((v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}); - if (field_name.len > 0 && u8_is_capital(string_at(field_name, 0)) && (sym->info)._typ == 416 /* v.ast.Struct */ && sym->language == v__ast__Language__v) { + if (field_name.len > 0 && u8_is_capital(string_at(field_name, 0)) && (sym->info)._typ == 417 /* v.ast.Struct */ && sym->language == v__ast__Language__v) { for (int _t10 = 0; _t10 < (*sym->info._v__ast__Struct).embeds.len; ++_t10) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Struct).embeds.data)[_t10]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(c->table, embed); @@ -52991,16 +53057,16 @@ 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){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_60871 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t13.data); - field = mr_60871.arg0; - embed_types = mr_60871.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_61862 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t13.data); + field = mr_61862.arg0; + embed_types = mr_61862.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); } } if (!c->inside_unsafe) { - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_union && !Array_v__token__Kind_contains(_const_v__token__assign_tokens, node->next_token)) { v__checker__Checker_warn(c, _SLIT("reading a union field (or its address) requires `unsafe`"), node->pos); } @@ -53027,9 +53093,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){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_61702 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t15.data); - field = mr_61702.arg0; - embed_types = mr_61702.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_62693 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t15.data); + field = mr_62693.arg0; + embed_types = mr_62693.arg1; node->from_embed_types = embed_types; } } @@ -53038,20 +53104,20 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S Option_v__ast__Fn _t16 = v__ast__Table_find_method(c->table, sym, field_name); if (_t16.state != 0) { /*or block*/ IError err = _t16.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid `IError` interface implementation: "), 0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid `IError` interface implementation: "), /*115 &IError*/0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t17 = _const_v__ast__void_type; return _t17; } v__ast__Fn method = (*(v__ast__Fn*)_t16.data); - v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("the `."), 0xfe10, {.d_s = field_name}}, {_SLIT("` field on `IError` is deprecated, and will be removed after 2022-06-01, use `."), 0xfe10, {.d_s = field_name}}, {_SLIT("()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("the `."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("` field on `IError` is deprecated, and will be removed after 2022-06-01, use `."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("()` instead."), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t18 = method.return_type; return _t18; } if (has_field) { if (!string__eq(sym->mod, c->mod) && !field.is_pub && sym->language != v__ast__Language__c) { v__ast__TypeSymbol* unwrapped_sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, typ)); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = unwrapped_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT("` is not public"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = unwrapped_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("` is not public"), 0, { .d_c = 0 }}})), node->pos); } v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, field.typ); if (field_sym->kind == v__ast__Kind__sum_type || field_sym->kind == v__ast__Kind__interface_) { @@ -53076,10 +53142,10 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S v__ast__Type _t22 = _const_v__ast__int_type; return _t22; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = unwrapped_sym->name}}, {_SLIT("` has no property `"), 0xfe10, {.d_s = node->field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = unwrapped_sym->name}}, {_SLIT("` has no property `"), /*115 &string*/0xfe10, {.d_s = node->field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else { - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { if (!v__token__Pos_struct_eq(c->smartcast_mut_pos, ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}))) { v__checker__Checker_note(c, _SLIT("smartcasting requires either an immutable value, or an explicit mut keyword before the value"), c->smartcast_mut_pos); } @@ -53118,7 +53184,7 @@ void v__checker__Checker_const_decl(v__checker__Checker* c, v__ast__ConstDecl* n v__ast__ConstField field = ((v__ast__ConstField*)node->fields.data)[_t1]; if (Array_string_contains(c->const_names, field.name)) { v__token__Pos name_pos = ((v__token__Pos){.len = v__util__no_cur_mod(field.name, c->mod).len,field.pos.line_nr,field.pos.pos,field.pos.col,field.pos.last_line,}); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate const `"), 0xfe10, {.d_s = field.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate const `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); } array_push((array*)&c->const_names, _MOV((string[]){ string_clone(field.name) })); } @@ -53149,31 +53215,31 @@ void v__checker__Checker_enum_decl(v__checker__Checker* c, v__ast__EnumDecl* nod for (int i = 0; i < node->fields.len; ++i) { v__ast__EnumField* field = ((v__ast__EnumField*)node->fields.data) + i; if (!c->pref->experimental && v__util__contains_capital(field->name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), 0xfe10, {.d_s = field->name}}, {_SLIT("` cannot contain uppercase letters, use snake_case instead"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), /*115 &string*/0xfe10, {.d_s = field->name}}, {_SLIT("` cannot contain uppercase letters, use snake_case instead"), 0, { .d_c = 0 }}})), field->pos); } for (int j = 0; j < i; ++j) { if (string__eq(field->name, (*(v__ast__EnumField*)/*ee elem_sym */array_get(node->fields, j)).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), 0xfe10, {.d_s = field->name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), /*115 &string*/0xfe10, {.d_s = field->name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field->pos); } } if (field->has_expr) { - if (field->expr._typ == 271 /* v.ast.IntegerLiteral */) { + if (field->expr._typ == 272 /* v.ast.IntegerLiteral */) { i64 val = string_i64((*field->expr._v__ast__IntegerLiteral).val); if (val < _const_v__checker__int_min || val > _const_v__checker__int_max) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), 0xfe09, {.d_i64 = val}}, {_SLIT("` overflows int"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), /*100 &i64*/0xfe09, {.d_i64 = val}}, {_SLIT("` overflows int"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); } else if (!c->pref->translated && !c->file->is_translated && !node->is_multi_allowed && Array_i64_contains(seen, ((i64)(val)))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), 0xfe09, {.d_i64 = val}}, {_SLIT("` already exists"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), /*100 &i64*/0xfe09, {.d_i64 = val}}, {_SLIT("` already exists"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); } array_push((array*)&seen, _MOV((i64[]){ ((i64)(val)) })); } - else if (field->expr._typ == 283 /* v.ast.PrefixExpr */) { + else if (field->expr._typ == 284 /* v.ast.PrefixExpr */) { } - else if (field->expr._typ == 270 /* v.ast.InfixExpr */) { + else if (field->expr._typ == 271 /* v.ast.InfixExpr */) { v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*field->expr._v__ast__InfixExpr)); } else { - if ((field->expr)._typ == 266 /* v.ast.Ident */) { + if ((field->expr)._typ == 267 /* v.ast.Ident */) { if ((*field->expr._v__ast__Ident).language == v__ast__Language__c) { continue; } @@ -53191,7 +53257,7 @@ void v__checker__Checker_enum_decl(v__checker__Checker* c, v__ast__EnumDecl* nod if (last == _const_v__checker__int_max) { v__checker__Checker_error(c, _SLIT("enum value overflows"), field->pos); } else if (!c->pref->translated && !c->file->is_translated && !node->is_multi_allowed && Array_i64_contains(seen, last + 1)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), 0xfe09, {.d_i64 = last + 1}}, {_SLIT("` already exists"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), /*100 &i64*/0xfe09, {.d_i64 = last + 1}}, {_SLIT("` already exists"), 0, { .d_c = 0 }}})), field->pos); } array_push((array*)&seen, _MOV((i64[]){ last + 1 })); } else { @@ -53218,42 +53284,42 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St #if defined(CUSTOM_DEFINE_trace_checker) { string ntype = string_replace(charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (node)._typ )), _SLIT("v.ast."), _SLIT("")); - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("checking: "), 0x3cfe10, {.d_s = c->file->path}}, {_SLIT(" | pos: "), 0x4efe10, {.d_s = v__token__Pos_line_str((*(node.pos)))}}, {_SLIT(" | node: "), 0xfe10, {.d_s = ntype}}, {_SLIT(" | "), 0xfe10, {.d_s = v__ast__Stmt_str(node)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("checking: "), /*115 &string*/0x3cfe10, {.d_s = c->file->path}}, {_SLIT(" | pos: "), /*115 &string*/0x4efe10, {.d_s = v__token__Pos_line_str((*(node.pos)))}}, {_SLIT(" | node: "), /*115 &string*/0xfe10, {.d_s = ntype}}, {_SLIT(" | "), /*115 &v.ast.Stmt*/0xfe10, {.d_s = v__ast__Stmt_str(node)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif c->expected_type = _const_v__ast__void_type; - if (node._typ == 304 /* v.ast.EmptyStmt */) { + if (node._typ == 305 /* v.ast.EmptyStmt */) { if (c->pref->is_verbose) { eprintln(_SLIT("Checker.stmt() EmptyStmt")); print_backtrace(); } } - else if (node._typ == 277 /* v.ast.NodeError */) { + else if (node._typ == 278 /* v.ast.NodeError */) { } - else if (node._typ == 296 /* v.ast.AsmStmt */) { + else if (node._typ == 297 /* v.ast.AsmStmt */) { v__checker__Checker_asm_stmt(c, (voidptr)&/*qq*/(*node._v__ast__AsmStmt)); } - else if (node._typ == 297 /* v.ast.AssertStmt */) { + else if (node._typ == 298 /* v.ast.AssertStmt */) { v__checker__Checker_assert_stmt(c, (*node._v__ast__AssertStmt)); } - else if (node._typ == 298 /* v.ast.AssignStmt */) { + else if (node._typ == 299 /* v.ast.AssignStmt */) { v__checker__Checker_assign_stmt(c, (voidptr)&/*qq*/(*node._v__ast__AssignStmt)); } - else if (node._typ == 299 /* v.ast.Block */) { + else if (node._typ == 300 /* v.ast.Block */) { v__checker__Checker_block(c, (*node._v__ast__Block)); } - else if (node._typ == 300 /* v.ast.BranchStmt */) { + else if (node._typ == 301 /* v.ast.BranchStmt */) { v__checker__Checker_branch_stmt(c, (*node._v__ast__BranchStmt)); } - else if (node._typ == 301 /* v.ast.ComptimeFor */) { + else if (node._typ == 302 /* v.ast.ComptimeFor */) { v__checker__Checker_comptime_for(c, (*node._v__ast__ComptimeFor)); } - else if (node._typ == 302 /* v.ast.ConstDecl */) { + else if (node._typ == 303 /* v.ast.ConstDecl */) { c->inside_const = true; v__checker__Checker_const_decl(c, (voidptr)&/*qq*/(*node._v__ast__ConstDecl)); c->inside_const = false; } - else if (node._typ == 303 /* v.ast.DeferStmt */) { + else if (node._typ == 304 /* v.ast.DeferStmt */) { if ((*node._v__ast__DeferStmt).idx_in_fn < 0) { (*node._v__ast__DeferStmt).idx_in_fn = c->table->cur_fn->defer_stmts.len; array_push((array*)&c->table->cur_fn->defer_stmts, _MOV((v__ast__DeferStmt[]){ *&(*node._v__ast__DeferStmt) })); @@ -53264,7 +53330,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St for (int i = 0; i < (*node._v__ast__DeferStmt).defer_vars.len; ++i) { v__ast__Ident ident = ((v__ast__Ident*)(*node._v__ast__DeferStmt).defer_vars.data)[i]; v__ast__Ident id = ident; - if ((id.info)._typ == 376 /* v.ast.IdentVar */) { + if ((id.info)._typ == 377 /* v.ast.IdentVar */) { if (id.comptime && Array_string_contains(_const_v__checker__valid_comptime_not_user_defined, id.name)) { (*(v__ast__Ident*)/*ee elem_sym */array_get((*node._v__ast__DeferStmt).defer_vars, i)) = ((v__ast__Ident){.language = 0,.tok_kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comptime = 0,.scope = 0,.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = _SLIT(""),.kind = 0,.info = {0},.is_mut = 0,}); continue; @@ -53281,20 +53347,20 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St v__checker__Checker_stmts(c, (*node._v__ast__DeferStmt).stmts); c->inside_defer = false; } - else if (node._typ == 305 /* v.ast.EnumDecl */) { + else if (node._typ == 306 /* v.ast.EnumDecl */) { v__checker__Checker_enum_decl(c, (voidptr)&/*qq*/(*node._v__ast__EnumDecl)); } - else if (node._typ == 306 /* v.ast.ExprStmt */) { + else if (node._typ == 307 /* v.ast.ExprStmt */) { (*node._v__ast__ExprStmt).typ = v__checker__Checker_expr(c, (*node._v__ast__ExprStmt).expr); c->expected_type = _const_v__ast__void_type; v__ast__Type or_typ = _const_v__ast__void_type; - if ((*node._v__ast__ExprStmt).expr._typ == 269 /* v.ast.IndexExpr */) { + if ((*node._v__ast__ExprStmt).expr._typ == 270 /* v.ast.IndexExpr */) { if ((*(*node._v__ast__ExprStmt).expr._v__ast__IndexExpr).or_expr.kind != v__ast__OrKind__absent) { (*node._v__ast__ExprStmt).is_expr = true; or_typ = (*node._v__ast__ExprStmt).typ; } } - else if ((*node._v__ast__ExprStmt).expr._typ == 283 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__ExprStmt).expr._typ == 284 /* v.ast.PrefixExpr */) { if ((*(*node._v__ast__ExprStmt).expr._v__ast__PrefixExpr).or_block.kind != v__ast__OrKind__absent) { (*node._v__ast__ExprStmt).is_expr = true; or_typ = (*node._v__ast__ExprStmt).typ; @@ -53305,7 +53371,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St } ; if (!c->pref->is_repl && (c->stmt_level == 1 || (c->stmt_level > 1 && !c->is_last_stmt))) { - if (((*node._v__ast__ExprStmt).expr)._typ == 270 /* v.ast.InfixExpr */) { + if (((*node._v__ast__ExprStmt).expr)._typ == 271 /* v.ast.InfixExpr */) { if ((*(*node._v__ast__ExprStmt).expr._v__ast__InfixExpr).op == v__token__Kind__left_shift) { v__ast__TypeSymbol* left_sym = v__ast__Table_final_sym(c->table, (*(*node._v__ast__ExprStmt).expr._v__ast__InfixExpr).left_type); if (left_sym->kind != v__ast__Kind__array) { @@ -53316,24 +53382,24 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St } v__checker__Checker_check_expr_opt_call(c, (*node._v__ast__ExprStmt).expr, or_typ); } - else if (node._typ == 183 /* v.ast.FnDecl */) { + else if (node._typ == 184 /* v.ast.FnDecl */) { v__checker__Checker_fn_decl(c, (voidptr)&/*qq*/(*node._v__ast__FnDecl)); } - else if (node._typ == 307 /* v.ast.ForCStmt */) { + else if (node._typ == 308 /* v.ast.ForCStmt */) { v__checker__Checker_for_c_stmt(c, (*node._v__ast__ForCStmt)); } - else if (node._typ == 308 /* v.ast.ForInStmt */) { + else if (node._typ == 309 /* v.ast.ForInStmt */) { v__checker__Checker_for_in_stmt(c, (voidptr)&/*qq*/(*node._v__ast__ForInStmt)); } - else if (node._typ == 309 /* v.ast.ForStmt */) { + else if (node._typ == 310 /* v.ast.ForStmt */) { v__checker__Checker_for_stmt(c, (voidptr)&/*qq*/(*node._v__ast__ForStmt)); } - else if (node._typ == 310 /* v.ast.GlobalDecl */) { + else if (node._typ == 311 /* v.ast.GlobalDecl */) { v__checker__Checker_global_decl(c, (voidptr)&/*qq*/(*node._v__ast__GlobalDecl)); } - else if (node._typ == 311 /* v.ast.GotoLabel */) { + else if (node._typ == 312 /* v.ast.GotoLabel */) { } - else if (node._typ == 312 /* v.ast.GotoStmt */) { + else if (node._typ == 313 /* v.ast.GotoStmt */) { if (c->inside_defer) { v__checker__Checker_error(c, _SLIT("goto is not allowed in defer statements"), (*node._v__ast__GotoStmt).pos); } @@ -53341,35 +53407,35 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St v__checker__Checker_warn(c, _SLIT("`goto` requires `unsafe` (consider using labelled break/continue)"), (*node._v__ast__GotoStmt).pos); } if (!Array_string_contains(c->table->cur_fn->label_names, (*node._v__ast__GotoStmt).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown label `"), 0xfe10, {.d_s = (*node._v__ast__GotoStmt).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__GotoStmt).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown label `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__GotoStmt).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__GotoStmt).pos); } } - else if (node._typ == 313 /* v.ast.HashStmt */) { + else if (node._typ == 314 /* v.ast.HashStmt */) { v__checker__Checker_hash_stmt(c, (voidptr)&/*qq*/(*node._v__ast__HashStmt)); } - else if (node._typ == 314 /* v.ast.Import */) { + else if (node._typ == 315 /* v.ast.Import */) { v__checker__Checker_import_stmt(c, (*node._v__ast__Import)); } - else if (node._typ == 315 /* v.ast.InterfaceDecl */) { + else if (node._typ == 316 /* v.ast.InterfaceDecl */) { v__checker__Checker_interface_decl(c, (voidptr)&/*qq*/(*node._v__ast__InterfaceDecl)); } - else if (node._typ == 316 /* v.ast.Module */) { + else if (node._typ == 317 /* v.ast.Module */) { c->mod = (*node._v__ast__Module).name; c->is_just_builtin_mod = string__eq((*node._v__ast__Module).name, _SLIT("builtin")); c->is_builtin_mod = c->is_just_builtin_mod || (string__eq((*node._v__ast__Module).name, _SLIT("os")) || string__eq((*node._v__ast__Module).name, _SLIT("strconv"))); v__checker__Checker_check_valid_snake_case(c, (*node._v__ast__Module).name, _SLIT("module name"), (*node._v__ast__Module).pos); } - else if (node._typ == 317 /* v.ast.Return */) { + else if (node._typ == 318 /* v.ast.Return */) { v__checker__Checker_return_stmt(c, (voidptr)&/*qq*/(*node._v__ast__Return)); c->scope_returns = true; } - else if (node._typ == 318 /* v.ast.SqlStmt */) { + else if (node._typ == 319 /* v.ast.SqlStmt */) { v__checker__Checker_sql_stmt(c, (voidptr)&/*qq*/(*node._v__ast__SqlStmt)); } - else if (node._typ == 319 /* v.ast.StructDecl */) { + else if (node._typ == 320 /* v.ast.StructDecl */) { v__checker__Checker_struct_decl(c, (voidptr)&/*qq*/(*node._v__ast__StructDecl)); } - else if (node._typ == 243 /* v.ast.TypeDecl */) { + else if (node._typ == 244 /* v.ast.TypeDecl */) { v__checker__Checker_type_decl(c, (*node._v__ast__TypeDecl)); } ; @@ -53380,7 +53446,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_assert_stmt(v__checker__Checker* c, v__ v__ast__Type assert_type = v__checker__Checker_check_expr_opt_call(c, node.expr, v__checker__Checker_expr(c, node.expr)); if (assert_type != _const_v__ast__bool_type_idx) { string atype_name = v__ast__Table_sym(c->table, assert_type)->name; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("assert can be used only with `bool` expressions, but found `"), 0xfe10, {.d_s = atype_name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("assert can be used only with `bool` expressions, but found `"), /*115 &string*/0xfe10, {.d_s = atype_name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), node.pos); } v__checker__Checker_fail_if_unreadable(c, node.expr, _const_v__ast__bool_type_idx, _SLIT("assertion")); c->expected_type = cur_exp_typ; @@ -53398,14 +53464,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_block(v__checker__Checker* c, v__ast__B VV_LOCAL_SYMBOL void v__checker__Checker_branch_stmt(v__checker__Checker* c, v__ast__BranchStmt node) { if (c->inside_defer) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(node.kind)}}, {_SLIT("` is not allowed in defer statements"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.kind)}}, {_SLIT("` is not allowed in defer statements"), 0, { .d_c = 0 }}})), node.pos); } if (c->in_for_count == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__token__Kind_str(node.kind)}}, {_SLIT(" statement not within a loop"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.kind)}}, {_SLIT(" statement not within a loop"), 0, { .d_c = 0 }}})), node.pos); } if (node.label.len > 0) { if (!string__eq(node.label, c->loop_label)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid label name `"), 0xfe10, {.d_s = node.label}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid label name `"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); } } } @@ -53415,14 +53481,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_global_decl(v__checker__Checker* c, v__ v__ast__GlobalField* field = ((v__ast__GlobalField*)node->fields.data) + _t1; v__checker__Checker_check_valid_snake_case(c, field->name, _SLIT("global name"), field->pos); if (Array_string_contains(c->global_names, field->name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate global `"), 0xfe10, {.d_s = field->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate global `"), /*115 &string*/0xfe10, {.d_s = field->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, field->typ); if (sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->typ_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->typ_pos); } if (field->has_expr) { - if ((field->expr)._typ == 244 /* v.ast.AnonFn */ && string__eq(field->name, _SLIT("main"))) { + if ((field->expr)._typ == 245 /* v.ast.AnonFn */ && string__eq(field->name, _SLIT("main"))) { v__checker__Checker_error(c, _SLIT("the `main` function is the program entry point, cannot redefine it"), field->pos); } field->typ = v__checker__Checker_expr(c, field->expr); @@ -53458,7 +53524,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_asm_stmt(v__checker__Checker* c, v__ast v__ast__AsmTemplate* _v_template = ((v__ast__AsmTemplate*)stmt->templates.data) + _t2; if (_v_template->is_directive) { if (!(string__eq(_v_template->name, _SLIT("skip")) || string__eq(_v_template->name, _SLIT("space")) || string__eq(_v_template->name, _SLIT("byte")) || string__eq(_v_template->name, _SLIT("word")) || string__eq(_v_template->name, _SLIT("short")) || string__eq(_v_template->name, _SLIT("int")) || string__eq(_v_template->name, _SLIT("long")) || string__eq(_v_template->name, _SLIT("quad")) || string__eq(_v_template->name, _SLIT("globl")) || string__eq(_v_template->name, _SLIT("global")) || string__eq(_v_template->name, _SLIT("section")) || string__eq(_v_template->name, _SLIT("text")) || string__eq(_v_template->name, _SLIT("data")) || string__eq(_v_template->name, _SLIT("bss")) || string__eq(_v_template->name, _SLIT("fill")) || string__eq(_v_template->name, _SLIT("org")) || string__eq(_v_template->name, _SLIT("previous")) || string__eq(_v_template->name, _SLIT("string")) || string__eq(_v_template->name, _SLIT("asciz")) || string__eq(_v_template->name, _SLIT("ascii")))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown assembler directive: `"), 0xfe10, {.d_s = _v_template->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), _v_template->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown assembler directive: `"), /*115 &string*/0xfe10, {.d_s = _v_template->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), _v_template->pos); } } for (int _t3 = 0; _t3 < _v_template->args.len; ++_t3) { @@ -53473,9 +53539,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_asm_stmt(v__checker__Checker* c, v__ast } VV_LOCAL_SYMBOL void v__checker__Checker_asm_arg(v__checker__Checker* c, v__ast__AsmArg arg, v__ast__AsmStmt stmt, Array_string aliases) { - if (arg._typ == 397 /* v.ast.AsmAlias */) { + if (arg._typ == 398 /* v.ast.AsmAlias */) { } - else if (arg._typ == 396 /* v.ast.AsmAddressing */) { + else if (arg._typ == 397 /* v.ast.AsmAddressing */) { if (!((*arg._v__ast__AsmAddressing).scale == -1 || (*arg._v__ast__AsmAddressing).scale == 1 || (*arg._v__ast__AsmAddressing).scale == 2 || (*arg._v__ast__AsmAddressing).scale == 4 || (*arg._v__ast__AsmAddressing).scale == 8)) { v__checker__Checker_error(c, _SLIT("scale must be one of 1, 2, 4, or 8"), (*arg._v__ast__AsmAddressing).pos); } @@ -53483,17 +53549,17 @@ VV_LOCAL_SYMBOL void v__checker__Checker_asm_arg(v__checker__Checker* c, v__ast_ v__checker__Checker_asm_arg(c, (*arg._v__ast__AsmAddressing).base, stmt, aliases); v__checker__Checker_asm_arg(c, (*arg._v__ast__AsmAddressing).index, stmt, aliases); } - else if (arg._typ == 250 /* v.ast.BoolLiteral */) { + else if (arg._typ == 251 /* v.ast.BoolLiteral */) { } - else if (arg._typ == 264 /* v.ast.FloatLiteral */) { + else if (arg._typ == 265 /* v.ast.FloatLiteral */) { } - else if (arg._typ == 255 /* v.ast.CharLiteral */) { + else if (arg._typ == 256 /* v.ast.CharLiteral */) { } - else if (arg._typ == 271 /* v.ast.IntegerLiteral */) { + else if (arg._typ == 272 /* v.ast.IntegerLiteral */) { } - else if (arg._typ == 321 /* v.ast.AsmRegister */) { + else if (arg._typ == 322 /* v.ast.AsmRegister */) { } - else if (arg._typ == 398 /* v.ast.AsmDisp */) { + else if (arg._typ == 399 /* v.ast.AsmDisp */) { } else if (arg._typ == 20 /* string */) { } @@ -53567,13 +53633,13 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } string vroot = (*(string*)_t1.data); - node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->kind}}, {_SLIT(" "), 0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); + node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->kind}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); node->main = vroot; flag = vroot; } if (string_contains(flag, _SLIT("@VEXEROOT"))) { string vroot = string_replace(flag, _SLIT("@VEXEROOT"), os__dir(v__pref__vexe_path())); - node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->kind}}, {_SLIT(" "), 0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); + node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->kind}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); node->main = vroot; flag = vroot; } @@ -53586,7 +53652,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } string vroot = (*(string*)_t2.data); - node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->kind}}, {_SLIT(" "), 0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); + node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->kind}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); node->main = vroot; flag = vroot; } @@ -53618,21 +53684,21 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as node->val = fcontent; } else { IError err = _t4.err; - string missing_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("The file "), 0xfe10, {.d_s = original_flag}}, {_SLIT(", needed for insertion by module `"), 0xfe10, {.d_s = node->mod}}, {_SLIT("`,"), 0, { .d_c = 0 }}})); + string missing_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("The file "), /*115 &string*/0xfe10, {.d_s = original_flag}}, {_SLIT(", needed for insertion by module `"), /*115 &string*/0xfe10, {.d_s = node->mod}}, {_SLIT("`,"), 0, { .d_c = 0 }}})); if (os__is_file(node->main)) { missing_message = /*f*/string__plus(missing_message, _SLIT(" is not readable.")); } else { missing_message = /*f*/string__plus(missing_message, _SLIT(" does not exist.")); } if ((node->msg).len != 0) { - missing_message = /*f*/string__plus(missing_message, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = node->msg}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + missing_message = /*f*/string__plus(missing_message, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = node->msg}}, {_SLIT("."), 0, { .d_c = 0 }}}))); } v__checker__Checker_error(c, missing_message, node->pos); } } } else if (string__eq(node->kind, _SLIT("pkgconfig"))) { - Array_string args = (string_contains(node->main, _SLIT("--")) ? (string_split(node->main, _SLIT(" "))) : (string_split( str_intp(2, _MOV((StrIntpData[]){{_SLIT("--cflags --libs "), 0xfe10, {.d_s = node->main}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(" ")))); + Array_string args = (string_contains(node->main, _SLIT("--")) ? (string_split(node->main, _SLIT(" "))) : (string_split( str_intp(2, _MOV((StrIntpData[]){{_SLIT("--cflags --libs "), /*115 &string*/0xfe10, {.d_s = node->main}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(" ")))); Option_v__pkgconfig__Main_ptr _t5 = v__pkgconfig__main(args); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; @@ -53698,7 +53764,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as string deprecated = ((string*)_t11.data)[_t12]; if (string_contains(flag, deprecated)) { if (!string_contains(flag, _SLIT("@VMODROOT"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = deprecated}}, {_SLIT(" had been deprecated, use @VMODROOT instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = deprecated}}, {_SLIT(" had been deprecated, use @VMODROOT instead."), 0, { .d_c = 0 }}})), node->pos); } } } @@ -53713,7 +53779,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } else { if (!string__eq(node->kind, _SLIT("define"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `#define`, `#flag`, `#include`, `#insert` or `#pkgconfig` not "), 0xfe10, {.d_s = node->val}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `#define`, `#flag`, `#include`, `#insert` or `#pkgconfig` not "), /*115 &string*/0xfe10, {.d_s = node->val}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } }; } @@ -53722,26 +53788,26 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ v__checker__Checker_check_valid_snake_case(c, node.alias, _SLIT("module alias"), node.pos); for (int _t1 = 0; _t1 < node.syms.len; ++_t1) { v__ast__ImportSymbol sym = ((v__ast__ImportSymbol*)node.syms.data)[_t1]; - string name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.mod}}, {_SLIT("."), 0xfe10, {.d_s = sym.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (u8_is_capital(string_at(sym.name, 0))) { Option_v__ast__TypeSymbol_ptr _t2; if (_t2 = v__ast__Table_find_sym(c->table, name), _t2.state == 0) { v__ast__TypeSymbol* type_sym = *(v__ast__TypeSymbol**)_t2.data; if (type_sym->kind != v__ast__Kind__placeholder) { if (!type_sym->is_pub) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), 0xfe10, {.d_s = node.mod}}, {_SLIT("` type `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("` type `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), sym.pos); } continue; } } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), 0xfe10, {.d_s = node.mod}}, {_SLIT("` has no type `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("` has no type `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), sym.pos); continue; } Option_v__ast__Fn _t3; if (_t3 = v__ast__Table_find_fn(c->table, name), _t3.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t3.data; if (!func.is_pub) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), 0xfe10, {.d_s = node.mod}}, {_SLIT("` function `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("()` is private"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("` function `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("()` is private"), 0, { .d_c = 0 }}})), sym.pos); } continue; } @@ -53749,7 +53815,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ if (_t4 = v__ast__Scope_find_const(c->file->global_scope, name), _t4.state == 0) { continue; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), 0xfe10, {.d_s = node.mod}}, {_SLIT("` has no constant or function `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("` has no constant or function `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), sym.pos); } time__Time* _t6 = (time__Time*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, c->table->mdeprecated_after), &(string[]){node.mod})); Option_time__Time _t5 = {0}; @@ -53781,7 +53847,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmts_ending_with_expression(v__checker } if (c->stmt_level > _const_v__checker__stmt_level_cutoff_limit) { c->scope_returns = false; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker: too many stmt levels: "), 0xfe07, {.d_i32 = c->stmt_level}}, {_SLIT(" "), 0, { .d_c = 0 }}})), (*((*(v__ast__Stmt*)/*ee elem_sym */array_get(stmts, 0)).pos))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker: too many stmt levels: "), /*100 &int*/0xfe07, {.d_i32 = c->stmt_level}}, {_SLIT(" "), 0, { .d_c = 0 }}})), (*((*(v__ast__Stmt*)/*ee elem_sym */array_get(stmts, 0)).pos))); return; } v__token__Pos unreachable = ((v__token__Pos){.len = 0,.line_nr = -1,.pos = 0,.col = 0,.last_line = 0,}); @@ -53795,7 +53861,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmts_ending_with_expression(v__checker } } v__checker__Checker_stmt(c, stmt); - if ((stmt)._typ == 311 /* v.ast.GotoLabel */) { + if ((stmt)._typ == 312 /* v.ast.GotoLabel */) { unreachable = ((v__token__Pos){.len = 0,.line_nr = -1,.pos = 0,.col = 0,.last_line = 0,}); c->scope_returns = false; } @@ -53830,7 +53896,7 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_expr_defer_0 = true; v__ast__Expr node = node_; if (c->expr_level > _const_v__checker__expr_level_cutoff_limit) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker: too many expr levels: "), 0xfe07, {.d_i32 = c->expr_level}}, {_SLIT(" "), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker: too many expr levels: "), /*100 &int*/0xfe07, {.d_i32 = c->expr_level}}, {_SLIT(" "), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node)); v__ast__Type _t1 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -53839,15 +53905,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t1; } - if (node._typ == 277 /* v.ast.NodeError */) { + if (node._typ == 278 /* v.ast.NodeError */) { } - else if (node._typ == 259 /* v.ast.ComptimeType */) { + else if (node._typ == 260 /* v.ast.ComptimeType */) { v__checker__Checker_error(c, _SLIT("incorrect use of compile-time type"), (*node._v__ast__ComptimeType).pos); } - else if (node._typ == 262 /* v.ast.EmptyExpr */) { + else if (node._typ == 263 /* v.ast.EmptyExpr */) { 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 == 251 /* v.ast.CTempVar */) { + else if (node._typ == 252 /* v.ast.CTempVar */) { v__ast__Type _t2 = (*node._v__ast__CTempVar).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -53856,7 +53922,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t2; } - else if (node._typ == 244 /* v.ast.AnonFn */) { + else if (node._typ == 245 /* v.ast.AnonFn */) { v__ast__Type _t3 = v__checker__Checker_anon_fn(c, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -53865,7 +53931,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t3; } - else if (node._typ == 245 /* v.ast.ArrayDecompose */) { + else if (node._typ == 246 /* 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) { @@ -53878,7 +53944,7 @@ bool v__checker__Checker_expr_defer_0 = false; // 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, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 412) /*expected idx: 412, 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; @@ -53890,7 +53956,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t5; } - else if (node._typ == 246 /* v.ast.ArrayInit */) { + else if (node._typ == 247 /* v.ast.ArrayInit */) { v__ast__Type _t6 = v__checker__Checker_array_init(c, (voidptr)&/*qq*/(*node._v__ast__ArrayInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -53899,7 +53965,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t6; } - else if (node._typ == 247 /* v.ast.AsCast */) { + else if (node._typ == 248 /* 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); @@ -53912,7 +53978,7 @@ bool v__checker__Checker_expr_defer_0 = false; ; if (!v__ast__Table_sumtype_has_variant(c->table, (*node._v__ast__AsCast).expr_type, (*node._v__ast__AsCast).typ, true)) { string addr = string_repeat(_SLIT("&"), v__ast__Type_nr_muls((*node._v__ast__AsCast).typ)); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = addr}}, {_SLIT0, 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__AsCast).pos); + 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); @@ -53922,9 +53988,9 @@ bool v__checker__Checker_expr_defer_0 = false; ; } else if (!v__ast__Type_alias_eq((*node._v__ast__AsCast).expr_type, (*node._v__ast__AsCast).typ)) { - string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast non-sum type `"), 0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` using `as`"), 0, { .d_c = 0 }}})); + string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast non-sum type `"), /*115 &string*/0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` using `as`"), 0, { .d_c = 0 }}})); if (type_sym->kind == v__ast__Kind__sum_type) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" - use e.g. `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("(some_expr)` instead."), 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" - use e.g. `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("(some_expr)` instead."), 0, { .d_c = 0 }}}))); } v__checker__Checker_error(c, s, (*node._v__ast__AsCast).pos); } @@ -53936,7 +54002,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t9; } - else if (node._typ == 248 /* v.ast.Assoc */) { + else if (node._typ == 249 /* 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; @@ -53958,7 +54024,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t11; } - else if (node._typ == 250 /* v.ast.BoolLiteral */) { + else if (node._typ == 251 /* v.ast.BoolLiteral */) { v__ast__Type _t12 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -53967,7 +54033,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t12; } - else if (node._typ == 253 /* v.ast.CastExpr */) { + else if (node._typ == 254 /* v.ast.CastExpr */) { v__ast__Type _t13 = v__checker__Checker_cast_expr(c, (voidptr)&/*qq*/(*node._v__ast__CastExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -53976,17 +54042,22 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t13; } - else if (node._typ == 252 /* v.ast.CallExpr */) { + else if (node._typ == 253 /* 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)) { + if (!v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional) && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__result)) { if ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__block) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `or` block, the function `"), 0xfe10, {.d_s = (*node._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*node._v__ast__CallExpr).or_block.pos); - } else if ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `?`, the function `"), 0xfe10, {.d_s = (*node._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*node._v__ast__CallExpr).or_block.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `or` block, the function `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__CallExpr).name}}, {_SLIT("` does neither return an optional nor a result"), 0, { .d_c = 0 }}})), (*node._v__ast__CallExpr).or_block.pos); + } else if ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `?`, the function `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__CallExpr).name}}, {_SLIT("` does neither return an optional nor a result"), 0, { .d_c = 0 }}})), (*node._v__ast__CallExpr).or_block.pos); } } - if (v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional) && (*node._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent) { - ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional); + if ((*node._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent) { + if (v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional)) { + ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional); + } + if (v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__result)) { + ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__result); + } } v__ast__Type _t14 = ret_type; // Defer begin @@ -53996,7 +54067,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t14; } - else if (node._typ == 254 /* v.ast.ChanInit */) { + else if (node._typ == 255 /* v.ast.ChanInit */) { v__ast__Type _t15 = v__checker__Checker_chan_init(c, (voidptr)&/*qq*/(*node._v__ast__ChanInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54005,7 +54076,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t15; } - else if (node._typ == 255 /* v.ast.CharLiteral */) { + else if (node._typ == 256 /* v.ast.CharLiteral */) { v__ast__Type _t16 = _const_v__ast__rune_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54014,7 +54085,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t16; } - else if (node._typ == 256 /* v.ast.Comment */) { + else if (node._typ == 257 /* v.ast.Comment */) { v__ast__Type _t17 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54023,7 +54094,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t17; } - else if (node._typ == 249 /* v.ast.AtExpr */) { + else if (node._typ == 250 /* v.ast.AtExpr */) { v__ast__Type _t18 = v__checker__Checker_at_expr(c, (voidptr)&/*qq*/(*node._v__ast__AtExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54032,7 +54103,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t18; } - else if (node._typ == 257 /* v.ast.ComptimeCall */) { + else if (node._typ == 258 /* v.ast.ComptimeCall */) { v__ast__Type _t19 = v__checker__Checker_comptime_call(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54041,14 +54112,14 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t19; } - else if (node._typ == 258 /* v.ast.ComptimeSelector */) { + else if (node._typ == 259 /* v.ast.ComptimeSelector */) { (*node._v__ast__ComptimeSelector).left_type = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, (*node._v__ast__ComptimeSelector).left)); v__ast__Type expr_type = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, (*node._v__ast__ComptimeSelector).field_expr)); v__ast__TypeSymbol* expr_sym = v__ast__Table_sym(c->table, expr_type); if (!v__ast__Type_alias_eq(expr_type, _const_v__ast__string_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `string` instead of `"), 0xfe10, {.d_s = expr_sym->name}}, {_SLIT("` (e.g. `field.name`)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*node._v__ast__ComptimeSelector).field_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `string` instead of `"), /*115 &string*/0xfe10, {.d_s = expr_sym->name}}, {_SLIT("` (e.g. `field.name`)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*node._v__ast__ComptimeSelector).field_expr)); } - if (((*node._v__ast__ComptimeSelector).field_expr)._typ == 286 /* v.ast.SelectorExpr */) { + if (((*node._v__ast__ComptimeSelector).field_expr)._typ == 287 /* v.ast.SelectorExpr */) { v__token__Pos left_pos = v__ast__Expr_pos((*(*node._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr); if (c->comptime_fields_type.len == 0) { v__checker__Checker_error(c, _SLIT("compile time field access can only be used when iterating over `T.fields`"), left_pos); @@ -54063,7 +54134,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t20; } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown `$for` variable `"), 0xfe10, {.d_s = expr_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown `$for` variable `"), /*115 &string*/0xfe10, {.d_s = expr_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); } else { v__checker__Checker_error(c, _SLIT("expected selector expression e.g. `$(field.name)`"), v__ast__Expr_pos((*node._v__ast__ComptimeSelector).field_expr)); } @@ -54075,7 +54146,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t21; } - else if (node._typ == 260 /* v.ast.ConcatExpr */) { + else if (node._typ == 261 /* 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) { @@ -54084,7 +54155,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t22; } - else if (node._typ == 261 /* v.ast.DumpExpr */) { + else if (node._typ == 262 /* v.ast.DumpExpr */) { (*node._v__ast__DumpExpr).expr_type = v__checker__Checker_expr(c, (*node._v__ast__DumpExpr).expr); int etidx = v__ast__Type_idx((*node._v__ast__DumpExpr).expr_type); if (etidx == _const_v__ast__void_type_idx) { @@ -54117,7 +54188,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t25; } - else if (node._typ == 263 /* v.ast.EnumVal */) { + else if (node._typ == 264 /* 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) { @@ -54126,7 +54197,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t26; } - else if (node._typ == 264 /* v.ast.FloatLiteral */) { + else if (node._typ == 265 /* v.ast.FloatLiteral */) { v__ast__Type _t27 = _const_v__ast__float_literal_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54135,7 +54206,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t27; } - else if (node._typ == 265 /* v.ast.GoExpr */) { + else if (node._typ == 266 /* 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) { @@ -54144,7 +54215,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t28; } - else if (node._typ == 266 /* v.ast.Ident */) { + else if (node._typ == 267 /* v.ast.Ident */) { v__ast__Type res = v__checker__Checker_ident(c, (voidptr)&/*qq*/(*node._v__ast__Ident)); v__ast__Type _t29 = res; // Defer begin @@ -54154,7 +54225,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t29; } - else if (node._typ == 267 /* v.ast.IfExpr */) { + else if (node._typ == 268 /* 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) { @@ -54163,19 +54234,19 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t30; } - else if (node._typ == 268 /* v.ast.IfGuardExpr */) { + else if (node._typ == 269 /* v.ast.IfGuardExpr */) { bool old_inside_if_guard = c->inside_if_guard; c->inside_if_guard = true; (*node._v__ast__IfGuardExpr).expr_type = v__checker__Checker_expr(c, (*node._v__ast__IfGuardExpr).expr); c->inside_if_guard = old_inside_if_guard; if (!v__ast__Type_has_flag((*node._v__ast__IfGuardExpr).expr_type, v__ast__TypeFlag__optional)) { bool no_opt = true; - if ((*node._v__ast__IfGuardExpr).expr._typ == 269 /* v.ast.IndexExpr */) { + if ((*node._v__ast__IfGuardExpr).expr._typ == 270 /* v.ast.IndexExpr */) { no_opt = false; (*node._v__ast__IfGuardExpr).expr_type = v__ast__Type_set_flag((*node._v__ast__IfGuardExpr).expr_type, v__ast__TypeFlag__optional); (*(*node._v__ast__IfGuardExpr).expr._v__ast__IndexExpr).is_option = true; } - else if ((*node._v__ast__IfGuardExpr).expr._typ == 283 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__IfGuardExpr).expr._typ == 284 /* v.ast.PrefixExpr */) { if ((*(*node._v__ast__IfGuardExpr).expr._v__ast__PrefixExpr).op == v__token__Kind__arrow) { no_opt = false; (*node._v__ast__IfGuardExpr).expr_type = v__ast__Type_set_flag((*node._v__ast__IfGuardExpr).expr_type, v__ast__TypeFlag__optional); @@ -54198,7 +54269,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t31; } - else if (node._typ == 269 /* v.ast.IndexExpr */) { + else if (node._typ == 270 /* 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) { @@ -54207,7 +54278,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t32; } - else if (node._typ == 270 /* v.ast.InfixExpr */) { + else if (node._typ == 271 /* 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) { @@ -54216,7 +54287,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t33; } - else if (node._typ == 271 /* v.ast.IntegerLiteral */) { + else if (node._typ == 272 /* 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) { @@ -54225,7 +54296,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t34; } - else if (node._typ == 274 /* v.ast.LockExpr */) { + else if (node._typ == 275 /* 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) { @@ -54234,7 +54305,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t35; } - else if (node._typ == 275 /* v.ast.MapInit */) { + else if (node._typ == 276 /* 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) { @@ -54243,7 +54314,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t36; } - else if (node._typ == 276 /* v.ast.MatchExpr */) { + else if (node._typ == 277 /* 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) { @@ -54252,7 +54323,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t37; } - else if (node._typ == 282 /* v.ast.PostfixExpr */) { + else if (node._typ == 283 /* 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) { @@ -54261,7 +54332,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t38; } - else if (node._typ == 283 /* v.ast.PrefixExpr */) { + else if (node._typ == 284 /* 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) { @@ -54270,7 +54341,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t39; } - else if (node._typ == 278 /* v.ast.None */) { + else if (node._typ == 279 /* v.ast.None */) { v__ast__Type _t40 = _const_v__ast__none_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54279,7 +54350,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t40; } - else if (node._typ == 280 /* v.ast.OrExpr */) { + else if (node._typ == 281 /* v.ast.OrExpr */) { v__ast__Type _t41 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54288,8 +54359,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t41; } - else if (node._typ == 281 /* v.ast.ParExpr */) { - if (((*node._v__ast__ParExpr).expr)._typ == 281 /* v.ast.ParExpr */) { + else if (node._typ == 282 /* v.ast.ParExpr */) { + if (((*node._v__ast__ParExpr).expr)._typ == 282 /* 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); @@ -54300,7 +54371,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t42; } - else if (node._typ == 284 /* v.ast.RangeExpr */) { + else if (node._typ == 285 /* v.ast.RangeExpr */) { v__ast__Type _t43 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54309,7 +54380,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t43; } - else if (node._typ == 285 /* v.ast.SelectExpr */) { + else if (node._typ == 286 /* 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) { @@ -54318,7 +54389,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t44; } - else if (node._typ == 286 /* v.ast.SelectorExpr */) { + else if (node._typ == 287 /* 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) { @@ -54327,7 +54398,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t45; } - else if (node._typ == 287 /* v.ast.SizeOf */) { + else if (node._typ == 288 /* 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); } @@ -54339,7 +54410,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t46; } - else if (node._typ == 272 /* v.ast.IsRefType */) { + else if (node._typ == 273 /* 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); } @@ -54351,7 +54422,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t47; } - else if (node._typ == 279 /* v.ast.OffsetOf */) { + else if (node._typ == 280 /* 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) { @@ -54360,7 +54431,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t48; } - else if (node._typ == 288 /* v.ast.SqlExpr */) { + else if (node._typ == 289 /* 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) { @@ -54369,7 +54440,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t49; } - else if (node._typ == 290 /* v.ast.StringLiteral */) { + else if (node._typ == 291 /* 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 @@ -54387,7 +54458,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t51; } - else if (node._typ == 289 /* v.ast.StringInterLiteral */) { + else if (node._typ == 290 /* 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) { @@ -54396,7 +54467,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t52; } - else if (node._typ == 291 /* v.ast.StructInit */) { + else if (node._typ == 292 /* 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 @@ -54414,7 +54485,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t54; } - else if (node._typ == 292 /* v.ast.TypeNode */) { + else if (node._typ == 293 /* v.ast.TypeNode */) { v__ast__Type _t55 = (*node._v__ast__TypeNode).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54423,7 +54494,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t55; } - else if (node._typ == 293 /* v.ast.TypeOf */) { + else if (node._typ == 294 /* 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 @@ -54433,7 +54504,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t56; } - else if (node._typ == 294 /* v.ast.UnsafeExpr */) { + else if (node._typ == 295 /* 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) { @@ -54442,12 +54513,12 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t57; } - else if (node._typ == 273 /* v.ast.Likely */) { + else if (node._typ == 274 /* 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)) { v__ast__TypeSymbol* ltype_sym = v__ast__Table_sym(c->table, ltype); string lname = ((*node._v__ast__Likely).is_likely ? (_SLIT("_likely_")) : (_SLIT("_unlikely_"))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = lname}}, {_SLIT("()` expects a boolean expression, instead it got `"), 0xfe10, {.d_s = ltype_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__Likely).pos); + 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 _t58 = _const_v__ast__bool_type; // Defer begin @@ -54502,32 +54573,32 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE if (!v__ast__Table_sumtype_has_variant(c->table, to_type, from_type, false) && !v__ast__Type_has_flag(to_type, v__ast__TypeFlag__optional)) { string ft = v__ast__Table_type_to_str(c->table, from_type); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to `"), 0xfe10, {.d_s = tt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } - } else if ((to_sym->info)._typ == 431 /* v.ast.Alias */ && !(final_to_sym->kind == v__ast__Kind__struct_ && v__ast__Type_is_ptr(to_type))) { + } else if ((to_sym->info)._typ == 432 /* v.ast.Alias */ && !(final_to_sym->kind == v__ast__Kind__struct_ && v__ast__Type_is_ptr(to_type))) { if (!v__checker__Checker_check_types(c, from_type, (*to_sym->info._v__ast__Alias).parent_type) && !(v__ast__TypeSymbol_is_int(final_to_sym) && (final_from_sym->kind == v__ast__Kind__enum_ || final_from_sym->kind == v__ast__Kind__bool || final_from_sym->kind == v__ast__Kind__i8 || final_from_sym->kind == v__ast__Kind__char))) { string ft = v__ast__Table_type_to_str(c->table, from_type); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to `"), 0xfe10, {.d_s = tt}}, {_SLIT("` (alias to `"), 0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("` (alias to `"), /*115 &string*/0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); } - } else if (to_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(to_type) && !(/* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).is_typedef) { + } else if (to_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(to_type) && !(/* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).is_typedef) { if (from_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(from_type)) { v__checker__Checker_warn(c, _SLIT("casting to struct is deprecated, use e.g. `Struct{...expr}` instead"), node->pos); - v__ast__Struct from_type_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; - v__ast__Struct to_type_info = /* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct from_type_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct to_type_info = /* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (!v__checker__Checker_check_struct_signature(c, from_type_info, to_type_info)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot convert struct `"), 0xfe10, {.d_s = from_sym->name}}, {_SLIT("` to struct `"), 0xfe10, {.d_s = to_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot convert struct `"), /*115 &string*/0xfe10, {.d_s = from_sym->name}}, {_SLIT("` to struct `"), /*115 &string*/0xfe10, {.d_s = to_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else { string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to struct"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to struct"), 0, { .d_c = 0 }}})), node->pos); } } else if (to_sym->kind == v__ast__Kind__interface_) { if (v__checker__Checker_type_implements(c, from_type, to_type, node->pos)) { if (!v__ast__Type_is_ptr(from_type) && !v__ast__Type_is_pointer(from_type) && from_sym->kind != v__ast__Kind__interface_ && !c->inside_unsafe) { v__checker__Checker_mark_as_referenced(c, &node->expr, true); } - if ((/* as */ *(v__ast__Interface*)__as_cast((to_sym->info)._v__ast__Interface,(to_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ).is_generic) { + if ((/* as */ *(v__ast__Interface*)__as_cast((to_sym->info)._v__ast__Interface,(to_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ).is_generic) { v__ast__Type inferred_type = v__checker__Checker_resolve_generic_interface(c, from_type, to_type, node->pos); if (inferred_type != 0) { to_type = inferred_type; @@ -54540,73 +54611,73 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE v__checker__Checker_error(c, _SLIT("cannot cast to bool - use e.g. `some_int != 0` instead"), node->pos); } else if (v__ast__Type_alias_eq(from_type, _const_v__ast__none_type) && !v__ast__Type_has_flag(to_type, v__ast__TypeFlag__optional)) { string type_name = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast `none` to `"), 0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast `none` to `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else if (from_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(from_type)) { if ((v__ast__Type_is_ptr(to_type) || !(to_sym->kind == v__ast__Kind__sum_type || to_sym->kind == v__ast__Kind__interface_)) && !c->is_builtin_mod) { string from_type_name = v__ast__Table_type_to_str(c->table, from_type); string type_name = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast struct `"), 0xfe10, {.d_s = from_type_name}}, {_SLIT("` to `"), 0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast struct `"), /*115 &string*/0xfe10, {.d_s = from_type_name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else if (to_sym->kind == v__ast__Kind__u8 && !v__ast__TypeSymbol_is_number(final_from_sym) && !v__ast__TypeSymbol_is_pointer(final_from_sym) && !v__ast__Type_is_ptr(from_type) && !(final_from_sym->kind == v__ast__Kind__char || final_from_sym->kind == v__ast__Kind__enum_ || final_from_sym->kind == v__ast__Kind__bool)) { string ft = v__ast__Table_type_to_str(c->table, from_type); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to `"), 0xfe10, {.d_s = tt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_has_flag(from_type, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(from_type, v__ast__TypeFlag__variadic)) { string msg = (v__ast__Type_has_flag(from_type, v__ast__TypeFlag__optional) ? (_SLIT("an optional")) : (_SLIT("a variadic"))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot type cast "), 0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot type cast "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (!c->inside_unsafe && v__ast__Type_is_ptr(to_type) && v__ast__Type_is_ptr(from_type) && !v__ast__Type_alias_eq(v__ast__Type_deref(to_type), _const_v__ast__char_type) && !v__ast__Type_alias_eq(v__ast__Type_deref(from_type), _const_v__ast__char_type)) { string ft = v__ast__Table_type_to_str(c->table, from_type); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("casting `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to `"), 0xfe10, {.d_s = tt}}, {_SLIT("` is only allowed in `unsafe` code"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("casting `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("` is only allowed in `unsafe` code"), 0, { .d_c = 0 }}})), node->pos); } else if (from_sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(from_type)) { v__checker__Checker_warn(c, _SLIT("cannot cast a fixed array (use e.g. `&arr[0]` instead)"), node->pos); } else if (final_from_sym->kind == v__ast__Kind__string && v__ast__TypeSymbol_is_number(final_to_sym) && final_to_sym->kind != v__ast__Kind__rune) { string snexpr = v__ast__Expr_str(node->expr); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast string to `"), 0xfe10, {.d_s = tt}}, {_SLIT("`, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT("."), 0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast string to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("`, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("()` instead."), 0, { .d_c = 0 }}})), node->pos); } if (to_sym->kind == v__ast__Kind__rune && v__ast__TypeSymbol_is_string(from_sym)) { string snexpr = v__ast__Expr_str(node->expr); string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to rune, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".runes()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to rune, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".runes()` instead."), 0, { .d_c = 0 }}})), node->pos); } if (v__ast__Type_alias_eq(to_type, _const_v__ast__string_type)) { if (v__ast__Type_alias_eq(from_type, _const_v__ast__byte_type) || v__ast__Type_alias_eq(from_type, _const_v__ast__bool_type)) { string snexpr = v__ast__Expr_str(node->expr); string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_is_real_pointer(from_type)) { string snexpr = v__ast__Expr_str(node->expr); string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast pointer type `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `&u8("), 0xfe10, {.d_s = snexpr}}, {_SLIT(").vstring()` or `cstring_to_vstring("), 0xfe10, {.d_s = snexpr}}, {_SLIT(")` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast pointer type `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `&u8("), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(").vstring()` or `cstring_to_vstring("), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(")` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_is_number(from_type)) { string snexpr = v__ast__Expr_str(node->expr); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast number to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast number to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (from_sym->kind == v__ast__Kind__alias && !string__eq(final_from_sym->name, _SLIT("string"))) { string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `x.str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `x.str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (final_from_sym->kind == v__ast__Kind__array) { string snexpr = v__ast__Expr_str(node->expr); if (string__eq(final_from_sym->name, _SLIT("[]u8"))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast []u8 to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".bytestr()` or `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast []u8 to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".bytestr()` or `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else { string first_elem_idx = _SLIT("[0]"); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast array to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT0, 0xfe10, {.d_s = first_elem_idx}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast array to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = first_elem_idx}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } } else if (final_from_sym->kind == v__ast__Kind__enum_) { string snexpr = v__ast__Expr_str(node->expr); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast enum to string, use "), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str() instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast enum to string, use "), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str() instead."), 0, { .d_c = 0 }}})), node->pos); } else if (final_from_sym->kind == v__ast__Kind__map) { v__checker__Checker_error(c, _SLIT("cannot cast map to string."), node->pos); } else if (final_from_sym->kind == v__ast__Kind__sum_type) { string snexpr = v__ast__Expr_str(node->expr); string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast sumtype `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast sumtype `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (!v__ast__Type_alias_eq(to_type, _const_v__ast__string_type) && v__ast__Type_alias_eq(from_type, _const_v__ast__string_type) && (!(to_sym->kind == v__ast__Kind__alias && string__eq(final_to_sym->name, _SLIT("string"))))) { - string error_msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast a string to a type `"), 0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("`, that is not an alias of string"), 0, { .d_c = 0 }}})); - if ((node->expr)._typ == 290 /* v.ast.StringLiteral */) { + string error_msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast a string to a type `"), /*115 &string*/0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("`, that is not an alias of string"), 0, { .d_c = 0 }}})); + if ((node->expr)._typ == 291 /* v.ast.StringLiteral */) { if ((*node->expr._v__ast__StringLiteral).val.len == 1) { - error_msg = /*f*/string__plus(error_msg, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", for denoting characters use `"), 0xfe10, {.d_s = (*node->expr._v__ast__StringLiteral).val}}, {_SLIT("` instead of '"), 0xfe10, {.d_s = (*node->expr._v__ast__StringLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + error_msg = /*f*/string__plus(error_msg, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", for denoting characters use `"), /*115 &string*/0xfe10, {.d_s = (*node->expr._v__ast__StringLiteral).val}}, {_SLIT("` instead of '"), /*115 &string*/0xfe10, {.d_s = (*node->expr._v__ast__StringLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); } } v__checker__Checker_error(c, error_msg, node->pos); @@ -54616,7 +54687,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE v__checker__Checker_expr(c, node->arg); } if (to_sym->kind == v__ast__Kind__enum_) { - if ((node->expr)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((node->expr)._typ == 272 /* v.ast.IntegerLiteral */) { string enum_typ_name = v__ast__Table_get_type_name(c->table, to_type); int node_val = string_int((*node->expr._v__ast__IntegerLiteral).val); v__ast__EnumDecl* _t4 = (v__ast__EnumDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, c->table->enum_decls), &(string[]){to_sym->name})); @@ -54637,7 +54708,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE int enum_val = 0; for (int _t5 = 0; _t5 < enum_decl.fields.len; ++_t5) { v__ast__EnumField enum_field = ((v__ast__EnumField*)enum_decl.fields.data)[_t5]; - if ((enum_field.expr)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((enum_field.expr)._typ == 272 /* v.ast.IntegerLiteral */) { enum_val = string_int((*enum_field.expr._v__ast__IntegerLiteral).val); } if (node_val == enum_val) { @@ -54648,7 +54719,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE } } if (!in_range) { - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = node_val}}, {_SLIT(" does not represent a value of enum "), 0xfe10, {.d_s = enum_typ_name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = node_val}}, {_SLIT(" does not represent a value of enum "), /*115 &string*/0xfe10, {.d_s = enum_typ_name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } } } @@ -54753,7 +54824,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_at_expr(v__checker__Checker* c, } case v__token__AtKind__unknown: { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown @ identifier: "), 0xfe10, {.d_s = node->name}}, {_SLIT(". Available identifiers: "), 0xfe10, {.d_s = Array_string_str(_const_v__token__valid_at_tokens)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown @ identifier: "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT(". Available identifiers: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(_const_v__token__valid_at_tokens)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); break; } } @@ -54766,10 +54837,10 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no if (c->const_deps.len > 0) { string name = node->name; if (!string_contains(name, _SLIT(".")) && !string__eq(node->mod, _SLIT("builtin"))) { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->mod}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); } if (string__eq(name, c->const_decl)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cycle in constant `"), 0xfe10, {.d_s = c->const_decl}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cycle in constant `"), /*115 &string*/0xfe10, {.d_s = c->const_decl}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t1 = _const_v__ast__void_type; return _t1; } @@ -54783,11 +54854,11 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no return _t3; } if (node->kind == v__ast__IdentKind__constant || node->kind == v__ast__IdentKind__global || node->kind == v__ast__IdentKind__variable) { - v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast((node->info)._v__ast__IdentVar,(node->info)._typ, 376) /*expected idx: 376, name: v.ast.IdentVar */ ; + v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast((node->info)._v__ast__IdentVar,(node->info)._typ, 377) /*expected idx: 377, name: v.ast.IdentVar */ ; v__ast__Type _t4 = info.typ; return _t4; } else if (node->kind == v__ast__IdentKind__function) { - v__ast__IdentFn info = /* as */ *(v__ast__IdentFn*)__as_cast((node->info)._v__ast__IdentFn,(node->info)._typ, 375) /*expected idx: 375, name: v.ast.IdentFn */ ; + v__ast__IdentFn info = /* as */ *(v__ast__IdentFn*)__as_cast((node->info)._v__ast__IdentFn,(node->info)._typ, 376) /*expected idx: 376, name: v.ast.IdentFn */ ; v__ast__Type _t5 = info.typ; return _t5; } else if (node->kind == v__ast__IdentKind__unresolved) { @@ -54797,17 +54868,17 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no Option_v__ast__ScopeObject _t6; if (_t6 = v__ast__Scope_find(node->scope, node->name), _t6.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t6.data; - if (obj._typ == 323 /* v.ast.GlobalField */) { + if (obj._typ == 324 /* v.ast.GlobalField */) { node->kind = v__ast__IdentKind__global; node->info = v__ast__IdentVar_to_sumtype_v__ast__IdentInfo(ADDR(v__ast__IdentVar, (((v__ast__IdentVar){.typ = (*obj._v__ast__GlobalField).typ,.is_mut = 0,.is_static = 0,.is_volatile = 0,.is_optional = 0,.share = 0,})))); node->obj = obj; v__ast__Type _t7 = (*obj._v__ast__GlobalField).typ; return _t7; } - else if (obj._typ == 324 /* v.ast.Var */) { + else if (obj._typ == 325 /* v.ast.Var */) { int node_pos = (c->pref->is_vweb && !_IN_MAP(ADDR(string, node->name), ADDR(map, node->scope->objects)) && node->scope->start_pos < c->comptime_call_pos ? (c->comptime_call_pos) : (node->pos.pos)); if (node_pos < (*obj._v__ast__Var).pos.pos) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` (used before declaration)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` (used before declaration)"), 0, { .d_c = 0 }}})), node->pos); } bool is_sum_type_cast = (*obj._v__ast__Var).smartcasts.len != 0 && !c->prevent_sum_type_unwrapping_once; c->prevent_sum_type_unwrapping_once = false; @@ -54819,17 +54890,17 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no } v__ast__Type typ = _t8; if (typ == 0) { - if (((*obj._v__ast__Var).expr)._typ == 266 /* v.ast.Ident */) { + if (((*obj._v__ast__Var).expr)._typ == 267 /* v.ast.Ident */) { if ((*(*obj._v__ast__Var).expr._v__ast__Ident).kind == v__ast__IdentKind__unresolved) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unresolved variable: `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unresolved variable: `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t9 = _const_v__ast__void_type; return _t9; } } - if (((*obj._v__ast__Var).expr)._typ == 268 /* v.ast.IfGuardExpr */) { + if (((*obj._v__ast__Var).expr)._typ == 269 /* v.ast.IfGuardExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*(*obj._v__ast__Var).expr._v__ast__IfGuardExpr).expr_type); if (sym->kind == v__ast__Kind__multi_return) { - v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 442) /*expected idx: 442, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; if (mr_info.types.len == (*(*obj._v__ast__Var).expr._v__ast__IfGuardExpr).vars.len) { for (int vi = 0; vi < (*(*obj._v__ast__Var).expr._v__ast__IfGuardExpr).vars.len; ++vi) { v__ast__IfGuardVar var = ((v__ast__IfGuardVar*)(*(*obj._v__ast__Var).expr._v__ast__IfGuardExpr).vars.data)[vi]; @@ -54868,14 +54939,14 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no if (_IN_MAP(ADDR(string, name), ADDR(map, c->file->imported_symbols))) { name = (*(string*)map_get(ADDR(map, c->file->imported_symbols), &(string[]){name}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); } else if (!string_contains(name, _SLIT(".")) && !string__eq(node->mod, _SLIT("builtin"))) { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->mod}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); } Option_v__ast__ScopeObject _t12; if (_t12 = v__ast__Scope_find(c->file->global_scope, name), _t12.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t12.data; - if (obj._typ == 322 /* v.ast.ConstField */) { + if (obj._typ == 323 /* v.ast.ConstField */) { if (!((*obj._v__ast__ConstField).is_pub || string__eq((*obj._v__ast__ConstField).mod, c->mod) || c->pref->is_test)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("constant `"), 0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("constant `"), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } v__ast__Type typ = (*obj._v__ast__ConstField).typ; if (typ == 0) { @@ -54885,7 +54956,7 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no typ = v__checker__Checker_expr(c, (*obj._v__ast__ConstField).expr); c->inside_const = false; c->mod = old_c_mod; - if (((*obj._v__ast__ConstField).expr)._typ == 252 /* v.ast.CallExpr */) { + if (((*obj._v__ast__ConstField).expr)._typ == 253 /* v.ast.CallExpr */) { if ((*(*obj._v__ast__ConstField).expr._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent) { typ = v__ast__Type_clear_flag(typ, v__ast__TypeFlag__optional); } @@ -54942,14 +55013,14 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no node->mod = saved_mod; } if (node->tok_kind == v__token__Kind__assign) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` (use `:=` to declare a variable)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` (use `:=` to declare a variable)"), 0, { .d_c = 0 }}})), node->pos); } else if (string__eq(node->name, _SLIT("errcode"))) { v__checker__Checker_error(c, _SLIT("undefined ident: `errcode`; did you mean `err.code`?"), node->pos); } else { if (c->inside_ct_attr) { - v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`[if "), 0xfe10, {.d_s = node->name}}, {_SLIT("]` is deprecated. Use `[if "), 0xfe10, {.d_s = node->name}}, {_SLIT("?]` instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`[if "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("]` is deprecated. Use `[if "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("?]` instead"), 0, { .d_c = 0 }}})), node->pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (v__ast__Table_known_type(c->table, node->name)) { @@ -54985,7 +55056,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast(v__checker__Checker* c, v__as v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, cur_type); v__ast__Type to_type = (sym->kind == v__ast__Kind__interface_ ? (v__ast__Type_ref(to_type_)) : (to_type_)); v__ast__Expr expr = expr_; - if (expr._typ == 286 /* v.ast.SelectorExpr */) { + if (expr._typ == 287 /* v.ast.SelectorExpr */) { bool is_mut = false; Array_v__ast__Type smartcasts = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); v__ast__TypeSymbol* expr_sym = v__ast__Table_sym(c->table, (*expr._v__ast__SelectorExpr).expr_type); @@ -55027,12 +55098,12 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast(v__checker__Checker* c, v__as c->smartcast_mut_pos = (*expr._v__ast__SelectorExpr).pos; } } - else if (expr._typ == 266 /* v.ast.Ident */) { + else if (expr._typ == 267 /* v.ast.Ident */) { bool is_mut = false; Array_v__ast__Type smartcasts = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); bool is_already_casted = false; int orig_type = 0; - if (((*expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { is_mut = (*(*expr._v__ast__Ident).obj._v__ast__Var).is_mut; _PUSH_MANY(&smartcasts, ((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts), _t7, Array_v__ast__Type); is_already_casted = (*(*expr._v__ast__Ident).obj._v__ast__Var).pos.pos == (*expr._v__ast__Ident).pos.pos; @@ -55079,15 +55150,15 @@ v__ast__Type v__checker__Checker_select_expr(v__checker__Checker* c, v__ast__Sel for (int _t1 = 0; _t1 < node->branches.len; ++_t1) { v__ast__SelectBranch branch = ((v__ast__SelectBranch*)node->branches.data)[_t1]; v__checker__Checker_stmt(c, branch.stmt); - if (branch.stmt._typ == 306 /* v.ast.ExprStmt */) { + if (branch.stmt._typ == 307 /* v.ast.ExprStmt */) { if (branch.is_timeout) { if (!v__ast__Type_is_int((*branch.stmt._v__ast__ExprStmt).typ)) { v__ast__TypeSymbol* tsym = v__ast__Table_sym(c->table, (*branch.stmt._v__ast__ExprStmt).typ); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), 0xfe10, {.d_s = tsym->name}}, {_SLIT("` for timeout - expected integer number of nanoseconds aka `time.Duration`"), 0, { .d_c = 0 }}})), (*branch.stmt._v__ast__ExprStmt).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), /*115 &string*/0xfe10, {.d_s = tsym->name}}, {_SLIT("` for timeout - expected integer number of nanoseconds aka `time.Duration`"), 0, { .d_c = 0 }}})), (*branch.stmt._v__ast__ExprStmt).pos); } } else { - if (((*branch.stmt._v__ast__ExprStmt).expr)._typ == 270 /* v.ast.InfixExpr */) { - if (((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 266 /* v.ast.Ident */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 286 /* v.ast.SelectorExpr */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 269 /* v.ast.IndexExpr */) { + if (((*branch.stmt._v__ast__ExprStmt).expr)._typ == 271 /* v.ast.InfixExpr */) { + if (((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 267 /* v.ast.Ident */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 287 /* v.ast.SelectorExpr */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 270 /* v.ast.IndexExpr */) { v__checker__Checker_error(c, _SLIT("channel in `select` key must be predefined"), v__ast__Expr_pos((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)); } } else { @@ -55095,15 +55166,15 @@ v__ast__Type v__checker__Checker_select_expr(v__checker__Checker* c, v__ast__Sel } } } - else if (branch.stmt._typ == 298 /* v.ast.AssignStmt */) { + else if (branch.stmt._typ == 299 /* v.ast.AssignStmt */) { v__ast__Expr expr = (*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)); - if (expr._typ == 283 /* v.ast.PrefixExpr */) { - if (((*expr._v__ast__PrefixExpr).right)._typ != 266 /* v.ast.Ident */ && ((*expr._v__ast__PrefixExpr).right)._typ != 286 /* v.ast.SelectorExpr */ && ((*expr._v__ast__PrefixExpr).right)._typ != 269 /* v.ast.IndexExpr */) { + if (expr._typ == 284 /* v.ast.PrefixExpr */) { + if (((*expr._v__ast__PrefixExpr).right)._typ != 267 /* v.ast.Ident */ && ((*expr._v__ast__PrefixExpr).right)._typ != 287 /* v.ast.SelectorExpr */ && ((*expr._v__ast__PrefixExpr).right)._typ != 270 /* v.ast.IndexExpr */) { v__checker__Checker_error(c, _SLIT("channel in `select` key must be predefined"), v__ast__Expr_pos((*expr._v__ast__PrefixExpr).right)); } if ((*expr._v__ast__PrefixExpr).or_block.kind != v__ast__OrKind__absent) { string err_prefix = ((*expr._v__ast__PrefixExpr).or_block.kind == v__ast__OrKind__block ? (_SLIT("or block")) : (_SLIT("error propagation"))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = err_prefix}}, {_SLIT(" not allowed in `select` key"), 0, { .d_c = 0 }}})), (*expr._v__ast__PrefixExpr).or_block.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = err_prefix}}, {_SLIT(" not allowed in `select` key"), 0, { .d_c = 0 }}})), (*expr._v__ast__PrefixExpr).or_block.pos); } } @@ -55133,13 +55204,13 @@ v__ast__Type v__checker__Checker_lock_expr(v__checker__Checker* c, v__ast__LockE v__ast__Type e_typ = v__checker__Checker_expr(c, (*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i))); string id_name = v__ast__Expr_str((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i))); if (!v__ast__Type_has_flag(e_typ, v__ast__TypeFlag__shared_f)) { - string obj_type = (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))._typ == 266 /* v.ast.Ident */ ? (_SLIT("variable")) : (_SLIT("struct element"))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = id_name}}, {_SLIT("` must be declared as `shared` "), 0xfe10, {.d_s = obj_type}}, {_SLIT(" to be locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); + string obj_type = (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))._typ == 267 /* v.ast.Ident */ ? (_SLIT("variable")) : (_SLIT("struct element"))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = id_name}}, {_SLIT("` must be declared as `shared` "), /*115 &string*/0xfe10, {.d_s = obj_type}}, {_SLIT(" to be locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); } if (Array_string_contains(c->locked_names, id_name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = id_name}}, {_SLIT("` is already locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = id_name}}, {_SLIT("` is already locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); } else if (Array_string_contains(c->rlocked_names, id_name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = id_name}}, {_SLIT("` is already read-locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = id_name}}, {_SLIT("` is already read-locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); } if ((*(bool*)/*ee elem_sym */array_get(node->is_rlock, i))) { array_push((array*)&c->rlocked_names, _MOV((string[]){ string_clone(id_name) })); @@ -55153,7 +55224,7 @@ v__ast__Type v__checker__Checker_lock_expr(v__checker__Checker* c, v__ast__LockE v__ast__Type ret_type = _const_v__ast__void_type; if (node->stmts.len > 0) { v__ast__Stmt last_stmt = (*(v__ast__Stmt*)array_last(node->stmts)); - if ((last_stmt)._typ == 306 /* v.ast.ExprStmt */) { + if ((last_stmt)._typ == 307 /* v.ast.ExprStmt */) { ret_type = (*last_stmt._v__ast__ExprStmt).typ; } } @@ -55183,46 +55254,46 @@ VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_definition(v__check return _t2; } else if (ident.kind == (v__ast__IdentKind__global)) { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ident.name}}, {_SLIT(" is a global variable"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ident.name}}, {_SLIT(" is a global variable"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (ident.kind == (v__ast__IdentKind__function)) { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ident.name}}, {_SLIT(" is a function"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ident.name}}, {_SLIT(" is a function"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_v__ast__Expr){0}; } VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_obj_definition(v__checker__Checker* c, v__ast__ScopeObject obj) { string name = _SLIT(""); - if (obj._typ == 324 /* v.ast.Var */) { + if (obj._typ == 325 /* v.ast.Var */) { name = (*obj._v__ast__Var).name; } - else if (obj._typ == 322 /* v.ast.ConstField */) { + else if (obj._typ == 323 /* v.ast.ConstField */) { name = (*obj._v__ast__ConstField).name; } - else if (obj._typ == 323 /* v.ast.GlobalField */) { + else if (obj._typ == 324 /* v.ast.GlobalField */) { name = (*obj._v__ast__GlobalField).name; } - else if (obj._typ == 321 /* v.ast.AsmRegister */) { + else if (obj._typ == 322 /* v.ast.AsmRegister */) { name = (*obj._v__ast__AsmRegister).name; } ; v__ast__Expr expr = v__ast__empty_expr(); - if ((obj)._typ == 324 /* v.ast.Var */) { + if ((obj)._typ == 325 /* v.ast.Var */) { if ((*obj._v__ast__Var).is_mut) { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = name}}, {_SLIT("` is mut and may have changed since its definition"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` is mut and may have changed since its definition"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } expr = (*obj._v__ast__Var).expr; - } else if ((obj)._typ == 322 /* v.ast.ConstField */) { + } else if ((obj)._typ == 323 /* v.ast.ConstField */) { expr = (*obj._v__ast__ConstField).expr; } else { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = name}}, {_SLIT("` is a global variable and is unknown at compile time"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` is a global variable and is unknown at compile time"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - if ((expr)._typ == 266 /* v.ast.Ident */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { Option_v__ast__Expr _t3 = v__checker__Checker_find_definition(c, (*expr._v__ast__Ident)); return _t3; } if (!v__ast__Expr_is_lit(expr)) { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("definition of `"), 0xfe10, {.d_s = name}}, {_SLIT("` is unknown at compile time"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("definition of `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` is unknown at compile time"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_v__ast__Expr _t5; opt_ok(&(v__ast__Expr[]) { expr }, (Option*)(&_t5), sizeof(v__ast__Expr)); @@ -55233,8 +55304,8 @@ VV_LOCAL_SYMBOL Option_bool v__checker__Checker_has_return(v__checker__Checker* bool has_complexity = false; for (int _t1 = 0; _t1 < stmts.len; ++_t1) { v__ast__Stmt s = ((v__ast__Stmt*)stmts.data)[_t1]; - if ((s)._typ == 306 /* v.ast.ExprStmt */) { - if (((*s._v__ast__ExprStmt).expr)._typ == 267 /* v.ast.IfExpr */ || ((*s._v__ast__ExprStmt).expr)._typ == 276 /* v.ast.MatchExpr */) { + if ((s)._typ == 307 /* v.ast.ExprStmt */) { + if (((*s._v__ast__ExprStmt).expr)._typ == 268 /* v.ast.IfExpr */ || ((*s._v__ast__ExprStmt).expr)._typ == 277 /* v.ast.MatchExpr */) { has_complexity = true; break; } @@ -55257,18 +55328,18 @@ v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__Po } if (!(v__ast__TypeSymbol_is_number(typ_sym) || ((c->inside_unsafe || c->pref->translated) && is_non_void_pointer))) { 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: "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" (non-numeric type `"), 0xfe10, {.d_s = typ_str}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); + 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_115935 = v__checker__Checker_fail_if_immutable(c, node->expr); - node->auto_locked = mr_115935.arg0; + multi_return_string_v__token__Pos mr_117098 = v__checker__Checker_fail_if_immutable(c, node->expr); + node->auto_locked = mr_117098.arg0; } v__ast__Type _t1 = typ; return _t1; } void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr* node, bool as_interface) { - if (node->_typ == 266 /* v.ast.Ident */) { - if (((*node->_v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if (node->_typ == 267 /* v.ast.Ident */) { + if (((*node->_v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { v__ast__Var* obj = &(*(*node->_v__ast__Ident).obj._v__ast__Var); if (c->fn_scope != ((voidptr)(0))) { Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(c->fn_scope, (*(*node->_v__ast__Ident).obj._v__ast__Var).name); @@ -55284,15 +55355,15 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, v__ast__Type_set_nr_muls(obj->typ, 0)); if (obj->is_stack_obj && !v__ast__TypeSymbol_is_heap(type_sym) && !c->pref->translated && !c->file->is_translated) { - string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); + string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); string mischief = (as_interface ? (_SLIT("used as interface object")) : (_SLIT("referenced"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*node->_v__ast__Ident).name}}, {_SLIT("` cannot be "), 0xfe10, {.d_s = mischief}}, {_SLIT(" outside `unsafe` blocks as it might be stored on stack. Consider "), 0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*node->_v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*node->_v__ast__Ident).name}}, {_SLIT("` cannot be "), /*115 &string*/0xfe10, {.d_s = mischief}}, {_SLIT(" outside `unsafe` blocks as it might be stored on stack. Consider "), /*115 &string*/0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*node->_v__ast__Ident).pos); } else if (type_sym->kind == v__ast__Kind__array_fixed) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot reference fixed array `"), 0xfe10, {.d_s = (*node->_v__ast__Ident).name}}, {_SLIT("` outside `unsafe` blocks as it is supposed to be stored on stack"), 0, { .d_c = 0 }}})), (*node->_v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot reference fixed array `"), /*115 &string*/0xfe10, {.d_s = (*node->_v__ast__Ident).name}}, {_SLIT("` outside `unsafe` blocks as it is supposed to be stored on stack"), 0, { .d_c = 0 }}})), (*node->_v__ast__Ident).pos); } else { if (type_sym->kind == (v__ast__Kind__struct_)) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (!info.is_heap) { (*(*node->_v__ast__Ident).obj._v__ast__Var).is_auto_heap = true; } @@ -55303,12 +55374,12 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } } } - else if (node->_typ == 286 /* v.ast.SelectorExpr */) { + else if (node->_typ == 287 /* v.ast.SelectorExpr */) { if (!v__ast__Type_is_ptr((*node->_v__ast__SelectorExpr).expr_type)) { v__checker__Checker_mark_as_referenced(c, &(*node->_v__ast__SelectorExpr).expr, as_interface); } } - else if (node->_typ == 269 /* v.ast.IndexExpr */) { + else if (node->_typ == 270 /* v.ast.IndexExpr */) { v__checker__Checker_mark_as_referenced(c, &(*node->_v__ast__IndexExpr).left, as_interface); } @@ -55318,15 +55389,15 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } string v__checker__Checker_get_base_name(v__checker__Checker* c, v__ast__Expr* node) { - if (node->_typ == 266 /* v.ast.Ident */) { + if (node->_typ == 267 /* v.ast.Ident */) { string _t1 = (*node->_v__ast__Ident).name; return _t1; } - else if (node->_typ == 286 /* v.ast.SelectorExpr */) { + else if (node->_typ == 287 /* v.ast.SelectorExpr */) { string _t2 = v__checker__Checker_get_base_name(c, &(*node->_v__ast__SelectorExpr).expr); return _t2; } - else if (node->_typ == 269 /* v.ast.IndexExpr */) { + else if (node->_typ == 270 /* v.ast.IndexExpr */) { string _t3 = v__checker__Checker_get_base_name(c, &(*node->_v__ast__IndexExpr).left); return _t3; } @@ -55346,7 +55417,7 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre c->inside_ref_lit = old_inside_ref_lit; node->right_type = right_type; if (node->op == v__token__Kind__amp) { - if ((node->right)._typ == 283 /* v.ast.PrefixExpr */) { + if ((node->right)._typ == 284 /* v.ast.PrefixExpr */) { if ((*node->right._v__ast__PrefixExpr).op == v__token__Kind__amp) { v__checker__Checker_error(c, _SLIT("unexpected `&`, expecting expression"), (*node->right._v__ast__PrefixExpr).pos); } @@ -55355,19 +55426,19 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre if (node->op == v__token__Kind__amp && !v__ast__Type_is_ptr(right_type)) { v__ast__Expr expr = node->right; for (;;) { - if (!((expr)._typ == 281 /* v.ast.ParExpr */)) break; + if (!((expr)._typ == 282 /* v.ast.ParExpr */)) break; expr = (*expr._v__ast__ParExpr).expr; } - if ((expr)._typ == 250 /* v.ast.BoolLiteral */ || (expr)._typ == 252 /* v.ast.CallExpr */ || (expr)._typ == 255 /* v.ast.CharLiteral */ || (expr)._typ == 264 /* v.ast.FloatLiteral */ || (expr)._typ == 271 /* v.ast.IntegerLiteral */ || (expr)._typ == 270 /* v.ast.InfixExpr */ || (expr)._typ == 290 /* v.ast.StringLiteral */ || (expr)._typ == 289 /* v.ast.StringInterLiteral */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot take the address of "), 0xfe10, {.d_s = v__ast__Expr_str(expr)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + if ((expr)._typ == 251 /* v.ast.BoolLiteral */ || (expr)._typ == 253 /* v.ast.CallExpr */ || (expr)._typ == 256 /* v.ast.CharLiteral */ || (expr)._typ == 265 /* v.ast.FloatLiteral */ || (expr)._typ == 272 /* v.ast.IntegerLiteral */ || (expr)._typ == 271 /* v.ast.InfixExpr */ || (expr)._typ == 291 /* v.ast.StringLiteral */ || (expr)._typ == 290 /* v.ast.StringInterLiteral */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot take the address of "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(expr)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } - if ((node->right)._typ == 269 /* v.ast.IndexExpr */) { + if ((node->right)._typ == 270 /* v.ast.IndexExpr */) { v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, (*node->right._v__ast__IndexExpr).left_type); bool is_mut = false; - if (((*node->right._v__ast__IndexExpr).left)._typ == 266 /* v.ast.Ident */) { + if (((*node->right._v__ast__IndexExpr).left)._typ == 267 /* v.ast.Ident */) { v__ast__Ident ident = (*(*node->right._v__ast__IndexExpr).left._v__ast__Ident); v__ast__ScopeObject ident_obj = ident.obj; - if ((ident_obj)._typ == 324 /* v.ast.Var */) { + if ((ident_obj)._typ == 325 /* v.ast.Var */) { is_mut = (*ident_obj._v__ast__Var).is_mut; } } @@ -55385,7 +55456,7 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre } v__ast__Type _t1 = v__ast__Type_ref(right_type); return _t1; - } else if (node->op == v__token__Kind__amp && (node->right)._typ != 253 /* v.ast.CastExpr */) { + } else if (node->op == v__token__Kind__amp && (node->right)._typ != 254 /* v.ast.CastExpr */) { if (!c->inside_fn_arg && !c->inside_unsafe) { v__checker__Checker_mark_as_referenced(c, &node->right, false); } @@ -55404,7 +55475,7 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre } if (!v__ast__Type_is_pointer(right_type) && !c->pref->translated && !c->file->is_translated) { string s = v__ast__Table_type_to_str(c->table, right_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid indirect of `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid indirect of `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (node->op == v__token__Kind__bit_not && !v__ast__Type_is_int(right_type) && !c->pref->translated && !c->file->is_translated) { @@ -55432,24 +55503,24 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre VV_LOCAL_SYMBOL void v__checker__Checker_check_index(v__checker__Checker* c, v__ast__TypeSymbol* typ_sym, v__ast__Expr index, v__ast__Type index_type, v__token__Pos pos, bool range_index, bool is_gated) { v__ast__TypeSymbol* index_type_sym = v__ast__Table_sym(c->table, index_type); if (typ_sym->kind == v__ast__Kind__array || typ_sym->kind == v__ast__Kind__array_fixed || typ_sym->kind == v__ast__Kind__string) { - if (!(v__ast__Type_is_int(index_type) || index_type_sym->kind == v__ast__Kind__enum_ || (index_type_sym->kind == v__ast__Kind__alias && v__ast__Type_is_int((/* as */ *(v__ast__Alias*)__as_cast((index_type_sym->info)._v__ast__Alias,(index_type_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type)))) { - string type_str = (typ_sym->kind == v__ast__Kind__string ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-integer string index `"), 0xfe10, {.d_s = index_type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("non-integer index `"), 0xfe10, {.d_s = index_type_sym->name}}, {_SLIT("` (array type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + if (!(v__ast__Type_is_int(index_type) || index_type_sym->kind == v__ast__Kind__enum_ || (index_type_sym->kind == v__ast__Kind__alias && v__ast__Type_is_int((/* as */ *(v__ast__Alias*)__as_cast((index_type_sym->info)._v__ast__Alias,(index_type_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type)))) { + string type_str = (typ_sym->kind == v__ast__Kind__string ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-integer string index `"), /*115 &string*/0xfe10, {.d_s = index_type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("non-integer index `"), /*115 &string*/0xfe10, {.d_s = index_type_sym->name}}, {_SLIT("` (array type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); } - if ((index)._typ == 271 /* v.ast.IntegerLiteral */ && !is_gated) { + if ((index)._typ == 272 /* v.ast.IntegerLiteral */ && !is_gated) { if (string_at((*index._v__ast__IntegerLiteral).val, 0) == '-') { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("negative index `"), 0xfe10, {.d_s = (*index._v__ast__IntegerLiteral).val}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*index._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("negative index `"), /*115 &string*/0xfe10, {.d_s = (*index._v__ast__IntegerLiteral).val}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*index._v__ast__IntegerLiteral).pos); } else if (typ_sym->kind == v__ast__Kind__array_fixed) { int i = string_int((*index._v__ast__IntegerLiteral).val); - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((typ_sym->info)._v__ast__ArrayFixed,(typ_sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((typ_sym->info)._v__ast__ArrayFixed,(typ_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; if ((!range_index && i >= info.size) || (range_index && i > info.size)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("index out of range (index: "), 0xfe07, {.d_i32 = i}}, {_SLIT(", len: "), 0xfe07, {.d_i32 = info.size}}, {_SLIT(")"), 0, { .d_c = 0 }}})), (*index._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("index out of range (index: "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", len: "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(")"), 0, { .d_c = 0 }}})), (*index._v__ast__IntegerLiteral).pos); } } } if (v__ast__Type_has_flag(index_type, v__ast__TypeFlag__optional)) { - string type_str = (typ_sym->kind == v__ast__Kind__string ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("(type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("(array type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use optional as index "), 0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + string type_str = (typ_sym->kind == v__ast__Kind__string ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("(type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("(array type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use optional as index "), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); } } } @@ -55466,7 +55537,7 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde } else if (typ_sym->kind == (v__ast__Kind__array)) { node->is_array = true; - if (node->or_expr.kind != v__ast__OrKind__absent && (node->index)._typ == 284 /* v.ast.RangeExpr */) { + if (node->or_expr.kind != v__ast__OrKind__absent && (node->index)._typ == 285 /* v.ast.RangeExpr */) { v__checker__Checker_error(c, _SLIT("custom error handling on range expressions for arrays is not supported yet."), node->or_expr.pos); } break; @@ -55483,7 +55554,7 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde if (v__ast__Type_is_ptr(typ)) { continue; } else { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("generic type "), 0xfe10, {.d_s = gname}}, {_SLIT(" does not support indexing, pass an array, or a reference instead, e.g. []"), 0xfe10, {.d_s = gname}}, {_SLIT(" or &"), 0xfe10, {.d_s = gname}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("generic type "), /*115 &string*/0xfe10, {.d_s = gname}}, {_SLIT(" does not support indexing, pass an array, or a reference instead, e.g. []"), /*115 &string*/0xfe10, {.d_s = gname}}, {_SLIT(" or &"), /*115 &string*/0xfe10, {.d_s = gname}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } } else { @@ -55491,29 +55562,29 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde }; } if (!(typ_sym->kind == v__ast__Kind__array || typ_sym->kind == v__ast__Kind__array_fixed || typ_sym->kind == v__ast__Kind__string || typ_sym->kind == v__ast__Kind__map) && !v__ast__Type_is_ptr(typ) && !(v__ast__Type_alias_eq(typ, _const_v__ast__byteptr_type) || v__ast__Type_alias_eq(typ, _const_v__ast__charptr_type)) && !v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not support indexing"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not support indexing"), 0, { .d_c = 0 }}})), node->pos); } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__optional)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `?"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` is optional, it does not support indexing"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `?"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` is optional, it does not support indexing"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); } if (typ_sym->kind == v__ast__Kind__string && !v__ast__Type_is_ptr(typ) && node->is_setter) { v__checker__Checker_error(c, _SLIT("cannot assign to s[i] since V strings are immutable\n(note, that variables may be mutable but string values are always immutable, like in Go and Java)"), node->pos); } if ((v__ast__Type_is_ptr(typ) && !v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f) && !v__ast__Expr_is_auto_deref_var(node->left)) || v__ast__Type_is_pointer(typ)) { bool is_ok = false; - if ((node->left)._typ == 266 /* v.ast.Ident */) { - if (((*node->left._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((node->left)._typ == 267 /* v.ast.Ident */) { + if (((*node->left._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { is_ok = (*(*node->left._v__ast__Ident).obj._v__ast__Var).is_mut && (*(*node->left._v__ast__Ident).obj._v__ast__Var).is_arg && !v__ast__Type_is_ptr(v__ast__Type_deref(typ)); } } - if (!is_ok && (node->index)._typ == 284 /* v.ast.RangeExpr */) { + if (!is_ok && (node->index)._typ == 285 /* v.ast.RangeExpr */) { string s = v__ast__Table_type_to_str(c->table, typ); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = s}}, {_SLIT("` does not support slicing"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("` does not support slicing"), 0, { .d_c = 0 }}})), node->pos); } else if (!c->inside_unsafe && !is_ok && !c->pref->translated && !c->file->is_translated) { v__checker__Checker_warn(c, _SLIT("pointer indexing is only allowed in `unsafe` blocks"), node->pos); } } - if ((node->index)._typ == 284 /* v.ast.RangeExpr */) { + if ((node->index)._typ == 285 /* v.ast.RangeExpr */) { if ((*node->index._v__ast__RangeExpr).has_low) { v__ast__Type index_type = v__checker__Checker_expr(c, (*node->index._v__ast__RangeExpr).low); v__checker__Checker_check_index(c, typ_sym, (*node->index._v__ast__RangeExpr).low, index_type, node->pos, true, node->is_gated); @@ -55531,12 +55602,12 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde } } else { if (typ_sym->kind == v__ast__Kind__map) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((typ_sym->info)._v__ast__Map,(typ_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((typ_sym->info)._v__ast__Map,(typ_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; c->expected_type = info.key_type; v__ast__Type index_type = v__checker__Checker_expr(c, node->index); if (!v__checker__Checker_check_types(c, index_type, info.key_type)) { string err = v__checker__Checker_expected_msg(c, index_type, info.key_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid key: "), 0xfe10, {.d_s = err}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid key: "), /*115 &string*/0xfe10, {.d_s = err}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } v__ast__TypeSymbol* value_sym = v__ast__Table_sym(c->table, info.value_type); if (!node->is_setter && value_sym->kind == v__ast__Kind__sum_type && node->or_expr.kind == v__ast__OrKind__absent && !c->inside_unsafe && !c->inside_if_guard) { @@ -55563,16 +55634,16 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde v__ast__Type v__checker__Checker_enum_val(v__checker__Checker* c, v__ast__EnumVal* node) { int typ_idx = ((node->enum_name).len == 0 ? ((v__ast__Type_alias_eq(c->expected_type, _const_v__ast__void_type) && !v__ast__Type_alias_eq(c->expected_expr_type, _const_v__ast__void_type) ? (v__ast__Type_idx(c->expected_expr_type)) : (v__ast__Type_idx(c->expected_type)))) : (v__ast__Table_find_type_idx(c->table, node->enum_name))); if (typ_idx == 0) { - if (string_starts_with(node->enum_name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0, { .d_c = 0 }}})))) { - typ_idx = v__ast__Table_find_type_idx(c->table, string_substr(node->enum_name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0, { .d_c = 0 }}})).len, (node->enum_name).len)); + if (string_starts_with(node->enum_name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0, { .d_c = 0 }}})))) { + typ_idx = v__ast__Table_find_type_idx(c->table, string_substr(node->enum_name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0, { .d_c = 0 }}})).len, (node->enum_name).len)); if (typ_idx == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enum `"), 0xfe10, {.d_s = node->enum_name}}, {_SLIT("` (type_idx=0)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enum `"), /*115 &string*/0xfe10, {.d_s = node->enum_name}}, {_SLIT("` (type_idx=0)"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t1 = _const_v__ast__void_type; return _t1; } } if (typ_idx == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enum `"), 0xfe10, {.d_s = node->enum_name}}, {_SLIT("` (type_idx=0)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enum `"), /*115 &string*/0xfe10, {.d_s = node->enum_name}}, {_SLIT("` (type_idx=0)"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t2 = _const_v__ast__void_type; return _t2; } @@ -55590,28 +55661,28 @@ v__ast__Type v__checker__Checker_enum_val(v__checker__Checker* c, v__ast__EnumVa } v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, typ); if (typ_sym->kind == v__ast__Kind__array && node->enum_name.len == 0) { - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((typ_sym->info)._v__ast__Array,(typ_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((typ_sym->info)._v__ast__Array,(typ_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; typ = array_info.elem_type; typ_sym = v__ast__Table_sym(c->table, typ); } v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(c->table, typ); if (fsym->kind != v__ast__Kind__enum_ && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected type is not an enum (`"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected type is not an enum (`"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t5 = _const_v__ast__void_type; return _t5; } - if ((fsym->info)._typ != 445 /* v.ast.Enum */) { + if ((fsym->info)._typ != 446 /* v.ast.Enum */) { v__checker__Checker_error(c, _SLIT("not an enum"), node->pos); v__ast__Type _t6 = _const_v__ast__void_type; return _t6; } if (!(typ_sym->is_pub || string__eq(typ_sym->mod, c->mod))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } v__ast__Enum info = v__ast__TypeSymbol_enum_info(typ_sym); if (!Array_string_contains(info.vals, node->val)) { v__util__Suggestion suggestion = v__util__new_suggestion(node->val, info.vals); - v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(3, _MOV((StrIntpData[]){{_SLIT("enum `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not have a value `"), 0xfe10, {.d_s = node->val}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), node->pos); + v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(3, _MOV((StrIntpData[]){{_SLIT("enum `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not have a value `"), /*115 &string*/0xfe10, {.d_s = node->val}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), node->pos); } node->typ = typ; v__ast__Type _t7 = typ; @@ -55643,7 +55714,7 @@ v__ast__Type v__checker__Checker_offset_of(v__checker__Checker* c, v__ast__Offse return _t1; } if (!v__ast__Table_struct_has_field(c->table, sym, node.field)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` has no field called `"), 0xfe10, {.d_s = node.field}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has no field called `"), /*115 &string*/0xfe10, {.d_s = node.field}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); } v__ast__Type _t2 = _const_v__ast__u32_type; return _t2; @@ -55651,21 +55722,21 @@ v__ast__Type v__checker__Checker_offset_of(v__checker__Checker* c, v__ast__Offse void v__checker__Checker_check_dup_keys(v__checker__Checker* c, v__ast__MapInit* node, int i) { v__ast__Expr key_i = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->keys, i)); - if ((key_i)._typ == 290 /* v.ast.StringLiteral */) { + if ((key_i)._typ == 291 /* v.ast.StringLiteral */) { for (int j = 0; j < i; ++j) { v__ast__Expr key_j = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->keys, j)); - if ((key_j)._typ == 290 /* v.ast.StringLiteral */) { + if ((key_j)._typ == 291 /* v.ast.StringLiteral */) { if (string__eq((*key_i._v__ast__StringLiteral).val, (*key_j._v__ast__StringLiteral).val)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate key \""), 0xfe10, {.d_s = (*key_i._v__ast__StringLiteral).val}}, {_SLIT("\" in map literal"), 0, { .d_c = 0 }}})), (*key_i._v__ast__StringLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate key \""), /*115 &string*/0xfe10, {.d_s = (*key_i._v__ast__StringLiteral).val}}, {_SLIT("\" in map literal"), 0, { .d_c = 0 }}})), (*key_i._v__ast__StringLiteral).pos); } } } - } else if ((key_i)._typ == 271 /* v.ast.IntegerLiteral */) { + } else if ((key_i)._typ == 272 /* v.ast.IntegerLiteral */) { for (int j = 0; j < i; ++j) { v__ast__Expr key_j = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->keys, j)); - if ((key_j)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((key_j)._typ == 272 /* v.ast.IntegerLiteral */) { if (string__eq((*key_i._v__ast__IntegerLiteral).val, (*key_j._v__ast__IntegerLiteral).val)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate key \""), 0xfe10, {.d_s = (*key_i._v__ast__IntegerLiteral).val}}, {_SLIT("\" in map literal"), 0, { .d_c = 0 }}})), (*key_i._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate key \""), /*115 &string*/0xfe10, {.d_s = (*key_i._v__ast__IntegerLiteral).val}}, {_SLIT("\" in map literal"), 0, { .d_c = 0 }}})), (*key_i._v__ast__IntegerLiteral).pos); } } } @@ -55684,7 +55755,7 @@ void v__checker__Checker_warn(v__checker__Checker* c, string s, v__token__Pos po void v__checker__Checker_error(v__checker__Checker* c, string message, v__token__Pos pos) { #if defined(CUSTOM_DEFINE_checker_exit_on_first_error) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n\n>> checker error: "), 0xfe10, {.d_s = message}}, {_SLIT(", pos: "), 0xfe10, {.d_s = v__token__Pos_str(pos)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n\n>> checker error: "), /*115 &string*/0xfe10, {.d_s = message}}, {_SLIT(", pos: "), /*115 &v.token.Pos*/0xfe10, {.d_s = v__token__Pos_str(pos)}}, {_SLIT0, 0, { .d_c = 0 }}}))); print_backtrace(); _v_exit(1); VUNREACHABLE(); @@ -55812,7 +55883,7 @@ VV_LOCAL_SYMBOL string v__checker__Checker_fetch_field_name(v__checker__Checker* } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, field.typ); if (sym->kind == v__ast__Kind__struct_ && !string__eq(sym->name, _SLIT("time.Time"))) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("_id"), 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("_id"), 0, { .d_c = 0 }}})); } string _t2 = name; return _t2; @@ -55820,7 +55891,7 @@ VV_LOCAL_SYMBOL string v__checker__Checker_fetch_field_name(v__checker__Checker* VV_LOCAL_SYMBOL void v__checker__Checker_trace(v__checker__Checker* c, string fbase, string message) { if (string__eq(c->file->path_base, fbase)) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> c.trace | "), 0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), 0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> c.trace | "), /*115 &string*/0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -55834,7 +55905,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C case v__ast__Kind__placeholder: { if (sym->language == v__ast__Language__v && !string_starts_with(sym->name, _SLIT("C."))) { - v__checker__Checker_error(c, v__util__Suggestion_say(v__util__new_suggestion(sym->name, v__ast__Table_known_type_names(c->table)), str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), pos); + v__checker__Checker_error(c, v__util__Suggestion_say(v__util__new_suggestion(sym->name, v__ast__Table_known_type_names(c->table)), str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), pos); return (Option_void){0}; } break; @@ -55843,7 +55914,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C case v__ast__Kind__float_literal: { if (!c->is_builtin_mod) { - string msg = (sym->kind == v__ast__Kind__int_literal ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`.\nDid you mean `int`?"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`.\nDid you mean `f64`?"), 0, { .d_c = 0 }}})))); + string msg = (sym->kind == v__ast__Kind__int_literal ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`.\nDid you mean `int`?"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`.\nDid you mean `f64`?"), 0, { .d_c = 0 }}})))); v__checker__Checker_error(c, msg, pos); return (Option_void){0}; } @@ -55851,7 +55922,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } case v__ast__Kind__array: { - Option_void _t1 = v__checker__Checker_ensure_type_exists(c, (/* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ).elem_type, pos); + Option_void _t1 = v__checker__Checker_ensure_type_exists(c, (/* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ).elem_type, pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { Option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); @@ -55863,7 +55934,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } case v__ast__Kind__array_fixed: { - Option_void _t3 = v__checker__Checker_ensure_type_exists(c, (/* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ).elem_type, pos); + Option_void _t3 = v__checker__Checker_ensure_type_exists(c, (/* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ).elem_type, pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { Option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); @@ -55875,7 +55946,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } case v__ast__Kind__map: { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; Option_void _t5 = v__checker__Checker_ensure_type_exists(c, info.key_type, pos); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { Option_void _t6; @@ -55896,7 +55967,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } case v__ast__Kind__sum_type: { - v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ; for (int _t9 = 0; _t9 < info.concrete_types.len; ++_t9) { v__ast__Type concrete_typ = ((v__ast__Type*)info.concrete_types.data)[_t9]; Option_void _t10 = v__checker__Checker_ensure_type_exists(c, concrete_typ, pos); @@ -55953,43 +56024,43 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr expr, v__ast__Type typ, string what) { v__token__Pos pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); - if (expr._typ == 266 /* v.ast.Ident */) { + if (expr._typ == 267 /* v.ast.Ident */) { if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { if (!Array_string_contains(c->rlocked_names, (*expr._v__ast__Ident).name) && !Array_string_contains(c->locked_names, (*expr._v__ast__Ident).name)) { string action = (string__eq(what, _SLIT("argument")) ? (_SLIT("passed")) : (_SLIT("used"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("` is `shared` and must be `rlock`ed or `lock`ed to be "), 0xfe10, {.d_s = action}}, {_SLIT(" as non-mut "), 0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("` is `shared` and must be `rlock`ed or `lock`ed to be "), /*115 &string*/0xfe10, {.d_s = action}}, {_SLIT(" as non-mut "), /*115 &string*/0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } } return; } - else if (expr._typ == 286 /* v.ast.SelectorExpr */) { + else if (expr._typ == 287 /* v.ast.SelectorExpr */) { pos = (*expr._v__ast__SelectorExpr).pos; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - string expr_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr)}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string expr_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!Array_string_contains(c->rlocked_names, expr_name) && !Array_string_contains(c->locked_names, expr_name)) { string action = (string__eq(what, _SLIT("argument")) ? (_SLIT("passed")) : (_SLIT("used"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = expr_name}}, {_SLIT("` is `shared` and must be `rlock`ed or `lock`ed to be "), 0xfe10, {.d_s = action}}, {_SLIT(" as non-mut "), 0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = expr_name}}, {_SLIT("` is `shared` and must be `rlock`ed or `lock`ed to be "), /*115 &string*/0xfe10, {.d_s = action}}, {_SLIT(" as non-mut "), /*115 &string*/0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); } return; } else { v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__SelectorExpr).expr, (*expr._v__ast__SelectorExpr).expr_type, what); } } - else if (expr._typ == 252 /* v.ast.CallExpr */) { + else if (expr._typ == 253 /* v.ast.CallExpr */) { pos = (*expr._v__ast__CallExpr).pos; if ((*expr._v__ast__CallExpr).is_method) { v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__CallExpr).left, (*expr._v__ast__CallExpr).left_type, what); } return; } - else if (expr._typ == 274 /* v.ast.LockExpr */) { + else if (expr._typ == 275 /* v.ast.LockExpr */) { return; } - else if (expr._typ == 269 /* v.ast.IndexExpr */) { + else if (expr._typ == 270 /* v.ast.IndexExpr */) { pos = v__token__Pos_extend(v__ast__Expr_pos((*expr._v__ast__IndexExpr).left), (*expr._v__ast__IndexExpr).pos); v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__IndexExpr).left, (*expr._v__ast__IndexExpr).left_type, what); } - else if (expr._typ == 270 /* v.ast.InfixExpr */) { + else if (expr._typ == 271 /* v.ast.InfixExpr */) { pos = v__token__Pos_extend(v__ast__Expr_pos((*expr._v__ast__InfixExpr).left), (*expr._v__ast__InfixExpr).pos); v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__InfixExpr).left, (*expr._v__ast__InfixExpr).left_type, what); v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__InfixExpr).right, (*expr._v__ast__InfixExpr).right_type, what); @@ -56000,14 +56071,14 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr } ; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("you have to create a handle and `rlock` it to use a `shared` element as non-mut "), 0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("you have to create a handle and `rlock` it to use a `shared` element as non-mut "), /*115 &string*/0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); } } 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->is_env) { - Option_string _t1 = v__util__resolve_env_value( str_intp(2, _MOV((StrIntpData[]){{_SLIT("$env('"), 0xfe10, {.d_s = node->args_var}}, {_SLIT("')"), 0, { .d_c = 0 }}})), false); + Option_string _t1 = v__util__resolve_env_value( str_intp(2, _MOV((StrIntpData[]){{_SLIT("$env('"), /*115 &string*/0xfe10, {.d_s = node->args_var}}, {_SLIT("')"), 0, { .d_c = 0 }}})), false); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->env_pos); @@ -56029,11 +56100,11 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check for (int _t5 = 0; _t5 < _t4_len; ++_t5) { string it = ((string*) _t4_orig.data)[_t5]; - string ti = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = it}}, {_SLIT0, 0, { .d_c = 0 }}})); + string ti = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = it}}, {_SLIT0, 0, { .d_c = 0 }}})); array_push((array*)&_t4, &ti); } string supported = Array_string_join(_t4, _SLIT(", ")); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("not supported compression type: ."), 0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(". supported: "), 0xfe10, {.d_s = supported}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("not supported compression type: ."), /*115 &string*/0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(". supported: "), /*115 &string*/0xfe10, {.d_s = supported}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } v__ast__Type _t6 = v__ast__Table_find_type_idx(c->table, _SLIT("v.embed_file.EmbedFileData")); return _t6; @@ -56074,7 +56145,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check Option_v__ast__Var_ptr _t13 = v__ast__Scope_find_var(node->scope, node->method_name); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown identifier `"), 0xfe10, {.d_s = node->method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown identifier `"), /*115 &string*/0xfe10, {.d_s = node->method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); v__ast__Type _t14 = _const_v__ast__void_type; return _t14; } @@ -56082,12 +56153,12 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check v__ast__Var* v = (*(v__ast__Var**)_t13.data); if (!v__ast__Type_alias_eq(v->typ, _const_v__ast__string_type)) { string s = v__checker__Checker_expected_msg(c, v->typ, _const_v__ast__string_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid string method call: "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}})), node->method_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid string method call: "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}})), node->method_pos); v__ast__Type _t15 = _const_v__ast__void_type; return _t15; } string method_name = _SLIT(""); - if ((v->expr)._typ == 290 /* v.ast.StringLiteral */) { + if ((v->expr)._typ == 291 /* v.ast.StringLiteral */) { method_name = (*v->expr._v__ast__StringLiteral).val; } else { v__checker__Checker_error(c, _SLIT("todo: not a string literal"), node->method_pos); @@ -56096,7 +56167,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check Option_v__ast__Fn _t16 = v__ast__TypeSymbol_find_method(left_sym, method_name); if (_t16.state != 0) { /*or block*/ IError err = _t16.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not find method `"), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not find method `"), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); v__ast__Type _t17 = _const_v__ast__void_type; return _t17; } @@ -56111,11 +56182,11 @@ VV_LOCAL_SYMBOL void v__checker__Checker_comptime_for(v__checker__Checker* c, v_ v__ast__Type typ = v__checker__Checker_unwrap_generic(c, node.typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, typ); if (sym->kind == v__ast__Kind__placeholder || v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.typ_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.typ_pos); } if (node.kind == v__ast__ComptimeForKind__fields) { if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; c->inside_comptime_for_field = true; for (int _t1 = 0; _t1 < sym_info.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)sym_info.fields.data)[_t1]; @@ -56134,22 +56205,22 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp if (nlevel > 100) { return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - if (expr._typ == 281 /* v.ast.ParExpr */) { + if (expr._typ == 282 /* v.ast.ParExpr */) { Option_v__ast__ComptTimeConstValue _t2 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__ParExpr).expr, nlevel + 1); return _t2; } - else if (expr._typ == 287 /* v.ast.SizeOf */) { + else if (expr._typ == 288 /* v.ast.SizeOf */) { Option_v__ast__ComptTimeConstValue _t3; opt_ok(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(ADDR(int, (v__ast__Table_type_size(c->table, (*expr._v__ast__SizeOf).typ)))) }, (Option*)(&_t3), sizeof(v__ast__ComptTimeConstValue)); return _t3; } - else if (expr._typ == 264 /* v.ast.FloatLiteral */) { + else if (expr._typ == 265 /* v.ast.FloatLiteral */) { f64 x = string_f64((*expr._v__ast__FloatLiteral).val); Option_v__ast__ComptTimeConstValue _t4; opt_ok(&(v__ast__ComptTimeConstValue[]) { f64_to_sumtype_v__ast__ComptTimeConstValue(&x) }, (Option*)(&_t4), sizeof(v__ast__ComptTimeConstValue)); return _t4; } - else if (expr._typ == 271 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { u64 x = string_u64((*expr._v__ast__IntegerLiteral).val); if (x > 9223372036854775807U) { Option_v__ast__ComptTimeConstValue _t5; @@ -56160,12 +56231,12 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (string_i64((*expr._v__ast__IntegerLiteral).val)))) }, (Option*)(&_t6), sizeof(v__ast__ComptTimeConstValue)); return _t6; } - else if (expr._typ == 290 /* v.ast.StringLiteral */) { + else if (expr._typ == 291 /* v.ast.StringLiteral */) { Option_v__ast__ComptTimeConstValue _t7; opt_ok(&(v__ast__ComptTimeConstValue[]) { string_to_sumtype_v__ast__ComptTimeConstValue(ADDR(string, (v__util__smart_quote((*expr._v__ast__StringLiteral).val, (*expr._v__ast__StringLiteral).is_raw)))) }, (Option*)(&_t7), sizeof(v__ast__ComptTimeConstValue)); return _t7; } - else if (expr._typ == 255 /* v.ast.CharLiteral */) { + else if (expr._typ == 256 /* v.ast.CharLiteral */) { Array_rune runes = string_runes((*expr._v__ast__CharLiteral).val); if (runes.len > 0) { Option_v__ast__ComptTimeConstValue _t8; @@ -56174,13 +56245,13 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp } return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - else if (expr._typ == 266 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 322 /* v.ast.ConstField */) { + else if (expr._typ == 267 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 323 /* v.ast.ConstField */) { Option_v__ast__ComptTimeConstValue _t10 = v__checker__Checker_eval_comptime_const_expr(c, (*(*expr._v__ast__Ident).obj._v__ast__ConstField).expr, nlevel + 1); return _t10; } } - else if (expr._typ == 253 /* v.ast.CastExpr */) { + else if (expr._typ == 254 /* v.ast.CastExpr */) { Option_v__ast__ComptTimeConstValue _t11 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__CastExpr).expr, nlevel + 1); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; @@ -56299,7 +56370,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp return _t40; } } - else if (expr._typ == 270 /* v.ast.InfixExpr */) { + else if (expr._typ == 271 /* v.ast.InfixExpr */) { Option_v__ast__ComptTimeConstValue _t43 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__InfixExpr).left, nlevel + 1); if (_t43.state != 0) { /*or block*/ Option_v__ast__ComptTimeConstValue _t44; @@ -57298,7 +57369,7 @@ VV_LOCAL_SYMBOL multi_return_bool_int_int v__checker__Checker_verify_vweb_params v__ast__Param param = ((v__ast__Param*)_t2.data)[_t4]; v__ast__TypeSymbol* param_sym = v__ast__Table_final_sym(c->table, param.typ); if (!(v__ast__TypeSymbol_is_string(param_sym) || v__ast__TypeSymbol_is_number(param_sym) || v__ast__TypeSymbol_is_float(param_sym) || param_sym->kind == v__ast__Kind__bool)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid type `"), 0xfe10, {.d_s = param_sym->name}}, {_SLIT("` for parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` in vweb app method `"), 0xfe10, {.d_s = node.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), param.pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid type `"), /*115 &string*/0xfe10, {.d_s = param_sym->name}}, {_SLIT("` for parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` in vweb app method `"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), param.pos); } } } @@ -57336,7 +57407,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_verify_all_vweb_routes(v__checker__Chec } if (f->return_type == typ_vweb_result && v__ast__Type_alias_eq(f->receiver.typ, (*(v__ast__Param*)/*ee elem_sym */array_get(m.params, 0)).typ) && string__eq(f->name, m.name) && !Array_v__ast__Attr_contains(f->attrs, _SLIT("post"))) { v__checker__Checker_change_current_file(c, f->source_file); - v__checker__Checker_warn(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("mismatched parameters count between vweb method `"), 0xfe10, {.d_s = sym_app->name}}, {_SLIT("."), 0xfe10, {.d_s = m.name}}, {_SLIT("` ("), 0xfe07, {.d_i32 = nargs}}, {_SLIT(") and route attribute "), 0xfe10, {.d_s = Array_v__ast__Attr_str(m.attrs)}}, {_SLIT(" ("), 0xfe07, {.d_i32 = nroute_attributes}}, {_SLIT(")"), 0, { .d_c = 0 }}})), f->pos); + v__checker__Checker_warn(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("mismatched parameters count between vweb method `"), /*115 &string*/0xfe10, {.d_s = sym_app->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = m.name}}, {_SLIT("` ("), /*100 &int*/0xfe07, {.d_i32 = nargs}}, {_SLIT(") and route attribute "), /*115 &[]v.ast.Attr*/0xfe10, {.d_s = Array_v__ast__Attr_str(m.attrs)}}, {_SLIT(" ("), /*100 &int*/0xfe07, {.d_i32 = nroute_attributes}}, {_SLIT(")"), 0, { .d_c = 0 }}})), f->pos); } } } @@ -57350,7 +57421,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__ bool _t1 = node->ct_skip; return _t1; } - if ((node->ct_expr)._typ == 266 /* v.ast.Ident */) { + if ((node->ct_expr)._typ == 267 /* v.ast.Ident */) { if (node->ct_opt) { if (Array_string_contains(_const_v__checker__valid_comptime_not_user_defined, (*node->ct_expr._v__ast__Ident).name)) { v__checker__Checker_error(c, _SLIT("optional `[if expression ?]` tags, can be used only for user defined identifiers"), node->pos); @@ -57363,7 +57434,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__ return _t2; } else { if (!Array_string_contains(_const_v__checker__valid_comptime_not_user_defined, (*node->ct_expr._v__ast__Ident).name)) { - v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`[if "), 0xfe10, {.d_s = (*node->ct_expr._v__ast__Ident).name}}, {_SLIT("]` is deprecated. Use `[if "), 0xfe10, {.d_s = (*node->ct_expr._v__ast__Ident).name}}, {_SLIT(" ?]` instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`[if "), /*115 &string*/0xfe10, {.d_s = (*node->ct_expr._v__ast__Ident).name}}, {_SLIT("]` is deprecated. Use `[if "), /*115 &string*/0xfe10, {.d_s = (*node->ct_expr._v__ast__Ident).name}}, {_SLIT(" ?]` instead"), 0, { .d_c = 0 }}})), node->pos); node->ct_skip = !Array_string_contains(c->pref->compile_defines, (*node->ct_expr._v__ast__Ident).name); node->ct_evaled = true; bool _t3 = node->ct_skip; @@ -57387,32 +57458,32 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__ } VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* c, v__ast__Expr cond, v__token__Pos pos) { - if (cond._typ == 250 /* v.ast.BoolLiteral */) { + if (cond._typ == 251 /* v.ast.BoolLiteral */) { bool _t1 = !(*cond._v__ast__BoolLiteral).val; return _t1; } - else if (cond._typ == 281 /* v.ast.ParExpr */) { + else if (cond._typ == 282 /* v.ast.ParExpr */) { bool _t2 = v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__ParExpr).expr, pos); return _t2; } - else if (cond._typ == 283 /* v.ast.PrefixExpr */) { + else if (cond._typ == 284 /* v.ast.PrefixExpr */) { if ((*cond._v__ast__PrefixExpr).op != v__token__Kind__not) { v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__PrefixExpr).pos); } bool _t3 = !v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__PrefixExpr).right, (*cond._v__ast__PrefixExpr).pos); return _t3; } - else if (cond._typ == 282 /* v.ast.PostfixExpr */) { + else if (cond._typ == 283 /* v.ast.PostfixExpr */) { if ((*cond._v__ast__PostfixExpr).op != v__token__Kind__question) { v__checker__Checker_error(c, _SLIT("invalid $if postfix operator"), (*cond._v__ast__PostfixExpr).pos); - } else if (((*cond._v__ast__PostfixExpr).expr)._typ == 266 /* v.ast.Ident */) { + } else if (((*cond._v__ast__PostfixExpr).expr)._typ == 267 /* v.ast.Ident */) { bool _t4 = !Array_string_contains(c->pref->compile_defines_all, (*(*cond._v__ast__PostfixExpr).expr._v__ast__Ident).name); return _t4; } else { v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__PostfixExpr).pos); } } - else if (cond._typ == 270 /* v.ast.InfixExpr */) { + else if (cond._typ == 271 /* v.ast.InfixExpr */) { if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__and)) { bool l = v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__InfixExpr).left, (*cond._v__ast__InfixExpr).pos); @@ -57427,19 +57498,19 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* return _t6; } else if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__key_is) || (*cond._v__ast__InfixExpr).op == (v__token__Kind__not_is)) { - if (((*cond._v__ast__InfixExpr).left)._typ == 292 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 292 /* v.ast.TypeNode */) { + if (((*cond._v__ast__InfixExpr).left)._typ == 293 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 293 /* v.ast.TypeNode */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*(*cond._v__ast__InfixExpr).right._v__ast__TypeNode).typ); if (sym->kind != v__ast__Kind__interface_) { v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).left); } bool _t7 = false; return _t7; - } else if (((*cond._v__ast__InfixExpr).left)._typ == 292 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 259 /* v.ast.ComptimeType */) { - v__ast__TypeNode left = /* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).left)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).left)._typ, 292) /*expected idx: 292, name: v.ast.TypeNode */ ; + } else if (((*cond._v__ast__InfixExpr).left)._typ == 293 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 260 /* v.ast.ComptimeType */) { + v__ast__TypeNode left = /* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).left)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).left)._typ, 293) /*expected idx: 293, name: v.ast.TypeNode */ ; v__ast__Type checked_type = v__checker__Checker_unwrap_generic(c, left.typ); bool _t8 = v__ast__Table_is_comptime_type(c->table, checked_type, (*(*cond._v__ast__InfixExpr).right._v__ast__ComptimeType)); return _t8; - } else if (((*cond._v__ast__InfixExpr).left)._typ == 286 /* v.ast.SelectorExpr */ || ((*cond._v__ast__InfixExpr).left)._typ == 292 /* v.ast.TypeNode */) { + } else if (((*cond._v__ast__InfixExpr).left)._typ == 287 /* v.ast.SelectorExpr */ || ((*cond._v__ast__InfixExpr).left)._typ == 293 /* v.ast.TypeNode */) { v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).left); bool _t9 = false; return _t9; @@ -57448,8 +57519,8 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* } } else if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__eq) || (*cond._v__ast__InfixExpr).op == (v__token__Kind__ne)) { - if (((*cond._v__ast__InfixExpr).left)._typ == 286 /* v.ast.SelectorExpr */ && ((*cond._v__ast__InfixExpr).right)._typ == 271 /* v.ast.IntegerLiteral */) { - } else if (((*cond._v__ast__InfixExpr).left)._typ == 266 /* v.ast.Ident */) { + if (((*cond._v__ast__InfixExpr).left)._typ == 287 /* v.ast.SelectorExpr */ && ((*cond._v__ast__InfixExpr).right)._typ == 272 /* v.ast.IntegerLiteral */) { + } else if (((*cond._v__ast__InfixExpr).left)._typ == 267 /* v.ast.Ident */) { v__ast__Type left_type = v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).left); v__ast__Type right_type = v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).right); Option_v__ast__Expr _t10 = v__checker__Checker_find_definition(c, (*(*cond._v__ast__InfixExpr).left._v__ast__Ident)); @@ -57464,20 +57535,20 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* if (!v__checker__Checker_check_types(c, right_type, left_type)) { string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*cond._v__ast__InfixExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*cond._v__ast__InfixExpr).pos); } bool different = !string__eq(v__ast__Expr_str(expr), v__ast__Expr_str((*cond._v__ast__InfixExpr).right)); bool _t12 = ((*cond._v__ast__InfixExpr).op == v__token__Kind__eq ? (different) : (!different)); return _t12; } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid `$if` condition: "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( ((*cond._v__ast__InfixExpr).left)._typ ))}}, {_SLIT("1"), 0, { .d_c = 0 }}})), (*cond._v__ast__InfixExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid `$if` condition: "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( ((*cond._v__ast__InfixExpr).left)._typ ))}}, {_SLIT("1"), 0, { .d_c = 0 }}})), (*cond._v__ast__InfixExpr).pos); } } else { v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__InfixExpr).pos); }; } - else if (cond._typ == 266 /* v.ast.Ident */) { + else if (cond._typ == 267 /* v.ast.Ident */) { string cname = (*cond._v__ast__Ident).name; if (Array_string_contains(_const_v__checker__valid_comptime_if_os, cname)) { bool is_os_target_different = false; @@ -57590,9 +57661,9 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* return _t36; } v__ast__Type typ = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, cond)); - if (((*cond._v__ast__Ident).obj)._typ != 324 /* v.ast.Var */ && ((*cond._v__ast__Ident).obj)._typ != 322 /* v.ast.ConstField */ && ((*cond._v__ast__Ident).obj)._typ != 323 /* v.ast.GlobalField */) { + if (((*cond._v__ast__Ident).obj)._typ != 325 /* v.ast.Var */ && ((*cond._v__ast__Ident).obj)._typ != 323 /* v.ast.ConstField */ && ((*cond._v__ast__Ident).obj)._typ != 324 /* v.ast.GlobalField */) { if (!c->inside_ct_attr) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown var: `"), 0xfe10, {.d_s = cname}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown var: `"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } bool _t37 = false; return _t37; @@ -57608,13 +57679,13 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* v__ast__Expr expr = (*(v__ast__Expr*)_t38.data); if (!v__checker__Checker_check_types(c, typ, _const_v__ast__bool_type)) { string type_name = v__ast__Table_type_to_str(c->table, typ); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-bool type `"), 0xfe10, {.d_s = type_name}}, {_SLIT("` used as $if condition"), 0, { .d_c = 0 }}})), (*cond._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-bool type `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("` used as $if condition"), 0, { .d_c = 0 }}})), (*cond._v__ast__Ident).pos); } - bool _t40 = !(/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)._v__ast__BoolLiteral,(expr)._typ, 250) /*expected idx: 250, name: v.ast.BoolLiteral */ ).val; + bool _t40 = !(/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)._v__ast__BoolLiteral,(expr)._typ, 251) /*expected idx: 251, name: v.ast.BoolLiteral */ ).val; return _t40; } } - else if (cond._typ == 257 /* v.ast.ComptimeCall */) { + else if (cond._typ == 258 /* v.ast.ComptimeCall */) { if ((*cond._v__ast__ComptimeCall).is_pkgconfig) { Option_v__pkgconfig__Main_ptr _t41 = v__pkgconfig__main(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){string_clone((*cond._v__ast__ComptimeCall).args_var)}))); if (_t41.state != 0) { /*or block*/ @@ -57650,7 +57721,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra if (node->elem_type != 0) { v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, node->elem_type); if (elem_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct elem_info = /* as */ *(v__ast__Struct*)__as_cast((elem_sym->info)._v__ast__Struct,(elem_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct elem_info = /* as */ *(v__ast__Struct*)__as_cast((elem_sym->info)._v__ast__Struct,(elem_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (elem_info.generic_types.len > 0 && elem_info.concrete_types.len == 0 && !v__ast__Type_has_flag(node->elem_type, v__ast__TypeFlag__generic)) { if (c->table->cur_concrete_types.len == 0) { v__checker__Checker_error(c, _SLIT("generic struct must specify type parameter, e.g. Foo"), node->elem_type_pos); @@ -57783,7 +57854,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra c->expected_type = elem_type; continue; } - if ((expr)->_typ != 292 /* v.ast.TypeNode */) { + if ((expr)->_typ != 293 /* v.ast.TypeNode */) { if (v__ast__Table_type_kind(c->table, elem_type) == v__ast__Kind__interface_) { if (v__checker__Checker_type_implements(c, typ, elem_type, v__ast__Expr_pos(/*rec*/*expr))) { continue; @@ -57792,7 +57863,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra Option_void _t8 = v__checker__Checker_check_expected(c, typ, elem_type); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { IError err = _t8.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid array element: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid array element: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*expr)); ; } @@ -57819,11 +57890,11 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra i64 fixed_size = ((i64)(0)); v__ast__Expr init_expr = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, 0)); v__checker__Checker_expr(c, init_expr); - if (init_expr._typ == 271 /* v.ast.IntegerLiteral */) { + if (init_expr._typ == 272 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*init_expr._v__ast__IntegerLiteral).val); } - else if (init_expr._typ == 266 /* v.ast.Ident */) { - if (((*init_expr._v__ast__Ident).obj)._typ == 322 /* v.ast.ConstField */) { + else if (init_expr._typ == 267 /* v.ast.Ident */) { + if (((*init_expr._v__ast__Ident).obj)._typ == 323 /* v.ast.ConstField */) { Option_v__ast__ComptTimeConstValue _t9; if (_t9 = v__checker__Checker_eval_comptime_const_expr(c, (*(*init_expr._v__ast__Ident).obj._v__ast__ConstField).expr, 0), _t9.state == 0) { v__ast__ComptTimeConstValue comptime_value = *(v__ast__ComptTimeConstValue*)_t9.data; @@ -57836,10 +57907,10 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra fixed_size = (*(i64*)_t10.data); } } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-constant array bound `"), 0xfe10, {.d_s = (*init_expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*init_expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-constant array bound `"), /*115 &string*/0xfe10, {.d_s = (*init_expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*init_expr._v__ast__Ident).pos); } } - else if (init_expr._typ == 270 /* v.ast.InfixExpr */) { + else if (init_expr._typ == 271 /* v.ast.InfixExpr */) { Option_v__ast__ComptTimeConstValue _t11; if (_t11 = v__checker__Checker_eval_comptime_const_expr(c, init_expr, 0), _t11.state == 0) { v__ast__ComptTimeConstValue comptime_value = *(v__ast__ComptTimeConstValue*)_t11.data; @@ -57858,7 +57929,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra } ; if (fixed_size <= 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("fixed size cannot be zero or negative (fixed_size: "), 0xfe09, {.d_i64 = fixed_size}}, {_SLIT(")"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(init_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("fixed size cannot be zero or negative (fixed_size: "), /*100 &i64*/0xfe09, {.d_i64 = fixed_size}}, {_SLIT(")"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(init_expr)); } int idx = v__ast__Table_find_or_register_array_fixed(c->table, node->elem_type, ((int)(fixed_size)), init_expr); if (v__ast__Type_has_flag(node->elem_type, v__ast__TypeFlag__generic)) { @@ -57877,7 +57948,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra VV_LOCAL_SYMBOL void v__checker__Checker_check_array_init_para_type(v__checker__Checker* c, string para, v__ast__Expr expr, v__token__Pos pos) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__checker__Checker_expr(c, expr)); if (!(sym->kind == v__ast__Kind__int || sym->kind == v__ast__Kind__int_literal)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array "), 0xfe10, {.d_s = para}}, {_SLIT(" needs to be an int"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array "), /*115 &string*/0xfe10, {.d_s = para}}, {_SLIT(" needs to be an int"), 0, { .d_c = 0 }}})), pos); } } @@ -57900,7 +57971,7 @@ v__ast__Type v__checker__Checker_map_init(v__checker__Checker* c, v__ast__MapIni return _t1; } else { if (sym->kind == v__ast__Kind__struct_) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`{}` can not be used for initialising empty structs any more. Use `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, c->expected_type)}}, {_SLIT("{}` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`{}` can not be used for initialising empty structs any more. Use `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, c->expected_type)}}, {_SLIT("{}` instead."), 0, { .d_c = 0 }}})), node->pos); } else { v__checker__Checker_error(c, _SLIT("invalid empty map initialisation syntax, use e.g. map[string]int{} instead"), node->pos); } @@ -57913,12 +57984,12 @@ v__ast__Type v__checker__Checker_map_init(v__checker__Checker* c, v__ast__MapIni if (info.value_type != 0) { v__ast__TypeSymbol* val_sym = v__ast__Table_sym(c->table, info.value_type); if (val_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct val_info = /* as */ *(v__ast__Struct*)__as_cast((val_sym->info)._v__ast__Struct,(val_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct val_info = /* as */ *(v__ast__Struct*)__as_cast((val_sym->info)._v__ast__Struct,(val_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (val_info.generic_types.len > 0 && val_info.concrete_types.len == 0 && !v__ast__Type_has_flag(info.value_type, v__ast__TypeFlag__generic)) { if (c->table->cur_concrete_types.len == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("generic struct `"), 0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("generic struct `"), /*115 &string*/0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("generic struct `"), 0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("generic struct `"), /*115 &string*/0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -57974,12 +58045,12 @@ v__ast__Type v__checker__Checker_map_init(v__checker__Checker* c, v__ast__MapIni array_push((array*)&node->val_types, _MOV((v__ast__Type[]){ val_type })); if (!v__checker__Checker_check_types(c, key_type, key0_type) || (i == 0 && v__ast__Type_is_number(key_type) && v__ast__Type_is_number(key0_type) && !v__ast__Type_alias_eq(key0_type, v__ast__mktyp(key_type)))) { string msg = v__checker__Checker_expected_msg(c, key_type, key0_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid map key: "), 0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(key)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid map key: "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(key)); same_key_type = false; } if (!v__checker__Checker_check_types(c, val_type, val0_type) || (i == 0 && v__ast__Type_is_number(val_type) && v__ast__Type_is_number(val0_type) && !v__ast__Type_alias_eq(val0_type, v__ast__mktyp(val_type)))) { string msg = v__checker__Checker_expected_msg(c, val_type, val0_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid map value: "), 0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(val)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid map value: "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(val)); } } if (same_key_type) { @@ -58012,7 +58083,7 @@ v__ast__Scope* prev_fn_scope; #if defined(CUSTOM_DEFINE_trace_post_process_generic_fns_types) { if (node->generic_names.len > 0) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(">>> post processing node.name: "), 0x3cfe10, {.d_s = node->name}}, {_SLIT(" | "), 0xfe10, {.d_s = Array_string_str(node->generic_names)}}, {_SLIT(" <=> "), 0xfe10, {.d_s = Array_v__ast__Type_str(c->table->cur_concrete_types)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(">>> post processing node.name: "), /*115 &string*/0x3cfe10, {.d_s = node->name}}, {_SLIT(" | "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(node->generic_names)}}, {_SLIT(" <=> "), /*115 &[]v.ast.Type*/0xfe10, {.d_s = Array_v__ast__Type_str(c->table->cur_concrete_types)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } #endif @@ -58055,7 +58126,7 @@ v__ast__Scope* prev_fn_scope; if (node->language == v__ast__Language__v && !c->is_builtin_mod && !node->is_anon) { v__checker__Checker_check_valid_snake_case(c, node->name, _SLIT("function name"), node->pos); if (!node->is_method && string__eq(node->mod, _SLIT("main")) && _IN_MAP(ADDR(string, node->short_name), ADDR(map, c->table->builtin_pub_fns))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot redefine builtin public function `"), 0xfe10, {.d_s = node->short_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot redefine builtin public function `"), /*115 &string*/0xfe10, {.d_s = node->short_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (string__eq(node->name, _SLIT("main.main"))) { @@ -58066,18 +58137,18 @@ v__ast__Scope* prev_fn_scope; if (_t3 = Array_v__ast__Attr_find_comptime_define(node->attrs), _t3.state == 0) { int ct_attr_idx = *(int*)_t3.data; string sexpr = v__ast__Expr_str((*(v__ast__Attr*)/*ee elem_sym */array_get(node->attrs, ct_attr_idx)).ct_expr); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only functions that do NOT return values can have `[if "), 0xfe10, {.d_s = sexpr}}, {_SLIT("]` tags"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only functions that do NOT return values can have `[if "), /*115 &string*/0xfe10, {.d_s = sexpr}}, {_SLIT("]` tags"), 0, { .d_c = 0 }}})), node->pos); } if (node->generic_names.len > 0) { v__ast__TypeSymbol* gs = v__ast__Table_sym(c->table, node->return_type); - if ((gs->info)._typ == 416 /* v.ast.Struct */) { + if ((gs->info)._typ == 417 /* v.ast.Struct */) { if ((*gs->info._v__ast__Struct).is_generic && !v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__generic)) { v__checker__Checker_error(c, _SLIT("return generic struct in fn declaration must specify the generic type names, e.g. Foo"), node->return_type_pos); } } } v__ast__TypeSymbol* return_sym = v__ast__Table_sym(c->table, node->return_type); - if ((return_sym->info)._typ == 442 /* v.ast.MultiReturn */) { + if ((return_sym->info)._typ == 443 /* v.ast.MultiReturn */) { for (int _t4 = 0; _t4 < (*return_sym->info._v__ast__MultiReturn).types.len; ++_t4) { v__ast__Type multi_type = ((v__ast__Type*)(*return_sym->info._v__ast__MultiReturn).types.data)[_t4]; v__ast__TypeSymbol* multi_sym = v__ast__Table_sym(c->table, multi_type); @@ -58112,7 +58183,7 @@ v__ast__Scope* prev_fn_scope; v__checker__Checker_error(c, _SLIT("cannot define method on multi-value"), node->method_type_pos); } if (sym->name.len == 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->receiver_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->receiver_pos); // Defer begin if (v__checker__Checker_fn_decl_defer_0) { c->stmt_level = prev_stmt_level; @@ -58128,19 +58199,19 @@ v__ast__Scope* prev_fn_scope; return; } if (sym->kind == v__ast__Kind__interface_ && v__ast__TypeSymbol_has_method(sym, node->name)) { - if ((sym->info)._typ == 434 /* v.ast.Interface */) { + if ((sym->info)._typ == 435 /* v.ast.Interface */) { if (v__ast__Interface_has_method(&(*sym->info._v__ast__Interface), node->name)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` cannot implement its own interface method `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` cannot implement its own interface method `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { Option_v__ast__StructField _t6; if (_t6 = v__ast__Table_find_field(c->table, sym, node->name), _t6.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t6.data; v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, field.typ); if (field_sym->kind == v__ast__Kind__function) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` has both field and method named `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has both field and method named `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (string__eq(node->name, _SLIT("free"))) { @@ -58149,7 +58220,7 @@ v__ast__Scope* prev_fn_scope; } if (!v__ast__Type_is_ptr(node->receiver.typ)) { string tname = string_after_char(sym->name, '.'); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`.free()` methods should be defined on either a `(mut x &"), 0xfe10, {.d_s = tname}}, {_SLIT(")`, or a `(x &"), 0xfe10, {.d_s = tname}}, {_SLIT(")` receiver"), 0, { .d_c = 0 }}})), node->receiver_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`.free()` methods should be defined on either a `(mut x &"), /*115 &string*/0xfe10, {.d_s = tname}}, {_SLIT(")`, or a `(x &"), /*115 &string*/0xfe10, {.d_s = tname}}, {_SLIT(")` receiver"), 0, { .d_c = 0 }}})), node->receiver_pos); } if (node->params.len != 1) { v__checker__Checker_error(c, _SLIT("`.free()` methods should have 0 arguments"), node->pos); @@ -58159,7 +58230,7 @@ v__ast__Scope* prev_fn_scope; if (node->method_idx < sym->methods.len) { (*(v__ast__Fn*)/*ee elem_sym */array_get(sym->methods, node->method_idx)).source_fn = ((voidptr)(node)); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method index: "), 0xfe07, {.d_i32 = node->method_idx}}, {_SLIT(" >= sym.methods.len: "), 0xfe07, {.d_i32 = sym->methods.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method index: "), /*100 &int*/0xfe07, {.d_i32 = node->method_idx}}, {_SLIT(" >= sym.methods.len: "), /*100 &int*/0xfe07, {.d_i32 = sym->methods.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } } if (node->language == v__ast__Language__v) { @@ -58185,7 +58256,7 @@ v__ast__Scope* prev_fn_scope; ; if (Array_string_contains(_const_v__checker__reserved_type_names, param->name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), 0xfe10, {.d_s = param->name}}, {_SLIT("` as a parameter name"), 0, { .d_c = 0 }}})), param->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = param->name}}, {_SLIT("` as a parameter name"), 0, { .d_c = 0 }}})), param->pos); } if (v__ast__Type_has_flag(param->typ, v__ast__TypeFlag__optional)) { v__checker__Checker_error(c, _SLIT("optional type argument is not supported currently"), param->type_pos); @@ -58193,7 +58264,7 @@ v__ast__Scope* prev_fn_scope; if (!v__ast__Type_is_ptr(param->typ)) { v__ast__TypeSymbol* arg_typ_sym = v__ast__Table_sym(c->table, param->typ); if (arg_typ_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((arg_typ_sym->info)._v__ast__Struct,(arg_typ_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((arg_typ_sym->info)._v__ast__Struct,(arg_typ_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (info.is_heap) { Option_v__ast__Var_ptr _t9 = v__ast__Scope_find_var(node->scope, param->name); if (_t9.state != 0) { /*or block*/ @@ -58208,12 +58279,12 @@ v__ast__Scope* prev_fn_scope; v__checker__Checker_error(c, _SLIT("generic struct in fn declaration must specify the generic type names, e.g. Foo"), param->type_pos); } } else if (arg_typ_sym->kind == v__ast__Kind__interface_) { - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((arg_typ_sym->info)._v__ast__Interface,(arg_typ_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((arg_typ_sym->info)._v__ast__Interface,(arg_typ_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; if (info.generic_types.len > 0 && !v__ast__Type_has_flag(param->typ, v__ast__TypeFlag__generic) && info.concrete_types.len == 0) { v__checker__Checker_error(c, _SLIT("generic interface in fn declaration must specify the generic type names, e.g. Foo"), param->type_pos); } } else if (arg_typ_sym->kind == v__ast__Kind__sum_type) { - v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((arg_typ_sym->info)._v__ast__SumType,(arg_typ_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((arg_typ_sym->info)._v__ast__SumType,(arg_typ_sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ; if (info.generic_types.len > 0 && !v__ast__Type_has_flag(param->typ, v__ast__TypeFlag__generic) && info.concrete_types.len == 0) { v__checker__Checker_error(c, _SLIT("generic sumtype in fn declaration must specify the generic type names, e.g. Foo"), param->type_pos); } @@ -58276,11 +58347,11 @@ v__ast__Scope* prev_fn_scope; } else if ((*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 1)).is_mut) { v__checker__Checker_error(c, _SLIT("argument cannot be `mut` for operator overloading"), node->pos); } else if (!v__checker__Checker_check_same_type_ignoring_pointers(c, node->receiver.typ, (*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 1)).typ)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = receiver_sym->name}}, {_SLIT("` not `"), 0xfe10, {.d_s = param_sym->name}}, {_SLIT("` - both operands must be the same type for operator overloading"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 1)).type_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = receiver_sym->name}}, {_SLIT("` not `"), /*115 &string*/0xfe10, {.d_s = param_sym->name}}, {_SLIT("` - both operands must be the same type for operator overloading"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 1)).type_pos); } else if ((string__eq(node->name, _SLIT("<")) || string__eq(node->name, _SLIT("=="))) && !v__ast__Type_alias_eq(node->return_type, _const_v__ast__bool_type)) { v__checker__Checker_error(c, _SLIT("operator comparison methods should return `bool`"), node->pos); } else if (v__ast__TypeSymbol_is_primitive(parent_sym)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot define operator methods on type alias for `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot define operator methods on type alias for `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -58290,7 +58361,7 @@ v__ast__Scope* prev_fn_scope; if (!c->pref->is_test) { for (int _t11 = 0; _t11 < node->stmts.len; ++_t11) { v__ast__Stmt st = ((v__ast__Stmt*)node->stmts.data)[_t11]; - if ((st)._typ == 297 /* v.ast.AssertStmt */) { + if ((st)._typ == 298 /* v.ast.AssertStmt */) { v__checker__Checker_warn(c, _SLIT("tests will not be run, because filename does not end with `_test.v`"), node->pos); break; } @@ -58305,7 +58376,13 @@ v__ast__Scope* prev_fn_scope; } c->expected_type = _const_v__ast__void_type; c->table->cur_fn = node; - if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__optional) && (node->stmts.len == 0 || ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 317 /* v.ast.Return */)) { + if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__optional) && (node->stmts.len == 0 || ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 318 /* v.ast.Return */)) { + v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->return_type); + if (sym->kind == v__ast__Kind__void) { + array_push((array*)&node->stmts, _MOV((v__ast__Stmt[]){ v__ast__Return_to_sumtype_v__ast__Stmt(ADDR(v__ast__Return, (((v__ast__Return){.pos = node->pos,.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.types = __new_array(0, 0, sizeof(v__ast__Type)),})))) })); + } + } + if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__result) && (node->stmts.len == 0 || ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 318 /* v.ast.Return */)) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->return_type); if (sym->kind == v__ast__Kind__void) { array_push((array*)&node->stmts, _MOV((v__ast__Stmt[]){ v__ast__Return_to_sumtype_v__ast__Stmt(ADDR(v__ast__Return, (((v__ast__Return){.pos = node->pos,.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.types = __new_array(0, 0, sizeof(v__ast__Type)),})))) })); @@ -58320,7 +58397,7 @@ v__ast__Scope* prev_fn_scope; if (c->inside_anon_fn) { v__checker__Checker_error(c, _SLIT("missing return at the end of an anonymous function"), node->pos); } else if (!Array_v__ast__Attr_contains(node->attrs, _SLIT("_naked"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("missing return at end of function `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("missing return at end of function `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } node->source_file = c->file; @@ -58369,14 +58446,14 @@ bool keep_inside_anon; Option_v__ast__Var_ptr _t3 = v__ast__Scope_find_var(node->decl.scope->parent, var->name); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected checker error: cannot find parent of inherited variable `"), 0xfe10, {.d_s = var->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected checker error: cannot find parent of inherited variable `"), /*115 &string*/0xfe10, {.d_s = var->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } v__ast__Var* parent_var = (*(v__ast__Var**)_t3.data); if (var->is_mut && !parent_var->is_mut) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("original `"), 0xfe10, {.d_s = parent_var->name}}, {_SLIT("` is immutable, declare it with `mut` to make it mutable"), 0, { .d_c = 0 }}})), var->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("original `"), /*115 &string*/0xfe10, {.d_s = parent_var->name}}, {_SLIT("` is immutable, declare it with `mut` to make it mutable"), 0, { .d_c = 0 }}})), var->pos); } var->typ = parent_var->typ; } @@ -58409,21 +58486,21 @@ v__ast__Type v__checker__Checker_call_expr(v__checker__Checker* c, v__ast__CallE if (!v__ast__Type_alias_eq(arg.typ, _const_v__ast__string_type)) { continue; } - if ((arg.expr)._typ == 266 /* v.ast.Ident */ || (arg.expr)._typ == 290 /* v.ast.StringLiteral */ || (arg.expr)._typ == 286 /* v.ast.SelectorExpr */) { + if ((arg.expr)._typ == 267 /* v.ast.Ident */ || (arg.expr)._typ == 291 /* v.ast.StringLiteral */ || (arg.expr)._typ == 287 /* v.ast.SelectorExpr */) { continue; } (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, i)).is_tmp_autofree = true; } - if (v__ast__Type_alias_eq(node->receiver_type, _const_v__ast__string_type) && !((node->left)._typ == 266 /* v.ast.Ident */ || (node->left)._typ == 290 /* v.ast.StringLiteral */ || (node->left)._typ == 286 /* v.ast.SelectorExpr */)) { + if (v__ast__Type_alias_eq(node->receiver_type, _const_v__ast__string_type) && !((node->left)._typ == 267 /* v.ast.Ident */ || (node->left)._typ == 291 /* v.ast.StringLiteral */ || (node->left)._typ == 287 /* v.ast.SelectorExpr */)) { node->free_receiver = true; } } c->expected_or_type = v__ast__Type_clear_flag(node->return_type, v__ast__TypeFlag__optional); v__checker__Checker_stmts_ending_with_expression(c, node->or_block.stmts); c->expected_or_type = _const_v__ast__void_type; - if (node->or_block.kind == v__ast__OrKind__propagate && !v__ast__Type_has_flag(c->table->cur_fn->return_type, v__ast__TypeFlag__optional) && !c->inside_const) { + if (node->or_block.kind == v__ast__OrKind__propagate_option && !v__ast__Type_has_flag(c->table->cur_fn->return_type, v__ast__TypeFlag__optional) && !c->inside_const) { if (!c->table->cur_fn->is_main) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the optional call, `"), 0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an optional"), 0, { .d_c = 0 }}})), node->or_block.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the optional call, `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an optional"), 0, { .d_c = 0 }}})), node->or_block.pos); } } v__ast__Type _t2 = typ; @@ -58473,12 +58550,12 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__Type typ = v__checker__Checker_expr(c, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr); v__ast__TypeSymbol* tsym = v__ast__Table_sym(c->table, typ); if (!string_starts_with(tsym->name, _SLIT("Promise<"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS.await: first argument must be a promise, got `"), 0xfe10, {.d_s = tsym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS.await: first argument must be a promise, got `"), /*115 &string*/0xfe10, {.d_s = tsym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t5 = _const_v__ast__void_type; return _t5; } c->table->cur_fn->has_await = true; - if (tsym->info._typ == 416 /* v.ast.Struct */) { + if (tsym->info._typ == 417 /* v.ast.Struct */) { v__ast__Type ret_type = (*(v__ast__Type*)/*ee elem_sym */array_get((*tsym->info._v__ast__Struct).concrete_types, 0)); ret_type = v__ast__Type_set_flag(ret_type, v__ast__TypeFlag__optional); node->return_type = ret_type; @@ -58503,14 +58580,14 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp return _t8; } v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr; - if ((expr)._typ == 292 /* v.ast.TypeNode */) { + if ((expr)._typ == 293 /* v.ast.TypeNode */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*expr._v__ast__TypeNode).typ); if (!v__ast__Table_known_type(c->table, sym->name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else { string typ = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ )); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: first argument needs to be a type, got `"), 0xfe10, {.d_s = typ}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: first argument needs to be a type, got `"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t9 = _const_v__ast__void_type; return _t9; } @@ -58519,7 +58596,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp if (!v__ast__Type_alias_eq((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 1)).typ, _const_v__ast__string_type)) { v__checker__Checker_error(c, _SLIT("json.decode: second argument needs to be a string"), node->pos); } - v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast((expr)._v__ast__TypeNode,(expr)._typ, 292) /*expected idx: 292, name: v.ast.TypeNode */ ; + v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast((expr)._v__ast__TypeNode,(expr)._typ, 293) /*expected idx: 293, name: v.ast.TypeNode */ ; v__ast__Type ret_type = v__ast__Type_set_flag(typ.typ, v__ast__TypeFlag__optional); node->return_type = ret_type; v__ast__Type _t10 = ret_type; @@ -58528,17 +58605,17 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__Fn func = ((v__ast__Fn){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}); bool found = false; bool found_in_args = false; - if ((node->left)._typ == 244 /* v.ast.AnonFn */) { + if ((node->left)._typ == 245 /* v.ast.AnonFn */) { node->name = _SLIT(""); v__checker__Checker_expr(c, node->left); if (!v__ast__Type_alias_eq((*node->left._v__ast__AnonFn).typ, ((v__ast__Type)(0)))) { v__ast__TypeSymbol* anon_fn_sym = v__ast__Table_sym(c->table, (*node->left._v__ast__AnonFn).typ); - func = (/* as */ *(v__ast__FnType*)__as_cast((anon_fn_sym->info)._v__ast__FnType,(anon_fn_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ).func; + func = (/* as */ *(v__ast__FnType*)__as_cast((anon_fn_sym->info)._v__ast__FnType,(anon_fn_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ).func; found = true; } } if (!found && !string_contains(fn_name, _SLIT(".")) && !string__eq(node->mod, _SLIT("builtin"))) { - string name_prefixed = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->mod}}, {_SLIT("."), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name_prefixed = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_v__ast__Fn _t11; if (_t11 = v__ast__Table_find_fn(c->table, name_prefixed), _t11.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t11.data; @@ -58548,14 +58625,14 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp (*(v__ast__Fn*)map_get((map*)&c->table->fns, &(string[]){name_prefixed}, &(v__ast__Fn[]){ (v__ast__Fn){.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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,} })).usages++; } } - if (!found && (node->left)._typ == 269 /* v.ast.IndexExpr */) { + if (!found && (node->left)._typ == 270 /* v.ast.IndexExpr */) { v__checker__Checker_expr(c, node->left); - v__ast__IndexExpr expr = /* as */ *(v__ast__IndexExpr*)__as_cast((node->left)._v__ast__IndexExpr,(node->left)._typ, 269) /*expected idx: 269, name: v.ast.IndexExpr */ ; + v__ast__IndexExpr expr = /* as */ *(v__ast__IndexExpr*)__as_cast((node->left)._v__ast__IndexExpr,(node->left)._typ, 270) /*expected idx: 270, name: v.ast.IndexExpr */ ; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, expr.left_type); if (sym->kind == v__ast__Kind__array) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, info.elem_type); - if ((elem_sym->info)._typ == 443 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 444 /* v.ast.FnType */) { node->return_type = (*elem_sym->info._v__ast__FnType).func.return_type; v__ast__Type _t12 = (*elem_sym->info._v__ast__FnType).func.return_type; return _t12; @@ -58563,9 +58640,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("cannot call the element of the array, it is not a function"), node->pos); } } else if (sym->kind == v__ast__Kind__map) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; v__ast__TypeSymbol* value_sym = v__ast__Table_sym(c->table, info.value_type); - if ((value_sym->info)._typ == 443 /* v.ast.FnType */) { + if ((value_sym->info)._typ == 444 /* v.ast.FnType */) { node->return_type = (*value_sym->info._v__ast__FnType).func.return_type; v__ast__Type _t13 = (*value_sym->info._v__ast__FnType).func.return_type; return _t13; @@ -58573,9 +58650,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("cannot call the value of the map, it is not a function"), node->pos); } } else if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, info.elem_type); - if ((elem_sym->info)._typ == 443 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 444 /* v.ast.FnType */) { node->return_type = (*elem_sym->info._v__ast__FnType).func.return_type; v__ast__Type _t14 = (*elem_sym->info._v__ast__FnType).func.return_type; return _t14; @@ -58587,12 +58664,12 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__Type _t15 = _const_v__ast__string_type; return _t15; } - if (!found && (node->left)._typ == 252 /* v.ast.CallExpr */) { + if (!found && (node->left)._typ == 253 /* v.ast.CallExpr */) { v__checker__Checker_expr(c, node->left); - v__ast__CallExpr expr = /* as */ *(v__ast__CallExpr*)__as_cast((node->left)._v__ast__CallExpr,(node->left)._typ, 252) /*expected idx: 252, name: v.ast.CallExpr */ ; + v__ast__CallExpr expr = /* as */ *(v__ast__CallExpr*)__as_cast((node->left)._v__ast__CallExpr,(node->left)._typ, 253) /*expected idx: 253, name: v.ast.CallExpr */ ; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, expr.return_type); if (sym->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; node->return_type = info.func.return_type; found = true; func = info.func; @@ -58617,7 +58694,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } } if (!found && c->pref->is_vsh) { - string os_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("os."), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string os_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("os."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_v__ast__Fn _t17; if (_t17 = v__ast__Table_find_fn(c->table, os_name), _t17.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t17.data; @@ -58640,12 +58717,12 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp Option_v__ast__ScopeObject _t19; if (_t19 = v__ast__Scope_find(node->scope, node->name), _t19.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t19.data; - if (obj._typ == 323 /* v.ast.GlobalField */) { + if (obj._typ == 324 /* v.ast.GlobalField */) { typ = (*obj._v__ast__GlobalField).typ; node->is_fn_var = true; node->fn_var_type = typ; } - else if (obj._typ == 324 /* v.ast.Var */) { + else if (obj._typ == 325 /* v.ast.Var */) { v__ast__Type _t20; /* if prepend */ if ((*obj._v__ast__Var).smartcasts.len != 0) { _t20 = (*(v__ast__Type*)array_last((*obj._v__ast__Var).smartcasts)); @@ -58664,14 +58741,14 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp if (typ != 0) { v__ast__TypeSymbol* generic_vts = v__ast__Table_final_sym(c->table, typ); if (generic_vts->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((generic_vts->info)._v__ast__FnType,(generic_vts->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((generic_vts->info)._v__ast__FnType,(generic_vts->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; func = info.func; found = true; found_in_args = true; } else { v__ast__TypeSymbol* vts = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, typ)); if (vts->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((vts->info)._v__ast__FnType,(vts->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((vts->info)._v__ast__FnType,(vts->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; func = info.func; found = true; found_in_args = true; @@ -58687,7 +58764,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*(obj.typ))); if (sym->kind == v__ast__Kind__function) { found = true; - func = (/* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ).func; + func = (/* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ).func; } } } @@ -58718,12 +58795,12 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } } v__util__Suggestion suggestion = v__util__new_suggestion(fn_name, mod_func_names); - v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown function: "), 0xfe10, {.d_s = fn_name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))), node->pos); + v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown function: "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))), node->pos); v__ast__Type _t28 = _const_v__ast__void_type; return _t28; } } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown function: "), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown function: "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t29 = _const_v__ast__void_type; return _t29; } @@ -58731,17 +58808,17 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp node->is_ctor_new = func.is_ctor_new; if (!found_in_args) { if (v__ast__Scope_known_var(node->scope, fn_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("ambiguous call to: `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`, may refer to fn `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("` or variable `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("ambiguous call to: `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`, may refer to fn `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("` or variable `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (!func.is_pub && func.language == v__ast__Language__v && func.name.len > 0 && func.mod.len > 0 && !string__eq(func.mod, c->mod)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("function `"), 0xfe10, {.d_s = func.name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("function `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } if (!isnil(c->table->cur_fn) && !c->table->cur_fn->is_deprecated && func.is_deprecated) { v__checker__Checker_deprecate_fnmethod(c, _SLIT("function"), func.name, func, *node); } if (func.is_unsafe && !c->inside_unsafe && (func.language != v__ast__Language__c || ((string_at(func.name, 2) == 'm' || string_at(func.name, 2) == 's') && string__eq(func.mod, _SLIT("builtin"))))) { - v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("function `"), 0xfe10, {.d_s = func.name}}, {_SLIT("` must be called from an `unsafe` block"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("function `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("` must be called from an `unsafe` block"), 0, { .d_c = 0 }}})), node->pos); } node->is_keep_alive = func.is_keep_alive; if (!string__eq(func.mod, _SLIT("builtin")) && func.language == v__ast__Language__v && func.no_body && !c->pref->translated && !c->file->is_translated && !func.is_unsafe) { @@ -58749,7 +58826,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } if (node->concrete_types.len > 0 && func.generic_names.len > 0 && node->concrete_types.len != func.generic_names.len) { string plural = (func.generic_names.len == 1 ? (_SLIT("")) : (_SLIT("s"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = func.generic_names.len}}, {_SLIT(" generic parameter"), 0xfe10, {.d_s = plural}}, {_SLIT(", got "), 0xfe07, {.d_i32 = node->concrete_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->concrete_list_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = func.generic_names.len}}, {_SLIT(" generic parameter"), /*115 &string*/0xfe10, {.d_s = plural}}, {_SLIT(", got "), /*100 &int*/0xfe07, {.d_i32 = node->concrete_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->concrete_list_pos); } for (int _t30 = 0; _t30 < node->concrete_types.len; ++_t30) { v__ast__Type concrete_type = ((v__ast__Type*)node->concrete_types.data)[_t30]; @@ -58785,9 +58862,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__CallArg arg = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)); v__checker__Checker_check_expr_opt_call(c, arg.expr, arg.typ); if (v__ast__Type_is_void(arg.typ)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = fn_name}}, {_SLIT("` can not print void expressions"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("` can not print void expressions"), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_alias_eq(arg.typ, _const_v__ast__char_type) && v__ast__Type_nr_muls(arg.typ) == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = fn_name}}, {_SLIT("` cannot print type `char` directly, print its address or cast it to an integer instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("` cannot print type `char` directly, print its address or cast it to an integer instead"), 0, { .d_c = 0 }}})), node->pos); } v__checker__Checker_fail_if_unreadable(c, arg.expr, arg.typ, _SLIT("argument to print")); c->inside_println_arg = false; @@ -58799,7 +58876,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__CallArg arg = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)); (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).typ = v__checker__Checker_expr(c, arg.expr); if (v__ast__Type_alias_eq((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).typ, _const_v__ast__error_type)) { - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`error("), 0xfe10, {.d_s = v__ast__CallArg_str(arg)}}, {_SLIT(")` can be shortened to just `"), 0xfe10, {.d_s = v__ast__CallArg_str(arg)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`error("), /*115 &v.ast.CallArg*/0xfe10, {.d_s = v__ast__CallArg_str(arg)}}, {_SLIT(")` can be shortened to just `"), /*115 &v.ast.CallArg*/0xfe10, {.d_s = v__ast__CallArg_str(arg)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (node->expected_arg_types.len == 0) { @@ -58809,7 +58886,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } } if (!v__pref__Backend_is_js(c->pref->backend) && node->args.len > 0 && func.params.len == 0) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("too many arguments in call to `"), 0xfe10, {.d_s = func.name}}, {_SLIT("` (non-js backend: "), 0xfe10, {.d_s = v__pref__Backend_str(c->pref->backend)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("too many arguments in call to `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("` (non-js backend: "), /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(c->pref->backend)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), node->pos); } for (int i = 0; i < node->args.len; ++i) { v__ast__CallArg* call_arg = ((v__ast__CallArg*)node->args.data) + i; @@ -58817,25 +58894,25 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp continue; } v__ast__Param param = (func.is_variadic && i >= func.params.len - 1 ? ((*(v__ast__Param*)/*ee elem_sym */array_get(func.params, func.params.len - 1))) : ((*(v__ast__Param*)/*ee elem_sym */array_get(func.params, i)))); - if (func.is_variadic && (call_arg->expr)._typ == 245 /* v.ast.ArrayDecompose */) { + if (func.is_variadic && (call_arg->expr)._typ == 246 /* v.ast.ArrayDecompose */) { if (i > func.params.len - 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("too many arguments in call to `"), 0xfe10, {.d_s = func.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("too many arguments in call to `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } c->expected_type = param.typ; v__ast__TypeSymbol* e_sym = v__ast__Table_sym(c->table, c->expected_type); - if ((call_arg->expr)._typ == 275 /* v.ast.MapInit */ && e_sym->kind == v__ast__Kind__struct_) { + if ((call_arg->expr)._typ == 276 /* v.ast.MapInit */ && e_sym->kind == v__ast__Kind__struct_) { v__checker__Checker_error(c, _SLIT("cannot initialize a struct with a map"), call_arg->pos); continue; - } else if ((call_arg->expr)._typ == 291 /* v.ast.StructInit */ && e_sym->kind == v__ast__Kind__map) { + } else if ((call_arg->expr)._typ == 292 /* v.ast.StructInit */ && e_sym->kind == v__ast__Kind__map) { v__checker__Checker_error(c, _SLIT("cannot initialize a map with a struct"), call_arg->pos); continue; } v__ast__Type arg_typ = v__checker__Checker_check_expr_opt_call(c, call_arg->expr, v__checker__Checker_expr(c, call_arg->expr)); (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, i)).typ = arg_typ; if (c->inside_comptime_for_field) { - if ((call_arg->expr)._typ == 266 /* v.ast.Ident */) { - if (((*call_arg->expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((call_arg->expr)._typ == 267 /* v.ast.Ident */) { + if (((*call_arg->expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, i)).typ = (*(*call_arg->expr._v__ast__Ident).obj._v__ast__Var).typ; } } @@ -58850,34 +58927,34 @@ 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_28813 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); - string to_lock = mr_28813.arg0; - v__token__Pos pos = mr_28813.arg1; + multi_return_string_v__token__Pos mr_29125 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); + string to_lock = mr_29125.arg0; + v__token__Pos pos = mr_29125.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)); } if (!param.is_mut) { string tok = v__ast__ShareType_str(call_arg->share); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` is not `"), 0xfe10, {.d_s = tok}}, {_SLIT("`, `"), 0xfe10, {.d_s = tok}}, {_SLIT("` is not needed`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); + 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(call_arg->expr)); } else { if (v__ast__Type_share(param.typ) != call_arg->share) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong shared type `"), 0xfe10, {.d_s = v__ast__ShareType_str(call_arg->share)}}, {_SLIT("`, expected: `"), 0xfe10, {.d_s = v__ast__ShareType_str(v__ast__Type_share(param.typ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong shared type `"), /*115 &string*/0xfe10, {.d_s = v__ast__ShareType_str(call_arg->share)}}, {_SLIT("`, expected: `"), /*115 &string*/0xfe10, {.d_s = v__ast__ShareType_str(v__ast__Type_share(param.typ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); } if ((to_lock).len != 0 && !v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__shared_f)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); } } } else { if (param.is_mut) { string tok = v__ast__ShareType_str(call_arg->share); - v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("function `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` is `"), 0xfe10, {.d_s = tok}}, {_SLIT("`, so use `"), 0xfe10, {.d_s = tok}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Expr_str(call_arg->expr)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); + v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("function `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` is `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("`, so use `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT(" "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(call_arg->expr)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); } else { v__checker__Checker_fail_if_unreadable(c, call_arg->expr, arg_typ, _SLIT("argument")); } } v__ast__TypeSymbol* final_param_sym = param_typ_sym; v__ast__Type final_param_typ = param.typ; - if (func.is_variadic && (param_typ_sym->info)._typ == 411 /* v.ast.Array */) { + if (func.is_variadic && (param_typ_sym->info)._typ == 412 /* v.ast.Array */) { final_param_typ = v__ast__TypeSymbol_array_info(param_typ_sym).elem_type; final_param_sym = v__ast__Table_sym(c->table, final_param_typ); } @@ -58902,9 +58979,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp continue; } if (param_typ_sym->kind == v__ast__Kind__array && arg_typ_sym->kind == v__ast__Kind__array) { - v__ast__Array param_info = /* as */ *(v__ast__Array*)__as_cast((param_typ_sym->info)._v__ast__Array,(param_typ_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array param_info = /* as */ *(v__ast__Array*)__as_cast((param_typ_sym->info)._v__ast__Array,(param_typ_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Type param_elem_type = v__ast__Table_unaliased_type(c->table, param_info.elem_type); - v__ast__Array arg_info = /* as */ *(v__ast__Array*)__as_cast((arg_typ_sym->info)._v__ast__Array,(arg_typ_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array arg_info = /* as */ *(v__ast__Array*)__as_cast((arg_typ_sym->info)._v__ast__Array,(arg_typ_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Type arg_elem_type = v__ast__Table_unaliased_type(c->table, arg_info.elem_type); if (v__ast__Type_nr_muls(param.typ) == v__ast__Type_nr_muls(arg_typ) && param_info.nr_dims == arg_info.nr_dims && v__ast__Type_alias_eq(param_elem_type, arg_elem_type)) { continue; @@ -58941,13 +59018,13 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp continue; } } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); ; } ; if (func.language != v__ast__Language__c && !c->inside_unsafe && v__ast__Type_nr_muls(arg_typ) != v__ast__Type_nr_muls(param.typ) && !(call_arg->is_mut && param.is_mut) && !(!call_arg->is_mut && !param.is_mut) && !(v__ast__Type_alias_eq(param.typ, _const_v__ast__byteptr_type) || v__ast__Type_alias_eq(param.typ, _const_v__ast__charptr_type) || v__ast__Type_alias_eq(param.typ, _const_v__ast__voidptr_type))) { - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("automatic referencing/dereferencing is deprecated and will be removed soon (got: "), 0xfe07, {.d_i32 = v__ast__Type_nr_muls(arg_typ)}}, {_SLIT(" references, expected: "), 0xfe07, {.d_i32 = v__ast__Type_nr_muls(param.typ)}}, {_SLIT(" references)"), 0, { .d_c = 0 }}})), call_arg->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("automatic referencing/dereferencing is deprecated and will be removed soon (got: "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_nr_muls(arg_typ)}}, {_SLIT(" references, expected: "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_nr_muls(param.typ)}}, {_SLIT(" references)"), 0, { .d_c = 0 }}})), call_arg->pos); } } if (func.generic_names.len != node->concrete_types.len) { @@ -58980,7 +59057,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp if (c->comptime_fields_type.len > 0) { continue; } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); ; } @@ -59035,7 +59112,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal bool is_generic = v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic); if (is_generic && node->concrete_types.len == 0) { v__ast__TypeSymbol* rec_sym = v__ast__Table_sym(c->table, left_type); - if ((rec_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((rec_sym->info)._typ == 417 /* v.ast.Struct */) { node->concrete_types = (*rec_sym->info._v__ast__Struct).generic_types; } } @@ -59053,10 +59130,10 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal Option_v__ast__StructField _t2; if (_t2 = v__ast__Table_find_field(c->table, left_sym, method_name), _t2.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t2.data; - _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown method `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` did you mean to access the field with the same name instead?"), 0, { .d_c = 0 }}})); + _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown method `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` did you mean to access the field with the same name instead?"), 0, { .d_c = 0 }}})); } else { IError err = _t2.err; - _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown method or field: `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown method or field: `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); } string unknown_method_msg = _t1; if (v__ast__Type_has_flag(left_type, v__ast__TypeFlag__optional)) { @@ -59100,7 +59177,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Type _t11 = v__checker__Checker_map_builtin_method_call(c, node, left_type, *left_sym); return _t11; } else { - v__ast__Type parent_type = (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type; + v__ast__Type parent_type = (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; v__ast__Type _t12 = v__checker__Checker_map_builtin_method_call(c, node, parent_type, *final_left_sym); return _t12; } @@ -59125,21 +59202,21 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal return _t15; } } - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Expr arg_expr = (string__eq(method_name, _SLIT("insert")) ? ((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 1)).expr) : ((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr)); v__ast__Type arg_type = v__checker__Checker_expr(c, arg_expr); v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(c->table, arg_type); if (!v__checker__Checker_check_types(c, arg_type, info.elem_type) && !v__checker__Checker_check_types(c, left_type, arg_type)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot "), 0xfe10, {.d_s = method_name}}, {_SLIT(" `"), 0xfe10, {.d_s = arg_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg_expr)); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot "), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = arg_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg_expr)); } } else if (final_left_sym->kind == v__ast__Kind__array && (string__eq(method_name, _SLIT("first")) || string__eq(method_name, _SLIT("last")) || string__eq(method_name, _SLIT("pop")))) { - if ((final_left_sym->info)._typ == 411 /* v.ast.Array */) { + if ((final_left_sym->info)._typ == 412 /* v.ast.Array */) { node->return_type = (*final_left_sym->info._v__ast__Array).elem_type; v__ast__Type _t16 = node->return_type; return _t16; } } else if (v__pref__Backend_is_js(c->pref->backend) && string_starts_with(left_sym->name, _SLIT("Promise<")) && string__eq(method_name, _SLIT("wait"))) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (node->args.len > 0) { v__checker__Checker_error(c, _SLIT("wait() does not have any arguments"), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } @@ -59149,7 +59226,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Type _t17 = node->return_type; return _t17; } else if (left_sym->kind == v__ast__Kind__thread && string__eq(method_name, _SLIT("wait"))) { - v__ast__Thread info = /* as */ *(v__ast__Thread*)__as_cast((left_sym->info)._v__ast__Thread,(left_sym->info)._typ, 441) /*expected idx: 441, name: v.ast.Thread */ ; + v__ast__Thread info = /* as */ *(v__ast__Thread*)__as_cast((left_sym->info)._v__ast__Thread,(left_sym->info)._typ, 442) /*expected idx: 442, name: v.ast.Thread */ ; if (node->args.len > 0) { v__checker__Checker_error(c, _SLIT("wait() does not have any arguments"), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } @@ -59173,11 +59250,11 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal IError err = _t20.err; if (left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_) { v__ast__Type parent_type = _const_v__ast__void_type; - if ((left_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((left_sym->info)._typ == 417 /* v.ast.Struct */) { parent_type = (*left_sym->info._v__ast__Struct).parent_type; - } else if ((left_sym->info)._typ == 435 /* v.ast.SumType */) { + } else if ((left_sym->info)._typ == 436 /* v.ast.SumType */) { parent_type = (*left_sym->info._v__ast__SumType).parent_type; - } else if ((left_sym->info)._typ == 434 /* v.ast.Interface */) { + } else if ((left_sym->info)._typ == 435 /* v.ast.Interface */) { parent_type = (*left_sym->info._v__ast__Interface).parent_type; } if (parent_type != 0) { @@ -59204,9 +59281,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal *(multi_return_v__ast__Fn_Array_v__ast__Type*) _t22.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_42485 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t22.data); - method = mr_42485.arg0; - embed_types = mr_42485.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_42797 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t22.data); + method = mr_42797.arg0; + embed_types = mr_42797.arg1; if (embed_types.len != 0) { is_method_from_embed = true; node->from_embed_types = embed_types; @@ -59220,21 +59297,21 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal node->is_noreturn = method.is_noreturn; node->is_ctor_new = method.is_ctor_new; if (!method.is_pub && !c->pref->is_test && !string__eq(method.mod, c->mod)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } v__ast__ShareType rec_share = v__ast__Type_share((*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).typ); if (rec_share == v__ast__ShareType__shared_t && (c->locked_names.len > 0 || c->rlocked_names.len > 0)) { 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_43616 = v__checker__Checker_fail_if_immutable(c, node->left); - string to_lock = mr_43616.arg0; - v__token__Pos pos = mr_43616.arg1; + multi_return_string_v__token__Pos mr_43928 = v__checker__Checker_fail_if_immutable(c, node->left); + string to_lock = mr_43928.arg0; + v__token__Pos pos = mr_43928.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)); } if ((to_lock).len != 0 && rec_share != v__ast__ShareType__shared_t) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); } } else { v__checker__Checker_fail_if_unreadable(c, node->left, left_type, _SLIT("receiver")); @@ -59244,7 +59321,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } if (node->concrete_types.len > 0 && method.generic_names.len > 0 && node->concrete_types.len != method.generic_names.len) { string plural = (method.generic_names.len == 1 ? (_SLIT("")) : (_SLIT("s"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = method.generic_names.len}}, {_SLIT(" generic parameter"), 0xfe10, {.d_s = plural}}, {_SLIT(", got "), 0xfe07, {.d_i32 = node->concrete_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->concrete_list_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = method.generic_names.len}}, {_SLIT(" generic parameter"), /*115 &string*/0xfe10, {.d_s = plural}}, {_SLIT(", got "), /*100 &int*/0xfe07, {.d_i32 = node->concrete_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->concrete_list_pos); } for (int _t23 = 0; _t23 < node->concrete_types.len; ++_t23) { v__ast__Type concrete_type = ((v__ast__Type*)node->concrete_types.data)[_t23]; @@ -59270,7 +59347,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal bool param_is_mut = false; bool no_type_promotion = false; if (left_sym->kind == v__ast__Kind__chan) { - v__ast__Type elem_typ = (/* as */ *(v__ast__Chan*)__as_cast((left_sym->info)._v__ast__Chan,(left_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.Chan */ ).elem_type; + v__ast__Type elem_typ = (/* as */ *(v__ast__Chan*)__as_cast((left_sym->info)._v__ast__Chan,(left_sym->info)._typ, 441) /*expected idx: 441, name: v.ast.Chan */ ).elem_type; if (string__eq(method_name, _SLIT("try_push"))) { exp_arg_typ = v__ast__Type_ref(elem_typ); } else if (string__eq(method_name, _SLIT("try_pop"))) { @@ -59292,7 +59369,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, i)).typ = got_arg_typ; if (no_type_promotion) { if (!v__ast__Type_alias_eq(got_arg_typ, exp_arg_typ)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, got_arg_typ)->name}}, {_SLIT("` as argument for `"), 0xfe10, {.d_s = method.name}}, {_SLIT("` (`"), 0xfe10, {.d_s = exp_arg_sym->name}}, {_SLIT("` expected)"), 0, { .d_c = 0 }}})), arg->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, got_arg_typ)->name}}, {_SLIT("` as argument for `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("` (`"), /*115 &string*/0xfe10, {.d_s = exp_arg_sym->name}}, {_SLIT("` expected)"), 0, { .d_c = 0 }}})), arg->pos); } } if (method.is_variadic && v__ast__Type_has_flag(got_arg_typ, v__ast__TypeFlag__variadic) && node->args.len - 1 > i) { @@ -59300,7 +59377,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } v__ast__TypeSymbol* final_arg_sym = exp_arg_sym; v__ast__Type final_arg_typ = exp_arg_typ; - if (method.is_variadic && (exp_arg_sym->info)._typ == 411 /* v.ast.Array */) { + if (method.is_variadic && (exp_arg_sym->info)._typ == 412 /* v.ast.Array */) { final_arg_typ = v__ast__TypeSymbol_array_info(exp_arg_sym).elem_type; final_arg_sym = v__ast__Table_sym(c->table, final_arg_typ); } @@ -59331,44 +59408,44 @@ 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_47585 = v__checker__Checker_fail_if_immutable(c, arg->expr); - string to_lock = mr_47585.arg0; - v__token__Pos pos = mr_47585.arg1; + multi_return_string_v__token__Pos mr_47897 = v__checker__Checker_fail_if_immutable(c, arg->expr); + string to_lock = mr_47897.arg0; + v__token__Pos pos = mr_47897.arg1; if (!param_is_mut) { string tok = v__ast__ShareType_str(arg->share); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` is not `"), 0xfe10, {.d_s = tok}}, {_SLIT("`, `"), 0xfe10, {.d_s = tok}}, {_SLIT("` is not needed`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); + 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)); } else { if (param_share != arg->share) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong shared type `"), 0xfe10, {.d_s = v__ast__ShareType_str(arg->share)}}, {_SLIT("`, expected: `"), 0xfe10, {.d_s = v__ast__ShareType_str(param_share)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong shared type `"), /*115 &string*/0xfe10, {.d_s = v__ast__ShareType_str(arg->share)}}, {_SLIT("`, expected: `"), /*115 &string*/0xfe10, {.d_s = v__ast__ShareType_str(param_share)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); } if ((to_lock).len != 0 && param_share != v__ast__ShareType__shared_t) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); } } } else { if (param_is_mut) { string tok = v__ast__ShareType_str(arg->share); - v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` is `"), 0xfe10, {.d_s = tok}}, {_SLIT("`, so use `"), 0xfe10, {.d_s = tok}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Expr_str(arg->expr)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); + v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` is `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("`, so use `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT(" "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(arg->expr)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); } else { v__checker__Checker_fail_if_unreadable(c, arg->expr, got_arg_typ, _SLIT("argument")); } } if (left_sym->kind == v__ast__Kind__array && string__eq(method_name, _SLIT("sort_with_compare"))) { - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Type elem_typ = array_info.elem_type; v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(c->table, arg->typ); if (arg_sym->kind == v__ast__Kind__function) { - v__ast__FnType func_info = /* as */ *(v__ast__FnType*)__as_cast((arg_sym->info)._v__ast__FnType,(arg_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType func_info = /* as */ *(v__ast__FnType*)__as_cast((arg_sym->info)._v__ast__FnType,(arg_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; if (func_info.func.params.len == 2) { if (v__ast__Type_nr_muls((*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).typ) != v__ast__Type_nr_muls(elem_typ) + 1) { string arg_typ_str = v__ast__Table_type_to_str(c->table, (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).typ); string expected_typ_str = v__ast__Table_type_to_str(c->table, v__ast__Type_ref(elem_typ)); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("sort_with_compare callback function parameter `"), 0xfe10, {.d_s = (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).name}}, {_SLIT("` with type `"), 0xfe10, {.d_s = arg_typ_str}}, {_SLIT("` should be `"), 0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).type_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("sort_with_compare callback function parameter `"), /*115 &string*/0xfe10, {.d_s = (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).name}}, {_SLIT("` with type `"), /*115 &string*/0xfe10, {.d_s = arg_typ_str}}, {_SLIT("` should be `"), /*115 &string*/0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).type_pos); } if (v__ast__Type_nr_muls((*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).typ) != v__ast__Type_nr_muls(elem_typ) + 1) { string arg_typ_str = v__ast__Table_type_to_str(c->table, (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).typ); string expected_typ_str = v__ast__Table_type_to_str(c->table, v__ast__Type_ref(elem_typ)); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("sort_with_compare callback function parameter `"), 0xfe10, {.d_s = (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).name}}, {_SLIT("` with type `"), 0xfe10, {.d_s = arg_typ_str}}, {_SLIT("` should be `"), 0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).type_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("sort_with_compare callback function parameter `"), /*115 &string*/0xfe10, {.d_s = (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).name}}, {_SLIT("` with type `"), /*115 &string*/0xfe10, {.d_s = arg_typ_str}}, {_SLIT("` should be `"), /*115 &string*/0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).type_pos); } } } @@ -59390,16 +59467,16 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__TypeSymbol* param_typ_sym = v__ast__Table_sym(c->table, exp_arg_typ); v__ast__TypeSymbol* arg_typ_sym = v__ast__Table_sym(c->table, got_arg_typ); if (param_typ_sym->kind == v__ast__Kind__array && arg_typ_sym->kind == v__ast__Kind__array) { - v__ast__Array param_info = /* as */ *(v__ast__Array*)__as_cast((param_typ_sym->info)._v__ast__Array,(param_typ_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array param_info = /* as */ *(v__ast__Array*)__as_cast((param_typ_sym->info)._v__ast__Array,(param_typ_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Type param_elem_type = v__ast__Table_unaliased_type(c->table, param_info.elem_type); - v__ast__Array arg_info = /* as */ *(v__ast__Array*)__as_cast((arg_typ_sym->info)._v__ast__Array,(arg_typ_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array arg_info = /* as */ *(v__ast__Array*)__as_cast((arg_typ_sym->info)._v__ast__Array,(arg_typ_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__Type arg_elem_type = v__ast__Table_unaliased_type(c->table, arg_info.elem_type); if (v__ast__Type_nr_muls(exp_arg_typ) == v__ast__Type_nr_muls(got_arg_typ) && param_info.nr_dims == arg_info.nr_dims && v__ast__Type_alias_eq(param_elem_type, arg_elem_type)) { continue; } } if (!v__ast__Type_alias_eq(got_arg_typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); } ; } @@ -59407,10 +59484,10 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal ; } if (method.is_unsafe && !c->inside_unsafe) { - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("` must be called from an `unsafe` block"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("` must be called from an `unsafe` block"), 0, { .d_c = 0 }}})), node->pos); } if (!c->table->cur_fn->is_deprecated && method.is_deprecated) { - v__checker__Checker_deprecate_fnmethod(c, _SLIT("method"), str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})), method, *node); + v__checker__Checker_deprecate_fnmethod(c, _SLIT("method"), str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})), method, *node); } if (node->expected_arg_types.len == 0) { for (int i = 1; i < method.params.len; ++i) { @@ -59451,7 +59528,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } if (method.generic_names.len > 0) { if (!v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic)) { - if ((left_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((left_sym->info)._typ == 417 /* v.ast.Struct */) { if (method.generic_names.len == (*left_sym->info._v__ast__Struct).concrete_types.len) { node->concrete_types = (*left_sym->info._v__ast__Struct).concrete_types; } @@ -59466,7 +59543,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (string__eq(method_name, _SLIT("str"))) { if (left_sym->kind == v__ast__Kind__interface_) { string iname = left_sym->name; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = iname}}, {_SLIT("` does not have a .str() method. Use typeof() instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = iname}}, {_SLIT("` does not have a .str() method. Use typeof() instead"), 0, { .d_c = 0 }}})), node->pos); } node->receiver_type = left_type; node->return_type = _const_v__ast__string_type; @@ -59487,7 +59564,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (field_sym->kind == v__ast__Kind__function) { node->is_method = false; node->is_field = true; - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; Option_void _t38 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/info.func); if (_t38.state != 0 && _t38.err._typ != _IError_None___index) { IError err = _t38.err; @@ -59509,7 +59586,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (_t41.state != 0 && _t41.err._typ != _IError_None___index) { IError err = _t41.err; if (!v__ast__Type_alias_eq(targ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); } ; } @@ -59526,8 +59603,8 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal return _t43; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_55050 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t42.data); - node->from_embed_types = mr_55050.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_55362 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t42.data); + node->from_embed_types = mr_55362.arg1; v__ast__Type _t44 = info.func.return_type; return _t44; } @@ -59598,16 +59675,16 @@ VV_LOCAL_SYMBOL void v__checker__Checker_deprecate_fnmethod(v__checker__Checker* } VV_LOCAL_SYMBOL void v__checker__Checker_deprecate(v__checker__Checker* c, string kind, string name, string deprecation_message, time__Time now, time__Time after_time, v__token__Pos pos) { - string start_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = kind}}, {_SLIT(" `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string start_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = kind}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); time__Time error_time = time__Time_add_days(&after_time, 180); if (time__Time__lt(error_time, now)) { - v__checker__Checker_error(c, v__checker__semicolonize( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated since "), 0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); + v__checker__Checker_error(c, v__checker__semicolonize( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated since "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); } else if (time__Time__lt(after_time, now)) { - v__checker__Checker_warn(c, v__checker__semicolonize( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated since "), 0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT(", it will be an error after "), 0xfe10, {.d_s = time__Time_ymmdd(error_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); + v__checker__Checker_warn(c, v__checker__semicolonize( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated since "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT(", it will be an error after "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(error_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); } else if (time__Time__eq(after_time, now)) { - v__checker__Checker_warn(c, v__checker__semicolonize( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated"), 0, { .d_c = 0 }}})), deprecation_message), pos); + v__checker__Checker_warn(c, v__checker__semicolonize( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated"), 0, { .d_c = 0 }}})), deprecation_message), pos); } else { - v__checker__Checker_note(c, v__checker__semicolonize( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = start_message}}, {_SLIT(" will be deprecated after "), 0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT(", and will become an error after "), 0xfe10, {.d_s = time__Time_ymmdd(error_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); + v__checker__Checker_note(c, v__checker__semicolonize( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = start_message}}, {_SLIT(" will be deprecated after "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT(", and will become an error after "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(error_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); } } @@ -59616,7 +59693,7 @@ VV_LOCAL_SYMBOL string v__checker__semicolonize(string main, string details) { string _t1 = main; return _t1; } - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = main}}, {_SLIT("; "), 0xfe10, {.d_s = details}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = main}}, {_SLIT("; "), /*115 &string*/0xfe10, {.d_s = details}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } @@ -59628,7 +59705,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_post_process_generic_fns(v__checker__Ch Array_Array_v__ast__Type gtypes = (*(Array_Array_v__ast__Type*)map_get(ADDR(map, c->table->fn_generic_types), &(string[]){fkey}, &(Array_Array_v__ast__Type[]){ __new_array(0, 0, sizeof(Array_v__ast__Type)) })); #if defined(CUSTOM_DEFINE_trace_post_process_generic_fns) { - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> post_process_generic_fns "), 0xfe10, {.d_s = node->mod}}, {_SLIT(" | "), 0xfe10, {.d_s = node->name}}, {_SLIT(" | fkey: "), 0xfe10, {.d_s = fkey}}, {_SLIT(" | gtypes: "), 0xfe10, {.d_s = Array_Array_v__ast__Type_str(gtypes)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> post_process_generic_fns "), /*115 &string*/0xfe10, {.d_s = node->mod}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT(" | fkey: "), /*115 &string*/0xfe10, {.d_s = fkey}}, {_SLIT(" | gtypes: "), /*115 &[][]v.ast.Type*/0xfe10, {.d_s = Array_Array_v__ast__Type_str(gtypes)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif for (int _t1 = 0; _t1 < gtypes.len; ++_t1) { @@ -59648,7 +59725,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_post_process_generic_fns(v__checker__Ch #if defined(CUSTOM_DEFINE_trace_post_process_generic_fns) { if (node->generic_names.len > 0) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(" > fn_decl node.name: "), 0xfe10, {.d_s = node->name}}, {_SLIT(" | generic_names: "), 0xfe10, {.d_s = Array_string_str(node->generic_names)}}, {_SLIT(" | ninstances: "), 0xfe07, {.d_i32 = node->ninstances}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(" > fn_decl node.name: "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT(" | generic_names: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(node->generic_names)}}, {_SLIT(" | ninstances: "), /*100 &int*/0xfe07, {.d_i32 = node->ninstances}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } #endif @@ -59672,7 +59749,7 @@ Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, if (min_required_params == nr_args + 1) { v__ast__Type last_typ = (*(v__ast__Param*)array_last(f->params)).typ; v__ast__TypeSymbol* last_sym = v__ast__Table_sym(c->table, last_typ); - if ((last_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((last_sym->info)._typ == 417 /* v.ast.Struct */) { Array_v__ast__Attr _t1 = {0}; Array_v__ast__Attr _t1_orig = (*last_sym->info._v__ast__Struct).attrs; int _t1_len = _t1_orig.len; @@ -59691,11 +59768,11 @@ Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, } } } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = min_required_params}}, {_SLIT(" arguments, but got "), 0xfe07, {.d_i32 = nr_args}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = min_required_params}}, {_SLIT(" arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = nr_args}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); return (Option_void){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (!f->is_variadic && nr_args > nr_params) { v__token__Pos unexpected_args_pos = v__token__Pos_extend((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, min_required_params)).pos, (*(v__ast__CallArg*)array_last(node->args)).pos); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = min_required_params}}, {_SLIT(" arguments, but got "), 0xfe07, {.d_i32 = nr_args}}, {_SLIT0, 0, { .d_c = 0 }}})), unexpected_args_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = min_required_params}}, {_SLIT(" arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = nr_args}}, {_SLIT0, 0, { .d_c = 0 }}})), unexpected_args_pos); return (Option_void){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; @@ -59703,26 +59780,26 @@ Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checker* c, bool is_map, v__ast__Type elem_typ, v__ast__CallExpr node) { if (node.args.len != 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 1 argument, but got "), 0xfe07, {.d_i32 = node.args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node.args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node.pos); return; } v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, elem_typ); v__ast__Expr arg_expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (arg_expr._typ == 244 /* v.ast.AnonFn */) { + if (arg_expr._typ == 245 /* v.ast.AnonFn */) { if ((*arg_expr._v__ast__AnonFn).decl.params.len > 1) { v__checker__Checker_error(c, _SLIT("function needs exactly 1 argument"), (*arg_expr._v__ast__AnonFn).decl.pos); } else if (is_map && (v__ast__Type_alias_eq((*arg_expr._v__ast__AnonFn).decl.return_type, _const_v__ast__void_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get((*arg_expr._v__ast__AnonFn).decl.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__AnonFn).decl.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__AnonFn).decl.pos); } else if (!is_map && (!v__ast__Type_alias_eq((*arg_expr._v__ast__AnonFn).decl.return_type, _const_v__ast__bool_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get((*arg_expr._v__ast__AnonFn).decl.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__AnonFn).decl.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__AnonFn).decl.pos); } } - else if (arg_expr._typ == 266 /* v.ast.Ident */) { + else if (arg_expr._typ == 267 /* v.ast.Ident */) { if ((*arg_expr._v__ast__Ident).kind == v__ast__IdentKind__function) { Option_v__ast__Fn _t1 = v__ast__Table_find_fn(c->table, (*arg_expr._v__ast__Ident).name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*arg_expr._v__ast__Ident).name}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*arg_expr._v__ast__Ident).name}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); return; } @@ -59730,20 +59807,20 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke if (func.params.len > 1) { v__checker__Checker_error(c, _SLIT("function needs exactly 1 argument"), node.pos); } else if (is_map && (v__ast__Type_alias_eq(func.return_type, _const_v__ast__void_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get(func.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); } else if (!is_map && (!v__ast__Type_alias_eq(func.return_type, _const_v__ast__bool_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get(func.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); } } else if ((*arg_expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { - if (((*arg_expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if (((*arg_expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { v__ast__Expr expr = (*(*arg_expr._v__ast__Ident).obj._v__ast__Var).expr; - if ((expr)._typ == 244 /* v.ast.AnonFn */) { + if ((expr)._typ == 245 /* v.ast.AnonFn */) { if ((*expr._v__ast__AnonFn).decl.params.len > 1) { v__checker__Checker_error(c, _SLIT("function needs exactly 1 argument"), (*expr._v__ast__AnonFn).decl.pos); } else if (is_map && (v__ast__Type_alias_eq((*expr._v__ast__AnonFn).decl.return_type, _const_v__ast__void_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get((*expr._v__ast__AnonFn).decl.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*expr._v__ast__AnonFn).decl.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*expr._v__ast__AnonFn).decl.pos); } else if (!is_map && (!v__ast__Type_alias_eq((*expr._v__ast__AnonFn).decl.return_type, _const_v__ast__bool_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get((*expr._v__ast__AnonFn).decl.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*expr._v__ast__AnonFn).decl.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*expr._v__ast__AnonFn).decl.pos); } return; } @@ -59753,14 +59830,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke } } } - else if (arg_expr._typ == 252 /* v.ast.CallExpr */) { + else if (arg_expr._typ == 253 /* v.ast.CallExpr */) { if (is_map && (v__ast__Type_alias_eq((*arg_expr._v__ast__CallExpr).return_type, _const_v__ast__void_type) || v__ast__Type_alias_eq((*arg_expr._v__ast__CallExpr).return_type, 0))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, `"), 0xfe10, {.d_s = (*arg_expr._v__ast__CallExpr).name}}, {_SLIT("` does not return anything"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__CallExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, `"), /*115 &string*/0xfe10, {.d_s = (*arg_expr._v__ast__CallExpr).name}}, {_SLIT("` does not return anything"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__CallExpr).pos); } else if (!is_map && !v__ast__Type_alias_eq((*arg_expr._v__ast__CallExpr).return_type, _const_v__ast__bool_type)) { if ((*arg_expr._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent && v__ast__Type_has_flag((*arg_expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) && v__ast__Type_alias_eq(v__ast__Type_clear_flag((*arg_expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional), _const_v__ast__bool_type)) { return; } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, `"), 0xfe10, {.d_s = (*arg_expr._v__ast__CallExpr).name}}, {_SLIT("` must return a bool"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__CallExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, `"), /*115 &string*/0xfe10, {.d_s = (*arg_expr._v__ast__CallExpr).name}}, {_SLIT("` must return a bool"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__CallExpr).pos); } } @@ -59775,7 +59852,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__chec if (string__eq(method_name, _SLIT("clone")) || string__eq(method_name, _SLIT("move"))) { if (node->args.len != 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), 0xfe10, {.d_s = method_name}}, {_SLIT("()` does not have any arguments"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("()` does not have any arguments"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } if (string_at(method_name, 0) == 'm') { v__checker__Checker_fail_if_immutable(c, node->left); @@ -59791,21 +59868,21 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__chec if (node->args.len != 0) { v__checker__Checker_error(c, _SLIT("`.keys()` does not have any arguments"), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; int typ = v__ast__Table_find_or_register_array(c->table, info.key_type); ret_type = ((typ)); } else if (string__eq(method_name, _SLIT("delete"))) { v__checker__Checker_fail_if_immutable(c, node->left); if (node->args.len != 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 1 argument, but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; v__ast__Type arg_type = v__checker__Checker_expr(c, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr); Option_void _t1 = v__checker__Checker_check_expected_call_arg(c, arg_type, info.key_type, node->language, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0))); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `Map.delete`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `Map.delete`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); ; } @@ -59825,38 +59902,38 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch if (string__eq(method_name, _SLIT("slice")) && !c->is_builtin_mod) { v__checker__Checker_error(c, _SLIT(".slice() is a private method, use `x[start..end]` instead"), node->pos); } - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left_sym.info)._v__ast__Array,(left_sym.info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left_sym.info)._v__ast__Array,(left_sym.info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; elem_typ = array_info.elem_type; if (string__eq(method_name, _SLIT("filter")) || string__eq(method_name, _SLIT("map")) || string__eq(method_name, _SLIT("any")) || string__eq(method_name, _SLIT("all"))) { v__checker__scope_register_it(node->scope, node->pos, elem_typ); } else if (string__eq(method_name, _SLIT("sort"))) { - if ((node->left)._typ == 252 /* v.ast.CallExpr */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the `sort()` method can be called only on mutable receivers, but `"), 0xfe10, {.d_s = v__ast__Expr_str(node->left)}}, {_SLIT("` is a call expression"), 0, { .d_c = 0 }}})), node->pos); + if ((node->left)._typ == 253 /* v.ast.CallExpr */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the `sort()` method can be called only on mutable receivers, but `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node->left)}}, {_SLIT("` is a call expression"), 0, { .d_c = 0 }}})), node->pos); } v__checker__Checker_fail_if_immutable(c, node->left); v__checker__scope_register_a_b(node->scope, node->pos, elem_typ); if (node->args.len > 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 0 or 1 argument, but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 0 or 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (node->args.len == 1) { - if (((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr)._typ == 270 /* v.ast.InfixExpr */) { + if (((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr)._typ == 271 /* v.ast.InfixExpr */) { if (!((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).op == v__token__Kind__gt || (*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).op == v__token__Kind__lt)) { v__checker__Checker_error(c, _SLIT("`.sort()` can only use `<` or `>` comparison"), node->pos); } - u8 left_name = string_at( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)}}, {_SLIT0, 0, { .d_c = 0 }}})), 0); - u8 right_name = string_at( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)}}, {_SLIT0, 0, { .d_c = 0 }}})), 0); + u8 left_name = string_at( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)}}, {_SLIT0, 0, { .d_c = 0 }}})), 0); + u8 right_name = string_at( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)}}, {_SLIT0, 0, { .d_c = 0 }}})), 0); if (!(left_name == 'a' || left_name == 'b') || !(right_name == 'a' || right_name == 'b')) { v__checker__Checker_error(c, _SLIT("`.sort()` can only use `a` or `b` as argument, e.g. `arr.sort(a < b)`"), node->pos); } else if (left_name == right_name) { v__checker__Checker_error(c, _SLIT("`.sort()` cannot use same argument"), node->pos); } - if ((((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 266 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 286 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 269 /* v.ast.IndexExpr */) || (((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 266 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 286 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 269 /* v.ast.IndexExpr */)) { + if ((((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 267 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 287 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 270 /* v.ast.IndexExpr */) || (((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 267 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 287 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 270 /* v.ast.IndexExpr */)) { v__checker__Checker_error(c, _SLIT("`.sort()` can only use ident, index or selector as argument, \ne.g. `arr.sort(a < b)`, `arr.sort(a.id < b.id)`, `arr.sort(a[0] < b[0])`"), node->pos); } } else { v__checker__Checker_error(c, _SLIT("`.sort()` requires a `<` or `>` comparison as the first and only argument\ne.g. `users.sort(a.id < b.id)`"), node->pos); } } else if (!(v__ast__TypeSymbol_has_method(v__ast__Table_sym(c->table, elem_typ), _SLIT("<")) || (v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__int_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), v__ast__Type_ref(_const_v__ast__int_type)) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__string_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), v__ast__Type_ref(_const_v__ast__string_type)) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__i8_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__i16_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__i64_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__byte_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__rune_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__u16_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__u32_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__u64_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__f32_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__f64_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__char_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__bool_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__float_literal_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__int_literal_type)))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("custom sorting condition must be supplied for type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, elem_typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("custom sorting condition must be supplied for type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, elem_typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else if (string__eq(method_name, _SLIT("wait"))) { v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, elem_typ); @@ -59870,7 +59947,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch } node->return_type = v__ast__Table_find_or_register_array(c->table, thread_ret_type); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = left_sym.name}}, {_SLIT("` has no method `wait()` (only thread handles and arrays of them have)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = left_sym.name}}, {_SLIT("` has no method `wait()` (only thread handles and arrays of them have)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); } } v__ast__Type arg_type = left_type; @@ -59881,7 +59958,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch if (string__eq(method_name, _SLIT("map"))) { v__checker__Checker_check_map_and_filter(c, true, elem_typ, *node); v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(c->table, arg_type); - v__ast__Type ret_type = ((arg_sym->info._typ == 443 /* v.ast.FnType */) ? ((*arg_sym->info._v__ast__FnType).func.return_type) : (arg_type)); + v__ast__Type ret_type = ((arg_sym->info._typ == 444 /* v.ast.FnType */) ? ((*arg_sym->info._v__ast__FnType).func.return_type) : (arg_type)); node->return_type = v__ast__Table_find_or_register_array(c->table, v__checker__Checker_unwrap_generic(c, ret_type)); if (v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__shared_f)) { node->return_type = v__ast__Type_deref(v__ast__Type_clear_flag(node->return_type, v__ast__TypeFlag__shared_f)); @@ -59915,13 +59992,13 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch node->return_type = _const_v__ast__void_type; } else if (string__eq(method_name, _SLIT("contains"))) { if (node->args.len != 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`.contains()` expected 1 argument, but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`.contains()` expected 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (!v__ast__TypeSymbol_has_method(&left_sym, _SLIT("contains"))) { v__ast__Type arg_typ = v__checker__Checker_expr(c, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr); Option_void _t2 = v__checker__Checker_check_expected_call_arg(c, arg_typ, elem_typ, node->language, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0))); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `.contains()`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `.contains()`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); ; } @@ -59930,13 +60007,13 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch node->return_type = _const_v__ast__bool_type; } else if (string__eq(method_name, _SLIT("index"))) { if (node->args.len != 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`.index()` expected 1 argument, but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`.index()` expected 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (!v__ast__TypeSymbol_has_method(&left_sym, _SLIT("index"))) { v__ast__Type arg_typ = v__checker__Checker_expr(c, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr); Option_void _t3 = v__checker__Checker_check_expected_call_arg(c, arg_typ, elem_typ, node->language, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0))); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `.index()`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `.index()`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); ; } @@ -59945,7 +60022,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch node->return_type = _const_v__ast__int_type; } else if (string__eq(method_name, _SLIT("first")) || string__eq(method_name, _SLIT("last")) || string__eq(method_name, _SLIT("pop"))) { if (node->args.len != 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), 0xfe10, {.d_s = method_name}}, {_SLIT("()` does not have any arguments"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("()` does not have any arguments"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } node->return_type = array_info.elem_type; if (string__eq(method_name, _SLIT("pop"))) { @@ -59976,10 +60053,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_c_stmt(v__checker__Checker* c, v__a } v__checker__Checker_expr(c, node.cond); if (node.has_inc) { - if ((node.inc)._typ == 298 /* v.ast.AssignStmt */) { + if ((node.inc)._typ == 299 /* v.ast.AssignStmt */) { for (int _t1 = 0; _t1 < (*node.inc._v__ast__AssignStmt).right.len; ++_t1) { v__ast__Expr right = ((v__ast__Expr*)(*node.inc._v__ast__AssignStmt).right.data)[_t1]; - if ((right)._typ == 252 /* v.ast.CallExpr */) { + if ((right)._typ == 253 /* v.ast.CallExpr */) { if ((*right._v__ast__CallExpr).or_block.stmts.len > 0) { v__checker__Checker_error(c, _SLIT("optionals are not allowed in `for statement increment` (yet)"), (*right._v__ast__CallExpr).pos); } @@ -60001,9 +60078,15 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_in_stmt(v__checker__Checker* c, v__ int typ_idx = v__ast__Type_idx(typ); if (node->key_var.len > 0 && !string__eq(node->key_var, _SLIT("_"))) { v__checker__Checker_check_valid_snake_case(c, node->key_var, _SLIT("variable name"), node->pos); + if (Array_string_contains(_const_v__checker__reserved_type_names, node->key_var)) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = node->key_var}}, {_SLIT("` as key name"), 0, { .d_c = 0 }}})), node->pos); + } } if (node->val_var.len > 0 && !string__eq(node->val_var, _SLIT("_"))) { v__checker__Checker_check_valid_snake_case(c, node->val_var, _SLIT("variable name"), node->pos); + if (Array_string_contains(_const_v__checker__reserved_type_names, node->val_var)) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = node->val_var}}, {_SLIT("` as value name"), 0, { .d_c = 0 }}})), node->pos); + } } if (node->is_range) { v__ast__Type high_type = v__checker__Checker_expr(c, node->high); @@ -60070,35 +60153,35 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_in_stmt(v__checker__Checker* c, v__ } if (v__ast__Type_alias_eq(value_type, _const_v__ast__void_type) || v__ast__Type_has_flag(typ, v__ast__TypeFlag__optional)) { if (!v__ast__Type_alias_eq(typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("for in: cannot index `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->cond)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("for in: cannot index `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->cond)); } } if (node->val_is_mut) { value_type = v__ast__Type_ref(value_type); - if (node->cond._typ == 266 /* v.ast.Ident */) { - if (((*node->cond._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if (node->cond._typ == 267 /* v.ast.Ident */) { + if (((*node->cond._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { if (!(*(*node->cond._v__ast__Ident).obj._v__ast__Var).is_mut) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*(*node->cond._v__ast__Ident).obj._v__ast__Var).name}}, {_SLIT("` is immutable, it cannot be changed"), 0, { .d_c = 0 }}})), (*node->cond._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*(*node->cond._v__ast__Ident).obj._v__ast__Var).name}}, {_SLIT("` is immutable, it cannot be changed"), 0, { .d_c = 0 }}})), (*node->cond._v__ast__Ident).pos); } } } - else if (node->cond._typ == 246 /* v.ast.ArrayInit */) { + else if (node->cond._typ == 247 /* v.ast.ArrayInit */) { v__checker__Checker_error(c, _SLIT("array literal is immutable, it cannot be changed"), (*node->cond._v__ast__ArrayInit).pos); } - else if (node->cond._typ == 275 /* v.ast.MapInit */) { + else if (node->cond._typ == 276 /* v.ast.MapInit */) { v__checker__Checker_error(c, _SLIT("map literal is immutable, it cannot be changed"), (*node->cond._v__ast__MapInit).pos); } - else if (node->cond._typ == 286 /* v.ast.SelectorExpr */) { + else if (node->cond._typ == 287 /* v.ast.SelectorExpr */) { Option_v__ast__Ident _t2 = v__ast__SelectorExpr_root_ident(&(*node->cond._v__ast__SelectorExpr)); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - *(v__ast__Ident*) _t2.data = /* as */ *(v__ast__Ident*)__as_cast(((*node->cond._v__ast__SelectorExpr).expr)._v__ast__Ident,((*node->cond._v__ast__SelectorExpr).expr)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ; + *(v__ast__Ident*) _t2.data = /* as */ *(v__ast__Ident*)__as_cast(((*node->cond._v__ast__SelectorExpr).expr)._v__ast__Ident,((*node->cond._v__ast__SelectorExpr).expr)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ; } v__ast__Ident root_ident = (*(v__ast__Ident*)_t2.data); if (root_ident.kind != v__ast__IdentKind__unresolved) { - if (!(/* as */ *(v__ast__Var*)__as_cast((root_ident.obj)._v__ast__Var,(root_ident.obj)._typ, 324) /*expected idx: 324, name: v.ast.Var */ ).is_mut) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = (*node->cond._v__ast__SelectorExpr).field_name}}, {_SLIT("` is immutable, it cannot be changed"), 0, { .d_c = 0 }}})), (*node->cond._v__ast__SelectorExpr).pos); + if (!(/* as */ *(v__ast__Var*)__as_cast((root_ident.obj)._v__ast__Var,(root_ident.obj)._typ, 325) /*expected idx: 325, name: v.ast.Var */ ).is_mut) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = (*node->cond._v__ast__SelectorExpr).field_name}}, {_SLIT("` is immutable, it cannot be changed"), 0, { .d_c = 0 }}})), (*node->cond._v__ast__SelectorExpr).pos); } } } @@ -60127,9 +60210,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_stmt(v__checker__Checker* c, v__ast 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 == 270 /* v.ast.InfixExpr */) { + if ((node->cond)._typ == 271 /* v.ast.InfixExpr */) { if ((*node->cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - if (((*node->cond._v__ast__InfixExpr).right)._typ == 292 /* v.ast.TypeNode */ && (((*node->cond._v__ast__InfixExpr).left)._typ == 266 /* v.ast.Ident */ || ((*node->cond._v__ast__InfixExpr).left)._typ == 286 /* v.ast.SelectorExpr */)) { + if (((*node->cond._v__ast__InfixExpr).right)._typ == 293 /* v.ast.TypeNode */ && (((*node->cond._v__ast__InfixExpr).left)._typ == 267 /* v.ast.Ident */ || ((*node->cond._v__ast__InfixExpr).left)._typ == 287 /* v.ast.SelectorExpr */)) { if (v__ast__Table_type_kind(c->table, (*node->cond._v__ast__InfixExpr).left_type) == v__ast__Kind__sum_type || v__ast__Table_type_kind(c->table, (*node->cond._v__ast__InfixExpr).left_type) == v__ast__Kind__interface_) { v__checker__Checker_smartcast(c, (*node->cond._v__ast__InfixExpr).left, (*node->cond._v__ast__InfixExpr).left_type, (*node->cond._v__ast__InfixExpr).right_type, node->scope); } @@ -60151,7 +60234,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; bool node_is_expr = false; if (node->branches.len > 0 && node->has_else) { Array_v__ast__Stmt stmts = (*(v__ast__IfBranch*)/*ee elem_sym */array_get(node->branches, 0)).stmts; - if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 306 /* v.ast.ExprStmt */ && !v__ast__Type_alias_eq((/* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(stmts)))._typ, 306) /*expected idx: 306, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 307 /* v.ast.ExprStmt */ && !v__ast__Type_alias_eq((/* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(stmts)))._typ, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { node_is_expr = true; } } @@ -60172,8 +60255,8 @@ bool v__checker__Checker_if_expr_defer_0 = false; bool is_comptime_type_is_expr = false; for (int i = 0; i < node->branches.len; ++i) { v__ast__IfBranch branch = (*(v__ast__IfBranch*)/*ee elem_sym */array_get(node->branches, i)); - if ((branch.cond)._typ == 281 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("unnecessary `()` in `"), 0xfe10, {.d_s = if_kind}}, {_SLIT("` condition, use `"), 0xfe10, {.d_s = if_kind}}, {_SLIT(" expr {` instead of `"), 0xfe10, {.d_s = if_kind}}, {_SLIT(" (expr) {`."), 0, { .d_c = 0 }}})), branch.pos); + if ((branch.cond)._typ == 282 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("unnecessary `()` in `"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT("` condition, use `"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT(" expr {` instead of `"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT(" (expr) {`."), 0, { .d_c = 0 }}})), branch.pos); } if (!node->has_else || i < node->branches.len - 1) { if (node->is_comptime) { @@ -60183,15 +60266,15 @@ bool v__checker__Checker_if_expr_defer_0 = false; c->expected_type = _const_v__ast__bool_type; v__ast__Type cond_typ = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, branch.cond)); if ((v__ast__Type_idx(cond_typ) != _const_v__ast__bool_type_idx || v__ast__Type_has_flag(cond_typ, v__ast__TypeFlag__optional)) && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-bool type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, cond_typ)}}, {_SLIT("` used as if condition"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(branch.cond)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-bool type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, cond_typ)}}, {_SLIT("` used as if condition"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(branch.cond)); } } } if (node->is_comptime) { string comptime_field_name = _SLIT(""); - if ((branch.cond)._typ == 270 /* v.ast.InfixExpr */) { + if ((branch.cond)._typ == 271 /* v.ast.InfixExpr */) { if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - if (((*branch.cond._v__ast__InfixExpr).right)._typ != 292 /* v.ast.TypeNode */ && ((*branch.cond._v__ast__InfixExpr).right)._typ != 259 /* v.ast.ComptimeType */) { + if (((*branch.cond._v__ast__InfixExpr).right)._typ != 293 /* v.ast.TypeNode */ && ((*branch.cond._v__ast__InfixExpr).right)._typ != 260 /* v.ast.ComptimeType */) { v__checker__Checker_error(c, _SLIT("invalid `$if` condition: expected a type"), v__ast__Expr_pos((*branch.cond._v__ast__InfixExpr).right)); v__ast__Type _t1 = 0; // Defer begin @@ -60202,25 +60285,25 @@ bool v__checker__Checker_if_expr_defer_0 = false; return _t1; } v__ast__Expr left = (*branch.cond._v__ast__InfixExpr).left; - if (((*branch.cond._v__ast__InfixExpr).right)._typ == 259 /* v.ast.ComptimeType */ && (left)._typ == 292 /* v.ast.TypeNode */) { + if (((*branch.cond._v__ast__InfixExpr).right)._typ == 260 /* v.ast.ComptimeType */ && (left)._typ == 293 /* v.ast.TypeNode */) { is_comptime_type_is_expr = true; v__ast__Type checked_type = v__checker__Checker_unwrap_generic(c, (*left._v__ast__TypeNode).typ); - should_skip = !v__ast__Table_is_comptime_type(c->table, checked_type, /* as */ *(v__ast__ComptimeType*)__as_cast(((*branch.cond._v__ast__InfixExpr).right)._v__ast__ComptimeType,((*branch.cond._v__ast__InfixExpr).right)._typ, 259) /*expected idx: 259, name: v.ast.ComptimeType */ ); + should_skip = !v__ast__Table_is_comptime_type(c->table, checked_type, /* as */ *(v__ast__ComptimeType*)__as_cast(((*branch.cond._v__ast__InfixExpr).right)._v__ast__ComptimeType,((*branch.cond._v__ast__InfixExpr).right)._typ, 260) /*expected idx: 260, name: v.ast.ComptimeType */ ); } else { - v__ast__Type got_type = v__checker__Checker_unwrap_generic(c, (/* as */ *(v__ast__TypeNode*)__as_cast(((*branch.cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*branch.cond._v__ast__InfixExpr).right)._typ, 292) /*expected idx: 292, name: v.ast.TypeNode */ ).typ); + v__ast__Type got_type = v__checker__Checker_unwrap_generic(c, (/* as */ *(v__ast__TypeNode*)__as_cast(((*branch.cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*branch.cond._v__ast__InfixExpr).right)._typ, 293) /*expected idx: 293, name: v.ast.TypeNode */ ).typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, got_type); if (sym->kind == v__ast__Kind__placeholder || v__ast__Type_has_flag(got_type, v__ast__TypeFlag__generic)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*branch.cond._v__ast__InfixExpr).right)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*branch.cond._v__ast__InfixExpr).right)); } - if ((left)._typ == 286 /* v.ast.SelectorExpr */) { + if ((left)._typ == 287 /* v.ast.SelectorExpr */) { comptime_field_name = v__ast__Expr_str((*left._v__ast__SelectorExpr).expr); map_set(&c->comptime_fields_type, &(string[]){comptime_field_name}, &(v__ast__Type[]) { got_type }); is_comptime_type_is_expr = true; - } else if (((*branch.cond._v__ast__InfixExpr).right)._typ == 292 /* v.ast.TypeNode */ && (left)._typ == 292 /* v.ast.TypeNode */ && sym->kind == v__ast__Kind__interface_) { + } else if (((*branch.cond._v__ast__InfixExpr).right)._typ == 293 /* v.ast.TypeNode */ && (left)._typ == 293 /* v.ast.TypeNode */ && sym->kind == v__ast__Kind__interface_) { is_comptime_type_is_expr = true; v__ast__Type checked_type = v__checker__Checker_unwrap_generic(c, (*left._v__ast__TypeNode).typ); should_skip = !v__ast__Table_does_type_implement_interface(c->table, checked_type, got_type); - } else if ((left)._typ == 292 /* v.ast.TypeNode */) { + } else if ((left)._typ == 293 /* v.ast.TypeNode */) { is_comptime_type_is_expr = true; v__ast__Type left_type = v__checker__Checker_unwrap_generic(c, (*left._v__ast__TypeNode).typ); if (!v__ast__Type_alias_eq(left_type, got_type)) { @@ -60252,7 +60335,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; } } else if (c->pref->output_cross_c) { bool is_freestanding_block = false; - if ((branch.cond)._typ == 266 /* v.ast.Ident */) { + if ((branch.cond)._typ == 267 /* v.ast.Ident */) { if (string__eq((*branch.cond._v__ast__Ident).name, _SLIT("freestanding"))) { is_freestanding_block = true; } @@ -60287,8 +60370,8 @@ bool v__checker__Checker_if_expr_defer_0 = false; c->smartcast_cond_pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); } if (expr_required) { - if (branch.stmts.len > 0 && ((*(v__ast__Stmt*)array_last(branch.stmts)))._typ == 306 /* v.ast.ExprStmt */) { - v__ast__ExprStmt last_expr = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(branch.stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(branch.stmts)))._typ, 306) /*expected idx: 306, name: v.ast.ExprStmt */ ; + if (branch.stmts.len > 0 && ((*(v__ast__Stmt*)array_last(branch.stmts)))._typ == 307 /* v.ast.ExprStmt */) { + v__ast__ExprStmt last_expr = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(branch.stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(branch.stmts)))._typ, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ; c->expected_type = former_expected_type; if (v__ast__Type_has_flag(c->expected_type, v__ast__TypeFlag__optional)) { if (v__ast__Type_alias_eq(node->typ, _const_v__ast__void_type)) { @@ -60346,29 +60429,29 @@ bool v__checker__Checker_if_expr_defer_0 = false; if (v__checker__is_noreturn_callexpr(last_expr.expr)) { continue; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, node->typ)}}, {_SLIT("` and `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, last_expr.typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, node->typ)}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, last_expr.typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = if_kind}}, {_SLIT("` expression requires an expression as the last statement of every branch"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT("` expression requires an expression as the last statement of every branch"), 0, { .d_c = 0 }}})), branch.pos); } for (int _t3 = 0; _t3 < branch.stmts.len; ++_t3) { v__ast__Stmt st = ((v__ast__Stmt*)branch.stmts.data)[_t3]; Option_void _t4 = v__ast__Stmt_check_c_expr(st); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`if` expression branch has "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`if` expression branch has "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); ; } ; } } - if ((branch.cond)._typ == 268 /* v.ast.IfGuardExpr */) { + if ((branch.cond)._typ == 269 /* v.ast.IfGuardExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*branch.cond._v__ast__IfGuardExpr).expr_type); if (sym->kind == v__ast__Kind__multi_return) { - v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 442) /*expected idx: 442, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; if ((*branch.cond._v__ast__IfGuardExpr).vars.len != mr_info.types.len) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if guard expects "), 0xfe07, {.d_i32 = mr_info.types.len}}, {_SLIT(" variables, but got "), 0xfe07, {.d_i32 = (*branch.cond._v__ast__IfGuardExpr).vars.len}}, {_SLIT0, 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if guard expects "), /*100 &int*/0xfe07, {.d_i32 = mr_info.types.len}}, {_SLIT(" variables, but got "), /*100 &int*/0xfe07, {.d_i32 = (*branch.cond._v__ast__IfGuardExpr).vars.len}}, {_SLIT0, 0, { .d_c = 0 }}})), branch.pos); } else { for (int vi = 0; vi < (*branch.cond._v__ast__IfGuardExpr).vars.len; ++vi) { v__ast__IfGuardVar var = ((v__ast__IfGuardVar*)(*branch.cond._v__ast__IfGuardExpr).vars.data)[vi]; @@ -60405,7 +60488,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; } if (expr_required && !node->has_else) { string d = (node->is_comptime ? (_SLIT("$")) : (_SLIT(""))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = if_kind}}, {_SLIT("` expression needs `"), 0xfe10, {.d_s = d}}, {_SLIT("else` clause"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT("` expression needs `"), /*115 &string*/0xfe10, {.d_s = d}}, {_SLIT("else` clause"), 0, { .d_c = 0 }}})), node->pos); } v__ast__Type _t6 = node->typ; // Defer begin @@ -60417,22 +60500,22 @@ bool v__checker__Checker_if_expr_defer_0 = false; } VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* c, v__ast__Expr node, v__ast__Scope* scope) { - if ((node)._typ == 270 /* v.ast.InfixExpr */) { + if ((node)._typ == 271 /* v.ast.InfixExpr */) { if ((*node._v__ast__InfixExpr).op == v__token__Kind__and) { v__checker__Checker_smartcast_if_conds(c, (*node._v__ast__InfixExpr).left, scope); v__checker__Checker_smartcast_if_conds(c, (*node._v__ast__InfixExpr).right, scope); } else if ((*node._v__ast__InfixExpr).op == v__token__Kind__key_is) { v__ast__Expr right_expr = (*node._v__ast__InfixExpr).right; v__ast__Type _t1 = 0; - if (right_expr._typ == 292 /* v.ast.TypeNode */) { + if (right_expr._typ == 293 /* v.ast.TypeNode */) { _t1 = (*right_expr._v__ast__TypeNode).typ; } - else if (right_expr._typ == 278 /* v.ast.None */) { + else if (right_expr._typ == 279 /* v.ast.None */) { _t1 = _const_v__ast__none_type_idx; } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), 0xfe10, {.d_s = v__ast__Expr_str(right_expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(right_expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); _t1 = ((v__ast__Type)(0)); } v__ast__Type right_type = _t1; @@ -60441,7 +60524,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); v__ast__Type expr_type = v__checker__Checker_expr(c, (*node._v__ast__InfixExpr).left); if (left_sym->kind == v__ast__Kind__aggregate) { - expr_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 429) /*expected idx: 429, name: v.ast.Aggregate */ ).sum_type; + expr_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 430) /*expected idx: 430, name: v.ast.Aggregate */ ).sum_type; } if (left_sym->kind == v__ast__Kind__interface_) { if (right_sym->kind != v__ast__Kind__interface_) { @@ -60452,12 +60535,12 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* } else if (!v__checker__Checker_check_types(c, right_type, expr_type) && left_sym->kind != v__ast__Kind__sum_type) { string expect_str = v__ast__Table_type_to_str(c->table, right_type); string expr_str = v__ast__Table_type_to_str(c->table, expr_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use type `"), 0xfe10, {.d_s = expect_str}}, {_SLIT("` as type `"), 0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__InfixExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use type `"), /*115 &string*/0xfe10, {.d_s = expect_str}}, {_SLIT("` as type `"), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__InfixExpr).pos); } - if ((((*node._v__ast__InfixExpr).left)._typ == 266 /* v.ast.Ident */ || ((*node._v__ast__InfixExpr).left)._typ == 286 /* v.ast.SelectorExpr */) && ((*node._v__ast__InfixExpr).right)._typ == 292 /* v.ast.TypeNode */) { - bool is_variable = (((*node._v__ast__InfixExpr).left)._typ == 266 /* v.ast.Ident */ ? ((*(*node._v__ast__InfixExpr).left._v__ast__Ident).kind == v__ast__IdentKind__variable) : (true)); + if ((((*node._v__ast__InfixExpr).left)._typ == 267 /* v.ast.Ident */ || ((*node._v__ast__InfixExpr).left)._typ == 287 /* v.ast.SelectorExpr */) && ((*node._v__ast__InfixExpr).right)._typ == 293 /* v.ast.TypeNode */) { + bool is_variable = (((*node._v__ast__InfixExpr).left)._typ == 267 /* v.ast.Ident */ ? ((*(*node._v__ast__InfixExpr).left._v__ast__Ident).kind == v__ast__IdentKind__variable) : (true)); if (is_variable) { - if ((((*node._v__ast__InfixExpr).left)._typ == 266 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__Ident,((*node._v__ast__InfixExpr).left)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ).is_mut) || (((*node._v__ast__InfixExpr).left)._typ == 286 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__SelectorExpr,((*node._v__ast__InfixExpr).left)._typ, 286) /*expected idx: 286, name: v.ast.SelectorExpr */ ).is_mut)) { + if ((((*node._v__ast__InfixExpr).left)._typ == 267 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__Ident,((*node._v__ast__InfixExpr).left)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ).is_mut) || (((*node._v__ast__InfixExpr).left)._typ == 287 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__SelectorExpr,((*node._v__ast__InfixExpr).left)._typ, 287) /*expected idx: 287, name: v.ast.SelectorExpr */ ).is_mut)) { v__checker__Checker_fail_if_immutable(c, (*node._v__ast__InfixExpr).left); } if (left_sym->kind == v__ast__Kind__interface_ || left_sym->kind == v__ast__Kind__sum_type) { @@ -60467,7 +60550,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* } } } - } else if ((node)._typ == 273 /* v.ast.Likely */) { + } else if ((node)._typ == 274 /* v.ast.Likely */) { v__checker__Checker_smartcast_if_conds(c, (*node._v__ast__Likely).expr, scope); } } @@ -60476,7 +60559,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__checker__Checker_check_valid_pascal_case(c, node->name, _SLIT("interface name"), node->pos); v__ast__TypeSymbol* decl_sym = v__ast__Table_sym(c->table, node->typ); bool is_js = node->language == v__ast__Language__js; - if ((decl_sym->info)._typ == 434 /* v.ast.Interface */) { + if ((decl_sym->info)._typ == 435 /* v.ast.Interface */) { if (node->embeds.len > 0) { Array_v__ast__InterfaceEmbedding all_embeds = v__checker__Checker_expand_iface_embeds(c, node, 0, node->embeds); node->embeds = all_embeds; @@ -60500,10 +60583,10 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__ast__InterfaceEmbedding embed = ((v__ast__InterfaceEmbedding*)all_embeds.data)[_t1]; v__ast__TypeSymbol* isym = v__ast__Table_sym(c->table, embed.typ); if (isym->kind != v__ast__Kind__interface_) { - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` tries to embed `"), 0xfe10, {.d_s = isym->name}}, {_SLIT("`, but `"), 0xfe10, {.d_s = isym->name}}, {_SLIT("` is not an interface, but `"), 0xfe10, {.d_s = v__ast__Kind_str(isym->kind)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), embed.pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` tries to embed `"), /*115 &string*/0xfe10, {.d_s = isym->name}}, {_SLIT("`, but `"), /*115 &string*/0xfe10, {.d_s = isym->name}}, {_SLIT("` is not an interface, but `"), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(isym->kind)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), embed.pos); continue; } - v__ast__Interface isym_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface isym_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; for (int _t2 = 0; _t2 < isym_info.fields.len; ++_t2) { v__ast__StructField f = ((v__ast__StructField*)isym_info.fields.data)[_t2]; if (!(*(bool*)map_get(ADDR(map, efnames_ds_info), &(string[]){f.name}, &(bool[]){ 0 }))) { @@ -60545,7 +60628,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { string exp = v__ast__Table_type_to_str(c->table, ifield.typ); string got = v__ast__Table_type_to_str(c->table, field.typ); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("embedded interface `"), 0xfe10, {.d_s = embed_decl.name}}, {_SLIT("` conflicts existing field: `"), 0xfe10, {.d_s = ifield.name}}, {_SLIT("`, expecting type: `"), 0xfe10, {.d_s = exp}}, {_SLIT("`, got type: `"), 0xfe10, {.d_s = got}}, {_SLIT("`"), 0, { .d_c = 0 }}})), ifield.pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("embedded interface `"), /*115 &string*/0xfe10, {.d_s = embed_decl.name}}, {_SLIT("` conflicts existing field: `"), /*115 &string*/0xfe10, {.d_s = ifield.name}}, {_SLIT("`, expecting type: `"), /*115 &string*/0xfe10, {.d_s = exp}}, {_SLIT("`, got type: `"), /*115 &string*/0xfe10, {.d_s = got}}, {_SLIT("`"), 0, { .d_c = 0 }}})), ifield.pos); } } } else { @@ -60567,7 +60650,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (msg.len > 0) { string em_sig = v__ast__Table_fn_signature(c->table, (voidptr)&/*qq*/em_fn, ((v__ast__FnSignatureOpts){.skip_receiver = true,.type_only = 0,})); string m_sig = v__ast__Table_fn_signature(c->table, (voidptr)&/*qq*/m_fn, ((v__ast__FnSignatureOpts){.skip_receiver = true,.type_only = 0,})); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("embedded interface `"), 0xfe10, {.d_s = embed_decl.name}}, {_SLIT("` causes conflict: "), 0xfe10, {.d_s = msg}}, {_SLIT(", for interface method `"), 0xfe10, {.d_s = em_sig}}, {_SLIT("` vs `"), 0xfe10, {.d_s = m_sig}}, {_SLIT("`"), 0, { .d_c = 0 }}})), imethod.pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("embedded interface `"), /*115 &string*/0xfe10, {.d_s = embed_decl.name}}, {_SLIT("` causes conflict: "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT(", for interface method `"), /*115 &string*/0xfe10, {.d_s = em_sig}}, {_SLIT("` vs `"), /*115 &string*/0xfe10, {.d_s = m_sig}}, {_SLIT("`"), 0, { .d_c = 0 }}})), imethod.pos); } } } @@ -60596,7 +60679,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (is_js) { v__ast__TypeSymbol* mtyp = v__ast__Table_sym(c->table, method.return_type); if (!v__ast__TypeSymbol_is_js_compatible(mtyp)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("method "), 0xfe10, {.d_s = method.name}}, {_SLIT(" returns non JS type"), 0, { .d_c = 0 }}})), method.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("method "), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT(" returns non JS type"), 0, { .d_c = 0 }}})), method.pos); } } for (int j = 0; j < method.params.len; ++j) { @@ -60612,12 +60695,12 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac ; if (Array_string_contains(_const_v__checker__reserved_type_names, param.name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` as a parameter name"), 0, { .d_c = 0 }}})), param.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` as a parameter name"), 0, { .d_c = 0 }}})), param.pos); } if (is_js) { v__ast__TypeSymbol* ptyp = v__ast__Table_sym(c->table, param.typ); if (!v__ast__TypeSymbol_is_js_compatible(ptyp) && !(j == method.params.len - 1 && method.is_variadic)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = method.name}}, {_SLIT("` accepts non JS type as parameter"), 0, { .d_c = 0 }}})), method.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("` accepts non JS type as parameter"), 0, { .d_c = 0 }}})), method.pos); } } } @@ -60625,12 +60708,12 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__ast__StructField field = ((v__ast__StructField*)node->fields.data)[_t19]; v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, field.typ); if (string__eq(field.name, method.name) && field_sym->kind == v__ast__Kind__function) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = decl_sym->name}}, {_SLIT("` has both field and method named `"), 0xfe10, {.d_s = method.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = decl_sym->name}}, {_SLIT("` has both field and method named `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method.pos); } } for (int j = 0; j < i; ++j) { if (string__eq(method.name, (*(v__ast__FnDecl*)/*ee elem_sym */array_get(node->methods, j)).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method name `"), 0xfe10, {.d_s = method.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method name `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method.pos); } } } @@ -60649,7 +60732,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (is_js) { v__ast__TypeSymbol* tsym = v__ast__Table_sym(c->table, field.typ); if (!v__ast__TypeSymbol_is_js_compatible(tsym)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` uses non JS type"), 0, { .d_c = 0 }}})), field.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` uses non JS type"), 0, { .d_c = 0 }}})), field.pos); } } if (v__ast__Type_alias_eq(field.typ, node->typ) && node->language != v__ast__Language__js) { @@ -60657,7 +60740,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac } for (int j = 0; j < i; ++j) { if (string__eq(field.name, (*(v__ast__StructField*)/*ee elem_sym */array_get(node->fields, j)).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field.pos); } } } @@ -60668,7 +60751,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch v__ast__Type utyp = v__checker__Checker_unwrap_generic(c, typ); v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, utyp); v__ast__TypeSymbol* inter_sym = v__ast__Table_sym(c->table, interface_type); - if ((inter_sym->info)._typ == 434 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 435 /* v.ast.Interface */) { if ((*inter_sym->info._v__ast__Interface).is_generic) { Array_v__ast__Type inferred_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); Array_string _t1 = {0}; @@ -60703,7 +60786,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch Option_v__ast__Fn _t8 = v__ast__TypeSymbol_find_method_with_generic_parent(typ_sym, imethod.name); if (_t8.state != 0) { /*or block*/ err = _t8.err; - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("can not find method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` on `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`, needed for interface: `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("can not find method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` on `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`, needed for interface: `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); v__ast__Type _t9 = 0; return _t9; } @@ -60716,16 +60799,16 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch v__ast__TypeSymbol* imret_sym = v__ast__Table_sym(c->table, imethod.return_type); v__ast__TypeSymbol* mret_sym = v__ast__Table_sym(c->table, method.return_type); if (v__ast__Type_alias_eq(method.return_type, _const_v__ast__void_type) && !v__ast__Type_alias_eq(imethod.return_type, method.return_type)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("interface method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` returns `"), 0xfe10, {.d_s = imret_sym->name}}, {_SLIT("`, but implementation method `"), 0xfe10, {.d_s = method.name}}, {_SLIT("` returns no value"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("interface method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` returns `"), /*115 &string*/0xfe10, {.d_s = imret_sym->name}}, {_SLIT("`, but implementation method `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("` returns no value"), 0, { .d_c = 0 }}})), pos); v__ast__Type _t10 = 0; return _t10; } if (v__ast__Type_alias_eq(imethod.return_type, _const_v__ast__void_type) && !v__ast__Type_alias_eq(imethod.return_type, method.return_type)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("interface method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` returns no value, but implementation method `"), 0xfe10, {.d_s = method.name}}, {_SLIT("` returns `"), 0xfe10, {.d_s = mret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("interface method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` returns no value, but implementation method `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("` returns `"), /*115 &string*/0xfe10, {.d_s = mret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); v__ast__Type _t11 = 0; return _t11; } - if ((imret_sym->info)._typ == 442 /* v.ast.MultiReturn */ && (mret_sym->info)._typ == 442 /* v.ast.MultiReturn */) { + if ((imret_sym->info)._typ == 443 /* v.ast.MultiReturn */ && (mret_sym->info)._typ == 443 /* v.ast.MultiReturn */) { for (int i = 0; i < (*imret_sym->info._v__ast__MultiReturn).types.len; ++i) { v__ast__Type mr_typ = ((v__ast__Type*)(*imret_sym->info._v__ast__MultiReturn).types.data)[i]; if (v__ast__Type_has_flag(mr_typ, v__ast__TypeFlag__generic) && string__eq(v__ast__Table_get_type_name(c->table, mr_typ), gt_name)) { @@ -60762,7 +60845,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch } } if (v__ast__Type_alias_eq(inferred_type, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not infer generic type `"), 0xfe10, {.d_s = gt_name}}, {_SLIT("` in interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not infer generic type `"), /*115 &string*/0xfe10, {.d_s = gt_name}}, {_SLIT("` in interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); v__ast__Type _t14 = interface_type; return _t14; } @@ -60788,7 +60871,7 @@ v__ast__Type v__checker__Checker_match_expr(v__checker__Checker* c, v__ast__Matc bool v__checker__Checker_match_expr_defer_0 = false; node->is_expr = !v__ast__Type_alias_eq(c->expected_type, _const_v__ast__void_type); node->expected_type = c->expected_type; - if ((node->cond)._typ == 281 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { + if ((node->cond)._typ == 282 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { v__checker__Checker_error(c, _SLIT("unnecessary `()` in `match` condition, use `match expr {` instead of `match (expr) {`."), (*node->cond._v__ast__ParExpr).pos); } if (node->is_expr) { @@ -60797,7 +60880,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; } v__ast__Type cond_type = v__checker__Checker_expr(c, node->cond); node->cond_type = v__ast__mktyp(cond_type); - if (((node->cond)._typ == 266 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->cond)._v__ast__Ident,(node->cond)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ).is_mut) || ((node->cond)._typ == 286 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast((node->cond)._v__ast__SelectorExpr,(node->cond)._typ, 286) /*expected idx: 286, name: v.ast.SelectorExpr */ ).is_mut)) { + if (((node->cond)._typ == 267 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->cond)._v__ast__Ident,(node->cond)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ).is_mut) || ((node->cond)._typ == 287 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast((node->cond)._v__ast__SelectorExpr,(node->cond)._typ, 287) /*expected idx: 287, name: v.ast.SelectorExpr */ ).is_mut)) { v__checker__Checker_fail_if_immutable(c, node->cond); } Option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->cond_type, node->pos); @@ -60839,7 +60922,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; Option_void _t6 = v__ast__Stmt_check_c_expr(st); if (_t6.state != 0 && _t6.err._typ != _IError_None___index) { IError err = _t6.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`match` expression branch has "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`match` expression branch has "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); ; } @@ -60851,7 +60934,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; } if (branch.stmts.len > 0) { v__ast__Stmt stmt = (*(v__ast__Stmt*)array_last(branch.stmts)); - if ((stmt)._typ == 306 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { if (node->is_expr) { c->expected_type = node->expected_type; } @@ -60886,7 +60969,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; continue; } } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return type mismatch, it should be `"), 0xfe10, {.d_s = ret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return type mismatch, it should be `"), /*115 &string*/0xfe10, {.d_s = ret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); } } } @@ -60961,15 +61044,15 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ for (int k = 0; k < branch.exprs.len; ++k) { v__ast__Expr expr = ((v__ast__Expr*)branch.exprs.data)[k]; string key = _SLIT(""); - if ((expr)._typ == 284 /* v.ast.RangeExpr */) { + if ((expr)._typ == 285 /* v.ast.RangeExpr */) { i64 low = ((i64)(0)); i64 high = ((i64)(0)); c->expected_type = node->expected_type; v__ast__Expr low_expr = (*expr._v__ast__RangeExpr).low; v__ast__Expr high_expr = (*expr._v__ast__RangeExpr).high; v__ast__TypeSymbol* final_cond_sym = v__ast__Table_final_sym(c->table, node->cond_type); - if ((low_expr)._typ == 271 /* v.ast.IntegerLiteral */) { - if ((high_expr)._typ == 271 /* v.ast.IntegerLiteral */ && (v__ast__TypeSymbol_is_int(final_cond_sym) || (final_cond_sym->info)._typ == 445 /* v.ast.Enum */)) { + if ((low_expr)._typ == 272 /* v.ast.IntegerLiteral */) { + if ((high_expr)._typ == 272 /* v.ast.IntegerLiteral */ && (v__ast__TypeSymbol_is_int(final_cond_sym) || (final_cond_sym->info)._typ == 446 /* v.ast.Enum */)) { low = string_i64((*low_expr._v__ast__IntegerLiteral).val); high = string_i64((*high_expr._v__ast__IntegerLiteral).val); if (low > high) { @@ -60978,8 +61061,8 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } else { v__checker__Checker_error(c, _SLIT("mismatched range types"), (*low_expr._v__ast__IntegerLiteral).pos); } - } else if ((low_expr)._typ == 255 /* v.ast.CharLiteral */) { - if ((high_expr)._typ == 255 /* v.ast.CharLiteral */ && (final_cond_sym->kind == v__ast__Kind__u8 || final_cond_sym->kind == v__ast__Kind__char || final_cond_sym->kind == v__ast__Kind__rune)) { + } else if ((low_expr)._typ == 256 /* v.ast.CharLiteral */) { + if ((high_expr)._typ == 256 /* v.ast.CharLiteral */ && (final_cond_sym->kind == v__ast__Kind__u8 || final_cond_sym->kind == v__ast__Kind__char || final_cond_sym->kind == v__ast__Kind__rune)) { low = string_at((*low_expr._v__ast__CharLiteral).val, 0); high = string_at((*high_expr._v__ast__CharLiteral).val, 0); if (low > high) { @@ -60990,27 +61073,27 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } else { string typ = v__ast__Table_type_to_str(c->table, v__checker__Checker_expr(c, (*expr._v__ast__RangeExpr).low)); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use type `"), 0xfe10, {.d_s = typ}}, {_SLIT("` in match range"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use type `"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT("` in match range"), 0, { .d_c = 0 }}})), branch.pos); } int high_low_cutoff = 1000; if (high - low > high_low_cutoff) { - v__checker__Checker_warn(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("more than "), 0xfe07, {.d_i32 = high_low_cutoff}}, {_SLIT(" possibilities ("), 0xfe09, {.d_i64 = low}}, {_SLIT(" ... "), 0xfe09, {.d_i64 = high}}, {_SLIT(") in match range"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_warn(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("more than "), /*100 &int*/0xfe07, {.d_i32 = high_low_cutoff}}, {_SLIT(" possibilities ("), /*100 &i64*/0xfe09, {.d_i64 = low}}, {_SLIT(" ... "), /*100 &i64*/0xfe09, {.d_i64 = high}}, {_SLIT(") in match range"), 0, { .d_c = 0 }}})), branch.pos); } for (i64 i = low; i < high + 1; ++i) { key = i64_str(i); int val = (_IN_MAP(ADDR(string, key), ADDR(map, branch_exprs)) ? ((*(int*)map_get(ADDR(map, branch_exprs), &(string[]){key}, &(int[]){ 0 }))) : (0)); if (val == 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("match case `"), 0xfe10, {.d_s = key}}, {_SLIT("` is handled more than once"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("match case `"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("` is handled more than once"), 0, { .d_c = 0 }}})), branch.pos); } map_set(&branch_exprs, &(string[]){key}, &(int[]) { val + 1 }); } continue; } - if (expr._typ == 292 /* v.ast.TypeNode */) { + if (expr._typ == 293 /* v.ast.TypeNode */) { key = v__ast__Table_type_to_str(c->table, (*expr._v__ast__TypeNode).typ); array_push((array*)&expr_types, _MOV((v__ast__TypeNode[]){ (*expr._v__ast__TypeNode) })); } - else if (expr._typ == 263 /* v.ast.EnumVal */) { + else if (expr._typ == 264 /* v.ast.EnumVal */) { key = (*expr._v__ast__EnumVal).val; } @@ -61020,7 +61103,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ ; int val = (_IN_MAP(ADDR(string, key), ADDR(map, branch_exprs)) ? ((*(int*)map_get(ADDR(map, branch_exprs), &(string[]){key}, &(int[]){ 0 }))) : (0)); if (val == 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("match case `"), 0xfe10, {.d_s = key}}, {_SLIT("` is handled more than once"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("match case `"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("` is handled more than once"), 0, { .d_c = 0 }}})), branch.pos); } c->expected_type = node->cond_type; v__ast__Type expr_type = v__checker__Checker_expr(c, expr); @@ -61037,7 +61120,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } } - } else if ((cond_type_sym.info)._typ == 435 /* v.ast.SumType */) { + } else if ((cond_type_sym.info)._typ == 436 /* v.ast.SumType */) { if (!Array_v__ast__Type_contains((*cond_type_sym.info._v__ast__SumType).variants, expr_type)) { string expr_str = v__ast__Table_type_to_str(c->table, expr_type); string expect_str = v__ast__Table_type_to_str(c->table, node->cond_type); @@ -61053,16 +61136,16 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } Array_string sumtype_variant_names =_t2; v__util__Suggestion suggestion = v__util__new_suggestion(expr_str, sumtype_variant_names); - v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = expect_str}}, {_SLIT("` has no variant `"), 0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), v__ast__Expr_pos(expr)); + v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = expect_str}}, {_SLIT("` has no variant `"), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), v__ast__Expr_pos(expr)); } - } else if ((cond_type_sym.info)._typ == 431 /* v.ast.Alias */ && (expr_type_sym->info)._typ == 416 /* v.ast.Struct */) { + } else if ((cond_type_sym.info)._typ == 432 /* v.ast.Alias */ && (expr_type_sym->info)._typ == 417 /* v.ast.Struct */) { string expr_str = v__ast__Table_type_to_str(c->table, expr_type); string expect_str = v__ast__Table_type_to_str(c->table, node->cond_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot match alias type `"), 0xfe10, {.d_s = expect_str}}, {_SLIT("` with `"), 0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot match alias type `"), /*115 &string*/0xfe10, {.d_s = expect_str}}, {_SLIT("` with `"), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); } else if (!v__checker__Checker_check_types(c, expr_type, node->cond_type)) { string expr_str = v__ast__Table_type_to_str(c->table, expr_type); string expect_str = v__ast__Table_type_to_str(c->table, node->cond_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot match `"), 0xfe10, {.d_s = expect_str}}, {_SLIT("` with `"), 0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot match `"), /*115 &string*/0xfe10, {.d_s = expect_str}}, {_SLIT("` with `"), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); } map_set(&branch_exprs, &(string[]){key}, &(int[]) { val + 1 }); } @@ -61080,7 +61163,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ strings__Builder_write_string(&agg_cname, _SLIT("___")); } string type_str = v__ast__Table_type_to_str(c->table, expr.typ); - string name = (c->is_builtin_mod ? (type_str) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string name = (c->is_builtin_mod ? (type_str) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = c->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})))); strings__Builder_write_string(&agg_name, name); strings__Builder_write_string(&agg_cname, v__util__no_dots(name)); } @@ -61117,26 +61200,26 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ string v = ((string*)variants.data)[_t6]; if (!_IN_MAP(ADDR(string, v), ADDR(map, branch_exprs))) { is_exhaustive = false; - array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); } } } else { - if (cond_type_sym.info._typ == 435 /* v.ast.SumType */) { + if (cond_type_sym.info._typ == 436 /* v.ast.SumType */) { for (int _t8 = 0; _t8 < (*cond_type_sym.info._v__ast__SumType).variants.len; ++_t8) { v__ast__Type v = ((v__ast__Type*)(*cond_type_sym.info._v__ast__SumType).variants.data)[_t8]; string v_str = v__ast__Table_type_to_str(c->table, v); if (!_IN_MAP(ADDR(string, v_str), ADDR(map, branch_exprs))) { is_exhaustive = false; - array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); } } } - else if (cond_type_sym.info._typ == 445 /* v.ast.Enum */) { + else if (cond_type_sym.info._typ == 446 /* v.ast.Enum */) { for (int _t10 = 0; _t10 < (*cond_type_sym.info._v__ast__Enum).vals.len; ++_t10) { string v = ((string*)(*cond_type_sym.info._v__ast__Enum).vals.data)[_t10]; if (!_IN_MAP(ADDR(string, v), ADDR(map, branch_exprs))) { is_exhaustive = false; - array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), 0xfe10, {.d_s = v}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); } } } @@ -61176,7 +61259,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ int remaining = unhandled.len - c->match_exhaustive_cutoff_limit; err_details = /*f*/string__plus(err_details, Array_string_join(array_slice(unhandled, 0, c->match_exhaustive_cutoff_limit), _SLIT(", "))); if (remaining > 0) { - err_details = /*f*/string__plus(err_details, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", and "), 0xfe07, {.d_i32 = remaining}}, {_SLIT(" others ..."), 0, { .d_c = 0 }}}))); + err_details = /*f*/string__plus(err_details, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", and "), /*100 &int*/0xfe07, {.d_i32 = remaining}}, {_SLIT(" others ..."), 0, { .d_c = 0 }}}))); } } err_details = /*f*/string__plus(err_details, _SLIT(" or `else {}` at the end)")); @@ -61205,8 +61288,8 @@ bool v__checker__Checker_sql_expr_defer_0 = false; ; c->cur_orm_ts = *sym; - if ((sym->info)._typ != 416 /* v.ast.Struct */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("The table symbol `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` has to be a struct"), 0, { .d_c = 0 }}})), node->table_expr.pos); + if ((sym->info)._typ != 417 /* v.ast.Struct */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("The table symbol `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has to be a struct"), 0, { .d_c = 0 }}})), node->table_expr.pos); v__ast__Type _t3 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_sql_expr_defer_0) { @@ -61215,7 +61298,7 @@ bool v__checker__Checker_sql_expr_defer_0 = false; // Defer end return _t3; } - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; Array_v__ast__StructField fields = v__checker__Checker_fetch_and_verify_orm_fields(c, info, node->table_expr.pos, sym->name); Map_int_v__ast__SqlExpr sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlExpr), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop); Array_v__ast__StructField _t5 = {0}; @@ -61337,8 +61420,8 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; ; v__ast__TypeSymbol* table_sym = v__ast__Table_sym(c->table, node->table_expr.typ); c->cur_orm_ts = *table_sym; - if ((table_sym->info)._typ != 416 /* v.ast.Struct */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = table_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + if ((table_sym->info)._typ != 417 /* v.ast.Struct */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = table_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t3 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_sql_stmt_line_defer_0) { @@ -61347,7 +61430,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; // Defer end return _t3; } - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((table_sym->info)._v__ast__Struct,(table_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((table_sym->info)._v__ast__Struct,(table_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; Array_v__ast__StructField fields = v__checker__Checker_fetch_and_verify_orm_fields(c, info, node->table_expr.pos, table_sym->name); Map_int_v__ast__SqlStmtLine sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlStmtLine), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop); Array_v__ast__StructField _t5 = {0}; @@ -61365,7 +61448,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; for (int _t7 = 0; _t7 < _t4.len; ++_t7) { v__ast__StructField f = ((v__ast__StructField*)_t4.data)[_t7]; v__ast__Type typ = (v__ast__Table_sym(c->table, f.typ)->kind == v__ast__Kind__struct_ ? (f.typ) : v__ast__Table_sym(c->table, f.typ)->kind == v__ast__Kind__array ? (v__ast__TypeSymbol_array_info(v__ast__Table_sym(c->table, f.typ)).elem_type) : (((v__ast__Type)(0)))); - string object_var_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->object_var_name}}, {_SLIT("."), 0xfe10, {.d_s = f.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string object_var_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->object_var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!v__ast__Type_alias_eq(typ, f.typ)) { object_var_name = node->object_var_name; } @@ -61392,7 +61475,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; } Array_v__ast__StructField x =_t8; if (x.len == 0) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = table_sym->name}}, {_SLIT("` has no field named `"), 0xfe10, {.d_s = column}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = table_sym->name}}, {_SLIT("` has no field named `"), /*115 &string*/0xfe10, {.d_s = column}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); continue; } v__ast__StructField field = (*(v__ast__StructField*)/*ee elem_sym */array_get(x, 0)); @@ -61404,7 +61487,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; v__checker__Checker_expr(c, expr); } } - if ((node->where_expr)._typ != 262 /* v.ast.EmptyExpr */) { + if ((node->where_expr)._typ != 263 /* v.ast.EmptyExpr */) { v__checker__Checker_expr(c, node->where_expr); } v__ast__Type _t11 = _const_v__ast__void_type; @@ -61430,12 +61513,12 @@ VV_LOCAL_SYMBOL Array_v__ast__StructField v__checker__Checker_fetch_and_verify_o } Array_v__ast__StructField fields =_t1; if (fields.len == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("V orm: select: empty fields in `"), 0xfe10, {.d_s = table_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("V orm: select: empty fields in `"), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); Array_v__ast__StructField _t3 = __new_array_with_default(0, 0, sizeof(v__ast__StructField), 0); return _t3; } if (!string__eq((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, 0)).name, _SLIT("id"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("V orm: `id int` must be the first field in `"), 0xfe10, {.d_s = table_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("V orm: `id int` must be the first field in `"), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } Array_v__ast__StructField _t4 = fields; return _t4; @@ -61451,7 +61534,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } else if (node->exprs.len == 0 && !(v__ast__Type_alias_eq(c->expected_type, _const_v__ast__void_type) || expected_type_sym->kind == v__ast__Kind__void)) { string stype = v__ast__Table_type_to_str(c->table, expected_type); string arg = (expected_type_sym->kind == v__ast__Kind__multi_return ? (_SLIT("arguments")) : (_SLIT("argument"))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = stype}}, {_SLIT("` "), 0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = stype}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); return; } if (node->exprs.len == 0) { @@ -61459,7 +61542,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } bool exp_is_optional = v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional); Array_v__ast__Type expected_types = new_array_from_c_array(1, 1, sizeof(v__ast__Type), _MOV((v__ast__Type[1]){expected_type})); - if ((expected_type_sym->info)._typ == 442 /* v.ast.MultiReturn */) { + if ((expected_type_sym->info)._typ == 443 /* v.ast.MultiReturn */) { expected_types = (*expected_type_sym->info._v__ast__MultiReturn).types; if (c->table->cur_concrete_types.len > 0) { Array_v__ast__Type _t1 = {0}; @@ -61481,7 +61564,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod v__ast__Expr expr = ((v__ast__Expr*)node->exprs.data)[i]; v__ast__Type typ = v__checker__Checker_expr(c, expr); if (v__ast__Type_alias_eq(typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__ast__Expr_str(expr)}}, {_SLIT("` used as value"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(expr)}}, {_SLIT("` used as value"), 0, { .d_c = 0 }}})), node->pos); } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, typ); if (sym->kind == v__ast__Kind__multi_return) { @@ -61491,8 +61574,8 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod array_push((array*)&expr_idxs, _MOV((int[]){ i })); } } else { - if ((expr)._typ == 266 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { if ((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts.len > 0) { typ = v__checker__Checker_unwrap_generic(c, (*(v__ast__Type*)array_last((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts))); } @@ -61520,7 +61603,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod Array_string pnames =_t8; for (int _t10 = 0; _t10 < node->exprs.len; ++_t10) { v__ast__Expr expr = ((v__ast__Expr*)node->exprs.data)[_t10]; - if ((expr)._typ == 266 /* v.ast.Ident */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { if (Array_string_contains(pnames, (*expr._v__ast__Ident).name)) { v__checker__Checker_note(c, _SLIT("returning a parameter in a fn marked with `[manualfree]` can cause double freeing in the caller"), node->pos); } @@ -61539,7 +61622,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } if (expected_types.len > 0 && expected_types.len != got_types.len) { string arg = (expected_types.len == 1 ? (_SLIT("argument")) : (_SLIT("arguments"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = expected_types.len}}, {_SLIT(" "), 0xfe10, {.d_s = arg}}, {_SLIT(", but got "), 0xfe07, {.d_i32 = got_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = expected_types.len}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(", but got "), /*100 &int*/0xfe07, {.d_i32 = got_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); return; } for (int i = 0; i < expected_types.len; ++i) { @@ -61547,7 +61630,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod v__ast__Type got_typ = v__checker__Checker_unwrap_generic(c, (*(v__ast__Type*)/*ee elem_sym */array_get(got_types, i))); if (v__ast__Type_has_flag(got_typ, v__ast__TypeFlag__optional) && (!v__ast__Type_has_flag(exp_type, v__ast__TypeFlag__optional) || !string__eq(v__ast__Table_type_to_str(c->table, got_typ), v__ast__Table_type_to_str(c->table, exp_type)))) { v__token__Pos pos = v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i))))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` as type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("` in return argument"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` as type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("` in return argument"), 0, { .d_c = 0 }}})), pos); } if (!v__checker__Checker_check_types(c, got_typ, exp_type)) { v__ast__TypeSymbol* got_typ_sym = v__ast__Table_sym(c->table, got_typ); @@ -61561,26 +61644,26 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod continue; } v__token__Pos pos = v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i))))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = got_typ_sym->name}}, {_SLIT("` as type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("` in return argument"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = got_typ_sym->name}}, {_SLIT("` as type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("` in return argument"), 0, { .d_c = 0 }}})), pos); } if ((v__ast__Type_is_ptr(got_typ) || v__ast__Type_is_pointer(got_typ)) && (!v__ast__Type_is_ptr(exp_type) && !v__ast__Type_is_pointer(exp_type))) { v__token__Pos pos = v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i))))); if (v__ast__Expr_is_auto_deref_var((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i)))))) { continue; } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn `"), 0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` expects you to return a non reference type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("`, but you are returning `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` expects you to return a non reference type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("`, but you are returning `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), pos); } if ((v__ast__Type_is_ptr(exp_type) || v__ast__Type_is_pointer(exp_type)) && (!v__ast__Type_is_ptr(got_typ) && !v__ast__Type_is_pointer(got_typ)) && !v__ast__Type_alias_eq(got_typ, _const_v__ast__int_literal_type) && !c->pref->translated && !c->file->is_translated) { v__token__Pos pos = v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i))))); if (v__ast__Expr_is_auto_deref_var((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i)))))) { continue; } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn `"), 0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` expects you to return a reference type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("`, but you are returning `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` expects you to return a reference type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("`, but you are returning `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), pos); } if (v__ast__Type_is_ptr(exp_type) && v__ast__Type_is_ptr(got_typ)) { v__ast__Expr* r_expr = &(*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, i)); - if ((r_expr)->_typ == 266 /* v.ast.Ident */) { - if (((*r_expr->_v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((r_expr)->_typ == 267 /* v.ast.Ident */) { + if (((*r_expr->_v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { v__ast__Var* obj = &(*(*r_expr->_v__ast__Ident).obj._v__ast__Var); if (c->fn_scope != ((voidptr)(0))) { Option_v__ast__Var_ptr _t11 = v__ast__Scope_find_var(c->fn_scope, (*(*r_expr->_v__ast__Ident).obj._v__ast__Var).name); @@ -61594,8 +61677,8 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod if (obj->is_stack_obj && !c->inside_unsafe) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, v__ast__Type_set_nr_muls(obj->typ, 0)); if (!v__ast__TypeSymbol_is_heap(type_sym) && !c->pref->translated && !c->file->is_translated) { - string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*r_expr->_v__ast__Ident).name}}, {_SLIT("` cannot be returned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), 0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*r_expr->_v__ast__Ident).pos); + string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*r_expr->_v__ast__Ident).name}}, {_SLIT("` cannot be returned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), /*115 &string*/0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*r_expr->_v__ast__Ident).pos); } } } @@ -61604,9 +61687,9 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } if (exp_is_optional && node->exprs.len > 0) { v__ast__Expr expr0 = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, 0)); - if ((expr0)._typ == 252 /* v.ast.CallExpr */) { - if ((*expr0._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate && node->exprs.len == 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`?` is not needed, use `return "), 0xfe10, {.d_s = (*expr0._v__ast__CallExpr).name}}, {_SLIT("()`"), 0, { .d_c = 0 }}})), (*expr0._v__ast__CallExpr).pos); + if ((expr0)._typ == 253 /* v.ast.CallExpr */) { + if ((*expr0._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option && node->exprs.len == 1) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`?` is not needed, use `return "), /*115 &string*/0xfe10, {.d_s = (*expr0._v__ast__CallExpr).name}}, {_SLIT("()`"), 0, { .d_c = 0 }}})), (*expr0._v__ast__CallExpr).pos); } } } @@ -61616,8 +61699,8 @@ void v__checker__Checker_find_unreachable_statements_after_noreturn_calls(v__che bool prev_stmt_was_noreturn_call = false; for (int _t1 = 0; _t1 < stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[_t1]; - if ((stmt)._typ == 306 /* v.ast.ExprStmt */) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 252 /* v.ast.CallExpr */) { + if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 253 /* v.ast.CallExpr */) { if (prev_stmt_was_noreturn_call) { v__checker__Checker_error(c, _SLIT("unreachable code after a [noreturn] call"), (*stmt._v__ast__ExprStmt).pos); return; @@ -61633,18 +61716,18 @@ void v__checker__Checker_find_unreachable_statements_after_noreturn_calls(v__che VV_LOCAL_SYMBOL bool v__checker__has_top_return(Array_v__ast__Stmt stmts) { for (int _t1 = 0; _t1 < stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[_t1]; - if (stmt._typ == 317 /* v.ast.Return */) { + if (stmt._typ == 318 /* v.ast.Return */) { bool _t2 = true; return _t2; } - else if (stmt._typ == 299 /* v.ast.Block */) { + else if (stmt._typ == 300 /* v.ast.Block */) { if (v__checker__has_top_return((*stmt._v__ast__Block).stmts)) { bool _t3 = true; return _t3; } } - else if (stmt._typ == 306 /* v.ast.ExprStmt */) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 252 /* v.ast.CallExpr */) { + else if (stmt._typ == 307 /* v.ast.ExprStmt */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 253 /* v.ast.CallExpr */) { if ((*(*stmt._v__ast__ExprStmt).expr._v__ast__CallExpr).is_noreturn) { bool _t4 = true; return _t4; @@ -61676,8 +61759,8 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_noreturn_fn_decl(v__checker__Chec if (node->stmts.len != 0) { bool is_valid_end_of_noreturn_fn = false; v__ast__Stmt last_stmt = (*(v__ast__Stmt*)array_last(node->stmts)); - if (last_stmt._typ == 306 /* v.ast.ExprStmt */) { - if (((*last_stmt._v__ast__ExprStmt).expr)._typ == 252 /* v.ast.CallExpr */) { + if (last_stmt._typ == 307 /* v.ast.ExprStmt */) { + if (((*last_stmt._v__ast__ExprStmt).expr)._typ == 253 /* v.ast.CallExpr */) { if ((*(*last_stmt._v__ast__ExprStmt).expr._v__ast__CallExpr).should_be_skipped) { v__checker__Checker_error(c, _SLIT("[noreturn] functions cannot end with a skippable `[if ..]` call"), (*last_stmt._v__ast__ExprStmt).pos); return; @@ -61687,7 +61770,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_noreturn_fn_decl(v__checker__Chec } } } - else if (last_stmt._typ == 309 /* v.ast.ForStmt */) { + else if (last_stmt._typ == 310 /* v.ast.ForStmt */) { if ((*last_stmt._v__ast__ForStmt).is_inf && (*last_stmt._v__ast__ForStmt).stmts.len == 0) { is_valid_end_of_noreturn_fn = true; } @@ -61710,24 +61793,24 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } for (int _t2 = 0; _t2 < stmts.len; ++_t2) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[_t2]; - if (stmt._typ == 317 /* v.ast.Return */) { + if (stmt._typ == 318 /* v.ast.Return */) { bool _t3 = true; return _t3; } - else if (stmt._typ == 299 /* v.ast.Block */) { + else if (stmt._typ == 300 /* v.ast.Block */) { if (v__checker__uses_return_stmt((*stmt._v__ast__Block).stmts)) { bool _t4 = true; return _t4; } } - else if (stmt._typ == 306 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).expr._typ == 252 /* v.ast.CallExpr */) { + else if (stmt._typ == 307 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 253 /* v.ast.CallExpr */) { if (v__checker__uses_return_stmt((*(*stmt._v__ast__ExprStmt).expr._v__ast__CallExpr).or_block.stmts)) { bool _t5 = true; return _t5; } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 276 /* v.ast.MatchExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 277 /* v.ast.MatchExpr */) { for (int _t6 = 0; _t6 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.len; ++_t6) { v__ast__MatchBranch b = ((v__ast__MatchBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.data)[_t6]; if (v__checker__uses_return_stmt(b.stmts)) { @@ -61736,7 +61819,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 285 /* v.ast.SelectExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 286 /* v.ast.SelectExpr */) { for (int _t8 = 0; _t8 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__SelectExpr).branches.len; ++_t8) { v__ast__SelectBranch b = ((v__ast__SelectBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__SelectExpr).branches.data)[_t8]; if (v__checker__uses_return_stmt(b.stmts)) { @@ -61745,7 +61828,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 267 /* v.ast.IfExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 268 /* v.ast.IfExpr */) { for (int _t10 = 0; _t10 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.len; ++_t10) { v__ast__IfBranch b = ((v__ast__IfBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.data)[_t10]; if (v__checker__uses_return_stmt(b.stmts)) { @@ -61759,19 +61842,19 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } ; } - else if (stmt._typ == 309 /* v.ast.ForStmt */) { + else if (stmt._typ == 310 /* v.ast.ForStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForStmt).stmts)) { bool _t12 = true; return _t12; } } - else if (stmt._typ == 307 /* v.ast.ForCStmt */) { + else if (stmt._typ == 308 /* v.ast.ForCStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForCStmt).stmts)) { bool _t13 = true; return _t13; } } - else if (stmt._typ == 308 /* v.ast.ForInStmt */) { + else if (stmt._typ == 309 /* v.ast.ForInStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForInStmt).stmts)) { bool _t14 = true; return _t14; @@ -61787,7 +61870,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } VV_LOCAL_SYMBOL bool v__checker__is_noreturn_callexpr(v__ast__Expr expr) { - if ((expr)._typ == 252 /* v.ast.CallExpr */) { + if ((expr)._typ == 253 /* v.ast.CallExpr */) { bool _t1 = (*expr._v__ast__CallExpr).is_noreturn; return _t1; } @@ -61796,7 +61879,7 @@ VV_LOCAL_SYMBOL bool v__checker__is_noreturn_callexpr(v__ast__Expr expr) { } u8 v__checker__Checker_get_default_fmt(v__checker__Checker* c, v__ast__Type ftyp, v__ast__Type typ) { - if (v__ast__Type_has_flag(ftyp, v__ast__TypeFlag__optional)) { + if (v__ast__Type_has_flag(ftyp, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(ftyp, v__ast__TypeFlag__result)) { u8 _t1 = 's'; return _t1; } else if (v__ast__Type_is_float(typ)) { @@ -61814,7 +61897,7 @@ u8 v__checker__Checker_get_default_fmt(v__checker__Checker* c, v__ast__Type ftyp } else { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, ftyp)); if (sym->kind == v__ast__Kind__alias) { - v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ; + v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ; sym = v__ast__Table_sym(c->table, info.parent_type); if (v__ast__Type_alias_eq(info.parent_type, _const_v__ast__string_type)) { u8 _t6 = 's'; @@ -61853,13 +61936,13 @@ v__ast__Type v__checker__Checker_string_inter_lit(v__checker__Checker* c, v__ast v__ast__Type typ = (ftyp_sym->kind == v__ast__Kind__alias && !v__ast__TypeSymbol_has_method(ftyp_sym, _SLIT("str")) ? (v__ast__Table_unalias_num_type(c->table, ftyp)) : (ftyp)); u8 fmt = (*(u8*)/*ee elem_sym */array_get(node->fmts, i)); if (!(fmt == 'E' || fmt == 'F' || fmt == 'G' || fmt == 'e' || fmt == 'f' || fmt == 'g' || fmt == 'd' || fmt == 'u' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'c' || fmt == 's' || fmt == 'S' || fmt == 'p' || fmt == 'b' || fmt == '_')) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown format specifier `"), 0xfe01, {.d_c = fmt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown format specifier `"), /*99 &u8*/0xfe01, {.d_c = fmt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); } if (fmt == '_') { fmt = v__checker__Checker_get_default_fmt(c, ftyp, typ); if (fmt == '_') { if (!v__ast__Type_alias_eq(typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("no known default format for type `"), 0xfe10, {.d_s = v__ast__Table_get_type_name(c->table, ftyp)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("no known default format for type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_get_type_name(c->table, ftyp)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); } } else { (*(u8*)/*ee elem_sym */array_get(node->fmts, i)) = fmt; @@ -61873,7 +61956,7 @@ v__ast__Type v__checker__Checker_string_inter_lit(v__checker__Checker* c, v__ast v__checker__Checker_error(c, _SLIT("plus prefix only allowed for numbers"), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); } if ((v__ast__Type_is_unsigned(typ) && !(fmt == 'u' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'c' || fmt == 'b')) || (v__ast__Type_is_signed(typ) && !(fmt == 'd' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'c' || fmt == 'b')) || (v__ast__Type_is_int_literal(typ) && !(fmt == 'd' || fmt == 'c' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'u' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'b')) || (v__ast__Type_is_float(typ) && !(fmt == 'E' || fmt == 'F' || fmt == 'G' || fmt == 'e' || fmt == 'f' || fmt == 'g')) || (v__ast__Type_is_pointer(typ) && !(fmt == 'p' || fmt == 'x' || fmt == 'X')) || (v__ast__Type_is_string(typ) && !(fmt == 's' || fmt == 'S')) || ((v__ast__Type_idx(typ) == _const_v__ast__i64_type_idx || v__ast__Type_idx(typ) == _const_v__ast__f64_type_idx) && fmt == 'c')) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("illegal format specifier `"), 0xfe01, {.d_c = fmt}}, {_SLIT("` for type `"), 0xfe10, {.d_s = v__ast__Table_get_type_name(c->table, ftyp)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("illegal format specifier `"), /*99 &u8*/0xfe01, {.d_c = fmt}}, {_SLIT("` for type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_get_type_name(c->table, ftyp)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); } (*(bool*)/*ee elem_sym */array_get(node->need_fmts, i)) = fmt != v__checker__Checker_get_default_fmt(c, ftyp, typ); } @@ -61965,7 +62048,7 @@ v__ast__Type v__checker__Checker_int_lit(v__checker__Checker* c, v__ast__Integer string lit = string_all_after(string_replace(node->val, _SLIT("_"), _SLIT("")), _SLIT("-")); bool is_neg = string_starts_with(node->val, _SLIT("-")); string limit = (is_neg ? (_SLIT("9223372036854775808")) : (_SLIT("18446744073709551615"))); - string message = str_intp(2, _MOV((StrIntpData[]){{_SLIT("integer literal "), 0xfe10, {.d_s = node->val}}, {_SLIT(" overflows int"), 0, { .d_c = 0 }}})); + string message = str_intp(2, _MOV((StrIntpData[]){{_SLIT("integer literal "), /*115 &string*/0xfe10, {.d_s = node->val}}, {_SLIT(" overflows int"), 0, { .d_c = 0 }}})); if (lit.len > limit.len) { v__checker__Checker_error(c, message, node->pos); } else if (lit.len == limit.len) { @@ -61990,7 +62073,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* v__ast__TypeSymbol* struct_sym = mr_405.arg0; int struct_typ_idx = mr_405.arg1; bool has_generic_types = false; - if ((struct_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((struct_sym->info)._typ == 417 /* v.ast.Struct */) { for (int _t1 = 0; _t1 < node->embeds.len; ++_t1) { v__ast__Embed embed = ((v__ast__Embed*)node->embeds.data)[_t1]; if (v__ast__Type_has_flag(embed.typ, v__ast__TypeFlag__generic)) { @@ -61998,9 +62081,9 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* } v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(c->table, embed.typ); if (embed_sym->kind != v__ast__Kind__struct_) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = embed_sym->name}}, {_SLIT("` is not a struct"), 0, { .d_c = 0 }}})), embed.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = embed_sym->name}}, {_SLIT("` is not a struct"), 0, { .d_c = 0 }}})), embed.pos); } else { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (info.is_heap && !v__ast__Type_is_ptr(embed.typ)) { (*struct_sym->info._v__ast__Struct).is_heap = true; } @@ -62033,18 +62116,18 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, field.typ); for (int j = 0; j < i; ++j) { if (string__eq(field.name, (*(v__ast__StructField*)/*ee elem_sym */array_get(node->fields, j)).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field.pos); } } if (field.typ != 0) { if (!v__ast__Type_is_ptr(field.typ)) { if (v__ast__Table_unaliased_type(c->table, field.typ) == struct_typ_idx) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` is part of `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`, they can not both have the same type"), 0, { .d_c = 0 }}})), field.type_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` is part of `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`, they can not both have the same type"), 0, { .d_c = 0 }}})), field.type_pos); } } v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, field.typ); if (field_sym->kind == v__ast__Kind__function) { - v__ast__FnType fn_info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType fn_info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; Option_void _t4 = v__checker__Checker_ensure_type_exists(c, fn_info.func.return_type, fn_info.func.return_type_pos); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; @@ -62065,7 +62148,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* } } if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (info.is_heap && !v__ast__Type_is_ptr(field.typ)) { (*struct_sym->info._v__ast__Struct).is_heap = true; } @@ -62088,7 +62171,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* } } } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("incompatible initializer for field `"), 0xfe10, {.d_s = field.name}}, {_SLIT("`: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(field.default_expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("incompatible initializer for field `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("`: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(field.default_expr)); } ; } @@ -62097,15 +62180,15 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* if (v__ast__Type_is_ptr(field.typ)) { continue; } - if ((field.default_expr)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((field.default_expr)._typ == 272 /* v.ast.IntegerLiteral */) { if (string__eq((*field.default_expr._v__ast__IntegerLiteral).val, _SLIT("0"))) { v__checker__Checker_warn(c, _SLIT("unnecessary default value of `0`: struct fields are zeroed by default"), (*field.default_expr._v__ast__IntegerLiteral).pos); } - } else if ((field.default_expr)._typ == 290 /* v.ast.StringLiteral */) { + } else if ((field.default_expr)._typ == 291 /* v.ast.StringLiteral */) { if (((*field.default_expr._v__ast__StringLiteral).val).len == 0) { v__checker__Checker_warn(c, _SLIT("unnecessary default value of '': struct fields are zeroed by default"), (*field.default_expr._v__ast__StringLiteral).pos); } - } else if ((field.default_expr)._typ == 250 /* v.ast.BoolLiteral */) { + } else if ((field.default_expr)._typ == 251 /* v.ast.BoolLiteral */) { if ((*field.default_expr._v__ast__BoolLiteral).val == false) { v__checker__Checker_warn(c, _SLIT("unnecessary default value `false`: struct fields are zeroed by default"), (*field.default_expr._v__ast__BoolLiteral).pos); } @@ -62133,12 +62216,12 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } } v__ast__TypeSymbol* struct_sym = v__ast__Table_sym(c->table, node->typ); - if ((struct_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((struct_sym->info)._typ == 417 /* v.ast.Struct */) { for (int _t2 = 0; _t2 < (*struct_sym->info._v__ast__Struct).concrete_types.len; ++_t2) { v__ast__Type ct = ((v__ast__Type*)(*struct_sym->info._v__ast__Struct).concrete_types.data)[_t2]; v__ast__TypeSymbol* ct_sym = v__ast__Table_sym(c->table, ct); if (ct_sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = ct_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = ct_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if ((*struct_sym->info._v__ast__Struct).generic_types.len > 0 && (*struct_sym->info._v__ast__Struct).concrete_types.len == 0 && !node->is_short_syntax) { @@ -62147,14 +62230,14 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } else if (node->generic_types.len == 0) { v__checker__Checker_error(c, _SLIT("generic struct init must specify type parameter, e.g. Foo"), node->pos); } else if (node->generic_types.len > 0 && node->generic_types.len != (*struct_sym->info._v__ast__Struct).generic_types.len) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("generic struct init expects "), 0xfe07, {.d_i32 = (*struct_sym->info._v__ast__Struct).generic_types.len}}, {_SLIT(" generic parameter, but got "), 0xfe07, {.d_i32 = node->generic_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("generic struct init expects "), /*100 &int*/0xfe07, {.d_i32 = (*struct_sym->info._v__ast__Struct).generic_types.len}}, {_SLIT(" generic parameter, but got "), /*100 &int*/0xfe07, {.d_i32 = node->generic_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (node->generic_types.len > 0) { for (int _t3 = 0; _t3 < node->generic_types.len; ++_t3) { v__ast__Type gtyp = ((v__ast__Type*)node->generic_types.data)[_t3]; string gtyp_name = v__ast__Table_sym(c->table, gtyp)->name; if (!Array_string_contains(c->table->cur_fn->generic_names, gtyp_name)) { string cur_generic_names = string__plus(string__plus(_SLIT("("), Array_string_join(c->table->cur_fn->generic_names, _SLIT(","))), _SLIT(")")); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("generic struct init type parameter `"), 0xfe10, {.d_s = gtyp_name}}, {_SLIT("` must be within the parameters `"), 0xfe10, {.d_s = cur_generic_names}}, {_SLIT("` of the current generic function"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("generic struct init type parameter `"), /*115 &string*/0xfe10, {.d_s = gtyp_name}}, {_SLIT("` must be within the parameters `"), /*115 &string*/0xfe10, {.d_s = cur_generic_names}}, {_SLIT("` of the current generic function"), 0, { .d_c = 0 }}})), node->pos); break; } } @@ -62163,12 +62246,12 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str if (node->generic_types.len > 0 && (*struct_sym->info._v__ast__Struct).generic_types.len == node->generic_types.len && !Array_v__ast__Type_arr_eq((*struct_sym->info._v__ast__Struct).generic_types, node->generic_types)) { v__ast__Table_replace_generic_type(c->table, node->typ, node->generic_types); } - } else if ((struct_sym->info)._typ == 431 /* v.ast.Alias */) { + } else if ((struct_sym->info)._typ == 432 /* v.ast.Alias */) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(c->table, (*struct_sym->info._v__ast__Alias).parent_type); if (parent_sym->kind == v__ast__Kind__map) { string alias_str = v__ast__Table_type_to_str(c->table, node->typ); string map_str = v__ast__Table_type_to_str(c->table, (*struct_sym->info._v__ast__Alias).parent_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("direct map alias init is not possible, use `"), 0xfe10, {.d_s = alias_str}}, {_SLIT("("), 0xfe10, {.d_s = map_str}}, {_SLIT("{})` instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("direct map alias init is not possible, use `"), /*115 &string*/0xfe10, {.d_s = alias_str}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = map_str}}, {_SLIT("{})` instead"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t4 = _const_v__ast__void_type; return _t4; } @@ -62196,67 +62279,67 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str int pos = (*(int*)_t6.data); u8 first_letter = string_at(type_sym->name, pos + 1); if (!u8_is_capital(first_letter)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot initialize builtin type `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot initialize builtin type `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (type_sym->kind == v__ast__Kind__sum_type && node->fields.len == 1) { string sexpr = v__ast__Expr_str((*(v__ast__StructInitField*)/*ee elem_sym */array_get(node->fields, 0)).expr); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("cast to sum type using `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("("), 0xfe10, {.d_s = sexpr}}, {_SLIT(")` not `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("{"), 0xfe10, {.d_s = sexpr}}, {_SLIT("}`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("cast to sum type using `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sexpr}}, {_SLIT(")` not `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("{"), /*115 &string*/0xfe10, {.d_s = sexpr}}, {_SLIT("}`"), 0, { .d_c = 0 }}})), node->pos); } if (type_sym->kind == v__ast__Kind__interface_ && type_sym->language != v__ast__Language__js) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot instantiate interface `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot instantiate interface `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } - if ((type_sym->info)._typ == 431 /* v.ast.Alias */) { + if ((type_sym->info)._typ == 432 /* v.ast.Alias */) { if (v__ast__Type_is_number((*type_sym->info._v__ast__Alias).parent_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot instantiate number type alias `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot instantiate number type alias `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t7 = _const_v__ast__void_type; return _t7; } } if (!type_sym->is_pub && type_sym->kind != v__ast__Kind__placeholder && type_sym->language != v__ast__Language__c && (!string__eq(type_sym->mod, c->mod) && !(v__ast__Type_has_flag(node->typ, v__ast__TypeFlag__generic) && !string__eq(type_sym->mod, _SLIT("builtin"))))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } if (type_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (info.attrs.len > 0 && string__eq((*(v__ast__Attr*)/*ee elem_sym */array_get(info.attrs, 0)).name, _SLIT("noinit")) && !string__eq(type_sym->mod, c->mod)) { - v__checker__Checker_error(c, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` is declared with a `[noinit]` attribute, so "), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("it cannot be initialized with `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("{}`"), 0, { .d_c = 0 }}}))), node->pos); + v__checker__Checker_error(c, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` is declared with a `[noinit]` attribute, so "), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("it cannot be initialized with `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("{}`"), 0, { .d_c = 0 }}}))), node->pos); } } if (type_sym->name.len == 1 && c->table->cur_fn->generic_names.len == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t8 = 0; return _t8; } if (type_sym->kind == (v__ast__Kind__placeholder)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct: "), 0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct: "), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t9 = _const_v__ast__void_type; return _t9; } else if (type_sym->kind == (v__ast__Kind__struct_) || type_sym->kind == (v__ast__Kind__string) || type_sym->kind == (v__ast__Kind__array) || type_sym->kind == (v__ast__Kind__alias)) { v__ast__Struct info = ((v__ast__Struct){.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.embeds = __new_array(0, 0, sizeof(v__ast__Type)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.is_typedef = 0,.is_union = 0,.is_heap = 0,.is_generic = 0,.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.concrete_types = __new_array(0, 0, sizeof(v__ast__Type)),.parent_type = 0,}); if (type_sym->kind == v__ast__Kind__alias) { - v__ast__Alias info_t = /* as */ *(v__ast__Alias*)__as_cast((type_sym->info)._v__ast__Alias,(type_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ; + v__ast__Alias info_t = /* as */ *(v__ast__Alias*)__as_cast((type_sym->info)._v__ast__Alias,(type_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, info_t.parent_type); if (sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct: "), 0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct: "), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t10 = _const_v__ast__void_type; return _t10; } if (sym->kind == v__ast__Kind__struct_) { - info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("alias type name: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct type"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("alias type name: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct type"), 0, { .d_c = 0 }}})), node->pos); } } else { - info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; } if (node->is_short) { int exp_len = info.fields.len; int got_len = node->fields.len; if (exp_len != got_len) { string amount = (exp_len < got_len ? (_SLIT("many")) : (_SLIT("few"))); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("too "), 0xfe10, {.d_s = amount}}, {_SLIT(" fields in `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` literal (expecting "), 0xfe07, {.d_i32 = exp_len}}, {_SLIT(", got "), 0xfe07, {.d_i32 = got_len}}, {_SLIT(")"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("too "), /*115 &string*/0xfe10, {.d_s = amount}}, {_SLIT(" fields in `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` literal (expecting "), /*100 &int*/0xfe07, {.d_i32 = exp_len}}, {_SLIT(", got "), /*100 &int*/0xfe07, {.d_i32 = got_len}}, {_SLIT(")"), 0, { .d_c = 0 }}})), node->pos); } } Array_string inited_fields = __new_array_with_default(0, 0, sizeof(string), 0); @@ -62283,11 +62366,11 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str field_info = (*(v__ast__StructField*)_t11.data); if (!exists) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), 0xfe10, {.d_s = field->name}}, {_SLIT("` in struct literal of type `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = field->name}}, {_SLIT("` in struct literal of type `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); continue; } if (Array_string_contains(inited_fields, field_name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate field name in struct literal: `"), 0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate field name in struct literal: `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); continue; } } @@ -62312,7 +62395,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str Option_void _t13 = v__checker__Checker_check_expected(c, v__checker__Checker_unwrap_generic(c, expr_type), v__checker__Checker_unwrap_generic(c, field_info.typ)); if (_t13.state != 0 && _t13.err._typ != _IError_None___index) { IError err = _t13.err; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to field `"), 0xfe10, {.d_s = field_info.name}}, {_SLIT("`: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to field `"), /*115 &string*/0xfe10, {.d_s = field_info.name}}, {_SLIT("`: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), field->pos); ; } @@ -62329,7 +62412,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } if (field_type_sym->kind == v__ast__Kind__function && field_type_sym->language == v__ast__Language__v) { v__token__Pos pos = v__ast__Expr_pos(field->expr); - if ((field->expr)._typ == 244 /* v.ast.AnonFn */) { + if ((field->expr)._typ == 245 /* v.ast.AnonFn */) { if ((*field->expr._v__ast__AnonFn).decl.no_body) { v__checker__Checker_error(c, _SLIT("cannot initialize the fn field with anonymous fn that does not have a body"), pos); } @@ -62338,11 +62421,11 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str (*(v__ast__StructInitField*)/*ee elem_sym */array_get(node->fields, i)).typ = expr_type; (*(v__ast__StructInitField*)/*ee elem_sym */array_get(node->fields, i)).expected_type = field_info.typ; if (v__ast__Type_has_flag(field_info.typ, v__ast__TypeFlag__optional)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = field_info.name}}, {_SLIT("` is optional, but initialization of optional fields currently unsupported"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = field_info.name}}, {_SLIT("` is optional, but initialization of optional fields currently unsupported"), 0, { .d_c = 0 }}})), field->pos); } if (v__ast__Type_is_ptr(expr_type) && v__ast__Type_is_ptr(expected_type)) { - if ((field->expr)._typ == 266 /* v.ast.Ident */) { - if (((*field->expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((field->expr)._typ == 267 /* v.ast.Ident */) { + if (((*field->expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { v__ast__Var* obj = &(*(*field->expr._v__ast__Ident).obj._v__ast__Var); if (c->fn_scope != ((voidptr)(0))) { Option_v__ast__Var_ptr _t14 = v__ast__Scope_find_var(c->fn_scope, obj->name); @@ -62356,8 +62439,8 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str if (obj->is_stack_obj && !c->inside_unsafe) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__ast__Type_set_nr_muls(obj->typ, 0)); if (!v__ast__TypeSymbol_is_heap(sym) && !c->pref->translated && !c->file->is_translated) { - string suggestion = (sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*field->expr._v__ast__Ident).name}}, {_SLIT("` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), 0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*field->expr._v__ast__Ident).pos); + string suggestion = (sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*field->expr._v__ast__Ident).name}}, {_SLIT("` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), /*115 &string*/0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*field->expr._v__ast__Ident).pos); } } } @@ -62371,14 +62454,14 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } if (field.has_default_expr) { if (field.default_expr_typ == 0) { - if ((field.default_expr)._typ == 291 /* v.ast.StructInit */) { + if ((field.default_expr)._typ == 292 /* v.ast.StructInit */) { int idx = v__ast__Table_find_type_idx(c->table, (*field.default_expr._v__ast__StructInit).typ_str); if (idx != 0) { (*(v__ast__StructField*)/*ee elem_sym */array_get(info.fields, i)).default_expr_typ = v__ast__new_type(idx); } } else { Option_v__ast__ConstField_ptr _t15; - if (_t15 = v__ast__Scope_find_const(c->table->global_scope, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(field.default_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))), _t15.state == 0) { + if (_t15 = v__ast__Scope_find_const(c->table->global_scope, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(field.default_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))), _t15.state == 0) { v__ast__ConstField* const_field = *(v__ast__ConstField**)_t15.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(info.fields, i)).default_expr_typ = const_field->typ; } @@ -62387,7 +62470,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str continue; } if (v__ast__Type_is_ptr(field.typ) && !v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__shared_f) && !node->has_update_expr && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("reference field `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("reference field `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, field.typ); bool has_noinit = false; @@ -62399,7 +62482,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } } if (sym->kind == v__ast__Kind__interface_ && (!has_noinit && sym->language != v__ast__Language__js)) { - v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("interface field `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("interface field `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); } if (Array_v__ast__Attr_contains(field.attrs, _SLIT("required")) && !node->is_short && !node->has_update_expr) { bool found = false; @@ -62411,7 +62494,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } } if (!found) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -62423,14 +62506,14 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str node->update_expr_type = update_type; if (v__ast__Table_type_kind(c->table, update_type) != v__ast__Kind__struct_) { string s = v__ast__Table_type_to_str(c->table, update_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected struct, found `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->update_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected struct, found `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->update_expr)); } else if (!v__ast__Type_alias_eq(update_type, node->typ)) { v__ast__TypeSymbol* from_sym = v__ast__Table_sym(c->table, update_type); v__ast__TypeSymbol* to_sym = v__ast__Table_sym(c->table, node->typ); - v__ast__Struct from_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; - v__ast__Struct to_info = /* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct from_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct to_info = /* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (!v__checker__Checker_check_struct_signature(c, from_info, to_info)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = from_sym->name}}, {_SLIT("` is not compatible with struct `"), 0xfe10, {.d_s = to_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->update_expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = from_sym->name}}, {_SLIT("` is not compatible with struct `"), /*115 &string*/0xfe10, {.d_s = to_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->update_expr)); } } if (!v__ast__Expr_is_lvalue(node->update_expr)) { @@ -62600,9 +62683,9 @@ void v__transformer__Transformer_find_new_array_len(v__transformer__Transformer* return; } v__ast__Expr right = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.right, 0)); - if ((right)._typ == 246 /* v.ast.ArrayInit */) { + if ((right)._typ == 247 /* v.ast.ArrayInit */) { v__ast__Expr left = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left)._typ == 266 /* v.ast.Ident */) { + if ((left)._typ == 267 /* v.ast.Ident */) { if ((*left._v__ast__Ident).is_mut) { v__transformer__IndexState_safe_access(t->index, (*left._v__ast__Ident).name, -2); return; @@ -62613,7 +62696,7 @@ void v__transformer__Transformer_find_new_array_len(v__transformer__Transformer* } int len = ((int)(0)); v__ast__Expr value = (*right._v__ast__ArrayInit).len_expr; - if ((value)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((value)._typ == 272 /* v.ast.IntegerLiteral */) { len = string_int((*value._v__ast__IntegerLiteral).val) + 1; } v__transformer__IndexState_safe_access(t->index, (*left._v__ast__Ident).name, len); @@ -62626,19 +62709,19 @@ void v__transformer__Transformer_find_new_range(v__transformer__Transformer* t, return; } v__ast__Expr right = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.right, 0)); - if ((right)._typ == 269 /* v.ast.IndexExpr */) { + if ((right)._typ == 270 /* v.ast.IndexExpr */) { v__ast__Expr left = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left)._typ == 266 /* v.ast.Ident */) { + if ((left)._typ == 267 /* v.ast.Ident */) { if ((*left._v__ast__Ident).is_mut) { v__transformer__IndexState_safe_access(t->index, (*left._v__ast__Ident).name, -2); return; } v__ast__Expr index = (*right._v__ast__IndexExpr).index; - if ((index)._typ == 284 /* v.ast.RangeExpr */) { + if ((index)._typ == 285 /* v.ast.RangeExpr */) { v__ast__Expr range_low = (*index._v__ast__RangeExpr).low; - if ((range_low)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((range_low)._typ == 272 /* v.ast.IntegerLiteral */) { v__ast__Expr sub_left = (*right._v__ast__IndexExpr).left; - if ((sub_left)._typ == 266 /* v.ast.Ident */) { + if ((sub_left)._typ == 267 /* v.ast.Ident */) { int safe = v__transformer__IndexState_safe_offset(t->index, (*sub_left._v__ast__Ident).name); int low = string_int((*range_low._v__ast__IntegerLiteral).val); if (safe >= low) { @@ -62666,40 +62749,40 @@ void v__transformer__Transformer_check_safe_array(v__transformer__Transformer* t } v__ast__Expr index = node->index; v__ast__Expr name = node->left; - if (index._typ == 271 /* v.ast.IntegerLiteral */) { + if (index._typ == 272 /* v.ast.IntegerLiteral */) { bool is_direct = v__transformer__IndexState_safe_access(t->index, v__ast__Expr_str(name), string_int((*index._v__ast__IntegerLiteral).val)); node->is_direct = is_direct; } - else if (index._typ == 284 /* v.ast.RangeExpr */) { + else if (index._typ == 285 /* v.ast.RangeExpr */) { if ((*index._v__ast__RangeExpr).has_high) { v__ast__Expr high = (*index._v__ast__RangeExpr).high; - if ((high)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((high)._typ == 272 /* v.ast.IntegerLiteral */) { v__transformer__IndexState_safe_access(t->index, v__ast__Expr_str(name), string_int((*high._v__ast__IntegerLiteral).val)); return; } } if ((*index._v__ast__RangeExpr).has_low) { v__ast__Expr low = (*index._v__ast__RangeExpr).low; - if ((low)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((low)._typ == 272 /* v.ast.IntegerLiteral */) { v__transformer__IndexState_safe_access(t->index, v__ast__Expr_str(name), string_int((*low._v__ast__IntegerLiteral).val)); return; } } } - else if (index._typ == 253 /* v.ast.CastExpr */) { + else if (index._typ == 254 /* v.ast.CastExpr */) { if (!string__eq((*index._v__ast__CastExpr).typname, _SLIT("int"))) { return; } v__ast__Expr index_expr = (*index._v__ast__CastExpr).expr; - if ((index_expr)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((index_expr)._typ == 272 /* v.ast.IntegerLiteral */) { string val = (*index_expr._v__ast__IntegerLiteral).val; node->is_direct = v__transformer__IndexState_safe_access(t->index, v__ast__Expr_str(name), string_int(val)); } } - else if (index._typ == 263 /* v.ast.EnumVal */) { + else if (index._typ == 264 /* v.ast.EnumVal */) { ; } - else if (index._typ == 266 /* v.ast.Ident */) { + else if (index._typ == 267 /* v.ast.Ident */) { } else { @@ -62708,17 +62791,17 @@ void v__transformer__Transformer_check_safe_array(v__transformer__Transformer* t } v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v__ast__Stmt* node) { - if (node->_typ == 304 /* v.ast.EmptyStmt */) { + if (node->_typ == 305 /* v.ast.EmptyStmt */) { } - else if (node->_typ == 277 /* v.ast.NodeError */) { + else if (node->_typ == 278 /* v.ast.NodeError */) { } - else if (node->_typ == 296 /* v.ast.AsmStmt */) { + else if (node->_typ == 297 /* v.ast.AsmStmt */) { } - else if (node->_typ == 297 /* v.ast.AssertStmt */) { + else if (node->_typ == 298 /* v.ast.AssertStmt */) { v__ast__Stmt _t1 = v__transformer__Transformer_assert_stmt(t, (voidptr)&/*qq*/(*node->_v__ast__AssertStmt)); return _t1; } - else if (node->_typ == 298 /* v.ast.AssignStmt */) { + else if (node->_typ == 299 /* v.ast.AssignStmt */) { v__transformer__Transformer_find_new_array_len(t, (*node->_v__ast__AssignStmt)); v__transformer__Transformer_find_new_range(t, (*node->_v__ast__AssignStmt)); v__transformer__Transformer_find_mut_self_assign(t, (*node->_v__ast__AssignStmt)); @@ -62731,7 +62814,7 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ *left = v__transformer__Transformer_expr(t, left); } } - else if (node->_typ == 299 /* v.ast.Block */) { + else if (node->_typ == 300 /* v.ast.Block */) { v__transformer__IndexState_indent(t->index, false); for (int _t4 = 0; _t4 < (*node->_v__ast__Block).stmts.len; ++_t4) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__Block).stmts.data) + _t4; @@ -62739,35 +62822,35 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 300 /* v.ast.BranchStmt */) { + else if (node->_typ == 301 /* v.ast.BranchStmt */) { t->index->disabled = true; } - else if (node->_typ == 301 /* v.ast.ComptimeFor */) { + else if (node->_typ == 302 /* v.ast.ComptimeFor */) { for (int _t5 = 0; _t5 < (*node->_v__ast__ComptimeFor).stmts.len; ++_t5) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__ComptimeFor).stmts.data) + _t5; *stmt = v__transformer__Transformer_stmt(t, stmt); } } - else if (node->_typ == 302 /* v.ast.ConstDecl */) { + else if (node->_typ == 303 /* v.ast.ConstDecl */) { for (int _t6 = 0; _t6 < (*node->_v__ast__ConstDecl).fields.len; ++_t6) { v__ast__ConstField* field = ((v__ast__ConstField*)(*node->_v__ast__ConstDecl).fields.data) + _t6; field->expr = v__transformer__Transformer_expr(t, &/*sum*/field->expr); } } - else if (node->_typ == 303 /* v.ast.DeferStmt */) { + else if (node->_typ == 304 /* v.ast.DeferStmt */) { for (int _t7 = 0; _t7 < (*node->_v__ast__DeferStmt).stmts.len; ++_t7) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__DeferStmt).stmts.data) + _t7; *stmt = v__transformer__Transformer_stmt(t, stmt); } } - else if (node->_typ == 305 /* v.ast.EnumDecl */) { + else if (node->_typ == 306 /* v.ast.EnumDecl */) { } - else if (node->_typ == 306 /* v.ast.ExprStmt */) { + else if (node->_typ == 307 /* v.ast.ExprStmt */) { v__ast__Expr _t8 = {0}; - if ((*node->_v__ast__ExprStmt).expr._typ == 267 /* v.ast.IfExpr */) { + if ((*node->_v__ast__ExprStmt).expr._typ == 268 /* v.ast.IfExpr */) { _t8 = v__transformer__Transformer_expr_stmt_if_expr(t, (voidptr)&/*qq*/(*(*node->_v__ast__ExprStmt).expr._v__ast__IfExpr)); } - else if ((*node->_v__ast__ExprStmt).expr._typ == 276 /* v.ast.MatchExpr */) { + else if ((*node->_v__ast__ExprStmt).expr._typ == 277 /* v.ast.MatchExpr */) { _t8 = v__transformer__Transformer_expr_stmt_match_expr(t, (voidptr)&/*qq*/(*(*node->_v__ast__ExprStmt).expr._v__ast__MatchExpr)); } @@ -62776,7 +62859,7 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } (*node->_v__ast__ExprStmt).expr = _t8; } - else if (node->_typ == 183 /* v.ast.FnDecl */) { + else if (node->_typ == 184 /* v.ast.FnDecl */) { v__transformer__IndexState_indent(t->index, true); for (int _t9 = 0; _t9 < (*node->_v__ast__FnDecl).stmts.len; ++_t9) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__FnDecl).stmts.data) + _t9; @@ -62784,11 +62867,11 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 307 /* v.ast.ForCStmt */) { + else if (node->_typ == 308 /* v.ast.ForCStmt */) { v__ast__Stmt _t10 = v__transformer__Transformer_for_c_stmt(t, (voidptr)&/*qq*/(*node->_v__ast__ForCStmt)); return _t10; } - else if (node->_typ == 308 /* v.ast.ForInStmt */) { + else if (node->_typ == 309 /* v.ast.ForInStmt */) { v__transformer__IndexState_indent(t->index, false); for (int _t11 = 0; _t11 < (*node->_v__ast__ForInStmt).stmts.len; ++_t11) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__ForInStmt).stmts.data) + _t11; @@ -62796,50 +62879,50 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 309 /* v.ast.ForStmt */) { + else if (node->_typ == 310 /* v.ast.ForStmt */) { v__ast__Stmt _t12 = v__transformer__Transformer_for_stmt(t, (voidptr)&/*qq*/(*node->_v__ast__ForStmt)); return _t12; } - else if (node->_typ == 310 /* v.ast.GlobalDecl */) { + else if (node->_typ == 311 /* v.ast.GlobalDecl */) { for (int _t13 = 0; _t13 < (*node->_v__ast__GlobalDecl).fields.len; ++_t13) { v__ast__GlobalField* field = ((v__ast__GlobalField*)(*node->_v__ast__GlobalDecl).fields.data) + _t13; field->expr = v__transformer__Transformer_expr(t, &/*sum*/field->expr); } } - else if (node->_typ == 311 /* v.ast.GotoLabel */) { + else if (node->_typ == 312 /* v.ast.GotoLabel */) { } - else if (node->_typ == 312 /* v.ast.GotoStmt */) { + else if (node->_typ == 313 /* v.ast.GotoStmt */) { t->index->disabled = true; } - else if (node->_typ == 313 /* v.ast.HashStmt */) { + else if (node->_typ == 314 /* v.ast.HashStmt */) { for (int _t14 = 0; _t14 < (*node->_v__ast__HashStmt).ct_conds.len; ++_t14) { v__ast__Expr* cond = ((v__ast__Expr*)(*node->_v__ast__HashStmt).ct_conds.data) + _t14; *cond = v__transformer__Transformer_expr(t, cond); } } - else if (node->_typ == 314 /* v.ast.Import */) { + else if (node->_typ == 315 /* v.ast.Import */) { } - else if (node->_typ == 315 /* v.ast.InterfaceDecl */) { + else if (node->_typ == 316 /* v.ast.InterfaceDecl */) { v__ast__Stmt _t15 = v__transformer__Transformer_interface_decl(t, (voidptr)&/*qq*/(*node->_v__ast__InterfaceDecl)); return _t15; } - else if (node->_typ == 316 /* v.ast.Module */) { + else if (node->_typ == 317 /* v.ast.Module */) { } - else if (node->_typ == 317 /* v.ast.Return */) { + else if (node->_typ == 318 /* v.ast.Return */) { for (int _t16 = 0; _t16 < (*node->_v__ast__Return).exprs.len; ++_t16) { v__ast__Expr* expr = ((v__ast__Expr*)(*node->_v__ast__Return).exprs.data) + _t16; *expr = v__transformer__Transformer_expr(t, expr); } } - else if (node->_typ == 318 /* v.ast.SqlStmt */) { + else if (node->_typ == 319 /* v.ast.SqlStmt */) { } - else if (node->_typ == 319 /* v.ast.StructDecl */) { + else if (node->_typ == 320 /* v.ast.StructDecl */) { for (int _t17 = 0; _t17 < (*node->_v__ast__StructDecl).fields.len; ++_t17) { v__ast__StructField* field = ((v__ast__StructField*)(*node->_v__ast__StructDecl).fields.data) + _t17; field->default_expr = v__transformer__Transformer_expr(t, &/*sum*/field->default_expr); } } - else if (node->_typ == 243 /* v.ast.TypeDecl */) { + else if (node->_typ == 244 /* v.ast.TypeDecl */) { } ; v__ast__Stmt _t18 = *node; @@ -62853,11 +62936,11 @@ v__ast__Stmt v__transformer__Transformer_assert_stmt(v__transformer__Transformer v__ast__Stmt _t1 = v__ast__AssertStmt_to_sumtype_v__ast__Stmt(node); return _t1; } - if ((node->expr)._typ == 270 /* v.ast.InfixExpr */) { + if ((node->expr)._typ == 271 /* v.ast.InfixExpr */) { v__ast__Expr right = (*node->expr._v__ast__InfixExpr).right; - if (right._typ == 271 /* v.ast.IntegerLiteral */) { + if (right._typ == 272 /* v.ast.IntegerLiteral */) { v__ast__Expr left = (*node->expr._v__ast__InfixExpr).left; - if ((left)._typ == 286 /* v.ast.SelectorExpr */) { + if ((left)._typ == 287 /* v.ast.SelectorExpr */) { int len = string_int((*right._v__ast__IntegerLiteral).val); if (string__eq((*left._v__ast__SelectorExpr).field_name, _SLIT("len"))) { @@ -62875,9 +62958,9 @@ v__ast__Stmt v__transformer__Transformer_assert_stmt(v__transformer__Transformer } } } - else if (right._typ == 286 /* v.ast.SelectorExpr */) { + else if (right._typ == 287 /* v.ast.SelectorExpr */) { v__ast__Expr left = (*node->expr._v__ast__InfixExpr).left; - if ((left)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((left)._typ == 272 /* v.ast.IntegerLiteral */) { int len = string_int((*left._v__ast__IntegerLiteral).val); if (string__eq((*right._v__ast__SelectorExpr).field_name, _SLIT("len"))) { @@ -62916,7 +62999,7 @@ v__ast__Expr v__transformer__Transformer_expr_stmt_if_expr(v__transformer__Trans v__ast__IfBranch* branch = ((v__ast__IfBranch*)node->branches.data) + i; v__ast__Expr cond = v__transformer__Transformer_expr(t, &/*sum*/branch->cond); *branch = ((v__ast__IfBranch){(*branch).pos,(*branch).body_pos,(*branch).comments,.cond = cond,(*branch).pkg_exist,(*branch).stmts,(*branch).scope,}); - if ((cond)._typ == 250 /* v.ast.BoolLiteral */) { + if ((cond)._typ == 251 /* v.ast.BoolLiteral */) { if ((*cond._v__ast__BoolLiteral).val) { stop_index = i; break; @@ -62975,36 +63058,36 @@ v__ast__Expr v__transformer__Transformer_expr_stmt_match_expr(v__transformer__Tr for (int _t3 = 0; _t3 < branch->exprs.len; ++_t3) { v__ast__Expr* expr = ((v__ast__Expr*)branch->exprs.data) + _t3; *expr = v__transformer__Transformer_expr(t, expr); - if (cond._typ == 250 /* v.ast.BoolLiteral */) { - if ((expr)->_typ == 250 /* v.ast.BoolLiteral */) { - if ((*cond._v__ast__BoolLiteral).val == (/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)->_v__ast__BoolLiteral,(expr)->_typ, 250) /*expected idx: 250, name: v.ast.BoolLiteral */ ).val) { + if (cond._typ == 251 /* v.ast.BoolLiteral */) { + if ((expr)->_typ == 251 /* v.ast.BoolLiteral */) { + if ((*cond._v__ast__BoolLiteral).val == (/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)->_v__ast__BoolLiteral,(expr)->_typ, 251) /*expected idx: 251, name: v.ast.BoolLiteral */ ).val) { branch->exprs = new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){*expr})); node->branches = new_array_from_c_array(1, 1, sizeof(v__ast__MatchBranch), _MOV((v__ast__MatchBranch[1]){*branch})); terminate = true; } } } - else if (cond._typ == 271 /* v.ast.IntegerLiteral */) { - if ((expr)->_typ == 271 /* v.ast.IntegerLiteral */) { - if (string_int((*cond._v__ast__IntegerLiteral).val) == string_int((/* as */ *(v__ast__IntegerLiteral*)__as_cast((expr)->_v__ast__IntegerLiteral,(expr)->_typ, 271) /*expected idx: 271, name: v.ast.IntegerLiteral */ ).val)) { + else if (cond._typ == 272 /* v.ast.IntegerLiteral */) { + if ((expr)->_typ == 272 /* v.ast.IntegerLiteral */) { + if (string_int((*cond._v__ast__IntegerLiteral).val) == string_int((/* as */ *(v__ast__IntegerLiteral*)__as_cast((expr)->_v__ast__IntegerLiteral,(expr)->_typ, 272) /*expected idx: 272, name: v.ast.IntegerLiteral */ ).val)) { branch->exprs = new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){*expr})); node->branches = new_array_from_c_array(1, 1, sizeof(v__ast__MatchBranch), _MOV((v__ast__MatchBranch[1]){*branch})); terminate = true; } } } - else if (cond._typ == 264 /* v.ast.FloatLiteral */) { - if ((expr)->_typ == 264 /* v.ast.FloatLiteral */) { - if (string_f32((*cond._v__ast__FloatLiteral).val) == string_f32((/* as */ *(v__ast__FloatLiteral*)__as_cast((expr)->_v__ast__FloatLiteral,(expr)->_typ, 264) /*expected idx: 264, name: v.ast.FloatLiteral */ ).val)) { + else if (cond._typ == 265 /* v.ast.FloatLiteral */) { + if ((expr)->_typ == 265 /* v.ast.FloatLiteral */) { + if (string_f32((*cond._v__ast__FloatLiteral).val) == string_f32((/* as */ *(v__ast__FloatLiteral*)__as_cast((expr)->_v__ast__FloatLiteral,(expr)->_typ, 265) /*expected idx: 265, name: v.ast.FloatLiteral */ ).val)) { branch->exprs = new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){*expr})); node->branches = new_array_from_c_array(1, 1, sizeof(v__ast__MatchBranch), _MOV((v__ast__MatchBranch[1]){*branch})); terminate = true; } } } - else if (cond._typ == 290 /* v.ast.StringLiteral */) { - if ((expr)->_typ == 290 /* v.ast.StringLiteral */) { - if (string__eq((*cond._v__ast__StringLiteral).val, (/* as */ *(v__ast__StringLiteral*)__as_cast((expr)->_v__ast__StringLiteral,(expr)->_typ, 290) /*expected idx: 290, name: v.ast.StringLiteral */ ).val)) { + else if (cond._typ == 291 /* v.ast.StringLiteral */) { + if ((expr)->_typ == 291 /* v.ast.StringLiteral */) { + if (string__eq((*cond._v__ast__StringLiteral).val, (/* as */ *(v__ast__StringLiteral*)__as_cast((expr)->_v__ast__StringLiteral,(expr)->_typ, 291) /*expected idx: 291, name: v.ast.StringLiteral */ ).val)) { branch->exprs = new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){*expr})); node->branches = new_array_from_c_array(1, 1, sizeof(v__ast__MatchBranch), _MOV((v__ast__MatchBranch[1]){*branch})); terminate = true; @@ -63052,8 +63135,8 @@ v__ast__Stmt v__transformer__Transformer_for_c_stmt(v__transformer__Transformer* v__ast__Stmt v__transformer__Transformer_for_stmt(v__transformer__Transformer* t, v__ast__ForStmt* node) { node->cond = v__transformer__Transformer_expr(t, &/*sum*/node->cond); - if (node->cond._typ == 250 /* v.ast.BoolLiteral */) { - if (!(/* as */ *(v__ast__BoolLiteral*)__as_cast((node->cond)._v__ast__BoolLiteral,(node->cond)._typ, 250) /*expected idx: 250, name: v.ast.BoolLiteral */ ).val) { + if (node->cond._typ == 251 /* v.ast.BoolLiteral */) { + if (!(/* as */ *(v__ast__BoolLiteral*)__as_cast((node->cond)._v__ast__BoolLiteral,(node->cond)._typ, 251) /*expected idx: 251, name: v.ast.BoolLiteral */ ).val) { v__ast__Stmt _t1 = v__ast__EmptyStmt_to_sumtype_v__ast__Stmt(ADDR(v__ast__EmptyStmt, (((v__ast__EmptyStmt){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},})))); return _t1; } @@ -63088,13 +63171,13 @@ v__ast__Stmt v__transformer__Transformer_interface_decl(v__transformer__Transfor } v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v__ast__Expr* node) { - if (node->_typ == 244 /* v.ast.AnonFn */) { - (*node->_v__ast__AnonFn).decl = /* as */ *(v__ast__FnDecl*)__as_cast((v__transformer__Transformer_stmt(t, HEAP(v__ast__Stmt, v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*node->_v__ast__AnonFn).decl))))._v__ast__FnDecl,(v__transformer__Transformer_stmt(t, HEAP(v__ast__Stmt, v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*node->_v__ast__AnonFn).decl))))._typ, 183) /*expected idx: 183, name: v.ast.FnDecl */ ; + if (node->_typ == 245 /* v.ast.AnonFn */) { + (*node->_v__ast__AnonFn).decl = /* as */ *(v__ast__FnDecl*)__as_cast((v__transformer__Transformer_stmt(t, HEAP(v__ast__Stmt, v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*node->_v__ast__AnonFn).decl))))._v__ast__FnDecl,(v__transformer__Transformer_stmt(t, HEAP(v__ast__Stmt, v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*node->_v__ast__AnonFn).decl))))._typ, 184) /*expected idx: 184, name: v.ast.FnDecl */ ; } - else if (node->_typ == 245 /* v.ast.ArrayDecompose */) { + else if (node->_typ == 246 /* v.ast.ArrayDecompose */) { (*node->_v__ast__ArrayDecompose).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ArrayDecompose).expr); } - else if (node->_typ == 246 /* v.ast.ArrayInit */) { + else if (node->_typ == 247 /* v.ast.ArrayInit */) { for (int _t1 = 0; _t1 < (*node->_v__ast__ArrayInit).exprs.len; ++_t1) { v__ast__Expr* expr = ((v__ast__Expr*)(*node->_v__ast__ArrayInit).exprs.data) + _t1; *expr = v__transformer__Transformer_expr(t, expr); @@ -63103,73 +63186,73 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ (*node->_v__ast__ArrayInit).cap_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ArrayInit).cap_expr); (*node->_v__ast__ArrayInit).default_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ArrayInit).default_expr); } - else if (node->_typ == 247 /* v.ast.AsCast */) { + else if (node->_typ == 248 /* v.ast.AsCast */) { (*node->_v__ast__AsCast).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__AsCast).expr); } - else if (node->_typ == 251 /* v.ast.CTempVar */) { + else if (node->_typ == 252 /* v.ast.CTempVar */) { (*node->_v__ast__CTempVar).orig = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CTempVar).orig); } - else if (node->_typ == 252 /* v.ast.CallExpr */) { + else if (node->_typ == 253 /* v.ast.CallExpr */) { (*node->_v__ast__CallExpr).left = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CallExpr).left); for (int _t2 = 0; _t2 < (*node->_v__ast__CallExpr).args.len; ++_t2) { v__ast__CallArg* arg = ((v__ast__CallArg*)(*node->_v__ast__CallExpr).args.data) + _t2; arg->expr = v__transformer__Transformer_expr(t, &/*sum*/arg->expr); } - (*node->_v__ast__CallExpr).or_block = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__CallExpr).or_block))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__CallExpr).or_block))))._typ, 280) /*expected idx: 280, name: v.ast.OrExpr */ ; + (*node->_v__ast__CallExpr).or_block = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__CallExpr).or_block))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__CallExpr).or_block))))._typ, 281) /*expected idx: 281, name: v.ast.OrExpr */ ; } - else if (node->_typ == 253 /* v.ast.CastExpr */) { + else if (node->_typ == 254 /* v.ast.CastExpr */) { (*node->_v__ast__CastExpr).arg = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CastExpr).arg); (*node->_v__ast__CastExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CastExpr).expr); } - else if (node->_typ == 254 /* v.ast.ChanInit */) { + else if (node->_typ == 255 /* v.ast.ChanInit */) { (*node->_v__ast__ChanInit).cap_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ChanInit).cap_expr); } - else if (node->_typ == 257 /* v.ast.ComptimeCall */) { + else if (node->_typ == 258 /* v.ast.ComptimeCall */) { for (int _t3 = 0; _t3 < (*node->_v__ast__ComptimeCall).args.len; ++_t3) { v__ast__CallArg* arg = ((v__ast__CallArg*)(*node->_v__ast__ComptimeCall).args.data) + _t3; arg->expr = v__transformer__Transformer_expr(t, &/*sum*/arg->expr); } } - else if (node->_typ == 258 /* v.ast.ComptimeSelector */) { + else if (node->_typ == 259 /* v.ast.ComptimeSelector */) { (*node->_v__ast__ComptimeSelector).left = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ComptimeSelector).left); (*node->_v__ast__ComptimeSelector).field_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ComptimeSelector).field_expr); } - else if (node->_typ == 260 /* v.ast.ConcatExpr */) { + else if (node->_typ == 261 /* v.ast.ConcatExpr */) { for (int _t4 = 0; _t4 < (*node->_v__ast__ConcatExpr).vals.len; ++_t4) { v__ast__Expr* val = ((v__ast__Expr*)(*node->_v__ast__ConcatExpr).vals.data) + _t4; *val = v__transformer__Transformer_expr(t, val); } } - else if (node->_typ == 261 /* v.ast.DumpExpr */) { + else if (node->_typ == 262 /* v.ast.DumpExpr */) { (*node->_v__ast__DumpExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__DumpExpr).expr); } - else if (node->_typ == 265 /* v.ast.GoExpr */) { - (*node->_v__ast__GoExpr).call_expr = /* as */ *(v__ast__CallExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__GoExpr).call_expr))))._v__ast__CallExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__GoExpr).call_expr))))._typ, 252) /*expected idx: 252, name: v.ast.CallExpr */ ; + else if (node->_typ == 266 /* v.ast.GoExpr */) { + (*node->_v__ast__GoExpr).call_expr = /* as */ *(v__ast__CallExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__GoExpr).call_expr))))._v__ast__CallExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__GoExpr).call_expr))))._typ, 253) /*expected idx: 253, name: v.ast.CallExpr */ ; } - else if (node->_typ == 267 /* v.ast.IfExpr */) { + else if (node->_typ == 268 /* v.ast.IfExpr */) { v__ast__Expr _t5 = v__transformer__Transformer_if_expr(t, (voidptr)&/*qq*/(*node->_v__ast__IfExpr)); return _t5; } - else if (node->_typ == 268 /* v.ast.IfGuardExpr */) { + else if (node->_typ == 269 /* v.ast.IfGuardExpr */) { (*node->_v__ast__IfGuardExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IfGuardExpr).expr); } - else if (node->_typ == 269 /* v.ast.IndexExpr */) { + else if (node->_typ == 270 /* v.ast.IndexExpr */) { v__transformer__Transformer_check_safe_array(t, (voidptr)&/*qq*/(*node->_v__ast__IndexExpr)); (*node->_v__ast__IndexExpr).left = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IndexExpr).left); (*node->_v__ast__IndexExpr).index = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IndexExpr).index); - (*node->_v__ast__IndexExpr).or_expr = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__IndexExpr).or_expr))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__IndexExpr).or_expr))))._typ, 280) /*expected idx: 280, name: v.ast.OrExpr */ ; + (*node->_v__ast__IndexExpr).or_expr = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__IndexExpr).or_expr))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__IndexExpr).or_expr))))._typ, 281) /*expected idx: 281, name: v.ast.OrExpr */ ; } - else if (node->_typ == 270 /* v.ast.InfixExpr */) { + else if (node->_typ == 271 /* v.ast.InfixExpr */) { v__ast__Expr _t6 = v__transformer__Transformer_infix_expr(t, (voidptr)&/*qq*/(*node->_v__ast__InfixExpr)); return _t6; } - else if (node->_typ == 272 /* v.ast.IsRefType */) { + else if (node->_typ == 273 /* v.ast.IsRefType */) { (*node->_v__ast__IsRefType).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IsRefType).expr); } - else if (node->_typ == 273 /* v.ast.Likely */) { + else if (node->_typ == 274 /* v.ast.Likely */) { (*node->_v__ast__Likely).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__Likely).expr); } - else if (node->_typ == 274 /* v.ast.LockExpr */) { + else if (node->_typ == 275 /* v.ast.LockExpr */) { for (int _t7 = 0; _t7 < (*node->_v__ast__LockExpr).stmts.len; ++_t7) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__LockExpr).stmts.data) + _t7; *stmt = v__transformer__Transformer_stmt(t, stmt); @@ -63179,7 +63262,7 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ *locked = v__transformer__Transformer_expr(t, locked); } } - else if (node->_typ == 275 /* v.ast.MapInit */) { + else if (node->_typ == 276 /* v.ast.MapInit */) { for (int _t9 = 0; _t9 < (*node->_v__ast__MapInit).keys.len; ++_t9) { v__ast__Expr* key = ((v__ast__Expr*)(*node->_v__ast__MapInit).keys.data) + _t9; *key = v__transformer__Transformer_expr(t, key); @@ -63189,31 +63272,31 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ *val = v__transformer__Transformer_expr(t, val); } } - else if (node->_typ == 276 /* v.ast.MatchExpr */) { + else if (node->_typ == 277 /* v.ast.MatchExpr */) { v__ast__Expr _t11 = v__transformer__Transformer_match_expr(t, (voidptr)&/*qq*/(*node->_v__ast__MatchExpr)); return _t11; } - else if (node->_typ == 280 /* v.ast.OrExpr */) { + else if (node->_typ == 281 /* v.ast.OrExpr */) { for (int _t12 = 0; _t12 < (*node->_v__ast__OrExpr).stmts.len; ++_t12) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__OrExpr).stmts.data) + _t12; *stmt = v__transformer__Transformer_stmt(t, stmt); } } - else if (node->_typ == 281 /* v.ast.ParExpr */) { + else if (node->_typ == 282 /* v.ast.ParExpr */) { (*node->_v__ast__ParExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ParExpr).expr); } - else if (node->_typ == 282 /* v.ast.PostfixExpr */) { + else if (node->_typ == 283 /* v.ast.PostfixExpr */) { (*node->_v__ast__PostfixExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__PostfixExpr).expr); } - else if (node->_typ == 283 /* v.ast.PrefixExpr */) { + else if (node->_typ == 284 /* v.ast.PrefixExpr */) { (*node->_v__ast__PrefixExpr).right = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__PrefixExpr).right); - (*node->_v__ast__PrefixExpr).or_block = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__PrefixExpr).or_block))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__PrefixExpr).or_block))))._typ, 280) /*expected idx: 280, name: v.ast.OrExpr */ ; + (*node->_v__ast__PrefixExpr).or_block = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__PrefixExpr).or_block))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__PrefixExpr).or_block))))._typ, 281) /*expected idx: 281, name: v.ast.OrExpr */ ; } - else if (node->_typ == 284 /* v.ast.RangeExpr */) { + else if (node->_typ == 285 /* v.ast.RangeExpr */) { (*node->_v__ast__RangeExpr).low = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__RangeExpr).low); (*node->_v__ast__RangeExpr).high = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__RangeExpr).high); } - else if (node->_typ == 285 /* v.ast.SelectExpr */) { + else if (node->_typ == 286 /* v.ast.SelectExpr */) { for (int _t13 = 0; _t13 < (*node->_v__ast__SelectExpr).branches.len; ++_t13) { v__ast__SelectBranch* branch = ((v__ast__SelectBranch*)(*node->_v__ast__SelectExpr).branches.data) + _t13; branch->stmt = v__transformer__Transformer_stmt(t, &/*sum*/branch->stmt); @@ -63223,27 +63306,27 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ } } } - else if (node->_typ == 286 /* v.ast.SelectorExpr */) { + else if (node->_typ == 287 /* v.ast.SelectorExpr */) { (*node->_v__ast__SelectorExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__SelectorExpr).expr); - if (((*node->_v__ast__SelectorExpr).expr)._typ == 290 /* v.ast.StringLiteral */ && string__eq((*node->_v__ast__SelectorExpr).field_name, _SLIT("len"))) { + if (((*node->_v__ast__SelectorExpr).expr)._typ == 291 /* v.ast.StringLiteral */ && string__eq((*node->_v__ast__SelectorExpr).field_name, _SLIT("len"))) { v__ast__Expr _t15 = v__ast__IntegerLiteral_to_sumtype_v__ast__Expr(ADDR(v__ast__IntegerLiteral, (((v__ast__IntegerLiteral){.val = int_str((*(*node->_v__ast__SelectorExpr).expr._v__ast__StringLiteral).val.len),.pos = (*node->_v__ast__SelectorExpr).pos,})))); return _t15; } } - else if (node->_typ == 287 /* v.ast.SizeOf */) { + else if (node->_typ == 288 /* v.ast.SizeOf */) { (*node->_v__ast__SizeOf).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__SizeOf).expr); } - else if (node->_typ == 288 /* v.ast.SqlExpr */) { + else if (node->_typ == 289 /* v.ast.SqlExpr */) { v__ast__Expr _t16 = v__transformer__Transformer_sql_expr(t, (voidptr)&/*qq*/(*node->_v__ast__SqlExpr)); return _t16; } - else if (node->_typ == 289 /* v.ast.StringInterLiteral */) { + else if (node->_typ == 290 /* v.ast.StringInterLiteral */) { for (int _t17 = 0; _t17 < (*node->_v__ast__StringInterLiteral).exprs.len; ++_t17) { v__ast__Expr* expr = ((v__ast__Expr*)(*node->_v__ast__StringInterLiteral).exprs.data) + _t17; *expr = v__transformer__Transformer_expr(t, expr); } } - else if (node->_typ == 291 /* v.ast.StructInit */) { + else if (node->_typ == 292 /* v.ast.StructInit */) { (*node->_v__ast__StructInit).update_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__StructInit).update_expr); for (int _t18 = 0; _t18 < (*node->_v__ast__StructInit).fields.len; ++_t18) { v__ast__StructInitField* field = ((v__ast__StructInitField*)(*node->_v__ast__StructInit).fields.data) + _t18; @@ -63254,7 +63337,7 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ embed->expr = v__transformer__Transformer_expr(t, &/*sum*/embed->expr); } } - else if (node->_typ == 294 /* v.ast.UnsafeExpr */) { + else if (node->_typ == 295 /* v.ast.UnsafeExpr */) { (*node->_v__ast__UnsafeExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__UnsafeExpr).expr); } @@ -63284,8 +63367,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* v__ast__Expr _t1 = v__ast__InfixExpr_to_sumtype_v__ast__Expr(node); return _t1; } else { - if (node->left._typ == 250 /* v.ast.BoolLiteral */) { - if (node->right._typ == 250 /* v.ast.BoolLiteral */) { + if (node->left._typ == 251 /* v.ast.BoolLiteral */) { + if (node->right._typ == 251 /* v.ast.BoolLiteral */) { if (node->op == (v__token__Kind__eq)) { v__ast__Expr _t2 = v__ast__BoolLiteral_to_sumtype_v__ast__Expr(ADDR(v__ast__BoolLiteral, (((v__ast__BoolLiteral){.val = (*node->left._v__ast__BoolLiteral).val == (*node->right._v__ast__BoolLiteral).val,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},})))); @@ -63311,8 +63394,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 290 /* v.ast.StringLiteral */) { - if (node->right._typ == 290 /* v.ast.StringLiteral */) { + else if (node->left._typ == 291 /* v.ast.StringLiteral */) { + if (node->right._typ == 291 /* v.ast.StringLiteral */) { if (node->op == (v__token__Kind__eq)) { v__ast__Expr _t6 = v__ast__BoolLiteral_to_sumtype_v__ast__Expr(ADDR(v__ast__BoolLiteral, (((v__ast__BoolLiteral){.val = string__eq((*node->left._v__ast__StringLiteral).val, (*node->right._v__ast__StringLiteral).val),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},})))); @@ -63334,8 +63417,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 271 /* v.ast.IntegerLiteral */) { - if (node->right._typ == 271 /* v.ast.IntegerLiteral */) { + else if (node->left._typ == 272 /* v.ast.IntegerLiteral */) { + if (node->right._typ == 272 /* v.ast.IntegerLiteral */) { i64 left_val = string_i64((*node->left._v__ast__IntegerLiteral).val); i64 right_val = string_i64((*node->right._v__ast__IntegerLiteral).val); switch (node->op) { @@ -63555,8 +63638,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 264 /* v.ast.FloatLiteral */) { - if (node->right._typ == 264 /* v.ast.FloatLiteral */) { + else if (node->left._typ == 265 /* v.ast.FloatLiteral */) { + if (node->right._typ == 265 /* v.ast.FloatLiteral */) { f32 left_val = string_f32((*node->left._v__ast__FloatLiteral).val); f32 right_val = string_f32((*node->right._v__ast__FloatLiteral).val); switch (node->op) { @@ -63756,16 +63839,16 @@ v__ast__Expr v__transformer__Transformer_if_expr(v__transformer__Transformer* t, v__ast__Stmt* stmt = ((v__ast__Stmt*)branch->stmts.data) + i; *stmt = v__transformer__Transformer_stmt(t, stmt); if (i == branch->stmts.len - 1) { - if ((stmt)->_typ == 306 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 307 /* v.ast.ExprStmt */) { v__ast__Expr expr = (*stmt->_v__ast__ExprStmt).expr; - if (expr._typ == 267 /* v.ast.IfExpr */) { + if (expr._typ == 268 /* v.ast.IfExpr */) { if ((*expr._v__ast__IfExpr).branches.len == 1) { (*(v__ast__Stmt*)array_pop(&branch->stmts)); _PUSH_MANY(&branch->stmts, ((*(v__ast__IfBranch*)/*ee elem_sym */array_get((*expr._v__ast__IfExpr).branches, 0)).stmts), _t2, Array_v__ast__Stmt); break; } } - else if (expr._typ == 276 /* v.ast.MatchExpr */) { + else if (expr._typ == 277 /* v.ast.MatchExpr */) { if ((*expr._v__ast__MatchExpr).branches.len == 1) { (*(v__ast__Stmt*)array_pop(&branch->stmts)); _PUSH_MANY(&branch->stmts, ((*(v__ast__MatchBranch*)/*ee elem_sym */array_get((*expr._v__ast__MatchExpr).branches, 0)).stmts), _t3, Array_v__ast__Stmt); @@ -63799,16 +63882,16 @@ v__ast__Expr v__transformer__Transformer_match_expr(v__transformer__Transformer* v__ast__Stmt* stmt = ((v__ast__Stmt*)branch->stmts.data) + i; *stmt = v__transformer__Transformer_stmt(t, stmt); if (i == branch->stmts.len - 1) { - if ((stmt)->_typ == 306 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 307 /* v.ast.ExprStmt */) { v__ast__Expr expr = (*stmt->_v__ast__ExprStmt).expr; - if (expr._typ == 267 /* v.ast.IfExpr */) { + if (expr._typ == 268 /* v.ast.IfExpr */) { if ((*expr._v__ast__IfExpr).branches.len == 1) { (*(v__ast__Stmt*)array_pop(&branch->stmts)); _PUSH_MANY(&branch->stmts, ((*(v__ast__IfBranch*)/*ee elem_sym */array_get((*expr._v__ast__IfExpr).branches, 0)).stmts), _t3, Array_v__ast__Stmt); break; } } - else if (expr._typ == 276 /* v.ast.MatchExpr */) { + else if (expr._typ == 277 /* v.ast.MatchExpr */) { if ((*expr._v__ast__MatchExpr).branches.len == 1) { (*(v__ast__Stmt*)array_pop(&branch->stmts)); _PUSH_MANY(&branch->stmts, ((*(v__ast__MatchBranch*)/*ee elem_sym */array_get((*expr._v__ast__MatchExpr).branches, 0)).stmts), _t4, Array_v__ast__Stmt); @@ -63857,7 +63940,7 @@ v__ast__Expr v__transformer__Transformer_sql_expr(v__transformer__Transformer* t } if (!DenseArray_has_index(&_t2.key_values, _t3)) {continue;} v__ast__SqlExpr* sub_struct = &(*(v__ast__SqlExpr*)DenseArray_value(&_t2.key_values, _t3)); - *sub_struct = /* as */ *(v__ast__SqlExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__SqlExpr_to_sumtype_v__ast__Expr(sub_struct))))._v__ast__SqlExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__SqlExpr_to_sumtype_v__ast__Expr(sub_struct))))._typ, 288) /*expected idx: 288, name: v.ast.SqlExpr */ ; + *sub_struct = /* as */ *(v__ast__SqlExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__SqlExpr_to_sumtype_v__ast__Expr(sub_struct))))._v__ast__SqlExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__SqlExpr_to_sumtype_v__ast__Expr(sub_struct))))._typ, 289) /*expected idx: 289, name: v.ast.SqlExpr */ ; } v__ast__Expr _t6 = v__ast__SqlExpr_to_sumtype_v__ast__Expr(node); return _t6; @@ -63903,7 +63986,7 @@ bool v__markused__mark_used_defer_0 = false; v__ast__FnDecl* mfn = &(*(v__ast__FnDecl*)DenseArray_value(&all_fns.key_values, _t2)); #if defined(CUSTOM_DEFINE_trace_skip_unused_all_fns) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("k: "), 0xfe10, {.d_s = k}}, {_SLIT(" | mfn: "), 0xfe10, {.d_s = mfn->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("k: "), /*115 &string*/0xfe10, {.d_s = k}}, {_SLIT(" | mfn: "), /*115 &string*/0xfe10, {.d_s = mfn->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif if (is_noscan_whitelisted && string_ends_with(mfn->name, _SLIT("_noscan"))) { @@ -63988,9 +64071,9 @@ bool v__markused__mark_used_defer_0 = false; if (_t25 = v__ast__Table_find_sym(table, _SLIT("main.BenchedTests")), _t25.state == 0) { v__ast__TypeSymbol* benched_tests_sym = *(v__ast__TypeSymbol**)_t25.data; v__ast__Type bts_type = (*(v__ast__Param*)/*ee elem_sym */array_get((*(v__ast__Fn*)/*ee elem_sym */array_get(benched_tests_sym->methods, 0)).params, 0)).typ; - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".testing_step_start"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".testing_step_end"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".end_testing"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".testing_step_start"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".testing_step_end"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".end_testing"), 0, { .d_c = 0 }}}))) })); array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(_SLIT("main.start_testing")) })); } } @@ -63999,10 +64082,10 @@ bool v__markused__mark_used_defer_0 = false; if (isym->kind != v__ast__Kind__interface_) { continue; } - if ((isym->info)._typ != 434 /* v.ast.Interface */) { + if ((isym->info)._typ != 435 /* v.ast.Interface */) { continue; } - v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; if (interface_info.methods.len == 0) { continue; } @@ -64015,10 +64098,10 @@ bool v__markused__mark_used_defer_0 = false; v__ast__Fn method = ((v__ast__Fn*)interface_info.methods.data)[_t32]; for (int _t33 = 0; _t33 < interface_types.len; ++_t33) { v__ast__Type typ = ((v__ast__Type*)interface_types.data)[_t33]; - string interface_implementation_method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(typ))}}, {_SLIT("."), 0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string interface_implementation_method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(typ))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); #if defined(CUSTOM_DEFINE_trace_skip_unused_interface_methods) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> isym.name: "), 0xfe10, {.d_s = isym->name}}, {_SLIT(" | interface_implementation_method_name: "), 0xfe10, {.d_s = interface_implementation_method_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> isym.name: "), /*115 &string*/0xfe10, {.d_s = isym->name}}, {_SLIT(" | interface_implementation_method_name: "), /*115 &string*/0xfe10, {.d_s = interface_implementation_method_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(interface_implementation_method_name) })); @@ -64030,7 +64113,7 @@ bool v__markused__mark_used_defer_0 = false; if (typ_vweb_result != 0) { array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(_SLIT("vweb.filter")) })); v__ast__Type typ_vweb_context = v__ast__Type_set_nr_muls(((v__ast__Table_find_type_idx(table, _SLIT("vweb.Context")))), 1); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(typ_vweb_context))}}, {_SLIT(".html"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(typ_vweb_context))}}, {_SLIT(".html"), 0, { .d_c = 0 }}}))) })); for (int _t37 = 0; _t37 < table->used_vweb_types.len; ++_t37) { v__ast__Type vgt = ((v__ast__Type*)table->used_vweb_types.data)[_t37]; v__ast__TypeSymbol* sym_app = v__ast__Table_sym(table, vgt); @@ -64038,7 +64121,7 @@ bool v__markused__mark_used_defer_0 = false; v__ast__Fn m = ((v__ast__Fn*)sym_app->methods.data)[_t38]; if (m.return_type == typ_vweb_result) { v__ast__Type pvgt = v__ast__Type_set_nr_muls(vgt, 1); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(pvgt))}}, {_SLIT("."), 0xfe10, {.d_s = m.name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(pvgt))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = m.name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } } @@ -64075,13 +64158,13 @@ bool v__markused__mark_used_defer_0 = false; } for (int _t46 = 0; _t46 < orm_connection_implementations.len; ++_t46) { v__ast__Type orm_type = ((v__ast__Type*)orm_connection_implementations.data)[_t46]; - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".select"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".insert"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".update"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".delete"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".create"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".drop"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".last_id"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".select"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".insert"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".update"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".delete"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".create"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".drop"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".last_id"), 0, { .d_c = 0 }}}))) })); } } if (pref->is_livemain) { @@ -64175,7 +64258,7 @@ bool v__markused__mark_used_defer_0 = false; if (!DenseArray_has_index(&_t64.key_values, _t65)) {continue;} string key = /*key*/ *(string*)DenseArray_key(&_t64.key_values, _t65); key = string_clone(key); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> used fn key: "), 0xfe10, {.d_s = key}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> used fn key: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } #endif @@ -64203,10 +64286,10 @@ bool v__markused__mark_used_defer_0 = false; table->used_globals = map_move(&walker.used_globals); #if defined(CUSTOM_DEFINE_trace_skip_unused) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> t.used_fns: "), 0xfe10, {.d_s = Array_string_str(map_keys(&table->used_fns))}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> t.used_consts: "), 0xfe10, {.d_s = Array_string_str(map_keys(&table->used_consts))}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> t.used_globals: "), 0xfe10, {.d_s = Array_string_str(map_keys(&table->used_globals))}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> walker.table.used_maps: "), 0xfe07, {.d_i32 = walker.table->used_maps}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> t.used_fns: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(map_keys(&table->used_fns))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> t.used_consts: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(map_keys(&table->used_consts))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> t.used_globals: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(map_keys(&table->used_globals))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> walker.table.used_maps: "), /*100 &int*/0xfe07, {.d_i32 = walker.table->used_maps}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif // Defer begin @@ -64227,18 +64310,18 @@ bool v__markused__all_fn_const_and_global_defer_0 = false; v__ast__File* file = (*(v__ast__File**)/*ee elem_sym */array_get(ast_files, i)); for (int _t1 = 0; _t1 < file->stmts.len; ++_t1) { v__ast__Stmt node = ((v__ast__Stmt*)file->stmts.data)[_t1]; - if (node._typ == 183 /* v.ast.FnDecl */) { + if (node._typ == 184 /* v.ast.FnDecl */) { string fkey = v__ast__FnDecl_fkey(&(*node._v__ast__FnDecl)); (*(v__ast__FnDecl*)map_get_and_set((map*)&all_fns, &(string[]){fkey}, &(v__ast__FnDecl[]){ (v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},} })) = (*node._v__ast__FnDecl); } - else if (node._typ == 302 /* v.ast.ConstDecl */) { + else if (node._typ == 303 /* v.ast.ConstDecl */) { for (int _t2 = 0; _t2 < (*node._v__ast__ConstDecl).fields.len; ++_t2) { v__ast__ConstField cfield = ((v__ast__ConstField*)(*node._v__ast__ConstDecl).fields.data)[_t2]; string ckey = cfield.name; (*(v__ast__ConstField*)map_get_and_set((map*)&all_consts, &(string[]){ckey}, &(v__ast__ConstField[]){ (v__ast__ConstField){.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.is_markused = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ = 0,.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.comptime_expr_value = v__ast__empty_comptime_const_expr(),} })) = cfield; } } - else if (node._typ == 310 /* v.ast.GlobalDecl */) { + else if (node._typ == 311 /* v.ast.GlobalDecl */) { for (int _t3 = 0; _t3 < (*node._v__ast__GlobalDecl).fields.len; ++_t3) { v__ast__GlobalField gfield = ((v__ast__GlobalField*)(*node._v__ast__GlobalDecl).fields.data)[_t3]; string gkey = gfield.name; @@ -64263,7 +64346,7 @@ bool v__markused__all_fn_const_and_global_defer_0 = false; void v__markused__Walker_mark_fn_as_used(v__markused__Walker* w, string fkey) { #if defined(CUSTOM_DEFINE_trace_skip_unused_marked) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" fn > |"), 0xfe10, {.d_s = fkey}}, {_SLIT("|"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" fn > |"), /*115 &string*/0xfe10, {.d_s = fkey}}, {_SLIT("|"), 0, { .d_c = 0 }}}))); } #endif map_set(&w->used_fns, &(string[]){fkey}, &(bool[]) { true }); @@ -64272,7 +64355,7 @@ void v__markused__Walker_mark_fn_as_used(v__markused__Walker* w, string fkey) { void v__markused__Walker_mark_const_as_used(v__markused__Walker* w, string ckey) { #if defined(CUSTOM_DEFINE_trace_skip_unused_marked) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" const > |"), 0xfe10, {.d_s = ckey}}, {_SLIT("|"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" const > |"), /*115 &string*/0xfe10, {.d_s = ckey}}, {_SLIT("|"), 0, { .d_c = 0 }}}))); } #endif if ((*(bool*)map_get(ADDR(map, w->used_consts), &(string[]){ckey}, &(bool[]){ 0 }))) { @@ -64299,7 +64382,7 @@ void v__markused__Walker_mark_const_as_used(v__markused__Walker* w, string ckey) void v__markused__Walker_mark_global_as_used(v__markused__Walker* w, string ckey) { #if defined(CUSTOM_DEFINE_trace_skip_unused_marked) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" global > |"), 0xfe10, {.d_s = ckey}}, {_SLIT("|"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" global > |"), /*115 &string*/0xfe10, {.d_s = ckey}}, {_SLIT("|"), 0, { .d_c = 0 }}}))); } #endif if ((*(bool*)map_get(ADDR(map, w->used_globals), &(string[]){ckey}, &(bool[]){ 0 }))) { @@ -64329,7 +64412,7 @@ void v__markused__Walker_mark_root_fns(v__markused__Walker* w, Array_string all_ if (!_IN_MAP(ADDR(string, fn_name), ADDR(map, w->used_fns))) { #if defined(CUSTOM_DEFINE_trace_skip_unused_roots) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>>> "), 0xfe10, {.d_s = fn_name}}, {_SLIT(" uses: "), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>>> "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" uses: "), 0, { .d_c = 0 }}}))); } #endif v__markused__Walker_fn_decl(w, (voidptr)&/*qq*/(*(v__ast__FnDecl*)map_get(ADDR(map, w->all_fns), &(string[]){fn_name}, &(v__ast__FnDecl[]){ (v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},} }))); @@ -64415,43 +64498,43 @@ void v__markused__Walker_mark_markused_globals(v__markused__Walker* w) { void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { v__ast__Stmt node = node_; - if (node._typ == 304 /* v.ast.EmptyStmt */) { + if (node._typ == 305 /* v.ast.EmptyStmt */) { } - else if (node._typ == 296 /* v.ast.AsmStmt */) { + else if (node._typ == 297 /* v.ast.AsmStmt */) { v__markused__Walker_asm_io(w, (*node._v__ast__AsmStmt).output); v__markused__Walker_asm_io(w, (*node._v__ast__AsmStmt).input); } - else if (node._typ == 297 /* v.ast.AssertStmt */) { + else if (node._typ == 298 /* v.ast.AssertStmt */) { if ((*node._v__ast__AssertStmt).is_used) { v__markused__Walker_expr(w, (*node._v__ast__AssertStmt).expr); w->n_asserts++; } } - else if (node._typ == 298 /* v.ast.AssignStmt */) { + else if (node._typ == 299 /* v.ast.AssignStmt */) { v__markused__Walker_exprs(w, (*node._v__ast__AssignStmt).left); v__markused__Walker_exprs(w, (*node._v__ast__AssignStmt).right); } - else if (node._typ == 299 /* v.ast.Block */) { + else if (node._typ == 300 /* v.ast.Block */) { v__markused__Walker_stmts(w, (*node._v__ast__Block).stmts); } - else if (node._typ == 301 /* v.ast.ComptimeFor */) { + else if (node._typ == 302 /* v.ast.ComptimeFor */) { v__markused__Walker_stmts(w, (*node._v__ast__ComptimeFor).stmts); } - else if (node._typ == 302 /* v.ast.ConstDecl */) { + else if (node._typ == 303 /* v.ast.ConstDecl */) { v__markused__Walker_const_fields(w, (*node._v__ast__ConstDecl).fields); } - else if (node._typ == 306 /* v.ast.ExprStmt */) { + else if (node._typ == 307 /* v.ast.ExprStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ExprStmt).expr); } - else if (node._typ == 183 /* v.ast.FnDecl */) { + else if (node._typ == 184 /* v.ast.FnDecl */) { v__markused__Walker_fn_decl(w, (voidptr)&/*qq*/(*node._v__ast__FnDecl)); } - else if (node._typ == 307 /* v.ast.ForCStmt */) { + else if (node._typ == 308 /* v.ast.ForCStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ForCStmt).cond); v__markused__Walker_stmt(w, (*node._v__ast__ForCStmt).inc); v__markused__Walker_stmts(w, (*node._v__ast__ForCStmt).stmts); } - else if (node._typ == 308 /* v.ast.ForInStmt */) { + else if (node._typ == 309 /* v.ast.ForInStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ForInStmt).cond); v__markused__Walker_expr(w, (*node._v__ast__ForInStmt).high); v__markused__Walker_stmts(w, (*node._v__ast__ForInStmt).stmts); @@ -64470,14 +64553,14 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { } } } - else if (node._typ == 309 /* v.ast.ForStmt */) { + else if (node._typ == 310 /* v.ast.ForStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ForStmt).cond); v__markused__Walker_stmts(w, (*node._v__ast__ForStmt).stmts); } - else if (node._typ == 317 /* v.ast.Return */) { + else if (node._typ == 318 /* v.ast.Return */) { v__markused__Walker_exprs(w, (*node._v__ast__Return).exprs); } - else if (node._typ == 318 /* v.ast.SqlStmt */) { + else if (node._typ == 319 /* v.ast.SqlStmt */) { v__markused__Walker_expr(w, (*node._v__ast__SqlStmt).db_expr); for (int _t2 = 0; _t2 < (*node._v__ast__SqlStmt).lines.len; ++_t2) { v__ast__SqlStmtLine line = ((v__ast__SqlStmtLine*)(*node._v__ast__SqlStmt).lines.data)[_t2]; @@ -64485,13 +64568,13 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { v__markused__Walker_exprs(w, line.update_exprs); } } - else if (node._typ == 319 /* v.ast.StructDecl */) { + else if (node._typ == 320 /* v.ast.StructDecl */) { v__markused__Walker_struct_fields(w, (*node._v__ast__StructDecl).fields); } - else if (node._typ == 303 /* v.ast.DeferStmt */) { + else if (node._typ == 304 /* v.ast.DeferStmt */) { v__markused__Walker_stmts(w, (*node._v__ast__DeferStmt).stmts); } - else if (node._typ == 310 /* v.ast.GlobalDecl */) { + else if (node._typ == 311 /* v.ast.GlobalDecl */) { for (int _t3 = 0; _t3 < (*node._v__ast__GlobalDecl).fields.len; ++_t3) { v__ast__GlobalField gf = ((v__ast__GlobalField*)(*node._v__ast__GlobalDecl).fields.data)[_t3]; if (gf.has_expr) { @@ -64499,25 +64582,25 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { } } } - else if (node._typ == 300 /* v.ast.BranchStmt */) { + else if (node._typ == 301 /* v.ast.BranchStmt */) { } - else if (node._typ == 305 /* v.ast.EnumDecl */) { + else if (node._typ == 306 /* v.ast.EnumDecl */) { } - else if (node._typ == 311 /* v.ast.GotoLabel */) { + else if (node._typ == 312 /* v.ast.GotoLabel */) { } - else if (node._typ == 312 /* v.ast.GotoStmt */) { + else if (node._typ == 313 /* v.ast.GotoStmt */) { } - else if (node._typ == 313 /* v.ast.HashStmt */) { + else if (node._typ == 314 /* v.ast.HashStmt */) { } - else if (node._typ == 314 /* v.ast.Import */) { + else if (node._typ == 315 /* v.ast.Import */) { } - else if (node._typ == 315 /* v.ast.InterfaceDecl */) { + else if (node._typ == 316 /* v.ast.InterfaceDecl */) { } - else if (node._typ == 316 /* v.ast.Module */) { + else if (node._typ == 317 /* v.ast.Module */) { } - else if (node._typ == 243 /* v.ast.TypeDecl */) { + else if (node._typ == 244 /* v.ast.TypeDecl */) { } - else if (node._typ == 277 /* v.ast.NodeError */) { + else if (node._typ == 278 /* v.ast.NodeError */) { } ; } @@ -64552,54 +64635,54 @@ VV_LOCAL_SYMBOL void v__markused__Walker_exprs(v__markused__Walker* w, Array_v__ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Expr node_) { v__ast__Expr node = node_; - if (node._typ == 262 /* v.ast.EmptyExpr */) { + if (node._typ == 263 /* v.ast.EmptyExpr */) { } - else if (node._typ == 259 /* v.ast.ComptimeType */) { + else if (node._typ == 260 /* v.ast.ComptimeType */) { } - else if (node._typ == 244 /* v.ast.AnonFn */) { + else if (node._typ == 245 /* v.ast.AnonFn */) { v__markused__Walker_fn_decl(w, (voidptr)&/*qq*/(*node._v__ast__AnonFn).decl); } - else if (node._typ == 246 /* v.ast.ArrayInit */) { + else if (node._typ == 247 /* v.ast.ArrayInit */) { v__markused__Walker_expr(w, (*node._v__ast__ArrayInit).len_expr); v__markused__Walker_expr(w, (*node._v__ast__ArrayInit).cap_expr); v__markused__Walker_expr(w, (*node._v__ast__ArrayInit).default_expr); v__markused__Walker_exprs(w, (*node._v__ast__ArrayInit).exprs); } - else if (node._typ == 248 /* v.ast.Assoc */) { + else if (node._typ == 249 /* v.ast.Assoc */) { v__markused__Walker_exprs(w, (*node._v__ast__Assoc).exprs); } - else if (node._typ == 245 /* v.ast.ArrayDecompose */) { + else if (node._typ == 246 /* v.ast.ArrayDecompose */) { v__markused__Walker_expr(w, (*node._v__ast__ArrayDecompose).expr); } - else if (node._typ == 252 /* v.ast.CallExpr */) { + else if (node._typ == 253 /* v.ast.CallExpr */) { v__markused__Walker_call_expr(w, (voidptr)&/*qq*/(*node._v__ast__CallExpr)); } - else if (node._typ == 253 /* v.ast.CastExpr */) { + else if (node._typ == 254 /* v.ast.CastExpr */) { v__markused__Walker_expr(w, (*node._v__ast__CastExpr).expr); v__markused__Walker_expr(w, (*node._v__ast__CastExpr).arg); } - else if (node._typ == 254 /* v.ast.ChanInit */) { + else if (node._typ == 255 /* v.ast.ChanInit */) { v__markused__Walker_expr(w, (*node._v__ast__ChanInit).cap_expr); } - else if (node._typ == 260 /* v.ast.ConcatExpr */) { + else if (node._typ == 261 /* v.ast.ConcatExpr */) { v__markused__Walker_exprs(w, (*node._v__ast__ConcatExpr).vals); } - else if (node._typ == 258 /* v.ast.ComptimeSelector */) { + else if (node._typ == 259 /* v.ast.ComptimeSelector */) { v__markused__Walker_expr(w, (*node._v__ast__ComptimeSelector).left); v__markused__Walker_expr(w, (*node._v__ast__ComptimeSelector).field_expr); } - else if (node._typ == 257 /* v.ast.ComptimeCall */) { + else if (node._typ == 258 /* v.ast.ComptimeCall */) { v__markused__Walker_expr(w, (*node._v__ast__ComptimeCall).left); if ((*node._v__ast__ComptimeCall).is_vweb) { v__markused__Walker_stmts(w, (*node._v__ast__ComptimeCall).vweb_tmpl.stmts); } } - else if (node._typ == 261 /* v.ast.DumpExpr */) { + else if (node._typ == 262 /* v.ast.DumpExpr */) { v__markused__Walker_expr(w, (*node._v__ast__DumpExpr).expr); v__markused__Walker_fn_by_name(w, _SLIT("eprint")); v__markused__Walker_fn_by_name(w, _SLIT("eprintln")); } - else if (node._typ == 265 /* v.ast.GoExpr */) { + else if (node._typ == 266 /* v.ast.GoExpr */) { v__markused__Walker_expr(w, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node._v__ast__GoExpr).call_expr)); if (w->pref->os == v__pref__OS__windows) { v__markused__Walker_fn_by_name(w, _SLIT("panic_lasterr")); @@ -64609,7 +64692,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_fn_by_name(w, _SLIT("panic_error_number")); } } - else if (node._typ == 269 /* v.ast.IndexExpr */) { + else if (node._typ == 270 /* v.ast.IndexExpr */) { v__markused__Walker_expr(w, (*node._v__ast__IndexExpr).left); v__markused__Walker_expr(w, (*node._v__ast__IndexExpr).index); v__markused__Walker_or_block(w, (*node._v__ast__IndexExpr).or_expr); @@ -64621,7 +64704,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex w->table->used_maps++; } } - else if (node._typ == 270 /* v.ast.InfixExpr */) { + else if (node._typ == 271 /* v.ast.InfixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__InfixExpr).left); v__markused__Walker_expr(w, (*node._v__ast__InfixExpr).right); v__markused__Walker_or_block(w, (*node._v__ast__InfixExpr).or_block); @@ -64644,10 +64727,10 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex w->table->used_maps++; } } - else if (node._typ == 268 /* v.ast.IfGuardExpr */) { + else if (node._typ == 269 /* v.ast.IfGuardExpr */) { v__markused__Walker_expr(w, (*node._v__ast__IfGuardExpr).expr); } - else if (node._typ == 267 /* v.ast.IfExpr */) { + else if (node._typ == 268 /* v.ast.IfExpr */) { v__markused__Walker_expr(w, (*node._v__ast__IfExpr).left); for (int _t2 = 0; _t2 < (*node._v__ast__IfExpr).branches.len; ++_t2) { v__ast__IfBranch b = ((v__ast__IfBranch*)(*node._v__ast__IfExpr).branches.data)[_t2]; @@ -64655,7 +64738,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_stmts(w, b.stmts); } } - else if (node._typ == 266 /* v.ast.Ident */) { + else if (node._typ == 267 /* v.ast.Ident */) { if ((*node._v__ast__Ident).kind == (v__ast__IdentKind__constant)) { v__markused__Walker_mark_const_as_used(w, (*node._v__ast__Ident).name); @@ -64669,15 +64752,15 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex else { }; } - else if (node._typ == 273 /* v.ast.Likely */) { + else if (node._typ == 274 /* v.ast.Likely */) { v__markused__Walker_expr(w, (*node._v__ast__Likely).expr); } - else if (node._typ == 275 /* v.ast.MapInit */) { + else if (node._typ == 276 /* v.ast.MapInit */) { v__markused__Walker_exprs(w, (*node._v__ast__MapInit).keys); v__markused__Walker_exprs(w, (*node._v__ast__MapInit).vals); w->table->used_maps++; } - else if (node._typ == 276 /* v.ast.MatchExpr */) { + else if (node._typ == 277 /* v.ast.MatchExpr */) { v__markused__Walker_expr(w, (*node._v__ast__MatchExpr).cond); for (int _t3 = 0; _t3 < (*node._v__ast__MatchExpr).branches.len; ++_t3) { v__ast__MatchBranch b = ((v__ast__MatchBranch*)(*node._v__ast__MatchExpr).branches.data)[_t3]; @@ -64685,18 +64768,18 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_stmts(w, b.stmts); } } - else if (node._typ == 278 /* v.ast.None */) { + else if (node._typ == 279 /* v.ast.None */) { } - else if (node._typ == 281 /* v.ast.ParExpr */) { + else if (node._typ == 282 /* v.ast.ParExpr */) { v__markused__Walker_expr(w, (*node._v__ast__ParExpr).expr); } - else if (node._typ == 283 /* v.ast.PrefixExpr */) { + else if (node._typ == 284 /* v.ast.PrefixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__PrefixExpr).right); } - else if (node._typ == 282 /* v.ast.PostfixExpr */) { + else if (node._typ == 283 /* v.ast.PostfixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__PostfixExpr).expr); } - else if (node._typ == 284 /* v.ast.RangeExpr */) { + else if (node._typ == 285 /* v.ast.RangeExpr */) { if ((*node._v__ast__RangeExpr).has_low) { v__markused__Walker_expr(w, (*node._v__ast__RangeExpr).low); } @@ -64704,32 +64787,32 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_expr(w, (*node._v__ast__RangeExpr).high); } } - else if (node._typ == 287 /* v.ast.SizeOf */) { + else if (node._typ == 288 /* v.ast.SizeOf */) { v__markused__Walker_expr(w, (*node._v__ast__SizeOf).expr); } - else if (node._typ == 272 /* v.ast.IsRefType */) { + else if (node._typ == 273 /* v.ast.IsRefType */) { v__markused__Walker_expr(w, (*node._v__ast__IsRefType).expr); } - else if (node._typ == 289 /* v.ast.StringInterLiteral */) { + else if (node._typ == 290 /* v.ast.StringInterLiteral */) { v__markused__Walker_exprs(w, (*node._v__ast__StringInterLiteral).exprs); } - else if (node._typ == 286 /* v.ast.SelectorExpr */) { + else if (node._typ == 287 /* v.ast.SelectorExpr */) { v__markused__Walker_expr(w, (*node._v__ast__SelectorExpr).expr); } - else if (node._typ == 288 /* v.ast.SqlExpr */) { + else if (node._typ == 289 /* v.ast.SqlExpr */) { v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).db_expr); v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).offset_expr); v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).order_expr); v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).limit_expr); v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).where_expr); } - else if (node._typ == 291 /* v.ast.StructInit */) { + else if (node._typ == 292 /* v.ast.StructInit */) { if ((*node._v__ast__StructInit).typ == 0) { return; } v__ast__TypeSymbol* sym = v__ast__Table_sym(w->table, (*node._v__ast__StructInit).typ); if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; for (int _t4 = 0; _t4 < info.fields.len; ++_t4) { v__ast__StructField ifield = ((v__ast__StructField*)info.fields.data)[_t4]; if (ifield.has_default_expr) { @@ -64755,52 +64838,52 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_expr(w, sie.expr); } } - else if (node._typ == 293 /* v.ast.TypeOf */) { + else if (node._typ == 294 /* v.ast.TypeOf */) { v__markused__Walker_expr(w, (*node._v__ast__TypeOf).expr); } - else if (node._typ == 247 /* v.ast.AsCast */) { + else if (node._typ == 248 /* v.ast.AsCast */) { v__markused__Walker_expr(w, (*node._v__ast__AsCast).expr); } - else if (node._typ == 249 /* v.ast.AtExpr */) { + else if (node._typ == 250 /* v.ast.AtExpr */) { } - else if (node._typ == 250 /* v.ast.BoolLiteral */) { + else if (node._typ == 251 /* v.ast.BoolLiteral */) { } - else if (node._typ == 264 /* v.ast.FloatLiteral */) { + else if (node._typ == 265 /* v.ast.FloatLiteral */) { } - else if (node._typ == 255 /* v.ast.CharLiteral */) { + else if (node._typ == 256 /* v.ast.CharLiteral */) { } - else if (node._typ == 271 /* v.ast.IntegerLiteral */) { + else if (node._typ == 272 /* v.ast.IntegerLiteral */) { } - else if (node._typ == 290 /* v.ast.StringLiteral */) { + else if (node._typ == 291 /* v.ast.StringLiteral */) { } - else if (node._typ == 251 /* v.ast.CTempVar */) { + else if (node._typ == 252 /* v.ast.CTempVar */) { v__markused__Walker_expr(w, (*node._v__ast__CTempVar).orig); } - else if (node._typ == 256 /* v.ast.Comment */) { + else if (node._typ == 257 /* v.ast.Comment */) { } - else if (node._typ == 263 /* v.ast.EnumVal */) { + else if (node._typ == 264 /* v.ast.EnumVal */) { } - else if (node._typ == 274 /* v.ast.LockExpr */) { + else if (node._typ == 275 /* v.ast.LockExpr */) { v__markused__Walker_stmts(w, (*node._v__ast__LockExpr).stmts); } - else if (node._typ == 279 /* v.ast.OffsetOf */) { + else if (node._typ == 280 /* v.ast.OffsetOf */) { } - else if (node._typ == 280 /* v.ast.OrExpr */) { + else if (node._typ == 281 /* v.ast.OrExpr */) { v__markused__Walker_or_block(w, (*node._v__ast__OrExpr)); } - else if (node._typ == 285 /* v.ast.SelectExpr */) { + else if (node._typ == 286 /* v.ast.SelectExpr */) { for (int _t7 = 0; _t7 < (*node._v__ast__SelectExpr).branches.len; ++_t7) { v__ast__SelectBranch branch = ((v__ast__SelectBranch*)(*node._v__ast__SelectExpr).branches.data)[_t7]; v__markused__Walker_stmt(w, branch.stmt); v__markused__Walker_stmts(w, branch.stmts); } } - else if (node._typ == 292 /* v.ast.TypeNode */) { + else if (node._typ == 293 /* v.ast.TypeNode */) { } - else if (node._typ == 294 /* v.ast.UnsafeExpr */) { + else if (node._typ == 295 /* v.ast.UnsafeExpr */) { v__markused__Walker_expr(w, (*node._v__ast__UnsafeExpr).expr); } - else if (node._typ == 277 /* v.ast.NodeError */) { + else if (node._typ == 278 /* v.ast.NodeError */) { } ; } @@ -64913,10 +64996,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init(v__gen__c__Gen* g, v__ast__ArrayI } if (g->is_shared) { shared_styp = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(array_type.typ, v__ast__TypeFlag__shared_f)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else if (is_amp) { array_styp = v__gen__c__Gen_typ(g, array_type.typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), 0xfe10, {.d_s = array_styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), /*115 &string*/0xfe10, {.d_s = array_styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); } int len = node.exprs.len; if (array_type.unaliased_sym->kind == v__ast__Kind__array_fixed) { @@ -64927,11 +65010,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init(v__gen__c__Gen* g, v__ast__ArrayI string elem_styp = v__gen__c__Gen_typ(g, elem_type.typ); string noscan = v__gen__c__Gen_check_noscan(g, elem_type.typ); if (elem_type.unaliased_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array("), 0xfe07, {.d_i32 = len}}, {_SLIT(", "), 0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(voidptr), _MOV((voidptr["), 0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(voidptr), _MOV((voidptr["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } else if (v__gen__c__Gen_is_empty_struct(g, elem_type)) { - v__gen__c__Gen_write(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe07, {.d_i32 = len}}, {_SLIT(", "), 0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(voidptr), _MOV(("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("["), 0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(voidptr), _MOV(("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe07, {.d_i32 = len}}, {_SLIT(", "), 0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("), _MOV(("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("["), 0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("), _MOV(("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } if (len > 8) { v__gen__c__Gen_writeln(g, _SLIT("")); @@ -64939,7 +65022,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init(v__gen__c__Gen* g, v__ast__ArrayI } for (int i = 0; i < node.exprs.len; ++i) { v__ast__Expr expr = ((v__ast__Expr*)node.exprs.data)[i]; - if (v__ast__Type_alias_eq((*(v__ast__Type*)/*ee elem_sym */array_get(node.expr_types, i)), _const_v__ast__string_type) && (expr)._typ != 290 /* v.ast.StringLiteral */ && (expr)._typ != 289 /* v.ast.StringInterLiteral */) { + if (v__ast__Type_alias_eq((*(v__ast__Type*)/*ee elem_sym */array_get(node.expr_types, i)), _const_v__ast__string_type) && (expr)._typ != 291 /* v.ast.StringLiteral */ && (expr)._typ != 290 /* v.ast.StringInterLiteral */) { v__gen__c__Gen_write(g, _SLIT("string_clone(")); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); @@ -64957,7 +65040,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init(v__gen__c__Gen* g, v__ast__ArrayI } v__gen__c__Gen_write(g, _SLIT("}))")); if (g->is_shared) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp) { v__gen__c__Gen_write(g, _SLIT(")")); } @@ -64974,7 +65057,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ string ret_typ = v__gen__c__Gen_typ(g, node.typ); string elem_typ = v__gen__c__Gen_typ(g, node.elem_type); g->empty_line = true; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" ="), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("{")); if (node.has_val) { for (int i = 0; i < node.exprs.len; ++i) { @@ -64989,7 +65072,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ } } else if (node.has_default) { v__gen__c__Gen_write(g, _SLIT("0")); - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((array_type.unaliased_sym->info)._v__ast__ArrayFixed,(array_type.unaliased_sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((array_type.unaliased_sym->info)._v__ast__ArrayFixed,(array_type.unaliased_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; for (int _t1 = 1; _t1 < info.size; ++_t1) { v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_write(g, _SLIT("0")); @@ -65001,8 +65084,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_writeln(g, _SLIT("{")); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_typ}}, {_SLIT("* pelem = ("), 0xfe10, {.d_s = elem_typ}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int _len = (int)sizeof("), 0xfe10, {.d_s = tmp}}, {_SLIT(") / sizeof("), 0xfe10, {.d_s = elem_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT("* pelem = ("), /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int _len = (int)sizeof("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(") / sizeof("), /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("for(int it=0; it<_len; it++, pelem++) {")); g->indent++; v__gen__c__Gen_write(g, _SLIT("*pelem = ")); @@ -65029,7 +65112,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ stmt_str = v__gen__c__Gen_go_before_stmt(g, 0); string ret_typ = v__gen__c__Gen_typ(g, node.typ); g->empty_line = true; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("{")); if (node.has_val) { @@ -65045,7 +65128,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ } } else if (node.has_default) { v__gen__c__Gen_expr(g, node.default_expr); - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((array_type.unaliased_sym->info)._v__ast__ArrayFixed,(array_type.unaliased_sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((array_type.unaliased_sym->info)._v__ast__ArrayFixed,(array_type.unaliased_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; for (int _t2 = 1; _t2 < info.size; ++_t2) { v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_expr(g, node.default_expr); @@ -65075,13 +65158,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ string ret_typ = v__gen__c__Gen_typ(g, node.typ); string elem_typ = v__gen__c__Gen_typ(g, node.elem_type); g->empty_line = true; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" ="), 0, { .d_c = 0 }}}))); if (is_default_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_array_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_array_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else if (is_default_map) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_map_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_map_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } if (node.has_len) { v__gen__c__Gen_expr(g, node.len_expr); @@ -65098,33 +65181,33 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ if (elem_type.unaliased_sym->kind == v__ast__Kind__function || v__gen__c__Gen_is_empty_struct(g, elem_type)) { v__gen__c__Gen_write(g, _SLIT("sizeof(voidptr), ")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); } if (is_default_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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, _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("&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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_write(g, _SLIT("_SLIT(\"\")")); v__gen__c__Gen_write(g, _SLIT("})")); } else if (node.has_len && (elem_type.unaliased_sym->kind == v__ast__Kind__array || elem_type.unaliased_sym->kind == v__ast__Kind__map)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr)&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr)&("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); 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 { v__gen__c__Gen_write(g, _SLIT("0)")); } if (g->is_shared) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp) { v__gen__c__Gen_write(g, _SLIT(")")); } v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_writeln(g, _SLIT("{")); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_typ}}, {_SLIT("* pelem = ("), 0xfe10, {.d_s = elem_typ}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("for(int it=0; it<"), 0xfe10, {.d_s = tmp}}, {_SLIT(".len; it++, pelem++) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT("* pelem = ("), /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("for(int it=0; it<"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".len; it++, pelem++) {"), 0, { .d_c = 0 }}}))); g->indent++; v__gen__c__Gen_write(g, _SLIT("*pelem = ")); v__gen__c__Gen_expr(g, node.default_expr); @@ -65143,11 +65226,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ return; } if (is_default_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_array_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_array_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else if (is_default_map) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_map_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_map_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } if (node.has_len) { v__gen__c__Gen_expr(g, node.len_expr); @@ -65164,29 +65247,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ if (elem_type.unaliased_sym->kind == v__ast__Kind__function || v__gen__c__Gen_is_empty_struct(g, elem_type)) { v__gen__c__Gen_write(g, _SLIT("sizeof(voidptr), ")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); } if (is_default_array || is_default_map) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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, _SLIT("}[0])")); } else if (node.has_default) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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_with_cast(g, node.default_expr, node.default_type, node.elem_type); v__gen__c__Gen_write(g, _SLIT("})")); } 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("&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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_write(g, _SLIT("_SLIT(\"\")")); v__gen__c__Gen_write(g, _SLIT("})")); } else if (node.has_len && (elem_type.unaliased_sym->kind == v__ast__Kind__array || elem_type.unaliased_sym->kind == v__ast__Kind__map)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr)&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr)&("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); 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 { v__gen__c__Gen_write(g, _SLIT("0)")); } if (g->is_shared) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp) { v__gen__c__Gen_write(g, _SLIT(")")); } @@ -65201,9 +65284,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal string ret_typ = v__gen__c__Gen_typ(g, node.return_type); v__ast__TypeSymbol* ret_sym = v__ast__Table_sym(g->table, node.return_type); v__ast__TypeSymbol* inp_sym = v__ast__Table_sym(g->table, node.receiver_type); - v__ast__Array ret_info = /* as */ *(v__ast__Array*)__as_cast((ret_sym->info)._v__ast__Array,(ret_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array ret_info = /* as */ *(v__ast__Array*)__as_cast((ret_sym->info)._v__ast__Array,(ret_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string ret_elem_type = v__gen__c__Gen_typ(g, ret_info.elem_type); - v__ast__Array inp_info = /* as */ *(v__ast__Array*)__as_cast((inp_sym->info)._v__ast__Array,(inp_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array inp_info = /* as */ *(v__ast__Array*)__as_cast((inp_sym->info)._v__ast__Array,(inp_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string inp_elem_type = v__gen__c__Gen_typ(g, inp_info.elem_type); if (inp_sym->kind != v__ast__Kind__array) { v__gen__c__verror(_SLIT("map() requires an array")); @@ -65211,43 +65294,43 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal } g->empty_line = true; string noscan = v__gen__c__Gen_check_noscan(g, ret_info.elem_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); bool has_infix_left_var_name = g->infix_left_var_name.len > 0; if (has_infix_left_var_name) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); 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__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + 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 }}}))); 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")); } v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT(" = __new_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len, sizeof("), 0xfe10, {.d_s = ret_elem_type}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = __new_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len, sizeof("), /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); string i = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = inp_elem_type}}, {_SLIT(" it = (("), 0xfe10, {.d_s = inp_elem_type}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = inp_elem_type}}, {_SLIT(" it = (("), /*115 &string*/0xfe10, {.d_s = inp_elem_type}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); bool is_embed_map_filter = false; v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (expr._typ == 244 /* v.ast.AnonFn */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); + if (expr._typ == 245 /* v.ast.AnonFn */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr._v__ast__AnonFn)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 266 /* v.ast.Ident */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); + else if (expr._typ == 267 /* v.ast.Ident */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*expr._v__ast__Ident)); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, var_info.typ); if (sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } @@ -65255,22 +65338,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } } - else if (expr._typ == 252 /* v.ast.CallExpr */) { + else if (expr._typ == 253 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("map")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("any"))) { is_embed_map_filter = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } ; v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("array_push"), 0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&"), 0xfe10, {.d_s = tmp}}, {_SLIT(", &ti);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("array_push"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(", &ti);"), 0, { .d_c = 0 }}}))); g->indent--; v__gen__c__Gen_writeln(g, _SLIT("}")); if (!is_embed_map_filter) { @@ -65301,9 +65384,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort(v__gen__c__Gen* g, v__ast__Ca v__gen__c__Gen_writeln(g, _SLIT("bare_panic(_SLIT(\"sort does not work with -freestanding\"))")); return; } - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((rec_sym->info)._v__ast__Array,(rec_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((rec_sym->info)._v__ast__Array,(rec_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string elem_stype = v__gen__c__Gen_typ(g, info.elem_type); - string compare_fn = str_intp(3, _MOV((StrIntpData[]){{_SLIT("compare_"), 0xfe08, {.d_u64 = g->unique_file_path_hash}}, {_SLIT("_"), 0xfe10, {.d_s = string_replace(elem_stype, _SLIT("*"), _SLIT("_ptr"))}}, {_SLIT0, 0, { .d_c = 0 }}})); + string compare_fn = str_intp(3, _MOV((StrIntpData[]){{_SLIT("compare_"), /*117 &u64*/0xfe08, {.d_u64 = g->unique_file_path_hash}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = string_replace(elem_stype, _SLIT("*"), _SLIT("_ptr"))}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Type comparison_type = v__gen__c__Gen_unwrap(g, _const_v__ast__void_type); string left_expr = _SLIT(""); string right_expr = _SLIT(""); @@ -65320,7 +65403,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort(v__gen__c__Gen* g, v__ast__Ca left_expr = _SLIT("*a"); right_expr = _SLIT("*b"); } else { - v__ast__InfixExpr infix_expr = /* as */ *(v__ast__InfixExpr*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._v__ast__InfixExpr,((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ, 270) /*expected idx: 270, name: v.ast.InfixExpr */ ; + v__ast__InfixExpr infix_expr = /* as */ *(v__ast__InfixExpr*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._v__ast__InfixExpr,((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ, 271) /*expected idx: 271, name: v.ast.InfixExpr */ ; comparison_type = v__gen__c__Gen_unwrap(g, v__ast__Type_set_nr_muls(infix_expr.left_type, 0)); string left_name = v__ast__Expr_str(infix_expr.left); if (left_name.len > 1) { @@ -65341,19 +65424,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort(v__gen__c__Gen* g, v__ast__Ca if (string_starts_with(left_name, _SLIT("a")) != is_reverse) { left_expr = v__gen__c__Gen_expr_string(g, infix_expr.left); right_expr = v__gen__c__Gen_expr_string(g, infix_expr.right); - if ((infix_expr.left)._typ == 266 /* v.ast.Ident */) { + if ((infix_expr.left)._typ == 267 /* v.ast.Ident */) { left_expr = string__plus(_SLIT("*"), left_expr); } - if ((infix_expr.right)._typ == 266 /* v.ast.Ident */) { + if ((infix_expr.right)._typ == 267 /* v.ast.Ident */) { right_expr = string__plus(_SLIT("*"), right_expr); } } else { left_expr = v__gen__c__Gen_expr_string(g, infix_expr.right); right_expr = v__gen__c__Gen_expr_string(g, infix_expr.left); - if ((infix_expr.left)._typ == 266 /* v.ast.Ident */) { + if ((infix_expr.left)._typ == 267 /* v.ast.Ident */) { right_expr = string__plus(_SLIT("*"), right_expr); } - if ((infix_expr.right)._typ == 266 /* v.ast.Ident */) { + if ((infix_expr.right)._typ == 267 /* v.ast.Ident */) { left_expr = string__plus(_SLIT("*"), left_expr); } } @@ -65364,9 +65447,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort(v__gen__c__Gen* g, v__ast__Ca } sync__RwMutex_unlock(&g->array_sort_fn->mtx);; string stype_arg = v__gen__c__Gen_typ(g, info.elem_type); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("VV_LOCAL_SYMBOL int "), 0xfe10, {.d_s = compare_fn}}, {_SLIT("("), 0xfe10, {.d_s = stype_arg}}, {_SLIT("* a, "), 0xfe10, {.d_s = stype_arg}}, {_SLIT("* b) {"), 0, { .d_c = 0 }}}))); - string c_condition = (v__ast__TypeSymbol_has_method(comparison_type.sym, _SLIT("<")) ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, comparison_type.typ)}}, {_SLIT("__lt("), 0xfe10, {.d_s = left_expr}}, {_SLIT(", "), 0xfe10, {.d_s = right_expr}}, {_SLIT(")"), 0, { .d_c = 0 }}}))) : v__ast__TypeSymbol_has_method(comparison_type.unaliased_sym, _SLIT("<")) ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, comparison_type.unaliased)}}, {_SLIT("__lt("), 0xfe10, {.d_s = left_expr}}, {_SLIT(", "), 0xfe10, {.d_s = right_expr}}, {_SLIT(")"), 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left_expr}}, {_SLIT(" < "), 0xfe10, {.d_s = right_expr}}, {_SLIT0, 0, { .d_c = 0 }}})))); - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = c_condition}}, {_SLIT(") return -1;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("VV_LOCAL_SYMBOL int "), /*115 &string*/0xfe10, {.d_s = compare_fn}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = stype_arg}}, {_SLIT("* a, "), /*115 &string*/0xfe10, {.d_s = stype_arg}}, {_SLIT("* b) {"), 0, { .d_c = 0 }}}))); + string c_condition = (v__ast__TypeSymbol_has_method(comparison_type.sym, _SLIT("<")) ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, comparison_type.typ)}}, {_SLIT("__lt("), /*115 &string*/0xfe10, {.d_s = left_expr}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = right_expr}}, {_SLIT(")"), 0, { .d_c = 0 }}}))) : v__ast__TypeSymbol_has_method(comparison_type.unaliased_sym, _SLIT("<")) ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, comparison_type.unaliased)}}, {_SLIT("__lt("), /*115 &string*/0xfe10, {.d_s = left_expr}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = right_expr}}, {_SLIT(")"), 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_expr}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = right_expr}}, {_SLIT0, 0, { .d_c = 0 }}})))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = c_condition}}, {_SLIT(") return -1;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->definitions, _SLIT("\telse return 1;")); strings__Builder_writeln(&g->definitions, _SLIT("}\n")); v__gen__c__Gen_gen_array_sort_call(g, node, compare_fn); @@ -65377,11 +65460,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort_call(v__gen__c__Gen* g, v__as g->empty_line = true; v__gen__c__Gen_write(g, _SLIT("qsort(")); v__gen__c__Gen_expr(g, node.left); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = deref_field}}, {_SLIT("data, "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = deref_field}}, {_SLIT("data, "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = deref_field}}, {_SLIT("len, "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = deref_field}}, {_SLIT("len, "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = deref_field}}, {_SLIT("element_size, (int (*)(const void *, const void *))&"), 0xfe10, {.d_s = compare_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = deref_field}}, {_SLIT("element_size, (int (*)(const void *, const void *))&"), /*115 &string*/0xfe10, {.d_s = compare_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__CallExpr node) { @@ -65394,48 +65477,48 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ v__gen__c__verror(_SLIT("filter() requires an array")); VUNREACHABLE(); } - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string styp = v__gen__c__Gen_typ(g, node.return_type); string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); g->empty_line = true; string noscan = v__gen__c__Gen_check_noscan(g, info.elem_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); bool has_infix_left_var_name = g->infix_left_var_name.len > 0; if (has_infix_left_var_name) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); 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__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + 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 }}}))); 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")); } v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT(" = __new_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len, sizeof("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = __new_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len, sizeof("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); string i = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); bool is_embed_map_filter = false; v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (expr._typ == 244 /* v.ast.AnonFn */) { + if (expr._typ == 245 /* v.ast.AnonFn */) { v__gen__c__Gen_write(g, _SLIT("if (")); v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr._v__ast__AnonFn)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 266 /* v.ast.Ident */) { + else if (expr._typ == 267 /* v.ast.Ident */) { v__gen__c__Gen_write(g, _SLIT("if (")); if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*expr._v__ast__Ident)); v__ast__TypeSymbol* sym_t = v__ast__Table_sym(g->table, var_info.typ); if (sym_t->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } @@ -65443,7 +65526,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } } - else if (expr._typ == 252 /* v.ast.CallExpr */) { + else if (expr._typ == 253 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("map")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("any"))) { is_embed_map_filter = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); @@ -65458,7 +65541,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ } ; v__gen__c__Gen_writeln(g, _SLIT(") {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tarray_push"), 0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&"), 0xfe10, {.d_s = tmp}}, {_SLIT(", &it);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tarray_push"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(", &it);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -65479,15 +65562,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_insert(v__gen__c__Gen* g, v__ast__CallExpr node) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, node.left_type); - v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, left_info.elem_type); v__ast__TypeSymbol* arg2_sym = v__ast__Table_sym(g->table, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 1)).typ); bool is_arg2_array = arg2_sym->kind == v__ast__Kind__array && v__ast__Type_alias_eq((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 1)).typ, node.left_type); string noscan = v__gen__c__Gen_check_noscan(g, left_info.elem_type); if (is_arg2_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_insert_many"), 0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_insert_many"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_insert"), 0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_insert"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); @@ -65499,7 +65582,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_insert(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 1)).expr); v__gen__c__Gen_write(g, _SLIT(".len)")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); if (v__ast__Type_alias_eq(left_info.elem_type, _const_v__ast__string_type)) { v__gen__c__Gen_write(g, _SLIT("string_clone(")); } @@ -65513,15 +65596,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_insert(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_prepend(v__gen__c__Gen* g, v__ast__CallExpr node) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, node.left_type); - v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, left_info.elem_type); v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(g->table, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).typ); bool is_arg_array = arg_sym->kind == v__ast__Kind__array && v__ast__Type_alias_eq((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).typ, node.left_type); string noscan = v__gen__c__Gen_check_noscan(g, left_info.elem_type); if (is_arg_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_prepend_many"), 0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_prepend_many"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_prepend"), 0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_prepend"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.left); if (is_arg_array) { @@ -65531,7 +65614,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_prepend(v__gen__c__Gen* g, v__ast_ v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); v__gen__c__Gen_write(g, _SLIT(".len)")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr_with_cast(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).typ, left_info.elem_type); v__gen__c__Gen_write(g, _SLIT("})")); } @@ -65554,42 +65637,42 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains_methods(v__gen__c__Gen* g } array_push((array*)&done, _MOV((v__ast__Type[]){ t })); string left_type_str = v__gen__c__Gen_typ(g, t); - string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left_type_str}}, {_SLIT("_contains"), 0, { .d_c = 0 }}})); - v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_final_sym->info)._v__ast__Array,(left_final_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT("_contains"), 0, { .d_c = 0 }}})); + v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_final_sym->info)._v__ast__Array,(left_final_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, left_info.elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, left_info.elem_type); if (elem_sym->kind == v__ast__Kind__function) { left_type_str = _SLIT("Array_voidptr"); elem_type_str = _SLIT("voidptr"); } - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tfor (int i = 0; i < a.len; ++i) {")); if (elem_sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (fast_string_eq(((string*)a.data)[i], v)) {")); } else if (elem_sym->kind == v__ast__Kind__array && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__function) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (((voidptr*)a.data)[i] == v) {")); } else if (elem_sym->kind == v__ast__Kind__map && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__struct_ && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__interface_ && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__sum_type && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__alias && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i] == v) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i] == v) {"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&fn_builder, _SLIT("\t\t\treturn true;")); strings__Builder_writeln(&fn_builder, _SLIT("\t\t}")); @@ -65602,7 +65685,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains_methods(v__gen__c__Gen* g VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains(v__gen__c__Gen* g, v__ast__Type typ, v__ast__Expr left, v__ast__Expr right) { string fn_name = v__gen__c__Gen_get_array_contains_method(g, typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, strings__repeat('*', v__ast__Type_nr_muls(typ))); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { strings__Builder_go_back(&g->out, 1); @@ -65636,41 +65719,41 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_index_methods(v__gen__c__Gen* g) { array_push((array*)&done, _MOV((v__ast__Type[]){ t })); v__ast__TypeSymbol* final_left_sym = v__ast__Table_final_sym(g->table, t); string left_type_str = v__gen__c__Gen_typ(g, t); - string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left_type_str}}, {_SLIT("_index"), 0, { .d_c = 0 }}})); - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((final_left_sym->info)._v__ast__Array,(final_left_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT("_index"), 0, { .d_c = 0 }}})); + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((final_left_sym->info)._v__ast__Array,(final_left_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, info.elem_type); if (elem_sym->kind == v__ast__Kind__function) { left_type_str = _SLIT("Array_voidptr"); elem_type_str = _SLIT("voidptr"); } - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static int "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static int "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static int "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("* pelem = a.data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static int "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("* pelem = a.data;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tfor (int i = 0; i < a.len; ++i, ++pelem) {")); if (elem_sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (fast_string_eq(*pelem, v)) {")); } else if (elem_sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(info.elem_type)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__function && !v__ast__Type_is_ptr(info.elem_type)) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif ( pelem == v) {")); } else if (elem_sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(info.elem_type)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq((*pelem, v))) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq((*pelem, v))) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(info.elem_type)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__interface_) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__sum_type) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__alias) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (*pelem == v) {")); } @@ -65685,7 +65768,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_index_methods(v__gen__c__Gen* g) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_index(v__gen__c__Gen* g, v__ast__CallExpr node) { string fn_name = v__gen__c__Gen_get_array_index_method(g, node.left_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(node.left_type)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -65705,7 +65788,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_wait(v__gen__c__Gen* g, v__ast__Ca v__ast__Type thread_ret_type = v__ast__TypeSymbol_thread_info(thread_sym).return_type; string eltyp = v__ast__Table_sym(g->table, thread_ret_type)->cname; string fn_name = v__gen__c__Gen_register_thread_array_wait_call(g, eltyp); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(")")); } @@ -65716,41 +65799,41 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal bool s_ends_with_ln = string_ends_with(s, _SLIT("\n")); s = string_trim_space(s); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.left_type); - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); bool has_infix_left_var_name = g->infix_left_var_name.len > 0; if (has_infix_left_var_name) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->infix_left_var_name = _SLIT(""); g->indent++; } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.left_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); string i = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); bool is_embed_map_filter = false; v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (expr._typ == 244 /* v.ast.AnonFn */) { + if (expr._typ == 245 /* v.ast.AnonFn */) { v__gen__c__Gen_write(g, _SLIT("if (")); v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr._v__ast__AnonFn)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 266 /* v.ast.Ident */) { + else if (expr._typ == 267 /* v.ast.Ident */) { v__gen__c__Gen_write(g, _SLIT("if (")); if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*expr._v__ast__Ident)); v__ast__TypeSymbol* sym_t = v__ast__Table_sym(g->table, var_info.typ); if (sym_t->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } @@ -65758,7 +65841,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } } - else if (expr._typ == 252 /* v.ast.CallExpr */) { + else if (expr._typ == 253 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("map")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("any"))) { is_embed_map_filter = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); @@ -65773,7 +65856,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal } ; v__gen__c__Gen_writeln(g, _SLIT(") {")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tbreak;")); v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; @@ -65799,42 +65882,42 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__Cal bool s_ends_with_ln = string_ends_with(s, _SLIT("\n")); s = string_trim_space(s); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.left_type); - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); bool has_infix_left_var_name = g->infix_left_var_name.len > 0; if (has_infix_left_var_name) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->infix_left_var_name = _SLIT(""); g->indent++; } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.left_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); string i = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); g->empty_line = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); bool is_embed_map_filter = false; v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (expr._typ == 244 /* v.ast.AnonFn */) { + if (expr._typ == 245 /* v.ast.AnonFn */) { v__gen__c__Gen_write(g, _SLIT("if (!(")); v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr._v__ast__AnonFn)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 266 /* v.ast.Ident */) { + else if (expr._typ == 267 /* v.ast.Ident */) { v__gen__c__Gen_write(g, _SLIT("if (!(")); if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*expr._v__ast__Ident)); v__ast__TypeSymbol* sym_t = v__ast__Table_sym(g->table, var_info.typ); if (sym_t->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } @@ -65842,7 +65925,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__Cal v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } } - else if (expr._typ == 252 /* v.ast.CallExpr */) { + else if (expr._typ == 253 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("map")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("any"))) { is_embed_map_filter = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); @@ -65857,7 +65940,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__Cal } ; v__gen__c__Gen_writeln(g, _SLIT(")) {")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tbreak;")); v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; @@ -65883,7 +65966,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__A } v__ast__AssertStmt node = original_assert_statement; v__gen__c__Gen_writeln(g, _SLIT("// assert")); - if ((node.expr)._typ == 270 /* v.ast.InfixExpr */) { + if ((node.expr)._typ == 271 /* v.ast.InfixExpr */) { Option_v__ast__Expr _t1; if (_t1 = v__gen__c__Gen_assert_subexpression_to_ctemp(g, (*node.expr._v__ast__InfixExpr).left, (*node.expr._v__ast__InfixExpr).left_type), _t1.state == 0) { v__ast__Expr subst_expr = *(v__ast__Expr*)_t1.data; @@ -65903,10 +65986,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__A v__gen__c__Gen_decrement_inside_ternary(g); v__gen__c__Gen_writeln(g, _SLIT(" {")); string metaname_ok = v__gen__c__Gen_gen_assert_metainfo(g, node); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_assert_pass(test_runner._object, &"), 0xfe10, {.d_s = metaname_ok}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_assert_pass(test_runner._object, &"), /*115 &string*/0xfe10, {.d_s = metaname_ok}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("} else {")); string metaname_fail = v__gen__c__Gen_gen_assert_metainfo(g, node); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_assert_fail(test_runner._object, &"), 0xfe10, {.d_s = metaname_fail}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_assert_fail(test_runner._object, &"), /*115 &string*/0xfe10, {.d_s = metaname_fail}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assert_postfailure_mode(g, node); v__gen__c__Gen_writeln(g, _SLIT("\tlongjmp(g_jump_buffer, 1);")); v__gen__c__Gen_writeln(g, _SLIT("\t// TODO")); @@ -65919,7 +66002,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__A v__gen__c__Gen_decrement_inside_ternary(g); v__gen__c__Gen_writeln(g, _SLIT(" {")); string metaname_panic = v__gen__c__Gen_gen_assert_metainfo(g, node); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t__print_assert_failure(&"), 0xfe10, {.d_s = metaname_panic}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t__print_assert_failure(&"), /*115 &string*/0xfe10, {.d_s = metaname_panic}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assert_postfailure_mode(g, node); v__gen__c__Gen_writeln(g, _SLIT("\t_v_panic(_SLIT(\"Assertion failed...\"));")); v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -65927,23 +66010,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__A } VV_LOCAL_SYMBOL Option_v__ast__Expr v__gen__c__Gen_assert_subexpression_to_ctemp(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type expr_type) { - if (expr._typ == 252 /* v.ast.CallExpr */) { + if (expr._typ == 253 /* v.ast.CallExpr */) { Option_v__ast__Expr _t1; opt_ok(&(v__ast__Expr[]) { v__ast__CTempVar_to_sumtype_v__ast__Expr(ADDR(v__ast__CTempVar, (v__gen__c__Gen_new_ctemp_var_then_gen(g, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*expr._v__ast__CallExpr)), expr_type)))) }, (Option*)(&_t1), sizeof(v__ast__Expr)); return _t1; } - else if (expr._typ == 281 /* v.ast.ParExpr */) { - if (((*expr._v__ast__ParExpr).expr)._typ == 252 /* v.ast.CallExpr */) { + else if (expr._typ == 282 /* v.ast.ParExpr */) { + if (((*expr._v__ast__ParExpr).expr)._typ == 253 /* v.ast.CallExpr */) { Option_v__ast__Expr _t2; opt_ok(&(v__ast__Expr[]) { v__ast__CTempVar_to_sumtype_v__ast__Expr(ADDR(v__ast__CTempVar, (v__gen__c__Gen_new_ctemp_var_then_gen(g, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*(*expr._v__ast__ParExpr).expr._v__ast__CallExpr)), expr_type)))) }, (Option*)(&_t2), sizeof(v__ast__Expr)); return _t2; } } - else if (expr._typ == 286 /* v.ast.SelectorExpr */) { - if (((*expr._v__ast__SelectorExpr).expr)._typ == 252 /* v.ast.CallExpr */) { + else if (expr._typ == 287 /* v.ast.SelectorExpr */) { + if (((*expr._v__ast__SelectorExpr).expr)._typ == 253 /* v.ast.CallExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_final_sym(g->table, v__gen__c__Gen_unwrap_generic(g, (*(*expr._v__ast__SelectorExpr).expr._v__ast__CallExpr).return_type)); if (sym->kind == v__ast__Kind__struct_) { - if ((/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).is_union) { + if ((/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).is_union) { return (Option_v__ast__Expr){ .state=2, .err=_const_v__gen__c__unsupported_ctemp_assert_transform, .data={EMPTY_STRUCT_INITIALIZATION} }; } } @@ -65977,29 +66060,29 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ string fn_name = g->fn_decl->name; int line_nr = node.pos.line_nr; string src = v__gen__c__cestring(v__ast__Expr_str(node.expr)); - string metaname = str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_assert_meta_info_"), 0xfe10, {.d_s = v__gen__c__Gen_new_tmp_var(g)}}, {_SLIT0, 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tVAssertMetaInfo "), 0xfe10, {.d_s = metaname}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".fpath = "), 0xfe10, {.d_s = v__gen__c__ctoslit(mod_path)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".line_nr = "), 0xfe07, {.d_i32 = line_nr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".fn_name = "), 0xfe10, {.d_s = v__gen__c__ctoslit(fn_name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + string metaname = str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_assert_meta_info_"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_new_tmp_var(g)}}, {_SLIT0, 0, { .d_c = 0 }}})); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tVAssertMetaInfo "), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".fpath = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(mod_path)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".line_nr = "), /*100 &int*/0xfe07, {.d_i32 = line_nr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".fn_name = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(fn_name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); string metasrc = v__gen__c__cnewlines(v__gen__c__ctoslit(src)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".src = "), 0xfe10, {.d_s = metasrc}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - if (node.expr._typ == 270 /* v.ast.InfixExpr */) { + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".src = "), /*115 &string*/0xfe10, {.d_s = metasrc}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + if (node.expr._typ == 271 /* v.ast.InfixExpr */) { string expr_op_str = v__gen__c__ctoslit(v__token__Kind_str((*node.expr._v__ast__InfixExpr).op)); string expr_left_str = v__gen__c__cnewlines(v__gen__c__ctoslit(v__ast__Expr_str((*node.expr._v__ast__InfixExpr).left))); string expr_right_str = v__gen__c__cnewlines(v__gen__c__ctoslit(v__ast__Expr_str((*node.expr._v__ast__InfixExpr).right))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".op = "), 0xfe10, {.d_s = expr_op_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".llabel = "), 0xfe10, {.d_s = expr_left_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".rlabel = "), 0xfe10, {.d_s = expr_right_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".lvalue = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".op = "), /*115 &string*/0xfe10, {.d_s = expr_op_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".llabel = "), /*115 &string*/0xfe10, {.d_s = expr_left_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".rlabel = "), /*115 &string*/0xfe10, {.d_s = expr_right_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".lvalue = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assert_single_expr(g, (*node.expr._v__ast__InfixExpr).left, (*node.expr._v__ast__InfixExpr).left_type); v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".rvalue = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".rvalue = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assert_single_expr(g, (*node.expr._v__ast__InfixExpr).right, (*node.expr._v__ast__InfixExpr).right_type); v__gen__c__Gen_writeln(g, _SLIT(";")); } - else if (node.expr._typ == 252 /* v.ast.CallExpr */) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".op = _SLIT(\"call\");"), 0, { .d_c = 0 }}}))); + else if (node.expr._typ == 253 /* v.ast.CallExpr */) { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".op = _SLIT(\"call\");"), 0, { .d_c = 0 }}}))); } else { @@ -66011,39 +66094,39 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_single_expr(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type typ) { string unknown_value = _SLIT("*unknown value*"); - if (expr._typ == 253 /* v.ast.CastExpr */) { + if (expr._typ == 254 /* v.ast.CastExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 267 /* v.ast.IfExpr */) { + else if (expr._typ == 268 /* v.ast.IfExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 269 /* v.ast.IndexExpr */) { + else if (expr._typ == 270 /* v.ast.IndexExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 276 /* v.ast.MatchExpr */) { + else if (expr._typ == 277 /* v.ast.MatchExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 283 /* v.ast.PrefixExpr */) { - if (((*expr._v__ast__PrefixExpr).right)._typ == 253 /* v.ast.CastExpr */) { + else if (expr._typ == 284 /* v.ast.PrefixExpr */) { + if (((*expr._v__ast__PrefixExpr).right)._typ == 254 /* v.ast.CastExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } else { v__gen__c__Gen_gen_expr_to_string(g, expr, typ); } } - else if (expr._typ == 292 /* v.ast.TypeNode */) { + else if (expr._typ == 293 /* v.ast.TypeNode */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); - v__gen__c__Gen_write(g, v__gen__c__ctoslit( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})))); + v__gen__c__Gen_write(g, v__gen__c__ctoslit( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})))); } else { bool should_clone = true; - if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type) && (expr)._typ == 290 /* v.ast.StringLiteral */) { + if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type) && (expr)._typ == 291 /* v.ast.StringLiteral */) { should_clone = false; } - if ((expr)._typ == 251 /* v.ast.CTempVar */) { - if (((*expr._v__ast__CTempVar).orig)._typ == 252 /* v.ast.CallExpr */) { + if ((expr)._typ == 252 /* v.ast.CTempVar */) { + if (((*expr._v__ast__CTempVar).orig)._typ == 253 /* v.ast.CallExpr */) { should_clone = false; - if ((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate) { + if ((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option) { should_clone = true; } if ((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).is_method && (*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).args.len == 0 && string__eq((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).name, _SLIT("type_name"))) { @@ -66080,23 +66163,23 @@ string sref_name; g->assign_op = node.op; v__token__Kind op = (is_decl ? (v__token__Kind__assign) : (node.op)); v__ast__Expr right_expr = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.right, 0)); - if (right_expr._typ == 252 /* v.ast.CallExpr */) { + if (right_expr._typ == 253 /* v.ast.CallExpr */) { return_type = (*right_expr._v__ast__CallExpr).return_type; } - else if (right_expr._typ == 274 /* v.ast.LockExpr */) { + else if (right_expr._typ == 275 /* v.ast.LockExpr */) { return_type = (*right_expr._v__ast__LockExpr).typ; } - else if (right_expr._typ == 276 /* v.ast.MatchExpr */) { + else if (right_expr._typ == 277 /* v.ast.MatchExpr */) { return_type = (*right_expr._v__ast__MatchExpr).return_type; } - else if (right_expr._typ == 267 /* v.ast.IfExpr */) { + else if (right_expr._typ == 268 /* v.ast.IfExpr */) { return_type = (*right_expr._v__ast__IfExpr).typ; } else { } ; - af = g->is_autofree && !g->is_builtin_mod && node.op == v__token__Kind__assign && node.left_types.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 266 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 286 /* v.ast.SelectorExpr */); + af = g->is_autofree && !g->is_builtin_mod && node.op == v__token__Kind__assign && node.left_types.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 267 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 287 /* v.ast.SelectorExpr */); sref_name = _SLIT(""); type_to_free = _SLIT(""); if (af) { @@ -66106,16 +66189,16 @@ string sref_name; type_to_free = (v__ast__Type_alias_eq(first_left_type, _const_v__ast__string_type) ? (_SLIT("string")) : (_SLIT("array"))); bool ok = true; v__ast__Expr left0 = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left0)._typ == 266 /* v.ast.Ident */) { + if ((left0)._typ == 267 /* v.ast.Ident */) { if (string__eq((*left0._v__ast__Ident).name, _SLIT("_"))) { ok = false; } } if (ok) { - sref_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_sref"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_to_free}}, {_SLIT(" "), 0xfe10, {.d_s = sref_name}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); + sref_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_sref"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sref_name}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, left0); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("); // free "), 0xfe10, {.d_s = type_to_free}}, {_SLIT(" on re-assignment2"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("); // free "), /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT(" on re-assignment2"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assign_stmt_defer_0 = true; } else { af = false; @@ -66132,7 +66215,7 @@ string sref_name; // Defer begin if (v__gen__c__Gen_gen_assign_stmt_defer_0) { if (af) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), 0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), /*115 &string*/0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } // Defer end @@ -66161,11 +66244,11 @@ string sref_name; bool blank_assign = false; v__ast__Ident ident = ((v__ast__Ident){.language = 0,.tok_kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comptime = 0,.scope = 0,.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.kind = 0,.info = {0},.is_mut = 0,}); v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, var_type)); - if ((left)->_typ == 266 /* v.ast.Ident */) { + if ((left)->_typ == 267 /* v.ast.Ident */) { ident = (*left->_v__ast__Ident); blank_assign = (*left->_v__ast__Ident).kind == v__ast__IdentKind__blank_ident; v__ast__IdentInfo left_info = (*left->_v__ast__Ident).info; - if ((left_info)._typ == 376 /* v.ast.IdentVar */) { + if ((left_info)._typ == 377 /* v.ast.IdentVar */) { v__ast__ShareType share = (*left_info._v__ast__IdentVar).share; if (share == v__ast__ShareType__shared_t) { var_type = v__ast__Type_set_flag(var_type, v__ast__TypeFlag__shared_f); @@ -66174,11 +66257,11 @@ string sref_name; var_type = v__ast__Type_set_flag(var_type, v__ast__TypeFlag__atomic_f); } } - if (((*left->_v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { - if ((val)._typ == 258 /* v.ast.ComptimeSelector */) { - if (((*val._v__ast__ComptimeSelector).field_expr)._typ == 286 /* v.ast.SelectorExpr */) { - if (((*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 266 /* v.ast.Ident */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); + if (((*left->_v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((val)._typ == 259 /* v.ast.ComptimeSelector */) { + if (((*val._v__ast__ComptimeSelector).field_expr)._typ == 287 /* v.ast.SelectorExpr */) { + if (((*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 267 /* v.ast.Ident */) { + string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); v__ast__Type* _t2 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); Option_v__ast__Type _t1 = {0}; if (_t2) { @@ -66196,8 +66279,8 @@ string sref_name; (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = var_type; } } - } else if ((val)._typ == 257 /* v.ast.ComptimeCall */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*val._v__ast__ComptimeCall).method_name}}, {_SLIT(".return_type"), 0, { .d_c = 0 }}})); + } else if ((val)._typ == 258 /* v.ast.ComptimeCall */) { + string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*val._v__ast__ComptimeCall).method_name}}, {_SLIT(".return_type"), 0, { .d_c = 0 }}})); v__ast__Type* _t4 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); Option_v__ast__Type _t3 = {0}; if (_t4) { @@ -66220,21 +66303,21 @@ string sref_name; string styp = v__gen__c__Gen_typ(g, var_type); bool is_fixed_array_init = false; bool has_val = false; - if (val._typ == 246 /* v.ast.ArrayInit */) { + if (val._typ == 247 /* v.ast.ArrayInit */) { is_fixed_array_init = (*val._v__ast__ArrayInit).is_fixed; has_val = (*val._v__ast__ArrayInit).has_val; } - else if (val._typ == 252 /* v.ast.CallExpr */) { + else if (val._typ == 253 /* v.ast.CallExpr */) { is_call = true; return_type = (*val._v__ast__CallExpr).return_type; } - else if (val._typ == 244 /* v.ast.AnonFn */) { + else if (val._typ == 245 /* v.ast.AnonFn */) { if (blank_assign) { v__gen__c__Gen_write(g, _SLIT("{")); } - if ((is_decl || blank_assign) && (left)->_typ == 266 /* v.ast.Ident */) { + if ((is_decl || blank_assign) && (left)->_typ == 267 /* v.ast.Ident */) { string ret_styp = v__gen__c__Gen_typ(g, (*val._v__ast__AnonFn).decl.return_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*"), 0xfe10, {.d_s = ident.name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = ident.name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); int def_pos = g->definitions.len; v__gen__c__Gen_fn_decl_params(g, (*val._v__ast__AnonFn).decl.params, ((voidptr)(0)), false); strings__Builder_go_back(&g->definitions, g->definitions.len - def_pos); @@ -66245,7 +66328,7 @@ string sref_name; v__gen__c__Gen_expr(g, *left); g->is_assign_lhs = false; g->is_arraymap_set = false; - if ((left)->_typ == 269 /* v.ast.IndexExpr */) { + if ((left)->_typ == 270 /* v.ast.IndexExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*left->_v__ast__IndexExpr).left_type); if (sym->kind == v__ast__Kind__map || sym->kind == v__ast__Kind__array) { v__gen__c__Gen_expr(g, val); @@ -66269,14 +66352,14 @@ string sref_name; v__ast__Type unwrapped_val_type = v__gen__c__Gen_unwrap_generic(g, val_type); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(g->table, unwrapped_val_type); v__ast__TypeSymbol* unaliased_right_sym = v__ast__Table_final_sym(g->table, unwrapped_val_type); - bool is_fixed_array_var = unaliased_right_sym->kind == v__ast__Kind__array_fixed && (val)._typ != 246 /* v.ast.ArrayInit */ && (((val)._typ == 266 /* v.ast.Ident */ || (val)._typ == 269 /* v.ast.IndexExpr */ || (val)._typ == 252 /* v.ast.CallExpr */ || (val)._typ == 286 /* v.ast.SelectorExpr */) || ((val)._typ == 253 /* v.ast.CastExpr */ && ((/* as */ *(v__ast__CastExpr*)__as_cast((val)._v__ast__CastExpr,(val)._typ, 253) /*expected idx: 253, name: v.ast.CastExpr */ ).expr)._typ != 246 /* v.ast.ArrayInit */)) && !g->pref->translated; + bool is_fixed_array_var = unaliased_right_sym->kind == v__ast__Kind__array_fixed && (val)._typ != 247 /* v.ast.ArrayInit */ && (((val)._typ == 267 /* v.ast.Ident */ || (val)._typ == 270 /* v.ast.IndexExpr */ || (val)._typ == 253 /* v.ast.CallExpr */ || (val)._typ == 287 /* v.ast.SelectorExpr */) || ((val)._typ == 254 /* v.ast.CastExpr */ && ((/* as */ *(v__ast__CastExpr*)__as_cast((val)._v__ast__CastExpr,(val)._typ, 254) /*expected idx: 254, name: v.ast.CastExpr */ ).expr)._typ != 247 /* v.ast.ArrayInit */)) && !g->pref->translated; g->is_assign_lhs = true; g->assign_op = node.op; if (v__ast__Type_has_flag(val_type, v__ast__TypeFlag__optional)) { g->right_is_opt = true; } if (blank_assign) { - if ((val)._typ == 269 /* v.ast.IndexExpr */) { + if ((val)._typ == 270 /* v.ast.IndexExpr */) { g->assign_op = v__token__Kind__decl_assign; } g->is_assign_lhs = false; @@ -66288,28 +66371,28 @@ string sref_name; } else if (g->inside_for_c_stmt) { v__gen__c__Gen_expr(g, val); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("{"), 0xfe10, {.d_s = styp}}, {_SLIT(" _ = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("{"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _ = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, val); v__gen__c__Gen_writeln(g, _SLIT(";}")); } - } else if (node.op == v__token__Kind__assign && !g->pref->translated && (is_fixed_array_init || (right_sym->kind == v__ast__Kind__array_fixed && (val)._typ == 266 /* v.ast.Ident */))) { + } else if (node.op == v__token__Kind__assign && !g->pref->translated && (is_fixed_array_init || (right_sym->kind == v__ast__Kind__array_fixed && (val)._typ == 267 /* v.ast.Ident */))) { string v_var = _SLIT(""); string arr_typ = string_trim(styp, _SLIT("*")); if (is_fixed_array_init) { - v__ast__ArrayInit right = /* as */ *(v__ast__ArrayInit*)__as_cast((val)._v__ast__ArrayInit,(val)._typ, 246) /*expected idx: 246, name: v.ast.ArrayInit */ ; + v__ast__ArrayInit right = /* as */ *(v__ast__ArrayInit*)__as_cast((val)._v__ast__ArrayInit,(val)._typ, 247) /*expected idx: 247, name: v.ast.ArrayInit */ ; v_var = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arr_typ}}, {_SLIT(" "), 0xfe10, {.d_s = v_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arr_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, v__ast__ArrayInit_to_sumtype_v__ast__Expr(&right)); v__gen__c__Gen_writeln(g, _SLIT(";")); } else { - v__ast__Ident right = /* as */ *(v__ast__Ident*)__as_cast((val)._v__ast__Ident,(val)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ; + v__ast__Ident right = /* as */ *(v__ast__Ident*)__as_cast((val)._v__ast__Ident,(val)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ; v_var = right.name; } int pos = g->out.len; v__gen__c__Gen_expr(g, *left); if (g->is_arraymap_set && g->arraymap_set_pos > 0) { strings__Builder_go_back_to(&g->out, g->arraymap_set_pos); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &"), 0xfe10, {.d_s = v_var}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &"), /*115 &string*/0xfe10, {.d_s = v_var}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); g->is_arraymap_set = false; g->arraymap_set_pos = 0; } else { @@ -66317,10 +66400,10 @@ string sref_name; bool is_var_mut = !is_decl && v__ast__Expr_is_auto_deref_var(/*rec*/*left); string addr_left = (is_var_mut ? (_SLIT("")) : (_SLIT("&"))); v__gen__c__Gen_writeln(g, _SLIT("")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("memcpy("), 0xfe10, {.d_s = addr_left}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("memcpy("), /*115 &string*/0xfe10, {.d_s = addr_left}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, *left); string addr_val = (is_fixed_array_var ? (_SLIT("")) : (_SLIT("&"))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe10, {.d_s = addr_val}}, {_SLIT0, 0xfe10, {.d_s = v_var}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = arr_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(", "), /*115 &string*/0xfe10, {.d_s = addr_val}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = v_var}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = arr_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } g->is_assign_lhs = false; } else { @@ -66339,7 +66422,7 @@ string sref_name; v__ast__Type op_expected_left = ((v__ast__Type)(0)); v__ast__Type op_expected_right = ((v__ast__Type)(0)); if (var_type == _const_v__ast__string_type_idx && node.op == v__token__Kind__plus_assign) { - if ((left)->_typ == 269 /* v.ast.IndexExpr */) { + if ((left)->_typ == 270 /* v.ast.IndexExpr */) { v__gen__c__Gen_expr(g, *left); v__gen__c__Gen_write(g, _SLIT("string__plus(")); } else { @@ -66371,11 +66454,11 @@ string sref_name; _t6 = _SLIT("unknown op"); }string extracted_op = _t6; v__gen__c__Gen_expr(g, *left); - if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).generic_types.len > 0) { - Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).concrete_types; + if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).generic_types.len > 0) { + Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).concrete_types; string method_name = string__plus(string__plus(left_sym->cname, _SLIT("_")), v__util__replace_op(extracted_op)); method_name = v__gen__c__Gen_generic_fn_name(g, concrete_types, method_name, true); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = method_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, *left); v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_expr(g, val); @@ -66383,17 +66466,17 @@ string sref_name; // Defer begin if (v__gen__c__Gen_gen_assign_stmt_defer_0) { if (af) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), 0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), /*115 &string*/0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } // Defer end return; } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = v__util__replace_op(extracted_op)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = v__util__replace_op(extracted_op)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); Option_v__ast__Fn _t7 = v__ast__Table_find_method(g->table, left_sym, extracted_op); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; - v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("assignment operator `"), 0xfe10, {.d_s = extracted_op}}, {_SLIT("=` used but no `"), 0xfe10, {.d_s = extracted_op}}, {_SLIT("` method defined"), 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("assignment operator `"), /*115 &string*/0xfe10, {.d_s = extracted_op}}, {_SLIT("=` used but no `"), /*115 &string*/0xfe10, {.d_s = extracted_op}}, {_SLIT("` method defined"), 0, { .d_c = 0 }}})), node.pos); VUNREACHABLE(); *(v__ast__Fn*) _t7.data = ((v__ast__Fn){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}); } @@ -66408,7 +66491,7 @@ string sref_name; if (is_inside_ternary && is_decl) { strings__Builder_write_string(&g->out, v__util__tabs(g->indent - g->inside_ternary)); } - v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((right_sym->info)._v__ast__FnType,(right_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((right_sym->info)._v__ast__FnType,(right_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; string ret_styp = v__gen__c__Gen_typ(g, func.func.return_type); string call_conv = _SLIT(""); string msvc_call_conv = _SLIT(""); @@ -66417,20 +66500,20 @@ string sref_name; if (string__eq(attr.name, _SLIT("callconv"))) { if (g->is_cc_msvc) { - msvc_call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = attr.arg}}, {_SLIT(" "), 0, { .d_c = 0 }}})); + msvc_call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT(" "), 0, { .d_c = 0 }}})); } else { - call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}})); + call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}})); } } else { }; } - string call_conv_attribute_suffix = (call_conv.len != 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), 0xfe10, {.d_s = call_conv}}, {_SLIT("))"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_styp}}, {_SLIT(" ("), 0xfe10, {.d_s = msvc_call_conv}}, {_SLIT("*"), 0xfe10, {.d_s = v__gen__c__Gen_get_ternary_name(g, ident.name)}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); + string call_conv_attribute_suffix = (call_conv.len != 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), /*115 &string*/0xfe10, {.d_s = call_conv}}, {_SLIT("))"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" ("), /*115 &string*/0xfe10, {.d_s = msvc_call_conv}}, {_SLIT("*"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_get_ternary_name(g, ident.name)}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); int def_pos = g->definitions.len; v__gen__c__Gen_fn_decl_params(g, func.func.params, ((voidptr)(0)), false); strings__Builder_go_back(&g->definitions, g->definitions.len - def_pos); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), 0xfe10, {.d_s = call_conv_attribute_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), /*115 &string*/0xfe10, {.d_s = call_conv_attribute_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { if (is_decl) { if (is_inside_ternary) { @@ -66439,30 +66522,30 @@ string sref_name; bool is_used_var_styp = false; if (!Array_string_contains(g->defer_vars, ident.name)) { v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, val_type); - if ((val_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((val_sym->info)._typ == 417 /* v.ast.Struct */) { if ((*val_sym->info._v__ast__Struct).generic_types.len > 0) { - if ((val)._typ == 291 /* v.ast.StructInit */) { + if ((val)._typ == 292 /* v.ast.StructInit */) { string var_styp = v__gen__c__Gen_typ(g, (*val._v__ast__StructInit).typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); is_used_var_styp = true; - } else if ((val)._typ == 283 /* v.ast.PrefixExpr */) { - if ((*val._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*val._v__ast__PrefixExpr).right)._typ == 291 /* v.ast.StructInit */) { + } else if ((val)._typ == 284 /* v.ast.PrefixExpr */) { + if ((*val._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*val._v__ast__PrefixExpr).right)._typ == 292 /* v.ast.StructInit */) { string var_styp = v__gen__c__Gen_typ(g, v__ast__Type_ref((*(*val._v__ast__PrefixExpr).right._v__ast__StructInit).typ)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); is_used_var_styp = true; } } } } if (!is_used_var_styp) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } if (is_auto_heap) { v__gen__c__Gen_write(g, _SLIT("*")); } } } - if ((left)->_typ == 266 /* v.ast.Ident */ || (left)->_typ == 286 /* v.ast.SelectorExpr */) { + if ((left)->_typ == 267 /* v.ast.Ident */ || (left)->_typ == 287 /* v.ast.SelectorExpr */) { g->prevent_sum_type_unwrapping_once = true; } if (!is_fixed_array_var || is_decl) { @@ -66477,7 +66560,7 @@ string sref_name; } } if (is_inside_ternary && is_decl) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(";\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(";\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->out, v__util__tabs(g->indent)); v__gen__c__Gen_expr(g, *left); } @@ -66487,7 +66570,7 @@ string sref_name; v__gen__c__Gen_writeln(g, _SLIT(";")); } } else if (!g->is_arraymap_set && !str_add && !op_overloaded) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } else if (str_add || op_overloaded) { v__gen__c__Gen_write(g, _SLIT(", ")); } @@ -66505,21 +66588,21 @@ string sref_name; if (is_fixed_array_var) { string typ_str = string_trim(v__gen__c__Gen_typ(g, val_type), _SLIT("*")); string ref_str = (v__ast__Type_is_ptr(val_type) ? (_SLIT("")) : (_SLIT("&"))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("memcpy(("), 0xfe10, {.d_s = typ_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("memcpy(("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, *left); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", (byte*)"), 0xfe10, {.d_s = ref_str}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", (byte*)"), /*115 &string*/0xfe10, {.d_s = ref_str}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, val); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), 0xfe10, {.d_s = typ_str}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_decl) { if (is_fixed_array_init && !has_val) { - if ((val)._typ == 246 /* v.ast.ArrayInit */) { + if ((val)._typ == 247 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*val._v__ast__ArrayInit)); } else { v__gen__c__Gen_write(g, _SLIT("{0}")); } } else { if (is_auto_heap) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), 0xfe10, {.d_s = styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); } if (v__ast__Expr_is_auto_deref_var(val)) { v__gen__c__Gen_write(g, _SLIT("*")); @@ -66559,7 +66642,7 @@ string sref_name; // Defer begin if (v__gen__c__Gen_gen_assign_stmt_defer_0) { if (af) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), 0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), /*115 &string*/0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } // Defer end @@ -66567,27 +66650,27 @@ if (v__gen__c__Gen_gen_assign_stmt_defer_0) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_multi_return_assign(v__gen__c__Gen* g, v__ast__AssignStmt* node, v__ast__Type return_type) { bool is_opt = v__ast__Type_has_flag(return_type, v__ast__TypeFlag__optional); - string mr_var_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("mr_"), 0xfe07, {.d_i32 = node->pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string mr_var_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("mr_"), /*100 &int*/0xfe07, {.d_i32 = node->pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); string mr_styp = v__gen__c__Gen_typ(g, v__ast__Type_clear_flag(return_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mr_styp}}, {_SLIT(" "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node->right, 0))); v__gen__c__Gen_writeln(g, _SLIT(";")); for (int i = 0; i < node->left.len; ++i) { v__ast__Expr lx = ((v__ast__Expr*)node->left.data)[i]; bool is_auto_heap = false; v__ast__Ident ident = ((v__ast__Ident){.language = 0,.tok_kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comptime = 0,.scope = 0,.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.kind = 0,.info = {0},.is_mut = 0,}); - if ((lx)._typ == 266 /* v.ast.Ident */) { + if ((lx)._typ == 267 /* v.ast.Ident */) { ident = (*lx._v__ast__Ident); if ((*lx._v__ast__Ident).kind == v__ast__IdentKind__blank_ident) { continue; } - if (((*lx._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if (((*lx._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { is_auto_heap = (*(*lx._v__ast__Ident).obj._v__ast__Var).is_auto_heap; } } string styp = (Array_string_contains(g->defer_vars, ident.name) ? (_SLIT("")) : (v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i))))); if (node->op == v__token__Kind__decl_assign) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); if (is_auto_heap) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -66601,30 +66684,30 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_multi_return_assign(v__gen__c__Gen* g, v if (is_opt) { string mr_base_styp = v__gen__c__Gen_base_type(g, return_type); if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("HEAP"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = mr_base_styp}}, {_SLIT(", "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(") });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("HEAP"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = mr_base_styp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(") });"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); } } else { if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("HEAP"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(") });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("HEAP"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(") });"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); } } } else { if (is_opt) { string mr_base_styp = v__gen__c__Gen_base_type(g, return_type); if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" = HEAP"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = mr_base_styp}}, {_SLIT(", "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" = HEAP"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = mr_base_styp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else { if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" = HEAP"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" = HEAP"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } @@ -66640,30 +66723,30 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assign_vars_autofree(v__gen__c__Gen* g, VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__ast__AssignStmt* node) { for (int i = 0; i < node->left.len; ++i) { v__ast__Expr left = ((v__ast__Expr*)node->left.data)[i]; - if (left._typ == 266 /* v.ast.Ident */) { + if (left._typ == 267 /* v.ast.Ident */) { v__ast__Type left_typ = (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i)); v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, left_typ); if (left_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), 0xfe07, {.d_i32 = (*left._v__ast__Ident).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__c_name((*left._v__ast__Ident).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__Ident).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*left._v__ast__Ident).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { string styp = v__gen__c__Gen_typ(g, left_typ); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), 0xfe07, {.d_i32 = (*left._v__ast__Ident).pos.pos}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__c_name((*left._v__ast__Ident).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__Ident).pos.pos}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*left._v__ast__Ident).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (left._typ == 269 /* v.ast.IndexExpr */) { + else if (left._typ == 270 /* v.ast.IndexExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*left._v__ast__IndexExpr).left_type); if (sym->kind == v__ast__Kind__array) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__TypeSymbol* elem_typ = v__ast__Table_sym(g->table, info.elem_type); if (elem_typ->kind == v__ast__Kind__function) { v__ast__Type left_typ = (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i)); v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, left_typ); - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), 0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(" = *(voidptr*)array_get(")); } else { string styp = v__gen__c__Gen_typ(g, info.elem_type); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), 0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT(" = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)array_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)array_get("), 0, { .d_c = 0 }}}))); } if (v__ast__Type_is_ptr((*left._v__ast__IndexExpr).left_type)) { v__gen__c__Gen_write(g, _SLIT("*")); @@ -66680,7 +66763,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a v__gen__c__Gen_expr(g, (*left._v__ast__IndexExpr).index); v__gen__c__Gen_writeln(g, _SLIT(");")); } else if (sym->kind == v__ast__Kind__map) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; string skeytyp = v__gen__c__Gen_typ(g, info.key_type); string styp = v__gen__c__Gen_typ(g, info.value_type); string zero = v__gen__c__Gen_type_default(g, info.value_type); @@ -66688,10 +66771,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a if (val_typ->kind == v__ast__Kind__function) { v__ast__Type left_type = (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i)); v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, left_type); - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), 0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(" = *(voidptr*)map_get(")); } else { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), 0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT(" = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)map_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)map_get("), 0, { .d_c = 0 }}}))); } if (!v__ast__Type_is_ptr((*left._v__ast__IndexExpr).left_type)) { v__gen__c__Gen_write(g, _SLIT("ADDR(map, ")); @@ -66700,19 +66783,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a } else { v__gen__c__Gen_expr(g, (*left._v__ast__IndexExpr).left); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = skeytyp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = skeytyp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*left._v__ast__IndexExpr).index); v__gen__c__Gen_write(g, _SLIT("}")); if (val_typ->kind == v__ast__Kind__function) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &(voidptr[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &(voidptr[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = styp}}, {_SLIT("[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); } } } - else if (left._typ == 286 /* v.ast.SelectorExpr */) { + else if (left._typ == 287 /* v.ast.SelectorExpr */) { string styp = v__gen__c__Gen_typ(g, (*left._v__ast__SelectorExpr).typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), 0xfe07, {.d_i32 = (*left._v__ast__SelectorExpr).pos.pos}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__SelectorExpr).pos.pos}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*left._v__ast__SelectorExpr).expr); string sel = _SLIT("."); if (v__ast__Type_is_ptr((*left._v__ast__SelectorExpr).expr_type)) { @@ -66722,7 +66805,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a sel = _SLIT("->"); } } - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sel}}, {_SLIT0, 0xfe10, {.d_s = (*left._v__ast__SelectorExpr).field_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sel}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = (*left._v__ast__SelectorExpr).field_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { @@ -66733,11 +66816,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_tmp_variable(v__gen__c__Gen* g, Array_v__ast__Expr left, v__ast__Expr val) { v__ast__Expr val_ = val; - if (val._typ == 266 /* v.ast.Ident */) { + if (val._typ == 267 /* v.ast.Ident */) { bool has_var = false; for (int _t1 = 0; _t1 < left.len; ++_t1) { v__ast__Expr lx = ((v__ast__Expr*)left.data)[_t1]; - if ((lx)._typ == 266 /* v.ast.Ident */) { + if ((lx)._typ == 267 /* v.ast.Ident */) { if (string__eq((*val._v__ast__Ident).name, (*lx._v__ast__Ident).name)) { v__gen__c__Gen_write(g, _SLIT("_var_")); v__gen__c__Gen_write(g, int_str((*lx._v__ast__Ident).pos.pos)); @@ -66750,7 +66833,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_tmp_variable(v__gen__c__Gen* g, Ar v__gen__c__Gen_expr(g, val_); } } - else if (val._typ == 269 /* v.ast.IndexExpr */) { + else if (val._typ == 270 /* v.ast.IndexExpr */) { bool has_var = false; for (int _t2 = 0; _t2 < left.len; ++_t2) { v__ast__Expr lx = ((v__ast__Expr*)left.data)[_t2]; @@ -66765,7 +66848,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_tmp_variable(v__gen__c__Gen* g, Ar v__gen__c__Gen_expr(g, val_); } } - else if (val._typ == 270 /* v.ast.InfixExpr */) { + else if (val._typ == 271 /* v.ast.InfixExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*val._v__ast__InfixExpr).left_type); Option_v__ast__Fn _t3; if (_t3 = v__ast__Table_find_method(g->table, sym, v__token__Kind_str((*val._v__ast__InfixExpr).op)), _t3.state == 0) { @@ -66785,15 +66868,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_tmp_variable(v__gen__c__Gen* g, Ar v__gen__c__Gen_gen_cross_tmp_variable(g, left, (*val._v__ast__InfixExpr).right); } } - else if (val._typ == 283 /* v.ast.PrefixExpr */) { + else if (val._typ == 284 /* v.ast.PrefixExpr */) { v__gen__c__Gen_write(g, v__token__Kind_str((*val._v__ast__PrefixExpr).op)); v__gen__c__Gen_gen_cross_tmp_variable(g, left, (*val._v__ast__PrefixExpr).right); } - else if (val._typ == 282 /* v.ast.PostfixExpr */) { + else if (val._typ == 283 /* v.ast.PostfixExpr */) { v__gen__c__Gen_gen_cross_tmp_variable(g, left, (*val._v__ast__PostfixExpr).expr); v__gen__c__Gen_write(g, v__token__Kind_str((*val._v__ast__PostfixExpr).op)); } - else if (val._typ == 286 /* v.ast.SelectorExpr */) { + else if (val._typ == 287 /* v.ast.SelectorExpr */) { bool has_var = false; for (int _t4 = 0; _t4 < left.len; ++_t4) { v__ast__Expr lx = ((v__ast__Expr*)left.data)[_t4]; @@ -66855,7 +66938,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_equality_fns(v__gen__c__Gen* g) { v__gen__c__Gen_gen_interface_equality_fn(g, needed_typ); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not generate equality function for type "), 0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not generate equality function for type "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); }; } @@ -66870,39 +66953,39 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_sumtype_equality_fn(v__gen__c__Gen* g, } array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__ast__SumType info = v__ast__TypeSymbol_sumtype_info(left.sym); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_sumtype_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_sumtype_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_sumtype_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_sumtype_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tif (a._typ != b._typ) { return false; }")); for (int _t3 = 0; _t3 < info.variants.len; ++_t3) { v__ast__Type typ = ((v__ast__Type*)info.variants.data)[_t3]; v__gen__c__Type variant = v__gen__c__Gen_unwrap(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (a._typ == "), 0xfe07, {.d_i32 = v__ast__Type_idx(variant.typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = variant.sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (a._typ == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(variant.typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = variant.sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (variant.sym->kind == v__ast__Kind__string) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn string__eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn string__eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__alias && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn *((voidptr*)(*a."), 0xfe10, {.d_s = name}}, {_SLIT(")) == *((voidptr*)(*b."), 0xfe10, {.d_s = name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn *((voidptr*)(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(")) == *((voidptr*)(*b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn *a."), 0xfe10, {.d_s = name}}, {_SLIT(" == *b."), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn *a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" == *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&fn_builder, _SLIT("\t}")); } @@ -66925,12 +67008,12 @@ strings__Builder fn_builder; } array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__ast__Struct info = v__ast__TypeSymbol_struct_info(left.sym); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("_struct_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_struct_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(512); v__gen__c__Gen_gen_struct_equality_fn_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("_struct_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_struct_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); if (v__ast__TypeSymbol_has_method(left.sym, _SLIT("=="))) { - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = fn_name}}, {_SLIT("__eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("__eq(a, b);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("}")); string _t3 = fn_name; // Defer begin @@ -66950,32 +67033,32 @@ strings__Builder fn_builder; v__gen__c__Type field_type = v__gen__c__Gen_unwrap(g, field.typ); string field_name = v__gen__c__c_name(field.name); if (field_type.sym->kind == v__ast__Kind__string) { - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string__eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string__eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__alias && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__function) { - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("*((voidptr*)(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(")) == *((voidptr*)(b."), 0xfe10, {.d_s = field_name}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("*((voidptr*)(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")) == *((voidptr*)(b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__interface_) { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("a."), 0xfe10, {.d_s = field_name}}, {_SLIT(" == b."), 0xfe10, {.d_s = field_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" == b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } else { @@ -67000,31 +67083,31 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_alias_equality_fn(v__gen__c__Gen* g, v return _t1; } array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); - v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((left.sym->info)._v__ast__Alias,(left.sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ; - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_alias_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((left.sym->info)._v__ast__Alias,(left.sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ; + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_alias_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_alias_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_alias_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, info.parent_type); if (sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&fn_builder, _SLIT("\treturn string__eq(a, b);")); } else if (sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__interface_ && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__function) { strings__Builder_writeln(&fn_builder, _SLIT("\treturn *((voidptr*)(a)) == *((voidptr*)(b));")); } else { @@ -67046,40 +67129,40 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_array_equality_fn(v__gen__c__Gen* g, v array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__gen__c__Type elem = v__gen__c__Gen_unwrap(g, v__ast__TypeSymbol_array_info(left.sym).elem_type); string ptr_elem_styp = v__gen__c__Gen_typ(g, elem.typ); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tif (a.len != b.len) {")); strings__Builder_writeln(&fn_builder, _SLIT("\t\treturn false;")); strings__Builder_writeln(&fn_builder, _SLIT("\t}")); strings__Builder_writeln(&fn_builder, _SLIT("\tfor (int i = 0; i < a.len; ++i) {")); if (elem.sym->kind == v__ast__Kind__string) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (!string__eq(*(("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)a.data+(i*a.element_size))), *(("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)b.data+(i*b.element_size))))) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (!string__eq(*(("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)a.data+(i*a.element_size))), *(("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)b.data+(i*b.element_size))))) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__interface_ && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__alias && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__function) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (*((voidptr*)((byte*)a.data+(i*a.element_size))) != *((voidptr*)((byte*)b.data+(i*b.element_size)))) {")); } else { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (*(("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)a.data+(i*a.element_size))) != *(("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)b.data+(i*b.element_size)))) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (*(("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)a.data+(i*a.element_size))) != *(("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)b.data+(i*b.element_size)))) {"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&fn_builder, _SLIT("\t\t\treturn false;")); strings__Builder_writeln(&fn_builder, _SLIT("\t\t}")); @@ -67102,33 +67185,33 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_fixed_array_equality_fn(v__gen__c__Gen v__ast__ArrayFixed elem_info = v__ast__TypeSymbol_array_fixed_info(left.sym); v__gen__c__Type elem = v__gen__c__Gen_unwrap(g, elem_info.elem_type); int size = elem_info.size; - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfor (int i = 0; i < "), 0xfe07, {.d_i32 = size}}, {_SLIT("; ++i) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfor (int i = 0; i < "), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("; ++i) {"), 0, { .d_c = 0 }}}))); if (elem.sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (!string__eq(a[i], b[i])) {")); } else if (elem.sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__interface_ && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__alias && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__function) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (a[i] != b[i]) {")); } else { @@ -67154,9 +67237,9 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_map_equality_fn(v__gen__c__Gen* g, v__ array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__gen__c__Type value = v__gen__c__Gen_unwrap(g, v__ast__TypeSymbol_map_info(left.sym).value_type); string ptr_value_styp = v__gen__c__Gen_typ(g, value.typ); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_map_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_map_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_map_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_map_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tif (a.len != b.len) {")); strings__Builder_writeln(&fn_builder, _SLIT("\t\treturn false;")); strings__Builder_writeln(&fn_builder, _SLIT("\t}")); @@ -67166,21 +67249,21 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_map_equality_fn(v__gen__c__Gen* g, v__ strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (!map_exists(&b, k)) return false;")); v__ast__Kind kind = v__ast__Table_type_kind(g->table, value.typ); if (kind == v__ast__Kind__function) { - v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((value.sym->info)._v__ast__FnType,(value.sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((value.sym->info)._v__ast__FnType,(value.sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; string ret_styp = v__gen__c__Gen_typ(g, func.func.return_type); - strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*v) ("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*v) ("), 0, { .d_c = 0 }}}))); int arg_len = func.func.params.len; for (int j = 0; j < func.func.params.len; ++j) { v__ast__Param arg = ((v__ast__Param*)func.func.params.data)[j]; string arg_styp = v__gen__c__Gen_typ(g, arg.typ); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_styp}}, {_SLIT(" "), 0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (j < arg_len - 1) { strings__Builder_write_string(&fn_builder, _SLIT(", ")); } } strings__Builder_writeln(&fn_builder, _SLIT(") = *(voidptr*)map_get(&a, k, &(voidptr[]){ 0 });")); } else { - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT(" v = *("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&a, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 });"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT(" v = *("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&a, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 });"), 0, { .d_c = 0 }}}))); } switch (kind) { case v__ast__Kind__string: @@ -67191,43 +67274,43 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_map_equality_fn(v__gen__c__Gen* g, v__ case v__ast__Kind__sum_type: { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__struct_: { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__interface_: { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__array: { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__array_fixed: { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__map: { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__alias: { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__function: @@ -67267,7 +67350,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_map_equality_fn(v__gen__c__Gen* g, v__ case v__ast__Kind__thread: default: { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }) != v) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }) != v) {"), 0, { .d_c = 0 }}}))); break; } } @@ -67294,46 +67377,46 @@ strings__Builder fn_builder; } array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__ast__TypeInfo info = left.sym->info; - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_interface_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_interface_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(512); v__gen__c__Gen_gen_interface_equality_fn_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_interface_idx_"), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("(int sidx); // for auto eq method"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("_interface_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_interface_idx_"), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("(int sidx); // for auto eq method"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_interface_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tif (a._typ == b._typ) {")); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tint idx = v_typeof_interface_idx_"), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("(a._typ);"), 0, { .d_c = 0 }}}))); - if ((info)._typ == 434 /* v.ast.Interface */) { + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tint idx = v_typeof_interface_idx_"), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("(a._typ);"), 0, { .d_c = 0 }}}))); + if ((info)._typ == 435 /* v.ast.Interface */) { for (int _t3 = 0; _t3 < (*info._v__ast__Interface).types.len; ++_t3) { v__ast__Type typ = ((v__ast__Type*)(*info._v__ast__Interface).types.data)[_t3]; - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (idx == "), 0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (idx == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&fn_builder, _SLIT("\t\t\treturn ")); v__ast__Kind _t4 = v__ast__Table_type_kind(g->table, typ); if (_t4 == (v__ast__Kind__struct_)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__string)) { strings__Builder_write_string(&fn_builder, _SLIT("string__eq(*(a._string), *(b._string))")); } else if (_t4 == (v__ast__Kind__sum_type)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__array)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__array_fixed)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__map)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__alias)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else { strings__Builder_write_string(&fn_builder, _SLIT("false")); @@ -67357,7 +67440,7 @@ strings__Builder fn_builder; VV_LOCAL_SYMBOL string v__gen__c__Gen_get_free_method(v__gen__c__Gen* g, v__ast__Type typ) { map_set(&g->autofree_methods, &(int[]){typ}, &(bool[]) { true }); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); - if ((sym->info)._typ == 431 /* v.ast.Alias */) { + if ((sym->info)._typ == 432 /* v.ast.Alias */) { if ((*sym->info._v__ast__Alias).is_import) { sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__Alias).parent_type); } @@ -67398,7 +67481,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_free_method(v__gen__c__Gen* g, v__ast_ } map_set(&g->generated_free_methods, &(int[]){deref_typ}, &(bool[]) { true }); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); - if ((sym->info)._typ == 431 /* v.ast.Alias */) { + if ((sym->info)._typ == 432 /* v.ast.Alias */) { if ((*sym->info._v__ast__Alias).is_import) { sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__Alias).parent_type); } @@ -67407,19 +67490,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_free_method(v__gen__c__Gen* g, v__ast_ string _t2 = fn_name; return _t2; } - if (sym->info._typ == 416 /* v.ast.Struct */) { + if (sym->info._typ == 417 /* v.ast.Struct */) { v__gen__c__Gen_gen_free_for_struct(g, (*sym->info._v__ast__Struct), styp, fn_name); } - else if (sym->info._typ == 411 /* v.ast.Array */) { + else if (sym->info._typ == 412 /* v.ast.Array */) { v__gen__c__Gen_gen_free_for_array(g, (*sym->info._v__ast__Array), styp, fn_name); } - else if (sym->info._typ == 412 /* v.ast.Map */) { + else if (sym->info._typ == 413 /* v.ast.Map */) { v__gen__c__Gen_gen_free_for_map(g, (*sym->info._v__ast__Map), styp, fn_name); } else { println(v__ast__Table_type_str(g->table, typ)); - v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not generate free method '"), 0xfe10, {.d_s = fn_name}}, {_SLIT("' for type '"), 0xfe10, {.d_s = styp}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not generate free method '"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("' for type '"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } ; @@ -67430,10 +67513,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_free_method(v__gen__c__Gen* g, v__ast_ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_free_for_struct(v__gen__c__Gen* g, v__ast__Struct info, string styp, string fn_name) { bool v__gen__c__Gen_gen_free_for_struct_defer_0 = false; strings__Builder fn_builder; - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(128); v__gen__c__Gen_gen_free_for_struct_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < info.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t1]; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, field.typ)); @@ -67445,11 +67528,11 @@ strings__Builder fn_builder; if (is_shared) { field_styp = string_all_after(field_styp, _SLIT("__shared__")); } - string field_styp_fn_name = (v__ast__TypeSymbol_has_method(sym, _SLIT("free")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = field_styp}}, {_SLIT("_free"), 0, { .d_c = 0 }}}))) : (v__gen__c__Gen_gen_free_method(g, field.typ))); + string field_styp_fn_name = (v__ast__TypeSymbol_has_method(sym, _SLIT("free")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("_free"), 0, { .d_c = 0 }}}))) : (v__gen__c__Gen_gen_free_method(g, field.typ))); if (is_shared) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = field_styp_fn_name}}, {_SLIT("(&(it->"), 0xfe10, {.d_s = field.name}}, {_SLIT("->val));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = field_styp_fn_name}}, {_SLIT("(&(it->"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("->val));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = field_styp_fn_name}}, {_SLIT("(&(it->"), 0xfe10, {.d_s = field.name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = field_styp_fn_name}}, {_SLIT("(&(it->"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&fn_builder, _SLIT("}")); @@ -67463,16 +67546,16 @@ if (v__gen__c__Gen_gen_free_for_struct_defer_0) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_free_for_array(v__gen__c__Gen* g, v__ast__Array info, string styp, string fn_name) { bool v__gen__c__Gen_gen_free_for_array_defer_0 = false; strings__Builder fn_builder; - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(128); v__gen__c__Gen_gen_free_for_array_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, info.elem_type)); if (sym->kind == v__ast__Kind__string || sym->kind == v__ast__Kind__array || sym->kind == v__ast__Kind__map || sym->kind == v__ast__Kind__struct_) { strings__Builder_writeln(&fn_builder, _SLIT("\tfor (int i = 0; i < it->len; i++) {")); string elem_styp = string_replace(v__gen__c__Gen_typ(g, info.elem_type), _SLIT("*"), _SLIT("")); - string elem_styp_fn_name = (v__ast__TypeSymbol_has_method(sym, _SLIT("free")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_styp}}, {_SLIT("_free"), 0, { .d_c = 0 }}}))) : (v__gen__c__Gen_gen_free_method(g, info.elem_type))); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = elem_styp_fn_name}}, {_SLIT("(&((("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("*)it->data)[i]));"), 0, { .d_c = 0 }}}))); + string elem_styp_fn_name = (v__ast__TypeSymbol_has_method(sym, _SLIT("free")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("_free"), 0, { .d_c = 0 }}}))) : (v__gen__c__Gen_gen_free_method(g, info.elem_type))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = elem_styp_fn_name}}, {_SLIT("(&((("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("*)it->data)[i]));"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\t}")); } strings__Builder_writeln(&fn_builder, _SLIT("\tarray_free(it);")); @@ -67487,10 +67570,10 @@ if (v__gen__c__Gen_gen_free_for_array_defer_0) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_free_for_map(v__gen__c__Gen* g, v__ast__Map info, string styp, string fn_name) { bool v__gen__c__Gen_gen_free_for_map_defer_0 = false; strings__Builder fn_builder; - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(128); v__gen__c__Gen_gen_free_for_map_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tmap_free(it);")); strings__Builder_writeln(&fn_builder, _SLIT("}")); // Defer begin @@ -67756,7 +67839,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__should_use_indent_func(v__ast__Kind kind) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_default(v__gen__c__Gen* g, v__ast__TypeSymbol sym, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> gen_str_default: "), 0xfe10, {.d_s = sym.name}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | str_fn_name"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> gen_str_default: "), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | str_fn_name"), 0, { .d_c = 0 }}}))); } #endif string convertor = _SLIT(""); @@ -67774,15 +67857,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_default(v__gen__c__Gen* g, v__ast__T convertor = _SLIT("bool"); typename_ = _SLIT("bool"); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not generate string method for type `"), 0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not generate string method for type `"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) {"), 0, { .d_c = 0 }}}))); if (string__eq(convertor, _SLIT("bool"))) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tmp1 = string__plus(_SLIT(\""), 0xfe10, {.d_s = styp}}, {_SLIT("(\"), ("), 0xfe10, {.d_s = convertor}}, {_SLIT(")it ? _SLIT(\"true\") : _SLIT(\"false\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tmp1 = string__plus(_SLIT(\""), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("(\"), ("), /*115 &string*/0xfe10, {.d_s = convertor}}, {_SLIT(")it ? _SLIT(\"true\") : _SLIT(\"false\"));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring tmp1 = string__plus(_SLIT(\""), 0xfe10, {.d_s = styp}}, {_SLIT("(\"), tos3("), 0xfe10, {.d_s = typename_}}, {_SLIT("_str(("), 0xfe10, {.d_s = convertor}}, {_SLIT(")it).str));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring tmp1 = string__plus(_SLIT(\""), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("(\"), tos3("), /*115 &string*/0xfe10, {.d_s = typename_}}, {_SLIT("_str(("), /*115 &string*/0xfe10, {.d_s = convertor}}, {_SLIT(")it).str));"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring tmp2 = string__plus(tmp1, _SLIT(\")\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring_free(&tmp1);")); @@ -67793,7 +67876,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_default(v__gen__c__Gen* g, v__ast__T VV_LOCAL_SYMBOL string v__gen__c__Gen_get_str_fn(v__gen__c__Gen* g, v__ast__Type typ) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> get_str_fn: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(typ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> get_str_fn: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(typ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__ast__Type unwrapped = v__ast__Type_clear_flag(v__ast__Type_set_nr_muls(v__gen__c__Gen_unwrap_generic(g, typ), 0), v__ast__TypeFlag__variadic); @@ -67810,13 +67893,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_str_fn(v__gen__c__Gen* g, v__ast__Type string styp = v__gen__c__Gen_typ(g, unwrapped); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, unwrapped); string str_fn_name = v__gen__c__styp_to_str_fn_name(styp); - if ((sym->info)._typ == 431 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { + if ((sym->info)._typ == 432 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { if ((*sym->info._v__ast__Alias).is_import) { sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__Alias).parent_type); str_fn_name = v__gen__c__styp_to_str_fn_name(sym->name); } } - if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && (sym->info)._typ == 416 /* v.ast.Struct */) { + if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && (sym->info)._typ == 417 /* v.ast.Struct */) { str_fn_name = v__gen__c__Gen_generic_fn_name(g, (*sym->info._v__ast__Struct).concrete_types, str_fn_name, false); } array_push((array*)&g->str_types, _MOV((v__gen__c__StrType[]){ ((v__gen__c__StrType){.styp = styp,.typ = unwrapped,}) })); @@ -67830,12 +67913,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_final_gen_str(v__gen__c__Gen* g, v__gen__c__ } #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> final_gen_str: "), 0xfe10, {.d_s = v__gen__c__StrType_str(typ)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> final_gen_str: "), /*115 &v.gen.c.StrType*/0xfe10, {.d_s = v__gen__c__StrType_str(typ)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif array_push((array*)&g->generated_str_fns, _MOV((v__gen__c__StrType[]){ typ })); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ.typ); - if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && !v__ast__Type_has_flag(typ.typ, v__ast__TypeFlag__optional)) { + if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && !(v__ast__Type_has_flag(typ.typ, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(typ.typ, v__ast__TypeFlag__result))) { return; } string styp = typ.styp; @@ -67844,49 +67927,53 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_final_gen_str(v__gen__c__Gen* g, v__gen__c__ v__gen__c__Gen_gen_str_for_option(g, typ.typ, styp, str_fn_name); return; } - if (sym->info._typ == 431 /* v.ast.Alias */) { + if (v__ast__Type_has_flag(typ.typ, v__ast__TypeFlag__result)) { + v__gen__c__Gen_gen_str_for_result(g, typ.typ, styp, str_fn_name); + return; + } + if (sym->info._typ == 432 /* v.ast.Alias */) { if ((*sym->info._v__ast__Alias).is_import) { v__gen__c__Gen_gen_str_default(g, *sym, styp, str_fn_name); } else { v__gen__c__Gen_gen_str_for_alias(g, (*sym->info._v__ast__Alias), styp, str_fn_name); } } - else if (sym->info._typ == 411 /* v.ast.Array */) { + else if (sym->info._typ == 412 /* v.ast.Array */) { v__gen__c__Gen_gen_str_for_array(g, (*sym->info._v__ast__Array), styp, str_fn_name); } - else if (sym->info._typ == 439 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 440 /* v.ast.ArrayFixed */) { v__gen__c__Gen_gen_str_for_array_fixed(g, (*sym->info._v__ast__ArrayFixed), styp, str_fn_name); } - else if (sym->info._typ == 445 /* v.ast.Enum */) { + else if (sym->info._typ == 446 /* v.ast.Enum */) { v__gen__c__Gen_gen_str_for_enum(g, (*sym->info._v__ast__Enum), styp, str_fn_name); } - else if (sym->info._typ == 443 /* v.ast.FnType */) { + else if (sym->info._typ == 444 /* v.ast.FnType */) { v__gen__c__Gen_gen_str_for_fn_type(g, (*sym->info._v__ast__FnType), styp, str_fn_name); } - else if (sym->info._typ == 416 /* v.ast.Struct */) { + else if (sym->info._typ == 417 /* v.ast.Struct */) { v__gen__c__Gen_gen_str_for_struct(g, (*sym->info._v__ast__Struct), styp, str_fn_name); } - else if (sym->info._typ == 412 /* v.ast.Map */) { + else if (sym->info._typ == 413 /* v.ast.Map */) { v__gen__c__Gen_gen_str_for_map(g, (*sym->info._v__ast__Map), styp, str_fn_name); } - else if (sym->info._typ == 442 /* v.ast.MultiReturn */) { + else if (sym->info._typ == 443 /* v.ast.MultiReturn */) { v__gen__c__Gen_gen_str_for_multi_return(g, (*sym->info._v__ast__MultiReturn), styp, str_fn_name); } - else if (sym->info._typ == 435 /* v.ast.SumType */) { + else if (sym->info._typ == 436 /* v.ast.SumType */) { v__gen__c__Gen_gen_str_for_union_sum_type(g, (*sym->info._v__ast__SumType), styp, str_fn_name); } - else if (sym->info._typ == 434 /* v.ast.Interface */) { + else if (sym->info._typ == 435 /* v.ast.Interface */) { v__gen__c__Gen_gen_str_for_interface(g, (*sym->info._v__ast__Interface), styp, str_fn_name); } - else if (sym->info._typ == 440 /* v.ast.Chan */) { + else if (sym->info._typ == 441 /* v.ast.Chan */) { v__gen__c__Gen_gen_str_for_chan(g, (*sym->info._v__ast__Chan), styp, str_fn_name); } - else if (sym->info._typ == 441 /* v.ast.Thread */) { + else if (sym->info._typ == 442 /* v.ast.Thread */) { v__gen__c__Gen_gen_str_for_thread(g, (*sym->info._v__ast__Thread), styp, str_fn_name); } else { - v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not generate string method `"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("` for type `"), 0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not generate string method `"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("` for type `"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } ; @@ -67895,33 +67982,66 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_final_gen_str(v__gen__c__Gen* g, v__gen__c__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_option(v__gen__c__Gen* g, v__ast__Type typ, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_option: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(typ))}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_option: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(typ))}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__ast__Type parent_type = v__ast__Type_clear_flag(typ, v__ast__TypeFlag__optional); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, parent_type); - multi_return_bool_bool_int mr_6220 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_6220.arg0; + multi_return_bool_bool_int mr_6348 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_6348.arg0; string parent_str_fn_name = v__gen__c__Gen_get_str_fn(g, parent_type); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring res;")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tif (it.state == 0) {")); if (sym->kind == v__ast__Kind__string) { - string tmp_res = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data)"), 0, { .d_c = 0 }}})); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), 0xfe10, {.d_s = str_intp_sq(tmp_res)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + string tmp_res = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data)"), 0, { .d_c = 0 }}})); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = str_intp_sq(tmp_res)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = indent_"), 0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data, indent_count);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = indent_"), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data, indent_count);"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), 0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data);"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t} else {")); string tmp_str = str_intp_sub(_SLIT("error: %%"), _SLIT("IError_str(it.err)")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t}")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = str_intp_sub(_SLIT("Option(%%)"), _SLIT("res"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = str_intp_sub(_SLIT("Option(%%)"), _SLIT("res"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("}")); +} + +VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_result(v__gen__c__Gen* g, v__ast__Type typ, string styp, string str_fn_name) { + #if defined(CUSTOM_DEFINE_trace_autostr) + { + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_result: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(typ))}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } + #endif + v__ast__Type parent_type = v__ast__Type_clear_flag(typ, v__ast__TypeFlag__result); + v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, parent_type); + multi_return_bool_bool_int mr_7867 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_7867.arg0; + string parent_str_fn_name = v__gen__c__Gen_get_str_fn(g, parent_type); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring res;")); + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tif (!it.is_error) {")); + if (sym->kind == v__ast__Kind__string) { + string tmp_res = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data)"), 0, { .d_c = 0 }}})); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = str_intp_sq(tmp_res)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } else if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = indent_"), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data, indent_count);"), 0, { .d_c = 0 }}}))); + } else { + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data);"), 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t} else {")); + string tmp_str = str_intp_sub(_SLIT("error: %%"), _SLIT("IError_str(it.err)")); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t}")); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = str_intp_sub(_SLIT("result(%%)"), _SLIT("res"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("}")); } @@ -67929,17 +68049,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_alias(v__gen__c__Gen* g, v__ast_ string parent_str_fn_name = v__gen__c__Gen_get_str_fn(g, info.parent_type); #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_alias: "), 0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_alias: "), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif string clean_type_v_type_name = v__util__strip_main_name(string_replace(styp, _SLIT("__"), _SLIT("."))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring indents = string_repeat(_SLIT(\" \"), indent_count);")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring tmp_ds = "), 0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(it);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring res = str_intp(3, _MOV((StrIntpData[]){\n {_SLIT0, "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = indents }},\n {_SLIT(\""), 0xfe10, {.d_s = clean_type_v_type_name}}, {_SLIT("(\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = tmp_ds }},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring tmp_ds = "), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(it);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring res = str_intp(3, _MOV((StrIntpData[]){\n {_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = indents }},\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_type_v_type_name}}, {_SLIT("(\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = tmp_ds }},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }));"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring_free(&indents);")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring_free(&tmp_ds);")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\treturn res;")); @@ -67949,43 +68069,43 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_alias(v__gen__c__Gen* g, v__ast_ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_multi_return(v__gen__c__Gen* g, v__ast__MultiReturn info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_multi_return: "), 0xfe10, {.d_s = Array_v__ast__Type_str(info.types)}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_multi_return: "), /*115 &[]v.ast.Type*/0xfe10, {.d_s = Array_v__ast__Type_str(info.types)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder sb = strings__new_builder("), 0xfe07, {.d_i32 = info.types.len}}, {_SLIT(" * 10);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder sb = strings__new_builder("), /*100 &int*/0xfe07, {.d_i32 = info.types.len}}, {_SLIT(" * 10);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\"(\"));")); for (int i = 0; i < info.types.len; ++i) { v__ast__Type typ = ((v__ast__Type*)info.types.data)[i]; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); bool is_arg_ptr = v__ast__Type_is_ptr(typ); - multi_return_bool_bool_int mr_9413 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_9413.arg0; - bool str_method_expects_ptr = mr_9413.arg1; + multi_return_bool_bool_int mr_11059 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_11059.arg0; + bool str_method_expects_ptr = mr_11059.arg1; string arg_str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("(a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("(a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__f32 || sym->kind == v__ast__Kind__f64) { if (sym->kind == v__ast__Kind__f32) { - string tmp_val = str_intp_g32( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_val}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_val = str_intp_g32( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_val}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - string tmp_val = str_intp_g64( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_val}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_val = str_intp_g64( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_val}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__string) { - string tmp_str = str_intp_sq( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_sq( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("());"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("());"), 0, { .d_c = 0 }}}))); } else { - multi_return_string_string mr_10238 = v__gen__c__deref_kind(str_method_expects_ptr, is_arg_ptr, typ); - string deref = mr_10238.arg0; - string deref_label = mr_10238.arg1; - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), 0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + multi_return_string_string mr_11884 = v__gen__c__deref_kind(str_method_expects_ptr, is_arg_ptr, typ); + string deref = mr_11884.arg0; + string deref_label = mr_11884.arg1; + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } if (i != info.types.len - 1) { strings__Builder_writeln(&fn_builder, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\", \"));")); @@ -68002,19 +68122,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_multi_return(v__gen__c__Gen* g, VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_enum(v__gen__c__Gen* g, v__ast__Enum info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_enum: "), 0xfe10, {.d_s = v__ast__Enum_str(info)}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_enum: "), /*115 &v.ast.Enum*/0xfe10, {.d_s = v__ast__Enum_str(info)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif string s = v__util__no_dots(styp); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) { /* gen_str_for_enum */"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { /* gen_str_for_enum */"), 0, { .d_c = 0 }}}))); if (info.is_flag) { string clean_name = v__util__strip_main_name(string_replace(styp, _SLIT("__"), _SLIT("."))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring ret = _SLIT(\""), 0xfe10, {.d_s = clean_name}}, {_SLIT("{\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring ret = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_name}}, {_SLIT("{\");"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tint first = 1;")); for (int i = 0; i < info.vals.len; ++i) { string val = ((string*)info.vals.data)[i]; - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (it & (1 << "), 0xfe07, {.d_i32 = i}}, {_SLIT(")) {if (!first) {ret = string__plus(ret, _SLIT(\" | \"));} ret = string__plus(ret, _SLIT(\"."), 0xfe10, {.d_s = val}}, {_SLIT("\")); first = 0;}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (it & (1 << "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(")) {if (!first) {ret = string__plus(ret, _SLIT(\" | \"));} ret = string__plus(ret, _SLIT(\"."), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\")); first = 0;}"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tret = string__plus(ret, _SLIT(\"}\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\treturn ret;")); @@ -68028,7 +68148,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_enum(v__gen__c__Gen* g, v__ast__ } else if (info.is_multi_allowed) { array_push((array*)&seen, _MOV((string[]){ string_clone(val) })); } - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe10, {.d_s = s}}, {_SLIT("__"), 0xfe10, {.d_s = val}}, {_SLIT(": return _SLIT(\""), 0xfe10, {.d_s = val}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("__"), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(": return _SLIT(\""), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tdefault: return _SLIT(\"unknown enum value\");")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t}")); @@ -68039,12 +68159,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_enum(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_interface(v__gen__c__Gen* g, v__ast__Interface info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_interface: "), 0xfe10, {.d_s = Array_v__ast__Type_str(info.types)}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_interface: "), /*115 &[]v.ast.Type*/0xfe10, {.d_s = Array_v__ast__Type_str(info.types)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(x, 0); }"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(x, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); string clean_interface_v_type_name = string_replace(styp, _SLIT("__"), _SLIT(".")); if (string_ends_with(styp, _SLIT("*"))) { @@ -68054,36 +68174,36 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_interface(v__gen__c__Gen* g, v__ clean_interface_v_type_name = string__plus(string_replace(string_replace(string_replace(clean_interface_v_type_name, _SLIT("Array_"), _SLIT("[]")), _SLIT("_T_"), _SLIT("<")), _SLIT("_"), _SLIT(", ")), _SLIT(">")); } clean_interface_v_type_name = v__util__strip_main_name(clean_interface_v_type_name); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count) { /* gen_str_for_interface */"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count) { /* gen_str_for_interface */"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < info.types.len; ++_t1) { v__ast__Type typ = ((v__ast__Type*)info.types.data)[_t1]; v__ast__TypeSymbol* sub_sym = v__ast__Table_sym(g->table, v__ast__mktyp(typ)); string func_name = v__gen__c__Gen_get_str_fn(g, typ); - multi_return_bool_bool_int mr_13672 = v__ast__TypeSymbol_str_method_info(sub_sym); - bool sym_has_str_method = mr_13672.arg0; - bool str_method_expects_ptr = mr_13672.arg1; + multi_return_bool_bool_int mr_15318 = v__ast__TypeSymbol_str_method_info(sub_sym); + bool sym_has_str_method = mr_15318.arg0; + bool str_method_expects_ptr = mr_15318.arg1; if (v__gen__c__should_use_indent_func(sub_sym->kind) && !sym_has_str_method) { - func_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("indent_"), 0xfe10, {.d_s = func_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + func_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("indent_"), /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT0, 0, { .d_c = 0 }}})); } string deref = (sym_has_str_method && str_method_expects_ptr ? (_SLIT(" ")) : (_SLIT("*"))); if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type)) { - string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = func_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("("), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("*)x._"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("*)x._"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__should_use_indent_func(sub_sym->kind) && !sym_has_str_method) { val = /*f*/string__plus(val, _SLIT(", indent_count")); } val = /*f*/string__plus(val, _SLIT(")")); - string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), 0xfe10, {.d_s = clean_interface_v_type_name}}, {_SLIT("(\'\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\"\')\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" return "), 0xfe10, {.d_s = res}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_interface_v_type_name}}, {_SLIT("(\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\"\')\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" return "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = func_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("("), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("*)x._"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("*)x._"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__should_use_indent_func(sub_sym->kind) && !sym_has_str_method) { val = /*f*/string__plus(val, _SLIT(", indent_count")); } val = /*f*/string__plus(val, _SLIT(")")); - string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), 0xfe10, {.d_s = clean_interface_v_type_name}}, {_SLIT("(\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" return "), 0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_interface_v_type_name}}, {_SLIT("(\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" return "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&fn_builder, _SLIT("\treturn _SLIT(\"unknown interface value\");")); @@ -68094,14 +68214,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_interface(v__gen__c__Gen* g, v__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_union_sum_type(v__gen__c__Gen* g, v__ast__SumType info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_union_sum_type: "), 0xfe10, {.d_s = Array_v__ast__Type_str(info.variants)}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_union_sum_type: "), /*115 &[]v.ast.Type*/0xfe10, {.d_s = Array_v__ast__Type_str(info.variants)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(x, 0); }"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(x, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count) {"), 0, { .d_c = 0 }}}))); string clean_sum_type_v_type_name = _SLIT(""); if (info.is_anon) { Array_string _t1 = {0}; @@ -68115,7 +68235,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_union_sum_type(v__gen__c__Gen* g array_push((array*)&_t1, &ti); } Array_string variant_names =_t1; - clean_sum_type_v_type_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = Array_string_join(variant_names, _SLIT(" | "))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + clean_sum_type_v_type_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = Array_string_join(variant_names, _SLIT(" | "))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); } else { clean_sum_type_v_type_name = string_replace(styp, _SLIT("__"), _SLIT(".")); if (string_ends_with(styp, _SLIT("*"))) { @@ -68132,29 +68252,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_union_sum_type(v__gen__c__Gen* g string typ_str = v__gen__c__Gen_typ(g, typ); string func_name = v__gen__c__Gen_get_str_fn(g, typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); - multi_return_bool_bool_int mr_16589 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_16589.arg0; - bool str_method_expects_ptr = mr_16589.arg1; + multi_return_bool_bool_int mr_18235 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_18235.arg0; + bool str_method_expects_ptr = mr_18235.arg1; string deref = (sym_has_str_method && str_method_expects_ptr ? (_SLIT(" ")) : (_SLIT("*"))); if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { - func_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("indent_"), 0xfe10, {.d_s = func_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + func_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("indent_"), /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT0, 0, { .d_c = 0 }}})); } if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type)) { - string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = func_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("("), 0xfe10, {.d_s = typ_str}}, {_SLIT("*)x._"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("*)x._"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { val = /*f*/string__plus(val, _SLIT(", indent_count")); } val = /*f*/string__plus(val, _SLIT(")")); - string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), 0xfe10, {.d_s = clean_sum_type_v_type_name}}, {_SLIT("(\'\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\"\')\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(": return "), 0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_sum_type_v_type_name}}, {_SLIT("(\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\"\')\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(": return "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); } else { - string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = func_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("("), 0xfe10, {.d_s = typ_str}}, {_SLIT("*)x._"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("*)x._"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { val = /*f*/string__plus(val, _SLIT(", indent_count")); } val = /*f*/string__plus(val, _SLIT(")")); - string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), 0xfe10, {.d_s = clean_sum_type_v_type_name}}, {_SLIT("(\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(": return "), 0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_sum_type_v_type_name}}, {_SLIT("(\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(": return "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&fn_builder, _SLIT("\t\tdefault: return _SLIT(\"unknown sum type value\");")); @@ -68178,12 +68298,14 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_fn_decl_str(v__gen__c__Gen* g, v__ast__FnT fn_str = /*f*/string__plus(fn_str, _SLIT(")")); if (v__ast__Type_alias_eq(info.func.return_type, _const_v__ast__ovoid_type)) { fn_str = /*f*/string__plus(fn_str, _SLIT(" ?")); + } else if (v__ast__Type_alias_eq(info.func.return_type, _const_v__ast__rvoid_type)) { + fn_str = /*f*/string__plus(fn_str, _SLIT(" !")); } else if (!v__ast__Type_alias_eq(info.func.return_type, _const_v__ast__void_type)) { string x = v__util__strip_main_name(v__ast__Table_get_type_name(g->table, v__gen__c__Gen_unwrap_generic(g, info.func.return_type))); if (v__ast__Type_has_flag(info.func.return_type, v__ast__TypeFlag__optional)) { - fn_str = /*f*/string__plus(fn_str, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" ?"), 0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}}))); + fn_str = /*f*/string__plus(fn_str, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" ?"), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - fn_str = /*f*/string__plus(fn_str, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}}))); + fn_str = /*f*/string__plus(fn_str, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } string _t1 = fn_str; @@ -68193,33 +68315,33 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_fn_decl_str(v__gen__c__Gen* g, v__ast__FnT VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_fn_type(v__gen__c__Gen* g, v__ast__FnType info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_fn_type: "), 0xfe10, {.d_s = info.func.name}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_fn_type: "), /*115 &string*/0xfe10, {.d_s = info.func.name}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("() { return _SLIT(\""), 0xfe10, {.d_s = v__gen__c__Gen_fn_decl_str(g, info)}}, {_SLIT("\");}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("() { return _SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_fn_decl_str(g, info)}}, {_SLIT("\");}"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_chan(v__gen__c__Gen* g, v__ast__Chan info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_chan: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.elem_type))}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_chan: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.elem_type))}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif string elem_type_name = v__util__strip_main_name(v__ast__Table_get_type_name(g->table, v__gen__c__Gen_unwrap_generic(g, info.elem_type))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x) { return sync__Channel_auto_str(x, _SLIT(\""), 0xfe10, {.d_s = elem_type_name}}, {_SLIT("\")); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x) { return sync__Channel_auto_str(x, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = elem_type_name}}, {_SLIT("\")); }"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_thread(v__gen__c__Gen* g, v__ast__Thread info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_thread: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.return_type))}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_thread: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.return_type))}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif string ret_type_name = v__util__strip_main_name(v__ast__Table_get_type_name(g->table, info.return_type)); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" _); // auto}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" _) { return _SLIT(\"thread("), 0xfe10, {.d_s = ret_type_name}}, {_SLIT(")\");}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _); // auto}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _) { return _SLIT(\"thread("), /*115 &string*/0xfe10, {.d_s = ret_type_name}}, {_SLIT(")\");}"), 0, { .d_c = 0 }}}))); } // Attr: [inline] @@ -68242,66 +68364,66 @@ VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__deref_kind(bool str_method VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array(v__gen__c__Gen* g, v__ast__Array info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_array: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.elem_type))}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_array: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.elem_type))}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__ast__Type typ = info.elem_type; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, info.elem_type); - if ((sym->info)._typ == 431 /* v.ast.Alias */) { + if ((sym->info)._typ == 432 /* v.ast.Alias */) { typ = (*sym->info._v__ast__Alias).parent_type; sym = v__ast__Table_sym(g->table, typ); } string field_styp = v__gen__c__Gen_typ(g, typ); bool is_elem_ptr = v__ast__Type_is_ptr(typ); - multi_return_bool_bool_int mr_20665 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_20665.arg0; - bool str_method_expects_ptr = mr_20665.arg1; + multi_return_bool_bool_int mr_22381 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_22381.arg0; + bool str_method_expects_ptr = mr_22381.arg1; string elem_str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); if (sym->kind == v__ast__Kind__u8) { elem_str_fn_name = string__plus(elem_str_fn_name, _SLIT("_escaped")); } - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(a, 0);}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(a, 0);}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder sb = strings__new_builder(a.len * 10);")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\"[\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tfor (int i = 0; i < a.len; ++i) {")); if (sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); } else { if (sym->kind == v__ast__Kind__array_fixed) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = field_styp}}, {_SLIT(" it;"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tmemcpy(*("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)it, (byte*)array_get(a, i), sizeof("), 0xfe10, {.d_s = field_styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT(" it;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tmemcpy(*("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)it, (byte*)array_get(a, i), sizeof("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = field_styp}}, {_SLIT(" it = *("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)array_get(a, i);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT(" it = *("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)array_get(a, i);"), 0, { .d_c = 0 }}}))); } if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { if (is_elem_ptr) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = indent_"), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*it, indent_count);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = indent_"), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*it, indent_count);"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = indent_"), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(it, indent_count);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = indent_"), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(it, indent_count);"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__f32 || sym->kind == v__ast__Kind__f64) { if (sym->kind == v__ast__Kind__f32) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = str_intp_g32(_SLIT("it"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = str_intp_g32(_SLIT("it"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = str_intp_g64(_SLIT("it"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = str_intp_g64(_SLIT("it"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__rune) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"`\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(it) }}, {_SLIT(\"`\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"`\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(it) }}, {_SLIT(\"`\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__string) { if (is_elem_ptr) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"&\'\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = *it }}, {_SLIT(\"\'\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"&\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = *it }}, {_SLIT(\"\'\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"\'\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = it }}, {_SLIT(\"\'\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = it }}, {_SLIT(\"\'\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); } } else { - multi_return_string_string mr_23189 = v__gen__c__deref_kind(str_method_expects_ptr, is_elem_ptr, typ); - string deref = mr_23189.arg0; - string deref_label = mr_23189.arg1; - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), 0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" it);"), 0, { .d_c = 0 }}}))); + multi_return_string_string mr_24905 = v__gen__c__deref_kind(str_method_expects_ptr, is_elem_ptr, typ); + string deref = mr_24905.arg0; + string deref_label = mr_24905.arg1; + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" it);"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tstrings__Builder_write_string(&sb, x);")); @@ -68322,61 +68444,61 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array(v__gen__c__Gen* g, v__ast_ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array_fixed(v__gen__c__Gen* g, v__ast__ArrayFixed info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_array_fixed: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.elem_type))}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_array_fixed: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.elem_type))}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__ast__Type typ = info.elem_type; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, info.elem_type); - if ((sym->info)._typ == 431 /* v.ast.Alias */) { + if ((sym->info)._typ == 432 /* v.ast.Alias */) { typ = (*sym->info._v__ast__Alias).parent_type; sym = v__ast__Table_sym(g->table, typ); } bool is_elem_ptr = v__ast__Type_is_ptr(typ); - multi_return_bool_bool_int mr_24571 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_24571.arg0; - bool str_method_expects_ptr = mr_24571.arg1; + multi_return_bool_bool_int mr_26287 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_26287.arg0; + bool str_method_expects_ptr = mr_26287.arg1; string elem_str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(a, 0);}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder sb = strings__new_builder("), 0xfe07, {.d_i32 = info.size}}, {_SLIT(" * 10);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(a, 0);}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder sb = strings__new_builder("), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(" * 10);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\"[\"));")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfor (int i = 0; i < "), 0xfe07, {.d_i32 = info.size}}, {_SLIT("; ++i) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfor (int i = 0; i < "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT("; ++i) {"), 0, { .d_c = 0 }}}))); if (sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tstrings__Builder_write_string(&sb, x);")); } else { - multi_return_string_string mr_25448 = v__gen__c__deref_kind(str_method_expects_ptr, is_elem_ptr, typ); - string deref = mr_25448.arg0; - string deref_label = mr_25448.arg1; + multi_return_string_string mr_27164 = v__gen__c__deref_kind(str_method_expects_ptr, is_elem_ptr, typ); + string deref = mr_27164.arg0; + string deref_label = mr_27164.arg1; if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { if (is_elem_ptr) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), 0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tif ( 0 == a[i] ) {")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t\tstrings__Builder_write_string(&sb, _SLIT(\"0\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t}else{")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a[i]) );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a[i]) );"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t}")); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a[i]) );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a[i]) );"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__f32 || sym->kind == v__ast__Kind__f64) { if (sym->kind == v__ast__Kind__f32) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_g32(_SLIT("a[i]"))}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_g32(_SLIT("a[i]"))}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_g64(_SLIT("a[i]"))}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_g64(_SLIT("a[i]"))}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__string) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_sq(_SLIT("a[i]"))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_sq(_SLIT("a[i]"))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__rune) { - string tmp_str = str_intp_rune( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a[i])"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_rune( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a[i])"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a[i]));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a[i]));"), 0, { .d_c = 0 }}}))); } } - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (i < "), 0xfe07, {.d_i32 = info.size - 1}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (i < "), /*100 &int*/0xfe07, {.d_i32 = info.size - 1}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t\tstrings__Builder_write_string(&sb, _SLIT(\", \"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t}")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t}")); @@ -68390,12 +68512,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array_fixed(v__gen__c__Gen* g, v VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_map(v__gen__c__Gen* g, v__ast__Map info, string styp, string str_fn_name) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_map: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.key_type))}}, {_SLIT(" -> "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.value_type))}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_map: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.key_type))}}, {_SLIT(" -> "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.value_type))}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__ast__Type key_typ = info.key_type; v__ast__TypeSymbol* key_sym = v__ast__Table_sym(g->table, key_typ); - if ((key_sym->info)._typ == 431 /* v.ast.Alias */) { + if ((key_sym->info)._typ == 432 /* v.ast.Alias */) { key_typ = (*key_sym->info._v__ast__Alias).parent_type; key_sym = v__ast__Table_sym(g->table, key_typ); } @@ -68406,7 +68528,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_map(v__gen__c__Gen* g, v__ast__M } v__ast__Type val_typ = info.value_type; v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, val_typ); - if ((val_sym->info)._typ == 431 /* v.ast.Alias */) { + if ((val_sym->info)._typ == 432 /* v.ast.Alias */) { val_typ = (*val_sym->info._v__ast__Alias).parent_type; val_sym = v__ast__Table_sym(g->table, val_typ); } @@ -68415,10 +68537,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_map(v__gen__c__Gen* g, v__ast__M if (!v__ast__TypeSymbol_has_method(val_sym, _SLIT("str"))) { v__gen__c__Gen_get_str_fn(g, val_typ); } - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" m); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" m) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(m, 0);}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" m, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" m, int indent_count) { /* gen_str_for_map */"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" m); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" m) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(m, 0);}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" m, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" m, int indent_count) { /* gen_str_for_map */"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder sb = strings__new_builder(m.key_values.len*10);")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\"{\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tfor (int i = 0; i < m.key_values.len; ++i) {")); @@ -68426,37 +68548,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_map(v__gen__c__Gen* g, v__ast__M if (key_sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tstring key = *(string*)DenseArray_key(&m.key_values, i);")); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = key_styp}}, {_SLIT(" key = *("), 0xfe10, {.d_s = key_styp}}, {_SLIT("*)DenseArray_key(&m.key_values, i);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = key_styp}}, {_SLIT(" key = *("), /*115 &string*/0xfe10, {.d_s = key_styp}}, {_SLIT("*)DenseArray_key(&m.key_values, i);"), 0, { .d_c = 0 }}}))); } if (key_sym->kind == v__ast__Kind__string) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_sq(_SLIT("key"))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_sq(_SLIT("key"))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (key_sym->kind == v__ast__Kind__rune) { - string tmp_str = str_intp_rune( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = key_str_fn_name}}, {_SLIT("(key)"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_rune( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = key_str_fn_name}}, {_SLIT("(key)"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = key_str_fn_name}}, {_SLIT("(key));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = key_str_fn_name}}, {_SLIT("(key));"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\": \"));")); if (val_sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("());"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("());"), 0, { .d_c = 0 }}}))); } else if (val_sym->kind == v__ast__Kind__string) { - string tmp_str = str_intp_sq( str_intp(2, _MOV((StrIntpData[]){{_SLIT("*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_sq( str_intp(2, _MOV((StrIntpData[]){{_SLIT("*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (v__gen__c__should_use_indent_func(val_sym->kind) && !v__ast__TypeSymbol_has_method(val_sym, _SLIT("str"))) { string ptr_str = string_repeat(_SLIT("*"), v__ast__Type_nr_muls(val_typ)); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, indent_"), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*"), 0xfe10, {.d_s = ptr_str}}, {_SLIT("("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i), indent_count));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, indent_"), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = ptr_str}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i), indent_count));"), 0, { .d_c = 0 }}}))); } else if (val_sym->kind == v__ast__Kind__f32 || val_sym->kind == v__ast__Kind__f64) { - string tmp_val = str_intp(2, _MOV((StrIntpData[]){{_SLIT("*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)"), 0, { .d_c = 0 }}})); + string tmp_val = str_intp(2, _MOV((StrIntpData[]){{_SLIT("*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)"), 0, { .d_c = 0 }}})); if (val_sym->kind == v__ast__Kind__f32) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_g32(tmp_val)}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_g32(tmp_val)}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_g64(tmp_val)}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_g64(tmp_val)}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else if (val_sym->kind == v__ast__Kind__rune) { - string tmp_str = str_intp_rune( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i))"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_rune( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i))"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)));"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tif (i != m.key_values.len-1) {")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t\tstrings__Builder_write_string(&sb, _SLIT(\", \"));")); @@ -68528,22 +68650,22 @@ v__util__Surrounder fn_body_surrounder; strings__Builder fn_body; #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_struct: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.parent_type))}}, {_SLIT(" | "), 0xfe10, {.d_s = styp}}, {_SLIT(" | "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> gen_str_for_struct: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(info.parent_type))}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0);}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0);}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(512); v__gen__c__Gen_gen_str_for_struct_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); string clean_struct_v_type_name = string_replace(styp, _SLIT("__"), _SLIT(".")); if (string_contains(clean_struct_v_type_name, _SLIT("_T_"))) { clean_struct_v_type_name = string__plus(string_replace(string_replace(string_replace(clean_struct_v_type_name, _SLIT("Array_"), _SLIT("[]")), _SLIT("_T_"), _SLIT("<")), _SLIT("_"), _SLIT(", ")), _SLIT(">")); } clean_struct_v_type_name = v__util__strip_main_name(clean_struct_v_type_name); if (info.fields.len == 0) { - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn _SLIT(\""), 0xfe10, {.d_s = clean_struct_v_type_name}}, {_SLIT("{}\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn _SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_struct_v_type_name}}, {_SLIT("{}\");"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("}")); // Defer begin if (v__gen__c__Gen_gen_str_for_struct_defer_0) { @@ -68556,8 +68678,8 @@ strings__Builder fn_body; fn_body_surrounder = v__util__new_surrounder(info.fields.len); fn_body = strings__new_builder(info.fields.len * 256); v__gen__c__Gen_gen_str_for_struct_defer_1 = true; - strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring res = str_intp( "), 0xfe07, {.d_i32 = info.fields.len * 4 + 3}}, {_SLIT(", _MOV((StrIntpData[]){"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\""), 0xfe10, {.d_s = clean_struct_v_type_name}}, {_SLIT("{\\n\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring res = str_intp( "), /*100 &int*/0xfe07, {.d_i32 = info.fields.len * 4 + 3}}, {_SLIT(", _MOV((StrIntpData[]){"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_struct_v_type_name}}, {_SLIT("{\\n\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); for (int i = 0; i < info.fields.len; ++i) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[i]; string ptr_amp = (v__ast__Type_is_ptr(field.typ) ? (_SLIT("&")) : (_SLIT(""))); @@ -68572,19 +68694,19 @@ strings__Builder fn_body; prefix = _SLIT("C"); } if (i == 0) { - strings__Builder_write_string(&fn_body, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT0, "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\" "), 0xfe10, {.d_s = field.name}}, {_SLIT(": "), 0xfe10, {.d_s = ptr_amp}}, {_SLIT0, 0xfe10, {.d_s = prefix}}, {_SLIT("\"), 0, {.d_c=0}}, "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = ptr_amp}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = prefix}}, {_SLIT("\"), 0, {.d_c=0}}, "), 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&fn_body, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\"\\n\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\" "), 0xfe10, {.d_s = field.name}}, {_SLIT(": "), 0xfe10, {.d_s = ptr_amp}}, {_SLIT0, 0xfe10, {.d_s = prefix}}, {_SLIT("\"), 0, {.d_c=0}}, "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\"\\n\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = ptr_amp}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = prefix}}, {_SLIT("\"), 0, {.d_c=0}}, "), 0, { .d_c = 0 }}}))); } - multi_return_bool_bool_int mr_35270 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_35270.arg0; - bool str_method_expects_ptr = mr_35270.arg1; + multi_return_bool_bool_int mr_36986 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_36986.arg0; + bool str_method_expects_ptr = mr_36986.arg1; string sftyp = v__gen__c__Gen_typ(g, field.typ); string field_styp = string_replace(sftyp, _SLIT("*"), _SLIT("")); string _t2; /* if prepend */ if (sym_has_str_method) { - string field_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = field_styp}}, {_SLIT("_str"), 0, { .d_c = 0 }}})); - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + string field_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("_str"), 0, { .d_c = 0 }}})); + if ((sym->info)._typ == 417 /* v.ast.Struct */) { field_fn_name = v__gen__c__Gen_generic_fn_name(g, (*sym->info._v__ast__Struct).concrete_types, field_fn_name, false); } _t2 = field_fn_name; @@ -68593,37 +68715,37 @@ strings__Builder fn_body; } string field_styp_fn_name = _t2; if (!(sym->kind == v__ast__Kind__f32 || sym->kind == v__ast__Kind__f64)) { - strings__Builder_write_string(&fn_body, str_intp(4, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), 0xfe10, {.d_s = quote_str}}, {_SLIT("\"), "), 0xfe07, {.d_i32 = ((int)(base_fmt))}}, {_SLIT(", {."), 0xfe10, {.d_s = v__gen__c__data_str(base_fmt)}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(4, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = quote_str}}, {_SLIT("\"), "), /*100 &int*/0xfe07, {.d_i32 = ((int)(base_fmt))}}, {_SLIT(", {."), /*115 &string*/0xfe10, {.d_s = v__gen__c__data_str(base_fmt)}}, {_SLIT("="), 0, { .d_c = 0 }}}))); } else { string g_fmt = string__plus(_SLIT("0x"), u32_hex(((((u32)(base_fmt)) | ((u32)(0x7FU)) << 9U)))); - strings__Builder_write_string(&fn_body, str_intp(4, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), 0xfe10, {.d_s = quote_str}}, {_SLIT("\"), "), 0xfe10, {.d_s = g_fmt}}, {_SLIT(", {."), 0xfe10, {.d_s = v__gen__c__data_str(base_fmt)}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(4, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = quote_str}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = g_fmt}}, {_SLIT(", {."), /*115 &string*/0xfe10, {.d_s = v__gen__c__data_str(base_fmt)}}, {_SLIT("="), 0, { .d_c = 0 }}}))); } string funcprefix = _SLIT(""); - multi_return_string_bool mr_36054 = v__gen__c__struct_auto_str_func(sym, field.typ, field_styp_fn_name, field.name, sym_has_str_method, str_method_expects_ptr); - string func = mr_36054.arg0; - bool caller_should_free = mr_36054.arg1; + multi_return_string_bool mr_37770 = v__gen__c__struct_auto_str_func(sym, field.typ, field_styp_fn_name, field.name, sym_has_str_method, str_method_expects_ptr); + string func = mr_37770.arg0; + bool caller_should_free = mr_37770.arg1; if (Array_v__ast__Type_contains(_const_v__ast__cptr_types, field.typ)) { - func = str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr) it."), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + func = str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr) it."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}})); caller_should_free = false; } else if (v__ast__Type_is_ptr(field.typ)) { - funcprefix = /*f*/string__plus(funcprefix, str_intp(2, _MOV((StrIntpData[]){{_SLIT("isnil(it."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + funcprefix = /*f*/string__plus(funcprefix, str_intp(2, _MOV((StrIntpData[]){{_SLIT("isnil(it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); funcprefix = /*f*/string__plus(funcprefix, _SLIT(" ? _SLIT(\"nil\") : ")); if (!(sym->kind == v__ast__Kind__struct_ || sym->kind == v__ast__Kind__alias) && !v__ast__Type_is_int_valptr(field.typ) && !v__ast__Type_is_float_valptr(field.typ)) { funcprefix = /*f*/string__plus(funcprefix, _SLIT("*")); } } if (string__eq(styp, field_styp)) { - strings__Builder_write_string(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = funcprefix}}, {_SLIT("_SLIT(\"\")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = funcprefix}}, {_SLIT("_SLIT(\"\")"), 0, { .d_c = 0 }}}))); } else { if (Array_v__ast__Type_contains(_const_v__ast__charptr_types, field.typ)) { - strings__Builder_write_string(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("tos2((byteptr)"), 0xfe10, {.d_s = func}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("tos2((byteptr)"), /*115 &string*/0xfe10, {.d_s = func}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { if (v__ast__Type_is_ptr(field.typ) && sym->kind == v__ast__Kind__struct_) { funcprefix = /*f*/string__plus(funcprefix, _SLIT("(indent_count > 25) ? _SLIT(\"\") : ")); } if (caller_should_free) { string tmpvar = v__gen__c__Gen_new_tmp_var(g); - v__util__Surrounder_add(&fn_body_surrounder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0xfe10, {.d_s = funcprefix}}, {_SLIT0, 0xfe10, {.d_s = func}}, {_SLIT(";"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), 0xfe10, {.d_s = tmpvar}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__util__Surrounder_add(&fn_body_surrounder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = funcprefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = func}}, {_SLIT(";"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&fn_body, tmpvar); } else { strings__Builder_write_string(&fn_body, funcprefix); @@ -68631,9 +68753,9 @@ strings__Builder fn_body; } } } - strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}}, {_SLIT(\""), 0xfe10, {.d_s = quote_str}}, {_SLIT("\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}}, {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = quote_str}}, {_SLIT("\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\"\\n\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\"}\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\"\\n\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\"}\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_body, _SLIT("\t}));")); // Defer begin if (v__gen__c__Gen_gen_str_for_struct_defer_1) { @@ -68655,45 +68777,45 @@ if (v__gen__c__Gen_gen_str_for_struct_defer_0) { VV_LOCAL_SYMBOL multi_return_string_bool v__gen__c__struct_auto_str_func(v__ast__TypeSymbol* sym, v__ast__Type field_type, string fn_name, string field_name, bool has_custom_str, bool expects_ptr) { #if defined(CUSTOM_DEFINE_trace_autostr) { - eprintln( str_intp(6, _MOV((StrIntpData[]){{_SLIT("> struct_auto_str_func: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" | field_type.debug() | "), 0xfe10, {.d_s = fn_name}}, {_SLIT(" | "), 0xfe10, {.d_s = field_name}}, {_SLIT(" | "), 0xfe10, {.d_s = has_custom_str ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), 0xfe10, {.d_s = expects_ptr ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(6, _MOV((StrIntpData[]){{_SLIT("> struct_auto_str_func: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" | field_type.debug() | "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = has_custom_str ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), /*115 &bool*/0xfe10, {.d_s = expects_ptr ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif - multi_return_string_string mr_37966 = v__gen__c__deref_kind(expects_ptr, v__ast__Type_is_ptr(field_type), field_type); - string deref = mr_37966.arg0; + multi_return_string_string mr_39682 = v__gen__c__deref_kind(expects_ptr, v__ast__Type_is_ptr(field_type), field_type); + string deref = mr_39682.arg0; if (sym->kind == v__ast__Kind__enum_) { - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (v__gen__c__should_use_indent_func(sym->kind)) { - string obj = str_intp(2, _MOV((StrIntpData[]){{_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string obj = str_intp(2, _MOV((StrIntpData[]){{_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT0, 0, { .d_c = 0 }}})); if (has_custom_str) { - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT0, 0xfe10, {.d_s = obj}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = obj}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; } - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT("indent_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT0, 0xfe10, {.d_s = obj}}, {_SLIT(", indent_count + 1)"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT("indent_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = obj}}, {_SLIT(", indent_count + 1)"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (sym->kind == v__ast__Kind__array || sym->kind == v__ast__Kind__array_fixed || sym->kind == v__ast__Kind__map || sym->kind == v__ast__Kind__sum_type) { if (has_custom_str) { - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; } - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT("indent_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(", indent_count + 1)"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT("indent_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(", indent_count + 1)"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (sym->kind == v__ast__Kind__function) { - return (multi_return_string_bool){.arg0= str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("()"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("()"), 0, { .d_c = 0 }}})), .arg1=true}; } else { if (sym->kind == v__ast__Kind__chan) { - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; } - string method_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string method_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT0, 0, { .d_c = 0 }}})); bool caller_should_free = false; if (sym->kind == v__ast__Kind__bool) { method_str = /*f*/string__plus(method_str, _SLIT(" ? _SLIT(\"true\") : _SLIT(\"false\")")); } else if ((v__ast__Type_is_int_valptr(field_type) || v__ast__Type_is_float_valptr(field_type)) && v__ast__Type_is_ptr(field_type) && !expects_ptr) { if (sym->kind == v__ast__Kind__f32) { - return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){\n {_SLIT0, "), 0xfe10, {.d_s = _const_si_g32_code}}, {_SLIT(", {.d_f32 = *"), 0xfe10, {.d_s = method_str}}, {_SLIT(" }}\n }))"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){\n {_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_si_g32_code}}, {_SLIT(", {.d_f32 = *"), /*115 &string*/0xfe10, {.d_s = method_str}}, {_SLIT(" }}\n }))"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (sym->kind == v__ast__Kind__f64) { - return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){\n {_SLIT0, "), 0xfe10, {.d_s = _const_si_g64_code}}, {_SLIT(", {.d_f64 = *"), 0xfe10, {.d_s = method_str}}, {_SLIT(" }}\n }))"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){\n {_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_si_g64_code}}, {_SLIT(", {.d_f64 = *"), /*115 &string*/0xfe10, {.d_s = method_str}}, {_SLIT(" }}\n }))"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (sym->kind == v__ast__Kind__u64) { v__gen__c__StrIntpType fmt_type = v__gen__c__StrIntpType__si_u64; - return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), 0xfe06, {.d_u32 = (((u32)(fmt_type)) | 0xfe00U)}}, {_SLIT(", {.d_u64 = *"), 0xfe10, {.d_s = method_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), /*117 &u32*/0xfe06, {.d_u32 = (((u32)(fmt_type)) | 0xfe00U)}}, {_SLIT(", {.d_u64 = *"), /*115 &string*/0xfe10, {.d_s = method_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})), .arg1=true}; } v__gen__c__StrIntpType fmt_type = v__gen__c__StrIntpType__si_i32; - return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), 0xfe06, {.d_u32 = (((u32)(fmt_type)) | 0xfe00U)}}, {_SLIT(", {.d_i32 = *"), 0xfe10, {.d_s = method_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), /*117 &u32*/0xfe06, {.d_u32 = (((u32)(fmt_type)) | 0xfe00U)}}, {_SLIT(", {.d_i32 = *"), /*115 &string*/0xfe10, {.d_s = method_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})), .arg1=true}; } return (multi_return_string_bool){.arg0=method_str, .arg1=caller_should_free}; } @@ -68759,6 +68881,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre .shared_types = strings__new_builder(100), .shared_functions = strings__new_builder(100), .options = strings__new_builder(100), + .out_results = strings__new_builder(100), .json_forward_decls = strings__new_builder(100), .sql_buf = strings__new_builder(100), .file = 0, @@ -68785,6 +68908,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre .is_cc_msvc = string__eq(pref->ccompiler, _SLIT("msvc")), .vlines_path = (string){.str=(byteptr)"", .is_lit=1}, .optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), + .results = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .done_optionals = (__shared__Array_string*)__dup_shared_array(&(__shared__Array_string){.mtx = {0}, .val =__new_array(0, 0, sizeof(string))}, sizeof(__shared__Array_string)), .chan_pop_optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .chan_push_optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), @@ -69117,7 +69241,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre string v = (*(string*)DenseArray_value(&_t35.key_values, _t36)); map_set(&global_g.optionals, &(string[]){k}, &(string[]) { v }); } - Map_string_string _t39 = g->as_cast_type_names; + Map_string_string _t39 = g->results; int _t41 = _t39.key_values.len; for (int _t40 = 0; _t40 < _t41; ++_t40 ) { int _t42 = _t39.key_values.len - _t41; @@ -69130,9 +69254,9 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre string k = /*key*/ *(string*)DenseArray_key(&_t39.key_values, _t40); k = string_clone(k); string v = (*(string*)DenseArray_value(&_t39.key_values, _t40)); - map_set(&global_g.as_cast_type_names, &(string[]){k}, &(string[]) { v }); + map_set(&global_g.results, &(string[]){k}, &(string[]) { v }); } - Map_int_bool _t43 = g->sumtype_definitions; + Map_string_string _t43 = g->as_cast_type_names; int _t45 = _t43.key_values.len; for (int _t44 = 0; _t44 < _t45; ++_t44 ) { int _t46 = _t43.key_values.len - _t45; @@ -69142,47 +69266,26 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre continue; } if (!DenseArray_has_index(&_t43.key_values, _t44)) {continue;} - int k = /*key*/ *(int*)DenseArray_key(&_t43.key_values, _t44); - bool v = (*(bool*)DenseArray_value(&_t43.key_values, _t44)); + string k = /*key*/ *(string*)DenseArray_key(&_t43.key_values, _t44); + k = string_clone(k); + string v = (*(string*)DenseArray_value(&_t43.key_values, _t44)); + map_set(&global_g.as_cast_type_names, &(string[]){k}, &(string[]) { v }); + } + Map_int_bool _t47 = g->sumtype_definitions; + int _t49 = _t47.key_values.len; + for (int _t48 = 0; _t48 < _t49; ++_t48 ) { + int _t50 = _t47.key_values.len - _t49; + _t49 = _t47.key_values.len; + if (_t50 < 0) { + _t48 = -1; + continue; + } + if (!DenseArray_has_index(&_t47.key_values, _t48)) {continue;} + int k = /*key*/ *(int*)DenseArray_key(&_t47.key_values, _t48); + bool v = (*(bool*)DenseArray_value(&_t47.key_values, _t48)); map_set(&global_g.sumtype_definitions, &(int[]){k}, &(bool[]) { v }); } - Option_int _t47 = strings__Builder_write(&global_g.json_forward_decls, g->json_forward_decls); - if (_t47.state != 0) { /*or block*/ - IError err = _t47.err; - _v_panic(IError_str(err)); - VUNREACHABLE(); - ; - } - - (*(int*)_t47.data); - Option_int _t48 = strings__Builder_write(&global_g.enum_typedefs, g->enum_typedefs); - if (_t48.state != 0) { /*or block*/ - IError err = _t48.err; - _v_panic(IError_str(err)); - VUNREACHABLE(); - ; - } - - (*(int*)_t48.data); - Option_int _t49 = strings__Builder_write(&global_g.channel_definitions, g->channel_definitions); - if (_t49.state != 0) { /*or block*/ - IError err = _t49.err; - _v_panic(IError_str(err)); - VUNREACHABLE(); - ; - } - - (*(int*)_t49.data); - Option_int _t50 = strings__Builder_write(&global_g.sql_buf, g->sql_buf); - if (_t50.state != 0) { /*or block*/ - IError err = _t50.err; - _v_panic(IError_str(err)); - VUNREACHABLE(); - ; - } - - (*(int*)_t50.data); - Option_int _t51 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.cleanups), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->cleanup); + Option_int _t51 = strings__Builder_write(&global_g.json_forward_decls, g->json_forward_decls); if (_t51.state != 0) { /*or block*/ IError err = _t51.err; _v_panic(IError_str(err)); @@ -69191,7 +69294,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t51.data); - Option_int _t52 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.inits), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->init); + Option_int _t52 = strings__Builder_write(&global_g.enum_typedefs, g->enum_typedefs); if (_t52.state != 0) { /*or block*/ IError err = _t52.err; _v_panic(IError_str(err)); @@ -69200,7 +69303,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t52.data); - Option_int _t53 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.global_inits), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->global_init); + Option_int _t53 = strings__Builder_write(&global_g.channel_definitions, g->channel_definitions); if (_t53.state != 0) { /*or block*/ IError err = _t53.err; _v_panic(IError_str(err)); @@ -69209,45 +69312,81 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t53.data); - for (int _t54 = 0; _t54 < g->str_types.len; ++_t54) { - v__gen__c__StrType str_type = ((v__gen__c__StrType*)g->str_types.data)[_t54]; + Option_int _t54 = strings__Builder_write(&global_g.sql_buf, g->sql_buf); + if (_t54.state != 0) { /*or block*/ + IError err = _t54.err; + _v_panic(IError_str(err)); + VUNREACHABLE(); + ; + } + + (*(int*)_t54.data); + Option_int _t55 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.cleanups), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->cleanup); + if (_t55.state != 0) { /*or block*/ + IError err = _t55.err; + _v_panic(IError_str(err)); + VUNREACHABLE(); + ; + } + + (*(int*)_t55.data); + Option_int _t56 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.inits), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->init); + if (_t56.state != 0) { /*or block*/ + IError err = _t56.err; + _v_panic(IError_str(err)); + VUNREACHABLE(); + ; + } + + (*(int*)_t56.data); + Option_int _t57 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.global_inits), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->global_init); + if (_t57.state != 0) { /*or block*/ + IError err = _t57.err; + _v_panic(IError_str(err)); + VUNREACHABLE(); + ; + } + + (*(int*)_t57.data); + for (int _t58 = 0; _t58 < g->str_types.len; ++_t58) { + v__gen__c__StrType str_type = ((v__gen__c__StrType*)g->str_types.data)[_t58]; array_push((array*)&global_g.str_types, _MOV((v__gen__c__StrType[]){ str_type })); } - for (int _t56 = 0; _t56 < g->sumtype_casting_fns.len; ++_t56) { - v__gen__c__SumtypeCastingFn scf = ((v__gen__c__SumtypeCastingFn*)g->sumtype_casting_fns.data)[_t56]; + for (int _t60 = 0; _t60 < g->sumtype_casting_fns.len; ++_t60) { + v__gen__c__SumtypeCastingFn scf = ((v__gen__c__SumtypeCastingFn*)g->sumtype_casting_fns.data)[_t60]; if (!Array_v__gen__c__SumtypeCastingFn_contains(global_g.sumtype_casting_fns, scf)) { array_push((array*)&global_g.sumtype_casting_fns, _MOV((v__gen__c__SumtypeCastingFn[]){ scf })); } } global_g.nr_closures += g->nr_closures; global_g.has_main = global_g.has_main || g->has_main; - _PUSH_MANY(&global_g.auto_fn_definitions, (g->auto_fn_definitions), _t58, Array_string); - _PUSH_MANY(&global_g.anon_fn_definitions, (g->anon_fn_definitions), _t59, Array_string); - _PUSH_MANY(&global_g.needed_equality_fns, (g->needed_equality_fns), _t60, Array_v__ast__Type); - _PUSH_MANY(&global_g.array_contains_types, (g->array_contains_types), _t61, Array_v__ast__Type); - _PUSH_MANY(&global_g.array_index_types, (g->array_index_types), _t62, Array_v__ast__Type); - _PUSH_MANY(&global_g.pcs, (g->pcs), _t63, Array_v__gen__c__ProfileCounterMeta); - _PUSH_MANY(&global_g.json_types, (g->json_types), _t64, Array_v__ast__Type); - _PUSH_MANY(&global_g.hotcode_fn_names, (g->hotcode_fn_names), _t65, Array_string); + _PUSH_MANY(&global_g.auto_fn_definitions, (g->auto_fn_definitions), _t62, Array_string); + _PUSH_MANY(&global_g.anon_fn_definitions, (g->anon_fn_definitions), _t63, Array_string); + _PUSH_MANY(&global_g.needed_equality_fns, (g->needed_equality_fns), _t64, Array_v__ast__Type); + _PUSH_MANY(&global_g.array_contains_types, (g->array_contains_types), _t65, Array_v__ast__Type); + _PUSH_MANY(&global_g.array_index_types, (g->array_index_types), _t66, Array_v__ast__Type); + _PUSH_MANY(&global_g.pcs, (g->pcs), _t67, Array_v__gen__c__ProfileCounterMeta); + _PUSH_MANY(&global_g.json_types, (g->json_types), _t68, Array_v__ast__Type); + _PUSH_MANY(&global_g.hotcode_fn_names, (g->hotcode_fn_names), _t69, Array_string); v__gen__c__Gen_free_builders(g); - Map_int_bool _t66 = g->autofree_methods; - int _t68 = _t66.key_values.len; - for (int _t67 = 0; _t67 < _t68; ++_t67 ) { - int _t69 = _t66.key_values.len - _t68; - _t68 = _t66.key_values.len; - if (_t69 < 0) { - _t67 = -1; + Map_int_bool _t70 = g->autofree_methods; + int _t72 = _t70.key_values.len; + for (int _t71 = 0; _t71 < _t72; ++_t71 ) { + int _t73 = _t70.key_values.len - _t72; + _t72 = _t70.key_values.len; + if (_t73 < 0) { + _t71 = -1; continue; } - if (!DenseArray_has_index(&_t66.key_values, _t67)) {continue;} - int k = /*key*/ *(int*)DenseArray_key(&_t66.key_values, _t67); - bool v = (*(bool*)DenseArray_value(&_t66.key_values, _t67)); + if (!DenseArray_has_index(&_t70.key_values, _t71)) {continue;} + int k = /*key*/ *(int*)DenseArray_key(&_t70.key_values, _t71); + bool v = (*(bool*)DenseArray_value(&_t70.key_values, _t71)); map_set(&global_g.autofree_methods, &(int[]){k}, &(bool[]) { v }); } } } else { - for (int _t70 = 0; _t70 < files.len; ++_t70) { - v__ast__File* file = ((v__ast__File**)files.data)[_t70]; + for (int _t74 = 0; _t74 < files.len; ++_t74) { + v__ast__File* file = ((v__ast__File**)files.data)[_t74]; global_g.file = file; v__gen__c__Gen_gen_file(&global_g); strings__Builder_drain_builder(&(*(strings__Builder*)map_get(ADDR(map, global_g.inits), &(string[]){file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), (voidptr)&/*qq*/global_g.init, 100); @@ -69258,12 +69397,13 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } v__gen__c__Gen_gen_jsons(&global_g); v__gen__c__Gen_write_optionals(&global_g); + v__gen__c__Gen_write_results(&global_g); v__gen__c__Gen_dump_expr_definitions(&global_g); for (int i = 0; i < global_g.str_types.len; i++) { v__gen__c__Gen_final_gen_str(&global_g, (*(v__gen__c__StrType*)/*ee elem_sym */array_get(global_g.str_types, i))); } - for (int _t71 = 0; _t71 < global_g.sumtype_casting_fns.len; ++_t71) { - v__gen__c__SumtypeCastingFn sumtype_casting_fn = ((v__gen__c__SumtypeCastingFn*)global_g.sumtype_casting_fns.data)[_t71]; + for (int _t75 = 0; _t75 < global_g.sumtype_casting_fns.len; ++_t75) { + v__gen__c__SumtypeCastingFn sumtype_casting_fn = ((v__gen__c__SumtypeCastingFn*)global_g.sumtype_casting_fns.data)[_t75]; v__gen__c__Gen_write_sumtype_casting_fn(&global_g, sumtype_casting_fn); } v__gen__c__Gen_write_shareds(&global_g); @@ -69282,7 +69422,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre if (idx == 0) { continue; } - strings__Builder_writeln(&g.definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("int _v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g.definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("int _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); } } else if (g.pref->use_cache) { for (int idx = 0; idx < g.table->type_symbols.len; ++idx) { @@ -69290,7 +69430,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre if (idx == 0) { continue; } - strings__Builder_writeln(&g.definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int _v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("() { return "), 0xfe07, {.d_i32 = idx}}, {_SLIT("; };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g.definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("() { return "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("; };"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_gen_vlines_reset(&g); @@ -69322,6 +69462,8 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre strings__Builder_write_string(&b, strings__Builder_str(&g.shared_types)); strings__Builder_writeln(&b, _SLIT("\n// V Option_xxx definitions:")); strings__Builder_write_string(&b, strings__Builder_str(&g.options)); + strings__Builder_writeln(&b, _SLIT("\n// V result_xxx definitions:")); + strings__Builder_write_string(&b, strings__Builder_str(&g.out_results)); strings__Builder_writeln(&b, _SLIT("\n// V json forward decls:")); strings__Builder_write_string(&b, strings__Builder_str(&g.json_forward_decls)); strings__Builder_writeln(&b, _SLIT("\n// V definitions:")); @@ -69365,8 +69507,8 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre strings__Builder_write_string(&b, strings__Builder_str(&g.dump_funcs)); } if (g.auto_fn_definitions.len > 0) { - for (int _t72 = 0; _t72 < g.auto_fn_definitions.len; ++_t72) { - string fn_def = ((string*)g.auto_fn_definitions.data)[_t72]; + for (int _t76 = 0; _t76 < g.auto_fn_definitions.len; ++_t76) { + string fn_def = ((string*)g.auto_fn_definitions.data)[_t76]; strings__Builder_writeln(&b, fn_def); } } @@ -69375,8 +69517,8 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre strings__Builder_writeln(&b, _SLIT("\n// V closure helpers")); strings__Builder_writeln(&b, v__gen__c__c_closure_helpers(g.pref)); } - for (int _t73 = 0; _t73 < g.anon_fn_definitions.len; ++_t73) { - string fn_def = ((string*)g.anon_fn_definitions.data)[_t73]; + for (int _t77 = 0; _t77 < g.anon_fn_definitions.len; ++_t77) { + string fn_def = ((string*)g.anon_fn_definitions.data)[_t77]; strings__Builder_writeln(&b, fn_def); } } @@ -69388,16 +69530,16 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre #if defined(CUSTOM_DEFINE_trace_all_generic_fn_keys) { Array_string gkeys = map_keys(&g.table->fn_generic_types); - for (int _t74 = 0; _t74 < gkeys.len; ++_t74) { - string gkey = ((string*)gkeys.data)[_t74]; - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> g.table.fn_generic_types key: "), 0xfe10, {.d_s = gkey}}, {_SLIT0, 0, { .d_c = 0 }}}))); + for (int _t78 = 0; _t78 < gkeys.len; ++_t78) { + string gkey = ((string*)gkeys.data)[_t78]; + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> g.table.fn_generic_types key: "), /*115 &string*/0xfe10, {.d_s = gkey}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } #endif strings__Builder_free(&b); v__gen__c__Gen_free_builders(&g); - string _t75 = res; - return _t75; + string _t79 = res; + return _t79; } VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__PoolProcessor* p, int idx, int wid) { @@ -69434,6 +69576,7 @@ VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__ .shared_types = strings__new_builder(100), .shared_functions = strings__new_builder(100), .options = strings__new_builder(100), + .out_results = strings__new_builder(100), .json_forward_decls = strings__new_builder(100), .sql_buf = strings__new_builder(100), .file = file, @@ -69460,6 +69603,7 @@ VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__ .is_cc_msvc = global_g->is_cc_msvc, .vlines_path = (string){.str=(byteptr)"", .is_lit=1}, .optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), + .results = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .done_optionals = global_g->done_optionals, .chan_pop_optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .chan_push_optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), @@ -69538,7 +69682,7 @@ VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__ .returned_var_name = (string){.str=(byteptr)"", .is_lit=1}, .infix_left_var_name = (string){.str=(byteptr)"", .is_lit=1}, .called_fn_name = (string){.str=(byteptr)"", .is_lit=1}, - .timers = v__util__new_timers(((v__util__TimerParams){.should_print = global_g->timers_should_print,.label = str_intp(3, _MOV((StrIntpData[]){{_SLIT("cgen_process_one_file_cb idx: "), 0xfe07, {.d_i32 = idx}}, {_SLIT(", wid: "), 0xfe07, {.d_i32 = wid}}, {_SLIT0, 0, { .d_c = 0 }}})),})), + .timers = v__util__new_timers(((v__util__TimerParams){.should_print = global_g->timers_should_print,.label = str_intp(3, _MOV((StrIntpData[]){{_SLIT("cgen_process_one_file_cb idx: "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT(", wid: "), /*100 &int*/0xfe07, {.d_i32 = wid}}, {_SLIT0, 0, { .d_c = 0 }}})),})), .force_main_console = 0, .as_cast_type_names = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .obf_table = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), @@ -69587,6 +69731,7 @@ void v__gen__c__Gen_free_builders(v__gen__c__Gen* g) { strings__Builder_free(&g->shared_functions); strings__Builder_free(&g->channel_definitions); strings__Builder_free(&g->options); + strings__Builder_free(&g->out_results); strings__Builder_free(&g->json_forward_decls); strings__Builder_free(&g->enum_typedefs); strings__Builder_free(&g->sql_buf); @@ -69633,7 +69778,7 @@ void v__gen__c__Gen_free_builders(v__gen__c__Gen* g) { } void v__gen__c__Gen_gen_file(v__gen__c__Gen* g) { - v__util__Timers_start(g->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen_file "), 0xfe10, {.d_s = g->file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_start(g->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen_file "), /*115 &string*/0xfe10, {.d_s = g->file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); g->unique_file_path_hash = hash__fnv1a__sum64_string(g->file->path); if (g->pref->is_vlines) { g->vlines_path = v__util__vlines_escape_path(g->file->path, g->pref->ccompiler); @@ -69647,7 +69792,7 @@ void v__gen__c__Gen_gen_file(v__gen__c__Gen* g) { array_push((array*)&g->embedded_files, _MOV((v__ast__EmbeddedFile[]){ path })); } } - v__util__Timers_show(g->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen_file "), 0xfe10, {.d_s = g->file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_show(g->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen_file "), /*115 &string*/0xfe10, {.d_s = g->file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string v__gen__c__Gen_hashes(v__gen__c__Gen* g) { @@ -69717,7 +69862,7 @@ void v__gen__c__Gen_init(v__gen__c__Gen* g) { strings__Builder_writeln(&g->comptime_definitions, string__plus(_SLIT("// Turned ON custom defines: "), Array_string_join(g->pref->compile_defines, _SLIT(",")))); for (int _t1 = 0; _t1 < g->pref->compile_defines.len; ++_t1) { string cdefine = ((string*)g->pref->compile_defines.data)[_t1]; - strings__Builder_writeln(&g->comptime_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define CUSTOM_DEFINE_"), 0xfe10, {.d_s = cdefine}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->comptime_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define CUSTOM_DEFINE_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->comptime_definitions, _SLIT("")); } @@ -69774,7 +69919,7 @@ void v__gen__c__Gen_init(v__gen__c__Gen* g) { if (!string__eq(f.mod, _SLIT("main")) && !string__eq(key, _SLIT("main"))) { continue; } - map_set(&g->obf_table, &(string[]){key}, &(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("_f"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})) }); + map_set(&g->obf_table, &(string[]){key}, &(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("_f"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})) }); i++; } for (int _t6 = 0; _t6 < g->table->type_symbols.len; ++_t6) { @@ -69784,7 +69929,7 @@ void v__gen__c__Gen_init(v__gen__c__Gen* g) { } for (int _t7 = 0; _t7 < type_sym->methods.len; ++_t7) { v__ast__Fn method = ((v__ast__Fn*)type_sym->methods.data)[_t7]; - map_set(&g->obf_table, &(string[]){string__plus(string__plus(type_sym->name, _SLIT(".")), method.name)}, &(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("_f"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})) }); + map_set(&g->obf_table, &(string[]){string__plus(string__plus(type_sym->name, _SLIT(".")), method.name)}, &(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("_f"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})) }); i++; } } @@ -69829,79 +69974,79 @@ void v__gen__c__Gen_write_typeof_functions(v__gen__c__Gen* g) { for (int ityp = 0; ityp < g->table->type_symbols.len; ++ityp) { v__ast__TypeSymbol* sym = ((v__ast__TypeSymbol**)g->table->type_symbols.data)[ityp]; if (sym->kind == v__ast__Kind__sum_type) { - v__ast__SumType sum_info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ; + v__ast__SumType sum_info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ; if (sum_info.is_generic) { continue; } - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_sumtype_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); if (g->pref->build_mode == v__pref__BuildMode__build_module) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif( sidx == _v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("() ) return \""), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif( sidx == _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("() ) return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < sum_info.variants.len; ++_t1) { v__ast__Type v = ((v__ast__Type*)sum_info.variants.data)[_t1]; v__ast__TypeSymbol* subtype = v__ast__Table_sym(g->table, v); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif( sidx == _v_type_idx_"), 0xfe10, {.d_s = subtype->cname}}, {_SLIT("() ) return \""), 0xfe10, {.d_s = v__util__strip_main_name(subtype->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif( sidx == _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = subtype->cname}}, {_SLIT("() ) return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(subtype->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn \"unknown "), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn \"unknown "), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); } else { int tidx = v__ast__Table_find_type_idx(g->table, sym->name); v__gen__c__Gen_writeln(g, _SLIT("\tswitch(sidx) {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = tidx}}, {_SLIT(": return \""), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = tidx}}, {_SLIT(": return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < sum_info.variants.len; ++_t2) { v__ast__Type v = ((v__ast__Type*)sum_info.variants.data)[_t2]; v__ast__TypeSymbol* subtype = v__ast__Table_sym(g->table, v); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = v__ast__Type_idx(v)}}, {_SLIT(": return \""), 0xfe10, {.d_s = v__util__strip_main_name(subtype->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(v)}}, {_SLIT(": return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(subtype->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tdefault: return \"unknown "), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tdefault: return \"unknown "), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t}")); } v__gen__c__Gen_writeln(g, _SLIT("}")); v__gen__c__Gen_writeln(g, _SLIT("")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_sumtype_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_sumtype_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); if (g->pref->build_mode == v__pref__BuildMode__build_module) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif( sidx == _v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("() ) return "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif( sidx == _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("() ) return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); for (int _t3 = 0; _t3 < sum_info.variants.len; ++_t3) { v__ast__Type v = ((v__ast__Type*)sum_info.variants.data)[_t3]; v__ast__TypeSymbol* subtype = v__ast__Table_sym(g->table, v); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif( sidx == _v_type_idx_"), 0xfe10, {.d_s = subtype->cname}}, {_SLIT("() ) return "), 0xfe07, {.d_i32 = ((int)(v))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif( sidx == _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = subtype->cname}}, {_SLIT("() ) return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(v))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { int tidx = v__ast__Table_find_type_idx(g->table, sym->name); v__gen__c__Gen_writeln(g, _SLIT("\tswitch(sidx) {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = tidx}}, {_SLIT(": return "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = tidx}}, {_SLIT(": return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); for (int _t4 = 0; _t4 < sum_info.variants.len; ++_t4) { v__ast__Type v = ((v__ast__Type*)sum_info.variants.data)[_t4]; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = v__ast__Type_idx(v)}}, {_SLIT(": return "), 0xfe07, {.d_i32 = ((int)(v))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(v)}}, {_SLIT(": return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(v))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tdefault: return "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tdefault: return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t}")); } v__gen__c__Gen_writeln(g, _SLIT("}")); } else if (sym->kind == v__ast__Kind__interface_) { - if ((sym->info)._typ != 434 /* v.ast.Interface */) { + if ((sym->info)._typ != 435 /* v.ast.Interface */) { continue; } - v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((sym->info)._v__ast__Interface,(sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((sym->info)._v__ast__Interface,(sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; if (inter_info.is_generic) { continue; } - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_interface_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx);"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_interface_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_interface_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_interface_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); for (int _t5 = 0; _t5 < inter_info.types.len; ++_t5) { v__ast__Type t = ((v__ast__Type*)inter_info.types.data)[_t5]; v__ast__TypeSymbol* sub_sym = v__ast__Table_sym(g->table, v__ast__mktyp(t)); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tif (sidx == _"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index) return \""), 0xfe10, {.d_s = v__util__strip_main_name(sub_sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tif (sidx == _"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index) return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sub_sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn \"unknown "), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn \"unknown "), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); v__gen__c__Gen_writeln(g, _SLIT("")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_interface_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_interface_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); for (int _t6 = 0; _t6 < inter_info.types.len; ++_t6) { v__ast__Type t = ((v__ast__Type*)inter_info.types.data)[_t6]; v__ast__TypeSymbol* sub_sym = v__ast__Table_sym(g->table, v__ast__mktyp(t)); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tif (sidx == _"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index) return "), 0xfe07, {.d_i32 = ((int)(t))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tif (sidx == _"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index) return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(t))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); } } @@ -69913,9 +70058,12 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_typ(v__gen__c__Gen* g, v__ast__Type t) { if (v__ast__Type_has_flag(t, v__ast__TypeFlag__optional)) { string _t1 = v__gen__c__Gen_register_optional(g, t); return _t1; - } else { - string _t2 = v__gen__c__Gen_base_type(g, t); + } else if (v__ast__Type_has_flag(t, v__ast__TypeFlag__result)) { + string _t2 = v__gen__c__Gen_register_result(g, t); return _t2; + } else { + string _t3 = v__gen__c__Gen_base_type(g, t); + return _t3; } return (string){.str=(byteptr)"", .is_lit=1}; } @@ -69993,7 +70141,16 @@ bool v__gen__c__Gen_expr_string_surround_defer_0 = false; VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_optional_type_name(v__gen__c__Gen* g, v__ast__Type t) { string base = v__gen__c__Gen_base_type(g, t); - string styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Option_"), 0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); + string styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Option_"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); + if (v__ast__Type_is_ptr(t)) { + styp = string_replace(styp, _SLIT("*"), _SLIT("_ptr")); + } + return (multi_return_string_string){.arg0=styp, .arg1=base}; +} + +VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_result_type_name(v__gen__c__Gen* g, v__ast__Type t) { + string base = v__gen__c__Gen_base_type(g, t); + string styp = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__result_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__ast__Type_is_ptr(t)) { styp = string_replace(styp, _SLIT("*"), _SLIT("_ptr")); } @@ -70002,20 +70159,36 @@ VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_optional_type_name(v__ VV_LOCAL_SYMBOL string v__gen__c__Gen_optional_type_text(v__gen__c__Gen* g, string styp, string base) { string size = (string__eq(base, _SLIT("void")) ? (_SLIT("u8")) : string_starts_with(base, _SLIT("anon_fn")) ? (_SLIT("void*")) : (base)); - string ret = str_intp(4, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = styp}}, {_SLIT(" {\n byte state;\n IError err;\n byte data[sizeof("), 0xfe10, {.d_s = size}}, {_SLIT(") > 0 ? sizeof("), 0xfe10, {.d_s = size}}, {_SLIT(") : 1];\n}"), 0, { .d_c = 0 }}})); + string ret = str_intp(4, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" {\n byte state;\n IError err;\n byte data[sizeof("), /*115 &string*/0xfe10, {.d_s = size}}, {_SLIT(") > 0 ? sizeof("), /*115 &string*/0xfe10, {.d_s = size}}, {_SLIT(") : 1];\n}"), 0, { .d_c = 0 }}})); + string _t1 = ret; + return _t1; +} + +VV_LOCAL_SYMBOL string v__gen__c__Gen_result_type_text(v__gen__c__Gen* g, string styp, string base) { + string size = (string__eq(base, _SLIT("void")) ? (_SLIT("u8")) : string_starts_with(base, _SLIT("anon_fn")) ? (_SLIT("void*")) : (base)); + string ret = str_intp(4, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" {\n bool is_error;\n IError err;\n byte data[sizeof("), /*115 &string*/0xfe10, {.d_s = size}}, {_SLIT(") > 0 ? sizeof("), /*115 &string*/0xfe10, {.d_s = size}}, {_SLIT(") : 1];\n}"), 0, { .d_c = 0 }}})); string _t1 = ret; return _t1; } VV_LOCAL_SYMBOL string v__gen__c__Gen_register_optional(v__gen__c__Gen* g, v__ast__Type t) { - multi_return_string_string mr_36790 = v__gen__c__Gen_optional_type_name(g, t); - string styp = mr_36790.arg0; - string base = mr_36790.arg1; + multi_return_string_string mr_37817 = v__gen__c__Gen_optional_type_name(g, t); + string styp = mr_37817.arg0; + string base = mr_37817.arg1; map_set(&g->optionals, &(string[]){base}, &(string[]) { styp }); string _t1 = styp; return _t1; } +VV_LOCAL_SYMBOL string v__gen__c__Gen_register_result(v__gen__c__Gen* g, v__ast__Type t) { + multi_return_string_string mr_37950 = v__gen__c__Gen_result_type_name(g, t); + string styp = mr_37950.arg0; + string base = mr_37950.arg1; + map_set(&g->results, &(string[]){base}, &(string[]) { styp }); + string _t1 = styp; + return _t1; +} + VV_LOCAL_SYMBOL void v__gen__c__Gen_write_optionals(v__gen__c__Gen* g) { Array_string done = __new_array_with_default(0, 0, sizeof(string), 0); sync__RwMutex_rlock(&g->done_optionals->mtx); @@ -70040,14 +70213,38 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_optionals(v__gen__c__Gen* g) { continue; } array_push((array*)&done, _MOV((string[]){ string_clone(base) })); - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->options, string__plus(v__gen__c__Gen_optional_type_text(g, styp, base), _SLIT(";\n\n"))); } } +VV_LOCAL_SYMBOL void v__gen__c__Gen_write_results(v__gen__c__Gen* g) { + Array_string done = __new_array_with_default(0, 0, sizeof(string), 0); + Map_string_string _t1 = g->results; + int _t3 = _t1.key_values.len; + for (int _t2 = 0; _t2 < _t3; ++_t2 ) { + int _t4 = _t1.key_values.len - _t3; + _t3 = _t1.key_values.len; + if (_t4 < 0) { + _t2 = -1; + continue; + } + if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} + string base = /*key*/ *(string*)DenseArray_key(&_t1.key_values, _t2); + base = string_clone(base); + string styp = (*(string*)DenseArray_value(&_t1.key_values, _t2)); + if (Array_string_contains(done, base)) { + continue; + } + array_push((array*)&done, _MOV((string[]){ string_clone(base) })); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->out_results, string__plus(v__gen__c__Gen_result_type_text(g, styp, base), _SLIT(";\n\n"))); + } +} + VV_LOCAL_SYMBOL string v__gen__c__Gen_find_or_register_shared(v__gen__c__Gen* g, v__ast__Type t, string base) { map_set(&g->shareds, &(int[]){v__ast__Type_idx(t)}, &(string[]) { base }); - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -70069,18 +70266,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_shareds(v__gen__c__Gen* g) { continue; } array_push((array*)&done_types, _MOV((int[]){ typ })); - string sh_typ = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); + string sh_typ = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); string mtx_typ = _SLIT("sync__RwMutex"); - strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = sh_typ}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = mtx_typ}}, {_SLIT(" mtx;"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = base}}, {_SLIT(" val;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = mtx_typ}}, {_SLIT(" mtx;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT(" val;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->shared_types, _SLIT("};")); - strings__Builder_writeln(&g->shared_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static inline voidptr __dup"), 0xfe10, {.d_s = sh_typ}}, {_SLIT("(voidptr src, int sz) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->shared_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = sh_typ}}, {_SLIT("* dest = memdup(src, sz);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static inline voidptr __dup"), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT("(voidptr src, int sz) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT("* dest = memdup(src, sz);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->shared_functions, _SLIT("\tsync__RwMutex_init(&dest->mtx);")); strings__Builder_writeln(&g->shared_functions, _SLIT("\treturn dest;")); strings__Builder_writeln(&g->shared_functions, _SLIT("}")); - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = sh_typ}}, {_SLIT(" "), 0xfe10, {.d_s = sh_typ}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } @@ -70108,10 +70305,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_register_thread_void_wait_call(v__gen__c__Ge VV_LOCAL_SYMBOL string v__gen__c__Gen_register_thread_array_wait_call(v__gen__c__Gen* g, string eltyp) { bool is_void = string__eq(eltyp, _SLIT("void")); - string thread_typ = (is_void ? (_SLIT("__v_thread")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), 0xfe10, {.d_s = eltyp}}, {_SLIT0, 0, { .d_c = 0 }}})))); - string ret_typ = (is_void ? (_SLIT("void")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), 0xfe10, {.d_s = eltyp}}, {_SLIT0, 0, { .d_c = 0 }}})))); - string thread_arr_typ = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), 0xfe10, {.d_s = thread_typ}}, {_SLIT0, 0, { .d_c = 0 }}})); - string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = thread_arr_typ}}, {_SLIT("_wait"), 0, { .d_c = 0 }}})); + string thread_typ = (is_void ? (_SLIT("__v_thread")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string ret_typ = (is_void ? (_SLIT("void")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string thread_arr_typ = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = thread_arr_typ}}, {_SLIT("_wait"), 0, { .d_c = 0 }}})); bool should_register = false; sync__RwMutex_lock(&g->waiter_fns->mtx); /*lock*/ { @@ -70124,15 +70321,15 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_register_thread_array_wait_call(v__gen__c_ if (should_register) { if (is_void) { v__gen__c__Gen_register_thread_void_wait_call(g); - strings__Builder_writeln(&g->gowrappers, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nvoid "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = thread_arr_typ}}, {_SLIT(" a) {\n for (int i = 0; i < a.len; ++i) {\n "), 0xfe10, {.d_s = thread_typ}}, {_SLIT(" t = (("), 0xfe10, {.d_s = thread_typ}}, {_SLIT("*)a.data)[i];\n if (t == 0) continue;\n __v_thread_wait(t);\n }\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nvoid "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = thread_arr_typ}}, {_SLIT(" a) {\n for (int i = 0; i < a.len; ++i) {\n "), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT(" t = (("), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT("*)a.data)[i];\n if (t == 0) continue;\n __v_thread_wait(t);\n }\n}"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->gowrappers, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = thread_arr_typ}}, {_SLIT(" a) {\n "), 0xfe10, {.d_s = ret_typ}}, {_SLIT(" res = __new_array_with_default(a.len, a.len, sizeof("), 0xfe10, {.d_s = eltyp}}, {_SLIT("), 0);\n for (int i = 0; i < a.len; ++i) {\n "), 0xfe10, {.d_s = thread_typ}}, {_SLIT(" t = (("), 0xfe10, {.d_s = thread_typ}}, {_SLIT("*)a.data)[i];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = thread_arr_typ}}, {_SLIT(" a) {\n "), /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" res = __new_array_with_default(a.len, a.len, sizeof("), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT("), 0);\n for (int i = 0; i < a.len; ++i) {\n "), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT(" t = (("), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT("*)a.data)[i];"), 0, { .d_c = 0 }}}))); if (g->pref->os == v__pref__OS__windows) { strings__Builder_writeln(&g->gowrappers, _SLIT("\t\tif (t.handle == 0) continue;")); } else { strings__Builder_writeln(&g->gowrappers, _SLIT("\t\tif (t == 0) continue;")); } - strings__Builder_writeln(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t(("), 0xfe10, {.d_s = eltyp}}, {_SLIT("*)res.data)[i] = __v_thread_"), 0xfe10, {.d_s = eltyp}}, {_SLIT("_wait(t);\n }\n return res;\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t(("), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT("*)res.data)[i] = __v_thread_"), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT("_wait(t);\n }\n return res;\n}"), 0, { .d_c = 0 }}}))); } } string _t2 = fn_name; @@ -70162,7 +70359,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_chan_pop_optional_fns(v__gen__c__Gen* continue; } array_push((array*)&done, _MOV((string[]){ string_clone(opt_el_type) })); - strings__Builder_writeln(&g->channel_definitions, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), 0xfe10, {.d_s = opt_el_type}}, {_SLIT(" __Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0xfe10, {.d_s = styp}}, {_SLIT(" ch) {\n "), 0xfe10, {.d_s = opt_el_type}}, {_SLIT(" _tmp = {0};\n if (sync__Channel_try_pop_priv(ch, _tmp.data, false)) {\n return ("), 0xfe10, {.d_s = opt_el_type}}, {_SLIT("){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return _tmp;\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), /*115 &string*/0xfe10, {.d_s = opt_el_type}}, {_SLIT(" __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_popval("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ch) {\n "), /*115 &string*/0xfe10, {.d_s = opt_el_type}}, {_SLIT(" _tmp = {0};\n if (sync__Channel_try_pop_priv(ch, _tmp.data, false)) {\n return ("), /*115 &string*/0xfe10, {.d_s = opt_el_type}}, {_SLIT("){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return _tmp;\n}"), 0, { .d_c = 0 }}}))); } } @@ -70190,42 +70387,42 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_chan_push_optional_fns(v__gen__c__Gen* } array_push((array*)&done, _MOV((string[]){ string_clone(styp) })); v__gen__c__Gen_register_optional(g, v__ast__Type_set_flag(_const_v__ast__void_type, v__ast__TypeFlag__optional)); - strings__Builder_writeln(&g->channel_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nstatic inline Option_void __Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0xfe10, {.d_s = styp}}, {_SLIT(" ch, "), 0xfe10, {.d_s = el_type}}, {_SLIT(" e) {\n if (sync__Channel_try_push_priv(ch, &e, false)) {\n return (Option_void){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return (Option_void){0};\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nstatic inline Option_void __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ch, "), /*115 &string*/0xfe10, {.d_s = el_type}}, {_SLIT(" e) {\n if (sync__Channel_try_push_priv(ch, &e, false)) {\n return (Option_void){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return (Option_void){0};\n}"), 0, { .d_c = 0 }}}))); } } VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type typ, bool is_prefix_struct) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); string styp = sym->cname; - if (sym->info._typ == 416 /* v.ast.Struct */) { + if (sym->info._typ == 417 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { string sgtyps = _SLIT("_T"); for (int _t1 = 0; _t1 < (*sym->info._v__ast__Struct).generic_types.len; ++_t1) { v__ast__Type gt = ((v__ast__Type*)(*sym->info._v__ast__Struct).generic_types.data)[_t1]; v__ast__TypeSymbol* gts = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, gt)); - sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } styp = /*f*/string__plus(styp, sgtyps); } } - else if (sym->info._typ == 434 /* v.ast.Interface */) { + else if (sym->info._typ == 435 /* v.ast.Interface */) { if ((*sym->info._v__ast__Interface).is_generic) { string sgtyps = _SLIT("_T"); for (int _t2 = 0; _t2 < (*sym->info._v__ast__Interface).generic_types.len; ++_t2) { v__ast__Type gt = ((v__ast__Type*)(*sym->info._v__ast__Interface).generic_types.data)[_t2]; v__ast__TypeSymbol* gts = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, gt)); - sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } styp = /*f*/string__plus(styp, sgtyps); } } - else if (sym->info._typ == 435 /* v.ast.SumType */) { + else if (sym->info._typ == 436 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { string sgtyps = _SLIT("_T"); for (int _t3 = 0; _t3 < (*sym->info._v__ast__SumType).generic_types.len; ++_t3) { v__ast__Type gt = ((v__ast__Type*)(*sym->info._v__ast__SumType).generic_types.data)[_t3]; v__ast__TypeSymbol* gts = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, gt)); - sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } styp = /*f*/string__plus(styp, sgtyps); } @@ -70237,9 +70434,9 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type ty if (is_prefix_struct && sym->language == v__ast__Language__c) { styp = string_substr(styp, 3, (styp).len); if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (!info.is_typedef) { - styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = styp}}, {_SLIT0, 0, { .d_c = 0 }}})); + styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT0, 0, { .d_c = 0 }}})); } } } @@ -70251,7 +70448,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type ty inline VV_LOCAL_SYMBOL string v__gen__c__Gen_type_sidx(v__gen__c__Gen* g, v__ast__Type t) { if (g->pref->build_mode == v__pref__BuildMode__build_module) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, t); - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("()"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("()"), 0, { .d_c = 0 }}})); return _t1; } string _t2 = int_str(v__ast__Type_idx(t)); @@ -70266,45 +70463,45 @@ void v__gen__c__Gen_write_typedef_types(v__gen__c__Gen* g) { } if (sym->kind == (v__ast__Kind__array)) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, info.elem_type); if (elem_sym->kind != v__ast__Kind__placeholder && !v__ast__Type_has_flag(info.elem_type, v__ast__TypeFlag__generic)) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef array "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef array "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == (v__ast__Kind__array_fixed)) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, info.elem_type); if (v__ast__TypeSymbol_is_builtin(elem_sym)) { string styp = sym->cname; string len = string_after(styp, _SLIT("_")); string fixed = v__gen__c__Gen_typ(g, info.elem_type); - if ((elem_sym->info)._typ == 443 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 444 /* v.ast.FnType */) { int pos = g->out.len; v__gen__c__Gen_write_fn_ptr_decl(g, &(*elem_sym->info._v__ast__FnType), _SLIT("")); fixed = strings__Builder_cut_to(&g->out, pos); - string def_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = fixed}}, {_SLIT(";"), 0, { .d_c = 0 }}})); - def_str = string_replace_once(def_str, _SLIT("(*)"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*"), 0xfe10, {.d_s = styp}}, {_SLIT("["), 0xfe10, {.d_s = len}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + string def_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = fixed}}, {_SLIT(";"), 0, { .d_c = 0 }}})); + def_str = string_replace_once(def_str, _SLIT("(*)"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = len}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, def_str); } else { - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = fixed}}, {_SLIT(" "), 0xfe10, {.d_s = styp}}, {_SLIT(" ["), 0xfe10, {.d_s = len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = fixed}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ["), /*115 &string*/0xfe10, {.d_s = len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } } else if (sym->kind == (v__ast__Kind__chan)) { if (!string__eq(sym->name, _SLIT("chan"))) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef chan "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef chan "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__ast__Chan chan_inf = v__ast__TypeSymbol_chan_info(sym); v__ast__Type chan_elem_type = chan_inf.elem_type; if (!v__ast__Type_has_flag(chan_elem_type, v__ast__TypeFlag__generic)) { string el_stype = v__gen__c__Gen_typ(g, chan_elem_type); - strings__Builder_writeln(&g->channel_definitions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), 0xfe10, {.d_s = el_stype}}, {_SLIT(" __"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_popval("), 0xfe10, {.d_s = sym->cname}}, {_SLIT(" ch) {\n "), 0xfe10, {.d_s = el_stype}}, {_SLIT(" val;\n sync__Channel_try_pop_priv(ch, &val, false);\n return val;\n}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->channel_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nstatic inline void __"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_pushval("), 0xfe10, {.d_s = sym->cname}}, {_SLIT(" ch, "), 0xfe10, {.d_s = el_stype}}, {_SLIT(" val) {\n sync__Channel_try_push_priv(ch, &val, false);\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" __"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_popval("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(" ch) {\n "), /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" val;\n sync__Channel_try_pop_priv(ch, &val, false);\n return val;\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nstatic inline void __"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_pushval("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(" ch, "), /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" val) {\n sync__Channel_try_push_priv(ch, &val, false);\n}"), 0, { .d_c = 0 }}}))); } } } else if (sym->kind == (v__ast__Kind__map)) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef map "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef map "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { continue; @@ -70341,7 +70538,7 @@ void v__gen__c__Gen_write_alias_typesymbol_declaration(v__gen__c__Gen* g, v__ast bool is_c_parent = parent->name.len > 2 && string_at(parent->name, 0) == 'C' && string_at(parent->name, 1) == '.'; bool is_typedef = false; bool is_fixed_array_of_non_builtin = false; - if ((parent->info)._typ == 416 /* v.ast.Struct */) { + if ((parent->info)._typ == 417 /* v.ast.Struct */) { is_typedef = (*parent->info._v__ast__Struct).is_typedef; } string parent_styp = parent->cname; @@ -70352,10 +70549,10 @@ void v__gen__c__Gen_write_alias_typesymbol_declaration(v__gen__c__Gen* g, v__ast parent_styp = string_substr(parent->cname, 3, (parent->cname).len); } } else { - if ((sym.info)._typ == 431 /* v.ast.Alias */) { + if ((sym.info)._typ == 432 /* v.ast.Alias */) { parent_styp = v__gen__c__Gen_typ(g, (*sym.info._v__ast__Alias).parent_type); v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*sym.info._v__ast__Alias).parent_type); - if ((parent_sym->info)._typ == 439 /* v.ast.ArrayFixed */) { + if ((parent_sym->info)._typ == 440 /* v.ast.ArrayFixed */) { v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, (*parent_sym->info._v__ast__ArrayFixed).elem_type); if (!v__ast__TypeSymbol_is_builtin(elem_sym)) { is_fixed_array_of_non_builtin = true; @@ -70367,27 +70564,27 @@ void v__gen__c__Gen_write_alias_typesymbol_declaration(v__gen__c__Gen* g, v__ast return; } if (is_fixed_array_of_non_builtin) { - strings__Builder_writeln(&g->alias_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = parent_styp}}, {_SLIT(" "), 0xfe10, {.d_s = sym.cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->alias_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = parent_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = parent_styp}}, {_SLIT(" "), 0xfe10, {.d_s = sym.cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = parent_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } void v__gen__c__Gen_write_interface_typedef(v__gen__c__Gen* g, v__ast__TypeSymbol sym) { string struct_name = v__gen__c__c_name(sym.cname); - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = struct_name}}, {_SLIT(" "), 0xfe10, {.d_s = struct_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = struct_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = struct_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v__ast__TypeSymbol sym) { - if ((sym.info)._typ != 434 /* v.ast.Interface */) { + if ((sym.info)._typ != 435 /* v.ast.Interface */) { return; } - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((sym.info)._v__ast__Interface,(sym.info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((sym.info)._v__ast__Interface,(sym.info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; if (info.is_generic) { return; } string struct_name = v__gen__c__c_name(sym.cname); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, _SLIT("\tunion {")); strings__Builder_writeln(&g->type_definitions, _SLIT("\t\tvoid* _object;")); for (int _t1 = 0; _t1 < info.types.len; ++_t1) { @@ -70397,7 +70594,7 @@ void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v_ continue; } string vcname = v__ast__Table_sym(g->table, mk_typ)->cname; - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = vcname}}, {_SLIT("* _"), 0xfe10, {.d_s = vcname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = vcname}}, {_SLIT("* _"), /*115 &string*/0xfe10, {.d_s = vcname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->type_definitions, _SLIT("\t};")); strings__Builder_writeln(&g->type_definitions, _SLIT("\tint _typ;")); @@ -70405,13 +70602,13 @@ void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v_ v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t2]; string styp = v__gen__c__Gen_typ(g, field.typ); string cname = v__gen__c__c_name(field.name); - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT("* "), 0xfe10, {.d_s = cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->type_definitions, _SLIT("};")); } void v__gen__c__Gen_write_fn_typesymbol_declaration(v__gen__c__Gen* g, v__ast__TypeSymbol sym) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym.info)._v__ast__FnType,(sym.info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym.info)._v__ast__FnType,(sym.info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; v__ast__Fn func = info.func; bool is_fn_sig = (func.name).len == 0; bool not_anon = !info.is_anon; @@ -70432,16 +70629,16 @@ void v__gen__c__Gen_write_fn_typesymbol_declaration(v__gen__c__Gen* g, v__ast__T if (string__eq(attr.name, _SLIT("callconv"))) { if (g->is_cc_msvc) { - msvc_call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = attr.arg}}, {_SLIT(" "), 0, { .d_c = 0 }}})); + msvc_call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT(" "), 0, { .d_c = 0 }}})); } else { - call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}})); + call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}})); } } else { }; } - string call_conv_attribute_suffix = (call_conv.len != 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), 0xfe10, {.d_s = call_conv}}, {_SLIT("))"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); - strings__Builder_write_string(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" ("), 0xfe10, {.d_s = msvc_call_conv}}, {_SLIT("*"), 0xfe10, {.d_s = fn_name}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); + string call_conv_attribute_suffix = (call_conv.len != 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), /*115 &string*/0xfe10, {.d_s = call_conv}}, {_SLIT("))"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); + strings__Builder_write_string(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" ("), /*115 &string*/0xfe10, {.d_s = msvc_call_conv}}, {_SLIT("*"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); for (int i = 0; i < func.params.len; ++i) { v__ast__Param param = ((v__ast__Param*)func.params.data)[i]; strings__Builder_write_string(&g->type_definitions, v__gen__c__Gen_typ(g, param.typ)); @@ -70449,7 +70646,7 @@ void v__gen__c__Gen_write_fn_typesymbol_declaration(v__gen__c__Gen* g, v__ast__T strings__Builder_write_string(&g->type_definitions, _SLIT(",")); } } - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), 0xfe10, {.d_s = call_conv_attribute_suffix}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), /*115 &string*/0xfe10, {.d_s = call_conv_attribute_suffix}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } @@ -70476,12 +70673,12 @@ void v__gen__c__Gen_write_multi_return_types(v__gen__c__Gen* g) { if (_t2.len > 0) { continue; } - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(" "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); for (int i = 0; i < info.types.len; ++i) { v__ast__Type mr_typ = ((v__ast__Type*)info.types.data)[i]; string type_name = v__gen__c__Gen_typ(g, mr_typ); - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = type_name}}, {_SLIT(" arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->type_definitions, _SLIT("};\n")); } @@ -70492,7 +70689,7 @@ void v__gen__c__Gen_write_multi_return_types(v__gen__c__Gen* g) { void v__gen__c__Gen_write(v__gen__c__Gen* g, string s) { #if defined(CUSTOM_DEFINE_trace_gen) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("gen file: "), 0x3cfe10, {.d_s = g->file->path}}, {_SLIT(" | last_fn_c_name: "), 0x5afe10, {.d_s = g->last_fn_c_name}}, {_SLIT(" | write: "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("gen file: "), /*115 &string*/0x3cfe10, {.d_s = g->file->path}}, {_SLIT(" | last_fn_c_name: "), /*115 &string*/0x5afe10, {.d_s = g->last_fn_c_name}}, {_SLIT(" | write: "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif if (g->indent > 0 && g->empty_line) { @@ -70505,7 +70702,7 @@ void v__gen__c__Gen_write(v__gen__c__Gen* g, string s) { void v__gen__c__Gen_writeln(v__gen__c__Gen* g, string s) { #if defined(CUSTOM_DEFINE_trace_gen) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("gen file: "), 0x3cfe10, {.d_s = g->file->path}}, {_SLIT(" | last_fn_c_name: "), 0x5afe10, {.d_s = g->last_fn_c_name}}, {_SLIT(" | writeln: "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("gen file: "), /*115 &string*/0x3cfe10, {.d_s = g->file->path}}, {_SLIT(" | last_fn_c_name: "), /*115 &string*/0x5afe10, {.d_s = g->last_fn_c_name}}, {_SLIT(" | writeln: "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif if (g->indent > 0 && g->empty_line) { @@ -70517,24 +70714,24 @@ void v__gen__c__Gen_writeln(v__gen__c__Gen* g, string s) { string v__gen__c__Gen_new_tmp_var(v__gen__c__Gen* g) { g->tmp_count++; - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), 0xfe07, {.d_i32 = g->tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), /*100 &int*/0xfe07, {.d_i32 = g->tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string v__gen__c__Gen_new_global_tmp_var(v__gen__c__Gen* g) { g->global_tmp_count++; - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), 0xfe07, {.d_i32 = g->global_tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), /*100 &int*/0xfe07, {.d_i32 = g->global_tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string v__gen__c__Gen_new_tmp_declaration_name(v__gen__c__Gen* g) { g->tmp_count_declarations++; - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d"), 0xfe07, {.d_i32 = g->tmp_count_declarations}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d"), /*100 &int*/0xfe07, {.d_i32 = g->tmp_count_declarations}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string v__gen__c__Gen_current_tmp_var(v__gen__c__Gen* g) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), 0xfe07, {.d_i32 = g->tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), /*100 &int*/0xfe07, {.d_i32 = g->tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -70558,7 +70755,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts(v__gen__c__Gen* g, Array_v__ast__Stmt } VV_LOCAL_SYMBOL bool v__gen__c__is_noreturn_callexpr(v__ast__Expr expr) { - if ((expr)._typ == 252 /* v.ast.CallExpr */) { + if ((expr)._typ == 253 /* v.ast.CallExpr */) { bool _t1 = (*expr._v__ast__CallExpr).is_noreturn; return _t1; } @@ -70577,10 +70774,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts_with_tmp_var(v__gen__c__Gen* g, Array_ if (g->inside_if_optional || g->inside_match_optional) { v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); g->skip_stmt_pos = true; - if ((stmt)._typ == 306 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).typ == _const_v__ast__error_type_idx || ((*stmt._v__ast__ExprStmt).expr)._typ == 278 /* v.ast.None */) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_var}}, {_SLIT(".state = 2;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_var}}, {_SLIT(".err = "), 0, { .d_c = 0 }}}))); + if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).typ == _const_v__ast__error_type_idx || ((*stmt._v__ast__ExprStmt).expr)._typ == 279 /* v.ast.None */) { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(".state = 2;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(".err = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*stmt._v__ast__ExprStmt).expr); v__gen__c__Gen_writeln(g, _SLIT(";")); } else { @@ -70594,20 +70791,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts_with_tmp_var(v__gen__c__Gen* g, Array_ } } #endif - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), 0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_stmt(g, stmt); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), 0xfe10, {.d_s = tmp_var}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } } } else { v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); g->skip_stmt_pos = true; bool is_noreturn = false; - if ((stmt)._typ == 306 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { is_noreturn = v__gen__c__is_noreturn_callexpr((*stmt._v__ast__ExprStmt).expr); } if (!is_noreturn) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_stmt(g, stmt); if (!string_contains(strings__Builder_last_n(&g->out, 2), _SLIT(";"))) { @@ -70616,7 +70813,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts_with_tmp_var(v__gen__c__Gen* g, Array_ } } else { v__gen__c__Gen_stmt(g, stmt); - if ((g->inside_if_optional || g->inside_match_optional) && (stmt)._typ == 306 /* v.ast.ExprStmt */) { + if ((g->inside_if_optional || g->inside_match_optional) && (stmt)._typ == 307 /* v.ast.ExprStmt */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } @@ -70632,19 +70829,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts_with_tmp_var(v__gen__c__Gen* g, Array_ } if (g->is_autofree && !g->inside_vweb_tmpl && stmts.len > 0) { v__ast__Stmt stmt = (*(v__ast__Stmt*)/*ee elem_sym */array_get(stmts, 0)); - if ((stmt)._typ != 183 /* v.ast.FnDecl */ && g->inside_ternary == 0) { + if ((stmt)._typ != 184 /* v.ast.FnDecl */ && g->inside_ternary == 0) { v__token__Pos stmt_pos = (*(stmt.pos)); if (stmt_pos.pos == 0) { - if ((stmt)._typ == 316 /* v.ast.Module */) { + if ((stmt)._typ == 317 /* v.ast.Module */) { return; } - if ((stmt)._typ == 306 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { stmt_pos = v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr); } if (stmt_pos.pos == 0) { #if defined(CUSTOM_DEFINE_trace_autofree) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("autofree: first stmt pos = 0. "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (stmt)._typ ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("autofree: first stmt pos = 0. "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (stmt)._typ ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif return; @@ -70659,10 +70856,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts_with_tmp_var(v__gen__c__Gen* g, Array_ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_write_v_source_line_info(v__gen__c__Gen* g, v__token__Pos pos) { if (g->inside_ternary == 0 && g->pref->is_vlines && g->is_vlines_enabled) { int nline = pos.line_nr + 1; - string lineinfo = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n#line "), 0xfe07, {.d_i32 = nline}}, {_SLIT(" \""), 0xfe10, {.d_s = g->vlines_path}}, {_SLIT("\""), 0, { .d_c = 0 }}})); + string lineinfo = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n#line "), /*100 &int*/0xfe07, {.d_i32 = nline}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = g->vlines_path}}, {_SLIT("\""), 0, { .d_c = 0 }}})); #if defined(CUSTOM_DEFINE_trace_gen_source_line_info) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> lineinfo: "), 0xfe10, {.d_s = string_replace(lineinfo, _SLIT("\n"), _SLIT(""))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> lineinfo: "), /*115 &string*/0xfe10, {.d_s = string_replace(lineinfo, _SLIT("\n"), _SLIT(""))}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__gen__c__Gen_writeln(g, lineinfo); @@ -70673,21 +70870,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { if (!g->skip_stmt_pos) { v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); } - if (node._typ == 304 /* v.ast.EmptyStmt */) { + if (node._typ == 305 /* v.ast.EmptyStmt */) { } - else if (node._typ == 296 /* v.ast.AsmStmt */) { + else if (node._typ == 297 /* v.ast.AsmStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__AsmStmt).pos); v__gen__c__Gen_gen_asm_stmt(g, (*node._v__ast__AsmStmt)); } - else if (node._typ == 297 /* v.ast.AssertStmt */) { + else if (node._typ == 298 /* v.ast.AssertStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__AssertStmt).pos); v__gen__c__Gen_gen_assert_stmt(g, (*node._v__ast__AssertStmt)); } - else if (node._typ == 298 /* v.ast.AssignStmt */) { + else if (node._typ == 299 /* v.ast.AssignStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__AssignStmt).pos); v__gen__c__Gen_gen_assign_stmt(g, (*node._v__ast__AssignStmt)); } - else if (node._typ == 299 /* v.ast.Block */) { + else if (node._typ == 300 /* v.ast.Block */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__Block).pos); if ((*node._v__ast__Block).is_unsafe) { v__gen__c__Gen_writeln(g, _SLIT("{ // Unsafe block")); @@ -70697,7 +70894,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { v__gen__c__Gen_stmts(g, (*node._v__ast__Block).stmts); v__gen__c__Gen_writeln(g, _SLIT("}")); } - else if (node._typ == 300 /* v.ast.BranchStmt */) { + else if (node._typ == 301 /* v.ast.BranchStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__BranchStmt).pos); if (((*node._v__ast__BranchStmt).label).len != 0) { v__ast__Stmt** _t2 = (v__ast__Stmt**)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->labeled_loops), &(string[]){(*node._v__ast__BranchStmt).label})); @@ -70710,23 +70907,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { ; if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT(" doesn\'t exist "), 0xfe10, {.d_s = g->file->path}}, {_SLIT(", "), 0xfe10, {.d_s = v__token__Pos_str((*node._v__ast__BranchStmt).pos)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT(" doesn\'t exist "), /*115 &string*/0xfe10, {.d_s = g->file->path}}, {_SLIT(", "), /*115 &v.token.Pos*/0xfe10, {.d_s = v__token__Pos_str((*node._v__ast__BranchStmt).pos)}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } v__ast__Stmt* x = *(v__ast__Stmt**)_t1.data; - if (x->_typ == 307 /* v.ast.ForCStmt */) { + if (x->_typ == 308 /* 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); } } - else if (x->_typ == 308 /* v.ast.ForInStmt */) { + else if (x->_typ == 309 /* v.ast.ForInStmt */) { if (v__ast__Scope_contains((*x->_v__ast__ForInStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } } - else if (x->_typ == 309 /* v.ast.ForStmt */) { + else if (x->_typ == 310 /* v.ast.ForStmt */) { if (v__ast__Scope_contains((*x->_v__ast__ForStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } @@ -70736,23 +70933,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } ; if ((*node._v__ast__BranchStmt).kind == v__token__Kind__key_break) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), 0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT("__break;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT("__break;"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), 0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT("__continue;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT("__continue;"), 0, { .d_c = 0 }}}))); } } else { v__ast__Stmt* inner_loop = g->inner_loop; - if (inner_loop->_typ == 307 /* v.ast.ForCStmt */) { + if (inner_loop->_typ == 308 /* v.ast.ForCStmt */) { if (v__ast__Scope_contains((*inner_loop->_v__ast__ForCStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } } - else if (inner_loop->_typ == 308 /* v.ast.ForInStmt */) { + else if (inner_loop->_typ == 309 /* v.ast.ForInStmt */) { if (v__ast__Scope_contains((*inner_loop->_v__ast__ForInStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } } - else if (inner_loop->_typ == 309 /* v.ast.ForStmt */) { + else if (inner_loop->_typ == 310 /* v.ast.ForStmt */) { if (v__ast__Scope_contains((*inner_loop->_v__ast__ForStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } @@ -70765,23 +70962,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { ; v__gen__c__Gen_autofree_scope_vars_stop(g, (*node._v__ast__BranchStmt).pos.pos - 1, (*node._v__ast__BranchStmt).pos.line_nr, true, g->branch_parent_pos); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__token__Kind_str((*node._v__ast__BranchStmt).kind)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str((*node._v__ast__BranchStmt).kind)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (node._typ == 302 /* v.ast.ConstDecl */) { + else if (node._typ == 303 /* v.ast.ConstDecl */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__ConstDecl).pos); v__gen__c__Gen_const_decl(g, (*node._v__ast__ConstDecl)); } - else if (node._typ == 301 /* v.ast.ComptimeFor */) { + else if (node._typ == 302 /* v.ast.ComptimeFor */) { v__gen__c__Gen_comptime_for(g, (*node._v__ast__ComptimeFor)); } - else if (node._typ == 303 /* v.ast.DeferStmt */) { + else if (node._typ == 304 /* v.ast.DeferStmt */) { v__ast__DeferStmt defer_stmt = (*node._v__ast__DeferStmt); defer_stmt.ifdef = g->defer_ifdef; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); array_push((array*)&g->defer_stmts, _MOV((v__ast__DeferStmt[]){ defer_stmt })); } - else if (node._typ == 305 /* v.ast.EnumDecl */) { + else if (node._typ == 306 /* v.ast.EnumDecl */) { string enum_name = v__util__no_dots((*node._v__ast__EnumDecl).name); bool is_flag = (*node._v__ast__EnumDecl).is_flag; strings__Builder_writeln(&g->enum_typedefs, _SLIT("typedef enum {")); @@ -70789,7 +70986,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { int cur_enum_offset = 0; for (int i = 0; i < (*node._v__ast__EnumDecl).fields.len; ++i) { v__ast__EnumField field = ((v__ast__EnumField*)(*node._v__ast__EnumDecl).fields.data)[i]; - strings__Builder_write_string(&g->enum_typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = enum_name}}, {_SLIT("__"), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->enum_typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("__"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (field.has_expr) { strings__Builder_write_string(&g->enum_typedefs, _SLIT(" = ")); string expr_str = v__gen__c__Gen_expr_string(g, field.expr); @@ -70798,34 +70995,34 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { cur_enum_offset = 0; } else if (is_flag) { strings__Builder_write_string(&g->enum_typedefs, _SLIT(" = ")); - cur_enum_expr = str_intp(2, _MOV((StrIntpData[]){{_SLIT("1 << "), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})); + cur_enum_expr = str_intp(2, _MOV((StrIntpData[]){{_SLIT("1 << "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})); strings__Builder_write_string(&g->enum_typedefs, int_literal_str((1 << i))); cur_enum_offset = 0; } - string cur_value = (cur_enum_offset > 0 ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_enum_expr}}, {_SLIT("+"), 0xfe07, {.d_i32 = cur_enum_offset}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (cur_enum_expr)); - strings__Builder_writeln(&g->enum_typedefs, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", // "), 0xfe10, {.d_s = cur_value}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string cur_value = (cur_enum_offset > 0 ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_enum_expr}}, {_SLIT("+"), /*100 &int*/0xfe07, {.d_i32 = cur_enum_offset}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (cur_enum_expr)); + strings__Builder_writeln(&g->enum_typedefs, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", // "), /*115 &string*/0xfe10, {.d_s = cur_value}}, {_SLIT0, 0, { .d_c = 0 }}}))); cur_enum_offset++; } - strings__Builder_writeln(&g->enum_typedefs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), 0xfe10, {.d_s = enum_name}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->enum_typedefs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 306 /* v.ast.ExprStmt */) { + else if (node._typ == 307 /* v.ast.ExprStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__ExprStmt).pos); bool old_is_void_expr_stmt = g->is_void_expr_stmt; g->is_void_expr_stmt = !(*node._v__ast__ExprStmt).is_expr; - if (!v__ast__Type_alias_eq((*node._v__ast__ExprStmt).typ, _const_v__ast__void_type) && g->expected_cast_type != 0 && ((*node._v__ast__ExprStmt).expr)._typ != 276 /* v.ast.MatchExpr */) { + if (!v__ast__Type_alias_eq((*node._v__ast__ExprStmt).typ, _const_v__ast__void_type) && g->expected_cast_type != 0 && ((*node._v__ast__ExprStmt).expr)._typ != 277 /* v.ast.MatchExpr */) { v__gen__c__Gen_expr_with_cast(g, (*node._v__ast__ExprStmt).expr, (*node._v__ast__ExprStmt).typ, g->expected_cast_type); } else { v__gen__c__Gen_expr(g, (*node._v__ast__ExprStmt).expr); } g->is_void_expr_stmt = old_is_void_expr_stmt; - if (g->inside_ternary == 0 && !g->inside_if_optional && !g->inside_match_optional && !(*node._v__ast__ExprStmt).is_expr && ((*node._v__ast__ExprStmt).expr)._typ != 267 /* v.ast.IfExpr */) { + if (g->inside_ternary == 0 && !g->inside_if_optional && !g->inside_match_optional && !(*node._v__ast__ExprStmt).is_expr && ((*node._v__ast__ExprStmt).expr)._typ != 268 /* v.ast.IfExpr */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } - else if (node._typ == 183 /* v.ast.FnDecl */) { + else if (node._typ == 184 /* v.ast.FnDecl */) { v__gen__c__Gen_fn_decl(g, (*node._v__ast__FnDecl)); } - else if (node._typ == 307 /* v.ast.ForCStmt */) { + else if (node._typ == 308 /* v.ast.ForCStmt */) { int prev_branch_parent_pos = g->branch_parent_pos; g->branch_parent_pos = (*node._v__ast__ForCStmt).pos.pos; v__ast__Stmt* save_inner_loop = g->inner_loop; @@ -70839,7 +71036,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { map_delete(&g->labeled_loops, &(string[]){(*node._v__ast__ForCStmt).label}); g->inner_loop = save_inner_loop; } - else if (node._typ == 308 /* v.ast.ForInStmt */) { + else if (node._typ == 309 /* v.ast.ForInStmt */) { int prev_branch_parent_pos = g->branch_parent_pos; g->branch_parent_pos = (*node._v__ast__ForInStmt).pos.pos; v__ast__Stmt* save_inner_loop = g->inner_loop; @@ -70853,7 +71050,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { map_delete(&g->labeled_loops, &(string[]){(*node._v__ast__ForInStmt).label}); g->inner_loop = save_inner_loop; } - else if (node._typ == 309 /* v.ast.ForStmt */) { + else if (node._typ == 310 /* v.ast.ForStmt */) { int prev_branch_parent_pos = g->branch_parent_pos; g->branch_parent_pos = (*node._v__ast__ForStmt).pos.pos; v__ast__Stmt* save_inner_loop = g->inner_loop; @@ -70867,17 +71064,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { map_delete(&g->labeled_loops, &(string[]){(*node._v__ast__ForStmt).label}); g->inner_loop = save_inner_loop; } - else if (node._typ == 310 /* v.ast.GlobalDecl */) { + else if (node._typ == 311 /* v.ast.GlobalDecl */) { v__gen__c__Gen_global_decl(g, (*node._v__ast__GlobalDecl)); } - else if (node._typ == 311 /* v.ast.GotoLabel */) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoLabel).name)}}, {_SLIT(": {}"), 0, { .d_c = 0 }}}))); + else if (node._typ == 312 /* v.ast.GotoLabel */) { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoLabel).name)}}, {_SLIT(": {}"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 312 /* v.ast.GotoStmt */) { + else if (node._typ == 313 /* v.ast.GotoStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__GotoStmt).pos); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), 0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoStmt).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoStmt).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 313 /* v.ast.HashStmt */) { + else if (node._typ == 314 /* v.ast.HashStmt */) { int line_nr = (*node._v__ast__HashStmt).pos.line_nr + 1; string ct_condition = _SLIT(""); if ((*node._v__ast__HashStmt).ct_conds.len > 0) { @@ -70892,96 +71089,99 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { ct_condition = string_trim_space(strings__Builder_cut_to(&g->out, ct_condition_start)); } if (string__eq((*node._v__ast__HashStmt).kind, _SLIT("include"))) { - string missing_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Header file "), 0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT(", needed for module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("` was not found."), 0, { .d_c = 0 }}})); + string missing_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Header file "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT(", needed for module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("` was not found."), 0, { .d_c = 0 }}})); if (((*node._v__ast__HashStmt).msg).len != 0) { - missing_message = /*f*/string__plus(missing_message, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = (*node._v__ast__HashStmt).msg}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + missing_message = /*f*/string__plus(missing_message, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).msg}}, {_SLIT("."), 0, { .d_c = 0 }}}))); } else { missing_message = /*f*/string__plus(missing_message, _SLIT(" Please install the corresponding development headers.")); } string guarded_include = v__gen__c__get_guarded_include_text((*node._v__ast__HashStmt).main, missing_message); if (string__eq((*node._v__ast__HashStmt).main, _SLIT(""))) { - guarded_include = str_intp(2, _MOV((StrIntpData[]){{_SLIT("#include "), 0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT0, 0, { .d_c = 0 }}})); + guarded_include = str_intp(2, _MOV((StrIntpData[]){{_SLIT("#include "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT0, 0, { .d_c = 0 }}})); } if (string_contains((*node._v__ast__HashStmt).main, _SLIT(".m"))) { strings__Builder_writeln(&g->definitions, _SLIT("\n")); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// added by module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), 0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), 0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// added by module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), /*115 &string*/0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->definitions, guarded_include); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->definitions, _SLIT("\n")); } else { strings__Builder_writeln(&g->includes, _SLIT("\n")); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->includes, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// added by module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), 0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), 0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// added by module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), /*115 &string*/0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->includes, guarded_include); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->includes, _SLIT("\n")); } } else if (string__eq((*node._v__ast__HashStmt).kind, _SLIT("insert"))) { if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->includes, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// inserted by module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), 0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), 0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// inserted by module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), /*115 &string*/0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->includes, (*node._v__ast__HashStmt).val); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } else if (string__eq((*node._v__ast__HashStmt).kind, _SLIT("define"))) { if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// defined by module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define "), 0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// defined by module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } - else if (node._typ == 314 /* v.ast.Import */) { + else if (node._typ == 315 /* v.ast.Import */) { } - else if (node._typ == 315 /* v.ast.InterfaceDecl */) { + else if (node._typ == 316 /* v.ast.InterfaceDecl */) { v__ast__TypeSymbol* ts = v__ast__Table_sym(g->table, (*node._v__ast__InterfaceDecl).typ); - if (!(/* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ).is_generic) { + if (!(/* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ).is_generic) { for (int _t4 = 0; _t4 < (*node._v__ast__InterfaceDecl).methods.len; ++_t4) { v__ast__FnDecl method = ((v__ast__FnDecl*)(*node._v__ast__InterfaceDecl).methods.data)[_t4]; if (v__ast__Type_has_flag(method.return_type, v__ast__TypeFlag__optional)) { v__gen__c__Gen_register_optional(g, method.return_type); } + if (v__ast__Type_has_flag(method.return_type, v__ast__TypeFlag__result)) { + v__gen__c__Gen_register_result(g, method.return_type); + } } } } - else if (node._typ == 316 /* v.ast.Module */) { + else if (node._typ == 317 /* v.ast.Module */) { g->is_builtin_mod = v__util__module_is_builtin((*node._v__ast__Module).name); g->cur_mod = (*node._v__ast__Module); } - else if (node._typ == 277 /* v.ast.NodeError */) { + else if (node._typ == 278 /* v.ast.NodeError */) { } - else if (node._typ == 317 /* v.ast.Return */) { + else if (node._typ == 318 /* v.ast.Return */) { v__gen__c__Gen_return_stmt(g, (*node._v__ast__Return)); } - else if (node._typ == 318 /* v.ast.SqlStmt */) { + else if (node._typ == 319 /* v.ast.SqlStmt */) { v__gen__c__Gen_sql_stmt(g, (*node._v__ast__SqlStmt)); } - else if (node._typ == 319 /* v.ast.StructDecl */) { + else if (node._typ == 320 /* v.ast.StructDecl */) { string name = ((*node._v__ast__StructDecl).language == v__ast__Language__c ? (v__util__no_dots((*node._v__ast__StructDecl).name)) : (string__eq((*node._v__ast__StructDecl).name, _SLIT("array")) || string__eq((*node._v__ast__StructDecl).name, _SLIT("string"))) ? ((*node._v__ast__StructDecl).name) : (v__gen__c__c_name((*node._v__ast__StructDecl).name))); if ((*node._v__ast__StructDecl).language == v__ast__Language__c) { return; } if ((*node._v__ast__StructDecl).is_union) { - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef union "), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef union "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (node._typ == 243 /* v.ast.TypeDecl */) { + else if (node._typ == 244 /* v.ast.TypeDecl */) { if (!g->pref->skip_unused) { v__gen__c__Gen_writeln(g, _SLIT("// TypeDecl")); } @@ -70991,7 +71191,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { array_delete_last(&g->stmt_path_pos); } if (g->is_autofree) { - if ((node)._typ != 183 /* v.ast.FnDecl */) { + if ((node)._typ != 184 /* v.ast.FnDecl */) { } } } @@ -71000,7 +71200,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_defer_stmts(v__gen__c__Gen* g) { for (int i = g->defer_stmts.len - 1; i >= 0; i--) { v__ast__DeferStmt defer_stmt = (*(v__ast__DeferStmt*)/*ee elem_sym */array_get(g->defer_stmts, i)); v__gen__c__Gen_writeln(g, _SLIT("// Defer begin")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; if (defer_stmt.ifdef.len > 0) { v__gen__c__Gen_writeln(g, defer_stmt.ifdef); @@ -71024,7 +71224,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_sumtype_casting_fn(v__gen__c__Gen* g, int i = (got | ((int)(((u32)(exp)) << 16U))); string got_cname = v__ast__Table_sym(g->table, got)->cname; string exp_cname = v__ast__Table_sym(g->table, exp)->cname; - string fn_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = got_cname}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = exp_cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fn_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = exp_cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (got == exp || (*(bool*)map_get(ADDR(map, g->sumtype_definitions), &(int[]){i}, &(bool[]){ 0 }))) { string _t1 = fn_name; return _t1; @@ -71043,8 +71243,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, string got_cname = got_sym->cname; string exp_cname = exp_sym->cname; strings__Builder sb = strings__new_builder(128); - strings__Builder_writeln(&sb, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static inline "), 0xfe10, {.d_s = exp_cname}}, {_SLIT(" "), 0xfe10, {.d_s = fun.fn_name}}, {_SLIT("("), 0xfe10, {.d_s = got_cname}}, {_SLIT("* x) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = got_cname}}, {_SLIT("* ptr = memdup(x, sizeof("), 0xfe10, {.d_s = got_cname}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static inline "), /*115 &string*/0xfe10, {.d_s = exp_cname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fun.fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT("* x) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT("* ptr = memdup(x, sizeof("), /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); Array_Array_v__ast__Type _t1 = v__ast__Table_get_embeds(g->table, got_sym, ((v__ast__GetEmbedsOptions){.preceding = __new_array(0, 0, sizeof(v__ast__Type)),})); for (int _t2 = 0; _t2 < _t1.len; ++_t2) { Array_v__ast__Type embed_hierarchy = ((Array_v__ast__Type*)_t1.data)[_t2]; @@ -71061,11 +71261,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, } accessor = /*f*/string__plus(accessor, embed_name); } - strings__Builder_writeln(&sb, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = embed_cname}}, {_SLIT("* "), 0xfe10, {.d_s = embed_name}}, {_SLIT("_ptr = memdup("), 0xfe10, {.d_s = accessor}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = embed_cname}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = embed_cname}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = embed_name}}, {_SLIT("_ptr = memdup("), /*115 &string*/0xfe10, {.d_s = accessor}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = embed_cname}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } - strings__Builder_write_string(&sb, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\treturn ("), 0xfe10, {.d_s = exp_cname}}, {_SLIT("){ ._"), 0xfe10, {.d_s = got_cname}}, {_SLIT(" = ptr, ._typ = "), 0xfe10, {.d_s = v__gen__c__Gen_type_sidx(g, got)}}, {_SLIT0, 0, { .d_c = 0 }}}))); - for (int _t3 = 0; _t3 < (/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ).fields.len; ++_t3) { - v__ast__StructField field = ((v__ast__StructField*)(/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ).fields.data)[_t3]; + strings__Builder_write_string(&sb, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\treturn ("), /*115 &string*/0xfe10, {.d_s = exp_cname}}, {_SLIT("){ ._"), /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT(" = ptr, ._typ = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_type_sidx(g, got)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + for (int _t3 = 0; _t3 < (/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ).fields.len; ++_t3) { + v__ast__StructField field = ((v__ast__StructField*)(/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ).fields.data)[_t3]; string ptr = _SLIT("ptr"); string type_cname = got_cname; Option_multi_return_v__ast__StructField_Array_v__ast__Type _t4 = v__ast__Table_find_field_from_embeds(g->table, got_sym, field.name); @@ -71074,18 +71274,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t4.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_65944 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data); - Array_v__ast__Type embed_types = mr_65944.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_67520 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data); + Array_v__ast__Type embed_types = mr_67520.arg1; if (embed_types.len > 0) { v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types))); - ptr = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT("_ptr"), 0, { .d_c = 0 }}})); + ptr = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT("_ptr"), 0, { .d_c = 0 }}})); type_cname = embed_sym->cname; } string field_styp = v__gen__c__Gen_typ(g, field.typ); if (got_sym->kind == v__ast__Kind__sum_type || got_sym->kind == v__ast__Kind__interface_) { - strings__Builder_write_string(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", ."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = ptr->"), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", ."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = ptr->"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&sb, str_intp(7, _MOV((StrIntpData[]){{_SLIT(", ."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = ("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)"), 0xfe10, {.d_s = ptr}}, {_SLIT(" + __offsetof_ptr("), 0xfe10, {.d_s = ptr}}, {_SLIT(", "), 0xfe10, {.d_s = type_cname}}, {_SLIT(", "), 0xfe10, {.d_s = field.name}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(7, _MOV((StrIntpData[]){{_SLIT(", ."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)"), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT(" + __offsetof_ptr("), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = type_cname}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&sb, _SLIT("};\n}")); @@ -71095,14 +71295,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, VV_LOCAL_SYMBOL void v__gen__c__Gen_call_cfn_for_casting_expr(v__gen__c__Gen* g, string fname, v__ast__Expr expr, bool exp_is_ptr, string exp_styp, bool got_is_ptr, string got_styp) { int rparen_n = 1; if (exp_is_ptr) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), 0xfe10, {.d_s = exp_styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), /*115 &string*/0xfe10, {.d_s = exp_styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); rparen_n++; } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (!got_is_ptr) { - if (!v__ast__Expr_is_lvalue(expr) || ((expr)._typ == 266 /* v.ast.Ident */ && v__ast__ScopeObject_is_simple_define_const((/* as */ *(v__ast__Ident*)__as_cast((expr)._v__ast__Ident,(expr)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ).obj))) { + if (!v__ast__Expr_is_lvalue(expr) || ((expr)._typ == 267 /* v.ast.Ident */ && v__ast__ScopeObject_is_simple_define_const((/* as */ *(v__ast__Ident*)__as_cast((expr)._v__ast__Ident,(expr)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ).obj))) { string promotion_macro_name = (string_contains(fname, _SLIT("_to_sumtype_")) ? (_SLIT("ADDR")) : (_SLIT("HEAP"))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = promotion_macro_name}}, {_SLIT("("), 0xfe10, {.d_s = got_styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = promotion_macro_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); rparen_n += 2; } else { v__gen__c__Gen_write(g, _SLIT("&")); @@ -71128,12 +71328,12 @@ 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 == 434 /* 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 == 291 /* v.ast.StructInit */ && !v__ast__Type_is_ptr(got_type)) { + if ((exp_sym->info)._typ == 435 /* 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 == 292 /* 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); string exp_styp = exp_sym->cname; - string fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), 0xfe10, {.d_s = got_styp}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}})); if ((*exp_sym->info._v__ast__Interface).is_generic) { fname = v__gen__c__Gen_generic_fn_name(g, (*exp_sym->info._v__ast__Interface).concrete_types, fname, false); } @@ -71142,14 +71342,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex } else { string got_styp = v__gen__c__Gen_cc_type(g, got_type, true); bool got_is_shared = v__ast__Type_has_flag(got_type, v__ast__TypeFlag__shared_f); - string exp_styp = (got_is_shared ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = exp_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (exp_sym->cname)); - string fname = (got_is_shared ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("I___shared__"), 0xfe10, {.d_s = got_styp}}, {_SLIT("_to_shared_Interface_"), 0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), 0xfe10, {.d_s = got_styp}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string exp_styp = (got_is_shared ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = exp_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (exp_sym->cname)); + string fname = (got_is_shared ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("I___shared__"), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT("_to_shared_Interface_"), /*115 &string*/0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}})))); sync__RwMutex_lock(&g->referenced_fns->mtx); /*lock*/ { map_set(&g->referenced_fns->val, &(string[]){fname}, &(bool[]) { true }); } sync__RwMutex_unlock(&g->referenced_fns->mtx);; - fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), 0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(exp_sym)}}}))}}, {_SLIT("*/"), 0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}})); + fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(exp_sym)}}}))}}, {_SLIT("*/"), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}})); if ((*exp_sym->info._v__ast__Interface).is_generic) { fname = v__gen__c__Gen_generic_fn_name(g, (*exp_sym->info._v__ast__Interface).concrete_types, fname, false); } @@ -71169,7 +71369,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex if (v__ast__Table_sumtype_has_variant(g->table, expected_deref_type, got_deref_type, false)) { bool is_already_sum_type = false; v__ast__Scope* scope = v__ast__Scope_innermost(g->file->scope, v__ast__Expr_pos(expr).pos); - if ((expr)._typ == 266 /* v.ast.Ident */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { Option_v__ast__Var_ptr _t1; if (_t1 = v__ast__Scope_find_var(scope, (*expr._v__ast__Ident).name), _t1.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t1.data; @@ -71177,7 +71377,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex is_already_sum_type = true; } } - } else if ((expr)._typ == 286 /* v.ast.SelectorExpr */) { + } else if ((expr)._typ == 287 /* v.ast.SelectorExpr */) { Option_v__ast__ScopeStructField _t2; if (_t2 = v__ast__Scope_find_struct_field(scope, v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr), (*expr._v__ast__SelectorExpr).expr_type, (*expr._v__ast__SelectorExpr).field_name), _t2.state == 0) { is_already_sum_type = true; @@ -71187,7 +71387,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex g->prevent_sum_type_unwrapping_once = true; v__gen__c__Gen_expr(g, expr); } else { - if ((unwrapped_got_sym->info)._typ == 429 /* v.ast.Aggregate */) { + if ((unwrapped_got_sym->info)._typ == 430 /* v.ast.Aggregate */) { unwrapped_got_type = (*(v__ast__Type*)/*ee elem_sym */array_get((*unwrapped_got_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); unwrapped_got_sym = v__ast__Table_sym(g->table, unwrapped_got_type); } @@ -71205,17 +71405,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex VUNREACHABLE(); } if (exp_sym->kind == v__ast__Kind__array) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else if (exp_sym->kind == v__ast__Kind__map) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), 0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } bool old_is_shared = g->is_shared; g->is_shared = false; v__gen__c__Gen_expr(g, expr); g->is_shared = old_is_shared; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); return; } else if (v__ast__Type_has_flag(got_type_raw, v__ast__TypeFlag__shared_f) && !v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__shared_f)) { if (v__ast__Type_is_ptr(expected_type)) { @@ -71225,7 +71425,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex v__gen__c__Gen_write(g, _SLIT("->val")); return; } - if (got_is_ptr && !expected_is_ptr && neither_void && exp_sym->kind != v__ast__Kind__placeholder && (expr)._typ != 270 /* v.ast.InfixExpr */) { + if (got_is_ptr && !expected_is_ptr && neither_void && exp_sym->kind != v__ast__Kind__placeholder && (expr)._typ != 271 /* v.ast.InfixExpr */) { v__ast__Type got_deref_type = v__ast__Type_deref(got_type); v__ast__TypeSymbol* deref_sym = v__ast__Table_sym(g->table, got_deref_type); bool deref_will_match = (v__ast__Type_alias_eq(expected_type, got_type) || v__ast__Type_alias_eq(expected_type, got_deref_type) || v__ast__Type_alias_eq(expected_type, deref_sym->parent_idx)); @@ -71234,11 +71434,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex v__gen__c__Gen_write(g, _SLIT("*")); } } - if (v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional) && (expr)._typ == 278 /* v.ast.None */) { + if (v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional) && (expr)._typ == 279 /* v.ast.None */) { v__gen__c__Gen_gen_optional_error(g, expected_type, expr); return; } - if ((expr)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((expr)._typ == 272 /* v.ast.IntegerLiteral */) { if ((v__ast__Type_alias_eq(expected_type, _const_v__ast__u64_type) || v__ast__Type_alias_eq(expected_type, _const_v__ast__u32_type) || v__ast__Type_alias_eq(expected_type, _const_v__ast__u16_type)) && string_at((*expr._v__ast__IntegerLiteral).val, 0) != '-') { v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT("U")); @@ -71289,7 +71489,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_attrs(v__gen__c__Gen* g, Array_v__ast__A } for (int _t1 = 0; _t1 < attrs.len; ++_t1) { v__ast__Attr attr = ((v__ast__Attr*)attrs.data)[_t1]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Attr: ["), 0xfe10, {.d_s = attr.name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Attr: ["), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); } } @@ -71322,7 +71522,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_asm_stmt(v__gen__c__Gen* g, v__ast__AsmS } for (int i = 0; i < _v_template.args.len; ++i) { v__ast__AsmArg arg = ((v__ast__AsmArg*)_v_template.args.data)[i]; - if (stmt.arch == v__pref__Arch__amd64 && (string__eq(_v_template.name, _SLIT("call")) || string_at(_v_template.name, 0) == 'j') && (arg)._typ == 321 /* v.ast.AsmRegister */) { + if (stmt.arch == v__pref__Arch__amd64 && (string__eq(_v_template.name, _SLIT("call")) || string_at(_v_template.name, 0) == 'j') && (arg)._typ == 322 /* v.ast.AsmRegister */) { v__gen__c__Gen_write(g, _SLIT("*")); } v__gen__c__Gen_asm_arg(g, arg, stmt); @@ -71374,7 +71574,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_asm_stmt(v__gen__c__Gen* g, v__ast__AsmS } VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg arg, v__ast__AsmStmt stmt) { - if (arg._typ == 397 /* v.ast.AsmAlias */) { + if (arg._typ == 398 /* v.ast.AsmAlias */) { string name = (*arg._v__ast__AsmAlias).name; bool _t1 = (Array_string_contains(stmt.local_labels, name) || Array_string_contains(stmt.global_labels, name) || Array_string_contains(g->file->global_labels, name) || stmt.is_basic); Array_string _t3 = {0}; @@ -71403,37 +71603,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar } } if ( _t1 || ( _t2 && !Array_string_contains(_t5, name))) { - string asm_formatted_name = (Array_string_contains(stmt.global_labels, name) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("%l["), 0xfe10, {.d_s = name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))) : (name)); + string asm_formatted_name = (Array_string_contains(stmt.global_labels, name) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("%l["), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))) : (name)); v__gen__c__Gen_write(g, asm_formatted_name); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%["), 0xfe10, {.d_s = name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%["), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); } } - else if (arg._typ == 255 /* v.ast.CharLiteral */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = (*arg._v__ast__CharLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + else if (arg._typ == 256 /* v.ast.CharLiteral */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__CharLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); } - else if (arg._typ == 271 /* v.ast.IntegerLiteral */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), 0xfe10, {.d_s = (*arg._v__ast__IntegerLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + else if (arg._typ == 272 /* v.ast.IntegerLiteral */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__IntegerLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (arg._typ == 264 /* v.ast.FloatLiteral */) { + else if (arg._typ == 265 /* v.ast.FloatLiteral */) { if (g->pref->nofloat) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), 0xfe07, {.d_i32 = string_int((*arg._v__ast__FloatLiteral).val)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), /*100 &int*/0xfe07, {.d_i32 = string_int((*arg._v__ast__FloatLiteral).val)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), 0xfe10, {.d_s = (*arg._v__ast__FloatLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__FloatLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } - else if (arg._typ == 250 /* v.ast.BoolLiteral */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), 0xfe10, {.d_s = bool_str((*arg._v__ast__BoolLiteral).val)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + else if (arg._typ == 251 /* v.ast.BoolLiteral */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), /*115 &string*/0xfe10, {.d_s = bool_str((*arg._v__ast__BoolLiteral).val)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (arg._typ == 321 /* v.ast.AsmRegister */) { + else if (arg._typ == 322 /* v.ast.AsmRegister */) { if (!stmt.is_basic) { v__gen__c__Gen_write(g, _SLIT("%")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%"), 0xfe10, {.d_s = (*arg._v__ast__AsmRegister).name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__AsmRegister).name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (arg._typ == 396 /* v.ast.AsmAddressing */) { + else if (arg._typ == 397 /* v.ast.AsmAddressing */) { if (((*arg._v__ast__AsmAddressing).segment).len != 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%%"), 0xfe10, {.d_s = (*arg._v__ast__AsmAddressing).segment}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%%"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__AsmAddressing).segment}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } v__ast__AsmArg base = (*arg._v__ast__AsmAddressing).base; v__ast__AsmArg index = (*arg._v__ast__AsmAddressing).index; @@ -71462,19 +71662,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar } case v__ast__AddressingMode__index_times_scale_plus_displacement: { - if ((displacement)._typ == 398 /* v.ast.AsmDisp */) { + if ((displacement)._typ == 399 /* v.ast.AsmDisp */) { v__gen__c__Gen_asm_arg(g, displacement, stmt); v__gen__c__Gen_write(g, _SLIT("(, ")); - } else if ((displacement)._typ == 321 /* v.ast.AsmRegister */) { + } else if ((displacement)._typ == 322 /* v.ast.AsmRegister */) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_asm_arg(g, displacement, stmt); v__gen__c__Gen_write(g, _SLIT(",")); } else { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.AsmArg */ v_typeof_sumtype_v__ast__AsmArg( (displacement)._typ ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.AsmArg */ v_typeof_sumtype_v__ast__AsmArg( (displacement)._typ ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__gen__c__Gen_asm_arg(g, index, stmt); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(","), 0xfe07, {.d_i32 = scale}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(","), /*100 &int*/0xfe07, {.d_i32 = scale}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); break; } case v__ast__AddressingMode__base_plus_index_plus_displacement: @@ -71494,7 +71694,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar v__gen__c__Gen_asm_arg(g, base, stmt); v__gen__c__Gen_write(g, _SLIT(",")); v__gen__c__Gen_asm_arg(g, index, stmt); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(","), 0xfe07, {.d_i32 = scale}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(","), /*100 &int*/0xfe07, {.d_i32 = scale}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); break; } case v__ast__AddressingMode__rip_plus_displacement: @@ -71514,7 +71714,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar } ; } - else if (arg._typ == 398 /* v.ast.AsmDisp */) { + else if (arg._typ == 399 /* v.ast.AsmDisp */) { v__gen__c__Gen_write(g, (*arg._v__ast__AsmDisp).val); } else if (arg._typ == 20 /* string */) { @@ -71527,9 +71727,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_asm_ios(v__gen__c__Gen* g, Array_v__ast_ for (int i = 0; i < ios.len; ++i) { v__ast__AsmIO io = ((v__ast__AsmIO*)ios.data)[i]; if ((io.alias).len != 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = io.alias}}, {_SLIT("] "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = io.alias}}, {_SLIT("] "), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = io.constraint}}, {_SLIT("\" ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = io.constraint}}, {_SLIT("\" ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, io.expr); v__gen__c__Gen_write(g, _SLIT(")")); if (i + 1 < ios.len) { @@ -71547,12 +71747,12 @@ VV_LOCAL_SYMBOL string v__gen__c__cnewlines(string s) { VV_LOCAL_SYMBOL void v__gen__c__Gen_write_fn_ptr_decl(v__gen__c__Gen* g, v__ast__FnType* func, string ptr_name) { string ret_styp = v__gen__c__Gen_typ(g, func->func.return_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*"), 0xfe10, {.d_s = ptr_name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = ptr_name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); int arg_len = func->func.params.len; for (int i = 0; i < func->func.params.len; ++i) { v__ast__Param arg = ((v__ast__Param*)func->func.params.data)[i]; string arg_styp = v__gen__c__Gen_typ(g, arg.typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_styp}}, {_SLIT(" "), 0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i < arg_len - 1) { v__gen__c__Gen_write(g, _SLIT(", ")); } @@ -71584,7 +71784,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_ternary_name(v__gen__c__Gen* g, string } VV_LOCAL_SYMBOL bool v__gen__c__Gen_gen_clone_assignment(v__gen__c__Gen* g, v__ast__Expr val, v__ast__Type typ, bool add_eq) { - if ((val)._typ != 266 /* v.ast.Ident */ && (val)._typ != 286 /* v.ast.SelectorExpr */) { + if ((val)._typ != 267 /* v.ast.Ident */ && (val)._typ != 287 /* v.ast.SelectorExpr */) { bool _t1 = false; return _t1; } @@ -71596,18 +71796,18 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_gen_clone_assignment(v__gen__c__Gen* g, v__a if (right_sym->kind == v__ast__Kind__array) { string shared_styp = v__gen__c__Gen_typ(g, v__ast__Type_set_nr_muls(typ, 0)); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT(" array_clone_static_to_depth(")); v__gen__c__Gen_expr(g, val); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { v__gen__c__Gen_write(g, _SLIT("->val")); } - v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((right_sym->info)._v__ast__Array,(right_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ).elem_type; + v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((right_sym->info)._v__ast__Array,(right_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ).elem_type; int array_depth = v__gen__c__Gen_get_array_depth(g, elem_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe07, {.d_i32 = array_depth}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = array_depth}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } else if (right_sym->kind == v__ast__Kind__string) { v__gen__c__Gen_write(g, _SLIT(" string_clone_static(")); @@ -71653,7 +71853,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_scope_vars2(v__gen__c__Gen* g, v__a } if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)DenseArray_value(&_t1.key_values, _t2)); - if (obj._typ == 324 /* v.ast.Var */) { + if (obj._typ == 325 /* v.ast.Var */) { ; if (string__eq((*obj._v__ast__Var).name, g->returned_var_name)) { ; @@ -71709,7 +71909,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_variable(v__gen__c__Gen* g, v__ast_ return; } if (sym->kind == v__ast__Kind__string) { - if (v.expr._typ == 290 /* v.ast.StringLiteral */) { + if (v.expr._typ == 291 /* v.ast.StringLiteral */) { ; } @@ -71766,9 +71966,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_var_call(v__gen__c__Gen* g, string return; } if (v.is_auto_heap) { - strings__Builder_writeln(&af, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = free_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = v__gen__c__c_name(v.name)}}, {_SLIT("); // autofreed heap var "), 0xfe10, {.d_s = g->cur_mod.name}}, {_SLIT(" "), 0xfe10, {.d_s = g->is_builtin_mod ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&af, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = free_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(v.name)}}, {_SLIT("); // autofreed heap var "), /*115 &string*/0xfe10, {.d_s = g->cur_mod.name}}, {_SLIT(" "), /*115 &bool*/0xfe10, {.d_s = g->is_builtin_mod ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&af, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = free_fn_name}}, {_SLIT("(&"), 0xfe10, {.d_s = v__gen__c__c_name(v.name)}}, {_SLIT("); // autofreed var "), 0xfe10, {.d_s = g->cur_mod.name}}, {_SLIT(" "), 0xfe10, {.d_s = g->is_builtin_mod ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&af, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = free_fn_name}}, {_SLIT("(&"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(v.name)}}, {_SLIT("); // autofreed var "), /*115 &string*/0xfe10, {.d_s = g->cur_mod.name}}, {_SLIT(" "), /*115 &bool*/0xfe10, {.d_s = g->is_builtin_mod ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } array_push((array*)&g->autofree_scope_stmts, _MOV((string[]){ string_clone(strings__Builder_str(&af)) })); @@ -71877,36 +72077,36 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) g->discard_or_result = false; } v__ast__Expr node = node_; - if (node._typ == 259 /* v.ast.ComptimeType */) { + if (node._typ == 260 /* v.ast.ComptimeType */) { v__gen__c__Gen_error(g, _SLIT("g.expr(): Unhandled ComptimeType"), (*node._v__ast__ComptimeType).pos); VUNREACHABLE(); } - else if (node._typ == 262 /* v.ast.EmptyExpr */) { + else if (node._typ == 263 /* v.ast.EmptyExpr */) { v__gen__c__Gen_error(g, _SLIT("g.expr(): unhandled EmptyExpr"), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,})); VUNREACHABLE(); } - else if (node._typ == 244 /* v.ast.AnonFn */) { + else if (node._typ == 245 /* v.ast.AnonFn */) { v__gen__c__Gen_gen_anon_fn(g, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); } - else if (node._typ == 245 /* v.ast.ArrayDecompose */) { + else if (node._typ == 246 /* v.ast.ArrayDecompose */) { v__gen__c__Gen_expr(g, (*node._v__ast__ArrayDecompose).expr); } - else if (node._typ == 246 /* v.ast.ArrayInit */) { + else if (node._typ == 247 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*node._v__ast__ArrayInit)); } - else if (node._typ == 247 /* v.ast.AsCast */) { + else if (node._typ == 248 /* v.ast.AsCast */) { v__gen__c__Gen_as_cast(g, (*node._v__ast__AsCast)); } - else if (node._typ == 248 /* v.ast.Assoc */) { + else if (node._typ == 249 /* v.ast.Assoc */) { v__gen__c__Gen_assoc(g, (*node._v__ast__Assoc)); } - else if (node._typ == 249 /* v.ast.AtExpr */) { + else if (node._typ == 250 /* v.ast.AtExpr */) { v__gen__c__Gen_comptime_at(g, (*node._v__ast__AtExpr)); } - else if (node._typ == 250 /* v.ast.BoolLiteral */) { + else if (node._typ == 251 /* v.ast.BoolLiteral */) { v__gen__c__Gen_write(g, bool_str((*node._v__ast__BoolLiteral).val)); } - else if (node._typ == 252 /* v.ast.CallExpr */) { + else if (node._typ == 253 /* v.ast.CallExpr */) { v__ast__Type ret_type = ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__absent ? ((*node._v__ast__CallExpr).return_type) : (v__ast__Type_clear_flag((*node._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional))); string shared_styp = _SLIT(""); if (g->is_shared && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__shared_f)) { @@ -71914,11 +72114,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__ast__Type shared_typ = v__ast__Type_set_flag(ret_type, v__ast__TypeFlag__shared_f); shared_styp = v__gen__c__Gen_typ(g, shared_typ); if (ret_sym->kind == v__ast__Kind__array) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else if (ret_sym->kind == v__ast__Kind__map) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), 0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } } int last_stmt_pos = (*(int*)array_last(g->stmt_path_pos)); @@ -71931,16 +72131,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) g->strs_to_free0 = __new_array_with_default(0, 0, sizeof(string), 0); } if (g->is_shared && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__shared_f)) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } - else if (node._typ == 253 /* v.ast.CastExpr */) { + else if (node._typ == 254 /* v.ast.CastExpr */) { v__gen__c__Gen_cast_expr(g, (*node._v__ast__CastExpr)); } - else if (node._typ == 254 /* v.ast.ChanInit */) { + else if (node._typ == 255 /* v.ast.ChanInit */) { string elem_typ_str = v__gen__c__Gen_typ(g, (*node._v__ast__ChanInit).elem_type); string noscan = v__gen__c__Gen_check_noscan(g, (*node._v__ast__ChanInit).elem_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__new_channel_st"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__new_channel_st"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if ((*node._v__ast__ChanInit).has_cap) { v__gen__c__Gen_expr(g, (*node._v__ast__ChanInit).cap_expr); } else { @@ -71950,52 +72150,52 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_write(g, elem_typ_str); v__gen__c__Gen_write(g, _SLIT("))")); } - else if (node._typ == 255 /* v.ast.CharLiteral */) { + else if (node._typ == 256 /* v.ast.CharLiteral */) { v__gen__c__Gen_char_literal(g, (*node._v__ast__CharLiteral)); } - else if (node._typ == 256 /* v.ast.Comment */) { + else if (node._typ == 257 /* v.ast.Comment */) { } - else if (node._typ == 257 /* v.ast.ComptimeCall */) { + else if (node._typ == 258 /* v.ast.ComptimeCall */) { v__gen__c__Gen_comptime_call(g, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); } - else if (node._typ == 258 /* v.ast.ComptimeSelector */) { + else if (node._typ == 259 /* v.ast.ComptimeSelector */) { v__gen__c__Gen_comptime_selector(g, (*node._v__ast__ComptimeSelector)); } - else if (node._typ == 260 /* v.ast.ConcatExpr */) { + else if (node._typ == 261 /* v.ast.ConcatExpr */) { v__gen__c__Gen_concat_expr(g, (*node._v__ast__ConcatExpr)); } - else if (node._typ == 251 /* v.ast.CTempVar */) { + else if (node._typ == 252 /* v.ast.CTempVar */) { v__gen__c__Gen_write(g, (*node._v__ast__CTempVar).name); } - else if (node._typ == 261 /* v.ast.DumpExpr */) { + else if (node._typ == 262 /* v.ast.DumpExpr */) { v__gen__c__Gen_dump_expr(g, (*node._v__ast__DumpExpr)); } - else if (node._typ == 263 /* v.ast.EnumVal */) { + else if (node._typ == 264 /* v.ast.EnumVal */) { v__gen__c__Gen_enum_val(g, (*node._v__ast__EnumVal)); } - else if (node._typ == 264 /* v.ast.FloatLiteral */) { + else if (node._typ == 265 /* v.ast.FloatLiteral */) { if (g->pref->nofloat) { v__gen__c__Gen_write(g, int_str(string_int((*node._v__ast__FloatLiteral).val))); } else { v__gen__c__Gen_write(g, (*node._v__ast__FloatLiteral).val); } } - else if (node._typ == 265 /* v.ast.GoExpr */) { + else if (node._typ == 266 /* v.ast.GoExpr */) { v__gen__c__Gen_go_expr(g, (*node._v__ast__GoExpr)); } - else if (node._typ == 266 /* v.ast.Ident */) { + else if (node._typ == 267 /* v.ast.Ident */) { v__gen__c__Gen_ident(g, (*node._v__ast__Ident)); } - else if (node._typ == 267 /* v.ast.IfExpr */) { + else if (node._typ == 268 /* v.ast.IfExpr */) { v__gen__c__Gen_if_expr(g, (*node._v__ast__IfExpr)); } - else if (node._typ == 268 /* v.ast.IfGuardExpr */) { + else if (node._typ == 269 /* v.ast.IfGuardExpr */) { v__gen__c__Gen_write(g, _SLIT("/* guard */")); } - else if (node._typ == 269 /* v.ast.IndexExpr */) { + else if (node._typ == 270 /* v.ast.IndexExpr */) { v__gen__c__Gen_index_expr(g, (*node._v__ast__IndexExpr)); } - else if (node._typ == 270 /* v.ast.InfixExpr */) { + else if (node._typ == 271 /* v.ast.InfixExpr */) { if ((*node._v__ast__InfixExpr).op == v__token__Kind__left_shift || (*node._v__ast__InfixExpr).op == v__token__Kind__plus_assign || (*node._v__ast__InfixExpr).op == v__token__Kind__minus_assign) { g->inside_map_infix = true; v__gen__c__Gen_infix_expr(g, (*node._v__ast__InfixExpr)); @@ -72004,7 +72204,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_infix_expr(g, (*node._v__ast__InfixExpr)); } } - else if (node._typ == 271 /* v.ast.IntegerLiteral */) { + else if (node._typ == 272 /* v.ast.IntegerLiteral */) { if (string_starts_with((*node._v__ast__IntegerLiteral).val, _SLIT("0o"))) { v__gen__c__Gen_write(g, _SLIT("0")); v__gen__c__Gen_write(g, string_substr((*node._v__ast__IntegerLiteral).val, 2, ((*node._v__ast__IntegerLiteral).val).len)); @@ -72015,18 +72215,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_write(g, (*node._v__ast__IntegerLiteral).val); } } - else if (node._typ == 272 /* v.ast.IsRefType */) { + else if (node._typ == 273 /* v.ast.IsRefType */) { v__ast__Type typ = (v__ast__Type_alias_eq((*node._v__ast__IsRefType).typ, g->field_data_type) ? (g->comptime_for_field_value.typ) : ((*node._v__ast__IsRefType).typ)); v__ast__Type node_typ = v__gen__c__Gen_unwrap_generic(g, typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node_typ); if (sym->language == v__ast__Language__v && (sym->kind == v__ast__Kind__placeholder || sym->kind == v__ast__Kind__any)) { - v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__IsRefType).pos); + v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__IsRefType).pos); VUNREACHABLE(); } bool is_ref_type = v__gen__c__Gen_contains_ptr(g, node_typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/*IsRefType*/ "), 0xfe10, {.d_s = is_ref_type ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/*IsRefType*/ "), /*115 &bool*/0xfe10, {.d_s = is_ref_type ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (node._typ == 273 /* v.ast.Likely */) { + else if (node._typ == 274 /* v.ast.Likely */) { if ((*node._v__ast__Likely).is_likely) { v__gen__c__Gen_write(g, _SLIT("_likely_")); } else { @@ -72036,34 +72236,34 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_expr(g, (*node._v__ast__Likely).expr); v__gen__c__Gen_write(g, _SLIT(")")); } - else if (node._typ == 274 /* v.ast.LockExpr */) { + else if (node._typ == 275 /* v.ast.LockExpr */) { v__gen__c__Gen_lock_expr(g, (*node._v__ast__LockExpr)); } - else if (node._typ == 275 /* v.ast.MapInit */) { + else if (node._typ == 276 /* v.ast.MapInit */) { v__gen__c__Gen_map_init(g, (*node._v__ast__MapInit)); } - else if (node._typ == 276 /* v.ast.MatchExpr */) { + else if (node._typ == 277 /* v.ast.MatchExpr */) { v__gen__c__Gen_match_expr(g, (*node._v__ast__MatchExpr)); } - else if (node._typ == 277 /* v.ast.NodeError */) { + else if (node._typ == 278 /* v.ast.NodeError */) { } - else if (node._typ == 278 /* v.ast.None */) { + else if (node._typ == 279 /* v.ast.None */) { v__gen__c__Gen_write(g, _SLIT("_const_none__")); } - else if (node._typ == 279 /* v.ast.OffsetOf */) { + else if (node._typ == 280 /* v.ast.OffsetOf */) { string styp = v__gen__c__Gen_typ(g, (*node._v__ast__OffsetOf).struct_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*OffsetOf*/ (u32)(__offsetof("), 0xfe10, {.d_s = v__util__no_dots(styp)}}, {_SLIT(", "), 0xfe10, {.d_s = (*node._v__ast__OffsetOf).field}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*OffsetOf*/ (u32)(__offsetof("), /*115 &string*/0xfe10, {.d_s = v__util__no_dots(styp)}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__OffsetOf).field}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 280 /* v.ast.OrExpr */) { + else if (node._typ == 281 /* v.ast.OrExpr */) { } - else if (node._typ == 281 /* v.ast.ParExpr */) { + else if (node._typ == 282 /* v.ast.ParExpr */) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_expr(g, (*node._v__ast__ParExpr).expr); v__gen__c__Gen_write(g, _SLIT(")")); } - else if (node._typ == 282 /* v.ast.PostfixExpr */) { + else if (node._typ == 283 /* v.ast.PostfixExpr */) { if (((*node._v__ast__PostfixExpr).auto_locked).len != 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_lock(&"), 0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_lock(&"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); } g->inside_map_postfix = true; if (v__ast__Expr_is_auto_deref_var((*node._v__ast__PostfixExpr).expr)) { @@ -72077,10 +72277,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_write(g, v__token__Kind_str((*node._v__ast__PostfixExpr).op)); if (((*node._v__ast__PostfixExpr).auto_locked).len != 0) { v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_unlock(&"), 0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_unlock(&"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx)"), 0, { .d_c = 0 }}}))); } } - else if (node._typ == 283 /* v.ast.PrefixExpr */) { + else if (node._typ == 284 /* v.ast.PrefixExpr */) { bool gen_or = (*node._v__ast__PrefixExpr).op == v__token__Kind__arrow && ((*node._v__ast__PrefixExpr).or_block.kind != v__ast__OrKind__absent || (*node._v__ast__PrefixExpr).is_option); if ((*node._v__ast__PrefixExpr).op == v__token__Kind__amp) { g->is_amp = true; @@ -72088,7 +72288,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) if ((*node._v__ast__PrefixExpr).op == v__token__Kind__arrow) { string styp = v__gen__c__Gen_typ(g, (*node._v__ast__PrefixExpr).right_type); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(g->table, (*node._v__ast__PrefixExpr).right_type); - v__ast__Chan right_inf = /* as */ *(v__ast__Chan*)__as_cast((right_sym->info)._v__ast__Chan,(right_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.Chan */ ; + v__ast__Chan right_inf = /* as */ *(v__ast__Chan*)__as_cast((right_sym->info)._v__ast__Chan,(right_sym->info)._typ, 441) /*expected idx: 441, name: v.ast.Chan */ ; v__ast__Type elem_type = right_inf.elem_type; bool is_gen_or_and_assign_rhs = gen_or && !g->discard_or_result; string _t1; /* if prepend */ @@ -72104,9 +72304,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) if (gen_or) { string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(elem_type, v__ast__TypeFlag__optional)); v__gen__c__Gen_register_chan_pop_optional_call(g, opt_elem_type, styp); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, (*node._v__ast__PrefixExpr).right); v__gen__c__Gen_write(g, _SLIT(")")); @@ -72116,7 +72316,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) } if (is_gen_or_and_assign_rhs) { string elem_styp = v__gen__c__Gen_typ(g, elem_type); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(";\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("*)"), 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_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); } } } else { @@ -72127,27 +72327,27 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) } g->is_amp = false; } - else if (node._typ == 284 /* v.ast.RangeExpr */) { + else if (node._typ == 285 /* v.ast.RangeExpr */) { } - else if (node._typ == 285 /* v.ast.SelectExpr */) { + else if (node._typ == 286 /* v.ast.SelectExpr */) { v__gen__c__Gen_select_expr(g, (*node._v__ast__SelectExpr)); } - else if (node._typ == 286 /* v.ast.SelectorExpr */) { + else if (node._typ == 287 /* v.ast.SelectorExpr */) { v__gen__c__Gen_selector_expr(g, (*node._v__ast__SelectorExpr)); } - else if (node._typ == 287 /* v.ast.SizeOf */) { + else if (node._typ == 288 /* v.ast.SizeOf */) { v__gen__c__Gen_size_of(g, (*node._v__ast__SizeOf)); } - else if (node._typ == 288 /* v.ast.SqlExpr */) { + else if (node._typ == 289 /* v.ast.SqlExpr */) { v__gen__c__Gen_sql_select_expr(g, (*node._v__ast__SqlExpr)); } - else if (node._typ == 290 /* v.ast.StringLiteral */) { + else if (node._typ == 291 /* v.ast.StringLiteral */) { v__gen__c__Gen_string_literal(g, (*node._v__ast__StringLiteral)); } - else if (node._typ == 289 /* v.ast.StringInterLiteral */) { + else if (node._typ == 290 /* v.ast.StringInterLiteral */) { v__gen__c__Gen_string_inter_literal(g, (*node._v__ast__StringInterLiteral)); } - else if (node._typ == 291 /* v.ast.StructInit */) { + else if (node._typ == 292 /* v.ast.StructInit */) { if ((*node._v__ast__StructInit).unresolved) { v__gen__c__Gen_expr(g, v__ast__resolve_init((*node._v__ast__StructInit), v__gen__c__Gen_unwrap_generic(g, (*node._v__ast__StructInit).typ), g->table)); } else { @@ -72156,16 +72356,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) g->inside_struct_init = false; } } - else if (node._typ == 292 /* v.ast.TypeNode */) { + else if (node._typ == 293 /* v.ast.TypeNode */) { v__ast__Type typ = v__gen__c__Gen_unwrap_generic(g, (*node._v__ast__TypeNode).typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); string sidx = v__gen__c__Gen_type_sidx(g, typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sidx}}, {_SLIT(" /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sidx}}, {_SLIT(" /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 293 /* v.ast.TypeOf */) { + else if (node._typ == 294 /* v.ast.TypeOf */) { v__gen__c__Gen_typeof_expr(g, (*node._v__ast__TypeOf)); } - else if (node._typ == 294 /* v.ast.UnsafeExpr */) { + else if (node._typ == 295 /* v.ast.UnsafeExpr */) { v__gen__c__Gen_expr(g, (*node._v__ast__UnsafeExpr).expr); } ; @@ -72179,7 +72379,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_char_literal(v__gen__c__Gen* g, v__ast__Char return; } if (string_len_utf8(node.val) < node.val.len) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("((rune)0x"), 0xfe10, {.d_s = int_hex(string_utf32_code(node.val))}}, {_SLIT(" /* `"), 0xfe10, {.d_s = node.val}}, {_SLIT("` */)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("((rune)0x"), /*115 &string*/0xfe10, {.d_s = int_hex(string_utf32_code(node.val))}}, {_SLIT(" /* `"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT("` */)"), 0, { .d_c = 0 }}}))); return; } if (node.val.len == 1) { @@ -72191,7 +72391,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_char_literal(v__gen__c__Gen* g, v__ast__Char return; } } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = node.val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_type_name(v__gen__c__Gen* g, v__ast__Type raw_type) { @@ -72200,37 +72400,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_type_name(v__gen__c__Gen* g, v__ast__Type ra string s = _SLIT(""); if (sym->kind == v__ast__Kind__function) { if (v__ast__Type_is_ptr(typ)) { - s = string__plus(_SLIT("&"), v__gen__c__Gen_fn_decl_str(g, /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ )); + s = string__plus(_SLIT("&"), v__gen__c__Gen_fn_decl_str(g, /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ )); } else { - s = v__gen__c__Gen_fn_decl_str(g, /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ); + s = v__gen__c__Gen_fn_decl_str(g, /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ); } } else { s = v__ast__Table_type_to_str(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = v__util__strip_main_name(s)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(s)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_typeof_expr(v__gen__c__Gen* g, v__ast__TypeOf node) { v__ast__Type typ = (v__ast__Type_alias_eq(node.expr_type, g->field_data_type) ? (g->comptime_for_field_value.typ) : (node.expr_type)); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); if (sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ v_typeof_sumtype_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("( ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ v_typeof_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("( ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")._typ ))")); } else if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed fixed_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed fixed_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; string typ_name = v__ast__Table_get_type_name(g->table, fixed_info.elem_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_SLIT(\"["), 0xfe07, {.d_i32 = fixed_info.size}}, {_SLIT("]"), 0xfe10, {.d_s = v__util__strip_main_name(typ_name)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_SLIT(\"["), /*100 &int*/0xfe07, {.d_i32 = fixed_info.size}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(typ_name)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = v__gen__c__Gen_fn_decl_str(g, info)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_fn_decl_str(g, info)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } else if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { v__ast__TypeSymbol* varg_elem_type_sym = v__ast__Table_sym(g->table, v__ast__Table_value_type(g->table, typ)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\"..."), 0xfe10, {.d_s = v__util__strip_main_name(varg_elem_type_sym->name)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\"..."), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(varg_elem_type_sym->name)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } else { string x = v__ast__Table_type_to_str(g->table, typ); string y = v__util__strip_main_name(x); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = y}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = y}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } } @@ -72250,11 +72450,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel else if (node.gkind_field == (v__ast__GenericKindField__unknown)) { if (string__eq(node.field_name, _SLIT("name"))) { v__ast__Type name_type = node.name_type; - if ((node.expr)._typ == 293 /* v.ast.TypeOf */) { - if (((*node.expr._v__ast__TypeOf).expr)._typ == 258 /* v.ast.ComptimeSelector */) { - if (((*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr)._typ == 286 /* v.ast.SelectorExpr */) { - if (((*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 266 /* v.ast.Ident */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); + if ((node.expr)._typ == 294 /* v.ast.TypeOf */) { + if (((*node.expr._v__ast__TypeOf).expr)._typ == 259 /* v.ast.ComptimeSelector */) { + if (((*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr)._typ == 287 /* v.ast.SelectorExpr */) { + if (((*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 267 /* v.ast.Ident */) { + string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); v__ast__Type* _t2 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); Option_v__ast__Type _t1 = {0}; if (_t2) { @@ -72287,10 +72487,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel v__gen__c__Gen_checker_bug(g, _SLIT("unexpected SelectorExpr.expr_type = 0"), node.pos); } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.expr_type)); - bool is_optional = (node.expr)._typ == 266 /* v.ast.Ident */ && v__ast__Type_has_flag(node.expr_type, v__ast__TypeFlag__optional); + bool is_optional = (node.expr)._typ == 267 /* v.ast.Ident */ && v__ast__Type_has_flag(node.expr_type, v__ast__TypeFlag__optional); if (is_optional) { string opt_base_typ = v__gen__c__Gen_base_type(g, node.expr_type); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = opt_base_typ}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = opt_base_typ}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } if (sym->kind == v__ast__Kind__interface_ || sym->kind == v__ast__Kind__sum_type) { v__gen__c__Gen_write(g, _SLIT("(*(")); @@ -72300,11 +72500,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel v__gen__c__Gen_error(g, _SLIT("field_name should be `len`"), node.pos); VUNREACHABLE(); } - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = info.size}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT0, 0, { .d_c = 0 }}}))); return; } else if (sym->kind == v__ast__Kind__chan && (string__eq(node.field_name, _SLIT("len")) || string__eq(node.field_name, _SLIT("closed")))) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__Channel_"), 0xfe10, {.d_s = node.field_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__Channel_"), /*115 &string*/0xfe10, {.d_s = node.field_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")")); return; @@ -72333,13 +72533,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel v__ast__TypeSymbol* cast_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); if (i != 0) { string dot = (v__ast__Type_is_ptr(field.typ) ? (_SLIT("->")) : (_SLIT("."))); - sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), 0xfe10, {.d_s = dot}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - if ((cast_sym->info)._typ == 429 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 430 /* v.ast.Aggregate */) { v__ast__TypeSymbol* agg_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx))); - sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = agg_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = agg_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -72358,7 +72558,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel if (is_optional) { v__gen__c__Gen_write(g, _SLIT(".data)")); } - if ((sym->info)._typ == 416 /* v.ast.Struct */ || (sym->info)._typ == 429 /* v.ast.Aggregate */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */ || (sym->info)._typ == 430 /* v.ast.Aggregate */) { for (int i = 0; i < node.from_embed_types.len; ++i) { v__ast__Type embed = ((v__ast__Type*)node.from_embed_types.data)[i]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, embed); @@ -72381,13 +72581,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel v__gen__c__Gen_write(g, _SLIT("val.")); } if (node.expr_type == 0) { - v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("cgen: SelectorExpr | expr_type: 0 | it.expr: `"), 0xfe10, {.d_s = v__ast__Expr_str(node.expr)}}, {_SLIT("` | field: `"), 0xfe10, {.d_s = node.field_name}}, {_SLIT("` | file: "), 0xfe10, {.d_s = g->file->path}}, {_SLIT(" | line: "), 0xfe07, {.d_i32 = node.pos.line_nr}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("cgen: SelectorExpr | expr_type: 0 | it.expr: `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node.expr)}}, {_SLIT("` | field: `"), /*115 &string*/0xfe10, {.d_s = node.field_name}}, {_SLIT("` | file: "), /*115 &string*/0xfe10, {.d_s = g->file->path}}, {_SLIT(" | line: "), /*100 &int*/0xfe07, {.d_i32 = node.pos.line_nr}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } string field_name = (sym->language == v__ast__Language__v ? (v__gen__c__c_name(node.field_name)) : (node.field_name)); v__gen__c__Gen_write(g, field_name); if ((sum_type_deref_field).len != 0) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sum_type_dot}}, {_SLIT0, 0xfe10, {.d_s = sum_type_deref_field}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sum_type_dot}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = sum_type_deref_field}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } if (sym->kind == v__ast__Kind__interface_ || sym->kind == v__ast__Kind__sum_type) { v__gen__c__Gen_write(g, _SLIT("))")); @@ -72395,7 +72595,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel } VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_expr(v__gen__c__Gen* g, v__ast__Expr node) { - if (node._typ == 263 /* v.ast.EnumVal */) { + if (node._typ == 264 /* v.ast.EnumVal */) { v__gen__c__Gen_write(g, (*node._v__ast__EnumVal).val); } @@ -72415,58 +72615,58 @@ bool v__gen__c__Gen_lock_expr_defer_1 = false; if (node.is_expr) { string styp = v__gen__c__Gen_typ(g, node.typ); cur_line = v__gen__c__Gen_go_before_stmt(g, 0); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_result}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_result}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } string mtxs = _SLIT(""); if (node.lockeds.len == 0) { } else if (node.lockeds.len == 1) { string lock_prefix = ((*(bool*)/*ee elem_sym */array_get(node.is_rlock, 0)) ? (_SLIT("r")) : (_SLIT(""))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_"), 0xfe10, {.d_s = lock_prefix}}, {_SLIT("lock(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_"), /*115 &string*/0xfe10, {.d_s = lock_prefix}}, {_SLIT("lock(&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.lockeds, 0))); v__gen__c__Gen_writeln(g, _SLIT("->mtx);")); } else { mtxs = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("uintptr_t _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("bool _isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("uintptr_t _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("bool _isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); int j = 0; for (int i = 0; i < node.is_rlock.len; ++i) { bool is_rlock = ((bool*)node.is_rlock.data)[i]; if (!is_rlock) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = j}}, {_SLIT("] = (uintptr_t)&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("] = (uintptr_t)&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.lockeds, i))); v__gen__c__Gen_writeln(g, _SLIT("->mtx;")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = j}}, {_SLIT("] = false;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("] = false;"), 0, { .d_c = 0 }}}))); j++; } } for (int i = 0; i < node.is_rlock.len; ++i) { bool is_rlock = ((bool*)node.is_rlock.data)[i]; if (is_rlock) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = j}}, {_SLIT("] = (uintptr_t)&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("] = (uintptr_t)&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.lockeds, i))); v__gen__c__Gen_writeln(g, _SLIT("->mtx;")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = j}}, {_SLIT("] = true;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("] = true;"), 0, { .d_c = 0 }}}))); j++; } } if (node.lockeds.len == 2) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0] > _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1]) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tuintptr_t _ptr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(" = _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0] = _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1] = _ptr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tbool _bool_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(" = _isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0] = _isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1] = _bool_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0] > _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1]) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tuintptr_t _ptr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(" = _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0] = _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1] = _ptr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tbool _bool_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(" = _isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0] = _isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1] = _bool_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); } else { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("__sort_ptr(_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(", _isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(", "), 0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("__sort_ptr(_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(", _isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = mtxs}}, {_SLIT("=0; "), 0xfe10, {.d_s = mtxs}}, {_SLIT("<"), 0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("; "), 0xfe10, {.d_s = mtxs}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = mtxs}}, {_SLIT(" && _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("] == _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("-1]) continue;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_rlock((sync__RwMutex*)_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("=0; "), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("<"), /*100 &int*/0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("; "), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(" && _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("] == _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("-1]) continue;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_rlock((sync__RwMutex*)_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\telse")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_lock((sync__RwMutex*)_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_lock((sync__RwMutex*)_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); } g->mtxs = mtxs; @@ -72481,7 +72681,7 @@ bool v__gen__c__Gen_lock_expr_defer_1 = false; if (node.is_expr) { v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_write(g, cur_line); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_result}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_result}}, {_SLIT0, 0, { .d_c = 0 }}}))); } // Defer begin if (v__gen__c__Gen_lock_expr_defer_1) { @@ -72499,16 +72699,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_unlock_locks(v__gen__c__Gen* g) { if (g->cur_lock.lockeds.len == 0) { } else if (g->cur_lock.lockeds.len == 1) { string lock_prefix = ((*(bool*)/*ee elem_sym */array_get(g->cur_lock.is_rlock, 0)) ? (_SLIT("r")) : (_SLIT(""))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_"), 0xfe10, {.d_s = lock_prefix}}, {_SLIT("unlock(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_"), /*115 &string*/0xfe10, {.d_s = lock_prefix}}, {_SLIT("unlock(&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(g->cur_lock.lockeds, 0))); v__gen__c__Gen_write(g, _SLIT("->mtx);")); } else { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("="), 0xfe07, {.d_i32 = g->cur_lock.lockeds.len - 1}}, {_SLIT("; "), 0xfe10, {.d_s = g->mtxs}}, {_SLIT(">=0; "), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("--) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = g->mtxs}}, {_SLIT(" && _arr_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("] == _arr_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("-1]) continue;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (_isrlck_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_runlock((sync__RwMutex*)_arr_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("="), /*100 &int*/0xfe07, {.d_i32 = g->cur_lock.lockeds.len - 1}}, {_SLIT("; "), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT(">=0; "), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("--) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT(" && _arr_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("] == _arr_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("-1]) continue;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (_isrlck_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_runlock((sync__RwMutex*)_arr_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\telse")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_unlock((sync__RwMutex*)_arr_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_unlock((sync__RwMutex*)_arr_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("}")); } } @@ -72520,11 +72720,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_105188 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); - string hash_fn = mr_105188.arg0; - string key_eq_fn = mr_105188.arg1; - string clone_fn = mr_105188.arg2; - string free_fn = mr_105188.arg3; + multi_return_string_string_string_string mr_106764 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); + string hash_fn = mr_106764.arg0; + string key_eq_fn = mr_106764.arg1; + string clone_fn = mr_106764.arg2; + string free_fn = mr_106764.arg3; int size = node.vals.len; string shared_styp = _SLIT(""); string styp = _SLIT(""); @@ -72536,10 +72736,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit if (g->is_shared) { v__ast__Type shared_typ = v__ast__Type_set_flag(node.typ, v__ast__TypeFlag__shared_f); shared_styp = v__gen__c__Gen_typ(g, shared_typ); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else if (is_amp) { styp = v__gen__c__Gen_typ(g, node.typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("*)memdup(ADDR("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)memdup(ADDR("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); } string noscan_key = v__gen__c__Gen_check_noscan(g, node.key_type); string noscan_value = v__gen__c__Gen_check_noscan(g, node.value_type); @@ -72554,9 +72754,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit } if (size > 0) { if (value_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(10, _MOV((StrIntpData[]){{_SLIT("new_map_init"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(", "), 0xfe07, {.d_i32 = size}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof(voidptr), _MOV(("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("["), 0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(10, _MOV((StrIntpData[]){{_SLIT("new_map_init"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof(voidptr), _MOV(("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(11, _MOV((StrIntpData[]){{_SLIT("new_map_init"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(", "), 0xfe07, {.d_i32 = size}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = value_typ_str}}, {_SLIT("), _MOV(("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("["), 0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(11, _MOV((StrIntpData[]){{_SLIT("new_map_init"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = value_typ_str}}, {_SLIT("), _MOV(("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } for (int _t1 = 0; _t1 < node.keys.len; ++_t1) { v__ast__Expr expr = ((v__ast__Expr*)node.keys.data)[_t1]; @@ -72564,9 +72764,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit v__gen__c__Gen_write(g, _SLIT(", ")); } if (value_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}), _MOV((voidptr["), 0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}), _MOV((voidptr["), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("}), _MOV(("), 0xfe10, {.d_s = value_typ_str}}, {_SLIT("["), 0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("}), _MOV(("), /*115 &string*/0xfe10, {.d_s = value_typ_str}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } for (int i = 0; i < node.vals.len; ++i) { v__ast__Expr expr = ((v__ast__Expr*)node.vals.data)[i]; @@ -72582,12 +72782,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit } v__gen__c__Gen_write(g, _SLIT("}))")); } else { - v__gen__c__Gen_write(g, str_intp(8, _MOV((StrIntpData[]){{_SLIT("new_map"), 0xfe10, {.d_s = noscan}}, {_SLIT("(sizeof("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = value_typ_str}}, {_SLIT("), "), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(8, _MOV((StrIntpData[]){{_SLIT("new_map"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(sizeof("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = value_typ_str}}, {_SLIT("), "), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } if (g->is_shared) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("), sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } @@ -72619,12 +72819,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } else if (branch.is_timeout) { has_timeout = true; exception_branch = j; - timeout_expr = (/* as */ *(v__ast__ExprStmt*)__as_cast((branch.stmt)._v__ast__ExprStmt,(branch.stmt)._typ, 306) /*expected idx: 306, name: v.ast.ExprStmt */ ).expr; + timeout_expr = (/* as */ *(v__ast__ExprStmt*)__as_cast((branch.stmt)._v__ast__ExprStmt,(branch.stmt)._typ, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ).expr; } else { - if (branch.stmt._typ == 306 /* v.ast.ExprStmt */) { - v__ast__InfixExpr expr = /* as */ *(v__ast__InfixExpr*)__as_cast(((*branch.stmt._v__ast__ExprStmt).expr)._v__ast__InfixExpr,((*branch.stmt._v__ast__ExprStmt).expr)._typ, 270) /*expected idx: 270, name: v.ast.InfixExpr */ ; + if (branch.stmt._typ == 307 /* v.ast.ExprStmt */) { + v__ast__InfixExpr expr = /* as */ *(v__ast__InfixExpr*)__as_cast(((*branch.stmt._v__ast__ExprStmt).expr)._v__ast__InfixExpr,((*branch.stmt._v__ast__ExprStmt).expr)._typ, 271) /*expected idx: 271, name: v.ast.InfixExpr */ ; array_push((array*)&channels, _MOV((v__ast__Expr[]){ expr.left })); - if ((expr.right)._typ == 266 /* v.ast.Ident */ || (expr.right)._typ == 269 /* v.ast.IndexExpr */ || (expr.right)._typ == 286 /* v.ast.SelectorExpr */ || (expr.right)._typ == 291 /* v.ast.StructInit */) { + if ((expr.right)._typ == 267 /* v.ast.Ident */ || (expr.right)._typ == 270 /* v.ast.IndexExpr */ || (expr.right)._typ == 287 /* v.ast.SelectorExpr */ || (expr.right)._typ == 292 /* v.ast.StructInit */) { array_push((array*)&objs, _MOV((v__ast__Expr[]){ expr.right })); array_push((array*)&tmp_objs, _MOV((string[]){ string_clone(_SLIT("")) })); array_push((array*)&elem_types, _MOV((string[]){ string_clone(_SLIT("")) })); @@ -72633,12 +72833,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec string tmp_obj = v__gen__c__Gen_new_tmp_var(g); array_push((array*)&tmp_objs, _MOV((string[]){ string_clone(tmp_obj) })); string el_stype = v__gen__c__Gen_typ(g, v__ast__mktyp(expr.right_type)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = el_stype}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } array_push((array*)&is_push, _MOV((bool[]){ true })); } - else if (branch.stmt._typ == 298 /* v.ast.AssignStmt */) { - v__ast__PrefixExpr rec_expr = /* as */ *(v__ast__PrefixExpr*)__as_cast(((*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)))._v__ast__PrefixExpr,((*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)))._typ, 283) /*expected idx: 283, name: v.ast.PrefixExpr */ ; + else if (branch.stmt._typ == 299 /* v.ast.AssignStmt */) { + v__ast__PrefixExpr rec_expr = /* as */ *(v__ast__PrefixExpr*)__as_cast(((*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)))._v__ast__PrefixExpr,((*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)))._typ, 284) /*expected idx: 284, name: v.ast.PrefixExpr */ ; array_push((array*)&channels, _MOV((v__ast__Expr[]){ rec_expr.right })); array_push((array*)&is_push, _MOV((bool[]){ false })); if ((*branch.stmt._v__ast__AssignStmt).op == v__token__Kind__decl_assign || !v__ast__Type_alias_eq((*(v__ast__Type*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right_types, 0)), (*(v__ast__Type*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).left_types, 0)))) { @@ -72646,7 +72846,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec array_push((array*)&tmp_objs, _MOV((string[]){ string_clone(tmp_obj) })); string el_stype = v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right_types, 0))); array_push((array*)&elem_types, _MOV((string[]){ string_clone(((*branch.stmt._v__ast__AssignStmt).op == v__token__Kind__decl_assign ? (string__plus(el_stype, _SLIT(" "))) : (_SLIT("")))) })); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = el_stype}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { array_push((array*)&tmp_objs, _MOV((string[]){ string_clone(_SLIT("")) })); array_push((array*)&elem_types, _MOV((string[]){ string_clone(_SLIT("")) })); @@ -72660,7 +72860,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } } string chan_array = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_sync__Channel_ptr "), 0xfe10, {.d_s = chan_array}}, {_SLIT(" = new_array_from_c_array("), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(sync__Channel*), _MOV((sync__Channel*["), 0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_sync__Channel_ptr "), /*115 &string*/0xfe10, {.d_s = chan_array}}, {_SLIT(" = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(sync__Channel*), _MOV((sync__Channel*["), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int i = 0; i < n_channels; ++i) { if (i > 0) { v__gen__c__Gen_write(g, _SLIT(", ")); @@ -72671,7 +72871,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } v__gen__c__Gen_writeln(g, _SLIT("}));\n")); string directions_array = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_sync__Direction "), 0xfe10, {.d_s = directions_array}}, {_SLIT(" = new_array_from_c_array("), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(sync__Direction), _MOV((sync__Direction["), 0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_sync__Direction "), /*115 &string*/0xfe10, {.d_s = directions_array}}, {_SLIT(" = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(sync__Direction), _MOV((sync__Direction["), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int i = 0; i < n_channels; ++i) { if (i > 0) { v__gen__c__Gen_write(g, _SLIT(", ")); @@ -72684,7 +72884,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } v__gen__c__Gen_writeln(g, _SLIT("}));\n")); string objs_array = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_voidptr "), 0xfe10, {.d_s = objs_array}}, {_SLIT(" = new_array_from_c_array("), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(voidptr), _MOV((voidptr["), 0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_voidptr "), /*115 &string*/0xfe10, {.d_s = objs_array}}, {_SLIT(" = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(voidptr), _MOV((voidptr["), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int i = 0; i < n_channels; ++i) { if (i > 0) { v__gen__c__Gen_write(g, _SLIT(", &")); @@ -72699,7 +72899,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } v__gen__c__Gen_writeln(g, _SLIT("}));\n")); string select_result = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = select_result}}, {_SLIT(" = sync__channel_select(&/*arr*/"), 0xfe10, {.d_s = chan_array}}, {_SLIT(", "), 0xfe10, {.d_s = directions_array}}, {_SLIT(", &/*arr*/"), 0xfe10, {.d_s = objs_array}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = select_result}}, {_SLIT(" = sync__channel_select(&/*arr*/"), /*115 &string*/0xfe10, {.d_s = chan_array}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = directions_array}}, {_SLIT(", &/*arr*/"), /*115 &string*/0xfe10, {.d_s = objs_array}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); if (has_timeout) { v__gen__c__Gen_expr(g, timeout_expr); } else if (has_else) { @@ -72708,23 +72908,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec v__gen__c__Gen_write(g, _SLIT("_const_time__infinite")); } v__gen__c__Gen_writeln(g, _SLIT(");")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), 0xfe10, {.d_s = objs_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), 0xfe10, {.d_s = directions_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), 0xfe10, {.d_s = chan_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), /*115 &string*/0xfe10, {.d_s = objs_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), /*115 &string*/0xfe10, {.d_s = directions_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), /*115 &string*/0xfe10, {.d_s = chan_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); int i = 0; for (int j = 0; j < node.branches.len; ++j) { if (j > 0) { v__gen__c__Gen_write(g, _SLIT("} else ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = select_result}}, {_SLIT(" == "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = select_result}}, {_SLIT(" == "), 0, { .d_c = 0 }}}))); if (j == exception_branch) { v__gen__c__Gen_writeln(g, _SLIT("-1) {")); } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); if (!(*(bool*)/*ee elem_sym */array_get(is_push, i)) && ((*(string*)/*ee elem_sym */array_get(tmp_objs, i))).len != 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(elem_types, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(elem_types, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(objs, i))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(tmp_objs, i))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(tmp_objs, i))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } i++; } @@ -72734,7 +72934,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec if (is_expr) { g->empty_line = false; v__gen__c__Gen_write(g, cur_line); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = select_result}}, {_SLIT(" != -2)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = select_result}}, {_SLIT(" != -2)"), 0, { .d_c = 0 }}}))); } } @@ -72763,19 +72963,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) } v__ast__IdentInfo node_info = node.info; bool is_auto_heap = false; - if ((node_info)._typ == 376 /* v.ast.IdentVar */) { + if ((node_info)._typ == 377 /* v.ast.IdentVar */) { if ((*node_info._v__ast__IdentVar).is_optional && !(g->is_assign_lhs && g->right_is_opt)) { v__gen__c__Gen_write(g, _SLIT("/*opt*/")); string styp = v__gen__c__Gen_base_type(g, (*node_info._v__ast__IdentVar).typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = name}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); return; } if (!g->is_assign_lhs && (*node_info._v__ast__IdentVar).share == v__ast__ShareType__shared_t) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT(".val"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(".val"), 0, { .d_c = 0 }}}))); return; } v__ast__ScopeObject v = node.obj; - if ((v)._typ == 324 /* v.ast.Var */) { + if ((v)._typ == 325 /* v.ast.Var */) { is_auto_heap = (*v._v__ast__Var).is_auto_heap && (!g->is_assign_lhs || g->assign_op != v__token__Kind__decl_assign); if (is_auto_heap) { v__gen__c__Gen_write(g, _SLIT("(*(")); @@ -72800,11 +73000,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) } } string dot = (is_ptr || is_auto_heap ? (_SLIT("->")) : (_SLIT("."))); - if ((cast_sym->info)._typ == 429 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 430 /* v.ast.Aggregate */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_"), 0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT(")")); } @@ -72818,7 +73018,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) v__gen__c__Gen_write(g, string__plus(_const_v__gen__c__closure_ctx, _SLIT("->"))); } } - } else if ((node_info)._typ == 375 /* v.ast.IdentFn */) { + } else if ((node_info)._typ == 376 /* v.ast.IdentFn */) { if (g->pref->translated || g->file->is_translated) { Option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { @@ -72830,7 +73030,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) } 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: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + 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) { @@ -72841,7 +73041,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) ; if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _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(); ; } @@ -72859,16 +73059,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_cast_expr(v__gen__c__Gen* g, v__ast__CastExp v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.typ); if (sym->kind == v__ast__Kind__sum_type || sym->kind == v__ast__Kind__interface_) { v__gen__c__Gen_expr_with_cast(g, node.expr, node.expr_type, node.typ); - } else if (sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(node.typ) && !(/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).is_typedef) { + } else if (sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(node.typ) && !(/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).is_typedef) { string styp = v__gen__c__Gen_typ(g, node.typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("*(("), 0xfe10, {.d_s = styp}}, {_SLIT(" *)(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("*(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" *)(&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT("))")); } else if (sym->kind == v__ast__Kind__alias && v__ast__Table_final_sym(g->table, node.typ)->kind == v__ast__Kind__array_fixed) { v__gen__c__Gen_expr(g, node.expr); } else if (v__ast__Type_alias_eq(node.expr_type, _const_v__ast__bool_type) && v__ast__Type_is_int(node.typ)) { string styp = v__gen__c__Gen_typ(g, node.typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("[]){("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]){("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")?1:0}[0]")); } else { @@ -72876,13 +73076,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_cast_expr(v__gen__c__Gen* g, v__ast__CastExp if ((g->pref->translated || g->file->is_translated) && sym->kind == v__ast__Kind__function) { } string cast_label = _SLIT(""); - if (sym->kind != v__ast__Kind__alias || !(v__ast__Type_alias_eq((/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type, node.expr_type) || v__ast__Type_alias_eq((/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type, _const_v__ast__string_type))) { - cast_label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + if (sym->kind != v__ast__Kind__alias || !(v__ast__Type_alias_eq((/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type, node.expr_type) || v__ast__Type_alias_eq((/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type, _const_v__ast__string_type))) { + cast_label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(")"), 0, { .d_c = 0 }}})); } - if (v__ast__Type_has_flag(node.typ, v__ast__TypeFlag__optional) && (node.expr)._typ == 278 /* v.ast.None */) { + if (v__ast__Type_has_flag(node.typ, v__ast__TypeFlag__optional) && (node.expr)._typ == 279 /* v.ast.None */) { v__gen__c__Gen_gen_optional_error(g, node.typ, node.expr); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = cast_label}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = cast_label}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (sym->kind == v__ast__Kind__alias && v__ast__Table_final_sym(g->table, node.typ)->kind == v__ast__Kind__string) { int ptr_cnt = v__ast__Type_nr_muls(node.typ) - v__ast__Type_nr_muls(node.expr_type); if (ptr_cnt > 0) { @@ -72890,7 +73090,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_cast_expr(v__gen__c__Gen* g, v__ast__CastExp } } v__gen__c__Gen_expr(g, node.expr); - if ((node.expr)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((node.expr)._typ == 272 /* v.ast.IntegerLiteral */) { if (v__ast__Type_alias_eq(node.typ, _const_v__ast__u64_type) || v__ast__Type_alias_eq(node.typ, _const_v__ast__u32_type) || v__ast__Type_alias_eq(node.typ, _const_v__ast__u16_type)) { if (!string_starts_with((*node.expr._v__ast__IntegerLiteral).val, _SLIT("-"))) { v__gen__c__Gen_write(g, _SLIT("U")); @@ -72914,10 +73114,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_concat_expr(v__gen__c__Gen* g, v__ast__Conca if (!is_multi) { v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.vals, 0))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); for (int i = 0; i < node.vals.len; ++i) { v__ast__Expr expr = ((v__ast__Expr*)node.vals.data)[i]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("="), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); if (i < node.vals.len - 1) { v__gen__c__Gen_write(g, _SLIT(",")); @@ -72929,7 +73129,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_concat_expr(v__gen__c__Gen* g, v__ast__Conca // Attr: [inline] inline VV_LOCAL_SYMBOL bool v__gen__c__Gen_expr_is_multi_return_call(v__gen__c__Gen* g, v__ast__Expr expr) { - if ((expr)._typ == 252 /* v.ast.CallExpr */) { + if ((expr)._typ == 253 /* v.ast.CallExpr */) { bool _t1 = v__ast__Table_sym(g->table, (*expr._v__ast__CallExpr).return_type)->kind == v__ast__Kind__multi_return; return _t1; } @@ -72937,9 +73137,16 @@ inline VV_LOCAL_SYMBOL bool v__gen__c__Gen_expr_is_multi_return_call(v__gen__c__ return _t2; } +VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_result_error(v__gen__c__Gen* g, v__ast__Type target_type, v__ast__Expr expr) { + string styp = v__gen__c__Gen_typ(g, target_type); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){ .is_error=true, .err="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_expr(g, expr); + v__gen__c__Gen_write(g, _SLIT(", .data={EMPTY_STRUCT_INITIALIZATION} }")); +} + VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_optional_error(v__gen__c__Gen* g, v__ast__Type target_type, v__ast__Expr expr) { string styp = v__gen__c__Gen_typ(g, target_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){ .state=2, .err="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){ .state=2, .err="), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(", .data={EMPTY_STRUCT_INITIALIZATION} }")); } @@ -72950,7 +73157,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; g->inside_return = true; v__gen__c__Gen_return_stmt_defer_0 = true; if (node.exprs.len > 0) { - if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 257 /* v.ast.ComptimeCall */) { + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 258 /* v.ast.ComptimeCall */) { v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); v__gen__c__Gen_writeln(g, _SLIT(";")); // Defer begin @@ -72964,12 +73171,13 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, g->fn_decl->return_type); bool fn_return_is_multi = sym->kind == v__ast__Kind__multi_return; bool fn_return_is_optional = v__ast__Type_has_flag(g->fn_decl->return_type, v__ast__TypeFlag__optional); + bool fn_return_is_result = v__ast__Type_has_flag(g->fn_decl->return_type, v__ast__TypeFlag__result); bool has_semicolon = false; if (node.exprs.len == 0) { v__gen__c__Gen_write_defer_stmts_when_needed(g); - if (fn_return_is_optional) { + if (fn_return_is_optional || fn_return_is_result) { string styp = v__gen__c__Gen_typ(g, g->fn_decl->return_type); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return ("), 0xfe10, {.d_s = styp}}, {_SLIT("){0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return ("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){0};"), 0, { .d_c = 0 }}}))); } else { if (g->is_autofree) { ; @@ -72988,13 +73196,13 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; string ret_typ = v__gen__c__Gen_typ(g, v__gen__c__Gen_unwrap_generic(g, g->fn_decl->return_type)); bool use_tmp_var = g->defer_stmts.len > 0 || g->defer_profile_code.len > 0 || g->cur_lock.lockeds.len > 0; if (fn_return_is_optional) { - bool optional_none = ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 278 /* v.ast.None */; + bool optional_none = ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 279 /* v.ast.None */; string ftyp = v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0))); bool is_regular_option = string__eq(ftyp, _SLIT("Option")); if (optional_none || is_regular_option || (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)) == _const_v__ast__error_type_idx) { if (!isnil(g->fn_decl) && g->fn_decl->is_test) { string test_error_var = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = test_error_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = test_error_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_optional_error(g, g->fn_decl->return_type, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_write_defer_stmts_when_needed(g); @@ -73007,7 +73215,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; return; } if (use_tmp_var) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("return ")); } @@ -73015,7 +73223,44 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; v__gen__c__Gen_writeln(g, _SLIT(";")); if (use_tmp_var) { v__gen__c__Gen_write_defer_stmts_when_needed(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } + // Defer begin + if (v__gen__c__Gen_return_stmt_defer_0) { + g->inside_return = false; + } + // Defer end + return; + } + } + if (fn_return_is_result) { + string ftyp = v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0))); + bool is_regular_result = string__eq(ftyp, _const_v__gen__c__result_name); + if (is_regular_result || (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)) == _const_v__ast__error_type_idx) { + if (!isnil(g->fn_decl) && g->fn_decl->is_test) { + string test_error_var = v__gen__c__Gen_new_tmp_var(g); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = test_error_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_gen_result_error(g, g->fn_decl->return_type, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); + v__gen__c__Gen_writeln(g, _SLIT(";")); + v__gen__c__Gen_write_defer_stmts_when_needed(g); + v__gen__c__Gen_gen_failing_return_error_for_test_fn(g, node, test_error_var); + // Defer begin + if (v__gen__c__Gen_return_stmt_defer_0) { + g->inside_return = false; + } + // Defer end + return; + } + if (use_tmp_var) { + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + } else { + v__gen__c__Gen_write(g, _SLIT("return ")); + } + v__gen__c__Gen_gen_result_error(g, g->fn_decl->return_type, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); + v__gen__c__Gen_writeln(g, _SLIT(";")); + if (use_tmp_var) { + v__gen__c__Gen_write_defer_stmts_when_needed(g); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } // Defer begin if (v__gen__c__Gen_return_stmt_defer_0) { @@ -73026,12 +73271,12 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } } if (fn_return_is_multi && node.exprs.len > 0 && !v__gen__c__Gen_expr_is_multi_return_call(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))) { - if (node.exprs.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 267 /* v.ast.IfExpr */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 276 /* v.ast.MatchExpr */)) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + if (node.exprs.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 268 /* v.ast.IfExpr */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 277 /* v.ast.MatchExpr */)) { + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_write_defer_stmts_when_needed(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); // Defer begin if (v__gen__c__Gen_return_stmt_defer_0) { g->inside_return = false; @@ -73040,33 +73285,33 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; return; } v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(g->table, g->fn_decl->return_type); - v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((typ_sym->info)._v__ast__MultiReturn,(typ_sym->info)._typ, 442) /*expected idx: 442, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((typ_sym->info)._v__ast__MultiReturn,(typ_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; string styp = _SLIT(""); - if (fn_return_is_optional) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + if (fn_return_is_optional || fn_return_is_result) { + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); styp = v__gen__c__Gen_base_type(g, g->fn_decl->return_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), 0xfe10, {.d_s = styp}}, {_SLIT("/*X*/[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("/*X*/[]) { "), 0, { .d_c = 0 }}}))); } else { if (use_tmp_var) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("return ")); } styp = v__gen__c__Gen_typ(g, g->fn_decl->return_type); } string multi_unpack = _SLIT(""); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); int arg_idx = 0; for (int i = 0; i < node.exprs.len; ++i) { v__ast__Expr expr = ((v__ast__Expr*)node.exprs.data)[i]; if (v__gen__c__Gen_expr_is_multi_return_call(g, expr)) { - v__ast__CallExpr c = /* as */ *(v__ast__CallExpr*)__as_cast((expr)._v__ast__CallExpr,(expr)._typ, 252) /*expected idx: 252, name: v.ast.CallExpr */ ; + v__ast__CallExpr c = /* as */ *(v__ast__CallExpr*)__as_cast((expr)._v__ast__CallExpr,(expr)._typ, 253) /*expected idx: 253, name: v.ast.CallExpr */ ; v__ast__TypeSymbol* expr_sym = v__ast__Table_sym(g->table, c.return_type); string tmp = v__gen__c__Gen_new_tmp_var(g); if (!v__ast__Type_has_flag(c.return_type, v__ast__TypeFlag__optional)) { string s = v__gen__c__Gen_go_before_stmt(g, 0); string expr_styp = v__gen__c__Gen_typ(g, c.return_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = expr_styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = expr_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("="), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_writeln(g, _SLIT(";")); multi_unpack = /*f*/string__plus(multi_unpack, v__gen__c__Gen_go_before_stmt(g, 0)); @@ -73078,11 +73323,11 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; multi_unpack = /*f*/string__plus(multi_unpack, v__gen__c__Gen_go_before_stmt(g, 0)); v__gen__c__Gen_write(g, s); string expr_styp = v__gen__c__Gen_base_type(g, c.return_type); - tmp = ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*opt*/(*("), 0xfe10, {.d_s = expr_styp}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); + tmp = ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*opt*/(*("), /*115 &string*/0xfe10, {.d_s = expr_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); } Array_v__ast__Type expr_types = v__ast__TypeSymbol_mr_info(expr_sym).types; for (int j = 0; j < expr_types.len; ++j) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(".arg"), 0xfe07, {.d_i32 = arg_idx}}, {_SLIT("="), 0xfe10, {.d_s = tmp}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = j}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = arg_idx}}, {_SLIT("="), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (j < expr_types.len || i < node.exprs.len - 1) { v__gen__c__Gen_write(g, _SLIT(",")); } @@ -73090,7 +73335,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } continue; } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg"), 0xfe07, {.d_i32 = arg_idx}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = arg_idx}}, {_SLIT("="), 0, { .d_c = 0 }}}))); if (v__ast__Expr_is_auto_deref_var(expr)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -73105,30 +73350,30 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } } v__gen__c__Gen_write(g, _SLIT("}")); - if (fn_return_is_optional) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), 0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + if (fn_return_is_optional || fn_return_is_result) { + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write_defer_stmts_when_needed(g); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (multi_unpack.len > 0) { v__gen__c__Gen_insert_before_stmt(g, multi_unpack); } - if (use_tmp_var && !fn_return_is_optional) { + if (use_tmp_var && !fn_return_is_optional && !fn_return_is_result) { if (!has_semicolon) { v__gen__c__Gen_writeln(g, _SLIT(";")); } v__gen__c__Gen_write_defer_stmts_when_needed(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); has_semicolon = true; } } else if (node.exprs.len >= 1) { if (node.types.len == 0) { - v__gen__c__Gen_checker_bug(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("node.exprs.len == "), 0xfe07, {.d_i32 = node.exprs.len}}, {_SLIT(" && node.types.len == 0"), 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_checker_bug(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("node.exprs.len == "), /*100 &int*/0xfe07, {.d_i32 = node.exprs.len}}, {_SLIT(" && node.types.len == 0"), 0, { .d_c = 0 }}})), node.pos); } v__ast__TypeSymbol* return_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0))); v__ast__Expr expr0 = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)); bool _t1 = 0; - if (expr0._typ == 252 /* v.ast.CallExpr */) { + if (expr0._typ == 253 /* v.ast.CallExpr */) { _t1 = v__ast__Type_has_flag((*expr0._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) && (*expr0._v__ast__CallExpr).or_block.kind == v__ast__OrKind__absent; } @@ -73138,10 +73383,10 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; bool expr_type_is_opt = _t1; if (fn_return_is_optional && !expr_type_is_opt && !string__eq(return_sym->name, _SLIT("Option"))) { string styp = v__gen__c__Gen_base_type(g, g->fn_decl->return_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), 0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); if (!v__ast__Type_is_ptr(g->fn_decl->return_type) && v__ast__Type_is_ptr((*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)))) { - if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 266 /* v.ast.Ident */ && !g->is_amp)) { + if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 267 /* v.ast.Ident */ && !g->is_amp)) { v__gen__c__Gen_write(g, _SLIT("*")); } } @@ -73152,10 +73397,46 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; v__gen__c__Gen_write(g, _SLIT(", ")); } } - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), 0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write_defer_stmts_when_needed(g); v__gen__c__Gen_autofree_scope_vars(g, node.pos.pos - 1, node.pos.line_nr, true); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + // Defer begin + if (v__gen__c__Gen_return_stmt_defer_0) { + g->inside_return = false; + } + // Defer end + return; + } + bool _t2 = 0; + if (expr0._typ == 253 /* v.ast.CallExpr */) { + _t2 = v__ast__Type_has_flag((*expr0._v__ast__CallExpr).return_type, v__ast__TypeFlag__result) && (*expr0._v__ast__CallExpr).or_block.kind == v__ast__OrKind__absent; + } + + else { + _t2 = v__ast__Type_has_flag((*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)), v__ast__TypeFlag__result); + } + bool expr_type_is_result = _t2; + if (fn_return_is_result && !expr_type_is_result && !string__eq(return_sym->name, _const_v__gen__c__result_name)) { + string styp = v__gen__c__Gen_base_type(g, g->fn_decl->return_type); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__result_name}}, {_SLIT("_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + if (!v__ast__Type_is_ptr(g->fn_decl->return_type) && v__ast__Type_is_ptr((*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)))) { + if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 267 /* v.ast.Ident */ && !g->is_amp)) { + v__gen__c__Gen_write(g, _SLIT("*")); + } + } + for (int i = 0; i < node.exprs.len; ++i) { + v__ast__Expr expr = ((v__ast__Expr*)node.exprs.data)[i]; + v__gen__c__Gen_expr_with_cast(g, expr, (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, i)), v__ast__Type_clear_flag(g->fn_decl->return_type, v__ast__TypeFlag__result)); + if (i < node.exprs.len - 1) { + v__gen__c__Gen_write(g, _SLIT(", ")); + } + } + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" }, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__result_name}}, {_SLIT("*)(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_defer_stmts_when_needed(g); + v__gen__c__Gen_autofree_scope_vars(g, node.pos.pos - 1, node.pos.line_nr, true); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); // Defer begin if (v__gen__c__Gen_return_stmt_defer_0) { g->inside_return = false; @@ -73165,14 +73446,14 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } if (g->is_autofree) { v__ast__Expr expr = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)); - if ((expr)._typ == 266 /* v.ast.Ident */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { g->returned_var_name = (*expr._v__ast__Ident).name; } } use_tmp_var = use_tmp_var || !g->is_builtin_mod; if (use_tmp_var) { - if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ != 266 /* v.ast.Ident */ || use_tmp_var) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ != 267 /* v.ast.Ident */ || use_tmp_var) { + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else { use_tmp_var = false; v__gen__c__Gen_write_defer_stmts_when_needed(g); @@ -73205,7 +73486,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; if (!g->is_builtin_mod) { v__gen__c__Gen_autofree_scope_vars(g, node.pos.pos - 1, node.pos.line_nr, true); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); has_semicolon = false; } } else { @@ -73232,7 +73513,7 @@ bool v__gen__c__Gen_const_decl_defer_0 = false; if (!_IN_MAP(ADDR(string, field.name), ADDR(map, g->table->used_consts))) { #if defined(CUSTOM_DEFINE_trace_skip_unused_consts) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> skipping unused const name: "), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> skipping unused const name: "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif continue; @@ -73241,27 +73522,27 @@ 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))); v__ast__Expr field_expr = field.expr; - if (field.expr._typ == 246 /* v.ast.ArrayInit */) { + if (field.expr._typ == 247 /* v.ast.ArrayInit */) { if ((*field.expr._v__ast__ArrayInit).is_fixed) { string styp = v__gen__c__Gen_typ(g, (*field.expr._v__ast__ArrayInit).typ); if (g->pref->build_mode != v__pref__BuildMode__build_module) { string val = v__gen__c__Gen_expr_string(g, field.expr); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = const_name}}, {_SLIT(" = "), 0xfe10, {.d_s = val}}, {_SLIT("; // fixed array const"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("; // fixed array const"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = const_name}}, {_SLIT("; // fixed array const"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT("; // fixed array const"), 0, { .d_c = 0 }}}))); } } else { v__gen__c__Gen_const_decl_init_later(g, field.mod, name, field.expr, field.typ, false); } } - else if (field.expr._typ == 290 /* v.ast.StringLiteral */) { - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = const_name}}, {_SLIT("; // a string literal, inited later"), 0, { .d_c = 0 }}}))); + else if (field.expr._typ == 291 /* v.ast.StringLiteral */) { + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT("; // a string literal, inited later"), 0, { .d_c = 0 }}}))); if (g->pref->build_mode != v__pref__BuildMode__build_module) { string val = v__gen__c__Gen_expr_string(g, field.expr); - strings__Builder_writeln(&g->stringliterals, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = const_name}}, {_SLIT(" = "), 0xfe10, {.d_s = val}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->stringliterals, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (field.expr._typ == 252 /* v.ast.CallExpr */) { + else if (field.expr._typ == 253 /* v.ast.CallExpr */) { if (v__ast__Type_has_flag((*field.expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional)) { g->inside_const_optional = true; bool unwrap_option = (*field.expr._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent; @@ -73300,10 +73581,10 @@ if (v__gen__c__Gen_const_decl_defer_0) { VV_LOCAL_SYMBOL bool v__gen__c__Gen_const_decl_precomputed(v__gen__c__Gen* g, string mod, string name, v__ast__ComptTimeConstValue ct_value, v__ast__Type typ) { string styp = v__gen__c__Gen_typ(g, typ); - string cname = (g->pref->translated && !g->is_builtin_mod ? (name) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string cname = (g->pref->translated && !g->is_builtin_mod ? (name) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})))); #if defined(CUSTOM_DEFINE_trace_const_precomputed) { - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> styp: "), 0xfe10, {.d_s = styp}}, {_SLIT(" | cname: "), 0xfe10, {.d_s = cname}}, {_SLIT(" | ct_value: "), 0xfe10, {.d_s = v__ast__ComptTimeConstValue_str(ct_value)}}, {_SLIT(" | "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.ComptTimeConstValue */ v_typeof_sumtype_v__ast__ComptTimeConstValue( (ct_value)._typ ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> styp: "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" | cname: "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" | ct_value: "), /*115 &v.ast.ComptTimeConstValue*/0xfe10, {.d_s = v__ast__ComptTimeConstValue_str(ct_value)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.ComptTimeConstValue */ v_typeof_sumtype_v__ast__ComptTimeConstValue( (ct_value)._typ ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif if (ct_value._typ == 5 /* i8 */) { @@ -73357,20 +73638,20 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_const_decl_precomputed(v__gen__c__Gen* g, st return _t3; } string escval = v__util__smart_quote(u8_ascii_str(((u8)(rune_code))), false); - v__gen__c__Gen_const_decl_write_precomputed(g, styp, cname, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = escval}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_const_decl_write_precomputed(g, styp, cname, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = escval}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_const_decl_write_precomputed(g, styp, cname, u32_str(((u32)((*ct_value._rune))))); } } else if (ct_value._typ == 20 /* string */) { string escaped_val = v__util__smart_quote((*ct_value._string), false); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = cname}}, {_SLIT("; // str inited later"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->init, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = cname}}, {_SLIT(" = _SLIT(\""), 0xfe10, {.d_s = escaped_val}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT("; // str inited later"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->init, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = escaped_val}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); if (g->is_autofree) { - strings__Builder_writeln(&(*(strings__Builder*)map_get(ADDR(map, g->cleanups), &(string[]){mod}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&(*(strings__Builder*)map_get(ADDR(map, g->cleanups), &(string[]){mod}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } - else if (ct_value._typ == 262 /* v.ast.EmptyExpr */) { + else if (ct_value._typ == 263 /* v.ast.EmptyExpr */) { bool _t4 = false; return _t4; } @@ -73380,18 +73661,18 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_const_decl_precomputed(v__gen__c__Gen* g, st } VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_write_precomputed(v__gen__c__Gen* g, string styp, string cname, string ct_value) { - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = cname}}, {_SLIT(" = "), 0xfe10, {.d_s = ct_value}}, {_SLIT("; // precomputed"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = ct_value}}, {_SLIT("; // precomputed"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_simple_define(v__gen__c__Gen* g, string name, string val) { - strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define _const_"), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define _const_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->definitions, val); } VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_init_later(v__gen__c__Gen* g, string mod, string name, v__ast__Expr expr, v__ast__Type typ, bool unwrap_option) { string styp = v__gen__c__Gen_typ(g, typ); - string cname = (g->pref->translated && !g->is_builtin_mod ? (name) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = cname}}, {_SLIT("; // inited later"), 0, { .d_c = 0 }}}))); + string cname = (g->pref->translated && !g->is_builtin_mod ? (name) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT("; // inited later"), 0, { .d_c = 0 }}}))); if (string__eq(cname, _SLIT("_const_os__args"))) { if (g->pref->os == v__pref__OS__windows) { strings__Builder_writeln(&g->init, _SLIT("\t_const_os__args = os__init_os_args_wide(___argc, (byteptr*)___argv);")); @@ -73401,26 +73682,26 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_init_later(v__gen__c__Gen* g, str } else { if (unwrap_option) { strings__Builder_writeln(&g->init, _SLIT("{")); - strings__Builder_writeln(&g->init, v__gen__c__Gen_expr_string_surround(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = cname}}, {_SLIT(" = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}})), expr, _SLIT(".data;"))); + strings__Builder_writeln(&g->init, v__gen__c__Gen_expr_string_surround(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}})), expr, _SLIT(".data;"))); strings__Builder_writeln(&g->init, _SLIT("}")); } else { - strings__Builder_writeln(&g->init, v__gen__c__Gen_expr_string_surround(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = cname}}, {_SLIT(" = "), 0, { .d_c = 0 }}})), expr, _SLIT(";"))); + strings__Builder_writeln(&g->init, v__gen__c__Gen_expr_string_surround(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = "), 0, { .d_c = 0 }}})), expr, _SLIT(";"))); } } if (g->is_autofree) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); if (string_starts_with(styp, _SLIT("Array_"))) { if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("free"))) { - strings__Builder_writeln(&g->cleanup, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT("_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tarray_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tarray_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else if (string__eq(styp, _SLIT("string"))) { - strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__map) { - strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmap_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmap_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (string__eq(styp, _SLIT("IError"))) { - strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } } @@ -73439,7 +73720,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_global_decl(v__gen__c__Gen* g, v__ast__Globa if (!_IN_MAP(ADDR(string, field.name), ADDR(map, g->table->used_globals))) { #if defined(CUSTOM_DEFINE_trace_skip_unused_globals) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> skipping unused global name: "), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> skipping unused global name: "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif continue; @@ -73447,21 +73728,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_global_decl(v__gen__c__Gen* g, v__ast__Globa } string styp = v__gen__c__Gen_typ(g, field.typ); v__ast__Expr anon_fn_expr = field.expr; - if (field.has_expr && (anon_fn_expr)._typ == 244 /* v.ast.AnonFn */) { + if (field.has_expr && (anon_fn_expr)._typ == 245 /* v.ast.AnonFn */) { v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*anon_fn_expr._v__ast__AnonFn)); string fn_type_name = v__gen__c__Gen_get_anon_fn_type_name(g, (voidptr)&/*qq*/(*anon_fn_expr._v__ast__AnonFn), field.name); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_type_name}}, {_SLIT(" = "), 0xfe10, {.d_s = v__ast__Table_sym(g->table, field.typ)->name}}, {_SLIT("; // global2"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_type_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(g->table, field.typ)->name}}, {_SLIT("; // global2"), 0, { .d_c = 0 }}}))); continue; } string modifier = (field.is_volatile ? (_SLIT(" volatile ")) : (_SLIT(""))); - strings__Builder_write_string(&g->definitions, str_intp(6, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = visibility_kw}}, {_SLIT0, 0xfe10, {.d_s = modifier}}, {_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = attributes}}, {_SLIT(" "), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = visibility_kw}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = modifier}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = attributes}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (field.has_expr || cinit) { if (g->pref->translated) { - strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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) { - strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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"), 0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT("; // 3global"), 0, { .d_c = 0 }}}))); + 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 }}}))); } } else if (!g->pref->translated) { string default_initializer = v__gen__c__Gen_type_default(g, field.typ); @@ -73469,7 +73750,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_global_decl(v__gen__c__Gen* g, v__ast__Globa strings__Builder_write_string(&g->definitions, _SLIT(" = {0}")); } else { if (!(string__eq(field.name, _SLIT("as_cast_type_indexes")) || string__eq(field.name, _SLIT("g_memory_block")) || string__eq(field.name, _SLIT("global_allocator")))) { - strings__Builder_writeln(&g->global_init, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = field.name}}, {_SLIT(" = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)&(("), 0xfe10, {.d_s = styp}}, {_SLIT("[]){"), 0xfe10, {.d_s = v__gen__c__Gen_type_default(g, field.typ)}}, {_SLIT("}[0]); // global"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->global_init, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)&(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]){"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_type_default(g, field.typ)}}, {_SLIT("}[0]); // global"), 0, { .d_c = 0 }}}))); } } } @@ -73483,28 +73764,28 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_assoc(v__gen__c__Gen* g, v__ast__Assoc node) return; } string styp = v__gen__c__Gen_typ(g, node.typ); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); Map_string_int inited_fields = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); for (int i = 0; i < node.fields.len; ++i) { string field = ((string*)node.fields.data)[i]; map_set(&inited_fields, &(string[]){field}, &(int[]) { i }); } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.typ); - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; for (int _t1 = 0; _t1 < info.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t1]; string field_name = v__gen__c__c_name(field.name); if (_IN_MAP(ADDR(string, field.name), ADDR(map, inited_fields))) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, (*(int*)map_get(ADDR(map, inited_fields), &(string[]){field.name}, &(int[]){ 0 }))))); v__gen__c__Gen_writeln(g, _SLIT(", ")); } else { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0xfe10, {.d_s = node.var_name}}, {_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = node.var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_write(g, _SLIT("}")); if (g->is_amp) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } @@ -73525,7 +73806,7 @@ VNORETURN VV_LOCAL_SYMBOL void v__gen__c__Gen_error(v__gen__c__Gen* g, string s, } VV_LOCAL_SYMBOL void v__gen__c__Gen_checker_bug(v__gen__c__Gen* g, string s, v__token__Pos pos) { - v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker bug; "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker bug; "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); VUNREACHABLE(); } @@ -73561,17 +73842,17 @@ bool v__gen__c__Gen_write_init_function_defer_0 = false; v__gen__c__Gen_writeln(g, _SLIT("\tvinit_string_literals();")); for (int _t1 = 0; _t1 < g->table->modules.len; ++_t1) { string mod_name = ((string*)g->table->modules.data)[_t1]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t{ // Initializations for module "), 0xfe10, {.d_s = mod_name}}, {_SLIT(" :"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t{ // Initializations for module "), /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(" :"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, strings__Builder_str(&(*(strings__Builder*)map_get(ADDR(map, g->inits), &(string[]){mod_name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })))); v__gen__c__Gen_write(g, strings__Builder_str(&(*(strings__Builder*)map_get(ADDR(map, g->global_inits), &(string[]){mod_name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })))); - string init_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod_name}}, {_SLIT(".init"), 0, { .d_c = 0 }}})); + string init_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(".init"), 0, { .d_c = 0 }}})); Option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, init_fn_name), _t2.state == 0) { v__ast__Fn initfn = *(v__ast__Fn*)_t2.data; if (v__ast__Type_alias_eq(initfn.return_type, _const_v__ast__void_type) && initfn.params.len == 0) { string mod_c_name = v__util__no_dots(mod_name); - string init_fn_c_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod_c_name}}, {_SLIT("__init"), 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = init_fn_c_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + string init_fn_c_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod_c_name}}, {_SLIT("__init"), 0, { .d_c = 0 }}})); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = init_fn_c_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("\t}")); @@ -73586,7 +73867,7 @@ bool v__gen__c__Gen_write_init_function_defer_0 = false; Array_string reversed_table_modules = array_reverse(g->table->modules); for (int _t3 = 0; _t3 < reversed_table_modules.len; ++_t3) { string mod_name = ((string*)reversed_table_modules.data)[_t3]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t// Cleanups for module "), 0xfe10, {.d_s = mod_name}}, {_SLIT(" :"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t// Cleanups for module "), /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(" :"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, strings__Builder_str(&(*(strings__Builder*)map_get(ADDR(map, g->cleanups), &(string[]){mod_name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })))); } v__gen__c__Gen_writeln(g, _SLIT("\tarray_free(&as_cast_type_indexes);")); @@ -73666,12 +73947,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ strings__Builder_writeln(&g->typedefs, _SLIT("typedef struct none none;")); } string name = sym->cname; - if (sym->info._typ == 416 /* v.ast.Struct */) { + if (sym->info._typ == 417 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { continue; } if (string_contains(name, _SLIT("_T_"))) { - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } int start_pos = g->type_definitions.len; string pre_pragma = _SLIT(""); @@ -73680,7 +73961,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ v__ast__Attr attr = ((v__ast__Attr*)(*sym->info._v__ast__Struct).attrs.data)[_t2]; if (string__eq(attr.name, _SLIT("_pack"))) { - pre_pragma = /*f*/string__plus(pre_pragma, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#pragma pack(push, "), 0xfe10, {.d_s = attr.arg}}, {_SLIT(")\n"), 0, { .d_c = 0 }}}))); + pre_pragma = /*f*/string__plus(pre_pragma, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#pragma pack(push, "), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT(")\n"), 0, { .d_c = 0 }}}))); post_pragma = /*f*/string__plus(post_pragma, _SLIT("#pragma pack(pop)")); } else { @@ -73688,25 +73969,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ } strings__Builder_writeln(&g->type_definitions, pre_pragma); if ((*sym->info._v__ast__Struct).is_union) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("union "), 0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("union "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); } if ((*sym->info._v__ast__Struct).fields.len > 0 || (*sym->info._v__ast__Struct).embeds.len > 0) { 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_142325 = v__gen__c__Gen_optional_type_name(g, field.typ); - string styp = mr_142325.arg0; - string base = mr_142325.arg1; + multi_return_string_string mr_146119 = v__gen__c__Gen_optional_type_name(g, field.typ); + string styp = mr_146119.arg0; + string base = mr_146119.arg1; sync__RwMutex_lock(&g->done_optionals->mtx); /*lock*/ { if (!Array_string_contains(g->done_optionals->val, base)) { array_push((array*)&g->done_optionals->val, _MOV((string[]){ string_clone(base) })); string last_text = string_clone(strings__Builder_after(&g->type_definitions, start_pos)); strings__Builder_go_back_to(&g->type_definitions, start_pos); - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_optional_type_text(g, styp, base)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_optional_type_text(g, styp, base)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->type_definitions, last_text); } } @@ -73715,50 +73996,50 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ string type_name = v__gen__c__Gen_typ(g, field.typ); string field_name = v__gen__c__c_name(field.name); string volatile_prefix = (field.is_volatile ? (_SLIT("volatile ")) : (_SLIT(""))); - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = volatile_prefix}}, {_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = field_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = volatile_prefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else { strings__Builder_writeln(&g->type_definitions, _SLIT("\tEMPTY_STRUCT_DECLARATION;")); } string ti_attrs = (Array_v__ast__Attr_contains((*sym->info._v__ast__Struct).attrs, _SLIT("packed")) ? (_SLIT("__attribute__((__packed__))")) : (_SLIT(""))); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}"), 0xfe10, {.d_s = ti_attrs}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}"), /*115 &string*/0xfe10, {.d_s = ti_attrs}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, post_pragma); } - else if (sym->info._typ == 431 /* v.ast.Alias */) { + else if (sym->info._typ == 432 /* v.ast.Alias */) { } - else if (sym->info._typ == 441 /* v.ast.Thread */) { + else if (sym->info._typ == 442 /* v.ast.Thread */) { if (g->pref->os == v__pref__OS__windows) { if (string__eq(name, _SLIT("__v_thread"))) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef HANDLE "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef HANDLE "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { strings__Builder_writeln(&g->type_definitions, _SLIT("typedef struct {")); strings__Builder_writeln(&g->type_definitions, _SLIT("\tvoid* ret_ptr;")); strings__Builder_writeln(&g->type_definitions, _SLIT("\tHANDLE handle;")); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else { if (!g->pref->is_bare && !g->pref->no_builtin) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef pthread_t "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef pthread_t "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } - else if (sym->info._typ == 435 /* v.ast.SumType */) { + else if (sym->info._typ == 436 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { continue; } - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, _SLIT("")); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Union sum type "), 0xfe10, {.d_s = name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Union sum type "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); for (int _t5 = 0; _t5 < (*sym->info._v__ast__SumType).variants.len; ++_t5) { v__ast__Type variant = ((v__ast__Type*)(*sym->info._v__ast__SumType).variants.data)[_t5]; - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// | "), 0x8fe27, {.d_i32 = variant}}, {_SLIT(" = "), 0x28fe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_idx(variant))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// | "), /*100 &v.ast.Type*/0x8fe27, {.d_i32 = variant}}, {_SLIT(" = "), /*115 &string*/0x28fe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_idx(variant))}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, _SLIT("\tunion {")); for (int _t6 = 0; _t6 < (*sym->info._v__ast__SumType).variants.len; ++_t6) { v__ast__Type variant = ((v__ast__Type*)(*sym->info._v__ast__SumType).variants.data)[_t6]; v__ast__TypeSymbol* variant_sym = v__ast__Table_sym(g->table, variant); - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_ref(variant))}}, {_SLIT(" _"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_ref(variant))}}, {_SLIT(" _"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->type_definitions, _SLIT("\t};")); strings__Builder_writeln(&g->type_definitions, _SLIT("\tint _typ;")); @@ -73766,13 +74047,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ v__gen__c__Gen_writeln(g, _SLIT("\t// pointers to common sumtype fields")); for (int _t7 = 0; _t7 < (*sym->info._v__ast__SumType).fields.len; ++_t7) { v__ast__StructField field = ((v__ast__StructField*)(*sym->info._v__ast__SumType).fields.data)[_t7]; - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_ref(field.typ))}}, {_SLIT(" "), 0xfe10, {.d_s = field.name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_ref(field.typ))}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&g->type_definitions, _SLIT("};")); strings__Builder_writeln(&g->type_definitions, _SLIT("")); } - else if (sym->info._typ == 439 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 440 /* v.ast.ArrayFixed */) { v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__ArrayFixed).elem_type); if (!v__ast__TypeSymbol_is_builtin(elem_sym) && !v__ast__Type_has_flag((*sym->info._v__ast__ArrayFixed).elem_type, v__ast__TypeFlag__generic)) { string styp = sym->cname; @@ -73784,15 +74065,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ if (string_starts_with(fixed_elem_name, _SLIT("C__"))) { fixed_elem_name = string_substr(fixed_elem_name, 3, (fixed_elem_name).len); } - if ((elem_sym->info)._typ == 443 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 444 /* v.ast.FnType */) { int pos = g->out.len; v__gen__c__Gen_write_fn_ptr_decl(g, &(*elem_sym->info._v__ast__FnType), _SLIT("")); fixed_elem_name = strings__Builder_cut_to(&g->out, pos); - string def_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = fixed_elem_name}}, {_SLIT(";"), 0, { .d_c = 0 }}})); - def_str = string_replace_once(def_str, _SLIT("(*)"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*"), 0xfe10, {.d_s = styp}}, {_SLIT("["), 0xfe07, {.d_i32 = len}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + string def_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = fixed_elem_name}}, {_SLIT(";"), 0, { .d_c = 0 }}})); + def_str = string_replace_once(def_str, _SLIT("(*)"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, def_str); } else { - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = fixed_elem_name}}, {_SLIT(" "), 0xfe10, {.d_s = styp}}, {_SLIT(" ["), 0xfe07, {.d_i32 = len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = fixed_elem_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } } @@ -73820,13 +74101,13 @@ bool v__gen__c__Gen_sort_structs_defer_0 = false; continue; } Array_string field_deps = __new_array_with_default(0, 0, sizeof(string), 0); - if (sym->info._typ == 439 /* v.ast.ArrayFixed */) { + if (sym->info._typ == 440 /* v.ast.ArrayFixed */) { string dep = v__ast__Table_sym(g->table, (*sym->info._v__ast__ArrayFixed).elem_type)->name; if (Array_string_contains(type_names, dep)) { array_push((array*)&field_deps, _MOV((string[]){ string_clone(dep) })); } } - else if (sym->info._typ == 416 /* v.ast.Struct */) { + else if (sym->info._typ == 417 /* v.ast.Struct */) { for (int _t5 = 0; _t5 < (*sym->info._v__ast__Struct).embeds.len; ++_t5) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Struct).embeds.data)[_t5]; string dep = v__ast__Table_sym(g->table, embed)->name; @@ -73846,7 +74127,7 @@ bool v__gen__c__Gen_sort_structs_defer_0 = false; continue; } array_push((array*)&field_deps, _MOV((string[]){ string_clone(dep) })); - if ((fsym->info)._typ == 431 /* v.ast.Alias */) { + if ((fsym->info)._typ == 432 /* v.ast.Alias */) { string xdep = v__ast__Table_sym(g->table, (*fsym->info._v__ast__Alias).parent_type)->name; if (!Array_string_contains(type_names, xdep) || Array_string_contains(field_deps, xdep)) { continue; @@ -73922,31 +74203,35 @@ bool v__gen__c__Gen_or_block_defer_0 = false; bool is_none_ok = v__ast__Type_alias_eq(return_type, _const_v__ast__ovoid_type); v__gen__c__Gen_writeln(g, _SLIT(";")); if (is_none_ok) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".state != 0 && "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ != _IError_None___index) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".state != 0 && "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ != _IError_None___index) {"), 0, { .d_c = 0 }}}))); } else { if (return_type != 0 && v__ast__Table_sym(g->table, return_type)->kind == v__ast__Kind__function) { mr_styp = _SLIT("voidptr"); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".state != 0) { /*or block*/ "), 0, { .d_c = 0 }}}))); + if (v__ast__Type_has_flag(return_type, v__ast__TypeFlag__result)) { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".is_error) { /*or block*/ "), 0, { .d_c = 0 }}}))); + } else { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".state != 0) { /*or block*/ "), 0, { .d_c = 0 }}}))); + } } if (or_block.kind == v__ast__OrKind__block) { g->or_expr_return_type = v__ast__Type_clear_flag(return_type, v__ast__TypeFlag__optional); if (g->inside_or_block) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\terr = "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\terr = "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError err = "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError err = "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); } g->inside_or_block = true; v__gen__c__Gen_or_block_defer_0 = true; Array_v__ast__Stmt stmts = or_block.stmts; - if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 306 /* v.ast.ExprStmt */ && !v__ast__Type_alias_eq((/* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(stmts)))._typ, 306) /*expected idx: 306, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 307 /* v.ast.ExprStmt */ && !v__ast__Type_alias_eq((/* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(stmts)))._typ, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { g->indent++; for (int i = 0; i < stmts.len; ++i) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[i]; if (i == stmts.len - 1) { - v__ast__ExprStmt expr_stmt = /* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 306) /*expected idx: 306, name: v.ast.ExprStmt */ ; + v__ast__ExprStmt expr_stmt = /* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("*("), 0xfe10, {.d_s = mr_styp}}, {_SLIT("*) "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".data = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("*("), /*115 &string*/0xfe10, {.d_s = mr_styp}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".data = "), 0, { .d_c = 0 }}}))); bool old_inside_opt_data = g->inside_opt_data; g->inside_opt_data = true; v__gen__c__Gen_expr_with_cast(g, expr_stmt.expr, expr_stmt.typ, v__ast__Type_clear_flag(return_type, v__ast__TypeFlag__optional)); @@ -73962,23 +74247,23 @@ bool v__gen__c__Gen_or_block_defer_0 = false; g->indent--; } else { v__gen__c__Gen_stmts(g, stmts); - if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 306 /* v.ast.ExprStmt */) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 307 /* v.ast.ExprStmt */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } g->or_expr_return_type = _const_v__ast__void_type; - } else if (or_block.kind == v__ast__OrKind__propagate) { + } else if (or_block.kind == v__ast__OrKind__propagate_option) { 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["), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); + 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_151479 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_151479.arg0; - string pafile = mr_151479.arg1; - string pamod = mr_151479.arg2; - string pafn = mr_151479.arg3; - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), 0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), 0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + multi_return_int_string_string_string mr_155392 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_155392.arg0; + string pafile = mr_155392.arg1; + string pamod = mr_155392.arg2; + string pafn = mr_155392.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( "), 0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + 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 }}}))); } } else if (!isnil(g->fn_decl) && g->fn_decl->is_test) { v__gen__c__Gen_gen_failing_error_propagation_for_test_fn(g, or_block, cvar_name); @@ -73989,9 +74274,36 @@ bool v__gen__c__Gen_or_block_defer_0 = false; } else { string styp = v__gen__c__Gen_typ(g, g->fn_decl->return_type); string err_obj = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(&"), 0xfe10, {.d_s = err_obj}}, {_SLIT(", &"), 0xfe10, {.d_s = cvar_name}}, {_SLIT(", sizeof(Option));"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(&"), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(", &"), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(", sizeof(Option));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } + } + } else if (or_block.kind == v__ast__OrKind__propagate_result) { + 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_156659 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_156659.arg0; + string pafile = mr_156659.arg1; + string pamod = mr_156659.arg2; + string pafn = mr_156659.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 }}}))); + } + } else if (!isnil(g->fn_decl) && g->fn_decl->is_test) { + v__gen__c__Gen_gen_failing_error_propagation_for_test_fn(g, or_block, cvar_name); + } else { + v__gen__c__Gen_write_defer_stmts(g); + if (v__ast__Type_alias_eq(g->fn_decl->return_type, _const_v__ast__void_type)) { + v__gen__c__Gen_writeln(g, _SLIT("\treturn;")); + } else { + string styp = v__gen__c__Gen_typ(g, g->fn_decl->return_type); + string err_obj = v__gen__c__Gen_new_tmp_var(g); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(&"), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(", &"), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__result_name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } @@ -74008,7 +74320,7 @@ if (v__gen__c__Gen_or_block_defer_0) { inline VV_LOCAL_SYMBOL string v__gen__c__c_name(string name_) { string name = v__util__no_dots(name_); if (_IN_MAP(ADDR(string, name), ADDR(map, _const_v__gen__c__c_reserved_map))) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string _t2 = name; @@ -74048,7 +74360,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty } case v__ast__Kind__alias: { - string _t6 = v__gen__c__Gen_type_default(g, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type); + string _t6 = v__gen__c__Gen_type_default(g, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type); return _t6; break; } @@ -74057,7 +74369,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty v__ast__Type elem_type = v__ast__TypeSymbol_chan_info(sym).elem_type; string elemtypstr = v__gen__c__Gen_typ(g, elem_type); string noscan = v__gen__c__Gen_check_noscan(g, elem_type); - string _t7 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("sync__new_channel_st"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, sizeof("), 0xfe10, {.d_s = elemtypstr}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string _t7 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("sync__new_channel_st"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, sizeof("), /*115 &string*/0xfe10, {.d_s = elemtypstr}}, {_SLIT("))"), 0, { .d_c = 0 }}})); return _t7; break; } @@ -74070,10 +74382,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty elem_type_str = string_substr(elem_type_str, 3, (elem_type_str).len); } string noscan = v__gen__c__Gen_check_noscan(g, elem_typ); - string init_str = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__new_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, 0, sizeof("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string init_str = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__new_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, 0, sizeof("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("))"), 0, { .d_c = 0 }}})); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - string atyp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); - string _t8 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = atyp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = atyp}}, {_SLIT("){.mtx = {0}, .val ="), 0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), 0xfe10, {.d_s = atyp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string atyp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t8 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = atyp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = atyp}}, {_SLIT("){.mtx = {0}, .val ="), /*115 &string*/0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = atyp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); return _t8; } else { string _t9 = init_str; @@ -74085,11 +74397,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_154061 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); - string hash_fn = mr_154061.arg0; - string key_eq_fn = mr_154061.arg1; - string clone_fn = mr_154061.arg2; - string free_fn = mr_154061.arg3; + multi_return_string_string_string_string mr_159244 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); + string hash_fn = mr_159244.arg0; + string key_eq_fn = mr_159244.arg1; + string clone_fn = mr_159244.arg2; + string free_fn = mr_159244.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(""))); @@ -74101,10 +74413,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty noscan = /*f*/string__plus(noscan, _SLIT("_value")); } } - string init_str = str_intp(8, _MOV((StrIntpData[]){{_SLIT("new_map"), 0xfe10, {.d_s = noscan}}, {_SLIT("(sizeof("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.key_type)}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.value_type)}}, {_SLIT("), "), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string init_str = str_intp(8, _MOV((StrIntpData[]){{_SLIT("new_map"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(sizeof("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.key_type)}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.value_type)}}, {_SLIT("), "), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}})); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - string mtyp = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__shared__Map_"), 0xfe10, {.d_s = key_typ->cname}}, {_SLIT("_"), 0xfe10, {.d_s = v__ast__Table_sym(g->table, info.value_type)->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); - string _t10 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = mtyp}}, {_SLIT("*)__dup_shared_map(&("), 0xfe10, {.d_s = mtyp}}, {_SLIT("){.mtx = {0}, .val ="), 0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), 0xfe10, {.d_s = mtyp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string mtyp = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__shared__Map_"), /*115 &string*/0xfe10, {.d_s = key_typ->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(g->table, info.value_type)->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t10 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = mtyp}}, {_SLIT("*)__dup_shared_map(&("), /*115 &string*/0xfe10, {.d_s = mtyp}}, {_SLIT("){.mtx = {0}, .val ="), /*115 &string*/0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = mtyp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); return _t10; } else { string _t11 = init_str; @@ -74116,7 +74428,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty { bool has_none_zero = false; string init_str = _SLIT("{"); - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; bool typ_is_shared_f = v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f); if (sym->language == v__ast__Language__v && !typ_is_shared_f) { for (int _t12 = 0; _t12 < info.fields.len; ++_t12) { @@ -74131,17 +74443,17 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty } else { expr_str = v__gen__c__Gen_expr_string(g, field.default_expr); } - init_str = /*f*/string__plus(init_str, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0xfe10, {.d_s = expr_str}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + init_str = /*f*/string__plus(init_str, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } else { string zero_str = v__gen__c__Gen_type_default(g, field.typ); if (string__eq(zero_str, _SLIT("{0}"))) { - if ((field_sym->info)._typ == 416 /* v.ast.Struct */ && field_sym->language == v__ast__Language__v) { + if ((field_sym->info)._typ == 417 /* v.ast.Struct */ && field_sym->language == v__ast__Language__v) { if ((*field_sym->info._v__ast__Struct).fields.len == 0 && (*field_sym->info._v__ast__Struct).embeds.len == 0) { zero_str = _SLIT("{EMPTY_STRUCT_INITIALIZATION}"); } } } - init_str = /*f*/string__plus(init_str, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0xfe10, {.d_s = zero_str}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + init_str = /*f*/string__plus(init_str, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = zero_str}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } has_none_zero = true; } @@ -74150,13 +74462,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty if (has_none_zero) { init_str = /*f*/string__plus(init_str, _SLIT("}")); string type_name = v__gen__c__Gen_typ(g, typ); - init_str = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = type_name}}, {_SLIT(")"), 0, { .d_c = 0 }}})), init_str); + init_str = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(")"), 0, { .d_c = 0 }}})), init_str); } else { init_str = /*f*/string__plus(init_str, _SLIT("0}")); } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - string styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = v__ast__Table_sym(g->table, typ)->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); - string _t13 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("*)__dup"), 0xfe10, {.d_s = styp}}, {_SLIT("(&("), 0xfe10, {.d_s = styp}}, {_SLIT("){.mtx = {0}, .val ="), 0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(g->table, typ)->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t13 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)__dup"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){.mtx = {0}, .val ="), /*115 &string*/0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); return _t13; } else { string _t14 = init_str; @@ -74252,19 +74564,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_size_of(v__gen__c__Gen* g, v__ast__SizeOf no v__ast__Type node_typ = v__gen__c__Gen_unwrap_generic(g, typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node_typ); if (sym->language == v__ast__Language__v && (sym->kind == v__ast__Kind__placeholder || sym->kind == v__ast__Kind__any)) { - v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); VUNREACHABLE(); } string styp = v__gen__c__Gen_typ(g, node_typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = v__util__no_dots(styp)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &string*/0xfe10, {.d_s = v__util__no_dots(styp)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } 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__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("/*enum val is_number "), 0xfe10, {.d_s = node.mod}}, {_SLIT(" styp="), 0xfe10, {.d_s = styp}}, {_SLIT("*/_const_main__"), 0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT("__"), 0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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 }}}))); } } @@ -74273,20 +74586,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_as_cast(v__gen__c__Gen* g, v__ast__AsCast no string styp = v__gen__c__Gen_typ(g, unwrapped_node_typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, unwrapped_node_typ); v__ast__TypeSymbol* expr_type_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.expr_type)); - if ((expr_type_sym->info)._typ == 435 /* v.ast.SumType */) { + if ((expr_type_sym->info)._typ == 436 /* v.ast.SumType */) { string dot = (v__ast__Type_is_ptr(node.expr_type) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* as */ *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)__as_cast("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* as */ *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)__as_cast("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")")); v__gen__c__Gen_write(g, dot); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(","), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")")); v__gen__c__Gen_write(g, dot); string sidx = v__gen__c__Gen_type_sidx(g, unwrapped_node_typ); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("_typ, "), 0xfe10, {.d_s = sidx}}, {_SLIT(") /*expected idx: "), 0xfe10, {.d_s = sidx}}, {_SLIT(", name: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("_typ, "), /*115 &string*/0xfe10, {.d_s = sidx}}, {_SLIT(") /*expected idx: "), /*115 &string*/0xfe10, {.d_s = sidx}}, {_SLIT(", name: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < (*expr_type_sym->info._v__ast__SumType).variants.len; ++_t1) { v__ast__Type variant = ((v__ast__Type*)(*expr_type_sym->info._v__ast__SumType).variants.data)[_t1]; string idx = u32_str(((u32)(variant))); @@ -74297,13 +74610,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_as_cast(v__gen__c__Gen* g, v__ast__AsCast no map_set(&g->as_cast_type_names, &(string[]){idx}, &(string[]) { variant_sym->name }); } } else if (expr_type_sym->kind == v__ast__Kind__interface_ && sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), 0xfe10, {.d_s = expr_type_sym->cname}}, {_SLIT("_as_I_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), /*115 &string*/0xfe10, {.d_s = expr_type_sym->cname}}, {_SLIT("_as_I_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(node.expr_type)) { v__gen__c__Gen_write(g, _SLIT("*")); } v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")")); - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((expr_type_sym->info)._v__ast__Interface,(expr_type_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((expr_type_sym->info)._v__ast__Interface,(expr_type_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; if (!_IN_MAP(ADDR(int, node.typ), ADDR(map, info.conversions))) { Array_v__ast__Type left_variants = (*(Array_v__ast__Type*)map_get(ADDR(map, g->table->iface_types), &(string[]){expr_type_sym->name}, &(Array_v__ast__Type[]){ __new_array(0, 0, sizeof(v__ast__Type)) })); Array_v__ast__Type right_variants = (*(Array_v__ast__Type*)map_get(ADDR(map, g->table->iface_types), &(string[]){sym->name}, &(Array_v__ast__Type[]){ __new_array(0, 0, sizeof(v__ast__Type)) })); @@ -74333,7 +74646,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_as_cast_name_table(v__gen__c__Gen* g) { } strings__Builder name_ast = strings__new_builder(1024); int casts_len = g->as_cast_type_names.len + 1; - strings__Builder_writeln(&name_ast, str_intp(4, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array("), 0xfe07, {.d_i32 = casts_len}}, {_SLIT(", "), 0xfe07, {.d_i32 = casts_len}}, {_SLIT(", sizeof(VCastTypeIndexName), _MOV((VCastTypeIndexName["), 0xfe07, {.d_i32 = casts_len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&name_ast, str_intp(4, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = casts_len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = casts_len}}, {_SLIT(", sizeof(VCastTypeIndexName), _MOV((VCastTypeIndexName["), /*100 &int*/0xfe07, {.d_i32 = casts_len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&name_ast, _SLIT("\t\t (VCastTypeIndexName){.tindex = 0, .tname = _SLIT(\"unknown\")}")); Map_string_string _t2 = g->as_cast_type_names; int _t4 = _t2.key_values.len; @@ -74348,7 +74661,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_as_cast_name_table(v__gen__c__Gen* g) { string key = /*key*/ *(string*)DenseArray_key(&_t2.key_values, _t3); key = string_clone(key); string value = (*(string*)DenseArray_value(&_t2.key_values, _t3)); - strings__Builder_writeln(&name_ast, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t, (VCastTypeIndexName){.tindex = "), 0xfe10, {.d_s = key}}, {_SLIT(", .tname = _SLIT(\""), 0xfe10, {.d_s = value}}, {_SLIT("\")}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&name_ast, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t, (VCastTypeIndexName){.tindex = "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(", .tname = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT("\")}"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&name_ast, _SLIT("\t}));\n")); string _t6 = strings__Builder_str(&name_ast); @@ -74374,26 +74687,26 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { if (isym->kind != v__ast__Kind__interface_) { continue; } - if ((isym->info)._typ != 434 /* v.ast.Interface */) { + if ((isym->info)._typ != 435 /* v.ast.Interface */) { continue; } - v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; if (inter_info.is_generic) { continue; } string interface_name = isym->cname; - string methods_struct_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_interface_methods"), 0, { .d_c = 0 }}})); + string methods_struct_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_interface_methods"), 0, { .d_c = 0 }}})); strings__Builder methods_struct_def = strings__new_builder(100); - strings__Builder_writeln(&methods_struct_def, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct_def, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); Map_string_int methodidx = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); for (int k = 0; k < inter_info.methods.len; ++k) { v__ast__Fn method = ((v__ast__Fn*)inter_info.methods.data)[k]; map_set(&methodidx, &(string[]){method.name}, &(int[]) { k }); string ret_styp = v__gen__c__Gen_typ(g, method.return_type); - strings__Builder_write_string(&methods_struct_def, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*_method_"), 0xfe10, {.d_s = v__gen__c__c_name(method.name)}}, {_SLIT(")(void* _"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&methods_struct_def, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*_method_"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(method.name)}}, {_SLIT(")(void* _"), 0, { .d_c = 0 }}}))); for (int i = 1; i < method.params.len; ++i) { v__ast__Param arg = (*(v__ast__Param*)/*ee elem_sym */array_get(method.params, i)); - strings__Builder_write_string(&methods_struct_def, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, arg.typ)}}, {_SLIT(" "), 0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&methods_struct_def, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, arg.typ)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&methods_struct_def, _SLIT(");")); } @@ -74401,17 +74714,17 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { strings__Builder methods_struct = strings__new_builder(100); int iname_table_length = inter_info.types.len; if (iname_table_length == 0) { - strings__Builder_writeln(&methods_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), 0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table[1];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table[1];"), 0, { .d_c = 0 }}}))); } else { if (g->pref->build_mode != v__pref__BuildMode__build_module) { - strings__Builder_writeln(&methods_struct, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), 0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table["), 0xfe07, {.d_i32 = iname_table_length}}, {_SLIT("] = {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table["), /*100 &int*/0xfe07, {.d_i32 = iname_table_length}}, {_SLIT("] = {"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&methods_struct, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), 0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table["), 0xfe07, {.d_i32 = iname_table_length}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table["), /*100 &int*/0xfe07, {.d_i32 = iname_table_length}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } strings__Builder cast_functions = strings__new_builder(100); strings__Builder methods_wrapper = strings__new_builder(100); - strings__Builder_writeln(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Methods wrapper for interface \""), 0xfe10, {.d_s = interface_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Methods wrapper for interface \""), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); Map_string_int already_generated_mwrappers = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); int iinidx_minimum_base = 1000; int current_iinidx = iinidx_minimum_base; @@ -74421,31 +74734,31 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { string cctype = v__gen__c__Gen_cc_type(g, v__ast__mktyp(st), true); #if defined(CUSTOM_DEFINE_debug_interface_table) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(">> interface name: "), 0xfe10, {.d_s = isym->name}}, {_SLIT(" | concrete type: "), 0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(st))}}, {_SLIT(" | st symname: "), 0xfe10, {.d_s = st_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(">> interface name: "), /*115 &string*/0xfe10, {.d_s = isym->name}}, {_SLIT(" | concrete type: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v__ast__Type_debug(st))}}, {_SLIT(" | st symname: "), /*115 &string*/0xfe10, {.d_s = st_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif - string interface_index_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_"), 0xfe10, {.d_s = cctype}}, {_SLIT("_index"), 0, { .d_c = 0 }}})); + string interface_index_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_index"), 0, { .d_c = 0 }}})); if ((*(int*)map_get(ADDR(map, already_generated_mwrappers), &(string[]){interface_index_name}, &(int[]){ 0 })) > 0) { continue; } map_set(&already_generated_mwrappers, &(string[]){interface_index_name}, &(int[]) { current_iinidx }); current_iinidx++; if (!string__eq(isym->name, _SLIT("vweb.DbInterface"))) { - strings__Builder_writeln(&sb, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static "), 0xfe10, {.d_s = interface_name}}, {_SLIT(" I_"), 0xfe10, {.d_s = cctype}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("("), 0xfe10, {.d_s = cctype}}, {_SLIT("* x);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" I_"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("* x);"), 0, { .d_c = 0 }}}))); strings__Builder cast_struct = strings__new_builder(100); - strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = interface_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._"), 0xfe10, {.d_s = cctype}}, {_SLIT(" = x,"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._typ = "), 0xfe10, {.d_s = interface_index_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT(" = x,"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._typ = "), /*115 &string*/0xfe10, {.d_s = interface_index_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); for (int _t3 = 0; _t3 < inter_info.fields.len; ++_t3) { v__ast__StructField field = ((v__ast__StructField*)inter_info.fields.data)[_t3]; string cname = v__gen__c__c_name(field.name); string field_styp = v__gen__c__Gen_typ(g, field.typ); Option_v__ast__StructField _t4; if (_t4 = v__ast__TypeSymbol_find_field(st_sym, field.name), _t4.state == 0) { - strings__Builder_writeln(&cast_struct, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t."), 0xfe10, {.d_s = cname}}, {_SLIT(" = ("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)x + __offsetof_ptr(x, "), 0xfe10, {.d_s = cctype}}, {_SLIT(", "), 0xfe10, {.d_s = cname}}, {_SLIT(")),"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_struct, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t."), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)x + __offsetof_ptr(x, "), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(")),"), 0, { .d_c = 0 }}}))); } else { IError err = _t4.err; - strings__Builder_write_string(&cast_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t."), 0xfe10, {.d_s = cname}}, {_SLIT(" = ("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)x"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&cast_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t."), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)x"), 0, { .d_c = 0 }}}))); if (v__ast__Type_alias_eq(st, _const_v__ast__voidptr_type)) { strings__Builder_write_string(&cast_struct, _SLIT("/*.... ast.voidptr_type */")); } else { @@ -74454,7 +74767,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, embed_type); Option_v__ast__StructField _t6; if (_t6 = v__ast__TypeSymbol_find_field(embed_sym, field.name), _t6.state == 0) { - strings__Builder_write_string(&cast_struct, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" + __offsetof_ptr(x, "), 0xfe10, {.d_s = cctype}}, {_SLIT(", "), 0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT(") + __offsetof_ptr(x, "), 0xfe10, {.d_s = embed_sym->cname}}, {_SLIT(", "), 0xfe10, {.d_s = cname}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&cast_struct, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" + __offsetof_ptr(x, "), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT(") + __offsetof_ptr(x, "), /*115 &string*/0xfe10, {.d_s = embed_sym->cname}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); break; } } @@ -74464,19 +74777,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } strings__Builder_write_string(&cast_struct, _SLIT("\t}")); string cast_struct_str = strings__Builder_str(&cast_struct); - strings__Builder_writeln(&cast_functions, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n// Casting functions for converting \""), 0xfe10, {.d_s = cctype}}, {_SLIT("\" to interface \""), 0xfe10, {.d_s = interface_name}}, {_SLIT("\"\nstatic inline "), 0xfe10, {.d_s = interface_name}}, {_SLIT(" I_"), 0xfe10, {.d_s = cctype}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("("), 0xfe10, {.d_s = cctype}}, {_SLIT("* x) {\n return "), 0xfe10, {.d_s = cast_struct_str}}, {_SLIT(";\n}"), 0, { .d_c = 0 }}}))); - string shared_fn_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("I___shared__"), 0xfe10, {.d_s = cctype}}, {_SLIT("_to_shared_Interface___shared__"), 0xfe10, {.d_s = interface_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + strings__Builder_writeln(&cast_functions, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n// Casting functions for converting \""), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("\" to interface \""), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("\"\nstatic inline "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" I_"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("* x) {\n return "), /*115 &string*/0xfe10, {.d_s = cast_struct_str}}, {_SLIT(";\n}"), 0, { .d_c = 0 }}}))); + string shared_fn_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("I___shared__"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_to_shared_Interface___shared__"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__Gen_has_been_referenced(g, shared_fn_name)) { strings__Builder cast_shared_struct = strings__new_builder(100); - strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(__shared__"), 0xfe10, {.d_s = interface_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(__shared__"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&cast_shared_struct, _SLIT("\t\t.mtx = {0},")); strings__Builder_writeln(&cast_shared_struct, _SLIT("\t\t.val = {")); - strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t._"), 0xfe10, {.d_s = cctype}}, {_SLIT(" = &x->val,"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t._typ = "), 0xfe10, {.d_s = interface_index_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t._"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT(" = &x->val,"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t._typ = "), /*115 &string*/0xfe10, {.d_s = interface_index_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&cast_shared_struct, _SLIT("\t\t}")); strings__Builder_write_string(&cast_shared_struct, _SLIT("\t}")); string cast_shared_struct_str = strings__Builder_str(&cast_shared_struct); - strings__Builder_writeln(&cast_functions, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n// Casting functions for converting \"__shared__"), 0xfe10, {.d_s = cctype}}, {_SLIT("\" to interface \"__shared__"), 0xfe10, {.d_s = interface_name}}, {_SLIT("\"\nstatic inline __shared__"), 0xfe10, {.d_s = interface_name}}, {_SLIT(" "), 0xfe10, {.d_s = shared_fn_name}}, {_SLIT("(__shared__"), 0xfe10, {.d_s = cctype}}, {_SLIT("* x) {\n return "), 0xfe10, {.d_s = cast_shared_struct_str}}, {_SLIT(";\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_functions, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n// Casting functions for converting \"__shared__"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("\" to interface \"__shared__"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("\"\nstatic inline __shared__"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = shared_fn_name}}, {_SLIT("(__shared__"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("* x) {\n return "), /*115 &string*/0xfe10, {.d_s = cast_shared_struct_str}}, {_SLIT(";\n}"), 0, { .d_c = 0 }}}))); } } if (g->pref->build_mode != v__pref__BuildMode__build_module) { @@ -74495,7 +74808,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { string mname = /*key*/ *(string*)DenseArray_key(&methodidx.key_values, _t7); mname = string_clone(mname); if (g->pref->build_mode != v__pref__BuildMode__build_module) { - strings__Builder_writeln(&methods_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._method_"), 0xfe10, {.d_s = v__gen__c__c_name(mname)}}, {_SLIT(" = (void*) 0,"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._method_"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(mname)}}, {_SLIT(" = (void*) 0,"), 0, { .d_c = 0 }}}))); } } } @@ -74511,7 +74824,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { array_push((array*)&_t10, &ti); } Array_string method_names =_t10; - if (st_sym->info._typ == 416 /* v.ast.Struct */) { + if (st_sym->info._typ == 417 /* v.ast.Struct */) { if (v__ast__Type_has_flag((*st_sym->info._v__ast__Struct).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*st_sym->info._v__ast__Struct).parent_type); for (int _t12 = 0; _t12 < parent_sym->methods.len; ++_t12) { @@ -74528,7 +74841,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } } } - else if (st_sym->info._typ == 434 /* v.ast.Interface */) { + else if (st_sym->info._typ == 435 /* v.ast.Interface */) { if (v__ast__Type_has_flag((*st_sym->info._v__ast__Interface).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*st_sym->info._v__ast__Interface).parent_type); for (int _t15 = 0; _t15 < parent_sym->methods.len; ++_t15) { @@ -74545,7 +74858,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } } } - else if (st_sym->info._typ == 435 /* v.ast.SumType */) { + else if (st_sym->info._typ == 436 /* v.ast.SumType */) { if (v__ast__Type_has_flag((*st_sym->info._v__ast__SumType).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*st_sym->info._v__ast__SumType).parent_type); for (int _t18 = 0; _t18 < parent_sym->methods.len; ++_t18) { @@ -74588,13 +74901,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { string name = method.name; if (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 == 416 /* v.ast.Struct */) { + if (parent_sym->info._typ == 417 /* v.ast.Struct */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__Struct).concrete_types, method.name, false); } - else if (parent_sym->info._typ == 434 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 435 /* v.ast.Interface */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__Interface).concrete_types, method.name, false); } - else if (parent_sym->info._typ == 435 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 436 /* v.ast.SumType */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__SumType).concrete_types, method.name, false); } @@ -74605,22 +74918,22 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { if (!_IN_MAP(ADDR(string, method.name), ADDR(map, methodidx))) { continue; } - if ((st_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((st_sym->info)._typ == 417 /* v.ast.Struct */) { if (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); } } string styp = v__gen__c__Gen_cc_type(g, (*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).typ, true); - string method_call = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string method_call = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!v__ast__Type_is_ptr((*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).typ)) { - method_call = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cctype}}, {_SLIT("_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); - string iwpostfix = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_Interface_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_method_wrapper"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&methods_wrapper, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, method.return_type)}}, {_SLIT(" "), 0xfe10, {.d_s = cctype}}, {_SLIT("_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0xfe10, {.d_s = iwpostfix}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + method_call = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string iwpostfix = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_Interface_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_method_wrapper"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&methods_wrapper, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, method.return_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = iwpostfix}}, {_SLIT("("), 0, { .d_c = 0 }}}))); 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)).pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).name,(*(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)).type_pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_hidden,.typ = v__ast__Type_set_nr_muls(st, 1),}) }); - multi_return_Array_string_Array_string_Array_bool mr_168496 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); - Array_string fargs = mr_168496.arg0; + multi_return_Array_string_Array_string_Array_bool mr_173726 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); + Array_string fargs = mr_173726.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__")); @@ -74637,19 +74950,19 @@ 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){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_168960 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); - Array_v__ast__Type embed_types = mr_168960.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_174190 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); + Array_v__ast__Type embed_types = mr_174190.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, 0xfe10, {.d_s = embed_sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); - strings__Builder_write_string(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = method_name}}, {_SLIT("("), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, 0))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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 }}})); + strings__Builder_write_string(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, 0))}}, {_SLIT0, 0, { .d_c = 0 }}}))); for (int idx_embed = 0; idx_embed < embed_types.len; ++idx_embed) { v__ast__Type embed = ((v__ast__Type*)embed_types.data)[idx_embed]; v__ast__TypeSymbol* esym = v__ast__Table_sym(g->table, embed); if (idx_embed == 0 || v__ast__Type_is_any_kind_of_pointer((*(v__ast__Type*)/*ee elem_sym */array_get(embed_types, idx_embed - 1)))) { - strings__Builder_write_string(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("->"), 0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(esym)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("->"), /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(esym)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(esym)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(esym)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } if (fargs.len > 1) { @@ -74657,19 +74970,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } Array_string _t27; string args = Array_string_join((_t27 = fargs, array_slice(_t27, 1, _t27.len)), _SLIT(", ")); - strings__Builder_writeln(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = args}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = args}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { if (string_starts_with(parameter_name, _SLIT("__shared__"))) { - strings__Builder_writeln(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = method_call}}, {_SLIT("("), 0xfe10, {.d_s = Array_string_join(fargs, _SLIT(", "))}}, {_SLIT("->val);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = method_call}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = Array_string_join(fargs, _SLIT(", "))}}, {_SLIT("->val);"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = method_call}}, {_SLIT("(*"), 0xfe10, {.d_s = Array_string_join(fargs, _SLIT(", "))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = method_call}}, {_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = Array_string_join(fargs, _SLIT(", "))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&methods_wrapper, _SLIT("}")); method_call = /*f*/string__plus(method_call, iwpostfix); } if (g->pref->build_mode != v__pref__BuildMode__build_module && !v__ast__Type_alias_eq(st, _const_v__ast__voidptr_type)) { - strings__Builder_writeln(&methods_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t._method_"), 0xfe10, {.d_s = v__gen__c__c_name(method.name)}}, {_SLIT(" = (void*) "), 0xfe10, {.d_s = method_call}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t._method_"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(method.name)}}, {_SLIT(" = (void*) "), /*115 &string*/0xfe10, {.d_s = method_call}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } } if (methods.len == 0 && isym->idx == _const_v__ast__error_type_idx) { @@ -74681,9 +74994,9 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } int iin_idx = (*(int*)map_get(ADDR(map, already_generated_mwrappers), &(string[]){interface_index_name}, &(int[]){ 0 })) - iinidx_minimum_base; if (g->pref->build_mode != v__pref__BuildMode__build_module) { - strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("const int "), 0xfe10, {.d_s = interface_index_name}}, {_SLIT(" = "), 0xfe07, {.d_i32 = iin_idx}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("const int "), /*115 &string*/0xfe10, {.d_s = interface_index_name}}, {_SLIT(" = "), /*100 &int*/0xfe07, {.d_i32 = iin_idx}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("extern const int "), 0xfe10, {.d_s = interface_index_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("extern const int "), /*115 &string*/0xfe10, {.d_s = interface_index_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } Map_int_Array_v__ast__Type _t28 = inter_info.conversions; @@ -74699,23 +75012,23 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { int vtyp = /*key*/ *(int*)DenseArray_key(&_t28.key_values, _t29); Array_v__ast__Type variants = (*(Array_v__ast__Type*)DenseArray_value(&_t28.key_values, _t29)); v__ast__TypeSymbol* vsym = v__ast__Table_sym(g->table, vtyp); - strings__Builder_write_string(&conversion_functions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static inline bool I_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_is_I_"), 0xfe10, {.d_s = vsym->cname}}, {_SLIT("("), 0xfe10, {.d_s = interface_name}}, {_SLIT(" x) {\n\treturn "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&conversion_functions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static inline bool I_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_is_I_"), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" x) {\n\treturn "), 0, { .d_c = 0 }}}))); for (int i = 0; i < variants.len; ++i) { v__ast__Type variant = ((v__ast__Type*)variants.data)[i]; v__ast__TypeSymbol* variant_sym = v__ast__Table_sym(g->table, variant); if (i > 0) { strings__Builder_write_string(&conversion_functions, _SLIT(" || ")); } - strings__Builder_write_string(&conversion_functions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(x._typ == _"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&conversion_functions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(x._typ == _"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&conversion_functions, _SLIT(";\n}")); - strings__Builder_writeln(&conversion_functions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), 0xfe10, {.d_s = vsym->cname}}, {_SLIT(" I_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_as_I_"), 0xfe10, {.d_s = vsym->cname}}, {_SLIT("("), 0xfe10, {.d_s = interface_name}}, {_SLIT(" x) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&conversion_functions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT(" I_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_as_I_"), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" x) {"), 0, { .d_c = 0 }}}))); for (int _t32 = 0; _t32 < variants.len; ++_t32) { v__ast__Type variant = ((v__ast__Type*)variants.data)[_t32]; v__ast__TypeSymbol* variant_sym = v__ast__Table_sym(g->table, variant); - strings__Builder_writeln(&conversion_functions, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_index) return I_"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = vsym->cname}}, {_SLIT("(x._"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&conversion_functions, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_index) return I_"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT("(x._"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } - string pmessage = str_intp(3, _MOV((StrIntpData[]){{_SLIT("string__plus(string__plus(tos3(\"`as_cast`: cannot convert \"), tos3(v_typeof_interface_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("(x._typ))), tos3(\" to "), 0xfe10, {.d_s = v__util__strip_main_name(vsym->name)}}, {_SLIT("\"))"), 0, { .d_c = 0 }}})); + string pmessage = str_intp(3, _MOV((StrIntpData[]){{_SLIT("string__plus(string__plus(tos3(\"`as_cast`: cannot convert \"), tos3(v_typeof_interface_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("(x._typ))), tos3(\" to "), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(vsym->name)}}, {_SLIT("\"))"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { strings__Builder_write_string(&conversion_functions, _SLIT("\tpanic_debug(1, tos3(\"builtin.v\"), tos3(\"builtin\"), tos3(\"__as_cast\"), ")); strings__Builder_write_string(&conversion_functions, pmessage); @@ -74725,10 +75038,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { strings__Builder_write_string(&conversion_functions, pmessage); strings__Builder_writeln(&conversion_functions, _SLIT(");")); } - strings__Builder_writeln(&conversion_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn ("), 0xfe10, {.d_s = vsym->cname}}, {_SLIT("){0};"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&conversion_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn ("), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT("){0};"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&conversion_functions, _SLIT("}")); } - strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// ^^^ number of types for interface "), 0xfe10, {.d_s = interface_name}}, {_SLIT(": "), 0xfe07, {.d_i32 = current_iinidx - iinidx_minimum_base}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// ^^^ number of types for interface "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(": "), /*100 &int*/0xfe07, {.d_i32 = current_iinidx - iinidx_minimum_base}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (iname_table_length == 0) { strings__Builder_writeln(&methods_struct, _SLIT("")); } else { @@ -74761,14 +75074,14 @@ VV_LOCAL_SYMBOL multi_return_int_string_string_string v__gen__c__Gen_panic_debug } string v__gen__c__get_guarded_include_text(string iname, string imessage) { - string res = string_strip_margin( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\n |#if defined(__has_include)\n |\n |#if __has_include("), 0xfe10, {.d_s = iname}}, {_SLIT(")\n |#include "), 0xfe10, {.d_s = iname}}, {_SLIT("\n |#else\n |#error VERROR_MESSAGE "), 0xfe10, {.d_s = imessage}}, {_SLIT("\n |#endif\n |\n |#else\n |#include "), 0xfe10, {.d_s = iname}}, {_SLIT("\n |#endif\n "), 0, { .d_c = 0 }}}))); + string res = string_strip_margin( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\n |#if defined(__has_include)\n |\n |#if __has_include("), /*115 &string*/0xfe10, {.d_s = iname}}, {_SLIT(")\n |#include "), /*115 &string*/0xfe10, {.d_s = iname}}, {_SLIT("\n |#else\n |#error VERROR_MESSAGE "), /*115 &string*/0xfe10, {.d_s = imessage}}, {_SLIT("\n |#endif\n |\n |#else\n |#include "), /*115 &string*/0xfe10, {.d_s = iname}}, {_SLIT("\n |#endif\n "), 0, { .d_c = 0 }}}))); string _t1 = res; return _t1; } VV_LOCAL_SYMBOL void v__gen__c__Gen_trace(v__gen__c__Gen* g, string fbase, string message) { if (string__eq(g->file->path_base, fbase)) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> g.trace | "), 0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), 0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> g.trace | "), /*115 &string*/0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -74776,7 +75089,7 @@ int v__gen__c__Gen_get_array_depth(v__gen__c__Gen* g, v__ast__Type el_typ) { v__ast__Type typ = v__gen__c__Gen_unwrap_generic(g, el_typ); v__ast__TypeSymbol* sym = v__ast__Table_final_sym(g->table, typ); if (sym->kind == v__ast__Kind__array) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; int _t1 = 1 + v__gen__c__Gen_get_array_depth(g, info.elem_type); return _t1; } else { @@ -74823,14 +75136,14 @@ bool v__gen__c__Gen_contains_ptr(v__gen__c__Gen* g, v__ast__Type el_typ) { } case v__ast__Kind__array_fixed: { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; bool _t5 = v__gen__c__Gen_contains_ptr(g, info.elem_type); return _t5; break; } case v__ast__Kind__struct_: { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; for (int _t6 = 0; _t6 < info.embeds.len; ++_t6) { v__ast__Type embed = ((v__ast__Type*)info.embeds.data)[_t6]; if (v__gen__c__Gen_contains_ptr(g, embed)) { @@ -74851,7 +75164,7 @@ bool v__gen__c__Gen_contains_ptr(v__gen__c__Gen* g, v__ast__Type el_typ) { } case v__ast__Kind__aggregate: { - v__ast__Aggregate info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 429) /*expected idx: 429, name: v.ast.Aggregate */ ; + v__ast__Aggregate info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 430) /*expected idx: 430, name: v.ast.Aggregate */ ; for (int _t11 = 0; _t11 < info.types.len; ++_t11) { v__ast__Type atyp = ((v__ast__Type*)info.types.data)[_t11]; if (v__gen__c__Gen_contains_ptr(g, atyp)) { @@ -74865,7 +75178,7 @@ bool v__gen__c__Gen_contains_ptr(v__gen__c__Gen* g, v__ast__Type el_typ) { } case v__ast__Kind__multi_return: { - v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 442) /*expected idx: 442, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; for (int _t14 = 0; _t14 < info.types.len; ++_t14) { v__ast__Type mrtyp = ((v__ast__Type*)info.types.data)[_t14]; if (v__gen__c__Gen_contains_ptr(g, mrtyp)) { @@ -74920,86 +75233,12 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_check_noscan(v__gen__c__Gen* g, v__ast__Ty return _t2; } -VV_LOCAL_SYMBOL string v__gen__c__arm64_bytes(int nargs) { - string bytes = _SLIT("0xd0, 0xff, 0xff, 0x58, 0x6, 0xff, 0xff, 0x58, 0x00, 0x02, 0x1f, 0xd6"); - string _t1 = string_replace(bytes, _SLIT(""), int_str(nargs)); - return _t1; -} - -VV_LOCAL_SYMBOL string v__gen__c__arm32_bytes(int nargs) { - string bytes = _SLIT("0x0c, 0x90, 0x1f, 0xe5, 0x14, 0x0, 0x1f, 0xe5, 0x19, 0xff, 0x2f, 0xe1"); - string _t1 = string_replace(bytes, _SLIT(""), int_str(nargs)); - return _t1; -} - -VV_LOCAL_SYMBOL string v__gen__c__amd64_bytes(int nargs) { - - if (nargs == (1)) { - string _t1 = _SLIT("0x48, 0x8b, 0x3d, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t1; - } - else if (nargs == (2)) { - string _t2 = _SLIT("0x48, 0x8b, 0x35, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t2; - } - else if (nargs == (3)) { - string _t3 = _SLIT("0x48, 0x8b, 0x15, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t3; - } - else if (nargs == (4)) { - string _t4 = _SLIT("0x48, 0x8b, 0x0d, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t4; - } - else if (nargs == (5)) { - string _t5 = _SLIT("0x4C, 0x8b, 0x05, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t5; - } - else if (nargs == (6)) { - string _t6 = _SLIT("0x4C, 0x8b, 0x0d, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t6; - } - else { - strings__Builder sb = strings__new_builder(256); - string s = u8_hex(((((((u8)(nargs)) & 1)) + 1) << 3)); - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x48, 0x83, 0xec, 0x"), 0xfe10, {.d_s = s}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&sb, _SLIT("0xff, 0x35, 0xe6, 0xff, 0xff, 0xff, ")); - string rsp_offset = u8_hex(((u8)(0x18 + ((((u8)(nargs - 7)) >> 1) << 4)))); - for (int _t7 = 0; _t7 < nargs - 7; ++_t7) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0xff, 0xb4, 0x24, 0x"), 0xfe10, {.d_s = rsp_offset}}, {_SLIT(", 0x00, 0x00, 0x00, "), 0, { .d_c = 0 }}}))); - } - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0xff, 0x15, 0x"), 0xfe10, {.d_s = u8_hex(((u8)(256 - sb.len / 6 - 6 - 8)))}}, {_SLIT(", 0xff, 0xff, 0xff, "), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x48, 0x81, 0xc4, 0x"), 0xfe10, {.d_s = rsp_offset}}, {_SLIT(", 0x00, 0x00, 0x00, "), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&sb, _SLIT("0xc3")); - string _t8 = strings__Builder_str(&sb); - return _t8; - }; - return (string){.str=(byteptr)"", .is_lit=1}; -} - VV_LOCAL_SYMBOL string v__gen__c__c_closure_helpers(v__pref__Preferences* pref) { - if (pref->os == v__pref__OS__windows) { - v__gen__c__verror(_SLIT("closures are not implemented on Windows yet")); - VUNREACHABLE(); - } - if (!(pref->arch == v__pref__Arch__amd64 || pref->arch == v__pref__Arch__arm64 || pref->arch == v__pref__Arch__arm32)) { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("closures are not implemented on this architecture yet: "), 0xfe10, {.d_s = v__pref__Arch_str(pref->arch)}}, {_SLIT0, 0, { .d_c = 0 }}}))); - VUNREACHABLE(); - } strings__Builder builder = strings__new_builder(2048); if (pref->os != v__pref__OS__windows) { strings__Builder_writeln(&builder, _SLIT("#include ")); } - if (pref->arch == v__pref__Arch__amd64) { - strings__Builder_write_string(&builder, str_intp(33, _MOV((StrIntpData[]){{_SLIT("\nstatic unsigned char __closure_thunk[32]["), 0xfe07, {.d_i32 = v__gen__c__amd64_bytes(31).len / 6 + 2}}, {_SLIT("] = {\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(1)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(2)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(3)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(4)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(5)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(6)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(7)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(8)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(9)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(10)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(11)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(12)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(13)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(14)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(15)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(16)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(17)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(18)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(19)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(20)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(21)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(22)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(23)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(24)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(25)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(26)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(27)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(28)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(29)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(30)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(31)}}, {_SLIT(" },\n};\n"), 0, { .d_c = 0 }}}))); - } else if (pref->arch == v__pref__Arch__arm64) { - strings__Builder_write_string(&builder, str_intp(9, _MOV((StrIntpData[]){{_SLIT("\nstatic unsigned char __closure_thunk[8][12] = {\n {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(0)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(1)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(2)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(3)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(4)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(5)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(6)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(7)}}, {_SLIT("\n },\n};\n"), 0, { .d_c = 0 }}}))); - } else if (pref->arch == v__pref__Arch__arm32) { - strings__Builder_write_string(&builder, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nstatic unsigned char __closure_thunk[4][12] = {\n {\n "), 0xfe10, {.d_s = v__gen__c__arm32_bytes(0)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm32_bytes(1)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm32_bytes(2)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm32_bytes(3)}}, {_SLIT("\n },\n};\n"), 0, { .d_c = 0 }}}))); - } - strings__Builder_write_string(&builder, _SLIT("\nstatic void __closure_set_data(void *closure, void *data) {\n void **p = closure;\n p[-2] = data;\n}\n\nstatic void __closure_set_function(void *closure, void *f) {\n void **p = closure;\n p[-1] = f;\n}\n\nstatic inline int __closure_check_nargs(int nargs) {\n\011if (nargs > (int)_ARR_LEN(__closure_thunk)) {\n\011\011_v_panic(_SLIT(\"Closure too large. Reduce the number of parameters, or pass the parameters by reference.\"));\n\011\011VUNREACHABLE();\n\011}\n\011return nargs;\n}\n")); - if (pref->os != v__pref__OS__windows) { - strings__Builder_write_string(&builder, _SLIT("\nstatic void * __closure_create(void *f, int nargs, void *userdata) {\n long page_size = sysconf(_SC_PAGESIZE);\n int prot = PROT_READ | PROT_WRITE;\n int flags = MAP_ANONYMOUS | MAP_PRIVATE;\n char *p = mmap(0, page_size * 2, prot, flags, -1, 0);\n if (p == MAP_FAILED)\n return 0;\n void *closure = p + page_size;\n memcpy(closure, __closure_thunk[nargs - 1], sizeof(__closure_thunk[0]));\n mprotect(closure, page_size, PROT_READ | PROT_EXEC);\n __closure_set_function(closure, f);\n __closure_set_data(closure, userdata);\n return closure;\n}\n\nstatic void __closure_destroy(void *closure) {\n long page_size = sysconf(_SC_PAGESIZE);\n munmap((char *)closure - page_size, page_size * 2);\n}\n")); - } + strings__Builder_write_string(&builder, _SLIT("\n#ifdef _MSC_VER\n\011#define __RETURN_ADDRESS() _ReturnAddress()\n#elif defined(__TINYC__) && defined(_WIN32)\n\011#define __RETURN_ADDRESS() __builtin_return_address(0)\n#else\n\011#define __RETURN_ADDRESS() __builtin_extract_return_addr(__builtin_return_address(0))\n#endif\n\n#ifdef __V_amd64\n#ifdef _WIN32\nstatic const char __closure_thunk[] = {\n\0110x48, 0x89, 0x0d, 0xc1, 0xff, 0xff, 0xff, // mov qword ptr [rip - 63], rcx # <_orig_rcx>\n\0110x8f, 0x05, 0xc3, 0xff, 0xff, 0xff, // pop qword ptr [rip - 61] # <_orig_rbp>\n\0110xff, 0x15, 0xd5, 0xff, 0xff, 0xff, // call qword ptr [rip - 43] # \n\0110x48, 0x8b, 0x0d, 0xae, 0xff, 0xff, 0xff, // mov rcx, qword ptr [rip - 82] # <_orig_rcx>\n\0110xff, 0x15, 0xc0, 0xff, 0xff, 0xff, // call qword ptr [rip - 64] # \n\0110xff, 0x35, 0xaa, 0xff, 0xff, 0xff, // push qword ptr [rip - 86] # <_orig_rbp>\n\0110xc3 // ret\n};\n#else\nstatic const char __closure_thunk[] = {\n\0110x48, 0x89, 0x3d, 0xc1, 0xff, 0xff, 0xff, // mov qword ptr [rip - 63], rdi # <_orig_rdi>\n\0110x8f, 0x05, 0xc3, 0xff, 0xff, 0xff, // pop qword ptr [rip - 61] # <_orig_rbp>\n\0110xff, 0x15, 0xd5, 0xff, 0xff, 0xff, // call qword ptr [rip - 43] # \n\0110x48, 0x8b, 0x3d, 0xae, 0xff, 0xff, 0xff, // mov rdi, qword ptr [rip - 82] # <_orig_rdi>\n\0110xff, 0x15, 0xc0, 0xff, 0xff, 0xff, // call qword ptr [rip - 64] # \n\0110xff, 0x35, 0xaa, 0xff, 0xff, 0xff, // push qword ptr [rip - 86] # <_orig_rbp>\n\0110xc3 // ret\n};\n#endif\n#define __CLOSURE_WRAPPER_OFFSET 19\n#define __CLOSURE_UNWRAPPER_OFFSET 32\n#define __CLOSURE_WRAPPER_EXTRA_PARAM void* _t\n#define __CLOSURE_WRAPPER_EXTRA_PARAM_COMMA ,\n#elif defined(__V_x86)\nstatic char __closure_thunk[] = {\n 0xe8, 0x00, 0x00, 0x00, 0x00, // call 4\n 0x58, // pop eax\n 0x8f, 0x40, 0xe3, // pop dword ptr [eax - 29] # <_orig_rbp>\n 0xff, 0x50, 0xef, // call dword ptr [eax - 17] # \n 0xe8, 0x00, 0x00, 0x00, 0x00, // call 4\n 0x58, // pop eax\n 0xff, 0x50, 0xdf, // call dword ptr [eax - 33] # \n 0xe8, 0x00, 0x00, 0x00, 0x00, // call 4\n 0x58, // pop eax\n 0xff, 0x70, 0xce, // push dword ptr [eax - 50] # <_orig_rbp>\n 0xc3 // ret\n};\n\n#define __CLOSURE_WRAPPER_OFFSET 12\n#define __CLOSURE_UNWRAPPER_OFFSET 21\n#define __CLOSURE_WRAPPER_EXTRA_PARAM void* _t\n#define __CLOSURE_WRAPPER_EXTRA_PARAM_COMMA ,\n\n#elif defined(__V_arm64)\nstatic char __closure_thunk[] = {\n\0110x10, 0x00, 0x00, 0x10, // adr x16, start\n\0110x08, 0x82, 0x1c, 0xf8, // str x8, _orig_x8\n\0110x1e, 0x02, 0x1d, 0xf8, // str x30, _orig_x30\n\0110xf0, 0xfe, 0xff, 0x58, // ldr x16, wrapper\n\0110x00, 0x02, 0x3f, 0xd6, // blr x16\n\0110x70, 0xff, 0xff, 0x10, // adr x16, start\n\0110x08, 0x82, 0x5c, 0xf8, // ldr x8, _orig_x8\n\0110x30, 0xfe, 0xff, 0x58, // ldr x16, unwrapper\n\0110x00, 0x02, 0x3f, 0xd6, // blr x16\n\0110xf0, 0xfe, 0xff, 0x10, // adr x16, start\n\0110x1e, 0x02, 0x5d, 0xf8, // ldr x30, _orig_x30\n\0110xc0, 0x03, 0x5f, 0xd6 // ret\n};\n#define __CLOSURE_WRAPPER_OFFSET 20\n#define __CLOSURE_UNWRAPPER_OFFSET 36\n#define __CLOSURE_WRAPPER_EXTRA_PARAM\n#define __CLOSURE_WRAPPER_EXTRA_PARAM_COMMA\n#elif defined(__V_arm32)\nstatic char __closure_thunk[] = {\n 0x24, 0x00, 0x0f, 0xe5, // str r0, orig_r0\n 0x24, 0xe0, 0x0f, 0xe5, // str lr, orig_lr\n 0x1c, 0xc0, 0x1f, 0xe5, // ldr ip, wrapper\n 0x3c, 0xff, 0x2f, 0xe1, // blx ip\n 0x34, 0x00, 0x1f, 0xe5, // ldr r0, orig_r0\n 0x2c, 0xc0, 0x1f, 0xe5, // ldr ip, unwrapper\n 0x3c, 0xff, 0x2f, 0xe1, // blx ip\n 0x3c, 0xe0, 0x1f, 0xe5, // ldr lr, orig_lr\n 0x1e, 0xff, 0x2f, 0xe1 // bx lr\n};\n#define __CLOSURE_WRAPPER_OFFSET 16\n#define __CLOSURE_UNWRAPPER_OFFSET 28\n#define __CLOSURE_WRAPPER_EXTRA_PARAM void* _t\n#define __CLOSURE_WRAPPER_EXTRA_PARAM_COMMA ,\n#endif\n\nstatic int _V_PAGE_SIZE = 4096; // pre-initialized to the most common value, in case _vinit is not called (in a DLL, for example)\n\nstatic inline void __closure_set_data(void* closure, void* data) {\n void** p = closure;\n p[-1] = data;\n}\n\nstatic inline void __closure_set_function(void* closure, void* f) {\n void** p = closure;\n p[-2] = f;\n}\n\nstatic inline void __closure_set_wrapper(void* closure, void* f) {\n void** p = closure;\n p[-3] = f;\n}\n\nstatic inline void __closure_set_unwrapper(void* closure, void* f) {\n void** p = closure;\n p[-4] = f;\n}\n\nstatic inline void __closure_set_base_ptr(void* closure, void* bp) {\n void** p = closure;\n p[-5] = bp;\n}\n\nstatic void* __closure_create(void* fn, void* wrapper, void* unwrapper, void* data) {\n#ifdef _WIN32\n\011SYSTEM_INFO si;\n\011GetNativeSystemInfo(&si);\n\011uint32_t page_size = si.dwPageSize;\n\011char* p = VirtualAlloc(NULL, page_size * 2, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);\n\011if (p == NULL) return 0;\n#else\n\011uint32_t page_size = sysconf(_SC_PAGESIZE);\n\011int prot = PROT_READ | PROT_WRITE;\n\011int flags = MAP_ANONYMOUS | MAP_PRIVATE;\n\011char* p = mmap(0, page_size * 2, prot, flags, -1, 0);\n\011if (p == MAP_FAILED) return 0;\n#endif\n\n\011void* closure = p + page_size;\n\011memcpy(closure, __closure_thunk, sizeof(__closure_thunk));\n\n#ifdef _WIN32\n\011DWORD _tmp;\n\011VirtualProtect(closure, page_size, PAGE_EXECUTE_READ, &_tmp);\n#else\n\011mprotect(closure, page_size, PROT_READ | PROT_EXEC);\n#endif\n\n\011__closure_set_data(closure, data);\n\011__closure_set_function(closure, fn);\n\011__closure_set_wrapper(closure, wrapper);\n\011__closure_set_unwrapper(closure, unwrapper);\n\011__closure_set_base_ptr(closure, p);\n\011return closure;\n}\n")); string _t1 = strings__Builder_str(&builder); return _t1; } @@ -75038,7 +75277,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_vlines_reset(v__gen__c__Gen* g) { g->vlines_path = v__util__vlines_escape_path(g->pref->out_name_c, g->pref->ccompiler); v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("\n// Reset the file/line numbers")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n#line "), 0xfe07, {.d_i32 = lines_so_far}}, {_SLIT(" \""), 0xfe10, {.d_s = g->vlines_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n#line "), /*100 &int*/0xfe07, {.d_i32 = lines_so_far}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = g->vlines_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("")); } } @@ -75128,8 +75367,8 @@ void v__gen__c__Gen_gen_failing_error_propagation_for_test_fn(v__gen__c__Gen* g, string pafile = mr_5046.arg1; string pamod = mr_5046.arg2; string pafn = mr_5046.arg3; - string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_fn_error(test_runner._object, "), 0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), 0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + 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 }}})); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_fn_error(test_runner._object, "), /*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 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tlongjmp(g_jump_buffer, 1);")); } @@ -75139,8 +75378,8 @@ void v__gen__c__Gen_gen_failing_return_error_for_test_fn(v__gen__c__Gen* g, v__a string pafile = mr_5737.arg1; string pamod = mr_5737.arg2; string pafn = mr_5737.arg3; - string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_fn_error(test_runner._object, "), 0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), 0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + 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 }}})); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_fn_error(test_runner._object, "), /*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 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tlongjmp(g_jump_buffer, 1);")); } @@ -75163,17 +75402,17 @@ void v__gen__c__Gen_gen_c_main_for_tests(v__gen__c__Gen* g) { v__gen__c__Gen_writeln(g, _SLIT("\t_vinit(___argc, (voidptr)___argv);")); Array_string all_tfuncs = v__gen__c__Gen_get_all_test_function_names(g); all_tfuncs = v__gen__c__Gen_filter_only_matching_fn_names(g, all_tfuncs); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring v_test_file = "), 0xfe10, {.d_s = v__gen__c__ctoslit(g->pref->path)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring v_test_file = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(g->pref->path)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); if (g->pref->is_stats) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__BenchedTests bt = main__start_testing("), 0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(", v_test_file);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__BenchedTests bt = main__start_testing("), /*100 &int*/0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(", v_test_file);"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("\tstruct _main__TestRunner_interface_methods _vtrunner = main__TestRunner_name_table[test_runner._typ];")); v__gen__c__Gen_writeln(g, _SLIT("\tvoid * _vtobj = test_runner._object;")); v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("\tmain__VTestFileMetaInfo_free(test_runner.file_test_info);")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t*(test_runner.file_test_info) = main__vtest_new_filemetainfo(v_test_file, "), 0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t_vtrunner._method_start(_vtobj, "), 0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t*(test_runner.file_test_info) = main__vtest_new_filemetainfo(v_test_file, "), /*100 &int*/0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t_vtrunner._method_start(_vtobj, "), /*100 &int*/0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("")); for (int tnumber = 0; tnumber < all_tfuncs.len; ++tnumber) { string tname = ((string*)all_tfuncs.data)[tnumber]; @@ -75181,16 +75420,16 @@ void v__gen__c__Gen_gen_c_main_for_tests(v__gen__c__Gen* g) { v__ast__Fn testfn = (*(v__ast__Fn*)map_get(ADDR(map, g->table->fns), &(string[]){tname}, &(v__ast__Fn[]){ (v__ast__Fn){.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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,} })); int lnum = testfn.pos.line_nr + 1; v__gen__c__Gen_writeln(g, _SLIT("\tmain__VTestFnMetaInfo_free(test_runner.fn_test_info);")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcname_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = _SLIT(\""), 0xfe10, {.d_s = tcname}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcmod_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = _SLIT(\""), 0xfe10, {.d_s = testfn.mod}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcfile_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__ctoslit(testfn.file)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(test_runner.fn_test_info) = main__vtest_new_metainfo(tcname_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(", tcmod_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(", tcfile_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(", "), 0xfe07, {.d_i32 = lnum}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcname_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = tcname}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcmod_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = testfn.mod}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcfile_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(testfn.file)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(test_runner.fn_test_info) = main__vtest_new_metainfo(tcname_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(", tcmod_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(", tcfile_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = lnum}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t_vtrunner._method_fn_start(_vtobj);")); v__gen__c__Gen_writeln(g, _SLIT("\tif (!setjmp(g_jump_buffer)) {")); if (g->pref->is_stats) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tmain__BenchedTests_testing_step_start(&bt, tcname_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tmain__BenchedTests_testing_step_start(&bt, tcname_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = tcname}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = tcname}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t\t_vtrunner._method_fn_pass(_vtobj);")); v__gen__c__Gen_writeln(g, _SLIT("\t}else{")); v__gen__c__Gen_writeln(g, _SLIT("\t\t_vtrunner._method_fn_fail(_vtobj);")); @@ -75253,8 +75492,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_selector(v__gen__c__Gen* g, v__ast_ } else { v__gen__c__Gen_write(g, _SLIT(".")); } - if ((node.field_expr)._typ == 286 /* v.ast.SelectorExpr */) { - if (((*node.field_expr._v__ast__SelectorExpr).expr)._typ == 266 /* v.ast.Ident */) { + if ((node.field_expr)._typ == 287 /* v.ast.SelectorExpr */) { + if (((*node.field_expr._v__ast__SelectorExpr).expr)._typ == 267 /* v.ast.Ident */) { if (string__eq((*(*node.field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name, g->comptime_for_field_var) && string__eq((*node.field_expr._v__ast__SelectorExpr).field_name, _SLIT("name"))) { v__gen__c__Gen_write(g, v__gen__c__c_name(g->comptime_for_field_value.name)); return; @@ -75271,7 +75510,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com } if (string__eq(node->method_name, _SLIT("env"))) { string val = v__util__cescaped_path(os__getenv(node->args_var)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); return; } if (node->is_vweb) { @@ -75282,7 +75521,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com } for (int _t1 = 0; _t1 < node->vweb_tmpl.stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)node->vweb_tmpl.stmts.data)[_t1]; - if ((stmt)._typ == 183 /* v.ast.FnDecl */) { + if ((stmt)._typ == 184 /* v.ast.FnDecl */) { if (string_starts_with((*stmt._v__ast__FnDecl).name, _SLIT("main.vweb_tmpl"))) { if (is_html) { g->inside_vweb_tmpl = true; @@ -75294,7 +75533,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com for (int _t3 = 0; _t3 < _t2_len; ++_t3) { v__ast__Stmt it = ((v__ast__Stmt*) _t2_orig.data)[_t3]; - if ((it)._typ != 317 /* v.ast.Return */) { + if ((it)._typ != 318 /* v.ast.Return */) { array_push((array*)&_t2, &it); } } @@ -75306,13 +75545,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com } string fn_name = string__plus(string_replace(g->fn_decl->name, _SLIT("."), _SLIT("__")), int_str(node->pos.pos)); if (is_html) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("vweb__Context_html(&app->Context, _tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("); strings__Builder_free(&sb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("); string_free(&_tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("vweb__Context_html(&app->Context, _tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("); strings__Builder_free(&sb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("); string_free(&_tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, cur_line); if (g->inside_return) { v__gen__c__Gen_write(g, _SLIT("return ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } return; } @@ -75330,23 +75569,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com if (node->args.len > 0 && m.params.len - 1 >= node->args.len) { v__ast__CallArg arg = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)); v__ast__Param param = (*(v__ast__Param*)/*ee elem_sym */array_get(m.params, node->args.len)); - _t5 = (arg.expr)._typ == 266 /* v.ast.Ident */ && string__eq(v__ast__Table_type_to_str(g->table, arg.typ), _SLIT("[]string")) && !string__eq(v__ast__Table_type_to_str(g->table, param.typ), _SLIT("[]string")); + _t5 = (arg.expr)._typ == 267 /* v.ast.Ident */ && string__eq(v__ast__Table_type_to_str(g->table, arg.typ), _SLIT("[]string")) && !string__eq(v__ast__Table_type_to_str(g->table, param.typ), _SLIT("[]string")); } else { _t5 = false; } bool expand_strs = _t5; if (m.params.len - 1 != node->args.len && !expand_strs) { if (g->inside_call) { - v__gen__c__Gen_error(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = m.params.len - 1}}, {_SLIT(" arguments to method "), 0xfe10, {.d_s = sym->name}}, {_SLIT("."), 0xfe10, {.d_s = m.name}}, {_SLIT(", but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__gen__c__Gen_error(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = m.params.len - 1}}, {_SLIT(" arguments to method "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = m.name}}, {_SLIT(", but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); VUNREACHABLE(); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* skipping "), 0xfe10, {.d_s = sym->name}}, {_SLIT("."), 0xfe10, {.d_s = m.name}}, {_SLIT(" due to mismatched arguments list */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* skipping "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = m.name}}, {_SLIT(" due to mismatched arguments list */"), 0, { .d_c = 0 }}}))); } return; } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__util__no_dots(sym->name)}}, {_SLIT("_"), 0xfe10, {.d_s = g->comptime_for_method}}, {_SLIT("("), 0, { .d_c = 0 }}}))); - if ((node->left)._typ == 266 /* v.ast.Ident */) { - if (((*node->left._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__util__no_dots(sym->name)}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = g->comptime_for_method}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + if ((node->left)._typ == 267 /* v.ast.Ident */) { + if (((*node->left._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { if (v__ast__Type_is_ptr((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, 0)).typ) && !v__ast__Type_is_ptr((*((*node->left._v__ast__Ident).obj.typ)))) { v__gen__c__Gen_write(g, _SLIT("&")); } @@ -75357,7 +75596,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com v__gen__c__Gen_write(g, _SLIT(", ")); } for (int i = 1; i < m.params.len; ++i) { - if ((node->left)._typ == 266 /* v.ast.Ident */) { + if ((node->left)._typ == 267 /* v.ast.Ident */) { if (string__eq((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, i)).name, (*node->left._v__ast__Ident).name)) { continue; } @@ -75372,9 +75611,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com int idx = i - node->args.len; if (v__ast__Type_is_int((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, i)).typ) || v__ast__Type_idx((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, i)).typ) == _const_v__ast__bool_type_idx) { string type_name = v__ast__TypeSymbol_str((*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(g->table->type_symbols, ((int)((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, i)).typ))))); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string_"), 0xfe10, {.d_s = type_name}}, {_SLIT("(((string*)"), 0xfe10, {.d_s = v__ast__CallArg_str((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)))}}, {_SLIT(".data) ["), 0xfe07, {.d_i32 = idx}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string_"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("(((string*)"), /*115 &v.ast.CallArg*/0xfe10, {.d_s = v__ast__CallArg_str((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)))}}, {_SLIT(".data) ["), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("((string*)"), 0xfe10, {.d_s = v__ast__CallArg_str((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)))}}, {_SLIT(".data) ["), 0xfe07, {.d_i32 = idx}}, {_SLIT("] "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("((string*)"), /*115 &v.ast.CallArg*/0xfe10, {.d_s = v__ast__CallArg_str((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)))}}, {_SLIT(".data) ["), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("] "), 0, { .d_c = 0 }}}))); } if (i < m.params.len - 1) { v__gen__c__Gen_write(g, _SLIT(", ")); @@ -75402,9 +75641,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com if (j > 0) { v__gen__c__Gen_write(g, _SLIT(" else ")); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (string__eq("), 0xfe10, {.d_s = node->method_name}}, {_SLIT(", _SLIT(\""), 0xfe10, {.d_s = method.name}}, {_SLIT("\"))) "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (string__eq("), /*115 &string*/0xfe10, {.d_s = node->method_name}}, {_SLIT(", _SLIT(\""), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("\"))) "), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__util__no_dots(sym->name)}}, {_SLIT("_"), 0xfe10, {.d_s = method.name}}, {_SLIT("("), 0xfe10, {.d_s = amp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__util__no_dots(sym->name)}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = amp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node->left); v__gen__c__Gen_writeln(g, _SLIT(");")); j++; @@ -75417,9 +75656,9 @@ VV_LOCAL_SYMBOL Array_string v__gen__c__cgen_attrs(Array_v__ast__Attr attrs) { v__ast__Attr attr = ((v__ast__Attr*)attrs.data)[_t1]; string s = attr.name; if (attr.arg.len > 0) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(": "), 0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(": "), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = s}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))) })); } Array_string _t3 = res; return _t3; @@ -75428,10 +75667,10 @@ VV_LOCAL_SYMBOL Array_string v__gen__c__cgen_attrs(Array_v__ast__Attr attrs) { VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_at(v__gen__c__Gen* g, v__ast__AtExpr node) { if (node.kind == v__token__AtKind__vmod_file) { string val = v__gen__c__cescape_nonascii(v__util__smart_quote(node.val, false)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } else { string val = string_replace(node.val, _SLIT("\\"), _SLIT("\\\\")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } } @@ -75441,7 +75680,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_if(v__gen__c__Gen* g, v__ast__IfExp return; } if (!g->pref->output_cross_c) { - if (((*(v__ast__IfBranch*)/*ee elem_sym */array_get(node.branches, 0)).cond)._typ == 266 /* v.ast.Ident */) { + if (((*(v__ast__IfBranch*)/*ee elem_sym */array_get(node.branches, 0)).cond)._typ == 267 /* v.ast.Ident */) { Option_v__pref__OS _t1 = v__pref__os_from_string((*(*(v__ast__IfBranch*)/*ee elem_sym */array_get(node.branches, 0)).cond._v__ast__Ident).name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; @@ -75487,21 +75726,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_if(v__gen__c__Gen* g, v__ast__IfExp if (node.is_expr) { int len = branch.stmts.len; if (len > 0) { - v__ast__ExprStmt last = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(branch.stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(branch.stmts)))._typ, 306) /*expected idx: 306, name: v.ast.ExprStmt */ ; + v__ast__ExprStmt last = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(branch.stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(branch.stmts)))._typ, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ; if (len > 1) { string tmp = v__gen__c__Gen_new_tmp_var(g); string styp = v__gen__c__Gen_typ(g, last.typ); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("{")); v__gen__c__Gen_stmts(g, array_slice(branch.stmts, 0, len - 1)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_stmt(g, v__ast__ExprStmt_to_sumtype_v__ast__Stmt(&last)); v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = line}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = line}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_stmt(g, v__ast__ExprStmt_to_sumtype_v__ast__Stmt(&last)); } } @@ -75523,25 +75762,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_if(v__gen__c__Gen* g, v__ast__IfExp } VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__Expr cond, bool pkg_exist) { - if (cond._typ == 250 /* v.ast.BoolLiteral */) { + if (cond._typ == 251 /* v.ast.BoolLiteral */) { v__gen__c__Gen_expr(g, cond); bool _t1 = true; return _t1; } - else if (cond._typ == 281 /* v.ast.ParExpr */) { + else if (cond._typ == 282 /* v.ast.ParExpr */) { v__gen__c__Gen_write(g, _SLIT("(")); bool is_cond_true = v__gen__c__Gen_comptime_if_cond(g, (*cond._v__ast__ParExpr).expr, pkg_exist); v__gen__c__Gen_write(g, _SLIT(")")); bool _t2 = is_cond_true; return _t2; } - else if (cond._typ == 283 /* v.ast.PrefixExpr */) { + else if (cond._typ == 284 /* v.ast.PrefixExpr */) { v__gen__c__Gen_write(g, v__token__Kind_str((*cond._v__ast__PrefixExpr).op)); bool _t3 = v__gen__c__Gen_comptime_if_cond(g, (*cond._v__ast__PrefixExpr).right, pkg_exist); return _t3; } - else if (cond._typ == 282 /* v.ast.PostfixExpr */) { - Option_string _t4 = v__gen__c__Gen_comptime_if_to_ifdef(g, (/* as */ *(v__ast__Ident*)__as_cast(((*cond._v__ast__PostfixExpr).expr)._v__ast__Ident,((*cond._v__ast__PostfixExpr).expr)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ).name, true); + else if (cond._typ == 283 /* v.ast.PostfixExpr */) { + Option_string _t4 = v__gen__c__Gen_comptime_if_to_ifdef(g, (/* as */ *(v__ast__Ident*)__as_cast(((*cond._v__ast__PostfixExpr).expr)._v__ast__Ident,((*cond._v__ast__PostfixExpr).expr)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ).name, true); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; v__gen__c__verror(IError_name_table[err._typ]._method_msg(err._object)); @@ -75551,15 +75790,15 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ } string ifdef = (*(string*)_t4.data); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("defined("), 0xfe10, {.d_s = ifdef}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("defined("), /*115 &string*/0xfe10, {.d_s = ifdef}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); bool _t6 = true; return _t6; } - else if (cond._typ == 270 /* v.ast.InfixExpr */) { + else if (cond._typ == 271 /* v.ast.InfixExpr */) { if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__and) || (*cond._v__ast__InfixExpr).op == (v__token__Kind__logical_or)) { bool l = v__gen__c__Gen_comptime_if_cond(g, (*cond._v__ast__InfixExpr).left, pkg_exist); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str((*cond._v__ast__InfixExpr).op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str((*cond._v__ast__InfixExpr).op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); bool r = v__gen__c__Gen_comptime_if_cond(g, (*cond._v__ast__InfixExpr).right, pkg_exist); bool _t7 = ((*cond._v__ast__InfixExpr).op == v__token__Kind__and ? (l && r) : (l || r)); return _t7; @@ -75567,7 +75806,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ else if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__key_is) || (*cond._v__ast__InfixExpr).op == (v__token__Kind__not_is)) { v__ast__Expr left = (*cond._v__ast__InfixExpr).left; string name = _SLIT(""); - if ((left)._typ == 292 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 259 /* v.ast.ComptimeType */) { + if ((left)._typ == 293 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 260 /* v.ast.ComptimeType */) { v__ast__Type checked_type = v__gen__c__Gen_unwrap_generic(g, (*left._v__ast__TypeNode).typ); bool is_true = v__ast__Table_is_comptime_type(g->table, checked_type, (*(*cond._v__ast__InfixExpr).right._v__ast__ComptimeType)); if ((*cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { @@ -75589,10 +75828,10 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ } } v__ast__Type exp_type = ((v__ast__Type)(0)); - v__ast__Type got_type = (/* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).right)._typ, 292) /*expected idx: 292, name: v.ast.TypeNode */ ).typ; - if ((left)._typ == 292 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 292 /* v.ast.TypeNode */ && v__ast__Table_sym(g->table, got_type)->kind == v__ast__Kind__interface_) { + v__ast__Type got_type = (/* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).right)._typ, 293) /*expected idx: 293, name: v.ast.TypeNode */ ).typ; + if ((left)._typ == 293 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 293 /* v.ast.TypeNode */ && v__ast__Table_sym(g->table, got_type)->kind == v__ast__Kind__interface_) { v__ast__TypeSymbol* interface_sym = v__ast__Table_sym(g->table, got_type); - if ((interface_sym->info)._typ == 434 /* v.ast.Interface */) { + if ((interface_sym->info)._typ == 435 /* v.ast.Interface */) { v__ast__Type checked_type = v__gen__c__Gen_unwrap_generic(g, (*left._v__ast__TypeNode).typ); bool is_true = v__ast__Table_does_type_implement_interface(g->table, checked_type, got_type); if ((*cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { @@ -75613,22 +75852,22 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ return _t11; } } - } else if ((left)._typ == 286 /* v.ast.SelectorExpr */) { + } else if ((left)._typ == 287 /* v.ast.SelectorExpr */) { if ((*left._v__ast__SelectorExpr).gkind_field == v__ast__GenericKindField__typ) { exp_type = v__gen__c__Gen_unwrap_generic(g, (*left._v__ast__SelectorExpr).name_type); } else { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*left._v__ast__SelectorExpr).expr)}}, {_SLIT("."), 0xfe10, {.d_s = (*left._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*left._v__ast__SelectorExpr).expr)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*left._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); exp_type = (*(v__ast__Type*)map_get(ADDR(map, g->comptime_var_type_map), &(string[]){name}, &(v__ast__Type[]){ 0 })); } - } else if ((left)._typ == 292 /* v.ast.TypeNode */) { + } else if ((left)._typ == 293 /* v.ast.TypeNode */) { exp_type = v__gen__c__Gen_unwrap_generic(g, (*left._v__ast__TypeNode).typ); } if ((*cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = v__ast__Type_idx(exp_type)}}, {_SLIT(" == "), 0xfe07, {.d_i32 = v__ast__Type_idx(got_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(exp_type)}}, {_SLIT(" == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(got_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); bool _t12 = v__ast__Type_alias_eq(exp_type, got_type); return _t12; } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = v__ast__Type_idx(exp_type)}}, {_SLIT(" != "), 0xfe07, {.d_i32 = v__ast__Type_idx(got_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(exp_type)}}, {_SLIT(" != "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(got_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); bool _t13 = !v__ast__Type_alias_eq(exp_type, got_type); return _t13; } @@ -75643,7 +75882,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ return _t15; }; } - else if (cond._typ == 266 /* v.ast.Ident */) { + else if (cond._typ == 267 /* v.ast.Ident */) { Option_string _t16 = v__gen__c__Gen_comptime_if_to_ifdef(g, (*cond._v__ast__Ident).name, false); if (_t16.state != 0) { /*or block*/ IError err = _t16.err; @@ -75651,12 +75890,12 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ } string ifdef = (*(string*)_t16.data); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("defined("), 0xfe10, {.d_s = ifdef}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("defined("), /*115 &string*/0xfe10, {.d_s = ifdef}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); bool _t17 = true; return _t17; } - else if (cond._typ == 257 /* v.ast.ComptimeCall */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = pkg_exist ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + else if (cond._typ == 258 /* v.ast.ComptimeCall */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &bool*/0xfe10, {.d_s = pkg_exist ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); bool _t18 = true; return _t18; } @@ -75672,7 +75911,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__ComptimeFor node) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.typ)); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("/* $for "), 0xfe10, {.d_s = node.val_var}}, {_SLIT(" in "), 0xfe10, {.d_s = sym->name}}, {_SLIT("("), 0xfe10, {.d_s = v__ast__ComptimeForKind_str(node.kind)}}, {_SLIT(") */ {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("/* $for "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" in "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__ast__ComptimeForKind_str(node.kind)}}, {_SLIT(") */ {"), 0, { .d_c = 0 }}}))); g->indent++; int i = 0; if (node.kind == v__ast__ComptimeForKind__methods) { @@ -75702,34 +75941,34 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp Array_v__ast__Fn methods_with_attrs =_t3; _PUSH_MANY(&methods, (methods_with_attrs), _t5, Array_v__ast__Fn); if (methods.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("FunctionData "), 0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("FunctionData "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); } for (int _t6 = 0; _t6 < methods.len; ++_t6) { v__ast__Fn method = ((v__ast__Fn*)methods.data)[_t6]; g->comptime_for_method = method.name; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* method "), 0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = method.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* method "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); if (method.attrs.len == 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = __new_array_with_default(0, 0, sizeof(string), 0);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = __new_array_with_default(0, 0, sizeof(string), 0);"), 0, { .d_c = 0 }}}))); } else { Array_string attrs = v__gen__c__cgen_attrs(method.attrs); - v__gen__c__Gen_writeln(g, string__plus(string__plus( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = new_array_from_c_array("), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", sizeof(string), _MOV((string["), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}})), Array_string_join(attrs, _SLIT(", "))), _SLIT("}));\n"))); + v__gen__c__Gen_writeln(g, string__plus(string__plus( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", sizeof(string), _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}})), Array_string_join(attrs, _SLIT(", "))), _SLIT("}));\n"))); } if (method.params.len < 2) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".args = __new_array_with_default(0, 0, sizeof(MethodArgs), 0);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".args = __new_array_with_default(0, 0, sizeof(MethodArgs), 0);"), 0, { .d_c = 0 }}}))); } else { int len = method.params.len - 1; - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".args = new_array_from_c_array("), 0xfe07, {.d_i32 = len}}, {_SLIT(", "), 0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(MethodArgs), _MOV((MethodArgs["), 0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".args = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(MethodArgs), _MOV((MethodArgs["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); Array_v__ast__Param _t8; Array_v__ast__Param _t7 = (_t8 = method.params, array_slice(_t8, 1, _t8.len)); for (int j = 0; j < _t7.len; ++j) { v__ast__Param arg = ((v__ast__Param*)_t7.data)[j]; int typ = v__ast__Type_idx(arg.typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("{"), 0xfe10, {.d_s = int_str(typ)}}, {_SLIT(", _SLIT(\""), 0xfe10, {.d_s = arg.name}}, {_SLIT("\")}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("{"), /*115 &string*/0xfe10, {.d_s = int_str(typ)}}, {_SLIT(", _SLIT(\""), /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT("\")}"), 0, { .d_c = 0 }}}))); if (j < len - 1) { v__gen__c__Gen_write(g, _SLIT(", ")); } - map_set(&g->comptime_var_type_map, &(string[]){ str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.val_var}}, {_SLIT(".args["), 0xfe07, {.d_i32 = j}}, {_SLIT("].typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { typ }); + map_set(&g->comptime_var_type_map, &(string[]){ str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".args["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("].typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { typ }); } v__gen__c__Gen_writeln(g, _SLIT("}));\n")); } @@ -75739,18 +75978,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp for (int j = 0; j < _t9.len; ++j) { v__ast__Param arg = ((v__ast__Param*)_t9.data)[j]; v__ast__Type typ = v__ast__Type_set_nr_muls(arg.typ, 0); - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (j < method.params.len - 2) { sig = /*f*/string__plus(sig, _SLIT("_")); } } - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = v__ast__Type_str(method.return_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(method.return_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); int styp = v__ast__Table_find_type_idx(g->table, sig); int ret_typ = v__ast__Type_idx(method.return_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ = "), 0xfe07, {.d_i32 = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".return_type = "), 0xfe07, {.d_i32 = ret_typ}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.val_var}}, {_SLIT(".return_type"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { ret_typ }); - map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { styp }); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ = "), /*100 &int*/0xfe07, {.d_i32 = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".return_type = "), /*100 &int*/0xfe07, {.d_i32 = ret_typ}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".return_type"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { ret_typ }); + map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { styp }); v__gen__c__Gen_stmts(g, node.stmts); i++; v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -75778,9 +76017,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp } } else if (node.kind == v__ast__ComptimeForKind__fields) { if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (sym_info.fields.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tFieldData "), 0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tFieldData "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); } g->inside_comptime_for_field = true; for (int _t17 = 0; _t17 < sym_info.fields.len; ++_t17) { @@ -75788,20 +76027,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp g->comptime_for_field_var = node.val_var; g->comptime_for_field_value = field; g->comptime_for_field_type = field.typ; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* field "), 0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = field.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* field "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); if (field.attrs.len == 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = __new_array_with_default(0, 0, sizeof(string), 0);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = __new_array_with_default(0, 0, sizeof(string), 0);"), 0, { .d_c = 0 }}}))); } else { Array_string attrs = v__gen__c__cgen_attrs(field.attrs); - v__gen__c__Gen_writeln(g, string__plus(string__plus( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = new_array_from_c_array("), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", sizeof(string), _MOV((string["), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}})), Array_string_join(attrs, _SLIT(", "))), _SLIT("}));\n"))); + v__gen__c__Gen_writeln(g, string__plus(string__plus( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", sizeof(string), _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}})), Array_string_join(attrs, _SLIT(", "))), _SLIT("}));\n"))); } v__ast__Type styp = field.typ; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ = "), 0xfe07, {.d_i32 = v__ast__Type_idx(styp)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_pub = "), 0xfe10, {.d_s = field.is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_mut = "), 0xfe10, {.d_s = field.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_shared = "), 0xfe10, {.d_s = v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__shared_f) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { styp }); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ = "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(styp)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_pub = "), /*115 &bool*/0xfe10, {.d_s = field.is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_mut = "), /*115 &bool*/0xfe10, {.d_s = field.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_shared = "), /*115 &bool*/0xfe10, {.d_s = v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__shared_f) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { styp }); v__gen__c__Gen_stmts(g, node.stmts); i++; v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -75811,17 +76050,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp map_delete(&g->comptime_var_type_map, &(string[]){node.val_var}); } } else if (node.kind == v__ast__ComptimeForKind__attributes) { - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).attrs.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tStructAttribute "), 0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tStructAttribute "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); } for (int _t18 = 0; _t18 < (*sym->info._v__ast__Struct).attrs.len; ++_t18) { v__ast__Attr attr = ((v__ast__Attr*)(*sym->info._v__ast__Struct).attrs.data)[_t18]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* attribute "), 0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = attr.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".has_arg = "), 0xfe10, {.d_s = attr.has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".arg = _SLIT(\""), 0xfe10, {.d_s = attr.arg}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".kind = AttributeKind__"), 0xfe10, {.d_s = v__ast__AttrKind_str(attr.kind)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* attribute "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".has_arg = "), /*115 &bool*/0xfe10, {.d_s = attr.has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".arg = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".kind = AttributeKind__"), /*115 &v.ast.AttrKind*/0xfe10, {.d_s = v__ast__AttrKind_str(attr.kind)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_stmts(g, node.stmts); v__gen__c__Gen_writeln(g, _SLIT("}")); } @@ -76023,33 +76262,43 @@ VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen opt_ok(&(string[]) { _SLIT("__V_arm64") }, (Option*)(&_t38), sizeof(string)); return _t38; } - else if (string__eq(name, _SLIT("x64"))) { + else if (string__eq(name, _SLIT("arm32"))) { Option_string _t39; - opt_ok(&(string[]) { _SLIT("TARGET_IS_64BIT") }, (Option*)(&_t39), sizeof(string)); + opt_ok(&(string[]) { _SLIT("__V_arm32") }, (Option*)(&_t39), sizeof(string)); return _t39; } - else if (string__eq(name, _SLIT("x32"))) { + else if (string__eq(name, _SLIT("i386"))) { Option_string _t40; - opt_ok(&(string[]) { _SLIT("TARGET_IS_32BIT") }, (Option*)(&_t40), sizeof(string)); + opt_ok(&(string[]) { _SLIT("__V_x86") }, (Option*)(&_t40), sizeof(string)); return _t40; } - else if (string__eq(name, _SLIT("little_endian"))) { + else if (string__eq(name, _SLIT("x64"))) { Option_string _t41; - opt_ok(&(string[]) { _SLIT("TARGET_ORDER_IS_LITTLE") }, (Option*)(&_t41), sizeof(string)); + opt_ok(&(string[]) { _SLIT("TARGET_IS_64BIT") }, (Option*)(&_t41), sizeof(string)); return _t41; } - else if (string__eq(name, _SLIT("big_endian"))) { + else if (string__eq(name, _SLIT("x32"))) { Option_string _t42; - opt_ok(&(string[]) { _SLIT("TARGET_ORDER_IS_BIG") }, (Option*)(&_t42), sizeof(string)); + opt_ok(&(string[]) { _SLIT("TARGET_IS_32BIT") }, (Option*)(&_t42), sizeof(string)); return _t42; } + else if (string__eq(name, _SLIT("little_endian"))) { + Option_string _t43; + opt_ok(&(string[]) { _SLIT("TARGET_ORDER_IS_LITTLE") }, (Option*)(&_t43), sizeof(string)); + return _t43; + } + else if (string__eq(name, _SLIT("big_endian"))) { + Option_string _t44; + opt_ok(&(string[]) { _SLIT("TARGET_ORDER_IS_BIG") }, (Option*)(&_t44), sizeof(string)); + return _t44; + } else { if (is_comptime_optional || (g->pref->compile_defines_all.len > 0 && Array_string_contains(g->pref->compile_defines_all, name))) { - Option_string _t43; - opt_ok(&(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("CUSTOM_DEFINE_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t43), sizeof(string)); - return _t43; + Option_string _t45; + opt_ok(&(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("CUSTOM_DEFINE_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t45), sizeof(string)); + return _t45; } - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("bad os ifdef name \""), 0xfe10, {.d_s = name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("bad os ifdef name \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } @@ -76068,7 +76317,7 @@ VV_LOCAL_SYMBOL v__ast__CTempVar v__gen__c__Gen_new_ctemp_var_then_gen(v__gen__c VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_ctemp_var(v__gen__c__Gen* g, v__ast__CTempVar tvar) { string styp = v__gen__c__Gen_typ(g, tvar.typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tvar.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tvar.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, tvar.orig); v__gen__c__Gen_writeln(g, _SLIT(";")); } @@ -76081,8 +76330,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_dump_expr(v__gen__c__Gen* g, v__ast__DumpExp v__gen__c__Gen_expr(g, node.expr); return; } - string dump_fn_name = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_dump_expr_"), 0xfe10, {.d_s = node.cname}}, {_SLIT0, 0, { .d_c = 0 }}})), ((v__ast__Type_is_ptr(node.expr_type) ? (_SLIT("_ptr")) : (_SLIT(""))))); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = dump_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = v__gen__c__ctoslit(fpath)}}, {_SLIT(", "), 0xfe07, {.d_i32 = line}}, {_SLIT(", "), 0xfe10, {.d_s = sexpr}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + string dump_fn_name = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_dump_expr_"), /*115 &string*/0xfe10, {.d_s = node.cname}}, {_SLIT0, 0, { .d_c = 0 }}})), ((v__ast__Type_is_ptr(node.expr_type) ? (_SLIT("_ptr")) : (_SLIT(""))))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dump_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(fpath)}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = line}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = sexpr}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(" )")); } @@ -76111,27 +76360,27 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_dump_expr_definitions(v__gen__c__Gen* g) { string deref = mr_830.arg0; string to_string_fn_name = v__gen__c__Gen_get_str_fn(g, dump_type); string ptr_asterisk = (is_ptr ? (_SLIT("*")) : (_SLIT(""))); - string str_dumparg_type = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cname}}, {_SLIT0, 0xfe10, {.d_s = ptr_asterisk}}, {_SLIT0, 0, { .d_c = 0 }}})); + string str_dumparg_type = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_asterisk}}, {_SLIT0, 0, { .d_c = 0 }}})); if (dump_sym->kind == v__ast__Kind__function) { - v__ast__FnType fninfo = /* as */ *(v__ast__FnType*)__as_cast((dump_sym->info)._v__ast__FnType,(dump_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; - str_dumparg_type = str_intp(2, _MOV((StrIntpData[]){{_SLIT("DumpFNType_"), 0xfe10, {.d_s = cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + v__ast__FnType fninfo = /* as */ *(v__ast__FnType*)__as_cast((dump_sym->info)._v__ast__FnType,(dump_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; + str_dumparg_type = str_intp(2, _MOV((StrIntpData[]){{_SLIT("DumpFNType_"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, 0, { .d_c = 0 }}})); int tdef_pos = g->out.len; v__gen__c__Gen_write_fn_ptr_decl(g, &fninfo, str_dumparg_type); string str_tdef = strings__Builder_after(&g->out, tdef_pos); strings__Builder_go_back(&g->out, str_tdef.len); - map_set(&dump_typedefs, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = str_tdef}}, {_SLIT(";"), 0, { .d_c = 0 }}}))}, &(bool[]) { true }); + map_set(&dump_typedefs, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = str_tdef}}, {_SLIT(";"), 0, { .d_c = 0 }}}))}, &(bool[]) { true }); } - string dump_fn_name = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_dump_expr_"), 0xfe10, {.d_s = cname}}, {_SLIT0, 0, { .d_c = 0 }}})), ((is_ptr ? (_SLIT("_ptr")) : (_SLIT(""))))); - strings__Builder_writeln(&dump_fn_defs, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" "), 0xfe10, {.d_s = dump_fn_name}}, {_SLIT("(string fpath, int line, string sexpr, "), 0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" dump_arg);"), 0, { .d_c = 0 }}}))); - if (v__gen__c__Gen_writeln_fn_header(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" "), 0xfe10, {.d_s = dump_fn_name}}, {_SLIT("(string fpath, int line, string sexpr, "), 0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" dump_arg)"), 0, { .d_c = 0 }}})), (voidptr)&/*qq*/dump_fns)) { + string dump_fn_name = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_dump_expr_"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, 0, { .d_c = 0 }}})), ((is_ptr ? (_SLIT("_ptr")) : (_SLIT(""))))); + strings__Builder_writeln(&dump_fn_defs, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dump_fn_name}}, {_SLIT("(string fpath, int line, string sexpr, "), /*115 &string*/0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" dump_arg);"), 0, { .d_c = 0 }}}))); + if (v__gen__c__Gen_writeln_fn_header(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dump_fn_name}}, {_SLIT("(string fpath, int line, string sexpr, "), /*115 &string*/0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" dump_arg)"), 0, { .d_c = 0 }}})), (voidptr)&/*qq*/dump_fns)) { continue; } v__util__Surrounder surrounder = v__util__new_surrounder(3); v__util__Surrounder_add(&surrounder, _SLIT("\tstring sline = int_str(line);"), _SLIT("\tstring_free(&sline);")); if (dump_sym->kind == v__ast__Kind__function) { - v__util__Surrounder_add(&surrounder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring value = "), 0xfe10, {.d_s = to_string_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}})), _SLIT("\tstring_free(&value);")); + v__util__Surrounder_add(&surrounder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring value = "), /*115 &string*/0xfe10, {.d_s = to_string_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}})), _SLIT("\tstring_free(&value);")); } else { - v__util__Surrounder_add(&surrounder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring value = "), 0xfe10, {.d_s = to_string_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("dump_arg);"), 0, { .d_c = 0 }}})), _SLIT("\tstring_free(&value);")); + v__util__Surrounder_add(&surrounder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring value = "), /*115 &string*/0xfe10, {.d_s = to_string_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("dump_arg);"), 0, { .d_c = 0 }}})), _SLIT("\tstring_free(&value);")); } v__util__Surrounder_add(&surrounder, _SLIT("\n\011strings__Builder sb = strings__new_builder(256);\n"), _SLIT("\n\011string res;\n\011res = strings__Builder_str(&sb);\n\011eprint(res);\n\011string_free(&res);\n\011strings__Builder_free(&sb);\n")); v__util__Surrounder_builder_write_befores(&surrounder, (voidptr)&/*qq*/dump_fns); @@ -76172,11 +76421,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_dump_expr_definitions(v__gen__c__Gen* g) { VV_LOCAL_SYMBOL bool v__gen__c__Gen_writeln_fn_header(v__gen__c__Gen* g, string s, strings__Builder* sb) { if (g->pref->build_mode == v__pref__BuildMode__build_module) { - strings__Builder_writeln(sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = s}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); bool _t1 = true; return _t1; } - strings__Builder_writeln(sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = s}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); bool _t2 = false; return _t2; } @@ -76193,14 +76442,14 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_embed_file_is_prod_mode(v__gen__c__Gen* g) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__ast__ComptimeCall* node) { #if defined(CUSTOM_DEFINE_trace_embed_file) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> gen_embed_file_init "), 0xfe10, {.d_s = node->embed_file.apath}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> gen_embed_file_init "), /*115 &string*/0xfe10, {.d_s = node->embed_file.apath}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif if (v__gen__c__Gen_embed_file_is_prod_mode(g)) { Option_Array_u8 _t1 = os__read_bytes(node->embed_file.apath); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to read file: \""), 0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to read file: \""), /*115 &string*/0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -76224,15 +76473,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as } string cache_path = os__join_path(cache_dir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){cache_key}))); string vexe = v__pref__vexe_path(); - string compress_cmd = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" compress "), 0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(node->embed_file.apath)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(cache_path)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string compress_cmd = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" compress "), /*115 &string*/0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(node->embed_file.apath)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(cache_path)}}, {_SLIT0, 0, { .d_c = 0 }}})); #if defined(CUSTOM_DEFINE_trace_embed_file) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> gen_embed_file_init, compress_cmd: "), 0xfe10, {.d_s = compress_cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> gen_embed_file_init, compress_cmd: "), /*115 &string*/0xfe10, {.d_s = compress_cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif os__Result result = os__execute(compress_cmd); if (result.exit_code != 0) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("unable to compress file \""), 0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT("\": "), 0xfe10, {.d_s = result.output}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("unable to compress file \""), /*115 &string*/0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT("\": "), /*115 &string*/0xfe10, {.d_s = result.output}}, {_SLIT0, 0, { .d_c = 0 }}}))); node->embed_file.bytes = file_bytes; } else { Option_Array_u8 _t3 = os__read_bytes(cache_path); @@ -76261,11 +76510,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as node->embed_file.len = file_bytes.len; } u64 ef_idx = v__ast__EmbeddedFile_hash(node->embed_file); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_embed_file_metadata( "), 0xfe08, {.d_u64 = ef_idx}}, {_SLIT("U )"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_embed_file_metadata( "), /*117 &u64*/0xfe08, {.d_u64 = ef_idx}}, {_SLIT("U )"), 0, { .d_c = 0 }}}))); array_push((array*)&g->file->embedded_files, _MOV((v__ast__EmbeddedFile[]){ node->embed_file })); #if defined(CUSTOM_DEFINE_trace_embed_file) { - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> gen_embed_file_init => _v_embed_file_metadata("), 0x32fe08, {.d_u64 = ef_idx}}, {_SLIT(") | "), 0x64fe10, {.d_s = node->embed_file.apath}}, {_SLIT(" | compression: "), 0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(" | len: "), 0xfe07, {.d_i32 = node->embed_file.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> gen_embed_file_init => _v_embed_file_metadata("), /*117 &u64*/0x32fe08, {.d_u64 = ef_idx}}, {_SLIT(") | "), /*115 &string*/0x64fe10, {.d_s = node->embed_file.apath}}, {_SLIT(" | compression: "), /*115 &string*/0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(" | len: "), /*100 &int*/0xfe07, {.d_i32 = node->embed_file.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif } @@ -76278,20 +76527,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_metadata(v__gen__c__Gen* g) { for (int _t1 = 0; _t1 < g->embedded_files.len; ++_t1) { v__ast__EmbeddedFile emfile = ((v__ast__EmbeddedFile*)g->embedded_files.data)[_t1]; u64 ef_idx = v__ast__EmbeddedFile_hash(emfile); - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe08, {.d_u64 = ef_idx}}, {_SLIT("U: {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.path = "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*117 &u64*/0xfe08, {.d_u64 = ef_idx}}, {_SLIT("U: {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.path = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); if (v__gen__c__Gen_embed_file_is_prod_mode(g)) { - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.apath = "), 0xfe10, {.d_s = v__gen__c__ctoslit(_SLIT(""))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.apath = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(_SLIT(""))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.apath = "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.apath)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.apath = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.apath)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } if (v__gen__c__Gen_embed_file_is_prod_mode(g)) { if (emfile.is_compressed) { - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.compression_type = "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.compressed = v__embed_file__find_index_entry_by_path((voidptr)_v_embed_file_index, "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(", "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(")->data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.compression_type = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.compressed = v__embed_file__find_index_entry_by_path((voidptr)_v_embed_file_index, "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(")->data;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tres.uncompressed = NULL;")); } else { - strings__Builder_writeln(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.uncompressed = v__embed_file__find_index_entry_by_path((voidptr)_v_embed_file_index, "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(", "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(")->data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.uncompressed = v__embed_file__find_index_entry_by_path((voidptr)_v_embed_file_index, "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(")->data;"), 0, { .d_c = 0 }}}))); } } else { strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tres.uncompressed = NULL;")); @@ -76299,16 +76548,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_metadata(v__gen__c__Gen* g) { strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tres.free_compressed = 0;")); strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tres.free_uncompressed = 0;")); if (v__gen__c__Gen_embed_file_is_prod_mode(g)) { - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.len = "), 0xfe07, {.d_i32 = emfile.len}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.len = "), /*100 &int*/0xfe07, {.d_i32 = emfile.len}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { u64 file_size = os__file_size(emfile.apath); if (file_size > 5242880U) { eprintln(_SLIT("Warning: embedding of files >= ~5MB is currently not supported")); } - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.len = "), 0xfe08, {.d_u64 = file_size}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.len = "), /*117 &u64*/0xfe08, {.d_u64 = file_size}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tbreak;")); - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t} // case "), 0xfe08, {.d_u64 = ef_idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t} // case "), /*117 &u64*/0xfe08, {.d_u64 = ef_idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->embedded_data, _SLIT("\t\tdefault: _v_panic(_SLIT(\"unknown embed file\"));")); strings__Builder_writeln(&g->embedded_data, _SLIT("\t} // switch")); @@ -76319,13 +76568,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_metadata(v__gen__c__Gen* g) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_data(v__gen__c__Gen* g) { for (int i = 0; i < g->embedded_files.len; ++i) { v__ast__EmbeddedFile emfile = ((v__ast__EmbeddedFile*)g->embedded_files.data)[i]; - strings__Builder_write_string(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static const unsigned char _v_embed_blob_"), 0xfe07, {.d_i32 = i}}, {_SLIT("["), 0xfe07, {.d_i32 = emfile.bytes.len}}, {_SLIT("] = {\n "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static const unsigned char _v_embed_blob_"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = emfile.bytes.len}}, {_SLIT("] = {\n "), 0, { .d_c = 0 }}}))); for (int j = 0; j < emfile.bytes.len; j++) { string b = u8_hex((*(u8*)/*ee elem_sym */array_get(emfile.bytes, j))); if (j < emfile.bytes.len - 1) { - strings__Builder_write_string(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x"), 0xfe10, {.d_s = b}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x"), /*115 &string*/0xfe10, {.d_s = b}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x"), 0xfe10, {.d_s = b}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x"), /*115 &string*/0xfe10, {.d_s = b}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (0 == ((j + 1) % 16)) { strings__Builder_write_string(&g->embedded_data, _SLIT("\n ")); @@ -76337,7 +76586,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_data(v__gen__c__Gen* g) { strings__Builder_writeln(&g->embedded_data, _SLIT("const v__embed_file__EmbedFileIndexEntry _v_embed_file_index[] = {")); for (int i = 0; i < g->embedded_files.len; ++i) { v__ast__EmbeddedFile emfile = ((v__ast__EmbeddedFile*)g->embedded_files.data)[i]; - strings__Builder_writeln(&g->embedded_data, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\t{"), 0xfe07, {.d_i32 = i}}, {_SLIT(", { .str=(byteptr)(\""), 0xfe10, {.d_s = v__gen__c__cestring(emfile.rpath)}}, {_SLIT("\"), .len="), 0xfe07, {.d_i32 = emfile.rpath.len}}, {_SLIT(", .is_lit=1 }, { .str=(byteptr)(\""), 0xfe10, {.d_s = v__gen__c__cestring(emfile.compression_type)}}, {_SLIT("\"), .len="), 0xfe07, {.d_i32 = emfile.compression_type.len}}, {_SLIT(", .is_lit=1 }, _v_embed_blob_"), 0xfe07, {.d_i32 = i}}, {_SLIT("},"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\t{"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", { .str=(byteptr)(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__cestring(emfile.rpath)}}, {_SLIT("\"), .len="), /*100 &int*/0xfe07, {.d_i32 = emfile.rpath.len}}, {_SLIT(", .is_lit=1 }, { .str=(byteptr)(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__cestring(emfile.compression_type)}}, {_SLIT("\"), .len="), /*100 &int*/0xfe07, {.d_i32 = emfile.compression_type.len}}, {_SLIT(", .is_lit=1 }, _v_embed_blob_"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("},"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->embedded_data, _SLIT("\t{-1, { .str=(byteptr)(\"\"), .len=0, .is_lit=1 }, { .str=(byteptr)(\"\"), .len=0, .is_lit=1 }, NULL}")); strings__Builder_writeln(&g->embedded_data, _SLIT("};")); @@ -76350,20 +76599,20 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_is_used_by_main(v__gen__c__Gen* g, v__ast__F is_used_by_main = (*(bool*)map_get(ADDR(map, g->table->used_fns), &(string[]){fkey}, &(bool[]){ 0 })); #if defined(CUSTOM_DEFINE_trace_skip_unused_fns) { - println( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> is_used_by_main: "), 0xfe10, {.d_s = is_used_by_main ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | node.name: "), 0xfe10, {.d_s = node.name}}, {_SLIT(" | fkey: "), 0xfe10, {.d_s = fkey}}, {_SLIT(" | node.is_method: "), 0xfe10, {.d_s = node.is_method ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> is_used_by_main: "), /*115 &bool*/0xfe10, {.d_s = is_used_by_main ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | node.name: "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT(" | fkey: "), /*115 &string*/0xfe10, {.d_s = fkey}}, {_SLIT(" | node.is_method: "), /*115 &bool*/0xfe10, {.d_s = node.is_method ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif if (!is_used_by_main) { #if defined(CUSTOM_DEFINE_trace_skip_unused_fns_in_c_code) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// trace_skip_unused_fns_in_c_code, "), 0xfe10, {.d_s = node.name}}, {_SLIT(", fkey: "), 0xfe10, {.d_s = fkey}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// trace_skip_unused_fns_in_c_code, "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT(", fkey: "), /*115 &string*/0xfe10, {.d_s = fkey}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif } } else { #if defined(CUSTOM_DEFINE_trace_skip_unused_fns_in_c_code) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// trace_skip_unused_fns_in_c_code, "), 0xfe10, {.d_s = node.name}}, {_SLIT(", fkey: "), 0xfe10, {.d_s = v__ast__FnDecl_fkey(&node)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// trace_skip_unused_fns_in_c_code, "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT(", fkey: "), /*115 &string*/0xfe10, {.d_s = v__ast__FnDecl_fkey(&node)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif } @@ -76378,7 +76627,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_decl(v__gen__c__Gen* g, v__ast__FnDecl no if (node.ninstances == 0 && node.generic_names.len > 0) { #if defined(CUSTOM_DEFINE_trace_generics) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("skipping generic fn with no concrete instances: "), 0xfe10, {.d_s = node.mod}}, {_SLIT(" "), 0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("skipping generic fn with no concrete instances: "), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif return; @@ -76403,7 +76652,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_decl(v__gen__c__Gen* g, v__ast__FnDecl no skip = false; } if (!skip && g->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("build module `"), 0xfe10, {.d_s = g->module_built}}, {_SLIT("` fn `"), 0xfe10, {.d_s = node.name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("build module `"), /*115 &string*/0xfe10, {.d_s = g->module_built}}, {_SLIT("` fn `"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } } if (g->pref->use_cache) { @@ -76476,7 +76725,7 @@ int ctmp; Array_Array_v__ast__Type generic_types_by_fn = (*(Array_Array_v__ast__Type*)map_get(ADDR(map, g->table->fn_generic_types), &(string[]){nkey}, &(Array_Array_v__ast__Type[]){ __new_array(0, 0, sizeof(Array_v__ast__Type)) })); #if defined(CUSTOM_DEFINE_trace_post_process_generic_fns) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> gen_fn_decl, nkey: "), 0xfe10, {.d_s = nkey}}, {_SLIT(" | generic_types_by_fn: "), 0xfe10, {.d_s = Array_Array_v__ast__Type_str(generic_types_by_fn)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">> gen_fn_decl, nkey: "), /*115 &string*/0xfe10, {.d_s = nkey}}, {_SLIT(" | generic_types_by_fn: "), /*115 &[][]v.ast.Type*/0xfe10, {.d_s = Array_Array_v__ast__Type_str(generic_types_by_fn)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif for (int _t1 = 0; _t1 < generic_types_by_fn.len; ++_t1) { @@ -76504,7 +76753,7 @@ int ctmp; array_push((array*)&_t4, &ti); } string the_type = Array_string_join(_t4, _SLIT(", ")); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("gen fn `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` for type `"), 0xfe10, {.d_s = the_type}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("gen fn `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` for type `"), /*115 &string*/0xfe10, {.d_s = the_type}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } g->cur_concrete_types = concrete_types; v__gen__c__Gen_gen_fn_decl(g, node, skip); @@ -76536,7 +76785,8 @@ int ctmp; bool is_closure = v__ast__Scope_has_inherited_vars(node->scope); string cur_closure_ctx = _SLIT(""); if (is_closure) { - cur_closure_ctx = v__gen__c__closure_ctx_struct(*node); + multi_return_string_string mr_5443 = v__gen__c__closure_ctx(*node); + cur_closure_ctx = mr_5443.arg0; strings__Builder_write_string(&g->definitions, cur_closure_ctx); strings__Builder_writeln(&g->definitions, _SLIT(";")); } @@ -76548,7 +76798,7 @@ int ctmp; bool is_livemode = g->pref->is_livemain || g->pref->is_liveshared; bool is_live_wrap = is_livefn && is_livemode; if (is_livefn && !is_livemode) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("INFO: compile with `v -live "), 0xfe10, {.d_s = g->pref->path}}, {_SLIT(" `, if you want to use the [live] function "), 0xfe10, {.d_s = node->name}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("INFO: compile with `v -live "), /*115 &string*/0xfe10, {.d_s = g->pref->path}}, {_SLIT(" `, if you want to use the [live] function "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); } Option_string _t6 = v__gen__c__Gen_c_fn_name(g, node); if (_t6.state != 0) { /*or block*/ @@ -76584,7 +76834,7 @@ int ctmp; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node->receiver.typ); key = string__plus(string__plus(sym->name, _SLIT(".")), node->name); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t8 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); Option_string _t7 = {0}; if (_t8) { @@ -76595,7 +76845,7 @@ int ctmp; ; if (_t7.state != 0) { /*or block*/ IError err = _t7.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: fn_decl: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: fn_decl: obf name \""), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -76607,19 +76857,19 @@ int ctmp; } string impl_fn_name = name; if (is_live_wrap) { - impl_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("impl_live_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + impl_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("impl_live_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } last_fn_c_name_save = g->last_fn_c_name; v__gen__c__Gen_gen_fn_decl_defer_4 = true; g->last_fn_c_name = impl_fn_name; if (is_live_wrap) { if (is_livemain) { - strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" (* "), 0xfe10, {.d_s = impl_fn_name}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" no_impl_"), 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" (* "), /*115 &string*/0xfe10, {.d_s = impl_fn_name}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" no_impl_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } if (is_liveshared) { - strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } } else { if (!(node->is_pub || g->pref->is_debug)) { @@ -76629,17 +76879,17 @@ int ctmp; } } string visibility_kw = (g->cur_concrete_types.len > 0 && (g->pref->build_mode == v__pref__BuildMode__build_module || g->pref->use_cache) ? (_SLIT("static ")) : (_SLIT(""))); - string fn_header = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = visibility_kw}}, {_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = fn_attrs}}, {_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})); + string fn_header = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = visibility_kw}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fn_attrs}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})); strings__Builder_write_string(&g->definitions, fn_header); v__gen__c__Gen_write(g, fn_header); } int arg_start_pos = g->out.len; - multi_return_Array_string_Array_string_Array_bool mr_8611 = v__gen__c__Gen_fn_decl_params(g, node->params, node->scope, node->is_variadic); - Array_string fargs = mr_8611.arg0; - Array_string fargtypes = mr_8611.arg1; - Array_bool heap_promoted = mr_8611.arg2; + multi_return_Array_string_Array_string_Array_bool mr_8607 = v__gen__c__Gen_fn_decl_params(g, node->params, node->scope, node->is_variadic); + Array_string fargs = mr_8607.arg0; + Array_string fargtypes = mr_8607.arg1; + Array_bool heap_promoted = mr_8607.arg2; if (is_closure) { - string s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_closure_ctx}}, {_SLIT(" *"), 0xfe10, {.d_s = _const_v__gen__c__closure_ctx}}, {_SLIT0, 0, { .d_c = 0 }}})); + string s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_closure_ctx}}, {_SLIT(" *"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__closure_ctx}}, {_SLIT0, 0, { .d_c = 0 }}})); if (node->params.len > 0) { s = string__plus(_SLIT(", "), s); } else { @@ -76648,10 +76898,6 @@ int ctmp; strings__Builder_write_string(&g->definitions, s); v__gen__c__Gen_write(g, s); g->nr_closures++; - if (g->pref->os == v__pref__OS__windows) { - v__gen__c__Gen_error(g, _SLIT("closures are not yet implemented on windows"), node->pos); - VUNREACHABLE(); - } } string arg_str = strings__Builder_after(&g->out, arg_start_pos); if (node->no_body || ((g->pref->use_cache && g->pref->build_mode != v__pref__BuildMode__build_module) && node->is_builtin && !g->pref->is_test) || skip) { @@ -76692,12 +76938,12 @@ int ctmp; for (int i = 0; i < heap_promoted.len; ++i) { bool is_promoted = ((bool*)heap_promoted.data)[i]; if (is_promoted) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, i))}}, {_SLIT("* "), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, i))}}, {_SLIT(" = HEAP("), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, i))}}, {_SLIT(", _v_toheap_"), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, i))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, i))}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, i))}}, {_SLIT(" = HEAP("), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, i))}}, {_SLIT(", _v_toheap_"), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, i))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } for (int _t10 = 0; _t10 < node->defer_stmts.len; ++_t10) { v__ast__DeferStmt defer_stmt = ((v__ast__DeferStmt*)node->defer_stmts.data)[_t10]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); for (int _t11 = 0; _t11 < defer_stmt.defer_vars.len; ++_t11) { v__ast__Ident var = ((v__ast__Ident*)defer_stmt.defer_vars.data)[_t11]; if (Array_string_contains(fargs, var.name) || var.kind == v__ast__IdentKind__constant) { @@ -76714,9 +76960,9 @@ int ctmp; deref = _SLIT("*"); } } - v__ast__Var info = /* as */ *(v__ast__Var*)__as_cast((var.obj)._v__ast__Var,(var.obj)._typ, 324) /*expected idx: 324, name: v.ast.Var */ ; + v__ast__Var info = /* as */ *(v__ast__Var*)__as_cast((var.obj)._v__ast__Var,(var.obj)._typ, 325) /*expected idx: 325, name: v.ast.Var */ ; if (v__ast__Table_sym(g->table, info.typ)->kind != v__ast__Kind__function) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.typ)}}, {_SLIT0, 0xfe10, {.d_s = deref}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(var.name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.typ)}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(var.name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } @@ -76726,20 +76972,20 @@ int ctmp; Array_string fn_args_list = __new_array_with_default(0, 0, sizeof(string), 0); for (int ia = 0; ia < fargs.len; ++ia) { string fa = ((string*)fargs.data)[ia]; - array_push((array*)&fn_args_list, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, ia))}}, {_SLIT(" "), 0xfe10, {.d_s = fa}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&fn_args_list, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, ia))}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fa}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } - string live_fncall = string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fargs, _SLIT(", "))), _SLIT(");")); + string live_fncall = string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fargs, _SLIT(", "))), _SLIT(");")); string live_fnreturn = _SLIT(""); if (!string__eq(type_name, _SLIT("void"))) { - live_fncall = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" res = "), 0xfe10, {.d_s = live_fncall}}, {_SLIT0, 0, { .d_c = 0 }}})); + live_fncall = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" res = "), /*115 &string*/0xfe10, {.d_s = live_fncall}}, {_SLIT0, 0, { .d_c = 0 }}})); live_fnreturn = _SLIT("return res;"); } - strings__Builder_writeln(&g->definitions, string__plus(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fn_args_list, _SLIT(", "))), _SLIT(");"))); - strings__Builder_writeln(&g->hotcode_definitions, string__plus(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fn_args_list, _SLIT(", "))), _SLIT("){"))); + strings__Builder_writeln(&g->definitions, string__plus(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fn_args_list, _SLIT(", "))), _SLIT(");"))); + strings__Builder_writeln(&g->hotcode_definitions, string__plus(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fn_args_list, _SLIT(", "))), _SLIT("){"))); strings__Builder_writeln(&g->hotcode_definitions, _SLIT(" pthread_mutex_lock(&live_fn_mutex);")); - strings__Builder_writeln(&g->hotcode_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = live_fncall}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->hotcode_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = live_fncall}}, {_SLIT0, 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->hotcode_definitions, _SLIT(" pthread_mutex_unlock(&live_fn_mutex);")); - strings__Builder_writeln(&g->hotcode_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = live_fnreturn}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->hotcode_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = live_fnreturn}}, {_SLIT0, 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->hotcode_definitions, _SLIT("}")); } if (g->pref->is_prof && g->pref->build_mode != v__pref__BuildMode__build_module) { @@ -76765,12 +77011,12 @@ int ctmp; } else { g->defer_stmts = __new_array_with_default(0, 0, sizeof(v__ast__DeferStmt), 0); } - if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && node->stmts.len > 0 && ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 317 /* v.ast.Return */ && !Array_v__ast__Attr_contains(node->attrs, _SLIT("_naked"))) { + if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && node->stmts.len > 0 && ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 318 /* v.ast.Return */ && !Array_v__ast__Attr_contains(node->attrs, _SLIT("_naked"))) { string default_expr = v__gen__c__Gen_type_default(g, node->return_type); if (string__eq(default_expr, _SLIT("{0}"))) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\treturn ("), 0xfe10, {.d_s = type_name}}, {_SLIT(")"), 0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\treturn ("), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -76780,11 +77026,11 @@ int ctmp; for (int _t15 = 0; _t15 < node->attrs.len; ++_t15) { v__ast__Attr attr = ((v__ast__Attr*)node->attrs.data)[_t15]; if (string__eq(attr.name, _SLIT("export"))) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// export alias: "), 0xfe10, {.d_s = attr.arg}}, {_SLIT(" -> "), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}}))); - string export_alias = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = fn_attrs}}, {_SLIT0, 0xfe10, {.d_s = attr.arg}}, {_SLIT("("), 0xfe10, {.d_s = arg_str}}, {_SLIT(")"), 0, { .d_c = 0 }}})); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("VV_EXPORTED_SYMBOL "), 0xfe10, {.d_s = export_alias}}, {_SLIT("; // exported fn "), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = export_alias}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// export alias: "), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT(" -> "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string export_alias = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fn_attrs}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = arg_str}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("VV_EXPORTED_SYMBOL "), /*115 &string*/0xfe10, {.d_s = export_alias}}, {_SLIT("; // exported fn "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = export_alias}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, Array_string_join(fargs, _SLIT(", "))); v__gen__c__Gen_writeln(g, _SLIT(");")); v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -76850,9 +77096,8 @@ VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast return _t2; } -VV_LOCAL_SYMBOL string v__gen__c__closure_ctx_struct(v__ast__FnDecl node) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _V_"), 0xfe10, {.d_s = node.name}}, {_SLIT("_Ctx"), 0, { .d_c = 0 }}})); - return _t1; +VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__closure_ctx(v__ast__FnDecl node) { + return (multi_return_string_string){.arg0= str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _V_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("_Ctx"), 0, { .d_c = 0 }}})), .arg1= str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _V_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("_Args"), 0, { .d_c = 0 }}}))}; } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn(v__gen__c__Gen* g, v__ast__AnonFn* node) { @@ -76861,26 +77106,64 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn(v__gen__c__Gen* g, v__ast__AnonF v__gen__c__Gen_write(g, node->decl.name); return; } - string ctx_struct = v__gen__c__closure_ctx_struct(node->decl); - strings__Builder size_sb = strings__new_builder(node->decl.params.len * 50); - for (int _t1 = 0; _t1 < node->decl.params.len; ++_t1) { - v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[_t1]; - strings__Builder_write_string(&size_sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_REG_WIDTH_BOUNDED("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, param.typ)}}, {_SLIT(") + "), 0, { .d_c = 0 }}}))); - } - if (g->pref->arch == v__pref__Arch__amd64 && !v__ast__Type_alias_eq(node->decl.return_type, _const_v__ast__void_type)) { - strings__Builder_write_string(&size_sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(_REG_WIDTH("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node->decl.return_type)}}, {_SLIT(") > 2) + "), 0, { .d_c = 0 }}}))); - } - strings__Builder_write_string(&size_sb, _SLIT("1")); - string args_size = strings__Builder_str(&size_sb); - v__gen__c__Gen_writeln(g, _SLIT("")); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("__closure_create("), 0xfe10, {.d_s = node->decl.name}}, {_SLIT(", __closure_check_nargs("), 0xfe10, {.d_s = args_size}}, {_SLIT("), ("), 0xfe10, {.d_s = ctx_struct}}, {_SLIT("*) memdup(&("), 0xfe10, {.d_s = ctx_struct}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + multi_return_string_string mr_14615 = v__gen__c__closure_ctx(node->decl); + string ctx_struct = mr_14615.arg0; + string arg_struct = mr_14615.arg1; + v__gen__c__Gen_write(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("__closure_create("), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT("_wrapper, "), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT("_unwrapper, ("), /*115 &string*/0xfe10, {.d_s = ctx_struct}}, {_SLIT("*) memdup(&("), /*115 &string*/0xfe10, {.d_s = ctx_struct}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); g->indent++; - for (int _t2 = 0; _t2 < node->inherited_vars.len; ++_t2) { - v__ast__Param var = ((v__ast__Param*)node->inherited_vars.data)[_t2]; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = var.name}}, {_SLIT(" = "), 0xfe10, {.d_s = var.name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + for (int _t1 = 0; _t1 < node->inherited_vars.len; ++_t1) { + v__ast__Param var = ((v__ast__Param*)node->inherited_vars.data)[_t1]; + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = var.name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = var.name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } g->indent--; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = ctx_struct}}, {_SLIT(")))"), 0, { .d_c = 0 }}}))); + int ps = g->table->pointer_size; + int is_big_cutoff = (g->pref->os == v__pref__OS__windows || g->pref->arch == v__pref__Arch__arm32 ? (ps) : (ps * 2)); + bool is_big = v__ast__Table_type_size(g->table, node->decl.return_type) > is_big_cutoff; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = ctx_struct}}, {_SLIT(")))"), 0, { .d_c = 0 }}}))); + strings__Builder sb = strings__new_builder(512); + string ret_styp = v__gen__c__Gen_typ(g, node->decl.return_type); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" VV_LOCAL_SYMBOL void "), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT("_wrapper("), 0, { .d_c = 0 }}}))); + if (is_big) { + strings__Builder_write_string(&sb, _SLIT("__CLOSURE_WRAPPER_EXTRA_PARAM ")); + if (node->decl.params.len > 0) { + strings__Builder_write_string(&sb, _SLIT("__CLOSURE_WRAPPER_EXTRA_PARAM_COMMA ")); + } + } + for (int i = 0; i < node->decl.params.len; ++i) { + v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[i]; + if (i > 0) { + strings__Builder_write_string(&sb, _SLIT(", ")); + } + strings__Builder_write_string(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, param.typ)}}, {_SLIT(" a"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&sb, _SLIT(") {")); + if (node->decl.params.len > 0) { + strings__Builder_writeln(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("void** closure_start = (void**)((char*)__RETURN_ADDRESS() - __CLOSURE_WRAPPER_OFFSET);\n "), /*115 &string*/0xfe10, {.d_s = arg_struct}}, {_SLIT("* args = closure_start[-5];"), 0, { .d_c = 0 }}}))); + for (int i = 0; i < node->decl.params.len; ++i) { + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\targs->a"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" = a"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } + } + strings__Builder_writeln(&sb, _SLIT("}\n")); + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" VV_LOCAL_SYMBOL "), /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT("_unwrapper(void) {\n void** closure_start = (void**)((char*)__RETURN_ADDRESS() - __CLOSURE_UNWRAPPER_OFFSET);\n void* userdata = closure_start[-1];"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node->decl.return_type)}}, {_SLIT(" (*fn)("), 0, { .d_c = 0 }}}))); + for (int i = 0; i < node->decl.params.len; ++i) { + v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[i]; + strings__Builder_write_string(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, param.typ)}}, {_SLIT(" a"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&sb, _SLIT("void* userdata) = closure_start[-2];")); + if (node->decl.params.len > 0) { + strings__Builder_writeln(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = arg_struct}}, {_SLIT("* args = closure_start[-5];"), 0, { .d_c = 0 }}}))); + } + if (node->decl.return_type == _const_v__ast__void_type_idx) { + strings__Builder_write_string(&sb, _SLIT("\tfn(")); + } else { + strings__Builder_write_string(&sb, _SLIT("\treturn fn(")); + } + for (int i = 0; i < node->decl.params.len; ++i) { + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("args->a"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&sb, _SLIT("userdata);\n}")); + array_push((array*)&g->anon_fn_definitions, _MOV((string[]){ string_clone(strings__Builder_str(&sb)) })); g->empty_line = false; } @@ -76891,14 +77174,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn_decl(v__gen__c__Gen* g, v__ast__ node->has_gen = true; strings__Builder builder = strings__new_builder(256); if (node->inherited_vars.len > 0) { - string ctx_struct = v__gen__c__closure_ctx_struct(node->decl); - strings__Builder_writeln(&builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ctx_struct}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + multi_return_string_string mr_17084 = v__gen__c__closure_ctx(node->decl); + string ctx_struct = mr_17084.arg0; + string arg_struct = mr_17084.arg1; + strings__Builder_writeln(&builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ctx_struct}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < node->inherited_vars.len; ++_t1) { v__ast__Param var = ((v__ast__Param*)node->inherited_vars.data)[_t1]; string styp = v__gen__c__Gen_typ(g, var.typ); - strings__Builder_writeln(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = var.name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = var.name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&builder, _SLIT("};\n")); + if (node->decl.params.len > 0) { + strings__Builder_writeln(&builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_struct}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + for (int i = 0; i < node->decl.params.len; ++i) { + v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[i]; + strings__Builder_writeln(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, param.typ)}}, {_SLIT(" a"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&builder, _SLIT("};\n")); + } } int pos = g->out.len; bool was_anon_fn = g->anon_fn; @@ -76910,7 +77203,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn_decl(v__gen__c__Gen* g, v__ast__ } VV_LOCAL_SYMBOL string v__gen__c__Gen_defer_flag_var(v__gen__c__Gen* g, v__ast__DeferStmt* stmt) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = g->last_fn_c_name}}, {_SLIT("_defer_"), 0xfe07, {.d_i32 = stmt->idx_in_fn}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = g->last_fn_c_name}}, {_SLIT("_defer_"), /*100 &int*/0xfe07, {.d_i32 = stmt->idx_in_fn}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -76941,10 +77234,10 @@ VV_LOCAL_SYMBOL multi_return_Array_string_Array_string_Array_bool v__gen__c__Gen v__ast__TypeSymbol* arg_type_sym = v__ast__Table_sym(g->table, typ); string arg_type_name = v__gen__c__Gen_typ(g, typ); if (arg_type_sym->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((arg_type_sym->info)._v__ast__FnType,(arg_type_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((arg_type_sym->info)._v__ast__FnType,(arg_type_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ; v__ast__Fn func = info.func; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" (*"), 0xfe10, {.d_s = caname}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" (*"), 0xfe10, {.d_s = caname}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = caname}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = caname}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_fn_decl_params(g, func.params, ((voidptr)(0)), func.is_variadic); v__gen__c__Gen_write(g, _SLIT(")")); strings__Builder_write_string(&g->definitions, _SLIT(")")); @@ -76965,7 +77258,7 @@ VV_LOCAL_SYMBOL multi_return_Array_string_Array_string_Array_bool v__gen__c__Gen } string var_name_prefix = (heap_prom ? (_SLIT("_v_toheap_")) : (_SLIT(""))); string const_prefix = (v__ast__Type_is_any_kind_of_pointer(arg.typ) && !arg.is_mut && string_starts_with(arg.name, _SLIT("const_")) ? (_SLIT("const ")) : (_SLIT(""))); - string s = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = const_prefix}}, {_SLIT0, 0xfe10, {.d_s = arg_type_name}}, {_SLIT(" "), 0xfe10, {.d_s = var_name_prefix}}, {_SLIT0, 0xfe10, {.d_s = caname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string s = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = const_prefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = var_name_prefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = caname}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Gen_write(g, s); strings__Builder_write_string(&g->definitions, s); array_push((array*)&fargs, _MOV((string[]){ string_clone(caname) })); @@ -76987,14 +77280,14 @@ VV_LOCAL_SYMBOL multi_return_Array_string_Array_string_Array_bool v__gen__c__Gen VV_LOCAL_SYMBOL string v__gen__c__Gen_get_anon_fn_type_name(v__gen__c__Gen* g, v__ast__AnonFn* node, string var_name) { strings__Builder builder = strings__new_builder(64); string return_styp = v__gen__c__Gen_typ(g, node->decl.return_type); - strings__Builder_write_string(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = return_styp}}, {_SLIT(" (*"), 0xfe10, {.d_s = var_name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = return_styp}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); if (node->decl.params.len == 0) { strings__Builder_write_string(&builder, _SLIT("void)")); } else { for (int i = 0; i < node->decl.params.len; ++i) { v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[i]; string param_styp = v__gen__c__Gen_typ(g, param.typ); - strings__Builder_write_string(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = param_styp}}, {_SLIT(" "), 0xfe10, {.d_s = param.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = param_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i != node->decl.params.len - 1) { strings__Builder_write_string(&builder, _SLIT(", ")); } @@ -77007,13 +77300,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_anon_fn_type_name(v__gen__c__Gen* g, v VV_LOCAL_SYMBOL void v__gen__c__Gen_call_expr(v__gen__c__Gen* g, v__ast__CallExpr node) { bool v__gen__c__Gen_call_expr_defer_0 = false; - if ((node.left)._typ == 244 /* v.ast.AnonFn */) { + if ((node.left)._typ == 245 /* v.ast.AnonFn */) { v__gen__c__Gen_expr(g, node.left); - } else if ((node.left)._typ == 269 /* v.ast.IndexExpr */ && (node.name).len == 0) { + } else if ((node.left)._typ == 270 /* v.ast.IndexExpr */ && (node.name).len == 0) { g->is_fn_index_call = true; v__gen__c__Gen_expr(g, node.left); g->is_fn_index_call = false; - } else if ((node.left)._typ == 252 /* v.ast.CallExpr */ && (node.name).len == 0) { + } else if ((node.left)._typ == 253 /* v.ast.CallExpr */ && (node.name).len == 0) { v__gen__c__Gen_expr(g, node.left); } if (node.should_be_skipped) { @@ -77036,17 +77329,14 @@ bool v__gen__c__Gen_call_expr_defer_0 = false; string tmp_opt = (gen_or || gen_keep_alive ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); if (gen_or || gen_keep_alive) { v__ast__Type ret_typ = node.return_type; - if (gen_or) { - ret_typ = v__ast__Type_set_flag(ret_typ, v__ast__TypeFlag__optional); - } string styp = v__gen__c__Gen_typ(g, ret_typ); if (gen_or && !is_gen_or_and_assign_rhs) { cur_line = v__gen__c__Gen_go_before_stmt(g, 0); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } if (node.is_method && !node.is_field) { - if (string__eq(node.name, _SLIT("writeln")) && g->pref->experimental && node.args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ == 289 /* v.ast.StringInterLiteral */ && string__eq(v__ast__Table_sym(g->table, node.receiver_type)->name, _SLIT("strings.Builder"))) { + if (string__eq(node.name, _SLIT("writeln")) && g->pref->experimental && node.args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ == 290 /* v.ast.StringInterLiteral */ && string__eq(v__ast__Table_sym(g->table, node.receiver_type)->name, _SLIT("strings.Builder"))) { v__gen__c__Gen_string_inter_literal_sb_optimized(g, node); } else { v__gen__c__Gen_method_call(g, node); @@ -77056,22 +77346,22 @@ bool v__gen__c__Gen_call_expr_defer_0 = false; } if (gen_or) { v__gen__c__Gen_or_block(g, tmp_opt, node.or_block, node.return_type); - v__ast__Type unwrapped_typ = v__ast__Type_clear_flag(node.return_type, v__ast__TypeFlag__optional); + v__ast__Type unwrapped_typ = v__ast__Type_clear_flag(v__ast__Type_clear_flag(node.return_type, v__ast__TypeFlag__optional), v__ast__TypeFlag__result); string unwrapped_styp = v__gen__c__Gen_typ(g, unwrapped_typ); if (v__ast__Type_alias_eq(unwrapped_typ, _const_v__ast__void_type)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { if (!g->inside_const_optional) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT(" (*("), 0xfe10, {.d_s = unwrapped_styp}}, {_SLIT("*)"), 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 = unwrapped_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } else if (gen_keep_alive) { if (v__ast__Type_alias_eq(node.return_type, _const_v__ast__void_type)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } if (node.is_noreturn) { @@ -77097,10 +77387,10 @@ if (v__gen__c__Gen_call_expr_defer_0) { } VV_LOCAL_SYMBOL void v__gen__c__Gen_conversion_function_call(v__gen__c__Gen* g, string prefix, string postfix, v__ast__CallExpr node) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = prefix}}, {_SLIT("( ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = prefix}}, {_SLIT("( ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); string dot = (v__ast__Type_is_ptr(node.left_type) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(")"), 0xfe10, {.d_s = dot}}, {_SLIT("_typ )"), 0xfe10, {.d_s = postfix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(")"), /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ )"), /*115 &string*/0xfe10, {.d_s = postfix}}, {_SLIT0, 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallExpr node) { @@ -77115,7 +77405,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE unwrapped_rec_type = v__gen__c__Gen_unwrap_generic(g, node.receiver_type); } else { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.receiver_type); - if (sym->info._typ == 416 /* v.ast.Struct */) { + if (sym->info._typ == 417 /* v.ast.Struct */) { Array_string _t1 = {0}; Array_v__ast__Type _t1_orig = (*sym->info._v__ast__Struct).generic_types; int _t1_len = _t1_orig.len; @@ -77134,7 +77424,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE unwrapped_rec_type = utyp; } } - else if (sym->info._typ == 434 /* v.ast.Interface */) { + else if (sym->info._typ == 435 /* v.ast.Interface */) { Array_string _t4 = {0}; Array_v__ast__Type _t4_orig = (*sym->info._v__ast__Interface).generic_types; int _t4_len = _t4_orig.len; @@ -77153,7 +77443,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE unwrapped_rec_type = utyp; } } - else if (sym->info._typ == 435 /* v.ast.SumType */) { + else if (sym->info._typ == 436 /* v.ast.SumType */) { Array_string _t7 = {0}; Array_v__ast__Type _t7_orig = (*sym->info._v__ast__SumType).generic_types; int _t7_len = _t7_orig.len; @@ -77179,21 +77469,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(g->table, unwrapped_rec_type); if (typ_sym->kind == v__ast__Kind__alias && !string__eq(node.name, _SLIT("str")) && !v__ast__TypeSymbol_has_method(typ_sym, node.name)) { - unwrapped_rec_type = (/* as */ *(v__ast__Alias*)__as_cast((typ_sym->info)._v__ast__Alias,(typ_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type; + unwrapped_rec_type = (/* as */ *(v__ast__Alias*)__as_cast((typ_sym->info)._v__ast__Alias,(typ_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; typ_sym = v__ast__Table_sym(g->table, unwrapped_rec_type); } string rec_cc_type = v__gen__c__Gen_cc_type(g, unwrapped_rec_type, false); string receiver_type_name = v__util__no_dots(rec_cc_type); - if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ )), node.name)) { + if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ )), node.name)) { #if defined(CUSTOM_DEFINE_debug_interface_method_call) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(">>> interface typ_sym.name: "), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT(" | receiver_type_name: "), 0xfe10, {.d_s = receiver_type_name}}, {_SLIT(" | pos: "), 0xfe10, {.d_s = v__token__Pos_str(node.pos)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT(">>> interface typ_sym.name: "), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT(" | receiver_type_name: "), /*115 &string*/0xfe10, {.d_s = receiver_type_name}}, {_SLIT(" | pos: "), /*115 &v.token.Pos*/0xfe10, {.d_s = v__token__Pos_str(node.pos)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif bool left_is_shared = v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f); string left_cc_type = v__gen__c__Gen_cc_type(g, node.left_type, false); string left_type_name = v__util__no_dots(left_cc_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(left_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(left_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); if (v__ast__Expr_is_auto_deref_var(node.left) && v__ast__Type_nr_muls(node.left_type) > 1) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_write(g, string_repeat(_SLIT("*"), v__ast__Type_nr_muls(node.left_type) - 1)); @@ -77204,7 +77494,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } string dot = (left_is_shared ? (_SLIT("->val.")) : v__ast__Type_is_ptr(node.left_type) ? (_SLIT("->")) : (_SLIT("."))); string mname = v__gen__c__c_name(node.name); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_"), 0xfe10, {.d_s = mname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_"), /*115 &string*/0xfe10, {.d_s = mname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Expr_is_auto_deref_var(node.left) && v__ast__Type_nr_muls(node.left_type) > 1) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_write(g, string_repeat(_SLIT("*"), v__ast__Type_nr_muls(node.left_type) - 1)); @@ -77213,7 +77503,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } else { v__gen__c__Gen_expr(g, node.left); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); if (node.args.len > 0) { v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_call_args(g, node); @@ -77269,7 +77559,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE }; } if (left_sym->kind == v__ast__Kind__map && string__eq(node.name, _SLIT("delete"))) { - v__ast__Map left_info = /* as */ *(v__ast__Map*)__as_cast((left_sym->info)._v__ast__Map,(left_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map left_info = /* as */ *(v__ast__Map*)__as_cast((left_sym->info)._v__ast__Map,(left_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; string elem_type_str = v__gen__c__Gen_typ(g, left_info.key_type); v__gen__c__Gen_write(g, _SLIT("map_delete(")); if (v__ast__Type_is_ptr(node.left_type)) { @@ -77278,7 +77568,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE v__gen__c__Gen_write(g, _SLIT("&")); v__gen__c__Gen_expr(g, node.left); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); v__gen__c__Gen_write(g, _SLIT("})")); return; @@ -77298,21 +77588,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE if (left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_) { if (string__eq(node.name, _SLIT("type_name"))) { if (left_sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_sumtype_"), 0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(")"), node); + v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_sumtype_"), /*115 &string*/0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(")"), node); return; } if (left_sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_interface_"), 0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(")"), node); + v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_interface_"), /*115 &string*/0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(")"), node); return; } } if (string__eq(node.name, _SLIT("type_idx"))) { if (left_sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_sumtype_idx_"), 0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(""), node); + v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_sumtype_idx_"), /*115 &string*/0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(""), node); return; } if (left_sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_interface_idx_"), 0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(""), node); + v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_interface_idx_"), /*115 &string*/0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(""), node); return; } } @@ -77322,10 +77612,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE if (v__ast__Type_has_flag(rec_type, v__ast__TypeFlag__shared_f)) { rec_type = v__ast__Type_set_nr_muls(v__ast__Type_clear_flag(rec_type, v__ast__TypeFlag__shared_f), 0); } - if ((node.left)._typ == 258 /* v.ast.ComptimeSelector */) { - if (((*node.left._v__ast__ComptimeSelector).field_expr)._typ == 286 /* v.ast.SelectorExpr */) { - if (((*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 266 /* v.ast.Ident */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); + if ((node.left)._typ == 259 /* v.ast.ComptimeSelector */) { + if (((*node.left._v__ast__ComptimeSelector).field_expr)._typ == 287 /* v.ast.SelectorExpr */) { + if (((*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 267 /* v.ast.Ident */) { + string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); v__ast__Type* _t11 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); Option_v__ast__Type _t10 = {0}; if (_t11) { @@ -77344,7 +77634,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE return; } } - } else if ((node.left)._typ == 257 /* v.ast.ComptimeCall */) { + } else if ((node.left)._typ == 258 /* v.ast.ComptimeCall */) { if (string__eq((*node.left._v__ast__ComptimeCall).method_name, _SLIT("method"))) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, (*node.left._v__ast__ComptimeCall).left_type)); Option_v__ast__Fn _t12; @@ -77355,8 +77645,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE return; } } - } else if ((node.left)._typ == 266 /* v.ast.Ident */) { - if (((*node.left._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + } else if ((node.left)._typ == 267 /* v.ast.Ident */) { + if (((*node.left._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { if (g->comptime_var_type_map.len > 0) { rec_type = (*(*node.left._v__ast__Ident).obj._v__ast__Var).typ; v__gen__c__Gen_gen_expr_to_string(g, node.left, rec_type); @@ -77364,7 +77654,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } else if ((*(*node.left._v__ast__Ident).obj._v__ast__Var).smartcasts.len > 0) { rec_type = v__gen__c__Gen_unwrap_generic(g, (*(v__ast__Type*)array_last((*(*node.left._v__ast__Ident).obj._v__ast__Var).smartcasts))); v__ast__TypeSymbol* cast_sym = v__ast__Table_sym(g->table, rec_type); - if ((cast_sym->info)._typ == 429 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 430 /* v.ast.Aggregate */) { rec_type = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } v__gen__c__Gen_gen_expr_to_string(g, node.left, rec_type); @@ -77385,32 +77675,32 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE receiver_type_name = _SLIT("map"); } if (final_left_sym->kind == v__ast__Kind__array && (string__eq(node.name, _SLIT("repeat")) || string__eq(node.name, _SLIT("sort_with_compare")) || string__eq(node.name, _SLIT("free")) || string__eq(node.name, _SLIT("push_many")) || string__eq(node.name, _SLIT("trim")) || string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("pop")) || string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("reverse")) || string__eq(node.name, _SLIT("slice")) || string__eq(node.name, _SLIT("pointers")))) { - if (!((left_sym->info)._typ == 431 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) { + if (!((left_sym->info)._typ == 432 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) { receiver_type_name = _SLIT("array"); } if (string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("pop"))) { string return_type_str = v__gen__c__Gen_typ(g, node.return_type); has_cast = true; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = return_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = return_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } } - string name = v__util__no_dots( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = receiver_type_name}}, {_SLIT("_"), 0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string name = v__util__no_dots( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = receiver_type_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); int array_depth = -1; string noscan = _SLIT(""); if (left_sym->kind == v__ast__Kind__array) { bool needs_depth = (string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("repeat"))); if (needs_depth) { - v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ).elem_type; + v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ).elem_type; array_depth = v__gen__c__Gen_get_array_depth(g, elem_type); } bool maybe_noscan = needs_depth || (string__eq(node.name, _SLIT("pop")) || string__eq(node.name, _SLIT("push")) || string__eq(node.name, _SLIT("push_many")) || string__eq(node.name, _SLIT("reverse")) || string__eq(node.name, _SLIT("grow_cap")) || string__eq(node.name, _SLIT("grow_len"))); if (maybe_noscan) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; noscan = v__gen__c__Gen_check_noscan(g, info.elem_type); } } else if (left_sym->kind == v__ast__Kind__chan) { if (string__eq(node.name, _SLIT("close")) || string__eq(node.name, _SLIT("try_pop")) || string__eq(node.name, _SLIT("try_push"))) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__Channel_"), 0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__Channel_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}})); } } else if (final_left_sym->kind == v__ast__Kind__map) { if (string__eq(node.name, _SLIT("keys"))) { @@ -77420,7 +77710,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE if (g->pref->obfuscate && string__eq(g->cur_mod.name, _SLIT("main")) && string_starts_with(name, _SLIT("main__")) && !string__eq(node.name, _SLIT("str"))) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.receiver_type); string key = string__plus(string__plus(sym->name, _SLIT(".")), node.name); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf method call: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf method call: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t14 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); Option_string _t13 = {0}; if (_t14) { @@ -77431,7 +77721,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE ; if (_t13.state != 0) { /*or block*/ IError err = _t13.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _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(); ; } @@ -77440,10 +77730,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } bool is_range_slice = false; if (v__ast__Type_is_ptr(node.receiver_type) && !v__ast__Type_is_ptr(node.left_type)) { - if ((node.left)._typ == 269 /* v.ast.IndexExpr */) { + if ((node.left)._typ == 270 /* v.ast.IndexExpr */) { v__ast__Expr idx = (*node.left._v__ast__IndexExpr).index; - if ((idx)._typ == 284 /* v.ast.RangeExpr */) { - name = v__util__no_dots( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = receiver_type_name}}, {_SLIT("_"), 0xfe10, {.d_s = node.name}}, {_SLIT("_static"), 0, { .d_c = 0 }}}))); + if ((idx)._typ == 285 /* v.ast.RangeExpr */) { + name = v__util__no_dots( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = receiver_type_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("_static"), 0, { .d_c = 0 }}}))); is_range_slice = true; } } @@ -77459,15 +77749,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE if (array_depth >= 0) { name = string__plus(name, _SLIT("_to_depth")); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT0, 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } } if (v__ast__Type_is_ptr(node.receiver_type) && (!v__ast__Type_is_ptr(node.left_type) || v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__variadic) || node.from_embed_types.len != 0 || (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) && !string__eq(node.name, _SLIT("str"))))) { if (!is_range_slice) { if (!v__ast__Expr_is_lvalue(node.left)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), 0xfe10, {.d_s = rec_cc_type}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), /*115 &string*/0xfe10, {.d_s = rec_cc_type}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); has_cast = true; } else { v__gen__c__Gen_write(g, _SLIT("&")); @@ -77481,19 +77771,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE int diff = v__ast__Type_nr_muls(node.left_type) - v__ast__Type_nr_muls(node.receiver_type); if (diff < 0) { } else if (diff > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/*diff="), 0xfe07, {.d_i32 = diff}}, {_SLIT("*/"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/*diff="), /*100 &int*/0xfe07, {.d_i32 = diff}}, {_SLIT("*/"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, Array_u8_bytestr(__new_array_with_default(diff, 0, sizeof(u8), &(u8[]){'*'}))); } } if (g->is_autofree && node.free_receiver && !g->inside_lambda && !g->is_builtin_mod) { string fn_name = string_replace(node.name, _SLIT("."), _SLIT("_")); - string arg_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("_0_"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string arg_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_0_"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Gen_write(g, string__plus(_SLIT("/*af receiver arg*/"), arg_name)); } else { if (left_sym->kind == v__ast__Kind__array && v__ast__Expr_is_auto_deref_var(node.left) && (string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("repeat")))) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((node.left)._typ == 275 /* v.ast.MapInit */) { + if ((node.left)._typ == 276 /* v.ast.MapInit */) { v__gen__c__Gen_write(g, _SLIT("(map[]){")); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT("}[0]")); @@ -77525,7 +77815,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } v__gen__c__Gen_call_args(g, node); if (array_depth >= 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe07, {.d_i32 = array_depth}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = array_depth}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT(")")); } @@ -77562,8 +77852,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr v__ast__CallExpr node_ = node; for (int i = 0; i < node_.args.len; ++i) { v__ast__CallArg* call_arg = ((v__ast__CallArg*)node_.args.data) + i; - if ((call_arg->expr)._typ == 266 /* v.ast.Ident */) { - if (((*call_arg->expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((call_arg->expr)._typ == 267 /* v.ast.Ident */) { + if (((*call_arg->expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { (*(v__ast__CallArg*)/*ee elem_sym */array_get(node_.args, i)).typ = (*(*call_arg->expr._v__ast__Ident).obj._v__ast__Var).typ; } } @@ -77589,7 +77879,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr string encode_name = v__gen__c__js_enc_name(json_type_str); g->empty_line = true; v__gen__c__Gen_writeln(g, _SLIT("// json.encode")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cJSON* "), 0xfe10, {.d_s = json_obj}}, {_SLIT(" = "), 0xfe10, {.d_s = encode_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cJSON* "), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = encode_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -77597,28 +77887,28 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr v__gen__c__Gen_writeln(g, _SLIT(");")); tmp2 = v__gen__c__Gen_new_tmp_var(g); if (is_json_encode) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = tmp2}}, {_SLIT(" = json__json_print("), 0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = tmp2}}, {_SLIT(" = json__json_print("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = tmp2}}, {_SLIT(" = json__json_print_pretty("), 0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = tmp2}}, {_SLIT(" = json__json_print_pretty("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else { - v__ast__TypeNode ast_type = /* as */ *(v__ast__TypeNode*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._v__ast__TypeNode,((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ, 292) /*expected idx: 292, name: v.ast.TypeNode */ ; + v__ast__TypeNode ast_type = /* as */ *(v__ast__TypeNode*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._v__ast__TypeNode,((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ, 293) /*expected idx: 293, name: v.ast.TypeNode */ ; string typ = v__gen__c__c_name(v__gen__c__Gen_typ(g, ast_type.typ)); string fn_name = string__plus(string__plus(v__gen__c__c_name(name), _SLIT("_")), typ); v__gen__c__Gen_gen_json_for_type(g, ast_type.typ); g->empty_line = true; v__gen__c__Gen_writeln(g, _SLIT("// json.decode")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cJSON* "), 0xfe10, {.d_s = json_obj}}, {_SLIT(" = json__json_parse("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cJSON* "), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(" = json__json_parse("), 0, { .d_c = 0 }}}))); g->is_js_call = true; v__gen__c__Gen_call_args(g, node); v__gen__c__Gen_writeln(g, _SLIT(");")); tmp2 = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Option_"), 0xfe10, {.d_s = typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp2}}, {_SLIT(" = "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Option_"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp2}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } if (!g->is_autofree) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cJSON_Delete("), 0xfe10, {.d_s = json_obj}}, {_SLIT("); // del"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cJSON_Delete("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT("); // del"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); name = _SLIT(""); json_obj = tmp2; } @@ -77638,7 +77928,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr } 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: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + 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) { @@ -77649,7 +77939,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr ; if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _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(); ; } @@ -77678,29 +77968,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr if (!v__ast__Type_alias_eq(typ, _const_v__ast__string_type) || g->comptime_for_method.len > 0) { v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(g->table, typ); - if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ )), _SLIT("str"))) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ )), _SLIT("str"))) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); string rec_type_name = v__util__no_dots(v__gen__c__Gen_cc_type(g, typ, false)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); string dot = (v__ast__Type_is_ptr(typ) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_str("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_str("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("));")); return; } if (g->is_autofree && !v__ast__Type_has_flag(typ, v__ast__TypeFlag__optional)) { string tmp = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_expr_to_string(g, expr, typ); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("; "), 0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0xfe10, {.d_s = tmp}}, {_SLIT("); string_free(&"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("; "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("); string_free(&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); - if ((expr)._typ == 258 /* v.ast.ComptimeSelector */) { - if (((*expr._v__ast__ComptimeSelector).field_expr)._typ == 286 /* v.ast.SelectorExpr */) { - if (((*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 266 /* v.ast.Ident */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + if ((expr)._typ == 259 /* v.ast.ComptimeSelector */) { + if (((*expr._v__ast__ComptimeSelector).field_expr)._typ == 287 /* v.ast.SelectorExpr */) { + if (((*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 267 /* 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) { @@ -77717,7 +78007,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr typ = *(v__ast__Type*)_t6.data; } } - } else if ((expr)._typ == 257 /* v.ast.ComptimeCall */) { + } else if ((expr)._typ == 258 /* 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; @@ -77726,13 +78016,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr typ = m.return_type; } } - } else if ((expr)._typ == 266 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + } else if ((expr)._typ == 267 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { typ = (*(*expr._v__ast__Ident).obj._v__ast__Var).typ; if ((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts.len > 0) { typ = v__gen__c__Gen_unwrap_generic(g, (*(v__ast__Type*)array_last((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts))); v__ast__TypeSymbol* cast_sym = v__ast__Table_sym(g->table, typ); - if ((cast_sym->info)._typ == 429 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 430 /* v.ast.Aggregate */) { typ = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } } @@ -77746,12 +78036,12 @@ 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_40533 = v__gen__c__Gen_panic_debug_info(g, node.pos); - int paline = mr_40533.arg0; - string pafile = mr_40533.arg1; - string pamod = mr_40533.arg2; - string pafn = mr_40533.arg3; - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), 0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), 0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); + multi_return_int_string_string_string mr_41672 = v__gen__c__Gen_panic_debug_info(g, node.pos); + int paline = mr_41672.arg0; + string pafile = mr_41672.arg1; + string pamod = mr_41672.arg2; + string pafn = mr_41672.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 { @@ -77759,7 +78049,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr 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; - if (obj._typ == 324 /* v.ast.Var */) { + if (obj._typ == 325 /* v.ast.Var */) { if ((*obj._v__ast__Var).smartcasts.len > 0) { for (int _t10 = 0; _t10 < (*obj._v__ast__Var).smartcasts.len; ++_t10) { v__gen__c__Gen_write(g, _SLIT("(*")); @@ -77775,11 +78065,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr } } string dot = (is_ptr ? (_SLIT("->")) : (_SLIT("."))); - if ((cast_sym->info)._typ == 429 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 430 /* v.ast.Aggregate */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_"), 0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT(")")); } @@ -77810,7 +78100,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr if (i > 0) { v__gen__c__Gen_write(g, _SLIT(", ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__tmp_arg_"), 0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__tmp_arg_"), /*100 &int*/0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } else { v__gen__c__Gen_call_args(g, node); @@ -77847,19 +78137,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_call_pregen(v__gen__c__Gen* g, v__a if (!arg.is_tmp_autofree) { continue; } - if ((arg.expr)._typ == 252 /* v.ast.CallExpr */) { + if ((arg.expr)._typ == 253 /* v.ast.CallExpr */) { v__gen__c__Gen_autofree_call_pregen(g, (*arg.expr._v__ast__CallExpr)); } free_tmp_arg_vars = true; string fn_name = string_replace(node.name, _SLIT("."), _SLIT("_")); - string t = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("_"), 0xfe07, {.d_i32 = i}}, {_SLIT("_"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string t = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); bool used = false; - string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); + string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); if (used) { Option_v__ast__ScopeObject _t2; if (_t2 = v__ast__Scope_find(scope, t), _t2.state == 0) { v__ast__ScopeObject x = *(v__ast__ScopeObject*)_t2.data; - if (x._typ == 324 /* v.ast.Var */) { + if (x._typ == 325 /* v.ast.Var */) { (*x._v__ast__Var).is_used = false; } @@ -77867,10 +78157,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_call_pregen(v__gen__c__Gen* g, v__a } ; } - s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); + s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); } else { v__ast__Scope_register(scope, v__ast__Var_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__Var, (((v__ast__Var){.name = t,.share = 0,.is_mut = 0,.is_autofree_tmp = true,.is_arg = 0,.is_auto_deref = 0,.is_inherited = 0,.expr = {0},.typ = _const_v__ast__string_type,.orig_type = 0,.smartcasts = __new_array(0, 0, sizeof(v__ast__Type)),.pos = node.pos,.is_used = 0,.is_changed = 0,.is_or = 0,.is_tmp = 0,.is_auto_heap = 0,.is_stack_obj = 0,}))))); - s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); + s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); } s = /*f*/string__plus(s, v__gen__c__Gen_expr_string(g, arg.expr)); s = /*f*/string__plus(s, _SLIT(";// new af2 pre")); @@ -77894,7 +78184,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_call_postgen(v__gen__c__Gen* g, int } if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} v__ast__ScopeObject* obj = &(*(v__ast__ScopeObject*)DenseArray_value(&_t1.key_values, _t2)); - if (obj->_typ == 324 /* v.ast.Var */) { + if (obj->_typ == 325 /* v.ast.Var */) { bool is_optional = v__ast__Type_has_flag((*obj->_v__ast__Var).typ, v__ast__TypeFlag__optional); if (is_optional) { continue; @@ -77987,7 +78277,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp if (use_tmp_var_autofree) { if (arg.is_tmp_autofree) { string fn_name = string_replace(node.name, _SLIT("."), _SLIT("_")); - string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("_"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT("_"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Gen_write(g, string__plus(_SLIT("/*af arg*/"), name)); } } else { @@ -77996,7 +78286,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } else { if (use_tmp_var_autofree) { string fn_name = string_replace(node.name, _SLIT("."), _SLIT("_")); - string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("_"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT("_"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Gen_write(g, string__plus(_SLIT("/*af arg2*/"), name)); } else { v__gen__c__Gen_expr(g, arg.expr); @@ -78011,7 +78301,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp v__ast__Type varg_type = (*(v__ast__Type*)array_last(expected_types)); int variadic_count = args.len - arg_nr; v__ast__TypeSymbol* arr_sym = v__ast__Table_sym(g->table, varg_type); - v__ast__Array arr_info = /* as */ *(v__ast__Array*)__as_cast((arr_sym->info)._v__ast__Array,(arr_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array arr_info = /* as */ *(v__ast__Array*)__as_cast((arr_sym->info)._v__ast__Array,(arr_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; if (v__ast__Type_has_flag(varg_type, v__ast__TypeFlag__generic)) { Option_v__ast__Fn _t10; if (_t10 = v__ast__Table_find_fn(g->table, node.name), _t10.state == 0) { @@ -78024,19 +78314,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } } else { IError err = _t10.err; - v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to find function "), 0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to find function "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}})), node.pos); VUNREACHABLE(); } } string elem_type = v__gen__c__Gen_typ(g, arr_info.elem_type); if ((g->pref->translated || g->file->is_translated) && args.len == 1) { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(args, 0)).expr); - } else if (args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(args, args.len - 1)).expr)._typ == 245 /* v.ast.ArrayDecompose */) { + } else if (args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(args, args.len - 1)).expr)._typ == 246 /* v.ast.ArrayDecompose */) { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(args, args.len - 1)).expr); } else { if (variadic_count > 0) { string noscan = v__gen__c__Gen_check_noscan(g, arr_info.elem_type); - v__gen__c__Gen_write(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe07, {.d_i32 = variadic_count}}, {_SLIT(", "), 0xfe07, {.d_i32 = variadic_count}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = elem_type}}, {_SLIT("), _MOV(("), 0xfe10, {.d_s = elem_type}}, {_SLIT("["), 0xfe07, {.d_i32 = variadic_count}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*100 &int*/0xfe07, {.d_i32 = variadic_count}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = variadic_count}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = elem_type}}, {_SLIT("), _MOV(("), /*115 &string*/0xfe10, {.d_s = elem_type}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = variadic_count}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int j = arg_nr; j < args.len; ++j) { v__gen__c__Gen_ref_or_deref_arg(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(args, j)), arr_info.elem_type, node.language); if (j < args.len - 1) { @@ -78045,7 +78335,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } v__gen__c__Gen_write(g, _SLIT("}))")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array(0, 0, sizeof("), 0xfe10, {.d_s = elem_type}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array(0, 0, sizeof("), /*115 &string*/0xfe10, {.d_s = elem_type}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } } @@ -78069,7 +78359,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no if (expr.is_method) { v__ast__TypeSymbol* receiver_sym = v__ast__Table_sym(g->table, expr.receiver_type); name = string__plus(string__plus(receiver_sym->name, _SLIT("_")), name); - } else if ((expr.left)._typ == 244 /* v.ast.AnonFn */) { + } else if ((expr.left)._typ == 245 /* v.ast.AnonFn */) { v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr.left._v__ast__AnonFn)); name = (*expr.left._v__ast__AnonFn).decl.name; } else if (expr.is_fn_var) { @@ -78082,7 +78372,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, expr.receiver_type); key = string__plus(string__plus(sym->name, _SLIT(".")), expr.name); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf go: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf go: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t2 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); Option_string _t1 = {0}; if (_t2) { @@ -78093,7 +78383,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no ; if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _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(); ; } @@ -78105,21 +78395,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no string wrapper_struct_name = string__plus(_SLIT("thread_arg_"), name); string wrapper_fn_name = string__plus(name, _SLIT("_thread_wrapper")); string arg_tmp_var = string__plus(_SLIT("arg_"), tmp); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *"), 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(" = malloc(sizeof(thread_arg_"), 0xfe10, {.d_s = name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *"), /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(" = malloc(sizeof(thread_arg_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); if (expr.is_method) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->arg0 = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->arg0 = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr.left); v__gen__c__Gen_writeln(g, _SLIT(";")); } for (int i = 0; i < expr.args.len; ++i) { v__ast__CallArg arg = ((v__ast__CallArg*)expr.args.data)[i]; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->arg"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->arg"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, arg.expr); v__gen__c__Gen_writeln(g, _SLIT(";")); } string s_ret_typ = v__gen__c__Gen_typ(g, node.call_expr.return_type); if (g->pref->os == v__pref__OS__windows && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->ret_ptr = malloc(sizeof("), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->ret_ptr = malloc(sizeof("), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } bool is_opt = v__ast__Type_has_flag(node.call_expr.return_type, v__ast__TypeFlag__optional); string gohandle_name = _SLIT(""); @@ -78127,39 +78417,39 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no gohandle_name = (is_opt ? (_SLIT("__v_thread_Option_void")) : (_SLIT("__v_thread"))); } else { string opt = (is_opt ? (_SLIT("Option_")) : (_SLIT(""))); - gohandle_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), 0xfe10, {.d_s = opt}}, {_SLIT0, 0xfe10, {.d_s = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.call_expr.return_type))->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + gohandle_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.call_expr.return_type))->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); } if (g->pref->os == v__pref__OS__windows) { - string simple_handle = (node.is_expr && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_handle_"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("HANDLE "), 0xfe10, {.d_s = simple_handle}}, {_SLIT(" = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)"), 0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT(", "), 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(", 0, 0);"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (!"), 0xfe10, {.d_s = simple_handle}}, {_SLIT(") panic_lasterr(tos3(\"`go "), 0xfe10, {.d_s = name}}, {_SLIT("()`: \"));"), 0, { .d_c = 0 }}}))); + string simple_handle = (node.is_expr && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_handle_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("HANDLE "), /*115 &string*/0xfe10, {.d_s = simple_handle}}, {_SLIT(" = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)"), /*115 &string*/0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(", 0, 0);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (!"), /*115 &string*/0xfe10, {.d_s = simple_handle}}, {_SLIT(") panic_lasterr(tos3(\"`go "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("()`: \"));"), 0, { .d_c = 0 }}}))); if (node.is_expr && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = gohandle_name}}, {_SLIT(" thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t.ret_ptr = "), 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->ret_ptr,"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t.handle = thread_handle_"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = gohandle_name}}, {_SLIT(" thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t.ret_ptr = "), /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->ret_ptr,"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t.handle = thread_handle_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("};")); } if (!node.is_expr) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("CloseHandle(thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("CloseHandle(thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_t thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_t thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); string sthread_attributes = _SLIT("NULL"); if (g->pref->os != v__pref__OS__vinix) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_attr_t thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT("_attributes;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_attr_init(&thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT("_attributes);"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("pthread_attr_setstacksize(&thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT("_attributes, "), 0xfe07, {.d_i32 = g->pref->thread_stack_size}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - sthread_attributes = str_intp(2, _MOV((StrIntpData[]){{_SLIT("&thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT("_attributes"), 0, { .d_c = 0 }}})); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_attr_t thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_attributes;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_attr_init(&thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_attributes);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("pthread_attr_setstacksize(&thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_attributes, "), /*100 &int*/0xfe07, {.d_i32 = g->pref->thread_stack_size}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + sthread_attributes = str_intp(2, _MOV((StrIntpData[]){{_SLIT("&thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_attributes"), 0, { .d_c = 0 }}})); } - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res = pthread_create(&thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(", "), 0xfe10, {.d_s = sthread_attributes}}, {_SLIT(", (void*)"), 0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT(", "), 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res) panic_error_number(tos3(\"`go "), 0xfe10, {.d_s = name}}, {_SLIT("()`: \"), "), 0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res = pthread_create(&thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = sthread_attributes}}, {_SLIT(", (void*)"), /*115 &string*/0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res) panic_error_number(tos3(\"`go "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("()`: \"), "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res);"), 0, { .d_c = 0 }}}))); if (!node.is_expr) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_detach(thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_detach(thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("// end go")); if (node.is_expr) { - handle = str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})); + handle = str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})); string waiter_fn_name = string__plus(gohandle_name, _SLIT("_wait")); bool should_register = false; sync__RwMutex_lock(&g->waiter_fns->mtx); @@ -78171,10 +78461,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } sync__RwMutex_unlock(&g->waiter_fns->mtx);; if (should_register) { - strings__Builder_writeln(&g->gowrappers, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = waiter_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = gohandle_name}}, {_SLIT(" thread) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = waiter_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = gohandle_name}}, {_SLIT(" thread) {"), 0, { .d_c = 0 }}}))); string c_ret_ptr_ptr = _SLIT("NULL"); if (!v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { - strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("* ret_ptr;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("* ret_ptr;"), 0, { .d_c = 0 }}}))); c_ret_ptr_ptr = _SLIT("&ret_ptr"); } if (g->pref->os == v__pref__OS__windows) { @@ -78185,7 +78475,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no strings__Builder_writeln(&g->gowrappers, _SLIT("\tret_ptr = thread.ret_ptr;")); } } else { - strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tint stat = pthread_join(thread, (void **)"), 0xfe10, {.d_s = c_ret_ptr_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tint stat = pthread_join(thread, (void **)"), /*115 &string*/0xfe10, {.d_s = c_ret_ptr_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->gowrappers, _SLIT("\tif (stat != 0) { _v_panic(_SLIT(\"unable to join thread\")); }")); if (g->pref->os == v__pref__OS__windows) { @@ -78196,7 +78486,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } } if (!v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { - strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT(" ret = *ret_ptr;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT(" ret = *ret_ptr;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->gowrappers, _SLIT("\tfree(ret_ptr);")); strings__Builder_writeln(&g->gowrappers, _SLIT("\treturn ret;")); } @@ -78213,10 +78503,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } sync__RwMutex_unlock(&g->threaded_fns->mtx);; if (should_register) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\ntypedef struct "), 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\ntypedef struct "), /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); if (expr.is_method) { string styp = v__gen__c__Gen_typ(g, expr.receiver_type); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" arg0;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" arg0;"), 0, { .d_c = 0 }}}))); } bool need_return_ptr = g->pref->os == v__pref__OS__windows && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type); if (expr.args.len == 0 && !need_return_ptr) { @@ -78225,21 +78515,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no for (int i = 0; i < expr.args.len; ++i) { v__ast__CallArg arg = ((v__ast__CallArg*)expr.args.data)[i]; string styp = v__gen__c__Gen_typ(g, arg.typ); - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" arg"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" arg"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } if (need_return_ptr) { strings__Builder_writeln(&g->type_definitions, _SLIT("\tvoid* ret_ptr;")); } - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); string thread_ret_type = (g->pref->os == v__pref__OS__windows ? (_SLIT("u32")) : (_SLIT("void*"))); - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = thread_ret_type}}, {_SLIT(" "), 0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *arg);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->gowrappers, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = thread_ret_type}}, {_SLIT(" "), 0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *arg) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = thread_ret_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *arg);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = thread_ret_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *arg) {"), 0, { .d_c = 0 }}}))); if (!v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { if (g->pref->os == v__pref__OS__windows) { - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t*(("), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("*)(arg->ret_ptr)) = "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t*(("), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("*)(arg->ret_ptr)) = "), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("* ret_ptr = malloc(sizeof("), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("* ret_ptr = malloc(sizeof("), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->gowrappers, _SLIT("\t*ret_ptr = ")); } } else { @@ -78248,25 +78538,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no if (expr.is_method) { v__ast__Type unwrapped_rec_type = v__gen__c__Gen_unwrap_generic(g, expr.receiver_type); v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(g->table, unwrapped_rec_type); - if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ )), expr.name)) { + if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ )), expr.name)) { string rec_cc_type = v__gen__c__Gen_cc_type(g, unwrapped_rec_type, false); string receiver_type_name = v__util__no_dots(rec_cc_type); - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(receiver_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(receiver_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->gowrappers, _SLIT("arg->arg0")); string dot = (v__ast__Type_is_ptr(expr.left_type) ? (_SLIT("->")) : (_SLIT("."))); string mname = v__gen__c__c_name(expr.name); - strings__Builder_write_string(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_"), 0xfe10, {.d_s = mname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_"), /*115 &string*/0xfe10, {.d_s = mname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->gowrappers, _SLIT("arg->arg0")); - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->gowrappers, _SLIT("arg->arg0")); } if (expr.args.len > 0) { strings__Builder_write_string(&g->gowrappers, _SLIT(", ")); } } else { - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } if (expr.args.len > 0) { bool has_cast = false; @@ -78284,7 +78574,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no Array_string rep_group = __new_array_with_default(0, 2 * expr.args.len, sizeof(string), 0); for (int i = 0; i < expr.args.len; ++i) { array_push((array*)&rep_group, _MOV((string[]){ string_clone(v__gen__c__Gen_expr_string(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(expr.args, i)).expr)) })); - array_push((array*)&rep_group, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("arg->arg"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&rep_group, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("arg->arg"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } call_args_str = string_replace_each(call_args_str, rep_group); strings__Builder_write_string(&g->gowrappers, call_args_str); @@ -78297,7 +78587,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } else if (arg_nr_muls < expected_nr_muls) { strings__Builder_write_string(&g->gowrappers, string_repeat(_SLIT("&"), expected_nr_muls - arg_nr_muls)); } - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("arg->arg"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("arg->arg"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i != expr.args.len - 1) { strings__Builder_write_string(&g->gowrappers, _SLIT(", ")); } @@ -78329,7 +78619,7 @@ VV_LOCAL_SYMBOL int v__gen__c__Gen_keep_alive_call_pregen(v__gen__c__Gen* g, v__ v__ast__CallArg arg = ((v__ast__CallArg*)node.args.data)[i]; v__ast__Type expected_type = (*(v__ast__Type*)/*ee elem_sym */array_get(node.expected_arg_types, i)); string typ = v__ast__Table_sym(g->table, expected_type)->cname; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = typ}}, {_SLIT(" __tmp_arg_"), 0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT(" __tmp_arg_"), /*100 &int*/0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_ref_or_deref_arg(g, arg, expected_type, node.language); v__gen__c__Gen_writeln(g, _SLIT(";")); } @@ -78343,7 +78633,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_keep_alive_call_postgen(v__gen__c__Gen* g, v for (int i = 0; i < node.expected_arg_types.len; ++i) { v__ast__Type expected_type = ((v__ast__Type*)node.expected_arg_types.data)[i]; if (v__ast__Type_is_ptr(expected_type) || v__ast__Type_is_pointer(expected_type)) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("GC_reachable_here(__tmp_arg_"), 0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("GC_reachable_here(__tmp_arg_"), /*100 &int*/0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } } @@ -78364,7 +78654,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_ref_or_deref_arg(v__gen__c__Gen* g, v if (arg.is_mut) { v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(g->table, arg_typ); if (exp_sym->kind == v__ast__Kind__array) { - if (((arg.expr)._typ == 266 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((arg.expr)._v__ast__Ident,(arg.expr)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ).kind == v__ast__IdentKind__variable) || (arg.expr)._typ == 286 /* v.ast.SelectorExpr */) { + if (((arg.expr)._typ == 267 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((arg.expr)._v__ast__Ident,(arg.expr)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ).kind == v__ast__IdentKind__variable) || (arg.expr)._typ == 287 /* v.ast.SelectorExpr */) { v__gen__c__Gen_write(g, _SLIT("&/*arr*/")); v__gen__c__Gen_expr(g, arg.expr); } else { @@ -78373,11 +78663,11 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_ref_or_deref_arg(v__gen__c__Gen* g, v v__gen__c__Gen_write(g, _SLIT("}[0]")); } return; - } else if (arg_sym->kind == v__ast__Kind__sum_type && exp_sym->kind == v__ast__Kind__sum_type && ((arg.expr)._typ == 266 /* v.ast.Ident */ || (arg.expr)._typ == 286 /* v.ast.SelectorExpr */)) { + } else if (arg_sym->kind == v__ast__Kind__sum_type && exp_sym->kind == v__ast__Kind__sum_type && ((arg.expr)._typ == 267 /* v.ast.Ident */ || (arg.expr)._typ == 287 /* v.ast.SelectorExpr */)) { v__gen__c__Gen_write(g, _SLIT("&/*sum*/")); v__gen__c__Gen_expr(g, arg.expr); return; - } else if (arg_sym->kind == v__ast__Kind__interface_ && exp_sym->kind == v__ast__Kind__interface_ && ((arg.expr)._typ == 266 /* v.ast.Ident */ || (arg.expr)._typ == 286 /* v.ast.SelectorExpr */)) { + } else if (arg_sym->kind == v__ast__Kind__interface_ && exp_sym->kind == v__ast__Kind__interface_ && ((arg.expr)._typ == 267 /* v.ast.Ident */ || (arg.expr)._typ == 287 /* v.ast.SelectorExpr */)) { v__gen__c__Gen_write(g, _SLIT("&/*iface*/")); v__gen__c__Gen_expr(g, arg.expr); return; @@ -78402,7 +78692,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_ref_or_deref_arg(v__gen__c__Gen* g, v v__gen__c__Gen_write(g, _SLIT("(voidptr)&/*qq*/")); } else { needs_closing = true; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, atype)}}, {_SLIT("/*qq*/, "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, atype)}}, {_SLIT("/*qq*/, "), 0, { .d_c = 0 }}}))); } } } @@ -78414,10 +78704,10 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_ref_or_deref_arg(v__gen__c__Gen* g, v v__gen__c__Gen_expr(g, arg.expr); v__gen__c__Gen_write(g, _SLIT("->val")); return; - } else if ((arg.expr)._typ == 246 /* v.ast.ArrayInit */) { + } else if ((arg.expr)._typ == 247 /* v.ast.ArrayInit */) { if ((*arg.expr._v__ast__ArrayInit).is_fixed) { if (!(*arg.expr._v__ast__ArrayInit).has_it) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*arg.expr._v__ast__ArrayInit).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*arg.expr._v__ast__ArrayInit).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } } } @@ -78514,7 +78804,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_write_fn_attrs(v__gen__c__Gen* g, Array_v_ } VV_LOCAL_SYMBOL string v__gen__c__call_convention_attribute(string cconvention, bool is_cc_msvc) { - string _t1 = (is_cc_msvc ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = cconvention}}, {_SLIT(" "), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), 0xfe10, {.d_s = cconvention}}, {_SLIT(")) "), 0, { .d_c = 0 }}})))); + string _t1 = (is_cc_msvc ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = cconvention}}, {_SLIT(" "), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), /*115 &string*/0xfe10, {.d_s = cconvention}}, {_SLIT(")) "), 0, { .d_c = 0 }}})))); return _t1; } @@ -78524,7 +78814,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_c_stmt(v__gen__c__Gen* g, v__ast__ForCSt g->is_vlines_enabled = false; g->inside_for_c_stmt = true; if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("{")); g->indent++; @@ -78552,19 +78842,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_c_stmt(v__gen__c__Gen* g, v__ast__ForCSt g->inside_for_c_stmt = false; v__gen__c__Gen_stmts(g, node.stmts); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); } } else { g->is_vlines_enabled = false; g->inside_for_c_stmt = true; if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("for (")); if (!node.has_init) { @@ -78589,11 +78879,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_c_stmt(v__gen__c__Gen* g, v__ast__ForCSt g->inside_for_c_stmt = false; v__gen__c__Gen_stmts(g, node.stmts); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); } } g->loop_depth--; @@ -78603,7 +78893,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_stmt(v__gen__c__Gen* g, v__ast__ForStmt g->loop_depth++; g->is_vlines_enabled = false; if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("for (;;) {")); if (!node.is_inf) { @@ -78617,11 +78907,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_stmt(v__gen__c__Gen* g, v__ast__ForStmt g->is_vlines_enabled = true; v__gen__c__Gen_stmts(g, node.stmts); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); } g->loop_depth--; } @@ -78629,26 +78919,26 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_stmt(v__gen__c__Gen* g, v__ast__ForStmt VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForInStmt node) { g->loop_depth++; if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.label}}, {_SLIT(": {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT(": {}"), 0, { .d_c = 0 }}}))); } if (node.is_range) { string i = (string__eq(node.val_var, _SLIT("_")) ? (v__gen__c__Gen_new_tmp_var(g)) : (v__gen__c__c_name(node.val_var))); v__ast__Type val_typ = v__ast__mktyp(node.val_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for ("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, val_typ)}}, {_SLIT(" "), 0xfe10, {.d_s = i}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for ("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, val_typ)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.high); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); } else if (node.kind == v__ast__Kind__array) { string styp = v__gen__c__Gen_typ(g, node.val_type); v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, node.val_type); string cond_var = _SLIT(""); - if ((node.cond)._typ == 266 /* v.ast.Ident */ || (node.cond)._typ == 286 /* v.ast.SelectorExpr */) { + if ((node.cond)._typ == 267 /* v.ast.Ident */ || (node.cond)._typ == 287 /* v.ast.SelectorExpr */) { cond_var = v__gen__c__Gen_expr_string(g, node.cond); } else { cond_var = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_write(g, v__gen__c__Gen_typ(g, node.cond_type)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); } @@ -78657,38 +78947,38 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn string share_accessor = (v__ast__Type_share(node.cond_type) == v__ast__ShareType__shared_t ? (_SLIT("val.")) : (_SLIT(""))); string op_field = string__plus(field_accessor, share_accessor); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); if (!string__eq(node.val_var, _SLIT("_"))) { if (val_sym->kind == v__ast__Kind__function) { v__gen__c__Gen_write(g, _SLIT("\t")); - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = ((voidptr*)"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = ((voidptr*)"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } else if (val_sym->kind == v__ast__Kind__array_fixed && !node.val_is_mut) { - string right = str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("data)["), 0xfe10, {.d_s = i}}, {_SLIT("]"), 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(*("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)"), 0xfe10, {.d_s = right}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + string right = str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("]"), 0, { .d_c = 0 }}})); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(*("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)"), /*115 &string*/0xfe10, {.d_s = right}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { - string right = (node.val_is_mut ? ( str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = styp}}, {_SLIT(")"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("data) + "), 0xfe10, {.d_s = i}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("data)["), 0xfe10, {.d_s = i}}, {_SLIT("]"), 0, { .d_c = 0 }}})))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = "), 0xfe10, {.d_s = right}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + string right = (node.val_is_mut ? ( str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("data) + "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("]"), 0, { .d_c = 0 }}})))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = right}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } else if (node.kind == v__ast__Kind__array_fixed) { string cond_var = _SLIT(""); bool cond_type_is_ptr = v__ast__Type_is_ptr(node.cond_type); - bool cond_is_literal = (node.cond)._typ == 246 /* v.ast.ArrayInit */; + bool cond_is_literal = (node.cond)._typ == 247 /* v.ast.ArrayInit */; if (cond_is_literal) { cond_var = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_write(g, v__gen__c__Gen_typ(g, node.cond_type)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); } else if (cond_type_is_ptr) { cond_var = v__gen__c__Gen_new_tmp_var(g); string cond_var_type = string_trim(v__gen__c__Gen_typ(g, node.cond_type), _SLIT("*")); if (!v__ast__Expr_is_lvalue(node.cond)) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var_type}}, {_SLIT(" *"), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = (("), 0xfe10, {.d_s = cond_var_type}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var_type}}, {_SLIT(" *"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = (("), /*115 &string*/0xfe10, {.d_s = cond_var_type}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var_type}}, {_SLIT(" *"), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var_type}}, {_SLIT(" *"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(");")); @@ -78697,43 +78987,43 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } string idx = ((string__eq(node.key_var, _SLIT("")) || string__eq(node.key_var, _SLIT("_"))) ? (v__gen__c__Gen_new_tmp_var(g)) : (node.key_var)); v__ast__TypeSymbol* cond_sym = v__ast__Table_sym(g->table, node.cond_type); - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((cond_sym->info)._v__ast__ArrayFixed,(cond_sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = idx}}, {_SLIT(" != "), 0xfe07, {.d_i32 = info.size}}, {_SLIT("; ++"), 0xfe10, {.d_s = idx}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((cond_sym->info)._v__ast__ArrayFixed,(cond_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" != "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT("; ++"), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); if (!string__eq(node.val_var, _SLIT("_"))) { v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, node.val_type); bool is_fixed_array = val_sym->kind == v__ast__Kind__array_fixed && !node.val_is_mut; if (val_sym->kind == v__ast__Kind__function) { v__gen__c__Gen_write(g, _SLIT("\t")); - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); } else if (is_fixed_array) { string styp = v__gen__c__Gen_typ(g, node.val_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(*("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)"), 0xfe10, {.d_s = cond_var}}, {_SLIT("["), 0xfe10, {.d_s = idx}}, {_SLIT("], sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(*("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("], sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { string styp = v__gen__c__Gen_typ(g, node.val_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (!is_fixed_array) { string addr = (node.val_is_mut ? (_SLIT("&")) : (_SLIT(""))); if (cond_type_is_ptr) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = addr}}, {_SLIT("(*"), 0xfe10, {.d_s = cond_var}}, {_SLIT(")["), 0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(")["), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } else if (cond_is_literal) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = addr}}, {_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT("["), 0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } } } else if (node.kind == v__ast__Kind__map) { string cond_var = _SLIT(""); - if ((node.cond)._typ == 266 /* v.ast.Ident */) { + if ((node.cond)._typ == 267 /* v.ast.Ident */) { cond_var = v__gen__c__Gen_expr_string(g, node.cond); } else { cond_var = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_write(g, v__gen__c__Gen_typ(g, node.cond_type)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); } @@ -78744,61 +79034,61 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn string idx = v__gen__c__Gen_new_tmp_var(g); string map_len = v__gen__c__Gen_new_tmp_var(g); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = map_len}}, {_SLIT(" = "), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = idx}}, {_SLIT(" < "), 0xfe10, {.d_s = map_len}}, {_SLIT("; ++"), 0xfe10, {.d_s = idx}}, {_SLIT(" ) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = map_len}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = map_len}}, {_SLIT("; ++"), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" ) {"), 0, { .d_c = 0 }}}))); g->indent++; string diff = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = diff}}, {_SLIT(" = "), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len - "), 0xfe10, {.d_s = map_len}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = map_len}}, {_SLIT(" = "), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = diff}}, {_SLIT(" < 0) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = idx}}, {_SLIT(" = -1;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = diff}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len - "), /*115 &string*/0xfe10, {.d_s = map_len}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = map_len}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = diff}}, {_SLIT(" < 0) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = -1;"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tcontinue;")); v__gen__c__Gen_writeln(g, _SLIT("}")); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if (!DenseArray_has_index(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT(")) {continue;}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if (!DenseArray_has_index(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(")) {continue;}"), 0, { .d_c = 0 }}}))); if (!string__eq(node.key_var, _SLIT("_"))) { string key_styp = v__gen__c__Gen_typ(g, node.key_type); string key = v__gen__c__c_name(node.key_var); - v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = key_styp}}, {_SLIT(" "), 0xfe10, {.d_s = key}}, {_SLIT(" = /*key*/ *("), 0xfe10, {.d_s = key_styp}}, {_SLIT("*)DenseArray_key(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = key_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" = /*key*/ *("), /*115 &string*/0xfe10, {.d_s = key_styp}}, {_SLIT("*)DenseArray_key(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); if (v__ast__Type_alias_eq(node.key_type, _const_v__ast__string_type)) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = key}}, {_SLIT(" = string_clone("), 0xfe10, {.d_s = key}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" = string_clone("), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } if (!string__eq(node.val_var, _SLIT("_"))) { v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, node.val_type); if (val_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 443) /*expected idx: 443, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); v__gen__c__Gen_write(g, _SLIT(" = (*(voidptr*)")); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("DenseArray_value(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("DenseArray_value(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else if (val_sym->kind == v__ast__Kind__array_fixed && !node.val_is_mut) { string val_styp = v__gen__c__Gen_typ(g, node.val_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("memcpy(*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)DenseArray_value(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = val_styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("memcpy(*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)DenseArray_value(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { string val_styp = v__gen__c__Gen_typ(g, node.val_type); if (v__ast__Type_is_ptr(node.val_type)) { if (node.val_is_mut) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = &(*("), 0xfe10, {.d_s = val_styp}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = &(*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = (*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = (*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } } else { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = (*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = (*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("DenseArray_value(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("DenseArray_value(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } } g->indent--; } else if (node.kind == v__ast__Kind__string) { - v__ast__Expr cond = ((node.cond)._typ == 290 /* v.ast.StringLiteral */ || (node.cond)._typ == 289 /* v.ast.StringInterLiteral */ ? (v__ast__CTempVar_to_sumtype_v__ast__Expr(ADDR(v__ast__CTempVar, (v__gen__c__Gen_new_ctemp_var_then_gen(g, node.cond, _const_v__ast__string_type))))) : (node.cond)); + v__ast__Expr cond = ((node.cond)._typ == 291 /* v.ast.StringLiteral */ || (node.cond)._typ == 290 /* v.ast.StringInterLiteral */ ? (v__ast__CTempVar_to_sumtype_v__ast__Expr(ADDR(v__ast__CTempVar, (v__gen__c__Gen_new_ctemp_var_then_gen(g, node.cond, _const_v__ast__string_type))))) : (node.cond)); string field_accessor = (v__ast__Type_is_ptr(node.cond_type) ? (_SLIT("->")) : (_SLIT("."))); string i = ((string__eq(node.key_var, _SLIT("")) || string__eq(node.key_var, _SLIT("_"))) ? (v__gen__c__Gen_new_tmp_var(g)) : (node.key_var)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, cond); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = field_accessor}}, {_SLIT("len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = field_accessor}}, {_SLIT("len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); if (!string__eq(node.val_var, _SLIT("_"))) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tu8 "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tu8 "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, cond); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = field_accessor}}, {_SLIT("str["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = field_accessor}}, {_SLIT("str["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } else if (node.kind == v__ast__Kind__struct_) { v__ast__TypeSymbol* cond_type_sym = v__ast__Table_sym(g->table, node.cond_type); @@ -78813,51 +79103,51 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn v__ast__Fn next_fn = (*(v__ast__Fn*)_t1.data); v__ast__Type ret_typ = next_fn.return_type; string t_expr = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.cond_type)}}, {_SLIT(" "), 0xfe10, {.d_s = t_expr}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.cond_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = t_expr}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); if (string__eq(node.key_var, _SLIT("")) || string__eq(node.key_var, _SLIT("_"))) { v__gen__c__Gen_writeln(g, _SLIT("while (1) {")); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for (size_t "), 0xfe10, {.d_s = node.key_var}}, {_SLIT(" = 0;; ++"), 0xfe10, {.d_s = node.key_var}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for (size_t "), /*115 &string*/0xfe10, {.d_s = node.key_var}}, {_SLIT(" = 0;; ++"), /*115 &string*/0xfe10, {.d_s = node.key_var}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); } string t_var = v__gen__c__Gen_new_tmp_var(g); v__ast__Type receiver_typ = (*(v__ast__Param*)/*ee elem_sym */array_get(next_fn.params, 0)).typ; string receiver_styp = v__gen__c__Gen_typ(g, receiver_typ); string fn_name = string__plus(string_replace_each(receiver_styp, new_array_from_c_array(4, 4, sizeof(string), _MOV((string[4]){_SLIT("*"), _SLIT(""), _SLIT("."), _SLIT("__")}))), _SLIT("_next")); v__ast__TypeSymbol* receiver_sym = v__ast__Table_sym(g->table, receiver_typ); - if ((receiver_sym->info)._typ == 416 /* v.ast.Struct */) { + if ((receiver_sym->info)._typ == 417 /* v.ast.Struct */) { if ((*receiver_sym->info._v__ast__Struct).concrete_types.len > 0) { fn_name = v__gen__c__Gen_generic_fn_name(g, (*receiver_sym->info._v__ast__Struct).concrete_types, fn_name, false); } } - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, ret_typ)}}, {_SLIT(" "), 0xfe10, {.d_s = t_var}}, {_SLIT(" = "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, ret_typ)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = t_var}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (!v__ast__Type_is_ptr(node.cond_type) && v__ast__Type_is_ptr(receiver_typ)) { v__gen__c__Gen_write(g, _SLIT("&")); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = t_expr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = t_var}}, {_SLIT(".state != 0) break;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = t_expr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = t_var}}, {_SLIT(".state != 0) break;"), 0, { .d_c = 0 }}}))); string val = ((string__eq(node.val_var, _SLIT("")) || string__eq(node.val_var, _SLIT("_"))) ? (v__gen__c__Gen_new_tmp_var(g)) : (node.val_var)); string val_styp = v__gen__c__Gen_typ(g, node.val_type); if (node.val_is_mut) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = val}}, {_SLIT(" = ("), 0xfe10, {.d_s = val_styp}}, {_SLIT(")"), 0xfe10, {.d_s = t_var}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = t_var}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = val}}, {_SLIT(" = *("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0xfe10, {.d_s = t_var}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = t_var}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } } else { string typ_str = v__ast__Table_type_to_str(g->table, node.cond_type); - v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for in: unhandled symbol `"), 0xfe10, {.d_s = v__ast__Expr_str(node.cond)}}, {_SLIT("` of type `"), 0xfe10, {.d_s = typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for in: unhandled symbol `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node.cond)}}, {_SLIT("` of type `"), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); VUNREACHABLE(); } v__gen__c__Gen_stmts(g, node.stmts); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); } if (node.kind == v__ast__Kind__map) { } v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); } g->loop_depth--; } @@ -78870,22 +79160,22 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_need_tmp_var_in_if(v__gen__c__Gen* g, v__ast } for (int _t2 = 0; _t2 < node.branches.len; ++_t2) { v__ast__IfBranch branch = ((v__ast__IfBranch*)node.branches.data)[_t2]; - if ((branch.cond)._typ == 268 /* v.ast.IfGuardExpr */ || branch.stmts.len > 1) { + if ((branch.cond)._typ == 269 /* v.ast.IfGuardExpr */ || branch.stmts.len > 1) { bool _t3 = true; return _t3; } if (branch.stmts.len == 1) { - if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 306 /* v.ast.ExprStmt */) { - v__ast__ExprStmt stmt = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._v__ast__ExprStmt,((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ, 306) /*expected idx: 306, name: v.ast.ExprStmt */ ; + if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 307 /* v.ast.ExprStmt */) { + v__ast__ExprStmt stmt = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._v__ast__ExprStmt,((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ; if (v__gen__c__is_noreturn_callexpr(stmt.expr)) { bool _t4 = true; return _t4; } - if ((stmt.expr)._typ == 276 /* v.ast.MatchExpr */) { + if ((stmt.expr)._typ == 277 /* v.ast.MatchExpr */) { bool _t5 = true; return _t5; } - if ((stmt.expr)._typ == 252 /* v.ast.CallExpr */) { + if ((stmt.expr)._typ == 253 /* v.ast.CallExpr */) { if ((*stmt.expr._v__ast__CallExpr).is_method) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, (*stmt.expr._v__ast__CallExpr).receiver_type); if (left_sym->kind == v__ast__Kind__array || left_sym->kind == v__ast__Kind__array_fixed || left_sym->kind == v__ast__Kind__map) { @@ -78920,9 +79210,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no string styp = v__gen__c__Gen_typ(g, node.typ); cur_line = v__gen__c__Gen_go_before_stmt(g, 0); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("; /* if prepend */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("; /* if prepend */"), 0, { .d_c = 0 }}}))); if (g->infix_left_var_name.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; } } else if (node.is_expr || g->inside_ternary != 0) { @@ -78957,16 +79247,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no for (int i = 0; i < node.branches.len; ++i) { v__ast__IfBranch branch = ((v__ast__IfBranch*)node.branches.data)[i]; v__ast__Expr cond = branch.cond; - if ((cond)._typ == 268 /* v.ast.IfGuardExpr */) { + if ((cond)._typ == 269 /* v.ast.IfGuardExpr */) { if (!is_guard) { is_guard = true; guard_idx = i; guard_vars = __new_array_with_default(node.branches.len, 0, sizeof(string), &(string[]){_SLIT("")}); } - if (((*cond._v__ast__IfGuardExpr).expr)._typ != 269 /* v.ast.IndexExpr */ && ((*cond._v__ast__IfGuardExpr).expr)._typ != 283 /* v.ast.PrefixExpr */) { + if (((*cond._v__ast__IfGuardExpr).expr)._typ != 270 /* v.ast.IndexExpr */ && ((*cond._v__ast__IfGuardExpr).expr)._typ != 284 /* v.ast.PrefixExpr */) { string var_name = v__gen__c__Gen_new_tmp_var(g); array_set(&guard_vars, i, &(string[]) { var_name }); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*cond._v__ast__IfGuardExpr).expr_type)}}, {_SLIT(" "), 0xfe10, {.d_s = var_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*cond._v__ast__IfGuardExpr).expr_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { array_set(&guard_vars, i, &(string[]) { _SLIT("") }); } @@ -78981,9 +79271,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no v__gen__c__Gen_writeln(g, _SLIT("{")); if (is_guard && guard_idx == i - 1) { string cvar_name = (*(string*)/*ee elem_sym */array_get(guard_vars, guard_idx)); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError err = "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError err = "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); } - } else if ((branch.cond)._typ == 268 /* v.ast.IfGuardExpr */) { + } else if ((branch.cond)._typ == 269 /* v.ast.IfGuardExpr */) { string var_name = (*(string*)/*ee elem_sym */array_get(guard_vars, i)); bool short_opt = false; if ((var_name).len == 0) { @@ -78991,17 +79281,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no var_name = v__gen__c__Gen_new_tmp_var(g); array_set(&guard_vars, i, &(string[]) { var_name }); g->tmp_count--; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = var_name}}, {_SLIT(".state == 0) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".state == 0) {"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*branch.cond._v__ast__IfGuardExpr).expr); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe10, {.d_s = var_name}}, {_SLIT(".state == 0) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".state == 0) {"), 0, { .d_c = 0 }}}))); } if (short_opt || !string__eq((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name, _SLIT("_"))) { string base_type = v__gen__c__Gen_base_type(g, (*branch.cond._v__ast__IfGuardExpr).expr_type); if (short_opt) { - string cond_var_name = (string__eq((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name, _SLIT("_")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_dummy_"), 0xfe07, {.d_i32 = g->tmp_count + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = base_type}}, {_SLIT(" "), 0xfe10, {.d_s = cond_var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + string cond_var_name = (string__eq((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name, _SLIT("_")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_dummy_"), /*100 &int*/0xfe07, {.d_i32 = g->tmp_count + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name)); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*branch.cond._v__ast__IfGuardExpr).expr); v__gen__c__Gen_writeln(g, _SLIT(";")); } else { @@ -79017,9 +79307,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no if ((*branch.cond._v__ast__IfGuardExpr).vars.len == 1) { string left_var_name = v__gen__c__c_name((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name); if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = base_type}}, {_SLIT("* "), 0xfe10, {.d_s = left_var_name}}, {_SLIT(" = HEAP("), 0xfe10, {.d_s = base_type}}, {_SLIT(", *("), 0xfe10, {.d_s = base_type}}, {_SLIT("*)"), 0xfe10, {.d_s = var_name}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = left_var_name}}, {_SLIT(" = HEAP("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT(", *("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = base_type}}, {_SLIT(" "), 0xfe10, {.d_s = left_var_name}}, {_SLIT(" = *("), 0xfe10, {.d_s = base_type}}, {_SLIT("*)"), 0xfe10, {.d_s = var_name}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = left_var_name}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } } else if ((*branch.cond._v__ast__IfGuardExpr).vars.len > 1) { for (int vi = 0; vi < (*branch.cond._v__ast__IfGuardExpr).vars.len; ++vi) { @@ -79027,13 +79317,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no string left_var_name = v__gen__c__c_name(var.name); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*branch.cond._v__ast__IfGuardExpr).expr_type); if (sym->kind == v__ast__Kind__multi_return) { - v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 442) /*expected idx: 442, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; if (mr_info.types.len == (*branch.cond._v__ast__IfGuardExpr).vars.len) { string var_typ = v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get(mr_info.types, vi))); if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = var_typ}}, {_SLIT("* "), 0xfe10, {.d_s = left_var_name}}, {_SLIT(" = (HEAP("), 0xfe10, {.d_s = base_type}}, {_SLIT(", *("), 0xfe10, {.d_s = base_type}}, {_SLIT("*)"), 0xfe10, {.d_s = var_name}}, {_SLIT(".data).arg"), 0xfe07, {.d_i32 = vi}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = var_typ}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = left_var_name}}, {_SLIT(" = (HEAP("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT(", *("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".data).arg"), /*100 &int*/0xfe07, {.d_i32 = vi}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = var_typ}}, {_SLIT(" "), 0xfe10, {.d_s = left_var_name}}, {_SLIT(" = (*("), 0xfe10, {.d_s = base_type}}, {_SLIT("*)"), 0xfe10, {.d_s = var_name}}, {_SLIT(".data).arg"), 0xfe07, {.d_i32 = vi}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = var_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = left_var_name}}, {_SLIT(" = (*("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".data).arg"), /*100 &int*/0xfe07, {.d_i32 = vi}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } @@ -79043,8 +79333,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no } } else { bool no_needs_par = false; - if ((branch.cond)._typ == 270 /* v.ast.InfixExpr */) { - if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_in && ((*branch.cond._v__ast__InfixExpr).left)._typ != 270 /* v.ast.InfixExpr */ && ((*branch.cond._v__ast__InfixExpr).right)._typ == 246 /* v.ast.ArrayInit */) { + if ((branch.cond)._typ == 271 /* v.ast.InfixExpr */) { + if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_in && ((*branch.cond._v__ast__InfixExpr).left)._typ != 271 /* v.ast.InfixExpr */ && ((*branch.cond._v__ast__InfixExpr).right)._typ == 247 /* v.ast.ArrayInit */) { no_needs_par = true; } } @@ -79083,7 +79373,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no v__gen__c__Gen_writeln(g, _SLIT("}")); } g->empty_line = false; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (v__ast__Type_has_flag(node.typ, v__ast__TypeFlag__optional)) { g->inside_if_optional = false; @@ -79091,7 +79381,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no } VV_LOCAL_SYMBOL void v__gen__c__Gen_index_expr(v__gen__c__Gen* g, v__ast__IndexExpr node) { - if ((node.index)._typ == 284 /* v.ast.RangeExpr */) { + if ((node.index)._typ == 285 /* v.ast.RangeExpr */) { v__gen__c__Gen_range_expr(g, node, (*node.index._v__ast__RangeExpr)); } else { v__ast__TypeSymbol* sym = v__ast__Table_final_sym(g->table, node.left_type); @@ -79115,7 +79405,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_expr(v__gen__c__Gen* g, v__ast__IndexE string cur_line = v__gen__c__Gen_go_before_stmt(g, 0); strings__Builder_write_string(&g->out, v__util__tabs(g->indent)); string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(_const_v__ast__byte_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = string_at_with_check("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = string_at_with_check("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_expr(g, node.index); @@ -79123,7 +79413,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_expr(v__gen__c__Gen* g, v__ast__IndexE if (!node.is_option) { v__gen__c__Gen_or_block(g, tmp_opt, node.or_expr, _const_v__ast__byte_type); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*(byte*)&"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT("*(byte*)&"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("string_at(")); v__gen__c__Gen_expr(g, node.left); @@ -79156,7 +79446,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE cur_line = v__gen__c__Gen_go_before_stmt(g, 0); strings__Builder_write_string(&g->out, v__util__tabs(g->indent)); string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(_const_v__ast__string_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = string_substr_with_check("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = string_substr_with_check("), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("string_substr(")); } @@ -79169,8 +79459,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE if (!range.has_high) { tmp_left = v__gen__c__Gen_new_tmp_var(g); string tmp_type = v__gen__c__Gen_typ(g, node.left_type); - v__gen__c__Gen_insert_before_stmt(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__util__tabs(g->indent)}}, {_SLIT0, 0xfe10, {.d_s = tmp_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_left}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = tmp_left}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_insert_before_stmt(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__util__tabs(g->indent)}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_left}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = tmp_left}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); } @@ -79188,16 +79478,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE v__gen__c__Gen_write(g, tmp_left); } } else if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; string noscan = v__gen__c__Gen_check_noscan(g, info.elem_type); if (node.is_gated) { v__gen__c__Gen_write(g, _SLIT("array_slice_ni(")); } else { v__gen__c__Gen_write(g, _SLIT("array_slice(")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); string ctype = v__gen__c__Gen_typ(g, info.elem_type); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = info.size}}, {_SLIT(", "), 0xfe07, {.d_i32 = info.size}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = ctype}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = ctype}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(node.left_type)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -79216,13 +79506,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE if (range.has_high) { v__gen__c__Gen_expr(g, range.high); } else if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = info.size}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__array) { if (v__ast__Type_is_ptr(node.left_type)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_left}}, {_SLIT("->"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_left}}, {_SLIT("->"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_left}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_left}}, {_SLIT("."), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("len)")); } else { @@ -79235,28 +79525,28 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE if (!node.is_option) { v__gen__c__Gen_or_block(g, tmp_opt, node.or_expr, _const_v__ast__string_type); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*(string*)&"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT("*(string*)&"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); } } VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__IndexExpr node, v__ast__TypeSymbol sym) { bool gen_or = node.or_expr.kind != v__ast__OrKind__absent || node.is_option; bool left_is_ptr = v__ast__Type_is_ptr(node.left_type); - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); v__ast__Type elem_type = info.elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type); if (elem_sym->kind == v__ast__Kind__function) { elem_type_str = _SLIT("voidptr"); } - bool is_selector = (node.left)._typ == 286 /* v.ast.SelectorExpr */; + bool is_selector = (node.left)._typ == 287 /* v.ast.SelectorExpr */; if (g->is_assign_lhs && !is_selector && node.is_setter) { bool is_direct_array_access = (g->fn_decl != 0 && g->fn_decl->is_direct_arr) || node.is_direct; bool is_op_assign = g->assign_op != v__token__Kind__assign && !v__ast__Type_alias_eq(info.elem_type, _const_v__ast__string_type); if (is_direct_array_access) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } else if (is_op_assign) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)array_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)array_get("), 0, { .d_c = 0 }}}))); if (left_is_ptr && !v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -79290,7 +79580,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In if (!is_op_assign) { bool need_wrapper = true; if (need_wrapper) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT(", &")); } @@ -79314,24 +79604,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In string tmp_opt = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); string tmp_opt_ptr = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); if (gen_or) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT("* "), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(" = ("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_ptr_typ */(array_get_with_check("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_ptr_typ */(array_get_with_check("), 0, { .d_c = 0 }}}))); } else { if (needs_clone) { v__gen__c__Gen_write(g, _SLIT("/*2*/string_clone(")); } if (g->is_fn_index_call) { - if ((elem_sym->info)._typ == 443 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 444 /* v.ast.FnType */) { v__gen__c__Gen_write(g, _SLIT("((")); v__gen__c__Gen_write_fn_ptr_decl(g, &(*elem_sym->info._v__ast__FnType), _SLIT("")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); } if (left_is_ptr && !v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("*")); } } else if (is_direct_array_access) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); if (left_is_ptr && !v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -79369,25 +79659,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In if (gen_or) { v__gen__c__Gen_writeln(g, _SLIT(";")); string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(elem_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)&"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data) = *(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)&"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data) = *(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("} else {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".state = 2; "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".err = _v_error(_SLIT(\"array index out of range\"));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".state = 2; "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".err = _v_error(_SLIT(\"array index out of range\"));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); 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"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 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 }}}))); } } } VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_fixed_array(v__gen__c__Gen* g, v__ast__IndexExpr node, v__ast__TypeSymbol sym) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym.info)._v__ast__ArrayFixed,(sym.info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym.info)._v__ast__ArrayFixed,(sym.info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; v__ast__Type elem_type = info.elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type); - bool is_fn_index_call = g->is_fn_index_call && (elem_sym->info)._typ == 443 /* v.ast.FnType */; + bool is_fn_index_call = g->is_fn_index_call && (elem_sym->info)._typ == 444 /* v.ast.FnType */; if (is_fn_index_call) { v__gen__c__Gen_write(g, _SLIT("(*")); } @@ -79400,12 +79690,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_fixed_array(v__gen__c__Gen* g, v__a } v__gen__c__Gen_write(g, _SLIT("[")); bool direct = g->fn_decl != 0 && g->fn_decl->is_direct_arr; - if ((direct || (node.index)._typ == 271 /* v.ast.IntegerLiteral */) || g->pref->translated) { + if ((direct || (node.index)._typ == 272 /* v.ast.IntegerLiteral */) || g->pref->translated) { v__gen__c__Gen_expr(g, node.index); } else { v__gen__c__Gen_write(g, _SLIT("v_fixed_index(")); v__gen__c__Gen_expr(g, node.index); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe07, {.d_i32 = info.size}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("]")); if (is_fn_index_call) { @@ -79416,7 +79706,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_fixed_array(v__gen__c__Gen* g, v__a VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__IndexExpr node, v__ast__TypeSymbol sym) { bool gen_or = node.or_expr.kind != v__ast__OrKind__absent || node.is_option; bool left_is_ptr = v__ast__Type_is_ptr(node.left_type); - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; string key_type_str = v__gen__c__Gen_typ(g, info.key_type); v__ast__Type elem_type = info.value_type; string elem_type_str = v__gen__c__Gen_typ(g, elem_type); @@ -79431,15 +79721,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde v__gen__c__Gen_write(g, _SLIT("map_set(")); } else { if (node.is_setter) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get_and_set((map*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get_and_set((map*)"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get((map*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get((map*)"), 0, { .d_c = 0 }}}))); } } if (!left_is_ptr || v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("&")); } - if ((node.left)._typ == 269 /* v.ast.IndexExpr */) { + if ((node.left)._typ == 270 /* v.ast.IndexExpr */) { g->inside_map_index = true; v__gen__c__Gen_expr(g, node.left); g->inside_map_index = false; @@ -79449,7 +79739,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde if (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("->val")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); bool old_is_arraymap_set = g->is_arraymap_set; bool old_is_assign_lhs = g->is_assign_lhs; g->is_arraymap_set = false; @@ -79459,17 +79749,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde g->is_assign_lhs = old_is_assign_lhs; v__gen__c__Gen_write(g, _SLIT("}")); g->arraymap_set_pos = g->out.len; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); if (g->assign_op != v__token__Kind__assign && !v__ast__Type_alias_eq(info.value_type, _const_v__ast__string_type)) { string zero = v__gen__c__Gen_type_default(g, info.value_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = zero}}, {_SLIT(" })))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" })))"), 0, { .d_c = 0 }}}))); } } else if (g->inside_map_postfix || g->inside_map_infix || g->inside_map_index || (g->is_assign_lhs && !g->is_arraymap_set && get_and_set_types)) { string zero = v__gen__c__Gen_type_default(g, info.value_type); if (node.is_setter) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get_and_set((map*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get_and_set((map*)"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get((map*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get((map*)"), 0, { .d_c = 0 }}}))); } if (!left_is_ptr || v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("&")); @@ -79478,9 +79768,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde if (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("->val")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.index); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("}, &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" }))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("}, &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" }))"), 0, { .d_c = 0 }}}))); } else { string zero = v__gen__c__Gen_type_default(g, info.value_type); bool is_gen_or_and_assign_rhs = gen_or && !g->discard_or_result; @@ -79496,16 +79786,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde string tmp_opt = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); string tmp_opt_ptr = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); if (gen_or) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT("* "), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(" = ("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_ptr_typ */(map_get_check("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_ptr_typ */(map_get_check("), 0, { .d_c = 0 }}}))); } else { if (g->is_fn_index_call) { - if ((elem_sym->info)._typ == 443 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 444 /* v.ast.FnType */) { v__gen__c__Gen_write(g, _SLIT("((")); v__gen__c__Gen_write_fn_ptr_decl(g, &(*elem_sym->info._v__ast__FnType), _SLIT("")); v__gen__c__Gen_write(g, _SLIT(")(*(voidptr*)map_get(")); } } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get("), 0, { .d_c = 0 }}}))); } } if (!left_is_ptr || v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { @@ -79522,36 +79812,36 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde v__gen__c__Gen_write(g, _SLIT(".val")); } } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("), &("), 0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("), &("), /*115 &string*/0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.index); v__gen__c__Gen_write(g, _SLIT("}")); if (gen_or) { v__gen__c__Gen_write(g, _SLIT("))")); } else if (g->is_fn_index_call) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &(voidptr[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" })))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &(voidptr[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" })))"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" }))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" }))"), 0, { .d_c = 0 }}}))); } if (gen_or) { v__gen__c__Gen_writeln(g, _SLIT(";")); string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(elem_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)&"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data) = *(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)&"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data) = *(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("} else {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".state = 2; "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".err = _v_error(_SLIT(\"array index out of range\"));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".state = 2; "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".err = _v_error(_SLIT(\"array index out of range\"));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); 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"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 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 }}}))); } } } VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr(v__gen__c__Gen* g, v__ast__InfixExpr node) { if ((node.auto_locked).len != 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_lock(&"), 0xfe10, {.d_s = node.auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_lock(&"), /*115 &string*/0xfe10, {.d_s = node.auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); } switch (node.op) { case v__token__Kind__arrow: @@ -79717,22 +80007,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr(v__gen__c__Gen* g, v__ast__InfixE ; if ((node.auto_locked).len != 0) { v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_unlock(&"), 0xfe10, {.d_s = node.auto_locked}}, {_SLIT("->mtx)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_unlock(&"), /*115 &string*/0xfe10, {.d_s = node.auto_locked}}, {_SLIT("->mtx)"), 0, { .d_c = 0 }}}))); } } VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_arrow_op(v__gen__c__Gen* g, v__ast__InfixExpr node) { v__gen__c__Type left = v__gen__c__Gen_unwrap(g, node.left_type); string styp = left.sym->cname; - v__ast__Type elem_type = (/* as */ *(v__ast__Chan*)__as_cast((left.sym->info)._v__ast__Chan,(left.sym->info)._typ, 440) /*expected idx: 440, name: v.ast.Chan */ ).elem_type; + v__ast__Type elem_type = (/* as */ *(v__ast__Chan*)__as_cast((left.sym->info)._v__ast__Chan,(left.sym->info)._typ, 441) /*expected idx: 441, name: v.ast.Chan */ ).elem_type; bool gen_or = node.or_block.kind != v__ast__OrKind__absent; string tmp_opt = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); if (gen_or) { string elem_styp = v__gen__c__Gen_typ(g, elem_type); v__gen__c__Gen_register_chan_push_optional_fn(g, elem_styp, styp); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); @@ -79751,15 +80041,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ v__gen__c__Type left = v__gen__c__Gen_unwrap(g, node.left_type); v__gen__c__Type right = v__gen__c__Gen_unwrap(g, node.right_type); bool has_defined_eq_operator = v__ast__Table_has_method(g->table, left.sym, _SLIT("==")); - bool has_alias_eq_op_overload = (left.sym->info)._typ == 431 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(left.sym, _SLIT("==")); + bool has_alias_eq_op_overload = (left.sym->info)._typ == 432 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(left.sym, _SLIT("==")); if ((v__ast__Type_is_ptr(left.typ) && v__ast__Type_is_int(right.typ)) || (v__ast__Type_is_ptr(right.typ) && v__ast__Type_is_int(left.typ))) { v__gen__c__Gen_gen_plain_infix_expr(g, node); - } else if ((v__ast__Type_idx(left.typ) == _const_v__ast__string_type_idx || (!has_defined_eq_operator && v__ast__Type_idx(left.unaliased) == _const_v__ast__string_type_idx)) && (node.right)._typ == 290 /* v.ast.StringLiteral */ && ((/* as */ *(v__ast__StringLiteral*)__as_cast((node.right)._v__ast__StringLiteral,(node.right)._typ, 290) /*expected idx: 290, name: v.ast.StringLiteral */ ).val).len == 0) { + } else if ((v__ast__Type_idx(left.typ) == _const_v__ast__string_type_idx || (!has_defined_eq_operator && v__ast__Type_idx(left.unaliased) == _const_v__ast__string_type_idx)) && (node.right)._typ == 291 /* v.ast.StringLiteral */ && ((/* as */ *(v__ast__StringLiteral*)__as_cast((node.right)._v__ast__StringLiteral,(node.right)._typ, 291) /*expected idx: 291, name: v.ast.StringLiteral */ ).val).len == 0) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(")")); string arrow = (v__ast__Type_is_ptr(left.typ) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arrow}}, {_SLIT("len "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" 0"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arrow}}, {_SLIT("len "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" 0"), 0, { .d_c = 0 }}}))); } else if (has_defined_eq_operator) { if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); @@ -79784,7 +80074,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -79803,7 +80093,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ) && !v__ast__Type_has_flag(left.typ, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -79828,22 +80118,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((node.left)._typ == 246 /* v.ast.ArrayInit */) { + if ((node.left)._typ == 247 /* v.ast.ArrayInit */) { if (!(*node.left._v__ast__ArrayInit).has_it) { string s = v__gen__c__Gen_typ(g, left.unaliased); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); - if ((node.right)._typ == 246 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 247 /* v.ast.ArrayInit */) { if (!(*node.right._v__ast__ArrayInit).has_it) { string s = v__gen__c__Gen_typ(g, right.unaliased); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_expr(g, node.right); @@ -79856,7 +80146,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -79875,7 +80165,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -79894,7 +80184,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -79913,7 +80203,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -79984,11 +80274,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_cmp_op(v__gen__c__Gen* g, v__ast_ v__gen__c__Type left = v__gen__c__Gen_unwrap(g, node.left_type); v__gen__c__Type right = v__gen__c__Gen_unwrap(g, node.right_type); bool has_operator_overloading = v__ast__Table_has_method(g->table, left.sym, _SLIT("<")); - if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).generic_types.len > 0) { + if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).generic_types.len > 0) { if (node.op == v__token__Kind__le || node.op == v__token__Kind__ge) { v__gen__c__Gen_write(g, _SLIT("!")); } - Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).concrete_types; + Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).concrete_types; string method_name = string__plus(left.sym->cname, _SLIT("__lt")); method_name = v__gen__c__Gen_generic_fn_name(g, concrete_types, method_name, true); v__gen__c__Gen_write(g, method_name); @@ -80065,7 +80355,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } if (right.unaliased_sym->kind == v__ast__Kind__array) { if (left.sym->kind == v__ast__Kind__sum_type || left.sym->kind == v__ast__Kind__interface_) { - if ((node.right)._typ == 246 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 247 /* v.ast.ArrayInit */) { if ((*node.right._v__ast__ArrayInit).exprs.len > 0) { Array_v__ast__InfixExpr infix_exprs = __new_array_with_default(0, 0, sizeof(v__ast__InfixExpr), 0); for (int i = 0; i < (*node.right._v__ast__ArrayInit).exprs.len; ++i) { @@ -80078,7 +80368,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } } } - if ((node.right)._typ == 246 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 247 /* v.ast.ArrayInit */) { if ((*node.right._v__ast__ArrayInit).exprs.len > 0) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_infix_expr_in_optimization(g, node.left, (*node.right._v__ast__ArrayInit)); @@ -80086,7 +80376,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ return; } } - if ((right.sym->info)._typ == 411 /* v.ast.Array */) { + if ((right.sym->info)._typ == 412 /* v.ast.Array */) { v__ast__Type elem_type = (*right.sym->info._v__ast__Array).elem_type; v__gen__c__Type elem_type_ = v__gen__c__Gen_unwrap(g, elem_type); if (elem_type_.sym->kind == v__ast__Kind__sum_type) { @@ -80102,7 +80392,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_write(g, _SLIT("_IN_MAP(")); if (!v__ast__Type_is_ptr(left.typ)) { string styp = v__gen__c__Gen_typ(g, node.left_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(")")); } else { @@ -80122,7 +80412,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_write(g, _SLIT(")")); } else if (right.unaliased_sym->kind == v__ast__Kind__array_fixed) { if (left.sym->kind == v__ast__Kind__sum_type || left.sym->kind == v__ast__Kind__interface_) { - if ((node.right)._typ == 246 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 247 /* v.ast.ArrayInit */) { if ((*node.right._v__ast__ArrayInit).exprs.len > 0) { Array_v__ast__InfixExpr infix_exprs = __new_array_with_default(0, 0, sizeof(v__ast__InfixExpr), 0); for (int i = 0; i < (*node.right._v__ast__ArrayInit).exprs.len; ++i) { @@ -80135,7 +80425,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } } } - if ((node.right)._typ == 246 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 247 /* v.ast.ArrayInit */) { if ((*node.right._v__ast__ArrayInit).exprs.len > 0) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_infix_expr_in_optimization(g, node.left, (*node.right._v__ast__ArrayInit)); @@ -80143,7 +80433,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ return; } } - if ((right.sym->info)._typ == 411 /* v.ast.Array */) { + if ((right.sym->info)._typ == 412 /* v.ast.Array */) { v__ast__Type elem_type = (*right.sym->info._v__ast__Array).elem_type; v__gen__c__Type elem_type_ = v__gen__c__Gen_unwrap(g, elem_type); if (elem_type_.sym->kind == v__ast__Kind__sum_type) { @@ -80175,17 +80465,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_optimization(v__gen__c__Gen* g } else { string ptr_typ = v__gen__c__Gen_equality_fn(g, right.elem_type); if (elem_sym->kind == v__ast__Kind__alias) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__map) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__struct_) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_expr(g, left); @@ -80208,7 +80498,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, node.left_type); bool is_aggregate = left_sym->kind == v__ast__Kind__aggregate; if (is_aggregate) { - v__ast__Type parent_left_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 429) /*expected idx: 429, name: v.ast.Aggregate */ ).sum_type; + v__ast__Type parent_left_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 430) /*expected idx: 430, name: v.ast.Aggregate */ ).sum_type; left_sym = v__ast__Table_sym(g->table, parent_left_type); } v__ast__TypeSymbol* right_sym = v__ast__Table_sym(g->table, node.right_type); @@ -80219,7 +80509,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ string cmp_op = (node.op == v__token__Kind__key_is ? (_SLIT("==")) : (_SLIT("!="))); v__gen__c__Gen_write(g, _SLIT("(")); if (is_aggregate) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(node.left)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node.left)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, node.left); } @@ -80230,12 +80520,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_write(g, _SLIT(".")); } if (left_sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_typ "), 0xfe10, {.d_s = cmp_op}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_typ "), /*115 &string*/0xfe10, {.d_s = cmp_op}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); v__ast__Type _t1 = 0; - if (node.right._typ == 292 /* v.ast.TypeNode */) { + if (node.right._typ == 293 /* v.ast.TypeNode */) { _t1 = v__gen__c__Gen_unwrap_generic(g, (*node.right._v__ast__TypeNode).typ); } - else if (node.right._typ == 278 /* v.ast.None */) { + else if (node.right._typ == 279 /* v.ast.None */) { _t1 = (*(int*)map_get(ADDR(map, g->table->type_idxs), &(string[]){_SLIT("None__")}, &(int[]){ 0 })); } @@ -80244,10 +80534,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ } v__ast__Type sub_type = _t1; v__ast__TypeSymbol* sub_sym = v__ast__Table_sym(g->table, sub_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = left_sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = left_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index"), 0, { .d_c = 0 }}}))); return; } else if (left_sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_typ "), 0xfe10, {.d_s = cmp_op}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_typ "), /*115 &string*/0xfe10, {.d_s = cmp_op}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.right); } @@ -80255,7 +80545,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_interface_is_op(v__gen__c__Gen* g, v__ast__InfixExpr node) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, node.left_type); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(g->table, node.right_type); - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((left_sym->info)._v__ast__Interface,(left_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((left_sym->info)._v__ast__Interface,(left_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; Array_v__ast__Type* _t2 = (Array_v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, info.conversions), &(int[]){node.right_type})); Option_Array_v__ast__Type _t1 = {0}; if (_t2) { @@ -80290,7 +80580,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_interface_is_op(v__gen__c__Gen* g, v__as v__gen__c__Gen_write(g, _SLIT("false")); return; } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), 0xfe10, {.d_s = left_sym->cname}}, {_SLIT("_is_I_"), 0xfe10, {.d_s = right_sym->cname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), /*115 &string*/0xfe10, {.d_s = left_sym->cname}}, {_SLIT("_is_I_"), /*115 &string*/0xfe10, {.d_s = right_sym->cname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(node.left_type)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -80301,8 +80591,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_interface_is_op(v__gen__c__Gen* g, v__as VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_arithmetic_op(v__gen__c__Gen* g, v__ast__InfixExpr node) { v__gen__c__Type left = v__gen__c__Gen_unwrap(g, node.left_type); v__gen__c__Type right = v__gen__c__Gen_unwrap(g, node.right_type); - if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).generic_types.len > 0) { - Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ).concrete_types; + if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).generic_types.len > 0) { + Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).concrete_types; string method_name = string__plus(string__plus(left.sym->cname, _SLIT("_")), v__util__replace_op(v__token__Kind_str(node.op))); method_name = v__gen__c__Gen_generic_fn_name(g, concrete_types, method_name, true); v__gen__c__Gen_write(g, method_name); @@ -80337,10 +80627,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, v__gen__c__Type right = v__gen__c__Gen_unwrap(g, node.right_type); if (left.unaliased_sym->kind == v__ast__Kind__array) { string tmp_var = v__gen__c__Gen_new_tmp_var(g); - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left.unaliased_sym->info)._v__ast__Array,(left.unaliased_sym->info)._typ, 411) /*expected idx: 411, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left.unaliased_sym->info)._v__ast__Array,(left.unaliased_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; string noscan = v__gen__c__Gen_check_noscan(g, array_info.elem_type); if (right.unaliased_sym->kind == v__ast__Kind__array && !v__ast__Type_alias_eq(array_info.elem_type, right.typ)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_PUSH_MANY"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_PUSH_MANY"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__ast__Type expected_push_many_atype = left.typ; bool is_shared = v__ast__Type_has_flag(expected_push_many_atype, v__ast__TypeFlag__shared_f); if (!v__ast__Type_is_ptr(expected_push_many_atype)) { @@ -80361,12 +80651,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, v__gen__c__Gen_write(g, _SLIT(", (")); v__gen__c__Gen_expr_with_cast(g, node.right, node.right_type, v__ast__Type_clear_flag(left.unaliased, v__ast__TypeFlag__shared_f)); string styp = v__gen__c__Gen_typ(g, expected_push_many_atype); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("), "), 0xfe10, {.d_s = tmp_var}}, {_SLIT(", "), 0xfe10, {.d_s = styp}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("), "), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { string elem_type_str = v__gen__c__Gen_typ(g, array_info.elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, array_info.elem_type); - bool elem_is_array_var = (elem_sym->kind == v__ast__Kind__array || elem_sym->kind == v__ast__Kind__array_fixed) && (node.right)._typ == 266 /* v.ast.Ident */; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_push"), 0xfe10, {.d_s = noscan}}, {_SLIT("((array*)"), 0, { .d_c = 0 }}}))); + bool elem_is_array_var = (elem_sym->kind == v__ast__Kind__array || elem_sym->kind == v__ast__Kind__array_fixed) && (node.right)._typ == 267 /* v.ast.Ident */; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_push"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("((array*)"), 0, { .d_c = 0 }}}))); if (!v__ast__Type_is_ptr(left.typ) || (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) && !v__ast__Type_is_ptr(v__ast__Type_deref(node.left_type)))) { v__gen__c__Gen_write(g, _SLIT("&")); } @@ -80378,9 +80668,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, v__gen__c__Gen_write(g, _SLIT(", _MOV((voidptr[]){ ")); } else if (elem_is_array_var) { string addr = (elem_sym->kind == v__ast__Kind__array_fixed ? (_SLIT("")) : (_SLIT("&"))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", _MOV(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", _MOV(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), 0, { .d_c = 0 }}}))); } bool needs_clone = !g->is_builtin_mod && v__ast__Type_idx(array_info.elem_type) == _const_v__ast__string_type_idx && v__ast__Type_nr_muls(array_info.elem_type) == 0; if (needs_clone) { @@ -80402,37 +80692,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, } VV_LOCAL_SYMBOL bool v__gen__c__Gen_need_tmp_var_in_array_call(v__gen__c__Gen* g, v__ast__Expr node) { - if (node._typ == 252 /* v.ast.CallExpr */) { + if (node._typ == 253 /* v.ast.CallExpr */) { if ((*node._v__ast__CallExpr).left_type != 0 && v__ast__Table_sym(g->table, (*node._v__ast__CallExpr).left_type)->kind == v__ast__Kind__array && (string__eq((*node._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*node._v__ast__CallExpr).name, _SLIT("any")) || string__eq((*node._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*node._v__ast__CallExpr).name, _SLIT("map")))) { bool _t1 = true; return _t1; } } - else if (node._typ == 269 /* v.ast.IndexExpr */) { + else if (node._typ == 270 /* v.ast.IndexExpr */) { bool _t2 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__IndexExpr).left); return _t2; } - else if (node._typ == 270 /* v.ast.InfixExpr */) { + else if (node._typ == 271 /* v.ast.InfixExpr */) { bool _t3 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__InfixExpr).left) || v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__InfixExpr).right); return _t3; } - else if (node._typ == 281 /* v.ast.ParExpr */) { + else if (node._typ == 282 /* v.ast.ParExpr */) { bool _t4 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__ParExpr).expr); return _t4; } - else if (node._typ == 282 /* v.ast.PostfixExpr */) { + else if (node._typ == 283 /* v.ast.PostfixExpr */) { bool _t5 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__PostfixExpr).expr); return _t5; } - else if (node._typ == 283 /* v.ast.PrefixExpr */) { + else if (node._typ == 284 /* v.ast.PrefixExpr */) { bool _t6 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__PrefixExpr).right); return _t6; } - else if (node._typ == 284 /* v.ast.RangeExpr */) { + else if (node._typ == 285 /* v.ast.RangeExpr */) { bool _t7 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__RangeExpr).low) || v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__RangeExpr).high); return _t7; } - else if (node._typ == 286 /* v.ast.SelectorExpr */) { + else if (node._typ == 287 /* v.ast.SelectorExpr */) { bool _t8 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__SelectorExpr).expr); return _t8; } @@ -80445,19 +80735,19 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_need_tmp_var_in_array_call(v__gen__c__Gen* g } VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_and_or_op(v__gen__c__Gen* g, v__ast__InfixExpr node) { - if ((node.right)._typ == 267 /* v.ast.IfExpr */) { + if ((node.right)._typ == 268 /* v.ast.IfExpr */) { int prev_inside_ternary = g->inside_ternary; g->inside_ternary = 0; if (v__gen__c__Gen_need_tmp_var_in_if(g, (*node.right._v__ast__IfExpr))) { string tmp = v__gen__c__Gen_new_tmp_var(g); string cur_line = string_trim_space(v__gen__c__Gen_go_before_stmt(g, 0)); g->empty_line = true; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_writeln(g, _SLIT(");")); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); - g->infix_left_var_name = (node.op == v__token__Kind__and ? (tmp) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + g->infix_left_var_name = (node.op == v__token__Kind__and ? (tmp) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); v__gen__c__Gen_expr(g, node.right); g->infix_left_var_name = _SLIT(""); g->inside_ternary = prev_inside_ternary; @@ -80469,15 +80759,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_and_or_op(v__gen__c__Gen* g, v__a string cur_line = string_trim_space(v__gen__c__Gen_go_before_stmt(g, 0)); g->empty_line = true; if (g->infix_left_var_name.len > 0) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = (("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = (("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_writeln(g, _SLIT(");")); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); - g->infix_left_var_name = (node.op == v__token__Kind__and ? (tmp) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + g->infix_left_var_name = (node.op == v__token__Kind__and ? (tmp) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); v__gen__c__Gen_expr(g, node.right); g->infix_left_var_name = _SLIT(""); return; @@ -80490,7 +80780,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_plain_infix_expr(v__gen__c__Gen* g, v__a v__gen__c__Gen_write(g, _SLIT("*")); } v__gen__c__Gen_expr(g, node.left); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr_with_cast(g, node.right, node.right_type, node.left_type); } @@ -80505,7 +80795,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_op_arg(v__gen__c__Gen* g, v__ast__Expr expr, v__gen__c__Gen_write(g, _SLIT("&")); } else { string styp = v__gen__c__Gen_typ(g, v__ast__Type_set_nr_muls(got, 0)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); needs_closing = true; } } @@ -80521,7 +80811,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_safe_integer_infix_expr(v__gen__c__Gen* int bitsize = (v__ast__Type_idx(cfg.unsigned_type) == _const_v__ast__u32_type_idx && v__ast__Type_idx(cfg.signed_type) != _const_v__ast__i64_type_idx ? (32) : (64)); int op_idx = ((int)(cfg.op)) - ((int)(v__token__Kind__eq)); string op_str = (cfg.reverse ? ((*(string*)/*ee elem_sym */array_get(_const_v__gen__c__cmp_rev, op_idx))) : ((*(string*)/*ee elem_sym */array_get(_const_v__gen__c__cmp_str, op_idx)))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_us"), 0xfe07, {.d_i32 = bitsize}}, {_SLIT("_"), 0xfe10, {.d_s = op_str}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_us"), /*100 &int*/0xfe07, {.d_i32 = bitsize}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = op_str}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, cfg.unsigned_expr); v__gen__c__Gen_write(g, _SLIT(",")); v__gen__c__Gen_expr(g, cfg.signed_expr); @@ -80551,11 +80841,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { string styp = v__gen__c__Gen_typ(g, utyp); v__gen__c__Gen_register_optional(g, utyp); string dec_fn_name = v__gen__c__js_dec_name(styp); - string dec_fn_dec = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = dec_fn_name}}, {_SLIT("(cJSON* root)"), 0, { .d_c = 0 }}})); - string init_styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" res"), 0, { .d_c = 0 }}})); + string dec_fn_dec = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dec_fn_name}}, {_SLIT("(cJSON* root)"), 0, { .d_c = 0 }}})); + string init_styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" res"), 0, { .d_c = 0 }}})); if (sym->kind == v__ast__Kind__struct_) { int skips = 0; - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; for (int _t2 = 0; _t2 < info.fields.len; ++_t2) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t2]; for (int _t3 = 0; _t3 < field.attrs.len; ++_t3) { @@ -80570,25 +80860,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { init_styp = /*f*/string__plus(init_styp, v__gen__c__Gen_expr_string(g, v__ast__StructInit_to_sumtype_v__ast__Expr(ADDR(v__ast__StructInit, (((v__ast__StructInit){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_short = 0,.is_short_syntax = 0,.unresolved = 0,.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.typ_str = styp,.typ = utyp,.update_expr = {0},.update_expr_type = 0,.update_expr_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.is_update_embed = 0,.has_update_expr = 0,.fields = __new_array(0, 0, sizeof(v__ast__StructInitField)),.embeds = __new_array(0, 0, sizeof(v__ast__StructInitEmbed)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),})))))); } } - strings__Builder_writeln(&dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = dec_fn_dec}}, {_SLIT(" {\n "), 0xfe10, {.d_s = init_styp}}, {_SLIT(";\n if (!root) {\n const char *error_ptr = cJSON_GetErrorPtr();\n if (error_ptr != NULL) {\n const int error_pos = (int)cJSON_GetErrorPos();\n int maxcontext_chars = 30;\n byte *buf = vcalloc_noscan(maxcontext_chars + 10);\n if(error_pos > 0) {\n int backlines = 1;\n int backchars = error_pos < maxcontext_chars-7 ? (int)error_pos : maxcontext_chars-7 ;\n char *prevline_ptr = (char*)error_ptr;\n while(backchars--){\n char prevc = *(prevline_ptr - 1);\n if(0==prevc){\n break;\n }\n if(10==prevc && !backlines--){\n break;\n }\n prevline_ptr--;\n if(123==prevc) {\n break; // stop at `{` too\n }\n }\n int maxchars = vstrlen_char(prevline_ptr);\n vmemcpy(buf, prevline_ptr, (maxchars < maxcontext_chars ? maxchars : maxcontext_chars));\n }\n return (Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("){.state = 2,.err = _v_error(tos2(buf)),.data = {0}};\n }\n }\n"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->json_forward_decls, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dec_fn_dec}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = dec_fn_dec}}, {_SLIT(" {\n "), /*115 &string*/0xfe10, {.d_s = init_styp}}, {_SLIT(";\n if (!root) {\n const char *error_ptr = cJSON_GetErrorPtr();\n if (error_ptr != NULL) {\n const int error_pos = (int)cJSON_GetErrorPos();\n int maxcontext_chars = 30;\n byte *buf = vcalloc_noscan(maxcontext_chars + 10);\n if(error_pos > 0) {\n int backlines = 1;\n int backchars = error_pos < maxcontext_chars-7 ? (int)error_pos : maxcontext_chars-7 ;\n char *prevline_ptr = (char*)error_ptr;\n while(backchars--){\n char prevc = *(prevline_ptr - 1);\n if(0==prevc){\n break;\n }\n if(10==prevc && !backlines--){\n break;\n }\n prevline_ptr--;\n if(123==prevc) {\n break; // stop at `{` too\n }\n }\n int maxchars = vstrlen_char(prevline_ptr);\n vmemcpy(buf, prevline_ptr, (maxchars < maxcontext_chars ? maxchars : maxcontext_chars));\n }\n return (Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){.state = 2,.err = _v_error(tos2(buf)),.data = {0}};\n }\n }\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->json_forward_decls, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dec_fn_dec}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); string enc_fn_name = v__gen__c__js_enc_name(styp); - string enc_fn_dec = str_intp(3, _MOV((StrIntpData[]){{_SLIT("cJSON* "), 0xfe10, {.d_s = enc_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" val)"), 0, { .d_c = 0 }}})); - strings__Builder_writeln(&g->json_forward_decls, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = enc_fn_dec}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = enc_fn_dec}}, {_SLIT(" {\n\tcJSON *o;"), 0, { .d_c = 0 }}}))); + string enc_fn_dec = str_intp(3, _MOV((StrIntpData[]){{_SLIT("cJSON* "), /*115 &string*/0xfe10, {.d_s = enc_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val)"), 0, { .d_c = 0 }}})); + strings__Builder_writeln(&g->json_forward_decls, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = enc_fn_dec}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = enc_fn_dec}}, {_SLIT(" {\n\tcJSON *o;"), 0, { .d_c = 0 }}}))); if (sym->kind == v__ast__Kind__array) { v__ast__Type value_type = v__ast__Table_value_type(g->table, utyp); v__gen__c__Gen_gen_json_for_type(g, value_type); strings__Builder_writeln(&dec, v__gen__c__Gen_decode_array(g, value_type)); strings__Builder_writeln(&enc, v__gen__c__Gen_encode_array(g, value_type)); } else if (sym->kind == v__ast__Kind__map) { - v__ast__Map m = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Map */ ; + v__ast__Map m = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Map */ ; v__gen__c__Gen_gen_json_for_type(g, m.key_type); v__gen__c__Gen_gen_json_for_type(g, m.value_type); strings__Builder_writeln(&dec, v__gen__c__Gen_decode_map(g, m.key_type, m.value_type)); strings__Builder_writeln(&enc, v__gen__c__Gen_encode_map(g, m.key_type, m.value_type)); } else if (sym->kind == v__ast__Kind__alias) { - v__ast__Alias a = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ; + v__ast__Alias a = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ; v__ast__Type parent_typ = a.parent_type; v__ast__TypeSymbol* psym = v__ast__Table_sym(g->table, parent_typ); if (v__gen__c__is_js_prim(v__gen__c__Gen_typ(g, parent_typ))) { @@ -80596,31 +80886,31 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { continue; } strings__Builder_writeln(&enc, _SLIT("\to = cJSON_CreateObject();")); - if ((psym->info)._typ == 416 /* v.ast.Struct */) { + if ((psym->info)._typ == 417 /* v.ast.Struct */) { v__gen__c__Gen_gen_struct_enc_dec(g, psym->info, styp, (voidptr)&/*qq*/enc, (voidptr)&/*qq*/dec); } else if (psym->kind == v__ast__Kind__sum_type) { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" aliased sumtypes does not work at the moment"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" aliased sumtypes does not work at the moment"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } else if (sym->kind == v__ast__Kind__sum_type) { strings__Builder_writeln(&enc, _SLIT("\to = cJSON_CreateObject();")); - if ((sym->info)._typ != 435 /* v.ast.SumType */) { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" is not a sumtype"), 0, { .d_c = 0 }}}))); + if ((sym->info)._typ != 436 /* v.ast.SumType */) { + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" is not a sumtype"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__gen__c__Gen_gen_sumtype_enc_dec(g, *sym, (voidptr)&/*qq*/enc, (voidptr)&/*qq*/dec); } else { strings__Builder_writeln(&enc, _SLIT("\to = cJSON_CreateObject();")); - if ((sym->info)._typ != 416 /* v.ast.Struct */) { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct"), 0, { .d_c = 0 }}}))); + if ((sym->info)._typ != 417 /* v.ast.Struct */) { + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__gen__c__Gen_gen_struct_enc_dec(g, sym->info, styp, (voidptr)&/*qq*/enc, (voidptr)&/*qq*/dec); } - strings__Builder_writeln(&dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tOption_"), 0xfe10, {.d_s = styp}}, {_SLIT(" ret;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tOption_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ret;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&dec, _SLIT("\topt_ok(&res, (Option*)&ret, sizeof(res));")); strings__Builder_writeln(&dec, _SLIT("\treturn ret;\n}")); strings__Builder_writeln(&enc, _SLIT("\treturn o;\n}")); @@ -80631,16 +80921,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { // Attr: [inline] inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g, v__ast__TypeSymbol sym, strings__Builder* enc, strings__Builder* dec) { - v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym.info)._v__ast__SumType,(sym.info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym.info)._v__ast__SumType,(sym.info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ; string type_var = v__gen__c__Gen_new_tmp_var(g); int typ = (*(int*)map_get(ADDR(map, g->table->type_idxs), &(string[]){sym.name}, &(int[]){ 0 })); #if !defined(CUSTOM_DEFINE_json_no_inline_sumtypes) { string type_tmp = v__gen__c__Gen_new_tmp_var(g); strings__Builder_writeln(dec, _SLIT("\tif (cJSON_IsObject(root)) {")); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON* "), 0xfe10, {.d_s = type_tmp}}, {_SLIT(" = js_get(root, \"_type\");"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = type_tmp}}, {_SLIT(" != 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tchar* "), 0xfe10, {.d_s = type_var}}, {_SLIT(" = cJSON_GetStringValue("), 0xfe10, {.d_s = type_tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON* "), /*115 &string*/0xfe10, {.d_s = type_tmp}}, {_SLIT(" = js_get(root, \"_type\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = type_tmp}}, {_SLIT(" != 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tchar* "), /*115 &string*/0xfe10, {.d_s = type_var}}, {_SLIT(" = cJSON_GetStringValue("), /*115 &string*/0xfe10, {.d_s = type_tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } #endif Array_string variant_types = __new_array_with_default(0, 0, sizeof(string), 0); @@ -80656,30 +80946,30 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g string unmangled_variant_name = (*(string*)array_last(string_split(variant_sym->name, _SLIT(".")))); v__gen__c__Gen_gen_json_for_type(g, variant); v__gen__c__Gen_get_sumtype_casting_fn(g, variant, typ); - strings__Builder_writeln(&g->definitions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), 0xfe10, {.d_s = sym.cname}}, {_SLIT(" "), 0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("("), 0xfe10, {.d_s = variant_typ}}, {_SLIT("* x);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (val._typ == "), 0xfe07, {.d_i32 = v__ast__Type_idx(variant)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("* x);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (val._typ == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(variant)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); #if defined(CUSTOM_DEFINE_json_no_inline_sumtypes) { if (variant_sym->kind == v__ast__Kind__enum_) { - strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), 0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("u64"))}}, {_SLIT("(*val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("u64"))}}, {_SLIT("(*val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else if (string__eq(variant_sym->name, _SLIT("time.Time"))) { - strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), 0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("i64"))}}, {_SLIT("(val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT("->_v_unix));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("i64"))}}, {_SLIT("(val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("->_v_unix));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), 0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } } #else { if (v__gen__c__is_js_prim(variant_typ)) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), 0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant_sym->kind == v__ast__Kind__enum_) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), 0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("u64"))}}, {_SLIT("(*val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("u64"))}}, {_SLIT("(*val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (string__eq(variant_sym->name, _SLIT("time.Time"))) { - strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"_type\", cJSON_CreateString(\""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"value\", "), 0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("i64"))}}, {_SLIT("(val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT("->_v_unix));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"_type\", cJSON_CreateString(\""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"value\", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("i64"))}}, {_SLIT("(val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("->_v_unix));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), 0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"_type\", cJSON_CreateString(\""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"_type\", cJSON_CreateString(\""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); } } #endif @@ -80687,38 +80977,38 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g string tmp = v__gen__c__Gen_new_tmp_var(g); #if defined(CUSTOM_DEFINE_json_no_inline_sumtypes) { - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (strcmp(\""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", root->child->string) == 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (strcmp(\""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", root->child->string) == 0) {"), 0, { .d_c = 0 }}}))); if (v__gen__c__is_js_prim(variant_typ)) { v__gen__c__gen_js_get(variant_typ, tmp, unmangled_variant_name, dec, true); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(variant_typ)}}, {_SLIT("(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(variant_typ)}}, {_SLIT("(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant_sym->kind == v__ast__Kind__enum_) { v__gen__c__gen_js_get(variant_typ, tmp, unmangled_variant_name, dec, true); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("u64"))}}, {_SLIT("(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("u64"))}}, {_SLIT("(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (string__eq(variant_sym->name, _SLIT("time.Time"))) { v__gen__c__gen_js_get(variant_typ, tmp, unmangled_variant_name, dec, true); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(" value = time__unix("), 0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("i64"))}}, {_SLIT("(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(" value = time__unix("), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("i64"))}}, {_SLIT("(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { v__gen__c__gen_js_get_opt(v__gen__c__js_dec_name(variant_typ), variant_typ, sym.cname, tmp, unmangled_variant_name, dec, true); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(" value = *("), 0xfe10, {.d_s = variant_typ}}, {_SLIT("*)("), 0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(" value = *("), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("*)("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), 0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t}")); } #else { if (string__eq(variant_sym->name, _SLIT("time.Time"))) { - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tif (strcmp(\"Time\", "), 0xfe10, {.d_s = type_var}}, {_SLIT(") == 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tif (strcmp(\"Time\", "), /*115 &string*/0xfe10, {.d_s = type_var}}, {_SLIT(") == 0) {"), 0, { .d_c = 0 }}}))); v__gen__c__gen_js_get(sym.cname, tmp, _SLIT("value"), dec, true); - strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = time__unix("), 0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("i64"))}}, {_SLIT("(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tres = "), 0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = time__unix("), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("i64"))}}, {_SLIT("(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t\t}")); } else if (!v__gen__c__is_js_prim(variant_typ) && variant_sym->kind != v__ast__Kind__enum_) { - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tif (strcmp(\""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), 0xfe10, {.d_s = type_var}}, {_SLIT(") == 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tOption_"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(variant_typ)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tif ("), 0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\treturn (Option_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("){ .state = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tif (strcmp(\""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), /*115 &string*/0xfe10, {.d_s = type_var}}, {_SLIT(") == 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tOption_"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(variant_typ)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tif ("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\treturn (Option_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("){ .state = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t\t\t}")); - strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tres = "), 0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(("), 0xfe10, {.d_s = variant_typ}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(("), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t\t}")); } } @@ -80735,8 +81025,8 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g if (Array_string_contains(variant_types, _SLIT("bool"))) { string var_t = _SLIT("bool"); strings__Builder_writeln(dec, _SLIT("\t\tif (cJSON_IsBool(root)) {")); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), 0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } for (int i = 0; i < variant_types.len; ++i) { @@ -80745,51 +81035,51 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g if (number_is_met) { string var_num = string_replace(var_t, _SLIT("__"), _SLIT(".")); string last_num = string_replace(last_number_type, _SLIT("__"), _SLIT(".")); - v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many numeric types (conflict of `"), 0xfe10, {.d_s = last_num}}, {_SLIT("` and `"), 0xfe10, {.d_s = var_num}}, {_SLIT("`), you can try to use alias for `"), 0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many numeric types (conflict of `"), /*115 &string*/0xfe10, {.d_s = last_num}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("`), you can try to use alias for `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } number_is_met = true; last_number_type = var_t; strings__Builder_writeln(dec, _SLIT("\t\tif (cJSON_IsNumber(root)) {")); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), 0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("u64"))}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("u64"))}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } if (string__eq(var_t, _SLIT("string")) || string__eq(var_t, _SLIT("rune"))) { if (string_is_met) { string var_num = string_replace(var_t, _SLIT("__"), _SLIT(".")); - v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many string types (conflict of `string` and `rune`), you can try to use alias for `"), 0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many string types (conflict of `string` and `rune`), you can try to use alias for `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } string_is_met = true; strings__Builder_writeln(dec, _SLIT("\t\tif (cJSON_IsString(root)) {")); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), 0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } if (string_starts_with(var_t, _SLIT("Array_"))) { string tmp = v__gen__c__Gen_new_tmp_var(g); string judge_elem_typ = (string_ends_with(var_t, _SLIT("string")) ? (_SLIT("cJSON_IsString(root->child)")) : string_ends_with(var_t, _SLIT("bool")) ? (_SLIT("cJSON_IsBool(root->child)")) : (_SLIT("cJSON_IsNumber(root->child)"))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (cJSON_IsArray(root) && "), 0xfe10, {.d_s = judge_elem_typ}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\tOption_"), 0xfe10, {.d_s = var_t}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tif ("), 0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\treturn (Option_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("){ .state = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (cJSON_IsArray(root) && "), /*115 &string*/0xfe10, {.d_s = judge_elem_typ}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\tOption_"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tif ("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\treturn (Option_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("){ .state = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t\t}")); - strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(("), 0xfe10, {.d_s = var_t}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(("), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } if (string__eq(var_t, _SLIT("i64")) || string__eq(var_t, _SLIT("int")) || string__eq(var_t, _SLIT("i8")) || string__eq(var_t, _SLIT("u64")) || string__eq(var_t, _SLIT("u32")) || string__eq(var_t, _SLIT("u16")) || string__eq(var_t, _SLIT("byte")) || string__eq(var_t, _SLIT("u8")) || string__eq(var_t, _SLIT("rune")) || string__eq(var_t, _SLIT("f64")) || string__eq(var_t, _SLIT("f32"))) { if (number_is_met) { string var_num = string_replace(var_t, _SLIT("__"), _SLIT(".")); string last_num = string_replace(last_number_type, _SLIT("__"), _SLIT(".")); - v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many numeric types (conflict of `"), 0xfe10, {.d_s = last_num}}, {_SLIT("` and `"), 0xfe10, {.d_s = var_num}}, {_SLIT("`), you can try to use alias for `"), 0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many numeric types (conflict of `"), /*115 &string*/0xfe10, {.d_s = last_num}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("`), you can try to use alias for `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } number_is_met = true; last_number_type = var_t; strings__Builder_writeln(dec, _SLIT("\t\tif (cJSON_IsNumber(root)) {")); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), 0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } } @@ -80801,7 +81091,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g // Attr: [inline] inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_struct_enc_dec(v__gen__c__Gen* g, v__ast__TypeInfo type_info, string styp, strings__Builder* enc, strings__Builder* dec) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_info)._v__ast__Struct,(type_info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_info)._v__ast__Struct,(type_info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; for (int _t1 = 0; _t1 < info.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t1]; string name = field.name; @@ -80836,90 +81126,90 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_struct_enc_dec(v__gen__c__Gen* g, string field_type = v__gen__c__Gen_typ(g, field.typ); v__ast__TypeSymbol* field_sym = v__ast__Table_sym(g->table, field.typ); if (is_raw) { - strings__Builder_writeln(dec, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = tos5(cJSON_PrintUnformatted("), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("js_get(root, \""), 0xfe10, {.d_s = name}}, {_SLIT("\")));"), 0, { .d_c = 0 }}})))); + strings__Builder_writeln(dec, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = tos5(cJSON_PrintUnformatted("), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("js_get(root, \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\")));"), 0, { .d_c = 0 }}})))); } else { v__gen__c__Gen_gen_json_for_type(g, field.typ); string dec_name = v__gen__c__js_dec_name(field_type); if (v__gen__c__is_js_prim(field_type)) { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = "), 0xfe10, {.d_s = dec_name}}, {_SLIT(" (jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = dec_name}}, {_SLIT(" (jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (field_sym->kind == v__ast__Kind__enum_) { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = json__decode_u64(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = json__decode_u64(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (string__eq(field_sym->name, _SLIT("time.Time"))) { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = time__unix(json__decode_u64(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = time__unix(json__decode_u64(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else if (field_sym->kind == v__ast__Kind__alias) { - v__ast__Alias alias = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ; + v__ast__Alias alias = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ; string parent_type = v__gen__c__Gen_typ(g, alias.parent_type); string parent_dec_name = v__gen__c__js_dec_name(parent_type); if (v__gen__c__is_js_prim(parent_type)) { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = "), 0xfe10, {.d_s = parent_dec_name}}, {_SLIT(" (jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = parent_dec_name}}, {_SLIT(" (jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_gen_json_for_type(g, field.typ); string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get_opt(dec_name, field_type, styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = *("), 0xfe10, {.d_s = field_type}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = field_type}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } } else { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get_opt(dec_name, field_type, styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = *("), 0xfe10, {.d_s = field_type}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = field_type}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } } string enc_name = v__gen__c__js_enc_name(field_type); if (is_omit_empty) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t if (val."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" != "), 0xfe10, {.d_s = v__gen__c__Gen_type_default(g, field.typ)}}, {_SLIT(") \n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t if (val."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" != "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_type_default(g, field.typ)}}, {_SLIT(") \n"), 0, { .d_c = 0 }}}))); } if (!v__gen__c__is_js_prim(field_type)) { if (field_sym->kind == v__ast__Kind__alias) { - v__ast__Alias ainfo = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ; + v__ast__Alias ainfo = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ; enc_name = v__gen__c__js_enc_name(v__gen__c__Gen_typ(g, ainfo.parent_type)); } } if (field_sym->kind == v__ast__Kind__enum_) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), 0xfe10, {.d_s = name}}, {_SLIT("\", json__encode_u64(val."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\", json__encode_u64(val."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); } else { if (string__eq(field_sym->name, _SLIT("time.Time"))) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), 0xfe10, {.d_s = name}}, {_SLIT("\", json__encode_u64(val."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("._v_unix));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\", json__encode_u64(val."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("._v_unix));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), 0xfe10, {.d_s = name}}, {_SLIT("\", "), 0xfe10, {.d_s = enc_name}}, {_SLIT("(val."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\", "), /*115 &string*/0xfe10, {.d_s = enc_name}}, {_SLIT("(val."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); } } } } VV_LOCAL_SYMBOL void v__gen__c__gen_js_get(string styp, string tmp, string name, strings__Builder* dec, bool is_required) { - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON *jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = js_get(root,\""), 0xfe10, {.d_s = name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON *jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = js_get(root,\""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); if (is_required) { - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(" == 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn (Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("){ .state = 2, .err = _v_error(_SLIT(\"expected field \'"), 0xfe10, {.d_s = name}}, {_SLIT("\' is missing\")), .data = {0} };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" == 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn (Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){ .state = 2, .err = _v_error(_SLIT(\"expected field \'"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\' is missing\")), .data = {0} };"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t}")); } } VV_LOCAL_SYMBOL void v__gen__c__gen_js_get_opt(string dec_name, string field_type, string styp, string tmp, string name, strings__Builder* dec, bool is_required) { v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\tOption_"), 0xfe10, {.d_s = field_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0xfe10, {.d_s = dec_name}}, {_SLIT(" (jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif("), 0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn (Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("){ .state = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\tOption_"), /*115 &string*/0xfe10, {.d_s = field_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = dec_name}}, {_SLIT(" (jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn (Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){ .state = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t}")); } VV_LOCAL_SYMBOL string v__gen__c__js_enc_name(string typ) { string suffix = (string_ends_with(typ, _SLIT("*")) ? (string_replace(typ, _SLIT("*"), _SLIT(""))) : (typ)); - string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("json__encode_"), 0xfe10, {.d_s = suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("json__encode_"), /*115 &string*/0xfe10, {.d_s = suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); string _t1 = v__util__no_dots(name); return _t1; } VV_LOCAL_SYMBOL string v__gen__c__js_dec_name(string typ) { - string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("json__decode_"), 0xfe10, {.d_s = typ}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("json__decode_"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT0, 0, { .d_c = 0 }}})); string _t1 = v__util__no_dots(name); return _t1; } @@ -80934,19 +81224,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_decode_array(v__gen__c__Gen* g, v__ast__Ty string fn_name = v__gen__c__js_dec_name(styp); string s = _SLIT(""); if (v__gen__c__is_js_prim(styp)) { - s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" val = "), 0xfe10, {.d_s = fn_name}}, {_SLIT("((cJSON *)jsval); "), 0, { .d_c = 0 }}})); + s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val = "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("((cJSON *)jsval); "), 0, { .d_c = 0 }}})); } else { - s = str_intp(6, _MOV((StrIntpData[]){{_SLIT("\n Option_"), 0xfe10, {.d_s = styp}}, {_SLIT(" val2 = "), 0xfe10, {.d_s = fn_name}}, {_SLIT(" ((cJSON *)jsval);\n if(val2.state != 0) {\n array_free(&res);\n return *(Option_Array_"), 0xfe10, {.d_s = styp}}, {_SLIT("*)&val2;\n }\n "), 0xfe10, {.d_s = styp}}, {_SLIT(" val = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)val2.data;\n"), 0, { .d_c = 0 }}})); + s = str_intp(6, _MOV((StrIntpData[]){{_SLIT("\n Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val2 = "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" ((cJSON *)jsval);\n if(val2.state != 0) {\n array_free(&res);\n return *(Option_Array_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)&val2;\n }\n "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)val2.data;\n"), 0, { .d_c = 0 }}})); } string noscan = v__gen__c__Gen_check_noscan(g, value_type); - string _t1 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("\n if(root && !cJSON_IsArray(root) && !cJSON_IsNull(root)) {\n return (Option_Array_"), 0xfe10, {.d_s = styp}}, {_SLIT("){.state = 2, .err = _v_error(string__plus(_SLIT(\"Json element is not an array: \"), tos2((byteptr)cJSON_PrintUnformatted(root)))), .data = {0}};\n }\n res = __new_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, 0, sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));\n const cJSON *jsval = NULL;\n cJSON_ArrayForEach(jsval, root)\n {\n "), 0xfe10, {.d_s = s}}, {_SLIT("\n array_push"), 0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&res, &val);\n }\n"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("\n if(root && !cJSON_IsArray(root) && !cJSON_IsNull(root)) {\n return (Option_Array_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){.state = 2, .err = _v_error(string__plus(_SLIT(\"Json element is not an array: \"), tos2((byteptr)cJSON_PrintUnformatted(root)))), .data = {0}};\n }\n res = __new_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, 0, sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));\n const cJSON *jsval = NULL;\n cJSON_ArrayForEach(jsval, root)\n {\n "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\n array_push"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&res, &val);\n }\n"), 0, { .d_c = 0 }}})); return _t1; } VV_LOCAL_SYMBOL string v__gen__c__Gen_encode_array(v__gen__c__Gen* g, v__ast__Type value_type) { string styp = v__gen__c__Gen_typ(g, value_type); string fn_name = v__gen__c__js_enc_name(styp); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n o = cJSON_CreateArray();\n for (int i = 0; i < val.len; i++){\n cJSON_AddItemToArray(o, "), 0xfe10, {.d_s = fn_name}}, {_SLIT(" ( (("), 0xfe10, {.d_s = styp}}, {_SLIT("*)val.data)[i] ));\n }\n"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n o = cJSON_CreateArray();\n for (int i = 0; i < val.len; i++){\n cJSON_AddItemToArray(o, "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" ( (("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)val.data)[i] ));\n }\n"), 0, { .d_c = 0 }}})); return _t1; } @@ -80962,11 +81252,11 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_decode_map(v__gen__c__Gen* g, v__ast__Type string fn_name_v = v__gen__c__js_dec_name(styp_v); string s = _SLIT(""); if (v__gen__c__is_js_prim(styp_v)) { - s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp_v}}, {_SLIT(" val = "), 0xfe10, {.d_s = fn_name_v}}, {_SLIT(" (js_get(root, jsval->string));"), 0, { .d_c = 0 }}})); + s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT(" val = "), /*115 &string*/0xfe10, {.d_s = fn_name_v}}, {_SLIT(" (js_get(root, jsval->string));"), 0, { .d_c = 0 }}})); } else { - s = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n Option_"), 0xfe10, {.d_s = styp_v}}, {_SLIT(" val2 = "), 0xfe10, {.d_s = fn_name_v}}, {_SLIT(" (js_get(root, jsval->string));\n if(val2.state != 0) {\n map_free(&res);\n return *(Option_Map_"), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = styp_v}}, {_SLIT("*)&val2;\n }\n "), 0xfe10, {.d_s = styp_v}}, {_SLIT(" val = *("), 0xfe10, {.d_s = styp_v}}, {_SLIT("*)val2.data;\n"), 0, { .d_c = 0 }}})); + s = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n Option_"), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT(" val2 = "), /*115 &string*/0xfe10, {.d_s = fn_name_v}}, {_SLIT(" (js_get(root, jsval->string));\n if(val2.state != 0) {\n map_free(&res);\n return *(Option_Map_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("*)&val2;\n }\n "), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT(" val = *("), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("*)val2.data;\n"), 0, { .d_c = 0 }}})); } - string _t1 = str_intp(10, _MOV((StrIntpData[]){{_SLIT("\n if(!cJSON_IsObject(root) && !cJSON_IsNull(root)) {\n return (Option_Map_"), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = styp_v}}, {_SLIT("){ .state = 2, .err = _v_error(string__plus(_SLIT(\"Json element is not an object: \"), tos2((byteptr)cJSON_PrintUnformatted(root)))), .data = {0}};\n }\n res = new_map(sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = styp_v}}, {_SLIT("), "), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(");\n cJSON *jsval = NULL;\n cJSON_ArrayForEach(jsval, root)\n {\n "), 0xfe10, {.d_s = s}}, {_SLIT("\n string key = tos2((byteptr)jsval->string);\n map_set(&res, &key, &val);\n }\n"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(10, _MOV((StrIntpData[]){{_SLIT("\n if(!cJSON_IsObject(root) && !cJSON_IsNull(root)) {\n return (Option_Map_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("){ .state = 2, .err = _v_error(string__plus(_SLIT(\"Json element is not an object: \"), tos2((byteptr)cJSON_PrintUnformatted(root)))), .data = {0}};\n }\n res = new_map(sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("), "), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(");\n cJSON *jsval = NULL;\n cJSON_ArrayForEach(jsval, root)\n {\n "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\n string key = tos2((byteptr)jsval->string);\n map_set(&res, &key, &val);\n }\n"), 0, { .d_c = 0 }}})); return _t1; } @@ -80978,12 +81268,12 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_encode_map(v__gen__c__Gen* g, v__ast__Type string keys_tmp = v__gen__c__Gen_new_tmp_var(g); string key = _SLIT("string key = "); if (v__ast__Type_is_string(key_type)) { - key = /*f*/string__plus(key, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = keys_tmp}}, {_SLIT(".data)[i];"), 0, { .d_c = 0 }}}))); + key = /*f*/string__plus(key, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = keys_tmp}}, {_SLIT(".data)[i];"), 0, { .d_c = 0 }}}))); } else { v__gen__c__verror(_SLIT("json: encode only maps with string keys")); VUNREACHABLE(); } - string _t1 = str_intp(10, _MOV((StrIntpData[]){{_SLIT("\n o = cJSON_CreateObject();\n Array_"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = keys_tmp}}, {_SLIT(" = map_keys(&val);\n for (int i = 0; i < "), 0xfe10, {.d_s = keys_tmp}}, {_SLIT(".len; ++i) {\n "), 0xfe10, {.d_s = key}}, {_SLIT("\n cJSON_AddItemToObject(o, (char*) key.str, "), 0xfe10, {.d_s = fn_name_v}}, {_SLIT(" ( *("), 0xfe10, {.d_s = styp_v}}, {_SLIT("*) map_get(&val, &key, &("), 0xfe10, {.d_s = styp_v}}, {_SLIT("[]) { "), 0xfe10, {.d_s = zero}}, {_SLIT(" } ) ) );\n }\n array_free(&"), 0xfe10, {.d_s = keys_tmp}}, {_SLIT(");\n"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(10, _MOV((StrIntpData[]){{_SLIT("\n o = cJSON_CreateObject();\n Array_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = keys_tmp}}, {_SLIT(" = map_keys(&val);\n for (int i = 0; i < "), /*115 &string*/0xfe10, {.d_s = keys_tmp}}, {_SLIT(".len; ++i) {\n "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("\n cJSON_AddItemToObject(o, (char*) key.str, "), /*115 &string*/0xfe10, {.d_s = fn_name_v}}, {_SLIT(" ( *("), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("*) map_get(&val, &key, &("), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("[]) { "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" } ) ) );\n }\n array_free(&"), /*115 &string*/0xfe10, {.d_s = keys_tmp}}, {_SLIT(");\n"), 0, { .d_c = 0 }}})); return _t1; } @@ -81017,13 +81307,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_generate_hotcode_reloader_code(v__gen__c__Ge if (g->pref->os != v__pref__OS__windows) { for (int _t1 = 0; _t1 < g->hotcode_fn_names.len; ++_t1) { string so_fn = ((string*)g->hotcode_fn_names.data)[_t1]; - array_push((array*)&load_code, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("impl_live_"), 0xfe10, {.d_s = so_fn}}, {_SLIT(" = dlsym(live_lib, \"impl_live_"), 0xfe10, {.d_s = so_fn}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&load_code, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("impl_live_"), /*115 &string*/0xfe10, {.d_s = so_fn}}, {_SLIT(" = dlsym(live_lib, \"impl_live_"), /*115 &string*/0xfe10, {.d_s = so_fn}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))) })); } phd = _const_v__gen__c__posix_hotcode_definitions_1; } else { for (int _t3 = 0; _t3 < g->hotcode_fn_names.len; ++_t3) { string so_fn = ((string*)g->hotcode_fn_names.data)[_t3]; - array_push((array*)&load_code, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("impl_live_"), 0xfe10, {.d_s = so_fn}}, {_SLIT(" = (void *)GetProcAddress(live_lib, \"impl_live_"), 0xfe10, {.d_s = so_fn}}, {_SLIT("\"); "), 0, { .d_c = 0 }}}))) })); + array_push((array*)&load_code, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("impl_live_"), /*115 &string*/0xfe10, {.d_s = so_fn}}, {_SLIT(" = (void *)GetProcAddress(live_lib, \"impl_live_"), /*115 &string*/0xfe10, {.d_s = so_fn}}, {_SLIT("\"); "), 0, { .d_c = 0 }}}))) })); } phd = _const_v__gen__c__windows_hotcode_definitions_1; } @@ -81041,21 +81331,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_generate_hotcode_reloading_main_caller(v__ge v__gen__c__Gen_writeln(g, _SLIT("\t\t// initialization of live function pointers")); for (int _t1 = 0; _t1 < g->hotcode_fn_names.len; ++_t1) { string fname = ((string*)g->hotcode_fn_names.data)[_t1]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\timpl_live_"), 0xfe10, {.d_s = fname}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\timpl_live_"), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); } string vexe = v__util__cescaped_path(v__pref__vexe_path()); string file = v__util__cescaped_path(g->pref->path); string msvc = (string__eq(g->pref->ccompiler, _SLIT("msvc")) ? (_SLIT("-cc msvc")) : (_SLIT(""))); string so_debug_flag = (g->pref->is_debug ? (_SLIT("-cg")) : (_SLIT(""))); - string vopts = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = msvc}}, {_SLIT(" "), 0xfe10, {.d_s = so_debug_flag}}, {_SLIT(" -sharedlive -shared"), 0, { .d_c = 0 }}})); + string vopts = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = msvc}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = so_debug_flag}}, {_SLIT(" -sharedlive -shared"), 0, { .d_c = 0 }}})); v__gen__c__Gen_writeln(g, _SLIT("\t\t// start background reloading thread")); if (g->pref->os == v__pref__OS__windows) { v__gen__c__Gen_writeln(g, _SLIT("\t\tlive_fn_mutex = CreateMutexA(0, 0, 0);")); } v__gen__c__Gen_writeln(g, _SLIT("\t\tv__live__LiveReloadInfo* live_info = v__live__executable__new_live_reload_info(")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), 0xfe10, {.d_s = file}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), 0xfe10, {.d_s = vexe}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), 0xfe10, {.d_s = vopts}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), /*115 &string*/0xfe10, {.d_s = vexe}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), /*115 &string*/0xfe10, {.d_s = vopts}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t\t\t\t\t &live_fn_mutex,")); v__gen__c__Gen_writeln(g, _SLIT("\t\t\t\t\t v_bind_live_symbols")); v__gen__c__Gen_writeln(g, _SLIT("\t\t);")); @@ -81092,9 +81382,9 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_need_tmp_var_in_match(v__gen__c__Gen* g, v__ return _t6; } if (branch.stmts.len == 1) { - if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 306 /* v.ast.ExprStmt */) { - v__ast__ExprStmt stmt = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._v__ast__ExprStmt,((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ, 306) /*expected idx: 306, name: v.ast.ExprStmt */ ; - if (((stmt.expr)._typ == 252 /* v.ast.CallExpr */ || (stmt.expr)._typ == 267 /* v.ast.IfExpr */ || (stmt.expr)._typ == 276 /* v.ast.MatchExpr */) || ((stmt.expr)._typ == 269 /* v.ast.IndexExpr */ && (/* as */ *(v__ast__IndexExpr*)__as_cast((stmt.expr)._v__ast__IndexExpr,(stmt.expr)._typ, 269) /*expected idx: 269, name: v.ast.IndexExpr */ ).or_expr.kind != v__ast__OrKind__absent)) { + if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 307 /* v.ast.ExprStmt */) { + v__ast__ExprStmt stmt = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._v__ast__ExprStmt,((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ; + if (((stmt.expr)._typ == 253 /* v.ast.CallExpr */ || (stmt.expr)._typ == 268 /* v.ast.IfExpr */ || (stmt.expr)._typ == 277 /* v.ast.MatchExpr */) || ((stmt.expr)._typ == 270 /* v.ast.IndexExpr */ && (/* as */ *(v__ast__IndexExpr*)__as_cast((stmt.expr)._v__ast__IndexExpr,(stmt.expr)._typ, 270) /*expected idx: 270, name: v.ast.IndexExpr */ ).or_expr.kind != v__ast__OrKind__absent)) { bool _t7 = true; return _t7; } @@ -81126,7 +81416,7 @@ bool old; v__gen__c__Gen_match_expr_defer_0 = true; g->inside_match_optional = true; } - if ((node.cond)._typ == 266 /* v.ast.Ident */ || (node.cond)._typ == 286 /* v.ast.SelectorExpr */ || (node.cond)._typ == 271 /* v.ast.IntegerLiteral */ || (node.cond)._typ == 290 /* v.ast.StringLiteral */ || (node.cond)._typ == 264 /* v.ast.FloatLiteral */) { + if ((node.cond)._typ == 267 /* v.ast.Ident */ || (node.cond)._typ == 287 /* v.ast.SelectorExpr */ || (node.cond)._typ == 272 /* v.ast.IntegerLiteral */ || (node.cond)._typ == 291 /* v.ast.StringLiteral */ || (node.cond)._typ == 265 /* v.ast.FloatLiteral */) { cond_var = v__gen__c__Gen_expr_string(g, node.cond); } else { string _t1; /* if prepend */ @@ -81138,7 +81428,7 @@ bool old; } string line = _t1; cond_var = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.cond_type)}}, {_SLIT(" "), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.cond_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); @@ -81148,7 +81438,7 @@ bool old; g->empty_line = true; cur_line = string_trim_left(v__gen__c__Gen_go_before_stmt(g, 0), _SLIT(" \t")); tmp_var = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.return_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__Gen_type_default(g, node.return_type)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.return_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_type_default(g, node.return_type)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } if (is_expr && !need_tmp_var) { v__gen__c__Gen_write(g, _SLIT("(")); @@ -81164,7 +81454,7 @@ bool old; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); v__gen__c__Gen_write(g, cur_line); if (need_tmp_var) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_var}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (is_expr && !need_tmp_var) { v__gen__c__Gen_write(g, _SLIT(")")); @@ -81214,15 +81504,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_sumtype(v__gen__c__Gen* g, v__ast v__gen__c__Gen_write(g, cond_var); string dot_or_ptr = (v__ast__Type_is_ptr(node.cond_type) ? (_SLIT("->")) : (_SLIT("."))); if (sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index))); } else if (sym->kind == v__ast__Kind__interface_) { - if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 292 /* v.ast.TypeNode */) { - v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast(((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._v__ast__TypeNode,((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ, 292) /*expected idx: 292, name: v.ast.TypeNode */ ; + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 293 /* v.ast.TypeNode */) { + v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast(((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._v__ast__TypeNode,((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ, 293) /*expected idx: 293, name: v.ast.TypeNode */ ; v__ast__TypeSymbol* branch_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ.typ)); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == _"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = branch_sym->cname}}, {_SLIT("_index"), 0, { .d_c = 0 }}}))); - } else if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 278 /* v.ast.None */ && sym->idx == _const_v__ast__error_type_idx) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == _IError_None___index"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == _"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = branch_sym->cname}}, {_SLIT("_index"), 0, { .d_c = 0 }}}))); + } else if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 279 /* v.ast.None */ && sym->idx == _const_v__ast__error_type_idx) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == _IError_None___index"), 0, { .d_c = 0 }}}))); } } if (is_expr && tmp_var.len == 0) { @@ -81250,20 +81540,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_sumtype(v__gen__c__Gen* g, v__ast } VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast__MatchExpr node, bool is_expr, string cond_var, string tmp_var, v__ast__TypeSymbol enum_typ) { - string cname = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = enum_typ.cname}}, {_SLIT("__"), 0, { .d_c = 0 }}})); - Array_string covered_enum = __new_array_with_default(0, (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 445) /*expected idx: 445, name: v.ast.Enum */ ).vals.len, sizeof(string), 0); + string cname = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = enum_typ.cname}}, {_SLIT("__"), 0, { .d_c = 0 }}})); + Array_string covered_enum = __new_array_with_default(0, (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 446) /*expected idx: 446, name: v.ast.Enum */ ).vals.len, sizeof(string), 0); Array_v__ast__MatchBranch range_branches = __new_array_with_default(0, node.branches.len, sizeof(v__ast__MatchBranch), 0); bool default_generated = false; g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("switch ("), 0xfe10, {.d_s = cond_var}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("switch ("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; for (int _t1 = 0; _t1 < node.branches.len; ++_t1) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)node.branches.data)[_t1]; if (branch.is_else) { - for (int _t2 = 0; _t2 < (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 445) /*expected idx: 445, name: v.ast.Enum */ ).vals.len; ++_t2) { - string val = ((string*)(/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 445) /*expected idx: 445, name: v.ast.Enum */ ).vals.data)[_t2]; + for (int _t2 = 0; _t2 < (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 446) /*expected idx: 446, name: v.ast.Enum */ ).vals.len; ++_t2) { + string val = ((string*)(/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 446) /*expected idx: 446, name: v.ast.Enum */ ).vals.data)[_t2]; if (!Array_string_contains(covered_enum, val)) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("case "), 0xfe10, {.d_s = cname}}, {_SLIT0, 0xfe10, {.d_s = val}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("case "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("default:")); @@ -81278,24 +81568,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ if (i > 0) { v__gen__c__Gen_write(g, _SLIT(" || ")); } - if ((expr)._typ == 284 /* v.ast.RangeExpr */) { + if ((expr)._typ == 285 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 271 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 272 /* v.ast.IntegerLiteral */) { if ((v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u16_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u32_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u64_type)) && string__eq((*(*expr._v__ast__RangeExpr).low._v__ast__IntegerLiteral).val, _SLIT("0"))) { skip_low = true; } } v__gen__c__Gen_write(g, _SLIT("(")); if (!skip_low) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).low); v__gen__c__Gen_write(g, _SLIT(" && ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).high); v__gen__c__Gen_write(g, _SLIT(")")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } @@ -81313,7 +81603,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ int _t4_len = _t4_orig.len; for (int _t5 = 0; _t5 < _t4_len; ++_t5) { v__ast__Expr it = ((v__ast__Expr*) _t4_orig.data)[_t5]; - if ((it)._typ == 284 /* v.ast.RangeExpr */) { + if ((it)._typ == 285 /* v.ast.RangeExpr */) { _t4 = true; break; } @@ -81324,7 +81614,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ } for (int _t7 = 0; _t7 < branch.exprs.len; ++_t7) { v__ast__Expr expr = ((v__ast__Expr*)branch.exprs.data)[_t7]; - if ((expr)._typ == 263 /* v.ast.EnumVal */) { + if ((expr)._typ == 264 /* v.ast.EnumVal */) { array_push((array*)&covered_enum, _MOV((string[]){ string_clone((*expr._v__ast__EnumVal).val) })); v__gen__c__Gen_write(g, _SLIT("case ")); v__gen__c__Gen_expr(g, expr); @@ -81354,24 +81644,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ if (i > 0) { v__gen__c__Gen_write(g, _SLIT(" || ")); } - if ((expr)._typ == 284 /* v.ast.RangeExpr */) { + if ((expr)._typ == 285 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 271 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 272 /* v.ast.IntegerLiteral */) { if ((v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u16_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u32_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u64_type)) && string__eq((*(*expr._v__ast__RangeExpr).low._v__ast__IntegerLiteral).val, _SLIT("0"))) { skip_low = true; } } v__gen__c__Gen_write(g, _SLIT("(")); if (!skip_low) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).low); v__gen__c__Gen_write(g, _SLIT(" && ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).high); v__gen__c__Gen_write(g, _SLIT(")")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } @@ -81429,52 +81719,52 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_classic(v__gen__c__Gen* g, v__ast if (type_sym->kind == (v__ast__Kind__array)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, node.cond_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (type_sym->kind == (v__ast__Kind__array_fixed)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, node.cond_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (type_sym->kind == (v__ast__Kind__map)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, node.cond_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (type_sym->kind == (v__ast__Kind__string)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string__eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string__eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (type_sym->kind == (v__ast__Kind__struct_)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, node.cond_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else { - if ((expr)._typ == 284 /* v.ast.RangeExpr */) { + if ((expr)._typ == 285 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 271 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 272 /* v.ast.IntegerLiteral */) { if ((v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u16_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u32_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u64_type)) && string__eq((*(*expr._v__ast__RangeExpr).low._v__ast__IntegerLiteral).val, _SLIT("0"))) { skip_low = true; } } v__gen__c__Gen_write(g, _SLIT("(")); if (!skip_low) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).low); v__gen__c__Gen_write(g, _SLIT(" && ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).high); v__gen__c__Gen_write(g, _SLIT(")")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } @@ -81508,27 +81798,27 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_profile_fn(v__gen__c__Gen* g, v__ast__FnDecl g->defer_profile_code = _SLIT(""); } else { string measure_fn_name = (g->pref->os == v__pref__OS__macos ? (_SLIT("time__vpc_now_darwin")) : (_SLIT("time__vpc_now"))); - string fn_profile_counter_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("vpc_"), 0xfe10, {.d_s = cfn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); - string fn_profile_counter_name_calls = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT("_calls"), 0, { .d_c = 0 }}})); + string fn_profile_counter_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("vpc_"), /*115 &string*/0xfe10, {.d_s = cfn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fn_profile_counter_name_calls = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT("_calls"), 0, { .d_c = 0 }}})); v__gen__c__Gen_writeln(g, _SLIT("")); bool should_restore_v__profile_enabled = g->pref->profile_fns.len > 0 && Array_string_contains(g->pref->profile_fns, cfn_name); if (should_restore_v__profile_enabled) { #if defined(CUSTOM_DEFINE_trace_profile_fns) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> profile_fn | "), 0xfe10, {.d_s = Array_string_str(g->pref->profile_fns)}}, {_SLIT(" | "), 0xfe10, {.d_s = cfn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> profile_fn | "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(g->pref->profile_fns)}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = cfn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__gen__c__Gen_writeln(g, _SLIT("\tbool _prev_v__profile_enabled = v__profile_enabled;")); v__gen__c__Gen_writeln(g, _SLIT("\tv__profile_enabled = true;")); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tdouble _PROF_FN_START = "), 0xfe10, {.d_s = measure_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif(v__profile_enabled) { "), 0xfe10, {.d_s = fn_profile_counter_name_calls}}, {_SLIT("++; } // "), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tdouble _PROF_FN_START = "), /*115 &string*/0xfe10, {.d_s = measure_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif(v__profile_enabled) { "), /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name_calls}}, {_SLIT("++; } // "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("")); - g->defer_profile_code = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif(v__profile_enabled) { "), 0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT(" += "), 0xfe10, {.d_s = measure_fn_name}}, {_SLIT("() - _PROF_FN_START; }"), 0, { .d_c = 0 }}})); + g->defer_profile_code = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif(v__profile_enabled) { "), /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT(" += "), /*115 &string*/0xfe10, {.d_s = measure_fn_name}}, {_SLIT("() - _PROF_FN_START; }"), 0, { .d_c = 0 }}})); if (should_restore_v__profile_enabled) { g->defer_profile_code = /*f*/string__plus(g->defer_profile_code, _SLIT("\n\t\tv__profile_enabled = _prev_v__profile_enabled;")); } - strings__Builder_writeln(&g->pcs_declarations, str_intp(3, _MOV((StrIntpData[]){{_SLIT("double "), 0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT(" = 0.0; u64 "), 0xfe10, {.d_s = fn_profile_counter_name_calls}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(3, _MOV((StrIntpData[]){{_SLIT("double "), /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT(" = 0.0; u64 "), /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name_calls}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); array_push((array*)&g->pcs, _MOV((v__gen__c__ProfileCounterMeta[]){ ((v__gen__c__ProfileCounterMeta){.fn_name = cfn_name,.vpc_name = fn_profile_counter_name,.vpc_calls = fn_profile_counter_name_calls,}) })); } } @@ -81539,14 +81829,14 @@ void v__gen__c__Gen_gen_vprint_profile_stats(v__gen__c__Gen* g) { if (string__eq(g->pref->profile_file, _SLIT("-"))) { for (int _t1 = 0; _t1 < g->pcs.len; ++_t1) { v__gen__c__ProfileCounterMeta pc_meta = ((v__gen__c__ProfileCounterMeta*)g->pcs.data)[_t1]; - strings__Builder_writeln(&g->pcs_declarations, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(") printf("), 0xfe10, {.d_s = fstring}}, {_SLIT(", "), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", "), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/1000000.0, "), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/"), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", \""), 0xfe10, {.d_s = pc_meta.fn_name}}, {_SLIT("\" );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(") printf("), /*115 &string*/0xfe10, {.d_s = fstring}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/1000000.0, "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", \""), /*115 &string*/0xfe10, {.d_s = pc_meta.fn_name}}, {_SLIT("\" );"), 0, { .d_c = 0 }}}))); } } else { strings__Builder_writeln(&g->pcs_declarations, _SLIT("\tFILE * fp;")); - strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfp = fopen (\""), 0xfe10, {.d_s = g->pref->profile_file}}, {_SLIT("\", \"w+\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfp = fopen (\""), /*115 &string*/0xfe10, {.d_s = g->pref->profile_file}}, {_SLIT("\", \"w+\");"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < g->pcs.len; ++_t2) { v__gen__c__ProfileCounterMeta pc_meta = ((v__gen__c__ProfileCounterMeta*)g->pcs.data)[_t2]; - strings__Builder_writeln(&g->pcs_declarations, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(") fprintf(fp, "), 0xfe10, {.d_s = fstring}}, {_SLIT(", "), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", "), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/1000000.0, "), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/"), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", \""), 0xfe10, {.d_s = pc_meta.fn_name}}, {_SLIT("\" );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(") fprintf(fp, "), /*115 &string*/0xfe10, {.d_s = fstring}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/1000000.0, "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", \""), /*115 &string*/0xfe10, {.d_s = pc_meta.fn_name}}, {_SLIT("\" );"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->pcs_declarations, _SLIT("\tfclose(fp);")); } @@ -81555,8 +81845,8 @@ void v__gen__c__Gen_gen_vprint_profile_stats(v__gen__c__Gen* g) { strings__Builder_writeln(&g->pcs_declarations, _SLIT("void vreset_profile_stats(){")); for (int _t3 = 0; _t3 < g->pcs.len; ++_t3) { v__gen__c__ProfileCounterMeta pc_meta = ((v__gen__c__ProfileCounterMeta*)g->pcs.data)[_t3]; - strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT(" = 0.0;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT(" = 0.0;"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->pcs_declarations, _SLIT("}")); strings__Builder_writeln(&g->pcs_declarations, _SLIT("")); @@ -81566,7 +81856,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt(v__gen__c__Gen* g, v__ast__SqlStmt string conn = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("// orm")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__Connection "), 0xfe10, {.d_s = conn}}, {_SLIT(" = (orm__Connection){._"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__Connection "), /*115 &string*/0xfe10, {.d_s = conn}}, {_SLIT(" = (orm__Connection){._"), 0, { .d_c = 0 }}}))); string fn_prefix = _SLIT(""); v__gen__c__SqlType typ = v__gen__c__Gen_parse_db_type(g, node.db_expr); @@ -81580,12 +81870,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt(v__gen__c__Gen* g, v__ast__SqlStmt fn_prefix = _SLIT("pg__DB"); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("This database type `"), 0xfe10, {.d_s = v__gen__c__SqlType_str(typ)}}, {_SLIT("` is not implemented yet in orm"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("This database type `"), /*115 &v.gen.c.SqlType*/0xfe10, {.d_s = v__gen__c__SqlType_str(typ)}}, {_SLIT("` is not implemented yet in orm"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); }; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_prefix}}, {_SLIT(" = &"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_prefix}}, {_SLIT(" = &"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.db_expr); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", ._typ = _orm__Connection_"), 0xfe10, {.d_s = fn_prefix}}, {_SLIT("_index};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", ._typ = _orm__Connection_"), /*115 &string*/0xfe10, {.d_s = fn_prefix}}, {_SLIT("_index};"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < node.lines.len; ++_t1) { v__ast__SqlStmtLine line = ((v__ast__SqlStmtLine*)node.lines.data)[_t1]; v__gen__c__Gen_sql_stmt_line(g, line, conn); @@ -81622,27 +81912,27 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt_line(v__gen__c__Gen* g, v__ast__Sql array_free(&fields); } if (node.kind == v__ast__SqlStmtKind__create) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_create_table(g, node, expr, table_name); subs = true; } else if (node.kind == v__ast__SqlStmtKind__drop) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("drop("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("drop("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); subs = true; } else if (node.kind == v__ast__SqlStmtKind__insert) { string arr = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_orm__Primitive "), 0xfe10, {.d_s = arr}}, {_SLIT(" = new_array_from_c_array(0, 0, sizeof(orm__Primitive), NULL);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_orm__Primitive "), /*115 &string*/0xfe10, {.d_s = arr}}, {_SLIT(" = new_array_from_c_array(0, 0, sizeof(orm__Primitive), NULL);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_insert(g, node, expr, table_name, arr, res, _SLIT(""), false, _SLIT("")); dcheck = true; } else if (node.kind == v__ast__SqlStmtKind__update) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_update(g, node, expr, table_name); } else if (node.kind == v__ast__SqlStmtKind__delete) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_delete(g, node, expr, table_name); } if (!dcheck) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && "), 0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str("), 0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); } if (subs) { Map_int_v__ast__SqlStmtLine _t4 = node.sub_structs; @@ -81662,32 +81952,32 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt_line(v__gen__c__Gen* g, v__ast__Sql } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_create_table(v__gen__c__Gen* g, v__ast__SqlStmtLine node, string expr, string table_name) { - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("create("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"), new_array_from_c_array("), 0xfe07, {.d_i32 = node.fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = node.fields.len}}, {_SLIT(", sizeof(orm__TableField),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("create("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"), new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = node.fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = node.fields.len}}, {_SLIT(", sizeof(orm__TableField),"), 0, { .d_c = 0 }}}))); if (node.fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__TableField["), 0xfe07, {.d_i32 = node.fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__TableField["), /*100 &int*/0xfe07, {.d_i32 = node.fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < node.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)node.fields.data)[_t1]; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); v__gen__c__Gen_write(g, _SLIT("(orm__TableField){")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = field.name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); int typ = ((int)(field.typ)); if (string__eq(sym->name, _SLIT("time.Time"))) { typ = -2; } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".typ = "), 0xfe07, {.d_i32 = typ}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_arr = "), 0xfe10, {.d_s = sym->kind == v__ast__Kind__array ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_time = "), 0xfe10, {.d_s = string__eq(v__ast__Table_get_type_name(g->table, field.typ), _SLIT("time__Time")) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".default_val = (string){.str = (byteptr) \""), 0xfe10, {.d_s = field.default_val}}, {_SLIT("\", .is_lit = 1},"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".attrs = new_array_from_c_array("), 0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT(", sizeof(StructAttribute),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".typ = "), /*100 &int*/0xfe07, {.d_i32 = typ}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_arr = "), /*115 &bool*/0xfe10, {.d_s = sym->kind == v__ast__Kind__array ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_time = "), /*115 &bool*/0xfe10, {.d_s = string__eq(v__ast__Table_get_type_name(g->table, field.typ), _SLIT("time__Time")) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".default_val = (string){.str = (byteptr) \""), /*115 &string*/0xfe10, {.d_s = field.default_val}}, {_SLIT("\", .is_lit = 1},"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".attrs = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT(", sizeof(StructAttribute),"), 0, { .d_c = 0 }}}))); if (field.attrs.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((StructAttribute["), 0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((StructAttribute["), /*100 &int*/0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < field.attrs.len; ++_t2) { v__ast__Attr attr = ((v__ast__Attr*)field.attrs.data)[_t2]; v__gen__c__Gen_write(g, _SLIT("(StructAttribute){")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = attr.name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_arg = "), 0xfe10, {.d_s = attr.has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg = _SLIT(\""), 0xfe10, {.d_s = attr.arg}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".kind = "), 0xfe07, {.d_i32 = ((int)(attr.kind))}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_arg = "), /*115 &bool*/0xfe10, {.d_s = attr.has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".kind = "), /*100 &int*/0xfe07, {.d_i32 = ((int)(attr.kind))}}, {_SLIT(","), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("},")); } v__gen__c__Gen_write(g, _SLIT("})")); @@ -81752,43 +82042,43 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_insert(v__gen__c__Gen* g, v__ast__SqlStm for (int _t9 = 0; _t9 < subs.len; ++_t9) { v__ast__SqlStmtLine sub = ((v__ast__SqlStmtLine*)subs.data)[_t9]; v__gen__c__Gen_sql_stmt_line(g, sub, expr); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("array_push(&"), 0xfe10, {.d_s = last_ids_arr}}, {_SLIT(", _MOV((orm__Primitive[]){orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_last_id("), 0xfe10, {.d_s = expr}}, {_SLIT("._object)}));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("array_push(&"), /*115 &string*/0xfe10, {.d_s = last_ids_arr}}, {_SLIT(", _MOV((orm__Primitive[]){orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_last_id("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object)}));"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("insert("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"), (orm__QueryData){"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("insert("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"), (orm__QueryData){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); if (fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_MOV((string["), 0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_MOV((string["), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t10 = 0; _t10 < fields.len; ++_t10) { v__ast__StructField f = ((v__ast__StructField*)fields.data)[_t10]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = v__gen__c__Gen_get_field_name(g, f)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_get_field_name(g, f)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); if (fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), 0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); int structs = 0; for (int _t11 = 0; _t11 < fields.len; ++_t11) { v__ast__StructField f = ((v__ast__StructField*)fields.data)[_t11]; if (string__eq(f.name, fkey)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = pid}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = pid}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); continue; } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, f.typ); string typ = sym->cname; if (sym->kind == v__ast__Kind__struct_ && !string__eq(typ, _SLIT("time__Time"))) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*(orm__Primitive*) array_get("), 0xfe10, {.d_s = last_ids_arr}}, {_SLIT(", "), 0xfe07, {.d_i32 = structs}}, {_SLIT(")),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*(orm__Primitive*) array_get("), /*115 &string*/0xfe10, {.d_s = last_ids_arr}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = structs}}, {_SLIT(")),"), 0, { .d_c = 0 }}}))); structs++; continue; } if (string__eq(typ, _SLIT("time__Time"))) { typ = _SLIT("time"); } - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("orm__"), 0xfe10, {.d_s = typ}}, {_SLIT("_to_primitive("), 0xfe10, {.d_s = node.object_var_name}}, {_SLIT("."), 0xfe10, {.d_s = f.name}}, {_SLIT("),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("orm__"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT("_to_primitive("), /*115 &string*/0xfe10, {.d_s = node.object_var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT("),"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { @@ -81799,19 +82089,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_insert(v__gen__c__Gen* g, v__ast__SqlStm v__gen__c__Gen_write(g, _SLIT(".kinds = new_array_from_c_array(0, 0, sizeof(orm__OperationKind), NULL),")); v__gen__c__Gen_write(g, _SLIT(".is_and = new_array_from_c_array(0, 0, sizeof(bool), NULL),")); v__gen__c__Gen_writeln(g, _SLIT("});")); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && "), 0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str("), 0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); if (arrs.len > 0) { string id_name = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("orm__Primitive "), 0xfe10, {.d_s = id_name}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_last_id("), 0xfe10, {.d_s = expr}}, {_SLIT("._object);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("orm__Primitive "), /*115 &string*/0xfe10, {.d_s = id_name}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_last_id("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object);"), 0, { .d_c = 0 }}}))); for (int i = 0; i < arrs.len; ++i) { v__ast__SqlStmtLine* arr = ((v__ast__SqlStmtLine*)arrs.data) + i; string idx = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = idx}}, {_SLIT(" < "), 0xfe10, {.d_s = arr->object_var_name}}, {_SLIT("."), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(field_names, i))}}, {_SLIT(".len; "), 0xfe10, {.d_s = idx}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = arr->object_var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(field_names, i))}}, {_SLIT(".len; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); string last_ids = v__gen__c__Gen_new_tmp_var(g); string res_ = v__gen__c__Gen_new_tmp_var(g); string tmp_var = v__gen__c__Gen_new_tmp_var(g); string ctyp = v__gen__c__Gen_typ(g, arr->table_expr.typ); - v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ctyp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_var}}, {_SLIT(" = (*("), 0xfe10, {.d_s = ctyp}}, {_SLIT("*)array_get("), 0xfe10, {.d_s = arr->object_var_name}}, {_SLIT("."), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(field_names, i))}}, {_SLIT(", "), 0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ctyp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(" = (*("), /*115 &string*/0xfe10, {.d_s = ctyp}}, {_SLIT("*)array_get("), /*115 &string*/0xfe10, {.d_s = arr->object_var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(field_names, i))}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); arr->object_var_name = tmp_var; Array_v__ast__StructField fff = __new_array_with_default(0, 0, sizeof(v__ast__StructField), 0); for (int _t12 = 0; _t12 < arr->fields.len; ++_t12) { @@ -81840,25 +82130,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_insert(v__gen__c__Gen* g, v__ast__SqlStm } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_update(v__gen__c__Gen* g, v__ast__SqlStmtLine node, string expr, string table_name) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("update("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"), (orm__QueryData){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("update("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"), (orm__QueryData){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(".kinds = new_array_from_c_array(0, 0, sizeof(orm__OperationKind), NULL),")); v__gen__c__Gen_write(g, _SLIT(".is_and = new_array_from_c_array(0, 0, sizeof(bool), NULL),")); v__gen__c__Gen_write(g, _SLIT(".types = new_array_from_c_array(0, 0, sizeof(int), NULL),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), 0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); if (node.updated_columns.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), 0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < node.updated_columns.len; ++_t1) { string field = ((string*)node.updated_columns.data)[_t1]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = field}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = field}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), 0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); if (node.update_exprs.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), 0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), /*100 &int*/0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < node.update_exprs.len; ++_t2) { v__ast__Expr e = ((v__ast__Expr*)node.update_exprs.data)[_t2]; v__gen__c__Gen_sql_expr_to_orm_primitive(g, e); @@ -81871,29 +82161,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_update(v__gen__c__Gen* g, v__ast__SqlStm } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_delete(v__gen__c__Gen* g, v__ast__SqlStmtLine node, string expr, string table_name) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_v_delete("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_v_delete("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_gen_where_data(g, node.where_expr); v__gen__c__Gen_writeln(g, _SLIT(");")); } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_expr_to_orm_primitive(v__gen__c__Gen* g, v__ast__Expr expr) { - if (expr._typ == 270 /* v.ast.InfixExpr */) { + if (expr._typ == 271 /* v.ast.InfixExpr */) { v__gen__c__Gen_sql_write_orm_primitive(g, v__ast__Table_find_type_idx(g->table, _SLIT("orm.InfixType")), expr); } - else if (expr._typ == 290 /* v.ast.StringLiteral */) { + else if (expr._typ == 291 /* v.ast.StringLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__string_type, expr); } - else if (expr._typ == 271 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__int_type, expr); } - else if (expr._typ == 250 /* v.ast.BoolLiteral */) { + else if (expr._typ == 251 /* v.ast.BoolLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__bool_type, expr); } - else if (expr._typ == 266 /* v.ast.Ident */) { - v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast(((*expr._v__ast__Ident).info)._v__ast__IdentVar,((*expr._v__ast__Ident).info)._typ, 376) /*expected idx: 376, name: v.ast.IdentVar */ ; + else if (expr._typ == 267 /* v.ast.Ident */) { + v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast(((*expr._v__ast__Ident).info)._v__ast__IdentVar,((*expr._v__ast__Ident).info)._typ, 377) /*expected idx: 377, name: v.ast.IdentVar */ ; v__gen__c__Gen_sql_write_orm_primitive(g, info.typ, expr); } - else if (expr._typ == 286 /* v.ast.SelectorExpr */) { + else if (expr._typ == 287 /* v.ast.SelectorExpr */) { v__gen__c__Gen_sql_write_orm_primitive(g, (*expr._v__ast__SelectorExpr).typ, expr); } @@ -81919,12 +82209,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_write_orm_primitive(v__gen__c__Gen* g, v if (string__eq(typ, _SLIT("orm__InfixType"))) { typ = _SLIT("infix"); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__"), 0xfe10, {.d_s = typ}}, {_SLIT("_to_primitive("), 0, { .d_c = 0 }}}))); - if ((expr)._typ == 270 /* v.ast.InfixExpr */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT("_to_primitive("), 0, { .d_c = 0 }}}))); + if ((expr)._typ == 271 /* v.ast.InfixExpr */) { v__gen__c__Gen_write(g, _SLIT("(orm__InfixType){")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__InfixExpr).left)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__InfixExpr).left)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); string kind = (((*expr._v__ast__InfixExpr).op == (v__token__Kind__plus)) ? (_SLIT("orm__MathOperationKind__add")) : ((*expr._v__ast__InfixExpr).op == (v__token__Kind__minus)) ? (_SLIT("orm__MathOperationKind__sub")) : ((*expr._v__ast__InfixExpr).op == (v__token__Kind__div)) ? (_SLIT("orm__MathOperationKind__div")) : ((*expr._v__ast__InfixExpr).op == (v__token__Kind__mul)) ? (_SLIT("orm__MathOperationKind__mul")) : (_SLIT(""))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".operator = "), 0xfe10, {.d_s = kind}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".operator = "), /*115 &string*/0xfe10, {.d_s = kind}}, {_SLIT(","), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(".right = ")); v__gen__c__Gen_sql_expr_to_orm_primitive(g, (*expr._v__ast__InfixExpr).right); v__gen__c__Gen_write(g, _SLIT("}")); @@ -81935,7 +82225,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_write_orm_primitive(v__gen__c__Gen* g, v } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_where_data(v__gen__c__Gen* g, v__ast__Expr expr, Array_string* fields, Array_string* kinds, Array_v__ast__Expr* data, Array_bool* is_and) { - if (expr._typ == 270 /* v.ast.InfixExpr */) { + if (expr._typ == 271 /* v.ast.InfixExpr */) { g->sql_side = v__gen__c__SqlExprSide__left; v__gen__c__Gen_sql_where_data(g, (*expr._v__ast__InfixExpr).left, fields, kinds, data, is_and); string _t1 = (string){.str=(byteptr)"", .is_lit=1}; @@ -82095,29 +82385,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_where_data(v__gen__c__Gen* g, v__ast__Ex kind = _SLIT("orm__OperationKind__eq"); } } - if (((*expr._v__ast__InfixExpr).left)._typ != 270 /* v.ast.InfixExpr */ && ((*expr._v__ast__InfixExpr).right)._typ != 270 /* v.ast.InfixExpr */) { + if (((*expr._v__ast__InfixExpr).left)._typ != 271 /* v.ast.InfixExpr */ && ((*expr._v__ast__InfixExpr).right)._typ != 271 /* v.ast.InfixExpr */) { array_push((array*)kinds, _MOV((string[]){ string_clone(kind) })); } g->sql_side = v__gen__c__SqlExprSide__right; v__gen__c__Gen_sql_where_data(g, (*expr._v__ast__InfixExpr).right, fields, kinds, data, is_and); } - else if (expr._typ == 266 /* v.ast.Ident */) { + else if (expr._typ == 267 /* v.ast.Ident */) { if (g->sql_side == v__gen__c__SqlExprSide__left) { array_push((array*)fields, _MOV((string[]){ string_clone(v__gen__c__Gen_get_field_name(g, v__gen__c__Gen_get_struct_field(g, (*expr._v__ast__Ident).name))) })); } else { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } } - else if (expr._typ == 290 /* v.ast.StringLiteral */) { + else if (expr._typ == 291 /* v.ast.StringLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 271 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 286 /* v.ast.SelectorExpr */) { + else if (expr._typ == 287 /* v.ast.SelectorExpr */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 250 /* v.ast.BoolLiteral */) { + else if (expr._typ == 251 /* v.ast.BoolLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } @@ -82134,21 +82424,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_gen_where_data(v__gen__c__Gen* g, v__ast Array_bool is_and = __new_array_with_default(0, 0, sizeof(bool), 0); v__gen__c__Gen_sql_where_data(g, where_expr, &/*arr*/fields, &/*arr*/kinds, &/*arr*/data, &/*arr*/is_and); v__gen__c__Gen_write(g, _SLIT(".types = new_array_from_c_array(0, 0, sizeof(int), NULL),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); if (fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), 0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < fields.len; ++_t1) { string field = ((string*)fields.data)[_t1]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = field}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = field}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), 0xfe07, {.d_i32 = data.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = data.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = data.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = data.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); if (data.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), 0xfe07, {.d_i32 = data.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), /*100 &int*/0xfe07, {.d_i32 = data.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < data.len; ++_t2) { v__ast__Expr e = ((v__ast__Expr*)data.data)[_t2]; v__gen__c__Gen_sql_expr_to_orm_primitive(g, e); @@ -82156,24 +82446,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_gen_where_data(v__gen__c__Gen* g, v__ast v__gen__c__Gen_write(g, _SLIT("})")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".kinds = new_array_from_c_array("), 0xfe07, {.d_i32 = kinds.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = kinds.len}}, {_SLIT(", sizeof(orm__OperationKind),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".kinds = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = kinds.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = kinds.len}}, {_SLIT(", sizeof(orm__OperationKind),"), 0, { .d_c = 0 }}}))); if (kinds.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__OperationKind["), 0xfe07, {.d_i32 = kinds.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__OperationKind["), /*100 &int*/0xfe07, {.d_i32 = kinds.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t3 = 0; _t3 < kinds.len; ++_t3) { string k = ((string*)kinds.data)[_t3]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = k}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = k}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".is_and = new_array_from_c_array("), 0xfe07, {.d_i32 = is_and.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = is_and.len}}, {_SLIT(", sizeof(bool),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".is_and = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = is_and.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = is_and.len}}, {_SLIT(", sizeof(bool),"), 0, { .d_c = 0 }}}))); if (is_and.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((bool["), 0xfe07, {.d_i32 = is_and.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((bool["), /*100 &int*/0xfe07, {.d_i32 = is_and.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t4 = 0; _t4 < is_and.len; ++_t4) { bool b = ((bool*)is_and.data)[_t4]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = b ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &bool*/0xfe10, {.d_s = b ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { @@ -82187,7 +82477,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select_expr(v__gen__c__Gen* g, v__ast__S string conn = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("// orm")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__Connection "), 0xfe10, {.d_s = conn}}, {_SLIT(" = (orm__Connection){._"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__Connection "), /*115 &string*/0xfe10, {.d_s = conn}}, {_SLIT(" = (orm__Connection){._"), 0, { .d_c = 0 }}}))); string fn_prefix = _SLIT(""); v__gen__c__SqlType typ = v__gen__c__Gen_parse_db_type(g, node.db_expr); @@ -82201,12 +82491,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select_expr(v__gen__c__Gen* g, v__ast__S fn_prefix = _SLIT("pg__DB"); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("This database type `"), 0xfe10, {.d_s = v__gen__c__SqlType_str(typ)}}, {_SLIT("` is not implemented yet in orm"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("This database type `"), /*115 &v.gen.c.SqlType*/0xfe10, {.d_s = v__gen__c__SqlType_str(typ)}}, {_SLIT("` is not implemented yet in orm"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); }; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_prefix}}, {_SLIT(" = &"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_prefix}}, {_SLIT(" = &"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.db_expr); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", ._typ = _orm__Connection_"), 0xfe10, {.d_s = fn_prefix}}, {_SLIT("_index};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", ._typ = _orm__Connection_"), /*115 &string*/0xfe10, {.d_s = fn_prefix}}, {_SLIT("_index};"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_select(g, node, conn, left); } @@ -82232,12 +82522,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp string res = v__gen__c__Gen_new_tmp_var(g); string table_name = v__gen__c__Gen_get_table_name(g, node.table_expr); g->sql_table_name = v__ast__Table_sym(g->table, node.table_expr.typ)->name; - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("Option_Array_Array_orm__Primitive _o"), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_select("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("Option_Array_Array_orm__Primitive _o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_select("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("(orm__SelectConfig){")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".table = _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_count = "), 0xfe10, {.d_s = node.is_count ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_where = "), 0xfe10, {.d_s = node.has_where ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_order = "), 0xfe10, {.d_s = node.has_order ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".table = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_count = "), /*115 &bool*/0xfe10, {.d_s = node.is_count ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_where = "), /*115 &bool*/0xfe10, {.d_s = node.has_where ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_order = "), /*115 &bool*/0xfe10, {.d_s = node.has_order ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); if (node.has_order) { v__gen__c__Gen_write(g, _SLIT(".order = _SLIT(\"")); v__gen__c__Gen_expr(g, node.order_expr); @@ -82248,10 +82538,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__gen__c__Gen_write(g, _SLIT(".order_type = orm__OrderType__asc,")); } } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_limit = "), 0xfe10, {.d_s = node.has_limit ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_offset = "), 0xfe10, {.d_s = node.has_offset ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_limit = "), /*115 &bool*/0xfe10, {.d_s = node.has_limit ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_offset = "), /*115 &bool*/0xfe10, {.d_s = node.has_offset ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); if ((prim).len != 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".primary = _SLIT(\""), 0xfe10, {.d_s = prim}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".primary = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = prim}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); } Array_v__ast__StructField _t4 = {0}; Array_v__ast__StructField _t4_orig = fields; @@ -82265,13 +82555,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp } } Array_v__ast__StructField select_fields =_t4; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), 0xfe07, {.d_i32 = select_fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = select_fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = select_fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = select_fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); Array_int types = __new_array_with_default(0, 0, sizeof(int), 0); if (select_fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), 0xfe07, {.d_i32 = select_fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = select_fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t6 = 0; _t6 < select_fields.len; ++_t6) { v__ast__StructField field = ((v__ast__StructField*)select_fields.data)[_t6]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = v__gen__c__Gen_get_field_name(g, field)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_get_field_name(g, field)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); if (string__eq(sym->name, _SLIT("time.Time"))) { array_push((array*)&types, _MOV((int[]){ -2 })); @@ -82288,12 +82578,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".types = new_array_from_c_array("), 0xfe07, {.d_i32 = types.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = types.len}}, {_SLIT(", sizeof(int),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".types = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = types.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = types.len}}, {_SLIT(", sizeof(int),"), 0, { .d_c = 0 }}}))); if (types.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((int["), 0xfe07, {.d_i32 = types.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((int["), /*100 &int*/0xfe07, {.d_i32 = types.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t10 = 0; _t10 < types.len; ++_t10) { int typ = ((int*)types.data)[_t10]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = typ}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = typ}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { @@ -82311,9 +82601,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__gen__c__Gen_write(g, _SLIT(".types = new_array_from_c_array(0, 0, sizeof(int), NULL),")); v__gen__c__Gen_write(g, _SLIT(".kinds = new_array_from_c_array(0, 0, sizeof(orm__OperationKind), NULL),")); v__gen__c__Gen_write(g, _SLIT(".is_and = new_array_from_c_array(0, 0, sizeof(bool), NULL),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), 0xfe07, {.d_i32 = exprs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = exprs.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = exprs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = exprs.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); if (exprs.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), 0xfe07, {.d_i32 = exprs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), /*100 &int*/0xfe07, {.d_i32 = exprs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t13 = 0; _t13 < exprs.len; ++_t13) { v__ast__Expr e = ((v__ast__Expr*)exprs.data)[_t13]; v__gen__c__Gen_sql_expr_to_orm_primitive(g, e); @@ -82329,22 +82619,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__gen__c__Gen_write(g, _SLIT("(orm__QueryData) {}")); } v__gen__c__Gen_writeln(g, _SLIT(");")); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if (_o"), 0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && _o"), 0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str(_o"), 0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Array_Array_orm__Primitive "), 0xfe10, {.d_s = res}}, {_SLIT(" = (*(Array_Array_orm__Primitive*)_o"), 0xfe10, {.d_s = res}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if (_o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && _o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str(_o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Array_Array_orm__Primitive "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = (*(Array_Array_orm__Primitive*)_o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); if (node.is_count) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left}}, {_SLIT(" *((*(orm__Primitive*) array_get((*(Array_orm__Primitive*)array_get("), 0xfe10, {.d_s = res}}, {_SLIT(", 0)), 0))._int);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left}}, {_SLIT(" *((*(orm__Primitive*) array_get((*(Array_orm__Primitive*)array_get("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(", 0)), 0))._int);"), 0, { .d_c = 0 }}}))); } else { string tmp = v__gen__c__Gen_new_tmp_var(g); string styp = v__gen__c__Gen_typ(g, node.typ); string idx = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = idx}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); string typ_str = _SLIT(""); if (node.is_array) { v__ast__Array info = v__ast__TypeSymbol_array_info(v__ast__Table_sym(g->table, node.typ)); typ_str = v__gen__c__Gen_typ(g, info.elem_type); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_array = __new_array(0, "), 0xfe10, {.d_s = res}}, {_SLIT(".len, sizeof("), 0xfe10, {.d_s = typ_str}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("for (; "), 0xfe10, {.d_s = idx}}, {_SLIT(" < "), 0xfe10, {.d_s = res}}, {_SLIT(".len; "), 0xfe10, {.d_s = idx}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = typ_str}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0xfe10, {.d_s = typ_str}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_array = __new_array(0, "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".len, sizeof("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("for (; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".len; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); v__ast__Struct inf = v__ast__TypeSymbol_struct_info(v__ast__Table_sym(g->table, info.elem_type)); for (int i = 0; i < inf.fields.len; ++i) { v__ast__StructField field = ((v__ast__StructField*)inf.fields.data)[i]; @@ -82355,7 +82645,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp } v__gen__c__Gen_writeln(g, _SLIT("};")); } else { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); v__ast__Struct info = v__ast__TypeSymbol_struct_info(v__ast__Table_sym(g->table, node.typ)); for (int i = 0; i < info.fields.len; ++i) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[i]; @@ -82366,26 +82656,26 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp } v__gen__c__Gen_writeln(g, _SLIT("};")); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = res}}, {_SLIT(".len > 0) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".len > 0) {"), 0, { .d_c = 0 }}}))); for (int i = 0; i < fields.len; ++i) { v__ast__StructField field = ((v__ast__StructField*)fields.data)[i]; - string sel = str_intp(4, _MOV((StrIntpData[]){{_SLIT("(*(orm__Primitive*) array_get((*(Array_orm__Primitive*) array_get("), 0xfe10, {.d_s = res}}, {_SLIT(", "), 0xfe10, {.d_s = idx}}, {_SLIT(")), "), 0xfe07, {.d_i32 = i}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string sel = str_intp(4, _MOV((StrIntpData[]){{_SLIT("(*(orm__Primitive*) array_get((*(Array_orm__Primitive*) array_get("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(")), "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("))"), 0, { .d_c = 0 }}})); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); if (sym->kind == v__ast__Kind__struct_ && !string__eq(sym->name, _SLIT("time.Time"))) { v__ast__SqlExpr sub = (*(v__ast__SqlExpr*)map_get(ADDR(map, node.sub_structs), &(int[]){((int)(field.typ))}, &(v__ast__SqlExpr[]){ (v__ast__SqlExpr){.typ = 0,.is_count = 0,.has_where = 0,.has_order = 0,.has_limit = 0,.has_offset = 0,.has_desc = 0,.is_array = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.table_expr = (v__ast__TypeNode){.typ = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlExpr), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop),} })); - v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 270) /*expected idx: 270, name: v.ast.InfixExpr */ ; - v__ast__Ident ident = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ; + v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 271) /*expected idx: 271, name: v.ast.InfixExpr */ ; + v__ast__Ident ident = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ; string name = sel; int s = v__ast__Table_find_type_idx(g->table, _SLIT("orm.Primitive")); if (s != 0) { - if ((ident.info)._typ == 376 /* v.ast.IdentVar */) { + if ((ident.info)._typ == 377 /* v.ast.IdentVar */) { (*ident.info._v__ast__IdentVar).typ = s; } } ident.name = name; where_expr.right = v__ast__Ident_to_sumtype_v__ast__Expr(&ident); sub.where_expr = v__ast__InfixExpr_to_sumtype_v__ast__Expr(&where_expr); - v__gen__c__Gen_sql_select(g, sub, expr, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_sql_select(g, sub, expr, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__array) { string fkey = _SLIT(""); for (int _t14 = 0; _t14 < field.attrs.len; ++_t14) { @@ -82401,9 +82691,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__ast__Array info = v__ast__TypeSymbol_array_info(sym); v__ast__Type arr_typ = info.elem_type; v__ast__SqlExpr sub = (*(v__ast__SqlExpr*)map_get(ADDR(map, node.sub_structs), &(int[]){((int)(arr_typ))}, &(v__ast__SqlExpr[]){ (v__ast__SqlExpr){.typ = 0,.is_count = 0,.has_where = 0,.has_order = 0,.has_limit = 0,.has_offset = 0,.has_desc = 0,.is_array = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.table_expr = (v__ast__TypeNode){.typ = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlExpr), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop),} })); - v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 270) /*expected idx: 270, name: v.ast.InfixExpr */ ; - v__ast__Ident l = /* as */ *(v__ast__Ident*)__as_cast((where_expr.left)._v__ast__Ident,(where_expr.left)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ; - v__ast__Ident r = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 266) /*expected idx: 266, name: v.ast.Ident */ ; + v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 271) /*expected idx: 271, name: v.ast.InfixExpr */ ; + v__ast__Ident l = /* as */ *(v__ast__Ident*)__as_cast((where_expr.left)._v__ast__Ident,(where_expr.left)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ; + v__ast__Ident r = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 267) /*expected idx: 267, name: v.ast.Ident */ ; l.name = fkey; r.name = tmp; where_expr.left = v__ast__Ident_to_sumtype_v__ast__Expr(&l); @@ -82414,7 +82704,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp .mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}, .next_token = 0, .expr = v__ast__Ident_to_sumtype_v__ast__Expr(&r), - .expr_type = (/* as */ *(v__ast__IdentVar*)__as_cast((r.info)._v__ast__IdentVar,(r.info)._typ, 376) /*expected idx: 376, name: v.ast.IdentVar */ ).typ, + .expr_type = (/* as */ *(v__ast__IdentVar*)__as_cast((r.info)._v__ast__IdentVar,(r.info)._typ, 377) /*expected idx: 377, name: v.ast.IdentVar */ ).typ, .typ = _const_v__ast__int_type, .name_type = 0, .gkind_field = 0, @@ -82440,18 +82730,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp .fields = sub.fields, .sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlExpr), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop), }); - v__gen__c__Gen_sql_select(g, arr, expr, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_sql_select(g, arr, expr, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else { string typ = sym->cname; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = *("), 0xfe10, {.d_s = sel}}, {_SLIT("._"), 0xfe10, {.d_s = typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = sel}}, {_SLIT("._"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.is_array) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("array_push(&"), 0xfe10, {.d_s = tmp}}, {_SLIT("_array, _MOV(("), 0xfe10, {.d_s = typ_str}}, {_SLIT("[]){ "), 0xfe10, {.d_s = tmp}}, {_SLIT(" }));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("array_push(&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_array, _MOV(("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("[]){ "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" }));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (node.is_array) { v__gen__c__Gen_write(g, _SLIT("_array")); } @@ -82462,13 +82752,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp } VV_LOCAL_SYMBOL v__gen__c__SqlType v__gen__c__Gen_parse_db_type(v__gen__c__Gen* g, v__ast__Expr expr) { - if (expr._typ == 266 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).info)._typ == 376 /* v.ast.IdentVar */) { + if (expr._typ == 267 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).info)._typ == 377 /* v.ast.IdentVar */) { v__gen__c__SqlType _t1 = v__gen__c__Gen_parse_db_from_type_string(g, v__ast__Table_get_type_name(g->table, (*(*expr._v__ast__Ident).info._v__ast__IdentVar).typ)); return _t1; } } - else if (expr._typ == 286 /* v.ast.SelectorExpr */) { + else if (expr._typ == 287 /* v.ast.SelectorExpr */) { v__gen__c__SqlType _t2 = v__gen__c__Gen_parse_db_from_type_string(g, v__ast__Table_get_type_name(g->table, (*expr._v__ast__SelectorExpr).typ)); return _t2; } @@ -82545,7 +82835,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_field_name(v__gen__c__Gen* g, v__ast__ } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); if (sym->kind == v__ast__Kind__struct_ && !string__eq(sym->name, _SLIT("time.Time"))) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("_id"), 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("_id"), 0, { .d_c = 0 }}})); } string _t2 = name; return _t2; @@ -82554,14 +82844,14 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_field_name(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_string_literal(v__gen__c__Gen* g, v__ast__StringLiteral node) { string escaped_val = v__gen__c__cescape_nonascii(v__util__smart_quote(node.val, node.is_raw)); if (node.language == v__ast__Language__c) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = escaped_val}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = escaped_val}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = escaped_val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = escaped_val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } } VV_LOCAL_SYMBOL void v__gen__c__Gen_string_inter_literal_sb_optimized(v__gen__c__Gen* g, v__ast__CallExpr call_expr) { - v__ast__StringInterLiteral node = /* as */ *(v__ast__StringInterLiteral*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(call_expr.args, 0)).expr)._v__ast__StringInterLiteral,((*(v__ast__CallArg*)/*ee elem_sym */array_get(call_expr.args, 0)).expr)._typ, 289) /*expected idx: 289, name: v.ast.StringInterLiteral */ ; + v__ast__StringInterLiteral node = /* as */ *(v__ast__StringInterLiteral*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(call_expr.args, 0)).expr)._v__ast__StringInterLiteral,((*(v__ast__CallArg*)/*ee elem_sym */array_get(call_expr.args, 0)).expr)._typ, 290) /*expected idx: 290, name: v.ast.StringInterLiteral */ ; v__gen__c__Gen_writeln(g, _SLIT("// sb inter opt")); bool is_nl = string__eq(call_expr.name, _SLIT("writeln")); for (int i = 0; i < node.vals.len; ++i) { @@ -82602,7 +82892,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast typ = v__ast__Type_set_nr_muls(v__ast__Type_clear_flag(typ, v__ast__TypeFlag__shared_f), 0); } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); - if ((sym->info)._typ == 431 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { + if ((sym->info)._typ == 432 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__Alias).parent_type); if (v__ast__TypeSymbol_has_method(parent_sym, _SLIT("str"))) { typ = (*sym->info._v__ast__Alias).parent_type; @@ -82614,7 +82904,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast bool str_method_expects_ptr = mr_2219.arg1; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type)) { @@ -82628,9 +82918,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast } else if (sym->kind == v__ast__Kind__none_) { v__gen__c__Gen_write(g, _SLIT("_SLIT(\"\")")); } else if (sym->kind == v__ast__Kind__enum_) { - if ((expr)._typ != 263 /* v.ast.EnumVal */) { + if ((expr)._typ != 264 /* v.ast.EnumVal */) { string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_enum_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else { @@ -82643,19 +82933,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast bool is_var_mut = v__ast__Expr_is_auto_deref_var(expr); string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); if (is_ptr && !is_var_mut) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\"&\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(" ,{.d_s="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\"&\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(" ,{.d_s="), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (str_method_expects_ptr && !is_ptr) { v__gen__c__Gen_write(g, _SLIT("&")); } else if ((!str_method_expects_ptr && is_ptr && !is_shared) || is_var_mut) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((expr)._typ == 246 /* v.ast.ArrayInit */) { + if ((expr)._typ == 247 /* v.ast.ArrayInit */) { if ((*expr._v__ast__ArrayInit).is_fixed) { string s = v__gen__c__Gen_typ(g, (*expr._v__ast__ArrayInit).typ); if (!(*expr._v__ast__ArrayInit).has_it) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } } } @@ -82669,7 +82959,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast } } else { string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Expr_is_auto_deref_var(expr)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -82686,11 +82976,12 @@ VV_LOCAL_SYMBOL multi_return_u64_string v__gen__c__Gen_str_format(v__gen__c__Gen v__ast__Type typ = v__gen__c__Gen_unwrap_generic(g, (*(v__ast__Type*)/*ee elem_sym */array_get(node.expr_types, i))); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); if (sym->kind == v__ast__Kind__alias) { - typ = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type; + typ = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; } bool remove_tail_zeros = false; u8 fspec = (*(u8*)/*ee elem_sym */array_get(node.fmts, i)); StrIntpType fmt_type = ((StrIntpType){0}); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*117 &u8*/0xfe02, {.d_u8 = fspec}}, {_SLIT(" "), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(sym)}}}))}}, {_SLIT("*/"), 0, { .d_c = 0 }}}))); if ((fspec - 'A') <= ('Z' - 'A')) { upper_case = true; } @@ -82806,25 +83097,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_str_val(v__gen__c__Gen* g, v__ast__StringInt } v__gen__c__Gen_expr(g, expr); } - } else if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ )), _SLIT("str"))) { + } else if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ )), _SLIT("str"))) { string rec_type_name = v__util__no_dots(v__gen__c__Gen_cc_type(g, typ, false)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); string dot = (v__ast__Type_is_ptr(typ) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_str("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_str("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(")")); } else if ((*(u8*)/*ee elem_sym */array_get(node.fmts, i)) == 's' || v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { v__ast__Type exp_typ = typ; - if ((expr)._typ == 266 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { if (g->comptime_var_type_map.len > 0 || g->comptime_for_method.len > 0) { exp_typ = (*(*expr._v__ast__Ident).obj._v__ast__Var).typ; } else if ((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts.len > 0) { exp_typ = v__gen__c__Gen_unwrap_generic(g, (*(v__ast__Type*)array_last((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts))); v__ast__TypeSymbol* cast_sym = v__ast__Table_sym(g->table, exp_typ); - if ((cast_sym->info)._typ == 429 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 430 /* v.ast.Aggregate */) { exp_typ = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } } @@ -82866,20 +83157,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_string_inter_literal(v__gen__c__Gen* g, v__a v__ast__StringInterLiteral node_ = node; for (int i = 0; i < node_.exprs.len; ++i) { v__ast__Expr* expr = ((v__ast__Expr*)node_.exprs.data) + i; - if ((expr)->_typ == 266 /* v.ast.Ident */) { - if (((*expr->_v__ast__Ident).obj)._typ == 324 /* v.ast.Var */) { + if ((expr)->_typ == 267 /* v.ast.Ident */) { + if (((*expr->_v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { (*(v__ast__Type*)/*ee elem_sym */array_get(node_.expr_types, i)) = (*(*expr->_v__ast__Ident).obj._v__ast__Var).typ; } } } } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" str_intp("), 0xfe07, {.d_i32 = node.vals.len}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" str_intp("), /*100 &int*/0xfe07, {.d_i32 = node.vals.len}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("_MOV((StrIntpData[]){")); for (int i = 0; i < node.vals.len; ++i) { string val = ((string*)node.vals.data)[i]; string escaped_val = v__util__smart_quote(val, false); if (escaped_val.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), 0xfe10, {.d_s = escaped_val}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = escaped_val}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("{_SLIT0, ")); } @@ -82887,10 +83178,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_string_inter_literal(v__gen__c__Gen* g, v__a v__gen__c__Gen_write(g, _SLIT("0, { .d_c = 0 }}")); break; } - multi_return_u64_string mr_5683 = v__gen__c__Gen_str_format(g, node, i); - u64 ft_u64 = mr_5683.arg0; - string ft_str = mr_5683.arg1; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("0x"), 0xfe10, {.d_s = u64_hex(ft_u64)}}, {_SLIT(", {.d_"), 0xfe10, {.d_s = ft_str}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + multi_return_u64_string mr_5711 = v__gen__c__Gen_str_format(g, node, i); + u64 ft_u64 = mr_5711.arg0; + string ft_str = mr_5711.arg1; + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("0x"), /*115 &string*/0xfe10, {.d_s = u64_hex(ft_u64)}}, {_SLIT(", {.d_"), /*115 &string*/0xfe10, {.d_s = ft_str}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); if (ft_str.str[0] == 'p') { v__gen__c__Gen_write(g, _SLIT("(void*)(")); v__gen__c__Gen_str_val(g, node, i); @@ -82926,21 +83217,21 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; if (g->is_shared && !g->inside_opt_data && !g->is_arraymap_set) { v__ast__Type shared_typ = v__ast__Type_set_flag(node.typ, v__ast__TypeFlag__shared_f); shared_styp = v__gen__c__Gen_typ(g, shared_typ); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), 0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val =("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val =("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } else if (is_amp || g->inside_cast_in_heap > 0) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("*)memdup(&("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)memdup(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } else if (v__ast__Type_is_ptr(node.typ)) { string basetyp = v__gen__c__Gen_typ(g, v__ast__Type_set_nr_muls(node.typ, 0)); if (is_multiline) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), 0xfe10, {.d_s = basetyp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), /*115 &string*/0xfe10, {.d_s = basetyp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), 0xfe10, {.d_s = basetyp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), /*115 &string*/0xfe10, {.d_s = basetyp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } } else { if (is_multiline) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } } Map_string_int inited_fields = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); @@ -82957,7 +83248,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; map_set(&inited_fields, &(string[]){field.name}, &(int[]) { i }); if (sym->kind != v__ast__Kind__struct_) { string field_name = (sym->language == v__ast__Language__v ? (v__gen__c__c_name(field.name)) : (field.name)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); if (field.typ == 0) { v__gen__c__Gen_checker_bug(g, _SLIT("struct init, field.typ is 0"), field.pos); } @@ -82989,7 +83280,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; g->is_shared = old_is_shared; int nr_fields = 1; if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; nr_fields = info.fields.len; if (info.is_union && node.fields.len > 1) { v__gen__c__verror(_SLIT("union must not have more than 1 initializer")); @@ -83026,7 +83317,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, embed); string embed_name = v__ast__TypeSymbol_embed_name(embed_sym); if (!_IN_MAP(ADDR(string, embed_name), ADDR(map, inited_fields))) { - v__ast__Struct embed_info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct embed_info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; Array_string _t6 = {0}; Array_v__ast__StructField _t6_orig = embed_info.fields; int _t6_len = _t6_orig.len; @@ -83064,7 +83355,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; v__ast__StructInit default_init = ((v__ast__StructInit){node.pos,node.name_pos,node.is_short,node.is_short_syntax,node.unresolved,node.pre_comments,node.typ_str,.typ = embed,node.update_expr,node.update_expr_type,node.update_expr_comments,.is_update_embed = true,node.has_update_expr,.fields = init_fields_to_embed,node.embeds,node.generic_types,}); int inside_cast_in_heap = g->inside_cast_in_heap; g->inside_cast_in_heap = 0; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = embed_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = embed_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_struct_init(g, default_init); g->inside_cast_in_heap = inside_cast_in_heap; if (is_multiline) { @@ -83082,7 +83373,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; if (!v__ast__Type_has_flag(field->typ, v__ast__TypeFlag__shared_f)) { g->is_shared = false; } - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { int found_equal_fields = 0; for (int _t14 = 0; _t14 < (*sym->info._v__ast__Struct).fields.len; ++_t14) { v__ast__StructField* sifield = ((v__ast__StructField*)(*sym->info._v__ast__Struct).fields.data) + _t14; @@ -83101,7 +83392,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; if (sfield.typ == 0) { continue; } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* field_type_sym = v__ast__Table_sym(g->table, sfield.typ); bool cloned = false; if (g->is_autofree && !v__ast__Type_is_ptr(sfield.typ) && (field_type_sym->kind == v__ast__Kind__array || field_type_sym->kind == v__ast__Kind__string)) { @@ -83111,12 +83402,12 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; } } if (!cloned) { - if (field_type_sym->kind == v__ast__Kind__array_fixed && (sfield.expr)._typ == 266 /* v.ast.Ident */) { - v__ast__ArrayFixed fixed_array_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((field_type_sym->info)._v__ast__ArrayFixed,(field_type_sym->info)._typ, 439) /*expected idx: 439, name: v.ast.ArrayFixed */ ; + if (field_type_sym->kind == v__ast__Kind__array_fixed && (sfield.expr)._typ == 267 /* v.ast.Ident */) { + v__ast__ArrayFixed fixed_array_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((field_type_sym->info)._v__ast__ArrayFixed,(field_type_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; v__gen__c__Gen_write(g, _SLIT("{")); for (int i = 0; i < fixed_array_info.size; ++i) { v__gen__c__Gen_expr(g, sfield.expr); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), 0xfe07, {.d_i32 = i}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), /*100 &int literal*/0xfe07, {.d_i32 = i}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); if (i != fixed_array_info.size - 1) { v__gen__c__Gen_write(g, _SLIT(", ")); } @@ -83142,7 +83433,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; } if (v__ast__Type_has_flag(field->typ, v__ast__TypeFlag__optional)) { string field_name = v__gen__c__c_name(field->name); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = {EMPTY_STRUCT_INITIALIZATION},"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = {EMPTY_STRUCT_INITIALIZATION},"), 0, { .d_c = 0 }}}))); initialized = true; continue; } @@ -83207,9 +83498,9 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; } v__gen__c__Gen_write(g, _SLIT("}")); if (g->is_shared && !g->inside_opt_data && !g->is_arraymap_set) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp || g->inside_cast_in_heap > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } // Defer begin if (v__gen__c__Gen_struct_init_defer_0) { @@ -83221,14 +83512,14 @@ if (v__gen__c__Gen_struct_init_defer_0) { VV_LOCAL_SYMBOL bool v__gen__c__Gen_zero_struct_field(v__gen__c__Gen* g, v__ast__StructField field) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (info.fields.len == 0) { bool _t1 = false; return _t1; } } string field_name = (sym->language == v__ast__Language__v ? (v__gen__c__c_name(field.name)) : (field.name)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); if (field.has_default_expr) { if (sym->kind == v__ast__Kind__sum_type || sym->kind == v__ast__Kind__interface_) { v__gen__c__Gen_expr_with_cast(g, field.default_expr, field.default_expr_typ, field.typ); @@ -83245,7 +83536,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_zero_struct_field(v__gen__c__Gen* g, v__ast_ VV_LOCAL_SYMBOL bool v__gen__c__Gen_is_empty_struct(v__gen__c__Gen* g, v__gen__c__Type t) { v__ast__TypeSymbol* sym = t.unaliased_sym; - if (sym->info._typ == 416 /* v.ast.Struct */) { + if (sym->info._typ == 417 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).fields.len > 0 || (*sym->info._v__ast__Struct).embeds.len > 0) { bool _t1 = false; return _t1; @@ -83289,7 +83580,7 @@ VV_LOCAL_SYMBOL v__gen__c__Type v__gen__c__Gen_unwrap(v__gen__c__Gen* g, v__ast_ Option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref) { if (!os__is_file(file_path)) { - return (Option_v__scanner__Scanner_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = file_path}}, {_SLIT(" is not a .v file"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__scanner__Scanner_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = file_path}}, {_SLIT(" is not a .v file"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_string _t2 = v__util__read_file(file_path); if (_t2.state != 0) { /*or block*/ @@ -83528,7 +83819,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_bin_number(v__scanner__Scanner* v__scanner__Scanner_error(s, _SLIT("number part of this binary is not provided")); } else if (has_wrong_digit) { s->pos = first_wrong_digit_pos; - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this binary number has unsuitable digit `"), 0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this binary number has unsuitable digit `"), /*115 &string*/0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } string number = v__scanner__Scanner_num_lit(s, start_pos, s->pos); s->pos--; @@ -83575,7 +83866,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_hex_number(v__scanner__Scanner* v__scanner__Scanner_error(s, _SLIT("number part of this hexadecimal is not provided")); } else if (has_wrong_digit) { s->pos = first_wrong_digit_pos; - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this hexadecimal number has unsuitable digit `"), 0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this hexadecimal number has unsuitable digit `"), /*115 &string*/0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } string number = v__scanner__Scanner_num_lit(s, start_pos, s->pos); s->pos--; @@ -83617,7 +83908,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_oct_number(v__scanner__Scanner* v__scanner__Scanner_error(s, _SLIT("number part of this octal is not provided")); } else if (has_wrong_digit) { s->pos = first_wrong_digit_pos; - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this octal number has unsuitable digit `"), 0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this octal number has unsuitable digit `"), /*115 &string*/0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } string number = v__scanner__Scanner_num_lit(s, start_pos, s->pos); s->pos--; @@ -83688,7 +83979,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_dec_number(v__scanner__Scanner* symbol_length++; } string float_symbol = string_substr(s->text, s->pos - 2 - symbol_length, s->pos - 1); - v__scanner__Scanner_warn(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("float literals should have a digit after the decimal point, e.g. `"), 0xfe10, {.d_s = float_symbol}}, {_SLIT(".0`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_warn(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("float literals should have a digit after the decimal point, e.g. `"), /*115 &string*/0xfe10, {.d_s = float_symbol}}, {_SLIT(".0`"), 0, { .d_c = 0 }}}))); } } } @@ -83720,7 +84011,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_dec_number(v__scanner__Scanner* if (has_wrong_digit) { s->pos = first_wrong_digit_pos; if (!s->pref->translated) { - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this number has unsuitable digit `"), 0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this number has unsuitable digit `"), /*115 &string*/0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } } else if (s->text.str[ s->pos - 1] == 'e' || s->text.str[ s->pos - 1] == 'E') { s->pos--; @@ -83786,7 +84077,7 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_end_of_file(v__scanner__Scan s->eofs++; if (s->eofs > 50) { s->line_nr--; - _v_panic(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the end of file `"), 0xfe10, {.d_s = s->file_path}}, {_SLIT("` has been reached 50 times already, the v parser is probably stuck.\n"), 0, { .d_c = 0 }}})), _SLIT("This should not happen. Please report the bug here, and include the last 2-3 lines of your source code:\n")), _SLIT("https://github.com/vlang/v/issues/new?labels=Bug&template=bug_report.md"))); + _v_panic(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the end of file `"), /*115 &string*/0xfe10, {.d_s = s->file_path}}, {_SLIT("` has been reached 50 times already, the v parser is probably stuck.\n"), 0, { .d_c = 0 }}})), _SLIT("This should not happen. Please report the bug here, and include the last 2-3 lines of your source code:\n")), _SLIT("https://github.com/vlang/v/issues/new?labels=Bug&template=bug_report.md"))); VUNREACHABLE(); } if (s->pos != s->text.len && s->eofs == 1) { @@ -83814,7 +84105,7 @@ v__util__Timers* timers; { for (int _t1 = 0; _t1 < s->all_tokens.len; ++_t1) { v__token__Token t = ((v__token__Token*)s->all_tokens.data)[_t1]; - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> tidx:"), 0xafe07, {.d_i32 = t.tidx}}, {_SLIT(" | kind: "), 0x14fe10, {.d_s = v__token__Kind_str(t.kind)}}, {_SLIT(" | lit: "), 0xfe10, {.d_s = t.lit}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> tidx:"), /*100 &int*/0xafe07, {.d_i32 = t.tidx}}, {_SLIT(" | kind: "), /*115 &v.token.Kind*/0x14fe10, {.d_s = v__token__Kind_str(t.kind)}}, {_SLIT(" | lit: "), /*115 &string*/0xfe10, {.d_s = t.lit}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } #endif @@ -83940,7 +84231,7 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_text_scan(v__scanner__Scanne } } if (s->is_inter_start && next_char == '\\' && !(v__scanner__Scanner_look_ahead(s, 2) == 'x' || v__scanner__Scanner_look_ahead(s, 2) == 'n' || v__scanner__Scanner_look_ahead(s, 2) == 'r' || v__scanner__Scanner_look_ahead(s, 2) == '\\' || v__scanner__Scanner_look_ahead(s, 2) == 't' || v__scanner__Scanner_look_ahead(s, 2) == 'e' || v__scanner__Scanner_look_ahead(s, 2) == '"' || v__scanner__Scanner_look_ahead(s, 2) == '\'')) { - v__scanner__Scanner_warn(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown escape sequence \\"), 0xfe02, {.d_u8 = v__scanner__Scanner_look_ahead(s, 2)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__scanner__Scanner_warn(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown escape sequence \\"), /*117 &u8*/0xfe02, {.d_u8 = v__scanner__Scanner_look_ahead(s, 2)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (s->is_inter_start && next_char == '(') { if (v__scanner__Scanner_look_ahead(s, 2) != ')') { @@ -84160,7 +84451,7 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_text_scan(v__scanner__Scanne if (!v__token__is_key(name)) { string at_error_msg = _SLIT("@ must be used before keywords or compile time variables (e.g. `@type string` or `@FN`)"); if (string_is_upper(name)) { - at_error_msg = /*f*/string__plus(at_error_msg, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\nAvailable compile time variables:\n"), 0xfe10, {.d_s = Array_string_str(_const_v__token__valid_at_tokens)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + at_error_msg = /*f*/string__plus(at_error_msg, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\nAvailable compile time variables:\n"), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(_const_v__token__valid_at_tokens)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__scanner__Scanner_error(s, at_error_msg); } @@ -84334,7 +84625,7 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_text_scan(v__scanner__Scanne v__token__Token _t78 = v__scanner__Scanner_new_token(s, v__token__Kind__not_is, _SLIT(""), 3); return _t78; } else { - v__token__Token _t79 = v__scanner__Scanner_new_token(s, v__token__Kind__not, _SLIT(""), 1); + v__token__Token _t79 = v__scanner__Scanner_new_token(s, v__token__Kind__not, _SLIT("!"), 1); return _t79; } } @@ -84433,7 +84724,7 @@ VV_LOCAL_SYMBOL void v__scanner__Scanner_invalid_character(v__scanner__Scanner* int len = utf8_char_len(string_at(s->text, s->pos)); int end = v__mathutil__min_T_int(s->pos + len, s->text.len); string c = string_substr(s->text, s->pos, end); - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid character `"), 0xfe10, {.d_s = c}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid character `"), /*115 &string*/0xfe10, {.d_s = c}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL int v__scanner__Scanner_current_column(v__scanner__Scanner* s) { @@ -84714,10 +85005,10 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_char(v__scanner__Scanner* s) { Array_rune u = string_runes(c); if (u.len != 1) { if (escaped_hex || escaped_unicode) { - v__scanner__Scanner_error(s, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid character literal `"), 0xfe10, {.d_s = orig}}, {_SLIT("` => `"), 0xfe10, {.d_s = c}}, {_SLIT("` ("), 0xfe10, {.d_s = Array_rune_str(u)}}, {_SLIT(") (escape sequence did not refer to a singular rune)"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid character literal `"), /*115 &string*/0xfe10, {.d_s = orig}}, {_SLIT("` => `"), /*115 &string*/0xfe10, {.d_s = c}}, {_SLIT("` ("), /*115 &[]rune*/0xfe10, {.d_s = Array_rune_str(u)}}, {_SLIT(") (escape sequence did not refer to a singular rune)"), 0, { .d_c = 0 }}}))); } else { v__scanner__Scanner_add_error_detail_with_pos(s, _SLIT("use quotes for strings, backticks for characters"), lspos); - v__scanner__Scanner_error(s, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid character literal `"), 0xfe10, {.d_s = orig}}, {_SLIT("` => `"), 0xfe10, {.d_s = c}}, {_SLIT("` ("), 0xfe10, {.d_s = Array_rune_str(u)}}, {_SLIT(") (more than one character)"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid character literal `"), /*115 &string*/0xfe10, {.d_s = orig}}, {_SLIT("` => `"), /*115 &string*/0xfe10, {.d_s = c}}, {_SLIT("` ("), /*115 &[]rune*/0xfe10, {.d_s = Array_rune_str(u)}}, {_SLIT(") (more than one character)"), 0, { .d_c = 0 }}}))); } } } @@ -84861,7 +85152,7 @@ VV_LOCAL_SYMBOL void v__scanner__Scanner_vet_error(v__scanner__Scanner* s, strin VV_LOCAL_SYMBOL void v__scanner__Scanner_trace(v__scanner__Scanner* s, string fbase, string message) { if (string__eq(s->file_base, fbase)) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> s.trace | "), 0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), 0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> s.trace | "), /*115 &string*/0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -84912,7 +85203,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; p->expr_level++; v__parser__Parser_check_undefined_variables_defer_0 = true; if (p->expr_level > _const_v__parser__max_expr_level) { - Option_void _t1 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("expr level > "), 0xfe07, {.d_i32 = _const_v__parser__max_expr_level}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + Option_void _t1 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("expr level > "), /*100 &int literal*/0xfe07, {.d_i32 = _const_v__parser__max_expr_level}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; @@ -84920,13 +85211,13 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; // Defer end return _t1; } - if (val._typ == 266 /* v.ast.Ident */) { + if (val._typ == 267 /* v.ast.Ident */) { for (int _t2 = 0; _t2 < exprs.len; ++_t2) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t2]; - if ((expr)._typ == 266 /* v.ast.Ident */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { if (string__eq((*expr._v__ast__Ident).name, (*val._v__ast__Ident).name) && (*expr._v__ast__Ident).kind != v__ast__IdentKind__blank_ident) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable: `"), 0xfe10, {.d_s = (*val._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*val._v__ast__Ident).pos); - Option_void _t3 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable: `"), 0xfe10, {.d_s = (*val._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable: `"), /*115 &string*/0xfe10, {.d_s = (*val._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*val._v__ast__Ident).pos); + Option_void _t3 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable: `"), /*115 &string*/0xfe10, {.d_s = (*val._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; @@ -84937,7 +85228,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 246 /* v.ast.ArrayInit */) { + else if (val._typ == 247 /* v.ast.ArrayInit */) { if ((*val._v__ast__ArrayInit).has_cap) { Option_void _t4 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).cap_expr); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { @@ -85000,7 +85291,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 252 /* v.ast.CallExpr */) { + else if (val._typ == 253 /* v.ast.CallExpr */) { Option_void _t13 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__CallExpr).left); if (_t13.state != 0 && _t13.err._typ != _IError_None___index) { // Defer begin @@ -85031,7 +85322,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 270 /* v.ast.InfixExpr */) { + else if (val._typ == 271 /* v.ast.InfixExpr */) { Option_void _t18 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__InfixExpr).left); if (_t18.state != 0 && _t18.err._typ != _IError_None___index) { // Defer begin @@ -85059,7 +85350,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } - else if (val._typ == 267 /* v.ast.IfExpr */) { + else if (val._typ == 268 /* v.ast.IfExpr */) { Option_void _t22 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__IfExpr).left); if (_t22.state != 0 && _t22.err._typ != _IError_None___index) { // Defer begin @@ -85090,7 +85381,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; for (int _t27 = 0; _t27 < branch.stmts.len; ++_t27) { v__ast__Stmt stmt = ((v__ast__Stmt*)branch.stmts.data)[_t27]; - if ((stmt)._typ == 306 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { Option_void _t28 = v__parser__Parser_check_undefined_variables(p, exprs, (*stmt._v__ast__ExprStmt).expr); if (_t28.state != 0 && _t28.err._typ != _IError_None___index) { // Defer begin @@ -85108,7 +85399,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 275 /* v.ast.MapInit */) { + else if (val._typ == 276 /* v.ast.MapInit */) { for (int _t30 = 0; _t30 < (*val._v__ast__MapInit).keys.len; ++_t30) { v__ast__Expr key = ((v__ast__Expr*)(*val._v__ast__MapInit).keys.data)[_t30]; Option_void _t31 = v__parser__Parser_check_undefined_variables(p, exprs, key); @@ -85142,7 +85433,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 276 /* v.ast.MatchExpr */) { + else if (val._typ == 277 /* v.ast.MatchExpr */) { Option_void _t36 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__MatchExpr).cond); if (_t36.state != 0 && _t36.err._typ != _IError_None___index) { // Defer begin @@ -85176,7 +85467,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } for (int _t42 = 0; _t42 < branch.stmts.len; ++_t42) { v__ast__Stmt stmt = ((v__ast__Stmt*)branch.stmts.data)[_t42]; - if ((stmt)._typ == 306 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { Option_void _t43 = v__parser__Parser_check_undefined_variables(p, exprs, (*stmt._v__ast__ExprStmt).expr); if (_t43.state != 0 && _t43.err._typ != _IError_None___index) { // Defer begin @@ -85194,7 +85485,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 281 /* v.ast.ParExpr */) { + else if (val._typ == 282 /* v.ast.ParExpr */) { Option_void _t45 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ParExpr).expr); if (_t45.state != 0 && _t45.err._typ != _IError_None___index) { // Defer begin @@ -85209,7 +85500,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } - else if (val._typ == 282 /* v.ast.PostfixExpr */) { + else if (val._typ == 283 /* v.ast.PostfixExpr */) { Option_void _t47 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__PostfixExpr).expr); if (_t47.state != 0 && _t47.err._typ != _IError_None___index) { // Defer begin @@ -85224,7 +85515,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } - else if (val._typ == 283 /* v.ast.PrefixExpr */) { + else if (val._typ == 284 /* v.ast.PrefixExpr */) { Option_void _t49 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__PrefixExpr).right); if (_t49.state != 0 && _t49.err._typ != _IError_None___index) { // Defer begin @@ -85239,7 +85530,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } - else if (val._typ == 289 /* v.ast.StringInterLiteral */) { + else if (val._typ == 290 /* v.ast.StringInterLiteral */) { for (int _t51 = 0; _t51 < (*val._v__ast__StringInterLiteral).exprs.len; ++_t51) { v__ast__Expr expr_ = ((v__ast__Expr*)(*val._v__ast__StringInterLiteral).exprs.data)[_t51]; Option_void _t52 = v__parser__Parser_check_undefined_variables(p, exprs, expr_); @@ -85257,7 +85548,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 291 /* v.ast.StructInit */) { + else if (val._typ == 292 /* v.ast.StructInit */) { for (int _t54 = 0; _t54 < (*val._v__ast__StructInit).fields.len; ++_t54) { v__ast__StructInitField field = ((v__ast__StructInitField*)(*val._v__ast__StructInit).fields.data)[_t54]; Option_void _t55 = v__parser__Parser_check_undefined_variables(p, exprs, field.expr); @@ -85289,10 +85580,10 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val) { string val_str = v__ast__Expr_str(val); - if (val._typ == 266 /* v.ast.Ident */) { + if (val._typ == 267 /* v.ast.Ident */) { for (int _t1 = 0; _t1 < exprs.len; ++_t1) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t1]; - if ((expr)._typ == 266 /* v.ast.Ident */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { if (string__eq((*expr._v__ast__Ident).name, (*val._v__ast__Ident).name)) { bool _t2 = true; return _t2; @@ -85300,7 +85591,7 @@ VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* } } } - else if (val._typ == 269 /* v.ast.IndexExpr */) { + else if (val._typ == 270 /* v.ast.IndexExpr */) { for (int _t3 = 0; _t3 < exprs.len; ++_t3) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t3]; if (string__eq(v__ast__Expr_str(expr), val_str)) { @@ -85309,19 +85600,19 @@ VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* } } } - else if (val._typ == 270 /* v.ast.InfixExpr */) { + else if (val._typ == 271 /* v.ast.InfixExpr */) { bool _t5 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__InfixExpr).left) || v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__InfixExpr).right); return _t5; } - else if (val._typ == 283 /* v.ast.PrefixExpr */) { + else if (val._typ == 284 /* v.ast.PrefixExpr */) { bool _t6 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__PrefixExpr).right); return _t6; } - else if (val._typ == 282 /* v.ast.PostfixExpr */) { + else if (val._typ == 283 /* v.ast.PostfixExpr */) { bool _t7 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__PostfixExpr).expr); return _t7; } - else if (val._typ == 286 /* v.ast.SelectorExpr */) { + else if (val._typ == 287 /* v.ast.SelectorExpr */) { for (int _t8 = 0; _t8 < exprs.len; ++_t8) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t8]; if (string__eq(v__ast__Expr_str(expr), val_str)) { @@ -85359,14 +85650,14 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa for (int i = 0; i < left.len; ++i) { v__ast__Expr lx_ = ((v__ast__Expr*)left.data)[i]; v__ast__Expr lx = lx_; - if (lx._typ == 266 /* v.ast.Ident */) { + if (lx._typ == 267 /* v.ast.Ident */) { if (op == v__token__Kind__decl_assign) { if (v__ast__Scope_known_var(p->scope, (*lx._v__ast__Ident).name)) { - v__ast__Stmt _t4 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of `"), 0xfe10, {.d_s = (*lx._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*lx._v__ast__Ident).pos)))); + v__ast__Stmt _t4 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of `"), /*115 &string*/0xfe10, {.d_s = (*lx._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*lx._v__ast__Ident).pos)))); return _t4; } v__ast__ShareType share = ((v__ast__ShareType)(0)); - if (((*lx._v__ast__Ident).info)._typ == 376 /* v.ast.IdentVar */) { + if (((*lx._v__ast__Ident).info)._typ == 377 /* v.ast.IdentVar */) { share = (*(*lx._v__ast__Ident).info._v__ast__IdentVar).share; if ((*(*lx._v__ast__Ident).info._v__ast__IdentVar).is_static) { if (!p->pref->translated && !p->is_translated && !p->pref->is_fmt && !p->inside_unsafe_fn) { @@ -85401,7 +85692,7 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa .is_stack_obj = p->inside_for, }); if (p->pref->autofree) { - if ((r0)._typ == 252 /* v.ast.CallExpr */) { + if ((r0)._typ == 253 /* v.ast.CallExpr */) { if ((*r0._v__ast__CallExpr).or_block.pos.pos > 0 && (*r0._v__ast__CallExpr).or_block.stmts.len > 0) { v.is_or = true; } @@ -85412,18 +85703,18 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa v__ast__Scope_register(p->scope, obj); } } - else if (lx._typ == 269 /* v.ast.IndexExpr */) { + else if (lx._typ == 270 /* v.ast.IndexExpr */) { if (op == v__token__Kind__decl_assign) { - v__ast__Stmt _t6 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("non-name `"), 0xfe10, {.d_s = v__ast__Expr_str((*lx._v__ast__IndexExpr).left)}}, {_SLIT("["), 0xfe10, {.d_s = v__ast__Expr_str((*lx._v__ast__IndexExpr).index)}}, {_SLIT("]` on left side of `:=`"), 0, { .d_c = 0 }}})), (*lx._v__ast__IndexExpr).pos)))); + v__ast__Stmt _t6 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("non-name `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*lx._v__ast__IndexExpr).left)}}, {_SLIT("["), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*lx._v__ast__IndexExpr).index)}}, {_SLIT("]` on left side of `:=`"), 0, { .d_c = 0 }}})), (*lx._v__ast__IndexExpr).pos)))); return _t6; } (*lx._v__ast__IndexExpr).is_setter = true; } - else if (lx._typ == 281 /* v.ast.ParExpr */) { + else if (lx._typ == 282 /* v.ast.ParExpr */) { } - else if (lx._typ == 283 /* v.ast.PrefixExpr */) { + else if (lx._typ == 284 /* v.ast.PrefixExpr */) { } - else if (lx._typ == 286 /* v.ast.SelectorExpr */) { + else if (lx._typ == 287 /* v.ast.SelectorExpr */) { if (op == v__token__Kind__decl_assign) { v__ast__Stmt _t7 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("struct fields can only be declared during the initialization"), (*lx._v__ast__SelectorExpr).pos)))); return _t7; @@ -85451,7 +85742,7 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa v__ast__Expr r = ((v__ast__Expr*)right.data)[_t11]; has_cross_var = v__parser__Parser_check_cross_variables(p, left, r); if (!(op == v__token__Kind__assign || op == v__token__Kind__decl_assign)) { - v__ast__Stmt _t12 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Kind_str(op)}}, {_SLIT(", expecting := or = or comma"), 0, { .d_c = 0 }}})), pos)))); + v__ast__Stmt _t12 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(op)}}, {_SLIT(", expecting := or = or comma"), 0, { .d_c = 0 }}})), pos)))); return _t12; } if (has_cross_var) { @@ -85482,7 +85773,7 @@ v__ast__ComptimeType v__parser__Parser_parse_comptime_type(v__parser__Parser* p) v__parser__Parser_check(p, v__token__Kind__dollar); string name = v__parser__Parser_check_name(p); if (!Array_string_contains(_const_v__parser__comptime_types, name)) { - v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unsupported compile-time type `"), 0xfe10, {.d_s = name}}, {_SLIT("`: only "), 0xfe10, {.d_s = Array_string_str(_const_v__parser__comptime_types)}}, {_SLIT(" are supported"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unsupported compile-time type `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`: only "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(_const_v__parser__comptime_types)}}, {_SLIT(" are supported"), 0, { .d_c = 0 }}}))); } v__ast__ComptimeTypeKind cty = v__ast__ComptimeTypeKind__map_; @@ -85524,7 +85815,7 @@ VV_LOCAL_SYMBOL v__ast__HashStmt v__parser__Parser_hash(v__parser__Parser* p) { v__parser__Parser_next(p); string main_str = _SLIT(""); string msg = _SLIT(""); - string content = string_all_before(string_all_after(val, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = kind}}, {_SLIT(" "), 0, { .d_c = 0 }}}))), _SLIT("//")); + string content = string_all_before(string_all_after(val, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = kind}}, {_SLIT(" "), 0, { .d_c = 0 }}}))), _SLIT("//")); if (string_contains(content, _SLIT(" #"))) { main_str = string_trim_space(string_all_before(content, _SLIT(" #"))); msg = string_trim_space(string_all_after(content, _SLIT(" #"))); @@ -85647,12 +85938,12 @@ VV_LOCAL_SYMBOL v__ast__ComptimeCall v__parser__Parser_comptime_call(v__parser__ if (!os__exists(abs_path)) { epath = os__real_path(os__join_path_single(os__dir(p->file_name), epath)); if (!os__exists(epath)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = epath}}, {_SLIT("\" does not exist so it cannot be embedded"), 0, { .d_c = 0 }}})), spos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = epath}}, {_SLIT("\" does not exist so it cannot be embedded"), 0, { .d_c = 0 }}})), spos); v__ast__ComptimeCall _t6 = (*(err_node)); return _t6; } if (!os__is_file(epath)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = epath}}, {_SLIT("\" is not a file so it cannot be embedded"), 0, { .d_c = 0 }}})), spos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = epath}}, {_SLIT("\" is not a file so it cannot be embedded"), 0, { .d_c = 0 }}})), spos); v__ast__ComptimeCall _t7 = (*(err_node)); return _t7; } @@ -85670,7 +85961,7 @@ VV_LOCAL_SYMBOL v__ast__ComptimeCall v__parser__Parser_comptime_call(v__parser__ Array_string fn_path = string_split(p->cur_fn_name, _SLIT("_")); string fn_path_joined = Array_string_join(fn_path, _const_os__path_separator); string compiled_vfile_path = os__real_path(string_replace(p->scanner->file_path, _SLIT("/"), _const_os__path_separator)); - string tmpl_path = (is_html ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(string*)array_last(fn_path))}}, {_SLIT(".html"), 0, { .d_c = 0 }}}))) : (path_of_literal_string_param)); + string tmpl_path = (is_html ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(string*)array_last(fn_path))}}, {_SLIT(".html"), 0, { .d_c = 0 }}}))) : (path_of_literal_string_param)); string dir = os__dir(compiled_vfile_path); string path = os__join_path_single(dir, fn_path_joined); path = /*f*/string__plus(path, _SLIT(".html")); @@ -85693,9 +85984,9 @@ VV_LOCAL_SYMBOL v__ast__ComptimeCall v__parser__Parser_comptime_call(v__parser__ return _t9; } if (is_html) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("vweb HTML template \""), 0xfe10, {.d_s = path}}, {_SLIT("\" not found"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("vweb HTML template \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\" not found"), 0, { .d_c = 0 }}}))); } else { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("template file \""), 0xfe10, {.d_s = path}}, {_SLIT("\" not found"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("template file \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\" not found"), 0, { .d_c = 0 }}}))); } v__ast__ComptimeCall _t10 = (*(err_node)); return _t10; @@ -85704,7 +85995,7 @@ VV_LOCAL_SYMBOL v__ast__ComptimeCall v__parser__Parser_comptime_call(v__parser__ string tmp_fn_name = string__plus(string_replace(p->cur_fn_name, _SLIT("."), _SLIT("__")), int_str(start_pos.pos)); #if defined(CUSTOM_DEFINE_trace_comptime) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">>> compiling comptime template file \""), 0xfe10, {.d_s = path}}, {_SLIT("\" for "), 0xfe10, {.d_s = tmp_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">>> compiling comptime template file \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\" for "), /*115 &string*/0xfe10, {.d_s = tmp_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif string v_code = v__parser__Parser_compile_template_file(p, path, tmp_fn_name); @@ -85713,14 +86004,14 @@ VV_LOCAL_SYMBOL v__ast__ComptimeCall v__parser__Parser_comptime_call(v__parser__ Array_string lines = string_split(v_code, _SLIT("\n")); for (int i = 0; i < lines.len; ++i) { string line = ((string*)lines.data)[i]; - println( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path}}, {_SLIT(":"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(": "), 0xfe10, {.d_s = line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = line}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } #endif #if defined(CUSTOM_DEFINE_trace_comptime) { println(_SLIT("")); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> template for "), 0xfe10, {.d_s = path}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> template for "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); println(v_code); println(_SLIT(">>> end of template END")); println(_SLIT("")); @@ -85774,7 +86065,7 @@ VV_LOCAL_SYMBOL v__ast__ComptimeFor v__parser__Parser_comptime_for(v__parser__Pa v__ast__Scope_register(p->scope, v__ast__Var_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__Var, (((v__ast__Var){.name = val_var,.share = 0,.is_mut = 0,.is_autofree_tmp = 0,.is_arg = 0,.is_auto_deref = 0,.is_inherited = 0,.expr = {0},.typ = v__ast__Table_find_type_idx(p->table, _SLIT("StructAttribute")),.orig_type = 0,.smartcasts = __new_array(0, 0, sizeof(v__ast__Type)),.pos = var_pos,.is_used = 0,.is_changed = 0,.is_or = 0,.is_tmp = 0,.is_auto_heap = 0,.is_stack_obj = 0,}))))); kind = v__ast__ComptimeForKind__attributes; } else { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown kind `"), 0xfe10, {.d_s = for_val}}, {_SLIT("`, available are: `methods`, `fields` or `attributes`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown kind `"), /*115 &string*/0xfe10, {.d_s = for_val}}, {_SLIT("`, available are: `methods`, `fields` or `attributes`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); v__ast__ComptimeFor _t1 = ((v__ast__ComptimeFor){.val_var = (string){.str=(byteptr)"", .is_lit=1},.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ = 0,}); return _t1; } @@ -85919,7 +86210,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser v__token__Pos pos = v__token__Token_pos(&p->tok); string n = v__parser__Parser_check_name(p); if (!string__eq(n, _SLIT("init"))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `init:`, not `"), 0xfe10, {.d_s = n}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `init:`, not `"), /*115 &string*/0xfe10, {.d_s = n}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); v__ast__ArrayInit _t4 = ((v__ast__ArrayInit){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.elem_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.ecmnts = __new_array(0, 0, sizeof(Array_v__ast__Comment)),.pre_cmnts = __new_array(0, 0, sizeof(v__ast__Comment)),.is_fixed = 0,.has_val = 0,.mod = (string){.str=(byteptr)"", .is_lit=1},.has_len = 0,.has_cap = 0,.has_default = 0,.has_it = 0,.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.len_expr = {0},.cap_expr = {0},.default_expr = {0},.expr_types = __new_array(0, 0, sizeof(v__ast__Type)),.elem_type = 0,.default_type = 0,.typ = 0,}); return _t4; } @@ -86007,7 +86298,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser v__parser__Parser_close_scope(p); } else { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrong field `"), 0xfe10, {.d_s = key}}, {_SLIT("`, expecting `len`, `cap`, or `init`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrong field `"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("`, expecting `len`, `cap`, or `init`"), 0, { .d_c = 0 }}}))); v__ast__ArrayInit _t9 = ((v__ast__ArrayInit){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.elem_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.ecmnts = __new_array(0, 0, sizeof(Array_v__ast__Comment)),.pre_cmnts = __new_array(0, 0, sizeof(v__ast__Comment)),.is_fixed = 0,.has_val = 0,.mod = (string){.str=(byteptr)"", .is_lit=1},.has_len = 0,.has_cap = 0,.has_default = 0,.has_it = 0,.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.len_expr = {0},.cap_expr = {0},.default_expr = {0},.expr_types = __new_array(0, 0, sizeof(v__ast__Type)),.elem_type = 0,.default_type = 0,.typ = 0,}); return _t9; }; @@ -86072,7 +86363,7 @@ v__ast__Expr v__parser__Parser_expr(v__parser__Parser* p, int precedence) { Option_v__ast__Expr _t2 = v__parser__Parser_check_expr(p, precedence); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - *(v__ast__Expr*) _t2.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + *(v__ast__Expr*) _t2.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); } v__ast__Expr _t1 = (*(v__ast__Expr*)_t2.data); @@ -86386,7 +86677,7 @@ bool inside_array_lit; v__parser__Parser_check(p, v__token__Kind__comma); if (p->tok.kind != v__token__Kind__name) { Option_v__ast__Expr _t9; - opt_ok(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`, expecting struct field"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))) }, (Option*)(&_t9), sizeof(v__ast__Expr)); + opt_ok(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`, expecting struct field"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))) }, (Option*)(&_t9), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -86587,7 +86878,7 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr node = v__ast__IndexExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__IndexExpr, (v__parser__Parser_index_expr(p, node, false)))); } p->is_stmt_ident = is_stmt_ident; - if (p->tok.kind == v__token__Kind__lpar && p->tok.line_nr == p->prev_tok.line_nr && (node)._typ == 269 /* v.ast.IndexExpr */) { + if (p->tok.kind == v__token__Kind__lpar && p->tok.line_nr == p->prev_tok.line_nr && (node)._typ == 270 /* v.ast.IndexExpr */) { v__parser__Parser_next(p); v__token__Pos pos = v__token__Token_pos(&p->tok); Array_v__ast__CallArg args = v__parser__Parser_call_args(p); @@ -86611,7 +86902,7 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr v__parser__Parser_next(p); v__ast__Expr right = v__parser__Parser_expr(p, precedence - 1); v__token__Pos_update_last_line(&pos, p->prev_tok.line_nr); - if ((node)._typ == 269 /* v.ast.IndexExpr */) { + if ((node)._typ == 270 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*node._v__ast__IndexExpr)); } node = v__ast__InfixExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__InfixExpr, (((v__ast__InfixExpr){.op = tok.kind,.pos = pos,.is_stmt = true,.left = node,.right = right,.left_type = 0,.right_type = 0,.auto_locked = (string){.str=(byteptr)"", .is_lit=1},.or_block = (v__ast__OrExpr){.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.ct_left_value_evaled = 0,.ct_left_value = v__ast__empty_comptime_const_expr(),.ct_right_value_evaled = 0,.ct_right_value = v__ast__empty_comptime_const_expr(),})))); @@ -86621,7 +86912,7 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr v__ast__Expr _t4 = node; return _t4; } - v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("move infix `"), 0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` operator before new line (if infix intended) or use brackets for a prefix expression"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("move infix `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` operator before new line (if infix intended) or use brackets for a prefix expression"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } node = v__parser__Parser_infix_expr(p, node); if (p->tok.kind == v__token__Kind__key_as && p->inside_if) { @@ -86631,13 +86922,13 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr } else if ((p->tok.kind == v__token__Kind__inc || p->tok.kind == v__token__Kind__dec) || (p->tok.kind == v__token__Kind__question && p->inside_ct_if_expr)) { if (p->peek_tok.kind == v__token__Kind__rpar || p->peek_tok.kind == v__token__Kind__rsbr) { if (!p->inside_ct_if_expr) { - v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` operator can only be used as a statement"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->peek_tok)); + v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` operator can only be used as a statement"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->peek_tok)); } } if ((p->tok.kind == v__token__Kind__inc || p->tok.kind == v__token__Kind__dec) && p->prev_tok.line_nr != p->tok.line_nr) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" must be on the same line as the previous token"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" must be on the same line as the previous token"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } - if ((node)._typ == 269 /* v.ast.IndexExpr */) { + if ((node)._typ == 270 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_mapset_is_setter(&(*node._v__ast__IndexExpr), true); } node = v__ast__PostfixExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__PostfixExpr, (((v__ast__PostfixExpr){.op = p->tok.kind,.pos = v__token__Token_pos(&p->tok),.expr = node,.auto_locked = (string){.str=(byteptr)"", .is_lit=1},})))); @@ -86677,7 +86968,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_infix_expr(v__parser__Parser* p, p->inside_in_array = false; } p->expecting_type = prev_expecting_type; - if (p->pref->is_vet && (op == v__token__Kind__key_in || op == v__token__Kind__not_in) && (right)._typ == 246 /* v.ast.ArrayInit */ && (/* as */ *(v__ast__ArrayInit*)__as_cast((right)._v__ast__ArrayInit,(right)._typ, 246) /*expected idx: 246, name: v.ast.ArrayInit */ ).exprs.len == 1) { + if (p->pref->is_vet && (op == v__token__Kind__key_in || op == v__token__Kind__not_in) && (right)._typ == 247 /* v.ast.ArrayInit */ && (/* as */ *(v__ast__ArrayInit*)__as_cast((right)._v__ast__ArrayInit,(right)._typ, 247) /*expected idx: 247, name: v.ast.ArrayInit */ ).exprs.len == 1) { v__parser__Parser_vet_error(p, _SLIT("Use `var == value` instead of `var in [value]`"), pos.line_nr, v__vet__FixKind__vfmt, v__vet__ErrorType__default); } Array_v__ast__Stmt or_stmts = __new_array_with_default(0, 0, sizeof(v__ast__Stmt), 0); @@ -86698,7 +86989,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_infix_expr(v__parser__Parser* p, } if (p->tok.kind == v__token__Kind__question) { v__parser__Parser_next(p); - or_kind = v__ast__OrKind__propagate; + or_kind = v__ast__OrKind__propagate_option; } p->or_is_handled = false; } @@ -86740,28 +87031,28 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_prefix_expr(v__parser__Parser* p) v__ast__Expr right = v__parser__Parser_expr(p, ((int)(v__token__Precedence__prefix))); p->is_amp = false; if (op == v__token__Kind__amp) { - if ((right)._typ == 253 /* v.ast.CastExpr */) { + if ((right)._typ == 254 /* v.ast.CastExpr */) { v__parser__Parser_recast_as_pointer(p, (voidptr)&/*qq*/(*right._v__ast__CastExpr), pos); v__ast__Expr _t1 = v__ast__CastExpr_to_sumtype_v__ast__Expr(&(*right._v__ast__CastExpr)); return _t1; } - if ((right)._typ == 286 /* v.ast.SelectorExpr */) { - if (((*right._v__ast__SelectorExpr).expr)._typ == 253 /* v.ast.CastExpr */) { + if ((right)._typ == 287 /* v.ast.SelectorExpr */) { + if (((*right._v__ast__SelectorExpr).expr)._typ == 254 /* v.ast.CastExpr */) { v__parser__Parser_recast_as_pointer(p, (voidptr)&/*qq*/(*(*right._v__ast__SelectorExpr).expr._v__ast__CastExpr), pos); v__ast__Expr _t2 = v__ast__SelectorExpr_to_sumtype_v__ast__Expr(&(*right._v__ast__SelectorExpr)); return _t2; } } - if ((right)._typ == 269 /* v.ast.IndexExpr */) { - if (((*right._v__ast__IndexExpr).left)._typ == 253 /* v.ast.CastExpr */) { + if ((right)._typ == 270 /* v.ast.IndexExpr */) { + if (((*right._v__ast__IndexExpr).left)._typ == 254 /* v.ast.CastExpr */) { v__parser__Parser_recast_as_pointer(p, (voidptr)&/*qq*/(*(*right._v__ast__IndexExpr).left._v__ast__CastExpr), pos); v__ast__Expr _t3 = v__ast__IndexExpr_to_sumtype_v__ast__Expr(&(*right._v__ast__IndexExpr)); return _t3; } } - if ((right)._typ == 281 /* v.ast.ParExpr */) { - if (((*right._v__ast__ParExpr).expr)._typ == 291 /* v.ast.StructInit */) { - v__parser__Parser_note_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unnecessary `()`, use `&"), 0xfe10, {.d_s = v__ast__Expr_str((*right._v__ast__ParExpr).expr)}}, {_SLIT("` instead of `&("), 0xfe10, {.d_s = v__ast__Expr_str((*right._v__ast__ParExpr).expr)}}, {_SLIT(")`"), 0, { .d_c = 0 }}})), (*right._v__ast__ParExpr).pos); + if ((right)._typ == 282 /* v.ast.ParExpr */) { + if (((*right._v__ast__ParExpr).expr)._typ == 292 /* v.ast.StructInit */) { + v__parser__Parser_note_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unnecessary `()`, use `&"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*right._v__ast__ParExpr).expr)}}, {_SLIT("` instead of `&("), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*right._v__ast__ParExpr).expr)}}, {_SLIT(")`"), 0, { .d_c = 0 }}})), (*right._v__ast__ParExpr).pos); right = (*right._v__ast__ParExpr).expr; } } @@ -86784,7 +87075,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_prefix_expr(v__parser__Parser* p) } if (p->tok.kind == v__token__Kind__question) { v__parser__Parser_next(p); - or_kind = v__ast__OrKind__propagate; + or_kind = v__ast__OrKind__propagate_option; } p->or_is_handled = false; } @@ -86803,7 +87094,7 @@ v__ast__CallExpr v__parser__Parser_call_expr(v__parser__Parser* p, v__ast__Langu bool v__parser__Parser_call_expr_defer_0 = false; string old_expr_mod; v__token__Pos first_pos = v__token__Token_pos(&p->tok); - string fn_name = (language == v__ast__Language__c ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), 0xfe10, {.d_s = v__parser__Parser_check_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : language == v__ast__Language__js ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), 0xfe10, {.d_s = v__parser__Parser_check_js_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : mod.len > 0 ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod}}, {_SLIT("."), 0xfe10, {.d_s = v__parser__Parser_check_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (v__parser__Parser_check_name(p))); + string fn_name = (language == v__ast__Language__c ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_check_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : language == v__ast__Language__js ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_check_js_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : mod.len > 0 ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_check_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (v__parser__Parser_check_name(p))); if (language != v__ast__Language__v) { v__parser__Parser_check_for_impure_v(p, language, first_pos); } @@ -86826,9 +87117,6 @@ string old_expr_mod; Array_v__ast__CallArg args = v__parser__Parser_call_args(p); v__token__Pos last_pos = v__token__Token_pos(&p->tok); v__parser__Parser_check(p, v__token__Kind__rpar); - if (p->tok.kind == v__token__Kind__not) { - v__parser__Parser_next(p); - } v__token__Pos pos = v__token__Pos_extend(first_pos, last_pos); Array_v__ast__Stmt or_stmts = __new_array_with_default(0, 0, sizeof(v__ast__Stmt), 0); v__token__Pos or_pos = v__token__Token_pos(&p->tok); @@ -86844,12 +87132,13 @@ string old_expr_mod; v__parser__Parser_close_scope(p); p->inside_or_expr = was_inside_or_expr; } - if (p->tok.kind == v__token__Kind__question) { + if (p->tok.kind == v__token__Kind__question || p->tok.kind == v__token__Kind__not) { + bool is_not = p->tok.kind == v__token__Kind__not; v__parser__Parser_next(p); if (p->inside_defer) { v__parser__Parser_error_with_pos(p, _SLIT("error propagation not allowed inside `defer` blocks"), v__token__Token_pos(&p->prev_tok)); } - or_kind = v__ast__OrKind__propagate; + or_kind = (is_not ? (v__ast__OrKind__propagate_result) : (v__ast__OrKind__propagate_option)); } if (_IN_MAP(ADDR(string, fn_name), ADDR(map, p->imported_symbols))) { fn_name = (*(string*)map_get(ADDR(map, p->imported_symbols), &(string[]){fn_name}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); @@ -86925,7 +87214,7 @@ Array_v__ast__CallArg v__parser__Parser_call_args(v__parser__Parser* p) { if (array_decompose) { expr = v__ast__ArrayDecompose_to_sumtype_v__ast__Expr(ADDR(v__ast__ArrayDecompose, (((v__ast__ArrayDecompose){.pos = v__token__Token_pos(&p->tok),.expr = expr,.expr_type = 0,.arg_type = 0,})))); } - if ((expr)._typ == 291 /* v.ast.StructInit */) { + if ((expr)._typ == 292 /* v.ast.StructInit */) { _PUSH_MANY(&(*expr._v__ast__StructInit).pre_comments, (comments), _t2, Array_v__ast__Comment); comments = __new_array_with_default(0, 0, sizeof(v__ast__Comment), 0); } @@ -87080,19 +87369,19 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { if (is_method) { bool is_duplicate = v__ast__TypeSymbol_has_method(type_sym, name); if (type_sym->kind == v__ast__Kind__interface_ && is_duplicate) { - if ((type_sym->info)._typ == 434 /* v.ast.Interface */) { + if ((type_sym->info)._typ == 435 /* v.ast.Interface */) { is_duplicate = !v__ast__Interface_has_method(&(*type_sym->info._v__ast__Interface), name); } } if (is_duplicate) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); v__ast__FnDecl _t8 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t8; } } if (!p->pref->is_fmt) { if (_IN_MAP(ADDR(string, name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot redefine imported function `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot redefine imported function `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); v__ast__FnDecl _t9 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t9; } @@ -87110,11 +87399,11 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { v__ast__FnDecl _t10 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t10; } - multi_return_Array_v__ast__Type_Array_string mr_8867 = v__parser__Parser_parse_generic_types(p); - Array_string generic_names = mr_8867.arg1; + multi_return_Array_v__ast__Type_Array_string mr_8890 = v__parser__Parser_parse_generic_types(p); + Array_string generic_names = mr_8890.arg1; if (is_method && v__ast__Type_has_flag(rec.typ, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* sym = v__ast__Table_sym(p->table, rec.typ); - if ((sym->info)._typ == 416 /* v.ast.Struct */) { + if ((sym->info)._typ == 417 /* v.ast.Struct */) { Array_string _t11 = {0}; Array_v__ast__Type _t11_orig = (*sym->info._v__ast__Struct).generic_types; int _t11_len = _t11_orig.len; @@ -87134,10 +87423,10 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { } } } - multi_return_Array_v__ast__Param_bool_bool mr_9302 = v__parser__Parser_fn_args(p); - Array_v__ast__Param args2 = mr_9302.arg0; - bool are_args_type_only = mr_9302.arg1; - bool is_variadic = mr_9302.arg2; + multi_return_Array_v__ast__Param_bool_bool mr_9325 = v__parser__Parser_fn_args(p); + Array_v__ast__Param args2 = mr_9325.arg0; + bool are_args_type_only = mr_9325.arg1; + bool is_variadic = mr_9325.arg2; if (is_c2v_variadic) { is_variadic = true; } @@ -87146,7 +87435,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { for (int _t16 = 0; _t16 < params.len; ++_t16) { v__ast__Param param = ((v__ast__Param*)params.data)[_t16]; if (v__ast__Scope_known_var(p->scope, param.name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), param.pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), param.pos); v__ast__FnDecl _t17 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t17; } @@ -87197,7 +87486,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { is_non_local = elem_type_sym->mod.len > 0 && !string__eq(elem_type_sym->mod, p->mod) && elem_type_sym->language == v__ast__Language__v; } if (is_non_local) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot define new methods on non-local type "), 0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), rec.type_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot define new methods on non-local type "), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), rec.type_pos); v__ast__FnDecl _t18 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t18; } @@ -87233,9 +87522,9 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { })); } else { if (language == v__ast__Language__c) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } else if (language == v__ast__Language__js) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { name = v__parser__Parser_prepend_mod(p, name); } @@ -87253,7 +87542,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { if ((existing.name).len != 0) { if (file_mode == v__ast__Language__v && existing.file_mode != v__ast__Language__v) { if (!p->pref->is_fmt) { - name = v__parser__Parser_prepend_mod(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("pure_v_but_overriden_by_"), 0xfe10, {.d_s = v__ast__Language_str(existing.file_mode)}}, {_SLIT("_"), 0xfe10, {.d_s = short_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + name = v__parser__Parser_prepend_mod(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("pure_v_but_overriden_by_"), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(existing.file_mode)}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = short_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } else { array_push((array*)&p->table->redefined_fns, _MOV((string[]){ string_clone(name) })); @@ -87432,7 +87721,7 @@ bool v__parser__Parser_fn_receiver_defer_0 = false; v__ast__TypeSymbol* type_sym = v__ast__Table_sym(p->table, rec->typ); bool is_auto_rec = false; if (type_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 416) /*expected idx: 416, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; if (!rec->is_mut && !v__ast__Type_is_ptr(rec->typ) && info.fields.len > 8) { rec->typ = v__ast__Type_ref(rec->typ); is_auto_rec = true; @@ -87478,9 +87767,9 @@ bool v__parser__Parser_anon_fn_defer_0 = false; v__parser__Parser_anon_fn_defer_0 = true; p->scope->detached_from_parent = true; Array_v__ast__Param inherited_vars = (p->tok.kind == v__token__Kind__lsbr ? (v__parser__Parser_closure_vars(p)) : (__new_array_with_default(0, 0, sizeof(v__ast__Param), 0))); - multi_return_Array_v__ast__Param_bool_bool mr_18767 = v__parser__Parser_fn_args(p); - Array_v__ast__Param args = mr_18767.arg0; - bool is_variadic = mr_18767.arg2; + multi_return_Array_v__ast__Param_bool_bool mr_18790 = v__parser__Parser_fn_args(p); + Array_v__ast__Param args = mr_18790.arg0; + bool is_variadic = mr_18790.arg2; for (int _t2 = 0; _t2 < args.len; ++_t2) { v__ast__Param arg = ((v__ast__Param*)args.data)[_t2]; if (arg.name.len == 0 && v__ast__Table_sym(p->table, arg.typ)->kind != v__ast__Kind__placeholder) { @@ -87516,18 +87805,18 @@ bool v__parser__Parser_anon_fn_defer_0 = false; return_type = v__parser__Parser_parse_type(p); return_type_pos = v__token__Pos_extend(return_type_pos, v__token__Token_pos(&p->tok)); } else if (p->tok.kind != v__token__Kind__lcbr) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected return type, not "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" for anonymous function"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected return type, not "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" for anonymous function"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } } Array_v__ast__Stmt stmts = __new_array_with_default(0, 0, sizeof(v__ast__Stmt), 0); bool no_body = p->tok.kind != v__token__Kind__lcbr; same_line = p->tok.line_nr == p->prev_tok.line_nr; if (no_body && same_line) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" after anonymous function signature, expecting `{`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" after anonymous function signature, expecting `{`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } Array_string label_names = __new_array_with_default(0, 0, sizeof(string), 0); v__ast__Fn func = ((v__ast__Fn){.is_variadic = is_variadic,.language = 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 = false,.no_body = 0,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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 = return_type,.receiver_type = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.params = args,.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}); - string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("anon_fn_"), 0xfe10, {.d_s = p->unique_prefix}}, {_SLIT("_"), 0xfe10, {.d_s = v__ast__Table_fn_type_signature(p->table, (voidptr)&/*qq*/func)}}, {_SLIT("_"), 0xfe07, {.d_i32 = p->tok.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("anon_fn_"), /*115 &string*/0xfe10, {.d_s = p->unique_prefix}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_fn_type_signature(p->table, (voidptr)&/*qq*/func)}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = p->tok.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); string keep_fn_name = p->cur_fn_name; p->cur_fn_name = name; if (p->tok.kind == v__token__Kind__lcbr) { @@ -87662,7 +87951,7 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Param_bool_bool v__parser__Parser_fn_ } if (p->tok.kind == v__token__Kind__comma) { if (is_variadic) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use ...(variadic) with non-final parameter no "), 0xfe07, {.d_i32 = arg_no}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use ...(variadic) with non-final parameter no "), /*100 &int*/0xfe07, {.d_i32 = arg_no}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); return (multi_return_Array_v__ast__Param_bool_bool){.arg0=__new_array_with_default(0, 0, sizeof(v__ast__Param), 0), .arg1=false, .arg2=false}; } v__parser__Parser_next(p); @@ -87695,13 +87984,13 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Param_bool_bool v__parser__Parser_fn_ string name = v__parser__Parser_check_name(p); Array_string arg_names = new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){string_clone(name)})); if (name.len > 0 && p->fn_language == v__ast__Language__v && u8_is_capital(string_at(name, 0))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter name must not begin with upper case letter (`"), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(arg_names, 0))}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter name must not begin with upper case letter (`"), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(arg_names, 0))}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); } Array_v__token__Pos type_pos = new_array_from_c_array(1, 1, sizeof(v__token__Pos), _MOV((v__token__Pos[1]){v__token__Token_pos(&p->tok)})); for (;;) { if (!(p->tok.kind == v__token__Kind__comma)) break; if (!p->pref->is_fmt) { - v__parser__Parser_warn(p, string__plus(_SLIT("`fn f(x, y Type)` syntax has been deprecated and will soon be removed. "), str_intp(2, _MOV((StrIntpData[]){{_SLIT("Use `fn f(x Type, y Type)` instead. You can run `v fmt -w \""), 0xfe10, {.d_s = p->scanner->file_path}}, {_SLIT("\"` to automatically fix your code."), 0, { .d_c = 0 }}})))); + v__parser__Parser_warn(p, string__plus(_SLIT("`fn f(x, y Type)` syntax has been deprecated and will soon be removed. "), str_intp(2, _MOV((StrIntpData[]){{_SLIT("Use `fn f(x Type, y Type)` instead. You can run `v fmt -w \""), /*115 &string*/0xfe10, {.d_s = p->scanner->file_path}}, {_SLIT("\"` to automatically fix your code."), 0, { .d_c = 0 }}})))); } v__parser__Parser_next(p); array_push((array*)&arg_pos, _MOV((v__token__Pos[]){ v__token__Token_pos(&p->tok) })); @@ -87758,7 +88047,7 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Param_bool_bool v__parser__Parser_fn_ } array_push((array*)&args, _MOV((v__ast__Param[]){ ((v__ast__Param){.pos = (*(v__token__Pos*)/*ee elem_sym */array_get(arg_pos, i)),.name = arg_name,.is_mut = is_mut,.is_auto_rec = 0,.type_pos = (*(v__token__Pos*)/*ee elem_sym */array_get(type_pos, i)),.is_hidden = 0,.typ = typ,}) })); if (is_variadic && p->tok.kind == v__token__Kind__comma) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use ...(variadic) with non-final parameter "), 0xfe10, {.d_s = arg_name}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(arg_pos, i))); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use ...(variadic) with non-final parameter "), /*115 &string*/0xfe10, {.d_s = arg_name}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(arg_pos, i))); return (multi_return_Array_v__ast__Param_bool_bool){.arg0=__new_array_with_default(0, 0, sizeof(v__ast__Param), 0), .arg1=false, .arg2=false}; } } @@ -87780,7 +88069,7 @@ VV_LOCAL_SYMBOL v__ast__GoExpr v__parser__Parser_go_expr(v__parser__Parser* p) { v__token__Pos spos = v__token__Token_pos(&p->tok); v__ast__Expr expr = v__parser__Parser_expr(p, 0); v__ast__CallExpr _t1; /* if prepend */ - if ((expr)._typ == 252 /* v.ast.CallExpr */) { + if ((expr)._typ == 253 /* v.ast.CallExpr */) { _t1 = (*expr._v__ast__CallExpr); } else { v__parser__Parser_error_with_pos(p, _SLIT("expression in `go` must be a function call"), v__ast__Expr_pos(expr)); @@ -87810,7 +88099,7 @@ VV_LOCAL_SYMBOL Array_v__ast__Param v__parser__Parser_closure_vars(v__parser__Pa Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(p->scope->parent, var_name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), 0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); continue; } @@ -87840,14 +88129,14 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_mutable_arguments(v__parser__Par return; } if (sym->kind == v__ast__Kind__alias) { - v__ast__Type atyp = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Alias */ ).parent_type; + v__ast__Type atyp = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; v__parser__Parser_check_fn_mutable_arguments(p, atyp, pos); return; } if (p->fn_language == v__ast__Language__c) { return; } - v__parser__Parser_error_with_pos(p, string__plus(_SLIT("mutable arguments are only allowed for arrays, interfaces, maps, pointers, structs or their aliases\n"), str_intp(4, _MOV((StrIntpData[]){{_SLIT("return values instead: `fn foo(mut n "), 0xfe10, {.d_s = sym->name}}, {_SLIT(") {` => `fn foo(n "), 0xfe10, {.d_s = sym->name}}, {_SLIT(") "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" {`"), 0, { .d_c = 0 }}}))), pos); + v__parser__Parser_error_with_pos(p, string__plus(_SLIT("mutable arguments are only allowed for arrays, interfaces, maps, pointers, structs or their aliases\n"), str_intp(4, _MOV((StrIntpData[]){{_SLIT("return values instead: `fn foo(mut n "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(") {` => `fn foo(n "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(") "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" {`"), 0, { .d_c = 0 }}}))), pos); } VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_shared_arguments(v__parser__Parser* p, v__ast__Type typ, v__token__Pos pos) { @@ -87860,14 +88149,14 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_shared_arguments(v__parser__Pars VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_atomic_arguments(v__parser__Parser* p, v__ast__Type typ, v__token__Pos pos) { v__ast__TypeSymbol* sym = v__ast__Table_sym(p->table, typ); if (!(sym->kind == v__ast__Kind__u32 || sym->kind == v__ast__Kind__int || sym->kind == v__ast__Kind__u64)) { - v__parser__Parser_error_with_pos(p, string__plus(_SLIT("atomic arguments are only allowed for 32/64 bit integers\n"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("use shared arguments instead: `fn foo(atomic n "), 0xfe10, {.d_s = sym->name}}, {_SLIT(") {` => `fn foo(shared n "), 0xfe10, {.d_s = sym->name}}, {_SLIT(") {`"), 0, { .d_c = 0 }}}))), pos); + v__parser__Parser_error_with_pos(p, string__plus(_SLIT("atomic arguments are only allowed for 32/64 bit integers\n"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("use shared arguments instead: `fn foo(atomic n "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(") {` => `fn foo(shared n "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(") {`"), 0, { .d_c = 0 }}}))), pos); } } VV_LOCAL_SYMBOL bool v__parser__have_fn_main(Array_v__ast__Stmt stmts) { for (int _t1 = 0; _t1 < stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[_t1]; - if ((stmt)._typ == 183 /* v.ast.FnDecl */) { + if ((stmt)._typ == 184 /* v.ast.FnDecl */) { if (string__eq((*stmt._v__ast__FnDecl).name, _SLIT("main.main"))) { bool _t2 = true; return _t2; @@ -87914,7 +88203,7 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_for_stmt(v__parser__Parser* p) { v__parser__Parser_check(p, v__token__Kind__semicolon); if (p->tok.kind != v__token__Kind__semicolon) { if (p->tok.kind == v__token__Kind__name && (p->peek_tok.kind == v__token__Kind__inc || p->peek_tok.kind == v__token__Kind__dec)) { - v__ast__Stmt _t4 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use "), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT0, 0xfe10, {.d_s = v__token__Kind_str(p->peek_tok.kind)}}, {_SLIT(" as value"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t4 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use "), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT0, /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(p->peek_tok.kind)}}, {_SLIT(" as value"), 0, { .d_c = 0 }}})))))); return _t4; } cond = v__parser__Parser_expr(p, 0); @@ -87974,21 +88263,21 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_for_stmt(v__parser__Parser* p) { return _t6; } if (v__ast__Scope_known_var(p->scope, key_var_name)) { - v__ast__Stmt _t7 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of key iteration variable `"), 0xfe10, {.d_s = key_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t7 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of key iteration variable `"), /*115 &string*/0xfe10, {.d_s = key_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); return _t7; } if (v__ast__Scope_known_var(p->scope, val_var_name)) { - v__ast__Stmt _t8 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of value iteration variable `"), 0xfe10, {.d_s = val_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t8 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of value iteration variable `"), /*115 &string*/0xfe10, {.d_s = val_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); return _t8; } v__ast__Scope_register(p->scope, v__ast__Var_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__Var, (((v__ast__Var){.name = key_var_name,.share = 0,.is_mut = 0,.is_autofree_tmp = 0,.is_arg = 0,.is_auto_deref = 0,.is_inherited = 0,.expr = {0},.typ = _const_v__ast__int_type,.orig_type = 0,.smartcasts = __new_array(0, 0, sizeof(v__ast__Type)),.pos = key_var_pos,.is_used = 0,.is_changed = 0,.is_or = 0,.is_tmp = true,.is_auto_heap = 0,.is_stack_obj = true,}))))); } else if (v__ast__Scope_known_var(p->scope, val_var_name)) { - v__ast__Stmt _t9 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of value iteration variable `"), 0xfe10, {.d_s = val_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t9 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of value iteration variable `"), /*115 &string*/0xfe10, {.d_s = val_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); return _t9; } v__parser__Parser_check(p, v__token__Kind__key_in); if (p->tok.kind == v__token__Kind__name && (string__eq(p->tok.lit, key_var_name) || string__eq(p->tok.lit, val_var_name))) { - v__ast__Stmt _t10 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("in a `for x in array` loop, the key or value iteration variable `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` can not be the same as the array variable"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t10 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("in a `for x in array` loop, the key or value iteration variable `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` can not be the same as the array variable"), 0, { .d_c = 0 }}})))))); return _t10; } v__ast__Expr cond = v__parser__Parser_expr(p, 0); @@ -88151,7 +88440,7 @@ bool was_inside_ct_if_expr; var.pos = v__token__Token_pos(&p->tok); var.name = v__parser__Parser_check_name(p); if (v__ast__Scope_known_var(p->scope, var.name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of `"), 0xfe10, {.d_s = var.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), var.pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of `"), /*115 &string*/0xfe10, {.d_s = var.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), var.pos); } array_push((array*)&vars, _MOV((v__ast__IfGuardVar[]){ var })); if (p->tok.kind != v__token__Kind__comma) { @@ -88163,7 +88452,7 @@ bool was_inside_ct_if_expr; v__parser__Parser_check(p, v__token__Kind__decl_assign); _PUSH_MANY(&comments, (v__parser__Parser_eat_comments(p, ((v__parser__EatCommentsConfig){.same_line = 0,.follow_up = 0,}))), _t9, Array_v__ast__Comment); v__ast__Expr expr = v__parser__Parser_expr(p, 0); - if (!((expr)._typ == 252 /* v.ast.CallExpr */ || (expr)._typ == 269 /* v.ast.IndexExpr */ || (expr)._typ == 283 /* v.ast.PrefixExpr */)) { + if (!((expr)._typ == 253 /* v.ast.CallExpr */ || (expr)._typ == 270 /* v.ast.IndexExpr */ || (expr)._typ == 284 /* v.ast.PrefixExpr */)) { v__parser__Parser_error_with_pos(p, _SLIT("if guard condition expression is illegal, it should return optional"), v__ast__Expr_pos(expr)); } cond = v__ast__IfGuardExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__IfGuardExpr, (((v__ast__IfGuardExpr){.vars = vars,.expr = expr,.expr_type = 0,})))); @@ -88437,14 +88726,14 @@ VV_LOCAL_SYMBOL v__ast__SelectExpr v__parser__Parser_select_expr(v__parser__Pars } p->inside_match = false; p->inside_select = false; - if (stmt._typ == 306 /* v.ast.ExprStmt */) { + if (stmt._typ == 307 /* v.ast.ExprStmt */) { bool check_timeout = false; if (!(*stmt._v__ast__ExprStmt).is_expr) { v__parser__Parser_error_with_pos(p, _SLIT("select: invalid expression"), (*stmt._v__ast__ExprStmt).pos); v__ast__SelectExpr _t4 = ((v__ast__SelectExpr){.branches = __new_array(0, 0, sizeof(v__ast__SelectBranch)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_exception = 0,.is_expr = 0,.expected_type = 0,}); return _t4; } else { - if ((*stmt._v__ast__ExprStmt).expr._typ == 270 /* v.ast.InfixExpr */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 271 /* v.ast.InfixExpr */) { if ((*(*stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).op != v__token__Kind__arrow) { check_timeout = true; } else if (is_gt) { @@ -88472,9 +88761,9 @@ VV_LOCAL_SYMBOL v__ast__SelectExpr v__parser__Parser_select_expr(v__parser__Pars has_timeout = true; } } - else if (stmt._typ == 298 /* v.ast.AssignStmt */) { + else if (stmt._typ == 299 /* v.ast.AssignStmt */) { v__ast__Expr expr = (*(v__ast__Expr*)/*ee elem_sym */array_get((*stmt._v__ast__AssignStmt).right, 0)); - if (expr._typ == 283 /* v.ast.PrefixExpr */) { + if (expr._typ == 284 /* v.ast.PrefixExpr */) { if ((*expr._v__ast__PrefixExpr).op != v__token__Kind__arrow) { v__parser__Parser_error_with_pos(p, _SLIT("select key: `<-` operator expected"), (*expr._v__ast__PrefixExpr).pos); v__ast__SelectExpr _t7 = ((v__ast__SelectExpr){.branches = __new_array(0, 0, sizeof(v__ast__SelectBranch)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_exception = 0,.is_expr = 0,.expected_type = 0,}); @@ -88536,7 +88825,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_lockable(v__parser__Parser* p) { v__token__Pos pos = v__token__Token_pos(&p->tok); for (;;) { if (p->tok.kind != v__token__Kind__name) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` (field/variable name expected)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` (field/variable name expected)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } array_push((array*)&names, _MOV((string[]){ string_clone(p->tok.lit) })); array_push((array*)&positions, _MOV((v__token__Pos[]){ pos })); @@ -88586,7 +88875,7 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Expr_Array_v__ast__Comment v__parser_ Array_v__ast__Comment comments = __new_array_with_default(0, 0, sizeof(v__ast__Comment), 0); for (;;) { v__ast__Expr expr = v__parser__Parser_lockable(p); - if ((expr)._typ == 256 /* v.ast.Comment */) { + if ((expr)._typ == 257 /* v.ast.Comment */) { array_push((array*)&comments, _MOV((v__ast__Comment[]){ (*expr._v__ast__Comment) })); } else { array_push((array*)&exprs, _MOV((v__ast__Expr[]){ expr })); @@ -88609,7 +88898,7 @@ VV_LOCAL_SYMBOL v__ast__LockExpr v__parser__Parser_lock_expr(v__parser__Parser* for (;;) { bool is_rlock = p->tok.kind == v__token__Kind__key_rlock; if (!is_rlock && p->tok.kind != v__token__Kind__key_lock) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT("`, expected `lock` or `rlock`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT("`, expected `lock` or `rlock`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } v__parser__Parser_next(p); if (p->tok.kind == v__token__Kind__lcbr) { @@ -88622,7 +88911,7 @@ VV_LOCAL_SYMBOL v__ast__LockExpr v__parser__Parser_lock_expr(v__parser__Parser* for (int _t1 = 0; _t1 < exprs.len; ++_t1) { v__ast__Expr e = ((v__ast__Expr*)exprs.data)[_t1]; if (!v__ast__Expr_is_lockable(&e)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__ast__Expr_str(e)}}, {_SLIT("` cannot be locked - only `x` or `x.y` are supported"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(e)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(e)}}, {_SLIT("` cannot be locked - only `x` or `x.y` are supported"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(e)); } array_push((array*)&lockeds, _MOV((v__ast__Expr[]){ e })); array_push((array*)&is_rlocked, _MOV((bool[]){ is_rlock })); @@ -88695,8 +88984,8 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check_unused_imports(v__parser__Parser* p string alias = import_m.alias; string mod = import_m.mod; if (!v__parser__Parser_is_used_import(p, alias)) { - string mod_alias = (string__eq(alias, mod) ? (alias) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = alias}}, {_SLIT(" ("), 0xfe10, {.d_s = mod}}, {_SLIT(")"), 0, { .d_c = 0 }}})))); - v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("module '"), 0xfe10, {.d_s = mod_alias}}, {_SLIT("' is imported but never used"), 0, { .d_c = 0 }}})), import_m.mod_pos); + string mod_alias = (string__eq(alias, mod) ? (alias) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = alias}}, {_SLIT(" ("), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT(")"), 0, { .d_c = 0 }}})))); + v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("module '"), /*115 &string*/0xfe10, {.d_s = mod_alias}}, {_SLIT("' is imported but never used"), 0, { .d_c = 0 }}})), import_m.mod_pos); } } } @@ -88709,21 +88998,21 @@ v__ast__Type v__parser__Parser_parse_array_type(v__parser__Parser* p, v__token__ if (p->pref->is_fmt) { fixed_size = 987654321; } else { - if (size_expr._typ == 271 /* v.ast.IntegerLiteral */) { + if (size_expr._typ == 272 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*size_expr._v__ast__IntegerLiteral).val); } - else if (size_expr._typ == 266 /* v.ast.Ident */) { + else if (size_expr._typ == 267 /* v.ast.Ident */) { bool show_non_const_error = false; Option_v__ast__ConstField_ptr _t1; - if (_t1 = v__ast__Scope_find_const(p->table->global_scope, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = p->mod}}, {_SLIT("."), 0xfe10, {.d_s = (*size_expr._v__ast__Ident).name}}, {_SLIT0, 0, { .d_c = 0 }}}))), _t1.state == 0) { + if (_t1 = v__ast__Scope_find_const(p->table->global_scope, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = p->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*size_expr._v__ast__Ident).name}}, {_SLIT0, 0, { .d_c = 0 }}}))), _t1.state == 0) { v__ast__ConstField* const_field = *(v__ast__ConstField**)_t1.data; - if ((const_field->expr)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((const_field->expr)._typ == 272 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*const_field->expr._v__ast__IntegerLiteral).val); } else { - if ((const_field->expr)._typ == 270 /* v.ast.InfixExpr */) { + if ((const_field->expr)._typ == 271 /* v.ast.InfixExpr */) { v__transformer__Transformer* t = v__transformer__new_transformer(p->pref); v__ast__Expr folded_expr = v__transformer__Transformer_infix_expr(t, (voidptr)&/*qq*/(*const_field->expr._v__ast__InfixExpr)); - if ((folded_expr)._typ == 271 /* v.ast.IntegerLiteral */) { + if ((folded_expr)._typ == 272 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*folded_expr._v__ast__IntegerLiteral).val); } else { show_non_const_error = true; @@ -88741,7 +89030,7 @@ v__ast__Type v__parser__Parser_parse_array_type(v__parser__Parser* p, v__token__ } } if (show_non_const_error) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-constant array bound `"), 0xfe10, {.d_s = (*size_expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*size_expr._v__ast__Ident).pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-constant array bound `"), /*115 &string*/0xfe10, {.d_s = (*size_expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*size_expr._v__ast__Ident).pos); } } @@ -88815,7 +89104,7 @@ v__ast__Type v__parser__Parser_parse_map_type(v__parser__Parser* p) { return _t3; } string s = v__ast__Table_type_to_str(p->table, key_type); - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("maps only support string, integer, float, rune, enum or voidptr keys for now (not `"), 0xfe10, {.d_s = s}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("maps only support string, integer, float, rune, enum or voidptr keys for now (not `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); v__ast__Type _t4 = 0; return _t4; } @@ -89026,7 +89315,7 @@ v__ast__Type v__parser__Parser_parse_inline_sum_type(v__parser__Parser* p) { if (variants.len > 1) { if (variants.len > _const_v__parser__maximum_inline_sum_type_variants) { v__token__Pos pos = v__token__Pos_extend((*(v__ast__TypeNode*)/*ee elem_sym */array_get(variants, 0)).pos, (*(v__ast__TypeNode*)/*ee elem_sym */array_get(variants, variants.len - 1)).pos); - v__parser__Parser_warn_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("an inline sum type expects a maximum of "), 0xfe07, {.d_i32 = _const_v__parser__maximum_inline_sum_type_variants}}, {_SLIT(" types ("), 0xfe07, {.d_i32 = variants.len}}, {_SLIT(" were given)"), 0, { .d_c = 0 }}})), pos); + v__parser__Parser_warn_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("an inline sum type expects a maximum of "), /*100 &int literal*/0xfe07, {.d_i32 = _const_v__parser__maximum_inline_sum_type_variants}}, {_SLIT(" types ("), /*100 &int*/0xfe07, {.d_i32 = variants.len}}, {_SLIT(" were given)"), 0, { .d_c = 0 }}})), pos); } Array_string _t1 = {0}; Array_v__ast__TypeNode _t1_orig = variants; @@ -89040,7 +89329,7 @@ v__ast__Type v__parser__Parser_parse_inline_sum_type(v__parser__Parser* p) { } Array_string variant_names =_t1; qsort(variant_names.data, variant_names.len, variant_names.element_size, (int (*)(const void *, const void *))&compare_7932637671395545435_string); - string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_anon_sum_type_"), 0xfe10, {.d_s = Array_string_join(variant_names, _SLIT("_"))}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_anon_sum_type_"), /*115 &string*/0xfe10, {.d_s = Array_string_join(variant_names, _SLIT("_"))}}, {_SLIT0, 0, { .d_c = 0 }}})); Array_v__ast__Type _t3 = {0}; Array_v__ast__TypeNode _t3_orig = variants; int _t3_len = _t3_orig.len; @@ -89097,19 +89386,25 @@ bool v__parser__Parser_parse_sum_type_variants_defer_0 = false; v__ast__Type v__parser__Parser_parse_type(v__parser__Parser* p) { bool is_optional = false; + bool is_result = false; + int line_nr = p->tok.line_nr; v__token__Pos optional_pos = v__token__Token_pos(&p->tok); if (p->tok.kind == v__token__Kind__question) { - int line_nr = p->tok.line_nr; v__parser__Parser_next(p); is_optional = true; - if (p->tok.line_nr > line_nr) { - v__ast__Type typ = _const_v__ast__void_type; - if (is_optional) { - typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__optional); - } - v__ast__Type _t1 = typ; - return _t1; + } else if (p->tok.kind == v__token__Kind__not) { + v__parser__Parser_next(p); + is_result = true; + } + if ((is_optional || is_result) && p->tok.line_nr > line_nr) { + v__ast__Type typ = _const_v__ast__void_type; + if (is_optional) { + typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__optional); + } else if (is_result) { + typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__result); } + v__ast__Type _t1 = typ; + return _t1; } bool is_shared = p->tok.kind == v__token__Kind__key_shared; bool is_atomic = p->tok.kind == v__token__Kind__key_atomic; @@ -89159,13 +89454,16 @@ v__ast__Type v__parser__Parser_parse_type(v__parser__Parser* p) { return _t4; } v__ast__TypeSymbol* sym = v__ast__Table_sym(p->table, typ); - if (is_optional && (sym->info)._typ == 435 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 435) /*expected idx: 435, name: v.ast.SumType */ ).is_anon) { + if (is_optional && (sym->info)._typ == 436 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 436) /*expected idx: 436, name: v.ast.SumType */ ).is_anon) { v__parser__Parser_error_with_pos(p, _SLIT("an inline sum type cannot be optional"), v__token__Pos_extend(optional_pos, v__token__Token_pos(&p->prev_tok))); } } if (is_optional) { typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__optional); } + if (is_result) { + typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__result); + } if (is_shared) { typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__shared_f); } @@ -89187,9 +89485,9 @@ v__ast__Type v__parser__Parser_parse_type(v__parser__Parser* p) { v__ast__Type v__parser__Parser_parse_any_type(v__parser__Parser* p, v__ast__Language language, bool is_ptr, bool check_dot) { string name = p->tok.lit; if (language == v__ast__Language__c) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } else if (language == v__ast__Language__js) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } else if (p->peek_tok.kind == v__token__Kind__dot && check_dot) { string mod = name; v__token__Pos mod_pos = v__token__Token_pos(&p->tok); @@ -89200,14 +89498,14 @@ v__ast__Type v__parser__Parser_parse_any_type(v__parser__Parser* p, v__ast__Lang if (!(p->peek_tok.kind == v__token__Kind__dot)) break; mod_pos = v__token__Pos_extend(mod_pos, v__token__Token_pos(&p->tok)); mod_last_part = p->tok.lit; - mod = /*f*/string__plus(mod, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = mod_last_part}}, {_SLIT0, 0, { .d_c = 0 }}}))); + mod = /*f*/string__plus(mod, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = mod_last_part}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__parser__Parser_next(p); v__parser__Parser_check(p, v__token__Kind__dot); } if (!v__parser__Parser_known_import(p, mod) && !p->pref->is_fmt) { - string msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown module `"), 0xfe10, {.d_s = mod}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown module `"), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("`"), 0, { .d_c = 0 }}})); if (mod.len > mod_last_part.len && v__parser__Parser_known_import(p, mod_last_part)) { - msg = /*f*/string__plus(msg, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; did you mean `"), 0xfe10, {.d_s = mod_last_part}}, {_SLIT("`?"), 0, { .d_c = 0 }}}))); + msg = /*f*/string__plus(msg, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; did you mean `"), /*115 &string*/0xfe10, {.d_s = mod_last_part}}, {_SLIT("`?"), 0, { .d_c = 0 }}}))); } v__parser__Parser_error_with_pos(p, msg, mod_pos); v__ast__Type _t1 = 0; @@ -89217,7 +89515,7 @@ v__ast__Type v__parser__Parser_parse_any_type(v__parser__Parser* p, v__ast__Lang v__parser__Parser_register_used_import(p, mod); mod = (*(string*)map_get(ADDR(map, p->imports), &(string[]){mod}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); } - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod}}, {_SLIT("."), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT0, 0, { .d_c = 0 }}})); if (p->tok.lit.len > 0 && !u8_is_capital(string_at(p->tok.lit, 0))) { v__parser__Parser_error(p, _SLIT("imported types must start with a capital letter")); v__ast__Type _t2 = 0; @@ -89413,25 +89711,25 @@ v__ast__Type v__parser__Parser_parse_generic_inst_type(v__parser__Parser* p, str parent_idx = v__ast__Table_add_placeholder_type(p->table, name, v__ast__Language__v); } v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(p->table, v__ast__new_type(parent_idx)); - if (parent_sym->info._typ == 416 /* v.ast.Struct */) { + if (parent_sym->info._typ == 417 /* v.ast.Struct */) { if ((*parent_sym->info._v__ast__Struct).generic_types.len == 0) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } else if ((*parent_sym->info._v__ast__Struct).generic_types.len != concrete_types.len) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of struct `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of struct `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } } - else if (parent_sym->info._typ == 434 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 435 /* v.ast.Interface */) { if ((*parent_sym->info._v__ast__Interface).generic_types.len == 0) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } else if ((*parent_sym->info._v__ast__Interface).generic_types.len != concrete_types.len) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of interfce `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of interfce `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } } - else if (parent_sym->info._typ == 435 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 436 /* v.ast.SumType */) { if ((*parent_sym->info._v__ast__SumType).generic_types.len == 0) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sumtype `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sumtype `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } else if ((*parent_sym->info._v__ast__SumType).generic_types.len != concrete_types.len) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of sumtype `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of sumtype `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } } @@ -89450,7 +89748,7 @@ v__ast__Stmt v__parser__parse_stmt(string text, v__ast__Table* table, v__ast__Sc bool v__parser__parse_stmt_defer_0 = false; #if defined(CUSTOM_DEFINE_trace_parse_stmt) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> "), 0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), 0xfe10, {.d_s = _SLIT("parse_stmt")}}, {_SLIT(" text: "), 0xfe10, {.d_s = text}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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){.pref = ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.os = 0,.backend = 0,.build_mode = 0,.arch = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 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,.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.profile_no_inline = 0,.profile_fns = __new_array(0, 0, sizeof(string)),.translated = 0,.is_prod = 0,.obfuscate = 0,.is_repl = 0,.is_run = 0,.is_debug = 0,.is_vlines = 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,.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.use_cache = 0,.retry_compilation = true,.is_stats = 0,.cflags = (string){.str=(byteptr)"", .is_lit=1},.m64 = 0,.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.ccompiler_type = 0,.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_fmt = 0,.is_vet = 0,.is_bare = 0,.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.no_preludes = 0,.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.lookup_path = __new_array(0, 0, sizeof(string)),.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.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},.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)),.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,.use_color = 0,.no_parallel = 0,.is_vweb = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.is_ios_simulator = 0,.is_apk = 0,.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.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),},.is_help = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.is_cstrict = 0,.assert_failure_mode = 0,.message_limit = 100,.nofloat = 0,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,}, sizeof(v__pref__Preferences))),.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},.file_backend_mode = 0,.scanner = v__scanner__new_scanner(text, v__scanner__CommentsMode__skip_comments, ((v__pref__Preferences*)memdup(&(v__pref__Preferences){.os = 0,.backend = 0,.build_mode = 0,.arch = 0,.output_mode = v__pref__OutputMode__stdout,.is_verbose = 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,.test_runner = (string){.str=(byteptr)"", .is_lit=1},.profile_file = (string){.str=(byteptr)"", .is_lit=1},.profile_no_inline = 0,.profile_fns = __new_array(0, 0, sizeof(string)),.translated = 0,.is_prod = 0,.obfuscate = 0,.is_repl = 0,.is_run = 0,.is_debug = 0,.is_vlines = 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,.dump_c_flags = (string){.str=(byteptr)"", .is_lit=1},.use_cache = 0,.retry_compilation = true,.is_stats = 0,.cflags = (string){.str=(byteptr)"", .is_lit=1},.m64 = 0,.ccompiler = (string){.str=(byteptr)"", .is_lit=1},.ccompiler_type = 0,.third_party_option = (string){.str=(byteptr)"", .is_lit=1},.building_v = 0,.autofree = 0,.compress = 0,.no_builtin = 0,.enable_globals = 0,.is_fmt = 0,.is_vet = 0,.is_bare = 0,.bare_builtin_dir = (string){.str=(byteptr)"", .is_lit=1},.no_preludes = 0,.custom_prelude = (string){.str=(byteptr)"", .is_lit=1},.lookup_path = __new_array(0, 0, sizeof(string)),.output_cross_c = 0,.output_es5 = 0,.prealloc = 0,.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},.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)),.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,.use_color = 0,.no_parallel = 0,.is_vweb = 0,.only_check_syntax = 0,.check_only = 0,.experimental = 0,.skip_unused = 0,.show_timings = 0,.is_ios_simulator = 0,.is_apk = 0,.cleanup_files = __new_array(0, 0, sizeof(string)),.build_options = __new_array(0, 0, sizeof(string)),.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),},.is_help = 0,.gc_mode = v__pref__GarbageCollectionMode__no_gc,.is_cstrict = 0,.assert_failure_mode = 0,.message_limit = 100,.nofloat = 0,.checker_match_exhaustive_cutoff_limit = 12,.thread_stack_size = 8388608,}, sizeof(v__pref__Preferences)))),.comments_mode = v__scanner__CommentsMode__skip_comments,.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,},.table = table,.language = 0,.fn_language = 0,.expr_level = 0,.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,.mod = (string){.str=(byteptr)"", .is_lit=1},.is_manualfree = 0,.has_globals = 0,.is_generated = 0,.is_translated = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.expr_mod = (string){.str=(byteptr)"", .is_lit=1},.scope = scope,.imports = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.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)),.imported_symbols = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.is_amp = 0,.returns = 0,.is_stmt_ident = 0,.expecting_type = 0,.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)),.cur_fn_name = (string){.str=(byteptr)"", .is_lit=1},.label_names = __new_array(0, 0, sizeof(string)),.name_error = 0,.n_asm = 0,.global_labels = __new_array(0, 0, sizeof(string)),.comptime_if_cond = 0,.defer_vars = __new_array(0, 0, sizeof(v__ast__Ident)),.should_abort = 0,.codegen_text = (string){.str=(byteptr)"", .is_lit=1},.struct_init_generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.if_cond_comments = __new_array(0, 0, sizeof(v__ast__Comment)),}); @@ -89470,7 +89768,7 @@ bool v__parser__parse_stmt_defer_0 = false; v__ast__File* v__parser__parse_comptime(string tmpl_path, string text, v__ast__Table* table, v__pref__Preferences* pref, v__ast__Scope* scope) { #if defined(CUSTOM_DEFINE_trace_parse_comptime) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> "), 0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), 0xfe10, {.d_s = _SLIT("parse_comptime")}}, {_SLIT(" text: "), 0xfe10, {.d_s = text}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> "), /*115 &string*/0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = _SLIT("parse_comptime")}}, {_SLIT(" text: "), /*115 &string*/0xfe10, {.d_s = text}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__parser__Parser p = ((v__parser__Parser){ @@ -89559,7 +89857,7 @@ v__ast__File* v__parser__parse_comptime(string tmpl_path, string text, v__ast__T v__ast__File* v__parser__parse_text(string text, string path, v__ast__Table* table, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref) { #if defined(CUSTOM_DEFINE_trace_parse_text) { - eprintln( str_intp(6, _MOV((StrIntpData[]){{_SLIT("> "), 0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), 0xfe10, {.d_s = _SLIT("parse_text")}}, {_SLIT(" comments_mode: "), 0x28fe10, {.d_s = v__scanner__CommentsMode_str(comments_mode)}}, {_SLIT(" | path: "), 0x28fe10, {.d_s = path}}, {_SLIT(" | text: "), 0xfe10, {.d_s = text}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(6, _MOV((StrIntpData[]){{_SLIT("> "), /*115 &string*/0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = _SLIT("parse_text")}}, {_SLIT(" comments_mode: "), /*115 &v.scanner.CommentsMode*/0x28fe10, {.d_s = v__scanner__CommentsMode_str(comments_mode)}}, {_SLIT(" | path: "), /*115 &string*/0x28fe10, {.d_s = path}}, {_SLIT(" | text: "), /*115 &string*/0xfe10, {.d_s = text}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__parser__Parser p = ((v__parser__Parser){ @@ -89702,7 +90000,7 @@ void v__parser__Parser_set_path(v__parser__Parser* p, string path) { v__ast__File* v__parser__parse_file(string path, v__ast__Table* table, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref) { #if defined(CUSTOM_DEFINE_trace_parse_file) { - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> "), 0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), 0xfe10, {.d_s = _SLIT("parse_file")}}, {_SLIT(" comments_mode: "), 0x28fe10, {.d_s = v__scanner__CommentsMode_str(comments_mode)}}, {_SLIT(" | path: "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT("> "), /*115 &string*/0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = _SLIT("parse_file")}}, {_SLIT(" comments_mode: "), /*115 &v.scanner.CommentsMode*/0x28fe10, {.d_s = v__scanner__CommentsMode_str(comments_mode)}}, {_SLIT(" | path: "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif Option_v__scanner__Scanner_ptr _t1 = v__scanner__new_scanner_file(path, comments_mode, pref); @@ -89800,7 +90098,7 @@ v__ast__File* v__parser__parse_file(string path, v__ast__Table* table, v__scanne multi_return_ref_v__ast__File_Array_v__vet__Error v__parser__parse_vet_file(string path, v__ast__Table* table_, v__pref__Preferences* pref) { #if defined(CUSTOM_DEFINE_trace_parse_vet_file) { - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> "), 0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), 0xfe10, {.d_s = _SLIT("parse_vet_file")}}, {_SLIT(" path: "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT("> "), /*115 &string*/0xfe10, {.d_s = _SLIT("v.parser")}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = _SLIT("parse_vet_file")}}, {_SLIT(" path: "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v__ast__Scope* global_scope = ((v__ast__Scope*)memdup(&(v__ast__Scope){.objects = new_map(sizeof(string), sizeof(v__ast__ScopeObject), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.struct_fields = new_map(sizeof(string), sizeof(v__ast__ScopeStructField), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.parent = 0,.detached_from_parent = 0,.children = __new_array(0, 0, sizeof(v__ast__Scope*)),.start_pos = 0,.end_pos = 0,}, sizeof(v__ast__Scope))); @@ -89948,7 +90246,7 @@ bool v__parser__Parser_parse_defer_0 = false; break; } v__ast__Stmt stmt = v__parser__Parser_top_stmt(p); - if (!((stmt)._typ == 306 /* v.ast.ExprStmt */ && ((/* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 306) /*expected idx: 306, name: v.ast.ExprStmt */ ).expr)._typ == 256 /* v.ast.Comment */)) { + if (!((stmt)._typ == 307 /* v.ast.ExprStmt */ && ((/* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ).expr)._typ == 257 /* v.ast.Comment */)) { p->attrs = __new_array_with_default(0, 0, sizeof(v__ast__Attr), 0); } array_push((array*)&stmts, _MOV((v__ast__Stmt[]){ stmt })); @@ -90000,7 +90298,7 @@ bool v__parser__Parser_parse_defer_0 = false; } Array_v__ast__File_ptr v__parser__parse_files(Array_string paths, v__ast__Table* table, v__pref__Preferences* pref) { - v__util__Timers* timers = v__util__new_timers(((v__util__TimerParams){.should_print = false,.label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_files: "), 0xfe10, {.d_s = Array_string_str(paths)}}, {_SLIT0, 0, { .d_c = 0 }}})),})); + v__util__Timers* timers = v__util__new_timers(((v__util__TimerParams){.should_print = false,.label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_files: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(paths)}}, {_SLIT0, 0, { .d_c = 0 }}})),})); #if defined(CUSTOM_DEFINE_time_parsing) { timers->should_print = true; @@ -90009,9 +90307,9 @@ Array_v__ast__File_ptr v__parser__parse_files(Array_string paths, v__ast__Table* Array_v__ast__File_ptr files = __new_array_with_default(0, paths.len, sizeof(v__ast__File*), 0); for (int _t1 = 0; _t1 < paths.len; ++_t1) { string path = ((string*)paths.data)[_t1]; - v__util__Timers_start(timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_file "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_start(timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_file "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); array_push((array*)&files, _MOV((v__ast__File*[]){ v__parser__parse_file(path, table, v__scanner__CommentsMode__skip_comments, pref) })); - v__util__Timers_show(timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_file "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_show(timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_file "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (codegen_files.len > 0) { _PUSH_MANY(&files, (codegen_files), _t3, Array_v__ast__File_ptr); @@ -90024,7 +90322,7 @@ Array_v__ast__File_ptr v__parser__parse_files(Array_string paths, v__ast__Table* void v__parser__Parser_codegen(v__parser__Parser* p, string code) { #if defined(CUSTOM_DEFINE_debug_codegen) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parser.codegen:\n "), 0xfe10, {.d_s = code}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parser.codegen:\n "), /*115 &string*/0xfe10, {.d_s = code}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif p->codegen_text = /*f*/string__plus(p->codegen_text, string__plus(_SLIT("\n"), code)); @@ -90093,10 +90391,10 @@ Array_v__ast__Stmt v__parser__Parser_parse_block_no_scope(v__parser__Parser* p, array_push((array*)&stmts, _MOV((v__ast__Stmt[]){ v__parser__Parser_stmt(p, is_top_level) })); count++; if (count % 100000 == 0) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("parsed "), 0xfe07, {.d_i32 = count}}, {_SLIT(" statements so far from fn "), 0xfe10, {.d_s = p->cur_fn_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("parsed "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT(" statements so far from fn "), /*115 &string*/0xfe10, {.d_s = p->cur_fn_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } if (count > 1000000) { - v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("parsed over "), 0xfe07, {.d_i32 = count}}, {_SLIT(" statements from fn "), 0xfe10, {.d_s = p->cur_fn_name}}, {_SLIT(", the parser is probably stuck"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("parsed over "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT(" statements from fn "), /*115 &string*/0xfe10, {.d_s = p->cur_fn_name}}, {_SLIT(", the parser is probably stuck"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); Array_v__ast__Stmt _t2 = __new_array_with_default(0, 0, sizeof(v__ast__Stmt), 0); return _t2; } @@ -90126,9 +90424,9 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check(v__parser__Parser* p, v__token__Kin } string s = v__token__Kind_str(expected); if (v__token__is_key(s) || (s.len > 0 && !u8_is_letter(string_at(s, 0)))) { - s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); } - v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -90136,7 +90434,7 @@ VV_LOCAL_SYMBOL string v__parser__Parser_check_js_name(v__parser__Parser* p) { string name = _SLIT(""); for (;;) { if (!(p->peek_tok.kind == v__token__Kind__dot)) break; - name = /*f*/string__plus(name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + name = /*f*/string__plus(name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("."), 0, { .d_c = 0 }}}))); v__parser__Parser_next(p); v__parser__Parser_next(p); } @@ -90424,7 +90722,7 @@ v__ast__Stmt v__parser__Parser_stmt(v__parser__Parser* p, bool is_top_level) { v__token__Pos spos = v__token__Token_pos(&p->tok); string name = v__parser__Parser_check_name(p); if (Array_string_contains(p->label_names, name)) { - v__ast__Stmt _t5 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate label `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), spos)))); + v__ast__Stmt _t5 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate label `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), spos)))); return _t5; } array_push((array*)&p->label_names, _MOV((string[]){ string_clone(name) })); @@ -90432,17 +90730,17 @@ v__ast__Stmt v__parser__Parser_stmt(v__parser__Parser* p, bool is_top_level) { if (p->tok.kind == v__token__Kind__key_for) { v__token__Pos for_pos = v__token__Token_pos(&p->tok); v__ast__Stmt stmt = v__parser__Parser_stmt(p, is_top_level); - if (stmt._typ == 309 /* v.ast.ForStmt */) { + if (stmt._typ == 310 /* v.ast.ForStmt */) { (*stmt._v__ast__ForStmt).label = name; v__ast__Stmt _t7 = v__ast__ForStmt_to_sumtype_v__ast__Stmt(&(*stmt._v__ast__ForStmt)); return _t7; } - else if (stmt._typ == 308 /* v.ast.ForInStmt */) { + else if (stmt._typ == 309 /* v.ast.ForInStmt */) { (*stmt._v__ast__ForInStmt).label = name; v__ast__Stmt _t8 = v__ast__ForInStmt_to_sumtype_v__ast__Stmt(&(*stmt._v__ast__ForInStmt)); return _t8; } - else if (stmt._typ == 307 /* v.ast.ForCStmt */) { + else if (stmt._typ == 308 /* v.ast.ForCStmt */) { (*stmt._v__ast__ForCStmt).label = name; v__ast__Stmt _t9 = v__ast__ForCStmt_to_sumtype_v__ast__Stmt(&(*stmt._v__ast__ForCStmt)); return _t9; @@ -90457,10 +90755,10 @@ v__ast__Stmt v__parser__Parser_stmt(v__parser__Parser* p, bool is_top_level) { v__ast__Stmt _t11 = v__ast__GotoLabel_to_sumtype_v__ast__Stmt(ADDR(v__ast__GotoLabel, (((v__ast__GotoLabel){.name = name,.pos = v__token__Pos_extend(spos, v__token__Token_pos(&p->tok)),})))); return _t11; } else if (p->peek_tok.kind == v__token__Kind__name) { - v__ast__Stmt _t12 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected name `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + v__ast__Stmt _t12 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected name `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); return _t12; } else if (!p->inside_if_expr && !p->inside_match_body && !p->inside_or_expr && (p->peek_tok.kind == v__token__Kind__rcbr || p->peek_tok.kind == v__token__Kind__eof) && !v__parser__Parser_mark_var_as_used(p, p->tok.lit)) { - v__ast__Stmt _t13 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` evaluated but not used"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + v__ast__Stmt _t13 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` evaluated but not used"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); return _t13; } v__ast__Stmt _t14 = v__parser__Parser_parse_multi_expr(p, is_top_level); @@ -90808,10 +91106,10 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; } else if (p->tok.kind == (v__token__Kind__number)) { v__ast__Expr number_lit = v__parser__Parser_parse_number_literal(p); - if (number_lit._typ == 264 /* v.ast.FloatLiteral */) { + if (number_lit._typ == 265 /* v.ast.FloatLiteral */) { array_push((array*)&args, _MOV((v__ast__AsmArg[]){ v__ast__FloatLiteral_to_sumtype_v__ast__AsmArg(ADDR(v__ast__FloatLiteral, (((v__ast__FloatLiteral){(*number_lit._v__ast__FloatLiteral).val,(*number_lit._v__ast__FloatLiteral).pos,})))) })); } - else if (number_lit._typ == 271 /* v.ast.IntegerLiteral */) { + else if (number_lit._typ == 272 /* v.ast.IntegerLiteral */) { if (is_directive) { array_push((array*)&args, _MOV((v__ast__AsmArg[]){ v__ast__AsmDisp_to_sumtype_v__ast__AsmArg(ADDR(v__ast__AsmDisp, (((v__ast__AsmDisp){.val = (*number_lit._v__ast__IntegerLiteral).val,.pos = (*number_lit._v__ast__IntegerLiteral).pos,})))) })); } else { @@ -90820,7 +91118,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; } else { - v__parser__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("p.parse_number_literal() invalid output: `"), 0xfe10, {.d_s = v__ast__Expr_str(number_lit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("p.parse_number_literal() invalid output: `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(number_lit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } ; @@ -90866,7 +91164,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; if (is_directive && (string__eq(name, _SLIT("globl")) || string__eq(name, _SLIT("global")))) { for (int _t12 = 0; _t12 < args.len; ++_t12) { v__ast__AsmArg arg = ((v__ast__AsmArg*)args.data)[_t12]; - array_push((array*)&p->global_labels, _MOV((string[]){ string_clone((/* as */ *(v__ast__AsmAlias*)__as_cast((arg)._v__ast__AsmAlias,(arg)._typ, 397) /*expected idx: 397, name: v.ast.AsmAlias */ ).name) })); + array_push((array*)&p->global_labels, _MOV((string[]){ string_clone((/* as */ *(v__ast__AsmAlias*)__as_cast((arg)._v__ast__AsmAlias,(arg)._typ, 398) /*expected idx: 398, name: v.ast.AsmAlias */ ).name) })); } } array_push((array*)&templates, _MOV((v__ast__AsmTemplate[]){ ((v__ast__AsmTemplate){ @@ -90968,7 +91266,7 @@ VV_LOCAL_SYMBOL v__ast__AsmArg v__parser__Parser_reg_or_alias(v__parser__Parser* } if (_IN_MAP(ADDR(string, p->prev_tok.lit), ADDR(map, p->scope->objects))) { v__ast__ScopeObject x = (*(v__ast__ScopeObject*)map_get(ADDR(map, p->scope->objects), &(string[]){p->prev_tok.lit}, &(v__ast__ScopeObject[]){ {0} })); - if ((x)._typ == 321 /* v.ast.AsmRegister */) { + if ((x)._typ == 322 /* v.ast.AsmRegister */) { v__ast__AsmArg _t1 = v__ast__AsmRegister_to_sumtype_v__ast__AsmArg(ADDR(v__ast__AsmRegister, ((*x._v__ast__AsmRegister)))); return _t1; } else { @@ -91142,7 +91440,7 @@ VV_LOCAL_SYMBOL Array_v__ast__AsmIO v__parser__Parser_asm_ios(v__parser__Parser* } } v__ast__Expr expr = v__parser__Parser_expr(p, 0); - if ((expr)._typ == 281 /* v.ast.ParExpr */) { + if ((expr)._typ == 282 /* v.ast.ParExpr */) { expr = (*expr._v__ast__ParExpr).expr; } else { v__parser__Parser_error(p, _SLIT("asm in/output must be enclosed in brackets")); @@ -91152,7 +91450,7 @@ VV_LOCAL_SYMBOL Array_v__ast__AsmIO v__parser__Parser_asm_ios(v__parser__Parser* v__parser__Parser_next(p); alias = p->tok.lit; v__parser__Parser_check(p, v__token__Kind__name); - } else if ((expr)._typ == 266 /* v.ast.Ident */) { + } else if ((expr)._typ == 267 /* v.ast.Ident */) { alias = (*expr._v__ast__Ident).name; } Array_v__ast__Comment comments = __new_array_with_default(0, 0, sizeof(v__ast__Comment), 0); @@ -91175,7 +91473,7 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Expr_Array_v__ast__Comment v__parser_ Array_v__ast__Comment comments = __new_array_with_default(0, 0, sizeof(v__ast__Comment), 0); for (;;) { v__ast__Expr expr = v__parser__Parser_expr(p, 0); - if ((expr)._typ == 256 /* v.ast.Comment */) { + if ((expr)._typ == 257 /* v.ast.Comment */) { array_push((array*)&comments, _MOV((v__ast__Comment[]){ (*expr._v__ast__Comment) })); } else { array_push((array*)&exprs, _MOV((v__ast__Expr[]){ expr })); @@ -91222,12 +91520,12 @@ VV_LOCAL_SYMBOL void v__parser__Parser_attributes(v__parser__Parser* p) { v__token__Pos start_pos = v__token__Token_pos(&p->tok); v__ast__Attr attr = v__parser__Parser_parse_attr(p); if (Array_v__ast__Attr_contains(p->attrs, attr.name) && !string__eq(attr.name, _SLIT("wasm_export"))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate attribute `"), 0xfe10, {.d_s = attr.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok))); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate attribute `"), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok))); return; } if (attr.kind == v__ast__AttrKind__comptime_define) { if (has_ctdefine) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only one `[if flag]` may be applied at a time `"), 0xfe10, {.d_s = attr.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok))); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only one `[if flag]` may be applied at a time `"), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok))); return; } else { has_ctdefine = true; @@ -91239,7 +91537,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_attributes(v__parser__Parser* p) { v__parser__Parser_next(p); break; } - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting `;`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting `;`"), 0, { .d_c = 0 }}}))); return; } v__parser__Parser_next(p); @@ -91273,7 +91571,7 @@ VV_LOCAL_SYMBOL v__ast__Attr v__parser__Parser_parse_attr(v__parser__Parser* p) p->comptime_if_cond = false; p->inside_if_expr = false; p->inside_ct_if_expr = false; - if ((comptime_cond)._typ == 282 /* v.ast.PostfixExpr */) { + if ((comptime_cond)._typ == 283 /* v.ast.PostfixExpr */) { comptime_cond_opt = true; } name = v__ast__Expr_str(comptime_cond); @@ -91307,7 +91605,7 @@ VV_LOCAL_SYMBOL v__ast__Attr v__parser__Parser_parse_attr(v__parser__Parser* p) arg = v__token__Kind_str(p->tok.kind); v__parser__Parser_next(p); } else { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", an argument is expected after `:`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", an argument is expected after `:`"), 0, { .d_c = 0 }}}))); } } } @@ -91327,12 +91625,12 @@ VV_LOCAL_SYMBOL v__ast__Attr v__parser__Parser_parse_attr(v__parser__Parser* p) void v__parser__Parser_language_not_allowed_error(v__parser__Parser* p, v__ast__Language language, v__token__Pos pos) { string upcase_language = string_to_upper(v__ast__Language_str(language)); - v__parser__Parser_error_with_pos(p, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = upcase_language}}, {_SLIT(" code is not allowed in ."), 0xfe10, {.d_s = v__ast__Language_str(p->file_backend_mode)}}, {_SLIT(".v files, please move it to a ."), 0xfe10, {.d_s = v__ast__Language_str(language)}}, {_SLIT(".v file"), 0, { .d_c = 0 }}})), pos); + v__parser__Parser_error_with_pos(p, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = upcase_language}}, {_SLIT(" code is not allowed in ."), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(p->file_backend_mode)}}, {_SLIT(".v files, please move it to a ."), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(language)}}, {_SLIT(".v file"), 0, { .d_c = 0 }}})), pos); } void v__parser__Parser_language_not_allowed_warning(v__parser__Parser* p, v__ast__Language language, v__token__Pos pos) { string upcase_language = string_to_upper(v__ast__Language_str(language)); - v__parser__Parser_warn_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = upcase_language}}, {_SLIT(" code will not be allowed in pure .v files, please move it to a ."), 0xfe10, {.d_s = v__ast__Language_str(language)}}, {_SLIT(".v file instead"), 0, { .d_c = 0 }}})), pos); + v__parser__Parser_warn_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = upcase_language}}, {_SLIT(" code will not be allowed in pure .v files, please move it to a ."), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(language)}}, {_SLIT(".v file instead"), 0, { .d_c = 0 }}})), pos); } void v__parser__Parser_check_for_impure_v(v__parser__Parser* p, v__ast__Language language, v__token__Pos pos) { @@ -91505,8 +91803,8 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_parse_multi_expr(v__parser__Parse } else if (!p->pref->translated && !p->is_translated && !p->pref->is_fmt && !(tok.kind == v__token__Kind__key_if || tok.kind == v__token__Kind__key_match || tok.kind == v__token__Kind__key_lock || tok.kind == v__token__Kind__key_rlock || tok.kind == v__token__Kind__key_select)) { for (int _t4 = 0; _t4 < left.len; ++_t4) { v__ast__Expr node = ((v__ast__Expr*)left.data)[_t4]; - if ((is_top_level || p->tok.kind != v__token__Kind__rcbr) && (node)._typ != 252 /* v.ast.CallExpr */ && (node)._typ != 282 /* v.ast.PostfixExpr */ && (node)._typ != 257 /* v.ast.ComptimeCall */ && (node)._typ != 286 /* v.ast.SelectorExpr */ && (node)._typ != 261 /* v.ast.DumpExpr */) { - bool is_complex_infix_expr = (node)._typ == 270 /* v.ast.InfixExpr */ && ((/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 270) /*expected idx: 270, name: v.ast.InfixExpr */ ).op == v__token__Kind__left_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 270) /*expected idx: 270, name: v.ast.InfixExpr */ ).op == v__token__Kind__right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 270) /*expected idx: 270, name: v.ast.InfixExpr */ ).op == v__token__Kind__unsigned_right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 270) /*expected idx: 270, name: v.ast.InfixExpr */ ).op == v__token__Kind__arrow); + if ((is_top_level || p->tok.kind != v__token__Kind__rcbr) && (node)._typ != 253 /* v.ast.CallExpr */ && (node)._typ != 283 /* v.ast.PostfixExpr */ && (node)._typ != 258 /* v.ast.ComptimeCall */ && (node)._typ != 287 /* v.ast.SelectorExpr */ && (node)._typ != 262 /* v.ast.DumpExpr */) { + bool is_complex_infix_expr = (node)._typ == 271 /* v.ast.InfixExpr */ && ((/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 271) /*expected idx: 271, name: v.ast.InfixExpr */ ).op == v__token__Kind__left_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 271) /*expected idx: 271, name: v.ast.InfixExpr */ ).op == v__token__Kind__right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 271) /*expected idx: 271, name: v.ast.InfixExpr */ ).op == v__token__Kind__unsigned_right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 271) /*expected idx: 271, name: v.ast.InfixExpr */ ).op == v__token__Kind__arrow); if (!is_complex_infix_expr) { v__ast__Stmt _t5 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("expression evaluated but not used"), v__ast__Expr_pos(node))))); return _t5; @@ -91545,9 +91843,9 @@ v__ast__Ident v__parser__Parser_parse_ident(v__parser__Parser* p, v__ast__Langua } if (p->tok.kind != v__token__Kind__name) { if (is_mut || is_static || is_volatile) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the `"), 0xfe10, {.d_s = v__token__Kind_str(modifier_kind)}}, {_SLIT("` keyword is invalid here"), 0, { .d_c = 0 }}})), mut_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(modifier_kind)}}, {_SLIT("` keyword is invalid here"), 0, { .d_c = 0 }}})), mut_pos); } else { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected token `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected token `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } v__ast__Ident _t1 = ((v__ast__Ident){.language = 0,.tok_kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comptime = 0,.scope = p->scope,.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.kind = 0,.info = {0},.is_mut = 0,}); return _t1; @@ -91574,7 +91872,7 @@ v__ast__Ident v__parser__Parser_parse_ident(v__parser__Parser* p, v__ast__Langua if (p->inside_match_body && string__eq(name, _SLIT("it"))) { } if (p->expr_mod.len > 0) { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = p->expr_mod}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = p->expr_mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } v__ast__Ident _t3 = ((v__ast__Ident){ .language = language, @@ -91754,11 +92052,11 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { cap_expr = v__parser__Parser_expr(p, 0); } else if (string__eq(key, _SLIT("len")) || string__eq(key, _SLIT("init"))) { - v__ast__Expr _t5 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = key}}, {_SLIT("` cannot be initialized for `chan`. Did you mean `cap`?"), 0, { .d_c = 0 }}})))))); + v__ast__Expr _t5 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("` cannot be initialized for `chan`. Did you mean `cap`?"), 0, { .d_c = 0 }}})))))); return _t5; } else { - v__ast__Expr _t6 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrong field `"), 0xfe10, {.d_s = key}}, {_SLIT("`, expecting `cap`"), 0, { .d_c = 0 }}})))))); + v__ast__Expr _t6 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrong field `"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("`, expecting `cap`"), 0, { .d_c = 0 }}})))))); return _t6; }; last_pos = v__token__Token_pos(&p->tok); @@ -91772,13 +92070,13 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { v__ast__Expr _t8 = v__parser__Parser_string_expr(p); return _t8; } else { - v__ast__Expr _t9 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only `c`, `r`, `js` are recognized string prefixes, but you tried to use `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); + v__ast__Expr _t9 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only `c`, `r`, `js` are recognized string prefixes, but you tried to use `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); return _t9; } } if (p->peek_tok.kind == v__token__Kind__chartoken && p->tok.lit.len == 1 && (string_at(p->tok.lit, 0) == 'r' || string_at(p->tok.lit, 0) == 'c')) { string opt = (string__eq(p->tok.lit, _SLIT("r")) ? (_SLIT("`r` (raw string)")) : (_SLIT("`c` (c string)"))); - v__ast__Expr _t10 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use "), 0xfe10, {.d_s = opt}}, {_SLIT(" with `byte` and `rune`"), 0, { .d_c = 0 }}})))))); + v__ast__Expr _t10 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use "), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT(" with `byte` and `rune`"), 0, { .d_c = 0 }}})))))); return _t10; } bool known_var = (v__token__Kind_is_assign(p->peek_tok.kind) ? (v__ast__Scope_known_var(p->scope, p->tok.lit)) : (v__parser__Parser_mark_var_as_used(p, p->tok.lit))); @@ -91847,7 +92145,7 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { } else if (p->peek_tok.kind == v__token__Kind__lpar || is_generic_call || is_generic_cast || (is_optional && v__parser__Parser_peek_token(p, 2).kind == v__token__Kind__lpar)) { string name = (is_optional ? (p->peek_tok.lit) : (p->tok.lit)); if (mod.len > 0) { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } string name_w_mod = v__parser__Parser_prepend_mod(p, name); if ((!known_var && (_IN_MAP(ADDR(string, name), ADDR(map, p->table->type_idxs)) || _IN_MAP(ADDR(string, name_w_mod), ADDR(map, p->table->type_idxs))) && !(string__eq(name, _SLIT("C.stat")) || string__eq(name, _SLIT("C.sigaction")))) || is_mod_cast || is_generic_cast || (language == v__ast__Language__v && name.len > 0 && u8_is_capital(string_at(name, 0)))) { @@ -91880,7 +92178,7 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { return _t18; } else { if (is_optional) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->prev_tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->prev_tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); } node = v__ast__CallExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__CallExpr, (v__parser__Parser_call_expr(p, language, mod)))); if (p->tok.kind == v__token__Kind__lpar && p->prev_tok.line_nr == p->tok.line_nr) { @@ -92002,7 +92300,7 @@ VV_LOCAL_SYMBOL v__ast__IndexExpr v__parser__Parser_index_expr(v__parser__Parser } if (p->tok.kind == v__token__Kind__question) { or_pos_high = v__token__Token_pos(&p->tok); - or_kind_high = v__ast__OrKind__propagate; + or_kind_high = v__ast__OrKind__propagate_option; v__parser__Parser_next(p); } } @@ -92046,7 +92344,7 @@ VV_LOCAL_SYMBOL v__ast__IndexExpr v__parser__Parser_index_expr(v__parser__Parser } if (p->tok.kind == v__token__Kind__question) { or_pos_low = v__token__Token_pos(&p->tok); - or_kind_low = v__ast__OrKind__propagate; + or_kind_low = v__ast__OrKind__propagate_option; v__parser__Parser_next(p); } } @@ -92081,7 +92379,7 @@ VV_LOCAL_SYMBOL v__ast__IndexExpr v__parser__Parser_index_expr(v__parser__Parser } if (p->tok.kind == v__token__Kind__question) { or_pos = v__token__Token_pos(&p->tok); - or_kind = v__ast__OrKind__propagate; + or_kind = v__ast__OrKind__propagate_option; v__parser__Parser_next(p); } } @@ -92158,12 +92456,13 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_dot_expr(v__parser__Parser* p, v_ v__parser__Parser_close_scope(p); p->inside_or_expr = was_inside_or_expr; } - if (p->tok.kind == v__token__Kind__question) { + if (p->tok.kind == v__token__Kind__question || p->tok.kind == v__token__Kind__not) { + bool is_not = p->tok.kind == v__token__Kind__not; v__parser__Parser_next(p); if (p->inside_defer) { v__parser__Parser_error_with_pos(p, _SLIT("error propagation not allowed inside `defer` blocks"), v__token__Token_pos(&p->prev_tok)); } - or_kind = v__ast__OrKind__propagate; + or_kind = (is_not ? (v__ast__OrKind__propagate_result) : (v__ast__OrKind__propagate_option)); } v__token__Pos end_pos = v__token__Token_pos(&p->prev_tok); v__token__Pos pos = v__token__Pos_extend(name_pos, end_pos); @@ -92206,11 +92505,11 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_dot_expr(v__parser__Parser* p, v_ bool is_mut = false; v__token__Pos mut_pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); if (p->inside_match || p->inside_if_expr || p->inside_for) { - if (left._typ == 266 /* v.ast.Ident */) { + if (left._typ == 267 /* v.ast.Ident */) { is_mut = (*left._v__ast__Ident).is_mut; mut_pos = (*left._v__ast__Ident).mut_pos; } - else if (left._typ == 286 /* v.ast.SelectorExpr */) { + else if (left._typ == 287 /* v.ast.SelectorExpr */) { is_mut = (*left._v__ast__SelectorExpr).is_mut; mut_pos = (*left._v__ast__SelectorExpr).mut_pos; } @@ -92263,10 +92562,10 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Type_Array_string v__parser__Parser_p v__parser__Parser_error(p, _SLIT("generic parameter name needs to be exactly one char")); } if (!v__util__is_generic_type_name(p->tok.lit)) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` is a reserved name and cannot be used for generics"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` is a reserved name and cannot be used for generics"), 0, { .d_c = 0 }}}))); } if (Array_string_contains(param_names, name)) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicated generic parameter `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicated generic parameter `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } if (count > 8) { v__parser__Parser_error(p, _SLIT("cannot have more than 9 generic parameters")); @@ -92485,18 +92784,18 @@ VV_LOCAL_SYMBOL v__ast__Module v__parser__Parser_module_decl(v__parser__Parser* name = v__parser__Parser_check_name(p); mod_node = ((v__ast__Module){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.pos = module_pos,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_skipped = 0,}); if (module_pos.line_nr != name_pos.line_nr) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`module` and `"), 0xfe10, {.d_s = name}}, {_SLIT("` must be at same line"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`module` and `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` must be at same line"), 0, { .d_c = 0 }}})), name_pos); v__ast__Module _t2 = mod_node; return _t2; } v__token__Pos n_pos = v__token__Token_pos(&p->tok); if (module_pos.line_nr == n_pos.line_nr && p->tok.kind != v__token__Kind__comment && p->tok.kind != v__token__Kind__eof) { if (p->tok.kind == v__token__Kind__name) { - v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`module "), 0xfe10, {.d_s = name}}, {_SLIT("`, you can only declare one module, unexpected `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})), n_pos); + v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`module "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, you can only declare one module, unexpected `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})), n_pos); v__ast__Module _t3 = mod_node; return _t3; } else { - v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`module "), 0xfe10, {.d_s = name}}, {_SLIT("`, unexpected `"), 0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` after module name"), 0, { .d_c = 0 }}})), n_pos); + v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`module "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, unexpected `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` after module name"), 0, { .d_c = 0 }}})), n_pos); v__ast__Module _t4 = mod_node; return _t4; } @@ -92541,7 +92840,7 @@ VV_LOCAL_SYMBOL v__ast__Module v__parser__Parser_module_decl(v__parser__Parser* p->is_translated = true; } else { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown module attribute `["), 0xfe10, {.d_s = ma.name}}, {_SLIT("]`"), 0, { .d_c = 0 }}})), ma.pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown module attribute `["), /*115 &string*/0xfe10, {.d_s = ma.name}}, {_SLIT("]`"), 0, { .d_c = 0 }}})), ma.pos); v__ast__Module _t6 = mod_node; return _t6; }; @@ -92599,7 +92898,7 @@ VV_LOCAL_SYMBOL v__ast__Import v__parser__Parser_import_stmt(v__parser__Parser* v__token__Pos alias_pos = v__token__Token_pos(&p->tok); mod_alias = v__parser__Parser_check_name(p); if (string__eq(mod_alias, (*(string*)array_last(mod_name_arr)))) { - v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("import alias `"), 0xfe10, {.d_s = mod_name}}, {_SLIT(" as "), 0xfe10, {.d_s = mod_alias}}, {_SLIT("` is redundant"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("import alias `"), /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(" as "), /*115 &string*/0xfe10, {.d_s = mod_alias}}, {_SLIT("` is redundant"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); v__ast__Import _t7 = import_node; return _t7; } @@ -92633,7 +92932,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_import_syms(v__parser__Parser* p, v__ast_ v__parser__Parser_next(p); v__token__Pos pos_t = v__token__Token_pos(&p->tok); if (p->tok.kind == v__token__Kind__rcbr) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("empty `"), 0xfe10, {.d_s = parent->mod}}, {_SLIT("` import set, remove `{}`"), 0, { .d_c = 0 }}})), pos_t); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("empty `"), /*115 &string*/0xfe10, {.d_s = parent->mod}}, {_SLIT("` import set, remove `{}`"), 0, { .d_c = 0 }}})), pos_t); return; } if (p->tok.kind != v__token__Kind__name) { @@ -92766,9 +93065,9 @@ VV_LOCAL_SYMBOL v__ast__Return v__parser__Parser_return_stmt(v__parser__Parser* v__ast__Return _t1 = ((v__ast__Return){.pos = first_pos,.comments = comments,.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.types = __new_array(0, 0, sizeof(v__ast__Type)),}); return _t1; } - multi_return_Array_v__ast__Expr_Array_v__ast__Comment mr_84307 = v__parser__Parser_expr_list(p); - Array_v__ast__Expr exprs = mr_84307.arg0; - Array_v__ast__Comment comments2 = mr_84307.arg1; + multi_return_Array_v__ast__Expr_Array_v__ast__Comment mr_84411 = v__parser__Parser_expr_list(p); + Array_v__ast__Expr exprs = mr_84411.arg0; + Array_v__ast__Comment comments2 = mr_84411.arg1; _PUSH_MANY(&comments, (comments2), _t2, Array_v__ast__Comment); v__token__Pos end_pos = v__ast__Expr_pos((*(v__ast__Expr*)array_last(exprs))); v__ast__Return _t3 = ((v__ast__Return){.pos = v__token__Pos_extend(first_pos, end_pos),.comments = comments,.exprs = exprs,.types = __new_array(0, 0, sizeof(v__ast__Type)),}); @@ -92827,40 +93126,40 @@ VV_LOCAL_SYMBOL v__ast__GlobalDecl v__parser__Parser_global_decl(v__parser__Pars if (has_expr) { v__parser__Parser_next(p); expr = v__parser__Parser_expr(p, 0); - if (expr._typ == 253 /* v.ast.CastExpr */) { + if (expr._typ == 254 /* v.ast.CastExpr */) { typ = (*expr._v__ast__CastExpr).typ; } - else if (expr._typ == 291 /* v.ast.StructInit */) { + else if (expr._typ == 292 /* v.ast.StructInit */) { typ = (*expr._v__ast__StructInit).typ; } - else if (expr._typ == 246 /* v.ast.ArrayInit */) { + else if (expr._typ == 247 /* v.ast.ArrayInit */) { typ = (*expr._v__ast__ArrayInit).typ; } - else if (expr._typ == 254 /* v.ast.ChanInit */) { + else if (expr._typ == 255 /* v.ast.ChanInit */) { typ = (*expr._v__ast__ChanInit).typ; } - else if (expr._typ == 250 /* v.ast.BoolLiteral */) { + else if (expr._typ == 251 /* v.ast.BoolLiteral */) { typ = _const_v__ast__bool_type; } - else if (expr._typ == 272 /* v.ast.IsRefType */) { + else if (expr._typ == 273 /* v.ast.IsRefType */) { typ = _const_v__ast__bool_type; } - else if (expr._typ == 255 /* v.ast.CharLiteral */) { + else if (expr._typ == 256 /* v.ast.CharLiteral */) { typ = _const_v__ast__char_type; } - else if (expr._typ == 264 /* v.ast.FloatLiteral */) { + else if (expr._typ == 265 /* v.ast.FloatLiteral */) { typ = _const_v__ast__f64_type; } - else if (expr._typ == 271 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { typ = _const_v__ast__int_type; } - else if (expr._typ == 287 /* v.ast.SizeOf */) { + else if (expr._typ == 288 /* v.ast.SizeOf */) { typ = _const_v__ast__int_type; } - else if (expr._typ == 290 /* v.ast.StringLiteral */) { + else if (expr._typ == 291 /* v.ast.StringLiteral */) { typ = _const_v__ast__string_type; } - else if (expr._typ == 289 /* v.ast.StringInterLiteral */) { + else if (expr._typ == 290 /* v.ast.StringInterLiteral */) { typ = _const_v__ast__string_type; } @@ -92919,7 +93218,7 @@ VV_LOCAL_SYMBOL v__ast__EnumDecl v__parser__Parser_enum_decl(v__parser__Parser* return _t1; } if (_IN_MAP(ADDR(string, enum_name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register enum `"), 0xfe10, {.d_s = enum_name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), end_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register enum `"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), end_pos); v__ast__EnumDecl _t2 = ((v__ast__EnumDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.is_flag = 0,.is_multi_allowed = 0,.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.fields = __new_array(0, 0, sizeof(v__ast__EnumField)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t2; } @@ -92968,7 +93267,7 @@ VV_LOCAL_SYMBOL v__ast__EnumDecl v__parser__Parser_enum_decl(v__parser__Parser* } } string pubfn = (string__eq(p->mod, _SLIT("main")) ? (_SLIT("fn")) : (_SLIT("pub fn"))); - v__parser__Parser_codegen(p, str_intp(21, _MOV((StrIntpData[]){{_SLIT("\n//\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), 0xfe10, {.d_s = enum_name}}, {_SLIT(") is_empty() bool { return int(*e) == 0 }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), 0xfe10, {.d_s = enum_name}}, {_SLIT(") has(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") bool { return (int(*e) & (int(flag))) != 0 }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), 0xfe10, {.d_s = enum_name}}, {_SLIT(") all(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") bool { return (int(*e) & (int(flag))) == int(flag) }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") set(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), 0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) | (int(flag))) } }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") clear(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), 0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) & ~(int(flag))) } }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") toggle(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), 0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) ^ (int(flag))) } }\n//\n"), 0, { .d_c = 0 }}}))); + v__parser__Parser_codegen(p, str_intp(21, _MOV((StrIntpData[]){{_SLIT("\n//\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") is_empty() bool { return int(*e) == 0 }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") has(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") bool { return (int(*e) & (int(flag))) != 0 }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") all(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") bool { return (int(*e) & (int(flag))) == int(flag) }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") set(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) | (int(flag))) } }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") clear(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) & ~(int(flag))) } }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") toggle(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) ^ (int(flag))) } }\n//\n"), 0, { .d_c = 0 }}}))); } int idx = v__ast__Table_register_sym(p->table, ((v__ast__TypeSymbol){ .parent_idx = 0, @@ -92983,7 +93282,7 @@ VV_LOCAL_SYMBOL v__ast__EnumDecl v__parser__Parser_enum_decl(v__parser__Parser* .idx = 0, })); if (idx == -1) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register enum `"), 0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), end_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register enum `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), end_pos); } v__ast__EnumDecl enum_decl = ((v__ast__EnumDecl){ .name = name, @@ -93017,13 +93316,13 @@ VV_LOCAL_SYMBOL v__ast__TypeDecl v__parser__Parser_type_decl(v__parser__Parser* return _t1; } if (_IN_MAP(ADDR(string, name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register alias `"), 0xfe10, {.d_s = name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), end_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register alias `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), end_pos); v__ast__TypeDecl _t2 = v__ast__AliasTypeDecl_to_sumtype_v__ast__TypeDecl(ADDR(v__ast__AliasTypeDecl, (((v__ast__AliasTypeDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.parent_type = 0,.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),})))); return _t2; } Array_v__ast__TypeNode sum_variants = __new_array_with_default(0, 0, sizeof(v__ast__TypeNode), 0); - multi_return_Array_v__ast__Type_Array_string mr_90504 = v__parser__Parser_parse_generic_types(p); - Array_v__ast__Type generic_types = mr_90504.arg0; + multi_return_Array_v__ast__Type_Array_string mr_90608 = v__parser__Parser_parse_generic_types(p); + Array_v__ast__Type generic_types = mr_90608.arg0; v__token__Pos decl_pos_with_generics = v__token__Pos_extend(decl_pos, v__token__Token_pos(&p->prev_tok)); v__parser__Parser_check(p, v__token__Kind__assign); v__token__Pos type_pos = v__token__Token_pos(&p->tok); @@ -93083,7 +93382,7 @@ VV_LOCAL_SYMBOL v__ast__TypeDecl v__parser__Parser_type_decl(v__parser__Parser* .idx = 0, })); if (typ == _const_v__ast__invalid_type_idx) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register sum type `"), 0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register sum type `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); v__ast__TypeDecl _t9 = v__ast__SumTypeDecl_to_sumtype_v__ast__TypeDecl(ADDR(v__ast__SumTypeDecl, (((v__ast__SumTypeDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.typ = 0,.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.variants = __new_array(0, 0, sizeof(v__ast__TypeNode)),})))); return _t9; } @@ -93124,13 +93423,13 @@ VV_LOCAL_SYMBOL v__ast__TypeDecl v__parser__Parser_type_decl(v__parser__Parser* })); v__token__Pos type_end_pos = v__token__Token_pos(&p->prev_tok); if (idx == _const_v__ast__invalid_type_idx) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register alias `"), 0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register alias `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); v__ast__TypeDecl _t12 = v__ast__AliasTypeDecl_to_sumtype_v__ast__TypeDecl(ADDR(v__ast__AliasTypeDecl, (((v__ast__AliasTypeDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.parent_type = 0,.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),})))); return _t12; } if (idx == pidx) { v__token__Pos type_alias_pos = (*(v__ast__TypeNode*)/*ee elem_sym */array_get(sum_variants, 0)).pos; - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("a type alias can not refer to itself: "), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Pos_extend(decl_pos, type_alias_pos)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("a type alias can not refer to itself: "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Pos_extend(decl_pos, type_alias_pos)); v__ast__TypeDecl _t13 = v__ast__AliasTypeDecl_to_sumtype_v__ast__TypeDecl(ADDR(v__ast__AliasTypeDecl, (((v__ast__AliasTypeDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.parent_type = 0,.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),})))); return _t13; } @@ -93152,7 +93451,7 @@ VV_LOCAL_SYMBOL v__ast__Assoc v__parser__Parser_assoc(v__parser__Parser* p) { Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(p->scope, var_name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown variable `"), 0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown variable `"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); v__ast__Assoc _t2 = ((v__ast__Assoc){.var_name = (string){.str=(byteptr)"", .is_lit=1},.fields = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.typ = 0,.scope = 0,}); return _t2; } @@ -93197,7 +93496,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_top_level_statement_start(v__parser__Pars v__parser__Parser_rewind_scanner_to_current_token_in_new_mode(p); #if defined(CUSTOM_DEFINE_debugscanner) { - eprintln( str_intp(7, _MOV((StrIntpData[]){{_SLIT(">> p.top_level_statement_start | tidx:"), 0xafe07, {.d_i32 = p->tok.tidx}}, {_SLIT(" | p.tok.kind: "), 0x14fe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT(" | p.tok.lit: "), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT(" "), 0xfe10, {.d_s = p->peek_tok.lit}}, {_SLIT(" "), 0xfe10, {.d_s = v__parser__Parser_peek_token(p, 2).lit}}, {_SLIT(" "), 0xfe10, {.d_s = v__parser__Parser_peek_token(p, 3).lit}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(7, _MOV((StrIntpData[]){{_SLIT(">> p.top_level_statement_start | tidx:"), /*100 &int*/0xafe07, {.d_i32 = p->tok.tidx}}, {_SLIT(" | p.tok.kind: "), /*115 &v.token.Kind*/0x14fe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT(" | p.tok.lit: "), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = p->peek_tok.lit}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_peek_token(p, 2).lit}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_peek_token(p, 3).lit}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } #endif } @@ -93209,7 +93508,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_top_level_statement_end(v__parser__Parser v__parser__Parser_rewind_scanner_to_current_token_in_new_mode(p); #if defined(CUSTOM_DEFINE_debugscanner) { - eprintln( str_intp(7, _MOV((StrIntpData[]){{_SLIT(">> p.top_level_statement_end | tidx:"), 0xafe07, {.d_i32 = p->tok.tidx}}, {_SLIT(" | p.tok.kind: "), 0x14fe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT(" | p.tok.lit: "), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT(" "), 0xfe10, {.d_s = p->peek_tok.lit}}, {_SLIT(" "), 0xfe10, {.d_s = v__parser__Parser_peek_token(p, 2).lit}}, {_SLIT(" "), 0xfe10, {.d_s = v__parser__Parser_peek_token(p, 3).lit}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(7, _MOV((StrIntpData[]){{_SLIT(">> p.top_level_statement_end | tidx:"), /*100 &int*/0xafe07, {.d_i32 = p->tok.tidx}}, {_SLIT(" | p.tok.kind: "), /*115 &v.token.Kind*/0x14fe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT(" | p.tok.lit: "), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = p->peek_tok.lit}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_peek_token(p, 2).lit}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_peek_token(p, 3).lit}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } #endif } @@ -93235,12 +93534,12 @@ bool v__parser__Parser_mark_var_as_used(v__parser__Parser* p, string varname) { Option_v__ast__ScopeObject _t1; if (_t1 = v__ast__Scope_find(p->scope, varname), _t1.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t1.data; - if (obj._typ == 324 /* v.ast.Var */) { + if (obj._typ == 325 /* v.ast.Var */) { (*obj._v__ast__Var).is_used = true; bool _t2 = true; return _t2; } - else if (obj._typ == 323 /* v.ast.GlobalField */) { + else if (obj._typ == 324 /* v.ast.GlobalField */) { bool _t3 = true; return _t3; } @@ -93277,7 +93576,7 @@ bool v__parser__Parser_unsafe_stmt_defer_0 = false; v__parser__Parser_unsafe_stmt_defer_0 = true; v__ast__Stmt stmt = v__parser__Parser_stmt(p, false); if (p->tok.kind == v__token__Kind__rcbr) { - if ((stmt)._typ == 306 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { if (v__ast__Expr_is_expr((*stmt._v__ast__ExprStmt).expr)) { v__parser__Parser_next(p); v__token__Pos_update_last_line(&pos, p->prev_tok.line_nr); @@ -93313,7 +93612,7 @@ bool v__parser__Parser_unsafe_stmt_defer_0 = false; VV_LOCAL_SYMBOL void v__parser__Parser_trace(v__parser__Parser* p, string fbase, string message) { if (string__eq(p->file_base, fbase)) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> p.trace | "), 0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), 0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> p.trace | "), /*115 &string*/0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -93323,7 +93622,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_sql_expr(v__parser__Parser* p) { Option_v__ast__Expr _t1 = v__parser__Parser_check_expr(p, 0); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - *(v__ast__Expr*) _t1.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting database"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + *(v__ast__Expr*) _t1.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting database"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); } v__ast__Expr db_expr = (*(v__ast__Expr*)_t1.data); @@ -93344,13 +93643,13 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_sql_expr(v__parser__Parser* p) { if (has_where) { v__parser__Parser_next(p); where_expr = v__parser__Parser_expr(p, 0); - if (!is_count && (where_expr)._typ == 270 /* v.ast.InfixExpr */) { - if ((*where_expr._v__ast__InfixExpr).op == v__token__Kind__eq && ((*where_expr._v__ast__InfixExpr).left)._typ == 266 /* v.ast.Ident */) { + if (!is_count && (where_expr)._typ == 271 /* v.ast.InfixExpr */) { + if ((*where_expr._v__ast__InfixExpr).op == v__token__Kind__eq && ((*where_expr._v__ast__InfixExpr).left)._typ == 267 /* v.ast.Ident */) { if (string__eq((*(*where_expr._v__ast__InfixExpr).left._v__ast__Ident).name, _SLIT("id"))) { query_one = true; } } - if (((*where_expr._v__ast__InfixExpr).right)._typ == 266 /* v.ast.Ident */) { + if (((*where_expr._v__ast__InfixExpr).right)._typ == 267 /* v.ast.Ident */) { if (!v__ast__Scope_known_var(p->scope, (*(*where_expr._v__ast__InfixExpr).right._v__ast__Ident).name)) { Option_void _t2 = v__parser__Parser_check_undefined_variables(p, new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){(*where_expr._v__ast__InfixExpr).left})), (*where_expr._v__ast__InfixExpr).right); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { @@ -93437,7 +93736,7 @@ bool v__parser__Parser_sql_stmt_defer_0 = false; Option_v__ast__Expr _t1 = v__parser__Parser_check_expr(p, 0); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - *(v__ast__Expr*) _t1.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting database"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + *(v__ast__Expr*) _t1.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting database"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); } v__ast__Expr db_expr = (*(v__ast__Expr*)_t1.data); @@ -93470,7 +93769,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par kind = v__ast__SqlStmtKind__create; string table = v__parser__Parser_check_name(p); if (!string__eq(table, _SLIT("table"))) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `table` got `"), 0xfe10, {.d_s = table}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `table` got `"), /*115 &string*/0xfe10, {.d_s = table}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); v__ast__SqlStmtLine _t1 = ((v__ast__SqlStmtLine){.kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.where_expr = {0},.update_exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.object_var_name = (string){.str=(byteptr)"", .is_lit=1},.updated_columns = __new_array(0, 0, sizeof(string)),.table_expr = (v__ast__TypeNode){.typ = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlStmtLine), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop),}); return _t1; } @@ -93482,7 +93781,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par kind = v__ast__SqlStmtKind__drop; string table = v__parser__Parser_check_name(p); if (!string__eq(table, _SLIT("table"))) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `table` got `"), 0xfe10, {.d_s = table}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `table` got `"), /*115 &string*/0xfe10, {.d_s = table}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); v__ast__SqlStmtLine _t3 = ((v__ast__SqlStmtLine){.kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.where_expr = {0},.update_exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.object_var_name = (string){.str=(byteptr)"", .is_lit=1},.updated_columns = __new_array(0, 0, sizeof(string)),.table_expr = (v__ast__TypeNode){.typ = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlStmtLine), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop),}); return _t3; } @@ -93498,7 +93797,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par table_type = v__parser__Parser_parse_type(p); } else if (kind == v__ast__SqlStmtKind__insert) { v__ast__Expr expr = v__parser__Parser_expr(p, 0); - if ((expr)._typ == 266 /* v.ast.Ident */) { + if ((expr)._typ == 267 /* v.ast.Ident */) { inserted_var_name = (*expr._v__ast__Ident).name; } else { v__parser__Parser_error(p, _SLIT("can only insert variables")); @@ -93580,7 +93879,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par VV_LOCAL_SYMBOL Option_bool v__parser__Parser_check_sql_keyword(v__parser__Parser* p, string name) { if (!string__eq(v__parser__Parser_check_name(p), name)) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm: expecting `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm: expecting `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_bool _t2; @@ -93626,7 +93925,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; Array_v__ast__Type generic_types = mr_1547.arg0; bool no_body = p->tok.kind != v__token__Kind__lcbr; if (language == v__ast__Language__v && no_body) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` lacks body"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` lacks body"), 0, { .d_c = 0 }}}))); v__ast__StructDecl _t2 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -93636,7 +93935,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; return _t2; } if (language == v__ast__Language__v && !p->builtin_mod && !p->is_translated && name.len > 0 && !u8_is_capital(string_at(name, 0)) && !p->pref->translated && !p->is_translated) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct name `"), 0xfe10, {.d_s = name}}, {_SLIT("` must begin with capital letter"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct name `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` must begin with capital letter"), 0, { .d_c = 0 }}})), name_pos); v__ast__StructDecl _t3 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -93656,7 +93955,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; return _t4; } if (_IN_MAP(ADDR(string, name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register struct `"), 0xfe10, {.d_s = name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register struct `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), name_pos); v__ast__StructDecl _t5 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -93667,10 +93966,10 @@ bool v__parser__Parser_struct_decl_defer_0 = false; } string orig_name = name; if (language == v__ast__Language__c) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); orig_name = name; } else if (language == v__ast__Language__js) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); orig_name = name; } else { name = v__parser__Parser_prepend_mod(p, name); @@ -93829,7 +94128,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; } v__ast__TypeSymbol* sym = v__ast__Table_sym(p->table, typ); if (Array_v__ast__Type_contains(embed_types, typ)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot embed `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` more than once"), 0, { .d_c = 0 }}})), type_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot embed `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` more than once"), 0, { .d_c = 0 }}})), type_pos); v__ast__StructDecl _t15 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -93840,7 +94139,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; } field_name = v__ast__TypeSymbol_embed_name(sym); if (Array_string_contains(embed_field_names, field_name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate field `"), 0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), type_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate field `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), type_pos); v__ast__StructDecl _t16 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -93886,7 +94185,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; if (p->tok.kind == v__token__Kind__assign) { v__parser__Parser_next(p); default_expr = v__parser__Parser_expr(p, 0); - if (default_expr._typ == 263 /* v.ast.EnumVal */) { + if (default_expr._typ == 264 /* v.ast.EnumVal */) { (*default_expr._v__ast__EnumVal).typ = typ; } @@ -93959,7 +94258,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; .idx = 0, }); if (v__ast__Table_has_deep_child_no_ref(p->table, &t, name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid recursive struct `"), 0xfe10, {.d_s = orig_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid recursive struct `"), /*115 &string*/0xfe10, {.d_s = orig_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); v__ast__StructDecl _t26 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -93971,7 +94270,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; int ret = 0; ret = v__ast__Table_register_sym(p->table, t); if (ret == -1 && language != v__ast__Language__c) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register struct `"), 0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register struct `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); v__ast__StructDecl _t27 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -94128,7 +94427,7 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser v__parser__Parser_check(p, v__token__Kind__lcbr); Array_v__ast__Comment pre_comments = v__parser__Parser_eat_comments(p, ((v__parser__EatCommentsConfig){.same_line = 0,.follow_up = 0,})); if (_IN_MAP(ADDR(string, modless_name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register interface `"), 0xfe10, {.d_s = interface_name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register interface `"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), name_pos); v__ast__InterfaceDecl _t1 = ((v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.language = 0,.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,}); return _t1; } @@ -94145,13 +94444,13 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser .idx = 0, })); if (reg_idx == -1) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register interface `"), 0xfe10, {.d_s = interface_name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register interface `"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); v__ast__InterfaceDecl _t2 = ((v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.language = 0,.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,}); return _t2; } v__ast__Type typ = v__ast__new_type(reg_idx); v__ast__TypeSymbol* ts = v__ast__Table_sym(p->table, typ); - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 434) /*expected idx: 434, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 435) /*expected idx: 435, name: v.ast.Interface */ ; ts->methods = __new_array_with_default(0, 20, sizeof(v__ast__Fn), 0); Array_v__ast__StructField fields = __new_array_with_default(0, 20, sizeof(v__ast__StructField), 0); Array_v__ast__FnDecl methods = __new_array_with_default(0, 20, sizeof(v__ast__FnDecl), 0); @@ -94160,7 +94459,7 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser Array_v__ast__InterfaceEmbedding ifaces = __new_array_with_default(0, 0, sizeof(v__ast__InterfaceEmbedding), 0); for (;;) { if (!(p->tok.kind != v__token__Kind__rcbr && p->tok.kind != v__token__Kind__eof)) break; - if (p->tok.kind == v__token__Kind__name && p->tok.lit.len > 0 && u8_is_capital(string_at(p->tok.lit, 0)) && p->peek_tok.kind != v__token__Kind__lpar) { + if (p->tok.kind == v__token__Kind__name && p->tok.lit.len > 0 && u8_is_capital(string_at(p->tok.lit, 0)) && (p->peek_tok.line_nr != p->tok.line_nr || !(p->peek_tok.kind == v__token__Kind__name || p->peek_tok.kind == v__token__Kind__amp || p->peek_tok.kind == v__token__Kind__lsbr || p->peek_tok.kind == v__token__Kind__lpar))) { v__token__Pos iface_pos = v__token__Token_pos(&p->tok); string iface_name = p->tok.lit; v__ast__Type iface_type = v__parser__Parser_parse_type(p); @@ -94176,12 +94475,12 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser } if (p->tok.kind == v__token__Kind__name && p->peek_tok.kind == v__token__Kind__dot) { if (!_IN_MAP(ADDR(string, p->tok.lit), ADDR(map, p->imports))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("mod `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` not imported"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("mod `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` not imported"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); break; } string mod_name = p->tok.lit; v__ast__Type from_mod_typ = v__parser__Parser_parse_type(p); - string from_mod_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod_name}}, {_SLIT("."), 0xfe10, {.d_s = p->prev_tok.lit}}, {_SLIT0, 0, { .d_c = 0 }}})); + string from_mod_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = p->prev_tok.lit}}, {_SLIT0, 0, { .d_c = 0 }}})); if (string_is_lower(from_mod_name)) { v__parser__Parser_error_with_pos(p, _SLIT("The interface name need to have the pascal case"), v__token__Token_pos(&p->prev_tok)); break; @@ -94208,18 +94507,18 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser int line_nr = p->tok.line_nr; string name = v__parser__Parser_check_name(p); if (string__eq(name, _SLIT("type_name")) || string__eq(name, _SLIT("type_idx"))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot override built-in method `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method_start_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot override built-in method `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method_start_pos); v__ast__InterfaceDecl _t6 = ((v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.language = 0,.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,}); return _t6; } if (v__ast__TypeSymbol_has_method(ts, name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method_start_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method_start_pos); v__ast__InterfaceDecl _t7 = ((v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.language = 0,.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,}); return _t7; } - multi_return_Array_v__ast__Param_bool_bool mr_16079 = v__parser__Parser_fn_args(p); - Array_v__ast__Param args2 = mr_16079.arg0; - bool is_variadic = mr_16079.arg2; + multi_return_Array_v__ast__Param_bool_bool mr_16146 = v__parser__Parser_fn_args(p); + Array_v__ast__Param args2 = mr_16146.arg0; + bool is_variadic = mr_16146.arg2; Array_v__ast__Param args = new_array_from_c_array(1, 1, sizeof(v__ast__Param), _MOV((v__ast__Param[1]){((v__ast__Param){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = _SLIT("x"),.is_mut = is_mut,.is_auto_rec = 0,.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_hidden = true,.typ = typ,})})); _PUSH_MANY(&args, (args2), _t8, Array_v__ast__Param); v__ast__FnDecl method = ((v__ast__FnDecl){ @@ -94436,7 +94735,7 @@ VV_LOCAL_SYMBOL bool v__parser__is_html_open_tag(string name, string s) { bool _t7 = false; return _t7; } - if (!string__eq(string_substr(sub, 0, len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT(" "), 0, { .d_c = 0 }}})))) { + if (!string__eq(string_substr(sub, 0, len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), 0, { .d_c = 0 }}})))) { bool _t8 = false; return _t8; } @@ -94447,7 +94746,7 @@ VV_LOCAL_SYMBOL bool v__parser__is_html_open_tag(string name, string s) { } VV_LOCAL_SYMBOL string v__parser__insert_template_code(string fn_name, string tmpl_str_start, string line) { - string trailing_bs = string__plus(string__plus(_const_v__parser__tmpl_str_end, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(".write_u8(92)\n"), 0, { .d_c = 0 }}}))), tmpl_str_start); + string trailing_bs = string__plus(string__plus(_const_v__parser__tmpl_str_end, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(".write_u8(92)\n"), 0, { .d_c = 0 }}}))), tmpl_str_start); Array_string round1 = new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("\\"), _SLIT("\\\\"), _SLIT("'"), _SLIT("\\'"), _SLIT("@"), _SLIT("$")})); Array_string round2 = new_array_from_c_array(4, 4, sizeof(string), _MOV((string[4]){_SLIT("$$"), _SLIT("\\@"), _SLIT(".$"), _SLIT(".@")})); string rline = string_replace_each(string_replace_each(line, round1), round2); @@ -94462,7 +94761,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp Option_Array_string _t1 = os__read_lines(template_file); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("reading from "), 0xfe10, {.d_s = template_file}}, {_SLIT(" failed"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("reading from "), /*115 &string*/0xfe10, {.d_s = template_file}}, {_SLIT(" failed"), 0, { .d_c = 0 }}}))); string _t2 = _SLIT(""); return _t2; } @@ -94470,9 +94769,9 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp Array_string lines = (*(Array_string*)_t1.data); string basepath = os__dir(template_file); int lstartlength = lines.len * 30; - string tmpl_str_start = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tsb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(".write_string('"), 0, { .d_c = 0 }}})); + string tmpl_str_start = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tsb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(".write_string('"), 0, { .d_c = 0 }}})); strings__Builder source = strings__new_builder(1000); - strings__Builder_writeln(&source, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nimport strings\n// === vweb html template ===\nfn vweb_tmpl_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("() string {\n mut sb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(" := strings.new_builder("), 0xfe07, {.d_i32 = lstartlength}}, {_SLIT(")\n\n\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nimport strings\n// === vweb html template ===\nfn vweb_tmpl_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("() string {\n mut sb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" := strings.new_builder("), /*100 &int*/0xfe07, {.d_i32 = lstartlength}}, {_SLIT(")\n\n\n"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&source, tmpl_str_start); v__parser__State state = v__parser__State__simple; string template_ext = os__file_ext(template_file); @@ -94493,7 +94792,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } #if defined(CUSTOM_DEFINE_trace_tmpl) { - eprintln( str_intp(8, _MOV((StrIntpData[]){{_SLIT(">>> tfile: "), 0xfe10, {.d_s = template_file}}, {_SLIT(", spos: "), 0xcfe27, {.d_i32 = start_of_line_pos}}, {_SLIT(", epos:"), 0xcfe27, {.d_i32 = end_of_line_pos}}, {_SLIT(", fi: "), 0xafe27, {.d_i32 = tline_number}}, {_SLIT(", i: "), 0xafe27, {.d_i32 = i}}, {_SLIT(", state: "), 0x14fe30, {.d_s = v__parser__State_str(state)}}, {_SLIT(", line: "), 0xfe10, {.d_s = line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(8, _MOV((StrIntpData[]){{_SLIT(">>> tfile: "), /*115 &string*/0xfe10, {.d_s = template_file}}, {_SLIT(", spos: "), /*100 &int*/0xcfe27, {.d_i32 = start_of_line_pos}}, {_SLIT(", epos:"), /*100 &int*/0xcfe27, {.d_i32 = end_of_line_pos}}, {_SLIT(", fi: "), /*100 &int*/0xafe27, {.d_i32 = tline_number}}, {_SLIT(", i: "), /*100 &int*/0xafe27, {.d_i32 = i}}, {_SLIT(", state: "), /*115 &v.parser.State*/0x14fe30, {.d_s = v__parser__State_str(state)}}, {_SLIT(", line: "), /*115 &string*/0xfe10, {.d_s = line}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif if (string_contains(line, _SLIT("@header"))) { @@ -94530,10 +94829,10 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp if (string_contains(file_name, _SLIT("/")) && string_starts_with(file_name, _SLIT("/"))) { templates_folder = _SLIT(""); } - string file_path = os__real_path(os__join_path_single(templates_folder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = file_name}}, {_SLIT0, 0xfe10, {.d_s = file_ext}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string file_path = os__real_path(os__join_path_single(templates_folder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = file_name}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = file_ext}}, {_SLIT0, 0, { .d_c = 0 }}})))); #if defined(CUSTOM_DEFINE_trace_tmpl) { - eprintln( str_intp(9, _MOV((StrIntpData[]){{_SLIT(">>> basepath: \""), 0xfe10, {.d_s = basepath}}, {_SLIT("\" , template_file: \""), 0xfe10, {.d_s = template_file}}, {_SLIT("\" , fn_name: \""), 0xfe10, {.d_s = fn_name}}, {_SLIT("\" , @include line: \""), 0xfe10, {.d_s = line}}, {_SLIT("\" , file_name: \""), 0xfe10, {.d_s = file_name}}, {_SLIT("\" , file_ext: \""), 0xfe10, {.d_s = file_ext}}, {_SLIT("\" , templates_folder: \""), 0xfe10, {.d_s = templates_folder}}, {_SLIT("\" , file_path: \""), 0xfe10, {.d_s = file_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + eprintln( str_intp(9, _MOV((StrIntpData[]){{_SLIT(">>> basepath: \""), /*115 &string*/0xfe10, {.d_s = basepath}}, {_SLIT("\" , template_file: \""), /*115 &string*/0xfe10, {.d_s = template_file}}, {_SLIT("\" , fn_name: \""), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("\" , @include line: \""), /*115 &string*/0xfe10, {.d_s = line}}, {_SLIT("\" , file_name: \""), /*115 &string*/0xfe10, {.d_s = file_name}}, {_SLIT("\" , file_ext: \""), /*115 &string*/0xfe10, {.d_s = file_ext}}, {_SLIT("\" , templates_folder: \""), /*115 &string*/0xfe10, {.d_s = templates_folder}}, {_SLIT("\" , file_path: \""), /*115 &string*/0xfe10, {.d_s = file_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } #endif Option_string _t5 = os__read_file(file_path); @@ -94546,7 +94845,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } int position = (*(int*)_t6.data) + 9; - v__parser__Parser_error_with_error(p, ((v__errors__Error){.message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Reading file "), 0xfe10, {.d_s = file_name}}, {_SLIT(" from path: "), 0xfe10, {.d_s = file_path}}, {_SLIT(" failed"), 0, { .d_c = 0 }}})),.details = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to @include '"), 0xfe10, {.d_s = file_name}}, {_SLIT("'"), 0, { .d_c = 0 }}})),.file_path = template_file,.pos = ((v__token__Pos){.len = 9 + file_name.len,.line_nr = tline_number,.pos = start_of_line_pos + position,.col = 0,.last_line = lines.len,}),.backtrace = (string){.str=(byteptr)"", .is_lit=1},.reporter = v__errors__Reporter__parser,})); + v__parser__Parser_error_with_error(p, ((v__errors__Error){.message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Reading file "), /*115 &string*/0xfe10, {.d_s = file_name}}, {_SLIT(" from path: "), /*115 &string*/0xfe10, {.d_s = file_path}}, {_SLIT(" failed"), 0, { .d_c = 0 }}})),.details = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to @include '"), /*115 &string*/0xfe10, {.d_s = file_name}}, {_SLIT("'"), 0, { .d_c = 0 }}})),.file_path = template_file,.pos = ((v__token__Pos){.len = 9 + file_name.len,.line_nr = tline_number,.pos = start_of_line_pos + position,.col = 0,.last_line = lines.len,}),.backtrace = (string){.str=(byteptr)"", .is_lit=1},.reporter = v__errors__Reporter__parser,})); *(string*) _t5.data = _SLIT(""); } @@ -94637,18 +94936,18 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp string line_t = string_trim_space(line); if (string_starts_with(line_t, _SLIT("span.")) && string_ends_with(line, _SLIT("{"))) { string _v_class = string_trim_space(string_find_between(line, _SLIT("span."), _SLIT("{"))); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT(""), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT(""), 0, { .d_c = 0 }}}))); in_span = true; continue; } else if (string_starts_with(line_t, _SLIT(".")) && string_ends_with(line, _SLIT("{"))) { string _v_class = string_trim_space(string_find_between(line, _SLIT("."), _SLIT("{"))); string trimmed = string_trim_space(line); strings__Builder_write_string(&source, strings__repeat('\t', line.len - trimmed.len)); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("
"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("
"), 0, { .d_c = 0 }}}))); continue; } else if (string_starts_with(line_t, _SLIT("#")) && string_ends_with(line, _SLIT("{"))) { string _v_class = string_trim_space(string_find_between(line, _SLIT("#"), _SLIT("{"))); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("
"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("
"), 0, { .d_c = 0 }}}))); continue; } else if (string__eq(line_t, _SLIT("}"))) { strings__Builder_write_string(&source, strings__repeat('\t', line.len - line_t.len)); @@ -94678,10 +94977,10 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp strings__Builder_writeln(&source, v__parser__insert_template_code(fn_name, tmpl_str_start, line)); } strings__Builder_writeln(&source, _const_v__parser__tmpl_str_end); - strings__Builder_writeln(&source, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(" := sb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(".str() "), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn _tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" := sb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(".str() "), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn _tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); strings__Builder_writeln(&source, _SLIT("}")); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// === end of vweb html template_file: "), 0xfe10, {.d_s = template_file}}, {_SLIT(" ==="), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// === end of vweb html template_file: "), /*115 &string*/0xfe10, {.d_s = template_file}}, {_SLIT(" ==="), 0, { .d_c = 0 }}}))); string result = strings__Builder_str(&source); #if defined(CUSTOM_DEFINE_trace_tmpl_expansion) { @@ -94695,7 +94994,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } void v__callgraph__show(v__ast__Table* table, v__pref__Preferences* pref, Array_v__ast__File_ptr ast_files) { - v__callgraph__Mapper* mapper = ((v__callgraph__Mapper*)memdup(&(v__callgraph__Mapper){.pos = 0,.pref = pref,.table = table,.file = 0,.node = 0,.fn_decl = 0,.caller_name = (string){.str=(byteptr)"", .is_lit=1},.dot_caller_name = (string){.str=(byteptr)"", .is_lit=1},.is_caller_used = 0,.dg = *v__dotgraph__new(_SLIT("CallGraph"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("CallGraph for "), 0xfe10, {.d_s = pref->path}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("green")),}, sizeof(v__callgraph__Mapper))); + v__callgraph__Mapper* mapper = ((v__callgraph__Mapper*)memdup(&(v__callgraph__Mapper){.pos = 0,.pref = pref,.table = table,.file = 0,.node = 0,.fn_decl = 0,.caller_name = (string){.str=(byteptr)"", .is_lit=1},.dot_caller_name = (string){.str=(byteptr)"", .is_lit=1},.is_caller_used = 0,.dg = *v__dotgraph__new(_SLIT("CallGraph"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("CallGraph for "), /*115 &string*/0xfe10, {.d_s = pref->path}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("green")),}, sizeof(v__callgraph__Mapper))); for (int _t1 = 0; _t1 < ast_files.len; ++_t1) { v__ast__File* afile = ((v__ast__File**)ast_files.data)[_t1]; v__ast__walker__walk(HEAP(v__ast__walker__Visitor, /*&v.ast.walker.Visitor*/I_v__callgraph__Mapper_to_Interface_v__ast__walker__Visitor(mapper)), HEAP(v__ast__Node, v__ast__File_to_sumtype_v__ast__Node(afile))); @@ -94719,7 +95018,7 @@ VV_LOCAL_SYMBOL string v__callgraph__Mapper_fn_name(v__callgraph__Mapper* m, str return _t1; } v__ast__TypeSymbol* rec_sym = v__ast__Table_sym(m->table, receiver_type); - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = rec_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = rec_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } @@ -94734,11 +95033,11 @@ VV_LOCAL_SYMBOL string v__callgraph__Mapper_dot_fn_name(v__callgraph__Mapper* m, VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node) { m->node = node; - if (node->_typ == 174 /* v.ast.File */) { + if (node->_typ == 175 /* v.ast.File */) { m->file = &(*node->_v__ast__File); } - else if (node->_typ == 320 /* v.ast.Stmt */) { - if ((*node->_v__ast__Stmt)._typ == 183 /* v.ast.FnDecl */) { + else if (node->_typ == 321 /* v.ast.Stmt */) { + if ((*node->_v__ast__Stmt)._typ == 184 /* v.ast.FnDecl */) { m->is_caller_used = true; if (m->pref->skip_unused) { m->is_caller_used = (*(bool*)map_get(ADDR(map, m->table->used_fns), &(string[]){v__ast__FnDecl_fkey(&(*(*node->_v__ast__Stmt)._v__ast__FnDecl))}, &(bool[]){ 0 })); @@ -94755,8 +95054,8 @@ VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, } ; } - else if (node->_typ == 295 /* v.ast.Expr */) { - if ((*node->_v__ast__Expr)._typ == 252 /* v.ast.CallExpr */) { + else if (node->_typ == 296 /* v.ast.Expr */) { + if ((*node->_v__ast__Expr)._typ == 253 /* v.ast.CallExpr */) { if (m->is_caller_used) { string dot_called_name = v__callgraph__Mapper_dot_fn_name(m, (*(*node->_v__ast__Expr)._v__ast__CallExpr).name, (*(*node->_v__ast__Expr)._v__ast__CallExpr).receiver_type, (*(*node->_v__ast__Expr)._v__ast__CallExpr).is_method); v__dotgraph__DotGraph_new_edge(&m->dg, m->dot_caller_name, dot_called_name, ((v__dotgraph__NewEdgeConfig){.should_highlight = string__eq(m->caller_name, _SLIT("main.main")),.ctx = ((voidptr)(0)),.name2node_fn = v__dotgraph__node_name,})); @@ -94923,14 +95222,14 @@ bool v__builder__Builder_parse_imports_defer_0 = false; Option_string _t11 = v__builder__Builder_find_module_path(b, mod, ast_file->path); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; - array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), 0xfe10, {.d_s = mod}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); + array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); break; } string import_path = (*(string*)_t11.data); Array_string v_files = v__builder__Builder_v_files_from_dir(b, import_path); if (v_files.len == 0) { - array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), 0xfe10, {.d_s = mod}}, {_SLIT("\" (no .v files in \""), 0xfe10, {.d_s = import_path}}, {_SLIT("\")"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); + array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" (no .v files in \""), /*115 &string*/0xfe10, {.d_s = import_path}}, {_SLIT("\")"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); continue; } Array_v__ast__File_ptr parsed_files = v__parser__parse_files(v_files, b->table, b->pref); @@ -94943,7 +95242,7 @@ bool v__builder__Builder_parse_imports_defer_0 = false; string sname = string_all_after_last(name, _SLIT(".")); string smod = string_all_after_last(mod, _SLIT(".")); if (!string__eq(sname, smod)) { - string msg = str_intp(5, _MOV((StrIntpData[]){{_SLIT("bad module definition: "), 0xfe10, {.d_s = ast_file->path}}, {_SLIT(" imports module \""), 0xfe10, {.d_s = mod}}, {_SLIT("\" but "), 0xfe10, {.d_s = file->path}}, {_SLIT(" is defined as module `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string msg = str_intp(5, _MOV((StrIntpData[]){{_SLIT("bad module definition: "), /*115 &string*/0xfe10, {.d_s = ast_file->path}}, {_SLIT(" imports module \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" but "), /*115 &string*/0xfe10, {.d_s = file->path}}, {_SLIT(" is defined as module `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, msg, ast_file->path, imp.pos) })); } } @@ -95054,10 +95353,10 @@ Array_string v__builder__Builder_v_files_from_dir(v__builder__Builder* b, string println(_SLIT("looks like you are trying to build V with an old command")); println(_SLIT("use `v -o v cmd/v` instead of `v -o v compiler`")); } - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT(" doesn't exist"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" doesn't exist"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (!os__is_dir(dir)) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT(" isn't a directory!"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" isn't a directory!"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } Option_Array_string _t1 = os__ls(dir); @@ -95070,7 +95369,7 @@ Array_string v__builder__Builder_v_files_from_dir(v__builder__Builder* b, string Array_string files = (*(Array_string*)_t1.data); if (b->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_files_from_dir (\""), 0xfe10, {.d_s = dir}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_files_from_dir (\""), /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } Array_string _t2 = v__pref__Preferences_should_compile_filtered_files(b->pref, dir, files); return _t2; @@ -95117,11 +95416,11 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin string search_path = ((string*)module_lookup_paths.data)[_t5]; string try_path = os__join_path(search_path, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){mod_path}))); if (b->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" >> trying to find "), 0xfe10, {.d_s = mod}}, {_SLIT(" in "), 0xfe10, {.d_s = try_path}}, {_SLIT(" .."), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" >> trying to find "), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT(" in "), /*115 &string*/0xfe10, {.d_s = try_path}}, {_SLIT(" .."), 0, { .d_c = 0 }}}))); } if (os__is_dir(try_path)) { if (b->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" << found "), 0xfe10, {.d_s = try_path}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" << found "), /*115 &string*/0xfe10, {.d_s = try_path}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); } Option_string _t6; opt_ok(&(string[]) { try_path }, (Option*)(&_t6), sizeof(string)); @@ -95133,7 +95432,7 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin string p1 = Array_string_join(array_slice(path_parts, 0, i), _const_os__path_separator); string try_path = os__join_path(p1, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){mod_path}))); if (b->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" >> trying to find "), 0xfe10, {.d_s = mod}}, {_SLIT(" in "), 0xfe10, {.d_s = try_path}}, {_SLIT(" .."), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" >> trying to find "), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT(" in "), /*115 &string*/0xfe10, {.d_s = try_path}}, {_SLIT(" .."), 0, { .d_c = 0 }}}))); } if (os__is_dir(try_path)) { Option_string _t7; @@ -95142,7 +95441,7 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin } } string smodule_lookup_paths = Array_string_join(module_lookup_paths, _SLIT(", ")); - return (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("module \""), 0xfe10, {.d_s = mod}}, {_SLIT("\" not found in:\n"), 0xfe10, {.d_s = smodule_lookup_paths}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("module \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" not found in:\n"), /*115 &string*/0xfe10, {.d_s = smodule_lookup_paths}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } void v__builder__Builder_show_total_warns_and_errors_stats(v__builder__Builder* b) { @@ -95162,9 +95461,9 @@ void v__builder__Builder_show_total_warns_and_errors_stats(v__builder__Builder* string wstring = v__util__bold(int_str(nr_warnings)); string nstring = v__util__bold(int_str(nr_notices)); if (b->pref->check_only) { - println( str_intp(4, _MOV((StrIntpData[]){{_SLIT("summary: "), 0xfe10, {.d_s = estring}}, {_SLIT(" V errors, "), 0xfe10, {.d_s = wstring}}, {_SLIT(" V warnings, "), 0xfe10, {.d_s = nstring}}, {_SLIT(" V notices"), 0, { .d_c = 0 }}}))); + println( str_intp(4, _MOV((StrIntpData[]){{_SLIT("summary: "), /*115 &string*/0xfe10, {.d_s = estring}}, {_SLIT(" V errors, "), /*115 &string*/0xfe10, {.d_s = wstring}}, {_SLIT(" V warnings, "), /*115 &string*/0xfe10, {.d_s = nstring}}, {_SLIT(" V notices"), 0, { .d_c = 0 }}}))); } else { - println( str_intp(4, _MOV((StrIntpData[]){{_SLIT("checker summary: "), 0xfe10, {.d_s = estring}}, {_SLIT(" V errors, "), 0xfe10, {.d_s = wstring}}, {_SLIT(" V warnings, "), 0xfe10, {.d_s = nstring}}, {_SLIT(" V notices"), 0, { .d_c = 0 }}}))); + println( str_intp(4, _MOV((StrIntpData[]){{_SLIT("checker summary: "), /*115 &string*/0xfe10, {.d_s = estring}}, {_SLIT(" V errors, "), /*115 &string*/0xfe10, {.d_s = wstring}}, {_SLIT(" V warnings, "), /*115 &string*/0xfe10, {.d_s = nstring}}, {_SLIT(" V notices"), 0, { .d_c = 0 }}}))); } } } @@ -95196,11 +95495,11 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; if (!b->pref->skip_warnings) { for (int _t3 = 0; _t3 < file->notices.len; ++_t3) { v__errors__Notice err = ((v__errors__Notice*)file->notices.data)[_t3]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" notice #"), 0xfe07, {.d_i32 = b->nr_notices}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("notice:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" notice #"), /*100 &int*/0xfe07, {.d_i32 = b->nr_notices}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("notice:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -95209,11 +95508,11 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; v__ast__File* file = ((v__ast__File**)b->parsed_files.data)[_t4]; for (int _t5 = 0; _t5 < file->errors.len; ++_t5) { v__errors__Error err = ((v__errors__Error*)file->errors.data)[_t5]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" error #"), 0xfe07, {.d_i32 = b->nr_errors}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("error:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" error #"), /*100 &int*/0xfe07, {.d_i32 = b->nr_errors}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("error:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -95222,11 +95521,11 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; if (!b->pref->skip_warnings) { for (int _t7 = 0; _t7 < file->warnings.len; ++_t7) { v__errors__Warning err = ((v__errors__Warning*)file->warnings.data)[_t7]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" warning #"), 0xfe07, {.d_i32 = b->nr_warnings}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("warning:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" warning #"), /*100 &int*/0xfe07, {.d_i32 = b->nr_warnings}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("warning:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -95240,44 +95539,44 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; VUNREACHABLE(); } if (b->pref->is_verbose && b->checker->nr_warnings > 1) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = b->checker->nr_warnings}}, {_SLIT(" warnings"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_warnings}}, {_SLIT(" warnings"), 0, { .d_c = 0 }}}))); } if (b->pref->is_verbose && b->checker->nr_notices > 1) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = b->checker->nr_notices}}, {_SLIT(" notices"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_notices}}, {_SLIT(" notices"), 0, { .d_c = 0 }}}))); } if (b->checker->nr_notices > 0 && !b->pref->skip_warnings) { for (int _t8 = 0; _t8 < b->checker->notices.len; ++_t8) { v__errors__Notice err = ((v__errors__Notice*)b->checker->notices.data)[_t8]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" notice #"), 0xfe07, {.d_i32 = b->checker->nr_notices}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("notice:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" notice #"), /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_notices}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("notice:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } if (b->checker->nr_warnings > 0 && !b->pref->skip_warnings) { for (int _t9 = 0; _t9 < b->checker->warnings.len; ++_t9) { v__errors__Warning err = ((v__errors__Warning*)b->checker->warnings.data)[_t9]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" warning #"), 0xfe07, {.d_i32 = b->checker->nr_warnings}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("warning:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" warning #"), /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_warnings}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("warning:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } if (b->pref->is_verbose && b->checker->nr_errors > 1) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = b->checker->nr_errors}}, {_SLIT(" errors"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_errors}}, {_SLIT(" errors"), 0, { .d_c = 0 }}}))); } if (b->checker->nr_errors > 0) { for (int _t10 = 0; _t10 < b->checker->errors.len; ++_t10) { v__errors__Error err = ((v__errors__Error*)b->checker->errors.data)[_t10]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" error #"), 0xfe07, {.d_i32 = b->checker->nr_errors}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("error:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" error #"), /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_errors}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("error:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } v__builder__Builder_show_total_warns_and_errors_stats(b); @@ -95294,7 +95593,7 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; v__ast__File* file = ((v__ast__File**)b->parsed_files.data)[_t12]; for (int _t13 = 0; _t13 < file->stmts.len; ++_t13) { v__ast__Stmt stmt = ((v__ast__Stmt*)file->stmts.data)[_t13]; - if ((stmt)._typ == 183 /* v.ast.FnDecl */) { + if ((stmt)._typ == 184 /* v.ast.FnDecl */) { if (string__eq((*stmt._v__ast__FnDecl).name, fn_name)) { string fheader = v__ast__FnDecl_stringify(&(*stmt._v__ast__FnDecl), b->table, _SLIT("main"), new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string)); array_push((array*)&redefines, _MOV((v__builder__FunctionRedefinition[]){ ((v__builder__FunctionRedefinition){.fpath = file->path,.fline = (*stmt._v__ast__FnDecl).pos.line_nr,.fheader = fheader,.f = (*stmt._v__ast__FnDecl),}) })); @@ -95304,7 +95603,7 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; } } if (redefines.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of function `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of function `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); for (int _t15 = 0; _t15 < redefines.len; ++_t15) { v__builder__FunctionRedefinition redefine = ((v__builder__FunctionRedefinition*)redefines.data)[_t15]; eprintln(v__util__formatted_error(_SLIT("conflicting declaration:"), redefine.fheader, redefine.fpath, redefine.f.pos)); @@ -95349,10 +95648,10 @@ Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { return (Option_void){0}; } #endif - os__Result ccompiler_version_res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(v->pref->ccompiler)}}, {_SLIT(" -v"), 0, { .d_c = 0 }}}))); + os__Result ccompiler_version_res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(v->pref->ccompiler)}}, {_SLIT(" -v"), 0, { .d_c = 0 }}}))); if (ccompiler_version_res.exit_code != 0) { if (v->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v->pref->ccompiler}}, {_SLIT(" not found, looking for msvc..."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v->pref->ccompiler}}, {_SLIT(" not found, looking for msvc..."), 0, { .d_c = 0 }}}))); } Option_v__builder__MsvcResult _t1 = v__builder__find_msvc(v->pref->m64); if (_t1.state != 0) { /*or block*/ @@ -95362,7 +95661,7 @@ Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { } string vpath = os__dir(v__pref__vexe_path()); string thirdparty_tcc = os__join_path(vpath, new_array_from_c_array(3, 3, sizeof(string), _MOV((string[3]){_SLIT("thirdparty"), _SLIT("tcc"), _SLIT("tcc.exe")}))); - os__Result tcc_version_res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(thirdparty_tcc)}}, {_SLIT(" -v"), 0, { .d_c = 0 }}}))); + os__Result tcc_version_res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(thirdparty_tcc)}}, {_SLIT(" -v"), 0, { .d_c = 0 }}}))); if (tcc_version_res.exit_code != 0) { if (v->pref->is_verbose) { println(_SLIT("tcc not found")); @@ -95398,7 +95697,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__build string tmpfile = ((string*)v->pref->cleanup_files.data)[_t1]; if (os__is_file(tmpfile)) { if (v->pref->is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> remove tmp file: "), 0xfe10, {.d_s = tmpfile}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> remove tmp file: "), /*115 &string*/0xfe10, {.d_s = tmpfile}}, {_SLIT0, 0, { .d_c = 0 }}}))); } Option_void _t2 = os__rm(tmpfile); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { @@ -95444,9 +95743,9 @@ VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__build VV_LOCAL_SYMBOL void v__builder__Builder_show_cc(v__builder__Builder* v, string cmd, string response_file, string response_file_content) { if (v->pref->is_verbose || v->pref->show_cc) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> C compiler cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> C compiler cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (v->pref->show_cc && !v->pref->no_rsp) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> C compiler response file \""), 0xfe10, {.d_s = response_file}}, {_SLIT("\":"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> C compiler response file \""), /*115 &string*/0xfe10, {.d_s = response_file}}, {_SLIT("\":"), 0, { .d_c = 0 }}}))); println(response_file_content); } } @@ -95488,7 +95787,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_ccompiler_options(v__builder__Bui ccoptions.debug_mode = v->pref->is_debug; ccoptions.guessed_compiler = v->pref->ccompiler; if (string__eq(ccoptions.guessed_compiler, _SLIT("cc")) && v->pref->is_prod) { - os__Result ccversion = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(_SLIT("cc"))}}, {_SLIT(" --version"), 0, { .d_c = 0 }}}))); + os__Result ccversion = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(_SLIT("cc"))}}, {_SLIT(" --version"), 0, { .d_c = 0 }}}))); if (ccversion.exit_code == 0) { if (string_contains(ccversion.output, _SLIT("This is free software;")) && string_contains(ccversion.output, _SLIT("Free Software Foundation, Inc."))) { ccoptions.guessed_compiler = _SLIT("gcc"); @@ -95604,7 +95903,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_ccompiler_options(v__builder__Bui array_push((array*)&ccoptions.source_args, _MOV((string[]){ string_clone(_SLIT("-x objective-c")) })); } } - array_push((array*)&ccoptions.source_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = v->out_name_c}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&ccoptions.source_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = v->out_name_c}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); if (v->pref->os == v__pref__OS__macos) { array_push((array*)&ccoptions.source_args, _MOV((string[]){ string_clone(_SLIT("-x none")) })); } @@ -95653,8 +95952,8 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_ccompiler_options(v__builder__Bui ccoptions.env_ldflags = os__getenv(_SLIT("LDFLAGS")); #if defined(CUSTOM_DEFINE_trace_ccoptions) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> setup_ccompiler_options ccompiler: "), 0xfe10, {.d_s = ccompiler}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> setup_ccompiler_options ccoptions: "), 0xfe10, {.d_s = v__builder__CcompilerOptions_str(ccoptions)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> setup_ccompiler_options ccompiler: "), /*115 &string*/0xfe10, {.d_s = ccompiler}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> setup_ccompiler_options ccoptions: "), /*115 &v.builder.CcompilerOptions*/0xfe10, {.d_s = v__builder__CcompilerOptions_str(ccoptions)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif v->ccoptions = ccoptions; @@ -95694,7 +95993,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_output_name(v__builder__Builder* if (!v->pref->is_shared && v->pref->build_mode != v__pref__BuildMode__build_module && string__eq(os__user_os(), _SLIT("windows")) && !string_ends_with(v->pref->out_name, _SLIT(".exe"))) { v->pref->out_name = /*f*/string__plus(v->pref->out_name, _SLIT(".exe")); } - v__builder__Builder_log(v, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cc() isprod="), 0xfe10, {.d_s = v->pref->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" outname="), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cc() isprod="), /*115 &bool*/0xfe10, {.d_s = v->pref->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" outname="), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (v->pref->is_shared) { if (!string_ends_with(v->pref->out_name, v->ccoptions.shared_postfix)) { v->pref->out_name = /*f*/string__plus(v->pref->out_name, v->ccoptions.shared_postfix); @@ -95703,9 +96002,9 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_output_name(v__builder__Builder* if (v->pref->build_mode == v__pref__BuildMode__build_module) { v->pref->out_name = v__vcache__CacheManager_postfix_with_key2cpath(&v->pref->cache_manager, _SLIT(".o"), v->pref->path); if (v->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Building "), 0xfe10, {.d_s = v->pref->path}}, {_SLIT(" to "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Building "), /*115 &string*/0xfe10, {.d_s = v->pref->path}}, {_SLIT(" to "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } - Option_string _t1 = v__vcache__CacheManager_save(&v->pref->cache_manager, _SLIT(".description.txt"), v->pref->path, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0x3cfe10, {.d_s = v->pref->path}}, {_SLIT(" @ "), 0xfe10, {.d_s = v->pref->cache_manager.vopts}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + Option_string _t1 = v__vcache__CacheManager_save(&v->pref->cache_manager, _SLIT(".description.txt"), v->pref->path, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x3cfe10, {.d_s = v->pref->path}}, {_SLIT(" @ "), /*115 &string*/0xfe10, {.d_s = v->pref->cache_manager.vopts}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -95716,10 +96015,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_output_name(v__builder__Builder* (*(string*)_t1.data); } if (os__is_dir(v->pref->out_name)) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("' is a directory"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("' is a directory"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } - array_push((array*)&v->ccoptions.o_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o \""), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&v->ccoptions.o_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o \""), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); } VV_LOCAL_SYMBOL void v__builder__Builder_dump_c_options(v__builder__Builder* v, Array_string all_args) { @@ -95757,7 +96056,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { return; } if (v->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("builder.cc() pref.out_name=\""), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("builder.cc() pref.out_name=\""), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } if (v->pref->only_check_syntax) { if (v->pref->is_verbose) { @@ -95794,7 +96093,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { bool ends_with_js = string_ends_with(v->pref->out_name, _SLIT(".js")); if (ends_with_c || ends_with_js) { v->pref->skip_running = true; - string msg_mv = str_intp(3, _MOV((StrIntpData[]){{_SLIT("os.mv_by_cp "), 0xfe10, {.d_s = v->out_name_c}}, {_SLIT(" => "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string msg_mv = str_intp(3, _MOV((StrIntpData[]){{_SLIT("os.mv_by_cp "), /*115 &string*/0xfe10, {.d_s = v->out_name_c}}, {_SLIT(" => "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}})); v__util__timing_start(msg_mv); Option_void _t3 = os__mv_by_cp(v->out_name_c, v->pref->out_name); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { @@ -95838,7 +96137,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { v__builder__Builder_build_thirdparty_obj_files(v); v__builder__Builder_setup_output_name(v); if (v->pref->os != v__pref__OS__windows && string_contains(ccompiler, _SLIT("++"))) { - string cpp_atomic_h_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("/woodpecker/src/git.rustybever.be/Chewing_Bever/v")}}, {_SLIT("/thirdparty/stdatomic/nix/cpp/atomic.h"), 0, { .d_c = 0 }}})); + string cpp_atomic_h_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("/woodpecker/src/git.rustybever.be/Chewing_Bever/v")}}, {_SLIT("/thirdparty/stdatomic/nix/cpp/atomic.h"), 0, { .d_c = 0 }}})); if (!os__exists(cpp_atomic_h_path)) { for (int _t4 = 0; _t4 < v->parsed_files.len; ++_t4) { v__ast__File* file = ((v__ast__File**)v->parsed_files.data)[_t4]; @@ -95855,11 +96154,11 @@ void v__builder__Builder_cc(v__builder__Builder* v) { if (_t5) { #if defined(CUSTOM_DEFINE_trace_stdatomic_gen) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> creating "), 0xfe10, {.d_s = cpp_atomic_h_path}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> creating "), /*115 &string*/0xfe10, {.d_s = cpp_atomic_h_path}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } #endif - string cppgenv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("/woodpecker/src/git.rustybever.be/Chewing_Bever/v")}}, {_SLIT("/thirdparty/stdatomic/nix/cpp/gen.v"), 0, { .d_c = 0 }}})); - os__execute( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" run "), 0xfe10, {.d_s = os__quoted_path(cppgenv)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string cppgenv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("/woodpecker/src/git.rustybever.be/Chewing_Bever/v")}}, {_SLIT("/thirdparty/stdatomic/nix/cpp/gen.v"), 0, { .d_c = 0 }}})); + os__execute( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" run "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(cppgenv)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT0, 0, { .d_c = 0 }}}))); break; } } @@ -95876,18 +96175,18 @@ void v__builder__Builder_cc(v__builder__Builder* v) { Array_string all_args = v__builder__Builder_all_args(v, v->ccoptions); v__builder__Builder_dump_c_options(v, all_args); string str_args = Array_string_join(all_args, _SLIT(" ")); - string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT(" "), 0xfe10, {.d_s = str_args}}, {_SLIT0, 0, { .d_c = 0 }}})); + string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = str_args}}, {_SLIT0, 0, { .d_c = 0 }}})); string response_file = _SLIT(""); string response_file_content = str_args; if (!v->pref->no_rsp) { - response_file = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v->out_name_c}}, {_SLIT(".rsp"), 0, { .d_c = 0 }}})); + response_file = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v->out_name_c}}, {_SLIT(".rsp"), 0, { .d_c = 0 }}})); response_file_content = string_replace(str_args, _SLIT("\\"), _SLIT("\\\\")); - string rspexpr = str_intp(2, _MOV((StrIntpData[]){{_SLIT("@"), 0xfe10, {.d_s = response_file}}, {_SLIT0, 0, { .d_c = 0 }}})); - cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(rspexpr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string rspexpr = str_intp(2, _MOV((StrIntpData[]){{_SLIT("@"), /*115 &string*/0xfe10, {.d_s = response_file}}, {_SLIT0, 0, { .d_c = 0 }}})); + cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(rspexpr)}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_void _t8 = os__write_file(response_file, response_file_content); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { IError err = _t8.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to write to C response file \""), 0xfe10, {.d_s = response_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to write to C response file \""), /*115 &string*/0xfe10, {.d_s = response_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -95904,7 +96203,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { { if (v->ccoptions.is_cc_tcc) { string def_name = string_substr(v->pref->out_name, 0, v->pref->out_name.len - 4); - array_push((array*)&v->pref->cleanup_files, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = def_name}}, {_SLIT(".def"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&v->pref->cleanup_files, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = def_name}}, {_SLIT(".def"), 0, { .d_c = 0 }}}))) })); } } #endif @@ -95916,7 +96215,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { ; array_push((array*)&tried_compilation_commands, _MOV((string[]){ string_clone(cmd) })); v__builder__Builder_show_cc(v, cmd, response_file, response_file_content); - string ccompiler_label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C "), 0x6fe30, {.d_s = os__file_name(ccompiler)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string ccompiler_label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C "), /*115 &string*/0x6fe30, {.d_s = os__file_name(ccompiler)}}, {_SLIT0, 0, { .d_c = 0 }}})); v__util__timing_start(ccompiler_label); os__Result res = os__execute(cmd); v__util__timing_measure(ccompiler_label); @@ -95935,10 +96234,10 @@ void v__builder__Builder_cc(v__builder__Builder* v) { if (res.exit_code != 0) { if (string_contains(ccompiler, _SLIT("tcc.exe"))) { if (tried_compilation_commands.len > 1) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Recompilation loop detected (ccompiler: "), 0xfe10, {.d_s = ccompiler}}, {_SLIT("):"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Recompilation loop detected (ccompiler: "), /*115 &string*/0xfe10, {.d_s = ccompiler}}, {_SLIT("):"), 0, { .d_c = 0 }}}))); for (int _t15 = 0; _t15 < tried_compilation_commands.len; ++_t15) { string recompile_command = ((string*)tried_compilation_commands.data)[_t15]; - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = recompile_command}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = recompile_command}}, {_SLIT0, 0, { .d_c = 0 }}}))); } _v_exit(101); VUNREACHABLE(); @@ -95947,13 +96246,13 @@ void v__builder__Builder_cc(v__builder__Builder* v) { tcc_output = res; v__pref__Preferences_default_c_compiler(v->pref); if (v->pref->is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Compilation with tcc failed. Retrying with "), 0xfe10, {.d_s = v->pref->ccompiler}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Compilation with tcc failed. Retrying with "), /*115 &string*/0xfe10, {.d_s = v->pref->ccompiler}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } continue; } } if (res.exit_code == 127) { - v__builder__verror(string__plus(string__plus(string__plus(string__plus(string__plus(_SLIT("C compiler error, while attempting to run: \n-----------------------------------------------------------\n"), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cmd}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), _SLIT("-----------------------------------------------------------\n")), _SLIT("Probably your C compiler is missing. \n")), _SLIT("Please reinstall it, or make it available in your PATH.\n\n")), v__builder__missing_compiler_info())); + v__builder__verror(string__plus(string__plus(string__plus(string__plus(string__plus(_SLIT("C compiler error, while attempting to run: \n-----------------------------------------------------------\n"), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), _SLIT("-----------------------------------------------------------\n")), _SLIT("Probably your C compiler is missing. \n")), _SLIT("Please reinstall it, or make it available in your PATH.\n\n")), v__builder__missing_compiler_info())); VUNREACHABLE(); } } @@ -95965,7 +96264,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { } } if (v->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ccompiler}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ccompiler}}, {_SLIT0, 0, { .d_c = 0 }}}))); println(_SLIT("=========\n")); } break; @@ -95977,14 +96276,14 @@ void v__builder__Builder_cc(v__builder__Builder* v) { return; } #endif - int ret = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strip "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + int ret = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strip "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (ret != 0) { println(_SLIT("strip failed")); return; } - int ret2 = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("upx --lzma -qqq "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + int ret2 = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("upx --lzma -qqq "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (ret2 != 0) { - ret2 = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("upx -qqq "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + ret2 = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("upx -qqq "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (ret2 != 0) { println(_SLIT("upx failed")); @@ -96015,9 +96314,9 @@ VV_LOCAL_SYMBOL void v__builder__Builder_ensure_linuxroot_exists(v__builder__Bui } if (!os__is_dir(sysroot)) { println(_SLIT("Downloading files for Linux cross compilation (~22MB) ...")); - os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT("git clone "), 0xfe10, {.d_s = crossrepo_url}}, {_SLIT(" "), 0xfe10, {.d_s = sysroot}}, {_SLIT0, 0, { .d_c = 0 }}}))); + os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT("git clone "), /*115 &string*/0xfe10, {.d_s = crossrepo_url}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (!os__exists(sysroot_git_config_path)) { - v__builder__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Failed to clone `"), 0xfe10, {.d_s = crossrepo_url}}, {_SLIT("` to `"), 0xfe10, {.d_s = sysroot}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Failed to clone `"), /*115 &string*/0xfe10, {.d_s = crossrepo_url}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } Option_void _t2 = os__chmod(os__join_path(sysroot, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("ld.lld")}))), 0755); @@ -96062,13 +96361,13 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-c")) })); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-target x86_64-linux-gnu")) })); _PUSH_MANY(&cc_args, (defines), _t6, Array_string); - array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I "), 0xfe10, {.d_s = sysroot}}, {_SLIT("/include "), 0, { .d_c = 0 }}}))) })); + array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I "), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/include "), 0, { .d_c = 0 }}}))) })); _PUSH_MANY(&cc_args, (others), _t8, Array_string); - array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o \""), 0xfe10, {.d_s = obj_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-c \""), 0xfe10, {.d_s = b->out_name_c}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o \""), /*115 &string*/0xfe10, {.d_s = obj_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-c \""), /*115 &string*/0xfe10, {.d_s = b->out_name_c}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); _PUSH_MANY(&cc_args, (libs), _t11, Array_string); v__builder__Builder_dump_c_options(b, cc_args); - string cc_cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(_SLIT("cc"))}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(cc_args, _SLIT(" "))); + string cc_cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(_SLIT("cc"))}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(cc_args, _SLIT(" "))); if (b->pref->show_cc) { println(cc_cmd); } @@ -96080,12 +96379,12 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) return; } Array_string linker_args = new_array_from_c_array(14, 14, sizeof(string), _MOV((string[14]){ - str_intp(2, _MOV((StrIntpData[]){{_SLIT("-L"), 0xfe10, {.d_s = sysroot}}, {_SLIT("/usr/lib/x86_64-linux-gnu/"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("-L"), 0xfe10, {.d_s = sysroot}}, {_SLIT("/lib/x86_64-linux-gnu"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("--sysroot="), 0xfe10, {.d_s = sysroot}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-v"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), 0xfe10, {.d_s = b->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-m elf_x86_64"), _SLIT("-dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2"), str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sysroot}}, {_SLIT("/crt1.o "), 0xfe10, {.d_s = sysroot}}, {_SLIT("/crti.o "), 0xfe10, {.d_s = obj_file}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-lc"), - _SLIT("-lcrypto"), _SLIT("-lssl"), _SLIT("-lpthread"), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sysroot}}, {_SLIT("/crtn.o"), 0, { .d_c = 0 }}})), _SLIT("-lm")})); + str_intp(2, _MOV((StrIntpData[]){{_SLIT("-L"), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/usr/lib/x86_64-linux-gnu/"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("-L"), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/lib/x86_64-linux-gnu"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("--sysroot="), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-v"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), /*115 &string*/0xfe10, {.d_s = b->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-m elf_x86_64"), _SLIT("-dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2"), str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/crt1.o "), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/crti.o "), /*115 &string*/0xfe10, {.d_s = obj_file}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-lc"), + _SLIT("-lcrypto"), _SLIT("-lssl"), _SLIT("-lpthread"), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/crtn.o"), 0, { .d_c = 0 }}})), _SLIT("-lm")})); _PUSH_MANY(&linker_args, (Array_v__cflag__CFlag_c_options_only_object_files(cflags)), _t12, Array_string); v__builder__Builder_dump_c_options(b, linker_args); - string ldlld = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sysroot}}, {_SLIT("/ld.lld"), 0, { .d_c = 0 }}})); - string linker_cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(ldlld)}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(linker_args, _SLIT(" "))); + string ldlld = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/ld.lld"), 0, { .d_c = 0 }}})); + string linker_cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(ldlld)}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(linker_args, _SLIT(" "))); if (b->pref->show_cc) { println(linker_cmd); } @@ -96109,8 +96408,8 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_windows_cross(v__builder__Builder* c } c->pref->out_name = os__quoted_path(c->pref->out_name); Array_string args = __new_array_with_default(0, 0, sizeof(string), 0); - array_push((array*)&args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = c->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), 0xfe10, {.d_s = c->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = c->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), /*115 &string*/0xfe10, {.d_s = c->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); array_push((array*)&args, _MOV((string[]){ string_clone(_SLIT("-w -L.")) })); Array_v__cflag__CFlag cflags = v__builder__Builder_get_os_cflags(c); if (string__eq(c->pref->ccompiler, _SLIT("msvc"))) { @@ -96132,15 +96431,15 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_windows_cross(v__builder__Builder* c } Array_string libs = __new_array_with_default(0, 0, sizeof(string), 0); if (false && c->pref->build_mode == v__pref__BuildMode__default_mode) { - string builtin_o = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = _const_v__pref__default_module_path}}, {_SLIT("/vlib/builtin.o\""), 0, { .d_c = 0 }}})); + string builtin_o = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = _const_v__pref__default_module_path}}, {_SLIT("/vlib/builtin.o\""), 0, { .d_c = 0 }}})); array_push((array*)&libs, _MOV((string[]){ string_clone(builtin_o) })); if (!os__exists(builtin_o)) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = builtin_o}}, {_SLIT(" not found"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = builtin_o}}, {_SLIT(" not found"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } for (int _t7 = 0; _t7 < c->table->imports.len; ++_t7) { string imp = ((string*)c->table->imports.data)[_t7]; - array_push((array*)&libs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = _const_v__pref__default_module_path}}, {_SLIT("/vlib/"), 0xfe10, {.d_s = imp}}, {_SLIT(".o\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&libs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = _const_v__pref__default_module_path}}, {_SLIT("/vlib/"), /*115 &string*/0xfe10, {.d_s = imp}}, {_SLIT(".o\""), 0, { .d_c = 0 }}}))) })); } } _PUSH_MANY(&args, (Array_v__cflag__CFlag_c_options_only_object_files(cflags)), _t9, Array_string); @@ -96185,7 +96484,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_windows_cross(v__builder__Builder* c } VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_files(v__builder__Builder* b) { - v__builder__Builder_log(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("build_thirdparty_obj_files: v.ast.cflags: "), 0xfe10, {.d_s = Array_v__cflag__CFlag_str(b->table->cflags)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__Builder_log(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("build_thirdparty_obj_files: v.ast.cflags: "), /*115 &[]v.cflag.CFlag*/0xfe10, {.d_s = Array_v__cflag__CFlag_str(b->table->cflags)}}, {_SLIT0, 0, { .d_c = 0 }}}))); Array_v__cflag__CFlag _t1 = v__builder__Builder_get_os_cflags(b); for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__cflag__CFlag flag = ((v__cflag__CFlag*)_t1.data)[_t2]; @@ -96202,12 +96501,12 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_files(v__builder__ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__Builder* v, string path, Array_v__cflag__CFlag moduleflags) { string obj_path = os__real_path(path); - string cfile = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = string_substr(obj_path, 0, obj_path.len - 2)}}, {_SLIT(".c"), 0, { .d_c = 0 }}})); + string cfile = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(obj_path, 0, obj_path.len - 2)}}, {_SLIT(".c"), 0, { .d_c = 0 }}})); string opath = v__vcache__CacheManager_postfix_with_key2cpath(&v->pref->cache_manager, _SLIT(".o"), obj_path); - string rebuild_reason_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = obj_path}}, {_SLIT(" not found, building it in "), 0xfe10, {.d_s = opath}}, {_SLIT(" ..."), 0, { .d_c = 0 }}})); + string rebuild_reason_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = obj_path}}, {_SLIT(" not found, building it in "), /*115 &string*/0xfe10, {.d_s = opath}}, {_SLIT(" ..."), 0, { .d_c = 0 }}})); if (os__exists(opath)) { if (os__exists(cfile) && os__file_last_mod_unix(opath) < os__file_last_mod_unix(cfile)) { - rebuild_reason_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opath}}, {_SLIT(" is older than "), 0xfe10, {.d_s = cfile}}, {_SLIT(", rebuilding ..."), 0, { .d_c = 0 }}})); + rebuild_reason_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opath}}, {_SLIT(" is older than "), /*115 &string*/0xfe10, {.d_s = cfile}}, {_SLIT(", rebuilding ..."), 0, { .d_c = 0 }}})); } else { return; } @@ -96237,13 +96536,13 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B Array_string all_options = __new_array_with_default(0, 0, sizeof(string), 0); array_push((array*)&all_options, _MOV((string[]){ string_clone(v->pref->third_party_option) })); _PUSH_MANY(&all_options, (Array_v__cflag__CFlag_c_options_before_target(moduleflags)), _t4, Array_string); - array_push((array*)&all_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), 0xfe10, {.d_s = os__quoted_path(opath)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-c "), 0xfe10, {.d_s = os__quoted_path(cfile)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(opath)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-c "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(cfile)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); string cc_options = Array_string_join(v__builder__Builder_thirdparty_object_args(v, v->ccoptions, all_options), _SLIT(" ")); - string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(v->pref->ccompiler)}}, {_SLIT(" "), 0xfe10, {.d_s = cc_options}}, {_SLIT0, 0, { .d_c = 0 }}})); + string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(v->pref->ccompiler)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cc_options}}, {_SLIT0, 0, { .d_c = 0 }}})); #if defined(CUSTOM_DEFINE_trace_thirdparty_obj_files) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> build_thirdparty_obj_files cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> build_thirdparty_obj_files cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif os__Result res = os__execute(cmd); @@ -96254,12 +96553,12 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B ; if (res.exit_code != 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed thirdparty object build cmd:\n"), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed thirdparty object build cmd:\n"), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__builder__verror(res.output); VUNREACHABLE(); return; } - Option_string _t8 = v__vcache__CacheManager_save(&v->pref->cache_manager, _SLIT(".description.txt"), obj_path, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0x3cfe10, {.d_s = obj_path}}, {_SLIT(" @ "), 0xfe10, {.d_s = cmd}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + Option_string _t8 = v__vcache__CacheManager_save(&v->pref->cache_manager, _SLIT(".description.txt"), obj_path, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x3cfe10, {.d_s = obj_path}}, {_SLIT(" @ "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; _v_panic(IError_str(err)); @@ -96392,7 +96691,7 @@ void v__builder__compile(string command, v__pref__Preferences* pref, void (*back v__util__Timers_show_remaining(timers); if (pref->is_stats) { i64 compilation_time_micros = 1 + time__Duration_microseconds(time__StopWatch_elapsed(sw)); - string scompilation_time_ms = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xc062d, {.d_f64 = ((f64)(compilation_time_micros)) / 1000.0}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string scompilation_time_ms = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*102 &f64*/0xc062d, {.d_f64 = ((f64)(compilation_time_micros)) / 1000.0}}, {_SLIT0, 0, { .d_c = 0 }}}))); int all_v_source_lines = 0; int all_v_source_bytes = 0; for (int _t2 = 0; _t2 < b.parsed_files.len; ++_t2) { @@ -96402,17 +96701,17 @@ void v__builder__compile(string command, v__pref__Preferences* pref, void (*back } string sall_v_source_lines = int_str(all_v_source_lines); string sall_v_source_bytes = int_str(all_v_source_bytes); - sall_v_source_lines = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x14fe30, {.d_s = sall_v_source_lines}}, {_SLIT0, 0, { .d_c = 0 }}}))); - sall_v_source_bytes = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x14fe30, {.d_s = sall_v_source_bytes}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" V source code size: "), 0xfe10, {.d_s = sall_v_source_lines}}, {_SLIT(" lines, "), 0xfe10, {.d_s = sall_v_source_bytes}}, {_SLIT(" bytes"), 0, { .d_c = 0 }}}))); + sall_v_source_lines = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x14fe30, {.d_s = sall_v_source_lines}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sall_v_source_bytes = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x14fe30, {.d_s = sall_v_source_bytes}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" V source code size: "), /*115 &string*/0xfe10, {.d_s = sall_v_source_lines}}, {_SLIT(" lines, "), /*115 &string*/0xfe10, {.d_s = sall_v_source_bytes}}, {_SLIT(" bytes"), 0, { .d_c = 0 }}}))); string slines = int_str(b.stats_lines); string sbytes = int_str(b.stats_bytes); - slines = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x14fe30, {.d_s = slines}}, {_SLIT0, 0, { .d_c = 0 }}}))); - sbytes = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x14fe30, {.d_s = sbytes}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("generated target code size: "), 0xfe10, {.d_s = slines}}, {_SLIT(" lines, "), 0xfe10, {.d_s = sbytes}}, {_SLIT(" bytes"), 0, { .d_c = 0 }}}))); + slines = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x14fe30, {.d_s = slines}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sbytes = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x14fe30, {.d_s = sbytes}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("generated target code size: "), /*115 &string*/0xfe10, {.d_s = slines}}, {_SLIT(" lines, "), /*115 &string*/0xfe10, {.d_s = sbytes}}, {_SLIT(" bytes"), 0, { .d_c = 0 }}}))); int vlines_per_second = ((int)(1000000.0 * ((f64)(all_v_source_lines)) / ((f64)(compilation_time_micros)))); string svlines_per_second = v__util__bold(int_str(vlines_per_second)); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("compilation took: "), 0xfe10, {.d_s = scompilation_time_ms}}, {_SLIT(" ms, compilation speed: "), 0xfe10, {.d_s = svlines_per_second}}, {_SLIT(" vlines/s"), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("compilation took: "), /*115 &string*/0xfe10, {.d_s = scompilation_time_ms}}, {_SLIT(" ms, compilation speed: "), /*115 &string*/0xfe10, {.d_s = svlines_per_second}}, {_SLIT(" vlines/s"), 0, { .d_c = 0 }}}))); } v__builder__Builder_exit_on_invalid_syntax(&b); v__builder__Builder_myfree(&b); @@ -96425,9 +96724,9 @@ string v__builder__Builder_get_vtmp_filename(v__builder__Builder* b, string base string vtmp = v__util__get_vtmp_folder(); string uniq = _SLIT(""); if (!b->pref->reuse_tmpc) { - uniq = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe08, {.d_u64 = rand__u64()}}, {_SLIT0, 0, { .d_c = 0 }}})); + uniq = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*117 &u64*/0xfe08, {.d_u64 = rand__u64()}}, {_SLIT0, 0, { .d_c = 0 }}})); } - string fname = string__plus(os__file_name(os__real_path(base_file_name)), str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = uniq}}, {_SLIT0, 0xfe10, {.d_s = postfix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string fname = string__plus(os__file_name(os__real_path(base_file_name)), str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = uniq}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = postfix}}, {_SLIT0, 0, { .d_c = 0 }}}))); string _t1 = os__real_path(os__join_path(vtmp, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){fname})))); return _t1; } @@ -96505,7 +96804,7 @@ Option_string _t2 = os__find_abs_path_of_executable(node_basename); os__Process* run_process = os__new_process(run_file); os__Process_set_args(run_process, run_args); if (b->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("running "), 0xfe10, {.d_s = run_process->filename}}, {_SLIT(" with arguments "), 0xfe10, {.d_s = Array_string_str(run_process->args)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("running "), /*115 &string*/0xfe10, {.d_s = run_process->filename}}, {_SLIT(" with arguments "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(run_process->args)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } Option_os__SignalHandler _t5 = os__signal_opt(os__Signal__int, (voidptr)v__builder__eshcb); if (_t5.state != 0) { /*or block*/ @@ -96568,7 +96867,7 @@ VV_LOCAL_SYMBOL void v__builder__eshcb(os__Signal _d1) { // Attr: [noreturn] VNORETURN VV_LOCAL_SYMBOL void v__builder__serror(string reason, IError e) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not "), 0xfe10, {.d_s = reason}}, {_SLIT(" handler"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not "), /*115 &string*/0xfe10, {.d_s = reason}}, {_SLIT(" handler"), 0, { .d_c = 0 }}}))); _v_panic(IError_str(e)); VUNREACHABLE(); while(1); @@ -96576,10 +96875,10 @@ VNORETURN VV_LOCAL_SYMBOL void v__builder__serror(string reason, IError e) { VV_LOCAL_SYMBOL void v__builder__Builder_cleanup_run_executable_after_exit(v__builder__Builder* v, string exefile) { if (v->pref->reuse_tmpc) { - v__pref__Preferences_vrun_elog(v->pref, str_intp(2, _MOV((StrIntpData[]){{_SLIT("keeping executable: "), 0xfe10, {.d_s = exefile}}, {_SLIT(" , because -keepc was passed"), 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(v->pref, str_intp(2, _MOV((StrIntpData[]){{_SLIT("keeping executable: "), /*115 &string*/0xfe10, {.d_s = exefile}}, {_SLIT(" , because -keepc was passed"), 0, { .d_c = 0 }}}))); return; } - v__pref__Preferences_vrun_elog(v->pref, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove run executable: "), 0xfe10, {.d_s = exefile}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(v->pref, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove run executable: "), /*115 &string*/0xfe10, {.d_s = exefile}}, {_SLIT0, 0, { .d_c = 0 }}}))); Option_void _t1 = os__rm(exefile); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; @@ -96596,7 +96895,7 @@ void v__builder__Builder_set_module_lookup_paths(v__builder__Builder* v) { array_push((array*)&v->module_search_paths, _MOV((string[]){ string_clone(v->compiled_dir) })); string x = os__join_path(v->compiled_dir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("modules")}))); if (v->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("x: \""), 0xfe10, {.d_s = x}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("x: \""), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } array_push((array*)&v->module_search_paths, _MOV((string[]){ string_clone(os__join_path(v->compiled_dir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("modules")})))) })); _PUSH_MANY(&v->module_search_paths, (v->pref->lookup_path), _t4, Array_string); @@ -96612,7 +96911,7 @@ Array_string v__builder__Builder_get_builtin_files(v__builder__Builder* v) { Array_string _t1 = __new_array_with_default(0, 0, sizeof(string), 0); return _t1; } - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("v.pref.lookup_path: "), 0xfe10, {.d_s = Array_string_str(v->pref->lookup_path)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("v.pref.lookup_path: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v->pref->lookup_path)}}, {_SLIT0, 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < v->pref->lookup_path.len; ++_t2) { string location = ((string*)v->pref->lookup_path.data)[_t2]; if (os__exists(os__join_path(location, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("builtin")}))))) { @@ -96646,7 +96945,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { return _t1; } string dir = v->pref->path; - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("get_v_files("), 0xfe10, {.d_s = dir}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("get_v_files("), /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); Array_string user_files = __new_array_with_default(0, 0, sizeof(string), 0); string vroot = os__dir(v__pref__vexe_path()); string preludes_path = os__join_path(vroot, new_array_from_c_array(3, 3, sizeof(string), _MOV((string[3]){_SLIT("vlib"), _SLIT("v"), _SLIT("preludes")}))); @@ -96672,10 +96971,10 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { v_test_runner_prelude = _SLIT("normal"); } if (!string_contains(v_test_runner_prelude, _SLIT("/")) && !string_contains(v_test_runner_prelude, _SLIT("\\")) && !string_ends_with(v_test_runner_prelude, _SLIT(".v"))) { - v_test_runner_prelude = os__join_path(preludes_path, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("test_runner_"), 0xfe10, {.d_s = v_test_runner_prelude}}, {_SLIT(".v"), 0, { .d_c = 0 }}}))}))); + v_test_runner_prelude = os__join_path(preludes_path, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("test_runner_"), /*115 &string*/0xfe10, {.d_s = v_test_runner_prelude}}, {_SLIT(".v"), 0, { .d_c = 0 }}}))}))); } if (!os__is_file(v_test_runner_prelude) || !os__is_readable(v_test_runner_prelude)) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("test runner error: File "), 0xfe10, {.d_s = v_test_runner_prelude}}, {_SLIT(" should be readable."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("test runner error: File "), /*115 &string*/0xfe10, {.d_s = v_test_runner_prelude}}, {_SLIT(" should be readable."), 0, { .d_c = 0 }}}))); v__builder__verror(_SLIT("supported test runners are: tap, json, simple, normal")); VUNREACHABLE(); } @@ -96696,7 +96995,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { Option_string _t10 = v__util__read_file(dir); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -96720,7 +97019,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { if (is_internal_module_test) { string single_test_v_file = os__real_path(dir); if (v->pref->is_verbose) { - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Compiling an internal module _test.v file "), 0xfe10, {.d_s = single_test_v_file}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Compiling an internal module _test.v file "), /*115 &string*/0xfe10, {.d_s = single_test_v_file}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); v__builder__Builder_log(v, _SLIT("> That brings in all other ordinary .v files in the same module too .")); } array_push((array*)&user_files, _MOV((string[]){ string_clone(single_test_v_file) })); @@ -96728,7 +97027,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { } bool does_exist = os__exists(dir); if (!does_exist) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT(" doesn't exist"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" doesn't exist"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } bool is_real_file = does_exist && !os__is_dir(dir); @@ -96737,17 +97036,17 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { string single_v_file = (string_ends_with(resolved_link, _SLIT(".vsh")) ? (resolved_link) : (dir)); array_push((array*)&user_files, _MOV((string[]){ string_clone(single_v_file) })); if (v->pref->is_verbose) { - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> just compile one file: \""), 0xfe10, {.d_s = single_v_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> just compile one file: \""), /*115 &string*/0xfe10, {.d_s = single_v_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } } else if (os__is_dir(dir)) { if (v->pref->is_verbose) { - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> add all .v files from directory \""), 0xfe10, {.d_s = dir}}, {_SLIT("\" ..."), 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> add all .v files from directory \""), /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT("\" ..."), 0, { .d_c = 0 }}}))); } _PUSH_MANY(&user_files, (v__builder__Builder_v_files_from_dir(v, dir)), _t14, Array_string); } else { println(_SLIT("usage: `v file.v` or `v directory`")); string ext = os__file_ext(dir); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown file extension `"), 0xfe10, {.d_s = ext}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown file extension `"), /*115 &string*/0xfe10, {.d_s = ext}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -96757,7 +97056,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { VUNREACHABLE(); } if (v->pref->is_verbose) { - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("user_files: "), 0xfe10, {.d_s = Array_string_str(user_files)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("user_files: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(user_files)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } Array_string _t15 = user_files; return _t15; @@ -96879,10 +97178,10 @@ VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__new_windows_kit(string highest_path = f; } } - string kit_lib_highest = string__plus(kit_lib, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\"), 0xfe10, {.d_s = highest_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string kit_lib_highest = string__plus(kit_lib, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\"), /*115 &string*/0xfe10, {.d_s = highest_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); string kit_include_highest = string_replace(kit_lib_highest, _SLIT("Lib"), _SLIT("Include")); Option_v__builder__WindowsKit _t4; - opt_ok(&(v__builder__WindowsKit[]) { ((v__builder__WindowsKit){.um_lib_path = string__plus(kit_lib_highest, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\um\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))),.ucrt_lib_path = string__plus(kit_lib_highest, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\ucrt\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))),.um_include_path = string__plus(kit_include_highest, _SLIT("\\um")),.ucrt_include_path = string__plus(kit_include_highest, _SLIT("\\ucrt")),.shared_include_path = string__plus(kit_include_highest, _SLIT("\\shared")),}) }, (Option*)(&_t4), sizeof(v__builder__WindowsKit)); + opt_ok(&(v__builder__WindowsKit[]) { ((v__builder__WindowsKit){.um_lib_path = string__plus(kit_lib_highest, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\um\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))),.ucrt_lib_path = string__plus(kit_lib_highest, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\ucrt\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))),.um_include_path = string__plus(kit_include_highest, _SLIT("\\um")),.ucrt_include_path = string__plus(kit_include_highest, _SLIT("\\ucrt")),.shared_include_path = string__plus(kit_include_highest, _SLIT("\\shared")),}) }, (Option*)(&_t4), sizeof(v__builder__WindowsKit)); return _t4; } @@ -96927,12 +97226,12 @@ VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs(string vsw VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(string vswhere_dir, string host_arch, string target_arch) { #if defined(_WIN32) { - os__Result res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = vswhere_dir}}, {_SLIT("\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath"), 0, { .d_c = 0 }}}))); + os__Result res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = vswhere_dir}}, {_SLIT("\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath"), 0, { .d_c = 0 }}}))); if (res.exit_code != 0) { return (Option_v__builder__VsInstallation){ .state=2, .err=error_with_code(res.output, res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; } string res_output = string_trim_space(res.output); - Option_string _t2 = os__read_file( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.txt"), 0, { .d_c = 0 }}}))); + Option_string _t2 = os__read_file( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.txt"), 0, { .d_c = 0 }}}))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Unable to find vs installation")), .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -96940,15 +97239,15 @@ VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(str string version = (*(string*)_t2.data); string v = string_trim_space(version); - string lib_path = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), 0xfe10, {.d_s = v}}, {_SLIT("\\lib\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); - string include_path = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), 0xfe10, {.d_s = v}}, {_SLIT("\\include"), 0, { .d_c = 0 }}})); - if (os__exists( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = lib_path}}, {_SLIT("\\vcruntime.lib"), 0, { .d_c = 0 }}})))) { - string p = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), 0xfe10, {.d_s = v}}, {_SLIT("\\bin\\Host"), 0xfe10, {.d_s = host_arch}}, {_SLIT("\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string lib_path = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("\\lib\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string include_path = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("\\include"), 0, { .d_c = 0 }}})); + if (os__exists( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = lib_path}}, {_SLIT("\\vcruntime.lib"), 0, { .d_c = 0 }}})))) { + string p = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("\\bin\\Host"), /*115 &string*/0xfe10, {.d_s = host_arch}}, {_SLIT("\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_v__builder__VsInstallation _t4; opt_ok(&(v__builder__VsInstallation[]) { ((v__builder__VsInstallation){.include_path = include_path,.lib_path = lib_path,.exe_path = p,}) }, (Option*)(&_t4), sizeof(v__builder__VsInstallation)); return _t4; } - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to find vs installation (attempted to use lib path \""), 0xfe10, {.d_s = lib_path}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to find vs installation (attempted to use lib path \""), /*115 &string*/0xfe10, {.d_s = lib_path}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Unable to find vs exe folder")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #else @@ -96968,9 +97267,9 @@ VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_env(str if ((vc_tools_dir).len == 0) { return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("empty VCToolsInstallDir")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - string bin_dir = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("bin\\Host"), 0xfe10, {.d_s = host_arch}}, {_SLIT("\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); - string lib_path = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("lib\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); - string include_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("include"), 0, { .d_c = 0 }}})); + string bin_dir = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("bin\\Host"), /*115 &string*/0xfe10, {.d_s = host_arch}}, {_SLIT("\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string lib_path = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("lib\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string include_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("include"), 0, { .d_c = 0 }}})); Option_v__builder__VsInstallation _t3; opt_ok(&(v__builder__VsInstallation[]) { ((v__builder__VsInstallation){.include_path = include_path,.lib_path = lib_path,.exe_path = bin_dir,}) }, (Option*)(&_t3), sizeof(v__builder__VsInstallation)); return _t3; @@ -97033,18 +97332,18 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { string out_name_cmd_line = os__real_path(string__plus(v->out_name_c, _SLIT(".rsp"))); Array_string a = __new_array_with_default(0, 0, sizeof(string), 0); string env_cflags = os__getenv(_SLIT("CFLAGS")); - string all_cflags = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = env_cflags}}, {_SLIT(" "), 0xfe10, {.d_s = v->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}})); + string all_cflags = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = env_cflags}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!string__eq(all_cflags, _SLIT(" "))) { array_push((array*)&a, _MOV((string[]){ string_clone(all_cflags) })); } - _PUSH_MANY(&a, (new_array_from_c_array(5, 5, sizeof(string), _MOV((string[5]){_SLIT("-w"), _SLIT("/we4013"), _SLIT("/volatile:ms"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("/Fo\""), 0xfe10, {.d_s = out_name_obj}}, {_SLIT("\""), 0, { .d_c = 0 }}})), _SLIT("/F 16777216")}))), _t2, Array_string); + _PUSH_MANY(&a, (new_array_from_c_array(5, 5, sizeof(string), _MOV((string[5]){_SLIT("-w"), _SLIT("/we4013"), _SLIT("/volatile:ms"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("/Fo\""), /*115 &string*/0xfe10, {.d_s = out_name_obj}}, {_SLIT("\""), 0, { .d_c = 0 }}})), _SLIT("/F 16777216")}))), _t2, Array_string); if (v->pref->is_prod) { array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/O2")) })); } if (v->pref->is_debug) { array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/MDd")) })); array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/D_DEBUG")) })); - _PUSH_MANY(&a, (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("/Zi"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("/Fd\""), 0xfe10, {.d_s = out_name_pdb}}, {_SLIT("\""), 0, { .d_c = 0 }}}))}))), _t6, Array_string); + _PUSH_MANY(&a, (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("/Zi"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("/Fd\""), /*115 &string*/0xfe10, {.d_s = out_name_pdb}}, {_SLIT("\""), 0, { .d_c = 0 }}}))}))), _t6, Array_string); } else { array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/MD")) })); array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/DNDEBUG")) })); @@ -97073,20 +97372,20 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { Array_string lib_paths = sflags.lib_paths; Array_string defines = sflags.defines; Array_string other_flags = sflags.other_flags; - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = r.ucrt_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = r.vs_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = r.um_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = r.shared_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = r.ucrt_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = r.vs_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = r.um_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = r.shared_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); _PUSH_MANY(&a, (defines), _t17, Array_string); _PUSH_MANY(&a, (inc_paths), _t18, Array_string); _PUSH_MANY(&a, (other_flags), _t19, Array_string); array_push((array*)&a, _MOV((string[]){ string_clone(Array_string_join(real_libs, _SLIT(" "))) })); array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/link")) })); array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/NOLOGO")) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/OUT:\""), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), 0xfe10, {.d_s = r.ucrt_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), 0xfe10, {.d_s = r.um_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), 0xfe10, {.d_s = r.vs_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/OUT:\""), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), /*115 &string*/0xfe10, {.d_s = r.ucrt_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), /*115 &string*/0xfe10, {.d_s = r.um_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), /*115 &string*/0xfe10, {.d_s = r.vs_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); if (!string_contains(all_cflags, _SLIT("/DEBUG"))) { array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/DEBUG:FULL")) })); } @@ -97104,16 +97403,16 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { Option_void _t33 = os__write_file(out_name_cmd_line, args); if (_t33.state != 0 && _t33.err._typ != _IError_None___index) { IError err = _t33.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to write response file to \""), 0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to write response file to \""), /*115 &string*/0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } ; - string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = r.full_cl_exe_path}}, {_SLIT("\" \"@"), 0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}})); + string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = r.full_cl_exe_path}}, {_SLIT("\" \"@"), /*115 &string*/0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}})); v__builder__Builder_show_cc(v, cmd, out_name_cmd_line, args); if (!string__eq(os__user_os(), _SLIT("windows")) && !string_ends_with(v->pref->out_name, _SLIT(".c"))) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Cannot build with msvc on "), 0xfe10, {.d_s = os__user_os()}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Cannot build with msvc on "), /*115 &string*/0xfe10, {.d_s = os__user_os()}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__util__timing_start(_SLIT("C msvc")); @@ -97144,20 +97443,20 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file_with_msvc(v__ VUNREACHABLE(); } string path_without_o_postfix = string_substr(path, 0, path.len - 2); - string obj_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path_without_o_postfix}}, {_SLIT(".obj"), 0, { .d_c = 0 }}})); + string obj_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path_without_o_postfix}}, {_SLIT(".obj"), 0, { .d_c = 0 }}})); obj_path = os__real_path(obj_path); if (os__exists(obj_path)) { return; } - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = obj_path}}, {_SLIT(" not found, building it (with msvc)..."), 0, { .d_c = 0 }}}))); - string cfile = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path_without_o_postfix}}, {_SLIT(".c"), 0, { .d_c = 0 }}})); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = obj_path}}, {_SLIT(" not found, building it (with msvc)..."), 0, { .d_c = 0 }}}))); + string cfile = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path_without_o_postfix}}, {_SLIT(".c"), 0, { .d_c = 0 }}})); v__builder__MsvcStringFlags flags = v__builder__msvc_string_flags(moduleflags); string inc_dirs = Array_string_join(flags.inc_paths, _SLIT(" ")); string defines = Array_string_join(flags.defines, _SLIT(" ")); - string include_string = str_intp(6, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = msvc.ucrt_include_path}}, {_SLIT("\" -I \""), 0xfe10, {.d_s = msvc.vs_include_path}}, {_SLIT("\" -I \""), 0xfe10, {.d_s = msvc.um_include_path}}, {_SLIT("\" -I \""), 0xfe10, {.d_s = msvc.shared_include_path}}, {_SLIT("\" "), 0xfe10, {.d_s = inc_dirs}}, {_SLIT0, 0, { .d_c = 0 }}})); + string include_string = str_intp(6, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = msvc.ucrt_include_path}}, {_SLIT("\" -I \""), /*115 &string*/0xfe10, {.d_s = msvc.vs_include_path}}, {_SLIT("\" -I \""), /*115 &string*/0xfe10, {.d_s = msvc.um_include_path}}, {_SLIT("\" -I \""), /*115 &string*/0xfe10, {.d_s = msvc.shared_include_path}}, {_SLIT("\" "), /*115 &string*/0xfe10, {.d_s = inc_dirs}}, {_SLIT0, 0, { .d_c = 0 }}})); Array_string oargs = __new_array_with_default(0, 0, sizeof(string), 0); string env_cflags = os__getenv(_SLIT("CFLAGS")); - string all_cflags = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = env_cflags}}, {_SLIT(" "), 0xfe10, {.d_s = v->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}})); + string all_cflags = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = env_cflags}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!string__eq(all_cflags, _SLIT(" "))) { array_push((array*)&oargs, _MOV((string[]){ string_clone(all_cflags) })); } @@ -97174,15 +97473,15 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file_with_msvc(v__ array_push((array*)&oargs, _MOV((string[]){ string_clone(env_ldflags) })); } string str_oargs = Array_string_join(oargs, _SLIT(" ")); - string cmd = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = msvc.full_cl_exe_path}}, {_SLIT("\" /volatile:ms "), 0xfe10, {.d_s = str_oargs}}, {_SLIT(" "), 0xfe10, {.d_s = defines}}, {_SLIT(" "), 0xfe10, {.d_s = include_string}}, {_SLIT(" /c \""), 0xfe10, {.d_s = cfile}}, {_SLIT("\" /Fo\""), 0xfe10, {.d_s = obj_path}}, {_SLIT("\""), 0, { .d_c = 0 }}})); + string cmd = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = msvc.full_cl_exe_path}}, {_SLIT("\" /volatile:ms "), /*115 &string*/0xfe10, {.d_s = str_oargs}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = defines}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = include_string}}, {_SLIT(" /c \""), /*115 &string*/0xfe10, {.d_s = cfile}}, {_SLIT("\" /Fo\""), /*115 &string*/0xfe10, {.d_s = obj_path}}, {_SLIT("\""), 0, { .d_c = 0 }}})); #if defined(CUSTOM_DEFINE_trace_thirdparty_obj_files) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> build_thirdparty_obj_file_with_msvc cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> build_thirdparty_obj_file_with_msvc cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif os__Result res = os__execute(cmd); if (res.exit_code != 0) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("msvc: failed to build a thirdparty object; cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("msvc: failed to build a thirdparty object; cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__builder__verror(res.output); VUNREACHABLE(); } @@ -97199,7 +97498,7 @@ v__builder__MsvcStringFlags v__builder__msvc_string_flags(Array_v__cflag__CFlag v__cflag__CFlag flag = ((v__cflag__CFlag*)cflags.data)[_t1]; if (string__eq(flag.name, _SLIT("-l"))) { if (string_ends_with(flag.value, _SLIT(".dll"))) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("MSVC cannot link against a dll (`#flag -l "), 0xfe10, {.d_s = flag.value}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("MSVC cannot link against a dll (`#flag -l "), /*115 &string*/0xfe10, {.d_s = flag.value}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } string lib_lib = string__plus(flag.value, _SLIT(".lib")); @@ -97207,14 +97506,14 @@ v__builder__MsvcStringFlags v__builder__msvc_string_flags(Array_v__cflag__CFlag } else if (string__eq(flag.name, _SLIT("-I"))) { array_push((array*)&inc_paths, _MOV((string[]){ string_clone(v__cflag__CFlag_format(&flag)) })); } else if (string__eq(flag.name, _SLIT("-D"))) { - array_push((array*)&defines, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/D"), 0xfe10, {.d_s = flag.value}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&defines, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/D"), /*115 &string*/0xfe10, {.d_s = flag.value}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else if (string__eq(flag.name, _SLIT("-L"))) { array_push((array*)&lib_paths, _MOV((string[]){ string_clone(flag.value) })); array_push((array*)&lib_paths, _MOV((string[]){ string_clone(string__plus(string__plus(flag.value, _const_os__path_separator), _SLIT("msvc"))) })); } else if (string_ends_with(flag.value, _SLIT(".o"))) { - array_push((array*)&other_flags, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = flag.value}}, {_SLIT("bj\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&other_flags, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = flag.value}}, {_SLIT("bj\""), 0, { .d_c = 0 }}}))) })); } else if (string_starts_with(flag.value, _SLIT("-D"))) { - array_push((array*)&defines, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/D"), 0xfe10, {.d_s = string_substr(flag.value, 2, (flag.value).len)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&defines, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/D"), /*115 &string*/0xfe10, {.d_s = string_substr(flag.value, 2, (flag.value).len)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else { array_push((array*)&other_flags, _MOV((string[]){ string_clone(flag.value) })); } @@ -97232,7 +97531,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { if (!b->pref->use_cache || b->pref->build_mode == v__pref__BuildMode__build_module) { return; } - v__util__timing_start( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" source_hashing"), 0, { .d_c = 0 }}}))); + v__util__timing_start( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" source_hashing"), 0, { .d_c = 0 }}}))); Map_string_string new_hashes = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); Map_string_string old_hashes = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); strings__Builder sb_new_hashes = strings__new_builder(1024); @@ -97290,9 +97589,9 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { } (*(string*)_t7.data); - v__util__timing_measure( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" source_hashing"), 0, { .d_c = 0 }}}))); + v__util__timing_measure( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" source_hashing"), 0, { .d_c = 0 }}}))); if (!Map_string_string_map_eq(new_hashes, old_hashes)) { - v__util__timing_start( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" rebuilding"), 0, { .d_c = 0 }}}))); + v__util__timing_start( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" rebuilding"), 0, { .d_c = 0 }}}))); #if defined(CUSTOM_DEFINE_trace_invalidations) { Map_string_Array_string _t8 = b->mod_invalidates_paths; @@ -97314,10 +97613,10 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { string mm = ((string*)_t12.data)[_t13]; map_set(&m, &(string[]){mm}, &(bool[]) { true }); } - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> module `"), 0xfe10, {.d_s = k}}, {_SLIT("` invalidates: "), 0xfe10, {.d_s = Array_string_str(map_keys(&m))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> module `"), /*115 &string*/0xfe10, {.d_s = k}}, {_SLIT("` invalidates: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(map_keys(&m))}}, {_SLIT0, 0, { .d_c = 0 }}}))); for (int _t14 = 0; _t14 < v.len; ++_t14) { string fpath = ((string*)v.data)[_t14]; - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = fpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -97368,14 +97667,14 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { } #if defined(CUSTOM_DEFINE_trace_invalidations) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalidated_paths: "), 0xfe10, {.d_s = Map_string_int_str(invalidated_paths)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalidated_paths: "), /*115 &map[string]int*/0xfe10, {.d_s = Map_string_int_str(invalidated_paths)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif bool rebuild_everything = false; for (int cycle = 0; true; cycle++) { #if defined(CUSTOM_DEFINE_trace_invalidations) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> cycle: "), 0xfe07, {.d_i32 = cycle}}, {_SLIT(" | invalidated_paths: "), 0xfe10, {.d_s = Map_string_int_str(invalidated_paths)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> cycle: "), /*100 &int*/0xfe07, {.d_i32 = cycle}}, {_SLIT(" | invalidated_paths: "), /*115 &map[string]int*/0xfe10, {.d_s = Map_string_int_str(invalidated_paths)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif Map_string_int new_invalidated_paths = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); @@ -97411,7 +97710,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { } #if defined(CUSTOM_DEFINE_trace_invalidations) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> npath -> invalidated_mods | "), 0xfe10, {.d_s = npath}}, {_SLIT(" -> "), 0xfe10, {.d_s = Array_string_str(invalidated_mods)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> npath -> invalidated_mods | "), /*115 &string*/0xfe10, {.d_s = npath}}, {_SLIT(" -> "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(invalidated_mods)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif string mpath = os__dir(npath); @@ -97448,8 +97747,8 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { } #if defined(CUSTOM_DEFINE_trace_invalidations) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalidated_mod_paths: "), 0xfe10, {.d_s = Map_string_int_str(invalidated_mod_paths)}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("rebuild_everything: "), 0xfe10, {.d_s = rebuild_everything ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalidated_mod_paths: "), /*115 &map[string]int*/0xfe10, {.d_s = Map_string_int_str(invalidated_mod_paths)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("rebuild_everything: "), /*115 &bool*/0xfe10, {.d_s = rebuild_everything ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif if (invalidated_mod_paths.len > 0) { @@ -97460,7 +97759,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { v__builder__Builder_v_build_module(b, vexe, imp); } } - v__util__timing_measure( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" rebuilding"), 0, { .d_c = 0 }}}))); + v__util__timing_measure( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" rebuilding"), 0, { .d_c = 0 }}}))); } } @@ -97477,11 +97776,11 @@ string pwd; ; string boptions = Array_string_join(b->pref->build_options, _SLIT(" ")); - string rebuild_cmd = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), 0xfe10, {.d_s = boptions}}, {_SLIT(" build-module "), 0xfe10, {.d_s = os__quoted_path(imp_path)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string rebuild_cmd = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = boptions}}, {_SLIT(" build-module "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(imp_path)}}, {_SLIT0, 0, { .d_c = 0 }}})); ; #if defined(CUSTOM_DEFINE_trace_v_build_module) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Builder.v_build_module: "), 0xfe10, {.d_s = rebuild_cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Builder.v_build_module: "), /*115 &string*/0xfe10, {.d_s = rebuild_cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); } #endif os__system(rebuild_cmd); @@ -97502,13 +97801,13 @@ VV_LOCAL_SYMBOL string v__builder__Builder_rebuild_cached_module(v__builder__Bui if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (b->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Cached "), 0xfe10, {.d_s = imp_path}}, {_SLIT(" .o file not found... Building .o file for "), 0xfe10, {.d_s = imp_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Cached "), /*115 &string*/0xfe10, {.d_s = imp_path}}, {_SLIT(" .o file not found... Building .o file for "), /*115 &string*/0xfe10, {.d_s = imp_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__builder__Builder_v_build_module(b, vexe, imp_path); Option_string _t2 = v__vcache__CacheManager_exists(&b->pref->cache_manager, _SLIT(".o"), imp_path); if (_t2.state != 0) { /*or block*/ err = _t2.err; - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not rebuild cache module for "), 0xfe10, {.d_s = imp_path}}, {_SLIT(", error: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not rebuild cache module for "), /*115 &string*/0xfe10, {.d_s = imp_path}}, {_SLIT(", error: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -97537,7 +97836,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_handle_usecache(v__builder__Builder* b, Option_string _t3 = v__builder__Builder_find_module_path(b, ast_file->mod.name, ast_file->path); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), 0xfe10, {.d_s = ast_file->mod.name}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), /*115 &string*/0xfe10, {.d_s = ast_file->mod.name}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); break; } @@ -97565,7 +97864,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_handle_usecache(v__builder__Builder* b, Option_string _t7 = v__builder__Builder_find_module_path(b, imp, ast_file->path); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), 0xfe10, {.d_s = imp}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), /*115 &string*/0xfe10, {.d_s = imp}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); break; } @@ -97642,7 +97941,7 @@ string v__builder__cbuilder__gen_c(v__builder__Builder* b, Array_string v_files) void v__builder__cbuilder__build_c(v__builder__Builder* b, Array_string v_files, string out_file) { b->out_name_c = out_file; b->pref->out_name_c = os__real_path(out_file); - v__builder__Builder_info(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("build_c("), 0xfe10, {.d_s = out_file}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__builder__Builder_info(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("build_c("), /*115 &string*/0xfe10, {.d_s = out_file}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); string output2 = v__builder__cbuilder__gen_c(b, v_files); Option_void _t1 = os__write_file(out_file, output2); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { @@ -97697,9 +97996,9 @@ v__util__Timers* timers; } Array_string _t5; Array_string args_and_flags = (_t5 = v__util__join_env_vflags_and_os_args(), array_slice(_t5, 1, _t5.len)); - multi_return_ref_v__pref__Preferences_string mr_1761 = v__pref__parse_args_and_show_errors(_const_main__external_tools, args_and_flags, true); - v__pref__Preferences* prefs = mr_1761.arg0; - string command = mr_1761.arg1; + multi_return_ref_v__pref__Preferences_string mr_1774 = v__pref__parse_args_and_show_errors(_const_main__external_tools, args_and_flags, true); + v__pref__Preferences* prefs = mr_1774.arg0; + string command = mr_1774.arg1; if (prefs->use_cache && string__eq(os__user_os(), _SLIT("windows"))) { eprintln(_SLIT("-usecache is currently disabled on windows")); _v_exit(1); @@ -97810,7 +98109,7 @@ v__util__Timers* timers; if (prefs->is_help) { main__invoke_help_and_exit(args); } - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("v "), 0xfe10, {.d_s = command}}, {_SLIT(": unknown command\nRun "), 0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT(" for usage."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("v "), /*115 &string*/0xfe10, {.d_s = command}}, {_SLIT(": unknown command\nRun "), /*115 &string*/0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT(" for usage."), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -97825,8 +98124,8 @@ VV_LOCAL_SYMBOL void main__invoke_help_and_exit(Array_string remaining) { } else { }; - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT(": provide only one help topic."), 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("For usage information, use "), 0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT(": provide only one help topic."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("For usage information, use "), /*115 &string*/0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT("."), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -97837,106 +98136,106 @@ void _vinit(int ___argc, voidptr ___argv) { #endif as_cast_type_indexes = new_array_from_c_array(102, 102, sizeof(VCastTypeIndexName), _MOV((VCastTypeIndexName[102]){ (VCastTypeIndexName){.tindex = 0, .tname = _SLIT("unknown")} - , (VCastTypeIndexName){.tindex = 429, .tname = _SLIT("v.ast.Aggregate")} - , (VCastTypeIndexName){.tindex = 431, .tname = _SLIT("v.ast.Alias")} - , (VCastTypeIndexName){.tindex = 411, .tname = _SLIT("v.ast.Array")} - , (VCastTypeIndexName){.tindex = 439, .tname = _SLIT("v.ast.ArrayFixed")} - , (VCastTypeIndexName){.tindex = 440, .tname = _SLIT("v.ast.Chan")} - , (VCastTypeIndexName){.tindex = 445, .tname = _SLIT("v.ast.Enum")} - , (VCastTypeIndexName){.tindex = 443, .tname = _SLIT("v.ast.FnType")} - , (VCastTypeIndexName){.tindex = 444, .tname = _SLIT("v.ast.GenericInst")} - , (VCastTypeIndexName){.tindex = 434, .tname = _SLIT("v.ast.Interface")} - , (VCastTypeIndexName){.tindex = 412, .tname = _SLIT("v.ast.Map")} - , (VCastTypeIndexName){.tindex = 442, .tname = _SLIT("v.ast.MultiReturn")} - , (VCastTypeIndexName){.tindex = 416, .tname = _SLIT("v.ast.Struct")} - , (VCastTypeIndexName){.tindex = 435, .tname = _SLIT("v.ast.SumType")} - , (VCastTypeIndexName){.tindex = 441, .tname = _SLIT("v.ast.Thread")} - , (VCastTypeIndexName){.tindex = 375, .tname = _SLIT("v.ast.IdentFn")} - , (VCastTypeIndexName){.tindex = 376, .tname = _SLIT("v.ast.IdentVar")} - , (VCastTypeIndexName){.tindex = 244, .tname = _SLIT("v.ast.AnonFn")} - , (VCastTypeIndexName){.tindex = 245, .tname = _SLIT("v.ast.ArrayDecompose")} - , (VCastTypeIndexName){.tindex = 246, .tname = _SLIT("v.ast.ArrayInit")} - , (VCastTypeIndexName){.tindex = 247, .tname = _SLIT("v.ast.AsCast")} - , (VCastTypeIndexName){.tindex = 248, .tname = _SLIT("v.ast.Assoc")} - , (VCastTypeIndexName){.tindex = 249, .tname = _SLIT("v.ast.AtExpr")} - , (VCastTypeIndexName){.tindex = 250, .tname = _SLIT("v.ast.BoolLiteral")} - , (VCastTypeIndexName){.tindex = 251, .tname = _SLIT("v.ast.CTempVar")} - , (VCastTypeIndexName){.tindex = 252, .tname = _SLIT("v.ast.CallExpr")} - , (VCastTypeIndexName){.tindex = 253, .tname = _SLIT("v.ast.CastExpr")} - , (VCastTypeIndexName){.tindex = 254, .tname = _SLIT("v.ast.ChanInit")} - , (VCastTypeIndexName){.tindex = 255, .tname = _SLIT("v.ast.CharLiteral")} - , (VCastTypeIndexName){.tindex = 256, .tname = _SLIT("v.ast.Comment")} - , (VCastTypeIndexName){.tindex = 257, .tname = _SLIT("v.ast.ComptimeCall")} - , (VCastTypeIndexName){.tindex = 258, .tname = _SLIT("v.ast.ComptimeSelector")} - , (VCastTypeIndexName){.tindex = 259, .tname = _SLIT("v.ast.ComptimeType")} - , (VCastTypeIndexName){.tindex = 260, .tname = _SLIT("v.ast.ConcatExpr")} - , (VCastTypeIndexName){.tindex = 261, .tname = _SLIT("v.ast.DumpExpr")} - , (VCastTypeIndexName){.tindex = 262, .tname = _SLIT("v.ast.EmptyExpr")} - , (VCastTypeIndexName){.tindex = 263, .tname = _SLIT("v.ast.EnumVal")} - , (VCastTypeIndexName){.tindex = 264, .tname = _SLIT("v.ast.FloatLiteral")} - , (VCastTypeIndexName){.tindex = 265, .tname = _SLIT("v.ast.GoExpr")} - , (VCastTypeIndexName){.tindex = 266, .tname = _SLIT("v.ast.Ident")} - , (VCastTypeIndexName){.tindex = 267, .tname = _SLIT("v.ast.IfExpr")} - , (VCastTypeIndexName){.tindex = 268, .tname = _SLIT("v.ast.IfGuardExpr")} - , (VCastTypeIndexName){.tindex = 269, .tname = _SLIT("v.ast.IndexExpr")} - , (VCastTypeIndexName){.tindex = 270, .tname = _SLIT("v.ast.InfixExpr")} - , (VCastTypeIndexName){.tindex = 271, .tname = _SLIT("v.ast.IntegerLiteral")} - , (VCastTypeIndexName){.tindex = 272, .tname = _SLIT("v.ast.IsRefType")} - , (VCastTypeIndexName){.tindex = 273, .tname = _SLIT("v.ast.Likely")} - , (VCastTypeIndexName){.tindex = 274, .tname = _SLIT("v.ast.LockExpr")} - , (VCastTypeIndexName){.tindex = 275, .tname = _SLIT("v.ast.MapInit")} - , (VCastTypeIndexName){.tindex = 276, .tname = _SLIT("v.ast.MatchExpr")} - , (VCastTypeIndexName){.tindex = 277, .tname = _SLIT("v.ast.NodeError")} - , (VCastTypeIndexName){.tindex = 278, .tname = _SLIT("v.ast.None")} - , (VCastTypeIndexName){.tindex = 279, .tname = _SLIT("v.ast.OffsetOf")} - , (VCastTypeIndexName){.tindex = 280, .tname = _SLIT("v.ast.OrExpr")} - , (VCastTypeIndexName){.tindex = 281, .tname = _SLIT("v.ast.ParExpr")} - , (VCastTypeIndexName){.tindex = 282, .tname = _SLIT("v.ast.PostfixExpr")} - , (VCastTypeIndexName){.tindex = 283, .tname = _SLIT("v.ast.PrefixExpr")} - , (VCastTypeIndexName){.tindex = 284, .tname = _SLIT("v.ast.RangeExpr")} - , (VCastTypeIndexName){.tindex = 285, .tname = _SLIT("v.ast.SelectExpr")} - , (VCastTypeIndexName){.tindex = 286, .tname = _SLIT("v.ast.SelectorExpr")} - , (VCastTypeIndexName){.tindex = 287, .tname = _SLIT("v.ast.SizeOf")} - , (VCastTypeIndexName){.tindex = 288, .tname = _SLIT("v.ast.SqlExpr")} - , (VCastTypeIndexName){.tindex = 289, .tname = _SLIT("v.ast.StringInterLiteral")} - , (VCastTypeIndexName){.tindex = 290, .tname = _SLIT("v.ast.StringLiteral")} - , (VCastTypeIndexName){.tindex = 291, .tname = _SLIT("v.ast.StructInit")} - , (VCastTypeIndexName){.tindex = 292, .tname = _SLIT("v.ast.TypeNode")} - , (VCastTypeIndexName){.tindex = 293, .tname = _SLIT("v.ast.TypeOf")} - , (VCastTypeIndexName){.tindex = 294, .tname = _SLIT("v.ast.UnsafeExpr")} - , (VCastTypeIndexName){.tindex = 321, .tname = _SLIT("v.ast.AsmRegister")} - , (VCastTypeIndexName){.tindex = 322, .tname = _SLIT("v.ast.ConstField")} - , (VCastTypeIndexName){.tindex = 323, .tname = _SLIT("v.ast.GlobalField")} - , (VCastTypeIndexName){.tindex = 324, .tname = _SLIT("v.ast.Var")} - , (VCastTypeIndexName){.tindex = 296, .tname = _SLIT("v.ast.AsmStmt")} - , (VCastTypeIndexName){.tindex = 297, .tname = _SLIT("v.ast.AssertStmt")} - , (VCastTypeIndexName){.tindex = 298, .tname = _SLIT("v.ast.AssignStmt")} - , (VCastTypeIndexName){.tindex = 299, .tname = _SLIT("v.ast.Block")} - , (VCastTypeIndexName){.tindex = 300, .tname = _SLIT("v.ast.BranchStmt")} - , (VCastTypeIndexName){.tindex = 301, .tname = _SLIT("v.ast.ComptimeFor")} - , (VCastTypeIndexName){.tindex = 302, .tname = _SLIT("v.ast.ConstDecl")} - , (VCastTypeIndexName){.tindex = 303, .tname = _SLIT("v.ast.DeferStmt")} - , (VCastTypeIndexName){.tindex = 304, .tname = _SLIT("v.ast.EmptyStmt")} - , (VCastTypeIndexName){.tindex = 305, .tname = _SLIT("v.ast.EnumDecl")} - , (VCastTypeIndexName){.tindex = 306, .tname = _SLIT("v.ast.ExprStmt")} - , (VCastTypeIndexName){.tindex = 183, .tname = _SLIT("v.ast.FnDecl")} - , (VCastTypeIndexName){.tindex = 307, .tname = _SLIT("v.ast.ForCStmt")} - , (VCastTypeIndexName){.tindex = 308, .tname = _SLIT("v.ast.ForInStmt")} - , (VCastTypeIndexName){.tindex = 309, .tname = _SLIT("v.ast.ForStmt")} - , (VCastTypeIndexName){.tindex = 310, .tname = _SLIT("v.ast.GlobalDecl")} - , (VCastTypeIndexName){.tindex = 311, .tname = _SLIT("v.ast.GotoLabel")} - , (VCastTypeIndexName){.tindex = 312, .tname = _SLIT("v.ast.GotoStmt")} - , (VCastTypeIndexName){.tindex = 313, .tname = _SLIT("v.ast.HashStmt")} - , (VCastTypeIndexName){.tindex = 314, .tname = _SLIT("v.ast.Import")} - , (VCastTypeIndexName){.tindex = 315, .tname = _SLIT("v.ast.InterfaceDecl")} - , (VCastTypeIndexName){.tindex = 316, .tname = _SLIT("v.ast.Module")} - , (VCastTypeIndexName){.tindex = 317, .tname = _SLIT("v.ast.Return")} - , (VCastTypeIndexName){.tindex = 318, .tname = _SLIT("v.ast.SqlStmt")} - , (VCastTypeIndexName){.tindex = 319, .tname = _SLIT("v.ast.StructDecl")} - , (VCastTypeIndexName){.tindex = 243, .tname = _SLIT("v.ast.TypeDecl")} - , (VCastTypeIndexName){.tindex = 396, .tname = _SLIT("v.ast.AsmAddressing")} - , (VCastTypeIndexName){.tindex = 397, .tname = _SLIT("v.ast.AsmAlias")} - , (VCastTypeIndexName){.tindex = 398, .tname = _SLIT("v.ast.AsmDisp")} + , (VCastTypeIndexName){.tindex = 430, .tname = _SLIT("v.ast.Aggregate")} + , (VCastTypeIndexName){.tindex = 432, .tname = _SLIT("v.ast.Alias")} + , (VCastTypeIndexName){.tindex = 412, .tname = _SLIT("v.ast.Array")} + , (VCastTypeIndexName){.tindex = 440, .tname = _SLIT("v.ast.ArrayFixed")} + , (VCastTypeIndexName){.tindex = 441, .tname = _SLIT("v.ast.Chan")} + , (VCastTypeIndexName){.tindex = 446, .tname = _SLIT("v.ast.Enum")} + , (VCastTypeIndexName){.tindex = 444, .tname = _SLIT("v.ast.FnType")} + , (VCastTypeIndexName){.tindex = 445, .tname = _SLIT("v.ast.GenericInst")} + , (VCastTypeIndexName){.tindex = 435, .tname = _SLIT("v.ast.Interface")} + , (VCastTypeIndexName){.tindex = 413, .tname = _SLIT("v.ast.Map")} + , (VCastTypeIndexName){.tindex = 443, .tname = _SLIT("v.ast.MultiReturn")} + , (VCastTypeIndexName){.tindex = 417, .tname = _SLIT("v.ast.Struct")} + , (VCastTypeIndexName){.tindex = 436, .tname = _SLIT("v.ast.SumType")} + , (VCastTypeIndexName){.tindex = 442, .tname = _SLIT("v.ast.Thread")} + , (VCastTypeIndexName){.tindex = 376, .tname = _SLIT("v.ast.IdentFn")} + , (VCastTypeIndexName){.tindex = 377, .tname = _SLIT("v.ast.IdentVar")} + , (VCastTypeIndexName){.tindex = 245, .tname = _SLIT("v.ast.AnonFn")} + , (VCastTypeIndexName){.tindex = 246, .tname = _SLIT("v.ast.ArrayDecompose")} + , (VCastTypeIndexName){.tindex = 247, .tname = _SLIT("v.ast.ArrayInit")} + , (VCastTypeIndexName){.tindex = 248, .tname = _SLIT("v.ast.AsCast")} + , (VCastTypeIndexName){.tindex = 249, .tname = _SLIT("v.ast.Assoc")} + , (VCastTypeIndexName){.tindex = 250, .tname = _SLIT("v.ast.AtExpr")} + , (VCastTypeIndexName){.tindex = 251, .tname = _SLIT("v.ast.BoolLiteral")} + , (VCastTypeIndexName){.tindex = 252, .tname = _SLIT("v.ast.CTempVar")} + , (VCastTypeIndexName){.tindex = 253, .tname = _SLIT("v.ast.CallExpr")} + , (VCastTypeIndexName){.tindex = 254, .tname = _SLIT("v.ast.CastExpr")} + , (VCastTypeIndexName){.tindex = 255, .tname = _SLIT("v.ast.ChanInit")} + , (VCastTypeIndexName){.tindex = 256, .tname = _SLIT("v.ast.CharLiteral")} + , (VCastTypeIndexName){.tindex = 257, .tname = _SLIT("v.ast.Comment")} + , (VCastTypeIndexName){.tindex = 258, .tname = _SLIT("v.ast.ComptimeCall")} + , (VCastTypeIndexName){.tindex = 259, .tname = _SLIT("v.ast.ComptimeSelector")} + , (VCastTypeIndexName){.tindex = 260, .tname = _SLIT("v.ast.ComptimeType")} + , (VCastTypeIndexName){.tindex = 261, .tname = _SLIT("v.ast.ConcatExpr")} + , (VCastTypeIndexName){.tindex = 262, .tname = _SLIT("v.ast.DumpExpr")} + , (VCastTypeIndexName){.tindex = 263, .tname = _SLIT("v.ast.EmptyExpr")} + , (VCastTypeIndexName){.tindex = 264, .tname = _SLIT("v.ast.EnumVal")} + , (VCastTypeIndexName){.tindex = 265, .tname = _SLIT("v.ast.FloatLiteral")} + , (VCastTypeIndexName){.tindex = 266, .tname = _SLIT("v.ast.GoExpr")} + , (VCastTypeIndexName){.tindex = 267, .tname = _SLIT("v.ast.Ident")} + , (VCastTypeIndexName){.tindex = 268, .tname = _SLIT("v.ast.IfExpr")} + , (VCastTypeIndexName){.tindex = 269, .tname = _SLIT("v.ast.IfGuardExpr")} + , (VCastTypeIndexName){.tindex = 270, .tname = _SLIT("v.ast.IndexExpr")} + , (VCastTypeIndexName){.tindex = 271, .tname = _SLIT("v.ast.InfixExpr")} + , (VCastTypeIndexName){.tindex = 272, .tname = _SLIT("v.ast.IntegerLiteral")} + , (VCastTypeIndexName){.tindex = 273, .tname = _SLIT("v.ast.IsRefType")} + , (VCastTypeIndexName){.tindex = 274, .tname = _SLIT("v.ast.Likely")} + , (VCastTypeIndexName){.tindex = 275, .tname = _SLIT("v.ast.LockExpr")} + , (VCastTypeIndexName){.tindex = 276, .tname = _SLIT("v.ast.MapInit")} + , (VCastTypeIndexName){.tindex = 277, .tname = _SLIT("v.ast.MatchExpr")} + , (VCastTypeIndexName){.tindex = 278, .tname = _SLIT("v.ast.NodeError")} + , (VCastTypeIndexName){.tindex = 279, .tname = _SLIT("v.ast.None")} + , (VCastTypeIndexName){.tindex = 280, .tname = _SLIT("v.ast.OffsetOf")} + , (VCastTypeIndexName){.tindex = 281, .tname = _SLIT("v.ast.OrExpr")} + , (VCastTypeIndexName){.tindex = 282, .tname = _SLIT("v.ast.ParExpr")} + , (VCastTypeIndexName){.tindex = 283, .tname = _SLIT("v.ast.PostfixExpr")} + , (VCastTypeIndexName){.tindex = 284, .tname = _SLIT("v.ast.PrefixExpr")} + , (VCastTypeIndexName){.tindex = 285, .tname = _SLIT("v.ast.RangeExpr")} + , (VCastTypeIndexName){.tindex = 286, .tname = _SLIT("v.ast.SelectExpr")} + , (VCastTypeIndexName){.tindex = 287, .tname = _SLIT("v.ast.SelectorExpr")} + , (VCastTypeIndexName){.tindex = 288, .tname = _SLIT("v.ast.SizeOf")} + , (VCastTypeIndexName){.tindex = 289, .tname = _SLIT("v.ast.SqlExpr")} + , (VCastTypeIndexName){.tindex = 290, .tname = _SLIT("v.ast.StringInterLiteral")} + , (VCastTypeIndexName){.tindex = 291, .tname = _SLIT("v.ast.StringLiteral")} + , (VCastTypeIndexName){.tindex = 292, .tname = _SLIT("v.ast.StructInit")} + , (VCastTypeIndexName){.tindex = 293, .tname = _SLIT("v.ast.TypeNode")} + , (VCastTypeIndexName){.tindex = 294, .tname = _SLIT("v.ast.TypeOf")} + , (VCastTypeIndexName){.tindex = 295, .tname = _SLIT("v.ast.UnsafeExpr")} + , (VCastTypeIndexName){.tindex = 322, .tname = _SLIT("v.ast.AsmRegister")} + , (VCastTypeIndexName){.tindex = 323, .tname = _SLIT("v.ast.ConstField")} + , (VCastTypeIndexName){.tindex = 324, .tname = _SLIT("v.ast.GlobalField")} + , (VCastTypeIndexName){.tindex = 325, .tname = _SLIT("v.ast.Var")} + , (VCastTypeIndexName){.tindex = 297, .tname = _SLIT("v.ast.AsmStmt")} + , (VCastTypeIndexName){.tindex = 298, .tname = _SLIT("v.ast.AssertStmt")} + , (VCastTypeIndexName){.tindex = 299, .tname = _SLIT("v.ast.AssignStmt")} + , (VCastTypeIndexName){.tindex = 300, .tname = _SLIT("v.ast.Block")} + , (VCastTypeIndexName){.tindex = 301, .tname = _SLIT("v.ast.BranchStmt")} + , (VCastTypeIndexName){.tindex = 302, .tname = _SLIT("v.ast.ComptimeFor")} + , (VCastTypeIndexName){.tindex = 303, .tname = _SLIT("v.ast.ConstDecl")} + , (VCastTypeIndexName){.tindex = 304, .tname = _SLIT("v.ast.DeferStmt")} + , (VCastTypeIndexName){.tindex = 305, .tname = _SLIT("v.ast.EmptyStmt")} + , (VCastTypeIndexName){.tindex = 306, .tname = _SLIT("v.ast.EnumDecl")} + , (VCastTypeIndexName){.tindex = 307, .tname = _SLIT("v.ast.ExprStmt")} + , (VCastTypeIndexName){.tindex = 184, .tname = _SLIT("v.ast.FnDecl")} + , (VCastTypeIndexName){.tindex = 308, .tname = _SLIT("v.ast.ForCStmt")} + , (VCastTypeIndexName){.tindex = 309, .tname = _SLIT("v.ast.ForInStmt")} + , (VCastTypeIndexName){.tindex = 310, .tname = _SLIT("v.ast.ForStmt")} + , (VCastTypeIndexName){.tindex = 311, .tname = _SLIT("v.ast.GlobalDecl")} + , (VCastTypeIndexName){.tindex = 312, .tname = _SLIT("v.ast.GotoLabel")} + , (VCastTypeIndexName){.tindex = 313, .tname = _SLIT("v.ast.GotoStmt")} + , (VCastTypeIndexName){.tindex = 314, .tname = _SLIT("v.ast.HashStmt")} + , (VCastTypeIndexName){.tindex = 315, .tname = _SLIT("v.ast.Import")} + , (VCastTypeIndexName){.tindex = 316, .tname = _SLIT("v.ast.InterfaceDecl")} + , (VCastTypeIndexName){.tindex = 317, .tname = _SLIT("v.ast.Module")} + , (VCastTypeIndexName){.tindex = 318, .tname = _SLIT("v.ast.Return")} + , (VCastTypeIndexName){.tindex = 319, .tname = _SLIT("v.ast.SqlStmt")} + , (VCastTypeIndexName){.tindex = 320, .tname = _SLIT("v.ast.StructDecl")} + , (VCastTypeIndexName){.tindex = 244, .tname = _SLIT("v.ast.TypeDecl")} + , (VCastTypeIndexName){.tindex = 397, .tname = _SLIT("v.ast.AsmAddressing")} + , (VCastTypeIndexName){.tindex = 398, .tname = _SLIT("v.ast.AsmAlias")} + , (VCastTypeIndexName){.tindex = 399, .tname = _SLIT("v.ast.AsmDisp")} , (VCastTypeIndexName){.tindex = 20, .tname = _SLIT("string")} })); @@ -98565,6 +98864,7 @@ void _vinit(int ___argc, voidptr ___argv) { _const_v__ast__string_type_idxs = new_array_from_c_array(1, 1, sizeof(int), _MOV((int[1]){_const_v__ast__string_type_idx})); _const_v__ast__void_type = v__ast__new_type(_const_v__ast__void_type_idx); _const_v__ast__ovoid_type = v__ast__Type_set_flag(v__ast__new_type(_const_v__ast__void_type_idx), v__ast__TypeFlag__optional); + _const_v__ast__rvoid_type = v__ast__Type_set_flag(v__ast__new_type(_const_v__ast__void_type_idx), v__ast__TypeFlag__result); _const_v__ast__voidptr_type = v__ast__new_type(_const_v__ast__voidptr_type_idx); _const_v__ast__byteptr_type = v__ast__new_type(_const_v__ast__byteptr_type_idx); _const_v__ast__charptr_type = v__ast__new_type(_const_v__ast__charptr_type_idx); @@ -98615,9 +98915,9 @@ void _vinit(int ___argc, voidptr ___argv) { _const_v__checker__array_builtin_methods = new_array_from_c_array(15, 15, sizeof(string), _MOV((string[15]){ _SLIT("filter"), _SLIT("clone"), _SLIT("repeat"), _SLIT("reverse"), _SLIT("map"), _SLIT("slice"), _SLIT("sort"), _SLIT("contains"), _SLIT("index"), _SLIT("wait"), _SLIT("any"), _SLIT("all"), _SLIT("first"), _SLIT("last"), _SLIT("pop")})); - _const_v__checker__reserved_type_names = new_array_from_c_array(15, 15, sizeof(string), _MOV((string[15]){ - _SLIT("bool"), _SLIT("char"), _SLIT("i8"), _SLIT("i16"), _SLIT("int"), _SLIT("i64"), _SLIT("byte"), _SLIT("u16"), _SLIT("u32"), - _SLIT("u64"), _SLIT("f32"), _SLIT("f64"), _SLIT("map"), _SLIT("string"), _SLIT("rune")})); + _const_v__checker__reserved_type_names = new_array_from_c_array(16, 16, sizeof(string), _MOV((string[16]){ + _SLIT("byte"), _SLIT("bool"), _SLIT("char"), _SLIT("i8"), _SLIT("i16"), _SLIT("int"), _SLIT("i64"), _SLIT("u8"), _SLIT("u16"), + _SLIT("u32"), _SLIT("u64"), _SLIT("f32"), _SLIT("f64"), _SLIT("map"), _SLIT("string"), _SLIT("rune")})); } { // Initializations for module v.transformer : } @@ -98637,9 +98937,9 @@ void _vinit(int ___argc, voidptr ___argv) { _const_v__gen__c__c_reserved_map = v__gen__c__string_array_to_map(_const_v__gen__c__c_reserved); _const_v__gen__c__cmp_str = new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("eq"), _SLIT("ne"), _SLIT("gt"), _SLIT("lt"), _SLIT("ge"), _SLIT("le")})); _const_v__gen__c__cmp_rev = new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("eq"), _SLIT("ne"), _SLIT("lt"), _SLIT("gt"), _SLIT("le"), _SLIT("ge")})); - _const_v__gen__c__builtins = new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){_SLIT("string"), _SLIT("array"), _SLIT("DenseArray"), _SLIT("map"), _SLIT("Error"), _SLIT("IError"), _SLIT("Option")})); - _const_v__gen__c__c_headers = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__)\n #define __V_amd64 1\n #undef __V_architecture\n #define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__)\n #define __V_arm64 1\n #undef __V_architecture\n #define __V_architecture 2\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n #define __V_GCC__\n#endif\n#ifdef __TINYC__\n #undef __V_GCC__\n#endif\n#ifdef __cplusplus\n #undef __V_GCC__\n#endif\n#ifdef __clang__\n #undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n #undef __V_GCC__\n #undef EMPTY_STRUCT_INITIALIZATION\n #define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n #define _Atomic volatile\n #undef EMPTY_STRUCT_DECLARATION\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #undef EMPTY_ARRAY_OF_ELEMS\n #define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n #undef __NOINLINE\n #undef __IRQHANDLER\n // tcc does not support inlining at all\n #define __NOINLINE\n #define __IRQHANDLER\n #undef TCCSKIP\n #define TCCSKIP(x)\n // #include \n #ifndef _WIN32\n #include \n int tcc_backtrace(const char *fmt, ...);\n #endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n #define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n// returns the number of CPU registers that TYPE takes up\n#define _REG_WIDTH(T) (((sizeof(T) + sizeof(void*) - 1) & ~(sizeof(void*) - 1)) / sizeof(void*))\n// parameters of size <= 2 registers are spilled across those two registers; larger types are passed as one pointer to some stack location\n#define _REG_WIDTH_BOUNDED(T) (_REG_WIDTH(T) <= 2 ? _REG_WIDTH(T) : 1)\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n #ifdef PRIx64\n #define V64_PRINTFORMAT \"0x%\"PRIx64\n #elif defined(__WIN32__)\n #define V64_PRINTFORMAT \"0x%I64x\"\n #elif defined(__linux__) && defined(__LP64__)\n #define V64_PRINTFORMAT \"0x%lx\"\n #else\n #define V64_PRINTFORMAT \"0x%llx\"\n #endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n #define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n #define VV_LOCAL_SYMBOL static\n#else\n // 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n // and does not support __has_attribute(visibility) ...\n #ifndef __has_attribute\n #define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n #endif\n #if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n #ifdef ARM\n #define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n #else\n #define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n #endif\n #if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n #define VV_LOCAL_SYMBOL static\n #else\n #define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n #endif\n #else\n #define VV_EXPORTED_SYMBOL extern\n #define VV_LOCAL_SYMBOL static\n #endif\n#endif\n\n#ifdef __cplusplus\n #include \n #define _MOV std::move\n#else\n #define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n #define VWEAK __attribute__((weak))\n #ifdef _MSC_VER\n #undef VWEAK\n #define VWEAK\n #endif\n#endif\n\n#if !defined(VNORETURN)\n #if defined(__TINYC__)\n #include \n #define VNORETURN noreturn\n #endif\n # if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n # define VNORETURN _Noreturn\n # elif defined(__GNUC__) && __GNUC__ >= 2\n # define VNORETURN __attribute__((noreturn))\n # endif\n #ifndef VNORETURN\n #define VNORETURN\n #endif\n#endif\n\n#if !defined(VUNREACHABLE)\n #if defined(__GNUC__) && !defined(__clang__)\n #define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n #if (V_GCC_VERSION >= 40500L)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #if defined(__clang__) && defined(__has_builtin)\n #if __has_builtin(__builtin_unreachable)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #ifndef VUNREACHABLE\n #define VUNREACHABLE() do { } while (0)\n #endif\n #if defined(__FreeBSD__) && defined(__TINYC__)\n #define VUNREACHABLE() do { } while (0)\n #endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n #define _likely_(x) __builtin_expect(x,1)\n #define _unlikely_(x) __builtin_expect(x,0)\n#else\n #define _likely_(x) (x)\n #define _unlikely_(x) (x)\n#endif\n\n\n// c_headers\ntypedef int (*qsort_callback_func)(const void*, const void*);\n#include // TODO remove all these includes, define all function signatures and types manually\n#include \n#include \n\n#ifndef _WIN32\n #if defined __has_include\n #if __has_include ()\n #include \n #else\n // Most probably musl OR __ANDROID__ ...\n int backtrace (void **__array, int __size) { return 0; }\n char **backtrace_symbols (void *const *__array, int __size){ return 0; }\n void backtrace_symbols_fd (void *const *__array, int __size, int __fd){}\n #endif\n #endif\n#endif\n\n#include // for va_list\n\n//================================== GLOBALS =================================*/\nint load_so(byteptr);\nvoid _vinit(int ___argc, voidptr ___argv);\nvoid _vcleanup(void);\n#define sigaction_size sizeof(sigaction);\n#define _ARR_LEN(a) ( (sizeof(a)) / (sizeof(a[0])) )\n\nvoid v_free(voidptr ptr);\nvoidptr memdup(voidptr src, int sz);\n\n#if INTPTR_MAX == INT32_MAX\n #define TARGET_IS_32BIT 1\n#elif INTPTR_MAX == INT64_MAX\n #define TARGET_IS_64BIT 1\n#else\n #error \"The environment is not 32 or 64-bit.\"\n#endif\n\n#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__)\n #define TARGET_ORDER_IS_BIG 1\n#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_IX86)\n #define TARGET_ORDER_IS_LITTLE 1\n#else\n #error \"Unknown architecture endianness\"\n#endif\n\n#ifndef _WIN32\n #include \n #include // tolower\n #include \n #include // sleep\n extern char **environ;\n#endif\n\n#if defined(__CYGWIN__) && !defined(_WIN32)\n #error Cygwin is not supported, please use MinGW or Visual Studio.\n#endif\n\n#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__vinix__) || defined(__serenity__) || defined(__sun)\n #include \n #include // os__wait uses wait on nix\n#endif\n\n#ifdef __OpenBSD__\n #include \n #include \n #include // os__wait uses wait on nix\n#endif\n\n#ifdef __NetBSD__\n #include // os__wait uses wait on nix\n#endif\n\n#ifdef _WIN32\n #define WINVER 0x0600\n #ifdef _WIN32_WINNT\n #undef _WIN32_WINNT\n #endif\n #define _WIN32_WINNT 0x0600\n #ifndef WIN32_FULL\n #define WIN32_LEAN_AND_MEAN\n #endif\n #ifndef _UNICODE\n #define _UNICODE\n #endif\n #ifndef UNICODE\n #define UNICODE\n #endif\n #include \n\n #include // _waccess\n #include // _wgetcwd\n #include // signal and SIGSEGV for segmentation fault handler\n\n #ifdef _MSC_VER\n // On MSVC these are the same (as long as /volatile:ms is passed)\n #define _Atomic volatile\n\n // MSVC cannot parse some things properly\n #undef EMPTY_STRUCT_DECLARATION\n #undef OPTION_CAST\n\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #define OPTION_CAST(x)\n #undef __NOINLINE\n #undef __IRQHANDLER\n #define __NOINLINE __declspec(noinline)\n #define __IRQHANDLER __declspec(naked)\n\n #include \n #pragma comment(lib, \"Dbghelp\")\n #endif\n#else\n #include \n #ifndef PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP\n // musl does not have that\n #define pthread_rwlockattr_setkind_np(a, b)\n #endif\n#endif\n\n// g_live_info is used by live.info()\nstatic void* g_live_info = NULL;\n\n#if defined(__MINGW32__) || defined(__MINGW64__) || (defined(_WIN32) && defined(__TINYC__))\n #undef PRId64\n #undef PRIi64\n #undef PRIo64\n #undef PRIu64\n #undef PRIx64\n #undef PRIX64\n #define PRId64 \"lld\"\n #define PRIi64 \"lli\"\n #define PRIo64 \"llo\"\n #define PRIu64 \"llu\"\n #define PRIx64 \"llx\"\n #define PRIX64 \"llX\"\n#endif\n\n#ifdef _VFREESTANDING\n#undef _VFREESTANDING\n#endif\n"); - _const_v__gen__c__c_bare_headers = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__)\n #define __V_amd64 1\n #undef __V_architecture\n #define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__)\n #define __V_arm64 1\n #undef __V_architecture\n #define __V_architecture 2\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n #define __V_GCC__\n#endif\n#ifdef __TINYC__\n #undef __V_GCC__\n#endif\n#ifdef __cplusplus\n #undef __V_GCC__\n#endif\n#ifdef __clang__\n #undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n #undef __V_GCC__\n #undef EMPTY_STRUCT_INITIALIZATION\n #define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n #define _Atomic volatile\n #undef EMPTY_STRUCT_DECLARATION\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #undef EMPTY_ARRAY_OF_ELEMS\n #define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n #undef __NOINLINE\n #undef __IRQHANDLER\n // tcc does not support inlining at all\n #define __NOINLINE\n #define __IRQHANDLER\n #undef TCCSKIP\n #define TCCSKIP(x)\n // #include \n #ifndef _WIN32\n #include \n int tcc_backtrace(const char *fmt, ...);\n #endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n #define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n// returns the number of CPU registers that TYPE takes up\n#define _REG_WIDTH(T) (((sizeof(T) + sizeof(void*) - 1) & ~(sizeof(void*) - 1)) / sizeof(void*))\n// parameters of size <= 2 registers are spilled across those two registers; larger types are passed as one pointer to some stack location\n#define _REG_WIDTH_BOUNDED(T) (_REG_WIDTH(T) <= 2 ? _REG_WIDTH(T) : 1)\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n #ifdef PRIx64\n #define V64_PRINTFORMAT \"0x%\"PRIx64\n #elif defined(__WIN32__)\n #define V64_PRINTFORMAT \"0x%I64x\"\n #elif defined(__linux__) && defined(__LP64__)\n #define V64_PRINTFORMAT \"0x%lx\"\n #else\n #define V64_PRINTFORMAT \"0x%llx\"\n #endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n #define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n #define VV_LOCAL_SYMBOL static\n#else\n // 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n // and does not support __has_attribute(visibility) ...\n #ifndef __has_attribute\n #define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n #endif\n #if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n #ifdef ARM\n #define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n #else\n #define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n #endif\n #if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n #define VV_LOCAL_SYMBOL static\n #else\n #define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n #endif\n #else\n #define VV_EXPORTED_SYMBOL extern\n #define VV_LOCAL_SYMBOL static\n #endif\n#endif\n\n#ifdef __cplusplus\n #include \n #define _MOV std::move\n#else\n #define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n #define VWEAK __attribute__((weak))\n #ifdef _MSC_VER\n #undef VWEAK\n #define VWEAK\n #endif\n#endif\n\n#if !defined(VNORETURN)\n #if defined(__TINYC__)\n #include \n #define VNORETURN noreturn\n #endif\n # if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n # define VNORETURN _Noreturn\n # elif defined(__GNUC__) && __GNUC__ >= 2\n # define VNORETURN __attribute__((noreturn))\n # endif\n #ifndef VNORETURN\n #define VNORETURN\n #endif\n#endif\n\n#if !defined(VUNREACHABLE)\n #if defined(__GNUC__) && !defined(__clang__)\n #define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n #if (V_GCC_VERSION >= 40500L)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #if defined(__clang__) && defined(__has_builtin)\n #if __has_builtin(__builtin_unreachable)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #ifndef VUNREACHABLE\n #define VUNREACHABLE() do { } while (0)\n #endif\n #if defined(__FreeBSD__) && defined(__TINYC__)\n #define VUNREACHABLE() do { } while (0)\n #endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n #define _likely_(x) __builtin_expect(x,1)\n #define _unlikely_(x) __builtin_expect(x,0)\n#else\n #define _likely_(x) (x)\n #define _unlikely_(x) (x)\n#endif\n\n\n#define _VFREESTANDING\n\ntypedef long unsigned int size_t;\n\n// Memory allocation related headers\nvoid *malloc(size_t size);\nvoid *calloc(size_t nitems, size_t size);\nvoid *realloc(void *ptr, size_t size);\nvoid *memcpy(void *dest, void *src, size_t n);\nvoid *memset(void *s, int c, size_t n);\nvoid *memmove(void *dest, void *src, size_t n);\n\n// varargs implementation, TODO: works on tcc and gcc, but is very unportable and hacky\ntypedef __builtin_va_list va_list;\n#define va_start(a, b) __builtin_va_start(a, b)\n#define va_end(a) __builtin_va_end(a)\n#define va_arg(a, b) __builtin_va_arg(a, b)\n#define va_copy(a, b) __builtin_va_copy(a, b)\n\n//================================== GLOBALS =================================*/\nint load_so(byteptr);\nvoid _vinit(int ___argc, voidptr ___argv);\nvoid _vcleanup();\n#define sigaction_size sizeof(sigaction);\n#define _ARR_LEN(a) ( (sizeof(a)) / (sizeof(a[0])) )\n\nvoid v_free(voidptr ptr);\nvoidptr memdup(voidptr src, int sz);\n\n"); + _const_v__gen__c__builtins = new_array_from_c_array(8, 8, sizeof(string), _MOV((string[8]){_SLIT("string"), _SLIT("array"), _SLIT("DenseArray"), _SLIT("map"), _SLIT("Error"), _SLIT("IError"), _SLIT("Option"), string_clone(_const_v__gen__c__result_name)})); + _const_v__gen__c__c_headers = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__) || defined(_M_AMD64)\n #define __V_amd64 1\n #undef __V_architecture\n #define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)\n #define __V_arm64 1\n #undef __V_architecture\n #define __V_architecture 2\n#endif\n\n#if defined(__arm__) || defined(_M_ARM)\n #define __V_arm32 1\n #undef __V_architecture\n #define __V_architecture 3\n#endif\n\n#if defined(__i386__) || defined(_M_IX86)\n #define __V_x86 1\n #undef __V_architecture\n #define __V_architecture 6\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n #define __V_GCC__\n#endif\n#ifdef __TINYC__\n #undef __V_GCC__\n#endif\n#ifdef __cplusplus\n #undef __V_GCC__\n#endif\n#ifdef __clang__\n #undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n #undef __V_GCC__\n #undef EMPTY_STRUCT_INITIALIZATION\n #define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n #define _Atomic volatile\n #undef EMPTY_STRUCT_DECLARATION\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #undef EMPTY_ARRAY_OF_ELEMS\n #define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n #undef __NOINLINE\n #undef __IRQHANDLER\n // tcc does not support inlining at all\n #define __NOINLINE\n #define __IRQHANDLER\n #undef TCCSKIP\n #define TCCSKIP(x)\n // #include \n #ifndef _WIN32\n #include \n int tcc_backtrace(const char *fmt, ...);\n #endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n #define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n #ifdef PRIx64\n #define V64_PRINTFORMAT \"0x%\"PRIx64\n #elif defined(__WIN32__)\n #define V64_PRINTFORMAT \"0x%I64x\"\n #elif defined(__linux__) && defined(__LP64__)\n #define V64_PRINTFORMAT \"0x%lx\"\n #else\n #define V64_PRINTFORMAT \"0x%llx\"\n #endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n #define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n #define VV_LOCAL_SYMBOL static\n#else\n // 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n // and does not support __has_attribute(visibility) ...\n #ifndef __has_attribute\n #define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n #endif\n #if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n #ifdef ARM\n #define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n #else\n #define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n #endif\n #if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n #define VV_LOCAL_SYMBOL static\n #else\n #define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n #endif\n #else\n #define VV_EXPORTED_SYMBOL extern\n #define VV_LOCAL_SYMBOL static\n #endif\n#endif\n\n#ifdef __cplusplus\n #include \n #define _MOV std::move\n#else\n #define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n #define VWEAK __attribute__((weak))\n #ifdef _MSC_VER\n #undef VWEAK\n #define VWEAK\n #endif\n#endif\n\n#if !defined(VNORETURN)\n #if defined(__TINYC__)\n #include \n #define VNORETURN noreturn\n #endif\n # if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n # define VNORETURN _Noreturn\n # elif defined(__GNUC__) && __GNUC__ >= 2\n # define VNORETURN __attribute__((noreturn))\n # endif\n #ifndef VNORETURN\n #define VNORETURN\n #endif\n#endif\n\n#if !defined(VUNREACHABLE)\n #if defined(__GNUC__) && !defined(__clang__)\n #define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n #if (V_GCC_VERSION >= 40500L)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #if defined(__clang__) && defined(__has_builtin)\n #if __has_builtin(__builtin_unreachable)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #ifndef VUNREACHABLE\n #define VUNREACHABLE() do { } while (0)\n #endif\n #if defined(__FreeBSD__) && defined(__TINYC__)\n #define VUNREACHABLE() do { } while (0)\n #endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n #define _likely_(x) __builtin_expect(x,1)\n #define _unlikely_(x) __builtin_expect(x,0)\n#else\n #define _likely_(x) (x)\n #define _unlikely_(x) (x)\n#endif\n\n\n// c_headers\ntypedef int (*qsort_callback_func)(const void*, const void*);\n#include // TODO remove all these includes, define all function signatures and types manually\n#include \n#include \n\n#ifndef _WIN32\n #if defined __has_include\n #if __has_include ()\n #include \n #else\n // Most probably musl OR __ANDROID__ ...\n int backtrace (void **__array, int __size) { return 0; }\n char **backtrace_symbols (void *const *__array, int __size){ return 0; }\n void backtrace_symbols_fd (void *const *__array, int __size, int __fd){}\n #endif\n #endif\n#endif\n\n#include // for va_list\n\n//================================== GLOBALS =================================*/\nint load_so(byteptr);\nvoid _vinit(int ___argc, voidptr ___argv);\nvoid _vcleanup(void);\n#define sigaction_size sizeof(sigaction);\n#define _ARR_LEN(a) ( (sizeof(a)) / (sizeof(a[0])) )\n\nvoid v_free(voidptr ptr);\nvoidptr memdup(voidptr src, int sz);\n\n#if INTPTR_MAX == INT32_MAX\n #define TARGET_IS_32BIT 1\n#elif INTPTR_MAX == INT64_MAX\n #define TARGET_IS_64BIT 1\n#else\n #error \"The environment is not 32 or 64-bit.\"\n#endif\n\n#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__)\n #define TARGET_ORDER_IS_BIG 1\n#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_IX86)\n #define TARGET_ORDER_IS_LITTLE 1\n#else\n #error \"Unknown architecture endianness\"\n#endif\n\n#ifndef _WIN32\n #include \n #include // tolower\n #include \n #include // sleep\n extern char **environ;\n#endif\n\n#if defined(__CYGWIN__) && !defined(_WIN32)\n #error Cygwin is not supported, please use MinGW or Visual Studio.\n#endif\n\n#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__vinix__) || defined(__serenity__) || defined(__sun)\n #include \n #include // os__wait uses wait on nix\n#endif\n\n#ifdef __OpenBSD__\n #include \n #include \n #include // os__wait uses wait on nix\n#endif\n\n#ifdef __NetBSD__\n #include // os__wait uses wait on nix\n#endif\n\n#ifdef _WIN32\n #define WINVER 0x0600\n #ifdef _WIN32_WINNT\n #undef _WIN32_WINNT\n #endif\n #define _WIN32_WINNT 0x0600\n #ifndef WIN32_FULL\n #define WIN32_LEAN_AND_MEAN\n #endif\n #ifndef _UNICODE\n #define _UNICODE\n #endif\n #ifndef UNICODE\n #define UNICODE\n #endif\n #include \n\n #include // _waccess\n #include // _wgetcwd\n #include // signal and SIGSEGV for segmentation fault handler\n\n #ifdef _MSC_VER\n // On MSVC these are the same (as long as /volatile:ms is passed)\n #define _Atomic volatile\n\n // MSVC cannot parse some things properly\n #undef EMPTY_STRUCT_DECLARATION\n #undef OPTION_CAST\n\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #define OPTION_CAST(x)\n #undef __NOINLINE\n #undef __IRQHANDLER\n #define __NOINLINE __declspec(noinline)\n #define __IRQHANDLER __declspec(naked)\n\n #include \n #pragma comment(lib, \"Dbghelp\")\n #endif\n#else\n #include \n #ifndef PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP\n // musl does not have that\n #define pthread_rwlockattr_setkind_np(a, b)\n #endif\n#endif\n\n// g_live_info is used by live.info()\nstatic void* g_live_info = NULL;\n\n#if defined(__MINGW32__) || defined(__MINGW64__) || (defined(_WIN32) && defined(__TINYC__))\n #undef PRId64\n #undef PRIi64\n #undef PRIo64\n #undef PRIu64\n #undef PRIx64\n #undef PRIX64\n #define PRId64 \"lld\"\n #define PRIi64 \"lli\"\n #define PRIo64 \"llo\"\n #define PRIu64 \"llu\"\n #define PRIx64 \"llx\"\n #define PRIX64 \"llX\"\n#endif\n\n#ifdef _VFREESTANDING\n#undef _VFREESTANDING\n#endif\n"); + _const_v__gen__c__c_bare_headers = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__) || defined(_M_AMD64)\n #define __V_amd64 1\n #undef __V_architecture\n #define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)\n #define __V_arm64 1\n #undef __V_architecture\n #define __V_architecture 2\n#endif\n\n#if defined(__arm__) || defined(_M_ARM)\n #define __V_arm32 1\n #undef __V_architecture\n #define __V_architecture 3\n#endif\n\n#if defined(__i386__) || defined(_M_IX86)\n #define __V_x86 1\n #undef __V_architecture\n #define __V_architecture 6\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n #define __V_GCC__\n#endif\n#ifdef __TINYC__\n #undef __V_GCC__\n#endif\n#ifdef __cplusplus\n #undef __V_GCC__\n#endif\n#ifdef __clang__\n #undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n #undef __V_GCC__\n #undef EMPTY_STRUCT_INITIALIZATION\n #define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n #define _Atomic volatile\n #undef EMPTY_STRUCT_DECLARATION\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #undef EMPTY_ARRAY_OF_ELEMS\n #define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n #undef __NOINLINE\n #undef __IRQHANDLER\n // tcc does not support inlining at all\n #define __NOINLINE\n #define __IRQHANDLER\n #undef TCCSKIP\n #define TCCSKIP(x)\n // #include \n #ifndef _WIN32\n #include \n int tcc_backtrace(const char *fmt, ...);\n #endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n #define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n #ifdef PRIx64\n #define V64_PRINTFORMAT \"0x%\"PRIx64\n #elif defined(__WIN32__)\n #define V64_PRINTFORMAT \"0x%I64x\"\n #elif defined(__linux__) && defined(__LP64__)\n #define V64_PRINTFORMAT \"0x%lx\"\n #else\n #define V64_PRINTFORMAT \"0x%llx\"\n #endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n #define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n #define VV_LOCAL_SYMBOL static\n#else\n // 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n // and does not support __has_attribute(visibility) ...\n #ifndef __has_attribute\n #define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n #endif\n #if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n #ifdef ARM\n #define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n #else\n #define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n #endif\n #if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n #define VV_LOCAL_SYMBOL static\n #else\n #define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n #endif\n #else\n #define VV_EXPORTED_SYMBOL extern\n #define VV_LOCAL_SYMBOL static\n #endif\n#endif\n\n#ifdef __cplusplus\n #include \n #define _MOV std::move\n#else\n #define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n #define VWEAK __attribute__((weak))\n #ifdef _MSC_VER\n #undef VWEAK\n #define VWEAK\n #endif\n#endif\n\n#if !defined(VNORETURN)\n #if defined(__TINYC__)\n #include \n #define VNORETURN noreturn\n #endif\n # if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n # define VNORETURN _Noreturn\n # elif defined(__GNUC__) && __GNUC__ >= 2\n # define VNORETURN __attribute__((noreturn))\n # endif\n #ifndef VNORETURN\n #define VNORETURN\n #endif\n#endif\n\n#if !defined(VUNREACHABLE)\n #if defined(__GNUC__) && !defined(__clang__)\n #define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n #if (V_GCC_VERSION >= 40500L)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #if defined(__clang__) && defined(__has_builtin)\n #if __has_builtin(__builtin_unreachable)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #ifndef VUNREACHABLE\n #define VUNREACHABLE() do { } while (0)\n #endif\n #if defined(__FreeBSD__) && defined(__TINYC__)\n #define VUNREACHABLE() do { } while (0)\n #endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n #define _likely_(x) __builtin_expect(x,1)\n #define _unlikely_(x) __builtin_expect(x,0)\n#else\n #define _likely_(x) (x)\n #define _unlikely_(x) (x)\n#endif\n\n\n#define _VFREESTANDING\n\ntypedef long unsigned int size_t;\n\n// Memory allocation related headers\nvoid *malloc(size_t size);\nvoid *calloc(size_t nitems, size_t size);\nvoid *realloc(void *ptr, size_t size);\nvoid *memcpy(void *dest, void *src, size_t n);\nvoid *memset(void *s, int c, size_t n);\nvoid *memmove(void *dest, void *src, size_t n);\n\n// varargs implementation, TODO: works on tcc and gcc, but is very unportable and hacky\ntypedef __builtin_va_list va_list;\n#define va_start(a, b) __builtin_va_start(a, b)\n#define va_end(a) __builtin_va_end(a)\n#define va_arg(a, b) __builtin_va_arg(a, b)\n#define va_copy(a, b) __builtin_va_copy(a, b)\n\n//================================== GLOBALS =================================*/\nint load_so(byteptr);\nvoid _vinit(int ___argc, voidptr ___argv);\nvoid _vcleanup();\n#define sigaction_size sizeof(sigaction);\n#define _ARR_LEN(a) ( (sizeof(a)) / (sizeof(a[0])) )\n\nvoid v_free(voidptr ptr);\nvoidptr memdup(voidptr src, int sz);\n\n"); _const_v__gen__c__skip_struct_init = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("struct stat"), _SLIT("struct addrinfo")})); } { // Initializations for module v.scanner : @@ -98660,11 +98960,11 @@ void _vinit(int ___argc, voidptr ___argv) { { // Initializations for module v.builder.cbuilder : } { // Initializations for module main : - _const_main__external_tools = new_array_from_c_array(32, 32, sizeof(string), _MOV((string[32]){ + _const_main__external_tools = new_array_from_c_array(33, 33, sizeof(string), _MOV((string[33]){ _SLIT("ast"), _SLIT("bin2v"), _SLIT("bug"), _SLIT("build-examples"), _SLIT("build-tools"), _SLIT("build-vbinaries"), _SLIT("bump"), _SLIT("check-md"), _SLIT("complete"), - _SLIT("compress"), _SLIT("doc"), _SLIT("doctor"), _SLIT("fmt"), _SLIT("gret"), _SLIT("repl"), _SLIT("self"), _SLIT("setup-freetype"), - _SLIT("shader"), _SLIT("should-compile-all"), _SLIT("symlink"), _SLIT("scan"), _SLIT("test"), _SLIT("test-all"), _SLIT("test-cleancode"), _SLIT("test-fmt"), - _SLIT("test-parser"), _SLIT("test-self"), _SLIT("tracev"), _SLIT("up"), _SLIT("vet"), _SLIT("wipe-cache"), _SLIT("watch")})); + _SLIT("compress"), _SLIT("doc"), _SLIT("doctor"), _SLIT("fmt"), _SLIT("gret"), _SLIT("missdoc"), _SLIT("repl"), _SLIT("self"), + _SLIT("setup-freetype"), _SLIT("shader"), _SLIT("should-compile-all"), _SLIT("symlink"), _SLIT("scan"), _SLIT("test"), _SLIT("test-all"), _SLIT("test-cleancode"), + _SLIT("test-fmt"), _SLIT("test-parser"), _SLIT("test-self"), _SLIT("tracev"), _SLIT("up"), _SLIT("vet"), _SLIT("wipe-cache"), _SLIT("watch")})); _const_main__list_of_flags_that_allow_duplicates = new_array_from_c_array(5, 5, sizeof(string), _MOV((string[5]){_SLIT("cc"), _SLIT("d"), _SLIT("define"), _SLIT("cf"), _SLIT("cflags")})); } } diff --git a/v_win.c b/v_win.c index a32c08e..8b5358a 100644 --- a/v_win.c +++ b/v_win.c @@ -1,11 +1,11 @@ -#define V_COMMIT_HASH "455a52e74" +#define V_COMMIT_HASH "91a9137b3" #ifndef V_COMMIT_HASH - #define V_COMMIT_HASH "9b1f7f5e9" + #define V_COMMIT_HASH "455a52e74" #endif #ifndef V_CURRENT_COMMIT_HASH - #define V_CURRENT_COMMIT_HASH "455a52e" + #define V_CURRENT_COMMIT_HASH "91a9137" #endif // V comptime_definitions: @@ -98,6 +98,7 @@ typedef struct Error Error; typedef struct MessageError MessageError; typedef struct None__ None__; typedef struct Option Option; +typedef struct _result _result; typedef struct VMemoryBlock VMemoryBlock; typedef struct SortedMap SortedMap; typedef struct mapnode mapnode; @@ -544,18 +545,30 @@ static inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (in #define __IRQHANDLER __attribute__((interrupt)) #define __V_architecture 0 -#if defined(__x86_64__) +#if defined(__x86_64__) || defined(_M_AMD64) #define __V_amd64 1 #undef __V_architecture #define __V_architecture 1 #endif -#if defined(__aarch64__) || defined(__arm64__) +#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) #define __V_arm64 1 #undef __V_architecture #define __V_architecture 2 #endif +#if defined(__arm__) || defined(_M_ARM) + #define __V_arm32 1 + #undef __V_architecture + #define __V_architecture 3 +#endif + +#if defined(__i386__) || defined(_M_IX86) + #define __V_x86 1 + #undef __V_architecture + #define __V_architecture 6 +#endif + // Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too: #ifdef __GNUC__ #define __V_GCC__ @@ -605,11 +618,6 @@ static inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (in #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0)) #endif -// returns the number of CPU registers that TYPE takes up -#define _REG_WIDTH(T) (((sizeof(T) + sizeof(void*) - 1) & ~(sizeof(void*) - 1)) / sizeof(void*)) -// parameters of size <= 2 registers are spilled across those two registers; larger types are passed as one pointer to some stack location -#define _REG_WIDTH_BOUNDED(T) (_REG_WIDTH(T) <= 2 ? _REG_WIDTH(T) : 1) - #define OPTION_CAST(x) (x) #ifndef V64_PRINTFORMAT @@ -2075,7 +2083,8 @@ typedef enum { typedef enum { v__ast__OrKind__absent, // v__ast__OrKind__block, // +1 - v__ast__OrKind__propagate, // +2 + v__ast__OrKind__propagate_option, // +2 + v__ast__OrKind__propagate_result, // +3 } v__ast__OrKind; typedef enum { @@ -2108,10 +2117,11 @@ typedef enum { typedef enum { v__ast__TypeFlag__optional, // - v__ast__TypeFlag__variadic, // +1 - v__ast__TypeFlag__generic, // +2 - v__ast__TypeFlag__shared_f, // +3 - v__ast__TypeFlag__atomic_f, // +4 + v__ast__TypeFlag__result, // +1 + v__ast__TypeFlag__variadic, // +2 + v__ast__TypeFlag__generic, // +3 + v__ast__TypeFlag__shared_f, // +4 + v__ast__TypeFlag__atomic_f, // +5 } v__ast__TypeFlag; typedef enum { @@ -2297,6 +2307,13 @@ struct Option { }; + +struct _result { + bool is_error; + IError err; +}; + + typedef array Array_string; typedef array Array_u8; typedef array Array_int; @@ -2442,8 +2459,8 @@ typedef array Array_v__ast__SelectorExpr; typedef array Array_v__pref__GarbageCollectionMode; typedef array Array_v__gen__c__Gen_ptr; typedef array Array_v__ast__Struct; -typedef array Array_v__pref__Arch; typedef array Array_v__ast__CallExpr; +typedef array Array_v__pref__Arch; typedef array Array_v__pref__OS; typedef u8 byte; typedef int i32; @@ -2621,9 +2638,9 @@ struct v__vmod__ModFileAndFolder { // Union sum type v__ast__TypeDecl = -// | 279 = v__ast__AliasTypeDecl -// | 280 = v__ast__FnTypeDecl -// | 281 = v__ast__SumTypeDecl +// | 280 = v__ast__AliasTypeDecl +// | 281 = v__ast__FnTypeDecl +// | 282 = v__ast__SumTypeDecl struct v__ast__TypeDecl { union { v__ast__AliasTypeDecl* _v__ast__AliasTypeDecl; @@ -2639,57 +2656,57 @@ struct v__ast__TypeDecl { // Union sum type v__ast__Expr = -// | 283 = v__ast__AnonFn -// | 284 = v__ast__ArrayDecompose -// | 285 = v__ast__ArrayInit -// | 286 = v__ast__AsCast -// | 287 = v__ast__Assoc -// | 288 = v__ast__AtExpr -// | 289 = v__ast__BoolLiteral -// | 290 = v__ast__CTempVar -// | 291 = v__ast__CallExpr -// | 292 = v__ast__CastExpr -// | 293 = v__ast__ChanInit -// | 294 = v__ast__CharLiteral -// | 295 = v__ast__Comment -// | 296 = v__ast__ComptimeCall -// | 297 = v__ast__ComptimeSelector -// | 298 = v__ast__ComptimeType -// | 299 = v__ast__ConcatExpr -// | 300 = v__ast__DumpExpr -// | 301 = v__ast__EmptyExpr -// | 302 = v__ast__EnumVal -// | 303 = v__ast__FloatLiteral -// | 304 = v__ast__GoExpr -// | 305 = v__ast__Ident -// | 306 = v__ast__IfExpr -// | 307 = v__ast__IfGuardExpr -// | 308 = v__ast__IndexExpr -// | 309 = v__ast__InfixExpr -// | 310 = v__ast__IntegerLiteral -// | 311 = v__ast__IsRefType -// | 312 = v__ast__Likely -// | 313 = v__ast__LockExpr -// | 314 = v__ast__MapInit -// | 315 = v__ast__MatchExpr -// | 316 = v__ast__NodeError -// | 317 = v__ast__None -// | 318 = v__ast__OffsetOf -// | 319 = v__ast__OrExpr -// | 320 = v__ast__ParExpr -// | 321 = v__ast__PostfixExpr -// | 322 = v__ast__PrefixExpr -// | 323 = v__ast__RangeExpr -// | 324 = v__ast__SelectExpr -// | 325 = v__ast__SelectorExpr -// | 326 = v__ast__SizeOf -// | 327 = v__ast__SqlExpr -// | 328 = v__ast__StringInterLiteral -// | 329 = v__ast__StringLiteral -// | 330 = v__ast__StructInit -// | 331 = v__ast__TypeNode -// | 332 = v__ast__TypeOf -// | 333 = v__ast__UnsafeExpr +// | 284 = v__ast__AnonFn +// | 285 = v__ast__ArrayDecompose +// | 286 = v__ast__ArrayInit +// | 287 = v__ast__AsCast +// | 288 = v__ast__Assoc +// | 289 = v__ast__AtExpr +// | 290 = v__ast__BoolLiteral +// | 291 = v__ast__CTempVar +// | 292 = v__ast__CallExpr +// | 293 = v__ast__CastExpr +// | 294 = v__ast__ChanInit +// | 295 = v__ast__CharLiteral +// | 296 = v__ast__Comment +// | 297 = v__ast__ComptimeCall +// | 298 = v__ast__ComptimeSelector +// | 299 = v__ast__ComptimeType +// | 300 = v__ast__ConcatExpr +// | 301 = v__ast__DumpExpr +// | 302 = v__ast__EmptyExpr +// | 303 = v__ast__EnumVal +// | 304 = v__ast__FloatLiteral +// | 305 = v__ast__GoExpr +// | 306 = v__ast__Ident +// | 307 = v__ast__IfExpr +// | 308 = v__ast__IfGuardExpr +// | 309 = v__ast__IndexExpr +// | 310 = v__ast__InfixExpr +// | 311 = v__ast__IntegerLiteral +// | 312 = v__ast__IsRefType +// | 313 = v__ast__Likely +// | 314 = v__ast__LockExpr +// | 315 = v__ast__MapInit +// | 316 = v__ast__MatchExpr +// | 317 = v__ast__NodeError +// | 318 = v__ast__None +// | 319 = v__ast__OffsetOf +// | 320 = v__ast__OrExpr +// | 321 = v__ast__ParExpr +// | 322 = v__ast__PostfixExpr +// | 323 = v__ast__PrefixExpr +// | 324 = v__ast__RangeExpr +// | 325 = v__ast__SelectExpr +// | 326 = v__ast__SelectorExpr +// | 327 = v__ast__SizeOf +// | 328 = v__ast__SqlExpr +// | 329 = v__ast__StringInterLiteral +// | 330 = v__ast__StringLiteral +// | 331 = v__ast__StructInit +// | 332 = v__ast__TypeNode +// | 333 = v__ast__TypeOf +// | 334 = v__ast__UnsafeExpr struct v__ast__Expr { union { v__ast__AnonFn* _v__ast__AnonFn; @@ -2749,33 +2766,33 @@ struct v__ast__Expr { // Union sum type v__ast__Stmt = -// | 335 = v__ast__AsmStmt -// | 336 = v__ast__AssertStmt -// | 337 = v__ast__AssignStmt -// | 338 = v__ast__Block -// | 339 = v__ast__BranchStmt -// | 340 = v__ast__ComptimeFor -// | 341 = v__ast__ConstDecl -// | 342 = v__ast__DeferStmt -// | 343 = v__ast__EmptyStmt -// | 344 = v__ast__EnumDecl -// | 345 = v__ast__ExprStmt -// | 218 = v__ast__FnDecl -// | 346 = v__ast__ForCStmt -// | 347 = v__ast__ForInStmt -// | 348 = v__ast__ForStmt -// | 349 = v__ast__GlobalDecl -// | 350 = v__ast__GotoLabel -// | 351 = v__ast__GotoStmt -// | 352 = v__ast__HashStmt -// | 353 = v__ast__Import -// | 354 = v__ast__InterfaceDecl -// | 355 = v__ast__Module -// | 316 = v__ast__NodeError -// | 356 = v__ast__Return -// | 357 = v__ast__SqlStmt -// | 358 = v__ast__StructDecl -// | 282 = v__ast__TypeDecl +// | 336 = v__ast__AsmStmt +// | 337 = v__ast__AssertStmt +// | 338 = v__ast__AssignStmt +// | 339 = v__ast__Block +// | 340 = v__ast__BranchStmt +// | 341 = v__ast__ComptimeFor +// | 342 = v__ast__ConstDecl +// | 343 = v__ast__DeferStmt +// | 344 = v__ast__EmptyStmt +// | 345 = v__ast__EnumDecl +// | 346 = v__ast__ExprStmt +// | 219 = v__ast__FnDecl +// | 347 = v__ast__ForCStmt +// | 348 = v__ast__ForInStmt +// | 349 = v__ast__ForStmt +// | 350 = v__ast__GlobalDecl +// | 351 = v__ast__GotoLabel +// | 352 = v__ast__GotoStmt +// | 353 = v__ast__HashStmt +// | 354 = v__ast__Import +// | 355 = v__ast__InterfaceDecl +// | 356 = v__ast__Module +// | 317 = v__ast__NodeError +// | 357 = v__ast__Return +// | 358 = v__ast__SqlStmt +// | 359 = v__ast__StructDecl +// | 283 = v__ast__TypeDecl struct v__ast__Stmt { union { v__ast__AsmStmt* _v__ast__AsmStmt; @@ -2812,10 +2829,10 @@ struct v__ast__Stmt { // Union sum type v__ast__ScopeObject = -// | 360 = v__ast__AsmRegister -// | 361 = v__ast__ConstField -// | 362 = v__ast__GlobalField -// | 363 = v__ast__Var +// | 361 = v__ast__AsmRegister +// | 362 = v__ast__ConstField +// | 363 = v__ast__GlobalField +// | 364 = v__ast__Var struct v__ast__ScopeObject { union { v__ast__AsmRegister* _v__ast__AsmRegister; @@ -2830,22 +2847,22 @@ struct v__ast__ScopeObject { // Union sum type v__ast__Node = -// | 365 = v__ast__CallArg -// | 361 = v__ast__ConstField -// | 366 = v__ast__EmptyNode -// | 367 = v__ast__EnumField -// | 334 = v__ast__Expr -// | 209 = v__ast__File -// | 362 = v__ast__GlobalField -// | 368 = v__ast__IfBranch -// | 369 = v__ast__MatchBranch -// | 316 = v__ast__NodeError -// | 370 = v__ast__Param -// | 364 = v__ast__ScopeObject -// | 371 = v__ast__SelectBranch -// | 359 = v__ast__Stmt -// | 372 = v__ast__StructField -// | 373 = v__ast__StructInitField +// | 366 = v__ast__CallArg +// | 362 = v__ast__ConstField +// | 367 = v__ast__EmptyNode +// | 368 = v__ast__EnumField +// | 335 = v__ast__Expr +// | 210 = v__ast__File +// | 363 = v__ast__GlobalField +// | 369 = v__ast__IfBranch +// | 370 = v__ast__MatchBranch +// | 317 = v__ast__NodeError +// | 371 = v__ast__Param +// | 365 = v__ast__ScopeObject +// | 372 = v__ast__SelectBranch +// | 360 = v__ast__Stmt +// | 373 = v__ast__StructField +// | 374 = v__ast__StructInitField struct v__ast__Node { union { v__ast__CallArg* _v__ast__CallArg; @@ -2870,7 +2887,7 @@ struct v__ast__Node { // Union sum type v__ast__ComptTimeConstValue = -// | 301 = v__ast__EmptyExpr +// | 302 = v__ast__EmptyExpr // | 15 = f32 // | 16 = f64 // | 6 = i16 @@ -2904,8 +2921,8 @@ struct v__ast__ComptTimeConstValue { // Union sum type v__ast__IdentInfo = -// | 414 = v__ast__IdentFn -// | 415 = v__ast__IdentVar +// | 415 = v__ast__IdentFn +// | 416 = v__ast__IdentVar struct v__ast__IdentInfo { union { v__ast__IdentFn* _v__ast__IdentFn; @@ -2916,14 +2933,14 @@ struct v__ast__IdentInfo { // Union sum type v__ast__AsmArg = -// | 435 = v__ast__AsmAddressing -// | 436 = v__ast__AsmAlias -// | 437 = v__ast__AsmDisp -// | 360 = v__ast__AsmRegister -// | 289 = v__ast__BoolLiteral -// | 294 = v__ast__CharLiteral -// | 303 = v__ast__FloatLiteral -// | 310 = v__ast__IntegerLiteral +// | 436 = v__ast__AsmAddressing +// | 437 = v__ast__AsmAlias +// | 438 = v__ast__AsmDisp +// | 361 = v__ast__AsmRegister +// | 290 = v__ast__BoolLiteral +// | 295 = v__ast__CharLiteral +// | 304 = v__ast__FloatLiteral +// | 311 = v__ast__IntegerLiteral // | 20 = string struct v__ast__AsmArg { union { @@ -2942,20 +2959,20 @@ struct v__ast__AsmArg { // Union sum type v__ast__TypeInfo = -// | 468 = v__ast__Aggregate -// | 470 = v__ast__Alias -// | 450 = v__ast__Array -// | 478 = v__ast__ArrayFixed -// | 479 = v__ast__Chan -// | 484 = v__ast__Enum -// | 482 = v__ast__FnType -// | 483 = v__ast__GenericInst -// | 473 = v__ast__Interface -// | 451 = v__ast__Map -// | 481 = v__ast__MultiReturn -// | 455 = v__ast__Struct -// | 474 = v__ast__SumType -// | 480 = v__ast__Thread +// | 469 = v__ast__Aggregate +// | 471 = v__ast__Alias +// | 451 = v__ast__Array +// | 479 = v__ast__ArrayFixed +// | 480 = v__ast__Chan +// | 485 = v__ast__Enum +// | 483 = v__ast__FnType +// | 484 = v__ast__GenericInst +// | 474 = v__ast__Interface +// | 452 = v__ast__Map +// | 482 = v__ast__MultiReturn +// | 456 = v__ast__Struct +// | 475 = v__ast__SumType +// | 481 = v__ast__Thread struct v__ast__TypeInfo { union { v__ast__Aggregate* _v__ast__Aggregate; @@ -5930,6 +5947,7 @@ struct v__gen__c__Gen { strings__Builder shared_types; strings__Builder shared_functions; strings__Builder options; + strings__Builder out_results; strings__Builder json_forward_decls; strings__Builder sql_buf; v__ast__File* file; @@ -5956,6 +5974,7 @@ struct v__gen__c__Gen { bool is_cc_msvc; string vlines_path; Map_string_string optionals; + Map_string_string results; __shared__Array_string* done_optionals; Map_string_string chan_pop_optionals; Map_string_string chan_push_optionals; @@ -6815,6 +6834,8 @@ struct Option_v__builder__VsInstallation { }; +// V result_xxx definitions: + // V json forward decls: // V definitions: @@ -7286,6 +7307,7 @@ VV_LOCAL_SYMBOL string None___str(None__ _d1); IError _v_error(string message); IError error_with_code(string message, int code); VV_LOCAL_SYMBOL void opt_ok(voidptr data, Option* option, int size); +VV_LOCAL_SYMBOL void _result_ok(voidptr data, _result* res, int size); string none_str(none _d2); #define _const_prealloc_block_size 16777216 VMemoryBlock* g_memory_block; // global4 @@ -9239,6 +9261,7 @@ Array_int _const_v__ast__pointer_type_idxs; // inited later Array_int _const_v__ast__string_type_idxs; // inited later v__ast__Type _const_v__ast__void_type; // inited later v__ast__Type _const_v__ast__ovoid_type; // inited later +v__ast__Type _const_v__ast__rvoid_type; // inited later v__ast__Type _const_v__ast__voidptr_type; // inited later v__ast__Type _const_v__ast__byteptr_type; // inited later v__ast__Type _const_v__ast__charptr_type; // inited later @@ -9578,6 +9601,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_default(v__gen__c__Gen* g, v__ast__T VV_LOCAL_SYMBOL string v__gen__c__Gen_get_str_fn(v__gen__c__Gen* g, v__ast__Type typ); VV_LOCAL_SYMBOL void v__gen__c__Gen_final_gen_str(v__gen__c__Gen* g, v__gen__c__StrType typ); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_option(v__gen__c__Gen* g, v__ast__Type typ, string styp, string str_fn_name); +VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_result(v__gen__c__Gen* g, v__ast__Type typ, string styp, string str_fn_name); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_alias(v__gen__c__Gen* g, v__ast__Alias info, string styp, string str_fn_name); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_multi_return(v__gen__c__Gen* g, v__ast__MultiReturn info, string styp, string str_fn_name); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_enum(v__gen__c__Gen* g, v__ast__Enum info, string styp, string str_fn_name); @@ -9599,6 +9623,7 @@ Array_string _const_v__gen__c__c_reserved; // inited later Map_string_bool _const_v__gen__c__c_reserved_map; // inited later Array_string _const_v__gen__c__cmp_str; // inited later Array_string _const_v__gen__c__cmp_rev; // inited later +string _const_v__gen__c__result_name; // a string literal, inited later VV_LOCAL_SYMBOL Map_string_bool v__gen__c__string_array_to_map(Array_string a); string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pref__Preferences* pref); VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__PoolProcessor* p, int idx, int wid); @@ -9615,9 +9640,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_expr_string(v__gen__c__Gen* g, v__ast__Exp VV_LOCAL_SYMBOL string v__gen__c__Gen_expr_string_with_cast(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type typ, v__ast__Type exp); VV_LOCAL_SYMBOL string v__gen__c__Gen_expr_string_surround(v__gen__c__Gen* g, string prepend, v__ast__Expr expr, string append); VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_optional_type_name(v__gen__c__Gen* g, v__ast__Type t); +VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_result_type_name(v__gen__c__Gen* g, v__ast__Type t); VV_LOCAL_SYMBOL string v__gen__c__Gen_optional_type_text(v__gen__c__Gen* g, string styp, string base); +VV_LOCAL_SYMBOL string v__gen__c__Gen_result_type_text(v__gen__c__Gen* g, string styp, string base); VV_LOCAL_SYMBOL string v__gen__c__Gen_register_optional(v__gen__c__Gen* g, v__ast__Type t); +VV_LOCAL_SYMBOL string v__gen__c__Gen_register_result(v__gen__c__Gen* g, v__ast__Type t); VV_LOCAL_SYMBOL void v__gen__c__Gen_write_optionals(v__gen__c__Gen* g); +VV_LOCAL_SYMBOL void v__gen__c__Gen_write_results(v__gen__c__Gen* g); VV_LOCAL_SYMBOL string v__gen__c__Gen_find_or_register_shared(v__gen__c__Gen* g, v__ast__Type t, string base); VV_LOCAL_SYMBOL void v__gen__c__Gen_write_shareds(v__gen__c__Gen* g); VV_LOCAL_SYMBOL void v__gen__c__Gen_register_thread_void_wait_call(v__gen__c__Gen* g); @@ -9685,6 +9714,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) VV_LOCAL_SYMBOL void v__gen__c__Gen_cast_expr(v__gen__c__Gen* g, v__ast__CastExpr node); VV_LOCAL_SYMBOL void v__gen__c__Gen_concat_expr(v__gen__c__Gen* g, v__ast__ConcatExpr node); VV_LOCAL_SYMBOL bool v__gen__c__Gen_expr_is_multi_return_call(v__gen__c__Gen* g, v__ast__Expr expr); +VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_result_error(v__gen__c__Gen* g, v__ast__Type target_type, v__ast__Expr expr); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_optional_error(v__gen__c__Gen* g, v__ast__Type target_type, v__ast__Expr expr); VV_LOCAL_SYMBOL void v__gen__c__Gen_return_stmt(v__gen__c__Gen* g, v__ast__Return node); VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl(v__gen__c__Gen* g, v__ast__ConstDecl node); @@ -9728,9 +9758,6 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_check_noscan(v__gen__c__Gen* g, v__ast__Ty string _const_v__gen__c__c_commit_hash_default; // a string literal, inited later string _const_v__gen__c__c_current_commit_hash_default; // a string literal, inited later string _const_v__gen__c__c_concurrency_helpers; // a string literal, inited later -VV_LOCAL_SYMBOL string v__gen__c__arm64_bytes(int nargs); -VV_LOCAL_SYMBOL string v__gen__c__arm32_bytes(int nargs); -VV_LOCAL_SYMBOL string v__gen__c__amd64_bytes(int nargs); VV_LOCAL_SYMBOL string v__gen__c__c_closure_helpers(v__pref__Preferences* pref); string _const_v__gen__c__c_common_macros; // a string literal, inited later string _const_v__gen__c__c_unsigned_comparison_functions; // a string literal, inited later @@ -9773,7 +9800,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_decl(v__gen__c__Gen* g, v__ast__FnDecl no VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_fn_decl(v__gen__c__Gen* g, v__ast__FnDecl* node, bool skip); VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast__FnDecl* node); string _const_v__gen__c__closure_ctx; // a string literal, inited later -VV_LOCAL_SYMBOL string v__gen__c__closure_ctx_struct(v__ast__FnDecl node); +VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__closure_ctx(v__ast__FnDecl node); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn(v__gen__c__Gen* g, v__ast__AnonFn* node); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn_decl(v__gen__c__Gen* g, v__ast__AnonFn* node); VV_LOCAL_SYMBOL string v__gen__c__Gen_defer_flag_var(v__gen__c__Gen* g, v__ast__DeferStmt* stmt); @@ -10198,7 +10225,8 @@ 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__pref__Arch_str(v__pref__Arch it); // 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 @@ -10782,10 +10810,11 @@ void vinit_string_literals(void){ _const_v__checker__vroot_is_deprecated_message = _SLIT("@VROOT is deprecated, use @VMODROOT or @VEXEROOT instead"); _const_v__checker__unicode_lit_overflow_message = _SLIT("unicode character exceeds max allowed value of 0x10ffff, consider using a unicode literal (\\u####)"); _const_v__gen__c__si_s_code = _SLIT("0xfe10"); + _const_v__gen__c__result_name = _SLIT("_result"); _const_v__gen__c__c_commit_hash_default = _SLIT("\n#ifndef V_COMMIT_HASH\n\011#define V_COMMIT_HASH \"@@@\"\n#endif\n"); _const_v__gen__c__c_current_commit_hash_default = _SLIT("\n#ifndef V_CURRENT_COMMIT_HASH\n\011#define V_CURRENT_COMMIT_HASH \"@@@\"\n#endif\n"); _const_v__gen__c__c_concurrency_helpers = _SLIT("\ntypedef struct __shared_map __shared_map;\nstruct __shared_map {\n\011sync__RwMutex mtx;\n\011map val;\n};\nstatic inline voidptr __dup_shared_map(voidptr src, int sz) {\n\011__shared_map* dest = memdup(src, sz);\n\011sync__RwMutex_init(&dest->mtx);\n\011return dest;\n}\ntypedef struct __shared_array __shared_array;\nstruct __shared_array {\n\011sync__RwMutex mtx;\n\011array val;\n};\nstatic inline voidptr __dup_shared_array(voidptr src, int sz) {\n\011__shared_array* dest = memdup(src, sz);\n\011sync__RwMutex_init(&dest->mtx);\n\011return dest;\n}\nstatic inline void __sort_ptr(uintptr_t a[], bool b[], int l) {\n\011for (int i=1; i0 && a[j-1] > ins) {\n\011\011\011a[j] = a[j-1];\n\011\011\011b[j] = b[j-1];\n\011\011\011j--;\n\011\011}\n\011\011a[j] = ins;\n\011\011b[j] = insb;\n\011}\n}\n"); - _const_v__gen__c__c_common_macros = _SLIT("\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__)\n\011#define __V_amd64 1\n\011#undef __V_architecture\n\011#define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__)\n\011#define __V_arm64 1\n\011#undef __V_architecture\n\011#define __V_architecture 2\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n\011#define __V_GCC__\n#endif\n#ifdef __TINYC__\n\011#undef __V_GCC__\n#endif\n#ifdef __cplusplus\n\011#undef __V_GCC__\n#endif\n#ifdef __clang__\n\011#undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n\011#undef __V_GCC__\n\011#undef EMPTY_STRUCT_INITIALIZATION\n\011#define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n\011#define _Atomic volatile\n\011#undef EMPTY_STRUCT_DECLARATION\n\011#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n\011#undef EMPTY_ARRAY_OF_ELEMS\n\011#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n\011#undef __NOINLINE\n\011#undef __IRQHANDLER\n\011// tcc does not support inlining at all\n\011#define __NOINLINE\n\011#define __IRQHANDLER\n\011#undef TCCSKIP\n\011#define TCCSKIP(x)\n\011// #include \n\011#ifndef _WIN32\n\011\011#include \n\011\011int tcc_backtrace(const char *fmt, ...);\n\011#endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n\011#define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n\011#define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n// returns the number of CPU registers that TYPE takes up\n#define _REG_WIDTH(T) (((sizeof(T) + sizeof(void*) - 1) & ~(sizeof(void*) - 1)) / sizeof(void*))\n// parameters of size <= 2 registers are spilled across those two registers; larger types are passed as one pointer to some stack location\n#define _REG_WIDTH_BOUNDED(T) (_REG_WIDTH(T) <= 2 ? _REG_WIDTH(T) : 1)\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n\011#ifdef PRIx64\n\011\011#define V64_PRINTFORMAT \"0x%\"PRIx64\n\011#elif defined(__WIN32__)\n\011\011#define V64_PRINTFORMAT \"0x%I64x\"\n\011#elif defined(__linux__) && defined(__LP64__)\n\011\011#define V64_PRINTFORMAT \"0x%lx\"\n\011#else\n\011\011#define V64_PRINTFORMAT \"0x%llx\"\n\011#endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n\011#define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n\011#define VV_LOCAL_SYMBOL static\n#else\n\011// 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n\011// and does not support __has_attribute(visibility) ...\n\011#ifndef __has_attribute\n\011\011#define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n\011#endif\n\011#if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n\011\011#ifdef ARM\n\011\011\011#define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n\011\011#else\n\011\011\011#define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n\011\011#endif\n\011\011#if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n\011\011\011#define VV_LOCAL_SYMBOL static\n\011\011#else\n\011\011\011#define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n\011\011#endif\n\011#else\n\011\011#define VV_EXPORTED_SYMBOL extern\n\011\011#define VV_LOCAL_SYMBOL static\n\011#endif\n#endif\n\n#ifdef __cplusplus\n\011#include \n\011#define _MOV std::move\n#else\n\011#define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n\011#define VWEAK __attribute__((weak))\n\011#ifdef _MSC_VER\n\011\011#undef VWEAK\n\011\011#define VWEAK\n\011#endif\n#endif\n\n#if !defined(VNORETURN)\n\011#if defined(__TINYC__)\n\011\011#include \n\011\011#define VNORETURN noreturn\n\011#endif\n\011# if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n\011# define VNORETURN _Noreturn\n\011# elif defined(__GNUC__) && __GNUC__ >= 2\n\011# define VNORETURN __attribute__((noreturn))\n\011# endif\n\011#ifndef VNORETURN\n\011\011#define VNORETURN\n\011#endif\n#endif\n\n#if !defined(VUNREACHABLE)\n\011#if defined(__GNUC__) && !defined(__clang__)\n\011\011#define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n\011\011#if (V_GCC_VERSION >= 40500L)\n\011\011\011#define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n\011\011#endif\n\011#endif\n\011#if defined(__clang__) && defined(__has_builtin)\n\011\011#if __has_builtin(__builtin_unreachable)\n\011\011\011#define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n\011\011#endif\n\011#endif\n\011#ifndef VUNREACHABLE\n\011\011#define VUNREACHABLE() do { } while (0)\n\011#endif\n\011#if defined(__FreeBSD__) && defined(__TINYC__)\n\011\011#define VUNREACHABLE() do { } while (0)\n\011#endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n\011#define _likely_(x) __builtin_expect(x,1)\n\011#define _unlikely_(x) __builtin_expect(x,0)\n#else\n\011#define _likely_(x) (x)\n\011#define _unlikely_(x) (x)\n#endif\n\n"); + _const_v__gen__c__c_common_macros = _SLIT("\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__) || defined(_M_AMD64)\n\011#define __V_amd64 1\n\011#undef __V_architecture\n\011#define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)\n\011#define __V_arm64 1\n\011#undef __V_architecture\n\011#define __V_architecture 2\n#endif\n\n#if defined(__arm__) || defined(_M_ARM)\n\011#define __V_arm32 1\n\011#undef __V_architecture\n\011#define __V_architecture 3\n#endif\n\n#if defined(__i386__) || defined(_M_IX86)\n\011#define __V_x86 1\n\011#undef __V_architecture\n\011#define __V_architecture 6\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n\011#define __V_GCC__\n#endif\n#ifdef __TINYC__\n\011#undef __V_GCC__\n#endif\n#ifdef __cplusplus\n\011#undef __V_GCC__\n#endif\n#ifdef __clang__\n\011#undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n\011#undef __V_GCC__\n\011#undef EMPTY_STRUCT_INITIALIZATION\n\011#define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n\011#define _Atomic volatile\n\011#undef EMPTY_STRUCT_DECLARATION\n\011#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n\011#undef EMPTY_ARRAY_OF_ELEMS\n\011#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n\011#undef __NOINLINE\n\011#undef __IRQHANDLER\n\011// tcc does not support inlining at all\n\011#define __NOINLINE\n\011#define __IRQHANDLER\n\011#undef TCCSKIP\n\011#define TCCSKIP(x)\n\011// #include \n\011#ifndef _WIN32\n\011\011#include \n\011\011int tcc_backtrace(const char *fmt, ...);\n\011#endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n\011#define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n\011#define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n\011#ifdef PRIx64\n\011\011#define V64_PRINTFORMAT \"0x%\"PRIx64\n\011#elif defined(__WIN32__)\n\011\011#define V64_PRINTFORMAT \"0x%I64x\"\n\011#elif defined(__linux__) && defined(__LP64__)\n\011\011#define V64_PRINTFORMAT \"0x%lx\"\n\011#else\n\011\011#define V64_PRINTFORMAT \"0x%llx\"\n\011#endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n\011#define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n\011#define VV_LOCAL_SYMBOL static\n#else\n\011// 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n\011// and does not support __has_attribute(visibility) ...\n\011#ifndef __has_attribute\n\011\011#define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n\011#endif\n\011#if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n\011\011#ifdef ARM\n\011\011\011#define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n\011\011#else\n\011\011\011#define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n\011\011#endif\n\011\011#if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n\011\011\011#define VV_LOCAL_SYMBOL static\n\011\011#else\n\011\011\011#define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n\011\011#endif\n\011#else\n\011\011#define VV_EXPORTED_SYMBOL extern\n\011\011#define VV_LOCAL_SYMBOL static\n\011#endif\n#endif\n\n#ifdef __cplusplus\n\011#include \n\011#define _MOV std::move\n#else\n\011#define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n\011#define VWEAK __attribute__((weak))\n\011#ifdef _MSC_VER\n\011\011#undef VWEAK\n\011\011#define VWEAK\n\011#endif\n#endif\n\n#if !defined(VNORETURN)\n\011#if defined(__TINYC__)\n\011\011#include \n\011\011#define VNORETURN noreturn\n\011#endif\n\011# if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n\011# define VNORETURN _Noreturn\n\011# elif defined(__GNUC__) && __GNUC__ >= 2\n\011# define VNORETURN __attribute__((noreturn))\n\011# endif\n\011#ifndef VNORETURN\n\011\011#define VNORETURN\n\011#endif\n#endif\n\n#if !defined(VUNREACHABLE)\n\011#if defined(__GNUC__) && !defined(__clang__)\n\011\011#define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n\011\011#if (V_GCC_VERSION >= 40500L)\n\011\011\011#define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n\011\011#endif\n\011#endif\n\011#if defined(__clang__) && defined(__has_builtin)\n\011\011#if __has_builtin(__builtin_unreachable)\n\011\011\011#define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n\011\011#endif\n\011#endif\n\011#ifndef VUNREACHABLE\n\011\011#define VUNREACHABLE() do { } while (0)\n\011#endif\n\011#if defined(__FreeBSD__) && defined(__TINYC__)\n\011\011#define VUNREACHABLE() do { } while (0)\n\011#endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n\011#define _likely_(x) __builtin_expect(x,1)\n\011#define _unlikely_(x) __builtin_expect(x,0)\n#else\n\011#define _likely_(x) (x)\n\011#define _unlikely_(x) (x)\n#endif\n\n"); _const_v__gen__c__c_unsigned_comparison_functions = _SLIT("\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n"); _const_v__gen__c__c_helper_macros = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n"); _const_v__gen__c__c_builtin_types = _SLIT("\n//================================== builtin types ================================*/\ntypedef int64_t i64;\ntypedef int16_t i16;\ntypedef int8_t i8;\ntypedef uint64_t u64;\ntypedef uint32_t u32;\ntypedef uint8_t u8;\ntypedef uint16_t u16;\n//typedef uint8_t byte;\ntypedef uint32_t rune;\ntypedef size_t usize;\ntypedef ptrdiff_t isize;\n#ifndef VNOFLOAT\ntypedef float f32;\ntypedef double f64;\n#else\ntypedef int32_t f32;\ntypedef int64_t f64;\n#endif\ntypedef int64_t int_literal;\n#ifndef VNOFLOAT\ntypedef double float_literal;\n#else\ntypedef int64_t float_literal;\n#endif\ntypedef unsigned char* byteptr;\ntypedef void* voidptr;\ntypedef char* charptr;\ntypedef u8 array_fixed_byte_300 [300];\n\ntypedef struct sync__Channel* chan;\n\n#ifndef __cplusplus\n\011#ifndef bool\n\011\011#ifdef CUSTOM_DEFINE_4bytebool\n\011\011\011typedef int bool;\n\011\011#else\n\011\011\011typedef u8 bool;\n\011\011#endif\n\011\011#define true 1\n\011\011#define false 0\n\011#endif\n#endif\n\ntypedef u64 (*MapHashFn)(voidptr);\ntypedef bool (*MapEqFn)(voidptr, voidptr);\ntypedef void (*MapCloneFn)(voidptr, voidptr);\ntypedef void (*MapFreeFn)(voidptr);\n"); @@ -10916,22 +10945,7 @@ 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__pref__Arch_str(v__pref__Arch it) { /* gen_str_for_enum */ - switch(it) { - case v__pref__Arch___auto: return _SLIT("_auto"); - case v__pref__Arch__amd64: return _SLIT("amd64"); - case v__pref__Arch__arm64: return _SLIT("arm64"); - case v__pref__Arch__arm32: return _SLIT("arm32"); - case v__pref__Arch__rv64: return _SLIT("rv64"); - case v__pref__Arch__rv32: return _SLIT("rv32"); - case v__pref__Arch__i386: return _SLIT("i386"); - case v__pref__Arch__js_node: return _SLIT("js_node"); - case v__pref__Arch__js_browser: return _SLIT("js_browser"); - case v__pref__Arch__js_freestanding: return _SLIT("js_freestanding"); - case v__pref__Arch___max: return _SLIT("_max"); - default: return _SLIT("unknown enum value"); - } -} +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"); @@ -11095,7 +11109,8 @@ static string v__ast__OrKind_str(v__ast__OrKind it) { /* gen_str_for_enum */ switch(it) { case v__ast__OrKind__absent: return _SLIT("absent"); case v__ast__OrKind__block: return _SLIT("block"); - case v__ast__OrKind__propagate: return _SLIT("propagate"); + case v__ast__OrKind__propagate_option: return _SLIT("propagate_option"); + case v__ast__OrKind__propagate_result: return _SLIT("propagate_result"); default: return _SLIT("unknown enum value"); } } @@ -11231,59 +11246,59 @@ static string indent_v__ast__CallExpr_str(v__ast__CallExpr it, int indent_count) static string indent_v__ast__TypeInfo_str(v__ast__TypeInfo x, int indent_count) { switch(x._typ) { - case 468: return str_intp(2, _MOV((StrIntpData[]){ + case 469: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Aggregate_str(*(v__ast__Aggregate*)x._v__ast__Aggregate, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 470: return str_intp(2, _MOV((StrIntpData[]){ + case 471: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Alias_str(*(v__ast__Alias*)x._v__ast__Alias, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 450: return str_intp(2, _MOV((StrIntpData[]){ + case 451: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Array_str(*(v__ast__Array*)x._v__ast__Array, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 478: return str_intp(2, _MOV((StrIntpData[]){ + case 479: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__ArrayFixed_str(*(v__ast__ArrayFixed*)x._v__ast__ArrayFixed, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 479: return str_intp(2, _MOV((StrIntpData[]){ + case 480: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Chan_str(*(v__ast__Chan*)x._v__ast__Chan, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 484: return str_intp(2, _MOV((StrIntpData[]){ + case 485: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Enum_str(*(v__ast__Enum*)x._v__ast__Enum, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 482: return str_intp(2, _MOV((StrIntpData[]){ + case 483: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__FnType_str(*(v__ast__FnType*)x._v__ast__FnType, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 483: return str_intp(2, _MOV((StrIntpData[]){ + case 484: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__GenericInst_str(*(v__ast__GenericInst*)x._v__ast__GenericInst, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 473: return str_intp(2, _MOV((StrIntpData[]){ + case 474: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Interface_str(*(v__ast__Interface*)x._v__ast__Interface, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 451: return str_intp(2, _MOV((StrIntpData[]){ + case 452: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Map_str(*(v__ast__Map*)x._v__ast__Map, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 481: return str_intp(2, _MOV((StrIntpData[]){ + case 482: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__MultiReturn_str(*(v__ast__MultiReturn*)x._v__ast__MultiReturn, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 455: return str_intp(2, _MOV((StrIntpData[]){ + case 456: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Struct_str(*(v__ast__Struct*)x._v__ast__Struct, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 474: return str_intp(2, _MOV((StrIntpData[]){ + case 475: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__SumType_str(*(v__ast__SumType*)x._v__ast__SumType, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 480: return str_intp(2, _MOV((StrIntpData[]){ + case 481: return str_intp(2, _MOV((StrIntpData[]){ {_SLIT("v.ast.TypeInfo("), 0xfe10, {.d_s = indent_v__ast__Thread_str(*(v__ast__Thread*)x._v__ast__Thread, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); @@ -11362,143 +11377,133 @@ static string indent_v__token__Pos_str(v__token__Pos it, int indent_count) { return res; } -static string indent_v__ast__OrExpr_str(v__ast__OrExpr it, int indent_count) { +static string indent_v__ast__EnumVal_str(v__ast__EnumVal it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - 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}}, + 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}}, {_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__Aggregate_str(v__ast__Aggregate 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 _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 _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.Aggregate{\n"), 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("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(&_t32); 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 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}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, + })); + string_free(&_t34); + string_free(&_t33); + string_free(&_t32); 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 _t33 = v__ast__Type_str(it.parent_type); - string _t34 = v__ast__Language_str(it.language); + string _t35 = v__ast__Type_str(it.parent_type); + string _t36 = 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=_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}}, + {_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}}, {_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(&_t34); - string_free(&_t33); + string_free(&_t36); + string_free(&_t35); 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 _t35 = v__ast__Type_str(it.elem_type); + string _t37 = 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=_t35}}, {_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(&_t35); + string_free(&_t37); 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 _t36 = v__ast__Expr_str(it.size_expr); - string _t37 = v__ast__Type_str(it.elem_type); + string _t38 = v__ast__Expr_str(it.size_expr); + string _t39 = 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: "), 0, {.d_c=0}}, {_SLIT(""), 7, {.d_i32=it.size}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 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(" elem_type: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t37}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" size_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t38}}, {_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("}"), 0, {.d_c=0}}, })); - string_free(&_t37); - string_free(&_t36); + string_free(&_t39); + string_free(&_t38); 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 _t38 = v__ast__Type_str(it.elem_type); + string _t40 = 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=_t38}}, {_SLIT(""), 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}}, {_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( 15, _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("}"), 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__GenericInst_str(v__ast__GenericInst it, int indent_count) { +static string indent_v__ast__Enum_str(v__ast__Enum it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - 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}}, + string _t41 = Array_string_str(it.vals); + string res = str_intp( 15, _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("}"), 0, {.d_c=0}}, })); string_free(&_t41); @@ -11506,428 +11511,457 @@ static string indent_v__ast__GenericInst_str(v__ast__GenericInst it, int indent_ return res; } -static string indent_v__ast__Interface_str(v__ast__Interface it, int indent_count) { +static string indent_v__ast__FnType_str(v__ast__FnType it, int indent_count) { string indents = string_repeat(_SLIT(" "), indent_count); - string _t42 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); - string _t43 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); - string _t44 = indent_Array_v__ast__Fn_str(it.methods, indent_count + 1); - string _t45 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); - string _t46 = indent_Map_int_Array_v__ast__Type_str(it.conversions, 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(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t42}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t43}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" methods: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t44}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t45}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" conversions: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t46}}, {_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(" 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}}, + 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_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t45 = indent_Array_v__ast__StructField_str(it.fields, indent_count + 1); + string _t46 = indent_Array_v__ast__Fn_str(it.methods, indent_count + 1); + string _t47 = indent_Array_v__ast__Type_str(it.embeds, indent_count + 1); + string _t48 = indent_Map_int_Array_v__ast__Type_str(it.conversions, 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 res = str_intp( 39, _MOV((StrIntpData[]){ + {_SLIT("v.ast.Interface{\n"), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" types: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t44}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" fields: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t45}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" methods: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t46}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" embeds: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t47}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" conversions: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t48}}, {_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(" 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}}, + {_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 _t50 = v__ast__Type_str(it.key_type); - string _t51 = v__ast__Type_str(it.value_type); + string _t52 = v__ast__Type_str(it.key_type); + string _t53 = 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=_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}}, + {_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}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t51); - string_free(&_t50); + string_free(&_t53); + string_free(&_t52); 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 _t52 = indent_Array_v__ast__Type_str(it.types, indent_count + 1); + string _t54 = 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=_t52}}, {_SLIT(""), 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}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t52); + string_free(&_t54); 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 _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 _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 res = str_intp( 43, _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=_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}}, + {_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(" 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}}, {_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(" 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(" 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}}, {_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 _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 _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 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=_t59}}, {_SLIT(""), 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(" 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(" 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(" 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}}, {_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 _t64 = v__ast__Type_str(it.return_type); + string _t66 = 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=_t64}}, {_SLIT(""), 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}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT("}"), 0, {.d_c=0}}, })); - string_free(&_t64); + string_free(&_t66); 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 _t65 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t67 = 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=_t65}}, {_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("}"), 0, {.d_c=0}}, })); - string_free(&_t65); + string_free(&_t67); 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 _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 _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 res = str_intp( 31, _MOV((StrIntpData[]){ {_SLIT("v.ast.Param{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t66}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 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(" name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.name}}, {_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(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t67}}, {_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(" 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(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t68}}, {_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("}"), 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 _t69 = indent_v__token__Pos_str(it.pos, indent_count + 1); - string _t70 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); - 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 = v__ast__Type_str(it.default_expr_typ); - string _t75 = v__ast__Type_str(it.typ); + string _t71 = indent_v__token__Pos_str(it.pos, indent_count + 1); + string _t72 = indent_v__token__Pos_str(it.type_pos, indent_count + 1); + string _t73 = indent_Array_v__ast__Comment_str(it.comments, indent_count + 1); + string _t74 = indent_Array_v__ast__Attr_str(it.attrs, indent_count + 1); + string _t75 = v__ast__Expr_str(it.default_expr); + string _t76 = v__ast__Type_str(it.default_expr_typ); + string _t77 = v__ast__Type_str(it.typ); string res = str_intp( 59, _MOV((StrIntpData[]){ {_SLIT("v.ast.StructField{\n"), 0, {.d_c=0}}, - {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t69}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t70}}, {_SLIT(""), 0, {.d_c=0}}, - {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" comments: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t71}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT0, 0xfe10, {.d_s=indents}}, {_SLIT(" pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t71}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" type_pos: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t72}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" comments: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t73}}, {_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(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t72}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" attrs: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t74}}, {_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(" 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(" 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_global: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_global ? _SLIT("true") : _SLIT("false")}}, {_SLIT(""), 0, {.d_c=0}}, {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" is_volatile: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=it.is_volatile ? _SLIT("true") : _SLIT("false")}}, {_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_typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t74}}, {_SLIT(""), 0, {.d_c=0}}, + {_SLIT("\n"), 0xfe10, {.d_s=indents}}, {_SLIT(" default_expr: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t75}}, {_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(" name: "), 0, {.d_c=0}}, {_SLIT("'"), 16, {.d_s=it.name}}, {_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(" typ: "), 0, {.d_c=0}}, {_SLIT(""), 16, {.d_s=_t77}}, {_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; } static inline v__ast__Expr v__ast__EmptyExpr_to_sumtype_v__ast__Expr(v__ast__EmptyExpr* x) { v__ast__EmptyExpr* ptr = memdup(x, sizeof(v__ast__EmptyExpr)); - return (v__ast__Expr){ ._v__ast__EmptyExpr = ptr, ._typ = 301}; + return (v__ast__Expr){ ._v__ast__EmptyExpr = ptr, ._typ = 302}; } static inline v__ast__Stmt v__ast__EmptyStmt_to_sumtype_v__ast__Stmt(v__ast__EmptyStmt* x) { v__ast__EmptyStmt* ptr = memdup(x, sizeof(v__ast__EmptyStmt)); - return (v__ast__Stmt){ ._v__ast__EmptyStmt = ptr, ._typ = 343, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EmptyStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__EmptyStmt = ptr, ._typ = 344, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EmptyStmt, pos))}; } static inline v__ast__Node v__ast__EmptyNode_to_sumtype_v__ast__Node(v__ast__EmptyNode* x) { v__ast__EmptyNode* ptr = memdup(x, sizeof(v__ast__EmptyNode)); - return (v__ast__Node){ ._v__ast__EmptyNode = ptr, ._typ = 366}; + return (v__ast__Node){ ._v__ast__EmptyNode = ptr, ._typ = 367}; } static inline v__ast__Node v__ast__Expr_to_sumtype_v__ast__Node(v__ast__Expr* x) { v__ast__Expr* ptr = memdup(x, sizeof(v__ast__Expr)); - return (v__ast__Node){ ._v__ast__Expr = ptr, ._typ = 334}; + return (v__ast__Node){ ._v__ast__Expr = ptr, ._typ = 335}; } static inline v__ast__Node v__ast__Stmt_to_sumtype_v__ast__Node(v__ast__Stmt* x) { v__ast__Stmt* ptr = memdup(x, sizeof(v__ast__Stmt)); - return (v__ast__Node){ ._v__ast__Stmt = ptr, ._typ = 359}; + return (v__ast__Node){ ._v__ast__Stmt = ptr, ._typ = 360}; } static inline v__ast__Node v__ast__StructInitField_to_sumtype_v__ast__Node(v__ast__StructInitField* x) { v__ast__StructInitField* ptr = memdup(x, sizeof(v__ast__StructInitField)); - return (v__ast__Node){ ._v__ast__StructInitField = ptr, ._typ = 373}; + return (v__ast__Node){ ._v__ast__StructInitField = ptr, ._typ = 374}; } static inline v__ast__Stmt v__ast__FnDecl_to_sumtype_v__ast__Stmt(v__ast__FnDecl* x) { v__ast__FnDecl* ptr = memdup(x, sizeof(v__ast__FnDecl)); - return (v__ast__Stmt){ ._v__ast__FnDecl = ptr, ._typ = 218, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__FnDecl = ptr, ._typ = 219, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnDecl, pos))}; } static inline v__ast__Node v__ast__CallArg_to_sumtype_v__ast__Node(v__ast__CallArg* x) { v__ast__CallArg* ptr = memdup(x, sizeof(v__ast__CallArg)); - return (v__ast__Node){ ._v__ast__CallArg = ptr, ._typ = 365}; + return (v__ast__Node){ ._v__ast__CallArg = ptr, ._typ = 366}; } static inline v__ast__Expr v__ast__OrExpr_to_sumtype_v__ast__Expr(v__ast__OrExpr* x) { v__ast__OrExpr* ptr = memdup(x, sizeof(v__ast__OrExpr)); - return (v__ast__Expr){ ._v__ast__OrExpr = ptr, ._typ = 319}; + return (v__ast__Expr){ ._v__ast__OrExpr = ptr, ._typ = 320}; } static inline v__ast__Node v__ast__IfBranch_to_sumtype_v__ast__Node(v__ast__IfBranch* x) { v__ast__IfBranch* ptr = memdup(x, sizeof(v__ast__IfBranch)); - return (v__ast__Node){ ._v__ast__IfBranch = ptr, ._typ = 368}; + return (v__ast__Node){ ._v__ast__IfBranch = ptr, ._typ = 369}; } static inline v__ast__Node v__ast__MatchBranch_to_sumtype_v__ast__Node(v__ast__MatchBranch* x) { v__ast__MatchBranch* ptr = memdup(x, sizeof(v__ast__MatchBranch)); - return (v__ast__Node){ ._v__ast__MatchBranch = ptr, ._typ = 369}; + return (v__ast__Node){ ._v__ast__MatchBranch = ptr, ._typ = 370}; } static inline v__ast__Node v__ast__SelectBranch_to_sumtype_v__ast__Node(v__ast__SelectBranch* x) { v__ast__SelectBranch* ptr = memdup(x, sizeof(v__ast__SelectBranch)); - return (v__ast__Node){ ._v__ast__SelectBranch = ptr, ._typ = 371}; + return (v__ast__Node){ ._v__ast__SelectBranch = ptr, ._typ = 372}; } static inline v__ast__Node v__ast__StructField_to_sumtype_v__ast__Node(v__ast__StructField* x) { v__ast__StructField* ptr = memdup(x, sizeof(v__ast__StructField)); - return (v__ast__Node){ ._v__ast__StructField = ptr, ._typ = 372}; + return (v__ast__Node){ ._v__ast__StructField = ptr, ._typ = 373}; } static inline v__ast__Node v__ast__GlobalField_to_sumtype_v__ast__Node(v__ast__GlobalField* x) { v__ast__GlobalField* ptr = memdup(x, sizeof(v__ast__GlobalField)); - return (v__ast__Node){ ._v__ast__GlobalField = ptr, ._typ = 362}; + return (v__ast__Node){ ._v__ast__GlobalField = ptr, ._typ = 363}; } static inline v__ast__Node v__ast__ConstField_to_sumtype_v__ast__Node(v__ast__ConstField* x) { v__ast__ConstField* ptr = memdup(x, sizeof(v__ast__ConstField)); - return (v__ast__Node){ ._v__ast__ConstField = ptr, ._typ = 361}; + return (v__ast__Node){ ._v__ast__ConstField = ptr, ._typ = 362}; } static inline v__ast__Node v__ast__EnumField_to_sumtype_v__ast__Node(v__ast__EnumField* x) { v__ast__EnumField* ptr = memdup(x, sizeof(v__ast__EnumField)); - return (v__ast__Node){ ._v__ast__EnumField = ptr, ._typ = 367}; + return (v__ast__Node){ ._v__ast__EnumField = ptr, ._typ = 368}; } static inline v__ast__Node v__ast__Param_to_sumtype_v__ast__Node(v__ast__Param* x) { v__ast__Param* ptr = memdup(x, sizeof(v__ast__Param)); - return (v__ast__Node){ ._v__ast__Param = ptr, ._typ = 370}; + return (v__ast__Node){ ._v__ast__Param = ptr, ._typ = 371}; } static inline v__ast__Expr v__ast__TypeNode_to_sumtype_v__ast__Expr(v__ast__TypeNode* x) { v__ast__TypeNode* ptr = memdup(x, sizeof(v__ast__TypeNode)); - return (v__ast__Expr){ ._v__ast__TypeNode = ptr, ._typ = 331}; + return (v__ast__Expr){ ._v__ast__TypeNode = ptr, ._typ = 332}; } static inline v__ast__ScopeObject v__ast__AsmRegister_to_sumtype_v__ast__ScopeObject(v__ast__AsmRegister* x) { v__ast__AsmRegister* ptr = memdup(x, sizeof(v__ast__AsmRegister)); - return (v__ast__ScopeObject){ ._v__ast__AsmRegister = ptr, ._typ = 360, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmRegister, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmRegister, typ))}; + return (v__ast__ScopeObject){ ._v__ast__AsmRegister = ptr, ._typ = 361, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmRegister, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmRegister, typ))}; } static inline v__ast__ComptTimeConstValue v__ast__EmptyExpr_to_sumtype_v__ast__ComptTimeConstValue(v__ast__EmptyExpr* x) { v__ast__EmptyExpr* ptr = memdup(x, sizeof(v__ast__EmptyExpr)); - return (v__ast__ComptTimeConstValue){ ._v__ast__EmptyExpr = ptr, ._typ = 301}; + return (v__ast__ComptTimeConstValue){ ._v__ast__EmptyExpr = ptr, ._typ = 302}; } static inline v__ast__Expr v__ast__ArrayInit_to_sumtype_v__ast__Expr(v__ast__ArrayInit* x) { v__ast__ArrayInit* ptr = memdup(x, sizeof(v__ast__ArrayInit)); - return (v__ast__Expr){ ._v__ast__ArrayInit = ptr, ._typ = 285}; + return (v__ast__Expr){ ._v__ast__ArrayInit = ptr, ._typ = 286}; } static inline v__ast__Expr v__ast__StringLiteral_to_sumtype_v__ast__Expr(v__ast__StringLiteral* x) { v__ast__StringLiteral* ptr = memdup(x, sizeof(v__ast__StringLiteral)); - return (v__ast__Expr){ ._v__ast__StringLiteral = ptr, ._typ = 329}; + return (v__ast__Expr){ ._v__ast__StringLiteral = ptr, ._typ = 330}; } static inline v__ast__Expr v__ast__MapInit_to_sumtype_v__ast__Expr(v__ast__MapInit* x) { v__ast__MapInit* ptr = memdup(x, sizeof(v__ast__MapInit)); - return (v__ast__Expr){ ._v__ast__MapInit = ptr, ._typ = 314}; + return (v__ast__Expr){ ._v__ast__MapInit = ptr, ._typ = 315}; } static inline v__ast__Expr v__ast__StructInit_to_sumtype_v__ast__Expr(v__ast__StructInit* x) { v__ast__StructInit* ptr = memdup(x, sizeof(v__ast__StructInit)); - return (v__ast__Expr){ ._v__ast__StructInit = ptr, ._typ = 330}; + return (v__ast__Expr){ ._v__ast__StructInit = ptr, ._typ = 331}; } static inline v__ast__TypeInfo v__ast__SumType_to_sumtype_v__ast__TypeInfo(v__ast__SumType* x) { v__ast__SumType* ptr = memdup(x, sizeof(v__ast__SumType)); - return (v__ast__TypeInfo){ ._v__ast__SumType = ptr, ._typ = 474}; + return (v__ast__TypeInfo){ ._v__ast__SumType = ptr, ._typ = 475}; } static inline v__ast__TypeInfo v__ast__Chan_to_sumtype_v__ast__TypeInfo(v__ast__Chan* x) { v__ast__Chan* ptr = memdup(x, sizeof(v__ast__Chan)); - return (v__ast__TypeInfo){ ._v__ast__Chan = ptr, ._typ = 479}; + return (v__ast__TypeInfo){ ._v__ast__Chan = ptr, ._typ = 480}; } static inline v__ast__TypeInfo v__ast__Map_to_sumtype_v__ast__TypeInfo(v__ast__Map* x) { v__ast__Map* ptr = memdup(x, sizeof(v__ast__Map)); - return (v__ast__TypeInfo){ ._v__ast__Map = ptr, ._typ = 451}; + return (v__ast__TypeInfo){ ._v__ast__Map = ptr, ._typ = 452}; } static inline v__ast__TypeInfo v__ast__Thread_to_sumtype_v__ast__TypeInfo(v__ast__Thread* x) { v__ast__Thread* ptr = memdup(x, sizeof(v__ast__Thread)); - return (v__ast__TypeInfo){ ._v__ast__Thread = ptr, ._typ = 480}; + return (v__ast__TypeInfo){ ._v__ast__Thread = ptr, ._typ = 481}; } static inline v__ast__TypeInfo v__ast__Struct_to_sumtype_v__ast__TypeInfo(v__ast__Struct* x) { v__ast__Struct* ptr = memdup(x, sizeof(v__ast__Struct)); - return (v__ast__TypeInfo){ ._v__ast__Struct = ptr, ._typ = 455}; + return (v__ast__TypeInfo){ ._v__ast__Struct = ptr, ._typ = 456}; } static inline v__ast__TypeInfo v__ast__Array_to_sumtype_v__ast__TypeInfo(v__ast__Array* x) { v__ast__Array* ptr = memdup(x, sizeof(v__ast__Array)); - return (v__ast__TypeInfo){ ._v__ast__Array = ptr, ._typ = 450}; + return (v__ast__TypeInfo){ ._v__ast__Array = ptr, ._typ = 451}; } static inline v__ast__TypeInfo v__ast__ArrayFixed_to_sumtype_v__ast__TypeInfo(v__ast__ArrayFixed* x) { v__ast__ArrayFixed* ptr = memdup(x, sizeof(v__ast__ArrayFixed)); - return (v__ast__TypeInfo){ ._v__ast__ArrayFixed = ptr, ._typ = 478}; + return (v__ast__TypeInfo){ ._v__ast__ArrayFixed = ptr, ._typ = 479}; } static inline v__ast__TypeInfo v__ast__MultiReturn_to_sumtype_v__ast__TypeInfo(v__ast__MultiReturn* x) { v__ast__MultiReturn* ptr = memdup(x, sizeof(v__ast__MultiReturn)); - return (v__ast__TypeInfo){ ._v__ast__MultiReturn = ptr, ._typ = 481}; + return (v__ast__TypeInfo){ ._v__ast__MultiReturn = ptr, ._typ = 482}; } static inline v__ast__TypeInfo v__ast__FnType_to_sumtype_v__ast__TypeInfo(v__ast__FnType* x) { v__ast__FnType* ptr = memdup(x, sizeof(v__ast__FnType)); - return (v__ast__TypeInfo){ ._v__ast__FnType = ptr, ._typ = 482}; + return (v__ast__TypeInfo){ ._v__ast__FnType = ptr, ._typ = 483}; } static inline v__ast__Expr v__ast__None_to_sumtype_v__ast__Expr(v__ast__None* x) { v__ast__None* ptr = memdup(x, sizeof(v__ast__None)); - return (v__ast__Expr){ ._v__ast__None = ptr, ._typ = 317}; + return (v__ast__Expr){ ._v__ast__None = ptr, ._typ = 318}; } static inline v__ast__TypeInfo v__ast__Interface_to_sumtype_v__ast__TypeInfo(v__ast__Interface* x) { v__ast__Interface* ptr = memdup(x, sizeof(v__ast__Interface)); - return (v__ast__TypeInfo){ ._v__ast__Interface = ptr, ._typ = 473}; + return (v__ast__TypeInfo){ ._v__ast__Interface = ptr, ._typ = 474}; } static inline v__ast__IdentInfo v__ast__IdentVar_to_sumtype_v__ast__IdentInfo(v__ast__IdentVar* x) { v__ast__IdentVar* ptr = memdup(x, sizeof(v__ast__IdentVar)); - return (v__ast__IdentInfo){ ._v__ast__IdentVar = ptr, ._typ = 415}; + return (v__ast__IdentInfo){ ._v__ast__IdentVar = ptr, ._typ = 416}; } static inline v__ast__Expr v__ast__InfixExpr_to_sumtype_v__ast__Expr(v__ast__InfixExpr* x) { v__ast__InfixExpr* ptr = memdup(x, sizeof(v__ast__InfixExpr)); - return (v__ast__Expr){ ._v__ast__InfixExpr = ptr, ._typ = 309}; + return (v__ast__Expr){ ._v__ast__InfixExpr = ptr, ._typ = 310}; } static inline v__ast__Expr v__ast__CastExpr_to_sumtype_v__ast__Expr(v__ast__CastExpr* x) { v__ast__CastExpr* ptr = memdup(x, sizeof(v__ast__CastExpr)); - return (v__ast__Expr){ ._v__ast__CastExpr = ptr, ._typ = 292}; + return (v__ast__Expr){ ._v__ast__CastExpr = ptr, ._typ = 293}; } static inline v__ast__AsmArg v__ast__AsmRegister_to_sumtype_v__ast__AsmArg(v__ast__AsmRegister* x) { v__ast__AsmRegister* ptr = memdup(x, sizeof(v__ast__AsmRegister)); - return (v__ast__AsmArg){ ._v__ast__AsmRegister = ptr, ._typ = 360}; + return (v__ast__AsmArg){ ._v__ast__AsmRegister = ptr, ._typ = 361}; } static inline v__ast__ScopeObject v__ast__Var_to_sumtype_v__ast__ScopeObject(v__ast__Var* x) { v__ast__Var* ptr = memdup(x, sizeof(v__ast__Var)); - return (v__ast__ScopeObject){ ._v__ast__Var = ptr, ._typ = 363, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Var, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Var, typ))}; + return (v__ast__ScopeObject){ ._v__ast__Var = ptr, ._typ = 364, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Var, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Var, typ))}; } static inline v__ast__IdentInfo v__ast__IdentFn_to_sumtype_v__ast__IdentInfo(v__ast__IdentFn* x) { v__ast__IdentFn* ptr = memdup(x, sizeof(v__ast__IdentFn)); - return (v__ast__IdentInfo){ ._v__ast__IdentFn = ptr, ._typ = 414}; + return (v__ast__IdentInfo){ ._v__ast__IdentFn = ptr, ._typ = 415}; } static inline v__ast__Expr v__ast__IndexExpr_to_sumtype_v__ast__Expr(v__ast__IndexExpr* x) { v__ast__IndexExpr* ptr = memdup(x, sizeof(v__ast__IndexExpr)); - return (v__ast__Expr){ ._v__ast__IndexExpr = ptr, ._typ = 308}; + return (v__ast__Expr){ ._v__ast__IndexExpr = ptr, ._typ = 309}; } static inline v__ast__ComptTimeConstValue int_to_sumtype_v__ast__ComptTimeConstValue(int* x) { @@ -11992,402 +12026,402 @@ static inline v__ast__ComptTimeConstValue f32_to_sumtype_v__ast__ComptTimeConstV static inline v__ast__Stmt v__ast__Return_to_sumtype_v__ast__Stmt(v__ast__Return* x) { v__ast__Return* ptr = memdup(x, sizeof(v__ast__Return)); - return (v__ast__Stmt){ ._v__ast__Return = ptr, ._typ = 356, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Return, pos))}; + return (v__ast__Stmt){ ._v__ast__Return = ptr, ._typ = 357, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Return, pos))}; } static inline v__ast__TypeInfo v__ast__Aggregate_to_sumtype_v__ast__TypeInfo(v__ast__Aggregate* x) { v__ast__Aggregate* ptr = memdup(x, sizeof(v__ast__Aggregate)); - return (v__ast__TypeInfo){ ._v__ast__Aggregate = ptr, ._typ = 468}; + return (v__ast__TypeInfo){ ._v__ast__Aggregate = ptr, ._typ = 469}; } static inline v__ast__Expr v__ast__Ident_to_sumtype_v__ast__Expr(v__ast__Ident* x) { v__ast__Ident* ptr = memdup(x, sizeof(v__ast__Ident)); - return (v__ast__Expr){ ._v__ast__Ident = ptr, ._typ = 305}; + return (v__ast__Expr){ ._v__ast__Ident = ptr, ._typ = 306}; } static inline v__ast__Stmt v__ast__AssertStmt_to_sumtype_v__ast__Stmt(v__ast__AssertStmt* x) { v__ast__AssertStmt* ptr = memdup(x, sizeof(v__ast__AssertStmt)); - return (v__ast__Stmt){ ._v__ast__AssertStmt = ptr, ._typ = 336, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssertStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AssertStmt = ptr, ._typ = 337, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssertStmt, pos))}; } static inline v__ast__Expr v__ast__IfExpr_to_sumtype_v__ast__Expr(v__ast__IfExpr* x) { v__ast__IfExpr* ptr = memdup(x, sizeof(v__ast__IfExpr)); - return (v__ast__Expr){ ._v__ast__IfExpr = ptr, ._typ = 306}; + return (v__ast__Expr){ ._v__ast__IfExpr = ptr, ._typ = 307}; } static inline v__ast__Expr v__ast__BoolLiteral_to_sumtype_v__ast__Expr(v__ast__BoolLiteral* x) { v__ast__BoolLiteral* ptr = memdup(x, sizeof(v__ast__BoolLiteral)); - return (v__ast__Expr){ ._v__ast__BoolLiteral = ptr, ._typ = 289}; + return (v__ast__Expr){ ._v__ast__BoolLiteral = ptr, ._typ = 290}; } static inline v__ast__Expr v__ast__MatchExpr_to_sumtype_v__ast__Expr(v__ast__MatchExpr* x) { v__ast__MatchExpr* ptr = memdup(x, sizeof(v__ast__MatchExpr)); - return (v__ast__Expr){ ._v__ast__MatchExpr = ptr, ._typ = 315}; + return (v__ast__Expr){ ._v__ast__MatchExpr = ptr, ._typ = 316}; } static inline v__ast__Stmt v__ast__ForCStmt_to_sumtype_v__ast__Stmt(v__ast__ForCStmt* x) { v__ast__ForCStmt* ptr = memdup(x, sizeof(v__ast__ForCStmt)); - return (v__ast__Stmt){ ._v__ast__ForCStmt = ptr, ._typ = 346, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForCStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForCStmt = ptr, ._typ = 347, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForCStmt, pos))}; } static inline v__ast__Stmt v__ast__ForStmt_to_sumtype_v__ast__Stmt(v__ast__ForStmt* x) { v__ast__ForStmt* ptr = memdup(x, sizeof(v__ast__ForStmt)); - return (v__ast__Stmt){ ._v__ast__ForStmt = ptr, ._typ = 348, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForStmt = ptr, ._typ = 349, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForStmt, pos))}; } static inline v__ast__Stmt v__ast__InterfaceDecl_to_sumtype_v__ast__Stmt(v__ast__InterfaceDecl* x) { v__ast__InterfaceDecl* ptr = memdup(x, sizeof(v__ast__InterfaceDecl)); - return (v__ast__Stmt){ ._v__ast__InterfaceDecl = ptr, ._typ = 354, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__InterfaceDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__InterfaceDecl = ptr, ._typ = 355, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__InterfaceDecl, pos))}; } static inline v__ast__Expr v__ast__CallExpr_to_sumtype_v__ast__Expr(v__ast__CallExpr* x) { v__ast__CallExpr* ptr = memdup(x, sizeof(v__ast__CallExpr)); - return (v__ast__Expr){ ._v__ast__CallExpr = ptr, ._typ = 291}; + return (v__ast__Expr){ ._v__ast__CallExpr = ptr, ._typ = 292}; } static inline v__ast__Expr v__ast__IntegerLiteral_to_sumtype_v__ast__Expr(v__ast__IntegerLiteral* x) { v__ast__IntegerLiteral* ptr = memdup(x, sizeof(v__ast__IntegerLiteral)); - return (v__ast__Expr){ ._v__ast__IntegerLiteral = ptr, ._typ = 310}; + return (v__ast__Expr){ ._v__ast__IntegerLiteral = ptr, ._typ = 311}; } static inline v__ast__Expr v__ast__FloatLiteral_to_sumtype_v__ast__Expr(v__ast__FloatLiteral* x) { v__ast__FloatLiteral* ptr = memdup(x, sizeof(v__ast__FloatLiteral)); - return (v__ast__Expr){ ._v__ast__FloatLiteral = ptr, ._typ = 303}; + return (v__ast__Expr){ ._v__ast__FloatLiteral = ptr, ._typ = 304}; } static inline v__ast__Expr v__ast__SqlExpr_to_sumtype_v__ast__Expr(v__ast__SqlExpr* x) { v__ast__SqlExpr* ptr = memdup(x, sizeof(v__ast__SqlExpr)); - return (v__ast__Expr){ ._v__ast__SqlExpr = ptr, ._typ = 327}; + return (v__ast__Expr){ ._v__ast__SqlExpr = ptr, ._typ = 328}; } static inline v__ast__Expr v__ast__CTempVar_to_sumtype_v__ast__Expr(v__ast__CTempVar* x) { v__ast__CTempVar* ptr = memdup(x, sizeof(v__ast__CTempVar)); - return (v__ast__Expr){ ._v__ast__CTempVar = ptr, ._typ = 290}; + return (v__ast__Expr){ ._v__ast__CTempVar = ptr, ._typ = 291}; } static inline v__ast__Expr v__ast__SelectorExpr_to_sumtype_v__ast__Expr(v__ast__SelectorExpr* x) { v__ast__SelectorExpr* ptr = memdup(x, sizeof(v__ast__SelectorExpr)); - return (v__ast__Expr){ ._v__ast__SelectorExpr = ptr, ._typ = 325}; + return (v__ast__Expr){ ._v__ast__SelectorExpr = ptr, ._typ = 326}; } static inline v__ast__Stmt v__ast__ForInStmt_to_sumtype_v__ast__Stmt(v__ast__ForInStmt* x) { v__ast__ForInStmt* ptr = memdup(x, sizeof(v__ast__ForInStmt)); - return (v__ast__Stmt){ ._v__ast__ForInStmt = ptr, ._typ = 347, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForInStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForInStmt = ptr, ._typ = 348, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForInStmt, pos))}; } static inline v__ast__Stmt v__ast__ExprStmt_to_sumtype_v__ast__Stmt(v__ast__ExprStmt* x) { v__ast__ExprStmt* ptr = memdup(x, sizeof(v__ast__ExprStmt)); - return (v__ast__Stmt){ ._v__ast__ExprStmt = ptr, ._typ = 345, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ExprStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ExprStmt = ptr, ._typ = 346, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ExprStmt, pos))}; } static inline v__ast__Stmt v__ast__NodeError_to_sumtype_v__ast__Stmt(v__ast__NodeError* x) { v__ast__NodeError* ptr = memdup(x, sizeof(v__ast__NodeError)); - return (v__ast__Stmt){ ._v__ast__NodeError = ptr, ._typ = 316, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__NodeError, pos))}; + return (v__ast__Stmt){ ._v__ast__NodeError = ptr, ._typ = 317, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__NodeError, pos))}; } static inline v__ast__Stmt v__ast__AssignStmt_to_sumtype_v__ast__Stmt(v__ast__AssignStmt* x) { v__ast__AssignStmt* ptr = memdup(x, sizeof(v__ast__AssignStmt)); - return (v__ast__Stmt){ ._v__ast__AssignStmt = ptr, ._typ = 337, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssignStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AssignStmt = ptr, ._typ = 338, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssignStmt, pos))}; } static inline v__ast__Expr v__ast__ComptimeCall_to_sumtype_v__ast__Expr(v__ast__ComptimeCall* x) { v__ast__ComptimeCall* ptr = memdup(x, sizeof(v__ast__ComptimeCall)); - return (v__ast__Expr){ ._v__ast__ComptimeCall = ptr, ._typ = 296}; + return (v__ast__Expr){ ._v__ast__ComptimeCall = ptr, ._typ = 297}; } static inline v__ast__Expr v__ast__ComptimeSelector_to_sumtype_v__ast__Expr(v__ast__ComptimeSelector* x) { v__ast__ComptimeSelector* ptr = memdup(x, sizeof(v__ast__ComptimeSelector)); - return (v__ast__Expr){ ._v__ast__ComptimeSelector = ptr, ._typ = 297}; + return (v__ast__Expr){ ._v__ast__ComptimeSelector = ptr, ._typ = 298}; } static inline v__ast__Expr v__ast__NodeError_to_sumtype_v__ast__Expr(v__ast__NodeError* x) { v__ast__NodeError* ptr = memdup(x, sizeof(v__ast__NodeError)); - return (v__ast__Expr){ ._v__ast__NodeError = ptr, ._typ = 316}; + return (v__ast__Expr){ ._v__ast__NodeError = ptr, ._typ = 317}; } static inline v__ast__Expr v__ast__Comment_to_sumtype_v__ast__Expr(v__ast__Comment* x) { v__ast__Comment* ptr = memdup(x, sizeof(v__ast__Comment)); - return (v__ast__Expr){ ._v__ast__Comment = ptr, ._typ = 295}; + return (v__ast__Expr){ ._v__ast__Comment = ptr, ._typ = 296}; } static inline v__ast__Expr v__ast__EnumVal_to_sumtype_v__ast__Expr(v__ast__EnumVal* x) { v__ast__EnumVal* ptr = memdup(x, sizeof(v__ast__EnumVal)); - return (v__ast__Expr){ ._v__ast__EnumVal = ptr, ._typ = 302}; + return (v__ast__Expr){ ._v__ast__EnumVal = ptr, ._typ = 303}; } static inline v__ast__Expr v__ast__AtExpr_to_sumtype_v__ast__Expr(v__ast__AtExpr* x) { v__ast__AtExpr* ptr = memdup(x, sizeof(v__ast__AtExpr)); - return (v__ast__Expr){ ._v__ast__AtExpr = ptr, ._typ = 288}; + return (v__ast__Expr){ ._v__ast__AtExpr = ptr, ._typ = 289}; } static inline v__ast__Expr v__ast__ComptimeType_to_sumtype_v__ast__Expr(v__ast__ComptimeType* x) { v__ast__ComptimeType* ptr = memdup(x, sizeof(v__ast__ComptimeType)); - return (v__ast__Expr){ ._v__ast__ComptimeType = ptr, ._typ = 298}; + return (v__ast__Expr){ ._v__ast__ComptimeType = ptr, ._typ = 299}; } static inline v__ast__Expr v__ast__CharLiteral_to_sumtype_v__ast__Expr(v__ast__CharLiteral* x) { v__ast__CharLiteral* ptr = memdup(x, sizeof(v__ast__CharLiteral)); - return (v__ast__Expr){ ._v__ast__CharLiteral = ptr, ._typ = 294}; + return (v__ast__Expr){ ._v__ast__CharLiteral = ptr, ._typ = 295}; } static inline v__ast__Expr v__ast__GoExpr_to_sumtype_v__ast__Expr(v__ast__GoExpr* x) { v__ast__GoExpr* ptr = memdup(x, sizeof(v__ast__GoExpr)); - return (v__ast__Expr){ ._v__ast__GoExpr = ptr, ._typ = 304}; + return (v__ast__Expr){ ._v__ast__GoExpr = ptr, ._typ = 305}; } static inline v__ast__Expr v__ast__SelectExpr_to_sumtype_v__ast__Expr(v__ast__SelectExpr* x) { v__ast__SelectExpr* ptr = memdup(x, sizeof(v__ast__SelectExpr)); - return (v__ast__Expr){ ._v__ast__SelectExpr = ptr, ._typ = 324}; + return (v__ast__Expr){ ._v__ast__SelectExpr = ptr, ._typ = 325}; } static inline v__ast__Expr v__ast__ParExpr_to_sumtype_v__ast__Expr(v__ast__ParExpr* x) { v__ast__ParExpr* ptr = memdup(x, sizeof(v__ast__ParExpr)); - return (v__ast__Expr){ ._v__ast__ParExpr = ptr, ._typ = 320}; + return (v__ast__Expr){ ._v__ast__ParExpr = ptr, ._typ = 321}; } static inline v__ast__Expr v__ast__UnsafeExpr_to_sumtype_v__ast__Expr(v__ast__UnsafeExpr* x) { v__ast__UnsafeExpr* ptr = memdup(x, sizeof(v__ast__UnsafeExpr)); - return (v__ast__Expr){ ._v__ast__UnsafeExpr = ptr, ._typ = 333}; + return (v__ast__Expr){ ._v__ast__UnsafeExpr = ptr, ._typ = 334}; } static inline v__ast__Expr v__ast__LockExpr_to_sumtype_v__ast__Expr(v__ast__LockExpr* x) { v__ast__LockExpr* ptr = memdup(x, sizeof(v__ast__LockExpr)); - return (v__ast__Expr){ ._v__ast__LockExpr = ptr, ._typ = 313}; + return (v__ast__Expr){ ._v__ast__LockExpr = ptr, ._typ = 314}; } static inline v__ast__Expr v__ast__IsRefType_to_sumtype_v__ast__Expr(v__ast__IsRefType* x) { v__ast__IsRefType* ptr = memdup(x, sizeof(v__ast__IsRefType)); - return (v__ast__Expr){ ._v__ast__IsRefType = ptr, ._typ = 311}; + return (v__ast__Expr){ ._v__ast__IsRefType = ptr, ._typ = 312}; } static inline v__ast__Expr v__ast__SizeOf_to_sumtype_v__ast__Expr(v__ast__SizeOf* x) { v__ast__SizeOf* ptr = memdup(x, sizeof(v__ast__SizeOf)); - return (v__ast__Expr){ ._v__ast__SizeOf = ptr, ._typ = 326}; + return (v__ast__Expr){ ._v__ast__SizeOf = ptr, ._typ = 327}; } static inline v__ast__Expr v__ast__TypeOf_to_sumtype_v__ast__Expr(v__ast__TypeOf* x) { v__ast__TypeOf* ptr = memdup(x, sizeof(v__ast__TypeOf)); - return (v__ast__Expr){ ._v__ast__TypeOf = ptr, ._typ = 332}; + return (v__ast__Expr){ ._v__ast__TypeOf = ptr, ._typ = 333}; } static inline v__ast__Expr v__ast__DumpExpr_to_sumtype_v__ast__Expr(v__ast__DumpExpr* x) { v__ast__DumpExpr* ptr = memdup(x, sizeof(v__ast__DumpExpr)); - return (v__ast__Expr){ ._v__ast__DumpExpr = ptr, ._typ = 300}; + return (v__ast__Expr){ ._v__ast__DumpExpr = ptr, ._typ = 301}; } static inline v__ast__Expr v__ast__OffsetOf_to_sumtype_v__ast__Expr(v__ast__OffsetOf* x) { v__ast__OffsetOf* ptr = memdup(x, sizeof(v__ast__OffsetOf)); - return (v__ast__Expr){ ._v__ast__OffsetOf = ptr, ._typ = 318}; + return (v__ast__Expr){ ._v__ast__OffsetOf = ptr, ._typ = 319}; } static inline v__ast__Expr v__ast__Likely_to_sumtype_v__ast__Expr(v__ast__Likely* x) { v__ast__Likely* ptr = memdup(x, sizeof(v__ast__Likely)); - return (v__ast__Expr){ ._v__ast__Likely = ptr, ._typ = 312}; + return (v__ast__Expr){ ._v__ast__Likely = ptr, ._typ = 313}; } static inline v__ast__Expr v__ast__AnonFn_to_sumtype_v__ast__Expr(v__ast__AnonFn* x) { v__ast__AnonFn* ptr = memdup(x, sizeof(v__ast__AnonFn)); - return (v__ast__Expr){ ._v__ast__AnonFn = ptr, ._typ = 283}; + return (v__ast__Expr){ ._v__ast__AnonFn = ptr, ._typ = 284}; } static inline v__ast__Expr v__ast__AsCast_to_sumtype_v__ast__Expr(v__ast__AsCast* x) { v__ast__AsCast* ptr = memdup(x, sizeof(v__ast__AsCast)); - return (v__ast__Expr){ ._v__ast__AsCast = ptr, ._typ = 286}; + return (v__ast__Expr){ ._v__ast__AsCast = ptr, ._typ = 287}; } static inline v__ast__Expr v__ast__PostfixExpr_to_sumtype_v__ast__Expr(v__ast__PostfixExpr* x) { v__ast__PostfixExpr* ptr = memdup(x, sizeof(v__ast__PostfixExpr)); - return (v__ast__Expr){ ._v__ast__PostfixExpr = ptr, ._typ = 321}; + return (v__ast__Expr){ ._v__ast__PostfixExpr = ptr, ._typ = 322}; } static inline v__ast__Expr v__ast__PrefixExpr_to_sumtype_v__ast__Expr(v__ast__PrefixExpr* x) { v__ast__PrefixExpr* ptr = memdup(x, sizeof(v__ast__PrefixExpr)); - return (v__ast__Expr){ ._v__ast__PrefixExpr = ptr, ._typ = 322}; + return (v__ast__Expr){ ._v__ast__PrefixExpr = ptr, ._typ = 323}; } static inline v__ast__Expr v__ast__ArrayDecompose_to_sumtype_v__ast__Expr(v__ast__ArrayDecompose* x) { v__ast__ArrayDecompose* ptr = memdup(x, sizeof(v__ast__ArrayDecompose)); - return (v__ast__Expr){ ._v__ast__ArrayDecompose = ptr, ._typ = 284}; + return (v__ast__Expr){ ._v__ast__ArrayDecompose = ptr, ._typ = 285}; } static inline v__ast__Expr v__ast__IfGuardExpr_to_sumtype_v__ast__Expr(v__ast__IfGuardExpr* x) { v__ast__IfGuardExpr* ptr = memdup(x, sizeof(v__ast__IfGuardExpr)); - return (v__ast__Expr){ ._v__ast__IfGuardExpr = ptr, ._typ = 307}; + return (v__ast__Expr){ ._v__ast__IfGuardExpr = ptr, ._typ = 308}; } static inline v__ast__Expr v__ast__RangeExpr_to_sumtype_v__ast__Expr(v__ast__RangeExpr* x) { v__ast__RangeExpr* ptr = memdup(x, sizeof(v__ast__RangeExpr)); - return (v__ast__Expr){ ._v__ast__RangeExpr = ptr, ._typ = 323}; + return (v__ast__Expr){ ._v__ast__RangeExpr = ptr, ._typ = 324}; } static inline v__ast__TypeInfo v__ast__GenericInst_to_sumtype_v__ast__TypeInfo(v__ast__GenericInst* x) { v__ast__GenericInst* ptr = memdup(x, sizeof(v__ast__GenericInst)); - return (v__ast__TypeInfo){ ._v__ast__GenericInst = ptr, ._typ = 483}; + return (v__ast__TypeInfo){ ._v__ast__GenericInst = ptr, ._typ = 484}; } static inline v__ast__Stmt v__ast__Module_to_sumtype_v__ast__Stmt(v__ast__Module* x) { v__ast__Module* ptr = memdup(x, sizeof(v__ast__Module)); - return (v__ast__Stmt){ ._v__ast__Module = ptr, ._typ = 355, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Module, pos))}; + return (v__ast__Stmt){ ._v__ast__Module = ptr, ._typ = 356, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Module, pos))}; } static inline v__ast__Stmt v__ast__Import_to_sumtype_v__ast__Stmt(v__ast__Import* x) { v__ast__Import* ptr = memdup(x, sizeof(v__ast__Import)); - return (v__ast__Stmt){ ._v__ast__Import = ptr, ._typ = 353, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Import, pos))}; + return (v__ast__Stmt){ ._v__ast__Import = ptr, ._typ = 354, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Import, pos))}; } static inline v__ast__Stmt v__ast__ConstDecl_to_sumtype_v__ast__Stmt(v__ast__ConstDecl* x) { v__ast__ConstDecl* ptr = memdup(x, sizeof(v__ast__ConstDecl)); - return (v__ast__Stmt){ ._v__ast__ConstDecl = ptr, ._typ = 341, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__ConstDecl = ptr, ._typ = 342, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstDecl, pos))}; } static inline v__ast__Stmt v__ast__StructDecl_to_sumtype_v__ast__Stmt(v__ast__StructDecl* x) { v__ast__StructDecl* ptr = memdup(x, sizeof(v__ast__StructDecl)); - return (v__ast__Stmt){ ._v__ast__StructDecl = ptr, ._typ = 358, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__StructDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__StructDecl = ptr, ._typ = 359, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__StructDecl, pos))}; } static inline v__ast__Stmt v__ast__EnumDecl_to_sumtype_v__ast__Stmt(v__ast__EnumDecl* x) { v__ast__EnumDecl* ptr = memdup(x, sizeof(v__ast__EnumDecl)); - return (v__ast__Stmt){ ._v__ast__EnumDecl = ptr, ._typ = 344, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EnumDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__EnumDecl = ptr, ._typ = 345, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EnumDecl, pos))}; } static inline v__ast__Stmt v__ast__TypeDecl_to_sumtype_v__ast__Stmt(v__ast__TypeDecl* x) { v__ast__TypeDecl* ptr = memdup(x, sizeof(v__ast__TypeDecl)); - return (v__ast__Stmt){ ._v__ast__TypeDecl = ptr, ._typ = 282, .pos = ptr->pos}; + return (v__ast__Stmt){ ._v__ast__TypeDecl = ptr, ._typ = 283, .pos = ptr->pos}; } static inline v__ast__Stmt v__ast__AsmStmt_to_sumtype_v__ast__Stmt(v__ast__AsmStmt* x) { v__ast__AsmStmt* ptr = memdup(x, sizeof(v__ast__AsmStmt)); - return (v__ast__Stmt){ ._v__ast__AsmStmt = ptr, ._typ = 335, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AsmStmt = ptr, ._typ = 336, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmStmt, pos))}; } static inline v__ast__Stmt v__ast__GlobalDecl_to_sumtype_v__ast__Stmt(v__ast__GlobalDecl* x) { v__ast__GlobalDecl* ptr = memdup(x, sizeof(v__ast__GlobalDecl)); - return (v__ast__Stmt){ ._v__ast__GlobalDecl = ptr, ._typ = 349, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__GlobalDecl = ptr, ._typ = 350, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalDecl, pos))}; } static inline v__ast__Stmt v__ast__HashStmt_to_sumtype_v__ast__Stmt(v__ast__HashStmt* x) { v__ast__HashStmt* ptr = memdup(x, sizeof(v__ast__HashStmt)); - return (v__ast__Stmt){ ._v__ast__HashStmt = ptr, ._typ = 352, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__HashStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__HashStmt = ptr, ._typ = 353, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__HashStmt, pos))}; } static inline v__ast__Stmt v__ast__Block_to_sumtype_v__ast__Stmt(v__ast__Block* x) { v__ast__Block* ptr = memdup(x, sizeof(v__ast__Block)); - return (v__ast__Stmt){ ._v__ast__Block = ptr, ._typ = 338, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Block, pos))}; + return (v__ast__Stmt){ ._v__ast__Block = ptr, ._typ = 339, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Block, pos))}; } static inline v__ast__Stmt v__ast__SqlStmt_to_sumtype_v__ast__Stmt(v__ast__SqlStmt* x) { v__ast__SqlStmt* ptr = memdup(x, sizeof(v__ast__SqlStmt)); - return (v__ast__Stmt){ ._v__ast__SqlStmt = ptr, ._typ = 357, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SqlStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__SqlStmt = ptr, ._typ = 358, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SqlStmt, pos))}; } static inline v__ast__Stmt v__ast__GotoLabel_to_sumtype_v__ast__Stmt(v__ast__GotoLabel* x) { v__ast__GotoLabel* ptr = memdup(x, sizeof(v__ast__GotoLabel)); - return (v__ast__Stmt){ ._v__ast__GotoLabel = ptr, ._typ = 350, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoLabel, pos))}; + return (v__ast__Stmt){ ._v__ast__GotoLabel = ptr, ._typ = 351, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoLabel, pos))}; } static inline v__ast__Stmt v__ast__ComptimeFor_to_sumtype_v__ast__Stmt(v__ast__ComptimeFor* x) { v__ast__ComptimeFor* ptr = memdup(x, sizeof(v__ast__ComptimeFor)); - return (v__ast__Stmt){ ._v__ast__ComptimeFor = ptr, ._typ = 340, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ComptimeFor, pos))}; + return (v__ast__Stmt){ ._v__ast__ComptimeFor = ptr, ._typ = 341, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ComptimeFor, pos))}; } static inline v__ast__Stmt v__ast__BranchStmt_to_sumtype_v__ast__Stmt(v__ast__BranchStmt* x) { v__ast__BranchStmt* ptr = memdup(x, sizeof(v__ast__BranchStmt)); - return (v__ast__Stmt){ ._v__ast__BranchStmt = ptr, ._typ = 339, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__BranchStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__BranchStmt = ptr, ._typ = 340, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__BranchStmt, pos))}; } static inline v__ast__Stmt v__ast__DeferStmt_to_sumtype_v__ast__Stmt(v__ast__DeferStmt* x) { v__ast__DeferStmt* ptr = memdup(x, sizeof(v__ast__DeferStmt)); - return (v__ast__Stmt){ ._v__ast__DeferStmt = ptr, ._typ = 342, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__DeferStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__DeferStmt = ptr, ._typ = 343, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__DeferStmt, pos))}; } static inline v__ast__Stmt v__ast__GotoStmt_to_sumtype_v__ast__Stmt(v__ast__GotoStmt* x) { v__ast__GotoStmt* ptr = memdup(x, sizeof(v__ast__GotoStmt)); - return (v__ast__Stmt){ ._v__ast__GotoStmt = ptr, ._typ = 351, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__GotoStmt = ptr, ._typ = 352, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoStmt, pos))}; } static inline v__ast__AsmArg v__ast__FloatLiteral_to_sumtype_v__ast__AsmArg(v__ast__FloatLiteral* x) { v__ast__FloatLiteral* ptr = memdup(x, sizeof(v__ast__FloatLiteral)); - return (v__ast__AsmArg){ ._v__ast__FloatLiteral = ptr, ._typ = 303}; + return (v__ast__AsmArg){ ._v__ast__FloatLiteral = ptr, ._typ = 304}; } static inline v__ast__AsmArg v__ast__AsmDisp_to_sumtype_v__ast__AsmArg(v__ast__AsmDisp* x) { v__ast__AsmDisp* ptr = memdup(x, sizeof(v__ast__AsmDisp)); - return (v__ast__AsmArg){ ._v__ast__AsmDisp = ptr, ._typ = 437}; + return (v__ast__AsmArg){ ._v__ast__AsmDisp = ptr, ._typ = 438}; } static inline v__ast__AsmArg v__ast__IntegerLiteral_to_sumtype_v__ast__AsmArg(v__ast__IntegerLiteral* x) { v__ast__IntegerLiteral* ptr = memdup(x, sizeof(v__ast__IntegerLiteral)); - return (v__ast__AsmArg){ ._v__ast__IntegerLiteral = ptr, ._typ = 310}; + return (v__ast__AsmArg){ ._v__ast__IntegerLiteral = ptr, ._typ = 311}; } static inline v__ast__AsmArg v__ast__CharLiteral_to_sumtype_v__ast__AsmArg(v__ast__CharLiteral* x) { v__ast__CharLiteral* ptr = memdup(x, sizeof(v__ast__CharLiteral)); - return (v__ast__AsmArg){ ._v__ast__CharLiteral = ptr, ._typ = 294}; + return (v__ast__AsmArg){ ._v__ast__CharLiteral = ptr, ._typ = 295}; } static inline v__ast__AsmArg v__ast__AsmAddressing_to_sumtype_v__ast__AsmArg(v__ast__AsmAddressing* x) { v__ast__AsmAddressing* ptr = memdup(x, sizeof(v__ast__AsmAddressing)); - return (v__ast__AsmArg){ ._v__ast__AsmAddressing = ptr, ._typ = 435}; + return (v__ast__AsmArg){ ._v__ast__AsmAddressing = ptr, ._typ = 436}; } static inline v__ast__AsmArg v__ast__AsmAlias_to_sumtype_v__ast__AsmArg(v__ast__AsmAlias* x) { v__ast__AsmAlias* ptr = memdup(x, sizeof(v__ast__AsmAlias)); - return (v__ast__AsmArg){ ._v__ast__AsmAlias = ptr, ._typ = 436}; + return (v__ast__AsmArg){ ._v__ast__AsmAlias = ptr, ._typ = 437}; } static inline v__ast__Expr v__ast__ConcatExpr_to_sumtype_v__ast__Expr(v__ast__ConcatExpr* x) { v__ast__ConcatExpr* ptr = memdup(x, sizeof(v__ast__ConcatExpr)); - return (v__ast__Expr){ ._v__ast__ConcatExpr = ptr, ._typ = 299}; + return (v__ast__Expr){ ._v__ast__ConcatExpr = ptr, ._typ = 300}; } static inline v__ast__Expr v__ast__ChanInit_to_sumtype_v__ast__Expr(v__ast__ChanInit* x) { v__ast__ChanInit* ptr = memdup(x, sizeof(v__ast__ChanInit)); - return (v__ast__Expr){ ._v__ast__ChanInit = ptr, ._typ = 293}; + return (v__ast__Expr){ ._v__ast__ChanInit = ptr, ._typ = 294}; } static inline v__ast__Expr v__ast__StringInterLiteral_to_sumtype_v__ast__Expr(v__ast__StringInterLiteral* x) { v__ast__StringInterLiteral* ptr = memdup(x, sizeof(v__ast__StringInterLiteral)); - return (v__ast__Expr){ ._v__ast__StringInterLiteral = ptr, ._typ = 328}; + return (v__ast__Expr){ ._v__ast__StringInterLiteral = ptr, ._typ = 329}; } static inline v__ast__ScopeObject v__ast__ConstField_to_sumtype_v__ast__ScopeObject(v__ast__ConstField* x) { v__ast__ConstField* ptr = memdup(x, sizeof(v__ast__ConstField)); - return (v__ast__ScopeObject){ ._v__ast__ConstField = ptr, ._typ = 361, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstField, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstField, typ))}; + return (v__ast__ScopeObject){ ._v__ast__ConstField = ptr, ._typ = 362, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstField, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstField, typ))}; } static inline v__ast__ScopeObject v__ast__GlobalField_to_sumtype_v__ast__ScopeObject(v__ast__GlobalField* x) { v__ast__GlobalField* ptr = memdup(x, sizeof(v__ast__GlobalField)); - return (v__ast__ScopeObject){ ._v__ast__GlobalField = ptr, ._typ = 362, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalField, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalField, typ))}; + return (v__ast__ScopeObject){ ._v__ast__GlobalField = ptr, ._typ = 363, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalField, name)), .typ = (v__ast__Type*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalField, typ))}; } static inline v__ast__TypeInfo v__ast__Enum_to_sumtype_v__ast__TypeInfo(v__ast__Enum* x) { v__ast__Enum* ptr = memdup(x, sizeof(v__ast__Enum)); - return (v__ast__TypeInfo){ ._v__ast__Enum = ptr, ._typ = 484}; + return (v__ast__TypeInfo){ ._v__ast__Enum = ptr, ._typ = 485}; } static inline v__ast__TypeDecl v__ast__FnTypeDecl_to_sumtype_v__ast__TypeDecl(v__ast__FnTypeDecl* x) { v__ast__FnTypeDecl* ptr = memdup(x, sizeof(v__ast__FnTypeDecl)); - return (v__ast__TypeDecl){ ._v__ast__FnTypeDecl = ptr, ._typ = 280, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, comments))}; + return (v__ast__TypeDecl){ ._v__ast__FnTypeDecl = ptr, ._typ = 281, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnTypeDecl, comments))}; } static inline v__ast__TypeDecl v__ast__AliasTypeDecl_to_sumtype_v__ast__TypeDecl(v__ast__AliasTypeDecl* x) { v__ast__AliasTypeDecl* ptr = memdup(x, sizeof(v__ast__AliasTypeDecl)); - return (v__ast__TypeDecl){ ._v__ast__AliasTypeDecl = ptr, ._typ = 279, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, comments))}; + return (v__ast__TypeDecl){ ._v__ast__AliasTypeDecl = ptr, ._typ = 280, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AliasTypeDecl, comments))}; } static inline v__ast__TypeDecl v__ast__SumTypeDecl_to_sumtype_v__ast__TypeDecl(v__ast__SumTypeDecl* x) { v__ast__SumTypeDecl* ptr = memdup(x, sizeof(v__ast__SumTypeDecl)); - return (v__ast__TypeDecl){ ._v__ast__SumTypeDecl = ptr, ._typ = 281, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, comments))}; + return (v__ast__TypeDecl){ ._v__ast__SumTypeDecl = ptr, ._typ = 282, .name = (string*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, name)), .is_pub = (bool*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, is_pub)), .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, pos)), .comments = (Array_v__ast__Comment*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SumTypeDecl, comments))}; } static inline v__ast__TypeInfo v__ast__Alias_to_sumtype_v__ast__TypeInfo(v__ast__Alias* x) { v__ast__Alias* ptr = memdup(x, sizeof(v__ast__Alias)); - return (v__ast__TypeInfo){ ._v__ast__Alias = ptr, ._typ = 470}; + return (v__ast__TypeInfo){ ._v__ast__Alias = ptr, ._typ = 471}; } static inline v__ast__Node v__ast__File_to_sumtype_v__ast__Node(v__ast__File* x) { v__ast__File* ptr = memdup(x, sizeof(v__ast__File)); - return (v__ast__Node){ ._v__ast__File = ptr, ._typ = 209}; + return (v__ast__Node){ ._v__ast__File = ptr, ._typ = 210}; } static bool Array_string_contains(Array_string a, string v) { @@ -12671,16 +12705,16 @@ static int v_typeof_interface_idx_IError(int sidx) { /* IError */ if (sidx == _IError_None___index) return 65620; if (sidx == _IError_Error_index) return 85; if (sidx == _IError_MessageError_index) return 86; - if (sidx == _IError_flag__UnkownFlagError_index) return 66133; - if (sidx == _IError_flag__ArgsCountError_index) return 66134; - if (sidx == _IError_semver__InvalidComparatorFormatError_index) return 66144; - if (sidx == _IError_semver__EmptyInputError_index) return 66146; - if (sidx == _IError_semver__InvalidVersionFormatError_index) return 66147; - if (sidx == _IError_os__FileNotOpenedError_index) return 65657; - if (sidx == _IError_os__SizeOfTypeIs0Error_index) return 65658; - if (sidx == _IError_os__ExecutableNotFoundError_index) return 65672; - if (sidx == _IError_time__TimeParseError_index) return 255; - if (sidx == _IError_v__gen__c__UnsupportedAssertCtempTransform_index) return 537; + if (sidx == _IError_flag__UnkownFlagError_index) return 66134; + if (sidx == _IError_flag__ArgsCountError_index) return 66135; + if (sidx == _IError_semver__InvalidComparatorFormatError_index) return 66145; + if (sidx == _IError_semver__EmptyInputError_index) return 66147; + if (sidx == _IError_semver__InvalidVersionFormatError_index) return 66148; + if (sidx == _IError_os__FileNotOpenedError_index) return 65658; + if (sidx == _IError_os__SizeOfTypeIs0Error_index) return 65659; + if (sidx == _IError_os__ExecutableNotFoundError_index) return 65673; + if (sidx == _IError_time__TimeParseError_index) return 256; + if (sidx == _IError_v__gen__c__UnsupportedAssertCtempTransform_index) return 538; return 29; } static char * v_typeof_interface_rand__PRNG(int sidx) { /* rand.PRNG */ @@ -12689,90 +12723,89 @@ static char * v_typeof_interface_rand__PRNG(int sidx) { /* rand.PRNG */ } static int v_typeof_interface_idx_rand__PRNG(int sidx) { /* rand.PRNG */ - if (sidx == _rand__PRNG_rand__wyrand__WyRandRNG_index) return 65771; - return 231; + if (sidx == _rand__PRNG_rand__wyrand__WyRandRNG_index) return 65772; + return 232; } static char * v_typeof_sumtype_v__ast__TypeDecl(int sidx) { /* v.ast.TypeDecl */ switch(sidx) { - case 282: return "v.ast.TypeDecl"; - case 279: return "v.ast.AliasTypeDecl"; - case 280: return "v.ast.FnTypeDecl"; - case 281: return "v.ast.SumTypeDecl"; + case 283: return "v.ast.TypeDecl"; + case 280: return "v.ast.AliasTypeDecl"; + case 281: return "v.ast.FnTypeDecl"; + case 282: return "v.ast.SumTypeDecl"; default: return "unknown v.ast.TypeDecl"; } } static int v_typeof_sumtype_idx_v__ast__TypeDecl(int sidx) { /* v.ast.TypeDecl */ switch(sidx) { - case 282: return 282; - case 279: return 279; + case 283: return 283; case 280: return 280; case 281: return 281; - default: return 282; + case 282: return 282; + default: return 283; } } static char * v_typeof_sumtype_v__ast__Expr(int sidx) { /* v.ast.Expr */ switch(sidx) { - case 334: return "v.ast.Expr"; - case 283: return "v.ast.AnonFn"; - case 284: return "v.ast.ArrayDecompose"; - case 285: return "v.ast.ArrayInit"; - case 286: return "v.ast.AsCast"; - case 287: return "v.ast.Assoc"; - case 288: return "v.ast.AtExpr"; - case 289: return "v.ast.BoolLiteral"; - case 290: return "v.ast.CTempVar"; - case 291: return "v.ast.CallExpr"; - case 292: return "v.ast.CastExpr"; - case 293: return "v.ast.ChanInit"; - case 294: return "v.ast.CharLiteral"; - case 295: return "v.ast.Comment"; - case 296: return "v.ast.ComptimeCall"; - case 297: return "v.ast.ComptimeSelector"; - case 298: return "v.ast.ComptimeType"; - case 299: return "v.ast.ConcatExpr"; - case 300: return "v.ast.DumpExpr"; - case 301: return "v.ast.EmptyExpr"; - case 302: return "v.ast.EnumVal"; - case 303: return "v.ast.FloatLiteral"; - case 304: return "v.ast.GoExpr"; - case 305: return "v.ast.Ident"; - case 306: return "v.ast.IfExpr"; - case 307: return "v.ast.IfGuardExpr"; - case 308: return "v.ast.IndexExpr"; - case 309: return "v.ast.InfixExpr"; - case 310: return "v.ast.IntegerLiteral"; - case 311: return "v.ast.IsRefType"; - case 312: return "v.ast.Likely"; - case 313: return "v.ast.LockExpr"; - case 314: return "v.ast.MapInit"; - case 315: return "v.ast.MatchExpr"; - case 316: return "v.ast.NodeError"; - case 317: return "v.ast.None"; - case 318: return "v.ast.OffsetOf"; - case 319: return "v.ast.OrExpr"; - case 320: return "v.ast.ParExpr"; - case 321: return "v.ast.PostfixExpr"; - case 322: return "v.ast.PrefixExpr"; - case 323: return "v.ast.RangeExpr"; - case 324: return "v.ast.SelectExpr"; - case 325: return "v.ast.SelectorExpr"; - case 326: return "v.ast.SizeOf"; - case 327: return "v.ast.SqlExpr"; - case 328: return "v.ast.StringInterLiteral"; - case 329: return "v.ast.StringLiteral"; - case 330: return "v.ast.StructInit"; - case 331: return "v.ast.TypeNode"; - case 332: return "v.ast.TypeOf"; - case 333: return "v.ast.UnsafeExpr"; + case 335: return "v.ast.Expr"; + case 284: return "v.ast.AnonFn"; + case 285: return "v.ast.ArrayDecompose"; + case 286: return "v.ast.ArrayInit"; + case 287: return "v.ast.AsCast"; + case 288: return "v.ast.Assoc"; + case 289: return "v.ast.AtExpr"; + case 290: return "v.ast.BoolLiteral"; + case 291: return "v.ast.CTempVar"; + case 292: return "v.ast.CallExpr"; + case 293: return "v.ast.CastExpr"; + case 294: return "v.ast.ChanInit"; + case 295: return "v.ast.CharLiteral"; + case 296: return "v.ast.Comment"; + case 297: return "v.ast.ComptimeCall"; + case 298: return "v.ast.ComptimeSelector"; + case 299: return "v.ast.ComptimeType"; + case 300: return "v.ast.ConcatExpr"; + case 301: return "v.ast.DumpExpr"; + case 302: return "v.ast.EmptyExpr"; + case 303: return "v.ast.EnumVal"; + case 304: return "v.ast.FloatLiteral"; + case 305: return "v.ast.GoExpr"; + case 306: return "v.ast.Ident"; + case 307: return "v.ast.IfExpr"; + case 308: return "v.ast.IfGuardExpr"; + case 309: return "v.ast.IndexExpr"; + case 310: return "v.ast.InfixExpr"; + case 311: return "v.ast.IntegerLiteral"; + case 312: return "v.ast.IsRefType"; + case 313: return "v.ast.Likely"; + case 314: return "v.ast.LockExpr"; + case 315: return "v.ast.MapInit"; + case 316: return "v.ast.MatchExpr"; + case 317: return "v.ast.NodeError"; + case 318: return "v.ast.None"; + case 319: return "v.ast.OffsetOf"; + case 320: return "v.ast.OrExpr"; + case 321: return "v.ast.ParExpr"; + case 322: return "v.ast.PostfixExpr"; + case 323: return "v.ast.PrefixExpr"; + case 324: return "v.ast.RangeExpr"; + case 325: return "v.ast.SelectExpr"; + case 326: return "v.ast.SelectorExpr"; + case 327: return "v.ast.SizeOf"; + case 328: return "v.ast.SqlExpr"; + case 329: return "v.ast.StringInterLiteral"; + case 330: return "v.ast.StringLiteral"; + case 331: return "v.ast.StructInit"; + case 332: return "v.ast.TypeNode"; + case 333: return "v.ast.TypeOf"; + case 334: return "v.ast.UnsafeExpr"; default: return "unknown v.ast.Expr"; } } static int v_typeof_sumtype_idx_v__ast__Expr(int sidx) { /* v.ast.Expr */ switch(sidx) { - case 334: return 334; - case 283: return 283; + case 335: return 335; case 284: return 284; case 285: return 285; case 286: return 286; @@ -12823,47 +12856,47 @@ static int v_typeof_sumtype_idx_v__ast__Expr(int sidx) { /* v.ast.Expr */ case 331: return 331; case 332: return 332; case 333: return 333; - default: return 334; + case 334: return 334; + default: return 335; } } static char * v_typeof_sumtype_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ switch(sidx) { - case 359: return "v.ast.Stmt"; - case 335: return "v.ast.AsmStmt"; - case 336: return "v.ast.AssertStmt"; - case 337: return "v.ast.AssignStmt"; - case 338: return "v.ast.Block"; - case 339: return "v.ast.BranchStmt"; - case 340: return "v.ast.ComptimeFor"; - case 341: return "v.ast.ConstDecl"; - case 342: return "v.ast.DeferStmt"; - case 343: return "v.ast.EmptyStmt"; - case 344: return "v.ast.EnumDecl"; - case 345: return "v.ast.ExprStmt"; - case 218: return "v.ast.FnDecl"; - case 346: return "v.ast.ForCStmt"; - case 347: return "v.ast.ForInStmt"; - case 348: return "v.ast.ForStmt"; - case 349: return "v.ast.GlobalDecl"; - case 350: return "v.ast.GotoLabel"; - case 351: return "v.ast.GotoStmt"; - case 352: return "v.ast.HashStmt"; - case 353: return "v.ast.Import"; - case 354: return "v.ast.InterfaceDecl"; - case 355: return "v.ast.Module"; - case 316: return "v.ast.NodeError"; - case 356: return "v.ast.Return"; - case 357: return "v.ast.SqlStmt"; - case 358: return "v.ast.StructDecl"; - case 282: return "v.ast.TypeDecl"; + case 360: return "v.ast.Stmt"; + case 336: return "v.ast.AsmStmt"; + case 337: return "v.ast.AssertStmt"; + case 338: return "v.ast.AssignStmt"; + case 339: return "v.ast.Block"; + case 340: return "v.ast.BranchStmt"; + case 341: return "v.ast.ComptimeFor"; + case 342: return "v.ast.ConstDecl"; + case 343: return "v.ast.DeferStmt"; + case 344: return "v.ast.EmptyStmt"; + case 345: return "v.ast.EnumDecl"; + case 346: return "v.ast.ExprStmt"; + case 219: return "v.ast.FnDecl"; + case 347: return "v.ast.ForCStmt"; + case 348: return "v.ast.ForInStmt"; + case 349: return "v.ast.ForStmt"; + case 350: return "v.ast.GlobalDecl"; + case 351: return "v.ast.GotoLabel"; + case 352: return "v.ast.GotoStmt"; + case 353: return "v.ast.HashStmt"; + case 354: return "v.ast.Import"; + case 355: return "v.ast.InterfaceDecl"; + case 356: return "v.ast.Module"; + case 317: return "v.ast.NodeError"; + case 357: return "v.ast.Return"; + case 358: return "v.ast.SqlStmt"; + case 359: return "v.ast.StructDecl"; + case 283: return "v.ast.TypeDecl"; default: return "unknown v.ast.Stmt"; } } static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ switch(sidx) { - case 359: return 359; - case 335: return 335; + case 360: return 360; case 336: return 336; case 337: return 337; case 338: return 338; @@ -12874,8 +12907,8 @@ static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ case 343: return 343; case 344: return 344; case 345: return 345; - case 218: return 218; case 346: return 346; + case 219: return 219; case 347: return 347; case 348: return 348; case 349: return 349; @@ -12885,84 +12918,85 @@ static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ case 353: return 353; case 354: return 354; case 355: return 355; - case 316: return 316; case 356: return 356; + case 317: return 317; case 357: return 357; case 358: return 358; - case 282: return 282; - default: return 359; + case 359: return 359; + case 283: return 283; + default: return 360; } } static char * v_typeof_sumtype_v__ast__ScopeObject(int sidx) { /* v.ast.ScopeObject */ switch(sidx) { - case 364: return "v.ast.ScopeObject"; - case 360: return "v.ast.AsmRegister"; - case 361: return "v.ast.ConstField"; - case 362: return "v.ast.GlobalField"; - case 363: return "v.ast.Var"; + case 365: return "v.ast.ScopeObject"; + case 361: return "v.ast.AsmRegister"; + case 362: return "v.ast.ConstField"; + case 363: return "v.ast.GlobalField"; + case 364: return "v.ast.Var"; default: return "unknown v.ast.ScopeObject"; } } static int v_typeof_sumtype_idx_v__ast__ScopeObject(int sidx) { /* v.ast.ScopeObject */ switch(sidx) { - case 364: return 364; - case 360: return 360; + case 365: return 365; case 361: return 361; case 362: return 362; case 363: return 363; - default: return 364; + case 364: return 364; + default: return 365; } } static char * v_typeof_sumtype_v__ast__Node(int sidx) { /* v.ast.Node */ switch(sidx) { - case 374: return "v.ast.Node"; - case 365: return "v.ast.CallArg"; - case 361: return "v.ast.ConstField"; - case 366: return "v.ast.EmptyNode"; - case 367: return "v.ast.EnumField"; - case 334: return "v.ast.Expr"; - case 209: return "v.ast.File"; - case 362: return "v.ast.GlobalField"; - case 368: return "v.ast.IfBranch"; - case 369: return "v.ast.MatchBranch"; - case 316: return "v.ast.NodeError"; - case 370: return "v.ast.Param"; - case 364: return "v.ast.ScopeObject"; - case 371: return "v.ast.SelectBranch"; - case 359: return "v.ast.Stmt"; - case 372: return "v.ast.StructField"; - case 373: return "v.ast.StructInitField"; + case 375: return "v.ast.Node"; + case 366: return "v.ast.CallArg"; + case 362: return "v.ast.ConstField"; + case 367: return "v.ast.EmptyNode"; + case 368: return "v.ast.EnumField"; + case 335: return "v.ast.Expr"; + case 210: return "v.ast.File"; + case 363: return "v.ast.GlobalField"; + case 369: return "v.ast.IfBranch"; + case 370: return "v.ast.MatchBranch"; + case 317: return "v.ast.NodeError"; + case 371: return "v.ast.Param"; + case 365: return "v.ast.ScopeObject"; + case 372: return "v.ast.SelectBranch"; + case 360: return "v.ast.Stmt"; + case 373: return "v.ast.StructField"; + case 374: return "v.ast.StructInitField"; default: return "unknown v.ast.Node"; } } static int v_typeof_sumtype_idx_v__ast__Node(int sidx) { /* v.ast.Node */ switch(sidx) { - case 374: return 374; - case 365: return 365; - case 361: return 361; + case 375: return 375; case 366: return 366; - case 367: return 367; - case 334: return 334; - case 209: return 209; case 362: return 362; + case 367: return 367; case 368: return 368; + case 335: return 335; + case 210: return 210; + case 363: return 363; case 369: return 369; - case 316: return 316; case 370: return 370; - case 364: return 364; + case 317: return 317; case 371: return 371; - case 359: return 359; + case 365: return 365; case 372: return 372; + case 360: return 360; case 373: return 373; - default: return 374; + case 374: return 374; + default: return 375; } } static char * v_typeof_sumtype_v__ast__ComptTimeConstValue(int sidx) { /* v.ast.ComptTimeConstValue */ switch(sidx) { - case 388: return "v.ast.ComptTimeConstValue"; - case 301: return "v.ast.EmptyExpr"; + case 389: return "v.ast.ComptTimeConstValue"; + case 302: return "v.ast.EmptyExpr"; case 15: return "f32"; case 16: return "f64"; case 6: return "i16"; @@ -12981,8 +13015,8 @@ static char * v_typeof_sumtype_v__ast__ComptTimeConstValue(int sidx) { /* v.ast. static int v_typeof_sumtype_idx_v__ast__ComptTimeConstValue(int sidx) { /* v.ast.ComptTimeConstValue */ switch(sidx) { - case 388: return 388; - case 301: return 301; + case 389: return 389; + case 302: return 302; case 15: return 15; case 16: return 16; case 6: return 6; @@ -12995,37 +13029,37 @@ static int v_typeof_sumtype_idx_v__ast__ComptTimeConstValue(int sidx) { /* v.ast case 12: return 12; case 13: return 13; case 10: return 10; - default: return 388; + default: return 389; } } static char * v_typeof_sumtype_v__ast__IdentInfo(int sidx) { /* v.ast.IdentInfo */ switch(sidx) { - case 416: return "v.ast.IdentInfo"; - case 414: return "v.ast.IdentFn"; - case 415: return "v.ast.IdentVar"; + case 417: return "v.ast.IdentInfo"; + case 415: return "v.ast.IdentFn"; + case 416: return "v.ast.IdentVar"; default: return "unknown v.ast.IdentInfo"; } } static int v_typeof_sumtype_idx_v__ast__IdentInfo(int sidx) { /* v.ast.IdentInfo */ switch(sidx) { - case 416: return 416; - case 414: return 414; + case 417: return 417; case 415: return 415; - default: return 416; + case 416: return 416; + default: return 417; } } static char * v_typeof_sumtype_v__ast__AsmArg(int sidx) { /* v.ast.AsmArg */ switch(sidx) { - case 433: return "v.ast.AsmArg"; - case 435: return "v.ast.AsmAddressing"; - case 436: return "v.ast.AsmAlias"; - case 437: return "v.ast.AsmDisp"; - case 360: return "v.ast.AsmRegister"; - case 289: return "v.ast.BoolLiteral"; - case 294: return "v.ast.CharLiteral"; - case 303: return "v.ast.FloatLiteral"; - case 310: return "v.ast.IntegerLiteral"; + case 434: return "v.ast.AsmArg"; + case 436: return "v.ast.AsmAddressing"; + case 437: return "v.ast.AsmAlias"; + case 438: return "v.ast.AsmDisp"; + case 361: return "v.ast.AsmRegister"; + case 290: return "v.ast.BoolLiteral"; + case 295: return "v.ast.CharLiteral"; + case 304: return "v.ast.FloatLiteral"; + case 311: return "v.ast.IntegerLiteral"; case 20: return "string"; default: return "unknown v.ast.AsmArg"; } @@ -13033,58 +13067,58 @@ static char * v_typeof_sumtype_v__ast__AsmArg(int sidx) { /* v.ast.AsmArg */ static int v_typeof_sumtype_idx_v__ast__AsmArg(int sidx) { /* v.ast.AsmArg */ switch(sidx) { - case 433: return 433; - case 435: return 435; + case 434: return 434; case 436: return 436; case 437: return 437; - case 360: return 360; - case 289: return 289; - case 294: return 294; - case 303: return 303; - case 310: return 310; + case 438: return 438; + case 361: return 361; + case 290: return 290; + case 295: return 295; + case 304: return 304; + case 311: return 311; case 20: return 20; - default: return 433; + default: return 434; } } static char * v_typeof_sumtype_v__ast__TypeInfo(int sidx) { /* v.ast.TypeInfo */ switch(sidx) { - case 485: return "v.ast.TypeInfo"; - case 468: return "v.ast.Aggregate"; - case 470: return "v.ast.Alias"; - case 450: return "v.ast.Array"; - case 478: return "v.ast.ArrayFixed"; - case 479: return "v.ast.Chan"; - case 484: return "v.ast.Enum"; - case 482: return "v.ast.FnType"; - case 483: return "v.ast.GenericInst"; - case 473: return "v.ast.Interface"; - case 451: return "v.ast.Map"; - case 481: return "v.ast.MultiReturn"; - case 455: return "v.ast.Struct"; - case 474: return "v.ast.SumType"; - case 480: return "v.ast.Thread"; + case 486: return "v.ast.TypeInfo"; + case 469: return "v.ast.Aggregate"; + case 471: return "v.ast.Alias"; + case 451: return "v.ast.Array"; + case 479: return "v.ast.ArrayFixed"; + case 480: return "v.ast.Chan"; + case 485: return "v.ast.Enum"; + case 483: return "v.ast.FnType"; + case 484: return "v.ast.GenericInst"; + case 474: return "v.ast.Interface"; + case 452: return "v.ast.Map"; + case 482: return "v.ast.MultiReturn"; + case 456: return "v.ast.Struct"; + case 475: return "v.ast.SumType"; + case 481: return "v.ast.Thread"; default: return "unknown v.ast.TypeInfo"; } } static int v_typeof_sumtype_idx_v__ast__TypeInfo(int sidx) { /* v.ast.TypeInfo */ switch(sidx) { - case 485: return 485; - case 468: return 468; - case 470: return 470; - case 450: return 450; - case 478: return 478; - case 479: return 479; - case 484: return 484; - case 482: return 482; - case 483: return 483; - case 473: return 473; + case 486: return 486; + case 469: return 469; + case 471: return 471; case 451: return 451; - case 481: return 481; - case 455: return 455; - case 474: return 474; + case 479: return 479; case 480: return 480; - default: return 485; + case 485: return 485; + case 483: return 483; + case 484: return 484; + case 474: return 474; + case 452: return 452; + case 482: return 482; + case 456: return 456; + case 475: return 475; + case 481: return 481; + default: return 486; } } static char * v_typeof_interface_hash__Hasher(int sidx) { /* hash.Hasher */ @@ -13092,21 +13126,21 @@ static char * v_typeof_interface_hash__Hasher(int sidx) { /* hash.Hasher */ } static int v_typeof_interface_idx_hash__Hasher(int sidx) { /* hash.Hasher */ - return 532; + return 533; } static char * v_typeof_interface_hash__Hash32er(int sidx) { /* hash.Hash32er */ return "unknown hash.Hash32er"; } static int v_typeof_interface_idx_hash__Hash32er(int sidx) { /* hash.Hash32er */ - return 533; + return 534; } static char * v_typeof_interface_hash__Hash64er(int sidx) { /* hash.Hash64er */ return "unknown hash.Hash64er"; } static int v_typeof_interface_idx_hash__Hash64er(int sidx) { /* hash.Hash64er */ - return 534; + return 535; } static char * v_typeof_interface_v__ast__walker__Visitor(int sidx) { /* v.ast.walker.Visitor */ if (sidx == _v__ast__walker__Visitor_v__ast__walker__Inspector_index) return "v.ast.walker.Inspector"; @@ -13115,9 +13149,9 @@ static char * v_typeof_interface_v__ast__walker__Visitor(int sidx) { /* v.ast.wa } static int v_typeof_interface_idx_v__ast__walker__Visitor(int sidx) { /* v.ast.walker.Visitor */ - if (sidx == _v__ast__walker__Visitor_v__ast__walker__Inspector_index) return 572; - if (sidx == _v__ast__walker__Visitor_v__callgraph__Mapper_index) return 66061; - return 570; + if (sidx == _v__ast__walker__Visitor_v__ast__walker__Inspector_index) return 573; + if (sidx == _v__ast__walker__Visitor_v__callgraph__Mapper_index) return 66062; + return 571; } // << typeof() support for sum types @@ -14282,16 +14316,16 @@ Option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool e if (err != 0 && (error_on_non_digit || error_on_high_digit)) { if (err == (-1)) { - return (Option_u64){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: wrong base "), 0xfe07, {.d_i32 = _base}}, {_SLIT(" for "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_u64){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: wrong base "), /*100 &int*/0xfe07, {.d_i32 = _base}}, {_SLIT(" for "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (err == (-2)) { - return (Option_u64){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: wrong bit size "), 0xfe07, {.d_i32 = _bit_size}}, {_SLIT(" for "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_u64){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: wrong bit size "), /*100 &int*/0xfe07, {.d_i32 = _bit_size}}, {_SLIT(" for "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (err == (-3)) { - return (Option_u64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: integer overflow "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_u64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: integer overflow "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else { - return (Option_u64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: syntax error "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_u64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("common_parse_uint: syntax error "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; } Option_u64 _t5; @@ -14429,21 +14463,21 @@ Option_i64 strconv__parse_int(string _s, int base, int _bit_size) { Option_int strconv__atoi(string s) { if ((s).len == 0) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), 0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if ((_const_strconv__int_size == 32 && (0 < s.len && s.len < 10)) || (_const_strconv__int_size == 64 && (0 < s.len && s.len < 19))) { int start_idx = 0; if (string_at(s, 0) == '-' || string_at(s, 0) == '+') { start_idx++; if (s.len - start_idx < 1) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), 0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } int n = 0; for (int i = start_idx; i < s.len; ++i) { rune ch = string_at(s, i) - '0'; if (ch > 9) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), 0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strconv.atoi: parsing \""), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\": invalid syntax "), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } n = n * 10 + ((int)(ch)); } @@ -15518,7 +15552,7 @@ inline string strconv__ftoa_long_32(f32 f) { string strconv__format_int(i64 n, int radix) { { // Unsafe block if (radix < 2 || radix > 36) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid radix: "), 0xfe07, {.d_i32 = radix}}, {_SLIT(" . It should be => 2 and <= 36"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid radix: "), /*100 &int*/0xfe07, {.d_i32 = radix}}, {_SLIT(" . It should be => 2 and <= 36"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (n == 0) { @@ -15555,7 +15589,7 @@ string strconv__format_int(i64 n, int radix) { string strconv__format_uint(u64 n, int radix) { { // Unsafe block if (radix < 2 || radix > 36) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid radix: "), 0xfe07, {.d_i32 = radix}}, {_SLIT(" . It should be => 2 and <= 36"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid radix: "), /*100 &int*/0xfe07, {.d_i32 = radix}}, {_SLIT(" . It should be => 2 and <= 36"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (n == 0U) { @@ -16482,7 +16516,7 @@ strings__Builder res; i++; } if (p_index != pt.len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = p_index}}, {_SLIT(" % conversion specifiers, but given "), 0xfe07, {.d_i32 = pt.len}}, {_SLIT(" args"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = p_index}}, {_SLIT(" % conversion specifiers, but given "), /*100 &int*/0xfe07, {.d_i32 = pt.len}}, {_SLIT(" args"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } string _t1 = strings__Builder_str(&res); @@ -16497,7 +16531,7 @@ strings__Builder res; // Attr: [inline] inline VV_LOCAL_SYMBOL void strconv__v_sprintf_panic(int idx, int len) { if (idx >= len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = idx + 1}}, {_SLIT(" % conversion specifiers, but given only "), 0xfe07, {.d_i32 = len}}, {_SLIT(" args"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = idx + 1}}, {_SLIT(" % conversion specifiers, but given only "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(" args"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -16839,7 +16873,7 @@ array array_repeat(array a, int count) { // Attr: [unsafe] array array_repeat_to_depth(array a, int count, int depth) { if (count < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("array.repeat: count is negative: "), 0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("array.repeat: count is negative: "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } int size = count * a.len * a.element_size; @@ -16864,7 +16898,7 @@ void array_insert(array* a, int i, voidptr val) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i > a->len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.insert: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.insert: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -16884,7 +16918,7 @@ VV_LOCAL_SYMBOL void array_insert_many(array* a, int i, voidptr val, int size) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i > a->len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.insert_many: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.insert_many: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -16916,8 +16950,8 @@ void array_delete_many(array* a, int i, int size) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i + size > a->len) { - string endidx = (size > 1 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT(".."), 0xfe07, {.d_i32 = i + size}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); - _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("array.delete: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0xfe10, {.d_s = endidx}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + string endidx = (size > 1 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT(".."), /*100 &int*/0xfe07, {.d_i32 = i + size}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); + _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("array.delete: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = endidx}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -16975,7 +17009,7 @@ VV_LOCAL_SYMBOL voidptr array_get(array a, int i) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i >= a.len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.get: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.get: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17055,15 +17089,15 @@ VV_LOCAL_SYMBOL array array_slice(array a, int start, int _end) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (start > end) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.slice: invalid slice index ("), 0xfe07, {.d_i32 = start}}, {_SLIT(" > "), 0xfe07, {.d_i32 = end}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.slice: invalid slice index ("), /*100 &int*/0xfe07, {.d_i32 = start}}, {_SLIT(" > "), /*100 &int*/0xfe07, {.d_i32 = end}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (end > a.len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.slice: slice bounds out of range ("), 0xfe07, {.d_i32 = end}}, {_SLIT(" >= "), 0xfe07, {.d_i32 = a.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.slice: slice bounds out of range ("), /*100 &int*/0xfe07, {.d_i32 = end}}, {_SLIT(" >= "), /*100 &int*/0xfe07, {.d_i32 = a.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (start < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("array.slice: slice bounds out of range ("), 0xfe07, {.d_i32 = start}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("array.slice: slice bounds out of range ("), /*100 &int*/0xfe07, {.d_i32 = start}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17151,7 +17185,7 @@ VV_LOCAL_SYMBOL void array_set(array* a, int i, voidptr val) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i >= a->len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.set: index out of range (i == "), 0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), 0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("array.set: index out of range (i == "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", a.len == "), /*100 &int*/0xfe07, {.d_i32 = a->len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -17373,11 +17407,11 @@ VNORETURN VV_LOCAL_SYMBOL void panic_debug(int line_no, string file, string mod, #else { eprintln(_SLIT("================ V panic ================")); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" module: "), 0xfe10, {.d_s = mod}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" function: "), 0xfe10, {.d_s = fn_name}}, {_SLIT("()"), 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" message: "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" file: "), 0xfe10, {.d_s = file}}, {_SLIT(":"), 0xfe07, {.d_i32 = line_no}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" v hash: "), 0xfe10, {.d_s = vcommithash()}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" module: "), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" function: "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("()"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" message: "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" file: "), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = line_no}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" v hash: "), /*115 &string*/0xfe10, {.d_s = vcommithash()}}, {_SLIT0, 0, { .d_c = 0 }}}))); eprintln(_SLIT("=========================================")); #if defined(CUSTOM_DEFINE_exit_after_panic_message) { @@ -17401,7 +17435,7 @@ VNORETURN VV_LOCAL_SYMBOL void panic_debug(int line_no, string file, string mod, // Attr: [noreturn] VNORETURN void panic_optional_not_set(string s) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("optional not set ("), 0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("optional not set ("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); while(1); } @@ -17415,7 +17449,7 @@ VNORETURN void _v_panic(string s) { { eprint(_SLIT("V panic: ")); eprintln(s); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v hash: "), 0xfe10, {.d_s = vcommithash()}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v hash: "), /*115 &string*/0xfe10, {.d_s = vcommithash()}}, {_SLIT0, 0, { .d_c = 0 }}}))); #if defined(CUSTOM_DEFINE_exit_after_panic_message) { } @@ -17598,7 +17632,7 @@ VV_LOCAL_SYMBOL void _write_buf_to_fd(int fd, u8* buf, int buf_len) { // Attr: [unsafe] u8* _v_malloc(int n) { if (n <= 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc("), 0xfe07, {.d_i32 = n}}, {_SLIT(" <= 0)"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(" <= 0)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } u8* res = ((u8*)(0)); @@ -17617,7 +17651,7 @@ u8* _v_malloc(int n) { } #endif if (res == 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc("), 0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } return res; @@ -17626,7 +17660,7 @@ u8* _v_malloc(int n) { // Attr: [unsafe] u8* malloc_noscan(int n) { if (n <= 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc_noscan("), 0xfe07, {.d_i32 = n}}, {_SLIT(" <= 0)"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc_noscan("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(" <= 0)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } u8* res = ((u8*)(0)); @@ -17645,7 +17679,7 @@ u8* malloc_noscan(int n) { } #endif if (res == 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc_noscan("), 0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("malloc_noscan("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } return res; @@ -17666,7 +17700,7 @@ u8* v_realloc(u8* b, int n) { } #endif if (new_ptr == 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("realloc("), 0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("realloc("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } return new_ptr; @@ -17684,7 +17718,7 @@ u8* realloc_data(u8* old_data, int old_size, int new_size) { } #endif if (nptr == 0) { - _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("realloc_data("), 0xfe11, {.d_p = (void*)(old_data)}}, {_SLIT(", "), 0xfe07, {.d_i32 = old_size}}, {_SLIT(", "), 0xfe07, {.d_i32 = new_size}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("realloc_data("), /*117 &u8*/0xfe11, {.d_p = (void*)(old_data)}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = old_size}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = new_size}}, {_SLIT(") failed"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } return nptr; @@ -17692,7 +17726,7 @@ u8* realloc_data(u8* old_data, int old_size, int new_size) { u8* vcalloc(int n) { if (n < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("calloc("), 0xfe07, {.d_i32 = n}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("calloc("), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT(" < 0)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (n == 0) { return ((u8*)(0)); @@ -17770,7 +17804,7 @@ inline VV_LOCAL_SYMBOL int v_fixed_index(int i, int len) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (i < 0 || i >= len) { - string s = str_intp(3, _MOV((StrIntpData[]){{_SLIT("fixed array index out of range (index: "), 0xfe07, {.d_i32 = i}}, {_SLIT(", len: "), 0xfe07, {.d_i32 = len}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string s = str_intp(3, _MOV((StrIntpData[]){{_SLIT("fixed array index out of range (index: "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", len: "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(")"), 0, { .d_c = 0 }}})); _v_panic(s); VUNREACHABLE(); } @@ -17819,7 +17853,7 @@ VV_LOCAL_SYMBOL voidptr __as_cast(voidptr obj, int obj_type, int expected_type) expected_name = string_clone(x.tname); } } - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("as cast: cannot cast `"), 0xfe10, {.d_s = obj_name}}, {_SLIT("` to `"), 0xfe10, {.d_s = expected_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("as cast: cannot cast `"), /*115 &string*/0xfe10, {.d_s = obj_name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = expected_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } return obj; @@ -17841,13 +17875,13 @@ void VAssertMetaInfo_free(VAssertMetaInfo* ami) { } VV_LOCAL_SYMBOL void __print_assert_failure(VAssertMetaInfo* i) { - eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = i->fpath}}, {_SLIT(":"), 0xfe07, {.d_i32 = i->line_nr + 1}}, {_SLIT(": FAIL: fn "), 0xfe10, {.d_s = i->fn_name}}, {_SLIT(": assert "), 0xfe10, {.d_s = i->src}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = i->fpath}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = i->line_nr + 1}}, {_SLIT(": FAIL: fn "), /*115 &string*/0xfe10, {.d_s = i->fn_name}}, {_SLIT(": assert "), /*115 &string*/0xfe10, {.d_s = i->src}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i->op.len > 0 && !string__eq(i->op, _SLIT("call"))) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" left value: "), 0xfe10, {.d_s = i->llabel}}, {_SLIT(" = "), 0xfe10, {.d_s = i->lvalue}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" left value: "), /*115 &string*/0xfe10, {.d_s = i->llabel}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = i->lvalue}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (string__eq(i->rlabel, i->rvalue)) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" right value: "), 0xfe10, {.d_s = i->rlabel}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" right value: "), /*115 &string*/0xfe10, {.d_s = i->rlabel}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" right value: "), 0xfe10, {.d_s = i->rlabel}}, {_SLIT(" = "), 0xfe10, {.d_s = i->rvalue}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" right value: "), /*115 &string*/0xfe10, {.d_s = i->rlabel}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = i->rvalue}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -17956,21 +17990,21 @@ voidptr handle; if (SymGetLineFromAddr64(handle, (*(frame_addr)), &offset, &sline64) == 1) { string file_name = tos3(sline64.f_file_name); u32 lnumber = sline64.f_line_number; - lineinfo = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = file_name}}, {_SLIT(":"), 0xfe06, {.d_u32 = lnumber}}, {_SLIT0, 0, { .d_c = 0 }}})); + lineinfo = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = file_name}}, {_SLIT(":"), /*117 &u32*/0xfe06, {.d_u32 = lnumber}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { addr: {} - lineinfo = str_intp(2, _MOV((StrIntpData[]){{_SLIT("?? : address = 0x"), 0x7000fe11, {.d_p = (void*)((&(*(frame_addr))))}}, {_SLIT0, 0, { .d_c = 0 }}})); + lineinfo = str_intp(2, _MOV((StrIntpData[]){{_SLIT("?? : address = 0x"), /*120 &voidptr*/0x7000fe11, {.d_p = (void*)((&(*(frame_addr))))}}, {_SLIT0, 0, { .d_c = 0 }}})); } string sfunc = tos3(fname); - eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x4fe07, {.d_i32 = nframe}}, {_SLIT(": "), 0x32fe10, {.d_s = sfunc}}, {_SLIT(" "), 0xfe10, {.d_s = lineinfo}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x4fe07, {.d_i32 = nframe}}, {_SLIT(": "), /*115 &string*/0x32fe10, {.d_s = sfunc}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = lineinfo}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { int cerr = ((int)(GetLastError())); if (cerr == 87) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("SymFromAddr failure: "), 0xfe07, {.d_i32 = cerr}}, {_SLIT(" = The parameter is incorrect)"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("SymFromAddr failure: "), /*100 &int*/0xfe07, {.d_i32 = cerr}}, {_SLIT(" = The parameter is incorrect)"), 0, { .d_c = 0 }}}))); } else if (cerr == 487) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("SymFromAddr failure: "), 0xfe07, {.d_i32 = cerr}}, {_SLIT(" = Attempt to access invalid address (Verify that you have the .pdb file in the right folder.)"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("SymFromAddr failure: "), /*100 &int*/0xfe07, {.d_i32 = cerr}}, {_SLIT(" = Attempt to access invalid address (Verify that you have the .pdb file in the right folder.)"), 0, { .d_c = 0 }}}))); } else { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("SymFromAddr failure: "), 0xfe07, {.d_i32 = cerr}}, {_SLIT(" (see https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes)"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("SymFromAddr failure: "), /*100 &int*/0xfe07, {.d_i32 = cerr}}, {_SLIT(" (see https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes)"), 0, { .d_c = 0 }}}))); } } } @@ -18022,7 +18056,7 @@ VV_LOCAL_SYMBOL int __stdcall unhandled_exception_handler(ExceptionPointers* e) return 0; } else { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unhandled Exception 0x"), 0x7000fe86, {.d_u32 = e->exception_record->code}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unhandled Exception 0x"), /*88 &u32*/0x7000fe86, {.d_u32 = e->exception_record->code}}, {_SLIT0, 0, { .d_c = 0 }}}))); print_backtrace_skipping_top_frames(5); }; return 0; @@ -18052,7 +18086,7 @@ string winapi_lasterr_str(void) { } u16* msgbuf = ((u16*)(0)); voidptr res = FormatMessage(((FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM) | FORMAT_MESSAGE_IGNORE_INSERTS), NULL, err_msg_id, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &msgbuf, 0, NULL); - string err_msg = (res == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Win-API error "), 0xfe06, {.d_u32 = err_msg_id}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (string_from_wide(msgbuf))); + string err_msg = (res == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Win-API error "), /*117 &u32*/0xfe06, {.d_u32 = err_msg_id}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (string_from_wide(msgbuf))); return err_msg; } @@ -18770,7 +18804,7 @@ Option_rune Array_u8_byterune(Array_u8 b) { string u8_repeat(u8 b, int count) { if (count < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("byte.repeat: count is negative: "), 0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("byte.repeat: count is negative: "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (count == 0) { return _SLIT(""); @@ -19452,7 +19486,7 @@ string IError_str(IError err) { } else { - _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = charptr_vstring_literal( /* IError */ v_typeof_interface_IError( (err)._typ ))}}, {_SLIT(": "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* IError */ v_typeof_interface_IError( (err)._typ ))}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})); } return _t2; } @@ -19501,6 +19535,13 @@ VV_LOCAL_SYMBOL void opt_ok(voidptr data, Option* option, int size) { } } +VV_LOCAL_SYMBOL void _result_ok(voidptr data, _result* res, int size) { + { // Unsafe block + *res = ((_result){.is_error = 0,.err = _const_none__,}); + vmemcpy(((u8*)(&res->err)) + sizeof(IError), data, size); + } +} + string none_str(none _d2) { return _SLIT("none"); } @@ -19594,7 +19635,7 @@ string Array_rune_string(Array_rune ra) { string rune_repeat(rune c, int count) { if (count < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("rune.repeat: count is negative: "), 0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("rune.repeat: count is negative: "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (count == 0) { return _SLIT(""); @@ -20610,7 +20651,7 @@ string string_substr(string s, int start, int end) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (start > end || start > s.len || end > s.len || start < 0 || end < 0) { - _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("substr("), 0xfe07, {.d_i32 = start}}, {_SLIT(", "), 0xfe07, {.d_i32 = end}}, {_SLIT(") out of bounds (len="), 0xfe07, {.d_i32 = s.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT("substr("), /*100 &int*/0xfe07, {.d_i32 = start}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = end}}, {_SLIT(") out of bounds (len="), /*100 &int*/0xfe07, {.d_i32 = s.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -20634,7 +20675,7 @@ string string_substr(string s, int start, int end) { // Attr: [direct_array_access] Option_string string_substr_with_check(string s, int start, int end) { if (start > end || start > s.len || end > s.len || start < 0 || end < 0) { - return (Option_string){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT("substr("), 0xfe07, {.d_i32 = start}}, {_SLIT(", "), 0xfe07, {.d_i32 = end}}, {_SLIT(") out of bounds (len="), 0xfe07, {.d_i32 = s.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT("substr("), /*100 &int*/0xfe07, {.d_i32 = start}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = end}}, {_SLIT(") out of bounds (len="), /*100 &int*/0xfe07, {.d_i32 = s.len}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int len = end - start; if (len == s.len) { @@ -21244,7 +21285,7 @@ VV_LOCAL_SYMBOL byte string_at(string s, int idx) { #if !defined(CUSTOM_DEFINE_no_bounds_checking) { if (idx < 0 || idx >= s.len) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("string index out of range: "), 0xfe07, {.d_i32 = idx}}, {_SLIT(" / "), 0xfe07, {.d_i32 = s.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("string index out of range: "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT(" / "), /*100 &int*/0xfe07, {.d_i32 = s.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -21465,7 +21506,7 @@ Array_u8 string_bytes(string s) { string string_repeat(string s, int count) { if (count < 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("string.repeat: count is negative: "), 0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("string.repeat: count is negative: "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (count == 0) { return _SLIT(""); @@ -22344,22 +22385,22 @@ string str_intp(int data_len, voidptr in_data) { // Attr: [inline] inline string str_intp_sq(string in_str) { - return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"\'\"), "), 0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = in_str}}, {_SLIT("}},{_SLIT(\"\'\"), 0, {.d_c = 0 }}}))"), 0, { .d_c = 0 }}})); + return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT("}},{_SLIT(\"\'\"), 0, {.d_c = 0 }}}))"), 0, { .d_c = 0 }}})); } // Attr: [inline] inline string str_intp_rune(string in_str) { - return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"`\"), "), 0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = in_str}}, {_SLIT("}},{_SLIT(\"`\"), 0, {.d_c = 0 }}}))"), 0, { .d_c = 0 }}})); + return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"`\"), "), /*115 &string*/0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT("}},{_SLIT(\"`\"), 0, {.d_c = 0 }}}))"), 0, { .d_c = 0 }}})); } // Attr: [inline] inline string str_intp_g32(string in_str) { - return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), 0xfe10, {.d_s = _const_si_g32_code}}, {_SLIT(", {.d_f32 = "), 0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); + return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_si_g32_code}}, {_SLIT(", {.d_f32 = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); } // Attr: [inline] inline string str_intp_g64(string in_str) { - return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), 0xfe10, {.d_s = _const_si_g64_code}}, {_SLIT(", {.d_f64 = "), 0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); + return str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_si_g64_code}}, {_SLIT(", {.d_f64 = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); } // Attr: [manualfree] @@ -22378,12 +22419,12 @@ string str_intp_sub(string base_str, string in_str) { string st_str = string_substr(base_str, 0, index); if (index + 2 < base_str.len) { string en_str = string_substr(base_str, index + 2, (base_str).len); - string res_str = str_intp(5, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\""), 0xfe10, {.d_s = st_str}}, {_SLIT("\"), "), 0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = in_str}}, {_SLIT(" }},{_SLIT(\""), 0xfe10, {.d_s = en_str}}, {_SLIT("\"), 0, {.d_c = 0}}}))"), 0, { .d_c = 0 }}})); + string res_str = str_intp(5, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = st_str}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT(" }},{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = en_str}}, {_SLIT("\"), 0, {.d_c = 0}}}))"), 0, { .d_c = 0 }}})); string_free(&st_str); string_free(&en_str); return res_str; } - string res2_str = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\""), 0xfe10, {.d_s = st_str}}, {_SLIT("\"), "), 0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); + string res2_str = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = st_str}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = _const_si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = in_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})); string_free(&st_str); return res2_str; } @@ -22693,7 +22734,7 @@ inline string dl__get_shared_library_extension(void) { // Attr: [inline] inline string dl__get_libname(string libname) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = libname}}, {_SLIT0, 0xfe10, {.d_s = _const_dl__dl_ext}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = libname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_dl__dl_ext}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -22737,7 +22778,7 @@ voidptr dl__sym(voidptr handle, string symbol) { string dl__dlerror(void) { int cerr = ((int)(GetLastError())); - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("error code "), 0xfe07, {.d_i32 = cerr}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("error code "), /*100 &int*/0xfe07, {.d_i32 = cerr}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -23010,7 +23051,7 @@ v__token__KeywordsMatcher v__token__new_keywords_matcher_T_int(Map_string_int kw VV_LOCAL_SYMBOL void v__token__KeywordsMatcher_add_word(v__token__KeywordsMatcher* km, string word, int kind) { if (word.len >= _const_v__token__max_keyword_len) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("increase max_keyword_len to > "), 0xfe07, {.d_i32 = word.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("increase max_keyword_len to > "), /*100 &int*/0xfe07, {.d_i32 = word.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (km->len_max < word.len) { @@ -23063,7 +23104,7 @@ void v__token__Pos_free(v__token__Pos* p) { } string v__token__Pos_line_str(v__token__Pos p) { - string _t1 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("{l: "), 0xafe27, {.d_i32 = p.line_nr + 1}}, {_SLIT(", c: "), 0x6fe27, {.d_i32 = p.col}}, {_SLIT(", p: "), 0xafe27, {.d_i32 = p.pos}}, {_SLIT(", ll: "), 0xafe27, {.d_i32 = p.last_line + 1}}, {_SLIT("}"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("{l: "), /*100 &int*/0xafe27, {.d_i32 = p.line_nr + 1}}, {_SLIT(", c: "), /*100 &int*/0x6fe27, {.d_i32 = p.col}}, {_SLIT(", p: "), /*100 &int*/0xafe27, {.d_i32 = p.pos}}, {_SLIT(", ll: "), /*100 &int*/0xafe27, {.d_i32 = p.last_line + 1}}, {_SLIT("}"), 0, { .d_c = 0 }}})); return _t1; } @@ -23246,14 +23287,14 @@ string v__token__Token_str(v__token__Token t) { if (s.len == 0) { eprintln(_SLIT("missing token kind string")); } else if (!u8_is_letter(string_at(s, 0))) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("token `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("token `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } if (v__token__is_key(t.lit)) { s = _SLIT("keyword"); } if ((t.lit).len != 0) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" `"), 0xfe10, {.d_s = t.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = t.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } string _t2 = s; return _t2; @@ -23262,7 +23303,7 @@ string v__token__Token_str(v__token__Token t) { string v__token__Token_debug(v__token__Token t) { string ks = v__token__kind_to_string(t.kind); string s = ((t.lit).len == 0 ? (v__token__Kind_str(t.kind)) : (t.lit)); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("tok: ."), 0x18fe10, {.d_s = ks}}, {_SLIT(" | lit: `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("tok: ."), /*115 &string*/0x18fe10, {.d_s = ks}}, {_SLIT(" | lit: `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } @@ -23341,7 +23382,7 @@ inline bool v__token__Kind_is_relational(v__token__Kind tok) { // Attr: [inline] inline bool v__token__Kind_is_start_of_type(v__token__Kind k) { - bool _t1 = (k == v__token__Kind__name || k == v__token__Kind__lpar || k == v__token__Kind__amp || k == v__token__Kind__lsbr || k == v__token__Kind__question || k == v__token__Kind__key_shared); + bool _t1 = (k == v__token__Kind__name || k == v__token__Kind__lpar || k == v__token__Kind__amp || k == v__token__Kind__lsbr || k == v__token__Kind__question || k == v__token__Kind__key_shared || k == v__token__Kind__not); return _t1; } @@ -24320,12 +24361,12 @@ void v__dotgraph__start_digraph(void) { v__dotgraph__DotGraph* v__dotgraph__new(string name, string label, string color) { v__dotgraph__DotGraph* res = ((v__dotgraph__DotGraph*)memdup(&(v__dotgraph__DotGraph){.sb = strings__new_builder(1024),}, sizeof(v__dotgraph__DotGraph))); - v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" subgraph cluster_"), 0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" subgraph cluster_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); v__dotgraph__DotGraph_writeln(res, _SLIT("\tedge [fontname=\"Helvetica\",fontsize=\"10\",labelfontname=\"Helvetica\",labelfontsize=\"10\",style=\"solid\",color=\"black\"];")); v__dotgraph__DotGraph_writeln(res, _SLIT("\tnode [fontname=\"Helvetica\",fontsize=\"10\",style=\"filled\",fontcolor=\"black\",fillcolor=\"white\",color=\"black\",shape=\"box\"];")); v__dotgraph__DotGraph_writeln(res, _SLIT("\trankdir=\"LR\";")); - v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tcolor=\""), 0xfe10, {.d_s = color}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); - v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tlabel=\""), 0xfe10, {.d_s = label}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tcolor=\""), /*115 &string*/0xfe10, {.d_s = color}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tlabel=\""), /*115 &string*/0xfe10, {.d_s = label}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); v__dotgraph__DotGraph* _t1 = res; return _t1; } @@ -24345,9 +24386,9 @@ void v__dotgraph__DotGraph_new_node(v__dotgraph__DotGraph* d, string nlabel, v__ nname = cfg.node_name; } if (cfg.should_highlight) { - v__dotgraph__DotGraph_writeln(d, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = nname}}, {_SLIT(" [label=\""), 0xfe10, {.d_s = nlabel}}, {_SLIT("\",color=\"blue\",height=0.2,width=0.4,fillcolor=\"#00FF00\",tooltip=\""), 0xfe10, {.d_s = cfg.tooltip}}, {_SLIT("\",shape=oval];"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(d, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = nname}}, {_SLIT(" [label=\""), /*115 &string*/0xfe10, {.d_s = nlabel}}, {_SLIT("\",color=\"blue\",height=0.2,width=0.4,fillcolor=\"#00FF00\",tooltip=\""), /*115 &string*/0xfe10, {.d_s = cfg.tooltip}}, {_SLIT("\",shape=oval];"), 0, { .d_c = 0 }}}))); } else { - v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = nname}}, {_SLIT(" [shape=\"box\",label=\""), 0xfe10, {.d_s = nlabel}}, {_SLIT("\"];"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = nname}}, {_SLIT(" [shape=\"box\",label=\""), /*115 &string*/0xfe10, {.d_s = nlabel}}, {_SLIT("\"];"), 0, { .d_c = 0 }}}))); } } @@ -24355,9 +24396,9 @@ void v__dotgraph__DotGraph_new_edge(v__dotgraph__DotGraph* d, string source, str string nsource = cfg.name2node_fn(source, cfg.ctx); string ntarget = cfg.name2node_fn(target, cfg.ctx); if (cfg.should_highlight) { - v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = nsource}}, {_SLIT(" -> "), 0xfe10, {.d_s = ntarget}}, {_SLIT(" [color=\"blue\"];"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = nsource}}, {_SLIT(" -> "), /*115 &string*/0xfe10, {.d_s = ntarget}}, {_SLIT(" [color=\"blue\"];"), 0, { .d_c = 0 }}}))); } else { - v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = nsource}}, {_SLIT(" -> "), 0xfe10, {.d_s = ntarget}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__dotgraph__DotGraph_writeln(d, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = nsource}}, {_SLIT(" -> "), /*115 &string*/0xfe10, {.d_s = ntarget}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } @@ -24511,19 +24552,19 @@ inline u64 hash__fnv1a__sum64_bytes(u8* data, int data_len) { } VV_LOCAL_SYMBOL string flag__UnkownFlagError_msg(flag__UnkownFlagError err) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unknown flag `"), 0xfe10, {.d_s = err.flag}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unknown flag `"), /*115 &string*/0xfe10, {.d_s = err.flag}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } VV_LOCAL_SYMBOL string flag__ArgsCountError_msg(flag__ArgsCountError err) { if (err.want == 0) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Expected no arguments, but got "), 0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Expected no arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } else if (err.got > err.want) { - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Expected at most "), 0xfe07, {.d_i32 = err.want}}, {_SLIT(" arguments, but got "), 0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Expected at most "), /*100 &int*/0xfe07, {.d_i32 = err.want}}, {_SLIT(" arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } else { - string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Expected at least "), 0xfe07, {.d_i32 = err.want}}, {_SLIT(" arguments, but got "), 0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Expected at least "), /*100 &int*/0xfe07, {.d_i32 = err.want}}, {_SLIT(" arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = err.got}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } return (string){.str=(byteptr)"", .is_lit=1}; @@ -24539,7 +24580,7 @@ VV_LOCAL_SYMBOL void flag__Flag_free(flag__Flag* f) { } string flag__Flag_str(flag__Flag f) { - string _t1 = string__plus(string__plus(string__plus(string__plus(_SLIT(" flag:\n"), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" name: "), 0xfe10, {.d_s = f.name}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" abbr: `"), 0xfe10, {.d_s = u8_ascii_str(f.abbr)}}, {_SLIT("`\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" usag: "), 0xfe10, {.d_s = f.usage}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" desc: "), 0xfe10, {.d_s = f.val_desc}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string _t1 = string__plus(string__plus(string__plus(string__plus(_SLIT(" flag:\n"), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" name: "), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" abbr: `"), /*115 &string*/0xfe10, {.d_s = u8_ascii_str(f.abbr)}}, {_SLIT("`\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" usag: "), /*115 &string*/0xfe10, {.d_s = f.usage}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), str_intp(2, _MOV((StrIntpData[]){{_SLIT(" desc: "), /*115 &string*/0xfe10, {.d_s = f.val_desc}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t1; } @@ -24611,7 +24652,7 @@ void flag__FlagParser_description(flag__FlagParser* fs, string desc) { if (fs->application_description.len == 0) { fs->application_description = desc; } else { - fs->application_description = /*f*/string__plus(fs->application_description, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = desc}}, {_SLIT0, 0, { .d_c = 0 }}}))); + fs->application_description = /*f*/string__plus(fs->application_description, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = desc}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -24633,7 +24674,7 @@ bool flag__FlagParser_parse_value_defer_0 = false; string full; bool flag__FlagParser_parse_value_defer_1 = false; Array_int to_delete; - full = str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), 0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); + full = str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), /*115 &string*/0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); flag__FlagParser_parse_value_defer_0 = true; Array_string found_entries = __new_array_with_default(0, 0, sizeof(string), 0); to_delete = __new_array_with_default(0, 0, sizeof(int), 0); @@ -24689,7 +24730,7 @@ Array_int to_delete; should_skip_one = true; continue; } - if (arg.len > full.len + 1 && string__eq(string_substr(arg, 0, full.len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = full}}, {_SLIT("="), 0, { .d_c = 0 }}})))) { + if (arg.len > full.len + 1 && string__eq(string_substr(arg, 0, full.len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = full}}, {_SLIT("="), 0, { .d_c = 0 }}})))) { array_push((array*)&found_entries, _MOV((string[]){ string_clone(string_substr(arg, full.len + 1, (arg).len)) })); array_push((array*)&to_delete, _MOV((int[]){ i })); continue; @@ -24715,7 +24756,7 @@ Array_int to_delete; VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser* fs, string longhand, u8 shorthand) { { - string full = str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), 0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); + string full = str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), /*115 &string*/0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); for (int i = 0; i < fs->args.len; ++i) { string arg = ((string*)fs->args.data)[i]; if (arg.len == 0) { @@ -24739,7 +24780,7 @@ VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser return _t2; } } - if (arg.len > full.len + 1 && string__eq(string_substr(arg, 0, full.len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = full}}, {_SLIT("="), 0, { .d_c = 0 }}})))) { + if (arg.len > full.len + 1 && string__eq(string_substr(arg, 0, full.len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = full}}, {_SLIT("="), 0, { .d_c = 0 }}})))) { string val = string_substr(arg, full.len + 1, (arg).len); array_delete(&fs->args, i); Option_string _t3; @@ -24753,7 +24794,7 @@ VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser } } } - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = longhand}}, {_SLIT("' not found"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = longhand}}, {_SLIT("' not found"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { @@ -24763,7 +24804,7 @@ Option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr Option_string _t1 = flag__FlagParser_parse_bool_value(fs, name, abbr); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string parsed = (*(string*)_t1.data); @@ -24805,7 +24846,7 @@ Option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, flag__FlagParser_add_flag(fs, name, abbr, usage, _SLIT("")); Array_string parsed = flag__FlagParser_parse_value(fs, name, abbr); if (parsed.len == 0) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string parsed0 = (*(string*)/*ee elem_sym */array_get(parsed, 0)); res = string_int(parsed0); @@ -24846,7 +24887,7 @@ Option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr flag__FlagParser_add_flag(fs, name, abbr, usage, _SLIT("")); Array_string parsed = flag__FlagParser_parse_value(fs, name, abbr); if (parsed.len == 0) { - return (Option_f64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_f64){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } res = string_f64((*(string*)/*ee elem_sym */array_get(parsed, 0))); } @@ -24880,7 +24921,7 @@ Option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 flag__FlagParser_add_flag(fs, name, abbr, usage, _SLIT("")); Array_string parsed = flag__FlagParser_parse_value(fs, name, abbr); if (parsed.len == 0) { - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), 0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter '"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("' not provided"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } res = (*(string*)/*ee elem_sym */array_get(parsed, 0)); } @@ -24904,7 +24945,7 @@ string flag__FlagParser_string(flag__FlagParser* fs, string name, u8 abbr, strin Option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, int n) { if (n > _const_flag__max_args_number) { - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args_to_at_least expect n to be smaller than "), 0xfe07, {.d_i32 = _const_flag__max_args_number}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args_to_at_least expect n to be smaller than "), /*100 &int literal*/0xfe07, {.d_i32 = _const_flag__max_args_number}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (n <= 0) { return (Option_void){ .state=2, .err=_v_error(_SLIT("flag.limit_free_args_to_at_least expect n to be a positive number")), .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -24915,7 +24956,7 @@ Option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, i Option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, int n) { if (n > _const_flag__max_args_number) { - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args_to_exactly expect n to be smaller than "), 0xfe07, {.d_i32 = _const_flag__max_args_number}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args_to_exactly expect n to be smaller than "), /*100 &int literal*/0xfe07, {.d_i32 = _const_flag__max_args_number}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (n < 0) { return (Option_void){ .state=2, .err=_v_error(_SLIT("flag.limit_free_args_to_exactly expect n to be a non negative number")), .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -24927,7 +24968,7 @@ Option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, in Option_void flag__FlagParser_limit_free_args(flag__FlagParser* fs, int min, int max) { if (min > max) { - return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args expect min < max, got "), 0xfe07, {.d_i32 = min}}, {_SLIT(" >= "), 0xfe07, {.d_i32 = max}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("flag.limit_free_args expect min < max, got "), /*100 &int*/0xfe07, {.d_i32 = min}}, {_SLIT(" >= "), /*100 &int*/0xfe07, {.d_i32 = max}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } fs->min_free_args = min; fs->max_free_args = max; @@ -24948,24 +24989,24 @@ string flag__FlagParser_usage(flag__FlagParser* fs) { } Array_string use = __new_array_with_default(0, 0, sizeof(string), 0); if ((fs->application_version).len != 0) { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), 0xfe10, {.d_s = fs->application_version}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_flag__underline}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fs->application_version}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_flag__underline}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (fs->usage_examples.len == 0) { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Usage: "), 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" [options] "), 0xfe10, {.d_s = adesc}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Usage: "), /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" [options] "), /*115 &string*/0xfe10, {.d_s = adesc}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else { for (int i = 0; i < fs->usage_examples.len; ++i) { string example = ((string*)fs->usage_examples.data)[i]; if (i == 0) { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Usage: "), 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), 0xfe10, {.d_s = example}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Usage: "), /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = example}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" or: "), 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), 0xfe10, {.d_s = example}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" or: "), /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = example}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } } array_push((array*)&use, _MOV((string[]){ string_clone(_SLIT("")) })); if ((fs->application_description).len != 0) { - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Description: "), 0xfe10, {.d_s = fs->application_description}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Description: "), /*115 &string*/0xfe10, {.d_s = fs->application_description}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); array_push((array*)&use, _MOV((string[]){ string_clone(_SLIT("")) })); } if (positive_min_arg || positive_max_arg || no_arguments) { @@ -24975,16 +25016,16 @@ string flag__FlagParser_usage(flag__FlagParser* fs) { } else { Array_string s = __new_array_with_default(0, 0, sizeof(string), 0); if (positive_min_arg) { - array_push((array*)&s, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("at least "), 0xfe07, {.d_i32 = fs->min_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&s, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("at least "), /*100 &int*/0xfe07, {.d_i32 = fs->min_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (positive_max_arg) { - array_push((array*)&s, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("at most "), 0xfe07, {.d_i32 = fs->max_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&s, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("at most "), /*100 &int*/0xfe07, {.d_i32 = fs->max_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (positive_min_arg && positive_max_arg && fs->min_free_args == fs->max_free_args) { - s = new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("exactly "), 0xfe07, {.d_i32 = fs->min_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))})); + s = new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("exactly "), /*100 &int*/0xfe07, {.d_i32 = fs->min_free_args}}, {_SLIT0, 0, { .d_c = 0 }}}))})); } string sargs = Array_string_join(s, _SLIT(" and ")); - array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("The arguments should be "), 0xfe10, {.d_s = sargs}}, {_SLIT(" in number."), 0, { .d_c = 0 }}}))) })); + array_push((array*)&use, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("The arguments should be "), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(" in number."), 0, { .d_c = 0 }}}))) })); array_push((array*)&use, _MOV((string[]){ string_clone(_SLIT("")) })); } } @@ -24994,23 +25035,23 @@ string flag__FlagParser_usage(flag__FlagParser* fs) { flag__Flag f = ((flag__Flag*)fs->flags.data)[_t16]; Array_string onames = __new_array_with_default(0, 0, sizeof(string), 0); if (f.abbr != 0) { - array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0xfe10, {.d_s = u8_ascii_str(f.abbr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*115 &string*/0xfe10, {.d_s = u8_ascii_str(f.abbr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((f.name).len != 0) { if (!string_contains(f.val_desc, _SLIT(""))) { - array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("--"), 0xfe10, {.d_s = f.name}}, {_SLIT(" "), 0xfe10, {.d_s = f.val_desc}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("--"), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = f.val_desc}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else { - array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), 0xfe10, {.d_s = f.name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&onames, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("--"), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } string option_names = string__plus(_SLIT(" "), Array_string_join(onames, _SLIT(", "))); string xspace = _SLIT(""); if (option_names.len > _const_flag__space.len - 2) { - xspace = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = _const_flag__space}}, {_SLIT0, 0, { .d_c = 0 }}})); + xspace = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = _const_flag__space}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { xspace = string_substr(_const_flag__space, option_names.len, (_const_flag__space).len); } - string fdesc = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = option_names}}, {_SLIT0, 0xfe10, {.d_s = xspace}}, {_SLIT0, 0xfe10, {.d_s = f.usage}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fdesc = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = option_names}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = xspace}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = f.usage}}, {_SLIT0, 0, { .d_c = 0 }}})); array_push((array*)&use, _MOV((string[]){ string_clone(fdesc) })); } } @@ -25057,7 +25098,7 @@ VV_LOCAL_SYMBOL void flag__FlagParser_handle_builtin_options(flag__FlagParser* f VUNREACHABLE(); } if (show_version) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), 0xfe10, {.d_s = fs->application_version}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fs->application_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fs->application_version}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(0); VUNREACHABLE(); } @@ -25231,7 +25272,7 @@ VV_LOCAL_SYMBOL bool semver__RawVersion_is_missing(semver__RawVersion ver, int t VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_coerce(semver__RawVersion raw_ver) { semver__RawVersion ver = semver__RawVersion_complete(raw_ver); if (!semver__is_valid_number((*(string*)/*ee elem_sym */array_get(ver.raw_ints, _const_semver__ver_major)))) { - return (Option_semver__Version){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid major version: "), 0xfe10, {.d_s = Array_string_str(ver.raw_ints)}}, {_SLIT("[ver_major]"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_semver__Version){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid major version: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(ver.raw_ints)}}, {_SLIT("[ver_major]"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_semver__Version _t2; opt_ok(&(semver__Version[]) { semver__RawVersion_to_version(ver) }, (Option*)(&_t2), sizeof(semver__Version)); @@ -25342,7 +25383,7 @@ VV_LOCAL_SYMBOL Option_semver__Range semver__parse_range(string input) { VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__parse_comparator_set(string input) { Array_string raw_comparators = string_split(input, _const_semver__comparator_sep); if (raw_comparators.len > 2) { - return (Option_semver__ComparatorSet){ .state=2, .err=/*&IError*/I_semver__InvalidComparatorFormatError_to_Interface_IError(((semver__InvalidComparatorFormatError*)memdup(&(semver__InvalidComparatorFormatError){.MessageError = ((MessageError){.msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid format of comparator set for input \""), 0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}})),.code = 0,}),}, sizeof(semver__InvalidComparatorFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_semver__ComparatorSet){ .state=2, .err=/*&IError*/I_semver__InvalidComparatorFormatError_to_Interface_IError(((semver__InvalidComparatorFormatError*)memdup(&(semver__InvalidComparatorFormatError){.MessageError = ((MessageError){.msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid format of comparator set for input \""), /*115 &string*/0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}})),.code = 0,}),}, sizeof(semver__InvalidComparatorFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Array_semver__Comparator comparators = __new_array_with_default(0, 0, sizeof(semver__Comparator), 0); for (int _t2 = 0; _t2 < raw_comparators.len; ++_t2) { @@ -25350,7 +25391,7 @@ VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__parse_comparator_set(string Option_semver__Comparator _t3 = semver__parse_comparator(raw_comp); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_semver__ComparatorSet){ .state=2, .err=/*&IError*/I_semver__InvalidComparatorFormatError_to_Interface_IError(((semver__InvalidComparatorFormatError*)memdup(&(semver__InvalidComparatorFormatError){.MessageError = ((MessageError){.msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Invalid comparator \""), 0xfe10, {.d_s = raw_comp}}, {_SLIT("\" in input \""), 0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}})),.code = 0,}),}, sizeof(semver__InvalidComparatorFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_semver__ComparatorSet){ .state=2, .err=/*&IError*/I_semver__InvalidComparatorFormatError_to_Interface_IError(((semver__InvalidComparatorFormatError*)memdup(&(semver__InvalidComparatorFormatError){.MessageError = ((MessageError){.msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Invalid comparator \""), /*115 &string*/0xfe10, {.d_s = raw_comp}}, {_SLIT("\" in input \""), /*115 &string*/0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}})),.code = 0,}),}, sizeof(semver__InvalidComparatorFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Comparator c = (*(semver__Comparator*)_t3.data); @@ -25565,7 +25606,7 @@ string semver__EmptyInputError_msg(semver__EmptyInputError err) { } string semver__InvalidVersionFormatError_msg(semver__InvalidVersionFormatError err) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid version format for input \""), 0xfe10, {.d_s = err.input}}, {_SLIT("\""), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid version format for input \""), /*115 &string*/0xfe10, {.d_s = err.input}}, {_SLIT("\""), 0, { .d_c = 0 }}})); return _t1; } @@ -25627,10 +25668,10 @@ bool semver__Version_le(semver__Version v1, semver__Version v2) { } string semver__Version_str(semver__Version ver) { - string common_string = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ver.major}}, {_SLIT("."), 0xfe07, {.d_i32 = ver.minor}}, {_SLIT("."), 0xfe07, {.d_i32 = ver.patch}}, {_SLIT0, 0, { .d_c = 0 }}})); - string prerelease_string = (ver.prerelease.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0xfe10, {.d_s = ver.prerelease}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); - string metadata_string = (ver.metadata.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), 0xfe10, {.d_s = ver.metadata}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = common_string}}, {_SLIT0, 0xfe10, {.d_s = prerelease_string}}, {_SLIT0, 0xfe10, {.d_s = metadata_string}}, {_SLIT0, 0, { .d_c = 0 }}})); + string common_string = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ver.major}}, {_SLIT("."), /*100 &int*/0xfe07, {.d_i32 = ver.minor}}, {_SLIT("."), /*100 &int*/0xfe07, {.d_i32 = ver.patch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string prerelease_string = (ver.prerelease.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*115 &string*/0xfe10, {.d_s = ver.prerelease}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); + string metadata_string = (ver.metadata.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), /*115 &string*/0xfe10, {.d_s = ver.metadata}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = common_string}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = prerelease_string}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = metadata_string}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -25657,7 +25698,7 @@ inline VV_LOCAL_SYMBOL Option_semver__Version semver__coerce_version(string inpu Option_semver__Version _t1 = semver__RawVersion_coerce(raw_ver); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__Version){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid version for input \""), 0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_semver__Version){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid version for input \""), /*115 &string*/0xfe10, {.d_s = input}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version ver = (*(semver__Version*)_t1.data); @@ -25866,7 +25907,7 @@ u16* kw; int os__setenv(string name, string value, bool overwrite) { #if defined(_WIN32) { - string format = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("="), 0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}})); + string format = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("="), /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}})); if (overwrite) { { // Unsafe block int _t1 = _putenv(((char*)(format.str))); @@ -25893,7 +25934,7 @@ int os__setenv(string name, string value, bool overwrite) { int os__unsetenv(string name) { #if defined(_WIN32) { - string format = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("="), 0, { .d_c = 0 }}})); + string format = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("="), 0, { .d_c = 0 }}})); int _t1 = _putenv(((char*)(format.str))); return _t1; } @@ -26055,7 +26096,7 @@ Option_os__File os__open_file(string path, string mode, Array_int options) { } FILE* cfile = fdopen(fd, ((char*)(mode.str))); if (isnil(cfile)) { - return (Option_os__File){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to open or create file \""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_os__File){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to open or create file \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_os__File _t4; opt_ok(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (Option*)(&_t4), sizeof(os__File)); @@ -26557,9 +26598,9 @@ os__FileMode os__inode(string path) { Option_void os__open_uri(string uri) { string vopen_uri_cmd = os__getenv(_SLIT("VOPEN_URI_CMD")); if ((vopen_uri_cmd).len != 0) { - os__Result result = os__execute( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = vopen_uri_cmd}}, {_SLIT(" \""), 0xfe10, {.d_s = uri}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + os__Result result = os__execute( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = vopen_uri_cmd}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = uri}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); if (result.exit_code != 0) { - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to open url: "), 0xfe10, {.d_s = result.output}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to open url: "), /*115 &string*/0xfe10, {.d_s = result.output}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; } @@ -26619,7 +26660,7 @@ FILE* fp; } int len = ((int)(fsize)); if (((i64)(len)) < fsize) { - Option_Array_u8 _t5 = (Option_Array_u8){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = fsize}}, {_SLIT(" cast to int results in "), 0xfe07, {.d_i32 = ((int)(fsize))}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + Option_Array_u8 _t5 = (Option_Array_u8){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = fsize}}, {_SLIT(" cast to int results in "), /*100 &int*/0xfe07, {.d_i32 = ((int)(fsize))}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -26686,7 +26727,7 @@ FILE* fp; rewind(fp); int allocate = ((int)(fsize)); if (((i64)(allocate)) < fsize) { - Option_string _t5 = (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = fsize}}, {_SLIT(" cast to int results in "), 0xfe07, {.d_i32 = ((int)(fsize))}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + Option_string _t5 = (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = fsize}}, {_SLIT(" cast to int results in "), /*100 &int*/0xfe07, {.d_i32 = ((int)(fsize))}}, {_SLIT(")"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -26830,7 +26871,7 @@ Option_void os__mv(string src, string dst) { string w_dst = string_replace(rdst, _SLIT("/"), _SLIT("\\")); int ret = _wrename(string_to_wide(w_src), string_to_wide(w_dst)); if (ret != 0) { - return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to rename "), 0xfe10, {.d_s = src}}, {_SLIT(" to "), 0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(ret))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to rename "), /*115 &string*/0xfe10, {.d_s = src}}, {_SLIT(" to "), /*115 &string*/0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(ret))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } #else @@ -26847,7 +26888,7 @@ Option_void os__cp(string src, string dst) { string w_dst = string_replace(dst, _SLIT("/"), _SLIT("\\")); if (CopyFile(string_to_wide(w_src), string_to_wide(w_dst), false) == 0) { u32 result = GetLastError(); - return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to copy "), 0xfe10, {.d_s = src}}, {_SLIT(" to "), 0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(result))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=error_with_code( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed to copy "), /*115 &string*/0xfe10, {.d_s = src}}, {_SLIT(" to "), /*115 &string*/0xfe10, {.d_s = dst}}, {_SLIT0, 0, { .d_c = 0 }}})), ((int)(result))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } #else @@ -26871,7 +26912,7 @@ Option_FILE_ptr os__vfopen(string path, string mode) { } #endif if (isnil(fp)) { - return (Option_FILE_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to open file \""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_FILE_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to open file \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else { Option_FILE_ptr _t3; opt_ok(&(FILE*[]) { fp }, (Option*)(&_t3), sizeof(FILE*)); @@ -26947,7 +26988,7 @@ int os__system(string cmd) { int ret = 0; #if defined(_WIN32) { - string wcmd = (cmd.len > 1 && string_at(cmd, 0) == '"' && string_at(cmd, 1) != '"' ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = cmd}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) : (cmd)); + string wcmd = (cmd.len > 1 && string_at(cmd, 0) == '"' && string_at(cmd, 1) != '"' ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) : (cmd)); { // Unsafe block ret = _wsystem(string_to_wide(wcmd)); } @@ -27034,7 +27075,7 @@ Option_void os__rm(string path) { } #endif if (rc == -1) { - return (Option_void){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to remove \""), 0xfe10, {.d_s = path}}, {_SLIT("\": "), 0, { .d_c = 0 }}})), os__posix_get_error_msg(errno))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to remove \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\": "), 0, { .d_c = 0 }}})), os__posix_get_error_msg(errno))), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; } @@ -27044,7 +27085,7 @@ Option_void os__rmdir(string path) { { int rc = RemoveDirectory(string_to_wide(path)); if (rc == 0) { - return (Option_void){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to remove \""), 0xfe10, {.d_s = path}}, {_SLIT("\": "), 0, { .d_c = 0 }}})), os__posix_get_error_msg(errno))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to remove \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\": "), 0, { .d_c = 0 }}})), os__posix_get_error_msg(errno))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } #else @@ -27057,7 +27098,7 @@ Option_void os__rmdir(string path) { VV_LOCAL_SYMBOL void os__print_c_errno(void) { int e = errno; string se = tos_clone(((u8*)(strerror(e)))); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("errno="), 0xfe07, {.d_i32 = e}}, {_SLIT(" err="), 0xfe10, {.d_s = se}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("errno="), /*100 &int*/0xfe07, {.d_i32 = e}}, {_SLIT(" err="), /*115 &string*/0xfe10, {.d_s = se}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string os__get_raw_line(void) { @@ -27518,7 +27559,7 @@ Option_os__File os__open_append(string path) { } #endif if (isnil(file.cfile)) { - return (Option_os__File){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to create(append) file \""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_os__File){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to create(append) file \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } file.is_opened = true; Option_os__File _t2; @@ -28364,7 +28405,7 @@ Option_void os__mkdir_all(string opath) { Option_bool _t2 = os__mkdir(p); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("folder: "), 0xfe10, {.d_s = p}}, {_SLIT(", error: "), 0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("folder: "), /*115 &string*/0xfe10, {.d_s = p}}, {_SLIT(", error: "), /*115 &IError*/0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } (*(bool*)_t2.data); @@ -28483,8 +28524,8 @@ string os__resource_abs_path(string path) { os__Result os__execute_or_panic(string cmd) { os__Result res = os__execute(cmd); if (res.exit_code != 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed code: "), 0xfe07, {.d_i32 = res.exit_code}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed code: "), /*100 &int*/0xfe07, {.d_i32 = res.exit_code}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_panic(res.output); VUNREACHABLE(); } @@ -28495,8 +28536,8 @@ os__Result os__execute_or_panic(string cmd) { os__Result os__execute_or_exit(string cmd) { os__Result res = os__execute(cmd); if (res.exit_code != 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed code: "), 0xfe07, {.d_i32 = res.exit_code}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed code: "), /*100 &int*/0xfe07, {.d_i32 = res.exit_code}}, {_SLIT0, 0, { .d_c = 0 }}}))); eprintln(res.output); _v_exit(1); VUNREACHABLE(); @@ -28508,7 +28549,7 @@ os__Result os__execute_or_exit(string cmd) { string os__quoted_path(string path) { #if defined(_WIN32) { - string _t1 = (string_ends_with(path, _const_os__path_separator) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = string__plus(path, _const_os__path_separator)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}})))); + string _t1 = (string_ends_with(path, _const_os__path_separator) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = string__plus(path, _const_os__path_separator)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}})))); return _t1; } #else @@ -28607,9 +28648,9 @@ Option_Array_string os__ls(string path) { os__Win32finddata find_file_data = ((os__Win32finddata){.dw_file_attributes = 0,.ft_creation_time = (os__Filetime){.dw_low_date_time = 0,.dw_high_date_time = 0,},.ft_last_access_time = (os__Filetime){.dw_low_date_time = 0,.dw_high_date_time = 0,},.ft_last_write_time = (os__Filetime){.dw_low_date_time = 0,.dw_high_date_time = 0,},.n_file_size_high = 0,.n_file_size_low = 0,.dw_reserved0 = 0,.dw_reserved1 = 0,.c_file_name = {0},.c_alternate_file_name = {0},.dw_file_type = 0,.dw_creator_type = 0,.w_finder_flags = 0,}); Array_string dir_files = __new_array_with_default(0, 0, sizeof(string), 0); if (!os__is_dir(path)) { - return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ls() couldnt open dir \""), 0xfe10, {.d_s = path}}, {_SLIT("\": directory does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ls() couldnt open dir \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\": directory does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - string path_files = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path}}, {_SLIT("\\*"), 0, { .d_c = 0 }}})); + string path_files = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\\*"), 0, { .d_c = 0 }}})); voidptr h_find_files = FindFirstFile(string_to_wide(path_files), ((voidptr)(&find_file_data))); string first_filename = string_from_wide(&find_file_data.c_file_name[0]); if (!string__eq(first_filename, _SLIT(".")) && !string__eq(first_filename, _SLIT(".."))) { @@ -28636,7 +28677,7 @@ Option_bool os__mkdir(string path) { } string apath = os__real_path(path); if (!CreateDirectory(string_to_wide(apath), 0)) { - return (Option_bool){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("mkdir failed for \""), 0xfe10, {.d_s = apath}}, {_SLIT("\", because CreateDirectory returned: "), 0, { .d_c = 0 }}})), os__get_error_msg(((int)(GetLastError()))))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("mkdir failed for \""), /*115 &string*/0xfe10, {.d_s = apath}}, {_SLIT("\", because CreateDirectory returned: "), 0, { .d_c = 0 }}})), os__get_error_msg(((int)(GetLastError()))))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_bool _t3; opt_ok(&(bool[]) { true }, (Option*)(&_t3), sizeof(bool)); @@ -28719,14 +28760,14 @@ os__Result os__execute(string cmd) { if (!create_pipe_ok) { int error_num = ((int)(GetLastError())); string error_msg = os__get_error_msg(error_num); - os__Result _t2 = ((os__Result){.exit_code = error_num,.output = str_intp(2, _MOV((StrIntpData[]){{_SLIT("exec failed (CreatePipe): "), 0xfe10, {.d_s = error_msg}}, {_SLIT0, 0, { .d_c = 0 }}})),}); + os__Result _t2 = ((os__Result){.exit_code = error_num,.output = str_intp(2, _MOV((StrIntpData[]){{_SLIT("exec failed (CreatePipe): "), /*115 &string*/0xfe10, {.d_s = error_msg}}, {_SLIT0, 0, { .d_c = 0 }}})),}); return _t2; } bool set_handle_info_ok = SetHandleInformation(child_stdout_read, HANDLE_FLAG_INHERIT, 0U); if (!set_handle_info_ok) { int error_num = ((int)(GetLastError())); string error_msg = os__get_error_msg(error_num); - os__Result _t3 = ((os__Result){.exit_code = error_num,.output = str_intp(2, _MOV((StrIntpData[]){{_SLIT("exec failed (SetHandleInformation): "), 0xfe10, {.d_s = error_msg}}, {_SLIT0, 0, { .d_c = 0 }}})),}); + os__Result _t3 = ((os__Result){.exit_code = error_num,.output = str_intp(2, _MOV((StrIntpData[]){{_SLIT("exec failed (SetHandleInformation): "), /*115 &string*/0xfe10, {.d_s = error_msg}}, {_SLIT0, 0, { .d_c = 0 }}})),}); return _t3; } os__ProcessInformation proc_info = ((os__ProcessInformation){.h_process = 0,.h_thread = 0,.dw_process_id = 0,.dw_thread_id = 0,}); @@ -28756,7 +28797,7 @@ os__Result os__execute(string cmd) { if (!create_process_ok) { int error_num = ((int)(GetLastError())); string error_msg = os__get_error_msg(error_num); - os__Result _t4 = ((os__Result){.exit_code = error_num,.output = str_intp(4, _MOV((StrIntpData[]){{_SLIT("exec failed (CreateProcess) with code "), 0xfe07, {.d_i32 = error_num}}, {_SLIT(": "), 0xfe10, {.d_s = error_msg}}, {_SLIT(" cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}})),}); + os__Result _t4 = ((os__Result){.exit_code = error_num,.output = str_intp(4, _MOV((StrIntpData[]){{_SLIT("exec failed (CreateProcess) with code "), /*100 &int*/0xfe07, {.d_i32 = error_num}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = error_msg}}, {_SLIT(" cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}})),}); return _t4; } CloseHandle(child_stdin); @@ -28876,7 +28917,7 @@ string os__loginname(void) { Option_bool os__is_writable_folder(string folder) { if (!os__exists(folder)) { - return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = folder}}, {_SLIT("` does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = folder}}, {_SLIT("` does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__is_dir(folder)) { return (Option_bool){ .state=2, .err=_v_error(_SLIT("`folder` is not a folder")), .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -28886,7 +28927,7 @@ Option_bool os__is_writable_folder(string folder) { Option_void _t3 = os__write_file(tmp_perm_check, _SLIT("test")); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; - return (Option_bool){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot write to folder \""), 0xfe10, {.d_s = folder}}, {_SLIT("\": "), 0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot write to folder \""), /*115 &string*/0xfe10, {.d_s = folder}}, {_SLIT("\": "), /*115 &IError*/0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } ; @@ -29040,7 +29081,7 @@ VV_LOCAL_SYMBOL int os__Process__spawn(os__Process* p) { string k = /*key*/ *(string*)DenseArray_key(¤t_environment.key_values, _t1); k = string_clone(k); string v = (*(string*)DenseArray_value(¤t_environment.key_values, _t1)); - array_push((array*)&p->env, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = k}}, {_SLIT("="), 0xfe10, {.d_s = v}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&p->env, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = k}}, {_SLIT("="), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } int pid = 0; @@ -29146,11 +29187,11 @@ string os__Process_stderr_read(os__Process* p) { VV_LOCAL_SYMBOL void os__Process__check_redirection_call(os__Process* p, string fn_name) { if (!p->use_stdio_ctl) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Call p.set_redirect_stdio() before calling p."), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Call p.set_redirect_stdio() before calling p."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } if (p->status == os__ProcessState__not_started) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Call p."), 0xfe10, {.d_s = fn_name}}, {_SLIT("() after you have called p.run()"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Call p."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("() after you have called p.run()"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } @@ -29262,7 +29303,7 @@ void os__Process_set_environment(os__Process* p, Map_string_string envs) { string k = /*key*/ *(string*)DenseArray_key(&envs.key_values, _t1); k = string_clone(k); string v = (*(string*)DenseArray_value(&envs.key_values, _t1)); - array_push((array*)&p->env, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = k}}, {_SLIT("="), 0xfe10, {.d_s = v}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&p->env, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = k}}, {_SLIT("="), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } return; } @@ -29285,7 +29326,7 @@ VV_LOCAL_SYMBOL void os__failed_cfn_report_error(bool ok, string label) { } int error_num = ((int)(GetLastError())); string error_msg = os__get_error_msg(error_num); - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed "), 0xfe10, {.d_s = label}}, {_SLIT(": "), 0xfe10, {.d_s = error_msg}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("failed "), /*115 &string*/0xfe10, {.d_s = label}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = error_msg}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -29322,7 +29363,7 @@ VV_LOCAL_SYMBOL int os__Process_win_spawn_process(os__Process* p) { start_info.h_std_error = wdata->child_stderr_write; start_info.dw_flags = ((u32)(STARTF_USESTDHANDLES)); } - string cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = p->filename}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(p->args, _SLIT(" "))); + string cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = p->filename}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(p->args, _SLIT(" "))); ExpandEnvironmentStringsW(string_to_wide(cmd), ((voidptr)(&wdata->command_line[0])), 32768U); int creation_flags = ((int)(NORMAL_PRIORITY_CLASS)); if (p->use_pgroup) { @@ -29398,7 +29439,7 @@ VV_LOCAL_SYMBOL bool os__Process_win_is_alive(os__Process* p) { } VV_LOCAL_SYMBOL void os__Process_win_write_string(os__Process* p, int idx, string s) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Process.write_string "), 0xfe07, {.d_i32 = idx}}, {_SLIT(" is not implemented yet"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Process.write_string "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT(" is not implemented yet"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } @@ -29557,7 +29598,7 @@ Array_string v__depgraph__OrderedDepMap_get(v__depgraph__OrderedDepMap* o, strin void v__depgraph__OrderedDepMap_delete(v__depgraph__OrderedDepMap* o, string name) { if (!_IN_MAP(ADDR(string, name), ADDR(map, o->data))) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("delete: no such key: "), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("delete: no such key: "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } for (int i = 0; i < o->keys.len; ++i) { @@ -29653,7 +29694,7 @@ string v__depgraph__DepGraph_display(v__depgraph__DepGraph* graph) { v__depgraph__DepGraphNode node = ((v__depgraph__DepGraphNode*)graph->nodes.data)[_t1]; for (int _t2 = 0; _t2 < node.deps.len; ++_t2) { string dep = ((string*)node.deps.data)[_t2]; - array_push((array*)&out, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" * "), 0xfe10, {.d_s = node.name}}, {_SLIT(" -> "), 0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&out, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" * "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT(" -> "), /*115 &string*/0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } string _t4 = Array_string_join(out, _SLIT("\n")); @@ -29730,7 +29771,7 @@ VV_LOCAL_SYMBOL multi_return_bool_Array_string v__depgraph__NodeNames_is_part_of } void v__depgraph__show(v__depgraph__DepGraph* graph, string path) { - v__dotgraph__DotGraph* dg = v__dotgraph__new(_SLIT("ModGraph"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("ModGraph for "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("blue")); + v__dotgraph__DotGraph* dg = v__dotgraph__new(_SLIT("ModGraph"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("ModGraph for "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("blue")); string mbuiltin = _SLIT("builtin"); for (int _t1 = 0; _t1 < graph->nodes.len; ++_t1) { v__depgraph__DepGraphNode node = ((v__depgraph__DepGraphNode*)graph->nodes.data)[_t1]; @@ -30936,7 +30977,7 @@ inline f64 math__degrees(f64 radians) { Array_int math__digits(i64 num, math__DigitParams params) { int b = params.base; if (b < 2) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("digits: Cannot find digits of n with base "), 0xfe07, {.d_i32 = b}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("digits: Cannot find digits of n with base "), /*100 &int*/0xfe07, {.d_i32 = b}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } i64 n = num; @@ -31764,12 +31805,12 @@ u32 math__get_high_word(f64 f) { } string term__format(string msg, string open, string close) { - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = open}}, {_SLIT("m"), 0xfe10, {.d_s = msg}}, {_SLIT("["), 0xfe10, {.d_s = close}}, {_SLIT("m"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = open}}, {_SLIT("m"), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = close}}, {_SLIT("m"), 0, { .d_c = 0 }}})); return _t1; } string term__format_rgb(int r, int g, int b, string msg, string open, string close) { - string _t1 = str_intp(7, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = open}}, {_SLIT(";2;"), 0xfe07, {.d_i32 = r}}, {_SLIT(";"), 0xfe07, {.d_i32 = g}}, {_SLIT(";"), 0xfe07, {.d_i32 = b}}, {_SLIT("m"), 0xfe10, {.d_s = msg}}, {_SLIT("["), 0xfe10, {.d_s = close}}, {_SLIT("m"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(7, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = open}}, {_SLIT(";2;"), /*100 &int*/0xfe07, {.d_i32 = r}}, {_SLIT(";"), /*100 &int*/0xfe07, {.d_i32 = g}}, {_SLIT(";"), /*100 &int*/0xfe07, {.d_i32 = b}}, {_SLIT("m"), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = close}}, {_SLIT("m"), 0, { .d_c = 0 }}})); return _t1; } @@ -31999,16 +32040,16 @@ string term__bright_bg_white(string msg) { } string term__highlight_command(string command) { - string _t1 = term__bright_white(term__bg_cyan( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = command}}, {_SLIT(" "), 0, { .d_c = 0 }}})))); + string _t1 = term__bright_white(term__bg_cyan( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = command}}, {_SLIT(" "), 0, { .d_c = 0 }}})))); return _t1; } void term__set_cursor_position(term__Coord c) { - print(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), 0xfe07, {.d_i32 = c.y}}, {_SLIT(";"), 0xfe07, {.d_i32 = c.x}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("H"))); + print(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = c.y}}, {_SLIT(";"), /*100 &int*/0xfe07, {.d_i32 = c.x}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("H"))); } void term__move(int n, string direction) { - print( str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), 0xfe07, {.d_i32 = n}}, {_SLIT0, 0xfe10, {.d_s = direction}}, {_SLIT0, 0, { .d_c = 0 }}}))); + print( str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = direction}}, {_SLIT0, 0, { .d_c = 0 }}}))); } void term__cursor_up(int n) { @@ -32096,7 +32137,7 @@ string term__failed(string s) { string term__ok_message(string s) { if (term__can_show_color_on_stdout()) { - string _t1 = term__green( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + string _t1 = term__green( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); return _t1; } string _t2 = s; @@ -32104,13 +32145,13 @@ string term__ok_message(string s) { } string term__fail_message(string s) { - string _t1 = term__failed( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + string _t1 = term__failed( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); return _t1; } string term__warn_message(string s) { if (term__can_show_color_on_stdout()) { - string _t1 = term__bright_yellow( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + string _t1 = term__bright_yellow( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); return _t1; } string _t2 = s; @@ -32199,7 +32240,7 @@ string term__header_left(string text, string divider) { string hstart = string_substr(string_repeat(relement, 4), 0, 4); int remaining_cols = term__imax(0, (cols - (hstart.len + 1 + plain_text.len + 1))); string hend = string_substr(string_repeat(relement, (remaining_cols + 1) / relement.len), 0, remaining_cols); - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = hstart}}, {_SLIT(" "), 0xfe10, {.d_s = text}}, {_SLIT(" "), 0xfe10, {.d_s = hend}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = hstart}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = text}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = hend}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -32407,17 +32448,17 @@ string v__util__version__full_hash(void) { string _t1 = build_hash; return _t1; } - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = build_hash}}, {_SLIT("."), 0xfe10, {.d_s = current_hash}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = build_hash}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = current_hash}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } string v__util__version__full_v_version(bool is_verbose) { if (is_verbose) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("V "), 0xfe10, {.d_s = _const_v__util__version__v_version}}, {_SLIT(" "), 0xfe10, {.d_s = v__util__version__full_hash()}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("V "), /*115 &string*/0xfe10, {.d_s = _const_v__util__version__v_version}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__util__version__full_hash()}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string hash = v__util__version__githash(false); - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("V "), 0xfe10, {.d_s = _const_v__util__version__v_version}}, {_SLIT(" "), 0xfe10, {.d_s = hash}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("V "), /*115 &string*/0xfe10, {.d_s = _const_v__util__version__v_version}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = hash}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } @@ -32713,25 +32754,25 @@ string time__Time_md(time__Time t) { VV_LOCAL_SYMBOL string time__ordinal_suffix(int n) { if (n > 3 && n < 21) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("th"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("th"), 0, { .d_c = 0 }}})); return _t1; } int _t2 = n % 10; if (_t2 == (1)) { - string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("st"), 0, { .d_c = 0 }}})); + string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("st"), 0, { .d_c = 0 }}})); return _t3; } else if (_t2 == (2)) { - string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("nd"), 0, { .d_c = 0 }}})); + string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("nd"), 0, { .d_c = 0 }}})); return _t4; } else if (_t2 == (3)) { - string _t5 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("rd"), 0, { .d_c = 0 }}})); + string _t5 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("rd"), 0, { .d_c = 0 }}})); return _t5; } else { - string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = n}}, {_SLIT("th"), 0, { .d_c = 0 }}})); + string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = n}}, {_SLIT("th"), 0, { .d_c = 0 }}})); return _t6; }; return (string){.str=(byteptr)"", .is_lit=1}; @@ -32760,7 +32801,7 @@ string time__Time_custom_format(time__Time t, string s) { strings__Builder_write_string(&sb, int_str(t.month)); } else if (string__eq(token, _SLIT("MM"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.month}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("Mo"))) { strings__Builder_write_string(&sb, time__ordinal_suffix(t.month)); @@ -32775,7 +32816,7 @@ string time__Time_custom_format(time__Time t, string s) { strings__Builder_write_string(&sb, int_str(t.day)); } else if (string__eq(token, _SLIT("DD"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("Do"))) { strings__Builder_write_string(&sb, time__ordinal_suffix(t.day)); @@ -32784,7 +32825,7 @@ string time__Time_custom_format(time__Time t, string s) { strings__Builder_write_string(&sb, int_str((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]))); } else if (string__eq(token, _SLIT("DDDD"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8006fe27, {.d_i32 = t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8006fe27, {.d_i32 = t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("DDDo"))) { strings__Builder_write_string(&sb, time__ordinal_suffix(t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0])); @@ -32811,52 +32852,52 @@ string time__Time_custom_format(time__Time t, string s) { strings__Builder_write_string(&sb, int_str(t.hour)); } else if (string__eq(token, _SLIT("HH"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("h"))) { strings__Builder_write_string(&sb, int_str((t.hour % 12))); } else if (string__eq(token, _SLIT("hh"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = (t.hour % 12)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = (t.hour % 12)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("m"))) { strings__Builder_write_string(&sb, int_str(t.minute)); } else if (string__eq(token, _SLIT("mm"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("s"))) { strings__Builder_write_string(&sb, int_str(t.second)); } else if (string__eq(token, _SLIT("ss"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.second}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("k"))) { strings__Builder_write_string(&sb, int_str((t.hour + 1))); } else if (string__eq(token, _SLIT("kk"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = (t.hour + 1)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = (t.hour + 1)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("w"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x1000f, {.d_f64 = math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*103 &f64*/0x1000f, {.d_f64 = math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("ww"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8005002f, {.d_f64 = math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*103 &f64*/0x8005002f, {.d_f64 = math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("wo"))) { strings__Builder_write_string(&sb, time__ordinal_suffix(((int)(math__ceil((t.day + (*(int*)/*ee elem_sym */array_get(_const_time__days_before, t.month - 1)) + (int[]){(time__is_leap_year(t.year))?1:0}[0]) / 7))))); } else if (string__eq(token, _SLIT("Q"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = (t.month % 4) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = (t.month % 4) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("QQ"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = (t.month % 4) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = (t.month % 4) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("Qo"))) { strings__Builder_write_string(&sb, time__ordinal_suffix((t.month % 4) + 1)); } else if (string__eq(token, _SLIT("c"))) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = time__Time_day_of_week(&t) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = time__Time_day_of_week(&t) + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(token, _SLIT("N"))) { strings__Builder_write_string(&sb, _SLIT("AD")); @@ -32867,28 +32908,28 @@ string time__Time_custom_format(time__Time t, string s) { else if (string__eq(token, _SLIT("Z"))) { int hours = time__offset() / _const_time__seconds_per_hour; if (hours >= 0) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), 0xfe07, {.d_i32 = hours}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), /*100 &int*/0xfe07, {.d_i32 = hours}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { hours = -hours; - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0xfe07, {.d_i32 = hours}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*100 &int*/0xfe07, {.d_i32 = hours}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } else if (string__eq(token, _SLIT("ZZ"))) { int hours = time__offset() / _const_time__seconds_per_hour; if (hours >= 0) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), 0x8004fe27, {.d_i32 = hours}}, {_SLIT("00"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), /*100 &int*/0x8004fe27, {.d_i32 = hours}}, {_SLIT("00"), 0, { .d_c = 0 }}}))); } else { hours = -hours; - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0x8004fe27, {.d_i32 = hours}}, {_SLIT("00"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*100 &int*/0x8004fe27, {.d_i32 = hours}}, {_SLIT("00"), 0, { .d_c = 0 }}}))); } } else if (string__eq(token, _SLIT("ZZZ"))) { int hours = time__offset() / _const_time__seconds_per_hour; if (hours >= 0) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), 0x8004fe27, {.d_i32 = hours}}, {_SLIT(":00"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("+"), /*100 &int*/0x8004fe27, {.d_i32 = hours}}, {_SLIT(":00"), 0, { .d_c = 0 }}}))); } else { hours = -hours; - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), 0x8004fe27, {.d_i32 = hours}}, {_SLIT(":00"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("-"), /*100 &int*/0x8004fe27, {.d_i32 = hours}}, {_SLIT(":00"), 0, { .d_c = 0 }}}))); } } else if (string__eq(token, _SLIT("a"))) { @@ -32952,38 +32993,38 @@ string time__Time_get_fmt_time_str(time__Time t, time__FormatTime fmt_time) { switch (fmt_time) { case time__FormatTime__hhmm12: { - _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = hour_}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(" "), 0xfe10, {.d_s = tp}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = hour_}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tp}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmm24: { - _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmmss12: { - _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = hour_}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT(" "), 0xfe10, {.d_s = tp}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = hour_}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tp}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmmss24: { - _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmmss24_milli: { - _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT("."), 0x8006fe27, {.d_i32 = (t.microsecond / 1000)}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT("."), /*100 &int*/0x8006fe27, {.d_i32 = (t.microsecond / 1000)}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__hhmmss24_micro: { - _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT("."), 0x800cfe27, {.d_i32 = t.microsecond}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT("."), /*100 &int*/0x800cfe27, {.d_i32 = t.microsecond}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatTime__no_time: default: { - _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enumeration "), 0xfe10, {.d_s = time__FormatTime_str(fmt_time)}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enumeration "), /*115 &time.FormatTime*/0xfe10, {.d_s = time__FormatTime_str(fmt_time)}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } } @@ -32997,63 +33038,63 @@ string time__Time_get_fmt_date_str(time__Time t, time__FormatDelimiter fmt_dlmtr return _t1; } string month = time__Time_smonth(&t); - string year = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = (t.year % 100)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string year = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = (t.year % 100)}}, {_SLIT0, 0, { .d_c = 0 }}})); string _t2 = (string){.str=(byteptr)"", .is_lit=1}; switch (fmt_date) { case time__FormatDate__ddmmyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*115 &string*/0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__ddmmyyyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmddyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*115 &string*/0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmddyyyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*100 &int*/0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmmd: { - _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = month}}, {_SLIT("|"), 0xfe07, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = month}}, {_SLIT("|"), /*100 &int*/0xfe07, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmmdd: { - _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmmddyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*115 &string*/0xfe10, {.d_s = year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__mmmddyyyy: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), 0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT("|"), /*100 &int*/0x8008fe27, {.d_i32 = t.year}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__yyyymmdd: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0x8008fe27, {.d_i32 = t.year}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0x8008fe27, {.d_i32 = t.year}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__yymmdd: { - _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = year}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), 0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = year}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.month}}, {_SLIT("|"), /*100 &int*/0x8004fe27, {.d_i32 = t.day}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case time__FormatDate__no_date: default: { - _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enumeration "), 0xfe10, {.d_s = time__FormatDate_str(fmt_date)}}, {_SLIT0, 0, { .d_c = 0 }}})); + _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enumeration "), /*115 &time.FormatDate*/0xfe10, {.d_s = time__FormatDate_str(fmt_date)}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } } @@ -33077,7 +33118,7 @@ string time__Time_get_fmt_str(time__Time t, time__FormatDelimiter fmt_dlmtr, tim if (fmt_time != time__FormatTime__no_time) { string dstr = time__Time_get_fmt_date_str(t, fmt_dlmtr, fmt_date); string tstr = time__Time_get_fmt_time_str(t, fmt_time); - string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dstr}}, {_SLIT(" "), 0xfe10, {.d_s = tstr}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dstr}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tstr}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } else { string _t4 = time__Time_get_fmt_date_str(t, fmt_dlmtr, fmt_date); @@ -33090,7 +33131,7 @@ string time__Time_get_fmt_str(time__Time t, time__FormatDelimiter fmt_dlmtr, tim string time__Time_utc_string(time__Time t) { string day_str = time__Time_weekday_str(&t); string month_str = time__Time_smonth(&t); - string utc_string = str_intp(8, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = day_str}}, {_SLIT(", "), 0xfe07, {.d_i32 = t.day}}, {_SLIT(" "), 0xfe10, {.d_s = month_str}}, {_SLIT(" "), 0xfe07, {.d_i32 = t.year}}, {_SLIT(" "), 0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), 0x8004fe27, {.d_i32 = t.second}}, {_SLIT(" UTC"), 0, { .d_c = 0 }}})); + string utc_string = str_intp(8, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = day_str}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = t.day}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = month_str}}, {_SLIT(" "), /*100 &int*/0xfe07, {.d_i32 = t.year}}, {_SLIT(" "), /*100 &int*/0x8004fe27, {.d_i32 = t.hour}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.minute}}, {_SLIT(":"), /*100 &int*/0x8004fe27, {.d_i32 = t.second}}, {_SLIT(" UTC"), 0, { .d_c = 0 }}})); string _t1 = utc_string; return _t1; } @@ -33423,7 +33464,7 @@ VV_LOCAL_SYMBOL Option_multi_return_int_int_int_int_i64_bool time__parse_iso8601 } string time__TimeParseError_msg(time__TimeParseError err) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid time format code: "), 0xfe07, {.d_i32 = err.code}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid time format code: "), /*100 &int*/0xfe07, {.d_i32 = err.code}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -33629,7 +33670,7 @@ string time__Time_relative(time__Time* t) { string _t3 = _SLIT("1 minute ago"); return _t3; } - string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = m}}, {_SLIT(" minutes ago"), 0, { .d_c = 0 }}})); + string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = m}}, {_SLIT(" minutes ago"), 0, { .d_c = 0 }}})); return _t4; } if (secs < 86400) { @@ -33638,7 +33679,7 @@ string time__Time_relative(time__Time* t) { string _t5 = _SLIT("1 hour ago"); return _t5; } - string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = h}}, {_SLIT(" hours ago"), 0, { .d_c = 0 }}})); + string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = h}}, {_SLIT(" hours ago"), 0, { .d_c = 0 }}})); return _t6; } if (secs < 432000) { @@ -33647,7 +33688,7 @@ string time__Time_relative(time__Time* t) { string _t7 = _SLIT("1 day ago"); return _t7; } - string _t8 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = d}}, {_SLIT(" days ago"), 0, { .d_c = 0 }}})); + string _t8 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = d}}, {_SLIT(" days ago"), 0, { .d_c = 0 }}})); return _t8; } if (secs > 864000000) { @@ -33670,15 +33711,15 @@ string time__Time_relative_short(time__Time* t) { return _t2; } if (secs < 3600) { - string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = secs / 60}}, {_SLIT("m"), 0, { .d_c = 0 }}})); + string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = secs / 60}}, {_SLIT("m"), 0, { .d_c = 0 }}})); return _t3; } if (secs < 86400) { - string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = secs / 3600}}, {_SLIT("h"), 0, { .d_c = 0 }}})); + string _t4 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = secs / 3600}}, {_SLIT("h"), 0, { .d_c = 0 }}})); return _t4; } if (secs < 432000) { - string _t5 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = secs / 3600 / 24}}, {_SLIT("d"), 0, { .d_c = 0 }}})); + string _t5 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = secs / 3600 / 24}}, {_SLIT("d"), 0, { .d_c = 0 }}})); return _t5; } if (secs > 864000000) { @@ -33725,7 +33766,7 @@ bool time__is_leap_year(int year) { Option_int time__days_in_month(int month, int year) { if (month > 12 || month < 1) { - return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid month: "), 0xfe07, {.d_i32 = month}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_int){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Invalid month: "), /*100 &int*/0xfe07, {.d_i32 = month}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int extra = (month == 2 && time__is_leap_year(year) ? (1) : (0)); int res = (*(int*)/*ee elem_sym */array_get(_const_time__month_days, month - 1)) + extra; @@ -33735,7 +33776,7 @@ Option_int time__days_in_month(int month, int year) { } string time__Time_debug(time__Time* t) { - string _t1 = str_intp(9, _MOV((StrIntpData[]){{_SLIT("Time{ year: "), 0x8008fe27, {.d_i32 = t->year}}, {_SLIT(" month: "), 0x8004fe27, {.d_i32 = t->month}}, {_SLIT(" day: "), 0x8004fe27, {.d_i32 = t->day}}, {_SLIT(" hour: "), 0x8004fe27, {.d_i32 = t->hour}}, {_SLIT(" minute: "), 0x8004fe27, {.d_i32 = t->minute}}, {_SLIT(" second: "), 0x8004fe27, {.d_i32 = t->second}}, {_SLIT(" microsecond: "), 0x800cfe27, {.d_i32 = t->microsecond}}, {_SLIT(" unix: "), 0x800efe29, {.d_i64 = t->_v_unix}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(9, _MOV((StrIntpData[]){{_SLIT("Time{ year: "), /*100 &int*/0x8008fe27, {.d_i32 = t->year}}, {_SLIT(" month: "), /*100 &int*/0x8004fe27, {.d_i32 = t->month}}, {_SLIT(" day: "), /*100 &int*/0x8004fe27, {.d_i32 = t->day}}, {_SLIT(" hour: "), /*100 &int*/0x8004fe27, {.d_i32 = t->hour}}, {_SLIT(" minute: "), /*100 &int*/0x8004fe27, {.d_i32 = t->minute}}, {_SLIT(" second: "), /*100 &int*/0x8004fe27, {.d_i32 = t->second}}, {_SLIT(" microsecond: "), /*100 &int*/0x800cfe27, {.d_i32 = t->microsecond}}, {_SLIT(" unix: "), /*100 &i64*/0x800efe29, {.d_i64 = t->_v_unix}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); return _t1; } @@ -33794,26 +33835,26 @@ string time__Duration_str(time__Duration d) { t -= us * _const_time__microsecond; i64 ns = t; if (hr > 0) { - string _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = hr}}, {_SLIT(":"), 0x8004fe29, {.d_i64 = min}}, {_SLIT(":"), 0x8004fe29, {.d_i64 = sec}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = hr}}, {_SLIT(":"), /*100 &i64*/0x8004fe29, {.d_i64 = min}}, {_SLIT(":"), /*100 &i64*/0x8004fe29, {.d_i64 = sec}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } if (min > 0) { - string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = min}}, {_SLIT(":"), 0x8004fe29, {.d_i64 = sec}}, {_SLIT("."), 0x8006fe29, {.d_i64 = ms}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = min}}, {_SLIT(":"), /*100 &i64*/0x8004fe29, {.d_i64 = sec}}, {_SLIT("."), /*100 &i64*/0x8006fe29, {.d_i64 = ms}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } if (sec > 0) { - string _t4 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = sec}}, {_SLIT("."), 0x8006fe29, {.d_i64 = ms}}, {_SLIT("s"), 0, { .d_c = 0 }}})); + string _t4 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = sec}}, {_SLIT("."), /*100 &i64*/0x8006fe29, {.d_i64 = ms}}, {_SLIT("s"), 0, { .d_c = 0 }}})); return _t4; } if (ms > 0) { - string _t5 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = ms}}, {_SLIT("."), 0x8006fe29, {.d_i64 = us}}, {_SLIT("ms"), 0, { .d_c = 0 }}})); + string _t5 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = ms}}, {_SLIT("."), /*100 &i64*/0x8006fe29, {.d_i64 = us}}, {_SLIT("ms"), 0, { .d_c = 0 }}})); return _t5; } if (us > 0) { - string _t6 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = us}}, {_SLIT("."), 0x8006fe29, {.d_i64 = ns}}, {_SLIT("us"), 0, { .d_c = 0 }}})); + string _t6 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = us}}, {_SLIT("."), /*100 &i64*/0x8006fe29, {.d_i64 = ns}}, {_SLIT("us"), 0, { .d_c = 0 }}})); return _t6; } - string _t7 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe09, {.d_i64 = ns}}, {_SLIT("ns"), 0, { .d_c = 0 }}})); + string _t7 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &i64*/0xfe09, {.d_i64 = ns}}, {_SLIT("ns"), 0, { .d_c = 0 }}})); return _t7; } @@ -34258,7 +34299,7 @@ VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content( Array_string vals = __new_array_with_default(0, 0, sizeof(string), 0); int idx = st_idx; if ((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx)).typ != v__vmod__TokenKind__labr) { - return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" not a valid array, at line "), 0xfe07, {.d_i32 = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx)).line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" not a valid array, at line "), /*100 &int*/0xfe07, {.d_i32 = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx)).line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } idx++; for (;;) { @@ -34267,7 +34308,7 @@ VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content( if (tok.typ == (v__vmod__TokenKind__str)) { array_push((array*)&vals, _MOV((string[]){ string_clone(tok.val) })); if (!((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).typ == v__vmod__TokenKind__comma || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).typ == v__vmod__TokenKind__rabr)) { - return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid separator \""), 0xfe10, {.d_s = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).val}}, {_SLIT("\", at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid separator \""), /*115 &string*/0xfe10, {.d_s = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).val}}, {_SLIT("\", at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } idx += ((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, idx + 1)).typ == v__vmod__TokenKind__comma ? (2) : (1)); } @@ -34276,7 +34317,7 @@ VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content( break; } else { - return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid token \""), 0xfe10, {.d_s = tok.val}}, {_SLIT("\", at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_Array_string_int){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid token \""), /*115 &string*/0xfe10, {.d_s = tok.val}}, {_SLIT("\", at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; } Option_multi_return_Array_string_int _t5; @@ -34286,13 +34327,13 @@ VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content( VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* p) { if (p->scanner.text.len == 0) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" no content."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" no content."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__vmod__Scanner_scan_all(&p->scanner); Array_v__vmod__Token tokens = p->scanner.tokens; v__vmod__Manifest mn = ((v__vmod__Manifest){.name = (string){.str=(byteptr)"", .is_lit=1},.version = (string){.str=(byteptr)"", .is_lit=1},.description = (string){.str=(byteptr)"", .is_lit=1},.dependencies = __new_array(0, 0, sizeof(string)),.license = (string){.str=(byteptr)"", .is_lit=1},.repo_url = (string){.str=(byteptr)"", .is_lit=1},.author = (string){.str=(byteptr)"", .is_lit=1},.unknown = new_map(sizeof(string), sizeof(Array_string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}); if ((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, 0)).typ != v__vmod__TokenKind__module_keyword) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" v.mod files should start with Module, at line "), 0xfe07, {.d_i32 = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, 0)).line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" v.mod files should start with Module, at line "), /*100 &int*/0xfe07, {.d_i32 = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, 0)).line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int i = 1; for (;;) { @@ -34301,7 +34342,7 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* if (tok.typ == (v__vmod__TokenKind__lcbr)) { if (!((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__field_key || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__rcbr)) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid content after opening brace, at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid content after opening brace, at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } i++; continue; @@ -34312,7 +34353,7 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* else if (tok.typ == (v__vmod__TokenKind__field_key)) { string field_name = string_trim_right(tok.val, _SLIT(":")); if (!((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__str || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__labr)) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" value of field \""), 0xfe10, {.d_s = field_name}}, {_SLIT("\" must be either string or an array of strings, at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" value of field \""), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("\" must be either string or an array of strings, at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string field_value = (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).val; @@ -34372,13 +34413,13 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* } else if (tok.typ == (v__vmod__TokenKind__comma)) { if (!((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i - 1)).typ == v__vmod__TokenKind__str || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i - 1)).typ == v__vmod__TokenKind__rabr) || (*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ != v__vmod__TokenKind__field_key) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid comma placement, at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid comma placement, at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } i++; continue; } else { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid token \""), 0xfe10, {.d_s = tok.val}}, {_SLIT("\", at line "), 0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__vmod__Manifest){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__vmod__err_label}}, {_SLIT(" invalid token \""), /*115 &string*/0xfe10, {.d_s = tok.val}}, {_SLIT("\", at line "), /*100 &int*/0xfe07, {.d_i32 = tok.line}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; } Option_v__vmod__Manifest _t11; @@ -34516,7 +34557,7 @@ void v__util__recompilation__must_be_enabled(string vroot, string error_message) string file = v__util__recompilation__disabling_file(vroot); bool is_recompilation_disabled = os__exists(file); if (is_recompilation_disabled) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Recompilation is disabled, since there is a \""), 0xfe10, {.d_s = file}}, {_SLIT("\" file present."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Recompilation is disabled, since there is a \""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\" file present."), 0, { .d_c = 0 }}}))); eprintln(error_message); _v_exit(1); VUNREACHABLE(); @@ -34524,7 +34565,7 @@ void v__util__recompilation__must_be_enabled(string vroot, string error_message) } string v__cflag__CFlag_str(v__cflag__CFlag* c) { - string _t1 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("CFlag{ name: \""), 0xfe10, {.d_s = c->name}}, {_SLIT("\" value: \""), 0xfe10, {.d_s = c->value}}, {_SLIT("\" mod: \""), 0xfe10, {.d_s = c->mod}}, {_SLIT("\" os: \""), 0xfe10, {.d_s = c->os}}, {_SLIT("\" cached: \""), 0xfe10, {.d_s = c->cached}}, {_SLIT("\" }"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("CFlag{ name: \""), /*115 &string*/0xfe10, {.d_s = c->name}}, {_SLIT("\" value: \""), /*115 &string*/0xfe10, {.d_s = c->value}}, {_SLIT("\" mod: \""), /*115 &string*/0xfe10, {.d_s = c->mod}}, {_SLIT("\" os: \""), /*115 &string*/0xfe10, {.d_s = c->os}}, {_SLIT("\" cached: \""), /*115 &string*/0xfe10, {.d_s = c->cached}}, {_SLIT("\" }"), 0, { .d_c = 0 }}})); return _t1; } @@ -34556,7 +34597,7 @@ string v__cflag__CFlag_eval(v__cflag__CFlag* cf) { goto cflag_eval_outer_loop__continue; } } - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> error: none of the paths "), 0xfe10, {.d_s = Array_string_str(svalues)}}, {_SLIT(" exist"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> error: none of the paths "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(svalues)}}, {_SLIT(" exist"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); continue; } @@ -34577,13 +34618,13 @@ string v__cflag__CFlag_format(v__cflag__CFlag* cf) { value = v__cflag__CFlag_eval(cf); } if ((string__eq(cf->name, _SLIT("-l")) || string__eq(cf->name, _SLIT("-Wa")) || string__eq(cf->name, _SLIT("-Wl")) || string__eq(cf->name, _SLIT("-Wp"))) && value.len > 0) { - string _t1 = string_trim_space( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cf->name}}, {_SLIT0, 0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string _t1 = string_trim_space( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cf->name}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t1; } if (string__eq(cf->name, _SLIT("-I")) || string__eq(cf->name, _SLIT("-L")) || string_ends_with(value, _SLIT(".o"))) { value = string__plus(string__plus(_SLIT("\""), os__real_path(value)), _SLIT("\"")); } - string _t2 = string_trim_space( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cf->name}}, {_SLIT(" "), 0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string _t2 = string_trim_space( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cf->name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t2; } @@ -34698,7 +34739,7 @@ Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { string d = (*(string*)_t2.data); string pad = strings__repeat(' ', 20 - mod.len); - m->res = /*f*/string__plus(m->res, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod}}, {_SLIT(" "), 0xfe10, {.d_s = pad}}, {_SLIT(" "), 0xfe10, {.d_s = d}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + m->res = /*f*/string__plus(m->res, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = pad}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = d}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); } } else { m->res = Array_string_join(modules, _SLIT("\n")); @@ -34822,14 +34863,14 @@ VV_LOCAL_SYMBOL string v__pkgconfig__filter(Array_string libs, string prefix, st for (int _t1 = 0; _t1 < libs.len; ++_t1) { string lib = ((string*)libs.data)[_t1]; if (!string_starts_with(lib, prefix) && !string_starts_with(lib, prefix2)) { - res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = lib}}, {_SLIT0, 0, { .d_c = 0 }}}))); + res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = lib}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } else { for (int _t2 = 0; _t2 < libs.len; ++_t2) { string lib = ((string*)libs.data)[_t2]; if (string_starts_with(lib, prefix)) { - res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = lib}}, {_SLIT0, 0, { .d_c = 0 }}}))); + res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = lib}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -34908,7 +34949,7 @@ VV_LOCAL_SYMBOL string v__pkgconfig__PkgConfig_parse_line(v__pkgconfig__PkgConfi int tok1 = (*(int*)_t2.data); tok1 += tok0; string v = string_substr(r, tok0 + 2, tok1); - r = string_replace(r, str_intp(2, _MOV((StrIntpData[]){{_SLIT("${"), 0xfe10, {.d_s = v}}, {_SLIT("}"), 0, { .d_c = 0 }}})), (*(string*)map_get(ADDR(map, pc->vars), &(string[]){v}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} }))); + r = string_replace(r, str_intp(2, _MOV((StrIntpData[]){{_SLIT("${"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("}"), 0, { .d_c = 0 }}})), (*(string*)map_get(ADDR(map, pc->vars), &(string[]){v}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} }))); } string _t3 = string_trim_space(r); return _t3; @@ -34993,7 +35034,7 @@ VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgC } for (int _t3 = 0; _t3 < pc->paths.len; ++_t3) { string path = ((string*)pc->paths.data)[_t3]; - string file = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path}}, {_SLIT("/"), 0xfe10, {.d_s = pkgname}}, {_SLIT(".pc"), 0, { .d_c = 0 }}})); + string file = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = pkgname}}, {_SLIT(".pc"), 0, { .d_c = 0 }}})); if (os__exists(file)) { Option_string _t4; opt_ok(&(string[]) { file }, (Option*)(&_t4), sizeof(string)); @@ -35001,7 +35042,7 @@ VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgC } } } - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Cannot find \""), 0xfe10, {.d_s = pkgname}}, {_SLIT("\" pkgconfig file"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Cannot find \""), /*115 &string*/0xfe10, {.d_s = pkgname}}, {_SLIT("\" pkgconfig file"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__pkgconfig__atleast(string v) { @@ -35100,14 +35141,14 @@ VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__P if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (pc->options.debug) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot resolve "), 0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot resolve "), /*115 &string*/0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not resolve dependency "), 0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not resolve dependency "), /*115 &string*/0xfe10, {.d_s = dep}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string depfile = (*(string*)_t1.data); if (!v__pkgconfig__PkgConfig_parse(&pcdep, depfile)) { - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("required file \""), 0xfe10, {.d_s = depfile}}, {_SLIT("\" could not be parsed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("required file \""), /*115 &string*/0xfe10, {.d_s = depfile}}, {_SLIT("\" could not be parsed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_void _t4 = v__pkgconfig__PkgConfig_load_requires(&pcdep); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { @@ -35171,7 +35212,7 @@ Option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconf string file = (*(string*)_t1.data); if (!v__pkgconfig__PkgConfig_parse(pc, file)) { - return (Option_v__pkgconfig__PkgConfig_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("file \""), 0xfe10, {.d_s = file}}, {_SLIT("\" could not be parsed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__pkgconfig__PkgConfig_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("file \""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\" could not be parsed"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!options.norecurse) { Option_void _t4 = v__pkgconfig__PkgConfig_load_requires(pc); @@ -35289,7 +35330,7 @@ Option_string v__util__diff__find_working_diff_command(void) { string env_diffopts = os__getenv(_SLIT("VDIFF_OPTIONS")); if ((env_difftool).len != 0) { Option_string _t1; - opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = env_difftool}}, {_SLIT(" "), 0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t1), sizeof(string)); + opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = env_difftool}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t1), sizeof(string)); return _t1; } Array_string known_diff_tools = __new_array_with_default(0, 0, sizeof(string), 0); @@ -35307,21 +35348,21 @@ Option_string v__util__diff__find_working_diff_command(void) { } continue; } - os__Result p = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = diffcmd}}, {_SLIT(" --version"), 0, { .d_c = 0 }}}))); + os__Result p = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" --version"), 0, { .d_c = 0 }}}))); if (p.exit_code < 0) { continue; } if (p.exit_code == 127 && string__eq(diffcmd, env_difftool)) { - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not find specified VDIFF_TOOL "), 0xfe10, {.d_s = diffcmd}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not find specified VDIFF_TOOL "), /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (p.exit_code == 0) { if (string__eq(diffcmd, _SLIT("code")) || string__eq(diffcmd, _SLIT("code.cmd"))) { Option_string _t7; - opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), 0xfe10, {.d_s = env_diffopts}}, {_SLIT(" -d"), 0, { .d_c = 0 }}})) }, (Option*)(&_t7), sizeof(string)); + opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT(" -d"), 0, { .d_c = 0 }}})) }, (Option*)(&_t7), sizeof(string)); return _t7; } Option_string _t8; - opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), 0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t8), sizeof(string)); + opt_ok(&(string[]) { str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t8), sizeof(string)); return _t8; } } @@ -35346,10 +35387,10 @@ VV_LOCAL_SYMBOL bool v__util__diff__opendiff_exists(void) { string v__util__diff__color_compare_files(string diff_cmd, string file1, string file2) { if ((diff_cmd).len != 0) { - string full_cmd = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = diff_cmd}}, {_SLIT(" --minimal --text --unified=2 --show-function-line=\"fn \" "), 0xfe10, {.d_s = os__quoted_path(file1)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(file2)}}, {_SLIT(" "), 0, { .d_c = 0 }}})); + string full_cmd = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = diff_cmd}}, {_SLIT(" --minimal --text --unified=2 --show-function-line=\"fn \" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(file1)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(file2)}}, {_SLIT(" "), 0, { .d_c = 0 }}})); os__Result x = os__execute(full_cmd); if (x.exit_code < 0) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("comparison command: `"), 0xfe10, {.d_s = full_cmd}}, {_SLIT("` not found"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("comparison command: `"), /*115 &string*/0xfe10, {.d_s = full_cmd}}, {_SLIT("` not found"), 0, { .d_c = 0 }}})); return _t1; } string _t2 = string_trim_right(x.output, _SLIT("\r\n")); @@ -35368,8 +35409,8 @@ string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefi (*(bool*)_t1.data); u64 ctime = time__sys_mono_now(); - string e_file = os__join_path_single(cdir, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe08, {.d_u64 = ctime}}, {_SLIT(".expected.txt"), 0, { .d_c = 0 }}}))); - string f_file = os__join_path_single(cdir, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe08, {.d_u64 = ctime}}, {_SLIT(".found.txt"), 0, { .d_c = 0 }}}))); + string e_file = os__join_path_single(cdir, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*117 &u64*/0xfe08, {.d_u64 = ctime}}, {_SLIT(".expected.txt"), 0, { .d_c = 0 }}}))); + string f_file = os__join_path_single(cdir, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*117 &u64*/0xfe08, {.d_u64 = ctime}}, {_SLIT(".found.txt"), 0, { .d_c = 0 }}}))); Option_void _t2 = os__write_file(e_file, expected); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; @@ -36212,7 +36253,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) { } string target_dir = (os__is_dir(rpath) ? (rpath) : (os__dir(rpath))); p->out_name = os__join_path(target_dir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){base}))); - if (string__eq(rpath, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = p->vroot}}, {_SLIT("/cmd/v"), 0, { .d_c = 0 }}}))) && os__is_dir(_SLIT("vlib/compiler"))) { + if (string__eq(rpath, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = p->vroot}}, {_SLIT("/cmd/v"), 0, { .d_c = 0 }}}))) && os__is_dir(_SLIT("vlib/compiler"))) { println(_SLIT("Saving the resulting V executable in `./v2`")); println(_SLIT("Use `v -o v cmd/v` if you want to replace current V executable.")); p->out_name = _SLIT("v2"); @@ -36235,8 +36276,8 @@ 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("9b1f7f5e9"); - 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, 0xfe10, {.d_s = v__pref__Backend_str(p->backend)}}, {_SLIT(" | "), 0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" | "), 0xfe10, {.d_s = p->ccompiler}}, {_SLIT(" | "), 0xfe10, {.d_s = p->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" | "), 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))}))); + string vhash = _SLIT("455a52e74"); + 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; } @@ -36296,11 +36337,11 @@ void v__pref__Preferences_default_c_compiler(v__pref__Preferences* p) { #if !defined(__TARGET_IOS__) { string ios_sdk = (p->is_ios_simulator ? (_SLIT("iphonesimulator")) : (_SLIT("iphoneos"))); - os__Result ios_sdk_path_res = os__execute_or_exit( str_intp(2, _MOV((StrIntpData[]){{_SLIT("xcrun --sdk "), 0xfe10, {.d_s = ios_sdk}}, {_SLIT(" --show-sdk-path"), 0, { .d_c = 0 }}}))); + os__Result ios_sdk_path_res = os__execute_or_exit( str_intp(2, _MOV((StrIntpData[]){{_SLIT("xcrun --sdk "), /*115 &string*/0xfe10, {.d_s = ios_sdk}}, {_SLIT(" --show-sdk-path"), 0, { .d_c = 0 }}}))); string isysroot = string_replace(ios_sdk_path_res.output, _SLIT("\n"), _SLIT("")); string arch = (p->is_ios_simulator ? (_SLIT("-arch x86_64 -arch arm64")) : (_SLIT("-arch armv7 -arch armv7s -arch arm64"))); p->ccompiler = _SLIT("/usr/bin/cc"); - p->cflags = string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("-isysroot "), 0xfe10, {.d_s = isysroot}}, {_SLIT(" "), 0xfe10, {.d_s = arch}}, {_SLIT0, 0, { .d_c = 0 }}})), p->cflags); + p->cflags = string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("-isysroot "), /*115 &string*/0xfe10, {.d_s = isysroot}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arch}}, {_SLIT0, 0, { .d_c = 0 }}})), p->cflags); return; } #endif @@ -36347,7 +36388,7 @@ string v__pref__Preferences_vcross_compiler_name(v__pref__Preferences* p) { if (p->backend == v__pref__Backend__c && !string_ends_with(p->out_name, _SLIT(".c"))) { eprintln(_SLIT("Note: V can only cross compile to windows and linux for now by default.")); eprintln(_SLIT("It will use `cc` as a cross compiler for now, although that will probably fail.")); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Set `VCROSS_COMPILER_NAME` to the name of your cross compiler, for your target OS: "), 0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Set `VCROSS_COMPILER_NAME` to the name of your cross compiler, for your target OS: "), /*115 &v.pref.OS*/0xfe10, {.d_s = v__pref__OS_str(p->os)}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); } string _t5 = _SLIT("cc"); return _t5; @@ -36481,7 +36522,7 @@ Option_v__pref__OS v__pref__os_from_string(string os_str) { return _t25; } else { - return (Option_v__pref__OS){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("bad OS "), 0xfe10, {.d_s = os_str}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__pref__OS){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("bad OS "), /*115 &string*/0xfe10, {.d_s = os_str}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_v__pref__OS){0}; } @@ -36687,7 +36728,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors Option_v__pref__Arch _t3 = v__pref__arch_from_string(target_arch); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown architecture target `"), 0xfe10, {.d_s = target_arch}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown architecture target `"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); ; @@ -36695,7 +36736,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors v__pref__Arch target_arch_kind = (*(v__pref__Arch*)_t3.data); res->arch = target_arch_kind; - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else if (string__eq(arg, _SLIT("-assert"))) { string assert_mode = os__cmdline__option(current_args, _SLIT("-assert"), _SLIT("")); @@ -36707,7 +36748,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors res->assert_failure_mode = v__pref__AssertFailureMode__backtraces; } else { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown assert mode `-gc "), 0xfe10, {.d_s = assert_mode}}, {_SLIT("`, supported modes are:`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown assert mode `-gc "), /*115 &string*/0xfe10, {.d_s = assert_mode}}, {_SLIT("`, supported modes are:`"), 0, { .d_c = 0 }}}))); eprintln(_SLIT(" `-assert aborts` .... calls abort() after assertion failure")); eprintln(_SLIT(" `-assert backtraces` .... calls print_backtrace() after assertion failure")); _v_exit(1); @@ -36793,7 +36834,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors v__pref__Preferences_parse_define(res, _SLIT("gcboehm_leak")); } else { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown garbage collection mode `-gc "), 0xfe10, {.d_s = gc_mode}}, {_SLIT("`, supported modes are:`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown garbage collection mode `-gc "), /*115 &string*/0xfe10, {.d_s = gc_mode}}, {_SLIT("`, supported modes are:`"), 0, { .d_c = 0 }}}))); eprintln(_SLIT(" `-gc boehm` ............ default GC-mode (currently `boehm_full_opt`)")); eprintln(_SLIT(" `-gc boehm_full` ....... classic full collection")); eprintln(_SLIT(" `-gc boehm_incr` ....... incremental collection")); @@ -36818,7 +36859,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-debug-tcc"))) { res->ccompiler = _SLIT("tcc"); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = res->ccompiler}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = res->ccompiler}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); res->retry_compilation = false; res->show_cc = true; res->show_c_output = true; @@ -36884,7 +36925,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors else if (string__eq(arg, _SLIT("-prof")) || string__eq(arg, _SLIT("-profile"))) { res->profile_file = os__cmdline__option(current_args, arg, _SLIT("-")); res->is_prof = true; - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = res->profile_file}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = res->profile_file}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); i++; } else if (string__eq(arg, _SLIT("-profile-fns"))) { @@ -36919,7 +36960,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-m32")) || string__eq(arg, _SLIT("-m64"))) { res->m64 = string_at(arg, 2) == '6'; - res->cflags = /*f*/string__plus(res->cflags, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}}))); + res->cflags = /*f*/string__plus(res->cflags, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (string__eq(arg, _SLIT("-color"))) { res->use_color = v__pref__ColorOutput__always; @@ -37007,7 +37048,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors res->output_cross_c = true; continue; } - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown operating system target `"), 0xfe10, {.d_s = target_os}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown operating system target `"), /*115 &string*/0xfe10, {.d_s = target_os}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); ; @@ -37018,7 +37059,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors res->is_bare = true; } res->os = target_os_kind; - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = target_os}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = target_os}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else if (string__eq(arg, _SLIT("-printfn"))) { _PUSH_MANY(&res->printfn_list, (string_split(os__cmdline__option(current_args, _SLIT("-printfn"), _SLIT("")), _SLIT(","))), _t22, Array_string); @@ -37026,7 +37067,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-cflags"))) { res->cflags = /*f*/string__plus(res->cflags, string__plus(_SLIT(" "), os__cmdline__option(current_args, _SLIT("-cflags"), _SLIT("")))); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = string_trim_space(res->cflags)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = string_trim_space(res->cflags)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); i++; } else if (string__eq(arg, _SLIT("-d")) || string__eq(arg, _SLIT("-define"))) { @@ -37046,7 +37087,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-cc"))) { res->ccompiler = os__cmdline__option(current_args, _SLIT("-cc"), _SLIT("cc")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = res->ccompiler}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = res->ccompiler}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); i++; } else if (string__eq(arg, _SLIT("-checker-match-exhaustive-cutoff-limit"))) { @@ -37068,7 +37109,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-b")) || string__eq(arg, _SLIT("-backend"))) { string sbackend = os__cmdline__option(current_args, arg, _SLIT("c")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = sbackend}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sbackend}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); Option_v__pref__Backend _t26 = v__pref__backend_from_string(sbackend); if (_t26.state != 0) { /*or block*/ IError err = _t26.err; @@ -37087,23 +37128,23 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else if (string__eq(arg, _SLIT("-path"))) { string path = os__cmdline__option(current_args, _SLIT("-path"), _SLIT("")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); res->lookup_path = string_split(string_replace(path, _SLIT("|"), _const_os__path_delimiter), _const_os__path_delimiter); i++; } else if (string__eq(arg, _SLIT("-bare-builtin-dir"))) { string bare_builtin_dir = os__cmdline__option(current_args, arg, _SLIT("")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" \""), 0xfe10, {.d_s = bare_builtin_dir}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = bare_builtin_dir}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); res->bare_builtin_dir = bare_builtin_dir; i++; } else if (string__eq(arg, _SLIT("-custom-prelude"))) { string path = os__cmdline__option(current_args, _SLIT("-custom-prelude"), _SLIT("")); - array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg}}, {_SLIT(" "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res->build_options, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); Option_string _t30 = os__read_file(path); if (_t30.state != 0) { /*or block*/ IError err = _t30.err; - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot open custom prelude file: "), 0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot open custom prelude file: "), /*115 &IError*/0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); ; @@ -37115,7 +37156,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } else { if (string__eq(command, _SLIT("build")) && v__pref__is_source_file(arg)) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Use `v "), 0xfe10, {.d_s = arg}}, {_SLIT("` instead."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Use `v "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT("` instead."), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -37146,8 +37187,8 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors if ((command).len != 0 && !string__eq(command, _SLIT("build-module"))) { continue; } - string extension = (command.len == 0 ? (_SLIT("")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" for command `"), 0xfe10, {.d_s = command}}, {_SLIT("`"), 0, { .d_c = 0 }}})))); - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Unknown argument `"), 0xfe10, {.d_s = arg}}, {_SLIT("`"), 0xfe10, {.d_s = extension}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string extension = (command.len == 0 ? (_SLIT("")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" for command `"), /*115 &string*/0xfe10, {.d_s = command}}, {_SLIT("`"), 0, { .d_c = 0 }}})))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Unknown argument `"), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT("`"), /*115 &string*/0xfe10, {.d_s = extension}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); }; @@ -37179,15 +37220,15 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors string tmp_exe_file_path = res->out_name; string output_option = _SLIT(""); if ((tmp_exe_file_path).len == 0) { - tmp_exe_file_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_file_path}}, {_SLIT(".exe"), 0, { .d_c = 0 }}})); - output_option = str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), 0xfe10, {.d_s = os__quoted_path(tmp_exe_file_path)}}, {_SLIT(" "), 0, { .d_c = 0 }}})); + tmp_exe_file_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_file_path}}, {_SLIT(".exe"), 0, { .d_c = 0 }}})); + output_option = str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(tmp_exe_file_path)}}, {_SLIT(" "), 0, { .d_c = 0 }}})); } - string tmp_v_file_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_file_path}}, {_SLIT(".v"), 0, { .d_c = 0 }}})); + string tmp_v_file_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_file_path}}, {_SLIT(".v"), 0, { .d_c = 0 }}})); string contents = os__get_raw_lines_joined(); Option_void _t32 = os__write_file(tmp_v_file_path, contents); if (_t32.state != 0 && _t32.err._typ != _IError_None___index) { IError err = _t32.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to create temporary file "), 0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to create temporary file "), /*115 &string*/0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -37197,12 +37238,12 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors Array_string _t33; string command_options = Array_string_join((_t33 = os__cmdline__options_after(args, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("run")}))), array_slice(_t33, 1, _t33.len)), _SLIT(" ")); string vexe = v__pref__vexe_path(); - string tmp_cmd = str_intp(6, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), 0xfe10, {.d_s = output_option}}, {_SLIT(" "), 0xfe10, {.d_s = run_options}}, {_SLIT(" run "), 0xfe10, {.d_s = os__quoted_path(tmp_v_file_path)}}, {_SLIT(" "), 0xfe10, {.d_s = command_options}}, {_SLIT0, 0, { .d_c = 0 }}})); - v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("tmp_cmd: "), 0xfe10, {.d_s = tmp_cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string tmp_cmd = str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = output_option}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = run_options}}, {_SLIT(" run "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(tmp_v_file_path)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = command_options}}, {_SLIT0, 0, { .d_c = 0 }}})); + v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("tmp_cmd: "), /*115 &string*/0xfe10, {.d_s = tmp_cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); int tmp_result = os__system(tmp_cmd); - v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("exit code: "), 0xfe07, {.d_i32 = tmp_result}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("exit code: "), /*100 &int*/0xfe07, {.d_i32 = tmp_result}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (output_option.len != 0) { - v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove tmp exe file: "), 0xfe10, {.d_s = tmp_exe_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove tmp exe file: "), /*115 &string*/0xfe10, {.d_s = tmp_exe_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); Option_void _t34 = os__rm(tmp_exe_file_path); if (_t34.state != 0 && _t34.err._typ != _IError_None___index) { IError err = _t34.err; @@ -37210,7 +37251,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors ; } - v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove tmp v file: "), 0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove tmp v file: "), /*115 &string*/0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); Option_void _t35 = os__rm(tmp_v_file_path); if (_t35.state != 0 && _t35.err._typ != _IError_None___index) { IError err = _t35.err; @@ -37222,7 +37263,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } v__pref__must_exist(res->path); if (!string_ends_with(res->path, _SLIT(".v")) && os__is_executable(res->path) && os__is_file(res->path) && os__is_file(string__plus(res->path, _SLIT(".v")))) { - v__pref__eprintln_cond(show_output, str_intp(3, _MOV((StrIntpData[]){{_SLIT("It looks like you wanted to run \""), 0xfe10, {.d_s = res->path}}, {_SLIT(".v\", so we went ahead and did that since \""), 0xfe10, {.d_s = res->path}}, {_SLIT("\" is an executable."), 0, { .d_c = 0 }}}))); + v__pref__eprintln_cond(show_output, str_intp(3, _MOV((StrIntpData[]){{_SLIT("It looks like you wanted to run \""), /*115 &string*/0xfe10, {.d_s = res->path}}, {_SLIT(".v\", so we went ahead and did that since \""), /*115 &string*/0xfe10, {.d_s = res->path}}, {_SLIT("\" is an executable."), 0, { .d_c = 0 }}}))); res->path = /*f*/string__plus(res->path, _SLIT(".v")); } } else if (v__pref__is_source_file(command)) { @@ -37248,7 +37289,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors res->run_args = (_t37 = args, array_slice(_t37, command_pos + 2, _t37.len)); v__pref__must_exist(res->path); if (!string_ends_with(res->path, _SLIT(".v")) && os__is_executable(res->path) && os__is_file(res->path) && os__is_file(string__plus(res->path, _SLIT(".v")))) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("It looks like you wanted to run \""), 0xfe10, {.d_s = res->path}}, {_SLIT(".v\", so we went ahead and did that since \""), 0xfe10, {.d_s = res->path}}, {_SLIT("\" is an executable."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("It looks like you wanted to run \""), /*115 &string*/0xfe10, {.d_s = res->path}}, {_SLIT(".v\", so we went ahead and did that since \""), /*115 &string*/0xfe10, {.d_s = res->path}}, {_SLIT("\" is an executable."), 0, { .d_c = 0 }}}))); res->path = /*f*/string__plus(res->path, _SLIT(".v")); } } @@ -37280,7 +37321,7 @@ void v__pref__eprintln_cond(bool condition, string s) { void v__pref__Preferences_vrun_elog(v__pref__Preferences* pref, string s) { if (pref->is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> v run -, "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> v run -, "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -37342,14 +37383,14 @@ Option_v__pref__Arch v__pref__arch_from_string(string arch_str) { return _t10; } else { - return (Option_v__pref__Arch){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid arch: "), 0xfe10, {.d_s = arch_str}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__pref__Arch){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid arch: "), /*115 &string*/0xfe10, {.d_s = arch_str}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_v__pref__Arch){0}; } VV_LOCAL_SYMBOL void v__pref__must_exist(string path) { if (!os__exists(path)) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v expects that `"), 0xfe10, {.d_s = path}}, {_SLIT("` exists, but it does not"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v expects that `"), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("` exists, but it does not"), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -37399,7 +37440,7 @@ Option_v__pref__Backend v__pref__backend_from_string(string s) { return _t7; } else { - return (Option_v__pref__Backend){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unknown backend type "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__pref__Backend){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unknown backend type "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_v__pref__Backend){0}; } @@ -37449,7 +37490,7 @@ v__pref__Arch v__pref__get_host_arch(void) { VV_LOCAL_SYMBOL void v__pref__Preferences_parse_define(v__pref__Preferences* prefs, string define) { Array_string define_parts = string_split(define, _SLIT("=")); if (!(prefs->is_debug && string__eq(define, _SLIT("debug")))) { - array_push((array*)&prefs->build_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-d "), 0xfe10, {.d_s = define}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&prefs->build_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-d "), /*115 &string*/0xfe10, {.d_s = define}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (define_parts.len == 1) { array_push((array*)&prefs->compile_defines, _MOV((string[]){ string_clone(define) })); @@ -37466,13 +37507,13 @@ VV_LOCAL_SYMBOL void v__pref__Preferences_parse_define(v__pref__Preferences* pre array_push((array*)&prefs->compile_defines, _MOV((string[]){ string_clone((*(string*)/*ee elem_sym */array_get(define_parts, 0))) })); } else { - println(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("V error: Unknown define argument value `"), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(define_parts, 1))}}, {_SLIT("` for "), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(define_parts, 0))}}, {_SLIT("."), 0, { .d_c = 0 }}})), _SLIT(" Expected `0` or `1`."))); + println(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("V error: Unknown define argument value `"), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(define_parts, 1))}}, {_SLIT("` for "), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(define_parts, 0))}}, {_SLIT("."), 0, { .d_c = 0 }}})), _SLIT(" Expected `0` or `1`."))); _v_exit(1); VUNREACHABLE(); }; return; } - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("V error: Unknown define argument: "), 0xfe10, {.d_s = define}}, {_SLIT(". Expected at most one `=`."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("V error: Unknown define argument: "), /*115 &string*/0xfe10, {.d_s = define}}, {_SLIT(". Expected at most one `=`."), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -37515,7 +37556,7 @@ Array_string v__pref__Preferences_should_compile_filtered_files(v__pref__Prefere bool allowed = false; for (int _t2 = 0; _t2 < prefs->compile_defines.len; ++_t2) { string cdefine = ((string*)prefs->compile_defines.data)[_t2]; - Array_string file_postfixes = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d_"), 0xfe10, {.d_s = cdefine}}, {_SLIT(".v"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d_"), 0xfe10, {.d_s = cdefine}}, {_SLIT(".c.v"), 0, { .d_c = 0 }}}))})); + Array_string file_postfixes = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT(".v"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT(".c.v"), 0, { .d_c = 0 }}}))})); for (int _t3 = 0; _t3 < file_postfixes.len; ++_t3) { string file_postfix = ((string*)file_postfixes.data)[_t3]; if (string_ends_with(file, file_postfix)) { @@ -37535,7 +37576,7 @@ Array_string v__pref__Preferences_should_compile_filtered_files(v__pref__Prefere bool allowed = true; for (int _t4 = 0; _t4 < prefs->compile_defines.len; ++_t4) { string cdefine = ((string*)prefs->compile_defines.data)[_t4]; - Array_string file_postfixes = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("_notd_"), 0xfe10, {.d_s = cdefine}}, {_SLIT(".v"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_notd_"), 0xfe10, {.d_s = cdefine}}, {_SLIT(".c.v"), 0, { .d_c = 0 }}}))})); + Array_string file_postfixes = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("_notd_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT(".v"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_notd_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT(".c.v"), 0, { .d_c = 0 }}}))})); for (int _t5 = 0; _t5 < file_postfixes.len; ++_t5) { string file_postfix = ((string*)file_postfixes.data)[_t5]; if (string_ends_with(file, file_postfix)) { @@ -37572,14 +37613,14 @@ Array_string v__pref__Preferences_should_compile_filtered_files(v__pref__Prefere string no_postfix_key = v__pref__fname_without_platform_postfix(file); if (_IN_MAP(ADDR(string, no_postfix_key), ADDR(map, fnames_no_postfixes))) { if (prefs->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">>> should_compile_filtered_files: skipping _default.c.v file "), 0xfe10, {.d_s = file}}, {_SLIT(" ; the specialized versions are: "), 0xfe10, {.d_s = Array_string_str((*(Array_string*)map_get(ADDR(map, fnames_no_postfixes), &(string[]){no_postfix_key}, &(Array_string[]){ __new_array(0, 0, sizeof(string)) })))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(">>> should_compile_filtered_files: skipping _default.c.v file "), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT(" ; the specialized versions are: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str((*(Array_string*)map_get(ADDR(map, fnames_no_postfixes), &(string[]){no_postfix_key}, &(Array_string[]){ __new_array(0, 0, sizeof(string)) })))}}, {_SLIT0, 0, { .d_c = 0 }}}))); } continue; } array_push((array*)&res, _MOV((string[]){ string_clone(file) })); } if (prefs->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> should_compile_filtered_files: res: "), 0xfe10, {.d_s = Array_string_str(res)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">>> should_compile_filtered_files: res: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(res)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } Array_string _t13 = res; return _t13; @@ -37768,7 +37809,7 @@ VV_LOCAL_SYMBOL sync__Channel* sync__new_channel_st_noscan(u32 n, u32 st) { } string sync__Channel_auto_str(sync__Channel* ch, string _v_typename) { - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("chan "), 0xfe10, {.d_s = _v_typename}}, {_SLIT("{cap: "), 0xfe06, {.d_u32 = ch->cap}}, {_SLIT(", closed: "), 0xfe04, {.d_u16 = ch->closed}}, {_SLIT("}"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("chan "), /*115 &string*/0xfe10, {.d_s = _v_typename}}, {_SLIT("{cap: "), /*117 &u32*/0xfe06, {.d_u32 = ch->cap}}, {_SLIT(", closed: "), /*117 &u16*/0xfe04, {.d_u16 = ch->closed}}, {_SLIT("}"), 0, { .d_c = 0 }}})); return _t1; } @@ -38640,7 +38681,7 @@ void help__print_and_exit(string topic) { _v_exit(0); VUNREACHABLE(); } - string target_topic = os__join_path(topicdir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT(".txt"), 0, { .d_c = 0 }}}))}))); + string target_topic = os__join_path(topicdir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(".txt"), 0, { .d_c = 0 }}}))}))); Option_string _t2 = os__read_file(target_topic); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; @@ -38750,13 +38791,13 @@ string v__util__formatted_error(string kind, string omsg, string filepath, v__to path = string_replace_once(path, _const_v__util__normalised_workdir, _SLIT("")); } } - string position = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path}}, {_SLIT(":"), 0xfe07, {.d_i32 = pos.line_nr + 1}}, {_SLIT(":"), 0xfe07, {.d_i32 = v__mathutil__max_T_int(1, pos.col + 1)}}, {_SLIT(":"), 0, { .d_c = 0 }}})); + string position = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = pos.line_nr + 1}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = v__mathutil__max_T_int(1, pos.col + 1)}}, {_SLIT(":"), 0, { .d_c = 0 }}})); string scontext = Array_string_join(v__util__source_file_context(kind, filepath, pos), _SLIT("\n")); string final_position = v__util__bold(position); string final_kind = v__util__bold(v__util__color(kind, kind)); string final_msg = emsg; - string final_context = (scontext.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = scontext}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); - string _t1 = string_trim_space( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = final_position}}, {_SLIT(" "), 0xfe10, {.d_s = final_kind}}, {_SLIT(" "), 0xfe10, {.d_s = final_msg}}, {_SLIT0, 0xfe10, {.d_s = final_context}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string final_context = (scontext.len > 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = scontext}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (_SLIT(""))); + string _t1 = string_trim_space( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = final_position}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = final_kind}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = final_msg}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = final_context}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t1; } @@ -38808,7 +38849,7 @@ Array_string v__util__source_file_context(string kind, string filepath, v__token int start_column = v__mathutil__max_T_int(0, v__mathutil__min_T_int(pos.col, sline.len)); int end_column = v__mathutil__max_T_int(0, v__mathutil__min_T_int(pos.col + v__mathutil__max_T_int(0, pos.len), sline.len)); string cline = (iline == pos.line_nr ? (string__plus(string__plus(string_substr(sline, 0, start_column), v__util__color(kind, string_substr(sline, start_column, end_column))), string_substr(sline, end_column, (sline).len))) : (sline)); - array_push((array*)&clines, _MOV((string[]){ string_clone(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xafe27, {.d_i32 = iline + 1}}, {_SLIT(" | "), 0, { .d_c = 0 }}})), string_replace(cline, _SLIT("\t"), tab_spaces))) })); + array_push((array*)&clines, _MOV((string[]){ string_clone(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xafe27, {.d_i32 = iline + 1}}, {_SLIT(" | "), 0, { .d_c = 0 }}})), string_replace(cline, _SLIT("\t"), tab_spaces))) })); if (iline == pos.line_nr) { strings__Builder pointerline_builder = strings__new_builder(sline.len); for (int i = 0; i < start_column; ) { @@ -38835,7 +38876,7 @@ Array_string v__util__source_file_context(string kind, string filepath, v__token // Attr: [noreturn] VNORETURN void v__util__verror(string kind, string s) { string final_kind = v__util__bold(v__util__color(kind, kind)); - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = final_kind}}, {_SLIT(": "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = final_kind}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); while(1); @@ -39186,7 +39227,7 @@ string v__util__Suggestion_say(v__util__Suggestion s, string msg) { if (top_posibility.similarity > 0.5) { string val = top_posibility.value; if (!string_starts_with(val, _SLIT("[]"))) { - res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\nDid you mean `"), 0xfe10, {.d_s = v__util__highlight_suggestion(val)}}, {_SLIT("`?"), 0, { .d_c = 0 }}}))); + res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\nDid you mean `"), /*115 &string*/0xfe10, {.d_s = v__util__highlight_suggestion(val)}}, {_SLIT("`?"), 0, { .d_c = 0 }}}))); found = true; } } @@ -39200,15 +39241,15 @@ string v__util__Suggestion_say(v__util__Suggestion s, string msg) { for (int _t2 = 0; _t2 < _t1_len; ++_t2) { v__util__Possibility it = ((v__util__Possibility*) _t1_orig.data)[_t2]; - string ti = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__util__highlight_suggestion(it.svalue)}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string ti = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v__util__highlight_suggestion(it.svalue)}}, {_SLIT("`"), 0, { .d_c = 0 }}})); array_push((array*)&_t1, &ti); } Array_string values =_t1; qsort(values.data, values.len, values.element_size, (int (*)(const void *, const void *))&compare_6907021362050549619_string); if (values.len == 1) { - res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\n1 possibility: "), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(values, 0))}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + res = /*f*/string__plus(res, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\n1 possibility: "), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(values, 0))}}, {_SLIT("."), 0, { .d_c = 0 }}}))); } else if (values.len < 25) { - res = /*f*/string__plus(res, string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\n"), 0xfe07, {.d_i32 = values.len}}, {_SLIT(" possibilities: "), 0, { .d_c = 0 }}})), Array_string_join(values, _SLIT(", "))), _SLIT("."))); + res = /*f*/string__plus(res, string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(".\n"), /*100 &int*/0xfe07, {.d_i32 = values.len}}, {_SLIT(" possibilities: "), 0, { .d_c = 0 }}})), Array_string_join(values, _SLIT(", "))), _SLIT("."))); } } } @@ -39228,7 +39269,7 @@ string v__util__short_module_name(string name) { } string mname = (*(string*)/*ee elem_sym */array_get(vals, vals.len - 2)); string symname = (*(string*)/*ee elem_sym */array_get(vals, vals.len - 1)); - string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mname}}, {_SLIT("."), 0xfe10, {.d_s = symname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mname}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = symname}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } @@ -39392,9 +39433,9 @@ void v__util__Timers_start(v__util__Timers* t, string name) { i64 v__util__Timers_measure(v__util__Timers* t, string name) { if (!_IN_MAP(ADDR(string, name), ADDR(map, t->swatches))) { Array_string timer_keys = map_keys(&t->swatches); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Timer `"), 0xfe10, {.d_s = name}}, {_SLIT("` was NOT started."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Timer `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` was NOT started."), 0, { .d_c = 0 }}}))); eprintln(_SLIT("> Available timers:")); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> "), 0xfe10, {.d_s = Array_string_str(timer_keys)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(timer_keys)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } i64 ms = time__Duration_microseconds(time__StopWatch_elapsed((*(time__StopWatch*)map_get(ADDR(map, t->swatches), &(string[]){name}, &(time__StopWatch[]){ (time__StopWatch){.elapsed = 0,.start = 0,.end = 0,} })))); i64 _t1 = ms; @@ -39434,8 +39475,8 @@ void v__util__Timers_measure_resume(v__util__Timers* t, string name) { string v__util__Timers_message(v__util__Timers* t, string name) { f64 ms = ((f64)(v__util__Timers_measure(t, name))) / 1000.0; - string value = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x10060d, {.d_f64 = ms}}, {_SLIT0, 0, { .d_c = 0 }}}))); - string formatted_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = value}}, {_SLIT(" ms "), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string value = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*102 &f64*/0x10060d, {.d_f64 = ms}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string formatted_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT(" ms "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); string _t1 = formatted_message; return _t1; } @@ -39532,7 +39573,7 @@ Option_string v__util__resolve_vmodroot(string str, string dir) { v__vmod__ModFileCacher* mcache = v__vmod__get_cache(); v__vmod__ModFileAndFolder vmod_file_location = v__vmod__ModFileCacher_get_by_folder(mcache, dir); if (vmod_file_location.vmod_file.len == 0) { - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("To use @VMODROOT, you need to have a \"v.mod\" file in "), 0xfe10, {.d_s = dir}}, {_SLIT(", or in one of its parent folders."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("To use @VMODROOT, you need to have a \"v.mod\" file in "), /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(", or in one of its parent folders."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string vmod_path = vmod_file_location.vmod_folder; Option_string _t2; @@ -39545,7 +39586,7 @@ Option_string v__util__resolve_env_value(string str, bool check_for_presence) { Option_int _t1 = string_index(str, env_ident); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_string){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("no \""), 0xfe10, {.d_s = env_ident}}, {_SLIT0, 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("...\')\" could be found in \""), 0xfe10, {.d_s = str}}, {_SLIT("\"."), 0, { .d_c = 0 }}})))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("no \""), /*115 &string*/0xfe10, {.d_s = env_ident}}, {_SLIT0, 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("...\')\" could be found in \""), /*115 &string*/0xfe10, {.d_s = str}}, {_SLIT("\"."), 0, { .d_c = 0 }}})))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int at = (*(int*)_t1.data); @@ -39560,7 +39601,7 @@ Option_string v__util__resolve_env_value(string str, bool check_for_presence) { if (ch == '$') { return (Option_string){ .state=2, .err=_v_error(_SLIT("cannot use string interpolation in compile time $env() expression")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid environment variable name in \""), 0xfe10, {.d_s = str}}, {_SLIT("\", invalid character \""), 0xfe10, {.d_s = u8_ascii_str(ch)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid environment variable name in \""), /*115 &string*/0xfe10, {.d_s = str}}, {_SLIT("\", invalid character \""), /*115 &string*/0xfe10, {.d_s = u8_ascii_str(ch)}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } } @@ -39579,12 +39620,12 @@ Option_string v__util__resolve_env_value(string str, bool check_for_presence) { ; if (_t6.state != 0) { /*or block*/ IError err = _t6.err; - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the environment variable \""), 0xfe10, {.d_s = env_lit}}, {_SLIT("\" does not exist."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + 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; if ((env_value).len == 0) { - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the environment variable \""), 0xfe10, {.d_s = env_lit}}, {_SLIT("\" is empty."), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + 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} }; } } else { env_value = os__getenv(env_lit); @@ -39617,17 +39658,17 @@ VNORETURN void v__util__launch_tool(bool is_verbose, string tool_name, Array_str tool_source = string__plus(tool_basename, _SLIT(".v")); } if (is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool vexe : "), 0xfe10, {.d_s = vexe}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool vroot : "), 0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_source : "), 0xfe10, {.d_s = tool_source}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_exe : "), 0xfe10, {.d_s = tool_exe}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_args : "), 0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool vexe : "), /*115 &string*/0xfe10, {.d_s = vexe}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool vroot : "), /*115 &string*/0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_source : "), /*115 &string*/0xfe10, {.d_s = tool_source}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_exe : "), /*115 &string*/0xfe10, {.d_s = tool_exe}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool tool_args : "), /*115 &string*/0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string disabling_file = v__util__recompilation__disabling_file(vroot); bool is_recompilation_disabled = os__exists(disabling_file); bool should_compile = !is_recompilation_disabled && v__util__should_recompile_tool(vexe, tool_source, tool_name, tool_exe); if (is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool should_compile: "), 0xfe10, {.d_s = should_compile ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("launch_tool should_compile: "), /*115 &bool*/0xfe10, {.d_s = should_compile ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (should_compile) { Array_string emodules = (*(Array_string*)map_get(ADDR(map, _const_v__util__external_module_dependencies_for_tool), &(string[]){tool_name}, &(Array_string[]){ __new_array(0, 0, sizeof(string)) })); @@ -39643,7 +39684,7 @@ VNORETURN void v__util__launch_tool(bool is_verbose, string tool_name, Array_str (*(bool*)_t2.data); } - string compilation_command = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" -skip-unused "), 0, { .d_c = 0 }}})); + string compilation_command = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" -skip-unused "), 0, { .d_c = 0 }}})); if (string__eq(tool_name, _SLIT("vself")) || string__eq(tool_name, _SLIT("vup")) || string__eq(tool_name, _SLIT("vdoctor")) || string__eq(tool_name, _SLIT("vsymlink"))) { compilation_command = /*f*/string__plus(compilation_command, _SLIT(" -g ")); } @@ -39652,18 +39693,18 @@ VNORETURN void v__util__launch_tool(bool is_verbose, string tool_name, Array_str } compilation_command = /*f*/string__plus(compilation_command, os__quoted_path(tool_source)); if (is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Compiling "), 0xfe10, {.d_s = tool_name}}, {_SLIT(" with: \""), 0xfe10, {.d_s = compilation_command}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Compiling "), /*115 &string*/0xfe10, {.d_s = tool_name}}, {_SLIT(" with: \""), /*115 &string*/0xfe10, {.d_s = compilation_command}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } os__Result tool_compilation = os__execute_or_exit(compilation_command); if (tool_compilation.exit_code != 0) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot compile `"), 0xfe10, {.d_s = tool_source}}, {_SLIT("`: \n"), 0xfe10, {.d_s = tool_compilation.output}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot compile `"), /*115 &string*/0xfe10, {.d_s = tool_source}}, {_SLIT("`: \n"), /*115 &string*/0xfe10, {.d_s = tool_compilation.output}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } } #if defined(_WIN32) { - _v_exit(os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(tool_exe)}}, {_SLIT(" "), 0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}})))); + _v_exit(os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(tool_exe)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tool_args}}, {_SLIT0, 0, { .d_c = 0 }}})))); VUNREACHABLE(); } #elif defined(_VJS) @@ -39777,7 +39818,7 @@ Option_string v__util__cached_read_source_file(string path) { Option_string _t5 = os__read_file(path); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to open "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed to open "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } string raw_text = (*(string*)_t5.data); @@ -39834,24 +39875,24 @@ VV_LOCAL_SYMBOL Array_string v__util__non_empty(Array_string arg) { Option_bool v__util__check_module_is_installed(string modulename, bool is_verbose) { string mpath = os__join_path_single(os__vmodules_dir(), modulename); string mod_v_file = os__join_path_single(mpath, _SLIT("v.mod")); - string murl = str_intp(2, _MOV((StrIntpData[]){{_SLIT("https://github.com/vlang/"), 0xfe10, {.d_s = modulename}}, {_SLIT0, 0, { .d_c = 0 }}})); + string murl = str_intp(2, _MOV((StrIntpData[]){{_SLIT("https://github.com/vlang/"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT0, 0, { .d_c = 0 }}})); if (is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: mpath: "), 0xfe10, {.d_s = mpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: mod_v_file: "), 0xfe10, {.d_s = mod_v_file}}, {_SLIT0, 0, { .d_c = 0 }}}))); - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: murl: "), 0xfe10, {.d_s = murl}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: mpath: "), /*115 &string*/0xfe10, {.d_s = mpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: mod_v_file: "), /*115 &string*/0xfe10, {.d_s = mod_v_file}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: murl: "), /*115 &string*/0xfe10, {.d_s = murl}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (os__exists(mod_v_file)) { string vexe = v__pref__vexe_path(); - string update_cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" update '"), 0xfe10, {.d_s = modulename}}, {_SLIT("'"), 0, { .d_c = 0 }}})); + string update_cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" update '"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT("'"), 0, { .d_c = 0 }}})); if (is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: updating with "), 0xfe10, {.d_s = update_cmd}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: updating with "), /*115 &string*/0xfe10, {.d_s = update_cmd}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } os__Result update_res = os__execute(update_cmd); if (update_res.exit_code < 0) { - return (Option_bool){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("can not start "), 0xfe10, {.d_s = update_cmd}}, {_SLIT(", error: "), 0xfe10, {.d_s = update_res.output}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("can not start "), /*115 &string*/0xfe10, {.d_s = update_cmd}}, {_SLIT(", error: "), /*115 &string*/0xfe10, {.d_s = update_res.output}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (update_res.exit_code != 0) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Warning: `"), 0xfe10, {.d_s = modulename}}, {_SLIT("` exists, but is not updated.\nV will continue, since updates can fail due to temporary network problems,\nand the existing module `"), 0xfe10, {.d_s = modulename}}, {_SLIT("` may still work."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Warning: `"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT("` exists, but is not updated.\nV will continue, since updates can fail due to temporary network problems,\nand the existing module `"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT("` may still work."), 0, { .d_c = 0 }}}))); if (is_verbose) { eprintln(_SLIT("Details:")); eprintln(update_res.output); @@ -39863,17 +39904,17 @@ Option_bool v__util__check_module_is_installed(string modulename, bool is_verbos return _t2; } if (is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: cloning from "), 0xfe10, {.d_s = murl}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("check_module_is_installed: cloning from "), /*115 &string*/0xfe10, {.d_s = murl}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } - os__Result cloning_res = os__execute( str_intp(3, _MOV((StrIntpData[]){{_SLIT("git clone "), 0xfe10, {.d_s = os__quoted_path(murl)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(mpath)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + os__Result cloning_res = os__execute( str_intp(3, _MOV((StrIntpData[]){{_SLIT("git clone "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(murl)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(mpath)}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (cloning_res.exit_code < 0) { - return (Option_bool){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("git is not installed, error: "), 0xfe10, {.d_s = cloning_res.output}}, {_SLIT0, 0, { .d_c = 0 }}})), cloning_res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("git is not installed, error: "), /*115 &string*/0xfe10, {.d_s = cloning_res.output}}, {_SLIT0, 0, { .d_c = 0 }}})), cloning_res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (cloning_res.exit_code != 0) { - return (Option_bool){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cloning failed, details: "), 0xfe10, {.d_s = cloning_res.output}}, {_SLIT0, 0, { .d_c = 0 }}})), cloning_res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=error_with_code( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cloning failed, details: "), /*115 &string*/0xfe10, {.d_s = cloning_res.output}}, {_SLIT0, 0, { .d_c = 0 }}})), cloning_res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__exists(mod_v_file)) { - return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("even after cloning, "), 0xfe10, {.d_s = mod_v_file}}, {_SLIT(" is still missing"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("even after cloning, "), /*115 &string*/0xfe10, {.d_s = mod_v_file}}, {_SLIT(" is still missing"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (is_verbose) { eprintln(_SLIT("check_module_is_installed: done")); @@ -39897,7 +39938,7 @@ void v__util__ensure_modules_for_all_tools_are_installed(bool is_verbose) { tool_name = string_clone(tool_name); Array_string tool_modules = (*(Array_string*)DenseArray_value(&_const_v__util__external_module_dependencies_for_tool.key_values, _t1)); if (is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Installing modules for tool: "), 0xfe10, {.d_s = tool_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Installing modules for tool: "), /*115 &string*/0xfe10, {.d_s = tool_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } for (int _t4 = 0; _t4 < tool_modules.len; ++_t4) { string emodule = ((string*)tool_modules.data)[_t4]; @@ -39962,10 +40003,10 @@ void v__util__prepare_tool_when_needed(string source_name) { } void v__util__recompile_file(string vexe, string file) { - string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(file)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(file)}}, {_SLIT0, 0, { .d_c = 0 }}})); int recompile_result = os__system(cmd); if (recompile_result != 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not recompile "), 0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not recompile "), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT0, 0, { .d_c = 0 }}}))); _v_exit(2); VUNREACHABLE(); } @@ -39978,7 +40019,7 @@ string v__util__get_vtmp_folder(void) { return _t1; } int uid = os__getuid(); - vtmp = os__join_path_single(os__temp_dir(), str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_"), 0xfe07, {.d_i32 = uid}}, {_SLIT0, 0, { .d_c = 0 }}}))); + vtmp = os__join_path_single(os__temp_dir(), str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_"), /*100 &int*/0xfe07, {.d_i32 = uid}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (!os__exists(vtmp) || !os__is_dir(vtmp)) { Option_void _t2 = os__mkdir_all(vtmp); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { @@ -40010,10 +40051,10 @@ Option_Array_string v__util__find_all_v_files(Array_string roots) { continue; } if (!string_ends_with(file, _SLIT(".v")) && !string_ends_with(file, _SLIT(".vv")) && !string_ends_with(file, _SLIT(".vsh"))) { - return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v fmt can only be used on .v files.\nOffending file: \""), 0xfe10, {.d_s = file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v fmt can only be used on .v files.\nOffending file: \""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__exists(file)) { - return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = file}}, {_SLIT("\" does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_Array_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\" does not exist"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } array_push((array*)&files, _MOV((string[]){ string_clone(file) })); } @@ -40214,10 +40255,10 @@ v__ast__Node v__ast__empty_node(void) { Option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e) { v__ast__Expr root = e->expr; for (;;) { - if (!((root)._typ == 325 /* v.ast.SelectorExpr */)) break; + if (!((root)._typ == 326 /* v.ast.SelectorExpr */)) break; root = (*root._v__ast__SelectorExpr).expr; } - if ((root)._typ == 305 /* v.ast.Ident */) { + if ((root)._typ == 306 /* v.ast.Ident */) { Option_v__ast__Ident _t1; opt_ok(&(v__ast__Ident[]) { (*root._v__ast__Ident) }, (Option*)(&_t1), sizeof(v__ast__Ident)); return _t1; @@ -40250,19 +40291,19 @@ void v__ast__File_free(v__ast__File* f) { // TypeDecl bool v__ast__Ident_is_mut(v__ast__Ident* i) { - if (i->obj._typ == 363 /* v.ast.Var */) { + if (i->obj._typ == 364 /* v.ast.Var */) { bool _t1 = (*i->obj._v__ast__Var).is_mut; return _t1; } - else if (i->obj._typ == 361 /* v.ast.ConstField */) { + else if (i->obj._typ == 362 /* v.ast.ConstField */) { bool _t2 = false; return _t2; } - else if (i->obj._typ == 360 /* v.ast.AsmRegister */) { + else if (i->obj._typ == 361 /* v.ast.AsmRegister */) { bool _t3 = true; return _t3; } - else if (i->obj._typ == 362 /* v.ast.GlobalField */) { + else if (i->obj._typ == 363 /* v.ast.GlobalField */) { bool _t4 = true; return _t4; } @@ -40271,7 +40312,7 @@ bool v__ast__Ident_is_mut(v__ast__Ident* i) { } v__ast__IdentVar v__ast__Ident_var_info(v__ast__Ident* i) { - if (i->info._typ == 415 /* v.ast.IdentVar */) { + if (i->info._typ == 416 /* v.ast.IdentVar */) { v__ast__IdentVar _t1 = (*i->info._v__ast__IdentVar); return _t1; } @@ -40287,7 +40328,7 @@ v__ast__IdentVar v__ast__Ident_var_info(v__ast__Ident* i) { // TypeDecl // Attr: [inline] inline bool v__ast__Expr_is_blank_ident(v__ast__Expr expr) { - if ((expr)._typ == 305 /* v.ast.Ident */) { + if ((expr)._typ == 306 /* v.ast.Ident */) { bool _t1 = (*expr._v__ast__Ident).kind == v__ast__IdentKind__blank_ident; return _t1; } @@ -40296,199 +40337,199 @@ inline bool v__ast__Expr_is_blank_ident(v__ast__Expr expr) { } v__token__Pos v__ast__Expr_pos(v__ast__Expr expr) { - if (expr._typ == 283 /* v.ast.AnonFn */) { + if (expr._typ == 284 /* v.ast.AnonFn */) { v__token__Pos _t1 = (*expr._v__ast__AnonFn).decl.pos; return _t1; } - else if (expr._typ == 290 /* v.ast.CTempVar */) { + else if (expr._typ == 291 /* v.ast.CTempVar */) { v__token__Pos _t2 = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); return _t2; } - else if (expr._typ == 301 /* v.ast.EmptyExpr */) { + else if (expr._typ == 302 /* v.ast.EmptyExpr */) { v__token__Pos _t3 = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); return _t3; } - else if (expr._typ == 316 /* v.ast.NodeError */) { + else if (expr._typ == 317 /* v.ast.NodeError */) { v__token__Pos _t4 = (*expr._v__ast__NodeError).pos; return _t4; } - else if (expr._typ == 284 /* v.ast.ArrayDecompose */) { + else if (expr._typ == 285 /* v.ast.ArrayDecompose */) { v__token__Pos _t5 = (*expr._v__ast__ArrayDecompose).pos; return _t5; } - else if (expr._typ == 285 /* v.ast.ArrayInit */) { + else if (expr._typ == 286 /* v.ast.ArrayInit */) { v__token__Pos _t6 = (*expr._v__ast__ArrayInit).pos; return _t6; } - else if (expr._typ == 286 /* v.ast.AsCast */) { + else if (expr._typ == 287 /* v.ast.AsCast */) { v__token__Pos _t7 = (*expr._v__ast__AsCast).pos; return _t7; } - else if (expr._typ == 287 /* v.ast.Assoc */) { + else if (expr._typ == 288 /* v.ast.Assoc */) { v__token__Pos _t8 = (*expr._v__ast__Assoc).pos; return _t8; } - else if (expr._typ == 288 /* v.ast.AtExpr */) { + else if (expr._typ == 289 /* v.ast.AtExpr */) { v__token__Pos _t9 = (*expr._v__ast__AtExpr).pos; return _t9; } - else if (expr._typ == 289 /* v.ast.BoolLiteral */) { + else if (expr._typ == 290 /* v.ast.BoolLiteral */) { v__token__Pos _t10 = (*expr._v__ast__BoolLiteral).pos; return _t10; } - else if (expr._typ == 291 /* v.ast.CallExpr */) { + else if (expr._typ == 292 /* v.ast.CallExpr */) { v__token__Pos _t11 = (*expr._v__ast__CallExpr).pos; return _t11; } - else if (expr._typ == 292 /* v.ast.CastExpr */) { + else if (expr._typ == 293 /* v.ast.CastExpr */) { v__token__Pos _t12 = (*expr._v__ast__CastExpr).pos; return _t12; } - else if (expr._typ == 293 /* v.ast.ChanInit */) { + else if (expr._typ == 294 /* v.ast.ChanInit */) { v__token__Pos _t13 = (*expr._v__ast__ChanInit).pos; return _t13; } - else if (expr._typ == 294 /* v.ast.CharLiteral */) { + else if (expr._typ == 295 /* v.ast.CharLiteral */) { v__token__Pos _t14 = (*expr._v__ast__CharLiteral).pos; return _t14; } - else if (expr._typ == 299 /* v.ast.ConcatExpr */) { + else if (expr._typ == 300 /* v.ast.ConcatExpr */) { v__token__Pos _t15 = (*expr._v__ast__ConcatExpr).pos; return _t15; } - else if (expr._typ == 295 /* v.ast.Comment */) { + else if (expr._typ == 296 /* v.ast.Comment */) { v__token__Pos _t16 = (*expr._v__ast__Comment).pos; return _t16; } - else if (expr._typ == 296 /* v.ast.ComptimeCall */) { + else if (expr._typ == 297 /* v.ast.ComptimeCall */) { v__token__Pos _t17 = (*expr._v__ast__ComptimeCall).pos; return _t17; } - else if (expr._typ == 297 /* v.ast.ComptimeSelector */) { + else if (expr._typ == 298 /* v.ast.ComptimeSelector */) { v__token__Pos _t18 = (*expr._v__ast__ComptimeSelector).pos; return _t18; } - else if (expr._typ == 302 /* v.ast.EnumVal */) { + else if (expr._typ == 303 /* v.ast.EnumVal */) { v__token__Pos _t19 = (*expr._v__ast__EnumVal).pos; return _t19; } - else if (expr._typ == 300 /* v.ast.DumpExpr */) { + else if (expr._typ == 301 /* v.ast.DumpExpr */) { v__token__Pos _t20 = (*expr._v__ast__DumpExpr).pos; return _t20; } - else if (expr._typ == 303 /* v.ast.FloatLiteral */) { + else if (expr._typ == 304 /* v.ast.FloatLiteral */) { v__token__Pos _t21 = (*expr._v__ast__FloatLiteral).pos; return _t21; } - else if (expr._typ == 304 /* v.ast.GoExpr */) { + else if (expr._typ == 305 /* v.ast.GoExpr */) { v__token__Pos _t22 = (*expr._v__ast__GoExpr).pos; return _t22; } - else if (expr._typ == 305 /* v.ast.Ident */) { + else if (expr._typ == 306 /* v.ast.Ident */) { v__token__Pos _t23 = (*expr._v__ast__Ident).pos; return _t23; } - else if (expr._typ == 306 /* v.ast.IfExpr */) { + else if (expr._typ == 307 /* v.ast.IfExpr */) { v__token__Pos _t24 = (*expr._v__ast__IfExpr).pos; return _t24; } - else if (expr._typ == 310 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { v__token__Pos _t25 = (*expr._v__ast__IntegerLiteral).pos; return _t25; } - else if (expr._typ == 311 /* v.ast.IsRefType */) { + else if (expr._typ == 312 /* v.ast.IsRefType */) { v__token__Pos _t26 = (*expr._v__ast__IsRefType).pos; return _t26; } - else if (expr._typ == 312 /* v.ast.Likely */) { + else if (expr._typ == 313 /* v.ast.Likely */) { v__token__Pos _t27 = (*expr._v__ast__Likely).pos; return _t27; } - else if (expr._typ == 313 /* v.ast.LockExpr */) { + else if (expr._typ == 314 /* v.ast.LockExpr */) { v__token__Pos _t28 = (*expr._v__ast__LockExpr).pos; return _t28; } - else if (expr._typ == 314 /* v.ast.MapInit */) { + else if (expr._typ == 315 /* v.ast.MapInit */) { v__token__Pos _t29 = (*expr._v__ast__MapInit).pos; return _t29; } - else if (expr._typ == 315 /* v.ast.MatchExpr */) { + else if (expr._typ == 316 /* v.ast.MatchExpr */) { v__token__Pos _t30 = (*expr._v__ast__MatchExpr).pos; return _t30; } - else if (expr._typ == 317 /* v.ast.None */) { + else if (expr._typ == 318 /* v.ast.None */) { v__token__Pos _t31 = (*expr._v__ast__None).pos; return _t31; } - else if (expr._typ == 318 /* v.ast.OffsetOf */) { + else if (expr._typ == 319 /* v.ast.OffsetOf */) { v__token__Pos _t32 = (*expr._v__ast__OffsetOf).pos; return _t32; } - else if (expr._typ == 319 /* v.ast.OrExpr */) { + else if (expr._typ == 320 /* v.ast.OrExpr */) { v__token__Pos _t33 = (*expr._v__ast__OrExpr).pos; return _t33; } - else if (expr._typ == 320 /* v.ast.ParExpr */) { + else if (expr._typ == 321 /* v.ast.ParExpr */) { v__token__Pos _t34 = (*expr._v__ast__ParExpr).pos; return _t34; } - else if (expr._typ == 321 /* v.ast.PostfixExpr */) { + else if (expr._typ == 322 /* v.ast.PostfixExpr */) { v__token__Pos _t35 = (*expr._v__ast__PostfixExpr).pos; return _t35; } - else if (expr._typ == 322 /* v.ast.PrefixExpr */) { + else if (expr._typ == 323 /* v.ast.PrefixExpr */) { v__token__Pos _t36 = (*expr._v__ast__PrefixExpr).pos; return _t36; } - else if (expr._typ == 323 /* v.ast.RangeExpr */) { + else if (expr._typ == 324 /* v.ast.RangeExpr */) { v__token__Pos _t37 = (*expr._v__ast__RangeExpr).pos; return _t37; } - else if (expr._typ == 324 /* v.ast.SelectExpr */) { + else if (expr._typ == 325 /* v.ast.SelectExpr */) { v__token__Pos _t38 = (*expr._v__ast__SelectExpr).pos; return _t38; } - else if (expr._typ == 325 /* v.ast.SelectorExpr */) { + else if (expr._typ == 326 /* v.ast.SelectorExpr */) { v__token__Pos _t39 = (*expr._v__ast__SelectorExpr).pos; return _t39; } - else if (expr._typ == 326 /* v.ast.SizeOf */) { + else if (expr._typ == 327 /* v.ast.SizeOf */) { v__token__Pos _t40 = (*expr._v__ast__SizeOf).pos; return _t40; } - else if (expr._typ == 327 /* v.ast.SqlExpr */) { + else if (expr._typ == 328 /* v.ast.SqlExpr */) { v__token__Pos _t41 = (*expr._v__ast__SqlExpr).pos; return _t41; } - else if (expr._typ == 328 /* v.ast.StringInterLiteral */) { + else if (expr._typ == 329 /* v.ast.StringInterLiteral */) { v__token__Pos _t42 = (*expr._v__ast__StringInterLiteral).pos; return _t42; } - else if (expr._typ == 329 /* v.ast.StringLiteral */) { + else if (expr._typ == 330 /* v.ast.StringLiteral */) { v__token__Pos _t43 = (*expr._v__ast__StringLiteral).pos; return _t43; } - else if (expr._typ == 330 /* v.ast.StructInit */) { + else if (expr._typ == 331 /* v.ast.StructInit */) { v__token__Pos _t44 = (*expr._v__ast__StructInit).pos; return _t44; } - else if (expr._typ == 331 /* v.ast.TypeNode */) { + else if (expr._typ == 332 /* v.ast.TypeNode */) { v__token__Pos _t45 = (*expr._v__ast__TypeNode).pos; return _t45; } - else if (expr._typ == 332 /* v.ast.TypeOf */) { + else if (expr._typ == 333 /* v.ast.TypeOf */) { v__token__Pos _t46 = (*expr._v__ast__TypeOf).pos; return _t46; } - else if (expr._typ == 333 /* v.ast.UnsafeExpr */) { + else if (expr._typ == 334 /* v.ast.UnsafeExpr */) { v__token__Pos _t47 = (*expr._v__ast__UnsafeExpr).pos; return _t47; } - else if (expr._typ == 298 /* v.ast.ComptimeType */) { + else if (expr._typ == 299 /* v.ast.ComptimeType */) { v__token__Pos _t48 = (*expr._v__ast__ComptimeType).pos; return _t48; } - else if (expr._typ == 308 /* v.ast.IndexExpr */) { + else if (expr._typ == 309 /* v.ast.IndexExpr */) { if ((*expr._v__ast__IndexExpr).or_expr.kind != v__ast__OrKind__absent) { v__token__Pos _t49 = (*expr._v__ast__IndexExpr).or_expr.pos; return _t49; @@ -40496,11 +40537,11 @@ v__token__Pos v__ast__Expr_pos(v__ast__Expr expr) { v__token__Pos _t50 = (*expr._v__ast__IndexExpr).pos; return _t50; } - else if (expr._typ == 307 /* v.ast.IfGuardExpr */) { + else if (expr._typ == 308 /* v.ast.IfGuardExpr */) { v__token__Pos _t51 = v__ast__Expr_pos((*expr._v__ast__IfGuardExpr).expr); return _t51; } - else if (expr._typ == 309 /* v.ast.InfixExpr */) { + else if (expr._typ == 310 /* v.ast.InfixExpr */) { v__token__Pos left_pos = v__ast__Expr_pos((*expr._v__ast__InfixExpr).left); v__token__Pos right_pos = v__ast__Expr_pos((*expr._v__ast__InfixExpr).right); v__token__Pos _t52 = ((v__token__Pos){.len = right_pos.pos - left_pos.pos + right_pos.len,.line_nr = (*expr._v__ast__InfixExpr).pos.line_nr,.pos = left_pos.pos,.col = left_pos.col,.last_line = right_pos.last_line,}); @@ -40511,27 +40552,27 @@ v__token__Pos v__ast__Expr_pos(v__ast__Expr expr) { } bool v__ast__Expr_is_lvalue(v__ast__Expr expr) { - if (expr._typ == 305 /* v.ast.Ident */) { + if (expr._typ == 306 /* v.ast.Ident */) { bool _t1 = true; return _t1; } - else if (expr._typ == 290 /* v.ast.CTempVar */) { + else if (expr._typ == 291 /* v.ast.CTempVar */) { bool _t2 = true; return _t2; } - else if (expr._typ == 308 /* v.ast.IndexExpr */) { + else if (expr._typ == 309 /* v.ast.IndexExpr */) { bool _t3 = v__ast__Expr_is_lvalue((*expr._v__ast__IndexExpr).left); return _t3; } - else if (expr._typ == 325 /* v.ast.SelectorExpr */) { + else if (expr._typ == 326 /* v.ast.SelectorExpr */) { bool _t4 = v__ast__Expr_is_lvalue((*expr._v__ast__SelectorExpr).expr); return _t4; } - else if (expr._typ == 320 /* v.ast.ParExpr */) { + else if (expr._typ == 321 /* v.ast.ParExpr */) { bool _t5 = v__ast__Expr_is_lvalue((*expr._v__ast__ParExpr).expr); return _t5; } - else if (expr._typ == 322 /* v.ast.PrefixExpr */) { + else if (expr._typ == 323 /* v.ast.PrefixExpr */) { bool _t6 = v__ast__Expr_is_lvalue((*expr._v__ast__PrefixExpr).right); return _t6; } @@ -40544,19 +40585,19 @@ bool v__ast__Expr_is_lvalue(v__ast__Expr expr) { } bool v__ast__Expr_is_expr(v__ast__Expr expr) { - if (expr._typ == 306 /* v.ast.IfExpr */) { + if (expr._typ == 307 /* v.ast.IfExpr */) { bool _t1 = (*expr._v__ast__IfExpr).is_expr; return _t1; } - else if (expr._typ == 313 /* v.ast.LockExpr */) { + else if (expr._typ == 314 /* v.ast.LockExpr */) { bool _t2 = (*expr._v__ast__LockExpr).is_expr; return _t2; } - else if (expr._typ == 315 /* v.ast.MatchExpr */) { + else if (expr._typ == 316 /* v.ast.MatchExpr */) { bool _t3 = (*expr._v__ast__MatchExpr).is_expr; return _t3; } - else if (expr._typ == 324 /* v.ast.SelectExpr */) { + else if (expr._typ == 325 /* v.ast.SelectExpr */) { bool _t4 = (*expr._v__ast__SelectExpr).is_expr; return _t4; } @@ -40569,20 +40610,20 @@ bool v__ast__Expr_is_expr(v__ast__Expr expr) { } bool v__ast__Expr_is_lit(v__ast__Expr expr) { - bool _t1 = ((expr._typ == 289 /* v.ast.BoolLiteral */) ? (true) : (expr._typ == 294 /* v.ast.CharLiteral */) ? (true) : (expr._typ == 329 /* v.ast.StringLiteral */) ? (true) : (expr._typ == 310 /* v.ast.IntegerLiteral */) ? (true) : (false)); + bool _t1 = ((expr._typ == 290 /* v.ast.BoolLiteral */) ? (true) : (expr._typ == 295 /* v.ast.CharLiteral */) ? (true) : (expr._typ == 330 /* v.ast.StringLiteral */) ? (true) : (expr._typ == 311 /* v.ast.IntegerLiteral */) ? (true) : (false)); return _t1; } bool v__ast__Expr_is_auto_deref_var(v__ast__Expr expr) { - if (expr._typ == 305 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if (expr._typ == 306 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { if ((*(*expr._v__ast__Ident).obj._v__ast__Var).is_auto_deref) { bool _t1 = true; return _t1; } } } - else if (expr._typ == 322 /* v.ast.PrefixExpr */) { + else if (expr._typ == 323 /* v.ast.PrefixExpr */) { if ((*expr._v__ast__PrefixExpr).op == v__token__Kind__amp && v__ast__Expr_is_auto_deref_var((*expr._v__ast__PrefixExpr).right)) { bool _t2 = true; return _t2; @@ -40597,11 +40638,11 @@ bool v__ast__Expr_is_auto_deref_var(v__ast__Expr expr) { } bool v__ast__Expr_is_lockable(v__ast__Expr* e) { - if (e->_typ == 305 /* v.ast.Ident */) { + if (e->_typ == 306 /* v.ast.Ident */) { bool _t1 = true; return _t1; } - else if (e->_typ == 325 /* v.ast.SelectorExpr */) { + else if (e->_typ == 326 /* v.ast.SelectorExpr */) { bool _t2 = v__ast__Expr_is_lockable(&(*e->_v__ast__SelectorExpr).expr); return _t2; } @@ -40615,55 +40656,55 @@ bool v__ast__Expr_is_lockable(v__ast__Expr* e) { } Option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt) { - if (stmt._typ == 337 /* v.ast.AssignStmt */) { + if (stmt._typ == 338 /* v.ast.AssignStmt */) { return (Option_void){0}; } - else if (stmt._typ == 346 /* v.ast.ForCStmt */) { + else if (stmt._typ == 347 /* v.ast.ForCStmt */) { return (Option_void){0}; } - else if (stmt._typ == 347 /* v.ast.ForInStmt */) { + else if (stmt._typ == 348 /* v.ast.ForInStmt */) { return (Option_void){0}; } - else if (stmt._typ == 348 /* v.ast.ForStmt */) { + else if (stmt._typ == 349 /* v.ast.ForStmt */) { return (Option_void){0}; } - else if (stmt._typ == 345 /* v.ast.ExprStmt */) { + else if (stmt._typ == 346 /* v.ast.ExprStmt */) { if (v__ast__Expr_is_expr((*stmt._v__ast__ExprStmt).expr)) { return (Option_void){0}; } - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsupported statement (`"), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( ((*stmt._v__ast__ExprStmt).expr)._typ ))}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsupported statement (`"), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( ((*stmt._v__ast__ExprStmt).expr)._typ ))}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else { } ; - return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsupported statement (`"), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (stmt)._typ ))}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsupported statement (`"), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (stmt)._typ ))}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__token__Pos v__ast__Node_pos(v__ast__Node node) { - if (node._typ == 316 /* v.ast.NodeError */) { + if (node._typ == 317 /* v.ast.NodeError */) { v__token__Pos _t1 = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); return _t1; } - else if (node._typ == 366 /* v.ast.EmptyNode */) { + else if (node._typ == 367 /* v.ast.EmptyNode */) { v__token__Pos _t2 = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); return _t2; } - else if (node._typ == 359 /* v.ast.Stmt */) { + else if (node._typ == 360 /* v.ast.Stmt */) { v__token__Pos pos = (*((*node._v__ast__Stmt).pos)); - if (((*node._v__ast__Stmt))._typ == 353 /* v.ast.Import */) { + if (((*node._v__ast__Stmt))._typ == 354 /* v.ast.Import */) { for (int _t3 = 0; _t3 < (*(*node._v__ast__Stmt)._v__ast__Import).syms.len; ++_t3) { v__ast__ImportSymbol sym = ((v__ast__ImportSymbol*)(*(*node._v__ast__Stmt)._v__ast__Import).syms.data)[_t3]; pos = v__token__Pos_extend(pos, sym.pos); } - } else if (((*node._v__ast__Stmt))._typ == 282 /* v.ast.TypeDecl */) { - if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 280 /* v.ast.FnTypeDecl */) { + } else if (((*node._v__ast__Stmt))._typ == 283 /* v.ast.TypeDecl */) { + if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 281 /* v.ast.FnTypeDecl */) { pos = v__token__Pos_extend(pos, (*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__FnTypeDecl).type_pos); } - else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 279 /* v.ast.AliasTypeDecl */) { + else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 280 /* v.ast.AliasTypeDecl */) { pos = v__token__Pos_extend(pos, (*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__AliasTypeDecl).type_pos); } - else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 281 /* v.ast.SumTypeDecl */) { + else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 282 /* v.ast.SumTypeDecl */) { for (int _t4 = 0; _t4 < (*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__SumTypeDecl).variants.len; ++_t4) { v__ast__TypeNode variant = ((v__ast__TypeNode*)(*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__SumTypeDecl).variants.data)[_t4]; pos = v__token__Pos_extend(pos, variant.pos); @@ -40671,81 +40712,81 @@ v__token__Pos v__ast__Node_pos(v__ast__Node node) { } ; } - if (((*node._v__ast__Stmt))._typ == 337 /* v.ast.AssignStmt */) { + if (((*node._v__ast__Stmt))._typ == 338 /* v.ast.AssignStmt */) { v__token__Pos _t5 = v__token__Pos_extend(pos, v__ast__Expr_pos((*(v__ast__Expr*)array_last((*(*node._v__ast__Stmt)._v__ast__AssignStmt).right)))); return _t5; } - if (((*node._v__ast__Stmt))._typ == 336 /* v.ast.AssertStmt */) { + if (((*node._v__ast__Stmt))._typ == 337 /* v.ast.AssertStmt */) { v__token__Pos _t6 = v__token__Pos_extend(pos, v__ast__Expr_pos((*(*node._v__ast__Stmt)._v__ast__AssertStmt).expr)); return _t6; } v__token__Pos _t7 = pos; return _t7; } - else if (node._typ == 334 /* v.ast.Expr */) { + else if (node._typ == 335 /* v.ast.Expr */) { v__token__Pos _t8 = v__ast__Expr_pos((*node._v__ast__Expr)); return _t8; } - else if (node._typ == 372 /* v.ast.StructField */) { + else if (node._typ == 373 /* v.ast.StructField */) { v__token__Pos _t9 = v__token__Pos_extend((*node._v__ast__StructField).pos, (*node._v__ast__StructField).type_pos); return _t9; } - else if (node._typ == 369 /* v.ast.MatchBranch */) { + else if (node._typ == 370 /* v.ast.MatchBranch */) { v__token__Pos _t10 = (*node._v__ast__MatchBranch).pos; return _t10; } - else if (node._typ == 371 /* v.ast.SelectBranch */) { + else if (node._typ == 372 /* v.ast.SelectBranch */) { v__token__Pos _t11 = (*node._v__ast__SelectBranch).pos; return _t11; } - else if (node._typ == 367 /* v.ast.EnumField */) { + else if (node._typ == 368 /* v.ast.EnumField */) { v__token__Pos _t12 = (*node._v__ast__EnumField).pos; return _t12; } - else if (node._typ == 361 /* v.ast.ConstField */) { + else if (node._typ == 362 /* v.ast.ConstField */) { v__token__Pos _t13 = (*node._v__ast__ConstField).pos; return _t13; } - else if (node._typ == 373 /* v.ast.StructInitField */) { + else if (node._typ == 374 /* v.ast.StructInitField */) { v__token__Pos _t14 = (*node._v__ast__StructInitField).pos; return _t14; } - else if (node._typ == 362 /* v.ast.GlobalField */) { + else if (node._typ == 363 /* v.ast.GlobalField */) { v__token__Pos _t15 = (*node._v__ast__GlobalField).pos; return _t15; } - else if (node._typ == 365 /* v.ast.CallArg */) { + else if (node._typ == 366 /* v.ast.CallArg */) { v__token__Pos _t16 = (*node._v__ast__CallArg).pos; return _t16; } - else if (node._typ == 370 /* v.ast.Param */) { + else if (node._typ == 371 /* v.ast.Param */) { v__token__Pos _t17 = v__token__Pos_extend((*node._v__ast__Param).pos, (*node._v__ast__Param).type_pos); return _t17; } - else if (node._typ == 368 /* v.ast.IfBranch */) { + else if (node._typ == 369 /* v.ast.IfBranch */) { v__token__Pos _t18 = v__token__Pos_extend((*node._v__ast__IfBranch).pos, (*node._v__ast__IfBranch).body_pos); return _t18; } - else if (node._typ == 364 /* v.ast.ScopeObject */) { - if ((*node._v__ast__ScopeObject)._typ == 361 /* v.ast.ConstField */) { + else if (node._typ == 365 /* v.ast.ScopeObject */) { + if ((*node._v__ast__ScopeObject)._typ == 362 /* v.ast.ConstField */) { v__token__Pos _t19 = (*(*node._v__ast__ScopeObject)._v__ast__ConstField).pos; return _t19; } - else if ((*node._v__ast__ScopeObject)._typ == 362 /* v.ast.GlobalField */) { + else if ((*node._v__ast__ScopeObject)._typ == 363 /* v.ast.GlobalField */) { v__token__Pos _t20 = (*(*node._v__ast__ScopeObject)._v__ast__GlobalField).pos; return _t20; } - else if ((*node._v__ast__ScopeObject)._typ == 363 /* v.ast.Var */) { + else if ((*node._v__ast__ScopeObject)._typ == 364 /* v.ast.Var */) { v__token__Pos _t21 = (*(*node._v__ast__ScopeObject)._v__ast__Var).pos; return _t21; } - else if ((*node._v__ast__ScopeObject)._typ == 360 /* v.ast.AsmRegister */) { + else if ((*node._v__ast__ScopeObject)._typ == 361 /* v.ast.AsmRegister */) { v__token__Pos _t22 = ((v__token__Pos){.len = -1,.line_nr = -1,.pos = -1,.col = -1,.last_line = -1,}); return _t22; } ; } - else if (node._typ == 209 /* v.ast.File */) { + else if (node._typ == 210 /* v.ast.File */) { v__token__Pos pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); if ((*node._v__ast__File).stmts.len > 0) { v__token__Pos first_pos = (*((*(v__ast__Stmt*)array_first((*node._v__ast__File).stmts)).pos)); @@ -40761,8 +40802,8 @@ v__token__Pos v__ast__Node_pos(v__ast__Node node) { Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node children = __new_array_with_default(0, 0, sizeof(v__ast__Node), 0); - if ((node)._typ == 334 /* v.ast.Expr */) { - if ((*node._v__ast__Expr)._typ == 328 /* v.ast.StringInterLiteral */) { + if ((node)._typ == 335 /* v.ast.Expr */) { + if ((*node._v__ast__Expr)._typ == 329 /* v.ast.StringInterLiteral */) { Array_v__ast__Node _t2 = {0}; Array_v__ast__Expr _t2_orig = (*(*node._v__ast__Expr)._v__ast__StringInterLiteral).exprs; int _t2_len = _t2_orig.len; @@ -40776,7 +40817,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t1 =_t2; return _t1; } - else if ((*node._v__ast__Expr)._typ == 287 /* v.ast.Assoc */) { + else if ((*node._v__ast__Expr)._typ == 288 /* v.ast.Assoc */) { Array_v__ast__Node _t5 = {0}; Array_v__ast__Expr _t5_orig = (*(*node._v__ast__Expr)._v__ast__Assoc).exprs; int _t5_len = _t5_orig.len; @@ -40790,7 +40831,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t4 =_t5; return _t4; } - else if ((*node._v__ast__Expr)._typ == 285 /* v.ast.ArrayInit */) { + else if ((*node._v__ast__Expr)._typ == 286 /* v.ast.ArrayInit */) { Array_v__ast__Node _t8 = {0}; Array_v__ast__Expr _t8_orig = (*(*node._v__ast__Expr)._v__ast__ArrayInit).exprs; int _t8_len = _t8_orig.len; @@ -40804,37 +40845,37 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t7 =_t8; return _t7; } - else if ((*node._v__ast__Expr)._typ == 325 /* v.ast.SelectorExpr */) { + else if ((*node._v__ast__Expr)._typ == 326 /* v.ast.SelectorExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__SelectorExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 321 /* v.ast.PostfixExpr */) { + else if ((*node._v__ast__Expr)._typ == 322 /* v.ast.PostfixExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__PostfixExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 333 /* v.ast.UnsafeExpr */) { + else if ((*node._v__ast__Expr)._typ == 334 /* v.ast.UnsafeExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__UnsafeExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 286 /* v.ast.AsCast */) { + else if ((*node._v__ast__Expr)._typ == 287 /* v.ast.AsCast */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__AsCast).expr) })); } - else if ((*node._v__ast__Expr)._typ == 320 /* v.ast.ParExpr */) { + else if ((*node._v__ast__Expr)._typ == 321 /* v.ast.ParExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ParExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 307 /* v.ast.IfGuardExpr */) { + else if ((*node._v__ast__Expr)._typ == 308 /* v.ast.IfGuardExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__IfGuardExpr).expr) })); } - else if ((*node._v__ast__Expr)._typ == 326 /* v.ast.SizeOf */) { + else if ((*node._v__ast__Expr)._typ == 327 /* v.ast.SizeOf */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__SizeOf).expr) })); } - else if ((*node._v__ast__Expr)._typ == 312 /* v.ast.Likely */) { + else if ((*node._v__ast__Expr)._typ == 313 /* v.ast.Likely */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__Likely).expr) })); } - else if ((*node._v__ast__Expr)._typ == 332 /* v.ast.TypeOf */) { + else if ((*node._v__ast__Expr)._typ == 333 /* v.ast.TypeOf */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__TypeOf).expr) })); } - else if ((*node._v__ast__Expr)._typ == 284 /* v.ast.ArrayDecompose */) { + else if ((*node._v__ast__Expr)._typ == 285 /* v.ast.ArrayDecompose */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ArrayDecompose).expr) })); } - else if ((*node._v__ast__Expr)._typ == 313 /* v.ast.LockExpr */) { + else if ((*node._v__ast__Expr)._typ == 314 /* v.ast.LockExpr */) { Array_v__ast__Node _t21 = {0}; Array_v__ast__Stmt _t21_orig = (*(*node._v__ast__Expr)._v__ast__LockExpr).stmts; int _t21_len = _t21_orig.len; @@ -40848,7 +40889,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t20 =_t21; return _t20; } - else if ((*node._v__ast__Expr)._typ == 319 /* v.ast.OrExpr */) { + else if ((*node._v__ast__Expr)._typ == 320 /* v.ast.OrExpr */) { Array_v__ast__Node _t24 = {0}; Array_v__ast__Stmt _t24_orig = (*(*node._v__ast__Expr)._v__ast__OrExpr).stmts; int _t24_len = _t24_orig.len; @@ -40862,7 +40903,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t23 =_t24; return _t23; } - else if ((*node._v__ast__Expr)._typ == 330 /* v.ast.StructInit */) { + else if ((*node._v__ast__Expr)._typ == 331 /* v.ast.StructInit */) { Array_v__ast__Node _t27 = {0}; Array_v__ast__StructInitField _t27_orig = (*(*node._v__ast__Expr)._v__ast__StructInit).fields; int _t27_len = _t27_orig.len; @@ -40876,10 +40917,10 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t26 =_t27; return _t26; } - else if ((*node._v__ast__Expr)._typ == 283 /* v.ast.AnonFn */) { + else if ((*node._v__ast__Expr)._typ == 284 /* v.ast.AnonFn */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Stmt_to_sumtype_v__ast__Node(ADDR(v__ast__Stmt, (v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*(*node._v__ast__Expr)._v__ast__AnonFn).decl)))) })); } - else if ((*node._v__ast__Expr)._typ == 291 /* v.ast.CallExpr */) { + else if ((*node._v__ast__Expr)._typ == 292 /* v.ast.CallExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__CallExpr).left) })); Array_v__ast__Node _t32 = {0}; Array_v__ast__CallArg _t32_orig = (*(*node._v__ast__Expr)._v__ast__CallExpr).args; @@ -40894,18 +40935,18 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { _PUSH_MANY(&children, (_t32), _t31, Array_v__ast__Node); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(ADDR(v__ast__Expr, (v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*(*node._v__ast__Expr)._v__ast__CallExpr).or_block)))) })); } - else if ((*node._v__ast__Expr)._typ == 309 /* v.ast.InfixExpr */) { + else if ((*node._v__ast__Expr)._typ == 310 /* v.ast.InfixExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__InfixExpr).left) })); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__InfixExpr).right) })); } - else if ((*node._v__ast__Expr)._typ == 322 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__Expr)._typ == 323 /* v.ast.PrefixExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__PrefixExpr).right) })); } - else if ((*node._v__ast__Expr)._typ == 308 /* v.ast.IndexExpr */) { + else if ((*node._v__ast__Expr)._typ == 309 /* v.ast.IndexExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__IndexExpr).left) })); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__IndexExpr).index) })); } - else if ((*node._v__ast__Expr)._typ == 306 /* v.ast.IfExpr */) { + else if ((*node._v__ast__Expr)._typ == 307 /* v.ast.IfExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__IfExpr).left) })); Array_v__ast__Node _t42 = {0}; Array_v__ast__IfBranch _t42_orig = (*(*node._v__ast__Expr)._v__ast__IfExpr).branches; @@ -40919,7 +40960,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t42), _t41, Array_v__ast__Node); } - else if ((*node._v__ast__Expr)._typ == 315 /* v.ast.MatchExpr */) { + else if ((*node._v__ast__Expr)._typ == 316 /* v.ast.MatchExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__MatchExpr).cond) })); Array_v__ast__Node _t46 = {0}; Array_v__ast__MatchBranch _t46_orig = (*(*node._v__ast__Expr)._v__ast__MatchExpr).branches; @@ -40933,7 +40974,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t46), _t45, Array_v__ast__Node); } - else if ((*node._v__ast__Expr)._typ == 324 /* v.ast.SelectExpr */) { + else if ((*node._v__ast__Expr)._typ == 325 /* v.ast.SelectExpr */) { Array_v__ast__Node _t49 = {0}; Array_v__ast__SelectBranch _t49_orig = (*(*node._v__ast__Expr)._v__ast__SelectExpr).branches; int _t49_len = _t49_orig.len; @@ -40947,10 +40988,10 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t48 =_t49; return _t48; } - else if ((*node._v__ast__Expr)._typ == 293 /* v.ast.ChanInit */) { + else if ((*node._v__ast__Expr)._typ == 294 /* v.ast.ChanInit */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ChanInit).cap_expr) })); } - else if ((*node._v__ast__Expr)._typ == 314 /* v.ast.MapInit */) { + else if ((*node._v__ast__Expr)._typ == 315 /* v.ast.MapInit */) { Array_v__ast__Node _t53 = {0}; Array_v__ast__Expr _t53_orig = (*(*node._v__ast__Expr)._v__ast__MapInit).keys; int _t53_len = _t53_orig.len; @@ -40974,15 +41015,15 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t56), _t55, Array_v__ast__Node); } - else if ((*node._v__ast__Expr)._typ == 323 /* v.ast.RangeExpr */) { + else if ((*node._v__ast__Expr)._typ == 324 /* v.ast.RangeExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__RangeExpr).low) })); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__RangeExpr).high) })); } - else if ((*node._v__ast__Expr)._typ == 292 /* v.ast.CastExpr */) { + else if ((*node._v__ast__Expr)._typ == 293 /* v.ast.CastExpr */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__CastExpr).expr) })); array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__CastExpr).arg) })); } - else if ((*node._v__ast__Expr)._typ == 299 /* v.ast.ConcatExpr */) { + else if ((*node._v__ast__Expr)._typ == 300 /* v.ast.ConcatExpr */) { Array_v__ast__Node _t63 = {0}; Array_v__ast__Expr _t63_orig = (*(*node._v__ast__Expr)._v__ast__ConcatExpr).vals; int _t63_len = _t63_orig.len; @@ -40996,18 +41037,18 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t62 =_t63; return _t62; } - else if ((*node._v__ast__Expr)._typ == 296 /* v.ast.ComptimeCall */) { + else if ((*node._v__ast__Expr)._typ == 297 /* v.ast.ComptimeCall */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ComptimeCall).left) })); } - else if ((*node._v__ast__Expr)._typ == 297 /* v.ast.ComptimeSelector */) { + else if ((*node._v__ast__Expr)._typ == 298 /* v.ast.ComptimeSelector */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Expr)._v__ast__ComptimeSelector).left) })); } else { } ; - } else if ((node)._typ == 359 /* v.ast.Stmt */) { - if ((*node._v__ast__Stmt)._typ == 338 /* v.ast.Block */) { + } else if ((node)._typ == 360 /* v.ast.Stmt */) { + if ((*node._v__ast__Stmt)._typ == 339 /* v.ast.Block */) { Array_v__ast__Node _t68 = {0}; Array_v__ast__Stmt _t68_orig = (*(*node._v__ast__Stmt)._v__ast__Block).stmts; int _t68_len = _t68_orig.len; @@ -41021,7 +41062,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t67 =_t68; return _t67; } - else if ((*node._v__ast__Stmt)._typ == 342 /* v.ast.DeferStmt */) { + else if ((*node._v__ast__Stmt)._typ == 343 /* v.ast.DeferStmt */) { Array_v__ast__Node _t71 = {0}; Array_v__ast__Stmt _t71_orig = (*(*node._v__ast__Stmt)._v__ast__DeferStmt).stmts; int _t71_len = _t71_orig.len; @@ -41035,7 +41076,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t70 =_t71; return _t70; } - else if ((*node._v__ast__Stmt)._typ == 346 /* v.ast.ForCStmt */) { + else if ((*node._v__ast__Stmt)._typ == 347 /* v.ast.ForCStmt */) { Array_v__ast__Node _t74 = {0}; Array_v__ast__Stmt _t74_orig = (*(*node._v__ast__Stmt)._v__ast__ForCStmt).stmts; int _t74_len = _t74_orig.len; @@ -41049,7 +41090,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t73 =_t74; return _t73; } - else if ((*node._v__ast__Stmt)._typ == 347 /* v.ast.ForInStmt */) { + else if ((*node._v__ast__Stmt)._typ == 348 /* v.ast.ForInStmt */) { Array_v__ast__Node _t77 = {0}; Array_v__ast__Stmt _t77_orig = (*(*node._v__ast__Stmt)._v__ast__ForInStmt).stmts; int _t77_len = _t77_orig.len; @@ -41063,7 +41104,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t76 =_t77; return _t76; } - else if ((*node._v__ast__Stmt)._typ == 348 /* v.ast.ForStmt */) { + else if ((*node._v__ast__Stmt)._typ == 349 /* v.ast.ForStmt */) { Array_v__ast__Node _t80 = {0}; Array_v__ast__Stmt _t80_orig = (*(*node._v__ast__Stmt)._v__ast__ForStmt).stmts; int _t80_len = _t80_orig.len; @@ -41077,7 +41118,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t79 =_t80; return _t79; } - else if ((*node._v__ast__Stmt)._typ == 340 /* v.ast.ComptimeFor */) { + else if ((*node._v__ast__Stmt)._typ == 341 /* v.ast.ComptimeFor */) { Array_v__ast__Node _t83 = {0}; Array_v__ast__Stmt _t83_orig = (*(*node._v__ast__Stmt)._v__ast__ComptimeFor).stmts; int _t83_len = _t83_orig.len; @@ -41091,13 +41132,13 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t82 =_t83; return _t82; } - else if ((*node._v__ast__Stmt)._typ == 345 /* v.ast.ExprStmt */) { + else if ((*node._v__ast__Stmt)._typ == 346 /* v.ast.ExprStmt */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Stmt)._v__ast__ExprStmt).expr) })); } - else if ((*node._v__ast__Stmt)._typ == 336 /* v.ast.AssertStmt */) { + else if ((*node._v__ast__Stmt)._typ == 337 /* v.ast.AssertStmt */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__Stmt)._v__ast__AssertStmt).expr) })); } - else if ((*node._v__ast__Stmt)._typ == 354 /* v.ast.InterfaceDecl */) { + else if ((*node._v__ast__Stmt)._typ == 355 /* v.ast.InterfaceDecl */) { Array_v__ast__Node _t88 = {0}; Array_v__ast__FnDecl _t88_orig = (*(*node._v__ast__Stmt)._v__ast__InterfaceDecl).methods; int _t88_len = _t88_orig.len; @@ -41121,7 +41162,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t91), _t90, Array_v__ast__Node); } - else if ((*node._v__ast__Stmt)._typ == 337 /* v.ast.AssignStmt */) { + else if ((*node._v__ast__Stmt)._typ == 338 /* v.ast.AssignStmt */) { Array_v__ast__Node _t94 = {0}; Array_v__ast__Expr _t94_orig = (*(*node._v__ast__Stmt)._v__ast__AssignStmt).left; int _t94_len = _t94_orig.len; @@ -41145,7 +41186,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t97), _t96, Array_v__ast__Node); } - else if ((*node._v__ast__Stmt)._typ == 356 /* v.ast.Return */) { + else if ((*node._v__ast__Stmt)._typ == 357 /* v.ast.Return */) { Array_v__ast__Node _t100 = {0}; Array_v__ast__Expr _t100_orig = (*(*node._v__ast__Stmt)._v__ast__Return).exprs; int _t100_len = _t100_orig.len; @@ -41159,7 +41200,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t99 =_t100; return _t99; } - else if ((*node._v__ast__Stmt)._typ == 358 /* v.ast.StructDecl */) { + else if ((*node._v__ast__Stmt)._typ == 359 /* v.ast.StructDecl */) { Array_v__ast__Node _t103 = {0}; Array_v__ast__StructField _t103_orig = (*(*node._v__ast__Stmt)._v__ast__StructDecl).fields; int _t103_len = _t103_orig.len; @@ -41173,7 +41214,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t102 =_t103; return _t102; } - else if ((*node._v__ast__Stmt)._typ == 349 /* v.ast.GlobalDecl */) { + else if ((*node._v__ast__Stmt)._typ == 350 /* v.ast.GlobalDecl */) { Array_v__ast__Node _t106 = {0}; Array_v__ast__GlobalField _t106_orig = (*(*node._v__ast__Stmt)._v__ast__GlobalDecl).fields; int _t106_len = _t106_orig.len; @@ -41187,7 +41228,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t105 =_t106; return _t105; } - else if ((*node._v__ast__Stmt)._typ == 341 /* v.ast.ConstDecl */) { + else if ((*node._v__ast__Stmt)._typ == 342 /* v.ast.ConstDecl */) { Array_v__ast__Node _t109 = {0}; Array_v__ast__ConstField _t109_orig = (*(*node._v__ast__Stmt)._v__ast__ConstDecl).fields; int _t109_len = _t109_orig.len; @@ -41201,7 +41242,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t108 =_t109; return _t108; } - else if ((*node._v__ast__Stmt)._typ == 344 /* v.ast.EnumDecl */) { + else if ((*node._v__ast__Stmt)._typ == 345 /* v.ast.EnumDecl */) { Array_v__ast__Node _t112 = {0}; Array_v__ast__EnumField _t112_orig = (*(*node._v__ast__Stmt)._v__ast__EnumDecl).fields; int _t112_len = _t112_orig.len; @@ -41215,7 +41256,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t111 =_t112; return _t111; } - else if ((*node._v__ast__Stmt)._typ == 218 /* v.ast.FnDecl */) { + else if ((*node._v__ast__Stmt)._typ == 219 /* v.ast.FnDecl */) { if ((*(*node._v__ast__Stmt)._v__ast__FnDecl).is_method) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__StructField_to_sumtype_v__ast__Node(&(*(*node._v__ast__Stmt)._v__ast__FnDecl).receiver) })); } @@ -41242,8 +41283,8 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t119), _t118, Array_v__ast__Node); } - else if ((*node._v__ast__Stmt)._typ == 282 /* v.ast.TypeDecl */) { - if (((*(*node._v__ast__Stmt)._v__ast__TypeDecl))._typ == 281 /* v.ast.SumTypeDecl */) { + else if ((*node._v__ast__Stmt)._typ == 283 /* v.ast.TypeDecl */) { + if (((*(*node._v__ast__Stmt)._v__ast__TypeDecl))._typ == 282 /* v.ast.SumTypeDecl */) { Array_v__ast__Node _t122 = {0}; Array_v__ast__TypeNode _t122_orig = (*(*(*node._v__ast__Stmt)._v__ast__TypeDecl)._v__ast__SumTypeDecl).variants; int _t122_len = _t122_orig.len; @@ -41261,36 +41302,36 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { else { } ; - } else if ((node)._typ == 364 /* v.ast.ScopeObject */) { - if ((*node._v__ast__ScopeObject)._typ == 362 /* v.ast.GlobalField */) { + } else if ((node)._typ == 365 /* v.ast.ScopeObject */) { + if ((*node._v__ast__ScopeObject)._typ == 363 /* v.ast.GlobalField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__ScopeObject)._v__ast__GlobalField).expr) })); } - else if ((*node._v__ast__ScopeObject)._typ == 361 /* v.ast.ConstField */) { + else if ((*node._v__ast__ScopeObject)._typ == 362 /* v.ast.ConstField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__ScopeObject)._v__ast__ConstField).expr) })); } - else if ((*node._v__ast__ScopeObject)._typ == 363 /* v.ast.Var */) { + else if ((*node._v__ast__ScopeObject)._typ == 364 /* v.ast.Var */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*(*node._v__ast__ScopeObject)._v__ast__Var).expr) })); } - else if ((*node._v__ast__ScopeObject)._typ == 360 /* v.ast.AsmRegister */) { + else if ((*node._v__ast__ScopeObject)._typ == 361 /* v.ast.AsmRegister */) { } ; } else { - if (node._typ == 362 /* v.ast.GlobalField */) { + if (node._typ == 363 /* v.ast.GlobalField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__GlobalField).expr) })); } - else if (node._typ == 361 /* v.ast.ConstField */) { + else if (node._typ == 362 /* v.ast.ConstField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__ConstField).expr) })); } - else if (node._typ == 367 /* v.ast.EnumField */) { + else if (node._typ == 368 /* v.ast.EnumField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__EnumField).expr) })); } - else if (node._typ == 373 /* v.ast.StructInitField */) { + else if (node._typ == 374 /* v.ast.StructInitField */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__StructInitField).expr) })); } - else if (node._typ == 365 /* v.ast.CallArg */) { + else if (node._typ == 366 /* v.ast.CallArg */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Expr_to_sumtype_v__ast__Node(&(*node._v__ast__CallArg).expr) })); } - else if (node._typ == 371 /* v.ast.SelectBranch */) { + else if (node._typ == 372 /* v.ast.SelectBranch */) { array_push((array*)&children, _MOV((v__ast__Node[]){ v__ast__Stmt_to_sumtype_v__ast__Node(&(*node._v__ast__SelectBranch).stmt) })); Array_v__ast__Node _t134 = {0}; Array_v__ast__Stmt _t134_orig = (*node._v__ast__SelectBranch).stmts; @@ -41304,7 +41345,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { } _PUSH_MANY(&children, (_t134), _t133, Array_v__ast__Node); } - else if (node._typ == 368 /* v.ast.IfBranch */) { + else if (node._typ == 369 /* v.ast.IfBranch */) { Array_v__ast__Node _t137 = {0}; Array_v__ast__Stmt _t137_orig = (*node._v__ast__IfBranch).stmts; int _t137_len = _t137_orig.len; @@ -41318,7 +41359,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t136 =_t137; return _t136; } - else if (node._typ == 209 /* v.ast.File */) { + else if (node._typ == 210 /* v.ast.File */) { Array_v__ast__Node _t140 = {0}; Array_v__ast__Stmt _t140_orig = (*node._v__ast__File).stmts; int _t140_len = _t140_orig.len; @@ -41332,7 +41373,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { Array_v__ast__Node _t139 =_t140; return _t139; } - else if (node._typ == 369 /* v.ast.MatchBranch */) { + else if (node._typ == 370 /* v.ast.MatchBranch */) { Array_v__ast__Node _t143 = {0}; Array_v__ast__Stmt _t143_orig = (*node._v__ast__MatchBranch).stmts; int _t143_len = _t143_orig.len; @@ -41367,7 +41408,7 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { void v__ast__IndexExpr_recursive_mapset_is_setter(v__ast__IndexExpr* lx, bool val) { lx->is_setter = val; - if ((lx->left)._typ == 308 /* v.ast.IndexExpr */) { + if ((lx->left)._typ == 309 /* v.ast.IndexExpr */) { if ((*lx->left._v__ast__IndexExpr).is_map) { v__ast__IndexExpr_recursive_mapset_is_setter(&(*lx->left._v__ast__IndexExpr), val); } @@ -41376,10 +41417,10 @@ void v__ast__IndexExpr_recursive_mapset_is_setter(v__ast__IndexExpr* lx, bool va void v__ast__IndexExpr_recursive_arraymap_set_is_setter(v__ast__IndexExpr* lx) { lx->is_setter = true; - if ((lx->left)._typ == 308 /* v.ast.IndexExpr */) { + if ((lx->left)._typ == 309 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*lx->left._v__ast__IndexExpr)); - } else if ((lx->left)._typ == 325 /* v.ast.SelectorExpr */) { - if (((*lx->left._v__ast__SelectorExpr).expr)._typ == 308 /* v.ast.IndexExpr */) { + } else if ((lx->left)._typ == 326 /* v.ast.SelectorExpr */) { + if (((*lx->left._v__ast__SelectorExpr).expr)._typ == 309 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*(*lx->left._v__ast__SelectorExpr).expr._v__ast__IndexExpr)); } } @@ -41440,7 +41481,7 @@ Map_string_v__ast__ScopeObject v__ast__all_registers(v__ast__Table* t, v__pref__ } int hash_index = (*(int*)_t11.data); - string assembled_name = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = string_substr(name, 0, hash_index)}}, {_SLIT0, 0xfe07, {.d_i32 = i}}, {_SLIT0, 0xfe10, {.d_s = string_substr(name, hash_index + 1, (name).len)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string assembled_name = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(name, 0, hash_index)}}, {_SLIT0, /*100 &int literal*/0xfe07, {.d_i32 = i}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(name, hash_index + 1, (name).len)}}, {_SLIT0, 0, { .d_c = 0 }}})); map_set(&res, &(string[]){assembled_name}, &(v__ast__ScopeObject[]) { v__ast__AsmRegister_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__AsmRegister, (((v__ast__AsmRegister){.name = assembled_name,.typ = v__ast__Table_bitsize_to_type(t, bit_size),.size = bit_size,})))) }); } } @@ -41568,7 +41609,7 @@ VV_LOCAL_SYMBOL Map_string_v__ast__ScopeObject v__ast__gen_all_registers(v__ast_ } int hash_index = (*(int*)_t5.data); - string assembled_name = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = string_substr(name, 0, hash_index)}}, {_SLIT0, 0xfe07, {.d_i32 = i}}, {_SLIT0, 0xfe10, {.d_s = string_substr(name, hash_index + 1, (name).len)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string assembled_name = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(name, 0, hash_index)}}, {_SLIT0, /*100 &int literal*/0xfe07, {.d_i32 = i}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(name, hash_index + 1, (name).len)}}, {_SLIT0, 0, { .d_c = 0 }}})); map_set(&res, &(string[]){assembled_name}, &(v__ast__ScopeObject[]) { v__ast__AsmRegister_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__AsmRegister, (((v__ast__AsmRegister){.name = assembled_name,.typ = v__ast__Table_bitsize_to_type(t, bit_size),.size = bit_size,})))) }); } } @@ -41577,43 +41618,43 @@ VV_LOCAL_SYMBOL Map_string_v__ast__ScopeObject v__ast__gen_all_registers(v__ast_ } bool v__ast__Expr_is_literal(v__ast__Expr expr) { - if (expr._typ == 289 /* v.ast.BoolLiteral */) { + if (expr._typ == 290 /* v.ast.BoolLiteral */) { bool _t1 = true; return _t1; } - else if (expr._typ == 294 /* v.ast.CharLiteral */) { + else if (expr._typ == 295 /* v.ast.CharLiteral */) { bool _t2 = true; return _t2; } - else if (expr._typ == 303 /* v.ast.FloatLiteral */) { + else if (expr._typ == 304 /* v.ast.FloatLiteral */) { bool _t3 = true; return _t3; } - else if (expr._typ == 310 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { bool _t4 = true; return _t4; } - else if (expr._typ == 322 /* v.ast.PrefixExpr */) { + else if (expr._typ == 323 /* v.ast.PrefixExpr */) { bool _t5 = v__ast__Expr_is_literal((*expr._v__ast__PrefixExpr).right); return _t5; } - else if (expr._typ == 309 /* v.ast.InfixExpr */) { + else if (expr._typ == 310 /* v.ast.InfixExpr */) { bool _t6 = v__ast__Expr_is_literal((*expr._v__ast__InfixExpr).left) && v__ast__Expr_is_literal((*expr._v__ast__InfixExpr).right); return _t6; } - else if (expr._typ == 320 /* v.ast.ParExpr */) { + else if (expr._typ == 321 /* v.ast.ParExpr */) { bool _t7 = v__ast__Expr_is_literal((*expr._v__ast__ParExpr).expr); return _t7; } - else if (expr._typ == 292 /* v.ast.CastExpr */) { + else if (expr._typ == 293 /* v.ast.CastExpr */) { bool _t8 = !(*expr._v__ast__CastExpr).has_arg && v__ast__Expr_is_literal((*expr._v__ast__CastExpr).expr) && (v__ast__Type_is_ptr((*expr._v__ast__CastExpr).typ) || v__ast__Type_is_pointer((*expr._v__ast__CastExpr).typ) || (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i8_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i16_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__int_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i64_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__byte_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u16_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u32_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u64_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__f32_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__f64_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__char_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__bool_type) || v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__rune_type))); return _t8; } - else if (expr._typ == 326 /* v.ast.SizeOf */) { + else if (expr._typ == 327 /* v.ast.SizeOf */) { bool _t9 = (*expr._v__ast__SizeOf).is_type || v__ast__Expr_is_literal((*expr._v__ast__SizeOf).expr); return _t9; } - else if (expr._typ == 311 /* v.ast.IsRefType */) { + else if (expr._typ == 312 /* v.ast.IsRefType */) { bool _t10 = (*expr._v__ast__IsRefType).is_type || v__ast__Expr_is_literal((*expr._v__ast__IsRefType).expr); return _t10; } @@ -41653,7 +41694,7 @@ VV_LOCAL_SYMBOL v__token__KeywordsMatcher v__ast__build_builtin_type_names_match } string v__ast__Attr_debug(v__ast__Attr* a) { - string _t1 = str_intp(8, _MOV((StrIntpData[]){{_SLIT("Attr{ name: \""), 0xfe10, {.d_s = a->name}}, {_SLIT("\", has_arg: "), 0xfe10, {.d_s = a->has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", arg: \""), 0xfe10, {.d_s = a->arg}}, {_SLIT("\", kind: "), 0xfe10, {.d_s = v__ast__AttrKind_str(a->kind)}}, {_SLIT(", ct_expr: "), 0xfe10, {.d_s = v__ast__Expr_str(a->ct_expr)}}, {_SLIT(", ct_opt: "), 0xfe10, {.d_s = a->ct_opt ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", ct_skip: "), 0xfe10, {.d_s = a->ct_skip ? _SLIT("true") : _SLIT("false")}}, {_SLIT("}"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(8, _MOV((StrIntpData[]){{_SLIT("Attr{ name: \""), /*115 &string*/0xfe10, {.d_s = a->name}}, {_SLIT("\", has_arg: "), /*115 &bool*/0xfe10, {.d_s = a->has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", arg: \""), /*115 &string*/0xfe10, {.d_s = a->arg}}, {_SLIT("\", kind: "), /*115 &v.ast.AttrKind*/0xfe10, {.d_s = v__ast__AttrKind_str(a->kind)}}, {_SLIT(", ct_expr: "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(a->ct_expr)}}, {_SLIT(", ct_opt: "), /*115 &bool*/0xfe10, {.d_s = a->ct_opt ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", ct_skip: "), /*115 &bool*/0xfe10, {.d_s = a->ct_skip ? _SLIT("true") : _SLIT("false")}}, {_SLIT("}"), 0, { .d_c = 0 }}})); return _t1; } @@ -41661,13 +41702,13 @@ string v__ast__Attr_str(v__ast__Attr* a) { string s = _SLIT(""); string _t1; /* if prepend */ if (a->has_arg) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = a->name}}, {_SLIT(": "), 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = a->name}}, {_SLIT(": "), 0, { .d_c = 0 }}}))); _t1 = a->arg; } else { _t1 = a->name; } string arg = _t1; - s = /*f*/string__plus(s, ((a->kind == (v__ast__AttrKind__plain) || a->kind == (v__ast__AttrKind__number) || a->kind == (v__ast__AttrKind__bool)) ? (arg) : (a->kind == (v__ast__AttrKind__string)) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = arg}}, {_SLIT("'"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("if "), 0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}}))))); + s = /*f*/string__plus(s, ((a->kind == (v__ast__AttrKind__plain) || a->kind == (v__ast__AttrKind__number) || a->kind == (v__ast__AttrKind__bool)) ? (arg) : (a->kind == (v__ast__AttrKind__string)) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT("'"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("if "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}}))))); string _t2 = s; return _t2; } @@ -41780,7 +41821,7 @@ Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, } if (((string__eq(name, _SLIT("-I")) || string__eq(name, _SLIT("-l")) || string__eq(name, _SLIT("-L")))) && (value).len == 0) { string hint = (string__eq(name, _SLIT("-l")) ? (_SLIT("library name")) : (_SLIT("path"))); - return (Option_bool){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT("bad #flag `"), 0xfe10, {.d_s = flag_orig}}, {_SLIT("`: missing "), 0xfe10, {.d_s = hint}}, {_SLIT(" after `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_bool){ .state=2, .err=_v_error( str_intp(4, _MOV((StrIntpData[]){{_SLIT("bad #flag `"), /*115 &string*/0xfe10, {.d_s = flag_orig}}, {_SLIT("`: missing "), /*115 &string*/0xfe10, {.d_s = hint}}, {_SLIT(" after `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__cflag__CFlag cf = ((v__cflag__CFlag){.mod = mod,.os = fos,.name = name,.value = value,.cached = (string){.str=(byteptr)"", .is_lit=1},}); if (!v__ast__Table_has_cflag(t, cf)) { @@ -41919,7 +41960,7 @@ Option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val) { opt_ok(&(i64[]) { ((int)((*val._rune))) }, (Option*)(&_t12), sizeof(i64)); return _t12; } - else if (val._typ == 301 /* v.ast.EmptyExpr */) { + else if (val._typ == 302 /* v.ast.EmptyExpr */) { } ; return (Option_i64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -42046,7 +42087,7 @@ Option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val) { } else if (val._typ == 21 /* rune */) { } - else if (val._typ == 301 /* v.ast.EmptyExpr */) { + else if (val._typ == 302 /* v.ast.EmptyExpr */) { } ; return (Option_u64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -42124,7 +42165,7 @@ Option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val) { } else if (val._typ == 21 /* rune */) { } - else if (val._typ == 301 /* v.ast.EmptyExpr */) { + else if (val._typ == 302 /* v.ast.EmptyExpr */) { } ; return (Option_f64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -42191,14 +42232,14 @@ Option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val opt_ok(&(string[]) { (*val._string) }, (Option*)(&_t12), sizeof(string)); return _t12; } - else if (val._typ == 301 /* v.ast.EmptyExpr */) { + else if (val._typ == 302 /* v.ast.EmptyExpr */) { } ; return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast__ConstField* obj) { - if ((obj->comptime_expr_value)._typ != 301 /* v.ast.EmptyExpr */) { + if ((obj->comptime_expr_value)._typ != 302 /* v.ast.EmptyExpr */) { Option_v__ast__ComptTimeConstValue _t1; opt_ok(&(v__ast__ComptTimeConstValue[]) { obj->comptime_expr_value }, (Option*)(&_t1), sizeof(v__ast__ComptTimeConstValue)); return _t1; @@ -42207,12 +42248,12 @@ Option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast } bool v__ast__ConstField_is_simple_define_const(v__ast__ConstField* obj) { - bool _t1 = ((obj->expr._typ == 294 /* v.ast.CharLiteral */) ? (true) : (obj->expr._typ == 303 /* v.ast.FloatLiteral */) ? (true) : (obj->expr._typ == 310 /* v.ast.IntegerLiteral */) ? (true) : (false)); + bool _t1 = ((obj->expr._typ == 295 /* v.ast.CharLiteral */) ? (true) : (obj->expr._typ == 304 /* v.ast.FloatLiteral */) ? (true) : (obj->expr._typ == 311 /* v.ast.IntegerLiteral */) ? (true) : (false)); return _t1; } bool v__ast__ScopeObject_is_simple_define_const(v__ast__ScopeObject obj) { - if ((obj)._typ == 361 /* v.ast.ConstField */) { + if ((obj)._typ == 362 /* v.ast.ConstField */) { bool _t1 = v__ast__ConstField_is_simple_define_const(&(*obj._v__ast__ConstField)); return _t1; } @@ -42221,14 +42262,14 @@ bool v__ast__ScopeObject_is_simple_define_const(v__ast__ScopeObject obj) { } u64 v__ast__EmbeddedFile_hash(v__ast__EmbeddedFile e) { - u64 _t1 = hash__fnv1a__sum64_string( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = e.apath}}, {_SLIT(", "), 0xfe10, {.d_s = e.compression_type}}, {_SLIT(", "), 0xfe10, {.d_s = e.is_compressed ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0xfe07, {.d_i32 = e.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); + u64 _t1 = hash__fnv1a__sum64_string( str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = e.apath}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = e.compression_type}}, {_SLIT(", "), /*115 &bool*/0xfe10, {.d_s = e.is_compressed ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = e.len}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t1; } v__ast__Expr v__ast__resolve_init(v__ast__StructInit node, v__ast__Type typ, v__ast__Table* t) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(t, typ); if (type_sym->kind == v__ast__Kind__array) { - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; bool has_len = false; bool has_cap = false; bool has_default = false; @@ -42278,7 +42319,7 @@ v__ast__Expr v__ast__resolve_init(v__ast__StructInit node, v__ast__Type typ, v__ })))); return _t3; } else if (type_sym->kind == v__ast__Kind__map) { - v__ast__Map map_info = /* as */ *(v__ast__Map*)__as_cast((type_sym->info)._v__ast__Map,(type_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map map_info = /* as */ *(v__ast__Map*)__as_cast((type_sym->info)._v__ast__Map,(type_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; Array_v__ast__Expr keys = __new_array_with_default(0, 0, sizeof(v__ast__Expr), 0); Array_v__ast__Expr vals = __new_array_with_default(0, 0, sizeof(v__ast__Expr), 0); for (int _t4 = 0; _t4 < node.fields.len; ++_t4) { @@ -42354,7 +42395,7 @@ Option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name) { Option_v__ast__ScopeObject _t1; if (_t1 = v__ast__Scope_find(s, name), _t1.state == 0) { v__ast__ScopeObject* obj = HEAP(v__ast__ScopeObject, *(v__ast__ScopeObject*)_t1.data); - if ((*(obj))._typ == 363 /* v.ast.Var */) { + if ((*(obj))._typ == 364 /* v.ast.Var */) { Option_v__ast__Var_ptr _t2; opt_ok(&(v__ast__Var*[]) { &(*((obj->_v__ast__Var))) }, (Option*)(&_t2), sizeof(v__ast__Var*)); return _t2; @@ -42371,7 +42412,7 @@ Option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, strin Option_v__ast__ScopeObject _t1; if (_t1 = v__ast__Scope_find(s, name), _t1.state == 0) { v__ast__ScopeObject* obj = HEAP(v__ast__ScopeObject, *(v__ast__ScopeObject*)_t1.data); - if ((*(obj))._typ == 362 /* v.ast.GlobalField */) { + if ((*(obj))._typ == 363 /* v.ast.GlobalField */) { Option_v__ast__GlobalField_ptr _t2; opt_ok(&(v__ast__GlobalField*[]) { &(*((obj->_v__ast__GlobalField))) }, (Option*)(&_t2), sizeof(v__ast__GlobalField*)); return _t2; @@ -42388,7 +42429,7 @@ Option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string Option_v__ast__ScopeObject _t1; if (_t1 = v__ast__Scope_find(s, name), _t1.state == 0) { v__ast__ScopeObject* obj = HEAP(v__ast__ScopeObject, *(v__ast__ScopeObject*)_t1.data); - if ((*(obj))._typ == 361 /* v.ast.ConstField */) { + if ((*(obj))._typ == 362 /* v.ast.ConstField */) { Option_v__ast__ConstField_ptr _t2; opt_ok(&(v__ast__ConstField*[]) { &(*((obj->_v__ast__ConstField))) }, (Option*)(&_t2), sizeof(v__ast__ConstField*)); return _t2; @@ -42429,7 +42470,7 @@ bool v__ast__Scope_known_const(v__ast__Scope* s, string name) { void v__ast__Scope_update_var_type(v__ast__Scope* s, string name, v__ast__Type typ) { v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)map_get(ADDR(map, s->objects), &(string[]){name}, &(v__ast__ScopeObject[]){ {0} })); - if ((obj)._typ == 363 /* v.ast.Var */) { + if ((obj)._typ == 364 /* v.ast.Var */) { if (!v__ast__Type_alias_eq((*obj._v__ast__Var).typ, typ)) { (*obj._v__ast__Var).typ = typ; } @@ -42507,7 +42548,7 @@ bool v__ast__Scope_has_inherited_vars(v__ast__Scope* s) { } if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)DenseArray_value(&_t1.key_values, _t2)); - if ((obj)._typ == 363 /* v.ast.Var */) { + if ((obj)._typ == 364 /* v.ast.Var */) { if ((*obj._v__ast__Var).is_inherited) { bool _t5 = true; return _t5; @@ -42525,7 +42566,7 @@ v__ast__Scope* sc = HEAP(v__ast__Scope, _v_toheap_sc); for (int _t1 = 0; _t1 < depth * 4; ++_t1) { indent = /*f*/string__plus(indent, _SLIT(" ")); } - out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = indent}}, {_SLIT("# "), 0xfe07, {.d_i32 = (*(sc)).start_pos}}, {_SLIT(" - "), 0xfe07, {.d_i32 = (*(sc)).end_pos}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = indent}}, {_SLIT("# "), /*100 &int*/0xfe07, {.d_i32 = (*(sc)).start_pos}}, {_SLIT(" - "), /*100 &int*/0xfe07, {.d_i32 = (*(sc)).end_pos}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); Map_string_v__ast__ScopeObject _t2 = (*(sc)).objects; int _t4 = _t2.key_values.len; for (int _t3 = 0; _t3 < _t4; ++_t3 ) { @@ -42537,11 +42578,11 @@ v__ast__Scope* sc = HEAP(v__ast__Scope, _v_toheap_sc); } if (!DenseArray_has_index(&_t2.key_values, _t3)) {continue;} v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)DenseArray_value(&_t2.key_values, _t3)); - if (obj._typ == 361 /* v.ast.ConstField */) { - out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = indent}}, {_SLIT(" * const: "), 0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT(" - "), 0xfe10, {.d_s = v__ast__Type_str((*obj._v__ast__ConstField).typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + if (obj._typ == 362 /* v.ast.ConstField */) { + out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = indent}}, {_SLIT(" * const: "), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT(" - "), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str((*obj._v__ast__ConstField).typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); } - else if (obj._typ == 363 /* v.ast.Var */) { - out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = indent}}, {_SLIT(" * var: "), 0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT(" - "), 0xfe10, {.d_s = v__ast__Type_str((*obj._v__ast__Var).typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + else if (obj._typ == 364 /* v.ast.Var */) { + out = /*f*/string__plus(out, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = indent}}, {_SLIT(" * var: "), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT(" - "), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str((*obj._v__ast__Var).typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); } else { @@ -42559,7 +42600,7 @@ v__ast__Scope* sc = HEAP(v__ast__Scope, _v_toheap_sc); } if (!DenseArray_has_index(&_t6.key_values, _t7)) {continue;} v__ast__ScopeStructField field = (*(v__ast__ScopeStructField*)DenseArray_value(&_t6.key_values, _t7)); - out = /*f*/string__plus(out, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = indent}}, {_SLIT(" * struct_field: "), 0xfe10, {.d_s = v__ast__Type_str(field.struct_type)}}, {_SLIT(" "), 0xfe10, {.d_s = field.name}}, {_SLIT(" - "), 0xfe10, {.d_s = v__ast__Type_str(field.typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + out = /*f*/string__plus(out, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = indent}}, {_SLIT(" * struct_field: "), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(field.struct_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" - "), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(field.typ)}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); } if (max_depth == 0 || depth < max_depth - 1) { for (int i = 0; i < (*(sc)).children.len; ++i) { @@ -42591,7 +42632,7 @@ string v__ast__FnDecl_modname(v__ast__FnDecl* node) { string v__ast__FnDecl_fkey(v__ast__FnDecl* node) { if (node->is_method) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(node->receiver.typ))}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(node->receiver.typ))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string _t2 = node->name; @@ -42600,7 +42641,7 @@ string v__ast__FnDecl_fkey(v__ast__FnDecl* node) { string v__ast__Fn_fkey(v__ast__Fn* node) { if (node->is_method) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(node->receiver_type))}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(node->receiver_type))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string _t2 = node->name; @@ -42609,7 +42650,7 @@ string v__ast__Fn_fkey(v__ast__Fn* node) { string v__ast__CallExpr_fkey(v__ast__CallExpr* node) { if (node->is_method) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(node->receiver_type))}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(node->receiver_type))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string _t2 = node->name; @@ -42673,7 +42714,7 @@ VV_LOCAL_SYMBOL void v__ast__stringify_fn_after_name(v__ast__FnDecl* node, strin if (node->generic_names.len > 0) { if (node->is_method) { v__ast__TypeSymbol* sym = v__ast__Table_sym(t, (*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 0)).typ); - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { Array_string _t1 = {0}; Array_v__ast__Type _t1_orig = (*sym->info._v__ast__Struct).generic_types; int _t1_len = _t1_orig.len; @@ -42794,24 +42835,24 @@ multi_return_string_bool v__ast__StringInterLiteral_get_fspec_braces(v__ast__Str if (!needs_braces) { v__ast__Expr sub_expr = (*(v__ast__Expr*)/*ee elem_sym */array_get(lit->exprs, i)); for (;;) { - if (sub_expr._typ == 305 /* v.ast.Ident */) { + if (sub_expr._typ == 306 /* v.ast.Ident */) { if (string_at((*sub_expr._v__ast__Ident).name, 0) == '@') { needs_braces = true; } break; } - else if (sub_expr._typ == 291 /* v.ast.CallExpr */) { - if ((*sub_expr._v__ast__CallExpr).args.len != 0 || (*sub_expr._v__ast__CallExpr).concrete_types.len != 0 || (*sub_expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate || (*sub_expr._v__ast__CallExpr).or_block.stmts.len > 0) { + else if (sub_expr._typ == 292 /* v.ast.CallExpr */) { + if ((*sub_expr._v__ast__CallExpr).args.len != 0 || (*sub_expr._v__ast__CallExpr).concrete_types.len != 0 || (*sub_expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option || (*sub_expr._v__ast__CallExpr).or_block.stmts.len > 0) { needs_braces = true; - } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 291 /* v.ast.CallExpr */) { + } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 292 /* v.ast.CallExpr */) { sub_expr = (*sub_expr._v__ast__CallExpr).left; continue; - } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 292 /* v.ast.CastExpr */ || ((*sub_expr._v__ast__CallExpr).left)._typ == 308 /* v.ast.IndexExpr */) { + } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 293 /* v.ast.CastExpr */ || ((*sub_expr._v__ast__CallExpr).left)._typ == 309 /* v.ast.IndexExpr */) { needs_braces = true; } break; } - else if (sub_expr._typ == 325 /* v.ast.SelectorExpr */) { + else if (sub_expr._typ == 326 /* v.ast.SelectorExpr */) { if (string_at((*sub_expr._v__ast__SelectorExpr).field_name, 0) == '@') { needs_braces = true; break; @@ -42836,112 +42877,112 @@ multi_return_string_bool v__ast__StringInterLiteral_get_fspec_braces(v__ast__Str array_push((array*)&res, _MOV((string[]){ string_clone(_SLIT("0")) })); } if ((*(int*)/*ee elem_sym */array_get(lit->fwidths, i)) != 0) { - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = (*(int*)/*ee elem_sym */array_get(lit->fwidths, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = (*(int*)/*ee elem_sym */array_get(lit->fwidths, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((*(int*)/*ee elem_sym */array_get(lit->precisions, i)) != 987698) { - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe07, {.d_i32 = (*(int*)/*ee elem_sym */array_get(lit->precisions, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*100 &int*/0xfe07, {.d_i32 = (*(int*)/*ee elem_sym */array_get(lit->precisions, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((*(bool*)/*ee elem_sym */array_get(lit->need_fmts, i))) { - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe01, {.d_c = (*(u8*)/*ee elem_sym */array_get(lit->fmts, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*99 &u8*/0xfe01, {.d_c = (*(u8*)/*ee elem_sym */array_get(lit->fmts, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } return (multi_return_string_bool){.arg0=Array_string_join(res, _SLIT("")), .arg1=needs_braces}; } string v__ast__Expr_str(v__ast__Expr x) { - if (x._typ == 283 /* v.ast.AnonFn */) { + if (x._typ == 284 /* v.ast.AnonFn */) { string _t1 = _SLIT("anon_fn"); return _t1; } - else if (x._typ == 298 /* v.ast.ComptimeType */) { + else if (x._typ == 299 /* v.ast.ComptimeType */) { string _t2 = v__ast__ComptimeType_str((*x._v__ast__ComptimeType)); return _t2; } - else if (x._typ == 300 /* v.ast.DumpExpr */) { - string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("dump("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__DumpExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 301 /* v.ast.DumpExpr */) { + string _t3 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("dump("), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__DumpExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t3; } - else if (x._typ == 285 /* v.ast.ArrayInit */) { + else if (x._typ == 286 /* v.ast.ArrayInit */) { Array_string fields = __new_array_with_default(0, 0, sizeof(string), 0); if ((*x._v__ast__ArrayInit).has_len) { - array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("len: "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).len_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("len: "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).len_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((*x._v__ast__ArrayInit).has_cap) { - array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cap: "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).cap_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cap: "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).cap_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if ((*x._v__ast__ArrayInit).has_default) { - array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("init: "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).default_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&fields, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("init: "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).default_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } if (fields.len > 0) { - string _t7 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[]T{"), 0xfe10, {.d_s = Array_string_join(fields, _SLIT(", "))}}, {_SLIT("}"), 0, { .d_c = 0 }}})); + string _t7 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[]T{"), /*115 &string*/0xfe10, {.d_s = Array_string_join(fields, _SLIT(", "))}}, {_SLIT("}"), 0, { .d_c = 0 }}})); return _t7; } else { string _t8 = Array_v__ast__Expr_str((*x._v__ast__ArrayInit).exprs); return _t8; } } - else if (x._typ == 286 /* v.ast.AsCast */) { - string _t9 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__AsCast).expr)}}, {_SLIT(" as "), 0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__AsCast).typ)}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 287 /* v.ast.AsCast */) { + string _t9 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__AsCast).expr)}}, {_SLIT(" as "), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__AsCast).typ)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t9; } - else if (x._typ == 288 /* v.ast.AtExpr */) { - string _t10 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__AtExpr).val}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 289 /* v.ast.AtExpr */) { + string _t10 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__AtExpr).val}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t10; } - else if (x._typ == 290 /* v.ast.CTempVar */) { + else if (x._typ == 291 /* v.ast.CTempVar */) { string _t11 = v__ast__Expr_str((*x._v__ast__CTempVar).orig); return _t11; } - else if (x._typ == 289 /* v.ast.BoolLiteral */) { + else if (x._typ == 290 /* v.ast.BoolLiteral */) { string _t12 = bool_str((*x._v__ast__BoolLiteral).val); return _t12; } - else if (x._typ == 292 /* v.ast.CastExpr */) { - string _t13 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CastExpr).typname}}, {_SLIT("("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__CastExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 293 /* v.ast.CastExpr */) { + string _t13 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CastExpr).typname}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__CastExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t13; } - else if (x._typ == 291 /* v.ast.CallExpr */) { + else if (x._typ == 292 /* v.ast.CallExpr */) { string sargs = v__ast__args2str((*x._v__ast__CallExpr).args); - string propagate_suffix = ((*x._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate ? (_SLIT(" ?")) : (_SLIT(""))); + string propagate_suffix = ((*x._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option ? (_SLIT(" ?")) : (_SLIT(""))); if ((*x._v__ast__CallExpr).is_method) { - string _t14 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__CallExpr).left)}}, {_SLIT("."), 0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t14 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__CallExpr).left)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t14; } - if (string_starts_with((*x._v__ast__CallExpr).name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CallExpr).mod}}, {_SLIT("."), 0, { .d_c = 0 }}})))) { - string _t15 = v__util__strip_main_name( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + if (string_starts_with((*x._v__ast__CallExpr).name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).mod}}, {_SLIT("."), 0, { .d_c = 0 }}})))) { + string _t15 = v__util__strip_main_name( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t15; } if (((*x._v__ast__CallExpr).mod).len == 0 && ((*x._v__ast__CallExpr).name).len == 0) { - string _t16 = string__plus(v__ast__Expr_str((*x._v__ast__CallExpr).left), str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string _t16 = string__plus(v__ast__Expr_str((*x._v__ast__CallExpr).left), str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); return _t16; } if (string_contains((*x._v__ast__CallExpr).name, _SLIT("."))) { - string _t17 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t17 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t17; } - string _t18 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*x._v__ast__CallExpr).mod}}, {_SLIT("."), 0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), 0xfe10, {.d_s = sargs}}, {_SLIT(")"), 0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t18 = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CallExpr).name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sargs}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = propagate_suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t18; } - else if (x._typ == 294 /* v.ast.CharLiteral */) { - string _t19 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*x._v__ast__CharLiteral).val}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + else if (x._typ == 295 /* v.ast.CharLiteral */) { + string _t19 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__CharLiteral).val}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t19; } - else if (x._typ == 295 /* v.ast.Comment */) { + else if (x._typ == 296 /* v.ast.Comment */) { if ((*x._v__ast__Comment).is_multi) { Array_string lines = string_split_into_lines((*x._v__ast__Comment).text); - string _t20 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* "), 0xfe07, {.d_i32 = lines.len}}, {_SLIT(" lines comment */"), 0, { .d_c = 0 }}})); + string _t20 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* "), /*100 &int*/0xfe07, {.d_i32 = lines.len}}, {_SLIT(" lines comment */"), 0, { .d_c = 0 }}})); return _t20; } else { string text = string_trim_space(string_trim((*x._v__ast__Comment).text, _SLIT("\001"))); - string _t21 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("´// "), 0xfe10, {.d_s = text}}, {_SLIT("´"), 0, { .d_c = 0 }}})); + string _t21 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("´// "), /*115 &string*/0xfe10, {.d_s = text}}, {_SLIT("´"), 0, { .d_c = 0 }}})); return _t21; } } - else if (x._typ == 297 /* v.ast.ComptimeSelector */) { - string _t22 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ComptimeSelector).left)}}, {_SLIT(".$"), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ComptimeSelector).field_expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 298 /* v.ast.ComptimeSelector */) { + string _t22 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ComptimeSelector).left)}}, {_SLIT(".$"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ComptimeSelector).field_expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t22; } - else if (x._typ == 299 /* v.ast.ConcatExpr */) { + else if (x._typ == 300 /* v.ast.ConcatExpr */) { Array_string _t24 = {0}; Array_v__ast__Expr _t24_orig = (*x._v__ast__ConcatExpr).vals; int _t24_len = _t24_orig.len; @@ -42955,36 +42996,36 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t23 = Array_string_join(_t24, _SLIT(",")); return _t23; } - else if (x._typ == 302 /* v.ast.EnumVal */) { - string _t26 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = (*x._v__ast__EnumVal).val}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 303 /* v.ast.EnumVal */) { + string _t26 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__EnumVal).val}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t26; } - else if (x._typ == 303 /* v.ast.FloatLiteral */) { + else if (x._typ == 304 /* v.ast.FloatLiteral */) { string _t27 = (*x._v__ast__FloatLiteral).val; return _t27; } - else if (x._typ == 310 /* v.ast.IntegerLiteral */) { + else if (x._typ == 311 /* v.ast.IntegerLiteral */) { string _t28 = (*x._v__ast__IntegerLiteral).val; return _t28; } - else if (x._typ == 304 /* v.ast.GoExpr */) { - string _t29 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("go "), 0xfe10, {.d_s = v__ast__CallExpr_str((*x._v__ast__GoExpr).call_expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 305 /* v.ast.GoExpr */) { + string _t29 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("go "), /*115 &v.ast.CallExpr*/0xfe10, {.d_s = v__ast__CallExpr_str((*x._v__ast__GoExpr).call_expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t29; } - else if (x._typ == 305 /* v.ast.Ident */) { + else if (x._typ == 306 /* v.ast.Ident */) { string _t30 = (*x._v__ast__Ident).name; return _t30; } - else if (x._typ == 306 /* v.ast.IfExpr */) { + else if (x._typ == 307 /* v.ast.IfExpr */) { Array_string parts = __new_array_with_default(0, 0, sizeof(string), 0); string dollar = ((*x._v__ast__IfExpr).is_comptime ? (_SLIT("$")) : (_SLIT(""))); for (int i = 0; i < (*x._v__ast__IfExpr).branches.len; ++i) { v__ast__IfBranch branch = ((v__ast__IfBranch*)(*x._v__ast__IfExpr).branches.data)[i]; if (i != 0) { - array_push((array*)&parts, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" } "), 0xfe10, {.d_s = dollar}}, {_SLIT("else "), 0, { .d_c = 0 }}}))) })); + array_push((array*)&parts, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" } "), /*115 &string*/0xfe10, {.d_s = dollar}}, {_SLIT("else "), 0, { .d_c = 0 }}}))) })); } if (i < (*x._v__ast__IfExpr).branches.len - 1 || !(*x._v__ast__IfExpr).has_else) { - array_push((array*)&parts, _MOV((string[]){ string_clone(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = dollar}}, {_SLIT("if "), 0, { .d_c = 0 }}})), v__ast__Expr_str(branch.cond)), _SLIT(" { "))) })); + array_push((array*)&parts, _MOV((string[]){ string_clone(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dollar}}, {_SLIT("if "), 0, { .d_c = 0 }}})), v__ast__Expr_str(branch.cond)), _SLIT(" { "))) })); } for (int _t33 = 0; _t33 < branch.stmts.len; ++_t33) { v__ast__Stmt stmt = ((v__ast__Stmt*)branch.stmts.data)[_t33]; @@ -42995,72 +43036,72 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t36 = Array_string_join(parts, _SLIT("")); return _t36; } - else if (x._typ == 308 /* v.ast.IndexExpr */) { - string _t37 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__IndexExpr).left)}}, {_SLIT("["), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__IndexExpr).index)}}, {_SLIT("]"), 0, { .d_c = 0 }}})); + else if (x._typ == 309 /* v.ast.IndexExpr */) { + string _t37 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__IndexExpr).left)}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__IndexExpr).index)}}, {_SLIT("]"), 0, { .d_c = 0 }}})); return _t37; } - else if (x._typ == 309 /* v.ast.InfixExpr */) { - string _t38 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__InfixExpr).left)}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str((*x._v__ast__InfixExpr).op)}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__InfixExpr).right)}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 310 /* v.ast.InfixExpr */) { + string _t38 = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__InfixExpr).left)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str((*x._v__ast__InfixExpr).op)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__InfixExpr).right)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t38; } - else if (x._typ == 314 /* v.ast.MapInit */) { + else if (x._typ == 315 /* v.ast.MapInit */) { Array_string pairs = __new_array_with_default(0, 0, sizeof(string), 0); for (int ik = 0; ik < (*x._v__ast__MapInit).keys.len; ++ik) { v__ast__Expr kv = ((v__ast__Expr*)(*x._v__ast__MapInit).keys.data)[ik]; string mv = v__ast__Expr_str((*(v__ast__Expr*)/*ee elem_sym */array_get((*x._v__ast__MapInit).vals, ik))); - array_push((array*)&pairs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(kv)}}, {_SLIT(": "), 0xfe10, {.d_s = mv}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&pairs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(kv)}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = mv}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } - string _t40 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("map{ "), 0xfe10, {.d_s = Array_string_join(pairs, _SLIT(" "))}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); + string _t40 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("map{ "), /*115 &string*/0xfe10, {.d_s = Array_string_join(pairs, _SLIT(" "))}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); return _t40; } - else if (x._typ == 320 /* v.ast.ParExpr */) { - string _t41 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ParExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 321 /* v.ast.ParExpr */) { + string _t41 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ParExpr).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t41; } - else if (x._typ == 321 /* v.ast.PostfixExpr */) { + else if (x._typ == 322 /* v.ast.PostfixExpr */) { if ((*x._v__ast__PostfixExpr).op == v__token__Kind__question) { - string _t42 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__PostfixExpr).expr)}}, {_SLIT(" ?"), 0, { .d_c = 0 }}})); + string _t42 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__PostfixExpr).expr)}}, {_SLIT(" ?"), 0, { .d_c = 0 }}})); return _t42; } - string _t43 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__PostfixExpr).expr)}}, {_SLIT0, 0xfe10, {.d_s = v__token__Kind_str((*x._v__ast__PostfixExpr).op)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t43 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__PostfixExpr).expr)}}, {_SLIT0, /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str((*x._v__ast__PostfixExpr).op)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t43; } - else if (x._typ == 322 /* v.ast.PrefixExpr */) { + else if (x._typ == 323 /* v.ast.PrefixExpr */) { string _t44 = string__plus(v__token__Kind_str((*x._v__ast__PrefixExpr).op), v__ast__Expr_str((*x._v__ast__PrefixExpr).right)); return _t44; } - else if (x._typ == 323 /* v.ast.RangeExpr */) { + else if (x._typ == 324 /* v.ast.RangeExpr */) { string s = _SLIT(".."); if ((*x._v__ast__RangeExpr).has_low) { - s = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__RangeExpr).low)}}, {_SLIT(" "), 0, { .d_c = 0 }}})), s); + s = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__RangeExpr).low)}}, {_SLIT(" "), 0, { .d_c = 0 }}})), s); } if ((*x._v__ast__RangeExpr).has_high) { - s = string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__RangeExpr).high)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + s = string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__RangeExpr).high)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string _t45 = s; return _t45; } - else if (x._typ == 324 /* v.ast.SelectExpr */) { + else if (x._typ == 325 /* v.ast.SelectExpr */) { string _t46 = _SLIT("ast.SelectExpr"); return _t46; } - else if (x._typ == 325 /* v.ast.SelectorExpr */) { - string _t47 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__SelectorExpr).expr)}}, {_SLIT("."), 0xfe10, {.d_s = (*x._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (x._typ == 326 /* v.ast.SelectorExpr */) { + string _t47 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__SelectorExpr).expr)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t47; } - else if (x._typ == 326 /* v.ast.SizeOf */) { + else if (x._typ == 327 /* v.ast.SizeOf */) { if ((*x._v__ast__SizeOf).is_type) { - string _t48 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__SizeOf).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string _t48 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__SizeOf).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t48; } - string _t49 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__SizeOf).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string _t49 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__SizeOf).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t49; } - else if (x._typ == 318 /* v.ast.OffsetOf */) { - string _t50 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__offsetof("), 0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__OffsetOf).struct_type)}}, {_SLIT(", "), 0xfe10, {.d_s = (*x._v__ast__OffsetOf).field}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 319 /* v.ast.OffsetOf */) { + string _t50 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__offsetof("), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(global_table, (*x._v__ast__OffsetOf).struct_type)}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__OffsetOf).field}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t50; } - else if (x._typ == 328 /* v.ast.StringInterLiteral */) { + else if (x._typ == 329 /* v.ast.StringInterLiteral */) { strings__Builder res = strings__new_builder(50); strings__Builder_write_string(&res, _SLIT("'")); for (int i = 0; i < (*x._v__ast__StringInterLiteral).vals.len; ++i) { @@ -43070,9 +43111,9 @@ string v__ast__Expr_str(v__ast__Expr x) { break; } strings__Builder_write_string(&res, _SLIT("$")); - multi_return_string_bool mr_10119 = v__ast__StringInterLiteral_get_fspec_braces(&(*x._v__ast__StringInterLiteral), i); - string fspec_str = mr_10119.arg0; - bool needs_braces = mr_10119.arg1; + multi_return_string_bool mr_10139 = v__ast__StringInterLiteral_get_fspec_braces(&(*x._v__ast__StringInterLiteral), i); + string fspec_str = mr_10139.arg0; + bool needs_braces = mr_10139.arg1; if (needs_braces) { strings__Builder_write_string(&res, _SLIT("{")); strings__Builder_write_string(&res, v__ast__Expr_str((*(v__ast__Expr*)/*ee elem_sym */array_get((*x._v__ast__StringInterLiteral).exprs, i)))); @@ -43086,35 +43127,35 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t51 = strings__Builder_str(&res); return _t51; } - else if (x._typ == 329 /* v.ast.StringLiteral */) { - string _t52 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = (*x._v__ast__StringLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}})); + else if (x._typ == 330 /* v.ast.StringLiteral */) { + string _t52 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = (*x._v__ast__StringLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}})); return _t52; } - else if (x._typ == 331 /* v.ast.TypeNode */) { - string _t53 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("TypeNode("), 0xfe10, {.d_s = v__ast__Type_str((*x._v__ast__TypeNode).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 332 /* v.ast.TypeNode */) { + string _t53 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("TypeNode("), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str((*x._v__ast__TypeNode).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t53; } - else if (x._typ == 332 /* v.ast.TypeOf */) { - string _t54 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typeof("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__TypeOf).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 333 /* v.ast.TypeOf */) { + string _t54 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typeof("), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__TypeOf).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t54; } - else if (x._typ == 312 /* v.ast.Likely */) { - string _t55 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_likely_("), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__Likely).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + else if (x._typ == 313 /* v.ast.Likely */) { + string _t55 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_likely_("), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__Likely).expr)}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t55; } - else if (x._typ == 333 /* v.ast.UnsafeExpr */) { - string _t56 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsafe { "), 0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__UnsafeExpr).expr)}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); + else if (x._typ == 334 /* v.ast.UnsafeExpr */) { + string _t56 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unsafe { "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__UnsafeExpr).expr)}}, {_SLIT(" }"), 0, { .d_c = 0 }}})); return _t56; } - else if (x._typ == 317 /* v.ast.None */) { + else if (x._typ == 318 /* v.ast.None */) { string _t57 = _SLIT("none"); return _t57; } - else if (x._typ == 311 /* v.ast.IsRefType */) { + else if (x._typ == 312 /* v.ast.IsRefType */) { string _t58 = string__plus(string__plus(_SLIT("isreftype("), ((*x._v__ast__IsRefType).is_type ? (v__ast__Table_type_to_str(global_table, (*x._v__ast__IsRefType).typ)) : (v__ast__Expr_str((*x._v__ast__IsRefType).expr)))), _SLIT(")")); return _t58; } - else if (x._typ == 307 /* v.ast.IfGuardExpr */) { + else if (x._typ == 308 /* v.ast.IfGuardExpr */) { string s = _SLIT(""); for (int i = 0; i < (*x._v__ast__IfGuardExpr).vars.len; ++i) { v__ast__IfGuardVar var = ((v__ast__IfGuardVar*)(*x._v__ast__IfGuardExpr).vars.data)[i]; @@ -43126,62 +43167,62 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t59 = string__plus(string__plus(s, _SLIT(" := ")), v__ast__Expr_str((*x._v__ast__IfGuardExpr).expr)); return _t59; } - else if (x._typ == 330 /* v.ast.StructInit */) { + else if (x._typ == 331 /* v.ast.StructInit */) { string sname = v__ast__Table_sym(global_table, (*x._v__ast__StructInit).typ)->name; - string _t60 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sname}}, {_SLIT("{....}"), 0, { .d_c = 0 }}})); + string _t60 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sname}}, {_SLIT("{....}"), 0, { .d_c = 0 }}})); return _t60; } - else if (x._typ == 284 /* v.ast.ArrayDecompose */) { + else if (x._typ == 285 /* v.ast.ArrayDecompose */) { string _t61 = _SLIT("ast.ArrayDecompose"); return _t61; } - else if (x._typ == 287 /* v.ast.Assoc */) { + else if (x._typ == 288 /* v.ast.Assoc */) { string _t62 = _SLIT("ast.Assoc"); return _t62; } - else if (x._typ == 293 /* v.ast.ChanInit */) { + else if (x._typ == 294 /* v.ast.ChanInit */) { string _t63 = _SLIT("ast.ChanInit"); return _t63; } - else if (x._typ == 296 /* v.ast.ComptimeCall */) { + else if (x._typ == 297 /* v.ast.ComptimeCall */) { string _t64 = _SLIT("ast.ComptimeCall"); return _t64; } - else if (x._typ == 301 /* v.ast.EmptyExpr */) { + else if (x._typ == 302 /* v.ast.EmptyExpr */) { string _t65 = _SLIT("ast.EmptyExpr"); return _t65; } - else if (x._typ == 313 /* v.ast.LockExpr */) { + else if (x._typ == 314 /* v.ast.LockExpr */) { string _t66 = _SLIT("ast.LockExpr"); return _t66; } - else if (x._typ == 315 /* v.ast.MatchExpr */) { + else if (x._typ == 316 /* v.ast.MatchExpr */) { string _t67 = _SLIT("ast.MatchExpr"); return _t67; } - else if (x._typ == 316 /* v.ast.NodeError */) { + else if (x._typ == 317 /* v.ast.NodeError */) { string _t68 = _SLIT("ast.NodeError"); return _t68; } - else if (x._typ == 319 /* v.ast.OrExpr */) { + else if (x._typ == 320 /* v.ast.OrExpr */) { string _t69 = _SLIT("ast.OrExpr"); return _t69; } - else if (x._typ == 327 /* v.ast.SqlExpr */) { + else if (x._typ == 328 /* v.ast.SqlExpr */) { string _t70 = _SLIT("ast.SqlExpr"); return _t70; } ; - string _t71 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[unhandled expr type "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (x)._typ ))}}, {_SLIT("]"), 0, { .d_c = 0 }}})); + string _t71 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[unhandled expr type "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (x)._typ ))}}, {_SLIT("]"), 0, { .d_c = 0 }}})); return _t71; } string v__ast__CallArg_str(v__ast__CallArg a) { if (a.is_mut) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("mut "), 0xfe10, {.d_s = v__ast__Expr_str(a.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("mut "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str(a.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } - string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(a.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str(a.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } @@ -43196,24 +43237,24 @@ string v__ast__args2str(Array_v__ast__CallArg args) { } string v__ast__BranchStmt_str(v__ast__BranchStmt* node) { - string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__token__Kind_str(node->kind)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->kind)}}, {_SLIT0, 0, { .d_c = 0 }}})); if (node->label.len > 0) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = node->label}}, {_SLIT0, 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = node->label}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string _t1 = s; return _t1; } string v__ast__Stmt_str(v__ast__Stmt node) { - if (node._typ == 336 /* v.ast.AssertStmt */) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("assert "), 0xfe10, {.d_s = v__ast__Expr_str((*node._v__ast__AssertStmt).expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + if (node._typ == 337 /* v.ast.AssertStmt */) { + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("assert "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*node._v__ast__AssertStmt).expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } - else if (node._typ == 337 /* v.ast.AssignStmt */) { + else if (node._typ == 338 /* v.ast.AssignStmt */) { string out = _SLIT(""); for (int i = 0; i < (*node._v__ast__AssignStmt).left.len; ++i) { v__ast__Expr left = ((v__ast__Expr*)(*node._v__ast__AssignStmt).left.data)[i]; - if ((left)._typ == 305 /* v.ast.Ident */) { + if ((left)._typ == 306 /* v.ast.Ident */) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*left._v__ast__Ident)); if (var_info.is_mut) { out = /*f*/string__plus(out, _SLIT("mut ")); @@ -43224,7 +43265,7 @@ string v__ast__Stmt_str(v__ast__Stmt node) { out = /*f*/string__plus(out, _SLIT(",")); } } - out = /*f*/string__plus(out, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str((*node._v__ast__AssignStmt).op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + out = /*f*/string__plus(out, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str((*node._v__ast__AssignStmt).op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); for (int i = 0; i < (*node._v__ast__AssignStmt).right.len; ++i) { v__ast__Expr val = ((v__ast__Expr*)(*node._v__ast__AssignStmt).right.data)[i]; out = /*f*/string__plus(out, v__ast__Expr_str(val)); @@ -43235,11 +43276,11 @@ string v__ast__Stmt_str(v__ast__Stmt node) { string _t2 = out; return _t2; } - else if (node._typ == 339 /* v.ast.BranchStmt */) { + else if (node._typ == 340 /* v.ast.BranchStmt */) { string _t3 = v__ast__BranchStmt_str(&(*node._v__ast__BranchStmt)); return _t3; } - else if (node._typ == 341 /* v.ast.ConstDecl */) { + else if (node._typ == 342 /* v.ast.ConstDecl */) { Array_string _t4 = {0}; Array_v__ast__ConstField _t4_orig = (*node._v__ast__ConstDecl).fields; int _t4_len = _t4_orig.len; @@ -43251,40 +43292,40 @@ string v__ast__Stmt_str(v__ast__Stmt node) { array_push((array*)&_t4, &ti); } Array_string fields =_t4; - string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("const ("), 0xfe10, {.d_s = Array_string_join(fields, _SLIT(" "))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string _t6 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("const ("), /*115 &string*/0xfe10, {.d_s = Array_string_join(fields, _SLIT(" "))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t6; } - else if (node._typ == 345 /* v.ast.ExprStmt */) { + else if (node._typ == 346 /* v.ast.ExprStmt */) { string _t7 = v__ast__Expr_str((*node._v__ast__ExprStmt).expr); return _t7; } - else if (node._typ == 218 /* v.ast.FnDecl */) { - string _t8 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn "), 0xfe10, {.d_s = (*node._v__ast__FnDecl).name}}, {_SLIT("( "), 0xfe07, {.d_i32 = (*node._v__ast__FnDecl).params.len}}, {_SLIT(" params ) { "), 0xfe07, {.d_i32 = (*node._v__ast__FnDecl).stmts.len}}, {_SLIT(" stmts }"), 0, { .d_c = 0 }}})); + else if (node._typ == 219 /* v.ast.FnDecl */) { + string _t8 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__FnDecl).name}}, {_SLIT("( "), /*100 &int*/0xfe07, {.d_i32 = (*node._v__ast__FnDecl).params.len}}, {_SLIT(" params ) { "), /*100 &int*/0xfe07, {.d_i32 = (*node._v__ast__FnDecl).stmts.len}}, {_SLIT(" stmts }"), 0, { .d_c = 0 }}})); return _t8; } - else if (node._typ == 344 /* v.ast.EnumDecl */) { - string _t9 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("enum "), 0xfe10, {.d_s = (*node._v__ast__EnumDecl).name}}, {_SLIT(" { "), 0xfe07, {.d_i32 = (*node._v__ast__EnumDecl).fields.len}}, {_SLIT(" fields }"), 0, { .d_c = 0 }}})); + else if (node._typ == 345 /* v.ast.EnumDecl */) { + string _t9 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("enum "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__EnumDecl).name}}, {_SLIT(" { "), /*100 &int*/0xfe07, {.d_i32 = (*node._v__ast__EnumDecl).fields.len}}, {_SLIT(" fields }"), 0, { .d_c = 0 }}})); return _t9; } - else if (node._typ == 355 /* v.ast.Module */) { - string _t10 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("module "), 0xfe10, {.d_s = (*node._v__ast__Module).name}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (node._typ == 356 /* v.ast.Module */) { + string _t10 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("module "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__Module).name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t10; } - else if (node._typ == 353 /* v.ast.Import */) { - string out = str_intp(2, _MOV((StrIntpData[]){{_SLIT("import "), 0xfe10, {.d_s = (*node._v__ast__Import).mod}}, {_SLIT0, 0, { .d_c = 0 }}})); + else if (node._typ == 354 /* v.ast.Import */) { + string out = str_intp(2, _MOV((StrIntpData[]){{_SLIT("import "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__Import).mod}}, {_SLIT0, 0, { .d_c = 0 }}})); if ((*node._v__ast__Import).alias.len > 0) { - out = /*f*/string__plus(out, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" as "), 0xfe10, {.d_s = (*node._v__ast__Import).alias}}, {_SLIT0, 0, { .d_c = 0 }}}))); + out = /*f*/string__plus(out, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" as "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__Import).alias}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string _t11 = out; return _t11; } - else if (node._typ == 358 /* v.ast.StructDecl */) { - string _t12 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = (*node._v__ast__StructDecl).name}}, {_SLIT(" { "), 0xfe07, {.d_i32 = (*node._v__ast__StructDecl).fields.len}}, {_SLIT(" fields }"), 0, { .d_c = 0 }}})); + else if (node._typ == 359 /* v.ast.StructDecl */) { + string _t12 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__StructDecl).name}}, {_SLIT(" { "), /*100 &int*/0xfe07, {.d_i32 = (*node._v__ast__StructDecl).fields.len}}, {_SLIT(" fields }"), 0, { .d_c = 0 }}})); return _t12; } else { - string _t13 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[unhandled stmt str type: "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (node)._typ ))}}, {_SLIT(" ]"), 0, { .d_c = 0 }}})); + string _t13 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[unhandled stmt str type: "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Stmt */ v_typeof_sumtype_v__ast__Stmt( (node)._typ ))}}, {_SLIT(" ]"), 0, { .d_c = 0 }}})); return _t13; } ; @@ -43293,7 +43334,7 @@ string v__ast__Stmt_str(v__ast__Stmt node) { VV_LOCAL_SYMBOL string v__ast__field_to_string(v__ast__ConstField f) { string x = string_trim_string_left(f.name, string__plus(f.mod, _SLIT("."))); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = x}}, {_SLIT(" = "), 0xfe10, {.d_s = v__ast__Expr_str(f.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT(" = "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(f.expr)}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -43444,9 +43485,9 @@ string v__ast__Table_fn_type_signature(v__ast__Table* t, v__ast__Fn* f) { v__ast__TypeSymbol* sym = v__ast__Table_sym(t, f->return_type); string opt = (v__ast__Type_has_flag(f->return_type, v__ast__TypeFlag__optional) ? (_SLIT("option_")) : (_SLIT(""))); if (sym->kind == v__ast__Kind__alias) { - sig = /*f*/string__plus(sig, str_intp(3, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = opt}}, {_SLIT0, 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(3, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - sig = /*f*/string__plus(sig, str_intp(3, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = opt}}, {_SLIT0, 0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(3, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT0, /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } string _t1 = sig; @@ -43461,7 +43502,7 @@ string v__ast__Table_fn_type_source_signature(v__ast__Table* t, v__ast__Fn* f) { sig = /*f*/string__plus(sig, _SLIT("mut ")); } if (t->is_fmt && arg.name.len > 0) { - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg.name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } v__ast__TypeSymbol* arg_type_sym = v__ast__Table_sym(t, arg.typ); sig = /*f*/string__plus(sig, arg_type_sym->name); @@ -43472,12 +43513,16 @@ string v__ast__Table_fn_type_source_signature(v__ast__Table* t, v__ast__Fn* f) { sig = /*f*/string__plus(sig, _SLIT(")")); if (v__ast__Type_alias_eq(f->return_type, _const_v__ast__ovoid_type)) { sig = /*f*/string__plus(sig, _SLIT(" ?")); + } else if (v__ast__Type_alias_eq(f->return_type, _const_v__ast__rvoid_type)) { + sig = /*f*/string__plus(sig, _SLIT(" !")); } else if (!v__ast__Type_alias_eq(f->return_type, _const_v__ast__void_type)) { v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, f->return_type); if (v__ast__Type_has_flag(f->return_type, v__ast__TypeFlag__optional)) { - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" ?"), 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" ?"), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } else if (v__ast__Type_has_flag(f->return_type, v__ast__TypeFlag__result)) { + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" !"), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } string _t1 = sig; @@ -43487,11 +43532,11 @@ string v__ast__Table_fn_type_source_signature(v__ast__Table* t, v__ast__Fn* f) { string v__ast__Table_is_same_method(v__ast__Table* t, v__ast__Fn* f, v__ast__Fn* func) { if (!v__ast__Type_alias_eq(f->return_type, func->return_type)) { string s = v__ast__Table_type_to_str(t, f->return_type); - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected return type `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected return type `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } if (f->params.len != func->params.len) { - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = f->params.len}}, {_SLIT(" parameter(s), not "), 0xfe07, {.d_i32 = func->params.len}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = f->params.len}}, {_SLIT(" parameter(s), not "), /*100 &int*/0xfe07, {.d_i32 = func->params.len}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } for (int i = 0; i < f->params.len; ++i) { @@ -43507,10 +43552,10 @@ string v__ast__Table_is_same_method(v__ast__Table* t, v__ast__Fn* f, v__ast__Fn* string exps = v__ast__Table_type_to_str(t, (*(v__ast__Param*)/*ee elem_sym */array_get(f->params, i)).typ); string gots = v__ast__Table_type_to_str(t, (*(v__ast__Param*)/*ee elem_sym */array_get(func->params, i)).typ); if (has_unexpected_type) { - string _t4 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = exps}}, {_SLIT("`, not `"), 0xfe10, {.d_s = gots}}, {_SLIT("` for parameter "), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t4 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = exps}}, {_SLIT("`, not `"), /*115 &string*/0xfe10, {.d_s = gots}}, {_SLIT("` for parameter "), /*100 &int literal*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t4; } else { - string _t5 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = exps}}, {_SLIT("` which is immutable, not `mut "), 0xfe10, {.d_s = gots}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t5 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = exps}}, {_SLIT("` which is immutable, not `mut "), /*115 &string*/0xfe10, {.d_s = gots}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t5; } } @@ -43584,9 +43629,9 @@ int v__ast__TypeSymbol_register_method(v__ast__TypeSymbol* t, v__ast__Fn new_fn) Option_v__ast__Fn v__ast__Table_register_aggregate_method(v__ast__Table* t, v__ast__TypeSymbol* sym, string name) { if (sym->kind != v__ast__Kind__aggregate) { - v__ast__Table_panic(t, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unexpected type symbol: "), 0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__ast__Table_panic(t, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unexpected type symbol: "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 468) /*expected idx: 468, name: v.ast.Aggregate */ ; + v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 469) /*expected idx: 469, name: v.ast.Aggregate */ ; bool found_once = false; v__ast__Fn new_fn = ((v__ast__Fn){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}); for (int _t1 = 0; _t1 < agg_info.types.len; ++_t1) { @@ -43599,11 +43644,11 @@ Option_v__ast__Fn v__ast__Table_register_aggregate_method(v__ast__Table* t, v__a found_once = true; new_fn = type_method; } else if (!v__ast__Fn_method_equals(&new_fn, (voidptr)&/*qq*/type_method)) { - return (Option_v__ast__Fn){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT("` signature is different"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Fn){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` signature is different"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } else { IError err = _t2.err; - return (Option_v__ast__Fn){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown method: `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Fn){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown method: `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } v__ast__TypeSymbol_register_method(sym, new_fn); @@ -43649,8 +43694,8 @@ Option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol Array_Array_v__ast__Type v__ast__Table_get_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, v__ast__GetEmbedsOptions options) { Array_Array_v__ast__Type embeds = __new_array_with_default(0, 0, sizeof(Array_v__ast__Type), 0); - v__ast__TypeSymbol* unalias_sym = ((sym->info)._typ == 470 /* v.ast.Alias */ ? (v__ast__Table_sym(t, (*sym->info._v__ast__Alias).parent_type)) : (sym)); - if ((unalias_sym->info)._typ == 455 /* v.ast.Struct */) { + v__ast__TypeSymbol* unalias_sym = ((sym->info)._typ == 471 /* v.ast.Alias */ ? (v__ast__Table_sym(t, (*sym->info._v__ast__Alias).parent_type)) : (sym)); + if ((unalias_sym->info)._typ == 456 /* v.ast.Struct */) { for (int _t1 = 0; _t1 < (*unalias_sym->info._v__ast__Struct).embeds.len; ++_t1) { v__ast__Type embed = ((v__ast__Type*)(*unalias_sym->info._v__ast__Struct).embeds.data)[_t1]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(t, embed); @@ -43667,7 +43712,7 @@ Array_Array_v__ast__Type v__ast__Table_get_embeds(v__ast__Table* t, v__ast__Type } Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name) { - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { Array_v__ast__Fn found_methods = __new_array_with_default(0, 0, sizeof(v__ast__Fn), 0); Array_v__ast__Type embed_of_found_methods = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); for (int _t1 = 0; _t1 < (*sym->info._v__ast__Struct).embeds.len; ++_t1) { @@ -43686,9 +43731,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from continue; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_12290 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t5.data); - v__ast__Fn method = mr_12290.arg0; - Array_v__ast__Type types = mr_12290.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_12435 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t5.data); + v__ast__Fn method = mr_12435.arg0; + Array_v__ast__Type types = mr_12435.arg1; array_push((array*)&found_methods, _MOV((v__ast__Fn[]){ method })); array_push((array*)&embed_of_found_methods, _MOV((v__ast__Type[]){ embed })); _PUSH_MANY(&embed_of_found_methods, (types), _t8, Array_v__ast__Type); @@ -43699,9 +43744,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from opt_ok(&(multi_return_v__ast__Fn_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=(*(v__ast__Fn*)/*ee elem_sym */array_get(found_methods, 0)), .arg1=embed_of_found_methods} }, (Option*)(&_t9), sizeof(multi_return_v__ast__Fn_Array_v__ast__Type)); return _t9; } else if (found_methods.len > 1) { - return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous method `"), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous method `"), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - } else if ((sym->info)._typ == 473 /* v.ast.Interface */) { + } else if ((sym->info)._typ == 474 /* v.ast.Interface */) { Array_v__ast__Fn found_methods = __new_array_with_default(0, 0, sizeof(v__ast__Fn), 0); Array_v__ast__Type embed_of_found_methods = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); for (int _t11 = 0; _t11 < (*sym->info._v__ast__Interface).embeds.len; ++_t11) { @@ -43720,9 +43765,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from continue; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_12948 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t15.data); - v__ast__Fn method = mr_12948.arg0; - Array_v__ast__Type types = mr_12948.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_13093 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t15.data); + v__ast__Fn method = mr_13093.arg0; + Array_v__ast__Type types = mr_13093.arg1; array_push((array*)&found_methods, _MOV((v__ast__Fn[]){ method })); array_push((array*)&embed_of_found_methods, _MOV((v__ast__Type[]){ embed })); _PUSH_MANY(&embed_of_found_methods, (types), _t18, Array_v__ast__Type); @@ -43733,9 +43778,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from opt_ok(&(multi_return_v__ast__Fn_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=(*(v__ast__Fn*)/*ee elem_sym */array_get(found_methods, 0)), .arg1=embed_of_found_methods} }, (Option*)(&_t19), sizeof(multi_return_v__ast__Fn_Array_v__ast__Type)); return _t19; } else if (found_methods.len > 1) { - return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous method `"), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous method `"), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - } else if ((sym->info)._typ == 468 /* v.ast.Aggregate */) { + } else if ((sym->info)._typ == 469 /* v.ast.Aggregate */) { for (int _t21 = 0; _t21 < (*sym->info._v__ast__Aggregate).types.len; ++_t21) { v__ast__Type typ = ((v__ast__Type*)(*sym->info._v__ast__Aggregate).types.data)[_t21]; v__ast__TypeSymbol* agg_sym = v__ast__Table_sym(t, typ); @@ -43745,9 +43790,9 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from continue; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_13411 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t22.data); - v__ast__Fn method = mr_13411.arg0; - Array_v__ast__Type embed_types = mr_13411.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_13556 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t22.data); + v__ast__Fn method = mr_13556.arg0; + Array_v__ast__Type embed_types = mr_13556.arg1; if (embed_types.len != 0) { Option_multi_return_v__ast__Fn_Array_v__ast__Type _t23; opt_ok(&(multi_return_v__ast__Fn_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=method, .arg1=embed_types} }, (Option*)(&_t23), sizeof(multi_return_v__ast__Fn_Array_v__ast__Type)); @@ -43774,8 +43819,8 @@ Option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast return (Option_v__ast__Fn){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_13872 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t3.data); - v__ast__Fn func = mr_13872.arg0; + multi_return_v__ast__Fn_Array_v__ast__Type mr_14017 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t3.data); + v__ast__Fn func = mr_14017.arg0; Option_v__ast__Fn _t5; opt_ok(&(v__ast__Fn[]) { func }, (Option*)(&_t5), sizeof(v__ast__Fn)); return _t5; @@ -43785,7 +43830,7 @@ Option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast Array_v__ast__Fn v__ast__Table_get_embed_methods(v__ast__Table* t, v__ast__TypeSymbol* sym) { Array_v__ast__Fn methods = __new_array_with_default(0, 0, sizeof(v__ast__Fn), 0); - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { for (int _t1 = 0; _t1 < (*sym->info._v__ast__Struct).embeds.len; ++_t1) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Struct).embeds.data)[_t1]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(t, embed); @@ -43799,9 +43844,9 @@ Array_v__ast__Fn v__ast__Table_get_embed_methods(v__ast__Table* t, v__ast__TypeS VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Table_register_aggregate_field(v__ast__Table* t, v__ast__TypeSymbol* sym, string name) { if (sym->kind != v__ast__Kind__aggregate) { - v__ast__Table_panic(t, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unexpected type symbol: "), 0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__ast__Table_panic(t, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unexpected type symbol: "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 468) /*expected idx: 468, name: v.ast.Aggregate */ ; + v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 469) /*expected idx: 469, name: v.ast.Aggregate */ ; bool found_once = false; v__ast__StructField new_field = ((v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}); for (int _t1 = 0; _t1 < agg_info.types.len; ++_t1) { @@ -43814,12 +43859,12 @@ VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Table_register_aggregate_fiel found_once = true; new_field = type_field; } else if (!v__ast__Type_alias_eq(new_field.typ, type_field.typ)) { - return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT("` type is different"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` type is different"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } new_field = ((v__ast__StructField){new_field.pos,new_field.type_pos,new_field.comments,new_field.has_default_expr,new_field.attrs,.is_pub = new_field.is_pub && type_field.is_pub,new_field.default_val,.is_mut = new_field.is_mut && type_field.is_mut,new_field.is_global,new_field.is_volatile,new_field.default_expr,new_field.default_expr_typ,new_field.name,new_field.typ,}); } else { IError err = _t2.err; - return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("` has no field or method `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(t, typ)}}, {_SLIT("` has no field or method `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } array_push((array*)&agg_info.fields, _MOV((v__ast__StructField[]){ new_field })); @@ -43843,7 +43888,7 @@ bool v__ast__Table_struct_has_field(v__ast__Table* t, v__ast__TypeSymbol* struct Array_v__ast__StructField v__ast__Table_struct_fields(v__ast__Table* t, v__ast__TypeSymbol* sym) { Array_v__ast__StructField fields = __new_array_with_default(0, 0, sizeof(v__ast__StructField), 0); - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { _PUSH_MANY(&fields, ((*sym->info._v__ast__Struct).fields), _t1, Array_v__ast__StructField); for (int _t2 = 0; _t2 < (*sym->info._v__ast__Struct).embeds.len; ++_t2) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Struct).embeds.data)[_t2]; @@ -43858,7 +43903,7 @@ Array_v__ast__StructField v__ast__Table_struct_fields(v__ast__Table* t, v__ast__ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { v__ast__TypeSymbol* ts = s; for (;;) { - if (ts->info._typ == 455 /* v.ast.Struct */) { + if (ts->info._typ == 456 /* v.ast.Struct */) { Option_v__ast__StructField _t1; if (_t1 = v__ast__Struct_find_field(&(*ts->info._v__ast__Struct), name), _t1.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t1.data; @@ -43867,7 +43912,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty return _t2; } } - else if (ts->info._typ == 468 /* v.ast.Aggregate */) { + else if (ts->info._typ == 469 /* v.ast.Aggregate */) { Option_v__ast__StructField _t3; if (_t3 = v__ast__Aggregate_find_field(&(*ts->info._v__ast__Aggregate), name), _t3.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t3.data; @@ -43886,7 +43931,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t7), sizeof(v__ast__StructField)); return _t7; } - else if (ts->info._typ == 473 /* v.ast.Interface */) { + else if (ts->info._typ == 474 /* v.ast.Interface */) { Option_v__ast__StructField _t8; if (_t8 = v__ast__Interface_find_field(&(*ts->info._v__ast__Interface), name), _t8.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t8.data; @@ -43895,7 +43940,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty return _t9; } } - else if (ts->info._typ == 474 /* v.ast.SumType */) { + else if (ts->info._typ == 475 /* v.ast.SumType */) { v__ast__Table_resolve_common_sumtype_fields(t, ts); Option_v__ast__StructField _t10; if (_t10 = v__ast__SumType_find_field(&(*ts->info._v__ast__SumType), name), _t10.state == 0) { @@ -43904,7 +43949,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t11), sizeof(v__ast__StructField)); return _t11; } - return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = name}}, {_SLIT("` does not exist or have the same type in all sumtype variants"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__StructField){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` does not exist or have the same type in all sumtype variants"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else { @@ -43919,7 +43964,7 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty } Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_field_from_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name) { - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { Array_v__ast__StructField found_fields = __new_array_with_default(0, 0, sizeof(v__ast__StructField), 0); Array_v__ast__Type embeds_of_found_fields = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); for (int _t1 = 0; _t1 < (*sym->info._v__ast__Struct).embeds.len; ++_t1) { @@ -43938,9 +43983,9 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi continue; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_17119 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t5.data); - v__ast__StructField field = mr_17119.arg0; - Array_v__ast__Type types = mr_17119.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_17264 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t5.data); + v__ast__StructField field = mr_17264.arg0; + Array_v__ast__Type types = mr_17264.arg1; array_push((array*)&found_fields, _MOV((v__ast__StructField[]){ field })); array_push((array*)&embeds_of_found_fields, _MOV((v__ast__Type[]){ embed })); _PUSH_MANY(&embeds_of_found_fields, (types), _t8, Array_v__ast__Type); @@ -43951,9 +43996,9 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi opt_ok(&(multi_return_v__ast__StructField_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=(*(v__ast__StructField*)/*ee elem_sym */array_get(found_fields, 0)), .arg1=embeds_of_found_fields} }, (Option*)(&_t9), sizeof(multi_return_v__ast__StructField_Array_v__ast__Type)); return _t9; } else if (found_fields.len > 1) { - return (Option_multi_return_v__ast__StructField_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous field `"), 0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_multi_return_v__ast__StructField_Array_v__ast__Type){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("ambiguous field `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - } else if ((sym->info)._typ == 468 /* v.ast.Aggregate */) { + } else if ((sym->info)._typ == 469 /* v.ast.Aggregate */) { for (int _t11 = 0; _t11 < (*sym->info._v__ast__Aggregate).types.len; ++_t11) { v__ast__Type typ = ((v__ast__Type*)(*sym->info._v__ast__Aggregate).types.data)[_t11]; v__ast__TypeSymbol* agg_sym = v__ast__Table_sym(t, typ); @@ -43963,16 +44008,16 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi continue; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_17572 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t12.data); - v__ast__StructField field = mr_17572.arg0; - Array_v__ast__Type embed_types = mr_17572.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_17717 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t12.data); + v__ast__StructField field = mr_17717.arg0; + Array_v__ast__Type embed_types = mr_17717.arg1; if (embed_types.len > 0) { Option_multi_return_v__ast__StructField_Array_v__ast__Type _t13; opt_ok(&(multi_return_v__ast__StructField_Array_v__ast__Type/*X*/[]) { (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=field, .arg1=embed_types} }, (Option*)(&_t13), sizeof(multi_return_v__ast__StructField_Array_v__ast__Type)); return _t13; } } - } else if ((sym->info)._typ == 470 /* v.ast.Alias */) { + } else if ((sym->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* unalias_sym = v__ast__Table_sym(t, (*sym->info._v__ast__Alias).parent_type); Option_multi_return_v__ast__StructField_Array_v__ast__Type _t14 = v__ast__Table_find_field_from_embeds(t, unalias_sym, field_name); return _t14; @@ -43996,8 +44041,8 @@ Option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t return (Option_v__ast__StructField){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_18170 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t3.data); - v__ast__StructField field = mr_18170.arg0; + multi_return_v__ast__StructField_Array_v__ast__Type mr_18315 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t3.data); + v__ast__StructField field = mr_18315.arg0; Option_v__ast__StructField _t5; opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t5), sizeof(v__ast__StructField)); return _t5; @@ -44007,7 +44052,7 @@ Option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t void v__ast__Table_resolve_common_sumtype_fields(v__ast__Table* t, v__ast__TypeSymbol* sym_) { v__ast__TypeSymbol* sym = sym_; - v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ; if (info.found_fields) { return; } @@ -44017,10 +44062,10 @@ void v__ast__Table_resolve_common_sumtype_fields(v__ast__Table* t, v__ast__TypeS v__ast__Type variant = ((v__ast__Type*)info.variants.data)[_t1]; v__ast__TypeSymbol* v_sym = v__ast__Table_final_sym(t, variant); Array_v__ast__StructField _t2 = __new_array(0, 0, sizeof(v__ast__StructField)); - if (v_sym->info._typ == 455 /* v.ast.Struct */) { + if (v_sym->info._typ == 456 /* v.ast.Struct */) { _t2 = v__ast__Table_struct_fields(t, v_sym); } - else if (v_sym->info._typ == 474 /* v.ast.SumType */) { + else if (v_sym->info._typ == 475 /* v.ast.SumType */) { v__ast__Table_resolve_common_sumtype_fields(t, v_sym); _t2 = (*v_sym->info._v__ast__SumType).fields; } @@ -44097,7 +44142,7 @@ v__ast__TypeSymbol* v__ast__Table_sym(v__ast__Table* t, v__ast__Type typ) { v__ast__TypeSymbol* _t1 = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)); return _t1; } - v__ast__Table_panic(t, str_intp(3, _MOV((StrIntpData[]){{_SLIT("sym: invalid type (typ="), 0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT(" idx="), 0xfe07, {.d_i32 = idx}}, {_SLIT("). Compiler bug. This should never happen. Please report the bug using `v bug file.v`.\n"), 0, { .d_c = 0 }}}))); + v__ast__Table_panic(t, str_intp(3, _MOV((StrIntpData[]){{_SLIT("sym: invalid type (typ="), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT(" idx="), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("). Compiler bug. This should never happen. Please report the bug using `v bug file.v`.\n"), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* _t2 = _const_v__ast__invalid_type_symbol; return _t2; } @@ -44108,12 +44153,12 @@ inline v__ast__TypeSymbol* v__ast__Table_final_sym(v__ast__Table* t, v__ast__Typ if (idx > 0) { v__ast__TypeSymbol* current_symbol = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)); if (current_symbol->kind == v__ast__Kind__alias) { - idx = v__ast__Type_idx((/* as */ *(v__ast__Alias*)__as_cast((current_symbol->info)._v__ast__Alias,(current_symbol->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type); + idx = v__ast__Type_idx((/* as */ *(v__ast__Alias*)__as_cast((current_symbol->info)._v__ast__Alias,(current_symbol->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type); } v__ast__TypeSymbol* _t1 = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)); return _t1; } - v__ast__Table_panic(t, str_intp(3, _MOV((StrIntpData[]){{_SLIT("final_sym: invalid type (typ="), 0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT(" idx="), 0xfe07, {.d_i32 = idx}}, {_SLIT("). Compiler bug. This should never happen. Please report the bug using `v bug file.v`."), 0, { .d_c = 0 }}}))); + v__ast__Table_panic(t, str_intp(3, _MOV((StrIntpData[]){{_SLIT("final_sym: invalid type (typ="), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT(" idx="), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("). Compiler bug. This should never happen. Please report the bug using `v bug file.v`."), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* _t2 = _const_v__ast__invalid_type_symbol; return _t2; } @@ -44129,7 +44174,7 @@ inline string v__ast__Table_get_type_name(v__ast__Table* t, v__ast__Type typ) { inline v__ast__Type v__ast__Table_unalias_num_type(v__ast__Table* t, v__ast__Type typ) { v__ast__TypeSymbol* sym = v__ast__Table_sym(t, typ); if (sym->kind == v__ast__Kind__alias) { - v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type; + v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; if (pt <= _const_v__ast__char_type && pt >= _const_v__ast__void_type) { v__ast__Type _t1 = pt; return _t1; @@ -44143,7 +44188,7 @@ inline v__ast__Type v__ast__Table_unalias_num_type(v__ast__Table* t, v__ast__Typ inline v__ast__Type v__ast__Table_unaliased_type(v__ast__Table* t, v__ast__Type typ) { v__ast__TypeSymbol* sym = v__ast__Table_sym(t, typ); if (sym->kind == v__ast__Kind__alias) { - v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type; + v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; v__ast__Type _t1 = pt; return _t1; } @@ -44232,15 +44277,15 @@ bool v__ast__Table_known_type_idx(v__ast__Table* t, v__ast__Type typ) { return _t2; } else if (sym->kind == (v__ast__Kind__array)) { - bool _t3 = v__ast__Table_known_type_idx(t, (/* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ).elem_type); + bool _t3 = v__ast__Table_known_type_idx(t, (/* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ).elem_type); return _t3; } else if (sym->kind == (v__ast__Kind__array_fixed)) { - bool _t4 = v__ast__Table_known_type_idx(t, (/* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ).elem_type); + bool _t4 = v__ast__Table_known_type_idx(t, (/* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ).elem_type); return _t4; } else if (sym->kind == (v__ast__Kind__map)) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; bool _t5 = v__ast__Table_known_type_idx(t, info.key_type) && v__ast__Table_known_type_idx(t, info.value_type); return _t5; } @@ -44254,7 +44299,7 @@ bool v__ast__Table_known_type_idx(v__ast__Table* t, v__ast__Type typ) { inline string v__ast__Table_array_name(v__ast__Table* t, v__ast__Type elem_type) { v__ast__TypeSymbol* elem_type_sym = v__ast__Table_sym(t, elem_type); string ptr = (v__ast__Type_is_ptr(elem_type) ? (string_repeat(_SLIT("&"), v__ast__Type_nr_muls(elem_type))) : (_SLIT(""))); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("[]"), 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("[]"), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -44267,10 +44312,10 @@ inline string v__ast__Table_array_cname(v__ast__Table* t, v__ast__Type elem_type } if (string_contains(elem_type_sym->cname, _SLIT("<"))) { string type_name = string_replace_each(elem_type_sym->cname, new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("<"), _SLIT("_T_"), _SLIT(", "), _SLIT("_"), _SLIT(">"), _SLIT("")}))); - string _t1 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), 0xfe10, {.d_s = type_name}}, {_SLIT0, 0, { .d_c = 0 }}})), res); + string _t1 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT0, 0, { .d_c = 0 }}})), res); return _t1; } else { - string _t2 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), 0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), res); + string _t2 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), /*115 &string*/0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), res); return _t2; } return (string){.str=(byteptr)"", .is_lit=1}; @@ -44280,8 +44325,8 @@ inline string v__ast__Table_array_cname(v__ast__Table* t, v__ast__Type elem_type inline string v__ast__Table_array_fixed_name(v__ast__Table* t, v__ast__Type elem_type, int size, v__ast__Expr size_expr) { v__ast__TypeSymbol* elem_type_sym = v__ast__Table_sym(t, elem_type); string ptr = (v__ast__Type_is_ptr(elem_type) ? (string_repeat(_SLIT("&"), v__ast__Type_nr_muls(elem_type))) : (_SLIT(""))); - string size_str = ((size_expr)._typ == 301 /* v.ast.EmptyExpr */ || size != 987654321 ? (int_str(size)) : (v__ast__Expr_str(size_expr))); - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = size_str}}, {_SLIT("]"), 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string size_str = ((size_expr)._typ == 302 /* v.ast.EmptyExpr */ || size != 987654321 ? (int_str(size)) : (v__ast__Expr_str(size_expr))); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = size_str}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -44290,9 +44335,9 @@ inline string v__ast__Table_array_fixed_cname(v__ast__Table* t, v__ast__Type ele v__ast__TypeSymbol* elem_type_sym = v__ast__Table_sym(t, elem_type); string res = _SLIT(""); if (v__ast__Type_is_ptr(elem_type)) { - res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_ptr"), 0xfe07, {.d_i32 = v__ast__Type_nr_muls(elem_type)}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_ptr"), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_nr_muls(elem_type)}}, {_SLIT0, 0, { .d_c = 0 }}})); } - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("Array_fixed_"), 0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0xfe10, {.d_s = res}}, {_SLIT("_"), 0xfe07, {.d_i32 = size}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("Array_fixed_"), /*115 &string*/0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -44305,7 +44350,7 @@ inline string v__ast__Table_chan_name(v__ast__Table* t, v__ast__Type elem_type, } else if (v__ast__Type_is_ptr(elem_type)) { ptr = _SLIT("&"); } - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("chan "), 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("chan "), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -44318,7 +44363,7 @@ inline string v__ast__Table_chan_cname(v__ast__Table* t, v__ast__Type elem_type, } else if (v__ast__Type_is_ptr(elem_type)) { suffix = _SLIT("_ptr"); } - string _t1 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("chan_"), 0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), suffix); + string _t1 = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("chan_"), /*115 &string*/0xfe10, {.d_s = elem_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), suffix); return _t1; } @@ -44329,7 +44374,7 @@ inline string v__ast__Table_promise_name(v__ast__Table* t, v__ast__Type return_t return _t1; } v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, return_type); - string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Promise<"), 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT(", JS.Any>"), 0, { .d_c = 0 }}})); + string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Promise<"), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT(", JS.Any>"), 0, { .d_c = 0 }}})); return _t2; } @@ -44340,7 +44385,7 @@ inline string v__ast__Table_promise_cname(v__ast__Table* t, v__ast__Type return_ return _t1; } v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, return_type); - string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Promise_"), 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT("_Any"), 0, { .d_c = 0 }}})); + string _t2 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Promise_"), /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT("_Any"), 0, { .d_c = 0 }}})); return _t2; } @@ -44358,7 +44403,7 @@ inline string v__ast__Table_thread_name(v__ast__Table* t, v__ast__Type return_ty v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, return_type); string ptr = (v__ast__Type_is_ptr(return_type) ? (_SLIT("&")) : (_SLIT(""))); string opt = (v__ast__Type_has_flag(return_type, v__ast__TypeFlag__optional) ? (_SLIT("?")) : (_SLIT(""))); - string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("thread "), 0xfe10, {.d_s = opt}}, {_SLIT0, 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("thread "), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = return_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } @@ -44376,7 +44421,7 @@ inline string v__ast__Table_thread_cname(v__ast__Table* t, v__ast__Type return_t v__ast__TypeSymbol* return_type_sym = v__ast__Table_sym(t, return_type); string suffix = (v__ast__Type_is_ptr(return_type) ? (_SLIT("_ptr")) : (_SLIT(""))); string prefix = (v__ast__Type_has_flag(return_type, v__ast__TypeFlag__optional) ? (_SLIT("Option_")) : (_SLIT(""))); - string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), 0xfe10, {.d_s = prefix}}, {_SLIT0, 0xfe10, {.d_s = return_type_sym->cname}}, {_SLIT0, 0xfe10, {.d_s = suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t3 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), /*115 &string*/0xfe10, {.d_s = prefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = return_type_sym->cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t3; } @@ -44385,7 +44430,7 @@ inline string v__ast__Table_map_name(v__ast__Table* t, v__ast__Type key_type, v_ v__ast__TypeSymbol* key_type_sym = v__ast__Table_sym(t, key_type); v__ast__TypeSymbol* value_type_sym = v__ast__Table_sym(t, value_type); string ptr = (v__ast__Type_is_ptr(value_type) ? (_SLIT("&")) : (_SLIT(""))); - string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("map["), 0xfe10, {.d_s = key_type_sym->name}}, {_SLIT("]"), 0xfe10, {.d_s = ptr}}, {_SLIT0, 0xfe10, {.d_s = value_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(4, _MOV((StrIntpData[]){{_SLIT("map["), /*115 &string*/0xfe10, {.d_s = key_type_sym->name}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = value_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -44394,7 +44439,7 @@ inline string v__ast__Table_map_cname(v__ast__Table* t, v__ast__Type key_type, v v__ast__TypeSymbol* key_type_sym = v__ast__Table_sym(t, key_type); v__ast__TypeSymbol* value_type_sym = v__ast__Table_sym(t, value_type); string suffix = (v__ast__Type_is_ptr(value_type) ? (_SLIT("_ptr")) : (_SLIT(""))); - string _t1 = string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Map_"), 0xfe10, {.d_s = key_type_sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = value_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), suffix); + string _t1 = string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Map_"), /*115 &string*/0xfe10, {.d_s = key_type_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = value_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), suffix); return _t1; } @@ -44491,11 +44536,11 @@ int v__ast__Table_find_or_register_multi_return(v__ast__Table* t, Array_v__ast__ for (int i = 0; i < mr_typs.len; ++i) { v__ast__Type mr_typ = ((v__ast__Type*)mr_typs.data)[i]; v__ast__TypeSymbol* mr_type_sym = v__ast__Table_sym(t, v__ast__mktyp(mr_typ)); - multi_return_string_string mr_31228 = (v__ast__Type_is_ptr(mr_typ) ? ((multi_return_string_string){.arg0=_SLIT("&"),.arg1=_SLIT("ref_")}) : ((multi_return_string_string){.arg0=_SLIT(""),.arg1=_SLIT("")})); - string ref = mr_31228.arg0; - string cref = mr_31228.arg1; - name = /*f*/string__plus(name, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ref}}, {_SLIT0, 0xfe10, {.d_s = mr_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); - cname = /*f*/string__plus(cname, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = cref}}, {_SLIT0, 0xfe10, {.d_s = mr_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + multi_return_string_string mr_31373 = (v__ast__Type_is_ptr(mr_typ) ? ((multi_return_string_string){.arg0=_SLIT("&"),.arg1=_SLIT("ref_")}) : ((multi_return_string_string){.arg0=_SLIT(""),.arg1=_SLIT("")})); + string ref = mr_31373.arg0; + string cref = mr_31373.arg1; + name = /*f*/string__plus(name, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ref}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + cname = /*f*/string__plus(cname, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cref}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_type_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i < mr_typs.len - 1) { name = /*f*/string__plus(name, _SLIT(", ")); } @@ -44512,8 +44557,8 @@ int v__ast__Table_find_or_register_multi_return(v__ast__Table* t, Array_v__ast__ } int v__ast__Table_find_or_register_fn_type(v__ast__Table* t, string mod, v__ast__Fn f, bool is_anon, bool has_decl) { - string name = (f.name.len == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("fn "), 0xfe10, {.d_s = v__ast__Table_fn_type_source_signature(t, (voidptr)&/*qq*/f)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (string_clone(f.name))); - string cname = (f.name.len == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("anon_fn_"), 0xfe10, {.d_s = v__ast__Table_fn_type_signature(t, (voidptr)&/*qq*/f)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (v__util__no_dots(string_clone(f.name)))); + string name = (f.name.len == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("fn "), /*115 &string*/0xfe10, {.d_s = v__ast__Table_fn_type_source_signature(t, (voidptr)&/*qq*/f)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (string_clone(f.name))); + string cname = (f.name.len == 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("anon_fn_"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_fn_type_signature(t, (voidptr)&/*qq*/f)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (v__util__no_dots(string_clone(f.name)))); bool anon = f.name.len == 0 || is_anon; int existing_idx = (*(int*)map_get(ADDR(map, t->type_idxs), &(string[]){name}, &(int[]){ 0 })); if (existing_idx > 0 && (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, existing_idx))->kind != v__ast__Kind__placeholder) { @@ -44538,22 +44583,22 @@ int v__ast__Table_add_placeholder_type(v__ast__Table* t, string name, v__ast__La inline v__ast__Type v__ast__Table_value_type(v__ast__Table* t, v__ast__Type typ) { v__ast__TypeSymbol* sym = v__ast__Table_final_sym(t, typ); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Type _t1 = array_info.elem_type; return _t1; } if (sym->kind == v__ast__Kind__array) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Type _t2 = info.elem_type; return _t2; } if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; v__ast__Type _t3 = info.elem_type; return _t3; } if (sym->kind == v__ast__Kind__map) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; v__ast__Type _t4 = info.value_type; return _t4; } @@ -44606,7 +44651,7 @@ bool v__ast__Table_register_fn_concrete_types(v__ast__Table* t, string fn_name, bool v__ast__Table_sumtype_has_variant(v__ast__Table* t, v__ast__Type parent, v__ast__Type variant, bool is_as) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(t, parent); if (parent_sym->kind == v__ast__Kind__sum_type) { - v__ast__SumType parent_info = /* as */ *(v__ast__SumType*)__as_cast((parent_sym->info)._v__ast__SumType,(parent_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ; + v__ast__SumType parent_info = /* as */ *(v__ast__SumType*)__as_cast((parent_sym->info)._v__ast__SumType,(parent_sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ; v__ast__TypeSymbol* var_sym = v__ast__Table_sym(t, variant); if (var_sym->kind == (v__ast__Kind__aggregate)) { @@ -44639,7 +44684,7 @@ VV_LOCAL_SYMBOL bool v__ast__Table_sumtype_check_variant_in_type(v__ast__Table* } VV_LOCAL_SYMBOL bool v__ast__Table_sumtype_check_aggregate_variant(v__ast__Table* t, v__ast__Type parent_type, v__ast__Type* aggregate_type, bool is_as) { - v__ast__Aggregate aggregate_sym = /* as */ *(v__ast__Aggregate*)__as_cast((v__ast__Table_sym(t, *aggregate_type)->info)._v__ast__Aggregate,(v__ast__Table_sym(t, *aggregate_type)->info)._typ, 468) /*expected idx: 468, name: v.ast.Aggregate */ ; + v__ast__Aggregate aggregate_sym = /* as */ *(v__ast__Aggregate*)__as_cast((v__ast__Table_sym(t, *aggregate_type)->info)._v__ast__Aggregate,(v__ast__Table_sym(t, *aggregate_type)->info)._typ, 469) /*expected idx: 469, name: v.ast.Aggregate */ ; for (int _t1 = 0; _t1 < aggregate_sym.types.len; ++_t1) { v__ast__Type var_type = ((v__ast__Type*)aggregate_sym.types.data)[_t1]; if (!v__ast__Table_sumtype_has_variant(t, parent_type, var_type, is_as)) { @@ -44652,9 +44697,9 @@ VV_LOCAL_SYMBOL bool v__ast__Table_sumtype_check_aggregate_variant(v__ast__Table } VV_LOCAL_SYMBOL bool v__ast__Table_sumtype_check_alias_variant(v__ast__Table* t, v__ast__Type parent_type, v__ast__Type alias_type, bool is_as) { - v__ast__SumType parent_sym = /* as */ *(v__ast__SumType*)__as_cast((v__ast__Table_sym(t, parent_type)->info)._v__ast__SumType,(v__ast__Table_sym(t, parent_type)->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ; + v__ast__SumType parent_sym = /* as */ *(v__ast__SumType*)__as_cast((v__ast__Table_sym(t, parent_type)->info)._v__ast__SumType,(v__ast__Table_sym(t, parent_type)->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ; if (!v__ast__Table_sumtype_check_variant_in_type(t, parent_sym, alias_type, is_as)) { - v__ast__Alias alias_info = /* as */ *(v__ast__Alias*)__as_cast((v__ast__Table_sym(t, alias_type)->info)._v__ast__Alias,(v__ast__Table_sym(t, alias_type)->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ; + v__ast__Alias alias_info = /* as */ *(v__ast__Alias*)__as_cast((v__ast__Table_sym(t, alias_type)->info)._v__ast__Alias,(v__ast__Table_sym(t, alias_type)->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ; bool _t1 = v__ast__Type_alias_eq(parent_type, alias_info.parent_type) || v__ast__Table_sumtype_has_variant(t, parent_type, alias_info.parent_type, is_as); return _t1; } @@ -44697,7 +44742,7 @@ Array_string v__ast__Table_known_type_names(v__ast__Table* t) { } bool v__ast__Table_has_deep_child_no_ref(v__ast__Table* t, v__ast__TypeSymbol* ts, string name) { - if ((ts->info)._typ == 455 /* v.ast.Struct */) { + if ((ts->info)._typ == 456 /* v.ast.Struct */) { for (int _t1 = 0; _t1 < (*ts->info._v__ast__Struct).fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)(*ts->info._v__ast__Struct).fields.data)[_t1]; v__ast__TypeSymbol* sym = v__ast__Table_sym(t, field.typ); @@ -44791,7 +44836,7 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type bool _t3 = false; return _t3; } - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { bool _t4 = false; return _t4; @@ -44802,7 +44847,7 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type bool _t5 = false; return _t5; } - if ((inter_sym->info)._typ == 473 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 474 /* v.ast.Interface */) { Array_v__ast__Attr attrs = (*(v__ast__InterfaceDecl*)map_get(ADDR(map, t->interfaces), &(int[]){inter_typ}, &(v__ast__InterfaceDecl[]){ (v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,} })).attrs; for (int _t6 = 0; _t6 < attrs.len; ++_t6) { v__ast__Attr attr = ((v__ast__Attr*)attrs.data)[_t6]; @@ -44890,12 +44935,12 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, return _t4; } } - if (sym->info._typ == 450 /* v.ast.Array */) { + if (sym->info._typ == 451 /* v.ast.Array */) { v__ast__Type elem_type = (*sym->info._v__ast__Array).elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(t, elem_type); int dims = 1; for (;;) { - if (!((elem_sym->info)._typ == 450 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 451 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; @@ -44915,7 +44960,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 478 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 479 /* v.ast.ArrayFixed */) { Option_v__ast__Type _t8; if (_t8 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__ArrayFixed).elem_type, generic_names, concrete_types), _t8.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t8.data; @@ -44931,7 +44976,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 479 /* v.ast.Chan */) { + else if (sym->info._typ == 480 /* v.ast.Chan */) { Option_v__ast__Type _t11; if (_t11 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Chan).elem_type, generic_names, concrete_types), _t11.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t11.data; @@ -44947,7 +44992,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 482 /* v.ast.FnType */) { + else if (sym->info._typ == 483 /* v.ast.FnType */) { v__ast__Fn func = (*sym->info._v__ast__FnType).func; bool has_generic = false; if (v__ast__Type_has_flag(func.return_type, v__ast__TypeFlag__generic)) { @@ -44986,7 +45031,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, return _t18; } } - else if (sym->info._typ == 481 /* v.ast.MultiReturn */) { + else if (sym->info._typ == 482 /* v.ast.MultiReturn */) { Array_v__ast__Type types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); bool type_changed = false; for (int _t19 = 0; _t19 < (*sym->info._v__ast__MultiReturn).types.len; ++_t19) { @@ -45024,7 +45069,7 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 451 /* v.ast.Map */) { + else if (sym->info._typ == 452 /* v.ast.Map */) { bool type_changed = false; v__ast__Type unwrapped_key_type = (*sym->info._v__ast__Map).key_type; v__ast__Type unwrapped_value_type = (*sym->info._v__ast__Map).value_type; @@ -45053,9 +45098,9 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } } - else if (sym->info._typ == 455 /* v.ast.Struct */) { + else if (sym->info._typ == 456 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { - string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*sym->info._v__ast__Struct).generic_types.len; ++i) { Option_v__ast__Type _t31; if (_t31 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*sym->info._v__ast__Struct).generic_types, i)), generic_names, concrete_types), _t31.state == 0) { @@ -45077,9 +45122,9 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, return _t32; } } - else if (sym->info._typ == 473 /* v.ast.Interface */) { + else if (sym->info._typ == 474 /* v.ast.Interface */) { if ((*sym->info._v__ast__Interface).is_generic) { - string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*sym->info._v__ast__Interface).generic_types.len; ++i) { Option_v__ast__Type _t33; if (_t33 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*sym->info._v__ast__Interface).generic_types, i)), generic_names, concrete_types), _t33.state == 0) { @@ -45101,9 +45146,9 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, return _t34; } } - else if (sym->info._typ == 474 /* v.ast.SumType */) { + else if (sym->info._typ == 475 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { - string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + string nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*sym->info._v__ast__SumType).generic_types.len; ++i) { Option_v__ast__Type _t35; if (_t35 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*sym->info._v__ast__SumType).generic_types, i)), generic_names, concrete_types), _t35.state == 0) { @@ -45139,12 +45184,12 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty string nrt = _SLIT(""); string c_nrt = _SLIT(""); v__ast__TypeSymbol* ts = v__ast__Table_sym(t, typ); - if (ts->info._typ == 450 /* v.ast.Array */) { + if (ts->info._typ == 451 /* v.ast.Array */) { v__ast__Type elem_type = (*ts->info._v__ast__Array).elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(t, elem_type); int dims = 1; for (;;) { - if (!((elem_sym->info)._typ == 450 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 451 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; @@ -45154,32 +45199,32 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty v__ast__Type _t1 = v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), typ), v__ast__TypeFlag__generic); return _t1; } - else if (ts->info._typ == 478 /* v.ast.ArrayFixed */) { + else if (ts->info._typ == 479 /* v.ast.ArrayFixed */) { v__ast__Type unwrap_typ = v__ast__Table_unwrap_generic_type(t, (*ts->info._v__ast__ArrayFixed).elem_type, generic_names, concrete_types); int idx = v__ast__Table_find_or_register_array_fixed(t, unwrap_typ, (*ts->info._v__ast__ArrayFixed).size, v__ast__None_to_sumtype_v__ast__Expr(ADDR(v__ast__None, (((v__ast__None){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}))))); v__ast__Type _t2 = v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), typ), v__ast__TypeFlag__generic); return _t2; } - else if (ts->info._typ == 479 /* v.ast.Chan */) { + else if (ts->info._typ == 480 /* v.ast.Chan */) { v__ast__Type unwrap_typ = v__ast__Table_unwrap_generic_type(t, (*ts->info._v__ast__Chan).elem_type, generic_names, concrete_types); int idx = v__ast__Table_find_or_register_chan(t, unwrap_typ, v__ast__Type_nr_muls(unwrap_typ) > 0); v__ast__Type _t3 = v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), typ), v__ast__TypeFlag__generic); return _t3; } - else if (ts->info._typ == 451 /* v.ast.Map */) { + else if (ts->info._typ == 452 /* v.ast.Map */) { v__ast__Type unwrap_key_type = v__ast__Table_unwrap_generic_type(t, (*ts->info._v__ast__Map).key_type, generic_names, concrete_types); v__ast__Type unwrap_value_type = v__ast__Table_unwrap_generic_type(t, (*ts->info._v__ast__Map).value_type, generic_names, concrete_types); int idx = v__ast__Table_find_or_register_map(t, unwrap_key_type, unwrap_value_type); v__ast__Type _t4 = v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), typ), v__ast__TypeFlag__generic); return _t4; } - else if (ts->info._typ == 455 /* v.ast.Struct */) { + else if (ts->info._typ == 456 /* v.ast.Struct */) { if (!(*ts->info._v__ast__Struct).is_generic) { v__ast__Type _t5 = typ; return _t5; } - nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); - c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); + nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*ts->info._v__ast__Struct).generic_types.len; ++i) { Option_v__ast__Type _t6; if (_t6 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*ts->info._v__ast__Struct).generic_types, i)), generic_names, concrete_types), _t6.state == 0) { @@ -45241,13 +45286,13 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } } - else if (ts->info._typ == 473 /* v.ast.Interface */) { + else if (ts->info._typ == 474 /* v.ast.Interface */) { if (!(*ts->info._v__ast__Interface).is_generic) { v__ast__Type _t14 = typ; return _t14; } - nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); - c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); + nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*ts->info._v__ast__Interface).generic_types.len; ++i) { Option_v__ast__Type _t15; if (_t15 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*ts->info._v__ast__Interface).generic_types, i)), generic_names, concrete_types), _t15.state == 0) { @@ -45309,13 +45354,13 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } } - else if (ts->info._typ == 474 /* v.ast.SumType */) { + else if (ts->info._typ == 475 /* v.ast.SumType */) { if (!(*ts->info._v__ast__SumType).is_generic) { v__ast__Type _t23 = typ; return _t23; } - nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); - c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); + nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->name}}, {_SLIT("<"), 0, { .d_c = 0 }}})); + c_nrt = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ts->cname}}, {_SLIT("_T_"), 0, { .d_c = 0 }}})); for (int i = 0; i < (*ts->info._v__ast__SumType).generic_types.len; ++i) { Option_v__ast__Type _t24; if (_t24 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get((*ts->info._v__ast__SumType).generic_types, i)), generic_names, concrete_types), _t24.state == 0) { @@ -45381,7 +45426,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty else { } ; - if (ts->info._typ == 455 /* v.ast.Struct */) { + if (ts->info._typ == 456 /* v.ast.Struct */) { v__ast__Struct info = (*ts->info._v__ast__Struct); info.is_generic = false; info.concrete_types = final_concrete_types; @@ -45395,7 +45440,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty v__ast__Type _t33 = v__ast__Type_clear_flag(v__ast__Type_derive(v__ast__new_type(new_idx), typ), v__ast__TypeFlag__generic); return _t33; } - else if (ts->info._typ == 474 /* v.ast.SumType */) { + else if (ts->info._typ == 475 /* v.ast.SumType */) { Array_v__ast__Type variants = array_clone_to_depth(&(*ts->info._v__ast__SumType).variants, 0); 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)) { @@ -45425,7 +45470,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty v__ast__Type _t36 = v__ast__Type_clear_flag(v__ast__Type_derive(v__ast__new_type(new_idx), typ), v__ast__TypeFlag__generic); return _t36; } - else if (ts->info._typ == 473 /* v.ast.Interface */) { + else if (ts->info._typ == 474 /* v.ast.Interface */) { Array_v__ast__Fn imethods = array_clone_to_depth(&(*ts->info._v__ast__Interface).methods, 0); for (int _t37 = 0; _t37 < imethods.len; ++_t37) { v__ast__Fn* method = ((v__ast__Fn*)imethods.data) + _t37; @@ -45478,29 +45523,29 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Array_v__ast__Type generic_types) { v__ast__TypeSymbol* ts = v__ast__Table_sym(t, typ); - if (ts->info._typ == 450 /* v.ast.Array */) { + if (ts->info._typ == 451 /* v.ast.Array */) { v__ast__Type elem_type = (*ts->info._v__ast__Array).elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(t, elem_type); int dims = 1; for (;;) { - if (!((elem_sym->info)._typ == 450 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 451 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; } v__ast__Table_replace_generic_type(t, elem_type, generic_types); } - else if (ts->info._typ == 478 /* v.ast.ArrayFixed */) { + else if (ts->info._typ == 479 /* v.ast.ArrayFixed */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__ArrayFixed).elem_type, generic_types); } - else if (ts->info._typ == 479 /* v.ast.Chan */) { + else if (ts->info._typ == 480 /* v.ast.Chan */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__Chan).elem_type, generic_types); } - else if (ts->info._typ == 451 /* v.ast.Map */) { + else if (ts->info._typ == 452 /* v.ast.Map */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__Map).key_type, generic_types); v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__Map).value_type, generic_types); } - else if (ts->info._typ == 455 /* v.ast.Struct */) { + else if (ts->info._typ == 456 /* v.ast.Struct */) { Array_string _t1 = {0}; Array_v__ast__Type _t1_orig = (*ts->info._v__ast__Struct).generic_types; int _t1_len = _t1_orig.len; @@ -45523,7 +45568,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra } (*ts->info._v__ast__Struct).generic_types = generic_types; } - else if (ts->info._typ == 473 /* v.ast.Interface */) { + else if (ts->info._typ == 474 /* v.ast.Interface */) { Array_string _t4 = {0}; Array_v__ast__Type _t4_orig = (*ts->info._v__ast__Interface).generic_types; int _t4_len = _t4_orig.len; @@ -45546,7 +45591,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra } (*ts->info._v__ast__Interface).generic_types = generic_types; } - else if (ts->info._typ == 474 /* v.ast.SumType */) { + else if (ts->info._typ == 475 /* v.ast.SumType */) { Array_string _t7 = {0}; Array_v__ast__Type _t7_orig = (*ts->info._v__ast__SumType).generic_types; int _t7_len = _t7_orig.len; @@ -45579,16 +45624,16 @@ 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, 483) /*expected idx: 483, name: v.ast.GenericInst */ ; + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast(((*typ)->info)._v__ast__GenericInst,((*typ)->info)._typ, 484) /*expected idx: 484, 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; continue; } - if (parent->info._typ == 455 /* v.ast.Struct */) { + if (parent->info._typ == 456 /* v.ast.Struct */) { v__ast__Struct parent_info = (*parent->info._v__ast__Struct); if (!parent_info.is_generic) { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); + v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); continue; } @@ -45632,14 +45677,14 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } } } else { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of struct `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); + v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of struct `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } - else if (parent->info._typ == 473 /* v.ast.Interface */) { + else if (parent->info._typ == 474 /* v.ast.Interface */) { v__ast__Interface parent_info = (*parent->info._v__ast__Interface); if (!parent_info.is_generic) { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); + v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); continue; } @@ -45698,14 +45743,14 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { (*typ)->kind = parent->kind; (*typ)->methods = all_methods; } else { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of interface `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); + 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(); } } - else if (parent->info._typ == 474 /* v.ast.SumType */) { + else if (parent->info._typ == 475 /* v.ast.SumType */) { v__ast__SumType parent_info = (*parent->info._v__ast__SumType); if (!parent_info.is_generic) { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("sumtype `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); + v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("sumtype `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); continue; } @@ -45748,7 +45793,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { (*typ)->is_pub = true; (*typ)->kind = parent->kind; } else { - v__util__verror(_SLIT("generic error"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of sumtype `"), 0xfe10, {.d_s = parent->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}}))); + 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(); } } @@ -45983,7 +46028,7 @@ inline v__ast__Type v__ast__Type_ref(v__ast__Type t) { inline v__ast__Type v__ast__Type_deref(v__ast__Type t) { int nr_muls = ((((int)(t)) >> 16) & 0xff); if (nr_muls == 0) { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("deref: type `"), 0xfe10, {.d_s = v__ast__Type_str(t)}}, {_SLIT("` is not a pointer"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("deref: type `"), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(t)}}, {_SLIT("` is not a pointer"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__ast__Type _t1 = ((((int)(t)) & 0xff00ffff) | ((int)(((u32)(nr_muls - 1)) << 16U))); @@ -46017,7 +46062,7 @@ inline bool v__ast__Type_has_flag(v__ast__Type t, v__ast__TypeFlag flag) { Array_string v__ast__TypeSymbol_debug(v__ast__TypeSymbol* ts) { Array_string res = __new_array_with_default(0, 0, sizeof(string), 0); v__ast__TypeSymbol_dbg_common(ts, &/*arr*/res); - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("info: "), 0xfe10, {.d_s = v__ast__TypeInfo_str(ts->info)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("info: "), /*115 &v.ast.TypeInfo*/0xfe10, {.d_s = v__ast__TypeInfo_str(ts->info)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); Array_string _t3 = {0}; Array_v__ast__Fn _t3_orig = ts->methods; int _t3_len = _t3_orig.len; @@ -46028,7 +46073,7 @@ Array_string v__ast__TypeSymbol_debug(v__ast__TypeSymbol* ts) { string ti = v__ast__Fn_str(it); array_push((array*)&_t3, &ti); } - array_push((array*)&res, _MOV((string[]){ string_clone(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("methods ("), 0xfe07, {.d_i32 = ts->methods.len}}, {_SLIT("): "), 0, { .d_c = 0 }}})), Array_string_join(_t3, _SLIT(", ")))) })); + array_push((array*)&res, _MOV((string[]){ string_clone(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("methods ("), /*100 &int*/0xfe07, {.d_i32 = ts->methods.len}}, {_SLIT("): "), 0, { .d_c = 0 }}})), Array_string_join(_t3, _SLIT(", ")))) })); Array_string _t5 = res; return _t5; } @@ -46041,18 +46086,18 @@ Array_string v__ast__TypeSymbol_dbg(v__ast__TypeSymbol* ts) { } VV_LOCAL_SYMBOL void v__ast__TypeSymbol_dbg_common(v__ast__TypeSymbol* ts, Array_string* res) { - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("idx: 0x"), 0xfe10, {.d_s = int_hex(ts->idx)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parent_idx: 0x"), 0xfe10, {.d_s = int_hex(ts->parent_idx)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("mod: "), 0xfe10, {.d_s = ts->mod}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("name: "), 0xfe10, {.d_s = ts->name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cname: "), 0xfe10, {.d_s = ts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("kind: "), 0xfe10, {.d_s = v__ast__Kind_str(ts->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("is_pub: "), 0xfe10, {.d_s = ts->is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("language: "), 0xfe10, {.d_s = v__ast__Language_str(ts->language)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("idx: 0x"), /*115 &string*/0xfe10, {.d_s = int_hex(ts->idx)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("parent_idx: 0x"), /*115 &string*/0xfe10, {.d_s = int_hex(ts->parent_idx)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("mod: "), /*115 &string*/0xfe10, {.d_s = ts->mod}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("name: "), /*115 &string*/0xfe10, {.d_s = ts->name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cname: "), /*115 &string*/0xfe10, {.d_s = ts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("kind: "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(ts->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("is_pub: "), /*115 &bool*/0xfe10, {.d_s = ts->is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("language: "), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(ts->language)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } string v__ast__Type_str(v__ast__Type t) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("ast.Type(0x"), 0xfe10, {.d_s = int_hex(t)}}, {_SLIT(" = "), 0xfe06, {.d_u32 = ((u32)(t))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("ast.Type(0x"), /*115 &string*/0xfe10, {.d_s = int_hex(t)}}, {_SLIT(" = "), /*117 &u32*/0xfe06, {.d_u32 = ((u32)(t))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); return _t1; } @@ -46063,9 +46108,9 @@ string v__ast__Table_type_str(v__ast__Table* t, v__ast__Type typ) { Array_string v__ast__Type_debug(v__ast__Type t) { Array_string res = __new_array_with_default(0, 0, sizeof(string), 0); - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("idx: 0x"), 0x10fe10, {.d_s = int_hex(v__ast__Type_idx(t))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("type: 0x"), 0x10fe10, {.d_s = int_hex(t)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("nr_muls: "), 0xfe07, {.d_i32 = v__ast__Type_nr_muls(t)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("idx: 0x"), /*115 &string*/0x10fe10, {.d_s = int_hex(v__ast__Type_idx(t))}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("type: 0x"), /*115 &string*/0x10fe10, {.d_s = int_hex(t)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("nr_muls: "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_nr_muls(t)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); if (v__ast__Type_has_flag(t, v__ast__TypeFlag__optional)) { array_push((array*)&res, _MOV((string[]){ string_clone(_SLIT("optional")) })); } @@ -46241,20 +46286,20 @@ string v__ast__TypeSymbol_str(v__ast__TypeSymbol* t) { // Attr: [noreturn] VNORETURN VV_LOCAL_SYMBOL void v__ast__TypeSymbol_no_info_panic(v__ast__TypeSymbol* t, string fname) { - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fname}}, {_SLIT(": no info for type: "), 0xfe10, {.d_s = t->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT(": no info for type: "), /*115 &string*/0xfe10, {.d_s = t->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); while(1); } // Attr: [inline] inline v__ast__Enum v__ast__TypeSymbol_enum_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 484 /* v.ast.Enum */) { + if ((t->info)._typ == 485 /* v.ast.Enum */) { v__ast__Enum _t1 = (*t->info._v__ast__Enum); return _t1; } - if ((t->info)._typ == 470 /* v.ast.Alias */) { + if ((t->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 484 /* v.ast.Enum */) { + if ((fsym->info)._typ == 485 /* v.ast.Enum */) { v__ast__Enum _t2 = (*fsym->info._v__ast__Enum); return _t2; } @@ -46266,13 +46311,13 @@ inline v__ast__Enum v__ast__TypeSymbol_enum_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__MultiReturn v__ast__TypeSymbol_mr_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 481 /* v.ast.MultiReturn */) { + if ((t->info)._typ == 482 /* v.ast.MultiReturn */) { v__ast__MultiReturn _t1 = (*t->info._v__ast__MultiReturn); return _t1; } - if ((t->info)._typ == 470 /* v.ast.Alias */) { + if ((t->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 481 /* v.ast.MultiReturn */) { + if ((fsym->info)._typ == 482 /* v.ast.MultiReturn */) { v__ast__MultiReturn _t2 = (*fsym->info._v__ast__MultiReturn); return _t2; } @@ -46284,13 +46329,13 @@ inline v__ast__MultiReturn v__ast__TypeSymbol_mr_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__Array v__ast__TypeSymbol_array_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 450 /* v.ast.Array */) { + if ((t->info)._typ == 451 /* v.ast.Array */) { v__ast__Array _t1 = (*t->info._v__ast__Array); return _t1; } - if ((t->info)._typ == 470 /* v.ast.Alias */) { + if ((t->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 450 /* v.ast.Array */) { + if ((fsym->info)._typ == 451 /* v.ast.Array */) { v__ast__Array _t2 = (*fsym->info._v__ast__Array); return _t2; } @@ -46302,13 +46347,13 @@ inline v__ast__Array v__ast__TypeSymbol_array_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__ArrayFixed v__ast__TypeSymbol_array_fixed_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 478 /* v.ast.ArrayFixed */) { + if ((t->info)._typ == 479 /* v.ast.ArrayFixed */) { v__ast__ArrayFixed _t1 = (*t->info._v__ast__ArrayFixed); return _t1; } - if ((t->info)._typ == 470 /* v.ast.Alias */) { + if ((t->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 478 /* v.ast.ArrayFixed */) { + if ((fsym->info)._typ == 479 /* v.ast.ArrayFixed */) { v__ast__ArrayFixed _t2 = (*fsym->info._v__ast__ArrayFixed); return _t2; } @@ -46320,13 +46365,13 @@ inline v__ast__ArrayFixed v__ast__TypeSymbol_array_fixed_info(v__ast__TypeSymbol // Attr: [inline] inline v__ast__Chan v__ast__TypeSymbol_chan_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 479 /* v.ast.Chan */) { + if ((t->info)._typ == 480 /* v.ast.Chan */) { v__ast__Chan _t1 = (*t->info._v__ast__Chan); return _t1; } - if ((t->info)._typ == 470 /* v.ast.Alias */) { + if ((t->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 479 /* v.ast.Chan */) { + if ((fsym->info)._typ == 480 /* v.ast.Chan */) { v__ast__Chan _t2 = (*fsym->info._v__ast__Chan); return _t2; } @@ -46338,13 +46383,13 @@ inline v__ast__Chan v__ast__TypeSymbol_chan_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__Thread v__ast__TypeSymbol_thread_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 480 /* v.ast.Thread */) { + if ((t->info)._typ == 481 /* v.ast.Thread */) { v__ast__Thread _t1 = (*t->info._v__ast__Thread); return _t1; } - if ((t->info)._typ == 470 /* v.ast.Alias */) { + if ((t->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 480 /* v.ast.Thread */) { + if ((fsym->info)._typ == 481 /* v.ast.Thread */) { v__ast__Thread _t2 = (*fsym->info._v__ast__Thread); return _t2; } @@ -46356,13 +46401,13 @@ inline v__ast__Thread v__ast__TypeSymbol_thread_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__Map v__ast__TypeSymbol_map_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 451 /* v.ast.Map */) { + if ((t->info)._typ == 452 /* v.ast.Map */) { v__ast__Map _t1 = (*t->info._v__ast__Map); return _t1; } - if ((t->info)._typ == 470 /* v.ast.Alias */) { + if ((t->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 451 /* v.ast.Map */) { + if ((fsym->info)._typ == 452 /* v.ast.Map */) { v__ast__Map _t2 = (*fsym->info._v__ast__Map); return _t2; } @@ -46374,13 +46419,13 @@ inline v__ast__Map v__ast__TypeSymbol_map_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__Struct v__ast__TypeSymbol_struct_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 455 /* v.ast.Struct */) { + if ((t->info)._typ == 456 /* v.ast.Struct */) { v__ast__Struct _t1 = (*t->info._v__ast__Struct); return _t1; } - if ((t->info)._typ == 470 /* v.ast.Alias */) { + if ((t->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__Alias).parent_type); - if ((fsym->info)._typ == 455 /* v.ast.Struct */) { + if ((fsym->info)._typ == 456 /* v.ast.Struct */) { v__ast__Struct _t2 = (*fsym->info._v__ast__Struct); return _t2; } @@ -46392,13 +46437,13 @@ inline v__ast__Struct v__ast__TypeSymbol_struct_info(v__ast__TypeSymbol* t) { // Attr: [inline] inline v__ast__SumType v__ast__TypeSymbol_sumtype_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 474 /* v.ast.SumType */) { + if ((t->info)._typ == 475 /* v.ast.SumType */) { v__ast__SumType _t1 = (*t->info._v__ast__SumType); return _t1; } - if ((t->info)._typ == 474 /* v.ast.SumType */) { + if ((t->info)._typ == 475 /* v.ast.SumType */) { v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(global_table, (*t->info._v__ast__SumType).parent_type); - if ((fsym->info)._typ == 474 /* v.ast.SumType */) { + if ((fsym->info)._typ == 475 /* v.ast.SumType */) { v__ast__SumType _t2 = (*fsym->info._v__ast__SumType); return _t2; } @@ -46410,7 +46455,7 @@ inline v__ast__SumType v__ast__TypeSymbol_sumtype_info(v__ast__TypeSymbol* t) { bool v__ast__TypeSymbol_is_heap(v__ast__TypeSymbol* t) { if (t->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((t->info)._v__ast__Struct,(t->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((t->info)._v__ast__Struct,(t->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; bool _t1 = info.is_heap; return _t1; } else { @@ -46464,7 +46509,7 @@ inline bool v__ast__TypeSymbol_is_pointer(v__ast__TypeSymbol* t) { inline bool v__ast__TypeSymbol_is_int(v__ast__TypeSymbol* t) { bool res = (t->kind == v__ast__Kind__i8 || t->kind == v__ast__Kind__i16 || t->kind == v__ast__Kind__int || t->kind == v__ast__Kind__i64 || t->kind == v__ast__Kind__isize || t->kind == v__ast__Kind__u8 || t->kind == v__ast__Kind__u16 || t->kind == v__ast__Kind__u32 || t->kind == v__ast__Kind__u64 || t->kind == v__ast__Kind__usize || t->kind == v__ast__Kind__int_literal || t->kind == v__ast__Kind__rune); if (!res && t->kind == v__ast__Kind__alias) { - bool _t1 = v__ast__Type_is_number((/* as */ *(v__ast__Alias*)__as_cast((t->info)._v__ast__Alias,(t->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type); + bool _t1 = v__ast__Type_is_number((/* as */ *(v__ast__Alias*)__as_cast((t->info)._v__ast__Alias,(t->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type); return _t1; } bool _t2 = res; @@ -46572,7 +46617,7 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { } case v__ast__Kind__alias: { - int _t9 = v__ast__Table_type_size(t, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type); + int _t9 = v__ast__Table_type_size(t, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type); return _t9; break; } @@ -46583,7 +46628,7 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { int max_alignment = 0; int total_size = 0; Array_v__ast__Type _t10; /* if prepend */ - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { Array_v__ast__Type _t11 = {0}; Array_v__ast__StructField _t11_orig = (*sym->info._v__ast__Struct).fields; int _t11_len = _t11_orig.len; @@ -46596,7 +46641,7 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { } _t10 =_t11; } else { - _t10 = (/* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 481) /*expected idx: 481, name: v.ast.MultiReturn */ ).types; + _t10 = (/* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ).types; } Array_v__ast__Type types = _t10; for (int _t13 = 0; _t13 < types.len; ++_t13) { @@ -46616,15 +46661,15 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { case v__ast__Kind__interface_: case v__ast__Kind__aggregate: { - if (sym->info._typ == 474 /* v.ast.SumType */) { + if (sym->info._typ == 475 /* v.ast.SumType */) { int _t15 = ((*sym->info._v__ast__SumType).fields.len + 2) * t->pointer_size; return _t15; } - else if (sym->info._typ == 468 /* v.ast.Aggregate */) { + else if (sym->info._typ == 469 /* v.ast.Aggregate */) { int _t16 = ((*sym->info._v__ast__Aggregate).fields.len + 2) * t->pointer_size; return _t16; } - else if (sym->info._typ == 473 /* v.ast.Interface */) { + else if (sym->info._typ == 474 /* v.ast.Interface */) { int res = ((*sym->info._v__ast__Interface).fields.len + 2) * t->pointer_size; for (int _t17 = 0; _t17 < (*sym->info._v__ast__Interface).embeds.len; ++_t17) { v__ast__Type etyp = ((v__ast__Type*)(*sym->info._v__ast__Interface).embeds.data)[_t17]; @@ -46643,7 +46688,7 @@ int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) { } case v__ast__Kind__array_fixed: { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; int _t20 = info.size * v__ast__Table_type_size(t, info.elem_type); return _t20; break; @@ -46959,9 +47004,9 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { res = v__ast__Table_type_to_str_using_aliases(t, v__ast__Table_value_type(t, typ), import_aliases); } else { - if ((sym->info)._typ == 450 /* v.ast.Array */) { + if ((sym->info)._typ == 451 /* v.ast.Array */) { string elem_str = v__ast__Table_type_to_str_using_aliases(t, (*sym->info._v__ast__Array).elem_type, import_aliases); - res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[]"), 0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("[]"), /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { res = _SLIT("array"); } @@ -46970,19 +47015,19 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } case v__ast__Kind__array_fixed: { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; string elem_str = v__ast__Table_type_to_str_using_aliases(t, info.elem_type, import_aliases); - if ((info.size_expr)._typ == 301 /* v.ast.EmptyExpr */) { - res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), 0xfe07, {.d_i32 = info.size}}, {_SLIT("]"), 0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + if ((info.size_expr)._typ == 302 /* v.ast.EmptyExpr */) { + res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { - res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = v__ast__Expr_str(info.size_expr)}}, {_SLIT("]"), 0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("["), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(info.size_expr)}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } break; } case v__ast__Kind__chan: { if (!string__eq(sym->mod, _SLIT("builtin")) && !string__eq(sym->name, _SLIT("chan"))) { - v__ast__Chan info = /* as */ *(v__ast__Chan*)__as_cast((sym->info)._v__ast__Chan,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.Chan */ ; + v__ast__Chan info = /* as */ *(v__ast__Chan*)__as_cast((sym->info)._v__ast__Chan,(sym->info)._typ, 480) /*expected idx: 480, name: v.ast.Chan */ ; v__ast__Type elem_type = info.elem_type; string mut_str = _SLIT(""); if (info.is_mut) { @@ -46990,13 +47035,13 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty elem_type = v__ast__Type_set_nr_muls(elem_type, v__ast__Type_nr_muls(elem_type) - 1); } string elem_str = v__ast__Table_type_to_str_using_aliases(t, elem_type, import_aliases); - res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("chan "), 0xfe10, {.d_s = mut_str}}, {_SLIT0, 0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("chan "), /*115 &string*/0xfe10, {.d_s = mut_str}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } break; } case v__ast__Kind__function: { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; if (!t->is_fmt) { res = v__ast__Table_fn_signature(t, (voidptr)&/*qq*/info.func, ((v__ast__FnSignatureOpts){.skip_receiver = 0,.type_only = true,})); } else { @@ -47025,16 +47070,16 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty string _t4 = _SLIT("map"); return _t4; } - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; string key_str = v__ast__Table_type_to_str_using_aliases(t, info.key_type, import_aliases); string val_str = v__ast__Table_type_to_str_using_aliases(t, info.value_type, import_aliases); - res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("map["), 0xfe10, {.d_s = key_str}}, {_SLIT("]"), 0xfe10, {.d_s = val_str}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(3, _MOV((StrIntpData[]){{_SLIT("map["), /*115 &string*/0xfe10, {.d_s = key_str}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = val_str}}, {_SLIT0, 0, { .d_c = 0 }}})); break; } case v__ast__Kind__multi_return: { res = _SLIT("("); - v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 481) /*expected idx: 481, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; for (int i = 0; i < info.types.len; ++i) { v__ast__Type typ2 = ((v__ast__Type*)info.types.data)[i]; if (i > 0) { @@ -47050,7 +47095,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty case v__ast__Kind__sum_type: { if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - if (sym->info._typ == 455 /* v.ast.Struct */) { + if (sym->info._typ == 456 /* v.ast.Struct */) { res = /*f*/string__plus(res, _SLIT("<")); for (int i = 0; i < (*sym->info._v__ast__Struct).generic_types.len; ++i) { v__ast__Type gtyp = ((v__ast__Type*)(*sym->info._v__ast__Struct).generic_types.data)[i]; @@ -47061,7 +47106,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } res = /*f*/string__plus(res, _SLIT(">")); } - else if (sym->info._typ == 473 /* v.ast.Interface */) { + else if (sym->info._typ == 474 /* v.ast.Interface */) { res = /*f*/string__plus(res, _SLIT("<")); for (int i = 0; i < (*sym->info._v__ast__Interface).generic_types.len; ++i) { v__ast__Type gtyp = ((v__ast__Type*)(*sym->info._v__ast__Interface).generic_types.data)[i]; @@ -47072,7 +47117,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } res = /*f*/string__plus(res, _SLIT(">")); } - else if (sym->info._typ == 474 /* v.ast.SumType */) { + else if (sym->info._typ == 475 /* v.ast.SumType */) { res = /*f*/string__plus(res, _SLIT("<")); for (int i = 0; i < (*sym->info._v__ast__SumType).generic_types.len; ++i) { v__ast__Type gtyp = ((v__ast__Type*)(*sym->info._v__ast__SumType).generic_types.data)[i]; @@ -47087,7 +47132,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty else { } ; - } else if ((sym->info)._typ == 474 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ).is_anon) { + } else if ((sym->info)._typ == 475 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ).is_anon) { Array_string _t5 = {0}; Array_v__ast__Type _t5_orig = (*sym->info._v__ast__SumType).variants; int _t5_len = _t5_orig.len; @@ -47099,7 +47144,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty array_push((array*)&_t5, &ti); } Array_string variant_names =_t5; - res = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = Array_string_join(variant_names, _SLIT(" | "))}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = Array_string_join(variant_names, _SLIT(" | "))}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { res = v__ast__Table_shorten_user_defined_typenames(t, res, import_aliases); } @@ -47107,7 +47152,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } case v__ast__Kind__generic_inst: { - v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast((sym->info)._v__ast__GenericInst,(sym->info)._typ, 483) /*expected idx: 483, name: v.ast.GenericInst */ ; + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast((sym->info)._v__ast__GenericInst,(sym->info)._typ, 484) /*expected idx: 484, name: v.ast.GenericInst */ ; res = v__ast__Table_shorten_user_defined_typenames(t, string_all_before(sym->name, _SLIT("<")), import_aliases); res = /*f*/string__plus(res, _SLIT("<")); for (int i = 0; i < info.concrete_types.len; ++i) { @@ -47126,8 +47171,12 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty string _t7 = _SLIT("?"); return _t7; } - string _t8 = _SLIT("void"); - return _t8; + if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__result)) { + string _t8 = _SLIT("!"); + return _t8; + } + string _t9 = _SLIT("void"); + return _t9; break; } case v__ast__Kind__thread: @@ -47165,10 +47214,13 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty res = string__plus(strings__repeat('&', nr_muls), res); } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__optional)) { - res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("?"), 0xfe10, {.d_s = res}}, {_SLIT0, 0, { .d_c = 0 }}})); + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("?"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT0, 0, { .d_c = 0 }}})); } - string _t9 = res; - return _t9; + if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__result)) { + res = str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT0, 0, { .d_c = 0 }}})); + } + string _t10 = res; + return _t10; } VV_LOCAL_SYMBOL string v__ast__Table_shorten_user_defined_typenames(v__ast__Table* t, string originalname, Map_string_string import_aliases) { @@ -47322,13 +47374,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ return _t2; } v__ast__Table* table = global_table; - if (t->info._typ == 455 /* v.ast.Struct */) { + if (t->info._typ == 456 /* v.ast.Struct */) { if (v__ast__Type_has_flag((*t->info._v__ast__Struct).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(table, (*t->info._v__ast__Struct).parent_type); Option_v__ast__Fn _t3; if (_t3 = v__ast__TypeSymbol_find_method(parent_sym, name), _t3.state == 0) { v__ast__Fn x = *(v__ast__Fn*)_t3.data; - if (parent_sym->info._typ == 455 /* v.ast.Struct */) { + if (parent_sym->info._typ == 456 /* v.ast.Struct */) { v__ast__Fn method = x; Array_string _t4 = {0}; Array_v__ast__Type _t4_orig = (*parent_sym->info._v__ast__Struct).generic_types; @@ -47365,7 +47417,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t9), sizeof(v__ast__Fn)); return _t9; } - else if (parent_sym->info._typ == 473 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 474 /* v.ast.Interface */) { v__ast__Fn method = x; Array_string _t10 = {0}; Array_v__ast__Type _t10_orig = (*parent_sym->info._v__ast__Interface).generic_types; @@ -47402,7 +47454,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t15), sizeof(v__ast__Fn)); return _t15; } - else if (parent_sym->info._typ == 474 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 475 /* v.ast.SumType */) { v__ast__Fn method = x; Array_string _t16 = {0}; Array_v__ast__Type _t16_orig = (*parent_sym->info._v__ast__SumType).generic_types; @@ -47446,13 +47498,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ } } } - else if (t->info._typ == 473 /* v.ast.Interface */) { + else if (t->info._typ == 474 /* v.ast.Interface */) { if (v__ast__Type_has_flag((*t->info._v__ast__Interface).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(table, (*t->info._v__ast__Interface).parent_type); Option_v__ast__Fn _t22; if (_t22 = v__ast__TypeSymbol_find_method(parent_sym, name), _t22.state == 0) { v__ast__Fn x = *(v__ast__Fn*)_t22.data; - if (parent_sym->info._typ == 455 /* v.ast.Struct */) { + if (parent_sym->info._typ == 456 /* v.ast.Struct */) { v__ast__Fn method = x; Array_string _t23 = {0}; Array_v__ast__Type _t23_orig = (*parent_sym->info._v__ast__Struct).generic_types; @@ -47489,7 +47541,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t28), sizeof(v__ast__Fn)); return _t28; } - else if (parent_sym->info._typ == 473 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 474 /* v.ast.Interface */) { v__ast__Fn method = x; Array_string _t29 = {0}; Array_v__ast__Type _t29_orig = (*parent_sym->info._v__ast__Interface).generic_types; @@ -47526,7 +47578,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t34), sizeof(v__ast__Fn)); return _t34; } - else if (parent_sym->info._typ == 474 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 475 /* v.ast.SumType */) { v__ast__Fn method = x; Array_string _t35 = {0}; Array_v__ast__Type _t35_orig = (*parent_sym->info._v__ast__SumType).generic_types; @@ -47570,13 +47622,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ } } } - else if (t->info._typ == 474 /* v.ast.SumType */) { + else if (t->info._typ == 475 /* v.ast.SumType */) { if (v__ast__Type_has_flag((*t->info._v__ast__SumType).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(table, (*t->info._v__ast__SumType).parent_type); Option_v__ast__Fn _t41; if (_t41 = v__ast__TypeSymbol_find_method(parent_sym, name), _t41.state == 0) { v__ast__Fn x = *(v__ast__Fn*)_t41.data; - if (parent_sym->info._typ == 455 /* v.ast.Struct */) { + if (parent_sym->info._typ == 456 /* v.ast.Struct */) { v__ast__Fn method = x; Array_string _t42 = {0}; Array_v__ast__Type _t42_orig = (*parent_sym->info._v__ast__Struct).generic_types; @@ -47613,7 +47665,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t47), sizeof(v__ast__Fn)); return _t47; } - else if (parent_sym->info._typ == 473 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 474 /* v.ast.Interface */) { v__ast__Fn method = x; Array_string _t48 = {0}; Array_v__ast__Type _t48_orig = (*parent_sym->info._v__ast__Interface).generic_types; @@ -47650,7 +47702,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t53), sizeof(v__ast__Fn)); return _t53; } - else if (parent_sym->info._typ == 474 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 475 /* v.ast.SumType */) { v__ast__Fn method = x; Array_string _t54 = {0}; Array_v__ast__Type _t54_orig = (*parent_sym->info._v__ast__SumType).generic_types; @@ -47715,7 +47767,7 @@ bool v__ast__TypeSymbol_is_js_compatible(v__ast__TypeSymbol* t) { bool _t3 = true; return _t3; } - if (t->info._typ == 474 /* v.ast.SumType */) { + if (t->info._typ == 475 /* v.ast.SumType */) { for (int _t4 = 0; _t4 < (*t->info._v__ast__SumType).variants.len; ++_t4) { v__ast__Type variant = ((v__ast__Type*)(*t->info._v__ast__SumType).variants.data)[_t4]; v__ast__TypeSymbol* sym = v__ast__Table_final_sym(table, variant); @@ -47753,19 +47805,19 @@ multi_return_bool_bool_int v__ast__TypeSymbol_str_method_info(v__ast__TypeSymbol } Option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name) { - if (t->info._typ == 468 /* v.ast.Aggregate */) { + if (t->info._typ == 469 /* v.ast.Aggregate */) { Option_v__ast__StructField _t1 = v__ast__Aggregate_find_field(&(*t->info._v__ast__Aggregate), name); return _t1; } - else if (t->info._typ == 455 /* v.ast.Struct */) { + else if (t->info._typ == 456 /* v.ast.Struct */) { Option_v__ast__StructField _t2 = v__ast__Struct_find_field(&(*t->info._v__ast__Struct), name); return _t2; } - else if (t->info._typ == 473 /* v.ast.Interface */) { + else if (t->info._typ == 474 /* v.ast.Interface */) { Option_v__ast__StructField _t3 = v__ast__Interface_find_field(&(*t->info._v__ast__Interface), name); return _t3; } - else if (t->info._typ == 474 /* v.ast.SumType */) { + else if (t->info._typ == 475 /* v.ast.SumType */) { Option_v__ast__StructField _t4 = v__ast__SumType_find_field(&(*t->info._v__ast__SumType), name); return _t4; } @@ -47849,7 +47901,7 @@ v__ast__StructField v__ast__Struct_get_field(v__ast__Struct* s, string name) { v__ast__StructField _t2 = field; return _t2; } - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown field `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); return (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}; } @@ -47891,8 +47943,8 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__ast__Type right_type0 = _const_v__ast__void_type; for (int i = 0; i < node->right.len; ++i) { v__ast__Expr* right = ((v__ast__Expr*)node->right.data) + i; - if ((right)->_typ == 291 /* v.ast.CallExpr */ || (right)->_typ == 306 /* v.ast.IfExpr */ || (right)->_typ == 313 /* v.ast.LockExpr */ || (right)->_typ == 315 /* v.ast.MatchExpr */) { - if (((right)->_typ == 306 /* v.ast.IfExpr */ || (right)->_typ == 315 /* v.ast.MatchExpr */) && node->left.len == node->right.len && !is_decl && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 305 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 325 /* v.ast.SelectorExpr */) && !v__ast__Expr_is_blank_ident((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))) { + if ((right)->_typ == 292 /* v.ast.CallExpr */ || (right)->_typ == 307 /* v.ast.IfExpr */ || (right)->_typ == 314 /* v.ast.LockExpr */ || (right)->_typ == 316 /* v.ast.MatchExpr */) { + if (((right)->_typ == 307 /* v.ast.IfExpr */ || (right)->_typ == 316 /* v.ast.MatchExpr */) && node->left.len == node->right.len && !is_decl && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 306 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 326 /* v.ast.SelectorExpr */) && !v__ast__Expr_is_blank_ident((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))) { c->expected_type = v__checker__Checker_expr(c, (*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i))); } v__ast__Type right_type = v__checker__Checker_expr(c, *right); @@ -47904,7 +47956,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__ast__TypeSymbol* right_type_sym = v__ast__Table_sym(c->table, right_type); if (right_type_sym->kind == v__ast__Kind__multi_return) { if (node->right.len > 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use multi-value "), 0xfe10, {.d_s = right_type_sym->name}}, {_SLIT(" in single-value context"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*right)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use multi-value "), /*115 &string*/0xfe10, {.d_s = right_type_sym->name}}, {_SLIT(" in single-value context"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*right)); } node->right_types = v__ast__TypeSymbol_mr_info(right_type_sym).types; right_len = node->right_types.len; @@ -47912,22 +47964,22 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; right_len = 0; } } - if ((right)->_typ == 309 /* v.ast.InfixExpr */) { + if ((right)->_typ == 310 /* v.ast.InfixExpr */) { if ((*right->_v__ast__InfixExpr).op == v__token__Kind__arrow) { v__checker__Checker_error(c, _SLIT("cannot use `<-` on the right-hand side of an assignment, as it does not return any values"), (*right->_v__ast__InfixExpr).pos); } } - if ((right)->_typ == 305 /* v.ast.Ident */) { + if ((right)->_typ == 306 /* v.ast.Ident */) { if ((*right->_v__ast__Ident).is_mut) { v__checker__Checker_error(c, _SLIT("unexpected `mut` on right-hand side of assignment"), (*right->_v__ast__Ident).mut_pos); } } - if ((right)->_typ == 317 /* v.ast.None */) { + if ((right)->_typ == 318 /* v.ast.None */) { v__checker__Checker_error(c, _SLIT("you can not assign a `none` value to a variable"), (*right->_v__ast__None).pos); } } if (node->left.len != right_len) { - if ((right_first)._typ == 291 /* v.ast.CallExpr */) { + if ((right_first)._typ == 292 /* v.ast.CallExpr */) { if (node->left_types.len > 0 && v__ast__Type_alias_eq((*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, 0)), _const_v__ast__void_type)) { // Defer begin if (v__checker__Checker_assign_stmt_defer_0) { @@ -47936,9 +47988,9 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; // Defer end return; } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("assignment mismatch: "), 0xfe07, {.d_i32 = node->left.len}}, {_SLIT(" variable(s) but `"), 0xfe10, {.d_s = (*right_first._v__ast__CallExpr).name}}, {_SLIT("()` returns "), 0xfe07, {.d_i32 = right_len}}, {_SLIT(" value(s)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("assignment mismatch: "), /*100 &int*/0xfe07, {.d_i32 = node->left.len}}, {_SLIT(" variable(s) but `"), /*115 &string*/0xfe10, {.d_s = (*right_first._v__ast__CallExpr).name}}, {_SLIT("()` returns "), /*100 &int*/0xfe07, {.d_i32 = right_len}}, {_SLIT(" value(s)"), 0, { .d_c = 0 }}})), node->pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("assignment mismatch: "), 0xfe07, {.d_i32 = node->left.len}}, {_SLIT(" variable(s) "), 0xfe07, {.d_i32 = right_len}}, {_SLIT(" value(s)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("assignment mismatch: "), /*100 &int*/0xfe07, {.d_i32 = node->left.len}}, {_SLIT(" variable(s) "), /*100 &int*/0xfe07, {.d_i32 = right_len}}, {_SLIT(" value(s)"), 0, { .d_c = 0 }}})), node->pos); } // Defer begin if (v__checker__Checker_assign_stmt_defer_0) { @@ -47949,21 +48001,21 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } for (int i = 0; i < node->left.len; ++i) { v__ast__Expr* left = ((v__ast__Expr*)node->left.data) + i; - if ((left)->_typ == 291 /* v.ast.CallExpr */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot call function `"), 0xfe10, {.d_s = (*left->_v__ast__CallExpr).name}}, {_SLIT("()` on the left side of an assignment"), 0, { .d_c = 0 }}})), (*left->_v__ast__CallExpr).pos); - } else if ((left)->_typ == 322 /* v.ast.PrefixExpr */) { - if (((*left->_v__ast__PrefixExpr).right)._typ == 291 /* v.ast.CallExpr */ && (*left->_v__ast__PrefixExpr).op == v__token__Kind__mul) { + if ((left)->_typ == 292 /* v.ast.CallExpr */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot call function `"), /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__CallExpr).name}}, {_SLIT("()` on the left side of an assignment"), 0, { .d_c = 0 }}})), (*left->_v__ast__CallExpr).pos); + } else if ((left)->_typ == 323 /* v.ast.PrefixExpr */) { + if (((*left->_v__ast__PrefixExpr).right)._typ == 292 /* v.ast.CallExpr */ && (*left->_v__ast__PrefixExpr).op == v__token__Kind__mul) { v__checker__Checker_error(c, _SLIT("cannot dereference a function call on the left side of an assignment, use a temporary variable"), (*left->_v__ast__PrefixExpr).pos); } - } else if ((left)->_typ == 308 /* v.ast.IndexExpr */) { - if (((*left->_v__ast__IndexExpr).index)._typ == 323 /* v.ast.RangeExpr */) { + } else if ((left)->_typ == 309 /* v.ast.IndexExpr */) { + if (((*left->_v__ast__IndexExpr).index)._typ == 324 /* v.ast.RangeExpr */) { v__checker__Checker_error(c, _SLIT("cannot reassign using range expression on the left side of an assignment"), (*left->_v__ast__IndexExpr).pos); } } bool is_blank_ident = v__ast__Expr_is_blank_ident(/*rec*/*left); v__ast__Type left_type = _const_v__ast__void_type; if (!is_decl && !is_blank_ident) { - if ((left)->_typ == 305 /* v.ast.Ident */ || (left)->_typ == 325 /* v.ast.SelectorExpr */) { + if ((left)->_typ == 306 /* v.ast.Ident */ || (left)->_typ == 326 /* v.ast.SelectorExpr */) { c->prevent_sum_type_unwrapping_once = true; } left_type = v__checker__Checker_expr(c, *left); @@ -47971,8 +48023,8 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } if (node->right_types.len < node->left.len) { bool old_inside_ref_lit = c->inside_ref_lit; - if ((left)->_typ == 305 /* v.ast.Ident */) { - if (((*left->_v__ast__Ident).info)._typ == 415 /* v.ast.IdentVar */) { + if ((left)->_typ == 306 /* v.ast.Ident */) { + if (((*left->_v__ast__Ident).info)._typ == 416 /* v.ast.IdentVar */) { c->inside_ref_lit = c->inside_ref_lit || (*(*left->_v__ast__Ident).info._v__ast__IdentVar).share == v__ast__ShareType__shared_t; } } @@ -47986,9 +48038,9 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } v__ast__Expr right = (i < node->right.len ? ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->right, i))) : ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->right, 0)))); v__ast__Type right_type = (*(v__ast__Type*)/*ee elem_sym */array_get(node->right_types, i)); - if ((right)._typ == 305 /* v.ast.Ident */) { + if ((right)._typ == 306 /* v.ast.Ident */) { v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); - if ((right_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((right_sym->info)._typ == 456 /* v.ast.Struct */) { if ((*right_sym->info._v__ast__Struct).generic_types.len > 0) { Option_v__ast__ScopeObject _t2; if (_t2 = v__ast__Scope_find((*right._v__ast__Ident).scope, (*right._v__ast__Ident).name), _t2.state == 0) { @@ -47997,17 +48049,17 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } } - } else if ((right)._typ == 297 /* v.ast.ComptimeSelector */) { + } else if ((right)._typ == 298 /* v.ast.ComptimeSelector */) { right_type = c->comptime_fields_default_type; } if (is_decl) { - if ((right)._typ == 330 /* v.ast.StructInit */) { + if ((right)._typ == 331 /* v.ast.StructInit */) { if (v__ast__Type_has_flag((*right._v__ast__StructInit).typ, v__ast__TypeFlag__generic)) { v__checker__Checker_expr(c, right); right_type = (*right._v__ast__StructInit).typ; } - } else if ((right)._typ == 322 /* v.ast.PrefixExpr */) { - if ((*right._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*right._v__ast__PrefixExpr).right)._typ == 330 /* v.ast.StructInit */) { + } else if ((right)._typ == 323 /* v.ast.PrefixExpr */) { + if ((*right._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*right._v__ast__PrefixExpr).right)._typ == 331 /* v.ast.StructInit */) { right_type = v__checker__Checker_expr(c, right); } } @@ -48017,7 +48069,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; left_type = v__ast__mktyp(right_type); } if (v__ast__Type_alias_eq(left_type, _const_v__ast__int_type)) { - if ((right)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((right)._typ == 311 /* v.ast.IntegerLiteral */) { bool is_large = (*right._v__ast__IntegerLiteral).val.len > 13; if (!is_large && (*right._v__ast__IntegerLiteral).val.len > 8) { i64 val = string_i64((*right._v__ast__IntegerLiteral).val); @@ -48032,8 +48084,8 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__checker__Checker_fail_if_immutable(c, *left); } if (v__ast__Type_is_ptr(right_type) && v__ast__Type_is_ptr(left_type)) { - if ((right)._typ == 305 /* v.ast.Ident */) { - if (((*right._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((right)._typ == 306 /* v.ast.Ident */) { + if (((*right._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { v__ast__Var* obj = &(*(*right._v__ast__Ident).obj._v__ast__Var); if (c->fn_scope != ((voidptr)(0))) { Option_v__ast__Var_ptr _t3 = v__ast__Scope_find_var(c->fn_scope, (*(*right._v__ast__Ident).obj._v__ast__Var).name); @@ -48047,37 +48099,37 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; if (obj->is_stack_obj && !c->inside_unsafe) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, v__ast__Type_set_nr_muls(obj->typ, 0)); if (!v__ast__TypeSymbol_is_heap(type_sym) && !c->pref->translated && !c->file->is_translated) { - string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*right._v__ast__Ident).name}}, {_SLIT("` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), 0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*right._v__ast__Ident).pos); + string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*right._v__ast__Ident).name}}, {_SLIT("` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), /*115 &string*/0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*right._v__ast__Ident).pos); } } } } } - if (!is_decl && (left)->_typ == 305 /* v.ast.Ident */ && !is_blank_ident && !v__ast__Type_is_real_pointer(left_type) && v__ast__Type_is_real_pointer(right_type) && !v__ast__Type_has_flag(right_type, v__ast__TypeFlag__shared_f)) { + if (!is_decl && (left)->_typ == 306 /* v.ast.Ident */ && !is_blank_ident && !v__ast__Type_is_real_pointer(left_type) && v__ast__Type_is_real_pointer(right_type) && !v__ast__Type_has_flag(right_type, v__ast__TypeFlag__shared_f)) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, left_type); if (left_sym->kind != v__ast__Kind__function) { - v__checker__Checker_warn(c, string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign a reference to a value (this will be an error soon) left="), 0xfe10, {.d_s = v__ast__Table_type_str(c->table, left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Type_is_ptr(left_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" "), 0, { .d_c = 0 }}})), str_intp(4, _MOV((StrIntpData[]){{_SLIT("right="), 0xfe10, {.d_s = v__ast__Table_type_str(c->table, right_type)}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Type_is_real_pointer(right_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" ptr="), 0xfe10, {.d_s = v__ast__Type_is_ptr(right_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))), node->pos); + v__checker__Checker_warn(c, string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign a reference to a value (this will be an error soon) left="), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_str(c->table, left_type)}}, {_SLIT(" "), /*115 &bool*/0xfe10, {.d_s = v__ast__Type_is_ptr(left_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" "), 0, { .d_c = 0 }}})), str_intp(4, _MOV((StrIntpData[]){{_SLIT("right="), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_str(c->table, right_type)}}, {_SLIT(" "), /*115 &bool*/0xfe10, {.d_s = v__ast__Type_is_real_pointer(right_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" ptr="), /*115 &bool*/0xfe10, {.d_s = v__ast__Type_is_ptr(right_type) ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))), node->pos); } } array_push((array*)&node->left_types, _MOV((v__ast__Type[]){ left_type })); - if (left->_typ == 305 /* v.ast.Ident */) { + if (left->_typ == 306 /* v.ast.Ident */) { if ((*left->_v__ast__Ident).kind == v__ast__IdentKind__blank_ident) { left_type = right_type; (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i)) = right_type; if (!(node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign)) { v__checker__Checker_error(c, _SLIT("cannot modify blank `_` identifier"), (*left->_v__ast__Ident).pos); } - } else if (((*left->_v__ast__Ident).info)._typ != 415 /* v.ast.IdentVar */) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to "), 0xfe10, {.d_s = v__ast__IdentKind_str((*left->_v__ast__Ident).kind)}}, {_SLIT(" `"), 0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); + } else if (((*left->_v__ast__Ident).info)._typ != 416 /* v.ast.IdentVar */) { + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to "), /*115 &v.ast.IdentKind*/0xfe10, {.d_s = v__ast__IdentKind_str((*left->_v__ast__Ident).kind)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); } else { if (is_decl) { v__checker__Checker_check_valid_snake_case(c, (*left->_v__ast__Ident).name, _SLIT("variable name"), (*left->_v__ast__Ident).pos); if (Array_string_contains(_const_v__checker__reserved_type_names, (*left->_v__ast__Ident).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), 0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT("` as a variable name"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT("` as a variable name"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); } } - v__ast__IdentVar ident_var_info = /* as */ *(v__ast__IdentVar*)__as_cast(((*left->_v__ast__Ident).info)._v__ast__IdentVar,((*left->_v__ast__Ident).info)._typ, 415) /*expected idx: 415, name: v.ast.IdentVar */ ; + v__ast__IdentVar ident_var_info = /* as */ *(v__ast__IdentVar*)__as_cast(((*left->_v__ast__Ident).info)._v__ast__IdentVar,((*left->_v__ast__Ident).info)._typ, 416) /*expected idx: 416, name: v.ast.IdentVar */ ; if (ident_var_info.share == v__ast__ShareType__shared_t) { left_type = v__ast__Type_set_flag(left_type, v__ast__TypeFlag__shared_f); if (is_decl) { @@ -48096,7 +48148,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; ident_var_info.typ = left_type; (*left->_v__ast__Ident).info = v__ast__IdentVar_to_sumtype_v__ast__IdentInfo(&ident_var_info); if (left_type != 0) { - if ((*left->_v__ast__Ident).obj._typ == 363 /* v.ast.Var */) { + if ((*left->_v__ast__Ident).obj._typ == 364 /* v.ast.Var */) { (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = left_type; if ((*(*left->_v__ast__Ident).obj._v__ast__Var).is_auto_deref) { (*(*left->_v__ast__Ident).obj._v__ast__Var).is_used = true; @@ -48107,14 +48159,14 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } if (Array_int_contains(_const_v__ast__unsigned_integer_type_idxs, left_type)) { - if ((right)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((right)._typ == 311 /* v.ast.IntegerLiteral */) { if (string_at((*right._v__ast__IntegerLiteral).val, 0) == '-') { v__checker__Checker_error(c, _SLIT("Cannot assign negative value to unsigned integer type"), (*right._v__ast__IntegerLiteral).pos); } } } } - else if ((*left->_v__ast__Ident).obj._typ == 362 /* v.ast.GlobalField */) { + else if ((*left->_v__ast__Ident).obj._typ == 363 /* v.ast.GlobalField */) { (*(*left->_v__ast__Ident).obj._v__ast__GlobalField).typ = left_type; } @@ -48123,23 +48175,23 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; ; } if (is_decl) { - string full_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*left->_v__ast__Ident).mod}}, {_SLIT("."), 0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string full_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__Ident).mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*left->_v__ast__Ident).name}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_v__ast__ScopeObject _t5; if (_t5 = v__ast__Scope_find(c->file->global_scope, full_name), _t5.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t5.data; - if ((obj)._typ == 361 /* v.ast.ConstField */) { - v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate of a const name `"), 0xfe10, {.d_s = full_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); + if ((obj)._typ == 362 /* v.ast.ConstField */) { + v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate of a const name `"), /*115 &string*/0xfe10, {.d_s = full_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*left->_v__ast__Ident).pos); } } } } } - else if (left->_typ == 322 /* v.ast.PrefixExpr */) { + else if (left->_typ == 323 /* v.ast.PrefixExpr */) { if ((*left->_v__ast__PrefixExpr).op == v__token__Kind__mul) { if (!c->inside_unsafe && !c->pref->translated && !c->file->is_translated) { v__checker__Checker_error(c, _SLIT("modifying variables via dereferencing can only be done in `unsafe` blocks"), node->pos); - } else if (((*left->_v__ast__PrefixExpr).right)._typ == 305 /* v.ast.Ident */) { - if (((*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + } else if (((*left->_v__ast__PrefixExpr).right)._typ == 306 /* v.ast.Ident */) { + if (((*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { (*(*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj._v__ast__Var).is_used = true; } } @@ -48148,8 +48200,8 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__checker__Checker_error(c, _SLIT("non-name on the left side of `:=`"), (*left->_v__ast__PrefixExpr).pos); } } - else if (left->_typ == 325 /* v.ast.SelectorExpr */) { - if (((*left->_v__ast__SelectorExpr).expr)._typ == 308 /* v.ast.IndexExpr */) { + else if (left->_typ == 326 /* v.ast.SelectorExpr */) { + if (((*left->_v__ast__SelectorExpr).expr)._typ == 309 /* v.ast.IndexExpr */) { if ((*(*left->_v__ast__SelectorExpr).expr._v__ast__IndexExpr).is_map) { (*(*left->_v__ast__SelectorExpr).expr._v__ast__IndexExpr).is_setter = true; } @@ -48157,13 +48209,13 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } else { - if ((left)->_typ == 308 /* v.ast.IndexExpr */) { + if ((left)->_typ == 309 /* v.ast.IndexExpr */) { if ((*left->_v__ast__IndexExpr).is_map && (*left->_v__ast__IndexExpr).is_setter) { v__ast__IndexExpr_recursive_mapset_is_setter(&(*left->_v__ast__IndexExpr), true); } } if (is_decl) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-name `"), 0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("` on left side of `:=`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-name `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("` on left side of `:=`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } } ; @@ -48180,26 +48232,26 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, left_type_unwrapped); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type_unwrapped); - if (left_sym->kind == v__ast__Kind__array && !c->inside_unsafe && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__array && (left)->_typ == 305 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 305 /* v.ast.Ident */) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("use `array2 "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" array1.clone()` instead of `array2 "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" array1` (or use `unsafe`)"), 0, { .d_c = 0 }}})), node->pos); + if (left_sym->kind == v__ast__Kind__array && !c->inside_unsafe && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__array && (left)->_typ == 306 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 306 /* v.ast.Ident */) { + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("use `array2 "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" array1.clone()` instead of `array2 "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" array1` (or use `unsafe`)"), 0, { .d_c = 0 }}})), node->pos); } if (left_sym->kind == v__ast__Kind__array && right_sym->kind == v__ast__Kind__array) { - v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Type left_elem_type = v__ast__Table_unaliased_type(c->table, left_info.elem_type); - v__ast__Array right_info = /* as */ *(v__ast__Array*)__as_cast((right_sym->info)._v__ast__Array,(right_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array right_info = /* as */ *(v__ast__Array*)__as_cast((right_sym->info)._v__ast__Array,(right_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Type right_elem_type = v__ast__Table_unaliased_type(c->table, right_info.elem_type); if (v__ast__Type_nr_muls(left_type_unwrapped) == v__ast__Type_nr_muls(right_type_unwrapped) && left_info.nr_dims == right_info.nr_dims && v__ast__Type_alias_eq(left_elem_type, right_elem_type)) { continue; } } - if (left_sym->kind == v__ast__Kind__array_fixed && !c->inside_unsafe && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__array_fixed && (left)->_typ == 305 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 305 /* v.ast.Ident */) { - if ((right_sym->info)._typ == 478 /* v.ast.ArrayFixed */) { + if (left_sym->kind == v__ast__Kind__array_fixed && !c->inside_unsafe && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__array_fixed && (left)->_typ == 306 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 306 /* v.ast.Ident */) { + if ((right_sym->info)._typ == 479 /* v.ast.ArrayFixed */) { if (v__ast__Type_is_ptr((*right_sym->info._v__ast__ArrayFixed).elem_type)) { v__checker__Checker_error(c, _SLIT("assignment from one fixed array to another with a pointer element type is prohibited outside of `unsafe`"), node->pos); } } } - if (left_sym->kind == v__ast__Kind__map && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__map && !v__ast__Expr_is_blank_ident(/*rec*/*left) && v__ast__Expr_is_lvalue(right) && (!v__ast__Type_is_ptr(right_type) || ((right)._typ == 305 /* v.ast.Ident */ && v__ast__Expr_is_auto_deref_var(right)))) { + if (left_sym->kind == v__ast__Kind__map && (node->op == v__token__Kind__assign || node->op == v__token__Kind__decl_assign) && right_sym->kind == v__ast__Kind__map && !v__ast__Expr_is_blank_ident(/*rec*/*left) && v__ast__Expr_is_lvalue(right) && (!v__ast__Type_is_ptr(right_type) || ((right)._typ == 306 /* v.ast.Ident */ && v__ast__Expr_is_auto_deref_var(right)))) { v__checker__Checker_error(c, _SLIT("cannot copy map: call `move` or `clone` method (or use a reference)"), v__ast__Expr_pos(right)); } bool left_is_ptr = v__ast__Type_is_ptr(left_type) || v__ast__TypeSymbol_is_pointer(left_sym); @@ -48209,16 +48261,16 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } bool right_is_ptr = v__ast__Type_is_ptr(right_type) || v__ast__TypeSymbol_is_pointer(right_sym); if (!right_is_ptr && node->op == v__token__Kind__assign && v__ast__Type_is_number(right_type_unwrapped)) { - v__checker__Checker_error(c, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot assign to `"), 0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("`: "), 0, { .d_c = 0 }}})), v__checker__Checker_expected_msg(c, right_type_unwrapped, left_type_unwrapped)), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot assign to `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("`: "), 0, { .d_c = 0 }}})), v__checker__Checker_expected_msg(c, right_type_unwrapped, left_type_unwrapped)), v__ast__Expr_pos(right)); } - if (!v__ast__TypeSymbol_is_number(right_sym) && !v__ast__Type_has_flag(left_type, v__ast__TypeFlag__shared_f) && ((right)._typ == 330 /* v.ast.StructInit */ || !right_is_ptr)) { + if (!v__ast__TypeSymbol_is_number(right_sym) && !v__ast__Type_has_flag(left_type, v__ast__TypeFlag__shared_f) && ((right)._typ == 331 /* v.ast.StructInit */ || !right_is_ptr)) { string left_name = v__ast__Table_type_to_str(c->table, left_type_unwrapped); v__ast__Type rtype = right_type_unwrapped; if (v__ast__Type_is_ptr(rtype)) { rtype = v__ast__Type_deref(rtype); } string right_name = v__ast__Table_type_to_str(c->table, rtype); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } @@ -48227,29 +48279,29 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; else if (node->op == (v__token__Kind__plus_assign) || node->op == (v__token__Kind__minus_assign)) { if (v__ast__Type_alias_eq(left_type, _const_v__ast__string_type)) { if (node->op != v__token__Kind__plus_assign) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` not defined on left operand type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` not defined on left operand type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } if (!v__ast__Type_alias_eq(right_type, _const_v__ast__string_type)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid right operand: "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" "), 0xfe10, {.d_s = right_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid right operand: "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } } else if (!v__ast__TypeSymbol_is_number(left_sym) && !(left_sym->kind == v__ast__Kind__byteptr || left_sym->kind == v__ast__Kind__charptr || left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__alias)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` not defined on left operand type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` not defined on left operand type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } else if (!v__ast__TypeSymbol_is_number(right_sym) && !(left_sym->kind == v__ast__Kind__byteptr || left_sym->kind == v__ast__Kind__charptr || left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__alias)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid right operand: "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" "), 0xfe10, {.d_s = right_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid right operand: "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } } else if (node->op == (v__token__Kind__mult_assign) || node->op == (v__token__Kind__div_assign)) { if (!v__ast__TypeSymbol_is_number(left_sym) && !v__ast__TypeSymbol_is_int(v__ast__Table_final_sym(c->table, left_type_unwrapped)) && !(left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__alias)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on left operand type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on left operand type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } else if (!v__ast__TypeSymbol_is_number(right_sym) && !v__ast__TypeSymbol_is_int(v__ast__Table_final_sym(c->table, left_type_unwrapped)) && !(left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__alias)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on right operand type `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on right operand type `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } } else if (node->op == (v__token__Kind__and_assign) || node->op == (v__token__Kind__or_assign) || node->op == (v__token__Kind__xor_assign) || node->op == (v__token__Kind__mod_assign) || node->op == (v__token__Kind__left_shift_assign) || node->op == (v__token__Kind__right_shift_assign)) { if (!v__ast__TypeSymbol_is_int(left_sym) && !v__ast__TypeSymbol_is_int(v__ast__Table_final_sym(c->table, left_type_unwrapped))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on left operand type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on left operand type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*left)); } else if (!v__ast__TypeSymbol_is_int(right_sym) && !v__ast__TypeSymbol_is_int(v__ast__Table_final_sym(c->table, right_type_unwrapped))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on right operand type `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" not defined on right operand type `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } } else if (node->op == (v__token__Kind__unsigned_right_shift_assign)) { @@ -48258,7 +48310,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } int _t6; /* if prepend */ if (!v__ast__Type_is_int(left_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, left_type)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, left_type)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); _t6 = _const_v__ast__void_type_idx; } else if (v__ast__Type_is_int_literal(left_type)) { _t6 = _const_v__ast__u32_type_idx; @@ -48304,7 +48356,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; string right_name = v__ast__Table_type_to_str(c->table, right_type_unwrapped); v__ast__TypeSymbol* parent_sym = v__ast__Table_final_sym(c->table, left_type_unwrapped); if (left_sym->kind == v__ast__Kind__alias && right_sym->kind != v__ast__Kind__alias) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } string _t7 = (string){.str=(byteptr)"", .is_lit=1}; @@ -48326,24 +48378,24 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; else { _t7 = _SLIT("unknown op"); }string extracted_op = _t7; - if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).generic_types.len > 0) { + if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).generic_types.len > 0) { continue; } Option_v__ast__Fn _t8; if (_t8 = v__ast__TypeSymbol_find_method(left_sym, extracted_op), _t8.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t8.data; if (!v__ast__Type_alias_eq(method.return_type, left_type_unwrapped)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), 0xfe10, {.d_s = extracted_op}}, {_SLIT("` must return `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` to be used as an assignment operator"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("operator `"), /*115 &string*/0xfe10, {.d_s = extracted_op}}, {_SLIT("` must return `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` to be used as an assignment operator"), 0, { .d_c = 0 }}})), node->pos); } } else { IError err = _t8.err; if (v__ast__TypeSymbol_is_primitive(parent_sym)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use operator methods on type alias for `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use operator methods on type alias for `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = extracted_op}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = extracted_op}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -48356,7 +48408,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__checker__Checker_warn(c, _SLIT("pointer arithmetic is only allowed in `unsafe` blocks"), node->pos); } } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to `"), 0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("`: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(*left)}}, {_SLIT("`: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(right)); } ; } @@ -48371,13 +48423,13 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } } - if ((right_first)._typ == 322 /* v.ast.PrefixExpr */) { + if ((right_first)._typ == 323 /* v.ast.PrefixExpr */) { v__ast__PrefixExpr right_node = (*right_first._v__ast__PrefixExpr); v__ast__Expr left_first = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, 0)); - if ((left_first)._typ == 305 /* v.ast.Ident */) { + if ((left_first)._typ == 306 /* v.ast.Ident */) { v__ast__Ident assigned_var = (*left_first._v__ast__Ident); bool is_shared = false; - if (((*left_first._v__ast__Ident).info)._typ == 415 /* v.ast.IdentVar */) { + if (((*left_first._v__ast__Ident).info)._typ == 416 /* v.ast.IdentVar */) { is_shared = (*(*left_first._v__ast__Ident).info._v__ast__IdentVar).share == v__ast__ShareType__shared_t; } bool old_inside_ref_lit = c->inside_ref_lit; @@ -48385,13 +48437,13 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; v__checker__Checker_expr(c, right_node.right); c->inside_ref_lit = old_inside_ref_lit; if (right_node.op == v__token__Kind__amp) { - if ((right_node.right)._typ == 305 /* v.ast.Ident */) { - if (((*right_node.right._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((right_node.right)._typ == 306 /* v.ast.Ident */) { + if (((*right_node.right._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { v__ast__Var v = (*(*right_node.right._v__ast__Ident).obj._v__ast__Var); right_type0 = v.typ; } if (!c->inside_unsafe && v__ast__Ident_is_mut(&assigned_var) && !v__ast__Ident_is_mut(&(*right_node.right._v__ast__Ident))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*right_node.right._v__ast__Ident).name}}, {_SLIT("` is immutable, cannot have a mutable reference to it"), 0, { .d_c = 0 }}})), right_node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*right_node.right._v__ast__Ident).name}}, {_SLIT("` is immutable, cannot have a mutable reference to it"), 0, { .d_c = 0 }}})), right_node.pos); } } } @@ -48401,7 +48453,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; if (right_sym->kind == v__ast__Kind__chan) { v__ast__Chan chan_info = v__ast__TypeSymbol_chan_info(right_sym); if (v__ast__Type_is_ptr(chan_info.elem_type) && !chan_info.is_mut) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot have a mutable reference to object from `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot have a mutable reference to object from `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_node.pos); } } } @@ -48504,12 +48556,12 @@ bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v bool _t15 = true; return _t15; } - if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional)) { + if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(expected, v__ast__TypeFlag__result)) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, got); - if (sym->idx == _const_v__ast__error_type_idx || (v__ast__Type_alias_eq(got, _const_v__ast__none_type) || v__ast__Type_alias_eq(got, _const_v__ast__error_type))) { + if (((sym->idx == _const_v__ast__error_type_idx || (v__ast__Type_alias_eq(got, _const_v__ast__none_type) || v__ast__Type_alias_eq(got, _const_v__ast__error_type))) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__optional)) || ((sym->idx == _const_v__ast__error_type_idx || v__ast__Type_alias_eq(got, _const_v__ast__error_type)) && v__ast__Type_has_flag(expected, v__ast__TypeFlag__result))) { bool _t16 = true; return _t16; - } else if (!v__checker__Checker_check_basic(c, got, v__ast__Type_clear_flag(expected, v__ast__TypeFlag__optional))) { + } else if (!v__checker__Checker_check_basic(c, got, v__ast__Type_clear_flag(v__ast__Type_clear_flag(expected, v__ast__TypeFlag__optional), v__ast__TypeFlag__result))) { bool _t17 = false; return _t17; } @@ -48546,7 +48598,7 @@ Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type expected = expected_; if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__variadic)) { v__ast__TypeSymbol* exp_type_sym = v__ast__Table_sym(c->table, expected_); - v__ast__Array exp_info = /* as */ *(v__ast__Array*)__as_cast((exp_type_sym->info)._v__ast__Array,(exp_type_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array exp_info = /* as */ *(v__ast__Array*)__as_cast((exp_type_sym->info)._v__ast__Array,(exp_type_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; expected = exp_info.elem_type; } if (language == v__ast__Language__c) { @@ -48598,12 +48650,12 @@ Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, string expected_typ_str = v__ast__Table_type_to_str(c->table, v__ast__Type_clear_flag(expected, v__ast__TypeFlag__variadic)); if (string__eq(v__ast__TypeSymbol_symbol_name_except_generic(got_typ_sym), v__ast__TypeSymbol_symbol_name_except_generic(expected_typ_sym))) { if ((v__ast__Type_is_ptr(got) != v__ast__Type_is_ptr(expected)) || !v__checker__Checker_check_same_module(/*rec*/*c, got, expected)) { - return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = got_typ_str}}, {_SLIT("` as `"), 0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = got_typ_str}}, {_SLIT("` as `"), /*115 &string*/0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; } if (!v__ast__Type_alias_eq(got, _const_v__ast__void_type)) { - return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = got_typ_str}}, {_SLIT("` as `"), 0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_void){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = got_typ_str}}, {_SLIT("` as `"), /*115 &string*/0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; } @@ -48710,8 +48762,8 @@ bool v__checker__Checker_check_basic(v__checker__Checker* c, v__ast__Type got, v } bool v__checker__Checker_check_matching_function_symbols(v__checker__Checker* c, v__ast__TypeSymbol* got_type_sym, v__ast__TypeSymbol* exp_type_sym) { - v__ast__FnType got_info = /* as */ *(v__ast__FnType*)__as_cast((got_type_sym->info)._v__ast__FnType,(got_type_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; - v__ast__FnType exp_info = /* as */ *(v__ast__FnType*)__as_cast((exp_type_sym->info)._v__ast__FnType,(exp_type_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType got_info = /* as */ *(v__ast__FnType*)__as_cast((got_type_sym->info)._v__ast__FnType,(got_type_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__ast__FnType exp_info = /* as */ *(v__ast__FnType*)__as_cast((exp_type_sym->info)._v__ast__FnType,(exp_type_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; v__ast__Fn got_fn = got_info.func; v__ast__Fn exp_fn = exp_info.func; if (got_fn.params.len != exp_fn.params.len) { @@ -48734,7 +48786,7 @@ bool v__checker__Checker_check_matching_function_symbols(v__checker__Checker* c, if (exp_arg_is_ptr != got_arg_is_ptr) { string exp_arg_pointedness = (exp_arg_is_ptr ? (_SLIT("a pointer")) : (_SLIT("NOT a pointer"))); string got_arg_pointedness = (got_arg_is_ptr ? (_SLIT("a pointer")) : (_SLIT("NOT a pointer"))); - v__checker__Checker_add_error_detail(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = exp_fn.name}}, {_SLIT("`\'s expected fn argument: `"), 0xfe10, {.d_s = exp_arg.name}}, {_SLIT("` is "), 0xfe10, {.d_s = exp_arg_pointedness}}, {_SLIT(", but the passed fn argument: `"), 0xfe10, {.d_s = got_arg.name}}, {_SLIT("` is "), 0xfe10, {.d_s = got_arg_pointedness}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__checker__Checker_add_error_detail(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = exp_fn.name}}, {_SLIT("`\'s expected fn argument: `"), /*115 &string*/0xfe10, {.d_s = exp_arg.name}}, {_SLIT("` is "), /*115 &string*/0xfe10, {.d_s = exp_arg_pointedness}}, {_SLIT(", but the passed fn argument: `"), /*115 &string*/0xfe10, {.d_s = got_arg.name}}, {_SLIT("` is "), /*115 &string*/0xfe10, {.d_s = got_arg_pointedness}}, {_SLIT0, 0, { .d_c = 0 }}}))); bool _t4 = false; return _t4; } else if (exp_arg_is_ptr && got_arg_is_ptr) { @@ -48752,7 +48804,7 @@ bool v__checker__Checker_check_matching_function_symbols(v__checker__Checker* c, VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker* c, v__ast__InfixExpr* node, v__ast__Type left_type, v__ast__Type right_type) { if (!v__ast__Type_is_int(left_type)) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, left_type); - if (left_sym->kind == v__ast__Kind__alias && v__ast__Type_is_int((/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type)) { + if (left_sym->kind == v__ast__Kind__alias && v__ast__Type_is_int((/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type)) { v__ast__Type _t1 = left_type; return _t1; } @@ -48760,14 +48812,14 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker v__ast__Type _t2 = _const_v__ast__int_type; return _t2; } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); v__ast__Type _t3 = _const_v__ast__void_type; return _t3; } if (!v__ast__Type_is_int(right_type) && !c->pref->translated) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, left_type); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot shift non-integer type `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` into type `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot shift non-integer type `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` into type `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); v__ast__Type _t4 = _const_v__ast__void_type; return _t4; } @@ -48792,10 +48844,10 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker v__ast__TypeSymbol* left_sym_final = v__ast__Table_final_sym(c->table, left_type); v__ast__Type left_type_final = ((left_sym_final->idx)); if (node->op == v__token__Kind__left_shift && v__ast__Type_is_signed(left_type_final) && !(c->inside_unsafe && c->is_generated)) { - v__checker__Checker_note(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("shifting a value from a signed type `"), 0xfe10, {.d_s = left_sym_final->name}}, {_SLIT("` can change the sign"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_note(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("shifting a value from a signed type `"), /*115 &string*/0xfe10, {.d_s = left_sym_final->name}}, {_SLIT("` can change the sign"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); } if (node->ct_right_value_evaled) { - if ((node->ct_right_value)._typ != 301 /* v.ast.EmptyExpr */) { + if ((node->ct_right_value)._typ != 302 /* v.ast.EmptyExpr */) { Option_i64 _t7 = v__ast__ComptTimeConstValue_i64(node->ct_right_value); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; @@ -48810,7 +48862,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker } int moffset = ((left_type_final == (_const_v__ast__char_type)) ? (7) : (left_type_final == (_const_v__ast__i8_type)) ? (7) : (left_type_final == (_const_v__ast__i16_type)) ? (15) : (left_type_final == (_const_v__ast__int_type)) ? (31) : (left_type_final == (_const_v__ast__i64_type)) ? (63) : (left_type_final == (_const_v__ast__byte_type)) ? (7) : (left_type_final == (_const_v__ast__u16_type)) ? (15) : (left_type_final == (_const_v__ast__u32_type)) ? (31) : (left_type_final == (_const_v__ast__u64_type)) ? (63) : (64)); if (ival > moffset && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("shift count for type `"), 0xfe10, {.d_s = left_sym_final->name}}, {_SLIT("` too large (maximum: "), 0xfe07, {.d_i32 = moffset}}, {_SLIT(" bits)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("shift count for type `"), /*115 &string*/0xfe10, {.d_s = left_sym_final->name}}, {_SLIT("` too large (maximum: "), /*100 &int*/0xfe07, {.d_i32 = moffset}}, {_SLIT(" bits)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); v__ast__Type _t9 = left_type; return _t9; } @@ -48832,7 +48884,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker } } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown shift operator: "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown shift operator: "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t13 = left_type; return _t13; }; @@ -48879,10 +48931,10 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_promote_num(v__checker__Checker v__ast__Type type_hi = left_type; v__ast__Type type_lo = right_type; if (v__ast__Type_idx(type_hi) < v__ast__Type_idx(type_lo)) { - v__ast__Type _var_16786 = type_hi; - v__ast__Type _var_16795 = type_lo; - type_hi = _var_16795; - type_lo = _var_16786; + v__ast__Type _var_16973 = type_hi; + v__ast__Type _var_16982 = type_lo; + type_hi = _var_16982; + type_lo = _var_16973; } int idx_hi = v__ast__Type_idx(type_hi); int idx_lo = v__ast__Type_idx(type_lo); @@ -48939,7 +48991,7 @@ Option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__T VV_LOCAL_SYMBOL string v__checker__Checker_expected_msg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected) { string exps = v__ast__Table_type_to_str(c->table, expected); string gots = v__ast__Table_type_to_str(c->table, got); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = exps}}, {_SLIT("`, not `"), 0xfe10, {.d_s = gots}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = exps}}, {_SLIT("`, not `"), /*115 &string*/0xfe10, {.d_s = gots}}, {_SLIT("`"), 0, { .d_c = 0 }}})); return _t1; } @@ -48974,7 +49026,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ 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); - if (sym->info._typ == 455 /* v.ast.Struct */) { + if (sym->info._typ == 456 /* v.ast.Struct */) { if (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) { int idx = Array_string_index(c->table->cur_fn->generic_names, gt_name); @@ -48998,7 +49050,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } - else if (sym->info._typ == 473 /* v.ast.Interface */) { + else if (sym->info._typ == 474 /* v.ast.Interface */) { if (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) { int idx = Array_string_index(c->table->cur_fn->generic_names, gt_name); @@ -49022,7 +49074,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } - else if (sym->info._typ == 474 /* v.ast.SumType */) { + else if (sym->info._typ == 475 /* v.ast.SumType */) { if (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) { int idx = Array_string_index(c->table->cur_fn->generic_names, gt_name); @@ -49061,7 +49113,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ if (v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__generic) && string__eq(param_type_sym->name, gt_name)) { to_set = v__ast__mktyp(arg.typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, arg.typ); - if ((sym->info)._typ == 482 /* v.ast.FnType */) { + if ((sym->info)._typ == 483 /* v.ast.FnType */) { v__ast__Fn func_ = (*sym->info._v__ast__FnType).func; func_.name = _SLIT(""); int idx = v__ast__Table_find_or_register_fn_type(c->table, c->mod, func_, true, false); @@ -49081,15 +49133,15 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ if (v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__variadic)) { to_set = v__ast__mktyp(arg.typ); } else if (arg_sym->kind == v__ast__Kind__array && param_type_sym->kind == v__ast__Kind__array) { - v__ast__Array arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_sym->info)._v__ast__Array,(arg_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; - v__ast__Array param_elem_info = /* as */ *(v__ast__Array*)__as_cast((param_type_sym->info)._v__ast__Array,(param_type_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_sym->info)._v__ast__Array,(arg_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array param_elem_info = /* as */ *(v__ast__Array*)__as_cast((param_type_sym->info)._v__ast__Array,(param_type_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__TypeSymbol* arg_elem_sym = v__ast__Table_sym(c->table, arg_elem_info.elem_type); v__ast__TypeSymbol* param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); for (;;) { if (arg_elem_sym->kind == v__ast__Kind__array && param_elem_sym->kind == v__ast__Kind__array && !Array_string_contains(c->table->cur_fn->generic_names, param_elem_sym->name)) { - arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_elem_sym->info)._v__ast__Array,(arg_elem_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_elem_sym->info)._v__ast__Array,(arg_elem_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; arg_elem_sym = v__ast__Table_sym(c->table, arg_elem_info.elem_type); - param_elem_info = /* as */ *(v__ast__Array*)__as_cast((param_elem_sym->info)._v__ast__Array,(param_elem_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + param_elem_info = /* as */ *(v__ast__Array*)__as_cast((param_elem_sym->info)._v__ast__Array,(param_elem_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); } else { to_set = arg_elem_info.elem_type; @@ -49097,15 +49149,15 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } else if (arg_sym->kind == v__ast__Kind__array_fixed && param_type_sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_sym->info)._v__ast__ArrayFixed,(arg_sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; - v__ast__ArrayFixed param_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((param_type_sym->info)._v__ast__ArrayFixed,(param_type_sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_sym->info)._v__ast__ArrayFixed,(arg_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed param_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((param_type_sym->info)._v__ast__ArrayFixed,(param_type_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; v__ast__TypeSymbol* arg_elem_sym = v__ast__Table_sym(c->table, arg_elem_info.elem_type); v__ast__TypeSymbol* param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); for (;;) { if (arg_elem_sym->kind == v__ast__Kind__array_fixed && param_elem_sym->kind == v__ast__Kind__array_fixed && !Array_string_contains(c->table->cur_fn->generic_names, param_elem_sym->name)) { - arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_elem_sym->info)._v__ast__ArrayFixed,(arg_elem_sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_elem_sym->info)._v__ast__ArrayFixed,(arg_elem_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; arg_elem_sym = v__ast__Table_sym(c->table, arg_elem_info.elem_type); - param_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((param_elem_sym->info)._v__ast__ArrayFixed,(param_elem_sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + param_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((param_elem_sym->info)._v__ast__ArrayFixed,(param_elem_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); } else { to_set = arg_elem_info.elem_type; @@ -49113,8 +49165,8 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } else if (arg_sym->kind == v__ast__Kind__map && param_type_sym->kind == v__ast__Kind__map) { - v__ast__Map arg_map_info = /* as */ *(v__ast__Map*)__as_cast((arg_sym->info)._v__ast__Map,(arg_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; - v__ast__Map param_map_info = /* as */ *(v__ast__Map*)__as_cast((param_type_sym->info)._v__ast__Map,(param_type_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map arg_map_info = /* as */ *(v__ast__Map*)__as_cast((arg_sym->info)._v__ast__Map,(arg_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map param_map_info = /* as */ *(v__ast__Map*)__as_cast((param_type_sym->info)._v__ast__Map,(param_type_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; if (v__ast__Type_has_flag(param_map_info.key_type, v__ast__TypeFlag__generic) && string__eq(v__ast__Table_sym(c->table, param_map_info.key_type)->name, gt_name)) { typ = arg_map_info.key_type; } @@ -49124,15 +49176,15 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } else if (arg_sym->kind == v__ast__Kind__struct_ || arg_sym->kind == v__ast__Kind__interface_ || arg_sym->kind == v__ast__Kind__sum_type) { Array_v__ast__Type generic_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); Array_v__ast__Type concrete_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - if (arg_sym->info._typ == 455 /* v.ast.Struct */) { + if (arg_sym->info._typ == 456 /* v.ast.Struct */) { generic_types = (*arg_sym->info._v__ast__Struct).generic_types; concrete_types = (*arg_sym->info._v__ast__Struct).concrete_types; } - else if (arg_sym->info._typ == 473 /* v.ast.Interface */) { + else if (arg_sym->info._typ == 474 /* v.ast.Interface */) { generic_types = (*arg_sym->info._v__ast__Interface).generic_types; concrete_types = (*arg_sym->info._v__ast__Interface).concrete_types; } - else if (arg_sym->info._typ == 474 /* v.ast.SumType */) { + else if (arg_sym->info._typ == 475 /* v.ast.SumType */) { generic_types = (*arg_sym->info._v__ast__SumType).generic_types; concrete_types = (*arg_sym->info._v__ast__SumType).concrete_types; } @@ -49166,19 +49218,19 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } if (!v__checker__Checker_check_types(c, typ, to_set)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("inferred generic type `"), 0xfe10, {.d_s = gt_name}}, {_SLIT("` is ambiguous: got `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, to_set)->name}}, {_SLIT("`, expected `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, typ)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg.pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("inferred generic type `"), /*115 &string*/0xfe10, {.d_s = gt_name}}, {_SLIT("` is ambiguous: got `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, to_set)->name}}, {_SLIT("`, expected `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, typ)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg.pos); } } typ = to_set; } } if (v__ast__Type_alias_eq(typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not infer generic type `"), 0xfe10, {.d_s = gt_name}}, {_SLIT("` in call to `"), 0xfe10, {.d_s = func.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not infer generic type `"), /*115 &string*/0xfe10, {.d_s = gt_name}}, {_SLIT("` in call to `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); return; } if (c->pref->is_verbose) { string s = v__ast__Table_type_to_str(c->table, typ); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("inferred `"), 0xfe10, {.d_s = func.name}}, {_SLIT("<"), 0xfe10, {.d_s = s}}, {_SLIT(">`"), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("inferred `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("<"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(">`"), 0, { .d_c = 0 }}}))); } array_push((array*)&inferred_types, _MOV((v__ast__Type[]){ typ })); array_push((array*)&node->concrete_types, _MOV((v__ast__Type[]){ typ })); @@ -49247,19 +49299,19 @@ void v__checker__Checker_check(v__checker__Checker* c, v__ast__File* ast_file_) v__ast__ImportSymbol sym = ((v__ast__ImportSymbol*)ast_import.syms.data)[_t1]; string full_name = string__plus(string__plus(ast_import.mod, _SLIT(".")), sym.name); if (Array_string_contains(c->const_names, full_name)) { - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("cannot selectively import constant `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` from `"), 0xfe10, {.d_s = ast_import.mod}}, {_SLIT("`, import `"), 0xfe10, {.d_s = ast_import.mod}}, {_SLIT("` and use `"), 0xfe10, {.d_s = full_name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("cannot selectively import constant `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` from `"), /*115 &string*/0xfe10, {.d_s = ast_import.mod}}, {_SLIT("`, import `"), /*115 &string*/0xfe10, {.d_s = ast_import.mod}}, {_SLIT("` and use `"), /*115 &string*/0xfe10, {.d_s = full_name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), sym.pos); } } for (int j = 0; j < i; ++j) { if (string__eq(ast_import.mod, (*(v__ast__Import*)/*ee elem_sym */array_get(ast_file->imports, j)).mod)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = ast_import.mod}}, {_SLIT("` was already imported on line "), 0xfe07, {.d_i32 = (*(v__ast__Import*)/*ee elem_sym */array_get(ast_file->imports, j)).mod_pos.line_nr + 1}}, {_SLIT0, 0, { .d_c = 0 }}})), ast_import.mod_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = ast_import.mod}}, {_SLIT("` was already imported on line "), /*100 &int*/0xfe07, {.d_i32 = (*(v__ast__Import*)/*ee elem_sym */array_get(ast_file->imports, j)).mod_pos.line_nr + 1}}, {_SLIT0, 0, { .d_c = 0 }}})), ast_import.mod_pos); } } } c->stmt_level = 0; for (int _t2 = 0; _t2 < ast_file->stmts.len; ++_t2) { v__ast__Stmt* stmt = ((v__ast__Stmt*)ast_file->stmts.data) + _t2; - if ((stmt)->_typ == 341 /* v.ast.ConstDecl */ || (stmt)->_typ == 345 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 342 /* v.ast.ConstDecl */ || (stmt)->_typ == 346 /* v.ast.ExprStmt */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -49270,7 +49322,7 @@ void v__checker__Checker_check(v__checker__Checker* c, v__ast__File* ast_file_) c->stmt_level = 0; for (int _t3 = 0; _t3 < ast_file->stmts.len; ++_t3) { v__ast__Stmt* stmt = ((v__ast__Stmt*)ast_file->stmts.data) + _t3; - if ((stmt)->_typ == 349 /* v.ast.GlobalDecl */) { + if ((stmt)->_typ == 350 /* v.ast.GlobalDecl */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -49281,7 +49333,7 @@ void v__checker__Checker_check(v__checker__Checker* c, v__ast__File* ast_file_) c->stmt_level = 0; for (int _t4 = 0; _t4 < ast_file->stmts.len; ++_t4) { v__ast__Stmt* stmt = ((v__ast__Stmt*)ast_file->stmts.data) + _t4; - if ((stmt)->_typ != 341 /* v.ast.ConstDecl */ && (stmt)->_typ != 349 /* v.ast.GlobalDecl */ && (stmt)->_typ != 345 /* v.ast.ExprStmt */) { + if ((stmt)->_typ != 342 /* v.ast.ConstDecl */ && (stmt)->_typ != 350 /* v.ast.GlobalDecl */ && (stmt)->_typ != 346 /* v.ast.ExprStmt */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -49305,9 +49357,9 @@ void v__checker__Checker_check_scope_vars(v__checker__Checker* c, v__ast__Scope* } if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)DenseArray_value(&_t1.key_values, _t2)); - if (obj._typ == 363 /* v.ast.Var */) { + if (obj._typ == 364 /* v.ast.Var */) { if (!(*obj._v__ast__Var).is_used && string_at((*obj._v__ast__Var).name, 0) != '_') { - v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unused variable: `"), 0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*obj._v__ast__Var).pos); + v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unused variable: `"), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*obj._v__ast__Var).pos); } if ((*obj._v__ast__Var).is_mut && !(*obj._v__ast__Var).is_changed && !c->is_builtin_mod && !string__eq((*obj._v__ast__Var).name, _SLIT("it"))) { } @@ -49347,7 +49399,7 @@ void v__checker__Checker_check_files(v__checker__Checker* c, Array_v__ast__File_ Array_v__ast__File_ptr files_from_main_module = __new_array_with_default(0, 0, sizeof(v__ast__File*), 0); for (int i = 0; i < ast_files.len; ++i) { v__ast__File* file = (*(v__ast__File**)/*ee elem_sym */array_get(ast_files, i)); - v__util__Timers_start(c->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker_check "), 0xfe10, {.d_s = file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_start(c->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker_check "), /*115 &string*/0xfe10, {.d_s = file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__checker__Checker_check(c, file); if (string__eq(file->mod.name, _SLIT("main"))) { array_push((array*)&files_from_main_module, _MOV((v__ast__File*[]){ file })); @@ -49356,7 +49408,7 @@ void v__checker__Checker_check_files(v__checker__Checker* c, Array_v__ast__File_ has_main_fn = true; } } - v__util__Timers_show(c->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker_check "), 0xfe10, {.d_s = file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_show(c->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker_check "), /*115 &string*/0xfe10, {.d_s = file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (has_main_mod_file && !has_main_fn && files_from_main_module.len > 0) { if (c->pref->is_script && !c->pref->is_test) { @@ -49482,7 +49534,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_file_has_main_fn(v__checker__Checker* c bool has_main_fn = false; for (int _t1 = 0; _t1 < file->stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)file->stmts.data)[_t1]; - if ((stmt)._typ == 218 /* v.ast.FnDecl */) { + if ((stmt)._typ == 219 /* v.ast.FnDecl */) { if (string__eq((*stmt._v__ast__FnDecl).name, _SLIT("main.main"))) { if (has_main_fn) { v__checker__Checker_error(c, _SLIT("function `main` is already defined"), (*stmt._v__ast__FnDecl).pos); @@ -49511,10 +49563,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_valid_snake_case(v__checker__Chec return; } if (!c->pref->is_vweb && name.len > 0 && (string_at(name, 0) == '_' || string_contains(name, _SLIT("._")))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = identifier}}, {_SLIT(" `"), 0xfe10, {.d_s = name}}, {_SLIT("` cannot start with `_`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = identifier}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` cannot start with `_`"), 0, { .d_c = 0 }}})), pos); } if (!c->pref->experimental && v__util__contains_capital(name)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = identifier}}, {_SLIT(" `"), 0xfe10, {.d_s = name}}, {_SLIT("` cannot contain uppercase letters, use snake_case instead"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = identifier}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` cannot contain uppercase letters, use snake_case instead"), 0, { .d_c = 0 }}})), pos); } } @@ -49533,18 +49585,18 @@ VV_LOCAL_SYMBOL string v__checker__stripped_name(string name) { VV_LOCAL_SYMBOL void v__checker__Checker_check_valid_pascal_case(v__checker__Checker* c, string name, string identifier, v__token__Pos pos) { string sname = v__checker__stripped_name(name); if (sname.len > 0 && !u8_is_capital(string_at(sname, 0)) && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = identifier}}, {_SLIT(" `"), 0xfe10, {.d_s = name}}, {_SLIT("` must begin with capital letter"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = identifier}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` must begin with capital letter"), 0, { .d_c = 0 }}})), pos); } } void v__checker__Checker_type_decl(v__checker__Checker* c, v__ast__TypeDecl node) { - if (node._typ == 279 /* v.ast.AliasTypeDecl */) { + if (node._typ == 280 /* v.ast.AliasTypeDecl */) { v__checker__Checker_alias_type_decl(c, (*node._v__ast__AliasTypeDecl)); } - else if (node._typ == 280 /* v.ast.FnTypeDecl */) { + else if (node._typ == 281 /* v.ast.FnTypeDecl */) { v__checker__Checker_fn_type_decl(c, (*node._v__ast__FnTypeDecl)); } - else if (node._typ == 281 /* v.ast.SumTypeDecl */) { + else if (node._typ == 282 /* v.ast.SumTypeDecl */) { v__checker__Checker_sum_type_decl(c, (*node._v__ast__SumTypeDecl)); } ; @@ -49563,10 +49615,10 @@ void v__checker__Checker_alias_type_decl(v__checker__Checker* c, v__ast__AliasTy ; v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, node.parent_type); if (typ_sym->kind == v__ast__Kind__placeholder || typ_sym->kind == v__ast__Kind__int_literal || typ_sym->kind == v__ast__Kind__float_literal) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.type_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.type_pos); } else if (typ_sym->kind == v__ast__Kind__alias) { - v__ast__TypeSymbol* orig_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((typ_sym->info)._v__ast__Alias,(typ_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = v__ast__TypeSymbol_str(typ_sym)}}, {_SLIT("` is an alias, use the original alias type `"), 0xfe10, {.d_s = orig_sym->name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), node.type_pos); + v__ast__TypeSymbol* orig_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((typ_sym->info)._v__ast__Alias,(typ_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_str(typ_sym)}}, {_SLIT("` is an alias, use the original alias type `"), /*115 &string*/0xfe10, {.d_s = orig_sym->name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), node.type_pos); } else if (typ_sym->kind == v__ast__Kind__chan) { v__checker__Checker_error(c, _SLIT("aliases of `chan` types are not allowed."), node.type_pos); } @@ -49575,7 +49627,7 @@ void v__checker__Checker_alias_type_decl(v__checker__Checker* c, v__ast__AliasTy void v__checker__Checker_fn_type_decl(v__checker__Checker* c, v__ast__FnTypeDecl node) { v__checker__Checker_check_valid_pascal_case(c, node.name, _SLIT("fn type"), node.pos); v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, node.typ); - v__ast__FnType fn_typ_info = /* as */ *(v__ast__FnType*)__as_cast((typ_sym->info)._v__ast__FnType,(typ_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType fn_typ_info = /* as */ *(v__ast__FnType*)__as_cast((typ_sym->info)._v__ast__FnType,(typ_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; v__ast__Fn fn_info = fn_typ_info.func; Option_void _t1 = v__checker__Checker_ensure_type_exists(c, fn_info.return_type, fn_info.return_type_pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { @@ -49585,7 +49637,7 @@ void v__checker__Checker_fn_type_decl(v__checker__Checker* c, v__ast__FnTypeDecl ; v__ast__TypeSymbol* ret_sym = v__ast__Table_sym(c->table, fn_info.return_type); if (ret_sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = ret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), fn_info.return_type_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = ret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), fn_info.return_type_pos); } for (int _t2 = 0; _t2 < fn_info.params.len; ++_t2) { v__ast__Param arg = ((v__ast__Param*)fn_info.params.data)[_t2]; @@ -49598,7 +49650,7 @@ void v__checker__Checker_fn_type_decl(v__checker__Checker* c, v__ast__FnTypeDecl ; v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(c->table, arg.typ); if (arg_sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = arg_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg.type_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = arg_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg.type_pos); } } } @@ -49619,9 +49671,9 @@ void v__checker__Checker_sum_type_decl(v__checker__Checker* c, v__ast__SumTypeDe ; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, variant.typ); if (Array_string_contains(names_used, sym->name)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("sum type "), 0xfe10, {.d_s = node.name}}, {_SLIT(" cannot hold the type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` more than once"), 0, { .d_c = 0 }}})), variant.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("sum type "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT(" cannot hold the type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` more than once"), 0, { .d_c = 0 }}})), variant.pos); } else if (sym->kind == v__ast__Kind__placeholder || sym->kind == v__ast__Kind__int_literal || sym->kind == v__ast__Kind__float_literal) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), variant.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), variant.pos); } else if (sym->kind == v__ast__Kind__interface_ && sym->language != v__ast__Language__js) { v__checker__Checker_error(c, _SLIT("sum type cannot hold an interface"), variant.pos); } else if (sym->kind == v__ast__Kind__struct_ && sym->language == v__ast__Language__js) { @@ -49636,7 +49688,7 @@ void v__checker__Checker_sum_type_decl(v__checker__Checker* c, v__ast__SumTypeDe Array_v__ast__InterfaceEmbedding v__checker__Checker_expand_iface_embeds(v__checker__Checker* c, v__ast__InterfaceDecl* idecl, int level, Array_v__ast__InterfaceEmbedding iface_embeds) { if (level > _const_v__checker__iface_level_cutoff_limit) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("too many interface embedding levels: "), 0xfe07, {.d_i32 = level}}, {_SLIT(", for interface `"), 0xfe10, {.d_s = idecl->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), idecl->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("too many interface embedding levels: "), /*100 &int*/0xfe07, {.d_i32 = level}}, {_SLIT(", for interface `"), /*115 &string*/0xfe10, {.d_s = idecl->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), idecl->pos); Array_v__ast__InterfaceEmbedding _t1 = __new_array_with_default(0, 0, sizeof(v__ast__InterfaceEmbedding), 0); return _t1; } @@ -49688,19 +49740,19 @@ Array_v__ast__InterfaceEmbedding v__checker__Checker_expand_iface_embeds(v__chec } VV_LOCAL_SYMBOL void v__checker__Checker_check_div_mod_by_zero(v__checker__Checker* c, v__ast__Expr expr, v__token__Kind op_kind) { - if (expr._typ == 303 /* v.ast.FloatLiteral */) { + if (expr._typ == 304 /* v.ast.FloatLiteral */) { if (string_f64((*expr._v__ast__FloatLiteral).val) == 0.0) { string oper = (op_kind == v__token__Kind__div ? (_SLIT("division")) : (_SLIT("modulo"))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__FloatLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__FloatLiteral).pos); } } - else if (expr._typ == 310 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { if (string_int((*expr._v__ast__IntegerLiteral).val) == 0) { string oper = (op_kind == v__token__Kind__div ? (_SLIT("division")) : (_SLIT("modulo"))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__IntegerLiteral).pos); } } - else if (expr._typ == 292 /* v.ast.CastExpr */) { + else if (expr._typ == 293 /* v.ast.CastExpr */) { v__checker__Checker_check_div_mod_by_zero(c, (*expr._v__ast__CastExpr).expr, op_kind); } @@ -49736,24 +49788,24 @@ v__ast__Type former_expected_type; if (!c->pref->translated && ((v__ast__Type_is_any_kind_of_pointer(right_type) && node->op != v__token__Kind__minus) || (!v__ast__Type_is_any_kind_of_pointer(right_type) && !(node->op == v__token__Kind__plus || node->op == v__token__Kind__minus)))) { string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else if (node->op == v__token__Kind__plus || node->op == v__token__Kind__minus) { if (!c->inside_unsafe && !v__ast__Expr_is_auto_deref_var(node->left) && !v__ast__Expr_is_auto_deref_var(node->right)) { v__checker__Checker_warn(c, _SLIT("pointer arithmetic is only allowed in `unsafe` blocks"), left_right_pos); } - if (v__ast__Type_alias_eq(left_type, _const_v__ast__voidptr_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be used with `voidptr`"), 0, { .d_c = 0 }}})), left_pos); + if (v__ast__Type_alias_eq(left_type, _const_v__ast__voidptr_type) && !c->pref->translated) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be used with `voidptr`"), 0, { .d_c = 0 }}})), left_pos); } } } v__ast__Type return_type = left_type; if (node->op != v__token__Kind__key_is) { - if (node->left._typ == 305 /* v.ast.Ident */) { + if (node->left._typ == 306 /* v.ast.Ident */) { if ((*node->left._v__ast__Ident).is_mut) { v__checker__Checker_error(c, _SLIT("the `mut` keyword is invalid here"), (*node->left._v__ast__Ident).mut_pos); } } - else if (node->left._typ == 325 /* v.ast.SelectorExpr */) { + else if (node->left._typ == 326 /* v.ast.SelectorExpr */) { if ((*node->left._v__ast__SelectorExpr).is_mut) { v__checker__Checker_error(c, _SLIT("the `mut` keyword is invalid here"), (*node->left._v__ast__SelectorExpr).mut_pos); } @@ -49763,12 +49815,12 @@ v__ast__Type former_expected_type; } ; } - if (node->right._typ == 305 /* v.ast.Ident */) { + if (node->right._typ == 306 /* v.ast.Ident */) { if ((*node->right._v__ast__Ident).is_mut) { v__checker__Checker_error(c, _SLIT("the `mut` keyword is invalid here"), (*node->right._v__ast__Ident).mut_pos); } } - else if (node->right._typ == 325 /* v.ast.SelectorExpr */) { + else if (node->right._typ == 326 /* v.ast.SelectorExpr */) { if ((*node->right._v__ast__SelectorExpr).is_mut) { v__checker__Checker_error(c, _SLIT("the `mut` keyword is invalid here"), (*node->right._v__ast__SelectorExpr).mut_pos); } @@ -49784,19 +49836,19 @@ v__ast__Type former_expected_type; { bool is_mismatch = (left_sym->kind == v__ast__Kind__alias && (right_sym->kind == v__ast__Kind__struct_ || right_sym->kind == v__ast__Kind__array || right_sym->kind == v__ast__Kind__sum_type)) || (right_sym->kind == v__ast__Kind__alias && (left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__array || left_sym->kind == v__ast__Kind__sum_type)); if (is_mismatch) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("possible type mismatch of compared values of `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` operation"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("possible type mismatch of compared values of `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` operation"), 0, { .d_c = 0 }}})), left_right_pos); } else if (Array_int_contains(_const_v__ast__integer_type_idxs, left_type) && Array_int_contains(_const_v__ast__integer_type_idxs, right_type)) { bool is_left_type_signed = Array_int_contains(_const_v__ast__signed_integer_type_idxs, left_type); bool is_right_type_signed = Array_int_contains(_const_v__ast__signed_integer_type_idxs, right_type); - if (!is_left_type_signed && (node->right)._typ == 310 /* v.ast.IntegerLiteral */) { + if (!is_left_type_signed && (node->right)._typ == 311 /* v.ast.IntegerLiteral */) { if (string_int((*node->right._v__ast__IntegerLiteral).val) < 0 && Array_int_contains(_const_v__ast__int_promoted_type_idxs, left_type)) { string lt = v__ast__Table_sym(c->table, left_type)->name; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = lt}}, {_SLIT("` cannot be compared with negative value"), 0, { .d_c = 0 }}})), (*node->right._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = lt}}, {_SLIT("` cannot be compared with negative value"), 0, { .d_c = 0 }}})), (*node->right._v__ast__IntegerLiteral).pos); } - } else if (!is_right_type_signed && (node->left)._typ == 310 /* v.ast.IntegerLiteral */) { + } else if (!is_right_type_signed && (node->left)._typ == 311 /* v.ast.IntegerLiteral */) { if (string_int((*node->left._v__ast__IntegerLiteral).val) < 0 && Array_int_contains(_const_v__ast__int_promoted_type_idxs, right_type)) { string rt = v__ast__Table_sym(c->table, right_type)->name; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("negative value cannot be compared with `"), 0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node->left._v__ast__IntegerLiteral).pos); + 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) { int ls = v__ast__Table_type_size(c->table, left_type); @@ -49804,7 +49856,7 @@ v__ast__Type former_expected_type; if ((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; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = lt}}, {_SLIT("` cannot be compared with `"), 0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = lt}}, {_SLIT("` cannot be compared with `"), /*115 &string*/0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -49820,7 +49872,7 @@ v__ast__Type former_expected_type; Option_void _t1 = v__checker__Checker_check_expected(c, left_type, elem_type); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the array element type: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the array element type: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); ; } @@ -49832,7 +49884,7 @@ v__ast__Type former_expected_type; Option_void _t2 = v__checker__Checker_check_expected(c, left_type, map_info.key_type); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the map key type: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the map key type: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); ; } @@ -49845,7 +49897,7 @@ v__ast__Type former_expected_type; Option_void _t3 = v__checker__Checker_check_expected(c, left_type, elem_type); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the fixed array element type: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("left operand to `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` does not match the fixed array element type: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), left_right_pos); ; } @@ -49853,7 +49905,7 @@ v__ast__Type former_expected_type; } } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` can only be used with arrays and maps"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` can only be used with arrays and maps"), 0, { .d_c = 0 }}})), node->pos); }; v__ast__Type _t4 = _const_v__ast__bool_type; // Defer begin @@ -49873,15 +49925,15 @@ v__ast__Type former_expected_type; case v__token__Kind__amp: case v__token__Kind__pipe: { - if ((right_sym->info)._typ == 470 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).language != v__ast__Language__c && string__eq(c->mod, (*(string*)/*ee elem_sym */array_get(string_split(v__ast__Table_type_to_str(c->table, right_type), _SLIT(".")), 0))) && v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type))) { - right_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type); + if ((right_sym->info)._typ == 471 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).language != v__ast__Language__c && string__eq(c->mod, (*(string*)/*ee elem_sym */array_get(string_split(v__ast__Table_type_to_str(c->table, right_type), _SLIT(".")), 0))) && v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type))) { + right_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type); } - if ((left_sym->info)._typ == 470 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).language != v__ast__Language__c && string__eq(c->mod, (*(string*)/*ee elem_sym */array_get(string_split(v__ast__Table_type_to_str(c->table, left_type), _SLIT(".")), 0))) && v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type))) { - left_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type); + if ((left_sym->info)._typ == 471 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).language != v__ast__Language__c && string__eq(c->mod, (*(string*)/*ee elem_sym */array_get(string_split(v__ast__Table_type_to_str(c->table, left_type), _SLIT(".")), 0))) && v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type))) { + left_sym = v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type); } if (c->pref->translated && (node->op == v__token__Kind__plus || node->op == v__token__Kind__minus || node->op == v__token__Kind__mul) && v__ast__Type_is_any_kind_of_pointer(left_type) && v__ast__Type_is_any_kind_of_pointer(right_type)) { return_type = left_type; - } else if (!c->pref->translated && left_sym->kind == v__ast__Kind__alias && (left_sym->info)._typ == 470 /* v.ast.Alias */ && !(v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type)))) { + } else if (!c->pref->translated && left_sym->kind == v__ast__Kind__alias && (left_sym->info)._typ == 471 /* v.ast.Alias */ && !(v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type)))) { if (v__ast__TypeSymbol_has_method(left_sym, v__token__Kind_str(node->op))) { Option_v__ast__Fn _t5; if (_t5 = v__ast__TypeSymbol_find_method(left_sym, v__token__Kind_str(node->op)), _t5.state == 0) { @@ -49895,12 +49947,12 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } - } else if (!c->pref->translated && right_sym->kind == v__ast__Kind__alias && (right_sym->info)._typ == 470 /* v.ast.Alias */ && !(v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type)))) { + } else if (!c->pref->translated && right_sym->kind == v__ast__Kind__alias && (right_sym->info)._typ == 471 /* v.ast.Alias */ && !(v__ast__TypeSymbol_is_primitive(v__ast__Table_sym(c->table, (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type)))) { if (v__ast__TypeSymbol_has_method(right_sym, v__token__Kind_str(node->op))) { Option_v__ast__Fn _t6; if (_t6 = v__ast__TypeSymbol_find_method(right_sym, v__token__Kind_str(node->op)), _t6.state == 0) { @@ -49914,9 +49966,9 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } } @@ -49934,9 +49986,9 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } } else if (!c->pref->translated && (right_sym->kind == v__ast__Kind__array || right_sym->kind == v__ast__Kind__array_fixed || right_sym->kind == v__ast__Kind__map || right_sym->kind == v__ast__Kind__struct_)) { @@ -49953,9 +50005,9 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } } else if (v__ast__Expr_is_auto_deref_var(node->left) || v__ast__Expr_is_auto_deref_var(node->right)) { @@ -49964,7 +50016,7 @@ v__ast__Type former_expected_type; string left_name = v__ast__Table_type_to_str(c->table, v__ast__mktyp(deref_left_type)); string right_name = v__ast__Table_type_to_str(c->table, v__ast__mktyp(deref_right_type)); if (!string__eq(left_name, right_name)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } else { v__ast__Type unaliased_left_type = v__ast__Table_unalias_num_type(c->table, left_type); @@ -49977,10 +50029,10 @@ v__ast__Type former_expected_type; if (v__ast__Type_idx(promoted_type) == _const_v__ast__void_type_idx) { string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } else if (v__ast__Type_has_flag(promoted_type, v__ast__TypeFlag__optional)) { string s = v__ast__Table_type_to_str(c->table, promoted_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be used with `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be used with `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_is_float(promoted_type)) { if (node->op == v__token__Kind__mod || node->op == v__token__Kind__xor || node->op == v__token__Kind__amp || node->op == v__token__Kind__pipe) { string side = (v__ast__Type_alias_eq(left_type, promoted_type) ? (_SLIT("left")) : (_SLIT("right"))); @@ -49989,7 +50041,7 @@ v__ast__Type former_expected_type; if (node->op == v__token__Kind__mod) { v__checker__Checker_error(c, _SLIT("float modulo not allowed, use math.fmod() instead"), pos); } else { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = side}}, {_SLIT(" type of `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be non-integer type `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = side}}, {_SLIT(" type of `"), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` cannot be non-integer type `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } } } @@ -50007,7 +50059,7 @@ v__ast__Type former_expected_type; { if ((left_sym->kind == v__ast__Kind__array || left_sym->kind == v__ast__Kind__array_fixed) && (right_sym->kind == v__ast__Kind__array || right_sym->kind == v__ast__Kind__array_fixed)) { v__checker__Checker_error(c, _SLIT("only `==` and `!=` are defined on arrays"), node->pos); - } else if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).generic_types.len > 0) { + } else if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).generic_types.len > 0) { v__ast__Type _t9 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_infix_expr_defer_0) { @@ -50021,16 +50073,16 @@ v__ast__Type former_expected_type; string right_name = v__ast__Table_type_to_str(c->table, right_type); if (string__eq(left_name, right_name)) { if (!(node->op == v__token__Kind__lt && c->pref->translated)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("undefined operation `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } } } if (left_sym->kind == v__ast__Kind__struct_ && right_sym->kind == v__ast__Kind__struct_) { if (!v__ast__TypeSymbol_has_method(left_sym, _SLIT("<")) && (node->op == v__token__Kind__ge || node->op == v__token__Kind__le)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` as `<` operator method is not defined"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` as `<` operator method is not defined"), 0, { .d_c = 0 }}})), left_right_pos); } else if (!v__ast__TypeSymbol_has_method(left_sym, _SLIT("<")) && node->op == v__token__Kind__gt) { v__checker__Checker_error(c, _SLIT("cannot use `>` as `<=` operator method is not defined"), left_right_pos); } @@ -50039,7 +50091,7 @@ v__ast__Type former_expected_type; v__ast__TypeSymbol* gen_sym = v__ast__Table_sym(c->table, left_gen_type); bool need_overload = (gen_sym->kind == v__ast__Kind__struct_ || gen_sym->kind == v__ast__Kind__interface_); if (need_overload && !v__ast__TypeSymbol_has_method_with_generic_parent(gen_sym, _SLIT("<")) && (node->op == v__token__Kind__ge || node->op == v__token__Kind__le)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` as `<` operator method is not defined"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` as `<` operator method is not defined"), 0, { .d_c = 0 }}})), left_right_pos); } else if (need_overload && !v__ast__TypeSymbol_has_method_with_generic_parent(gen_sym, _SLIT("<")) && node->op == v__token__Kind__gt) { v__checker__Checker_error(c, _SLIT("cannot use `>` as `<=` operator method is not defined"), left_right_pos); } @@ -50048,13 +50100,13 @@ v__ast__Type former_expected_type; bool is_right_type_signed = Array_int_contains(_const_v__ast__signed_integer_type_idxs, right_type) || right_type == _const_v__ast__int_literal_type_idx; if (is_left_type_signed != is_right_type_signed) { if (is_right_type_signed) { - if ((node->right)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((node->right)._typ == 311 /* v.ast.IntegerLiteral */) { if (string_int((*node->right._v__ast__IntegerLiteral).val) < 0) { v__checker__Checker_error(c, _SLIT("unsigned integer cannot be compared with negative value"), (*node->right._v__ast__IntegerLiteral).pos); } } } else if (is_left_type_signed) { - if ((node->left)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((node->left)._typ == 311 /* v.ast.IntegerLiteral */) { if (string_int((*node->left._v__ast__IntegerLiteral).val) < 0) { v__checker__Checker_error(c, _SLIT("unsigned integer cannot be compared with negative value"), (*node->left._v__ast__IntegerLiteral).pos); } @@ -50073,8 +50125,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_33844 = v__checker__Checker_fail_if_immutable(c, node->left); - node->auto_locked = mr_33844.arg0; + multi_return_string_v__token__Pos mr_33942 = v__checker__Checker_fail_if_immutable(c, node->left); + node->auto_locked = mr_33942.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_) { @@ -50097,12 +50149,12 @@ v__ast__Type former_expected_type; } else if (left_value_sym->kind == v__ast__Kind__sum_type) { if (right_final->kind != v__ast__Kind__array) { if (!v__ast__Table_is_sumtype_or_in_variant(c->table, left_value_type, v__ast__mktyp(right_type))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); } } else { v__ast__Type right_value_type = v__ast__Table_value_type(c->table, right_type); if (!v__ast__Table_is_sumtype_or_in_variant(c->table, left_value_type, v__ast__mktyp(right_value_type))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); } } v__ast__Type _t11 = _const_v__ast__void_type; @@ -50133,7 +50185,7 @@ v__ast__Type former_expected_type; // Defer end return _t13; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot append `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); v__ast__Type _t14 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_infix_expr_defer_0) { @@ -50167,7 +50219,7 @@ v__ast__Type former_expected_type; { int _t17; /* if prepend */ if (!v__ast__Type_is_int(left_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, left_type)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid operation: shift on type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, left_type)->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); _t17 = _const_v__ast__void_type_idx; } else if (v__ast__Type_is_int_literal(left_type)) { _t17 = _const_v__ast__u32_type_idx; @@ -50215,15 +50267,15 @@ v__ast__Type former_expected_type; { v__ast__Expr right_expr = node->right; v__ast__Type _t20 = 0; - if (right_expr._typ == 331 /* v.ast.TypeNode */) { + if (right_expr._typ == 332 /* v.ast.TypeNode */) { _t20 = (*right_expr._v__ast__TypeNode).typ; } - else if (right_expr._typ == 317 /* v.ast.None */) { + else if (right_expr._typ == 318 /* v.ast.None */) { _t20 = _const_v__ast__none_type_idx; } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), 0xfe10, {.d_s = v__ast__Expr_str(right_expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(right_expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); _t20 = ((v__ast__Type)(0)); } v__ast__Type typ = _t20; @@ -50231,17 +50283,17 @@ v__ast__Type former_expected_type; v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, typ); string op = v__token__Kind_str(node->op); if (typ_sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = op}}, {_SLIT(": type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not exist"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = op}}, {_SLIT(": type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not exist"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); } if (left_sym->kind == v__ast__Kind__aggregate) { - v__ast__Type parent_left_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 468) /*expected idx: 468, name: v.ast.Aggregate */ ).sum_type; + v__ast__Type parent_left_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 469) /*expected idx: 469, name: v.ast.Aggregate */ ).sum_type; left_sym = v__ast__Table_sym(c->table, parent_left_type); } if (!(left_sym->kind == v__ast__Kind__interface_ || left_sym->kind == v__ast__Kind__sum_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = op}}, {_SLIT("` can only be used with interfaces and sum types"), 0, { .d_c = 0 }}})), node->pos); - } else if ((left_sym->info)._typ == 474 /* v.ast.SumType */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = op}}, {_SLIT("` can only be used with interfaces and sum types"), 0, { .d_c = 0 }}})), node->pos); + } else if ((left_sym->info)._typ == 475 /* v.ast.SumType */) { if (!Array_v__ast__Type_contains((*left_sym->info._v__ast__SumType).variants, typ)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("` has no variant `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("` has no variant `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -50260,17 +50312,17 @@ v__ast__Type former_expected_type; v__ast__Chan chan_info = v__ast__TypeSymbol_chan_info(left_sym); v__ast__Type elem_type = chan_info.elem_type; if (!v__checker__Checker_check_types(c, right_type, elem_type)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot push `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` on `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot push `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` on `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); } if (chan_info.is_mut) { v__checker__Checker_fail_if_immutable(c, node->right); } if (v__ast__Type_is_ptr(elem_type) && !v__ast__Type_is_ptr(right_type)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot push non-reference `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` on `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot push non-reference `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` on `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), right_pos); } v__checker__Checker_stmts_ending_with_expression(c, node->or_block.stmts); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot push on non-channel `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot push on non-channel `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); } v__ast__Type _t22 = _const_v__ast__void_type; // Defer begin @@ -50286,13 +50338,13 @@ v__ast__Type former_expected_type; { if (!c->pref->translated && !c->file->is_translated) { if (node->left_type != _const_v__ast__bool_type_idx) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("left operand for `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` is not a boolean"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("left operand for `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` is not a boolean"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); } if (node->right_type != _const_v__ast__bool_type_idx) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("right operand for `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` is not a boolean"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("right operand for `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` is not a boolean"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->right)); } } - if ((node->left)._typ == 309 /* v.ast.InfixExpr */) { + if ((node->left)._typ == 310 /* v.ast.InfixExpr */) { if ((*node->left._v__ast__InfixExpr).op != node->op && ((*node->left._v__ast__InfixExpr).op == v__token__Kind__logical_or || (*node->left._v__ast__InfixExpr).op == v__token__Kind__and)) { v__checker__Checker_error(c, _SLIT("ambiguous boolean expression. use `()` to ensure correct order of operations"), node->pos); } @@ -50401,8 +50453,8 @@ v__ast__Type former_expected_type; } else if (v__ast__Type_alias_eq(left_type, _const_v__ast__string_type) && !(node->op == v__token__Kind__plus || node->op == v__token__Kind__eq || node->op == v__token__Kind__ne || node->op == v__token__Kind__lt || node->op == v__token__Kind__gt || node->op == v__token__Kind__le || node->op == v__token__Kind__ge)) { v__checker__Checker_error(c, _SLIT("string types only have the following operators defined: `==`, `!=`, `<`, `>`, `<=`, `>=`, and `+`"), node->pos); } else if (left_sym->kind == v__ast__Kind__enum_ && right_sym->kind == v__ast__Kind__enum_ && !eq_ne) { - v__ast__Enum left_enum = /* as */ *(v__ast__Enum*)__as_cast((left_sym->info)._v__ast__Enum,(left_sym->info)._typ, 484) /*expected idx: 484, name: v.ast.Enum */ ; - v__ast__Enum right_enum = /* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 484) /*expected idx: 484, name: v.ast.Enum */ ; + v__ast__Enum left_enum = /* as */ *(v__ast__Enum*)__as_cast((left_sym->info)._v__ast__Enum,(left_sym->info)._typ, 485) /*expected idx: 485, name: v.ast.Enum */ ; + v__ast__Enum right_enum = /* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 485) /*expected idx: 485, name: v.ast.Enum */ ; if (left_enum.is_flag && right_enum.is_flag) { if (!(node->op == v__token__Kind__pipe || node->op == v__token__Kind__amp)) { v__checker__Checker_error(c, _SLIT("only `==`, `!=`, `|` and `&` are defined on `[flag]` tagged `enum`, use an explicit cast to `int` if needed"), node->pos); @@ -50412,9 +50464,9 @@ v__ast__Type former_expected_type; } } if (v__ast__Table_type_kind(c->table, left_type) == v__ast__Kind__sum_type && !eq_ne) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` with `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` with `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Table_type_kind(c->table, right_type) == v__ast__Kind__sum_type && !eq_ne) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use operator `"), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` with `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use operator `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT("` with `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } bool left_is_optional = v__ast__Type_has_flag(left_type, v__ast__TypeFlag__optional); bool right_is_optional = v__ast__Type_has_flag(right_type, v__ast__TypeFlag__optional); @@ -50440,7 +50492,7 @@ v__ast__Type former_expected_type; // Defer end return _t24; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("infix expr: cannot use `"), 0xfe10, {.d_s = right_sym->name}}, {_SLIT("` (right expression) as `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("infix expr: cannot use `"), /*115 &string*/0xfe10, {.d_s = right_sym->name}}, {_SLIT("` (right expression) as `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_right_pos); } v__ast__Type _t25 = (v__token__Kind_is_relational(node->op) ? (_const_v__ast__bool_type) : (return_type)); // Defer begin @@ -50456,50 +50508,50 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im v__token__Pos pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); bool explicit_lock_needed = false; v__ast__Expr expr = expr_; - if (expr._typ == 292 /* v.ast.CastExpr */) { + if (expr._typ == 293 /* v.ast.CastExpr */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 297 /* v.ast.ComptimeSelector */) { + else if (expr._typ == 298 /* v.ast.ComptimeSelector */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 305 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + else if (expr._typ == 306 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { if (!(*(*expr._v__ast__Ident).obj._v__ast__Var).is_mut && !c->pref->translated && !c->file->is_translated && !c->inside_unsafe) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("` is immutable, declare it with `mut` to make it mutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("` is immutable, declare it with `mut` to make it mutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } (*(*expr._v__ast__Ident).obj._v__ast__Var).is_changed = true; if (v__ast__Type_share((*(*expr._v__ast__Ident).obj._v__ast__Var).typ) == v__ast__ShareType__shared_t) { if (!Array_string_contains(c->locked_names, (*expr._v__ast__Ident).name)) { if (c->locked_names.len > 0 || c->rlocked_names.len > 0) { if (Array_string_contains(c->rlocked_names, (*expr._v__ast__Ident).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT(" has an `rlock` but needs a `lock`"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT(" has an `rlock` but needs a `lock`"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT(" must be added to the `lock` list above"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT(" must be added to the `lock` list above"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } } to_lock = (*expr._v__ast__Ident).name; pos = (*expr._v__ast__Ident).pos; } } - } else if (((*expr._v__ast__Ident).obj)._typ == 361 /* v.ast.ConstField */ && Array_string_contains(c->const_names, (*expr._v__ast__Ident).name)) { + } else if (((*expr._v__ast__Ident).obj)._typ == 362 /* v.ast.ConstField */ && Array_string_contains(c->const_names, (*expr._v__ast__Ident).name)) { if (!c->inside_unsafe) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot modify constant `"), 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot modify constant `"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } } } - else if (expr._typ == 308 /* v.ast.IndexExpr */) { + else if (expr._typ == 309 /* v.ast.IndexExpr */) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, (*expr._v__ast__IndexExpr).left_type); v__ast__Type elem_type = ((v__ast__Type)(0)); string kind = _SLIT(""); - if (left_sym->info._typ == 450 /* v.ast.Array */) { + if (left_sym->info._typ == 451 /* v.ast.Array */) { elem_type = (*left_sym->info._v__ast__Array).elem_type; kind = _SLIT("array"); } - else if (left_sym->info._typ == 478 /* v.ast.ArrayFixed */) { + else if (left_sym->info._typ == 479 /* v.ast.ArrayFixed */) { elem_type = (*left_sym->info._v__ast__ArrayFixed).elem_type; kind = _SLIT("fixed array"); } - else if (left_sym->info._typ == 451 /* v.ast.Map */) { + else if (left_sym->info._typ == 452 /* v.ast.Map */) { elem_type = (*left_sym->info._v__ast__Map).value_type; kind = _SLIT("map"); } @@ -50508,23 +50560,23 @@ 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` "), 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)); + 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_44242 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__IndexExpr).left); - to_lock = mr_44242.arg0; - pos = mr_44242.arg1; + multi_return_string_v__token__Pos mr_44340 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__IndexExpr).left); + to_lock = mr_44340.arg0; + pos = mr_44340.arg1; } - else if (expr._typ == 320 /* v.ast.ParExpr */) { - multi_return_string_v__token__Pos mr_44311 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); - to_lock = mr_44311.arg0; - pos = mr_44311.arg1; + else if (expr._typ == 321 /* v.ast.ParExpr */) { + multi_return_string_v__token__Pos mr_44409 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); + to_lock = mr_44409.arg0; + pos = mr_44409.arg1; } - else if (expr._typ == 322 /* v.ast.PrefixExpr */) { - multi_return_string_v__token__Pos mr_44383 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); - to_lock = mr_44383.arg0; - pos = mr_44383.arg1; + else if (expr._typ == 323 /* v.ast.PrefixExpr */) { + multi_return_string_v__token__Pos mr_44481 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); + to_lock = mr_44481.arg0; + pos = mr_44481.arg1; } - else if (expr._typ == 325 /* v.ast.SelectorExpr */) { + else if (expr._typ == 326 /* v.ast.SelectorExpr */) { if ((*expr._v__ast__SelectorExpr).expr_type == 0) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } @@ -50550,17 +50602,17 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im v__ast__StructField field_info = (*(v__ast__StructField*)_t6.data); if (!has_field) { 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("unknown field `"), 0xfe10, {.d_s = type_str}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } if (v__ast__Type_has_flag(field_info.typ, v__ast__TypeFlag__shared_f)) { - string expr_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr)}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string expr_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!Array_string_contains(c->locked_names, expr_name)) { if (c->locked_names.len > 0 || c->rlocked_names.len > 0) { if (Array_string_contains(c->rlocked_names, expr_name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = expr_name}}, {_SLIT(" has an `rlock` but needs a `lock`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = expr_name}}, {_SLIT(" has an `rlock` but needs a `lock`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = expr_name}}, {_SLIT(" must be added to the `lock` list above"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = expr_name}}, {_SLIT(" must be added to the `lock` list above"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); } return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; } @@ -50570,11 +50622,11 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } else { if (!field_info.is_mut && !c->pref->translated && !c->file->is_translated) { 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 `"), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("` of struct `"), 0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + 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_45847 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); - to_lock = mr_45847.arg0; - pos = mr_45847.arg1; + multi_return_string_v__token__Pos mr_45945 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); + to_lock = mr_45945.arg0; + pos = mr_45945.arg1; } if ((to_lock).len != 0) { explicit_lock_needed = true; @@ -50583,19 +50635,19 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } case v__ast__Kind__interface_: { - v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; Option_v__ast__StructField _t9 = v__ast__Interface_find_field(&interface_info, (*expr._v__ast__SelectorExpr).field_name); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; 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("unknown field `"), 0xfe10, {.d_s = type_str}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } v__ast__StructField field_info = (*(v__ast__StructField*)_t9.data); if (!field_info.is_mut) { 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 `"), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + 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 interface `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; } v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); @@ -50603,19 +50655,19 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } case v__ast__Kind__sum_type: { - v__ast__SumType sumtype_info = /* as */ *(v__ast__SumType*)__as_cast((typ_sym->info)._v__ast__SumType,(typ_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ; + v__ast__SumType sumtype_info = /* as */ *(v__ast__SumType*)__as_cast((typ_sym->info)._v__ast__SumType,(typ_sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ; Option_v__ast__StructField _t12 = v__ast__SumType_find_field(&sumtype_info, (*expr._v__ast__SelectorExpr).field_name); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; 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("unknown field `"), 0xfe10, {.d_s = type_str}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } v__ast__StructField field_info = (*(v__ast__StructField*)_t12.data); if (!field_info.is_mut) { 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 `"), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT("` of sumtype `"), 0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + 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 sumtype `"), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT("` is immutable"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; } v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__SelectorExpr).expr); @@ -50626,7 +50678,7 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im { bool inside_builtin = string__eq(c->file->mod.name, _SLIT("builtin")); if (!inside_builtin && !c->inside_unsafe) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__ast__Kind_str(typ_sym->kind)}}, {_SLIT("` can not be modified"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(typ_sym->kind)}}, {_SLIT("` can not be modified"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; } break; @@ -50671,43 +50723,43 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im case v__ast__Kind__thread: default: { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected symbol `"), 0xfe10, {.d_s = v__ast__Kind_str(typ_sym->kind)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected symbol `"), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(typ_sym->kind)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=(*expr._v__ast__SelectorExpr).pos}; break; } } ; } - else if (expr._typ == 291 /* v.ast.CallExpr */) { + else if (expr._typ == 292 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("slice"))) { - multi_return_string_v__token__Pos mr_47670 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); - to_lock = mr_47670.arg0; - pos = mr_47670.arg1; + multi_return_string_v__token__Pos mr_47768 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); + to_lock = mr_47768.arg0; + pos = mr_47768.arg1; if ((to_lock).len != 0) { explicit_lock_needed = true; } } } - else if (expr._typ == 285 /* v.ast.ArrayInit */) { + else if (expr._typ == 286 /* v.ast.ArrayInit */) { v__checker__Checker_error(c, _SLIT("array literal can not be modified"), (*expr._v__ast__ArrayInit).pos); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 330 /* v.ast.StructInit */) { + else if (expr._typ == 331 /* v.ast.StructInit */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 309 /* v.ast.InfixExpr */) { + else if (expr._typ == 310 /* v.ast.InfixExpr */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } else { if (!v__ast__Expr_is_lit(expr)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected expression `"), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected expression `"), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } } ; if (explicit_lock_needed) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = to_lock}}, {_SLIT("` is `shared` and needs explicit lock for `"), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = to_lock}}, {_SLIT("` is `shared` and needs explicit lock for `"), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); to_lock = _SLIT(""); } return (multi_return_string_v__token__Pos){.arg0=to_lock, .arg1=pos}; @@ -50725,12 +50777,12 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, bool _t2 = true; return _t2; } - if ((inter_sym->info)._typ == 473 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 474 /* v.ast.Interface */) { v__ast__Type generic_type = interface_type; v__ast__Interface generic_info = (*inter_sym->info._v__ast__Interface); if (v__ast__Type_has_flag((*inter_sym->info._v__ast__Interface).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(c->table, (*inter_sym->info._v__ast__Interface).parent_type); - if ((parent_sym->info)._typ == 473 /* v.ast.Interface */) { + if ((parent_sym->info)._typ == 474 /* v.ast.Interface */) { generic_type = (*inter_sym->info._v__ast__Interface).parent_type; generic_info = (*parent_sym->info._v__ast__Interface); } @@ -50752,7 +50804,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, return _t5; } } - if ((inter_sym->info)._typ == 473 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 474 /* v.ast.Interface */) { for (int _t6 = 0; _t6 < (*inter_sym->info._v__ast__Interface).types.len; ++_t6) { v__ast__Type t = ((v__ast__Type*)(*inter_sym->info._v__ast__Interface).types.data)[_t6]; if (v__ast__Type_idx(t) == v__ast__Type_idx(utyp)) { @@ -50771,9 +50823,9 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, return _t9; } if (typ_sym->kind == v__ast__Kind__interface_ && inter_sym->kind == v__ast__Kind__interface_ && !string_starts_with(styp, _SLIT("JS.")) && !string_starts_with(inter_sym->name, _SLIT("JS."))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot implement interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("` with a different interface `"), 0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot implement interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("` with a different interface `"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } - Array_v__ast__Fn imethods = (inter_sym->kind == v__ast__Kind__interface_ ? ((/* as */ *(v__ast__Interface*)__as_cast((inter_sym->info)._v__ast__Interface,(inter_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ).methods) : (inter_sym->methods)); + Array_v__ast__Fn imethods = (inter_sym->kind == v__ast__Kind__interface_ ? ((/* as */ *(v__ast__Interface*)__as_cast((inter_sym->info)._v__ast__Interface,(inter_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ).methods) : (inter_sym->methods)); if (!v__ast__Type_alias_eq(utyp, _const_v__ast__voidptr_type)) { for (int _t10 = 0; _t10 < imethods.len; ++_t10) { v__ast__Fn imethod = ((v__ast__Fn*)imethods.data)[_t10]; @@ -50781,13 +50833,13 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, if (_t11.state != 0) { /*or block*/ IError err = _t11.err; if (inter_sym->idx == _const_v__ast__error_type_idx && (string__eq(imethod.name, _SLIT("msg")) || string__eq(imethod.name, _SLIT("code")))) { - v__checker__Checker_note(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`. The usage of fields is being deprecated in favor of methods."), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_note(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`. The usage of fields is being deprecated in favor of methods."), 0, { .d_c = 0 }}})), pos); continue; } Option_v__ast__Fn _t12 = v__ast__TypeSymbol_find_method_with_generic_parent(typ_sym, imethod.name); if (_t12.state != 0) { /*or block*/ err = _t12.err; - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); continue; } @@ -50799,15 +50851,15 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, if (msg.len > 0) { string sig = v__ast__Table_fn_signature(c->table, (voidptr)&/*qq*/imethod, ((v__ast__FnSignatureOpts){.skip_receiver = false,.type_only = 0,})); string typ_sig = v__ast__Table_fn_signature(c->table, (voidptr)&/*qq*/method, ((v__ast__FnSignatureOpts){.skip_receiver = false,.type_only = 0,})); - v__checker__Checker_add_error_detail(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = inter_sym->name}}, {_SLIT(" has `"), 0xfe10, {.d_s = sig}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); - v__checker__Checker_add_error_detail(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT(" has `"), 0xfe10, {.d_s = typ_sig}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`: "), 0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + v__checker__Checker_add_error_detail(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT(" has `"), /*115 &string*/0xfe10, {.d_s = sig}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__checker__Checker_add_error_detail(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT(" has `"), /*115 &string*/0xfe10, {.d_s = typ_sig}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`: "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); bool _t13 = false; return _t13; } } } - if ((inter_sym->info)._typ == 473 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 474 /* v.ast.Interface */) { for (int _t14 = 0; _t14 < (*inter_sym->info._v__ast__Interface).fields.len; ++_t14) { v__ast__StructField ifield = ((v__ast__StructField*)(*inter_sym->info._v__ast__Interface).fields.data)[_t14]; Option_v__ast__StructField _t15; @@ -50816,11 +50868,11 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { string exp = v__ast__Table_type_to_str(c->table, ifield.typ); string got = v__ast__Table_type_to_str(c->table, field.typ); - v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements field `"), 0xfe10, {.d_s = ifield.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`, expected `"), 0xfe10, {.d_s = exp}}, {_SLIT("`, got `"), 0xfe10, {.d_s = got}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements field `"), /*115 &string*/0xfe10, {.d_s = ifield.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`, expected `"), /*115 &string*/0xfe10, {.d_s = exp}}, {_SLIT("`, got `"), /*115 &string*/0xfe10, {.d_s = got}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); bool _t16 = false; return _t16; } else if (ifield.is_mut && !(field.is_mut || field.is_global)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`, field `"), 0xfe10, {.d_s = ifield.name}}, {_SLIT("` must be mutable"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` incorrectly implements interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`, field `"), /*115 &string*/0xfe10, {.d_s = ifield.name}}, {_SLIT("` must be mutable"), 0, { .d_c = 0 }}})), pos); bool _t17 = false; return _t17; } @@ -50829,7 +50881,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, if (!v__ast__Type_alias_eq(utyp, _const_v__ast__voidptr_type)) { if (inter_sym->idx == _const_v__ast__error_type_idx && (string__eq(ifield.name, _SLIT("msg")) || string__eq(ifield.name, _SLIT("code")))) { } else { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement field `"), 0xfe10, {.d_s = ifield.name}}, {_SLIT("` of interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("` doesn't implement field `"), /*115 &string*/0xfe10, {.d_s = ifield.name}}, {_SLIT("` of interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } } } @@ -50840,27 +50892,29 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, } v__ast__Type v__checker__Checker_check_expr_opt_call(v__checker__Checker* c, v__ast__Expr expr, v__ast__Type ret_type) { - if ((expr)._typ == 291 /* v.ast.CallExpr */) { - if (v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional)) { + if ((expr)._typ == 292 /* v.ast.CallExpr */) { + if (v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) || v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__result)) { + string return_modifier_kind = (v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) ? (_SLIT("an option")) : (_SLIT("a result"))); + string return_modifier = (v__ast__Type_has_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) ? (_SLIT("?")) : (_SLIT("!"))); if ((*expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__absent) { if (c->inside_defer) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("() returns an option, so it should have an `or {}` block at the end"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("() returns "), /*115 &string*/0xfe10, {.d_s = return_modifier_kind}}, {_SLIT(", so it should have an `or {}` block at the end"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("() returns an option, so it should have either an `or {}` block, or `?` at the end"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("() returns "), /*115 &string*/0xfe10, {.d_s = return_modifier_kind}}, {_SLIT(", so it should have either an `or {}` block, or `"), /*115 &string*/0xfe10, {.d_s = return_modifier}}, {_SLIT("` at the end"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).pos); } } else { - v__checker__Checker_check_or_expr(c, (*expr._v__ast__CallExpr).or_block, ret_type, v__ast__Type_clear_flag((*expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional)); + v__checker__Checker_check_or_expr(c, (*expr._v__ast__CallExpr).or_block, ret_type, (*expr._v__ast__CallExpr).return_type); } v__ast__Type _t1 = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional); return _t1; } else if ((*expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__block) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `or` block, the function `"), 0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).or_block.pos); - } else if ((*expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `?`, the function `"), 0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).or_block.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `or` block, the function `"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("` does neither return an optional nor a result"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).or_block.pos); + } else if ((*expr._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `?`, the function `"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*expr._v__ast__CallExpr).or_block.pos); } - } else if ((expr)._typ == 308 /* v.ast.IndexExpr */) { + } else if ((expr)._typ == 309 /* v.ast.IndexExpr */) { if ((*expr._v__ast__IndexExpr).or_expr.kind != v__ast__OrKind__absent) { - v__checker__Checker_check_or_expr(c, (*expr._v__ast__IndexExpr).or_expr, ret_type, ret_type); + v__checker__Checker_check_or_expr(c, (*expr._v__ast__IndexExpr).or_expr, ret_type, v__ast__Type_set_flag(ret_type, v__ast__TypeFlag__optional)); } } v__ast__Type _t2 = ret_type; @@ -50868,9 +50922,21 @@ v__ast__Type v__checker__Checker_check_expr_opt_call(v__checker__Checker* c, v__ } void v__checker__Checker_check_or_expr(v__checker__Checker* c, v__ast__OrExpr node, v__ast__Type ret_type, v__ast__Type expr_return_type) { - if (node.kind == v__ast__OrKind__propagate) { + if (node.kind == v__ast__OrKind__propagate_option) { if (!v__ast__Type_has_flag(c->table->cur_fn->return_type, v__ast__TypeFlag__optional) && !string__eq(c->table->cur_fn->name, _SLIT("main.main")) && !c->inside_const) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the optional call, `"), 0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an optional"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the call, `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an optional type"), 0, { .d_c = 0 }}})), node.pos); + } + if (!v__ast__Type_has_flag(expr_return_type, v__ast__TypeFlag__optional)) { + v__checker__Checker_error(c, _SLIT("to propagate an option, the call must also return an optional type"), node.pos); + } + return; + } + if (node.kind == v__ast__OrKind__propagate_result) { + if (!v__ast__Type_has_flag(c->table->cur_fn->return_type, v__ast__TypeFlag__result) && !string__eq(c->table->cur_fn->name, _SLIT("main.main")) && !c->inside_const) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the call, `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an result type"), 0, { .d_c = 0 }}})), node.pos); + } + if (!v__ast__Type_has_flag(expr_return_type, v__ast__TypeFlag__result)) { + v__checker__Checker_error(c, _SLIT("to propagate a result, the call must also return a result type"), node.pos); } return; } @@ -50882,12 +50948,12 @@ void v__checker__Checker_check_or_expr(v__checker__Checker* c, v__ast__OrExpr no return; } v__ast__Stmt last_stmt = (*(v__ast__Stmt*)/*ee elem_sym */array_get(node.stmts, stmts_len - 1)); - v__checker__Checker_check_or_last_stmt(c, last_stmt, ret_type, expr_return_type); + v__checker__Checker_check_or_last_stmt(c, last_stmt, ret_type, v__ast__Type_clear_flag(v__ast__Type_clear_flag(expr_return_type, v__ast__TypeFlag__optional), v__ast__TypeFlag__result)); } VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* c, v__ast__Stmt stmt, v__ast__Type ret_type, v__ast__Type expr_return_type) { if (!v__ast__Type_alias_eq(ret_type, _const_v__ast__void_type)) { - if (stmt._typ == 345 /* v.ast.ExprStmt */) { + if (stmt._typ == 346 /* v.ast.ExprStmt */) { c->expected_type = ret_type; c->expected_or_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional); v__ast__Type last_stmt_typ = v__checker__Checker_expr(c, (*stmt._v__ast__ExprStmt).expr); @@ -50899,47 +50965,47 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* } string expected_type_name = v__ast__Table_type_to_str(c->table, v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional)); if (v__ast__Type_alias_eq((*stmt._v__ast__ExprStmt).typ, _const_v__ast__void_type)) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 306 /* v.ast.IfExpr */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 307 /* v.ast.IfExpr */) { for (int _t1 = 0; _t1 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.len; ++_t1) { v__ast__IfBranch branch = ((v__ast__IfBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.data)[_t1]; v__checker__Checker_check_or_last_stmt(c, (*(v__ast__Stmt*)array_last(branch.stmts)), ret_type, expr_return_type); } return; - } else if (((*stmt._v__ast__ExprStmt).expr)._typ == 315 /* v.ast.MatchExpr */) { + } else if (((*stmt._v__ast__ExprStmt).expr)._typ == 316 /* v.ast.MatchExpr */) { for (int _t2 = 0; _t2 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.len; ++_t2) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.data)[_t2]; v__checker__Checker_check_or_last_stmt(c, (*(v__ast__Stmt*)array_last(branch.stmts)), ret_type, expr_return_type); } return; } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`or` block must provide a default value of type `"), 0xfe10, {.d_s = expected_type_name}}, {_SLIT("`, or return/continue/break or call a [noreturn] function like panic(err) or exit(1)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`or` block must provide a default value of type `"), /*115 &string*/0xfe10, {.d_s = expected_type_name}}, {_SLIT("`, or return/continue/break or call a [noreturn] function like panic(err) or exit(1)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); } else { string type_name = v__ast__Table_type_to_str(c->table, last_stmt_typ); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong return type `"), 0xfe10, {.d_s = type_name}}, {_SLIT("` in the `or {}` block, expected `"), 0xfe10, {.d_s = expected_type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong return type `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("` in the `or {}` block, expected `"), /*115 &string*/0xfe10, {.d_s = expected_type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); } } - else if (stmt._typ == 339 /* v.ast.BranchStmt */) { + else if (stmt._typ == 340 /* v.ast.BranchStmt */) { if (!((*stmt._v__ast__BranchStmt).kind == v__token__Kind__key_continue || (*stmt._v__ast__BranchStmt).kind == v__token__Kind__key_break)) { v__checker__Checker_error(c, _SLIT("only break/continue is allowed as a branch statement in the end of an `or {}` block"), (*stmt._v__ast__BranchStmt).pos); return; } } - else if (stmt._typ == 356 /* v.ast.Return */) { + else if (stmt._typ == 357 /* v.ast.Return */) { } else { string expected_type_name = v__ast__Table_type_to_str(c->table, v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional)); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("last statement in the `or {}` block should be an expression of type `"), 0xfe10, {.d_s = expected_type_name}}, {_SLIT("` or exit parent scope"), 0, { .d_c = 0 }}})), (*(stmt.pos))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("last statement in the `or {}` block should be an expression of type `"), /*115 &string*/0xfe10, {.d_s = expected_type_name}}, {_SLIT("` or exit parent scope"), 0, { .d_c = 0 }}})), (*(stmt.pos))); } ; - } else if ((stmt)._typ == 345 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).expr._typ == 306 /* v.ast.IfExpr */) { + } else if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 307 /* v.ast.IfExpr */) { for (int _t3 = 0; _t3 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.len; ++_t3) { v__ast__IfBranch branch = ((v__ast__IfBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.data)[_t3]; v__checker__Checker_check_or_last_stmt(c, (*(v__ast__Stmt*)array_last(branch.stmts)), ret_type, expr_return_type); } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 315 /* v.ast.MatchExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 316 /* v.ast.MatchExpr */) { for (int _t4 = 0; _t4 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.len; ++_t4) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.data)[_t4]; v__checker__Checker_check_or_last_stmt(c, (*(v__ast__Stmt*)array_last(branch.stmts)), ret_type, expr_return_type); @@ -50958,7 +51024,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* } string type_name = v__ast__Table_type_to_str(c->table, (*stmt._v__ast__ExprStmt).typ); string expr_return_type_name = v__ast__Table_type_to_str(c->table, expr_return_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("the default expression type in the `or` block should be `"), 0xfe10, {.d_s = expr_return_type_name}}, {_SLIT("`, instead you gave a value of type `"), 0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("the default expression type in the `or` block should be `"), /*115 &string*/0xfe10, {.d_s = expr_return_type_name}}, {_SLIT("`, instead you gave a value of type `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); } ; } @@ -50968,18 +51034,18 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S bool prevent_sum_type_unwrapping_once = c->prevent_sum_type_unwrapping_once; c->prevent_sum_type_unwrapping_once = false; bool using_new_err_struct_save = c->using_new_err_struct; - if (string__eq( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(node->expr)}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("err"))) { + if (string__eq( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node->expr)}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("err"))) { c->using_new_err_struct = true; } int name_type = 0; - if (node->expr._typ == 305 /* v.ast.Ident */) { + if (node->expr._typ == 306 /* v.ast.Ident */) { string name = (*node->expr._v__ast__Ident).name; bool valid_generic = v__util__is_generic_type_name(name) && Array_string_contains(c->table->cur_fn->generic_names, name); if (valid_generic) { name_type = v__ast__Type_set_flag(((v__ast__Table_find_type_idx(c->table, name))), v__ast__TypeFlag__generic); } } - else if (node->expr._typ == 332 /* v.ast.TypeOf */) { + else if (node->expr._typ == 333 /* v.ast.TypeOf */) { name_type = v__checker__Checker_expr(c, (*node->expr._v__ast__TypeOf).expr); } @@ -51005,7 +51071,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S v__ast__Type _t4 = _const_v__ast__int_type; return _t4; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid field `."), 0xfe10, {.d_s = node->field_name}}, {_SLIT("` for type `"), 0xfe10, {.d_s = v__ast__Expr_str(node->expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid field `."), /*115 &string*/0xfe10, {.d_s = node->field_name}}, {_SLIT("` for type `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node->expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t5 = _const_v__ast__string_type; return _t5; }; @@ -51014,8 +51080,8 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S c->inside_selector_expr = true; v__ast__Type typ = v__checker__Checker_expr(c, node->expr); if (v__ast__Expr_is_auto_deref_var(node->expr)) { - if ((node->expr)._typ == 305 /* v.ast.Ident */) { - if (((*node->expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((node->expr)._typ == 306 /* v.ast.Ident */) { + if (((*node->expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { typ = (*(*node->expr._v__ast__Ident).obj._v__ast__Var).typ; } } @@ -51027,7 +51093,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S return _t6; } node->expr_type = typ; - if (v__ast__Type_has_flag(node->expr_type, v__ast__TypeFlag__optional) && !((node->expr)._typ == 305 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->expr)._v__ast__Ident,(node->expr)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ).kind == v__ast__IdentKind__constant)) { + if (v__ast__Type_has_flag(node->expr_type, v__ast__TypeFlag__optional) && !((node->expr)._typ == 306 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->expr)._v__ast__Ident,(node->expr)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ).kind == v__ast__IdentKind__constant)) { v__checker__Checker_error(c, _SLIT("cannot access fields of an optional, handle the error with `or {...}` or propagate it with `?`"), node->pos); } string field_name = node->field_name; @@ -51048,10 +51114,10 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S return _t9; } } - string unknown_field_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` has no field named `"), 0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string unknown_field_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has no field named `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); bool has_field = false; v__ast__StructField field = ((v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}); - if (field_name.len > 0 && u8_is_capital(string_at(field_name, 0)) && (sym->info)._typ == 455 /* v.ast.Struct */ && sym->language == v__ast__Language__v) { + if (field_name.len > 0 && u8_is_capital(string_at(field_name, 0)) && (sym->info)._typ == 456 /* v.ast.Struct */ && sym->language == v__ast__Language__v) { for (int _t10 = 0; _t10 < (*sym->info._v__ast__Struct).embeds.len; ++_t10) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Struct).embeds.data)[_t10]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(c->table, embed); @@ -51081,16 +51147,16 @@ 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){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_60871 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t13.data); - field = mr_60871.arg0; - embed_types = mr_60871.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_61862 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t13.data); + field = mr_61862.arg0; + embed_types = mr_61862.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); } } if (!c->inside_unsafe) { - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_union && !Array_v__token__Kind_contains(_const_v__token__assign_tokens, node->next_token)) { v__checker__Checker_warn(c, _SLIT("reading a union field (or its address) requires `unsafe`"), node->pos); } @@ -51117,9 +51183,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){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_61702 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t15.data); - field = mr_61702.arg0; - embed_types = mr_61702.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_62693 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t15.data); + field = mr_62693.arg0; + embed_types = mr_62693.arg1; node->from_embed_types = embed_types; } } @@ -51128,20 +51194,20 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S Option_v__ast__Fn _t16 = v__ast__Table_find_method(c->table, sym, field_name); if (_t16.state != 0) { /*or block*/ IError err = _t16.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid `IError` interface implementation: "), 0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid `IError` interface implementation: "), /*115 &IError*/0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t17 = _const_v__ast__void_type; return _t17; } v__ast__Fn method = (*(v__ast__Fn*)_t16.data); - v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("the `."), 0xfe10, {.d_s = field_name}}, {_SLIT("` field on `IError` is deprecated, and will be removed after 2022-06-01, use `."), 0xfe10, {.d_s = field_name}}, {_SLIT("()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("the `."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("` field on `IError` is deprecated, and will be removed after 2022-06-01, use `."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("()` instead."), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t18 = method.return_type; return _t18; } if (has_field) { if (!string__eq(sym->mod, c->mod) && !field.is_pub && sym->language != v__ast__Language__c) { v__ast__TypeSymbol* unwrapped_sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, typ)); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = unwrapped_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT("` is not public"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = unwrapped_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("` is not public"), 0, { .d_c = 0 }}})), node->pos); } v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, field.typ); if (field_sym->kind == v__ast__Kind__sum_type || field_sym->kind == v__ast__Kind__interface_) { @@ -51166,10 +51232,10 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S v__ast__Type _t22 = _const_v__ast__int_type; return _t22; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = unwrapped_sym->name}}, {_SLIT("` has no property `"), 0xfe10, {.d_s = node->field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = unwrapped_sym->name}}, {_SLIT("` has no property `"), /*115 &string*/0xfe10, {.d_s = node->field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else { - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { if (!v__token__Pos_struct_eq(c->smartcast_mut_pos, ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}))) { v__checker__Checker_note(c, _SLIT("smartcasting requires either an immutable value, or an explicit mut keyword before the value"), c->smartcast_mut_pos); } @@ -51208,7 +51274,7 @@ void v__checker__Checker_const_decl(v__checker__Checker* c, v__ast__ConstDecl* n v__ast__ConstField field = ((v__ast__ConstField*)node->fields.data)[_t1]; if (Array_string_contains(c->const_names, field.name)) { v__token__Pos name_pos = ((v__token__Pos){.len = v__util__no_cur_mod(field.name, c->mod).len,field.pos.line_nr,field.pos.pos,field.pos.col,field.pos.last_line,}); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate const `"), 0xfe10, {.d_s = field.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate const `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); } array_push((array*)&c->const_names, _MOV((string[]){ string_clone(field.name) })); } @@ -51239,31 +51305,31 @@ void v__checker__Checker_enum_decl(v__checker__Checker* c, v__ast__EnumDecl* nod for (int i = 0; i < node->fields.len; ++i) { v__ast__EnumField* field = ((v__ast__EnumField*)node->fields.data) + i; if (!c->pref->experimental && v__util__contains_capital(field->name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), 0xfe10, {.d_s = field->name}}, {_SLIT("` cannot contain uppercase letters, use snake_case instead"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), /*115 &string*/0xfe10, {.d_s = field->name}}, {_SLIT("` cannot contain uppercase letters, use snake_case instead"), 0, { .d_c = 0 }}})), field->pos); } for (int j = 0; j < i; ++j) { if (string__eq(field->name, (*(v__ast__EnumField*)/*ee elem_sym */array_get(node->fields, j)).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), 0xfe10, {.d_s = field->name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), /*115 &string*/0xfe10, {.d_s = field->name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field->pos); } } if (field->has_expr) { - if (field->expr._typ == 310 /* v.ast.IntegerLiteral */) { + if (field->expr._typ == 311 /* v.ast.IntegerLiteral */) { i64 val = string_i64((*field->expr._v__ast__IntegerLiteral).val); if (val < _const_v__checker__int_min || val > _const_v__checker__int_max) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), 0xfe09, {.d_i64 = val}}, {_SLIT("` overflows int"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), /*100 &i64*/0xfe09, {.d_i64 = val}}, {_SLIT("` overflows int"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); } else if (!c->pref->translated && !c->file->is_translated && !node->is_multi_allowed && Array_i64_contains(seen, ((i64)(val)))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), 0xfe09, {.d_i64 = val}}, {_SLIT("` already exists"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), /*100 &i64*/0xfe09, {.d_i64 = val}}, {_SLIT("` already exists"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); } array_push((array*)&seen, _MOV((i64[]){ ((i64)(val)) })); } - else if (field->expr._typ == 322 /* v.ast.PrefixExpr */) { + else if (field->expr._typ == 323 /* v.ast.PrefixExpr */) { } - else if (field->expr._typ == 309 /* v.ast.InfixExpr */) { + else if (field->expr._typ == 310 /* v.ast.InfixExpr */) { v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*field->expr._v__ast__InfixExpr)); } else { - if ((field->expr)._typ == 305 /* v.ast.Ident */) { + if ((field->expr)._typ == 306 /* v.ast.Ident */) { if ((*field->expr._v__ast__Ident).language == v__ast__Language__c) { continue; } @@ -51281,7 +51347,7 @@ void v__checker__Checker_enum_decl(v__checker__Checker* c, v__ast__EnumDecl* nod if (last == _const_v__checker__int_max) { v__checker__Checker_error(c, _SLIT("enum value overflows"), field->pos); } else if (!c->pref->translated && !c->file->is_translated && !node->is_multi_allowed && Array_i64_contains(seen, last + 1)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), 0xfe09, {.d_i64 = last + 1}}, {_SLIT("` already exists"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum value `"), /*100 &i64*/0xfe09, {.d_i64 = last + 1}}, {_SLIT("` already exists"), 0, { .d_c = 0 }}})), field->pos); } array_push((array*)&seen, _MOV((i64[]){ last + 1 })); } else { @@ -51306,38 +51372,38 @@ inline VV_LOCAL_SYMBOL void v__checker__Checker_check_loop_label(v__checker__Che VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__Stmt node_) { v__ast__Stmt node = node_; c->expected_type = _const_v__ast__void_type; - if (node._typ == 343 /* v.ast.EmptyStmt */) { + if (node._typ == 344 /* v.ast.EmptyStmt */) { if (c->pref->is_verbose) { eprintln(_SLIT("Checker.stmt() EmptyStmt")); print_backtrace(); } } - else if (node._typ == 316 /* v.ast.NodeError */) { + else if (node._typ == 317 /* v.ast.NodeError */) { } - else if (node._typ == 335 /* v.ast.AsmStmt */) { + else if (node._typ == 336 /* v.ast.AsmStmt */) { v__checker__Checker_asm_stmt(c, (voidptr)&/*qq*/(*node._v__ast__AsmStmt)); } - else if (node._typ == 336 /* v.ast.AssertStmt */) { + else if (node._typ == 337 /* v.ast.AssertStmt */) { v__checker__Checker_assert_stmt(c, (*node._v__ast__AssertStmt)); } - else if (node._typ == 337 /* v.ast.AssignStmt */) { + else if (node._typ == 338 /* v.ast.AssignStmt */) { v__checker__Checker_assign_stmt(c, (voidptr)&/*qq*/(*node._v__ast__AssignStmt)); } - else if (node._typ == 338 /* v.ast.Block */) { + else if (node._typ == 339 /* v.ast.Block */) { v__checker__Checker_block(c, (*node._v__ast__Block)); } - else if (node._typ == 339 /* v.ast.BranchStmt */) { + else if (node._typ == 340 /* v.ast.BranchStmt */) { v__checker__Checker_branch_stmt(c, (*node._v__ast__BranchStmt)); } - else if (node._typ == 340 /* v.ast.ComptimeFor */) { + else if (node._typ == 341 /* v.ast.ComptimeFor */) { v__checker__Checker_comptime_for(c, (*node._v__ast__ComptimeFor)); } - else if (node._typ == 341 /* v.ast.ConstDecl */) { + else if (node._typ == 342 /* v.ast.ConstDecl */) { c->inside_const = true; v__checker__Checker_const_decl(c, (voidptr)&/*qq*/(*node._v__ast__ConstDecl)); c->inside_const = false; } - else if (node._typ == 342 /* v.ast.DeferStmt */) { + else if (node._typ == 343 /* v.ast.DeferStmt */) { if ((*node._v__ast__DeferStmt).idx_in_fn < 0) { (*node._v__ast__DeferStmt).idx_in_fn = c->table->cur_fn->defer_stmts.len; array_push((array*)&c->table->cur_fn->defer_stmts, _MOV((v__ast__DeferStmt[]){ *&(*node._v__ast__DeferStmt) })); @@ -51348,7 +51414,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St for (int i = 0; i < (*node._v__ast__DeferStmt).defer_vars.len; ++i) { v__ast__Ident ident = ((v__ast__Ident*)(*node._v__ast__DeferStmt).defer_vars.data)[i]; v__ast__Ident id = ident; - if ((id.info)._typ == 415 /* v.ast.IdentVar */) { + if ((id.info)._typ == 416 /* v.ast.IdentVar */) { if (id.comptime && Array_string_contains(_const_v__checker__valid_comptime_not_user_defined, id.name)) { (*(v__ast__Ident*)/*ee elem_sym */array_get((*node._v__ast__DeferStmt).defer_vars, i)) = ((v__ast__Ident){.language = 0,.tok_kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comptime = 0,.scope = 0,.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = _SLIT(""),.kind = 0,.info = {0},.is_mut = 0,}); continue; @@ -51365,20 +51431,20 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St v__checker__Checker_stmts(c, (*node._v__ast__DeferStmt).stmts); c->inside_defer = false; } - else if (node._typ == 344 /* v.ast.EnumDecl */) { + else if (node._typ == 345 /* v.ast.EnumDecl */) { v__checker__Checker_enum_decl(c, (voidptr)&/*qq*/(*node._v__ast__EnumDecl)); } - else if (node._typ == 345 /* v.ast.ExprStmt */) { + else if (node._typ == 346 /* v.ast.ExprStmt */) { (*node._v__ast__ExprStmt).typ = v__checker__Checker_expr(c, (*node._v__ast__ExprStmt).expr); c->expected_type = _const_v__ast__void_type; v__ast__Type or_typ = _const_v__ast__void_type; - if ((*node._v__ast__ExprStmt).expr._typ == 308 /* v.ast.IndexExpr */) { + if ((*node._v__ast__ExprStmt).expr._typ == 309 /* v.ast.IndexExpr */) { if ((*(*node._v__ast__ExprStmt).expr._v__ast__IndexExpr).or_expr.kind != v__ast__OrKind__absent) { (*node._v__ast__ExprStmt).is_expr = true; or_typ = (*node._v__ast__ExprStmt).typ; } } - else if ((*node._v__ast__ExprStmt).expr._typ == 322 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__ExprStmt).expr._typ == 323 /* v.ast.PrefixExpr */) { if ((*(*node._v__ast__ExprStmt).expr._v__ast__PrefixExpr).or_block.kind != v__ast__OrKind__absent) { (*node._v__ast__ExprStmt).is_expr = true; or_typ = (*node._v__ast__ExprStmt).typ; @@ -51389,7 +51455,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St } ; if (!c->pref->is_repl && (c->stmt_level == 1 || (c->stmt_level > 1 && !c->is_last_stmt))) { - if (((*node._v__ast__ExprStmt).expr)._typ == 309 /* v.ast.InfixExpr */) { + if (((*node._v__ast__ExprStmt).expr)._typ == 310 /* v.ast.InfixExpr */) { if ((*(*node._v__ast__ExprStmt).expr._v__ast__InfixExpr).op == v__token__Kind__left_shift) { v__ast__TypeSymbol* left_sym = v__ast__Table_final_sym(c->table, (*(*node._v__ast__ExprStmt).expr._v__ast__InfixExpr).left_type); if (left_sym->kind != v__ast__Kind__array) { @@ -51400,24 +51466,24 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St } v__checker__Checker_check_expr_opt_call(c, (*node._v__ast__ExprStmt).expr, or_typ); } - else if (node._typ == 218 /* v.ast.FnDecl */) { + else if (node._typ == 219 /* v.ast.FnDecl */) { v__checker__Checker_fn_decl(c, (voidptr)&/*qq*/(*node._v__ast__FnDecl)); } - else if (node._typ == 346 /* v.ast.ForCStmt */) { + else if (node._typ == 347 /* v.ast.ForCStmt */) { v__checker__Checker_for_c_stmt(c, (*node._v__ast__ForCStmt)); } - else if (node._typ == 347 /* v.ast.ForInStmt */) { + else if (node._typ == 348 /* v.ast.ForInStmt */) { v__checker__Checker_for_in_stmt(c, (voidptr)&/*qq*/(*node._v__ast__ForInStmt)); } - else if (node._typ == 348 /* v.ast.ForStmt */) { + else if (node._typ == 349 /* v.ast.ForStmt */) { v__checker__Checker_for_stmt(c, (voidptr)&/*qq*/(*node._v__ast__ForStmt)); } - else if (node._typ == 349 /* v.ast.GlobalDecl */) { + else if (node._typ == 350 /* v.ast.GlobalDecl */) { v__checker__Checker_global_decl(c, (voidptr)&/*qq*/(*node._v__ast__GlobalDecl)); } - else if (node._typ == 350 /* v.ast.GotoLabel */) { + else if (node._typ == 351 /* v.ast.GotoLabel */) { } - else if (node._typ == 351 /* v.ast.GotoStmt */) { + else if (node._typ == 352 /* v.ast.GotoStmt */) { if (c->inside_defer) { v__checker__Checker_error(c, _SLIT("goto is not allowed in defer statements"), (*node._v__ast__GotoStmt).pos); } @@ -51425,35 +51491,35 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St v__checker__Checker_warn(c, _SLIT("`goto` requires `unsafe` (consider using labelled break/continue)"), (*node._v__ast__GotoStmt).pos); } if (!Array_string_contains(c->table->cur_fn->label_names, (*node._v__ast__GotoStmt).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown label `"), 0xfe10, {.d_s = (*node._v__ast__GotoStmt).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__GotoStmt).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown label `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__GotoStmt).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__GotoStmt).pos); } } - else if (node._typ == 352 /* v.ast.HashStmt */) { + else if (node._typ == 353 /* v.ast.HashStmt */) { v__checker__Checker_hash_stmt(c, (voidptr)&/*qq*/(*node._v__ast__HashStmt)); } - else if (node._typ == 353 /* v.ast.Import */) { + else if (node._typ == 354 /* v.ast.Import */) { v__checker__Checker_import_stmt(c, (*node._v__ast__Import)); } - else if (node._typ == 354 /* v.ast.InterfaceDecl */) { + else if (node._typ == 355 /* v.ast.InterfaceDecl */) { v__checker__Checker_interface_decl(c, (voidptr)&/*qq*/(*node._v__ast__InterfaceDecl)); } - else if (node._typ == 355 /* v.ast.Module */) { + else if (node._typ == 356 /* v.ast.Module */) { c->mod = (*node._v__ast__Module).name; c->is_just_builtin_mod = string__eq((*node._v__ast__Module).name, _SLIT("builtin")); c->is_builtin_mod = c->is_just_builtin_mod || (string__eq((*node._v__ast__Module).name, _SLIT("os")) || string__eq((*node._v__ast__Module).name, _SLIT("strconv"))); v__checker__Checker_check_valid_snake_case(c, (*node._v__ast__Module).name, _SLIT("module name"), (*node._v__ast__Module).pos); } - else if (node._typ == 356 /* v.ast.Return */) { + else if (node._typ == 357 /* v.ast.Return */) { v__checker__Checker_return_stmt(c, (voidptr)&/*qq*/(*node._v__ast__Return)); c->scope_returns = true; } - else if (node._typ == 357 /* v.ast.SqlStmt */) { + else if (node._typ == 358 /* v.ast.SqlStmt */) { v__checker__Checker_sql_stmt(c, (voidptr)&/*qq*/(*node._v__ast__SqlStmt)); } - else if (node._typ == 358 /* v.ast.StructDecl */) { + else if (node._typ == 359 /* v.ast.StructDecl */) { v__checker__Checker_struct_decl(c, (voidptr)&/*qq*/(*node._v__ast__StructDecl)); } - else if (node._typ == 282 /* v.ast.TypeDecl */) { + else if (node._typ == 283 /* v.ast.TypeDecl */) { v__checker__Checker_type_decl(c, (*node._v__ast__TypeDecl)); } ; @@ -51464,7 +51530,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_assert_stmt(v__checker__Checker* c, v__ v__ast__Type assert_type = v__checker__Checker_check_expr_opt_call(c, node.expr, v__checker__Checker_expr(c, node.expr)); if (assert_type != _const_v__ast__bool_type_idx) { string atype_name = v__ast__Table_sym(c->table, assert_type)->name; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("assert can be used only with `bool` expressions, but found `"), 0xfe10, {.d_s = atype_name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("assert can be used only with `bool` expressions, but found `"), /*115 &string*/0xfe10, {.d_s = atype_name}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), node.pos); } v__checker__Checker_fail_if_unreadable(c, node.expr, _const_v__ast__bool_type_idx, _SLIT("assertion")); c->expected_type = cur_exp_typ; @@ -51482,14 +51548,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_block(v__checker__Checker* c, v__ast__B VV_LOCAL_SYMBOL void v__checker__Checker_branch_stmt(v__checker__Checker* c, v__ast__BranchStmt node) { if (c->inside_defer) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(node.kind)}}, {_SLIT("` is not allowed in defer statements"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.kind)}}, {_SLIT("` is not allowed in defer statements"), 0, { .d_c = 0 }}})), node.pos); } if (c->in_for_count == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__token__Kind_str(node.kind)}}, {_SLIT(" statement not within a loop"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.kind)}}, {_SLIT(" statement not within a loop"), 0, { .d_c = 0 }}})), node.pos); } if (node.label.len > 0) { if (!string__eq(node.label, c->loop_label)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid label name `"), 0xfe10, {.d_s = node.label}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid label name `"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); } } } @@ -51499,14 +51565,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_global_decl(v__checker__Checker* c, v__ v__ast__GlobalField* field = ((v__ast__GlobalField*)node->fields.data) + _t1; v__checker__Checker_check_valid_snake_case(c, field->name, _SLIT("global name"), field->pos); if (Array_string_contains(c->global_names, field->name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate global `"), 0xfe10, {.d_s = field->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate global `"), /*115 &string*/0xfe10, {.d_s = field->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, field->typ); if (sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->typ_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->typ_pos); } if (field->has_expr) { - if ((field->expr)._typ == 283 /* v.ast.AnonFn */ && string__eq(field->name, _SLIT("main"))) { + if ((field->expr)._typ == 284 /* v.ast.AnonFn */ && string__eq(field->name, _SLIT("main"))) { v__checker__Checker_error(c, _SLIT("the `main` function is the program entry point, cannot redefine it"), field->pos); } field->typ = v__checker__Checker_expr(c, field->expr); @@ -51542,7 +51608,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_asm_stmt(v__checker__Checker* c, v__ast v__ast__AsmTemplate* _v_template = ((v__ast__AsmTemplate*)stmt->templates.data) + _t2; if (_v_template->is_directive) { if (!(string__eq(_v_template->name, _SLIT("skip")) || string__eq(_v_template->name, _SLIT("space")) || string__eq(_v_template->name, _SLIT("byte")) || string__eq(_v_template->name, _SLIT("word")) || string__eq(_v_template->name, _SLIT("short")) || string__eq(_v_template->name, _SLIT("int")) || string__eq(_v_template->name, _SLIT("long")) || string__eq(_v_template->name, _SLIT("quad")) || string__eq(_v_template->name, _SLIT("globl")) || string__eq(_v_template->name, _SLIT("global")) || string__eq(_v_template->name, _SLIT("section")) || string__eq(_v_template->name, _SLIT("text")) || string__eq(_v_template->name, _SLIT("data")) || string__eq(_v_template->name, _SLIT("bss")) || string__eq(_v_template->name, _SLIT("fill")) || string__eq(_v_template->name, _SLIT("org")) || string__eq(_v_template->name, _SLIT("previous")) || string__eq(_v_template->name, _SLIT("string")) || string__eq(_v_template->name, _SLIT("asciz")) || string__eq(_v_template->name, _SLIT("ascii")))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown assembler directive: `"), 0xfe10, {.d_s = _v_template->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), _v_template->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown assembler directive: `"), /*115 &string*/0xfe10, {.d_s = _v_template->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), _v_template->pos); } } for (int _t3 = 0; _t3 < _v_template->args.len; ++_t3) { @@ -51557,9 +51623,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_asm_stmt(v__checker__Checker* c, v__ast } VV_LOCAL_SYMBOL void v__checker__Checker_asm_arg(v__checker__Checker* c, v__ast__AsmArg arg, v__ast__AsmStmt stmt, Array_string aliases) { - if (arg._typ == 436 /* v.ast.AsmAlias */) { + if (arg._typ == 437 /* v.ast.AsmAlias */) { } - else if (arg._typ == 435 /* v.ast.AsmAddressing */) { + else if (arg._typ == 436 /* v.ast.AsmAddressing */) { if (!((*arg._v__ast__AsmAddressing).scale == -1 || (*arg._v__ast__AsmAddressing).scale == 1 || (*arg._v__ast__AsmAddressing).scale == 2 || (*arg._v__ast__AsmAddressing).scale == 4 || (*arg._v__ast__AsmAddressing).scale == 8)) { v__checker__Checker_error(c, _SLIT("scale must be one of 1, 2, 4, or 8"), (*arg._v__ast__AsmAddressing).pos); } @@ -51567,17 +51633,17 @@ VV_LOCAL_SYMBOL void v__checker__Checker_asm_arg(v__checker__Checker* c, v__ast_ v__checker__Checker_asm_arg(c, (*arg._v__ast__AsmAddressing).base, stmt, aliases); v__checker__Checker_asm_arg(c, (*arg._v__ast__AsmAddressing).index, stmt, aliases); } - else if (arg._typ == 289 /* v.ast.BoolLiteral */) { + else if (arg._typ == 290 /* v.ast.BoolLiteral */) { } - else if (arg._typ == 303 /* v.ast.FloatLiteral */) { + else if (arg._typ == 304 /* v.ast.FloatLiteral */) { } - else if (arg._typ == 294 /* v.ast.CharLiteral */) { + else if (arg._typ == 295 /* v.ast.CharLiteral */) { } - else if (arg._typ == 310 /* v.ast.IntegerLiteral */) { + else if (arg._typ == 311 /* v.ast.IntegerLiteral */) { } - else if (arg._typ == 360 /* v.ast.AsmRegister */) { + else if (arg._typ == 361 /* v.ast.AsmRegister */) { } - else if (arg._typ == 437 /* v.ast.AsmDisp */) { + else if (arg._typ == 438 /* v.ast.AsmDisp */) { } else if (arg._typ == 20 /* string */) { } @@ -51651,13 +51717,13 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } string vroot = (*(string*)_t1.data); - node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->kind}}, {_SLIT(" "), 0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); + node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->kind}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); node->main = vroot; flag = vroot; } if (string_contains(flag, _SLIT("@VEXEROOT"))) { string vroot = string_replace(flag, _SLIT("@VEXEROOT"), os__dir(v__pref__vexe_path())); - node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->kind}}, {_SLIT(" "), 0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); + node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->kind}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); node->main = vroot; flag = vroot; } @@ -51670,7 +51736,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } string vroot = (*(string*)_t2.data); - node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->kind}}, {_SLIT(" "), 0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); + node->val = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->kind}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = vroot}}, {_SLIT0, 0, { .d_c = 0 }}})); node->main = vroot; flag = vroot; } @@ -51702,21 +51768,21 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as node->val = fcontent; } else { IError err = _t4.err; - string missing_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("The file "), 0xfe10, {.d_s = original_flag}}, {_SLIT(", needed for insertion by module `"), 0xfe10, {.d_s = node->mod}}, {_SLIT("`,"), 0, { .d_c = 0 }}})); + string missing_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("The file "), /*115 &string*/0xfe10, {.d_s = original_flag}}, {_SLIT(", needed for insertion by module `"), /*115 &string*/0xfe10, {.d_s = node->mod}}, {_SLIT("`,"), 0, { .d_c = 0 }}})); if (os__is_file(node->main)) { missing_message = /*f*/string__plus(missing_message, _SLIT(" is not readable.")); } else { missing_message = /*f*/string__plus(missing_message, _SLIT(" does not exist.")); } if ((node->msg).len != 0) { - missing_message = /*f*/string__plus(missing_message, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = node->msg}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + missing_message = /*f*/string__plus(missing_message, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = node->msg}}, {_SLIT("."), 0, { .d_c = 0 }}}))); } v__checker__Checker_error(c, missing_message, node->pos); } } } else if (string__eq(node->kind, _SLIT("pkgconfig"))) { - Array_string args = (string_contains(node->main, _SLIT("--")) ? (string_split(node->main, _SLIT(" "))) : (string_split( str_intp(2, _MOV((StrIntpData[]){{_SLIT("--cflags --libs "), 0xfe10, {.d_s = node->main}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(" ")))); + Array_string args = (string_contains(node->main, _SLIT("--")) ? (string_split(node->main, _SLIT(" "))) : (string_split( str_intp(2, _MOV((StrIntpData[]){{_SLIT("--cflags --libs "), /*115 &string*/0xfe10, {.d_s = node->main}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(" ")))); Option_v__pkgconfig__Main_ptr _t5 = v__pkgconfig__main(args); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; @@ -51782,7 +51848,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as string deprecated = ((string*)_t11.data)[_t12]; if (string_contains(flag, deprecated)) { if (!string_contains(flag, _SLIT("@VMODROOT"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = deprecated}}, {_SLIT(" had been deprecated, use @VMODROOT instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = deprecated}}, {_SLIT(" had been deprecated, use @VMODROOT instead."), 0, { .d_c = 0 }}})), node->pos); } } } @@ -51797,7 +51863,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } else { if (!string__eq(node->kind, _SLIT("define"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `#define`, `#flag`, `#include`, `#insert` or `#pkgconfig` not "), 0xfe10, {.d_s = node->val}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `#define`, `#flag`, `#include`, `#insert` or `#pkgconfig` not "), /*115 &string*/0xfe10, {.d_s = node->val}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } }; } @@ -51806,26 +51872,26 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ v__checker__Checker_check_valid_snake_case(c, node.alias, _SLIT("module alias"), node.pos); for (int _t1 = 0; _t1 < node.syms.len; ++_t1) { v__ast__ImportSymbol sym = ((v__ast__ImportSymbol*)node.syms.data)[_t1]; - string name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.mod}}, {_SLIT("."), 0xfe10, {.d_s = sym.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (u8_is_capital(string_at(sym.name, 0))) { Option_v__ast__TypeSymbol_ptr _t2; if (_t2 = v__ast__Table_find_sym(c->table, name), _t2.state == 0) { v__ast__TypeSymbol* type_sym = *(v__ast__TypeSymbol**)_t2.data; if (type_sym->kind != v__ast__Kind__placeholder) { if (!type_sym->is_pub) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), 0xfe10, {.d_s = node.mod}}, {_SLIT("` type `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("` type `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), sym.pos); } continue; } } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), 0xfe10, {.d_s = node.mod}}, {_SLIT("` has no type `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("` has no type `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), sym.pos); continue; } Option_v__ast__Fn _t3; if (_t3 = v__ast__Table_find_fn(c->table, name), _t3.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t3.data; if (!func.is_pub) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), 0xfe10, {.d_s = node.mod}}, {_SLIT("` function `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("()` is private"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("` function `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("()` is private"), 0, { .d_c = 0 }}})), sym.pos); } continue; } @@ -51833,7 +51899,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ if (_t4 = v__ast__Scope_find_const(c->file->global_scope, name), _t4.state == 0) { continue; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), 0xfe10, {.d_s = node.mod}}, {_SLIT("` has no constant or function `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), sym.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("module `"), /*115 &string*/0xfe10, {.d_s = node.mod}}, {_SLIT("` has no constant or function `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), sym.pos); } time__Time* _t6 = (time__Time*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, c->table->mdeprecated_after), &(string[]){node.mod})); Option_time__Time _t5 = {0}; @@ -51865,7 +51931,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmts_ending_with_expression(v__checker } if (c->stmt_level > _const_v__checker__stmt_level_cutoff_limit) { c->scope_returns = false; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker: too many stmt levels: "), 0xfe07, {.d_i32 = c->stmt_level}}, {_SLIT(" "), 0, { .d_c = 0 }}})), (*((*(v__ast__Stmt*)/*ee elem_sym */array_get(stmts, 0)).pos))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker: too many stmt levels: "), /*100 &int*/0xfe07, {.d_i32 = c->stmt_level}}, {_SLIT(" "), 0, { .d_c = 0 }}})), (*((*(v__ast__Stmt*)/*ee elem_sym */array_get(stmts, 0)).pos))); return; } v__token__Pos unreachable = ((v__token__Pos){.len = 0,.line_nr = -1,.pos = 0,.col = 0,.last_line = 0,}); @@ -51879,7 +51945,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmts_ending_with_expression(v__checker } } v__checker__Checker_stmt(c, stmt); - if ((stmt)._typ == 350 /* v.ast.GotoLabel */) { + if ((stmt)._typ == 351 /* v.ast.GotoLabel */) { unreachable = ((v__token__Pos){.len = 0,.line_nr = -1,.pos = 0,.col = 0,.last_line = 0,}); c->scope_returns = false; } @@ -51914,7 +51980,7 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_expr_defer_0 = true; v__ast__Expr node = node_; if (c->expr_level > _const_v__checker__expr_level_cutoff_limit) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker: too many expr levels: "), 0xfe07, {.d_i32 = c->expr_level}}, {_SLIT(" "), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker: too many expr levels: "), /*100 &int*/0xfe07, {.d_i32 = c->expr_level}}, {_SLIT(" "), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node)); v__ast__Type _t1 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -51923,15 +51989,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t1; } - if (node._typ == 316 /* v.ast.NodeError */) { + if (node._typ == 317 /* v.ast.NodeError */) { } - else if (node._typ == 298 /* v.ast.ComptimeType */) { + else if (node._typ == 299 /* v.ast.ComptimeType */) { v__checker__Checker_error(c, _SLIT("incorrect use of compile-time type"), (*node._v__ast__ComptimeType).pos); } - else if (node._typ == 301 /* v.ast.EmptyExpr */) { + else if (node._typ == 302 /* v.ast.EmptyExpr */) { 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 == 290 /* v.ast.CTempVar */) { + else if (node._typ == 291 /* v.ast.CTempVar */) { v__ast__Type _t2 = (*node._v__ast__CTempVar).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -51940,7 +52006,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t2; } - else if (node._typ == 283 /* v.ast.AnonFn */) { + else if (node._typ == 284 /* v.ast.AnonFn */) { v__ast__Type _t3 = v__checker__Checker_anon_fn(c, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -51949,7 +52015,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t3; } - else if (node._typ == 284 /* v.ast.ArrayDecompose */) { + else if (node._typ == 285 /* 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) { @@ -51962,7 +52028,7 @@ bool v__checker__Checker_expr_defer_0 = false; // 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, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((type_sym->info)._v__ast__Array,(type_sym->info)._typ, 451) /*expected idx: 451, 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; @@ -51974,7 +52040,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t5; } - else if (node._typ == 285 /* v.ast.ArrayInit */) { + else if (node._typ == 286 /* v.ast.ArrayInit */) { v__ast__Type _t6 = v__checker__Checker_array_init(c, (voidptr)&/*qq*/(*node._v__ast__ArrayInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -51983,7 +52049,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t6; } - else if (node._typ == 286 /* v.ast.AsCast */) { + else if (node._typ == 287 /* 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); @@ -51996,7 +52062,7 @@ bool v__checker__Checker_expr_defer_0 = false; ; if (!v__ast__Table_sumtype_has_variant(c->table, (*node._v__ast__AsCast).expr_type, (*node._v__ast__AsCast).typ, true)) { string addr = string_repeat(_SLIT("&"), v__ast__Type_nr_muls((*node._v__ast__AsCast).typ)); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = addr}}, {_SLIT0, 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__AsCast).pos); + 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); @@ -52006,9 +52072,9 @@ bool v__checker__Checker_expr_defer_0 = false; ; } else if (!v__ast__Type_alias_eq((*node._v__ast__AsCast).expr_type, (*node._v__ast__AsCast).typ)) { - string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast non-sum type `"), 0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` using `as`"), 0, { .d_c = 0 }}})); + string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast non-sum type `"), /*115 &string*/0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` using `as`"), 0, { .d_c = 0 }}})); if (type_sym->kind == v__ast__Kind__sum_type) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" - use e.g. `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("(some_expr)` instead."), 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" - use e.g. `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("(some_expr)` instead."), 0, { .d_c = 0 }}}))); } v__checker__Checker_error(c, s, (*node._v__ast__AsCast).pos); } @@ -52020,7 +52086,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t9; } - else if (node._typ == 287 /* v.ast.Assoc */) { + else if (node._typ == 288 /* 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; @@ -52042,7 +52108,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t11; } - else if (node._typ == 289 /* v.ast.BoolLiteral */) { + else if (node._typ == 290 /* v.ast.BoolLiteral */) { v__ast__Type _t12 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52051,7 +52117,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t12; } - else if (node._typ == 292 /* v.ast.CastExpr */) { + else if (node._typ == 293 /* v.ast.CastExpr */) { v__ast__Type _t13 = v__checker__Checker_cast_expr(c, (voidptr)&/*qq*/(*node._v__ast__CastExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52060,17 +52126,22 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t13; } - else if (node._typ == 291 /* v.ast.CallExpr */) { + else if (node._typ == 292 /* 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)) { + if (!v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional) && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__result)) { if ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__block) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `or` block, the function `"), 0xfe10, {.d_s = (*node._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*node._v__ast__CallExpr).or_block.pos); - } else if ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `?`, the function `"), 0xfe10, {.d_s = (*node._v__ast__CallExpr).name}}, {_SLIT("` does not return an optional"), 0, { .d_c = 0 }}})), (*node._v__ast__CallExpr).or_block.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `or` block, the function `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__CallExpr).name}}, {_SLIT("` does neither return an optional nor a result"), 0, { .d_c = 0 }}})), (*node._v__ast__CallExpr).or_block.pos); + } else if ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `?`, the function `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__CallExpr).name}}, {_SLIT("` does neither return an optional nor a result"), 0, { .d_c = 0 }}})), (*node._v__ast__CallExpr).or_block.pos); } } - if (v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional) && (*node._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent) { - ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional); + if ((*node._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent) { + if (v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional)) { + ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__optional); + } + if (v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__result)) { + ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__result); + } } v__ast__Type _t14 = ret_type; // Defer begin @@ -52080,7 +52151,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t14; } - else if (node._typ == 293 /* v.ast.ChanInit */) { + else if (node._typ == 294 /* v.ast.ChanInit */) { v__ast__Type _t15 = v__checker__Checker_chan_init(c, (voidptr)&/*qq*/(*node._v__ast__ChanInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52089,7 +52160,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t15; } - else if (node._typ == 294 /* v.ast.CharLiteral */) { + else if (node._typ == 295 /* v.ast.CharLiteral */) { v__ast__Type _t16 = _const_v__ast__rune_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52098,7 +52169,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t16; } - else if (node._typ == 295 /* v.ast.Comment */) { + else if (node._typ == 296 /* v.ast.Comment */) { v__ast__Type _t17 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52107,7 +52178,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t17; } - else if (node._typ == 288 /* v.ast.AtExpr */) { + else if (node._typ == 289 /* v.ast.AtExpr */) { v__ast__Type _t18 = v__checker__Checker_at_expr(c, (voidptr)&/*qq*/(*node._v__ast__AtExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52116,7 +52187,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t18; } - else if (node._typ == 296 /* v.ast.ComptimeCall */) { + else if (node._typ == 297 /* v.ast.ComptimeCall */) { v__ast__Type _t19 = v__checker__Checker_comptime_call(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52125,14 +52196,14 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t19; } - else if (node._typ == 297 /* v.ast.ComptimeSelector */) { + else if (node._typ == 298 /* v.ast.ComptimeSelector */) { (*node._v__ast__ComptimeSelector).left_type = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, (*node._v__ast__ComptimeSelector).left)); v__ast__Type expr_type = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, (*node._v__ast__ComptimeSelector).field_expr)); v__ast__TypeSymbol* expr_sym = v__ast__Table_sym(c->table, expr_type); if (!v__ast__Type_alias_eq(expr_type, _const_v__ast__string_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `string` instead of `"), 0xfe10, {.d_s = expr_sym->name}}, {_SLIT("` (e.g. `field.name`)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*node._v__ast__ComptimeSelector).field_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `string` instead of `"), /*115 &string*/0xfe10, {.d_s = expr_sym->name}}, {_SLIT("` (e.g. `field.name`)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*node._v__ast__ComptimeSelector).field_expr)); } - if (((*node._v__ast__ComptimeSelector).field_expr)._typ == 325 /* v.ast.SelectorExpr */) { + if (((*node._v__ast__ComptimeSelector).field_expr)._typ == 326 /* v.ast.SelectorExpr */) { v__token__Pos left_pos = v__ast__Expr_pos((*(*node._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr); if (c->comptime_fields_type.len == 0) { v__checker__Checker_error(c, _SLIT("compile time field access can only be used when iterating over `T.fields`"), left_pos); @@ -52147,7 +52218,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t20; } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown `$for` variable `"), 0xfe10, {.d_s = expr_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown `$for` variable `"), /*115 &string*/0xfe10, {.d_s = expr_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), left_pos); } else { v__checker__Checker_error(c, _SLIT("expected selector expression e.g. `$(field.name)`"), v__ast__Expr_pos((*node._v__ast__ComptimeSelector).field_expr)); } @@ -52159,7 +52230,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t21; } - else if (node._typ == 299 /* v.ast.ConcatExpr */) { + else if (node._typ == 300 /* 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) { @@ -52168,7 +52239,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t22; } - else if (node._typ == 300 /* v.ast.DumpExpr */) { + else if (node._typ == 301 /* v.ast.DumpExpr */) { (*node._v__ast__DumpExpr).expr_type = v__checker__Checker_expr(c, (*node._v__ast__DumpExpr).expr); int etidx = v__ast__Type_idx((*node._v__ast__DumpExpr).expr_type); if (etidx == _const_v__ast__void_type_idx) { @@ -52201,7 +52272,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t25; } - else if (node._typ == 302 /* v.ast.EnumVal */) { + else if (node._typ == 303 /* 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) { @@ -52210,7 +52281,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t26; } - else if (node._typ == 303 /* v.ast.FloatLiteral */) { + else if (node._typ == 304 /* v.ast.FloatLiteral */) { v__ast__Type _t27 = _const_v__ast__float_literal_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52219,7 +52290,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t27; } - else if (node._typ == 304 /* v.ast.GoExpr */) { + else if (node._typ == 305 /* 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) { @@ -52228,7 +52299,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t28; } - else if (node._typ == 305 /* v.ast.Ident */) { + else if (node._typ == 306 /* v.ast.Ident */) { v__ast__Type res = v__checker__Checker_ident(c, (voidptr)&/*qq*/(*node._v__ast__Ident)); v__ast__Type _t29 = res; // Defer begin @@ -52238,7 +52309,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t29; } - else if (node._typ == 306 /* v.ast.IfExpr */) { + else if (node._typ == 307 /* 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) { @@ -52247,19 +52318,19 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t30; } - else if (node._typ == 307 /* v.ast.IfGuardExpr */) { + else if (node._typ == 308 /* v.ast.IfGuardExpr */) { bool old_inside_if_guard = c->inside_if_guard; c->inside_if_guard = true; (*node._v__ast__IfGuardExpr).expr_type = v__checker__Checker_expr(c, (*node._v__ast__IfGuardExpr).expr); c->inside_if_guard = old_inside_if_guard; if (!v__ast__Type_has_flag((*node._v__ast__IfGuardExpr).expr_type, v__ast__TypeFlag__optional)) { bool no_opt = true; - if ((*node._v__ast__IfGuardExpr).expr._typ == 308 /* v.ast.IndexExpr */) { + if ((*node._v__ast__IfGuardExpr).expr._typ == 309 /* v.ast.IndexExpr */) { no_opt = false; (*node._v__ast__IfGuardExpr).expr_type = v__ast__Type_set_flag((*node._v__ast__IfGuardExpr).expr_type, v__ast__TypeFlag__optional); (*(*node._v__ast__IfGuardExpr).expr._v__ast__IndexExpr).is_option = true; } - else if ((*node._v__ast__IfGuardExpr).expr._typ == 322 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__IfGuardExpr).expr._typ == 323 /* v.ast.PrefixExpr */) { if ((*(*node._v__ast__IfGuardExpr).expr._v__ast__PrefixExpr).op == v__token__Kind__arrow) { no_opt = false; (*node._v__ast__IfGuardExpr).expr_type = v__ast__Type_set_flag((*node._v__ast__IfGuardExpr).expr_type, v__ast__TypeFlag__optional); @@ -52282,7 +52353,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t31; } - else if (node._typ == 308 /* v.ast.IndexExpr */) { + else if (node._typ == 309 /* 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) { @@ -52291,7 +52362,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t32; } - else if (node._typ == 309 /* v.ast.InfixExpr */) { + else if (node._typ == 310 /* 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) { @@ -52300,7 +52371,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t33; } - else if (node._typ == 310 /* v.ast.IntegerLiteral */) { + else if (node._typ == 311 /* 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) { @@ -52309,7 +52380,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t34; } - else if (node._typ == 313 /* v.ast.LockExpr */) { + else if (node._typ == 314 /* 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) { @@ -52318,7 +52389,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t35; } - else if (node._typ == 314 /* v.ast.MapInit */) { + else if (node._typ == 315 /* 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) { @@ -52327,7 +52398,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t36; } - else if (node._typ == 315 /* v.ast.MatchExpr */) { + else if (node._typ == 316 /* 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) { @@ -52336,7 +52407,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t37; } - else if (node._typ == 321 /* v.ast.PostfixExpr */) { + else if (node._typ == 322 /* 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) { @@ -52345,7 +52416,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t38; } - else if (node._typ == 322 /* v.ast.PrefixExpr */) { + else if (node._typ == 323 /* 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) { @@ -52354,7 +52425,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t39; } - else if (node._typ == 317 /* v.ast.None */) { + else if (node._typ == 318 /* v.ast.None */) { v__ast__Type _t40 = _const_v__ast__none_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52363,7 +52434,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t40; } - else if (node._typ == 319 /* v.ast.OrExpr */) { + else if (node._typ == 320 /* v.ast.OrExpr */) { v__ast__Type _t41 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52372,8 +52443,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t41; } - else if (node._typ == 320 /* v.ast.ParExpr */) { - if (((*node._v__ast__ParExpr).expr)._typ == 320 /* v.ast.ParExpr */) { + else if (node._typ == 321 /* v.ast.ParExpr */) { + if (((*node._v__ast__ParExpr).expr)._typ == 321 /* 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); @@ -52384,7 +52455,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t42; } - else if (node._typ == 323 /* v.ast.RangeExpr */) { + else if (node._typ == 324 /* v.ast.RangeExpr */) { v__ast__Type _t43 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52393,7 +52464,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t43; } - else if (node._typ == 324 /* v.ast.SelectExpr */) { + else if (node._typ == 325 /* 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) { @@ -52402,7 +52473,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t44; } - else if (node._typ == 325 /* v.ast.SelectorExpr */) { + else if (node._typ == 326 /* 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) { @@ -52411,7 +52482,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t45; } - else if (node._typ == 326 /* v.ast.SizeOf */) { + else if (node._typ == 327 /* 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); } @@ -52423,7 +52494,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t46; } - else if (node._typ == 311 /* v.ast.IsRefType */) { + else if (node._typ == 312 /* 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); } @@ -52435,7 +52506,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t47; } - else if (node._typ == 318 /* v.ast.OffsetOf */) { + else if (node._typ == 319 /* 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) { @@ -52444,7 +52515,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t48; } - else if (node._typ == 327 /* v.ast.SqlExpr */) { + else if (node._typ == 328 /* 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) { @@ -52453,7 +52524,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t49; } - else if (node._typ == 329 /* v.ast.StringLiteral */) { + else if (node._typ == 330 /* 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 @@ -52471,7 +52542,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t51; } - else if (node._typ == 328 /* v.ast.StringInterLiteral */) { + else if (node._typ == 329 /* 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) { @@ -52480,7 +52551,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t52; } - else if (node._typ == 330 /* v.ast.StructInit */) { + else if (node._typ == 331 /* 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 @@ -52498,7 +52569,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t54; } - else if (node._typ == 331 /* v.ast.TypeNode */) { + else if (node._typ == 332 /* v.ast.TypeNode */) { v__ast__Type _t55 = (*node._v__ast__TypeNode).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52507,7 +52578,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t55; } - else if (node._typ == 332 /* v.ast.TypeOf */) { + else if (node._typ == 333 /* 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 @@ -52517,7 +52588,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t56; } - else if (node._typ == 333 /* v.ast.UnsafeExpr */) { + else if (node._typ == 334 /* 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) { @@ -52526,12 +52597,12 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t57; } - else if (node._typ == 312 /* v.ast.Likely */) { + else if (node._typ == 313 /* 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)) { v__ast__TypeSymbol* ltype_sym = v__ast__Table_sym(c->table, ltype); string lname = ((*node._v__ast__Likely).is_likely ? (_SLIT("_likely_")) : (_SLIT("_unlikely_"))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = lname}}, {_SLIT("()` expects a boolean expression, instead it got `"), 0xfe10, {.d_s = ltype_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__Likely).pos); + 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 _t58 = _const_v__ast__bool_type; // Defer begin @@ -52586,32 +52657,32 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE if (!v__ast__Table_sumtype_has_variant(c->table, to_type, from_type, false) && !v__ast__Type_has_flag(to_type, v__ast__TypeFlag__optional)) { string ft = v__ast__Table_type_to_str(c->table, from_type); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to `"), 0xfe10, {.d_s = tt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } - } else if ((to_sym->info)._typ == 470 /* v.ast.Alias */ && !(final_to_sym->kind == v__ast__Kind__struct_ && v__ast__Type_is_ptr(to_type))) { + } else if ((to_sym->info)._typ == 471 /* v.ast.Alias */ && !(final_to_sym->kind == v__ast__Kind__struct_ && v__ast__Type_is_ptr(to_type))) { if (!v__checker__Checker_check_types(c, from_type, (*to_sym->info._v__ast__Alias).parent_type) && !(v__ast__TypeSymbol_is_int(final_to_sym) && (final_from_sym->kind == v__ast__Kind__enum_ || final_from_sym->kind == v__ast__Kind__bool || final_from_sym->kind == v__ast__Kind__i8 || final_from_sym->kind == v__ast__Kind__char))) { string ft = v__ast__Table_type_to_str(c->table, from_type); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to `"), 0xfe10, {.d_s = tt}}, {_SLIT("` (alias to `"), 0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("` (alias to `"), /*115 &string*/0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); } - } else if (to_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(to_type) && !(/* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).is_typedef) { + } else if (to_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(to_type) && !(/* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).is_typedef) { if (from_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(from_type)) { v__checker__Checker_warn(c, _SLIT("casting to struct is deprecated, use e.g. `Struct{...expr}` instead"), node->pos); - v__ast__Struct from_type_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; - v__ast__Struct to_type_info = /* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct from_type_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct to_type_info = /* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (!v__checker__Checker_check_struct_signature(c, from_type_info, to_type_info)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot convert struct `"), 0xfe10, {.d_s = from_sym->name}}, {_SLIT("` to struct `"), 0xfe10, {.d_s = to_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot convert struct `"), /*115 &string*/0xfe10, {.d_s = from_sym->name}}, {_SLIT("` to struct `"), /*115 &string*/0xfe10, {.d_s = to_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else { string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to struct"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to struct"), 0, { .d_c = 0 }}})), node->pos); } } else if (to_sym->kind == v__ast__Kind__interface_) { if (v__checker__Checker_type_implements(c, from_type, to_type, node->pos)) { if (!v__ast__Type_is_ptr(from_type) && !v__ast__Type_is_pointer(from_type) && from_sym->kind != v__ast__Kind__interface_ && !c->inside_unsafe) { v__checker__Checker_mark_as_referenced(c, &node->expr, true); } - if ((/* as */ *(v__ast__Interface*)__as_cast((to_sym->info)._v__ast__Interface,(to_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ).is_generic) { + if ((/* as */ *(v__ast__Interface*)__as_cast((to_sym->info)._v__ast__Interface,(to_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ).is_generic) { v__ast__Type inferred_type = v__checker__Checker_resolve_generic_interface(c, from_type, to_type, node->pos); if (inferred_type != 0) { to_type = inferred_type; @@ -52624,73 +52695,73 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE v__checker__Checker_error(c, _SLIT("cannot cast to bool - use e.g. `some_int != 0` instead"), node->pos); } else if (v__ast__Type_alias_eq(from_type, _const_v__ast__none_type) && !v__ast__Type_has_flag(to_type, v__ast__TypeFlag__optional)) { string type_name = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast `none` to `"), 0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast `none` to `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else if (from_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(from_type)) { if ((v__ast__Type_is_ptr(to_type) || !(to_sym->kind == v__ast__Kind__sum_type || to_sym->kind == v__ast__Kind__interface_)) && !c->is_builtin_mod) { string from_type_name = v__ast__Table_type_to_str(c->table, from_type); string type_name = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast struct `"), 0xfe10, {.d_s = from_type_name}}, {_SLIT("` to `"), 0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast struct `"), /*115 &string*/0xfe10, {.d_s = from_type_name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else if (to_sym->kind == v__ast__Kind__u8 && !v__ast__TypeSymbol_is_number(final_from_sym) && !v__ast__TypeSymbol_is_pointer(final_from_sym) && !v__ast__Type_is_ptr(from_type) && !(final_from_sym->kind == v__ast__Kind__char || final_from_sym->kind == v__ast__Kind__enum_ || final_from_sym->kind == v__ast__Kind__bool)) { string ft = v__ast__Table_type_to_str(c->table, from_type); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to `"), 0xfe10, {.d_s = tt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_has_flag(from_type, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(from_type, v__ast__TypeFlag__variadic)) { string msg = (v__ast__Type_has_flag(from_type, v__ast__TypeFlag__optional) ? (_SLIT("an optional")) : (_SLIT("a variadic"))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot type cast "), 0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot type cast "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (!c->inside_unsafe && v__ast__Type_is_ptr(to_type) && v__ast__Type_is_ptr(from_type) && !v__ast__Type_alias_eq(v__ast__Type_deref(to_type), _const_v__ast__char_type) && !v__ast__Type_alias_eq(v__ast__Type_deref(from_type), _const_v__ast__char_type)) { string ft = v__ast__Table_type_to_str(c->table, from_type); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("casting `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to `"), 0xfe10, {.d_s = tt}}, {_SLIT("` is only allowed in `unsafe` code"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("casting `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("` is only allowed in `unsafe` code"), 0, { .d_c = 0 }}})), node->pos); } else if (from_sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(from_type)) { v__checker__Checker_warn(c, _SLIT("cannot cast a fixed array (use e.g. `&arr[0]` instead)"), node->pos); } else if (final_from_sym->kind == v__ast__Kind__string && v__ast__TypeSymbol_is_number(final_to_sym) && final_to_sym->kind != v__ast__Kind__rune) { string snexpr = v__ast__Expr_str(node->expr); string tt = v__ast__Table_type_to_str(c->table, to_type); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast string to `"), 0xfe10, {.d_s = tt}}, {_SLIT("`, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT("."), 0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast string to `"), /*115 &string*/0xfe10, {.d_s = tt}}, {_SLIT("`, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("()` instead."), 0, { .d_c = 0 }}})), node->pos); } if (to_sym->kind == v__ast__Kind__rune && v__ast__TypeSymbol_is_string(from_sym)) { string snexpr = v__ast__Expr_str(node->expr); string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to rune, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".runes()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to rune, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".runes()` instead."), 0, { .d_c = 0 }}})), node->pos); } if (v__ast__Type_alias_eq(to_type, _const_v__ast__string_type)) { if (v__ast__Type_alias_eq(from_type, _const_v__ast__byte_type) || v__ast__Type_alias_eq(from_type, _const_v__ast__bool_type)) { string snexpr = v__ast__Expr_str(node->expr); string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_is_real_pointer(from_type)) { string snexpr = v__ast__Expr_str(node->expr); string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast pointer type `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `&u8("), 0xfe10, {.d_s = snexpr}}, {_SLIT(").vstring()` or `cstring_to_vstring("), 0xfe10, {.d_s = snexpr}}, {_SLIT(")` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast pointer type `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `&u8("), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(").vstring()` or `cstring_to_vstring("), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(")` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_is_number(from_type)) { string snexpr = v__ast__Expr_str(node->expr); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast number to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast number to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (from_sym->kind == v__ast__Kind__alias && !string__eq(final_from_sym->name, _SLIT("string"))) { string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `x.str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast type `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `x.str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (final_from_sym->kind == v__ast__Kind__array) { string snexpr = v__ast__Expr_str(node->expr); if (string__eq(final_from_sym->name, _SLIT("[]u8"))) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast []u8 to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".bytestr()` or `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast []u8 to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".bytestr()` or `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else { string first_elem_idx = _SLIT("[0]"); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast array to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT0, 0xfe10, {.d_s = first_elem_idx}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast array to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = first_elem_idx}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } } else if (final_from_sym->kind == v__ast__Kind__enum_) { string snexpr = v__ast__Expr_str(node->expr); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast enum to string, use "), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str() instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast enum to string, use "), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str() instead."), 0, { .d_c = 0 }}})), node->pos); } else if (final_from_sym->kind == v__ast__Kind__map) { v__checker__Checker_error(c, _SLIT("cannot cast map to string."), node->pos); } else if (final_from_sym->kind == v__ast__Kind__sum_type) { string snexpr = v__ast__Expr_str(node->expr); string ft = v__ast__Table_type_to_str(c->table, from_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast sumtype `"), 0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `"), 0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot cast sumtype `"), /*115 &string*/0xfe10, {.d_s = ft}}, {_SLIT("` to string, use `"), /*115 &string*/0xfe10, {.d_s = snexpr}}, {_SLIT(".str()` instead."), 0, { .d_c = 0 }}})), node->pos); } else if (!v__ast__Type_alias_eq(to_type, _const_v__ast__string_type) && v__ast__Type_alias_eq(from_type, _const_v__ast__string_type) && (!(to_sym->kind == v__ast__Kind__alias && string__eq(final_to_sym->name, _SLIT("string"))))) { - string error_msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast a string to a type `"), 0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("`, that is not an alias of string"), 0, { .d_c = 0 }}})); - if ((node->expr)._typ == 329 /* v.ast.StringLiteral */) { + string error_msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot cast a string to a type `"), /*115 &string*/0xfe10, {.d_s = final_to_sym->name}}, {_SLIT("`, that is not an alias of string"), 0, { .d_c = 0 }}})); + if ((node->expr)._typ == 330 /* v.ast.StringLiteral */) { if ((*node->expr._v__ast__StringLiteral).val.len == 1) { - error_msg = /*f*/string__plus(error_msg, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", for denoting characters use `"), 0xfe10, {.d_s = (*node->expr._v__ast__StringLiteral).val}}, {_SLIT("` instead of '"), 0xfe10, {.d_s = (*node->expr._v__ast__StringLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + error_msg = /*f*/string__plus(error_msg, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", for denoting characters use `"), /*115 &string*/0xfe10, {.d_s = (*node->expr._v__ast__StringLiteral).val}}, {_SLIT("` instead of '"), /*115 &string*/0xfe10, {.d_s = (*node->expr._v__ast__StringLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); } } v__checker__Checker_error(c, error_msg, node->pos); @@ -52700,7 +52771,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE v__checker__Checker_expr(c, node->arg); } if (to_sym->kind == v__ast__Kind__enum_) { - if ((node->expr)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((node->expr)._typ == 311 /* v.ast.IntegerLiteral */) { string enum_typ_name = v__ast__Table_get_type_name(c->table, to_type); int node_val = string_int((*node->expr._v__ast__IntegerLiteral).val); v__ast__EnumDecl* _t4 = (v__ast__EnumDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, c->table->enum_decls), &(string[]){to_sym->name})); @@ -52721,7 +52792,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE int enum_val = 0; for (int _t5 = 0; _t5 < enum_decl.fields.len; ++_t5) { v__ast__EnumField enum_field = ((v__ast__EnumField*)enum_decl.fields.data)[_t5]; - if ((enum_field.expr)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((enum_field.expr)._typ == 311 /* v.ast.IntegerLiteral */) { enum_val = string_int((*enum_field.expr._v__ast__IntegerLiteral).val); } if (node_val == enum_val) { @@ -52732,7 +52803,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE } } if (!in_range) { - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = node_val}}, {_SLIT(" does not represent a value of enum "), 0xfe10, {.d_s = enum_typ_name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = node_val}}, {_SLIT(" does not represent a value of enum "), /*115 &string*/0xfe10, {.d_s = enum_typ_name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } } } @@ -52837,7 +52908,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_at_expr(v__checker__Checker* c, } case v__token__AtKind__unknown: { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown @ identifier: "), 0xfe10, {.d_s = node->name}}, {_SLIT(". Available identifiers: "), 0xfe10, {.d_s = Array_string_str(_const_v__token__valid_at_tokens)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown @ identifier: "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT(". Available identifiers: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(_const_v__token__valid_at_tokens)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); break; } } @@ -52850,10 +52921,10 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no if (c->const_deps.len > 0) { string name = node->name; if (!string_contains(name, _SLIT(".")) && !string__eq(node->mod, _SLIT("builtin"))) { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->mod}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); } if (string__eq(name, c->const_decl)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cycle in constant `"), 0xfe10, {.d_s = c->const_decl}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cycle in constant `"), /*115 &string*/0xfe10, {.d_s = c->const_decl}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t1 = _const_v__ast__void_type; return _t1; } @@ -52867,11 +52938,11 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no return _t3; } if (node->kind == v__ast__IdentKind__constant || node->kind == v__ast__IdentKind__global || node->kind == v__ast__IdentKind__variable) { - v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast((node->info)._v__ast__IdentVar,(node->info)._typ, 415) /*expected idx: 415, name: v.ast.IdentVar */ ; + v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast((node->info)._v__ast__IdentVar,(node->info)._typ, 416) /*expected idx: 416, name: v.ast.IdentVar */ ; v__ast__Type _t4 = info.typ; return _t4; } else if (node->kind == v__ast__IdentKind__function) { - v__ast__IdentFn info = /* as */ *(v__ast__IdentFn*)__as_cast((node->info)._v__ast__IdentFn,(node->info)._typ, 414) /*expected idx: 414, name: v.ast.IdentFn */ ; + v__ast__IdentFn info = /* as */ *(v__ast__IdentFn*)__as_cast((node->info)._v__ast__IdentFn,(node->info)._typ, 415) /*expected idx: 415, name: v.ast.IdentFn */ ; v__ast__Type _t5 = info.typ; return _t5; } else if (node->kind == v__ast__IdentKind__unresolved) { @@ -52881,17 +52952,17 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no Option_v__ast__ScopeObject _t6; if (_t6 = v__ast__Scope_find(node->scope, node->name), _t6.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t6.data; - if (obj._typ == 362 /* v.ast.GlobalField */) { + if (obj._typ == 363 /* v.ast.GlobalField */) { node->kind = v__ast__IdentKind__global; node->info = v__ast__IdentVar_to_sumtype_v__ast__IdentInfo(ADDR(v__ast__IdentVar, (((v__ast__IdentVar){.typ = (*obj._v__ast__GlobalField).typ,.is_mut = 0,.is_static = 0,.is_volatile = 0,.is_optional = 0,.share = 0,})))); node->obj = obj; v__ast__Type _t7 = (*obj._v__ast__GlobalField).typ; return _t7; } - else if (obj._typ == 363 /* v.ast.Var */) { + else if (obj._typ == 364 /* v.ast.Var */) { int node_pos = (c->pref->is_vweb && !_IN_MAP(ADDR(string, node->name), ADDR(map, node->scope->objects)) && node->scope->start_pos < c->comptime_call_pos ? (c->comptime_call_pos) : (node->pos.pos)); if (node_pos < (*obj._v__ast__Var).pos.pos) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` (used before declaration)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` (used before declaration)"), 0, { .d_c = 0 }}})), node->pos); } bool is_sum_type_cast = (*obj._v__ast__Var).smartcasts.len != 0 && !c->prevent_sum_type_unwrapping_once; c->prevent_sum_type_unwrapping_once = false; @@ -52903,17 +52974,17 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no } v__ast__Type typ = _t8; if (typ == 0) { - if (((*obj._v__ast__Var).expr)._typ == 305 /* v.ast.Ident */) { + if (((*obj._v__ast__Var).expr)._typ == 306 /* v.ast.Ident */) { if ((*(*obj._v__ast__Var).expr._v__ast__Ident).kind == v__ast__IdentKind__unresolved) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unresolved variable: `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unresolved variable: `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t9 = _const_v__ast__void_type; return _t9; } } - if (((*obj._v__ast__Var).expr)._typ == 307 /* v.ast.IfGuardExpr */) { + if (((*obj._v__ast__Var).expr)._typ == 308 /* v.ast.IfGuardExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*(*obj._v__ast__Var).expr._v__ast__IfGuardExpr).expr_type); if (sym->kind == v__ast__Kind__multi_return) { - v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 481) /*expected idx: 481, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; if (mr_info.types.len == (*(*obj._v__ast__Var).expr._v__ast__IfGuardExpr).vars.len) { for (int vi = 0; vi < (*(*obj._v__ast__Var).expr._v__ast__IfGuardExpr).vars.len; ++vi) { v__ast__IfGuardVar var = ((v__ast__IfGuardVar*)(*(*obj._v__ast__Var).expr._v__ast__IfGuardExpr).vars.data)[vi]; @@ -52952,14 +53023,14 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no if (_IN_MAP(ADDR(string, name), ADDR(map, c->file->imported_symbols))) { name = (*(string*)map_get(ADDR(map, c->file->imported_symbols), &(string[]){name}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); } else if (!string_contains(name, _SLIT(".")) && !string__eq(node->mod, _SLIT("builtin"))) { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->mod}}, {_SLIT("."), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}})); } Option_v__ast__ScopeObject _t12; if (_t12 = v__ast__Scope_find(c->file->global_scope, name), _t12.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t12.data; - if (obj._typ == 361 /* v.ast.ConstField */) { + if (obj._typ == 362 /* v.ast.ConstField */) { if (!((*obj._v__ast__ConstField).is_pub || string__eq((*obj._v__ast__ConstField).mod, c->mod) || c->pref->is_test)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("constant `"), 0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("constant `"), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } v__ast__Type typ = (*obj._v__ast__ConstField).typ; if (typ == 0) { @@ -52969,7 +53040,7 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no typ = v__checker__Checker_expr(c, (*obj._v__ast__ConstField).expr); c->inside_const = false; c->mod = old_c_mod; - if (((*obj._v__ast__ConstField).expr)._typ == 291 /* v.ast.CallExpr */) { + if (((*obj._v__ast__ConstField).expr)._typ == 292 /* v.ast.CallExpr */) { if ((*(*obj._v__ast__ConstField).expr._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent) { typ = v__ast__Type_clear_flag(typ, v__ast__TypeFlag__optional); } @@ -53026,14 +53097,14 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no node->mod = saved_mod; } if (node->tok_kind == v__token__Kind__assign) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` (use `:=` to declare a variable)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` (use `:=` to declare a variable)"), 0, { .d_c = 0 }}})), node->pos); } else if (string__eq(node->name, _SLIT("errcode"))) { v__checker__Checker_error(c, _SLIT("undefined ident: `errcode`; did you mean `err.code`?"), node->pos); } else { if (c->inside_ct_attr) { - v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`[if "), 0xfe10, {.d_s = node->name}}, {_SLIT("]` is deprecated. Use `[if "), 0xfe10, {.d_s = node->name}}, {_SLIT("?]` instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`[if "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("]` is deprecated. Use `[if "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("?]` instead"), 0, { .d_c = 0 }}})), node->pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (v__ast__Table_known_type(c->table, node->name)) { @@ -53069,7 +53140,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast(v__checker__Checker* c, v__as v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, cur_type); v__ast__Type to_type = (sym->kind == v__ast__Kind__interface_ ? (v__ast__Type_ref(to_type_)) : (to_type_)); v__ast__Expr expr = expr_; - if (expr._typ == 325 /* v.ast.SelectorExpr */) { + if (expr._typ == 326 /* v.ast.SelectorExpr */) { bool is_mut = false; Array_v__ast__Type smartcasts = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); v__ast__TypeSymbol* expr_sym = v__ast__Table_sym(c->table, (*expr._v__ast__SelectorExpr).expr_type); @@ -53111,12 +53182,12 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast(v__checker__Checker* c, v__as c->smartcast_mut_pos = (*expr._v__ast__SelectorExpr).pos; } } - else if (expr._typ == 305 /* v.ast.Ident */) { + else if (expr._typ == 306 /* v.ast.Ident */) { bool is_mut = false; Array_v__ast__Type smartcasts = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); bool is_already_casted = false; int orig_type = 0; - if (((*expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { is_mut = (*(*expr._v__ast__Ident).obj._v__ast__Var).is_mut; _PUSH_MANY(&smartcasts, ((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts), _t7, Array_v__ast__Type); is_already_casted = (*(*expr._v__ast__Ident).obj._v__ast__Var).pos.pos == (*expr._v__ast__Ident).pos.pos; @@ -53163,15 +53234,15 @@ v__ast__Type v__checker__Checker_select_expr(v__checker__Checker* c, v__ast__Sel for (int _t1 = 0; _t1 < node->branches.len; ++_t1) { v__ast__SelectBranch branch = ((v__ast__SelectBranch*)node->branches.data)[_t1]; v__checker__Checker_stmt(c, branch.stmt); - if (branch.stmt._typ == 345 /* v.ast.ExprStmt */) { + if (branch.stmt._typ == 346 /* v.ast.ExprStmt */) { if (branch.is_timeout) { if (!v__ast__Type_is_int((*branch.stmt._v__ast__ExprStmt).typ)) { v__ast__TypeSymbol* tsym = v__ast__Table_sym(c->table, (*branch.stmt._v__ast__ExprStmt).typ); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), 0xfe10, {.d_s = tsym->name}}, {_SLIT("` for timeout - expected integer number of nanoseconds aka `time.Duration`"), 0, { .d_c = 0 }}})), (*branch.stmt._v__ast__ExprStmt).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), /*115 &string*/0xfe10, {.d_s = tsym->name}}, {_SLIT("` for timeout - expected integer number of nanoseconds aka `time.Duration`"), 0, { .d_c = 0 }}})), (*branch.stmt._v__ast__ExprStmt).pos); } } else { - if (((*branch.stmt._v__ast__ExprStmt).expr)._typ == 309 /* v.ast.InfixExpr */) { - if (((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 305 /* v.ast.Ident */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 325 /* v.ast.SelectorExpr */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 308 /* v.ast.IndexExpr */) { + if (((*branch.stmt._v__ast__ExprStmt).expr)._typ == 310 /* v.ast.InfixExpr */) { + if (((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 306 /* v.ast.Ident */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 326 /* v.ast.SelectorExpr */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 309 /* v.ast.IndexExpr */) { v__checker__Checker_error(c, _SLIT("channel in `select` key must be predefined"), v__ast__Expr_pos((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)); } } else { @@ -53179,15 +53250,15 @@ v__ast__Type v__checker__Checker_select_expr(v__checker__Checker* c, v__ast__Sel } } } - else if (branch.stmt._typ == 337 /* v.ast.AssignStmt */) { + else if (branch.stmt._typ == 338 /* v.ast.AssignStmt */) { v__ast__Expr expr = (*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)); - if (expr._typ == 322 /* v.ast.PrefixExpr */) { - if (((*expr._v__ast__PrefixExpr).right)._typ != 305 /* v.ast.Ident */ && ((*expr._v__ast__PrefixExpr).right)._typ != 325 /* v.ast.SelectorExpr */ && ((*expr._v__ast__PrefixExpr).right)._typ != 308 /* v.ast.IndexExpr */) { + if (expr._typ == 323 /* v.ast.PrefixExpr */) { + if (((*expr._v__ast__PrefixExpr).right)._typ != 306 /* v.ast.Ident */ && ((*expr._v__ast__PrefixExpr).right)._typ != 326 /* v.ast.SelectorExpr */ && ((*expr._v__ast__PrefixExpr).right)._typ != 309 /* v.ast.IndexExpr */) { v__checker__Checker_error(c, _SLIT("channel in `select` key must be predefined"), v__ast__Expr_pos((*expr._v__ast__PrefixExpr).right)); } if ((*expr._v__ast__PrefixExpr).or_block.kind != v__ast__OrKind__absent) { string err_prefix = ((*expr._v__ast__PrefixExpr).or_block.kind == v__ast__OrKind__block ? (_SLIT("or block")) : (_SLIT("error propagation"))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = err_prefix}}, {_SLIT(" not allowed in `select` key"), 0, { .d_c = 0 }}})), (*expr._v__ast__PrefixExpr).or_block.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = err_prefix}}, {_SLIT(" not allowed in `select` key"), 0, { .d_c = 0 }}})), (*expr._v__ast__PrefixExpr).or_block.pos); } } @@ -53217,13 +53288,13 @@ v__ast__Type v__checker__Checker_lock_expr(v__checker__Checker* c, v__ast__LockE v__ast__Type e_typ = v__checker__Checker_expr(c, (*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i))); string id_name = v__ast__Expr_str((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i))); if (!v__ast__Type_has_flag(e_typ, v__ast__TypeFlag__shared_f)) { - string obj_type = (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))._typ == 305 /* v.ast.Ident */ ? (_SLIT("variable")) : (_SLIT("struct element"))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = id_name}}, {_SLIT("` must be declared as `shared` "), 0xfe10, {.d_s = obj_type}}, {_SLIT(" to be locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); + string obj_type = (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))._typ == 306 /* v.ast.Ident */ ? (_SLIT("variable")) : (_SLIT("struct element"))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = id_name}}, {_SLIT("` must be declared as `shared` "), /*115 &string*/0xfe10, {.d_s = obj_type}}, {_SLIT(" to be locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); } if (Array_string_contains(c->locked_names, id_name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = id_name}}, {_SLIT("` is already locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = id_name}}, {_SLIT("` is already locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); } else if (Array_string_contains(c->rlocked_names, id_name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = id_name}}, {_SLIT("` is already read-locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = id_name}}, {_SLIT("` is already read-locked"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))); } if ((*(bool*)/*ee elem_sym */array_get(node->is_rlock, i))) { array_push((array*)&c->rlocked_names, _MOV((string[]){ string_clone(id_name) })); @@ -53237,7 +53308,7 @@ v__ast__Type v__checker__Checker_lock_expr(v__checker__Checker* c, v__ast__LockE v__ast__Type ret_type = _const_v__ast__void_type; if (node->stmts.len > 0) { v__ast__Stmt last_stmt = (*(v__ast__Stmt*)array_last(node->stmts)); - if ((last_stmt)._typ == 345 /* v.ast.ExprStmt */) { + if ((last_stmt)._typ == 346 /* v.ast.ExprStmt */) { ret_type = (*last_stmt._v__ast__ExprStmt).typ; } } @@ -53267,46 +53338,46 @@ VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_definition(v__check return _t2; } else if (ident.kind == (v__ast__IdentKind__global)) { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ident.name}}, {_SLIT(" is a global variable"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ident.name}}, {_SLIT(" is a global variable"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (ident.kind == (v__ast__IdentKind__function)) { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ident.name}}, {_SLIT(" is a function"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ident.name}}, {_SLIT(" is a function"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_v__ast__Expr){0}; } VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_obj_definition(v__checker__Checker* c, v__ast__ScopeObject obj) { string name = _SLIT(""); - if (obj._typ == 363 /* v.ast.Var */) { + if (obj._typ == 364 /* v.ast.Var */) { name = (*obj._v__ast__Var).name; } - else if (obj._typ == 361 /* v.ast.ConstField */) { + else if (obj._typ == 362 /* v.ast.ConstField */) { name = (*obj._v__ast__ConstField).name; } - else if (obj._typ == 362 /* v.ast.GlobalField */) { + else if (obj._typ == 363 /* v.ast.GlobalField */) { name = (*obj._v__ast__GlobalField).name; } - else if (obj._typ == 360 /* v.ast.AsmRegister */) { + else if (obj._typ == 361 /* v.ast.AsmRegister */) { name = (*obj._v__ast__AsmRegister).name; } ; v__ast__Expr expr = v__ast__empty_expr(); - if ((obj)._typ == 363 /* v.ast.Var */) { + if ((obj)._typ == 364 /* v.ast.Var */) { if ((*obj._v__ast__Var).is_mut) { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = name}}, {_SLIT("` is mut and may have changed since its definition"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` is mut and may have changed since its definition"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } expr = (*obj._v__ast__Var).expr; - } else if ((obj)._typ == 361 /* v.ast.ConstField */) { + } else if ((obj)._typ == 362 /* v.ast.ConstField */) { expr = (*obj._v__ast__ConstField).expr; } else { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = name}}, {_SLIT("` is a global variable and is unknown at compile time"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` is a global variable and is unknown at compile time"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } - if ((expr)._typ == 305 /* v.ast.Ident */) { + if ((expr)._typ == 306 /* v.ast.Ident */) { Option_v__ast__Expr _t3 = v__checker__Checker_find_definition(c, (*expr._v__ast__Ident)); return _t3; } if (!v__ast__Expr_is_lit(expr)) { - return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("definition of `"), 0xfe10, {.d_s = name}}, {_SLIT("` is unknown at compile time"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__ast__Expr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("definition of `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` is unknown at compile time"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_v__ast__Expr _t5; opt_ok(&(v__ast__Expr[]) { expr }, (Option*)(&_t5), sizeof(v__ast__Expr)); @@ -53317,8 +53388,8 @@ VV_LOCAL_SYMBOL Option_bool v__checker__Checker_has_return(v__checker__Checker* bool has_complexity = false; for (int _t1 = 0; _t1 < stmts.len; ++_t1) { v__ast__Stmt s = ((v__ast__Stmt*)stmts.data)[_t1]; - if ((s)._typ == 345 /* v.ast.ExprStmt */) { - if (((*s._v__ast__ExprStmt).expr)._typ == 306 /* v.ast.IfExpr */ || ((*s._v__ast__ExprStmt).expr)._typ == 315 /* v.ast.MatchExpr */) { + if ((s)._typ == 346 /* v.ast.ExprStmt */) { + if (((*s._v__ast__ExprStmt).expr)._typ == 307 /* v.ast.IfExpr */ || ((*s._v__ast__ExprStmt).expr)._typ == 316 /* v.ast.MatchExpr */) { has_complexity = true; break; } @@ -53341,18 +53412,18 @@ v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__Po } if (!(v__ast__TypeSymbol_is_number(typ_sym) || ((c->inside_unsafe || c->pref->translated) && is_non_void_pointer))) { 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: "), 0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" (non-numeric type `"), 0xfe10, {.d_s = typ_str}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); + 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_115935 = v__checker__Checker_fail_if_immutable(c, node->expr); - node->auto_locked = mr_115935.arg0; + multi_return_string_v__token__Pos mr_117098 = v__checker__Checker_fail_if_immutable(c, node->expr); + node->auto_locked = mr_117098.arg0; } v__ast__Type _t1 = typ; return _t1; } void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr* node, bool as_interface) { - if (node->_typ == 305 /* v.ast.Ident */) { - if (((*node->_v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if (node->_typ == 306 /* v.ast.Ident */) { + if (((*node->_v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { v__ast__Var* obj = &(*(*node->_v__ast__Ident).obj._v__ast__Var); if (c->fn_scope != ((voidptr)(0))) { Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(c->fn_scope, (*(*node->_v__ast__Ident).obj._v__ast__Var).name); @@ -53368,15 +53439,15 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, v__ast__Type_set_nr_muls(obj->typ, 0)); if (obj->is_stack_obj && !v__ast__TypeSymbol_is_heap(type_sym) && !c->pref->translated && !c->file->is_translated) { - string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); + string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); string mischief = (as_interface ? (_SLIT("used as interface object")) : (_SLIT("referenced"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*node->_v__ast__Ident).name}}, {_SLIT("` cannot be "), 0xfe10, {.d_s = mischief}}, {_SLIT(" outside `unsafe` blocks as it might be stored on stack. Consider "), 0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*node->_v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*node->_v__ast__Ident).name}}, {_SLIT("` cannot be "), /*115 &string*/0xfe10, {.d_s = mischief}}, {_SLIT(" outside `unsafe` blocks as it might be stored on stack. Consider "), /*115 &string*/0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*node->_v__ast__Ident).pos); } else if (type_sym->kind == v__ast__Kind__array_fixed) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot reference fixed array `"), 0xfe10, {.d_s = (*node->_v__ast__Ident).name}}, {_SLIT("` outside `unsafe` blocks as it is supposed to be stored on stack"), 0, { .d_c = 0 }}})), (*node->_v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot reference fixed array `"), /*115 &string*/0xfe10, {.d_s = (*node->_v__ast__Ident).name}}, {_SLIT("` outside `unsafe` blocks as it is supposed to be stored on stack"), 0, { .d_c = 0 }}})), (*node->_v__ast__Ident).pos); } else { if (type_sym->kind == (v__ast__Kind__struct_)) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (!info.is_heap) { (*(*node->_v__ast__Ident).obj._v__ast__Var).is_auto_heap = true; } @@ -53387,12 +53458,12 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } } } - else if (node->_typ == 325 /* v.ast.SelectorExpr */) { + else if (node->_typ == 326 /* v.ast.SelectorExpr */) { if (!v__ast__Type_is_ptr((*node->_v__ast__SelectorExpr).expr_type)) { v__checker__Checker_mark_as_referenced(c, &(*node->_v__ast__SelectorExpr).expr, as_interface); } } - else if (node->_typ == 308 /* v.ast.IndexExpr */) { + else if (node->_typ == 309 /* v.ast.IndexExpr */) { v__checker__Checker_mark_as_referenced(c, &(*node->_v__ast__IndexExpr).left, as_interface); } @@ -53402,15 +53473,15 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } string v__checker__Checker_get_base_name(v__checker__Checker* c, v__ast__Expr* node) { - if (node->_typ == 305 /* v.ast.Ident */) { + if (node->_typ == 306 /* v.ast.Ident */) { string _t1 = (*node->_v__ast__Ident).name; return _t1; } - else if (node->_typ == 325 /* v.ast.SelectorExpr */) { + else if (node->_typ == 326 /* v.ast.SelectorExpr */) { string _t2 = v__checker__Checker_get_base_name(c, &(*node->_v__ast__SelectorExpr).expr); return _t2; } - else if (node->_typ == 308 /* v.ast.IndexExpr */) { + else if (node->_typ == 309 /* v.ast.IndexExpr */) { string _t3 = v__checker__Checker_get_base_name(c, &(*node->_v__ast__IndexExpr).left); return _t3; } @@ -53430,7 +53501,7 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre c->inside_ref_lit = old_inside_ref_lit; node->right_type = right_type; if (node->op == v__token__Kind__amp) { - if ((node->right)._typ == 322 /* v.ast.PrefixExpr */) { + if ((node->right)._typ == 323 /* v.ast.PrefixExpr */) { if ((*node->right._v__ast__PrefixExpr).op == v__token__Kind__amp) { v__checker__Checker_error(c, _SLIT("unexpected `&`, expecting expression"), (*node->right._v__ast__PrefixExpr).pos); } @@ -53439,19 +53510,19 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre if (node->op == v__token__Kind__amp && !v__ast__Type_is_ptr(right_type)) { v__ast__Expr expr = node->right; for (;;) { - if (!((expr)._typ == 320 /* v.ast.ParExpr */)) break; + if (!((expr)._typ == 321 /* v.ast.ParExpr */)) break; expr = (*expr._v__ast__ParExpr).expr; } - if ((expr)._typ == 289 /* v.ast.BoolLiteral */ || (expr)._typ == 291 /* v.ast.CallExpr */ || (expr)._typ == 294 /* v.ast.CharLiteral */ || (expr)._typ == 303 /* v.ast.FloatLiteral */ || (expr)._typ == 310 /* v.ast.IntegerLiteral */ || (expr)._typ == 309 /* v.ast.InfixExpr */ || (expr)._typ == 329 /* v.ast.StringLiteral */ || (expr)._typ == 328 /* v.ast.StringInterLiteral */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot take the address of "), 0xfe10, {.d_s = v__ast__Expr_str(expr)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + if ((expr)._typ == 290 /* v.ast.BoolLiteral */ || (expr)._typ == 292 /* v.ast.CallExpr */ || (expr)._typ == 295 /* v.ast.CharLiteral */ || (expr)._typ == 304 /* v.ast.FloatLiteral */ || (expr)._typ == 311 /* v.ast.IntegerLiteral */ || (expr)._typ == 310 /* v.ast.InfixExpr */ || (expr)._typ == 330 /* v.ast.StringLiteral */ || (expr)._typ == 329 /* v.ast.StringInterLiteral */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot take the address of "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(expr)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } - if ((node->right)._typ == 308 /* v.ast.IndexExpr */) { + if ((node->right)._typ == 309 /* v.ast.IndexExpr */) { v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, (*node->right._v__ast__IndexExpr).left_type); bool is_mut = false; - if (((*node->right._v__ast__IndexExpr).left)._typ == 305 /* v.ast.Ident */) { + if (((*node->right._v__ast__IndexExpr).left)._typ == 306 /* v.ast.Ident */) { v__ast__Ident ident = (*(*node->right._v__ast__IndexExpr).left._v__ast__Ident); v__ast__ScopeObject ident_obj = ident.obj; - if ((ident_obj)._typ == 363 /* v.ast.Var */) { + if ((ident_obj)._typ == 364 /* v.ast.Var */) { is_mut = (*ident_obj._v__ast__Var).is_mut; } } @@ -53469,7 +53540,7 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre } v__ast__Type _t1 = v__ast__Type_ref(right_type); return _t1; - } else if (node->op == v__token__Kind__amp && (node->right)._typ != 292 /* v.ast.CastExpr */) { + } else if (node->op == v__token__Kind__amp && (node->right)._typ != 293 /* v.ast.CastExpr */) { if (!c->inside_fn_arg && !c->inside_unsafe) { v__checker__Checker_mark_as_referenced(c, &node->right, false); } @@ -53488,7 +53559,7 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre } if (!v__ast__Type_is_pointer(right_type) && !c->pref->translated && !c->file->is_translated) { string s = v__ast__Table_type_to_str(c->table, right_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid indirect of `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid indirect of `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (node->op == v__token__Kind__bit_not && !v__ast__Type_is_int(right_type) && !c->pref->translated && !c->file->is_translated) { @@ -53516,24 +53587,24 @@ v__ast__Type v__checker__Checker_prefix_expr(v__checker__Checker* c, v__ast__Pre VV_LOCAL_SYMBOL void v__checker__Checker_check_index(v__checker__Checker* c, v__ast__TypeSymbol* typ_sym, v__ast__Expr index, v__ast__Type index_type, v__token__Pos pos, bool range_index, bool is_gated) { v__ast__TypeSymbol* index_type_sym = v__ast__Table_sym(c->table, index_type); if (typ_sym->kind == v__ast__Kind__array || typ_sym->kind == v__ast__Kind__array_fixed || typ_sym->kind == v__ast__Kind__string) { - if (!(v__ast__Type_is_int(index_type) || index_type_sym->kind == v__ast__Kind__enum_ || (index_type_sym->kind == v__ast__Kind__alias && v__ast__Type_is_int((/* as */ *(v__ast__Alias*)__as_cast((index_type_sym->info)._v__ast__Alias,(index_type_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type)))) { - string type_str = (typ_sym->kind == v__ast__Kind__string ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-integer string index `"), 0xfe10, {.d_s = index_type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("non-integer index `"), 0xfe10, {.d_s = index_type_sym->name}}, {_SLIT("` (array type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + if (!(v__ast__Type_is_int(index_type) || index_type_sym->kind == v__ast__Kind__enum_ || (index_type_sym->kind == v__ast__Kind__alias && v__ast__Type_is_int((/* as */ *(v__ast__Alias*)__as_cast((index_type_sym->info)._v__ast__Alias,(index_type_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type)))) { + string type_str = (typ_sym->kind == v__ast__Kind__string ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-integer string index `"), /*115 &string*/0xfe10, {.d_s = index_type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("non-integer index `"), /*115 &string*/0xfe10, {.d_s = index_type_sym->name}}, {_SLIT("` (array type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); } - if ((index)._typ == 310 /* v.ast.IntegerLiteral */ && !is_gated) { + if ((index)._typ == 311 /* v.ast.IntegerLiteral */ && !is_gated) { if (string_at((*index._v__ast__IntegerLiteral).val, 0) == '-') { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("negative index `"), 0xfe10, {.d_s = (*index._v__ast__IntegerLiteral).val}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*index._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("negative index `"), /*115 &string*/0xfe10, {.d_s = (*index._v__ast__IntegerLiteral).val}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*index._v__ast__IntegerLiteral).pos); } else if (typ_sym->kind == v__ast__Kind__array_fixed) { int i = string_int((*index._v__ast__IntegerLiteral).val); - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((typ_sym->info)._v__ast__ArrayFixed,(typ_sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((typ_sym->info)._v__ast__ArrayFixed,(typ_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; if ((!range_index && i >= info.size) || (range_index && i > info.size)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("index out of range (index: "), 0xfe07, {.d_i32 = i}}, {_SLIT(", len: "), 0xfe07, {.d_i32 = info.size}}, {_SLIT(")"), 0, { .d_c = 0 }}})), (*index._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("index out of range (index: "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", len: "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(")"), 0, { .d_c = 0 }}})), (*index._v__ast__IntegerLiteral).pos); } } } if (v__ast__Type_has_flag(index_type, v__ast__TypeFlag__optional)) { - string type_str = (typ_sym->kind == v__ast__Kind__string ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("(type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("(array type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use optional as index "), 0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + string type_str = (typ_sym->kind == v__ast__Kind__string ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("(type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("(array type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use optional as index "), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); } } } @@ -53550,7 +53621,7 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde } else if (typ_sym->kind == (v__ast__Kind__array)) { node->is_array = true; - if (node->or_expr.kind != v__ast__OrKind__absent && (node->index)._typ == 323 /* v.ast.RangeExpr */) { + if (node->or_expr.kind != v__ast__OrKind__absent && (node->index)._typ == 324 /* v.ast.RangeExpr */) { v__checker__Checker_error(c, _SLIT("custom error handling on range expressions for arrays is not supported yet."), node->or_expr.pos); } break; @@ -53567,7 +53638,7 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde if (v__ast__Type_is_ptr(typ)) { continue; } else { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("generic type "), 0xfe10, {.d_s = gname}}, {_SLIT(" does not support indexing, pass an array, or a reference instead, e.g. []"), 0xfe10, {.d_s = gname}}, {_SLIT(" or &"), 0xfe10, {.d_s = gname}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("generic type "), /*115 &string*/0xfe10, {.d_s = gname}}, {_SLIT(" does not support indexing, pass an array, or a reference instead, e.g. []"), /*115 &string*/0xfe10, {.d_s = gname}}, {_SLIT(" or &"), /*115 &string*/0xfe10, {.d_s = gname}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } } else { @@ -53575,29 +53646,29 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde }; } if (!(typ_sym->kind == v__ast__Kind__array || typ_sym->kind == v__ast__Kind__array_fixed || typ_sym->kind == v__ast__Kind__string || typ_sym->kind == v__ast__Kind__map) && !v__ast__Type_is_ptr(typ) && !(v__ast__Type_alias_eq(typ, _const_v__ast__byteptr_type) || v__ast__Type_alias_eq(typ, _const_v__ast__charptr_type)) && !v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not support indexing"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not support indexing"), 0, { .d_c = 0 }}})), node->pos); } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__optional)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `?"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` is optional, it does not support indexing"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `?"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` is optional, it does not support indexing"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); } if (typ_sym->kind == v__ast__Kind__string && !v__ast__Type_is_ptr(typ) && node->is_setter) { v__checker__Checker_error(c, _SLIT("cannot assign to s[i] since V strings are immutable\n(note, that variables may be mutable but string values are always immutable, like in Go and Java)"), node->pos); } if ((v__ast__Type_is_ptr(typ) && !v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f) && !v__ast__Expr_is_auto_deref_var(node->left)) || v__ast__Type_is_pointer(typ)) { bool is_ok = false; - if ((node->left)._typ == 305 /* v.ast.Ident */) { - if (((*node->left._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((node->left)._typ == 306 /* v.ast.Ident */) { + if (((*node->left._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { is_ok = (*(*node->left._v__ast__Ident).obj._v__ast__Var).is_mut && (*(*node->left._v__ast__Ident).obj._v__ast__Var).is_arg && !v__ast__Type_is_ptr(v__ast__Type_deref(typ)); } } - if (!is_ok && (node->index)._typ == 323 /* v.ast.RangeExpr */) { + if (!is_ok && (node->index)._typ == 324 /* v.ast.RangeExpr */) { string s = v__ast__Table_type_to_str(c->table, typ); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = s}}, {_SLIT("` does not support slicing"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("` does not support slicing"), 0, { .d_c = 0 }}})), node->pos); } else if (!c->inside_unsafe && !is_ok && !c->pref->translated && !c->file->is_translated) { v__checker__Checker_warn(c, _SLIT("pointer indexing is only allowed in `unsafe` blocks"), node->pos); } } - if ((node->index)._typ == 323 /* v.ast.RangeExpr */) { + if ((node->index)._typ == 324 /* v.ast.RangeExpr */) { if ((*node->index._v__ast__RangeExpr).has_low) { v__ast__Type index_type = v__checker__Checker_expr(c, (*node->index._v__ast__RangeExpr).low); v__checker__Checker_check_index(c, typ_sym, (*node->index._v__ast__RangeExpr).low, index_type, node->pos, true, node->is_gated); @@ -53615,12 +53686,12 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde } } else { if (typ_sym->kind == v__ast__Kind__map) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((typ_sym->info)._v__ast__Map,(typ_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((typ_sym->info)._v__ast__Map,(typ_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; c->expected_type = info.key_type; v__ast__Type index_type = v__checker__Checker_expr(c, node->index); if (!v__checker__Checker_check_types(c, index_type, info.key_type)) { string err = v__checker__Checker_expected_msg(c, index_type, info.key_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid key: "), 0xfe10, {.d_s = err}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid key: "), /*115 &string*/0xfe10, {.d_s = err}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } v__ast__TypeSymbol* value_sym = v__ast__Table_sym(c->table, info.value_type); if (!node->is_setter && value_sym->kind == v__ast__Kind__sum_type && node->or_expr.kind == v__ast__OrKind__absent && !c->inside_unsafe && !c->inside_if_guard) { @@ -53647,16 +53718,16 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde v__ast__Type v__checker__Checker_enum_val(v__checker__Checker* c, v__ast__EnumVal* node) { int typ_idx = ((node->enum_name).len == 0 ? ((v__ast__Type_alias_eq(c->expected_type, _const_v__ast__void_type) && !v__ast__Type_alias_eq(c->expected_expr_type, _const_v__ast__void_type) ? (v__ast__Type_idx(c->expected_expr_type)) : (v__ast__Type_idx(c->expected_type)))) : (v__ast__Table_find_type_idx(c->table, node->enum_name))); if (typ_idx == 0) { - if (string_starts_with(node->enum_name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0, { .d_c = 0 }}})))) { - typ_idx = v__ast__Table_find_type_idx(c->table, string_substr(node->enum_name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0, { .d_c = 0 }}})).len, (node->enum_name).len)); + if (string_starts_with(node->enum_name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0, { .d_c = 0 }}})))) { + typ_idx = v__ast__Table_find_type_idx(c->table, string_substr(node->enum_name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0, { .d_c = 0 }}})).len, (node->enum_name).len)); if (typ_idx == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enum `"), 0xfe10, {.d_s = node->enum_name}}, {_SLIT("` (type_idx=0)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enum `"), /*115 &string*/0xfe10, {.d_s = node->enum_name}}, {_SLIT("` (type_idx=0)"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t1 = _const_v__ast__void_type; return _t1; } } if (typ_idx == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enum `"), 0xfe10, {.d_s = node->enum_name}}, {_SLIT("` (type_idx=0)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown enum `"), /*115 &string*/0xfe10, {.d_s = node->enum_name}}, {_SLIT("` (type_idx=0)"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t2 = _const_v__ast__void_type; return _t2; } @@ -53674,28 +53745,28 @@ v__ast__Type v__checker__Checker_enum_val(v__checker__Checker* c, v__ast__EnumVa } v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, typ); if (typ_sym->kind == v__ast__Kind__array && node->enum_name.len == 0) { - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((typ_sym->info)._v__ast__Array,(typ_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((typ_sym->info)._v__ast__Array,(typ_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; typ = array_info.elem_type; typ_sym = v__ast__Table_sym(c->table, typ); } v__ast__TypeSymbol* fsym = v__ast__Table_final_sym(c->table, typ); if (fsym->kind != v__ast__Kind__enum_ && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected type is not an enum (`"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected type is not an enum (`"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t5 = _const_v__ast__void_type; return _t5; } - if ((fsym->info)._typ != 484 /* v.ast.Enum */) { + if ((fsym->info)._typ != 485 /* v.ast.Enum */) { v__checker__Checker_error(c, _SLIT("not an enum"), node->pos); v__ast__Type _t6 = _const_v__ast__void_type; return _t6; } if (!(typ_sym->is_pub || string__eq(typ_sym->mod, c->mod))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("enum `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } v__ast__Enum info = v__ast__TypeSymbol_enum_info(typ_sym); if (!Array_string_contains(info.vals, node->val)) { v__util__Suggestion suggestion = v__util__new_suggestion(node->val, info.vals); - v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(3, _MOV((StrIntpData[]){{_SLIT("enum `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not have a value `"), 0xfe10, {.d_s = node->val}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), node->pos); + v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(3, _MOV((StrIntpData[]){{_SLIT("enum `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("` does not have a value `"), /*115 &string*/0xfe10, {.d_s = node->val}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), node->pos); } node->typ = typ; v__ast__Type _t7 = typ; @@ -53727,7 +53798,7 @@ v__ast__Type v__checker__Checker_offset_of(v__checker__Checker* c, v__ast__Offse return _t1; } if (!v__ast__Table_struct_has_field(c->table, sym, node.field)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` has no field called `"), 0xfe10, {.d_s = node.field}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has no field called `"), /*115 &string*/0xfe10, {.d_s = node.field}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); } v__ast__Type _t2 = _const_v__ast__u32_type; return _t2; @@ -53735,21 +53806,21 @@ v__ast__Type v__checker__Checker_offset_of(v__checker__Checker* c, v__ast__Offse void v__checker__Checker_check_dup_keys(v__checker__Checker* c, v__ast__MapInit* node, int i) { v__ast__Expr key_i = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->keys, i)); - if ((key_i)._typ == 329 /* v.ast.StringLiteral */) { + if ((key_i)._typ == 330 /* v.ast.StringLiteral */) { for (int j = 0; j < i; ++j) { v__ast__Expr key_j = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->keys, j)); - if ((key_j)._typ == 329 /* v.ast.StringLiteral */) { + if ((key_j)._typ == 330 /* v.ast.StringLiteral */) { if (string__eq((*key_i._v__ast__StringLiteral).val, (*key_j._v__ast__StringLiteral).val)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate key \""), 0xfe10, {.d_s = (*key_i._v__ast__StringLiteral).val}}, {_SLIT("\" in map literal"), 0, { .d_c = 0 }}})), (*key_i._v__ast__StringLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate key \""), /*115 &string*/0xfe10, {.d_s = (*key_i._v__ast__StringLiteral).val}}, {_SLIT("\" in map literal"), 0, { .d_c = 0 }}})), (*key_i._v__ast__StringLiteral).pos); } } } - } else if ((key_i)._typ == 310 /* v.ast.IntegerLiteral */) { + } else if ((key_i)._typ == 311 /* v.ast.IntegerLiteral */) { for (int j = 0; j < i; ++j) { v__ast__Expr key_j = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->keys, j)); - if ((key_j)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((key_j)._typ == 311 /* v.ast.IntegerLiteral */) { if (string__eq((*key_i._v__ast__IntegerLiteral).val, (*key_j._v__ast__IntegerLiteral).val)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate key \""), 0xfe10, {.d_s = (*key_i._v__ast__IntegerLiteral).val}}, {_SLIT("\" in map literal"), 0, { .d_c = 0 }}})), (*key_i._v__ast__IntegerLiteral).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate key \""), /*115 &string*/0xfe10, {.d_s = (*key_i._v__ast__IntegerLiteral).val}}, {_SLIT("\" in map literal"), 0, { .d_c = 0 }}})), (*key_i._v__ast__IntegerLiteral).pos); } } } @@ -53888,7 +53959,7 @@ VV_LOCAL_SYMBOL string v__checker__Checker_fetch_field_name(v__checker__Checker* } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, field.typ); if (sym->kind == v__ast__Kind__struct_ && !string__eq(sym->name, _SLIT("time.Time"))) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("_id"), 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("_id"), 0, { .d_c = 0 }}})); } string _t2 = name; return _t2; @@ -53896,7 +53967,7 @@ VV_LOCAL_SYMBOL string v__checker__Checker_fetch_field_name(v__checker__Checker* VV_LOCAL_SYMBOL void v__checker__Checker_trace(v__checker__Checker* c, string fbase, string message) { if (string__eq(c->file->path_base, fbase)) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> c.trace | "), 0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), 0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> c.trace | "), /*115 &string*/0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -53910,7 +53981,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C case v__ast__Kind__placeholder: { if (sym->language == v__ast__Language__v && !string_starts_with(sym->name, _SLIT("C."))) { - v__checker__Checker_error(c, v__util__Suggestion_say(v__util__new_suggestion(sym->name, v__ast__Table_known_type_names(c->table)), str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), pos); + v__checker__Checker_error(c, v__util__Suggestion_say(v__util__new_suggestion(sym->name, v__ast__Table_known_type_names(c->table)), str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), pos); return (Option_void){0}; } break; @@ -53919,7 +53990,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C case v__ast__Kind__float_literal: { if (!c->is_builtin_mod) { - string msg = (sym->kind == v__ast__Kind__int_literal ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`.\nDid you mean `int`?"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`.\nDid you mean `f64`?"), 0, { .d_c = 0 }}})))); + string msg = (sym->kind == v__ast__Kind__int_literal ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`.\nDid you mean `int`?"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`.\nDid you mean `f64`?"), 0, { .d_c = 0 }}})))); v__checker__Checker_error(c, msg, pos); return (Option_void){0}; } @@ -53927,7 +53998,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } case v__ast__Kind__array: { - Option_void _t1 = v__checker__Checker_ensure_type_exists(c, (/* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ).elem_type, pos); + Option_void _t1 = v__checker__Checker_ensure_type_exists(c, (/* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ).elem_type, pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { Option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); @@ -53939,7 +54010,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } case v__ast__Kind__array_fixed: { - Option_void _t3 = v__checker__Checker_ensure_type_exists(c, (/* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ).elem_type, pos); + Option_void _t3 = v__checker__Checker_ensure_type_exists(c, (/* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ).elem_type, pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { Option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); @@ -53951,7 +54022,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } case v__ast__Kind__map: { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; Option_void _t5 = v__checker__Checker_ensure_type_exists(c, info.key_type, pos); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { Option_void _t6; @@ -53972,7 +54043,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } case v__ast__Kind__sum_type: { - v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ; for (int _t9 = 0; _t9 < info.concrete_types.len; ++_t9) { v__ast__Type concrete_typ = ((v__ast__Type*)info.concrete_types.data)[_t9]; Option_void _t10 = v__checker__Checker_ensure_type_exists(c, concrete_typ, pos); @@ -54029,43 +54100,43 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr expr, v__ast__Type typ, string what) { v__token__Pos pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); - if (expr._typ == 305 /* v.ast.Ident */) { + if (expr._typ == 306 /* v.ast.Ident */) { if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { if (!Array_string_contains(c->rlocked_names, (*expr._v__ast__Ident).name) && !Array_string_contains(c->locked_names, (*expr._v__ast__Ident).name)) { string action = (string__eq(what, _SLIT("argument")) ? (_SLIT("passed")) : (_SLIT("used"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("` is `shared` and must be `rlock`ed or `lock`ed to be "), 0xfe10, {.d_s = action}}, {_SLIT(" as non-mut "), 0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__Ident).name}}, {_SLIT("` is `shared` and must be `rlock`ed or `lock`ed to be "), /*115 &string*/0xfe10, {.d_s = action}}, {_SLIT(" as non-mut "), /*115 &string*/0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__Ident).pos); } } return; } - else if (expr._typ == 325 /* v.ast.SelectorExpr */) { + else if (expr._typ == 326 /* v.ast.SelectorExpr */) { pos = (*expr._v__ast__SelectorExpr).pos; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - string expr_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr)}}, {_SLIT("."), 0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string expr_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!Array_string_contains(c->rlocked_names, expr_name) && !Array_string_contains(c->locked_names, expr_name)) { string action = (string__eq(what, _SLIT("argument")) ? (_SLIT("passed")) : (_SLIT("used"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = expr_name}}, {_SLIT("` is `shared` and must be `rlock`ed or `lock`ed to be "), 0xfe10, {.d_s = action}}, {_SLIT(" as non-mut "), 0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = expr_name}}, {_SLIT("` is `shared` and must be `rlock`ed or `lock`ed to be "), /*115 &string*/0xfe10, {.d_s = action}}, {_SLIT(" as non-mut "), /*115 &string*/0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__SelectorExpr).pos); } return; } else { v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__SelectorExpr).expr, (*expr._v__ast__SelectorExpr).expr_type, what); } } - else if (expr._typ == 291 /* v.ast.CallExpr */) { + else if (expr._typ == 292 /* v.ast.CallExpr */) { pos = (*expr._v__ast__CallExpr).pos; if ((*expr._v__ast__CallExpr).is_method) { v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__CallExpr).left, (*expr._v__ast__CallExpr).left_type, what); } return; } - else if (expr._typ == 313 /* v.ast.LockExpr */) { + else if (expr._typ == 314 /* v.ast.LockExpr */) { return; } - else if (expr._typ == 308 /* v.ast.IndexExpr */) { + else if (expr._typ == 309 /* v.ast.IndexExpr */) { pos = v__token__Pos_extend(v__ast__Expr_pos((*expr._v__ast__IndexExpr).left), (*expr._v__ast__IndexExpr).pos); v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__IndexExpr).left, (*expr._v__ast__IndexExpr).left_type, what); } - else if (expr._typ == 309 /* v.ast.InfixExpr */) { + else if (expr._typ == 310 /* v.ast.InfixExpr */) { pos = v__token__Pos_extend(v__ast__Expr_pos((*expr._v__ast__InfixExpr).left), (*expr._v__ast__InfixExpr).pos); v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__InfixExpr).left, (*expr._v__ast__InfixExpr).left_type, what); v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__InfixExpr).right, (*expr._v__ast__InfixExpr).right_type, what); @@ -54076,14 +54147,14 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr } ; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("you have to create a handle and `rlock` it to use a `shared` element as non-mut "), 0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("you have to create a handle and `rlock` it to use a `shared` element as non-mut "), /*115 &string*/0xfe10, {.d_s = what}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); } } 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->is_env) { - Option_string _t1 = v__util__resolve_env_value( str_intp(2, _MOV((StrIntpData[]){{_SLIT("$env('"), 0xfe10, {.d_s = node->args_var}}, {_SLIT("')"), 0, { .d_c = 0 }}})), false); + Option_string _t1 = v__util__resolve_env_value( str_intp(2, _MOV((StrIntpData[]){{_SLIT("$env('"), /*115 &string*/0xfe10, {.d_s = node->args_var}}, {_SLIT("')"), 0, { .d_c = 0 }}})), false); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->env_pos); @@ -54105,11 +54176,11 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check for (int _t5 = 0; _t5 < _t4_len; ++_t5) { string it = ((string*) _t4_orig.data)[_t5]; - string ti = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = it}}, {_SLIT0, 0, { .d_c = 0 }}})); + string ti = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = it}}, {_SLIT0, 0, { .d_c = 0 }}})); array_push((array*)&_t4, &ti); } string supported = Array_string_join(_t4, _SLIT(", ")); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("not supported compression type: ."), 0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(". supported: "), 0xfe10, {.d_s = supported}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("not supported compression type: ."), /*115 &string*/0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(". supported: "), /*115 &string*/0xfe10, {.d_s = supported}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } v__ast__Type _t6 = v__ast__Table_find_type_idx(c->table, _SLIT("v.embed_file.EmbedFileData")); return _t6; @@ -54150,7 +54221,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check Option_v__ast__Var_ptr _t13 = v__ast__Scope_find_var(node->scope, node->method_name); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown identifier `"), 0xfe10, {.d_s = node->method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown identifier `"), /*115 &string*/0xfe10, {.d_s = node->method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); v__ast__Type _t14 = _const_v__ast__void_type; return _t14; } @@ -54158,12 +54229,12 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check v__ast__Var* v = (*(v__ast__Var**)_t13.data); if (!v__ast__Type_alias_eq(v->typ, _const_v__ast__string_type)) { string s = v__checker__Checker_expected_msg(c, v->typ, _const_v__ast__string_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid string method call: "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}})), node->method_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid string method call: "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}})), node->method_pos); v__ast__Type _t15 = _const_v__ast__void_type; return _t15; } string method_name = _SLIT(""); - if ((v->expr)._typ == 329 /* v.ast.StringLiteral */) { + if ((v->expr)._typ == 330 /* v.ast.StringLiteral */) { method_name = (*v->expr._v__ast__StringLiteral).val; } else { v__checker__Checker_error(c, _SLIT("todo: not a string literal"), node->method_pos); @@ -54172,7 +54243,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check Option_v__ast__Fn _t16 = v__ast__TypeSymbol_find_method(left_sym, method_name); if (_t16.state != 0) { /*or block*/ IError err = _t16.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not find method `"), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not find method `"), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); v__ast__Type _t17 = _const_v__ast__void_type; return _t17; } @@ -54187,11 +54258,11 @@ VV_LOCAL_SYMBOL void v__checker__Checker_comptime_for(v__checker__Checker* c, v_ v__ast__Type typ = v__checker__Checker_unwrap_generic(c, node.typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, typ); if (sym->kind == v__ast__Kind__placeholder || v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.typ_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.typ_pos); } if (node.kind == v__ast__ComptimeForKind__fields) { if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; c->inside_comptime_for_field = true; for (int _t1 = 0; _t1 < sym_info.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)sym_info.fields.data)[_t1]; @@ -54210,22 +54281,22 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp if (nlevel > 100) { return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - if (expr._typ == 320 /* v.ast.ParExpr */) { + if (expr._typ == 321 /* v.ast.ParExpr */) { Option_v__ast__ComptTimeConstValue _t2 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__ParExpr).expr, nlevel + 1); return _t2; } - else if (expr._typ == 326 /* v.ast.SizeOf */) { + else if (expr._typ == 327 /* v.ast.SizeOf */) { Option_v__ast__ComptTimeConstValue _t3; opt_ok(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(ADDR(int, (v__ast__Table_type_size(c->table, (*expr._v__ast__SizeOf).typ)))) }, (Option*)(&_t3), sizeof(v__ast__ComptTimeConstValue)); return _t3; } - else if (expr._typ == 303 /* v.ast.FloatLiteral */) { + else if (expr._typ == 304 /* v.ast.FloatLiteral */) { f64 x = string_f64((*expr._v__ast__FloatLiteral).val); Option_v__ast__ComptTimeConstValue _t4; opt_ok(&(v__ast__ComptTimeConstValue[]) { f64_to_sumtype_v__ast__ComptTimeConstValue(&x) }, (Option*)(&_t4), sizeof(v__ast__ComptTimeConstValue)); return _t4; } - else if (expr._typ == 310 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { u64 x = string_u64((*expr._v__ast__IntegerLiteral).val); if (x > 9223372036854775807U) { Option_v__ast__ComptTimeConstValue _t5; @@ -54236,12 +54307,12 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (string_i64((*expr._v__ast__IntegerLiteral).val)))) }, (Option*)(&_t6), sizeof(v__ast__ComptTimeConstValue)); return _t6; } - else if (expr._typ == 329 /* v.ast.StringLiteral */) { + else if (expr._typ == 330 /* v.ast.StringLiteral */) { Option_v__ast__ComptTimeConstValue _t7; opt_ok(&(v__ast__ComptTimeConstValue[]) { string_to_sumtype_v__ast__ComptTimeConstValue(ADDR(string, (v__util__smart_quote((*expr._v__ast__StringLiteral).val, (*expr._v__ast__StringLiteral).is_raw)))) }, (Option*)(&_t7), sizeof(v__ast__ComptTimeConstValue)); return _t7; } - else if (expr._typ == 294 /* v.ast.CharLiteral */) { + else if (expr._typ == 295 /* v.ast.CharLiteral */) { Array_rune runes = string_runes((*expr._v__ast__CharLiteral).val); if (runes.len > 0) { Option_v__ast__ComptTimeConstValue _t8; @@ -54250,13 +54321,13 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp } return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - else if (expr._typ == 305 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 361 /* v.ast.ConstField */) { + else if (expr._typ == 306 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 362 /* v.ast.ConstField */) { Option_v__ast__ComptTimeConstValue _t10 = v__checker__Checker_eval_comptime_const_expr(c, (*(*expr._v__ast__Ident).obj._v__ast__ConstField).expr, nlevel + 1); return _t10; } } - else if (expr._typ == 292 /* v.ast.CastExpr */) { + else if (expr._typ == 293 /* v.ast.CastExpr */) { Option_v__ast__ComptTimeConstValue _t11 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__CastExpr).expr, nlevel + 1); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; @@ -54375,7 +54446,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp return _t40; } } - else if (expr._typ == 309 /* v.ast.InfixExpr */) { + else if (expr._typ == 310 /* v.ast.InfixExpr */) { Option_v__ast__ComptTimeConstValue _t43 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__InfixExpr).left, nlevel + 1); if (_t43.state != 0) { /*or block*/ Option_v__ast__ComptTimeConstValue _t44; @@ -55374,7 +55445,7 @@ VV_LOCAL_SYMBOL multi_return_bool_int_int v__checker__Checker_verify_vweb_params v__ast__Param param = ((v__ast__Param*)_t2.data)[_t4]; v__ast__TypeSymbol* param_sym = v__ast__Table_final_sym(c->table, param.typ); if (!(v__ast__TypeSymbol_is_string(param_sym) || v__ast__TypeSymbol_is_number(param_sym) || v__ast__TypeSymbol_is_float(param_sym) || param_sym->kind == v__ast__Kind__bool)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid type `"), 0xfe10, {.d_s = param_sym->name}}, {_SLIT("` for parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` in vweb app method `"), 0xfe10, {.d_s = node.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), param.pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid type `"), /*115 &string*/0xfe10, {.d_s = param_sym->name}}, {_SLIT("` for parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` in vweb app method `"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), param.pos); } } } @@ -55412,7 +55483,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_verify_all_vweb_routes(v__checker__Chec } if (f->return_type == typ_vweb_result && v__ast__Type_alias_eq(f->receiver.typ, (*(v__ast__Param*)/*ee elem_sym */array_get(m.params, 0)).typ) && string__eq(f->name, m.name) && !Array_v__ast__Attr_contains(f->attrs, _SLIT("post"))) { v__checker__Checker_change_current_file(c, f->source_file); - v__checker__Checker_warn(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("mismatched parameters count between vweb method `"), 0xfe10, {.d_s = sym_app->name}}, {_SLIT("."), 0xfe10, {.d_s = m.name}}, {_SLIT("` ("), 0xfe07, {.d_i32 = nargs}}, {_SLIT(") and route attribute "), 0xfe10, {.d_s = Array_v__ast__Attr_str(m.attrs)}}, {_SLIT(" ("), 0xfe07, {.d_i32 = nroute_attributes}}, {_SLIT(")"), 0, { .d_c = 0 }}})), f->pos); + v__checker__Checker_warn(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("mismatched parameters count between vweb method `"), /*115 &string*/0xfe10, {.d_s = sym_app->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = m.name}}, {_SLIT("` ("), /*100 &int*/0xfe07, {.d_i32 = nargs}}, {_SLIT(") and route attribute "), /*115 &[]v.ast.Attr*/0xfe10, {.d_s = Array_v__ast__Attr_str(m.attrs)}}, {_SLIT(" ("), /*100 &int*/0xfe07, {.d_i32 = nroute_attributes}}, {_SLIT(")"), 0, { .d_c = 0 }}})), f->pos); } } } @@ -55426,7 +55497,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__ bool _t1 = node->ct_skip; return _t1; } - if ((node->ct_expr)._typ == 305 /* v.ast.Ident */) { + if ((node->ct_expr)._typ == 306 /* v.ast.Ident */) { if (node->ct_opt) { if (Array_string_contains(_const_v__checker__valid_comptime_not_user_defined, (*node->ct_expr._v__ast__Ident).name)) { v__checker__Checker_error(c, _SLIT("optional `[if expression ?]` tags, can be used only for user defined identifiers"), node->pos); @@ -55439,7 +55510,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__ return _t2; } else { if (!Array_string_contains(_const_v__checker__valid_comptime_not_user_defined, (*node->ct_expr._v__ast__Ident).name)) { - v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`[if "), 0xfe10, {.d_s = (*node->ct_expr._v__ast__Ident).name}}, {_SLIT("]` is deprecated. Use `[if "), 0xfe10, {.d_s = (*node->ct_expr._v__ast__Ident).name}}, {_SLIT(" ?]` instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`[if "), /*115 &string*/0xfe10, {.d_s = (*node->ct_expr._v__ast__Ident).name}}, {_SLIT("]` is deprecated. Use `[if "), /*115 &string*/0xfe10, {.d_s = (*node->ct_expr._v__ast__Ident).name}}, {_SLIT(" ?]` instead"), 0, { .d_c = 0 }}})), node->pos); node->ct_skip = !Array_string_contains(c->pref->compile_defines, (*node->ct_expr._v__ast__Ident).name); node->ct_evaled = true; bool _t3 = node->ct_skip; @@ -55463,32 +55534,32 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__ } VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* c, v__ast__Expr cond, v__token__Pos pos) { - if (cond._typ == 289 /* v.ast.BoolLiteral */) { + if (cond._typ == 290 /* v.ast.BoolLiteral */) { bool _t1 = !(*cond._v__ast__BoolLiteral).val; return _t1; } - else if (cond._typ == 320 /* v.ast.ParExpr */) { + else if (cond._typ == 321 /* v.ast.ParExpr */) { bool _t2 = v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__ParExpr).expr, pos); return _t2; } - else if (cond._typ == 322 /* v.ast.PrefixExpr */) { + else if (cond._typ == 323 /* v.ast.PrefixExpr */) { if ((*cond._v__ast__PrefixExpr).op != v__token__Kind__not) { v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__PrefixExpr).pos); } bool _t3 = !v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__PrefixExpr).right, (*cond._v__ast__PrefixExpr).pos); return _t3; } - else if (cond._typ == 321 /* v.ast.PostfixExpr */) { + else if (cond._typ == 322 /* v.ast.PostfixExpr */) { if ((*cond._v__ast__PostfixExpr).op != v__token__Kind__question) { v__checker__Checker_error(c, _SLIT("invalid $if postfix operator"), (*cond._v__ast__PostfixExpr).pos); - } else if (((*cond._v__ast__PostfixExpr).expr)._typ == 305 /* v.ast.Ident */) { + } else if (((*cond._v__ast__PostfixExpr).expr)._typ == 306 /* v.ast.Ident */) { bool _t4 = !Array_string_contains(c->pref->compile_defines_all, (*(*cond._v__ast__PostfixExpr).expr._v__ast__Ident).name); return _t4; } else { v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__PostfixExpr).pos); } } - else if (cond._typ == 309 /* v.ast.InfixExpr */) { + else if (cond._typ == 310 /* v.ast.InfixExpr */) { if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__and)) { bool l = v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__InfixExpr).left, (*cond._v__ast__InfixExpr).pos); @@ -55503,19 +55574,19 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* return _t6; } else if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__key_is) || (*cond._v__ast__InfixExpr).op == (v__token__Kind__not_is)) { - if (((*cond._v__ast__InfixExpr).left)._typ == 331 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 331 /* v.ast.TypeNode */) { + if (((*cond._v__ast__InfixExpr).left)._typ == 332 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 332 /* v.ast.TypeNode */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*(*cond._v__ast__InfixExpr).right._v__ast__TypeNode).typ); if (sym->kind != v__ast__Kind__interface_) { v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).left); } bool _t7 = false; return _t7; - } else if (((*cond._v__ast__InfixExpr).left)._typ == 331 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 298 /* v.ast.ComptimeType */) { - v__ast__TypeNode left = /* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).left)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).left)._typ, 331) /*expected idx: 331, name: v.ast.TypeNode */ ; + } else if (((*cond._v__ast__InfixExpr).left)._typ == 332 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 299 /* v.ast.ComptimeType */) { + v__ast__TypeNode left = /* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).left)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).left)._typ, 332) /*expected idx: 332, name: v.ast.TypeNode */ ; v__ast__Type checked_type = v__checker__Checker_unwrap_generic(c, left.typ); bool _t8 = v__ast__Table_is_comptime_type(c->table, checked_type, (*(*cond._v__ast__InfixExpr).right._v__ast__ComptimeType)); return _t8; - } else if (((*cond._v__ast__InfixExpr).left)._typ == 325 /* v.ast.SelectorExpr */ || ((*cond._v__ast__InfixExpr).left)._typ == 331 /* v.ast.TypeNode */) { + } else if (((*cond._v__ast__InfixExpr).left)._typ == 326 /* v.ast.SelectorExpr */ || ((*cond._v__ast__InfixExpr).left)._typ == 332 /* v.ast.TypeNode */) { v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).left); bool _t9 = false; return _t9; @@ -55524,8 +55595,8 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* } } else if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__eq) || (*cond._v__ast__InfixExpr).op == (v__token__Kind__ne)) { - if (((*cond._v__ast__InfixExpr).left)._typ == 325 /* v.ast.SelectorExpr */ && ((*cond._v__ast__InfixExpr).right)._typ == 310 /* v.ast.IntegerLiteral */) { - } else if (((*cond._v__ast__InfixExpr).left)._typ == 305 /* v.ast.Ident */) { + if (((*cond._v__ast__InfixExpr).left)._typ == 326 /* v.ast.SelectorExpr */ && ((*cond._v__ast__InfixExpr).right)._typ == 311 /* v.ast.IntegerLiteral */) { + } else if (((*cond._v__ast__InfixExpr).left)._typ == 306 /* v.ast.Ident */) { v__ast__Type left_type = v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).left); v__ast__Type right_type = v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).right); Option_v__ast__Expr _t10 = v__checker__Checker_find_definition(c, (*(*cond._v__ast__InfixExpr).left._v__ast__Ident)); @@ -55540,20 +55611,20 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* if (!v__checker__Checker_check_types(c, right_type, left_type)) { string left_name = v__ast__Table_type_to_str(c->table, left_type); string right_name = v__ast__Table_type_to_str(c->table, right_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), 0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*cond._v__ast__InfixExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = left_name}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = right_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*cond._v__ast__InfixExpr).pos); } bool different = !string__eq(v__ast__Expr_str(expr), v__ast__Expr_str((*cond._v__ast__InfixExpr).right)); bool _t12 = ((*cond._v__ast__InfixExpr).op == v__token__Kind__eq ? (different) : (!different)); return _t12; } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid `$if` condition: "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( ((*cond._v__ast__InfixExpr).left)._typ ))}}, {_SLIT("1"), 0, { .d_c = 0 }}})), (*cond._v__ast__InfixExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid `$if` condition: "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( ((*cond._v__ast__InfixExpr).left)._typ ))}}, {_SLIT("1"), 0, { .d_c = 0 }}})), (*cond._v__ast__InfixExpr).pos); } } else { v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__InfixExpr).pos); }; } - else if (cond._typ == 305 /* v.ast.Ident */) { + else if (cond._typ == 306 /* v.ast.Ident */) { string cname = (*cond._v__ast__Ident).name; if (Array_string_contains(_const_v__checker__valid_comptime_if_os, cname)) { bool is_os_target_different = false; @@ -55666,9 +55737,9 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* return _t36; } v__ast__Type typ = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, cond)); - if (((*cond._v__ast__Ident).obj)._typ != 363 /* v.ast.Var */ && ((*cond._v__ast__Ident).obj)._typ != 361 /* v.ast.ConstField */ && ((*cond._v__ast__Ident).obj)._typ != 362 /* v.ast.GlobalField */) { + if (((*cond._v__ast__Ident).obj)._typ != 364 /* v.ast.Var */ && ((*cond._v__ast__Ident).obj)._typ != 362 /* v.ast.ConstField */ && ((*cond._v__ast__Ident).obj)._typ != 363 /* v.ast.GlobalField */) { if (!c->inside_ct_attr) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown var: `"), 0xfe10, {.d_s = cname}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown var: `"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } bool _t37 = false; return _t37; @@ -55684,13 +55755,13 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_comptime_if_branch(v__checker__Checker* v__ast__Expr expr = (*(v__ast__Expr*)_t38.data); if (!v__checker__Checker_check_types(c, typ, _const_v__ast__bool_type)) { string type_name = v__ast__Table_type_to_str(c->table, typ); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-bool type `"), 0xfe10, {.d_s = type_name}}, {_SLIT("` used as $if condition"), 0, { .d_c = 0 }}})), (*cond._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-bool type `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("` used as $if condition"), 0, { .d_c = 0 }}})), (*cond._v__ast__Ident).pos); } - bool _t40 = !(/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)._v__ast__BoolLiteral,(expr)._typ, 289) /*expected idx: 289, name: v.ast.BoolLiteral */ ).val; + bool _t40 = !(/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)._v__ast__BoolLiteral,(expr)._typ, 290) /*expected idx: 290, name: v.ast.BoolLiteral */ ).val; return _t40; } } - else if (cond._typ == 296 /* v.ast.ComptimeCall */) { + else if (cond._typ == 297 /* v.ast.ComptimeCall */) { if ((*cond._v__ast__ComptimeCall).is_pkgconfig) { Option_v__pkgconfig__Main_ptr _t41 = v__pkgconfig__main(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){string_clone((*cond._v__ast__ComptimeCall).args_var)}))); if (_t41.state != 0) { /*or block*/ @@ -55726,7 +55797,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra if (node->elem_type != 0) { v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, node->elem_type); if (elem_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct elem_info = /* as */ *(v__ast__Struct*)__as_cast((elem_sym->info)._v__ast__Struct,(elem_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct elem_info = /* as */ *(v__ast__Struct*)__as_cast((elem_sym->info)._v__ast__Struct,(elem_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (elem_info.generic_types.len > 0 && elem_info.concrete_types.len == 0 && !v__ast__Type_has_flag(node->elem_type, v__ast__TypeFlag__generic)) { if (c->table->cur_concrete_types.len == 0) { v__checker__Checker_error(c, _SLIT("generic struct must specify type parameter, e.g. Foo"), node->elem_type_pos); @@ -55859,7 +55930,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra c->expected_type = elem_type; continue; } - if ((expr)->_typ != 331 /* v.ast.TypeNode */) { + if ((expr)->_typ != 332 /* v.ast.TypeNode */) { if (v__ast__Table_type_kind(c->table, elem_type) == v__ast__Kind__interface_) { if (v__checker__Checker_type_implements(c, typ, elem_type, v__ast__Expr_pos(/*rec*/*expr))) { continue; @@ -55868,7 +55939,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra Option_void _t8 = v__checker__Checker_check_expected(c, typ, elem_type); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { IError err = _t8.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid array element: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid array element: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(/*rec*/*expr)); ; } @@ -55895,11 +55966,11 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra i64 fixed_size = ((i64)(0)); v__ast__Expr init_expr = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, 0)); v__checker__Checker_expr(c, init_expr); - if (init_expr._typ == 310 /* v.ast.IntegerLiteral */) { + if (init_expr._typ == 311 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*init_expr._v__ast__IntegerLiteral).val); } - else if (init_expr._typ == 305 /* v.ast.Ident */) { - if (((*init_expr._v__ast__Ident).obj)._typ == 361 /* v.ast.ConstField */) { + else if (init_expr._typ == 306 /* v.ast.Ident */) { + if (((*init_expr._v__ast__Ident).obj)._typ == 362 /* v.ast.ConstField */) { Option_v__ast__ComptTimeConstValue _t9; if (_t9 = v__checker__Checker_eval_comptime_const_expr(c, (*(*init_expr._v__ast__Ident).obj._v__ast__ConstField).expr, 0), _t9.state == 0) { v__ast__ComptTimeConstValue comptime_value = *(v__ast__ComptTimeConstValue*)_t9.data; @@ -55912,10 +55983,10 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra fixed_size = (*(i64*)_t10.data); } } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-constant array bound `"), 0xfe10, {.d_s = (*init_expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*init_expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-constant array bound `"), /*115 &string*/0xfe10, {.d_s = (*init_expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*init_expr._v__ast__Ident).pos); } } - else if (init_expr._typ == 309 /* v.ast.InfixExpr */) { + else if (init_expr._typ == 310 /* v.ast.InfixExpr */) { Option_v__ast__ComptTimeConstValue _t11; if (_t11 = v__checker__Checker_eval_comptime_const_expr(c, init_expr, 0), _t11.state == 0) { v__ast__ComptTimeConstValue comptime_value = *(v__ast__ComptTimeConstValue*)_t11.data; @@ -55934,7 +56005,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra } ; if (fixed_size <= 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("fixed size cannot be zero or negative (fixed_size: "), 0xfe09, {.d_i64 = fixed_size}}, {_SLIT(")"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(init_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("fixed size cannot be zero or negative (fixed_size: "), /*100 &i64*/0xfe09, {.d_i64 = fixed_size}}, {_SLIT(")"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(init_expr)); } int idx = v__ast__Table_find_or_register_array_fixed(c->table, node->elem_type, ((int)(fixed_size)), init_expr); if (v__ast__Type_has_flag(node->elem_type, v__ast__TypeFlag__generic)) { @@ -55953,7 +56024,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra VV_LOCAL_SYMBOL void v__checker__Checker_check_array_init_para_type(v__checker__Checker* c, string para, v__ast__Expr expr, v__token__Pos pos) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__checker__Checker_expr(c, expr)); if (!(sym->kind == v__ast__Kind__int || sym->kind == v__ast__Kind__int_literal)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array "), 0xfe10, {.d_s = para}}, {_SLIT(" needs to be an int"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array "), /*115 &string*/0xfe10, {.d_s = para}}, {_SLIT(" needs to be an int"), 0, { .d_c = 0 }}})), pos); } } @@ -55976,7 +56047,7 @@ v__ast__Type v__checker__Checker_map_init(v__checker__Checker* c, v__ast__MapIni return _t1; } else { if (sym->kind == v__ast__Kind__struct_) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`{}` can not be used for initialising empty structs any more. Use `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, c->expected_type)}}, {_SLIT("{}` instead."), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`{}` can not be used for initialising empty structs any more. Use `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, c->expected_type)}}, {_SLIT("{}` instead."), 0, { .d_c = 0 }}})), node->pos); } else { v__checker__Checker_error(c, _SLIT("invalid empty map initialisation syntax, use e.g. map[string]int{} instead"), node->pos); } @@ -55989,12 +56060,12 @@ v__ast__Type v__checker__Checker_map_init(v__checker__Checker* c, v__ast__MapIni if (info.value_type != 0) { v__ast__TypeSymbol* val_sym = v__ast__Table_sym(c->table, info.value_type); if (val_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct val_info = /* as */ *(v__ast__Struct*)__as_cast((val_sym->info)._v__ast__Struct,(val_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct val_info = /* as */ *(v__ast__Struct*)__as_cast((val_sym->info)._v__ast__Struct,(val_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (val_info.generic_types.len > 0 && val_info.concrete_types.len == 0 && !v__ast__Type_has_flag(info.value_type, v__ast__TypeFlag__generic)) { if (c->table->cur_concrete_types.len == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("generic struct `"), 0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("generic struct `"), /*115 &string*/0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("generic struct `"), 0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("generic struct `"), /*115 &string*/0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -56050,12 +56121,12 @@ v__ast__Type v__checker__Checker_map_init(v__checker__Checker* c, v__ast__MapIni array_push((array*)&node->val_types, _MOV((v__ast__Type[]){ val_type })); if (!v__checker__Checker_check_types(c, key_type, key0_type) || (i == 0 && v__ast__Type_is_number(key_type) && v__ast__Type_is_number(key0_type) && !v__ast__Type_alias_eq(key0_type, v__ast__mktyp(key_type)))) { string msg = v__checker__Checker_expected_msg(c, key_type, key0_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid map key: "), 0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(key)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid map key: "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(key)); same_key_type = false; } if (!v__checker__Checker_check_types(c, val_type, val0_type) || (i == 0 && v__ast__Type_is_number(val_type) && v__ast__Type_is_number(val0_type) && !v__ast__Type_alias_eq(val0_type, v__ast__mktyp(val_type)))) { string msg = v__checker__Checker_expected_msg(c, val_type, val0_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid map value: "), 0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(val)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid map value: "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(val)); } } if (same_key_type) { @@ -56124,7 +56195,7 @@ v__ast__Scope* prev_fn_scope; if (node->language == v__ast__Language__v && !c->is_builtin_mod && !node->is_anon) { v__checker__Checker_check_valid_snake_case(c, node->name, _SLIT("function name"), node->pos); if (!node->is_method && string__eq(node->mod, _SLIT("main")) && _IN_MAP(ADDR(string, node->short_name), ADDR(map, c->table->builtin_pub_fns))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot redefine builtin public function `"), 0xfe10, {.d_s = node->short_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot redefine builtin public function `"), /*115 &string*/0xfe10, {.d_s = node->short_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (string__eq(node->name, _SLIT("main.main"))) { @@ -56135,18 +56206,18 @@ v__ast__Scope* prev_fn_scope; if (_t3 = Array_v__ast__Attr_find_comptime_define(node->attrs), _t3.state == 0) { int ct_attr_idx = *(int*)_t3.data; string sexpr = v__ast__Expr_str((*(v__ast__Attr*)/*ee elem_sym */array_get(node->attrs, ct_attr_idx)).ct_expr); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only functions that do NOT return values can have `[if "), 0xfe10, {.d_s = sexpr}}, {_SLIT("]` tags"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only functions that do NOT return values can have `[if "), /*115 &string*/0xfe10, {.d_s = sexpr}}, {_SLIT("]` tags"), 0, { .d_c = 0 }}})), node->pos); } if (node->generic_names.len > 0) { v__ast__TypeSymbol* gs = v__ast__Table_sym(c->table, node->return_type); - if ((gs->info)._typ == 455 /* v.ast.Struct */) { + if ((gs->info)._typ == 456 /* v.ast.Struct */) { if ((*gs->info._v__ast__Struct).is_generic && !v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__generic)) { v__checker__Checker_error(c, _SLIT("return generic struct in fn declaration must specify the generic type names, e.g. Foo"), node->return_type_pos); } } } v__ast__TypeSymbol* return_sym = v__ast__Table_sym(c->table, node->return_type); - if ((return_sym->info)._typ == 481 /* v.ast.MultiReturn */) { + if ((return_sym->info)._typ == 482 /* v.ast.MultiReturn */) { for (int _t4 = 0; _t4 < (*return_sym->info._v__ast__MultiReturn).types.len; ++_t4) { v__ast__Type multi_type = ((v__ast__Type*)(*return_sym->info._v__ast__MultiReturn).types.data)[_t4]; v__ast__TypeSymbol* multi_sym = v__ast__Table_sym(c->table, multi_type); @@ -56181,7 +56252,7 @@ v__ast__Scope* prev_fn_scope; v__checker__Checker_error(c, _SLIT("cannot define method on multi-value"), node->method_type_pos); } if (sym->name.len == 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->receiver_pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->receiver_pos); // Defer begin if (v__checker__Checker_fn_decl_defer_0) { c->stmt_level = prev_stmt_level; @@ -56197,19 +56268,19 @@ v__ast__Scope* prev_fn_scope; return; } if (sym->kind == v__ast__Kind__interface_ && v__ast__TypeSymbol_has_method(sym, node->name)) { - if ((sym->info)._typ == 473 /* v.ast.Interface */) { + if ((sym->info)._typ == 474 /* v.ast.Interface */) { if (v__ast__Interface_has_method(&(*sym->info._v__ast__Interface), node->name)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` cannot implement its own interface method `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` cannot implement its own interface method `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { Option_v__ast__StructField _t6; if (_t6 = v__ast__Table_find_field(c->table, sym, node->name), _t6.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t6.data; v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, field.typ); if (field_sym->kind == v__ast__Kind__function) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` has both field and method named `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has both field and method named `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (string__eq(node->name, _SLIT("free"))) { @@ -56218,7 +56289,7 @@ v__ast__Scope* prev_fn_scope; } if (!v__ast__Type_is_ptr(node->receiver.typ)) { string tname = string_after_char(sym->name, '.'); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`.free()` methods should be defined on either a `(mut x &"), 0xfe10, {.d_s = tname}}, {_SLIT(")`, or a `(x &"), 0xfe10, {.d_s = tname}}, {_SLIT(")` receiver"), 0, { .d_c = 0 }}})), node->receiver_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`.free()` methods should be defined on either a `(mut x &"), /*115 &string*/0xfe10, {.d_s = tname}}, {_SLIT(")`, or a `(x &"), /*115 &string*/0xfe10, {.d_s = tname}}, {_SLIT(")` receiver"), 0, { .d_c = 0 }}})), node->receiver_pos); } if (node->params.len != 1) { v__checker__Checker_error(c, _SLIT("`.free()` methods should have 0 arguments"), node->pos); @@ -56228,7 +56299,7 @@ v__ast__Scope* prev_fn_scope; if (node->method_idx < sym->methods.len) { (*(v__ast__Fn*)/*ee elem_sym */array_get(sym->methods, node->method_idx)).source_fn = ((voidptr)(node)); } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method index: "), 0xfe07, {.d_i32 = node->method_idx}}, {_SLIT(" >= sym.methods.len: "), 0xfe07, {.d_i32 = sym->methods.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method index: "), /*100 &int*/0xfe07, {.d_i32 = node->method_idx}}, {_SLIT(" >= sym.methods.len: "), /*100 &int*/0xfe07, {.d_i32 = sym->methods.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } } if (node->language == v__ast__Language__v) { @@ -56254,7 +56325,7 @@ v__ast__Scope* prev_fn_scope; ; if (Array_string_contains(_const_v__checker__reserved_type_names, param->name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), 0xfe10, {.d_s = param->name}}, {_SLIT("` as a parameter name"), 0, { .d_c = 0 }}})), param->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = param->name}}, {_SLIT("` as a parameter name"), 0, { .d_c = 0 }}})), param->pos); } if (v__ast__Type_has_flag(param->typ, v__ast__TypeFlag__optional)) { v__checker__Checker_error(c, _SLIT("optional type argument is not supported currently"), param->type_pos); @@ -56262,7 +56333,7 @@ v__ast__Scope* prev_fn_scope; if (!v__ast__Type_is_ptr(param->typ)) { v__ast__TypeSymbol* arg_typ_sym = v__ast__Table_sym(c->table, param->typ); if (arg_typ_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((arg_typ_sym->info)._v__ast__Struct,(arg_typ_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((arg_typ_sym->info)._v__ast__Struct,(arg_typ_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (info.is_heap) { Option_v__ast__Var_ptr _t9 = v__ast__Scope_find_var(node->scope, param->name); if (_t9.state != 0) { /*or block*/ @@ -56277,12 +56348,12 @@ v__ast__Scope* prev_fn_scope; v__checker__Checker_error(c, _SLIT("generic struct in fn declaration must specify the generic type names, e.g. Foo"), param->type_pos); } } else if (arg_typ_sym->kind == v__ast__Kind__interface_) { - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((arg_typ_sym->info)._v__ast__Interface,(arg_typ_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((arg_typ_sym->info)._v__ast__Interface,(arg_typ_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; if (info.generic_types.len > 0 && !v__ast__Type_has_flag(param->typ, v__ast__TypeFlag__generic) && info.concrete_types.len == 0) { v__checker__Checker_error(c, _SLIT("generic interface in fn declaration must specify the generic type names, e.g. Foo"), param->type_pos); } } else if (arg_typ_sym->kind == v__ast__Kind__sum_type) { - v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((arg_typ_sym->info)._v__ast__SumType,(arg_typ_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((arg_typ_sym->info)._v__ast__SumType,(arg_typ_sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ; if (info.generic_types.len > 0 && !v__ast__Type_has_flag(param->typ, v__ast__TypeFlag__generic) && info.concrete_types.len == 0) { v__checker__Checker_error(c, _SLIT("generic sumtype in fn declaration must specify the generic type names, e.g. Foo"), param->type_pos); } @@ -56345,11 +56416,11 @@ v__ast__Scope* prev_fn_scope; } else if ((*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 1)).is_mut) { v__checker__Checker_error(c, _SLIT("argument cannot be `mut` for operator overloading"), node->pos); } else if (!v__checker__Checker_check_same_type_ignoring_pointers(c, node->receiver.typ, (*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 1)).typ)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = receiver_sym->name}}, {_SLIT("` not `"), 0xfe10, {.d_s = param_sym->name}}, {_SLIT("` - both operands must be the same type for operator overloading"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 1)).type_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = receiver_sym->name}}, {_SLIT("` not `"), /*115 &string*/0xfe10, {.d_s = param_sym->name}}, {_SLIT("` - both operands must be the same type for operator overloading"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(node->params, 1)).type_pos); } else if ((string__eq(node->name, _SLIT("<")) || string__eq(node->name, _SLIT("=="))) && !v__ast__Type_alias_eq(node->return_type, _const_v__ast__bool_type)) { v__checker__Checker_error(c, _SLIT("operator comparison methods should return `bool`"), node->pos); } else if (v__ast__TypeSymbol_is_primitive(parent_sym)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot define operator methods on type alias for `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot define operator methods on type alias for `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -56359,7 +56430,7 @@ v__ast__Scope* prev_fn_scope; if (!c->pref->is_test) { for (int _t11 = 0; _t11 < node->stmts.len; ++_t11) { v__ast__Stmt st = ((v__ast__Stmt*)node->stmts.data)[_t11]; - if ((st)._typ == 336 /* v.ast.AssertStmt */) { + if ((st)._typ == 337 /* v.ast.AssertStmt */) { v__checker__Checker_warn(c, _SLIT("tests will not be run, because filename does not end with `_test.v`"), node->pos); break; } @@ -56374,7 +56445,13 @@ v__ast__Scope* prev_fn_scope; } c->expected_type = _const_v__ast__void_type; c->table->cur_fn = node; - if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__optional) && (node->stmts.len == 0 || ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 356 /* v.ast.Return */)) { + if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__optional) && (node->stmts.len == 0 || ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 357 /* v.ast.Return */)) { + v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->return_type); + if (sym->kind == v__ast__Kind__void) { + array_push((array*)&node->stmts, _MOV((v__ast__Stmt[]){ v__ast__Return_to_sumtype_v__ast__Stmt(ADDR(v__ast__Return, (((v__ast__Return){.pos = node->pos,.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.types = __new_array(0, 0, sizeof(v__ast__Type)),})))) })); + } + } + if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__result) && (node->stmts.len == 0 || ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 357 /* v.ast.Return */)) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->return_type); if (sym->kind == v__ast__Kind__void) { array_push((array*)&node->stmts, _MOV((v__ast__Stmt[]){ v__ast__Return_to_sumtype_v__ast__Stmt(ADDR(v__ast__Return, (((v__ast__Return){.pos = node->pos,.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.types = __new_array(0, 0, sizeof(v__ast__Type)),})))) })); @@ -56389,7 +56466,7 @@ v__ast__Scope* prev_fn_scope; if (c->inside_anon_fn) { v__checker__Checker_error(c, _SLIT("missing return at the end of an anonymous function"), node->pos); } else if (!Array_v__ast__Attr_contains(node->attrs, _SLIT("_naked"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("missing return at end of function `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("missing return at end of function `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } node->source_file = c->file; @@ -56438,14 +56515,14 @@ bool keep_inside_anon; Option_v__ast__Var_ptr _t3 = v__ast__Scope_find_var(node->decl.scope->parent, var->name); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected checker error: cannot find parent of inherited variable `"), 0xfe10, {.d_s = var->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected checker error: cannot find parent of inherited variable `"), /*115 &string*/0xfe10, {.d_s = var->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } v__ast__Var* parent_var = (*(v__ast__Var**)_t3.data); if (var->is_mut && !parent_var->is_mut) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("original `"), 0xfe10, {.d_s = parent_var->name}}, {_SLIT("` is immutable, declare it with `mut` to make it mutable"), 0, { .d_c = 0 }}})), var->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("original `"), /*115 &string*/0xfe10, {.d_s = parent_var->name}}, {_SLIT("` is immutable, declare it with `mut` to make it mutable"), 0, { .d_c = 0 }}})), var->pos); } var->typ = parent_var->typ; } @@ -56478,21 +56555,21 @@ v__ast__Type v__checker__Checker_call_expr(v__checker__Checker* c, v__ast__CallE if (!v__ast__Type_alias_eq(arg.typ, _const_v__ast__string_type)) { continue; } - if ((arg.expr)._typ == 305 /* v.ast.Ident */ || (arg.expr)._typ == 329 /* v.ast.StringLiteral */ || (arg.expr)._typ == 325 /* v.ast.SelectorExpr */) { + if ((arg.expr)._typ == 306 /* v.ast.Ident */ || (arg.expr)._typ == 330 /* v.ast.StringLiteral */ || (arg.expr)._typ == 326 /* v.ast.SelectorExpr */) { continue; } (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, i)).is_tmp_autofree = true; } - if (v__ast__Type_alias_eq(node->receiver_type, _const_v__ast__string_type) && !((node->left)._typ == 305 /* v.ast.Ident */ || (node->left)._typ == 329 /* v.ast.StringLiteral */ || (node->left)._typ == 325 /* v.ast.SelectorExpr */)) { + if (v__ast__Type_alias_eq(node->receiver_type, _const_v__ast__string_type) && !((node->left)._typ == 306 /* v.ast.Ident */ || (node->left)._typ == 330 /* v.ast.StringLiteral */ || (node->left)._typ == 326 /* v.ast.SelectorExpr */)) { node->free_receiver = true; } } c->expected_or_type = v__ast__Type_clear_flag(node->return_type, v__ast__TypeFlag__optional); v__checker__Checker_stmts_ending_with_expression(c, node->or_block.stmts); c->expected_or_type = _const_v__ast__void_type; - if (node->or_block.kind == v__ast__OrKind__propagate && !v__ast__Type_has_flag(c->table->cur_fn->return_type, v__ast__TypeFlag__optional) && !c->inside_const) { + if (node->or_block.kind == v__ast__OrKind__propagate_option && !v__ast__Type_has_flag(c->table->cur_fn->return_type, v__ast__TypeFlag__optional) && !c->inside_const) { if (!c->table->cur_fn->is_main) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the optional call, `"), 0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an optional"), 0, { .d_c = 0 }}})), node->or_block.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("to propagate the optional call, `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` must return an optional"), 0, { .d_c = 0 }}})), node->or_block.pos); } } v__ast__Type _t2 = typ; @@ -56542,12 +56619,12 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__Type typ = v__checker__Checker_expr(c, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr); v__ast__TypeSymbol* tsym = v__ast__Table_sym(c->table, typ); if (!string_starts_with(tsym->name, _SLIT("Promise<"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS.await: first argument must be a promise, got `"), 0xfe10, {.d_s = tsym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS.await: first argument must be a promise, got `"), /*115 &string*/0xfe10, {.d_s = tsym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t5 = _const_v__ast__void_type; return _t5; } c->table->cur_fn->has_await = true; - if (tsym->info._typ == 455 /* v.ast.Struct */) { + if (tsym->info._typ == 456 /* v.ast.Struct */) { v__ast__Type ret_type = (*(v__ast__Type*)/*ee elem_sym */array_get((*tsym->info._v__ast__Struct).concrete_types, 0)); ret_type = v__ast__Type_set_flag(ret_type, v__ast__TypeFlag__optional); node->return_type = ret_type; @@ -56572,14 +56649,14 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp return _t8; } v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr; - if ((expr)._typ == 331 /* v.ast.TypeNode */) { + if ((expr)._typ == 332 /* v.ast.TypeNode */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*expr._v__ast__TypeNode).typ); if (!v__ast__Table_known_type(c->table, sym->name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else { string typ = charptr_vstring_literal( /* v.ast.Expr */ v_typeof_sumtype_v__ast__Expr( (expr)._typ )); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: first argument needs to be a type, got `"), 0xfe10, {.d_s = typ}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: first argument needs to be a type, got `"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t9 = _const_v__ast__void_type; return _t9; } @@ -56588,7 +56665,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp if (!v__ast__Type_alias_eq((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 1)).typ, _const_v__ast__string_type)) { v__checker__Checker_error(c, _SLIT("json.decode: second argument needs to be a string"), node->pos); } - v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast((expr)._v__ast__TypeNode,(expr)._typ, 331) /*expected idx: 331, name: v.ast.TypeNode */ ; + v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast((expr)._v__ast__TypeNode,(expr)._typ, 332) /*expected idx: 332, name: v.ast.TypeNode */ ; v__ast__Type ret_type = v__ast__Type_set_flag(typ.typ, v__ast__TypeFlag__optional); node->return_type = ret_type; v__ast__Type _t10 = ret_type; @@ -56597,17 +56674,17 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__Fn func = ((v__ast__Fn){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}); bool found = false; bool found_in_args = false; - if ((node->left)._typ == 283 /* v.ast.AnonFn */) { + if ((node->left)._typ == 284 /* v.ast.AnonFn */) { node->name = _SLIT(""); v__checker__Checker_expr(c, node->left); if (!v__ast__Type_alias_eq((*node->left._v__ast__AnonFn).typ, ((v__ast__Type)(0)))) { v__ast__TypeSymbol* anon_fn_sym = v__ast__Table_sym(c->table, (*node->left._v__ast__AnonFn).typ); - func = (/* as */ *(v__ast__FnType*)__as_cast((anon_fn_sym->info)._v__ast__FnType,(anon_fn_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ).func; + func = (/* as */ *(v__ast__FnType*)__as_cast((anon_fn_sym->info)._v__ast__FnType,(anon_fn_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ).func; found = true; } } if (!found && !string_contains(fn_name, _SLIT(".")) && !string__eq(node->mod, _SLIT("builtin"))) { - string name_prefixed = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->mod}}, {_SLIT("."), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name_prefixed = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_v__ast__Fn _t11; if (_t11 = v__ast__Table_find_fn(c->table, name_prefixed), _t11.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t11.data; @@ -56617,14 +56694,14 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp (*(v__ast__Fn*)map_get((map*)&c->table->fns, &(string[]){name_prefixed}, &(v__ast__Fn[]){ (v__ast__Fn){.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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,} })).usages++; } } - if (!found && (node->left)._typ == 308 /* v.ast.IndexExpr */) { + if (!found && (node->left)._typ == 309 /* v.ast.IndexExpr */) { v__checker__Checker_expr(c, node->left); - v__ast__IndexExpr expr = /* as */ *(v__ast__IndexExpr*)__as_cast((node->left)._v__ast__IndexExpr,(node->left)._typ, 308) /*expected idx: 308, name: v.ast.IndexExpr */ ; + v__ast__IndexExpr expr = /* as */ *(v__ast__IndexExpr*)__as_cast((node->left)._v__ast__IndexExpr,(node->left)._typ, 309) /*expected idx: 309, name: v.ast.IndexExpr */ ; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, expr.left_type); if (sym->kind == v__ast__Kind__array) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, info.elem_type); - if ((elem_sym->info)._typ == 482 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 483 /* v.ast.FnType */) { node->return_type = (*elem_sym->info._v__ast__FnType).func.return_type; v__ast__Type _t12 = (*elem_sym->info._v__ast__FnType).func.return_type; return _t12; @@ -56632,9 +56709,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("cannot call the element of the array, it is not a function"), node->pos); } } else if (sym->kind == v__ast__Kind__map) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; v__ast__TypeSymbol* value_sym = v__ast__Table_sym(c->table, info.value_type); - if ((value_sym->info)._typ == 482 /* v.ast.FnType */) { + if ((value_sym->info)._typ == 483 /* v.ast.FnType */) { node->return_type = (*value_sym->info._v__ast__FnType).func.return_type; v__ast__Type _t13 = (*value_sym->info._v__ast__FnType).func.return_type; return _t13; @@ -56642,9 +56719,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("cannot call the value of the map, it is not a function"), node->pos); } } else if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, info.elem_type); - if ((elem_sym->info)._typ == 482 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 483 /* v.ast.FnType */) { node->return_type = (*elem_sym->info._v__ast__FnType).func.return_type; v__ast__Type _t14 = (*elem_sym->info._v__ast__FnType).func.return_type; return _t14; @@ -56656,12 +56733,12 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__Type _t15 = _const_v__ast__string_type; return _t15; } - if (!found && (node->left)._typ == 291 /* v.ast.CallExpr */) { + if (!found && (node->left)._typ == 292 /* v.ast.CallExpr */) { v__checker__Checker_expr(c, node->left); - v__ast__CallExpr expr = /* as */ *(v__ast__CallExpr*)__as_cast((node->left)._v__ast__CallExpr,(node->left)._typ, 291) /*expected idx: 291, name: v.ast.CallExpr */ ; + v__ast__CallExpr expr = /* as */ *(v__ast__CallExpr*)__as_cast((node->left)._v__ast__CallExpr,(node->left)._typ, 292) /*expected idx: 292, name: v.ast.CallExpr */ ; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, expr.return_type); if (sym->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; node->return_type = info.func.return_type; found = true; func = info.func; @@ -56686,7 +56763,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } } if (!found && c->pref->is_vsh) { - string os_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("os."), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string os_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("os."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_v__ast__Fn _t17; if (_t17 = v__ast__Table_find_fn(c->table, os_name), _t17.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t17.data; @@ -56709,12 +56786,12 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp Option_v__ast__ScopeObject _t19; if (_t19 = v__ast__Scope_find(node->scope, node->name), _t19.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t19.data; - if (obj._typ == 362 /* v.ast.GlobalField */) { + if (obj._typ == 363 /* v.ast.GlobalField */) { typ = (*obj._v__ast__GlobalField).typ; node->is_fn_var = true; node->fn_var_type = typ; } - else if (obj._typ == 363 /* v.ast.Var */) { + else if (obj._typ == 364 /* v.ast.Var */) { v__ast__Type _t20; /* if prepend */ if ((*obj._v__ast__Var).smartcasts.len != 0) { _t20 = (*(v__ast__Type*)array_last((*obj._v__ast__Var).smartcasts)); @@ -56733,14 +56810,14 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp if (typ != 0) { v__ast__TypeSymbol* generic_vts = v__ast__Table_final_sym(c->table, typ); if (generic_vts->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((generic_vts->info)._v__ast__FnType,(generic_vts->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((generic_vts->info)._v__ast__FnType,(generic_vts->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; func = info.func; found = true; found_in_args = true; } else { v__ast__TypeSymbol* vts = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, typ)); if (vts->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((vts->info)._v__ast__FnType,(vts->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((vts->info)._v__ast__FnType,(vts->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; func = info.func; found = true; found_in_args = true; @@ -56756,7 +56833,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*(obj.typ))); if (sym->kind == v__ast__Kind__function) { found = true; - func = (/* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ).func; + func = (/* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ).func; } } } @@ -56787,12 +56864,12 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } } v__util__Suggestion suggestion = v__util__new_suggestion(fn_name, mod_func_names); - v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown function: "), 0xfe10, {.d_s = fn_name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))), node->pos); + v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown function: "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))), node->pos); v__ast__Type _t28 = _const_v__ast__void_type; return _t28; } } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown function: "), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown function: "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t29 = _const_v__ast__void_type; return _t29; } @@ -56800,17 +56877,17 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp node->is_ctor_new = func.is_ctor_new; if (!found_in_args) { if (v__ast__Scope_known_var(node->scope, fn_name)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("ambiguous call to: `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`, may refer to fn `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("` or variable `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("ambiguous call to: `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`, may refer to fn `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("` or variable `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (!func.is_pub && func.language == v__ast__Language__v && func.name.len > 0 && func.mod.len > 0 && !string__eq(func.mod, c->mod)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("function `"), 0xfe10, {.d_s = func.name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("function `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } if (!isnil(c->table->cur_fn) && !c->table->cur_fn->is_deprecated && func.is_deprecated) { v__checker__Checker_deprecate_fnmethod(c, _SLIT("function"), func.name, func, *node); } if (func.is_unsafe && !c->inside_unsafe && (func.language != v__ast__Language__c || ((string_at(func.name, 2) == 'm' || string_at(func.name, 2) == 's') && string__eq(func.mod, _SLIT("builtin"))))) { - v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("function `"), 0xfe10, {.d_s = func.name}}, {_SLIT("` must be called from an `unsafe` block"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("function `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("` must be called from an `unsafe` block"), 0, { .d_c = 0 }}})), node->pos); } node->is_keep_alive = func.is_keep_alive; if (!string__eq(func.mod, _SLIT("builtin")) && func.language == v__ast__Language__v && func.no_body && !c->pref->translated && !c->file->is_translated && !func.is_unsafe) { @@ -56818,7 +56895,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } if (node->concrete_types.len > 0 && func.generic_names.len > 0 && node->concrete_types.len != func.generic_names.len) { string plural = (func.generic_names.len == 1 ? (_SLIT("")) : (_SLIT("s"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = func.generic_names.len}}, {_SLIT(" generic parameter"), 0xfe10, {.d_s = plural}}, {_SLIT(", got "), 0xfe07, {.d_i32 = node->concrete_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->concrete_list_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = func.generic_names.len}}, {_SLIT(" generic parameter"), /*115 &string*/0xfe10, {.d_s = plural}}, {_SLIT(", got "), /*100 &int*/0xfe07, {.d_i32 = node->concrete_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->concrete_list_pos); } for (int _t30 = 0; _t30 < node->concrete_types.len; ++_t30) { v__ast__Type concrete_type = ((v__ast__Type*)node->concrete_types.data)[_t30]; @@ -56854,9 +56931,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__CallArg arg = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)); v__checker__Checker_check_expr_opt_call(c, arg.expr, arg.typ); if (v__ast__Type_is_void(arg.typ)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = fn_name}}, {_SLIT("` can not print void expressions"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("` can not print void expressions"), 0, { .d_c = 0 }}})), node->pos); } else if (v__ast__Type_alias_eq(arg.typ, _const_v__ast__char_type) && v__ast__Type_nr_muls(arg.typ) == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = fn_name}}, {_SLIT("` cannot print type `char` directly, print its address or cast it to an integer instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("` cannot print type `char` directly, print its address or cast it to an integer instead"), 0, { .d_c = 0 }}})), node->pos); } v__checker__Checker_fail_if_unreadable(c, arg.expr, arg.typ, _SLIT("argument to print")); c->inside_println_arg = false; @@ -56868,7 +56945,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__CallArg arg = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)); (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).typ = v__checker__Checker_expr(c, arg.expr); if (v__ast__Type_alias_eq((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).typ, _const_v__ast__error_type)) { - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`error("), 0xfe10, {.d_s = v__ast__CallArg_str(arg)}}, {_SLIT(")` can be shortened to just `"), 0xfe10, {.d_s = v__ast__CallArg_str(arg)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`error("), /*115 &v.ast.CallArg*/0xfe10, {.d_s = v__ast__CallArg_str(arg)}}, {_SLIT(")` can be shortened to just `"), /*115 &v.ast.CallArg*/0xfe10, {.d_s = v__ast__CallArg_str(arg)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (node->expected_arg_types.len == 0) { @@ -56878,7 +56955,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } } if (!v__pref__Backend_is_js(c->pref->backend) && node->args.len > 0 && func.params.len == 0) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("too many arguments in call to `"), 0xfe10, {.d_s = func.name}}, {_SLIT("` (non-js backend: "), 0xfe10, {.d_s = v__pref__Backend_str(c->pref->backend)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("too many arguments in call to `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("` (non-js backend: "), /*115 &v.pref.Backend*/0xfe10, {.d_s = v__pref__Backend_str(c->pref->backend)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), node->pos); } for (int i = 0; i < node->args.len; ++i) { v__ast__CallArg* call_arg = ((v__ast__CallArg*)node->args.data) + i; @@ -56886,25 +56963,25 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp continue; } v__ast__Param param = (func.is_variadic && i >= func.params.len - 1 ? ((*(v__ast__Param*)/*ee elem_sym */array_get(func.params, func.params.len - 1))) : ((*(v__ast__Param*)/*ee elem_sym */array_get(func.params, i)))); - if (func.is_variadic && (call_arg->expr)._typ == 284 /* v.ast.ArrayDecompose */) { + if (func.is_variadic && (call_arg->expr)._typ == 285 /* v.ast.ArrayDecompose */) { if (i > func.params.len - 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("too many arguments in call to `"), 0xfe10, {.d_s = func.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("too many arguments in call to `"), /*115 &string*/0xfe10, {.d_s = func.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } c->expected_type = param.typ; v__ast__TypeSymbol* e_sym = v__ast__Table_sym(c->table, c->expected_type); - if ((call_arg->expr)._typ == 314 /* v.ast.MapInit */ && e_sym->kind == v__ast__Kind__struct_) { + if ((call_arg->expr)._typ == 315 /* v.ast.MapInit */ && e_sym->kind == v__ast__Kind__struct_) { v__checker__Checker_error(c, _SLIT("cannot initialize a struct with a map"), call_arg->pos); continue; - } else if ((call_arg->expr)._typ == 330 /* v.ast.StructInit */ && e_sym->kind == v__ast__Kind__map) { + } else if ((call_arg->expr)._typ == 331 /* v.ast.StructInit */ && e_sym->kind == v__ast__Kind__map) { v__checker__Checker_error(c, _SLIT("cannot initialize a map with a struct"), call_arg->pos); continue; } v__ast__Type arg_typ = v__checker__Checker_check_expr_opt_call(c, call_arg->expr, v__checker__Checker_expr(c, call_arg->expr)); (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, i)).typ = arg_typ; if (c->inside_comptime_for_field) { - if ((call_arg->expr)._typ == 305 /* v.ast.Ident */) { - if (((*call_arg->expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((call_arg->expr)._typ == 306 /* v.ast.Ident */) { + if (((*call_arg->expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, i)).typ = (*(*call_arg->expr._v__ast__Ident).obj._v__ast__Var).typ; } } @@ -56919,34 +56996,34 @@ 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_28813 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); - string to_lock = mr_28813.arg0; - v__token__Pos pos = mr_28813.arg1; + multi_return_string_v__token__Pos mr_29125 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); + string to_lock = mr_29125.arg0; + v__token__Pos pos = mr_29125.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)); } if (!param.is_mut) { string tok = v__ast__ShareType_str(call_arg->share); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` is not `"), 0xfe10, {.d_s = tok}}, {_SLIT("`, `"), 0xfe10, {.d_s = tok}}, {_SLIT("` is not needed`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); + 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(call_arg->expr)); } else { if (v__ast__Type_share(param.typ) != call_arg->share) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong shared type `"), 0xfe10, {.d_s = v__ast__ShareType_str(call_arg->share)}}, {_SLIT("`, expected: `"), 0xfe10, {.d_s = v__ast__ShareType_str(v__ast__Type_share(param.typ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong shared type `"), /*115 &string*/0xfe10, {.d_s = v__ast__ShareType_str(call_arg->share)}}, {_SLIT("`, expected: `"), /*115 &string*/0xfe10, {.d_s = v__ast__ShareType_str(v__ast__Type_share(param.typ))}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); } if ((to_lock).len != 0 && !v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__shared_f)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); } } } else { if (param.is_mut) { string tok = v__ast__ShareType_str(call_arg->share); - v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("function `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` is `"), 0xfe10, {.d_s = tok}}, {_SLIT("`, so use `"), 0xfe10, {.d_s = tok}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Expr_str(call_arg->expr)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); + v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("function `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` is `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("`, so use `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT(" "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(call_arg->expr)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(call_arg->expr)); } else { v__checker__Checker_fail_if_unreadable(c, call_arg->expr, arg_typ, _SLIT("argument")); } } v__ast__TypeSymbol* final_param_sym = param_typ_sym; v__ast__Type final_param_typ = param.typ; - if (func.is_variadic && (param_typ_sym->info)._typ == 450 /* v.ast.Array */) { + if (func.is_variadic && (param_typ_sym->info)._typ == 451 /* v.ast.Array */) { final_param_typ = v__ast__TypeSymbol_array_info(param_typ_sym).elem_type; final_param_sym = v__ast__Table_sym(c->table, final_param_typ); } @@ -56971,9 +57048,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp continue; } if (param_typ_sym->kind == v__ast__Kind__array && arg_typ_sym->kind == v__ast__Kind__array) { - v__ast__Array param_info = /* as */ *(v__ast__Array*)__as_cast((param_typ_sym->info)._v__ast__Array,(param_typ_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array param_info = /* as */ *(v__ast__Array*)__as_cast((param_typ_sym->info)._v__ast__Array,(param_typ_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Type param_elem_type = v__ast__Table_unaliased_type(c->table, param_info.elem_type); - v__ast__Array arg_info = /* as */ *(v__ast__Array*)__as_cast((arg_typ_sym->info)._v__ast__Array,(arg_typ_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array arg_info = /* as */ *(v__ast__Array*)__as_cast((arg_typ_sym->info)._v__ast__Array,(arg_typ_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Type arg_elem_type = v__ast__Table_unaliased_type(c->table, arg_info.elem_type); if (v__ast__Type_nr_muls(param.typ) == v__ast__Type_nr_muls(arg_typ) && param_info.nr_dims == arg_info.nr_dims && v__ast__Type_alias_eq(param_elem_type, arg_elem_type)) { continue; @@ -57010,13 +57087,13 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp continue; } } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); ; } ; if (func.language != v__ast__Language__c && !c->inside_unsafe && v__ast__Type_nr_muls(arg_typ) != v__ast__Type_nr_muls(param.typ) && !(call_arg->is_mut && param.is_mut) && !(!call_arg->is_mut && !param.is_mut) && !(v__ast__Type_alias_eq(param.typ, _const_v__ast__byteptr_type) || v__ast__Type_alias_eq(param.typ, _const_v__ast__charptr_type) || v__ast__Type_alias_eq(param.typ, _const_v__ast__voidptr_type))) { - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("automatic referencing/dereferencing is deprecated and will be removed soon (got: "), 0xfe07, {.d_i32 = v__ast__Type_nr_muls(arg_typ)}}, {_SLIT(" references, expected: "), 0xfe07, {.d_i32 = v__ast__Type_nr_muls(param.typ)}}, {_SLIT(" references)"), 0, { .d_c = 0 }}})), call_arg->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("automatic referencing/dereferencing is deprecated and will be removed soon (got: "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_nr_muls(arg_typ)}}, {_SLIT(" references, expected: "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_nr_muls(param.typ)}}, {_SLIT(" references)"), 0, { .d_c = 0 }}})), call_arg->pos); } } if (func.generic_names.len != node->concrete_types.len) { @@ -57049,7 +57126,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp if (c->comptime_fields_type.len > 0) { continue; } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), call_arg->pos); ; } @@ -57104,7 +57181,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal bool is_generic = v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic); if (is_generic && node->concrete_types.len == 0) { v__ast__TypeSymbol* rec_sym = v__ast__Table_sym(c->table, left_type); - if ((rec_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((rec_sym->info)._typ == 456 /* v.ast.Struct */) { node->concrete_types = (*rec_sym->info._v__ast__Struct).generic_types; } } @@ -57122,10 +57199,10 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal Option_v__ast__StructField _t2; if (_t2 = v__ast__Table_find_field(c->table, left_sym, method_name), _t2.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t2.data; - _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown method `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` did you mean to access the field with the same name instead?"), 0, { .d_c = 0 }}})); + _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown method `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` did you mean to access the field with the same name instead?"), 0, { .d_c = 0 }}})); } else { IError err = _t2.err; - _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown method or field: `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown method or field: `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); } string unknown_method_msg = _t1; if (v__ast__Type_has_flag(left_type, v__ast__TypeFlag__optional)) { @@ -57169,7 +57246,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Type _t11 = v__checker__Checker_map_builtin_method_call(c, node, left_type, *left_sym); return _t11; } else { - v__ast__Type parent_type = (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type; + v__ast__Type parent_type = (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; v__ast__Type _t12 = v__checker__Checker_map_builtin_method_call(c, node, parent_type, *final_left_sym); return _t12; } @@ -57194,21 +57271,21 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal return _t15; } } - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Expr arg_expr = (string__eq(method_name, _SLIT("insert")) ? ((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 1)).expr) : ((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr)); v__ast__Type arg_type = v__checker__Checker_expr(c, arg_expr); v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(c->table, arg_type); if (!v__checker__Checker_check_types(c, arg_type, info.elem_type) && !v__checker__Checker_check_types(c, left_type, arg_type)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot "), 0xfe10, {.d_s = method_name}}, {_SLIT(" `"), 0xfe10, {.d_s = arg_sym->name}}, {_SLIT("` to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg_expr)); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot "), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = arg_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg_expr)); } } else if (final_left_sym->kind == v__ast__Kind__array && (string__eq(method_name, _SLIT("first")) || string__eq(method_name, _SLIT("last")) || string__eq(method_name, _SLIT("pop")))) { - if ((final_left_sym->info)._typ == 450 /* v.ast.Array */) { + if ((final_left_sym->info)._typ == 451 /* v.ast.Array */) { node->return_type = (*final_left_sym->info._v__ast__Array).elem_type; v__ast__Type _t16 = node->return_type; return _t16; } } else if (v__pref__Backend_is_js(c->pref->backend) && string_starts_with(left_sym->name, _SLIT("Promise<")) && string__eq(method_name, _SLIT("wait"))) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (node->args.len > 0) { v__checker__Checker_error(c, _SLIT("wait() does not have any arguments"), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } @@ -57218,7 +57295,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Type _t17 = node->return_type; return _t17; } else if (left_sym->kind == v__ast__Kind__thread && string__eq(method_name, _SLIT("wait"))) { - v__ast__Thread info = /* as */ *(v__ast__Thread*)__as_cast((left_sym->info)._v__ast__Thread,(left_sym->info)._typ, 480) /*expected idx: 480, name: v.ast.Thread */ ; + v__ast__Thread info = /* as */ *(v__ast__Thread*)__as_cast((left_sym->info)._v__ast__Thread,(left_sym->info)._typ, 481) /*expected idx: 481, name: v.ast.Thread */ ; if (node->args.len > 0) { v__checker__Checker_error(c, _SLIT("wait() does not have any arguments"), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } @@ -57242,11 +57319,11 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal IError err = _t20.err; if (left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_) { v__ast__Type parent_type = _const_v__ast__void_type; - if ((left_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((left_sym->info)._typ == 456 /* v.ast.Struct */) { parent_type = (*left_sym->info._v__ast__Struct).parent_type; - } else if ((left_sym->info)._typ == 474 /* v.ast.SumType */) { + } else if ((left_sym->info)._typ == 475 /* v.ast.SumType */) { parent_type = (*left_sym->info._v__ast__SumType).parent_type; - } else if ((left_sym->info)._typ == 473 /* v.ast.Interface */) { + } else if ((left_sym->info)._typ == 474 /* v.ast.Interface */) { parent_type = (*left_sym->info._v__ast__Interface).parent_type; } if (parent_type != 0) { @@ -57273,9 +57350,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal *(multi_return_v__ast__Fn_Array_v__ast__Type*) _t22.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_42485 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t22.data); - method = mr_42485.arg0; - embed_types = mr_42485.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_42797 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t22.data); + method = mr_42797.arg0; + embed_types = mr_42797.arg1; if (embed_types.len != 0) { is_method_from_embed = true; node->from_embed_types = embed_types; @@ -57289,21 +57366,21 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal node->is_noreturn = method.is_noreturn; node->is_ctor_new = method.is_ctor_new; if (!method.is_pub && !c->pref->is_test && !string__eq(method.mod, c->mod)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } v__ast__ShareType rec_share = v__ast__Type_share((*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).typ); if (rec_share == v__ast__ShareType__shared_t && (c->locked_names.len > 0 || c->rlocked_names.len > 0)) { 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_43616 = v__checker__Checker_fail_if_immutable(c, node->left); - string to_lock = mr_43616.arg0; - v__token__Pos pos = mr_43616.arg1; + multi_return_string_v__token__Pos mr_43928 = v__checker__Checker_fail_if_immutable(c, node->left); + string to_lock = mr_43928.arg0; + v__token__Pos pos = mr_43928.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)); } if ((to_lock).len != 0 && rec_share != v__ast__ShareType__shared_t) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); } } else { v__checker__Checker_fail_if_unreadable(c, node->left, left_type, _SLIT("receiver")); @@ -57313,7 +57390,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } if (node->concrete_types.len > 0 && method.generic_names.len > 0 && node->concrete_types.len != method.generic_names.len) { string plural = (method.generic_names.len == 1 ? (_SLIT("")) : (_SLIT("s"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = method.generic_names.len}}, {_SLIT(" generic parameter"), 0xfe10, {.d_s = plural}}, {_SLIT(", got "), 0xfe07, {.d_i32 = node->concrete_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->concrete_list_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = method.generic_names.len}}, {_SLIT(" generic parameter"), /*115 &string*/0xfe10, {.d_s = plural}}, {_SLIT(", got "), /*100 &int*/0xfe07, {.d_i32 = node->concrete_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->concrete_list_pos); } for (int _t23 = 0; _t23 < node->concrete_types.len; ++_t23) { v__ast__Type concrete_type = ((v__ast__Type*)node->concrete_types.data)[_t23]; @@ -57339,7 +57416,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal bool param_is_mut = false; bool no_type_promotion = false; if (left_sym->kind == v__ast__Kind__chan) { - v__ast__Type elem_typ = (/* as */ *(v__ast__Chan*)__as_cast((left_sym->info)._v__ast__Chan,(left_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.Chan */ ).elem_type; + v__ast__Type elem_typ = (/* as */ *(v__ast__Chan*)__as_cast((left_sym->info)._v__ast__Chan,(left_sym->info)._typ, 480) /*expected idx: 480, name: v.ast.Chan */ ).elem_type; if (string__eq(method_name, _SLIT("try_push"))) { exp_arg_typ = v__ast__Type_ref(elem_typ); } else if (string__eq(method_name, _SLIT("try_pop"))) { @@ -57361,7 +57438,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, i)).typ = got_arg_typ; if (no_type_promotion) { if (!v__ast__Type_alias_eq(got_arg_typ, exp_arg_typ)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = v__ast__Table_sym(c->table, got_arg_typ)->name}}, {_SLIT("` as argument for `"), 0xfe10, {.d_s = method.name}}, {_SLIT("` (`"), 0xfe10, {.d_s = exp_arg_sym->name}}, {_SLIT("` expected)"), 0, { .d_c = 0 }}})), arg->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(c->table, got_arg_typ)->name}}, {_SLIT("` as argument for `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("` (`"), /*115 &string*/0xfe10, {.d_s = exp_arg_sym->name}}, {_SLIT("` expected)"), 0, { .d_c = 0 }}})), arg->pos); } } if (method.is_variadic && v__ast__Type_has_flag(got_arg_typ, v__ast__TypeFlag__variadic) && node->args.len - 1 > i) { @@ -57369,7 +57446,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } v__ast__TypeSymbol* final_arg_sym = exp_arg_sym; v__ast__Type final_arg_typ = exp_arg_typ; - if (method.is_variadic && (exp_arg_sym->info)._typ == 450 /* v.ast.Array */) { + if (method.is_variadic && (exp_arg_sym->info)._typ == 451 /* v.ast.Array */) { final_arg_typ = v__ast__TypeSymbol_array_info(exp_arg_sym).elem_type; final_arg_sym = v__ast__Table_sym(c->table, final_arg_typ); } @@ -57400,44 +57477,44 @@ 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_47585 = v__checker__Checker_fail_if_immutable(c, arg->expr); - string to_lock = mr_47585.arg0; - v__token__Pos pos = mr_47585.arg1; + multi_return_string_v__token__Pos mr_47897 = v__checker__Checker_fail_if_immutable(c, arg->expr); + string to_lock = mr_47897.arg0; + v__token__Pos pos = mr_47897.arg1; if (!param_is_mut) { string tok = v__ast__ShareType_str(arg->share); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` is not `"), 0xfe10, {.d_s = tok}}, {_SLIT("`, `"), 0xfe10, {.d_s = tok}}, {_SLIT("` is not needed`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); + 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)); } else { if (param_share != arg->share) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong shared type `"), 0xfe10, {.d_s = v__ast__ShareType_str(arg->share)}}, {_SLIT("`, expected: `"), 0xfe10, {.d_s = v__ast__ShareType_str(param_share)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("wrong shared type `"), /*115 &string*/0xfe10, {.d_s = v__ast__ShareType_str(arg->share)}}, {_SLIT("`, expected: `"), /*115 &string*/0xfe10, {.d_s = v__ast__ShareType_str(param_share)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); } if ((to_lock).len != 0 && param_share != v__ast__ShareType__shared_t) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = to_lock}}, {_SLIT(" is `shared` and must be `lock`ed to be passed as `mut`"), 0, { .d_c = 0 }}})), pos); } } } else { if (param_is_mut) { string tok = v__ast__ShareType_str(arg->share); - v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` is `"), 0xfe10, {.d_s = tok}}, {_SLIT("`, so use `"), 0xfe10, {.d_s = tok}}, {_SLIT(" "), 0xfe10, {.d_s = v__ast__Expr_str(arg->expr)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); + v__checker__Checker_error(c, str_intp(6, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` is `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("`, so use `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT(" "), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(arg->expr)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); } else { v__checker__Checker_fail_if_unreadable(c, arg->expr, got_arg_typ, _SLIT("argument")); } } if (left_sym->kind == v__ast__Kind__array && string__eq(method_name, _SLIT("sort_with_compare"))) { - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Type elem_typ = array_info.elem_type; v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(c->table, arg->typ); if (arg_sym->kind == v__ast__Kind__function) { - v__ast__FnType func_info = /* as */ *(v__ast__FnType*)__as_cast((arg_sym->info)._v__ast__FnType,(arg_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType func_info = /* as */ *(v__ast__FnType*)__as_cast((arg_sym->info)._v__ast__FnType,(arg_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; if (func_info.func.params.len == 2) { if (v__ast__Type_nr_muls((*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).typ) != v__ast__Type_nr_muls(elem_typ) + 1) { string arg_typ_str = v__ast__Table_type_to_str(c->table, (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).typ); string expected_typ_str = v__ast__Table_type_to_str(c->table, v__ast__Type_ref(elem_typ)); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("sort_with_compare callback function parameter `"), 0xfe10, {.d_s = (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).name}}, {_SLIT("` with type `"), 0xfe10, {.d_s = arg_typ_str}}, {_SLIT("` should be `"), 0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).type_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("sort_with_compare callback function parameter `"), /*115 &string*/0xfe10, {.d_s = (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).name}}, {_SLIT("` with type `"), /*115 &string*/0xfe10, {.d_s = arg_typ_str}}, {_SLIT("` should be `"), /*115 &string*/0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 0)).type_pos); } if (v__ast__Type_nr_muls((*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).typ) != v__ast__Type_nr_muls(elem_typ) + 1) { string arg_typ_str = v__ast__Table_type_to_str(c->table, (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).typ); string expected_typ_str = v__ast__Table_type_to_str(c->table, v__ast__Type_ref(elem_typ)); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("sort_with_compare callback function parameter `"), 0xfe10, {.d_s = (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).name}}, {_SLIT("` with type `"), 0xfe10, {.d_s = arg_typ_str}}, {_SLIT("` should be `"), 0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).type_pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("sort_with_compare callback function parameter `"), /*115 &string*/0xfe10, {.d_s = (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).name}}, {_SLIT("` with type `"), /*115 &string*/0xfe10, {.d_s = arg_typ_str}}, {_SLIT("` should be `"), /*115 &string*/0xfe10, {.d_s = expected_typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__ast__Param*)/*ee elem_sym */array_get(func_info.func.params, 1)).type_pos); } } } @@ -57459,16 +57536,16 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__TypeSymbol* param_typ_sym = v__ast__Table_sym(c->table, exp_arg_typ); v__ast__TypeSymbol* arg_typ_sym = v__ast__Table_sym(c->table, got_arg_typ); if (param_typ_sym->kind == v__ast__Kind__array && arg_typ_sym->kind == v__ast__Kind__array) { - v__ast__Array param_info = /* as */ *(v__ast__Array*)__as_cast((param_typ_sym->info)._v__ast__Array,(param_typ_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array param_info = /* as */ *(v__ast__Array*)__as_cast((param_typ_sym->info)._v__ast__Array,(param_typ_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Type param_elem_type = v__ast__Table_unaliased_type(c->table, param_info.elem_type); - v__ast__Array arg_info = /* as */ *(v__ast__Array*)__as_cast((arg_typ_sym->info)._v__ast__Array,(arg_typ_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array arg_info = /* as */ *(v__ast__Array*)__as_cast((arg_typ_sym->info)._v__ast__Array,(arg_typ_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__Type arg_elem_type = v__ast__Table_unaliased_type(c->table, arg_info.elem_type); if (v__ast__Type_nr_muls(exp_arg_typ) == v__ast__Type_nr_muls(got_arg_typ) && param_info.nr_dims == arg_info.nr_dims && v__ast__Type_alias_eq(param_elem_type, arg_elem_type)) { continue; } } if (!v__ast__Type_alias_eq(got_arg_typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); } ; } @@ -57476,10 +57553,10 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal ; } if (method.is_unsafe && !c->inside_unsafe) { - v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("` must be called from an `unsafe` block"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_warn(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("` must be called from an `unsafe` block"), 0, { .d_c = 0 }}})), node->pos); } if (!c->table->cur_fn->is_deprecated && method.is_deprecated) { - v__checker__Checker_deprecate_fnmethod(c, _SLIT("method"), str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})), method, *node); + v__checker__Checker_deprecate_fnmethod(c, _SLIT("method"), str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})), method, *node); } if (node->expected_arg_types.len == 0) { for (int i = 1; i < method.params.len; ++i) { @@ -57520,7 +57597,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } if (method.generic_names.len > 0) { if (!v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic)) { - if ((left_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((left_sym->info)._typ == 456 /* v.ast.Struct */) { if (method.generic_names.len == (*left_sym->info._v__ast__Struct).concrete_types.len) { node->concrete_types = (*left_sym->info._v__ast__Struct).concrete_types; } @@ -57535,7 +57612,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (string__eq(method_name, _SLIT("str"))) { if (left_sym->kind == v__ast__Kind__interface_) { string iname = left_sym->name; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = iname}}, {_SLIT("` does not have a .str() method. Use typeof() instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = iname}}, {_SLIT("` does not have a .str() method. Use typeof() instead"), 0, { .d_c = 0 }}})), node->pos); } node->receiver_type = left_type; node->return_type = _const_v__ast__string_type; @@ -57556,7 +57633,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (field_sym->kind == v__ast__Kind__function) { node->is_method = false; node->is_field = true; - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; Option_void _t38 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/info.func); if (_t38.state != 0 && _t38.err._typ != _IError_None___index) { IError err = _t38.err; @@ -57578,7 +57655,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (_t41.state != 0 && _t41.err._typ != _IError_None___index) { IError err = _t41.err; if (!v__ast__Type_alias_eq(targ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), 0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument "), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" to `"), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), arg->pos); } ; } @@ -57595,8 +57672,8 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal return _t43; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_55050 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t42.data); - node->from_embed_types = mr_55050.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_55362 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t42.data); + node->from_embed_types = mr_55362.arg1; v__ast__Type _t44 = info.func.return_type; return _t44; } @@ -57667,16 +57744,16 @@ VV_LOCAL_SYMBOL void v__checker__Checker_deprecate_fnmethod(v__checker__Checker* } VV_LOCAL_SYMBOL void v__checker__Checker_deprecate(v__checker__Checker* c, string kind, string name, string deprecation_message, time__Time now, time__Time after_time, v__token__Pos pos) { - string start_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = kind}}, {_SLIT(" `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string start_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = kind}}, {_SLIT(" `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); time__Time error_time = time__Time_add_days(&after_time, 180); if (time__Time__lt(error_time, now)) { - v__checker__Checker_error(c, v__checker__semicolonize( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated since "), 0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); + v__checker__Checker_error(c, v__checker__semicolonize( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated since "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); } else if (time__Time__lt(after_time, now)) { - v__checker__Checker_warn(c, v__checker__semicolonize( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated since "), 0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT(", it will be an error after "), 0xfe10, {.d_s = time__Time_ymmdd(error_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); + v__checker__Checker_warn(c, v__checker__semicolonize( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated since "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT(", it will be an error after "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(error_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); } else if (time__Time__eq(after_time, now)) { - v__checker__Checker_warn(c, v__checker__semicolonize( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated"), 0, { .d_c = 0 }}})), deprecation_message), pos); + v__checker__Checker_warn(c, v__checker__semicolonize( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = start_message}}, {_SLIT(" has been deprecated"), 0, { .d_c = 0 }}})), deprecation_message), pos); } else { - v__checker__Checker_note(c, v__checker__semicolonize( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = start_message}}, {_SLIT(" will be deprecated after "), 0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT(", and will become an error after "), 0xfe10, {.d_s = time__Time_ymmdd(error_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); + v__checker__Checker_note(c, v__checker__semicolonize( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = start_message}}, {_SLIT(" will be deprecated after "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(after_time)}}, {_SLIT(", and will become an error after "), /*115 &string*/0xfe10, {.d_s = time__Time_ymmdd(error_time)}}, {_SLIT0, 0, { .d_c = 0 }}})), deprecation_message), pos); } } @@ -57685,7 +57762,7 @@ VV_LOCAL_SYMBOL string v__checker__semicolonize(string main, string details) { string _t1 = main; return _t1; } - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = main}}, {_SLIT("; "), 0xfe10, {.d_s = details}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = main}}, {_SLIT("; "), /*115 &string*/0xfe10, {.d_s = details}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } @@ -57729,7 +57806,7 @@ Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, if (min_required_params == nr_args + 1) { v__ast__Type last_typ = (*(v__ast__Param*)array_last(f->params)).typ; v__ast__TypeSymbol* last_sym = v__ast__Table_sym(c->table, last_typ); - if ((last_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((last_sym->info)._typ == 456 /* v.ast.Struct */) { Array_v__ast__Attr _t1 = {0}; Array_v__ast__Attr _t1_orig = (*last_sym->info._v__ast__Struct).attrs; int _t1_len = _t1_orig.len; @@ -57748,11 +57825,11 @@ Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, } } } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = min_required_params}}, {_SLIT(" arguments, but got "), 0xfe07, {.d_i32 = nr_args}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = min_required_params}}, {_SLIT(" arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = nr_args}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); return (Option_void){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (!f->is_variadic && nr_args > nr_params) { v__token__Pos unexpected_args_pos = v__token__Pos_extend((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, min_required_params)).pos, (*(v__ast__CallArg*)array_last(node->args)).pos); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = min_required_params}}, {_SLIT(" arguments, but got "), 0xfe07, {.d_i32 = nr_args}}, {_SLIT0, 0, { .d_c = 0 }}})), unexpected_args_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = min_required_params}}, {_SLIT(" arguments, but got "), /*100 &int*/0xfe07, {.d_i32 = nr_args}}, {_SLIT0, 0, { .d_c = 0 }}})), unexpected_args_pos); return (Option_void){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; } return (Option_void){0}; @@ -57760,26 +57837,26 @@ Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checker* c, bool is_map, v__ast__Type elem_typ, v__ast__CallExpr node) { if (node.args.len != 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 1 argument, but got "), 0xfe07, {.d_i32 = node.args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node.args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node.pos); return; } v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, elem_typ); v__ast__Expr arg_expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (arg_expr._typ == 283 /* v.ast.AnonFn */) { + if (arg_expr._typ == 284 /* v.ast.AnonFn */) { if ((*arg_expr._v__ast__AnonFn).decl.params.len > 1) { v__checker__Checker_error(c, _SLIT("function needs exactly 1 argument"), (*arg_expr._v__ast__AnonFn).decl.pos); } else if (is_map && (v__ast__Type_alias_eq((*arg_expr._v__ast__AnonFn).decl.return_type, _const_v__ast__void_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get((*arg_expr._v__ast__AnonFn).decl.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__AnonFn).decl.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__AnonFn).decl.pos); } else if (!is_map && (!v__ast__Type_alias_eq((*arg_expr._v__ast__AnonFn).decl.return_type, _const_v__ast__bool_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get((*arg_expr._v__ast__AnonFn).decl.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__AnonFn).decl.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__AnonFn).decl.pos); } } - else if (arg_expr._typ == 305 /* v.ast.Ident */) { + else if (arg_expr._typ == 306 /* v.ast.Ident */) { if ((*arg_expr._v__ast__Ident).kind == v__ast__IdentKind__function) { Option_v__ast__Fn _t1 = v__ast__Table_find_fn(c->table, (*arg_expr._v__ast__Ident).name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*arg_expr._v__ast__Ident).name}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*arg_expr._v__ast__Ident).name}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); return; } @@ -57787,20 +57864,20 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke if (func.params.len > 1) { v__checker__Checker_error(c, _SLIT("function needs exactly 1 argument"), node.pos); } else if (is_map && (v__ast__Type_alias_eq(func.return_type, _const_v__ast__void_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get(func.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); } else if (!is_map && (!v__ast__Type_alias_eq(func.return_type, _const_v__ast__bool_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get(func.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__Ident).pos); } } else if ((*arg_expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { - if (((*arg_expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if (((*arg_expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { v__ast__Expr expr = (*(*arg_expr._v__ast__Ident).obj._v__ast__Var).expr; - if ((expr)._typ == 283 /* v.ast.AnonFn */) { + if ((expr)._typ == 284 /* v.ast.AnonFn */) { if ((*expr._v__ast__AnonFn).decl.params.len > 1) { v__checker__Checker_error(c, _SLIT("function needs exactly 1 argument"), (*expr._v__ast__AnonFn).decl.pos); } else if (is_map && (v__ast__Type_alias_eq((*expr._v__ast__AnonFn).decl.return_type, _const_v__ast__void_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get((*expr._v__ast__AnonFn).decl.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*expr._v__ast__AnonFn).decl.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") T {...}`"), 0, { .d_c = 0 }}})), (*expr._v__ast__AnonFn).decl.pos); } else if (!is_map && (!v__ast__Type_alias_eq((*expr._v__ast__AnonFn).decl.return_type, _const_v__ast__bool_type) || !v__ast__Type_alias_eq((*(v__ast__Param*)/*ee elem_sym */array_get((*expr._v__ast__AnonFn).decl.params, 0)).typ, elem_typ))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), 0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*expr._v__ast__AnonFn).decl.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use `fn(a "), /*115 &string*/0xfe10, {.d_s = elem_sym->name}}, {_SLIT(") bool {...}`"), 0, { .d_c = 0 }}})), (*expr._v__ast__AnonFn).decl.pos); } return; } @@ -57810,14 +57887,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke } } } - else if (arg_expr._typ == 291 /* v.ast.CallExpr */) { + else if (arg_expr._typ == 292 /* v.ast.CallExpr */) { if (is_map && (v__ast__Type_alias_eq((*arg_expr._v__ast__CallExpr).return_type, _const_v__ast__void_type) || v__ast__Type_alias_eq((*arg_expr._v__ast__CallExpr).return_type, 0))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, `"), 0xfe10, {.d_s = (*arg_expr._v__ast__CallExpr).name}}, {_SLIT("` does not return anything"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__CallExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, `"), /*115 &string*/0xfe10, {.d_s = (*arg_expr._v__ast__CallExpr).name}}, {_SLIT("` does not return anything"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__CallExpr).pos); } else if (!is_map && !v__ast__Type_alias_eq((*arg_expr._v__ast__CallExpr).return_type, _const_v__ast__bool_type)) { if ((*arg_expr._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent && v__ast__Type_has_flag((*arg_expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) && v__ast__Type_alias_eq(v__ast__Type_clear_flag((*arg_expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional), _const_v__ast__bool_type)) { return; } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, `"), 0xfe10, {.d_s = (*arg_expr._v__ast__CallExpr).name}}, {_SLIT("` must return a bool"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__CallExpr).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, `"), /*115 &string*/0xfe10, {.d_s = (*arg_expr._v__ast__CallExpr).name}}, {_SLIT("` must return a bool"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__CallExpr).pos); } } @@ -57832,7 +57909,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__chec if (string__eq(method_name, _SLIT("clone")) || string__eq(method_name, _SLIT("move"))) { if (node->args.len != 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), 0xfe10, {.d_s = method_name}}, {_SLIT("()` does not have any arguments"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("()` does not have any arguments"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } if (string_at(method_name, 0) == 'm') { v__checker__Checker_fail_if_immutable(c, node->left); @@ -57848,21 +57925,21 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__chec if (node->args.len != 0) { v__checker__Checker_error(c, _SLIT("`.keys()` does not have any arguments"), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; int typ = v__ast__Table_find_or_register_array(c->table, info.key_type); ret_type = ((typ)); } else if (string__eq(method_name, _SLIT("delete"))) { v__checker__Checker_fail_if_immutable(c, node->left); if (node->args.len != 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 1 argument, but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; v__ast__Type arg_type = v__checker__Checker_expr(c, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr); Option_void _t1 = v__checker__Checker_check_expected_call_arg(c, arg_type, info.key_type, node->language, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0))); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `Map.delete`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `Map.delete`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); ; } @@ -57882,38 +57959,38 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch if (string__eq(method_name, _SLIT("slice")) && !c->is_builtin_mod) { v__checker__Checker_error(c, _SLIT(".slice() is a private method, use `x[start..end]` instead"), node->pos); } - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left_sym.info)._v__ast__Array,(left_sym.info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left_sym.info)._v__ast__Array,(left_sym.info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; elem_typ = array_info.elem_type; if (string__eq(method_name, _SLIT("filter")) || string__eq(method_name, _SLIT("map")) || string__eq(method_name, _SLIT("any")) || string__eq(method_name, _SLIT("all"))) { v__checker__scope_register_it(node->scope, node->pos, elem_typ); } else if (string__eq(method_name, _SLIT("sort"))) { - if ((node->left)._typ == 291 /* v.ast.CallExpr */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the `sort()` method can be called only on mutable receivers, but `"), 0xfe10, {.d_s = v__ast__Expr_str(node->left)}}, {_SLIT("` is a call expression"), 0, { .d_c = 0 }}})), node->pos); + if ((node->left)._typ == 292 /* v.ast.CallExpr */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the `sort()` method can be called only on mutable receivers, but `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node->left)}}, {_SLIT("` is a call expression"), 0, { .d_c = 0 }}})), node->pos); } v__checker__Checker_fail_if_immutable(c, node->left); v__checker__scope_register_a_b(node->scope, node->pos, elem_typ); if (node->args.len > 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 0 or 1 argument, but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected 0 or 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (node->args.len == 1) { - if (((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr)._typ == 309 /* v.ast.InfixExpr */) { + if (((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr)._typ == 310 /* v.ast.InfixExpr */) { if (!((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).op == v__token__Kind__gt || (*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).op == v__token__Kind__lt)) { v__checker__Checker_error(c, _SLIT("`.sort()` can only use `<` or `>` comparison"), node->pos); } - u8 left_name = string_at( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)}}, {_SLIT0, 0, { .d_c = 0 }}})), 0); - u8 right_name = string_at( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)}}, {_SLIT0, 0, { .d_c = 0 }}})), 0); + u8 left_name = string_at( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)}}, {_SLIT0, 0, { .d_c = 0 }}})), 0); + u8 right_name = string_at( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)}}, {_SLIT0, 0, { .d_c = 0 }}})), 0); if (!(left_name == 'a' || left_name == 'b') || !(right_name == 'a' || right_name == 'b')) { v__checker__Checker_error(c, _SLIT("`.sort()` can only use `a` or `b` as argument, e.g. `arr.sort(a < b)`"), node->pos); } else if (left_name == right_name) { v__checker__Checker_error(c, _SLIT("`.sort()` cannot use same argument"), node->pos); } - if ((((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 305 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 325 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 308 /* v.ast.IndexExpr */) || (((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 305 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 325 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 308 /* v.ast.IndexExpr */)) { + if ((((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 306 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 326 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 309 /* v.ast.IndexExpr */) || (((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 306 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 326 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 309 /* v.ast.IndexExpr */)) { v__checker__Checker_error(c, _SLIT("`.sort()` can only use ident, index or selector as argument, \ne.g. `arr.sort(a < b)`, `arr.sort(a.id < b.id)`, `arr.sort(a[0] < b[0])`"), node->pos); } } else { v__checker__Checker_error(c, _SLIT("`.sort()` requires a `<` or `>` comparison as the first and only argument\ne.g. `users.sort(a.id < b.id)`"), node->pos); } } else if (!(v__ast__TypeSymbol_has_method(v__ast__Table_sym(c->table, elem_typ), _SLIT("<")) || (v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__int_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), v__ast__Type_ref(_const_v__ast__int_type)) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__string_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), v__ast__Type_ref(_const_v__ast__string_type)) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__i8_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__i16_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__i64_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__byte_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__rune_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__u16_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__u32_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__u64_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__f32_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__f64_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__char_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__bool_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__float_literal_type) || v__ast__Type_alias_eq(v__ast__Table_unalias_num_type(c->table, elem_typ), _const_v__ast__int_literal_type)))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("custom sorting condition must be supplied for type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, elem_typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("custom sorting condition must be supplied for type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, elem_typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else if (string__eq(method_name, _SLIT("wait"))) { v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, elem_typ); @@ -57927,7 +58004,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch } node->return_type = v__ast__Table_find_or_register_array(c->table, thread_ret_type); } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = left_sym.name}}, {_SLIT("` has no method `wait()` (only thread handles and arrays of them have)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = left_sym.name}}, {_SLIT("` has no method `wait()` (only thread handles and arrays of them have)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->left)); } } v__ast__Type arg_type = left_type; @@ -57938,7 +58015,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch if (string__eq(method_name, _SLIT("map"))) { v__checker__Checker_check_map_and_filter(c, true, elem_typ, *node); v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(c->table, arg_type); - v__ast__Type ret_type = ((arg_sym->info._typ == 482 /* v.ast.FnType */) ? ((*arg_sym->info._v__ast__FnType).func.return_type) : (arg_type)); + v__ast__Type ret_type = ((arg_sym->info._typ == 483 /* v.ast.FnType */) ? ((*arg_sym->info._v__ast__FnType).func.return_type) : (arg_type)); node->return_type = v__ast__Table_find_or_register_array(c->table, v__checker__Checker_unwrap_generic(c, ret_type)); if (v__ast__Type_has_flag(node->return_type, v__ast__TypeFlag__shared_f)) { node->return_type = v__ast__Type_deref(v__ast__Type_clear_flag(node->return_type, v__ast__TypeFlag__shared_f)); @@ -57972,13 +58049,13 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch node->return_type = _const_v__ast__void_type; } else if (string__eq(method_name, _SLIT("contains"))) { if (node->args.len != 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`.contains()` expected 1 argument, but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`.contains()` expected 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (!v__ast__TypeSymbol_has_method(&left_sym, _SLIT("contains"))) { v__ast__Type arg_typ = v__checker__Checker_expr(c, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr); Option_void _t2 = v__checker__Checker_check_expected_call_arg(c, arg_typ, elem_typ, node->language, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0))); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `.contains()`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `.contains()`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); ; } @@ -57987,13 +58064,13 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch node->return_type = _const_v__ast__bool_type; } else if (string__eq(method_name, _SLIT("index"))) { if (node->args.len != 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`.index()` expected 1 argument, but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`.index()` expected 1 argument, but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (!v__ast__TypeSymbol_has_method(&left_sym, _SLIT("index"))) { v__ast__Type arg_typ = v__checker__Checker_expr(c, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr); Option_void _t3 = v__checker__Checker_check_expected_call_arg(c, arg_typ, elem_typ, node->language, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0))); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `.index()`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT(" in argument 1 to `.index()`"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); ; } @@ -58002,7 +58079,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch node->return_type = _const_v__ast__int_type; } else if (string__eq(method_name, _SLIT("first")) || string__eq(method_name, _SLIT("last")) || string__eq(method_name, _SLIT("pop"))) { if (node->args.len != 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), 0xfe10, {.d_s = method_name}}, {_SLIT("()` does not have any arguments"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("()` does not have any arguments"), 0, { .d_c = 0 }}})), (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).pos); } node->return_type = array_info.elem_type; if (string__eq(method_name, _SLIT("pop"))) { @@ -58033,10 +58110,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_c_stmt(v__checker__Checker* c, v__a } v__checker__Checker_expr(c, node.cond); if (node.has_inc) { - if ((node.inc)._typ == 337 /* v.ast.AssignStmt */) { + if ((node.inc)._typ == 338 /* v.ast.AssignStmt */) { for (int _t1 = 0; _t1 < (*node.inc._v__ast__AssignStmt).right.len; ++_t1) { v__ast__Expr right = ((v__ast__Expr*)(*node.inc._v__ast__AssignStmt).right.data)[_t1]; - if ((right)._typ == 291 /* v.ast.CallExpr */) { + if ((right)._typ == 292 /* v.ast.CallExpr */) { if ((*right._v__ast__CallExpr).or_block.stmts.len > 0) { v__checker__Checker_error(c, _SLIT("optionals are not allowed in `for statement increment` (yet)"), (*right._v__ast__CallExpr).pos); } @@ -58058,9 +58135,15 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_in_stmt(v__checker__Checker* c, v__ int typ_idx = v__ast__Type_idx(typ); if (node->key_var.len > 0 && !string__eq(node->key_var, _SLIT("_"))) { v__checker__Checker_check_valid_snake_case(c, node->key_var, _SLIT("variable name"), node->pos); + if (Array_string_contains(_const_v__checker__reserved_type_names, node->key_var)) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = node->key_var}}, {_SLIT("` as key name"), 0, { .d_c = 0 }}})), node->pos); + } } if (node->val_var.len > 0 && !string__eq(node->val_var, _SLIT("_"))) { v__checker__Checker_check_valid_snake_case(c, node->val_var, _SLIT("variable name"), node->pos); + if (Array_string_contains(_const_v__checker__reserved_type_names, node->val_var)) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = node->val_var}}, {_SLIT("` as value name"), 0, { .d_c = 0 }}})), node->pos); + } } if (node->is_range) { v__ast__Type high_type = v__checker__Checker_expr(c, node->high); @@ -58127,35 +58210,35 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_in_stmt(v__checker__Checker* c, v__ } if (v__ast__Type_alias_eq(value_type, _const_v__ast__void_type) || v__ast__Type_has_flag(typ, v__ast__TypeFlag__optional)) { if (!v__ast__Type_alias_eq(typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("for in: cannot index `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->cond)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("for in: cannot index `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->cond)); } } if (node->val_is_mut) { value_type = v__ast__Type_ref(value_type); - if (node->cond._typ == 305 /* v.ast.Ident */) { - if (((*node->cond._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if (node->cond._typ == 306 /* v.ast.Ident */) { + if (((*node->cond._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { if (!(*(*node->cond._v__ast__Ident).obj._v__ast__Var).is_mut) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*(*node->cond._v__ast__Ident).obj._v__ast__Var).name}}, {_SLIT("` is immutable, it cannot be changed"), 0, { .d_c = 0 }}})), (*node->cond._v__ast__Ident).pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*(*node->cond._v__ast__Ident).obj._v__ast__Var).name}}, {_SLIT("` is immutable, it cannot be changed"), 0, { .d_c = 0 }}})), (*node->cond._v__ast__Ident).pos); } } } - else if (node->cond._typ == 285 /* v.ast.ArrayInit */) { + else if (node->cond._typ == 286 /* v.ast.ArrayInit */) { v__checker__Checker_error(c, _SLIT("array literal is immutable, it cannot be changed"), (*node->cond._v__ast__ArrayInit).pos); } - else if (node->cond._typ == 314 /* v.ast.MapInit */) { + else if (node->cond._typ == 315 /* v.ast.MapInit */) { v__checker__Checker_error(c, _SLIT("map literal is immutable, it cannot be changed"), (*node->cond._v__ast__MapInit).pos); } - else if (node->cond._typ == 325 /* v.ast.SelectorExpr */) { + else if (node->cond._typ == 326 /* v.ast.SelectorExpr */) { Option_v__ast__Ident _t2 = v__ast__SelectorExpr_root_ident(&(*node->cond._v__ast__SelectorExpr)); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - *(v__ast__Ident*) _t2.data = /* as */ *(v__ast__Ident*)__as_cast(((*node->cond._v__ast__SelectorExpr).expr)._v__ast__Ident,((*node->cond._v__ast__SelectorExpr).expr)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ; + *(v__ast__Ident*) _t2.data = /* as */ *(v__ast__Ident*)__as_cast(((*node->cond._v__ast__SelectorExpr).expr)._v__ast__Ident,((*node->cond._v__ast__SelectorExpr).expr)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ; } v__ast__Ident root_ident = (*(v__ast__Ident*)_t2.data); if (root_ident.kind != v__ast__IdentKind__unresolved) { - if (!(/* as */ *(v__ast__Var*)__as_cast((root_ident.obj)._v__ast__Var,(root_ident.obj)._typ, 363) /*expected idx: 363, name: v.ast.Var */ ).is_mut) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = (*node->cond._v__ast__SelectorExpr).field_name}}, {_SLIT("` is immutable, it cannot be changed"), 0, { .d_c = 0 }}})), (*node->cond._v__ast__SelectorExpr).pos); + if (!(/* as */ *(v__ast__Var*)__as_cast((root_ident.obj)._v__ast__Var,(root_ident.obj)._typ, 364) /*expected idx: 364, name: v.ast.Var */ ).is_mut) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = (*node->cond._v__ast__SelectorExpr).field_name}}, {_SLIT("` is immutable, it cannot be changed"), 0, { .d_c = 0 }}})), (*node->cond._v__ast__SelectorExpr).pos); } } } @@ -58184,9 +58267,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_stmt(v__checker__Checker* c, v__ast 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 == 309 /* v.ast.InfixExpr */) { + if ((node->cond)._typ == 310 /* v.ast.InfixExpr */) { if ((*node->cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - if (((*node->cond._v__ast__InfixExpr).right)._typ == 331 /* v.ast.TypeNode */ && (((*node->cond._v__ast__InfixExpr).left)._typ == 305 /* v.ast.Ident */ || ((*node->cond._v__ast__InfixExpr).left)._typ == 325 /* v.ast.SelectorExpr */)) { + if (((*node->cond._v__ast__InfixExpr).right)._typ == 332 /* v.ast.TypeNode */ && (((*node->cond._v__ast__InfixExpr).left)._typ == 306 /* v.ast.Ident */ || ((*node->cond._v__ast__InfixExpr).left)._typ == 326 /* v.ast.SelectorExpr */)) { if (v__ast__Table_type_kind(c->table, (*node->cond._v__ast__InfixExpr).left_type) == v__ast__Kind__sum_type || v__ast__Table_type_kind(c->table, (*node->cond._v__ast__InfixExpr).left_type) == v__ast__Kind__interface_) { v__checker__Checker_smartcast(c, (*node->cond._v__ast__InfixExpr).left, (*node->cond._v__ast__InfixExpr).left_type, (*node->cond._v__ast__InfixExpr).right_type, node->scope); } @@ -58208,7 +58291,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; bool node_is_expr = false; if (node->branches.len > 0 && node->has_else) { Array_v__ast__Stmt stmts = (*(v__ast__IfBranch*)/*ee elem_sym */array_get(node->branches, 0)).stmts; - if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 345 /* v.ast.ExprStmt */ && !v__ast__Type_alias_eq((/* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(stmts)))._typ, 345) /*expected idx: 345, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 346 /* v.ast.ExprStmt */ && !v__ast__Type_alias_eq((/* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(stmts)))._typ, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { node_is_expr = true; } } @@ -58229,8 +58312,8 @@ bool v__checker__Checker_if_expr_defer_0 = false; bool is_comptime_type_is_expr = false; for (int i = 0; i < node->branches.len; ++i) { v__ast__IfBranch branch = (*(v__ast__IfBranch*)/*ee elem_sym */array_get(node->branches, i)); - if ((branch.cond)._typ == 320 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("unnecessary `()` in `"), 0xfe10, {.d_s = if_kind}}, {_SLIT("` condition, use `"), 0xfe10, {.d_s = if_kind}}, {_SLIT(" expr {` instead of `"), 0xfe10, {.d_s = if_kind}}, {_SLIT(" (expr) {`."), 0, { .d_c = 0 }}})), branch.pos); + if ((branch.cond)._typ == 321 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("unnecessary `()` in `"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT("` condition, use `"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT(" expr {` instead of `"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT(" (expr) {`."), 0, { .d_c = 0 }}})), branch.pos); } if (!node->has_else || i < node->branches.len - 1) { if (node->is_comptime) { @@ -58240,15 +58323,15 @@ bool v__checker__Checker_if_expr_defer_0 = false; c->expected_type = _const_v__ast__bool_type; v__ast__Type cond_typ = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, branch.cond)); if ((v__ast__Type_idx(cond_typ) != _const_v__ast__bool_type_idx || v__ast__Type_has_flag(cond_typ, v__ast__TypeFlag__optional)) && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-bool type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, cond_typ)}}, {_SLIT("` used as if condition"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(branch.cond)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-bool type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, cond_typ)}}, {_SLIT("` used as if condition"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(branch.cond)); } } } if (node->is_comptime) { string comptime_field_name = _SLIT(""); - if ((branch.cond)._typ == 309 /* v.ast.InfixExpr */) { + if ((branch.cond)._typ == 310 /* v.ast.InfixExpr */) { if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - if (((*branch.cond._v__ast__InfixExpr).right)._typ != 331 /* v.ast.TypeNode */ && ((*branch.cond._v__ast__InfixExpr).right)._typ != 298 /* v.ast.ComptimeType */) { + if (((*branch.cond._v__ast__InfixExpr).right)._typ != 332 /* v.ast.TypeNode */ && ((*branch.cond._v__ast__InfixExpr).right)._typ != 299 /* v.ast.ComptimeType */) { v__checker__Checker_error(c, _SLIT("invalid `$if` condition: expected a type"), v__ast__Expr_pos((*branch.cond._v__ast__InfixExpr).right)); v__ast__Type _t1 = 0; // Defer begin @@ -58259,25 +58342,25 @@ bool v__checker__Checker_if_expr_defer_0 = false; return _t1; } v__ast__Expr left = (*branch.cond._v__ast__InfixExpr).left; - if (((*branch.cond._v__ast__InfixExpr).right)._typ == 298 /* v.ast.ComptimeType */ && (left)._typ == 331 /* v.ast.TypeNode */) { + if (((*branch.cond._v__ast__InfixExpr).right)._typ == 299 /* v.ast.ComptimeType */ && (left)._typ == 332 /* v.ast.TypeNode */) { is_comptime_type_is_expr = true; v__ast__Type checked_type = v__checker__Checker_unwrap_generic(c, (*left._v__ast__TypeNode).typ); - should_skip = !v__ast__Table_is_comptime_type(c->table, checked_type, /* as */ *(v__ast__ComptimeType*)__as_cast(((*branch.cond._v__ast__InfixExpr).right)._v__ast__ComptimeType,((*branch.cond._v__ast__InfixExpr).right)._typ, 298) /*expected idx: 298, name: v.ast.ComptimeType */ ); + should_skip = !v__ast__Table_is_comptime_type(c->table, checked_type, /* as */ *(v__ast__ComptimeType*)__as_cast(((*branch.cond._v__ast__InfixExpr).right)._v__ast__ComptimeType,((*branch.cond._v__ast__InfixExpr).right)._typ, 299) /*expected idx: 299, name: v.ast.ComptimeType */ ); } else { - v__ast__Type got_type = v__checker__Checker_unwrap_generic(c, (/* as */ *(v__ast__TypeNode*)__as_cast(((*branch.cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*branch.cond._v__ast__InfixExpr).right)._typ, 331) /*expected idx: 331, name: v.ast.TypeNode */ ).typ); + v__ast__Type got_type = v__checker__Checker_unwrap_generic(c, (/* as */ *(v__ast__TypeNode*)__as_cast(((*branch.cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*branch.cond._v__ast__InfixExpr).right)._typ, 332) /*expected idx: 332, name: v.ast.TypeNode */ ).typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, got_type); if (sym->kind == v__ast__Kind__placeholder || v__ast__Type_has_flag(got_type, v__ast__TypeFlag__generic)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*branch.cond._v__ast__InfixExpr).right)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*branch.cond._v__ast__InfixExpr).right)); } - if ((left)._typ == 325 /* v.ast.SelectorExpr */) { + if ((left)._typ == 326 /* v.ast.SelectorExpr */) { comptime_field_name = v__ast__Expr_str((*left._v__ast__SelectorExpr).expr); map_set(&c->comptime_fields_type, &(string[]){comptime_field_name}, &(v__ast__Type[]) { got_type }); is_comptime_type_is_expr = true; - } else if (((*branch.cond._v__ast__InfixExpr).right)._typ == 331 /* v.ast.TypeNode */ && (left)._typ == 331 /* v.ast.TypeNode */ && sym->kind == v__ast__Kind__interface_) { + } else if (((*branch.cond._v__ast__InfixExpr).right)._typ == 332 /* v.ast.TypeNode */ && (left)._typ == 332 /* v.ast.TypeNode */ && sym->kind == v__ast__Kind__interface_) { is_comptime_type_is_expr = true; v__ast__Type checked_type = v__checker__Checker_unwrap_generic(c, (*left._v__ast__TypeNode).typ); should_skip = !v__ast__Table_does_type_implement_interface(c->table, checked_type, got_type); - } else if ((left)._typ == 331 /* v.ast.TypeNode */) { + } else if ((left)._typ == 332 /* v.ast.TypeNode */) { is_comptime_type_is_expr = true; v__ast__Type left_type = v__checker__Checker_unwrap_generic(c, (*left._v__ast__TypeNode).typ); if (!v__ast__Type_alias_eq(left_type, got_type)) { @@ -58309,7 +58392,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; } } else if (c->pref->output_cross_c) { bool is_freestanding_block = false; - if ((branch.cond)._typ == 305 /* v.ast.Ident */) { + if ((branch.cond)._typ == 306 /* v.ast.Ident */) { if (string__eq((*branch.cond._v__ast__Ident).name, _SLIT("freestanding"))) { is_freestanding_block = true; } @@ -58344,8 +58427,8 @@ bool v__checker__Checker_if_expr_defer_0 = false; c->smartcast_cond_pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); } if (expr_required) { - if (branch.stmts.len > 0 && ((*(v__ast__Stmt*)array_last(branch.stmts)))._typ == 345 /* v.ast.ExprStmt */) { - v__ast__ExprStmt last_expr = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(branch.stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(branch.stmts)))._typ, 345) /*expected idx: 345, name: v.ast.ExprStmt */ ; + if (branch.stmts.len > 0 && ((*(v__ast__Stmt*)array_last(branch.stmts)))._typ == 346 /* v.ast.ExprStmt */) { + v__ast__ExprStmt last_expr = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(branch.stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(branch.stmts)))._typ, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ; c->expected_type = former_expected_type; if (v__ast__Type_has_flag(c->expected_type, v__ast__TypeFlag__optional)) { if (v__ast__Type_alias_eq(node->typ, _const_v__ast__void_type)) { @@ -58403,29 +58486,29 @@ bool v__checker__Checker_if_expr_defer_0 = false; if (v__checker__is_noreturn_callexpr(last_expr.expr)) { continue; } - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, node->typ)}}, {_SLIT("` and `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, last_expr.typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("mismatched types `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, node->typ)}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, last_expr.typ)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = if_kind}}, {_SLIT("` expression requires an expression as the last statement of every branch"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT("` expression requires an expression as the last statement of every branch"), 0, { .d_c = 0 }}})), branch.pos); } for (int _t3 = 0; _t3 < branch.stmts.len; ++_t3) { v__ast__Stmt st = ((v__ast__Stmt*)branch.stmts.data)[_t3]; Option_void _t4 = v__ast__Stmt_check_c_expr(st); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`if` expression branch has "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`if` expression branch has "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); ; } ; } } - if ((branch.cond)._typ == 307 /* v.ast.IfGuardExpr */) { + if ((branch.cond)._typ == 308 /* v.ast.IfGuardExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, (*branch.cond._v__ast__IfGuardExpr).expr_type); if (sym->kind == v__ast__Kind__multi_return) { - v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 481) /*expected idx: 481, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; if ((*branch.cond._v__ast__IfGuardExpr).vars.len != mr_info.types.len) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if guard expects "), 0xfe07, {.d_i32 = mr_info.types.len}}, {_SLIT(" variables, but got "), 0xfe07, {.d_i32 = (*branch.cond._v__ast__IfGuardExpr).vars.len}}, {_SLIT0, 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if guard expects "), /*100 &int*/0xfe07, {.d_i32 = mr_info.types.len}}, {_SLIT(" variables, but got "), /*100 &int*/0xfe07, {.d_i32 = (*branch.cond._v__ast__IfGuardExpr).vars.len}}, {_SLIT0, 0, { .d_c = 0 }}})), branch.pos); } else { for (int vi = 0; vi < (*branch.cond._v__ast__IfGuardExpr).vars.len; ++vi) { v__ast__IfGuardVar var = ((v__ast__IfGuardVar*)(*branch.cond._v__ast__IfGuardExpr).vars.data)[vi]; @@ -58462,7 +58545,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; } if (expr_required && !node->has_else) { string d = (node->is_comptime ? (_SLIT("$")) : (_SLIT(""))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = if_kind}}, {_SLIT("` expression needs `"), 0xfe10, {.d_s = d}}, {_SLIT("else` clause"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = if_kind}}, {_SLIT("` expression needs `"), /*115 &string*/0xfe10, {.d_s = d}}, {_SLIT("else` clause"), 0, { .d_c = 0 }}})), node->pos); } v__ast__Type _t6 = node->typ; // Defer begin @@ -58474,22 +58557,22 @@ bool v__checker__Checker_if_expr_defer_0 = false; } VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* c, v__ast__Expr node, v__ast__Scope* scope) { - if ((node)._typ == 309 /* v.ast.InfixExpr */) { + if ((node)._typ == 310 /* v.ast.InfixExpr */) { if ((*node._v__ast__InfixExpr).op == v__token__Kind__and) { v__checker__Checker_smartcast_if_conds(c, (*node._v__ast__InfixExpr).left, scope); v__checker__Checker_smartcast_if_conds(c, (*node._v__ast__InfixExpr).right, scope); } else if ((*node._v__ast__InfixExpr).op == v__token__Kind__key_is) { v__ast__Expr right_expr = (*node._v__ast__InfixExpr).right; v__ast__Type _t1 = 0; - if (right_expr._typ == 331 /* v.ast.TypeNode */) { + if (right_expr._typ == 332 /* v.ast.TypeNode */) { _t1 = (*right_expr._v__ast__TypeNode).typ; } - else if (right_expr._typ == 317 /* v.ast.None */) { + else if (right_expr._typ == 318 /* v.ast.None */) { _t1 = _const_v__ast__none_type_idx; } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), 0xfe10, {.d_s = v__ast__Expr_str(right_expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid type `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(right_expr)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(right_expr)); _t1 = ((v__ast__Type)(0)); } v__ast__Type right_type = _t1; @@ -58498,7 +58581,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); v__ast__Type expr_type = v__checker__Checker_expr(c, (*node._v__ast__InfixExpr).left); if (left_sym->kind == v__ast__Kind__aggregate) { - expr_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 468) /*expected idx: 468, name: v.ast.Aggregate */ ).sum_type; + expr_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 469) /*expected idx: 469, name: v.ast.Aggregate */ ).sum_type; } if (left_sym->kind == v__ast__Kind__interface_) { if (right_sym->kind != v__ast__Kind__interface_) { @@ -58509,12 +58592,12 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* } else if (!v__checker__Checker_check_types(c, right_type, expr_type) && left_sym->kind != v__ast__Kind__sum_type) { string expect_str = v__ast__Table_type_to_str(c->table, right_type); string expr_str = v__ast__Table_type_to_str(c->table, expr_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use type `"), 0xfe10, {.d_s = expect_str}}, {_SLIT("` as type `"), 0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__InfixExpr).pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use type `"), /*115 &string*/0xfe10, {.d_s = expect_str}}, {_SLIT("` as type `"), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__InfixExpr).pos); } - if ((((*node._v__ast__InfixExpr).left)._typ == 305 /* v.ast.Ident */ || ((*node._v__ast__InfixExpr).left)._typ == 325 /* v.ast.SelectorExpr */) && ((*node._v__ast__InfixExpr).right)._typ == 331 /* v.ast.TypeNode */) { - bool is_variable = (((*node._v__ast__InfixExpr).left)._typ == 305 /* v.ast.Ident */ ? ((*(*node._v__ast__InfixExpr).left._v__ast__Ident).kind == v__ast__IdentKind__variable) : (true)); + if ((((*node._v__ast__InfixExpr).left)._typ == 306 /* v.ast.Ident */ || ((*node._v__ast__InfixExpr).left)._typ == 326 /* v.ast.SelectorExpr */) && ((*node._v__ast__InfixExpr).right)._typ == 332 /* v.ast.TypeNode */) { + bool is_variable = (((*node._v__ast__InfixExpr).left)._typ == 306 /* v.ast.Ident */ ? ((*(*node._v__ast__InfixExpr).left._v__ast__Ident).kind == v__ast__IdentKind__variable) : (true)); if (is_variable) { - if ((((*node._v__ast__InfixExpr).left)._typ == 305 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__Ident,((*node._v__ast__InfixExpr).left)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ).is_mut) || (((*node._v__ast__InfixExpr).left)._typ == 325 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__SelectorExpr,((*node._v__ast__InfixExpr).left)._typ, 325) /*expected idx: 325, name: v.ast.SelectorExpr */ ).is_mut)) { + if ((((*node._v__ast__InfixExpr).left)._typ == 306 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__Ident,((*node._v__ast__InfixExpr).left)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ).is_mut) || (((*node._v__ast__InfixExpr).left)._typ == 326 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__SelectorExpr,((*node._v__ast__InfixExpr).left)._typ, 326) /*expected idx: 326, name: v.ast.SelectorExpr */ ).is_mut)) { v__checker__Checker_fail_if_immutable(c, (*node._v__ast__InfixExpr).left); } if (left_sym->kind == v__ast__Kind__interface_ || left_sym->kind == v__ast__Kind__sum_type) { @@ -58524,7 +58607,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* } } } - } else if ((node)._typ == 312 /* v.ast.Likely */) { + } else if ((node)._typ == 313 /* v.ast.Likely */) { v__checker__Checker_smartcast_if_conds(c, (*node._v__ast__Likely).expr, scope); } } @@ -58533,7 +58616,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__checker__Checker_check_valid_pascal_case(c, node->name, _SLIT("interface name"), node->pos); v__ast__TypeSymbol* decl_sym = v__ast__Table_sym(c->table, node->typ); bool is_js = node->language == v__ast__Language__js; - if ((decl_sym->info)._typ == 473 /* v.ast.Interface */) { + if ((decl_sym->info)._typ == 474 /* v.ast.Interface */) { if (node->embeds.len > 0) { Array_v__ast__InterfaceEmbedding all_embeds = v__checker__Checker_expand_iface_embeds(c, node, 0, node->embeds); node->embeds = all_embeds; @@ -58557,10 +58640,10 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__ast__InterfaceEmbedding embed = ((v__ast__InterfaceEmbedding*)all_embeds.data)[_t1]; v__ast__TypeSymbol* isym = v__ast__Table_sym(c->table, embed.typ); if (isym->kind != v__ast__Kind__interface_) { - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` tries to embed `"), 0xfe10, {.d_s = isym->name}}, {_SLIT("`, but `"), 0xfe10, {.d_s = isym->name}}, {_SLIT("` is not an interface, but `"), 0xfe10, {.d_s = v__ast__Kind_str(isym->kind)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), embed.pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` tries to embed `"), /*115 &string*/0xfe10, {.d_s = isym->name}}, {_SLIT("`, but `"), /*115 &string*/0xfe10, {.d_s = isym->name}}, {_SLIT("` is not an interface, but `"), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(isym->kind)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), embed.pos); continue; } - v__ast__Interface isym_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface isym_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; for (int _t2 = 0; _t2 < isym_info.fields.len; ++_t2) { v__ast__StructField f = ((v__ast__StructField*)isym_info.fields.data)[_t2]; if (!(*(bool*)map_get(ADDR(map, efnames_ds_info), &(string[]){f.name}, &(bool[]){ 0 }))) { @@ -58602,7 +58685,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { string exp = v__ast__Table_type_to_str(c->table, ifield.typ); string got = v__ast__Table_type_to_str(c->table, field.typ); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("embedded interface `"), 0xfe10, {.d_s = embed_decl.name}}, {_SLIT("` conflicts existing field: `"), 0xfe10, {.d_s = ifield.name}}, {_SLIT("`, expecting type: `"), 0xfe10, {.d_s = exp}}, {_SLIT("`, got type: `"), 0xfe10, {.d_s = got}}, {_SLIT("`"), 0, { .d_c = 0 }}})), ifield.pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("embedded interface `"), /*115 &string*/0xfe10, {.d_s = embed_decl.name}}, {_SLIT("` conflicts existing field: `"), /*115 &string*/0xfe10, {.d_s = ifield.name}}, {_SLIT("`, expecting type: `"), /*115 &string*/0xfe10, {.d_s = exp}}, {_SLIT("`, got type: `"), /*115 &string*/0xfe10, {.d_s = got}}, {_SLIT("`"), 0, { .d_c = 0 }}})), ifield.pos); } } } else { @@ -58624,7 +58707,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (msg.len > 0) { string em_sig = v__ast__Table_fn_signature(c->table, (voidptr)&/*qq*/em_fn, ((v__ast__FnSignatureOpts){.skip_receiver = true,.type_only = 0,})); string m_sig = v__ast__Table_fn_signature(c->table, (voidptr)&/*qq*/m_fn, ((v__ast__FnSignatureOpts){.skip_receiver = true,.type_only = 0,})); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("embedded interface `"), 0xfe10, {.d_s = embed_decl.name}}, {_SLIT("` causes conflict: "), 0xfe10, {.d_s = msg}}, {_SLIT(", for interface method `"), 0xfe10, {.d_s = em_sig}}, {_SLIT("` vs `"), 0xfe10, {.d_s = m_sig}}, {_SLIT("`"), 0, { .d_c = 0 }}})), imethod.pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("embedded interface `"), /*115 &string*/0xfe10, {.d_s = embed_decl.name}}, {_SLIT("` causes conflict: "), /*115 &string*/0xfe10, {.d_s = msg}}, {_SLIT(", for interface method `"), /*115 &string*/0xfe10, {.d_s = em_sig}}, {_SLIT("` vs `"), /*115 &string*/0xfe10, {.d_s = m_sig}}, {_SLIT("`"), 0, { .d_c = 0 }}})), imethod.pos); } } } @@ -58653,7 +58736,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (is_js) { v__ast__TypeSymbol* mtyp = v__ast__Table_sym(c->table, method.return_type); if (!v__ast__TypeSymbol_is_js_compatible(mtyp)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("method "), 0xfe10, {.d_s = method.name}}, {_SLIT(" returns non JS type"), 0, { .d_c = 0 }}})), method.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("method "), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT(" returns non JS type"), 0, { .d_c = 0 }}})), method.pos); } } for (int j = 0; j < method.params.len; ++j) { @@ -58669,12 +58752,12 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac ; if (Array_string_contains(_const_v__checker__reserved_type_names, param.name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), 0xfe10, {.d_s = param.name}}, {_SLIT("` as a parameter name"), 0, { .d_c = 0 }}})), param.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid use of reserved type `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` as a parameter name"), 0, { .d_c = 0 }}})), param.pos); } if (is_js) { v__ast__TypeSymbol* ptyp = v__ast__Table_sym(c->table, param.typ); if (!v__ast__TypeSymbol_is_js_compatible(ptyp) && !(j == method.params.len - 1 && method.is_variadic)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("method `"), 0xfe10, {.d_s = method.name}}, {_SLIT("` accepts non JS type as parameter"), 0, { .d_c = 0 }}})), method.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("method `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("` accepts non JS type as parameter"), 0, { .d_c = 0 }}})), method.pos); } } } @@ -58682,12 +58765,12 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__ast__StructField field = ((v__ast__StructField*)node->fields.data)[_t19]; v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, field.typ); if (string__eq(field.name, method.name) && field_sym->kind == v__ast__Kind__function) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = decl_sym->name}}, {_SLIT("` has both field and method named `"), 0xfe10, {.d_s = method.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method.pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = decl_sym->name}}, {_SLIT("` has both field and method named `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method.pos); } } for (int j = 0; j < i; ++j) { if (string__eq(method.name, (*(v__ast__FnDecl*)/*ee elem_sym */array_get(node->methods, j)).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method name `"), 0xfe10, {.d_s = method.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method name `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method.pos); } } } @@ -58706,7 +58789,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (is_js) { v__ast__TypeSymbol* tsym = v__ast__Table_sym(c->table, field.typ); if (!v__ast__TypeSymbol_is_js_compatible(tsym)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` uses non JS type"), 0, { .d_c = 0 }}})), field.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` uses non JS type"), 0, { .d_c = 0 }}})), field.pos); } } if (v__ast__Type_alias_eq(field.typ, node->typ) && node->language != v__ast__Language__js) { @@ -58714,7 +58797,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac } for (int j = 0; j < i; ++j) { if (string__eq(field.name, (*(v__ast__StructField*)/*ee elem_sym */array_get(node->fields, j)).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field.pos); } } } @@ -58725,7 +58808,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch v__ast__Type utyp = v__checker__Checker_unwrap_generic(c, typ); v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(c->table, utyp); v__ast__TypeSymbol* inter_sym = v__ast__Table_sym(c->table, interface_type); - if ((inter_sym->info)._typ == 473 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 474 /* v.ast.Interface */) { if ((*inter_sym->info._v__ast__Interface).is_generic) { Array_v__ast__Type inferred_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); Array_string _t1 = {0}; @@ -58760,7 +58843,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch Option_v__ast__Fn _t8 = v__ast__TypeSymbol_find_method_with_generic_parent(typ_sym, imethod.name); if (_t8.state != 0) { /*or block*/ err = _t8.err; - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("can not find method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` on `"), 0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`, needed for interface: `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("can not find method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` on `"), /*115 &string*/0xfe10, {.d_s = typ_sym->name}}, {_SLIT("`, needed for interface: `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); v__ast__Type _t9 = 0; return _t9; } @@ -58773,16 +58856,16 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch v__ast__TypeSymbol* imret_sym = v__ast__Table_sym(c->table, imethod.return_type); v__ast__TypeSymbol* mret_sym = v__ast__Table_sym(c->table, method.return_type); if (v__ast__Type_alias_eq(method.return_type, _const_v__ast__void_type) && !v__ast__Type_alias_eq(imethod.return_type, method.return_type)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("interface method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` returns `"), 0xfe10, {.d_s = imret_sym->name}}, {_SLIT("`, but implementation method `"), 0xfe10, {.d_s = method.name}}, {_SLIT("` returns no value"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("interface method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` returns `"), /*115 &string*/0xfe10, {.d_s = imret_sym->name}}, {_SLIT("`, but implementation method `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("` returns no value"), 0, { .d_c = 0 }}})), pos); v__ast__Type _t10 = 0; return _t10; } if (v__ast__Type_alias_eq(imethod.return_type, _const_v__ast__void_type) && !v__ast__Type_alias_eq(imethod.return_type, method.return_type)) { - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("interface method `"), 0xfe10, {.d_s = imethod.name}}, {_SLIT("` returns no value, but implementation method `"), 0xfe10, {.d_s = method.name}}, {_SLIT("` returns `"), 0xfe10, {.d_s = mret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("interface method `"), /*115 &string*/0xfe10, {.d_s = imethod.name}}, {_SLIT("` returns no value, but implementation method `"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("` returns `"), /*115 &string*/0xfe10, {.d_s = mret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); v__ast__Type _t11 = 0; return _t11; } - if ((imret_sym->info)._typ == 481 /* v.ast.MultiReturn */ && (mret_sym->info)._typ == 481 /* v.ast.MultiReturn */) { + if ((imret_sym->info)._typ == 482 /* v.ast.MultiReturn */ && (mret_sym->info)._typ == 482 /* v.ast.MultiReturn */) { for (int i = 0; i < (*imret_sym->info._v__ast__MultiReturn).types.len; ++i) { v__ast__Type mr_typ = ((v__ast__Type*)(*imret_sym->info._v__ast__MultiReturn).types.data)[i]; if (v__ast__Type_has_flag(mr_typ, v__ast__TypeFlag__generic) && string__eq(v__ast__Table_get_type_name(c->table, mr_typ), gt_name)) { @@ -58819,7 +58902,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch } } if (v__ast__Type_alias_eq(inferred_type, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not infer generic type `"), 0xfe10, {.d_s = gt_name}}, {_SLIT("` in interface `"), 0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not infer generic type `"), /*115 &string*/0xfe10, {.d_s = gt_name}}, {_SLIT("` in interface `"), /*115 &string*/0xfe10, {.d_s = inter_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); v__ast__Type _t14 = interface_type; return _t14; } @@ -58845,7 +58928,7 @@ v__ast__Type v__checker__Checker_match_expr(v__checker__Checker* c, v__ast__Matc bool v__checker__Checker_match_expr_defer_0 = false; node->is_expr = !v__ast__Type_alias_eq(c->expected_type, _const_v__ast__void_type); node->expected_type = c->expected_type; - if ((node->cond)._typ == 320 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { + if ((node->cond)._typ == 321 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { v__checker__Checker_error(c, _SLIT("unnecessary `()` in `match` condition, use `match expr {` instead of `match (expr) {`."), (*node->cond._v__ast__ParExpr).pos); } if (node->is_expr) { @@ -58854,7 +58937,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; } v__ast__Type cond_type = v__checker__Checker_expr(c, node->cond); node->cond_type = v__ast__mktyp(cond_type); - if (((node->cond)._typ == 305 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->cond)._v__ast__Ident,(node->cond)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ).is_mut) || ((node->cond)._typ == 325 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast((node->cond)._v__ast__SelectorExpr,(node->cond)._typ, 325) /*expected idx: 325, name: v.ast.SelectorExpr */ ).is_mut)) { + if (((node->cond)._typ == 306 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->cond)._v__ast__Ident,(node->cond)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ).is_mut) || ((node->cond)._typ == 326 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast((node->cond)._v__ast__SelectorExpr,(node->cond)._typ, 326) /*expected idx: 326, name: v.ast.SelectorExpr */ ).is_mut)) { v__checker__Checker_fail_if_immutable(c, node->cond); } Option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->cond_type, node->pos); @@ -58896,7 +58979,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; Option_void _t6 = v__ast__Stmt_check_c_expr(st); if (_t6.state != 0 && _t6.err._typ != _IError_None___index) { IError err = _t6.err; - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`match` expression branch has "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`match` expression branch has "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); ; } @@ -58908,7 +58991,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; } if (branch.stmts.len > 0) { v__ast__Stmt stmt = (*(v__ast__Stmt*)array_last(branch.stmts)); - if ((stmt)._typ == 345 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { if (node->is_expr) { c->expected_type = node->expected_type; } @@ -58943,7 +59026,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; continue; } } - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return type mismatch, it should be `"), 0xfe10, {.d_s = ret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return type mismatch, it should be `"), /*115 &string*/0xfe10, {.d_s = ret_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr)); } } } @@ -59018,15 +59101,15 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ for (int k = 0; k < branch.exprs.len; ++k) { v__ast__Expr expr = ((v__ast__Expr*)branch.exprs.data)[k]; string key = _SLIT(""); - if ((expr)._typ == 323 /* v.ast.RangeExpr */) { + if ((expr)._typ == 324 /* v.ast.RangeExpr */) { i64 low = ((i64)(0)); i64 high = ((i64)(0)); c->expected_type = node->expected_type; v__ast__Expr low_expr = (*expr._v__ast__RangeExpr).low; v__ast__Expr high_expr = (*expr._v__ast__RangeExpr).high; v__ast__TypeSymbol* final_cond_sym = v__ast__Table_final_sym(c->table, node->cond_type); - if ((low_expr)._typ == 310 /* v.ast.IntegerLiteral */) { - if ((high_expr)._typ == 310 /* v.ast.IntegerLiteral */ && (v__ast__TypeSymbol_is_int(final_cond_sym) || (final_cond_sym->info)._typ == 484 /* v.ast.Enum */)) { + if ((low_expr)._typ == 311 /* v.ast.IntegerLiteral */) { + if ((high_expr)._typ == 311 /* v.ast.IntegerLiteral */ && (v__ast__TypeSymbol_is_int(final_cond_sym) || (final_cond_sym->info)._typ == 485 /* v.ast.Enum */)) { low = string_i64((*low_expr._v__ast__IntegerLiteral).val); high = string_i64((*high_expr._v__ast__IntegerLiteral).val); if (low > high) { @@ -59035,8 +59118,8 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } else { v__checker__Checker_error(c, _SLIT("mismatched range types"), (*low_expr._v__ast__IntegerLiteral).pos); } - } else if ((low_expr)._typ == 294 /* v.ast.CharLiteral */) { - if ((high_expr)._typ == 294 /* v.ast.CharLiteral */ && (final_cond_sym->kind == v__ast__Kind__u8 || final_cond_sym->kind == v__ast__Kind__char || final_cond_sym->kind == v__ast__Kind__rune)) { + } else if ((low_expr)._typ == 295 /* v.ast.CharLiteral */) { + if ((high_expr)._typ == 295 /* v.ast.CharLiteral */ && (final_cond_sym->kind == v__ast__Kind__u8 || final_cond_sym->kind == v__ast__Kind__char || final_cond_sym->kind == v__ast__Kind__rune)) { low = string_at((*low_expr._v__ast__CharLiteral).val, 0); high = string_at((*high_expr._v__ast__CharLiteral).val, 0); if (low > high) { @@ -59047,27 +59130,27 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } else { string typ = v__ast__Table_type_to_str(c->table, v__checker__Checker_expr(c, (*expr._v__ast__RangeExpr).low)); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use type `"), 0xfe10, {.d_s = typ}}, {_SLIT("` in match range"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use type `"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT("` in match range"), 0, { .d_c = 0 }}})), branch.pos); } int high_low_cutoff = 1000; if (high - low > high_low_cutoff) { - v__checker__Checker_warn(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("more than "), 0xfe07, {.d_i32 = high_low_cutoff}}, {_SLIT(" possibilities ("), 0xfe09, {.d_i64 = low}}, {_SLIT(" ... "), 0xfe09, {.d_i64 = high}}, {_SLIT(") in match range"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_warn(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("more than "), /*100 &int*/0xfe07, {.d_i32 = high_low_cutoff}}, {_SLIT(" possibilities ("), /*100 &i64*/0xfe09, {.d_i64 = low}}, {_SLIT(" ... "), /*100 &i64*/0xfe09, {.d_i64 = high}}, {_SLIT(") in match range"), 0, { .d_c = 0 }}})), branch.pos); } for (i64 i = low; i < high + 1; ++i) { key = i64_str(i); int val = (_IN_MAP(ADDR(string, key), ADDR(map, branch_exprs)) ? ((*(int*)map_get(ADDR(map, branch_exprs), &(string[]){key}, &(int[]){ 0 }))) : (0)); if (val == 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("match case `"), 0xfe10, {.d_s = key}}, {_SLIT("` is handled more than once"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("match case `"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("` is handled more than once"), 0, { .d_c = 0 }}})), branch.pos); } map_set(&branch_exprs, &(string[]){key}, &(int[]) { val + 1 }); } continue; } - if (expr._typ == 331 /* v.ast.TypeNode */) { + if (expr._typ == 332 /* v.ast.TypeNode */) { key = v__ast__Table_type_to_str(c->table, (*expr._v__ast__TypeNode).typ); array_push((array*)&expr_types, _MOV((v__ast__TypeNode[]){ (*expr._v__ast__TypeNode) })); } - else if (expr._typ == 302 /* v.ast.EnumVal */) { + else if (expr._typ == 303 /* v.ast.EnumVal */) { key = (*expr._v__ast__EnumVal).val; } @@ -59077,7 +59160,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ ; int val = (_IN_MAP(ADDR(string, key), ADDR(map, branch_exprs)) ? ((*(int*)map_get(ADDR(map, branch_exprs), &(string[]){key}, &(int[]){ 0 }))) : (0)); if (val == 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("match case `"), 0xfe10, {.d_s = key}}, {_SLIT("` is handled more than once"), 0, { .d_c = 0 }}})), branch.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("match case `"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("` is handled more than once"), 0, { .d_c = 0 }}})), branch.pos); } c->expected_type = node->cond_type; v__ast__Type expr_type = v__checker__Checker_expr(c, expr); @@ -59094,7 +59177,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } } - } else if ((cond_type_sym.info)._typ == 474 /* v.ast.SumType */) { + } else if ((cond_type_sym.info)._typ == 475 /* v.ast.SumType */) { if (!Array_v__ast__Type_contains((*cond_type_sym.info._v__ast__SumType).variants, expr_type)) { string expr_str = v__ast__Table_type_to_str(c->table, expr_type); string expect_str = v__ast__Table_type_to_str(c->table, node->cond_type); @@ -59110,16 +59193,16 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } Array_string sumtype_variant_names =_t2; v__util__Suggestion suggestion = v__util__new_suggestion(expr_str, sumtype_variant_names); - v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = expect_str}}, {_SLIT("` has no variant `"), 0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), v__ast__Expr_pos(expr)); + v__checker__Checker_error(c, v__util__Suggestion_say(suggestion, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = expect_str}}, {_SLIT("` has no variant `"), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), v__ast__Expr_pos(expr)); } - } else if ((cond_type_sym.info)._typ == 470 /* v.ast.Alias */ && (expr_type_sym->info)._typ == 455 /* v.ast.Struct */) { + } else if ((cond_type_sym.info)._typ == 471 /* v.ast.Alias */ && (expr_type_sym->info)._typ == 456 /* v.ast.Struct */) { string expr_str = v__ast__Table_type_to_str(c->table, expr_type); string expect_str = v__ast__Table_type_to_str(c->table, node->cond_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot match alias type `"), 0xfe10, {.d_s = expect_str}}, {_SLIT("` with `"), 0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot match alias type `"), /*115 &string*/0xfe10, {.d_s = expect_str}}, {_SLIT("` with `"), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); } else if (!v__checker__Checker_check_types(c, expr_type, node->cond_type)) { string expr_str = v__ast__Table_type_to_str(c->table, expr_type); string expect_str = v__ast__Table_type_to_str(c->table, node->cond_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot match `"), 0xfe10, {.d_s = expect_str}}, {_SLIT("` with `"), 0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot match `"), /*115 &string*/0xfe10, {.d_s = expect_str}}, {_SLIT("` with `"), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(expr)); } map_set(&branch_exprs, &(string[]){key}, &(int[]) { val + 1 }); } @@ -59137,7 +59220,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ strings__Builder_write_string(&agg_cname, _SLIT("___")); } string type_str = v__ast__Table_type_to_str(c->table, expr.typ); - string name = (c->is_builtin_mod ? (type_str) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = c->mod}}, {_SLIT("."), 0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string name = (c->is_builtin_mod ? (type_str) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = c->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = type_str}}, {_SLIT0, 0, { .d_c = 0 }}})))); strings__Builder_write_string(&agg_name, name); strings__Builder_write_string(&agg_cname, v__util__no_dots(name)); } @@ -59174,26 +59257,26 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ string v = ((string*)variants.data)[_t6]; if (!_IN_MAP(ADDR(string, v), ADDR(map, branch_exprs))) { is_exhaustive = false; - array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); } } } else { - if (cond_type_sym.info._typ == 474 /* v.ast.SumType */) { + if (cond_type_sym.info._typ == 475 /* v.ast.SumType */) { for (int _t8 = 0; _t8 < (*cond_type_sym.info._v__ast__SumType).variants.len; ++_t8) { v__ast__Type v = ((v__ast__Type*)(*cond_type_sym.info._v__ast__SumType).variants.data)[_t8]; string v_str = v__ast__Table_type_to_str(c->table, v); if (!_IN_MAP(ADDR(string, v_str), ADDR(map, branch_exprs))) { is_exhaustive = false; - array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = v_str}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); } } } - else if (cond_type_sym.info._typ == 484 /* v.ast.Enum */) { + else if (cond_type_sym.info._typ == 485 /* v.ast.Enum */) { for (int _t10 = 0; _t10 < (*cond_type_sym.info._v__ast__Enum).vals.len; ++_t10) { string v = ((string*)(*cond_type_sym.info._v__ast__Enum).vals.data)[_t10]; if (!_IN_MAP(ADDR(string, v), ADDR(map, branch_exprs))) { is_exhaustive = false; - array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), 0xfe10, {.d_s = v}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&unhandled, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`."), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("`"), 0, { .d_c = 0 }}}))) })); } } } @@ -59233,7 +59316,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ int remaining = unhandled.len - c->match_exhaustive_cutoff_limit; err_details = /*f*/string__plus(err_details, Array_string_join(array_slice(unhandled, 0, c->match_exhaustive_cutoff_limit), _SLIT(", "))); if (remaining > 0) { - err_details = /*f*/string__plus(err_details, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", and "), 0xfe07, {.d_i32 = remaining}}, {_SLIT(" others ..."), 0, { .d_c = 0 }}}))); + err_details = /*f*/string__plus(err_details, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", and "), /*100 &int*/0xfe07, {.d_i32 = remaining}}, {_SLIT(" others ..."), 0, { .d_c = 0 }}}))); } } err_details = /*f*/string__plus(err_details, _SLIT(" or `else {}` at the end)")); @@ -59262,8 +59345,8 @@ bool v__checker__Checker_sql_expr_defer_0 = false; ; c->cur_orm_ts = *sym; - if ((sym->info)._typ != 455 /* v.ast.Struct */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("The table symbol `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` has to be a struct"), 0, { .d_c = 0 }}})), node->table_expr.pos); + if ((sym->info)._typ != 456 /* v.ast.Struct */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("The table symbol `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` has to be a struct"), 0, { .d_c = 0 }}})), node->table_expr.pos); v__ast__Type _t3 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_sql_expr_defer_0) { @@ -59272,7 +59355,7 @@ bool v__checker__Checker_sql_expr_defer_0 = false; // Defer end return _t3; } - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; Array_v__ast__StructField fields = v__checker__Checker_fetch_and_verify_orm_fields(c, info, node->table_expr.pos, sym->name); Map_int_v__ast__SqlExpr sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlExpr), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop); Array_v__ast__StructField _t5 = {0}; @@ -59394,8 +59477,8 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; ; v__ast__TypeSymbol* table_sym = v__ast__Table_sym(c->table, node->table_expr.typ); c->cur_orm_ts = *table_sym; - if ((table_sym->info)._typ != 455 /* v.ast.Struct */) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = table_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + if ((table_sym->info)._typ != 456 /* v.ast.Struct */) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = table_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t3 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_sql_stmt_line_defer_0) { @@ -59404,7 +59487,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; // Defer end return _t3; } - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((table_sym->info)._v__ast__Struct,(table_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((table_sym->info)._v__ast__Struct,(table_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; Array_v__ast__StructField fields = v__checker__Checker_fetch_and_verify_orm_fields(c, info, node->table_expr.pos, table_sym->name); Map_int_v__ast__SqlStmtLine sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlStmtLine), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop); Array_v__ast__StructField _t5 = {0}; @@ -59422,7 +59505,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; for (int _t7 = 0; _t7 < _t4.len; ++_t7) { v__ast__StructField f = ((v__ast__StructField*)_t4.data)[_t7]; v__ast__Type typ = (v__ast__Table_sym(c->table, f.typ)->kind == v__ast__Kind__struct_ ? (f.typ) : v__ast__Table_sym(c->table, f.typ)->kind == v__ast__Kind__array ? (v__ast__TypeSymbol_array_info(v__ast__Table_sym(c->table, f.typ)).elem_type) : (((v__ast__Type)(0)))); - string object_var_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node->object_var_name}}, {_SLIT("."), 0xfe10, {.d_s = f.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string object_var_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node->object_var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!v__ast__Type_alias_eq(typ, f.typ)) { object_var_name = node->object_var_name; } @@ -59449,7 +59532,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; } Array_v__ast__StructField x =_t8; if (x.len == 0) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = table_sym->name}}, {_SLIT("` has no field named `"), 0xfe10, {.d_s = column}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = table_sym->name}}, {_SLIT("` has no field named `"), /*115 &string*/0xfe10, {.d_s = column}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); continue; } v__ast__StructField field = (*(v__ast__StructField*)/*ee elem_sym */array_get(x, 0)); @@ -59461,7 +59544,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; v__checker__Checker_expr(c, expr); } } - if ((node->where_expr)._typ != 301 /* v.ast.EmptyExpr */) { + if ((node->where_expr)._typ != 302 /* v.ast.EmptyExpr */) { v__checker__Checker_expr(c, node->where_expr); } v__ast__Type _t11 = _const_v__ast__void_type; @@ -59487,12 +59570,12 @@ VV_LOCAL_SYMBOL Array_v__ast__StructField v__checker__Checker_fetch_and_verify_o } Array_v__ast__StructField fields =_t1; if (fields.len == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("V orm: select: empty fields in `"), 0xfe10, {.d_s = table_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("V orm: select: empty fields in `"), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); Array_v__ast__StructField _t3 = __new_array_with_default(0, 0, sizeof(v__ast__StructField), 0); return _t3; } if (!string__eq((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, 0)).name, _SLIT("id"))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("V orm: `id int` must be the first field in `"), 0xfe10, {.d_s = table_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("V orm: `id int` must be the first field in `"), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); } Array_v__ast__StructField _t4 = fields; return _t4; @@ -59508,7 +59591,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } else if (node->exprs.len == 0 && !(v__ast__Type_alias_eq(c->expected_type, _const_v__ast__void_type) || expected_type_sym->kind == v__ast__Kind__void)) { string stype = v__ast__Table_type_to_str(c->table, expected_type); string arg = (expected_type_sym->kind == v__ast__Kind__multi_return ? (_SLIT("arguments")) : (_SLIT("argument"))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), 0xfe10, {.d_s = stype}}, {_SLIT("` "), 0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("expected `"), /*115 &string*/0xfe10, {.d_s = stype}}, {_SLIT("` "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); return; } if (node->exprs.len == 0) { @@ -59516,7 +59599,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } bool exp_is_optional = v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional); Array_v__ast__Type expected_types = new_array_from_c_array(1, 1, sizeof(v__ast__Type), _MOV((v__ast__Type[1]){expected_type})); - if ((expected_type_sym->info)._typ == 481 /* v.ast.MultiReturn */) { + if ((expected_type_sym->info)._typ == 482 /* v.ast.MultiReturn */) { expected_types = (*expected_type_sym->info._v__ast__MultiReturn).types; if (c->table->cur_concrete_types.len > 0) { Array_v__ast__Type _t1 = {0}; @@ -59538,7 +59621,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod v__ast__Expr expr = ((v__ast__Expr*)node->exprs.data)[i]; v__ast__Type typ = v__checker__Checker_expr(c, expr); if (v__ast__Type_alias_eq(typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__ast__Expr_str(expr)}}, {_SLIT("` used as value"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(expr)}}, {_SLIT("` used as value"), 0, { .d_c = 0 }}})), node->pos); } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, typ); if (sym->kind == v__ast__Kind__multi_return) { @@ -59548,8 +59631,8 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod array_push((array*)&expr_idxs, _MOV((int[]){ i })); } } else { - if ((expr)._typ == 305 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((expr)._typ == 306 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { if ((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts.len > 0) { typ = v__checker__Checker_unwrap_generic(c, (*(v__ast__Type*)array_last((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts))); } @@ -59570,7 +59653,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } if (expected_types.len > 0 && expected_types.len != got_types.len) { string arg = (expected_types.len == 1 ? (_SLIT("argument")) : (_SLIT("arguments"))); - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = expected_types.len}}, {_SLIT(" "), 0xfe10, {.d_s = arg}}, {_SLIT(", but got "), 0xfe07, {.d_i32 = got_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = expected_types.len}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(", but got "), /*100 &int*/0xfe07, {.d_i32 = got_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); return; } for (int i = 0; i < expected_types.len; ++i) { @@ -59578,7 +59661,7 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod v__ast__Type got_typ = v__checker__Checker_unwrap_generic(c, (*(v__ast__Type*)/*ee elem_sym */array_get(got_types, i))); if (v__ast__Type_has_flag(got_typ, v__ast__TypeFlag__optional) && (!v__ast__Type_has_flag(exp_type, v__ast__TypeFlag__optional) || !string__eq(v__ast__Table_type_to_str(c->table, got_typ), v__ast__Table_type_to_str(c->table, exp_type)))) { v__token__Pos pos = v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i))))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` as type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("` in return argument"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` as type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("` in return argument"), 0, { .d_c = 0 }}})), pos); } if (!v__checker__Checker_check_types(c, got_typ, exp_type)) { v__ast__TypeSymbol* got_typ_sym = v__ast__Table_sym(c->table, got_typ); @@ -59592,26 +59675,26 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod continue; } v__token__Pos pos = v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i))))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), 0xfe10, {.d_s = got_typ_sym->name}}, {_SLIT("` as type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("` in return argument"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use `"), /*115 &string*/0xfe10, {.d_s = got_typ_sym->name}}, {_SLIT("` as type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("` in return argument"), 0, { .d_c = 0 }}})), pos); } if ((v__ast__Type_is_ptr(got_typ) || v__ast__Type_is_pointer(got_typ)) && (!v__ast__Type_is_ptr(exp_type) && !v__ast__Type_is_pointer(exp_type))) { v__token__Pos pos = v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i))))); if (v__ast__Expr_is_auto_deref_var((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i)))))) { continue; } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn `"), 0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` expects you to return a non reference type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("`, but you are returning `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` expects you to return a non reference type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("`, but you are returning `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), pos); } if ((v__ast__Type_is_ptr(exp_type) || v__ast__Type_is_pointer(exp_type)) && (!v__ast__Type_is_ptr(got_typ) && !v__ast__Type_is_pointer(got_typ)) && !v__ast__Type_alias_eq(got_typ, _const_v__ast__int_literal_type) && !c->pref->translated && !c->file->is_translated) { v__token__Pos pos = v__ast__Expr_pos((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i))))); if (v__ast__Expr_is_auto_deref_var((*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, (*(int*)/*ee elem_sym */array_get(expr_idxs, i)))))) { continue; } - v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn `"), 0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` expects you to return a reference type `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("`, but you are returning `"), 0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), pos); + v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("fn `"), /*115 &string*/0xfe10, {.d_s = c->table->cur_fn->name}}, {_SLIT("` expects you to return a reference type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, exp_type)}}, {_SLIT("`, but you are returning `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, got_typ)}}, {_SLIT("` instead"), 0, { .d_c = 0 }}})), pos); } if (v__ast__Type_is_ptr(exp_type) && v__ast__Type_is_ptr(got_typ)) { v__ast__Expr* r_expr = &(*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, i)); - if ((r_expr)->_typ == 305 /* v.ast.Ident */) { - if (((*r_expr->_v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((r_expr)->_typ == 306 /* v.ast.Ident */) { + if (((*r_expr->_v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { v__ast__Var* obj = &(*(*r_expr->_v__ast__Ident).obj._v__ast__Var); if (c->fn_scope != ((voidptr)(0))) { Option_v__ast__Var_ptr _t8 = v__ast__Scope_find_var(c->fn_scope, (*(*r_expr->_v__ast__Ident).obj._v__ast__Var).name); @@ -59625,8 +59708,8 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod if (obj->is_stack_obj && !c->inside_unsafe) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, v__ast__Type_set_nr_muls(obj->typ, 0)); if (!v__ast__TypeSymbol_is_heap(type_sym) && !c->pref->translated && !c->file->is_translated) { - string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*r_expr->_v__ast__Ident).name}}, {_SLIT("` cannot be returned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), 0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*r_expr->_v__ast__Ident).pos); + string suggestion = (type_sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*r_expr->_v__ast__Ident).name}}, {_SLIT("` cannot be returned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), /*115 &string*/0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*r_expr->_v__ast__Ident).pos); } } } @@ -59635,9 +59718,9 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } if (exp_is_optional && node->exprs.len > 0) { v__ast__Expr expr0 = (*(v__ast__Expr*)/*ee elem_sym */array_get(node->exprs, 0)); - if ((expr0)._typ == 291 /* v.ast.CallExpr */) { - if ((*expr0._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate && node->exprs.len == 1) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`?` is not needed, use `return "), 0xfe10, {.d_s = (*expr0._v__ast__CallExpr).name}}, {_SLIT("()`"), 0, { .d_c = 0 }}})), (*expr0._v__ast__CallExpr).pos); + if ((expr0)._typ == 292 /* v.ast.CallExpr */) { + if ((*expr0._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option && node->exprs.len == 1) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`?` is not needed, use `return "), /*115 &string*/0xfe10, {.d_s = (*expr0._v__ast__CallExpr).name}}, {_SLIT("()`"), 0, { .d_c = 0 }}})), (*expr0._v__ast__CallExpr).pos); } } } @@ -59647,8 +59730,8 @@ void v__checker__Checker_find_unreachable_statements_after_noreturn_calls(v__che bool prev_stmt_was_noreturn_call = false; for (int _t1 = 0; _t1 < stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[_t1]; - if ((stmt)._typ == 345 /* v.ast.ExprStmt */) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 291 /* v.ast.CallExpr */) { + if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 292 /* v.ast.CallExpr */) { if (prev_stmt_was_noreturn_call) { v__checker__Checker_error(c, _SLIT("unreachable code after a [noreturn] call"), (*stmt._v__ast__ExprStmt).pos); return; @@ -59664,18 +59747,18 @@ void v__checker__Checker_find_unreachable_statements_after_noreturn_calls(v__che VV_LOCAL_SYMBOL bool v__checker__has_top_return(Array_v__ast__Stmt stmts) { for (int _t1 = 0; _t1 < stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[_t1]; - if (stmt._typ == 356 /* v.ast.Return */) { + if (stmt._typ == 357 /* v.ast.Return */) { bool _t2 = true; return _t2; } - else if (stmt._typ == 338 /* v.ast.Block */) { + else if (stmt._typ == 339 /* v.ast.Block */) { if (v__checker__has_top_return((*stmt._v__ast__Block).stmts)) { bool _t3 = true; return _t3; } } - else if (stmt._typ == 345 /* v.ast.ExprStmt */) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 291 /* v.ast.CallExpr */) { + else if (stmt._typ == 346 /* v.ast.ExprStmt */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 292 /* v.ast.CallExpr */) { if ((*(*stmt._v__ast__ExprStmt).expr._v__ast__CallExpr).is_noreturn) { bool _t4 = true; return _t4; @@ -59707,8 +59790,8 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_noreturn_fn_decl(v__checker__Chec if (node->stmts.len != 0) { bool is_valid_end_of_noreturn_fn = false; v__ast__Stmt last_stmt = (*(v__ast__Stmt*)array_last(node->stmts)); - if (last_stmt._typ == 345 /* v.ast.ExprStmt */) { - if (((*last_stmt._v__ast__ExprStmt).expr)._typ == 291 /* v.ast.CallExpr */) { + if (last_stmt._typ == 346 /* v.ast.ExprStmt */) { + if (((*last_stmt._v__ast__ExprStmt).expr)._typ == 292 /* v.ast.CallExpr */) { if ((*(*last_stmt._v__ast__ExprStmt).expr._v__ast__CallExpr).should_be_skipped) { v__checker__Checker_error(c, _SLIT("[noreturn] functions cannot end with a skippable `[if ..]` call"), (*last_stmt._v__ast__ExprStmt).pos); return; @@ -59718,7 +59801,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_noreturn_fn_decl(v__checker__Chec } } } - else if (last_stmt._typ == 348 /* v.ast.ForStmt */) { + else if (last_stmt._typ == 349 /* v.ast.ForStmt */) { if ((*last_stmt._v__ast__ForStmt).is_inf && (*last_stmt._v__ast__ForStmt).stmts.len == 0) { is_valid_end_of_noreturn_fn = true; } @@ -59741,24 +59824,24 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } for (int _t2 = 0; _t2 < stmts.len; ++_t2) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[_t2]; - if (stmt._typ == 356 /* v.ast.Return */) { + if (stmt._typ == 357 /* v.ast.Return */) { bool _t3 = true; return _t3; } - else if (stmt._typ == 338 /* v.ast.Block */) { + else if (stmt._typ == 339 /* v.ast.Block */) { if (v__checker__uses_return_stmt((*stmt._v__ast__Block).stmts)) { bool _t4 = true; return _t4; } } - else if (stmt._typ == 345 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).expr._typ == 291 /* v.ast.CallExpr */) { + else if (stmt._typ == 346 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 292 /* v.ast.CallExpr */) { if (v__checker__uses_return_stmt((*(*stmt._v__ast__ExprStmt).expr._v__ast__CallExpr).or_block.stmts)) { bool _t5 = true; return _t5; } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 315 /* v.ast.MatchExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 316 /* v.ast.MatchExpr */) { for (int _t6 = 0; _t6 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.len; ++_t6) { v__ast__MatchBranch b = ((v__ast__MatchBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__MatchExpr).branches.data)[_t6]; if (v__checker__uses_return_stmt(b.stmts)) { @@ -59767,7 +59850,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 324 /* v.ast.SelectExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 325 /* v.ast.SelectExpr */) { for (int _t8 = 0; _t8 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__SelectExpr).branches.len; ++_t8) { v__ast__SelectBranch b = ((v__ast__SelectBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__SelectExpr).branches.data)[_t8]; if (v__checker__uses_return_stmt(b.stmts)) { @@ -59776,7 +59859,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 306 /* v.ast.IfExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 307 /* v.ast.IfExpr */) { for (int _t10 = 0; _t10 < (*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.len; ++_t10) { v__ast__IfBranch b = ((v__ast__IfBranch*)(*(*stmt._v__ast__ExprStmt).expr._v__ast__IfExpr).branches.data)[_t10]; if (v__checker__uses_return_stmt(b.stmts)) { @@ -59790,19 +59873,19 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } ; } - else if (stmt._typ == 348 /* v.ast.ForStmt */) { + else if (stmt._typ == 349 /* v.ast.ForStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForStmt).stmts)) { bool _t12 = true; return _t12; } } - else if (stmt._typ == 346 /* v.ast.ForCStmt */) { + else if (stmt._typ == 347 /* v.ast.ForCStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForCStmt).stmts)) { bool _t13 = true; return _t13; } } - else if (stmt._typ == 347 /* v.ast.ForInStmt */) { + else if (stmt._typ == 348 /* v.ast.ForInStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForInStmt).stmts)) { bool _t14 = true; return _t14; @@ -59818,7 +59901,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } VV_LOCAL_SYMBOL bool v__checker__is_noreturn_callexpr(v__ast__Expr expr) { - if ((expr)._typ == 291 /* v.ast.CallExpr */) { + if ((expr)._typ == 292 /* v.ast.CallExpr */) { bool _t1 = (*expr._v__ast__CallExpr).is_noreturn; return _t1; } @@ -59827,7 +59910,7 @@ VV_LOCAL_SYMBOL bool v__checker__is_noreturn_callexpr(v__ast__Expr expr) { } u8 v__checker__Checker_get_default_fmt(v__checker__Checker* c, v__ast__Type ftyp, v__ast__Type typ) { - if (v__ast__Type_has_flag(ftyp, v__ast__TypeFlag__optional)) { + if (v__ast__Type_has_flag(ftyp, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(ftyp, v__ast__TypeFlag__result)) { u8 _t1 = 's'; return _t1; } else if (v__ast__Type_is_float(typ)) { @@ -59845,7 +59928,7 @@ u8 v__checker__Checker_get_default_fmt(v__checker__Checker* c, v__ast__Type ftyp } else { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, ftyp)); if (sym->kind == v__ast__Kind__alias) { - v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ; + v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ; sym = v__ast__Table_sym(c->table, info.parent_type); if (v__ast__Type_alias_eq(info.parent_type, _const_v__ast__string_type)) { u8 _t6 = 's'; @@ -59884,13 +59967,13 @@ v__ast__Type v__checker__Checker_string_inter_lit(v__checker__Checker* c, v__ast v__ast__Type typ = (ftyp_sym->kind == v__ast__Kind__alias && !v__ast__TypeSymbol_has_method(ftyp_sym, _SLIT("str")) ? (v__ast__Table_unalias_num_type(c->table, ftyp)) : (ftyp)); u8 fmt = (*(u8*)/*ee elem_sym */array_get(node->fmts, i)); if (!(fmt == 'E' || fmt == 'F' || fmt == 'G' || fmt == 'e' || fmt == 'f' || fmt == 'g' || fmt == 'd' || fmt == 'u' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'c' || fmt == 's' || fmt == 'S' || fmt == 'p' || fmt == 'b' || fmt == '_')) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown format specifier `"), 0xfe01, {.d_c = fmt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown format specifier `"), /*99 &u8*/0xfe01, {.d_c = fmt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); } if (fmt == '_') { fmt = v__checker__Checker_get_default_fmt(c, ftyp, typ); if (fmt == '_') { if (!v__ast__Type_alias_eq(typ, _const_v__ast__void_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("no known default format for type `"), 0xfe10, {.d_s = v__ast__Table_get_type_name(c->table, ftyp)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("no known default format for type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_get_type_name(c->table, ftyp)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); } } else { (*(u8*)/*ee elem_sym */array_get(node->fmts, i)) = fmt; @@ -59904,7 +59987,7 @@ v__ast__Type v__checker__Checker_string_inter_lit(v__checker__Checker* c, v__ast v__checker__Checker_error(c, _SLIT("plus prefix only allowed for numbers"), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); } if ((v__ast__Type_is_unsigned(typ) && !(fmt == 'u' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'c' || fmt == 'b')) || (v__ast__Type_is_signed(typ) && !(fmt == 'd' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'c' || fmt == 'b')) || (v__ast__Type_is_int_literal(typ) && !(fmt == 'd' || fmt == 'c' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'u' || fmt == 'x' || fmt == 'X' || fmt == 'o' || fmt == 'b')) || (v__ast__Type_is_float(typ) && !(fmt == 'E' || fmt == 'F' || fmt == 'G' || fmt == 'e' || fmt == 'f' || fmt == 'g')) || (v__ast__Type_is_pointer(typ) && !(fmt == 'p' || fmt == 'x' || fmt == 'X')) || (v__ast__Type_is_string(typ) && !(fmt == 's' || fmt == 'S')) || ((v__ast__Type_idx(typ) == _const_v__ast__i64_type_idx || v__ast__Type_idx(typ) == _const_v__ast__f64_type_idx) && fmt == 'c')) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("illegal format specifier `"), 0xfe01, {.d_c = fmt}}, {_SLIT("` for type `"), 0xfe10, {.d_s = v__ast__Table_get_type_name(c->table, ftyp)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("illegal format specifier `"), /*99 &u8*/0xfe01, {.d_c = fmt}}, {_SLIT("` for type `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_get_type_name(c->table, ftyp)}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(node->fmt_poss, i))); } (*(bool*)/*ee elem_sym */array_get(node->need_fmts, i)) = fmt != v__checker__Checker_get_default_fmt(c, ftyp, typ); } @@ -59996,7 +60079,7 @@ v__ast__Type v__checker__Checker_int_lit(v__checker__Checker* c, v__ast__Integer string lit = string_all_after(string_replace(node->val, _SLIT("_"), _SLIT("")), _SLIT("-")); bool is_neg = string_starts_with(node->val, _SLIT("-")); string limit = (is_neg ? (_SLIT("9223372036854775808")) : (_SLIT("18446744073709551615"))); - string message = str_intp(2, _MOV((StrIntpData[]){{_SLIT("integer literal "), 0xfe10, {.d_s = node->val}}, {_SLIT(" overflows int"), 0, { .d_c = 0 }}})); + string message = str_intp(2, _MOV((StrIntpData[]){{_SLIT("integer literal "), /*115 &string*/0xfe10, {.d_s = node->val}}, {_SLIT(" overflows int"), 0, { .d_c = 0 }}})); if (lit.len > limit.len) { v__checker__Checker_error(c, message, node->pos); } else if (lit.len == limit.len) { @@ -60021,7 +60104,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* v__ast__TypeSymbol* struct_sym = mr_405.arg0; int struct_typ_idx = mr_405.arg1; bool has_generic_types = false; - if ((struct_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((struct_sym->info)._typ == 456 /* v.ast.Struct */) { for (int _t1 = 0; _t1 < node->embeds.len; ++_t1) { v__ast__Embed embed = ((v__ast__Embed*)node->embeds.data)[_t1]; if (v__ast__Type_has_flag(embed.typ, v__ast__TypeFlag__generic)) { @@ -60029,9 +60112,9 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* } v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(c->table, embed.typ); if (embed_sym->kind != v__ast__Kind__struct_) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = embed_sym->name}}, {_SLIT("` is not a struct"), 0, { .d_c = 0 }}})), embed.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = embed_sym->name}}, {_SLIT("` is not a struct"), 0, { .d_c = 0 }}})), embed.pos); } else { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (info.is_heap && !v__ast__Type_is_ptr(embed.typ)) { (*struct_sym->info._v__ast__Struct).is_heap = true; } @@ -60064,18 +60147,18 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, field.typ); for (int j = 0; j < i; ++j) { if (string__eq(field.name, (*(v__ast__StructField*)/*ee elem_sym */array_get(node->fields, j)).name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field.pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field name `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` duplicate"), 0, { .d_c = 0 }}})), field.pos); } } if (field.typ != 0) { if (!v__ast__Type_is_ptr(field.typ)) { if (v__ast__Table_unaliased_type(c->table, field.typ) == struct_typ_idx) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = field.name}}, {_SLIT("` is part of `"), 0xfe10, {.d_s = node->name}}, {_SLIT("`, they can not both have the same type"), 0, { .d_c = 0 }}})), field.type_pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` is part of `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("`, they can not both have the same type"), 0, { .d_c = 0 }}})), field.type_pos); } } v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, field.typ); if (field_sym->kind == v__ast__Kind__function) { - v__ast__FnType fn_info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType fn_info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; Option_void _t4 = v__checker__Checker_ensure_type_exists(c, fn_info.func.return_type, fn_info.func.return_type_pos); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; @@ -60096,7 +60179,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* } } if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (info.is_heap && !v__ast__Type_is_ptr(field.typ)) { (*struct_sym->info._v__ast__Struct).is_heap = true; } @@ -60119,7 +60202,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* } } } else { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("incompatible initializer for field `"), 0xfe10, {.d_s = field.name}}, {_SLIT("`: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(field.default_expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("incompatible initializer for field `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("`: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__ast__Expr_pos(field.default_expr)); } ; } @@ -60128,15 +60211,15 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* if (v__ast__Type_is_ptr(field.typ)) { continue; } - if ((field.default_expr)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((field.default_expr)._typ == 311 /* v.ast.IntegerLiteral */) { if (string__eq((*field.default_expr._v__ast__IntegerLiteral).val, _SLIT("0"))) { v__checker__Checker_warn(c, _SLIT("unnecessary default value of `0`: struct fields are zeroed by default"), (*field.default_expr._v__ast__IntegerLiteral).pos); } - } else if ((field.default_expr)._typ == 329 /* v.ast.StringLiteral */) { + } else if ((field.default_expr)._typ == 330 /* v.ast.StringLiteral */) { if (((*field.default_expr._v__ast__StringLiteral).val).len == 0) { v__checker__Checker_warn(c, _SLIT("unnecessary default value of '': struct fields are zeroed by default"), (*field.default_expr._v__ast__StringLiteral).pos); } - } else if ((field.default_expr)._typ == 289 /* v.ast.BoolLiteral */) { + } else if ((field.default_expr)._typ == 290 /* v.ast.BoolLiteral */) { if ((*field.default_expr._v__ast__BoolLiteral).val == false) { v__checker__Checker_warn(c, _SLIT("unnecessary default value `false`: struct fields are zeroed by default"), (*field.default_expr._v__ast__BoolLiteral).pos); } @@ -60164,12 +60247,12 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } } v__ast__TypeSymbol* struct_sym = v__ast__Table_sym(c->table, node->typ); - if ((struct_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((struct_sym->info)._typ == 456 /* v.ast.Struct */) { for (int _t2 = 0; _t2 < (*struct_sym->info._v__ast__Struct).concrete_types.len; ++_t2) { v__ast__Type ct = ((v__ast__Type*)(*struct_sym->info._v__ast__Struct).concrete_types.data)[_t2]; v__ast__TypeSymbol* ct_sym = v__ast__Table_sym(c->table, ct); if (ct_sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = ct_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = ct_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if ((*struct_sym->info._v__ast__Struct).generic_types.len > 0 && (*struct_sym->info._v__ast__Struct).concrete_types.len == 0 && !node->is_short_syntax) { @@ -60178,14 +60261,14 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } else if (node->generic_types.len == 0) { v__checker__Checker_error(c, _SLIT("generic struct init must specify type parameter, e.g. Foo"), node->pos); } else if (node->generic_types.len > 0 && node->generic_types.len != (*struct_sym->info._v__ast__Struct).generic_types.len) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("generic struct init expects "), 0xfe07, {.d_i32 = (*struct_sym->info._v__ast__Struct).generic_types.len}}, {_SLIT(" generic parameter, but got "), 0xfe07, {.d_i32 = node->generic_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("generic struct init expects "), /*100 &int*/0xfe07, {.d_i32 = (*struct_sym->info._v__ast__Struct).generic_types.len}}, {_SLIT(" generic parameter, but got "), /*100 &int*/0xfe07, {.d_i32 = node->generic_types.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); } else if (node->generic_types.len > 0) { for (int _t3 = 0; _t3 < node->generic_types.len; ++_t3) { v__ast__Type gtyp = ((v__ast__Type*)node->generic_types.data)[_t3]; string gtyp_name = v__ast__Table_sym(c->table, gtyp)->name; if (!Array_string_contains(c->table->cur_fn->generic_names, gtyp_name)) { string cur_generic_names = string__plus(string__plus(_SLIT("("), Array_string_join(c->table->cur_fn->generic_names, _SLIT(","))), _SLIT(")")); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("generic struct init type parameter `"), 0xfe10, {.d_s = gtyp_name}}, {_SLIT("` must be within the parameters `"), 0xfe10, {.d_s = cur_generic_names}}, {_SLIT("` of the current generic function"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("generic struct init type parameter `"), /*115 &string*/0xfe10, {.d_s = gtyp_name}}, {_SLIT("` must be within the parameters `"), /*115 &string*/0xfe10, {.d_s = cur_generic_names}}, {_SLIT("` of the current generic function"), 0, { .d_c = 0 }}})), node->pos); break; } } @@ -60194,12 +60277,12 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str if (node->generic_types.len > 0 && (*struct_sym->info._v__ast__Struct).generic_types.len == node->generic_types.len && !Array_v__ast__Type_arr_eq((*struct_sym->info._v__ast__Struct).generic_types, node->generic_types)) { v__ast__Table_replace_generic_type(c->table, node->typ, node->generic_types); } - } else if ((struct_sym->info)._typ == 470 /* v.ast.Alias */) { + } else if ((struct_sym->info)._typ == 471 /* v.ast.Alias */) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(c->table, (*struct_sym->info._v__ast__Alias).parent_type); if (parent_sym->kind == v__ast__Kind__map) { string alias_str = v__ast__Table_type_to_str(c->table, node->typ); string map_str = v__ast__Table_type_to_str(c->table, (*struct_sym->info._v__ast__Alias).parent_type); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("direct map alias init is not possible, use `"), 0xfe10, {.d_s = alias_str}}, {_SLIT("("), 0xfe10, {.d_s = map_str}}, {_SLIT("{})` instead"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("direct map alias init is not possible, use `"), /*115 &string*/0xfe10, {.d_s = alias_str}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = map_str}}, {_SLIT("{})` instead"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t4 = _const_v__ast__void_type; return _t4; } @@ -60227,67 +60310,67 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str int pos = (*(int*)_t6.data); u8 first_letter = string_at(type_sym->name, pos + 1); if (!u8_is_capital(first_letter)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot initialize builtin type `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot initialize builtin type `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } } if (type_sym->kind == v__ast__Kind__sum_type && node->fields.len == 1) { string sexpr = v__ast__Expr_str((*(v__ast__StructInitField*)/*ee elem_sym */array_get(node->fields, 0)).expr); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("cast to sum type using `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("("), 0xfe10, {.d_s = sexpr}}, {_SLIT(")` not `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("{"), 0xfe10, {.d_s = sexpr}}, {_SLIT("}`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("cast to sum type using `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sexpr}}, {_SLIT(")` not `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("{"), /*115 &string*/0xfe10, {.d_s = sexpr}}, {_SLIT("}`"), 0, { .d_c = 0 }}})), node->pos); } if (type_sym->kind == v__ast__Kind__interface_ && type_sym->language != v__ast__Language__js) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot instantiate interface `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot instantiate interface `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } - if ((type_sym->info)._typ == 470 /* v.ast.Alias */) { + if ((type_sym->info)._typ == 471 /* v.ast.Alias */) { if (v__ast__Type_is_number((*type_sym->info._v__ast__Alias).parent_type)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot instantiate number type alias `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot instantiate number type alias `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t7 = _const_v__ast__void_type; return _t7; } } if (!type_sym->is_pub && type_sym->kind != v__ast__Kind__placeholder && type_sym->language != v__ast__Language__c && (!string__eq(type_sym->mod, c->mod) && !(v__ast__Type_has_flag(node->typ, v__ast__TypeFlag__generic) && !string__eq(type_sym->mod, _SLIT("builtin"))))) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } if (type_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (info.attrs.len > 0 && string__eq((*(v__ast__Attr*)/*ee elem_sym */array_get(info.attrs, 0)).name, _SLIT("noinit")) && !string__eq(type_sym->mod, c->mod)) { - v__checker__Checker_error(c, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` is declared with a `[noinit]` attribute, so "), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("it cannot be initialized with `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("{}`"), 0, { .d_c = 0 }}}))), node->pos); + v__checker__Checker_error(c, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` is declared with a `[noinit]` attribute, so "), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("it cannot be initialized with `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("{}`"), 0, { .d_c = 0 }}}))), node->pos); } } if (type_sym->name.len == 1 && c->table->cur_fn->generic_names.len == 0) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t8 = 0; return _t8; } if (type_sym->kind == (v__ast__Kind__placeholder)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct: "), 0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct: "), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t9 = _const_v__ast__void_type; return _t9; } else if (type_sym->kind == (v__ast__Kind__struct_) || type_sym->kind == (v__ast__Kind__string) || type_sym->kind == (v__ast__Kind__array) || type_sym->kind == (v__ast__Kind__alias)) { v__ast__Struct info = ((v__ast__Struct){.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.embeds = __new_array(0, 0, sizeof(v__ast__Type)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.is_typedef = 0,.is_union = 0,.is_heap = 0,.is_generic = 0,.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.concrete_types = __new_array(0, 0, sizeof(v__ast__Type)),.parent_type = 0,}); if (type_sym->kind == v__ast__Kind__alias) { - v__ast__Alias info_t = /* as */ *(v__ast__Alias*)__as_cast((type_sym->info)._v__ast__Alias,(type_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ; + v__ast__Alias info_t = /* as */ *(v__ast__Alias*)__as_cast((type_sym->info)._v__ast__Alias,(type_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, info_t.parent_type); if (sym->kind == v__ast__Kind__placeholder) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct: "), 0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown struct: "), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t10 = _const_v__ast__void_type; return _t10; } if (sym->kind == v__ast__Kind__struct_) { - info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; } else { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("alias type name: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct type"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("alias type name: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct type"), 0, { .d_c = 0 }}})), node->pos); } } else { - info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; } if (node->is_short) { int exp_len = info.fields.len; int got_len = node->fields.len; if (exp_len != got_len) { string amount = (exp_len < got_len ? (_SLIT("many")) : (_SLIT("few"))); - v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("too "), 0xfe10, {.d_s = amount}}, {_SLIT(" fields in `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("` literal (expecting "), 0xfe07, {.d_i32 = exp_len}}, {_SLIT(", got "), 0xfe07, {.d_i32 = got_len}}, {_SLIT(")"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("too "), /*115 &string*/0xfe10, {.d_s = amount}}, {_SLIT(" fields in `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("` literal (expecting "), /*100 &int*/0xfe07, {.d_i32 = exp_len}}, {_SLIT(", got "), /*100 &int*/0xfe07, {.d_i32 = got_len}}, {_SLIT(")"), 0, { .d_c = 0 }}})), node->pos); } } Array_string inited_fields = __new_array_with_default(0, 0, sizeof(string), 0); @@ -60314,11 +60397,11 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str field_info = (*(v__ast__StructField*)_t11.data); if (!exists) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), 0xfe10, {.d_s = field->name}}, {_SLIT("` in struct literal of type `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unknown field `"), /*115 &string*/0xfe10, {.d_s = field->name}}, {_SLIT("` in struct literal of type `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); continue; } if (Array_string_contains(inited_fields, field_name)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate field name in struct literal: `"), 0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate field name in struct literal: `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), field->pos); continue; } } @@ -60343,7 +60426,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str Option_void _t13 = v__checker__Checker_check_expected(c, v__checker__Checker_unwrap_generic(c, expr_type), v__checker__Checker_unwrap_generic(c, field_info.typ)); if (_t13.state != 0 && _t13.err._typ != _IError_None___index) { IError err = _t13.err; - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to field `"), 0xfe10, {.d_s = field_info.name}}, {_SLIT("`: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot assign to field `"), /*115 &string*/0xfe10, {.d_s = field_info.name}}, {_SLIT("`: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), field->pos); ; } @@ -60360,7 +60443,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } if (field_type_sym->kind == v__ast__Kind__function && field_type_sym->language == v__ast__Language__v) { v__token__Pos pos = v__ast__Expr_pos(field->expr); - if ((field->expr)._typ == 283 /* v.ast.AnonFn */) { + if ((field->expr)._typ == 284 /* v.ast.AnonFn */) { if ((*field->expr._v__ast__AnonFn).decl.no_body) { v__checker__Checker_error(c, _SLIT("cannot initialize the fn field with anonymous fn that does not have a body"), pos); } @@ -60369,11 +60452,11 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str (*(v__ast__StructInitField*)/*ee elem_sym */array_get(node->fields, i)).typ = expr_type; (*(v__ast__StructInitField*)/*ee elem_sym */array_get(node->fields, i)).expected_type = field_info.typ; if (v__ast__Type_has_flag(field_info.typ, v__ast__TypeFlag__optional)) { - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = field_info.name}}, {_SLIT("` is optional, but initialization of optional fields currently unsupported"), 0, { .d_c = 0 }}})), field->pos); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = field_info.name}}, {_SLIT("` is optional, but initialization of optional fields currently unsupported"), 0, { .d_c = 0 }}})), field->pos); } if (v__ast__Type_is_ptr(expr_type) && v__ast__Type_is_ptr(expected_type)) { - if ((field->expr)._typ == 305 /* v.ast.Ident */) { - if (((*field->expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((field->expr)._typ == 306 /* v.ast.Ident */) { + if (((*field->expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { v__ast__Var* obj = &(*(*field->expr._v__ast__Ident).obj._v__ast__Var); if (c->fn_scope != ((voidptr)(0))) { Option_v__ast__Var_ptr _t14 = v__ast__Scope_find_var(c->fn_scope, obj->name); @@ -60387,8 +60470,8 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str if (obj->is_stack_obj && !c->inside_unsafe) { v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__ast__Type_set_nr_muls(obj->typ, 0)); if (!v__ast__TypeSymbol_is_heap(sym) && !c->pref->translated && !c->file->is_translated) { - string suggestion = (sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = (*field->expr._v__ast__Ident).name}}, {_SLIT("` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), 0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*field->expr._v__ast__Ident).pos); + string suggestion = (sym->kind == v__ast__Kind__struct_ ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("declaring `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` as `[heap]`"), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrapping the `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` object in a `struct` declared as `[heap]`"), 0, { .d_c = 0 }}})))); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = (*field->expr._v__ast__Ident).name}}, {_SLIT("` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider "), /*115 &string*/0xfe10, {.d_s = suggestion}}, {_SLIT("."), 0, { .d_c = 0 }}})), (*field->expr._v__ast__Ident).pos); } } } @@ -60402,14 +60485,14 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } if (field.has_default_expr) { if (field.default_expr_typ == 0) { - if ((field.default_expr)._typ == 330 /* v.ast.StructInit */) { + if ((field.default_expr)._typ == 331 /* v.ast.StructInit */) { int idx = v__ast__Table_find_type_idx(c->table, (*field.default_expr._v__ast__StructInit).typ_str); if (idx != 0) { (*(v__ast__StructField*)/*ee elem_sym */array_get(info.fields, i)).default_expr_typ = v__ast__new_type(idx); } } else { Option_v__ast__ConstField_ptr _t15; - if (_t15 = v__ast__Scope_find_const(c->table->global_scope, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(field.default_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))), _t15.state == 0) { + if (_t15 = v__ast__Scope_find_const(c->table->global_scope, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(field.default_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))), _t15.state == 0) { v__ast__ConstField* const_field = *(v__ast__ConstField**)_t15.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(info.fields, i)).default_expr_typ = const_field->typ; } @@ -60418,7 +60501,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str continue; } if (v__ast__Type_is_ptr(field.typ) && !v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__shared_f) && !node->has_update_expr && !c->pref->translated && !c->file->is_translated) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("reference field `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("reference field `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, field.typ); bool has_noinit = false; @@ -60430,7 +60513,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } } if (sym->kind == v__ast__Kind__interface_ && (!has_noinit && sym->language != v__ast__Language__js)) { - v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("interface field `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_note(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("interface field `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); } if (Array_v__ast__Attr_contains(field.attrs, _SLIT("required")) && !node->is_short && !node->has_update_expr) { bool found = false; @@ -60442,7 +60525,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } } if (!found) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), 0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("field `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` must be initialized"), 0, { .d_c = 0 }}})), node->pos); } } } @@ -60454,14 +60537,14 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str node->update_expr_type = update_type; if (v__ast__Table_type_kind(c->table, update_type) != v__ast__Kind__struct_) { string s = v__ast__Table_type_to_str(c->table, update_type); - v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected struct, found `"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->update_expr)); + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected struct, found `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->update_expr)); } else if (!v__ast__Type_alias_eq(update_type, node->typ)) { v__ast__TypeSymbol* from_sym = v__ast__Table_sym(c->table, update_type); v__ast__TypeSymbol* to_sym = v__ast__Table_sym(c->table, node->typ); - v__ast__Struct from_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; - v__ast__Struct to_info = /* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct from_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct to_info = /* as */ *(v__ast__Struct*)__as_cast((to_sym->info)._v__ast__Struct,(to_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (!v__checker__Checker_check_struct_signature(c, from_info, to_info)) { - v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = from_sym->name}}, {_SLIT("` is not compatible with struct `"), 0xfe10, {.d_s = to_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->update_expr)); + v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = from_sym->name}}, {_SLIT("` is not compatible with struct `"), /*115 &string*/0xfe10, {.d_s = to_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->update_expr)); } } if (!v__ast__Expr_is_lvalue(node->update_expr)) { @@ -60619,9 +60702,9 @@ void v__transformer__Transformer_find_new_array_len(v__transformer__Transformer* return; } v__ast__Expr right = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.right, 0)); - if ((right)._typ == 285 /* v.ast.ArrayInit */) { + if ((right)._typ == 286 /* v.ast.ArrayInit */) { v__ast__Expr left = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left)._typ == 305 /* v.ast.Ident */) { + if ((left)._typ == 306 /* v.ast.Ident */) { if ((*left._v__ast__Ident).is_mut) { v__transformer__IndexState_safe_access(t->index, (*left._v__ast__Ident).name, -2); return; @@ -60632,7 +60715,7 @@ void v__transformer__Transformer_find_new_array_len(v__transformer__Transformer* } int len = ((int)(0)); v__ast__Expr value = (*right._v__ast__ArrayInit).len_expr; - if ((value)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((value)._typ == 311 /* v.ast.IntegerLiteral */) { len = string_int((*value._v__ast__IntegerLiteral).val) + 1; } v__transformer__IndexState_safe_access(t->index, (*left._v__ast__Ident).name, len); @@ -60645,19 +60728,19 @@ void v__transformer__Transformer_find_new_range(v__transformer__Transformer* t, return; } v__ast__Expr right = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.right, 0)); - if ((right)._typ == 308 /* v.ast.IndexExpr */) { + if ((right)._typ == 309 /* v.ast.IndexExpr */) { v__ast__Expr left = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left)._typ == 305 /* v.ast.Ident */) { + if ((left)._typ == 306 /* v.ast.Ident */) { if ((*left._v__ast__Ident).is_mut) { v__transformer__IndexState_safe_access(t->index, (*left._v__ast__Ident).name, -2); return; } v__ast__Expr index = (*right._v__ast__IndexExpr).index; - if ((index)._typ == 323 /* v.ast.RangeExpr */) { + if ((index)._typ == 324 /* v.ast.RangeExpr */) { v__ast__Expr range_low = (*index._v__ast__RangeExpr).low; - if ((range_low)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((range_low)._typ == 311 /* v.ast.IntegerLiteral */) { v__ast__Expr sub_left = (*right._v__ast__IndexExpr).left; - if ((sub_left)._typ == 305 /* v.ast.Ident */) { + if ((sub_left)._typ == 306 /* v.ast.Ident */) { int safe = v__transformer__IndexState_safe_offset(t->index, (*sub_left._v__ast__Ident).name); int low = string_int((*range_low._v__ast__IntegerLiteral).val); if (safe >= low) { @@ -60685,40 +60768,40 @@ void v__transformer__Transformer_check_safe_array(v__transformer__Transformer* t } v__ast__Expr index = node->index; v__ast__Expr name = node->left; - if (index._typ == 310 /* v.ast.IntegerLiteral */) { + if (index._typ == 311 /* v.ast.IntegerLiteral */) { bool is_direct = v__transformer__IndexState_safe_access(t->index, v__ast__Expr_str(name), string_int((*index._v__ast__IntegerLiteral).val)); node->is_direct = is_direct; } - else if (index._typ == 323 /* v.ast.RangeExpr */) { + else if (index._typ == 324 /* v.ast.RangeExpr */) { if ((*index._v__ast__RangeExpr).has_high) { v__ast__Expr high = (*index._v__ast__RangeExpr).high; - if ((high)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((high)._typ == 311 /* v.ast.IntegerLiteral */) { v__transformer__IndexState_safe_access(t->index, v__ast__Expr_str(name), string_int((*high._v__ast__IntegerLiteral).val)); return; } } if ((*index._v__ast__RangeExpr).has_low) { v__ast__Expr low = (*index._v__ast__RangeExpr).low; - if ((low)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((low)._typ == 311 /* v.ast.IntegerLiteral */) { v__transformer__IndexState_safe_access(t->index, v__ast__Expr_str(name), string_int((*low._v__ast__IntegerLiteral).val)); return; } } } - else if (index._typ == 292 /* v.ast.CastExpr */) { + else if (index._typ == 293 /* v.ast.CastExpr */) { if (!string__eq((*index._v__ast__CastExpr).typname, _SLIT("int"))) { return; } v__ast__Expr index_expr = (*index._v__ast__CastExpr).expr; - if ((index_expr)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((index_expr)._typ == 311 /* v.ast.IntegerLiteral */) { string val = (*index_expr._v__ast__IntegerLiteral).val; node->is_direct = v__transformer__IndexState_safe_access(t->index, v__ast__Expr_str(name), string_int(val)); } } - else if (index._typ == 302 /* v.ast.EnumVal */) { + else if (index._typ == 303 /* v.ast.EnumVal */) { ; } - else if (index._typ == 305 /* v.ast.Ident */) { + else if (index._typ == 306 /* v.ast.Ident */) { } else { @@ -60727,17 +60810,17 @@ void v__transformer__Transformer_check_safe_array(v__transformer__Transformer* t } v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v__ast__Stmt* node) { - if (node->_typ == 343 /* v.ast.EmptyStmt */) { + if (node->_typ == 344 /* v.ast.EmptyStmt */) { } - else if (node->_typ == 316 /* v.ast.NodeError */) { + else if (node->_typ == 317 /* v.ast.NodeError */) { } - else if (node->_typ == 335 /* v.ast.AsmStmt */) { + else if (node->_typ == 336 /* v.ast.AsmStmt */) { } - else if (node->_typ == 336 /* v.ast.AssertStmt */) { + else if (node->_typ == 337 /* v.ast.AssertStmt */) { v__ast__Stmt _t1 = v__transformer__Transformer_assert_stmt(t, (voidptr)&/*qq*/(*node->_v__ast__AssertStmt)); return _t1; } - else if (node->_typ == 337 /* v.ast.AssignStmt */) { + else if (node->_typ == 338 /* v.ast.AssignStmt */) { v__transformer__Transformer_find_new_array_len(t, (*node->_v__ast__AssignStmt)); v__transformer__Transformer_find_new_range(t, (*node->_v__ast__AssignStmt)); v__transformer__Transformer_find_mut_self_assign(t, (*node->_v__ast__AssignStmt)); @@ -60750,7 +60833,7 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ *left = v__transformer__Transformer_expr(t, left); } } - else if (node->_typ == 338 /* v.ast.Block */) { + else if (node->_typ == 339 /* v.ast.Block */) { v__transformer__IndexState_indent(t->index, false); for (int _t4 = 0; _t4 < (*node->_v__ast__Block).stmts.len; ++_t4) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__Block).stmts.data) + _t4; @@ -60758,35 +60841,35 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 339 /* v.ast.BranchStmt */) { + else if (node->_typ == 340 /* v.ast.BranchStmt */) { t->index->disabled = true; } - else if (node->_typ == 340 /* v.ast.ComptimeFor */) { + else if (node->_typ == 341 /* v.ast.ComptimeFor */) { for (int _t5 = 0; _t5 < (*node->_v__ast__ComptimeFor).stmts.len; ++_t5) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__ComptimeFor).stmts.data) + _t5; *stmt = v__transformer__Transformer_stmt(t, stmt); } } - else if (node->_typ == 341 /* v.ast.ConstDecl */) { + else if (node->_typ == 342 /* v.ast.ConstDecl */) { for (int _t6 = 0; _t6 < (*node->_v__ast__ConstDecl).fields.len; ++_t6) { v__ast__ConstField* field = ((v__ast__ConstField*)(*node->_v__ast__ConstDecl).fields.data) + _t6; field->expr = v__transformer__Transformer_expr(t, &/*sum*/field->expr); } } - else if (node->_typ == 342 /* v.ast.DeferStmt */) { + else if (node->_typ == 343 /* v.ast.DeferStmt */) { for (int _t7 = 0; _t7 < (*node->_v__ast__DeferStmt).stmts.len; ++_t7) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__DeferStmt).stmts.data) + _t7; *stmt = v__transformer__Transformer_stmt(t, stmt); } } - else if (node->_typ == 344 /* v.ast.EnumDecl */) { + else if (node->_typ == 345 /* v.ast.EnumDecl */) { } - else if (node->_typ == 345 /* v.ast.ExprStmt */) { + else if (node->_typ == 346 /* v.ast.ExprStmt */) { v__ast__Expr _t8 = {0}; - if ((*node->_v__ast__ExprStmt).expr._typ == 306 /* v.ast.IfExpr */) { + if ((*node->_v__ast__ExprStmt).expr._typ == 307 /* v.ast.IfExpr */) { _t8 = v__transformer__Transformer_expr_stmt_if_expr(t, (voidptr)&/*qq*/(*(*node->_v__ast__ExprStmt).expr._v__ast__IfExpr)); } - else if ((*node->_v__ast__ExprStmt).expr._typ == 315 /* v.ast.MatchExpr */) { + else if ((*node->_v__ast__ExprStmt).expr._typ == 316 /* v.ast.MatchExpr */) { _t8 = v__transformer__Transformer_expr_stmt_match_expr(t, (voidptr)&/*qq*/(*(*node->_v__ast__ExprStmt).expr._v__ast__MatchExpr)); } @@ -60795,7 +60878,7 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } (*node->_v__ast__ExprStmt).expr = _t8; } - else if (node->_typ == 218 /* v.ast.FnDecl */) { + else if (node->_typ == 219 /* v.ast.FnDecl */) { v__transformer__IndexState_indent(t->index, true); for (int _t9 = 0; _t9 < (*node->_v__ast__FnDecl).stmts.len; ++_t9) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__FnDecl).stmts.data) + _t9; @@ -60803,11 +60886,11 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 346 /* v.ast.ForCStmt */) { + else if (node->_typ == 347 /* v.ast.ForCStmt */) { v__ast__Stmt _t10 = v__transformer__Transformer_for_c_stmt(t, (voidptr)&/*qq*/(*node->_v__ast__ForCStmt)); return _t10; } - else if (node->_typ == 347 /* v.ast.ForInStmt */) { + else if (node->_typ == 348 /* v.ast.ForInStmt */) { v__transformer__IndexState_indent(t->index, false); for (int _t11 = 0; _t11 < (*node->_v__ast__ForInStmt).stmts.len; ++_t11) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__ForInStmt).stmts.data) + _t11; @@ -60815,50 +60898,50 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 348 /* v.ast.ForStmt */) { + else if (node->_typ == 349 /* v.ast.ForStmt */) { v__ast__Stmt _t12 = v__transformer__Transformer_for_stmt(t, (voidptr)&/*qq*/(*node->_v__ast__ForStmt)); return _t12; } - else if (node->_typ == 349 /* v.ast.GlobalDecl */) { + else if (node->_typ == 350 /* v.ast.GlobalDecl */) { for (int _t13 = 0; _t13 < (*node->_v__ast__GlobalDecl).fields.len; ++_t13) { v__ast__GlobalField* field = ((v__ast__GlobalField*)(*node->_v__ast__GlobalDecl).fields.data) + _t13; field->expr = v__transformer__Transformer_expr(t, &/*sum*/field->expr); } } - else if (node->_typ == 350 /* v.ast.GotoLabel */) { + else if (node->_typ == 351 /* v.ast.GotoLabel */) { } - else if (node->_typ == 351 /* v.ast.GotoStmt */) { + else if (node->_typ == 352 /* v.ast.GotoStmt */) { t->index->disabled = true; } - else if (node->_typ == 352 /* v.ast.HashStmt */) { + else if (node->_typ == 353 /* v.ast.HashStmt */) { for (int _t14 = 0; _t14 < (*node->_v__ast__HashStmt).ct_conds.len; ++_t14) { v__ast__Expr* cond = ((v__ast__Expr*)(*node->_v__ast__HashStmt).ct_conds.data) + _t14; *cond = v__transformer__Transformer_expr(t, cond); } } - else if (node->_typ == 353 /* v.ast.Import */) { + else if (node->_typ == 354 /* v.ast.Import */) { } - else if (node->_typ == 354 /* v.ast.InterfaceDecl */) { + else if (node->_typ == 355 /* v.ast.InterfaceDecl */) { v__ast__Stmt _t15 = v__transformer__Transformer_interface_decl(t, (voidptr)&/*qq*/(*node->_v__ast__InterfaceDecl)); return _t15; } - else if (node->_typ == 355 /* v.ast.Module */) { + else if (node->_typ == 356 /* v.ast.Module */) { } - else if (node->_typ == 356 /* v.ast.Return */) { + else if (node->_typ == 357 /* v.ast.Return */) { for (int _t16 = 0; _t16 < (*node->_v__ast__Return).exprs.len; ++_t16) { v__ast__Expr* expr = ((v__ast__Expr*)(*node->_v__ast__Return).exprs.data) + _t16; *expr = v__transformer__Transformer_expr(t, expr); } } - else if (node->_typ == 357 /* v.ast.SqlStmt */) { + else if (node->_typ == 358 /* v.ast.SqlStmt */) { } - else if (node->_typ == 358 /* v.ast.StructDecl */) { + else if (node->_typ == 359 /* v.ast.StructDecl */) { for (int _t17 = 0; _t17 < (*node->_v__ast__StructDecl).fields.len; ++_t17) { v__ast__StructField* field = ((v__ast__StructField*)(*node->_v__ast__StructDecl).fields.data) + _t17; field->default_expr = v__transformer__Transformer_expr(t, &/*sum*/field->default_expr); } } - else if (node->_typ == 282 /* v.ast.TypeDecl */) { + else if (node->_typ == 283 /* v.ast.TypeDecl */) { } ; v__ast__Stmt _t18 = *node; @@ -60872,11 +60955,11 @@ v__ast__Stmt v__transformer__Transformer_assert_stmt(v__transformer__Transformer v__ast__Stmt _t1 = v__ast__AssertStmt_to_sumtype_v__ast__Stmt(node); return _t1; } - if ((node->expr)._typ == 309 /* v.ast.InfixExpr */) { + if ((node->expr)._typ == 310 /* v.ast.InfixExpr */) { v__ast__Expr right = (*node->expr._v__ast__InfixExpr).right; - if (right._typ == 310 /* v.ast.IntegerLiteral */) { + if (right._typ == 311 /* v.ast.IntegerLiteral */) { v__ast__Expr left = (*node->expr._v__ast__InfixExpr).left; - if ((left)._typ == 325 /* v.ast.SelectorExpr */) { + if ((left)._typ == 326 /* v.ast.SelectorExpr */) { int len = string_int((*right._v__ast__IntegerLiteral).val); if (string__eq((*left._v__ast__SelectorExpr).field_name, _SLIT("len"))) { @@ -60894,9 +60977,9 @@ v__ast__Stmt v__transformer__Transformer_assert_stmt(v__transformer__Transformer } } } - else if (right._typ == 325 /* v.ast.SelectorExpr */) { + else if (right._typ == 326 /* v.ast.SelectorExpr */) { v__ast__Expr left = (*node->expr._v__ast__InfixExpr).left; - if ((left)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((left)._typ == 311 /* v.ast.IntegerLiteral */) { int len = string_int((*left._v__ast__IntegerLiteral).val); if (string__eq((*right._v__ast__SelectorExpr).field_name, _SLIT("len"))) { @@ -60935,7 +61018,7 @@ v__ast__Expr v__transformer__Transformer_expr_stmt_if_expr(v__transformer__Trans v__ast__IfBranch* branch = ((v__ast__IfBranch*)node->branches.data) + i; v__ast__Expr cond = v__transformer__Transformer_expr(t, &/*sum*/branch->cond); *branch = ((v__ast__IfBranch){(*branch).pos,(*branch).body_pos,(*branch).comments,.cond = cond,(*branch).pkg_exist,(*branch).stmts,(*branch).scope,}); - if ((cond)._typ == 289 /* v.ast.BoolLiteral */) { + if ((cond)._typ == 290 /* v.ast.BoolLiteral */) { if ((*cond._v__ast__BoolLiteral).val) { stop_index = i; break; @@ -60994,36 +61077,36 @@ v__ast__Expr v__transformer__Transformer_expr_stmt_match_expr(v__transformer__Tr for (int _t3 = 0; _t3 < branch->exprs.len; ++_t3) { v__ast__Expr* expr = ((v__ast__Expr*)branch->exprs.data) + _t3; *expr = v__transformer__Transformer_expr(t, expr); - if (cond._typ == 289 /* v.ast.BoolLiteral */) { - if ((expr)->_typ == 289 /* v.ast.BoolLiteral */) { - if ((*cond._v__ast__BoolLiteral).val == (/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)->_v__ast__BoolLiteral,(expr)->_typ, 289) /*expected idx: 289, name: v.ast.BoolLiteral */ ).val) { + if (cond._typ == 290 /* v.ast.BoolLiteral */) { + if ((expr)->_typ == 290 /* v.ast.BoolLiteral */) { + if ((*cond._v__ast__BoolLiteral).val == (/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)->_v__ast__BoolLiteral,(expr)->_typ, 290) /*expected idx: 290, name: v.ast.BoolLiteral */ ).val) { branch->exprs = new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){*expr})); node->branches = new_array_from_c_array(1, 1, sizeof(v__ast__MatchBranch), _MOV((v__ast__MatchBranch[1]){*branch})); terminate = true; } } } - else if (cond._typ == 310 /* v.ast.IntegerLiteral */) { - if ((expr)->_typ == 310 /* v.ast.IntegerLiteral */) { - if (string_int((*cond._v__ast__IntegerLiteral).val) == string_int((/* as */ *(v__ast__IntegerLiteral*)__as_cast((expr)->_v__ast__IntegerLiteral,(expr)->_typ, 310) /*expected idx: 310, name: v.ast.IntegerLiteral */ ).val)) { + else if (cond._typ == 311 /* v.ast.IntegerLiteral */) { + if ((expr)->_typ == 311 /* v.ast.IntegerLiteral */) { + if (string_int((*cond._v__ast__IntegerLiteral).val) == string_int((/* as */ *(v__ast__IntegerLiteral*)__as_cast((expr)->_v__ast__IntegerLiteral,(expr)->_typ, 311) /*expected idx: 311, name: v.ast.IntegerLiteral */ ).val)) { branch->exprs = new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){*expr})); node->branches = new_array_from_c_array(1, 1, sizeof(v__ast__MatchBranch), _MOV((v__ast__MatchBranch[1]){*branch})); terminate = true; } } } - else if (cond._typ == 303 /* v.ast.FloatLiteral */) { - if ((expr)->_typ == 303 /* v.ast.FloatLiteral */) { - if (string_f32((*cond._v__ast__FloatLiteral).val) == string_f32((/* as */ *(v__ast__FloatLiteral*)__as_cast((expr)->_v__ast__FloatLiteral,(expr)->_typ, 303) /*expected idx: 303, name: v.ast.FloatLiteral */ ).val)) { + else if (cond._typ == 304 /* v.ast.FloatLiteral */) { + if ((expr)->_typ == 304 /* v.ast.FloatLiteral */) { + if (string_f32((*cond._v__ast__FloatLiteral).val) == string_f32((/* as */ *(v__ast__FloatLiteral*)__as_cast((expr)->_v__ast__FloatLiteral,(expr)->_typ, 304) /*expected idx: 304, name: v.ast.FloatLiteral */ ).val)) { branch->exprs = new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){*expr})); node->branches = new_array_from_c_array(1, 1, sizeof(v__ast__MatchBranch), _MOV((v__ast__MatchBranch[1]){*branch})); terminate = true; } } } - else if (cond._typ == 329 /* v.ast.StringLiteral */) { - if ((expr)->_typ == 329 /* v.ast.StringLiteral */) { - if (string__eq((*cond._v__ast__StringLiteral).val, (/* as */ *(v__ast__StringLiteral*)__as_cast((expr)->_v__ast__StringLiteral,(expr)->_typ, 329) /*expected idx: 329, name: v.ast.StringLiteral */ ).val)) { + else if (cond._typ == 330 /* v.ast.StringLiteral */) { + if ((expr)->_typ == 330 /* v.ast.StringLiteral */) { + if (string__eq((*cond._v__ast__StringLiteral).val, (/* as */ *(v__ast__StringLiteral*)__as_cast((expr)->_v__ast__StringLiteral,(expr)->_typ, 330) /*expected idx: 330, name: v.ast.StringLiteral */ ).val)) { branch->exprs = new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){*expr})); node->branches = new_array_from_c_array(1, 1, sizeof(v__ast__MatchBranch), _MOV((v__ast__MatchBranch[1]){*branch})); terminate = true; @@ -61071,8 +61154,8 @@ v__ast__Stmt v__transformer__Transformer_for_c_stmt(v__transformer__Transformer* v__ast__Stmt v__transformer__Transformer_for_stmt(v__transformer__Transformer* t, v__ast__ForStmt* node) { node->cond = v__transformer__Transformer_expr(t, &/*sum*/node->cond); - if (node->cond._typ == 289 /* v.ast.BoolLiteral */) { - if (!(/* as */ *(v__ast__BoolLiteral*)__as_cast((node->cond)._v__ast__BoolLiteral,(node->cond)._typ, 289) /*expected idx: 289, name: v.ast.BoolLiteral */ ).val) { + if (node->cond._typ == 290 /* v.ast.BoolLiteral */) { + if (!(/* as */ *(v__ast__BoolLiteral*)__as_cast((node->cond)._v__ast__BoolLiteral,(node->cond)._typ, 290) /*expected idx: 290, name: v.ast.BoolLiteral */ ).val) { v__ast__Stmt _t1 = v__ast__EmptyStmt_to_sumtype_v__ast__Stmt(ADDR(v__ast__EmptyStmt, (((v__ast__EmptyStmt){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},})))); return _t1; } @@ -61107,13 +61190,13 @@ v__ast__Stmt v__transformer__Transformer_interface_decl(v__transformer__Transfor } v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v__ast__Expr* node) { - if (node->_typ == 283 /* v.ast.AnonFn */) { - (*node->_v__ast__AnonFn).decl = /* as */ *(v__ast__FnDecl*)__as_cast((v__transformer__Transformer_stmt(t, HEAP(v__ast__Stmt, v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*node->_v__ast__AnonFn).decl))))._v__ast__FnDecl,(v__transformer__Transformer_stmt(t, HEAP(v__ast__Stmt, v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*node->_v__ast__AnonFn).decl))))._typ, 218) /*expected idx: 218, name: v.ast.FnDecl */ ; + if (node->_typ == 284 /* v.ast.AnonFn */) { + (*node->_v__ast__AnonFn).decl = /* as */ *(v__ast__FnDecl*)__as_cast((v__transformer__Transformer_stmt(t, HEAP(v__ast__Stmt, v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*node->_v__ast__AnonFn).decl))))._v__ast__FnDecl,(v__transformer__Transformer_stmt(t, HEAP(v__ast__Stmt, v__ast__FnDecl_to_sumtype_v__ast__Stmt(&(*node->_v__ast__AnonFn).decl))))._typ, 219) /*expected idx: 219, name: v.ast.FnDecl */ ; } - else if (node->_typ == 284 /* v.ast.ArrayDecompose */) { + else if (node->_typ == 285 /* v.ast.ArrayDecompose */) { (*node->_v__ast__ArrayDecompose).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ArrayDecompose).expr); } - else if (node->_typ == 285 /* v.ast.ArrayInit */) { + else if (node->_typ == 286 /* v.ast.ArrayInit */) { for (int _t1 = 0; _t1 < (*node->_v__ast__ArrayInit).exprs.len; ++_t1) { v__ast__Expr* expr = ((v__ast__Expr*)(*node->_v__ast__ArrayInit).exprs.data) + _t1; *expr = v__transformer__Transformer_expr(t, expr); @@ -61122,73 +61205,73 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ (*node->_v__ast__ArrayInit).cap_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ArrayInit).cap_expr); (*node->_v__ast__ArrayInit).default_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ArrayInit).default_expr); } - else if (node->_typ == 286 /* v.ast.AsCast */) { + else if (node->_typ == 287 /* v.ast.AsCast */) { (*node->_v__ast__AsCast).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__AsCast).expr); } - else if (node->_typ == 290 /* v.ast.CTempVar */) { + else if (node->_typ == 291 /* v.ast.CTempVar */) { (*node->_v__ast__CTempVar).orig = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CTempVar).orig); } - else if (node->_typ == 291 /* v.ast.CallExpr */) { + else if (node->_typ == 292 /* v.ast.CallExpr */) { (*node->_v__ast__CallExpr).left = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CallExpr).left); for (int _t2 = 0; _t2 < (*node->_v__ast__CallExpr).args.len; ++_t2) { v__ast__CallArg* arg = ((v__ast__CallArg*)(*node->_v__ast__CallExpr).args.data) + _t2; arg->expr = v__transformer__Transformer_expr(t, &/*sum*/arg->expr); } - (*node->_v__ast__CallExpr).or_block = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__CallExpr).or_block))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__CallExpr).or_block))))._typ, 319) /*expected idx: 319, name: v.ast.OrExpr */ ; + (*node->_v__ast__CallExpr).or_block = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__CallExpr).or_block))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__CallExpr).or_block))))._typ, 320) /*expected idx: 320, name: v.ast.OrExpr */ ; } - else if (node->_typ == 292 /* v.ast.CastExpr */) { + else if (node->_typ == 293 /* v.ast.CastExpr */) { (*node->_v__ast__CastExpr).arg = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CastExpr).arg); (*node->_v__ast__CastExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CastExpr).expr); } - else if (node->_typ == 293 /* v.ast.ChanInit */) { + else if (node->_typ == 294 /* v.ast.ChanInit */) { (*node->_v__ast__ChanInit).cap_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ChanInit).cap_expr); } - else if (node->_typ == 296 /* v.ast.ComptimeCall */) { + else if (node->_typ == 297 /* v.ast.ComptimeCall */) { for (int _t3 = 0; _t3 < (*node->_v__ast__ComptimeCall).args.len; ++_t3) { v__ast__CallArg* arg = ((v__ast__CallArg*)(*node->_v__ast__ComptimeCall).args.data) + _t3; arg->expr = v__transformer__Transformer_expr(t, &/*sum*/arg->expr); } } - else if (node->_typ == 297 /* v.ast.ComptimeSelector */) { + else if (node->_typ == 298 /* v.ast.ComptimeSelector */) { (*node->_v__ast__ComptimeSelector).left = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ComptimeSelector).left); (*node->_v__ast__ComptimeSelector).field_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ComptimeSelector).field_expr); } - else if (node->_typ == 299 /* v.ast.ConcatExpr */) { + else if (node->_typ == 300 /* v.ast.ConcatExpr */) { for (int _t4 = 0; _t4 < (*node->_v__ast__ConcatExpr).vals.len; ++_t4) { v__ast__Expr* val = ((v__ast__Expr*)(*node->_v__ast__ConcatExpr).vals.data) + _t4; *val = v__transformer__Transformer_expr(t, val); } } - else if (node->_typ == 300 /* v.ast.DumpExpr */) { + else if (node->_typ == 301 /* v.ast.DumpExpr */) { (*node->_v__ast__DumpExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__DumpExpr).expr); } - else if (node->_typ == 304 /* v.ast.GoExpr */) { - (*node->_v__ast__GoExpr).call_expr = /* as */ *(v__ast__CallExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__GoExpr).call_expr))))._v__ast__CallExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__GoExpr).call_expr))))._typ, 291) /*expected idx: 291, name: v.ast.CallExpr */ ; + else if (node->_typ == 305 /* v.ast.GoExpr */) { + (*node->_v__ast__GoExpr).call_expr = /* as */ *(v__ast__CallExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__GoExpr).call_expr))))._v__ast__CallExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__GoExpr).call_expr))))._typ, 292) /*expected idx: 292, name: v.ast.CallExpr */ ; } - else if (node->_typ == 306 /* v.ast.IfExpr */) { + else if (node->_typ == 307 /* v.ast.IfExpr */) { v__ast__Expr _t5 = v__transformer__Transformer_if_expr(t, (voidptr)&/*qq*/(*node->_v__ast__IfExpr)); return _t5; } - else if (node->_typ == 307 /* v.ast.IfGuardExpr */) { + else if (node->_typ == 308 /* v.ast.IfGuardExpr */) { (*node->_v__ast__IfGuardExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IfGuardExpr).expr); } - else if (node->_typ == 308 /* v.ast.IndexExpr */) { + else if (node->_typ == 309 /* v.ast.IndexExpr */) { v__transformer__Transformer_check_safe_array(t, (voidptr)&/*qq*/(*node->_v__ast__IndexExpr)); (*node->_v__ast__IndexExpr).left = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IndexExpr).left); (*node->_v__ast__IndexExpr).index = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IndexExpr).index); - (*node->_v__ast__IndexExpr).or_expr = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__IndexExpr).or_expr))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__IndexExpr).or_expr))))._typ, 319) /*expected idx: 319, name: v.ast.OrExpr */ ; + (*node->_v__ast__IndexExpr).or_expr = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__IndexExpr).or_expr))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__IndexExpr).or_expr))))._typ, 320) /*expected idx: 320, name: v.ast.OrExpr */ ; } - else if (node->_typ == 309 /* v.ast.InfixExpr */) { + else if (node->_typ == 310 /* v.ast.InfixExpr */) { v__ast__Expr _t6 = v__transformer__Transformer_infix_expr(t, (voidptr)&/*qq*/(*node->_v__ast__InfixExpr)); return _t6; } - else if (node->_typ == 311 /* v.ast.IsRefType */) { + else if (node->_typ == 312 /* v.ast.IsRefType */) { (*node->_v__ast__IsRefType).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IsRefType).expr); } - else if (node->_typ == 312 /* v.ast.Likely */) { + else if (node->_typ == 313 /* v.ast.Likely */) { (*node->_v__ast__Likely).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__Likely).expr); } - else if (node->_typ == 313 /* v.ast.LockExpr */) { + else if (node->_typ == 314 /* v.ast.LockExpr */) { for (int _t7 = 0; _t7 < (*node->_v__ast__LockExpr).stmts.len; ++_t7) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__LockExpr).stmts.data) + _t7; *stmt = v__transformer__Transformer_stmt(t, stmt); @@ -61198,7 +61281,7 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ *locked = v__transformer__Transformer_expr(t, locked); } } - else if (node->_typ == 314 /* v.ast.MapInit */) { + else if (node->_typ == 315 /* v.ast.MapInit */) { for (int _t9 = 0; _t9 < (*node->_v__ast__MapInit).keys.len; ++_t9) { v__ast__Expr* key = ((v__ast__Expr*)(*node->_v__ast__MapInit).keys.data) + _t9; *key = v__transformer__Transformer_expr(t, key); @@ -61208,31 +61291,31 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ *val = v__transformer__Transformer_expr(t, val); } } - else if (node->_typ == 315 /* v.ast.MatchExpr */) { + else if (node->_typ == 316 /* v.ast.MatchExpr */) { v__ast__Expr _t11 = v__transformer__Transformer_match_expr(t, (voidptr)&/*qq*/(*node->_v__ast__MatchExpr)); return _t11; } - else if (node->_typ == 319 /* v.ast.OrExpr */) { + else if (node->_typ == 320 /* v.ast.OrExpr */) { for (int _t12 = 0; _t12 < (*node->_v__ast__OrExpr).stmts.len; ++_t12) { v__ast__Stmt* stmt = ((v__ast__Stmt*)(*node->_v__ast__OrExpr).stmts.data) + _t12; *stmt = v__transformer__Transformer_stmt(t, stmt); } } - else if (node->_typ == 320 /* v.ast.ParExpr */) { + else if (node->_typ == 321 /* v.ast.ParExpr */) { (*node->_v__ast__ParExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ParExpr).expr); } - else if (node->_typ == 321 /* v.ast.PostfixExpr */) { + else if (node->_typ == 322 /* v.ast.PostfixExpr */) { (*node->_v__ast__PostfixExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__PostfixExpr).expr); } - else if (node->_typ == 322 /* v.ast.PrefixExpr */) { + else if (node->_typ == 323 /* v.ast.PrefixExpr */) { (*node->_v__ast__PrefixExpr).right = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__PrefixExpr).right); - (*node->_v__ast__PrefixExpr).or_block = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__PrefixExpr).or_block))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__PrefixExpr).or_block))))._typ, 319) /*expected idx: 319, name: v.ast.OrExpr */ ; + (*node->_v__ast__PrefixExpr).or_block = /* as */ *(v__ast__OrExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__PrefixExpr).or_block))))._v__ast__OrExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__OrExpr_to_sumtype_v__ast__Expr(&(*node->_v__ast__PrefixExpr).or_block))))._typ, 320) /*expected idx: 320, name: v.ast.OrExpr */ ; } - else if (node->_typ == 323 /* v.ast.RangeExpr */) { + else if (node->_typ == 324 /* v.ast.RangeExpr */) { (*node->_v__ast__RangeExpr).low = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__RangeExpr).low); (*node->_v__ast__RangeExpr).high = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__RangeExpr).high); } - else if (node->_typ == 324 /* v.ast.SelectExpr */) { + else if (node->_typ == 325 /* v.ast.SelectExpr */) { for (int _t13 = 0; _t13 < (*node->_v__ast__SelectExpr).branches.len; ++_t13) { v__ast__SelectBranch* branch = ((v__ast__SelectBranch*)(*node->_v__ast__SelectExpr).branches.data) + _t13; branch->stmt = v__transformer__Transformer_stmt(t, &/*sum*/branch->stmt); @@ -61242,27 +61325,27 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ } } } - else if (node->_typ == 325 /* v.ast.SelectorExpr */) { + else if (node->_typ == 326 /* v.ast.SelectorExpr */) { (*node->_v__ast__SelectorExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__SelectorExpr).expr); - if (((*node->_v__ast__SelectorExpr).expr)._typ == 329 /* v.ast.StringLiteral */ && string__eq((*node->_v__ast__SelectorExpr).field_name, _SLIT("len"))) { + if (((*node->_v__ast__SelectorExpr).expr)._typ == 330 /* v.ast.StringLiteral */ && string__eq((*node->_v__ast__SelectorExpr).field_name, _SLIT("len"))) { v__ast__Expr _t15 = v__ast__IntegerLiteral_to_sumtype_v__ast__Expr(ADDR(v__ast__IntegerLiteral, (((v__ast__IntegerLiteral){.val = int_str((*(*node->_v__ast__SelectorExpr).expr._v__ast__StringLiteral).val.len),.pos = (*node->_v__ast__SelectorExpr).pos,})))); return _t15; } } - else if (node->_typ == 326 /* v.ast.SizeOf */) { + else if (node->_typ == 327 /* v.ast.SizeOf */) { (*node->_v__ast__SizeOf).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__SizeOf).expr); } - else if (node->_typ == 327 /* v.ast.SqlExpr */) { + else if (node->_typ == 328 /* v.ast.SqlExpr */) { v__ast__Expr _t16 = v__transformer__Transformer_sql_expr(t, (voidptr)&/*qq*/(*node->_v__ast__SqlExpr)); return _t16; } - else if (node->_typ == 328 /* v.ast.StringInterLiteral */) { + else if (node->_typ == 329 /* v.ast.StringInterLiteral */) { for (int _t17 = 0; _t17 < (*node->_v__ast__StringInterLiteral).exprs.len; ++_t17) { v__ast__Expr* expr = ((v__ast__Expr*)(*node->_v__ast__StringInterLiteral).exprs.data) + _t17; *expr = v__transformer__Transformer_expr(t, expr); } } - else if (node->_typ == 330 /* v.ast.StructInit */) { + else if (node->_typ == 331 /* v.ast.StructInit */) { (*node->_v__ast__StructInit).update_expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__StructInit).update_expr); for (int _t18 = 0; _t18 < (*node->_v__ast__StructInit).fields.len; ++_t18) { v__ast__StructInitField* field = ((v__ast__StructInitField*)(*node->_v__ast__StructInit).fields.data) + _t18; @@ -61273,7 +61356,7 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ embed->expr = v__transformer__Transformer_expr(t, &/*sum*/embed->expr); } } - else if (node->_typ == 333 /* v.ast.UnsafeExpr */) { + else if (node->_typ == 334 /* v.ast.UnsafeExpr */) { (*node->_v__ast__UnsafeExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__UnsafeExpr).expr); } @@ -61303,8 +61386,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* v__ast__Expr _t1 = v__ast__InfixExpr_to_sumtype_v__ast__Expr(node); return _t1; } else { - if (node->left._typ == 289 /* v.ast.BoolLiteral */) { - if (node->right._typ == 289 /* v.ast.BoolLiteral */) { + if (node->left._typ == 290 /* v.ast.BoolLiteral */) { + if (node->right._typ == 290 /* v.ast.BoolLiteral */) { if (node->op == (v__token__Kind__eq)) { v__ast__Expr _t2 = v__ast__BoolLiteral_to_sumtype_v__ast__Expr(ADDR(v__ast__BoolLiteral, (((v__ast__BoolLiteral){.val = (*node->left._v__ast__BoolLiteral).val == (*node->right._v__ast__BoolLiteral).val,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},})))); @@ -61330,8 +61413,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 329 /* v.ast.StringLiteral */) { - if (node->right._typ == 329 /* v.ast.StringLiteral */) { + else if (node->left._typ == 330 /* v.ast.StringLiteral */) { + if (node->right._typ == 330 /* v.ast.StringLiteral */) { if (node->op == (v__token__Kind__eq)) { v__ast__Expr _t6 = v__ast__BoolLiteral_to_sumtype_v__ast__Expr(ADDR(v__ast__BoolLiteral, (((v__ast__BoolLiteral){.val = string__eq((*node->left._v__ast__StringLiteral).val, (*node->right._v__ast__StringLiteral).val),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},})))); @@ -61353,8 +61436,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 310 /* v.ast.IntegerLiteral */) { - if (node->right._typ == 310 /* v.ast.IntegerLiteral */) { + else if (node->left._typ == 311 /* v.ast.IntegerLiteral */) { + if (node->right._typ == 311 /* v.ast.IntegerLiteral */) { i64 left_val = string_i64((*node->left._v__ast__IntegerLiteral).val); i64 right_val = string_i64((*node->right._v__ast__IntegerLiteral).val); switch (node->op) { @@ -61574,8 +61657,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 303 /* v.ast.FloatLiteral */) { - if (node->right._typ == 303 /* v.ast.FloatLiteral */) { + else if (node->left._typ == 304 /* v.ast.FloatLiteral */) { + if (node->right._typ == 304 /* v.ast.FloatLiteral */) { f32 left_val = string_f32((*node->left._v__ast__FloatLiteral).val); f32 right_val = string_f32((*node->right._v__ast__FloatLiteral).val); switch (node->op) { @@ -61775,16 +61858,16 @@ v__ast__Expr v__transformer__Transformer_if_expr(v__transformer__Transformer* t, v__ast__Stmt* stmt = ((v__ast__Stmt*)branch->stmts.data) + i; *stmt = v__transformer__Transformer_stmt(t, stmt); if (i == branch->stmts.len - 1) { - if ((stmt)->_typ == 345 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 346 /* v.ast.ExprStmt */) { v__ast__Expr expr = (*stmt->_v__ast__ExprStmt).expr; - if (expr._typ == 306 /* v.ast.IfExpr */) { + if (expr._typ == 307 /* v.ast.IfExpr */) { if ((*expr._v__ast__IfExpr).branches.len == 1) { (*(v__ast__Stmt*)array_pop(&branch->stmts)); _PUSH_MANY(&branch->stmts, ((*(v__ast__IfBranch*)/*ee elem_sym */array_get((*expr._v__ast__IfExpr).branches, 0)).stmts), _t2, Array_v__ast__Stmt); break; } } - else if (expr._typ == 315 /* v.ast.MatchExpr */) { + else if (expr._typ == 316 /* v.ast.MatchExpr */) { if ((*expr._v__ast__MatchExpr).branches.len == 1) { (*(v__ast__Stmt*)array_pop(&branch->stmts)); _PUSH_MANY(&branch->stmts, ((*(v__ast__MatchBranch*)/*ee elem_sym */array_get((*expr._v__ast__MatchExpr).branches, 0)).stmts), _t3, Array_v__ast__Stmt); @@ -61818,16 +61901,16 @@ v__ast__Expr v__transformer__Transformer_match_expr(v__transformer__Transformer* v__ast__Stmt* stmt = ((v__ast__Stmt*)branch->stmts.data) + i; *stmt = v__transformer__Transformer_stmt(t, stmt); if (i == branch->stmts.len - 1) { - if ((stmt)->_typ == 345 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 346 /* v.ast.ExprStmt */) { v__ast__Expr expr = (*stmt->_v__ast__ExprStmt).expr; - if (expr._typ == 306 /* v.ast.IfExpr */) { + if (expr._typ == 307 /* v.ast.IfExpr */) { if ((*expr._v__ast__IfExpr).branches.len == 1) { (*(v__ast__Stmt*)array_pop(&branch->stmts)); _PUSH_MANY(&branch->stmts, ((*(v__ast__IfBranch*)/*ee elem_sym */array_get((*expr._v__ast__IfExpr).branches, 0)).stmts), _t3, Array_v__ast__Stmt); break; } } - else if (expr._typ == 315 /* v.ast.MatchExpr */) { + else if (expr._typ == 316 /* v.ast.MatchExpr */) { if ((*expr._v__ast__MatchExpr).branches.len == 1) { (*(v__ast__Stmt*)array_pop(&branch->stmts)); _PUSH_MANY(&branch->stmts, ((*(v__ast__MatchBranch*)/*ee elem_sym */array_get((*expr._v__ast__MatchExpr).branches, 0)).stmts), _t4, Array_v__ast__Stmt); @@ -61876,7 +61959,7 @@ v__ast__Expr v__transformer__Transformer_sql_expr(v__transformer__Transformer* t } if (!DenseArray_has_index(&_t2.key_values, _t3)) {continue;} v__ast__SqlExpr* sub_struct = &(*(v__ast__SqlExpr*)DenseArray_value(&_t2.key_values, _t3)); - *sub_struct = /* as */ *(v__ast__SqlExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__SqlExpr_to_sumtype_v__ast__Expr(sub_struct))))._v__ast__SqlExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__SqlExpr_to_sumtype_v__ast__Expr(sub_struct))))._typ, 327) /*expected idx: 327, name: v.ast.SqlExpr */ ; + *sub_struct = /* as */ *(v__ast__SqlExpr*)__as_cast((v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__SqlExpr_to_sumtype_v__ast__Expr(sub_struct))))._v__ast__SqlExpr,(v__transformer__Transformer_expr(t, HEAP(v__ast__Expr, v__ast__SqlExpr_to_sumtype_v__ast__Expr(sub_struct))))._typ, 328) /*expected idx: 328, name: v.ast.SqlExpr */ ; } v__ast__Expr _t6 = v__ast__SqlExpr_to_sumtype_v__ast__Expr(node); return _t6; @@ -62002,9 +62085,9 @@ bool v__markused__mark_used_defer_0 = false; if (_t25 = v__ast__Table_find_sym(table, _SLIT("main.BenchedTests")), _t25.state == 0) { v__ast__TypeSymbol* benched_tests_sym = *(v__ast__TypeSymbol**)_t25.data; v__ast__Type bts_type = (*(v__ast__Param*)/*ee elem_sym */array_get((*(v__ast__Fn*)/*ee elem_sym */array_get(benched_tests_sym->methods, 0)).params, 0)).typ; - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".testing_step_start"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".testing_step_end"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".end_testing"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".testing_step_start"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".testing_step_end"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(bts_type)}}, {_SLIT(".end_testing"), 0, { .d_c = 0 }}}))) })); array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(_SLIT("main.start_testing")) })); } } @@ -62013,10 +62096,10 @@ bool v__markused__mark_used_defer_0 = false; if (isym->kind != v__ast__Kind__interface_) { continue; } - if ((isym->info)._typ != 473 /* v.ast.Interface */) { + if ((isym->info)._typ != 474 /* v.ast.Interface */) { continue; } - v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; if (interface_info.methods.len == 0) { continue; } @@ -62029,7 +62112,7 @@ bool v__markused__mark_used_defer_0 = false; v__ast__Fn method = ((v__ast__Fn*)interface_info.methods.data)[_t32]; for (int _t33 = 0; _t33 < interface_types.len; ++_t33) { v__ast__Type typ = ((v__ast__Type*)interface_types.data)[_t33]; - string interface_implementation_method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(typ))}}, {_SLIT("."), 0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string interface_implementation_method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(typ))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(interface_implementation_method_name) })); } } @@ -62039,7 +62122,7 @@ bool v__markused__mark_used_defer_0 = false; if (typ_vweb_result != 0) { array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(_SLIT("vweb.filter")) })); v__ast__Type typ_vweb_context = v__ast__Type_set_nr_muls(((v__ast__Table_find_type_idx(table, _SLIT("vweb.Context")))), 1); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(typ_vweb_context))}}, {_SLIT(".html"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(typ_vweb_context))}}, {_SLIT(".html"), 0, { .d_c = 0 }}}))) })); for (int _t37 = 0; _t37 < table->used_vweb_types.len; ++_t37) { v__ast__Type vgt = ((v__ast__Type*)table->used_vweb_types.data)[_t37]; v__ast__TypeSymbol* sym_app = v__ast__Table_sym(table, vgt); @@ -62047,7 +62130,7 @@ bool v__markused__mark_used_defer_0 = false; v__ast__Fn m = ((v__ast__Fn*)sym_app->methods.data)[_t38]; if (m.return_type == typ_vweb_result) { v__ast__Type pvgt = v__ast__Type_set_nr_muls(vgt, 1); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(pvgt))}}, {_SLIT("."), 0xfe10, {.d_s = m.name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(pvgt))}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = m.name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } } } @@ -62084,13 +62167,13 @@ bool v__markused__mark_used_defer_0 = false; } for (int _t46 = 0; _t46 < orm_connection_implementations.len; ++_t46) { v__ast__Type orm_type = ((v__ast__Type*)orm_connection_implementations.data)[_t46]; - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".select"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".insert"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".update"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".delete"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".create"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".drop"), 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".last_id"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".select"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".insert"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".update"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".delete"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".create"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".drop"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = ((int)(orm_type))}}, {_SLIT(".last_id"), 0, { .d_c = 0 }}}))) })); } } if (pref->is_livemain) { @@ -62210,18 +62293,18 @@ bool v__markused__all_fn_const_and_global_defer_0 = false; v__ast__File* file = (*(v__ast__File**)/*ee elem_sym */array_get(ast_files, i)); for (int _t1 = 0; _t1 < file->stmts.len; ++_t1) { v__ast__Stmt node = ((v__ast__Stmt*)file->stmts.data)[_t1]; - if (node._typ == 218 /* v.ast.FnDecl */) { + if (node._typ == 219 /* v.ast.FnDecl */) { string fkey = v__ast__FnDecl_fkey(&(*node._v__ast__FnDecl)); (*(v__ast__FnDecl*)map_get_and_set((map*)&all_fns, &(string[]){fkey}, &(v__ast__FnDecl[]){ (v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},} })) = (*node._v__ast__FnDecl); } - else if (node._typ == 341 /* v.ast.ConstDecl */) { + else if (node._typ == 342 /* v.ast.ConstDecl */) { for (int _t2 = 0; _t2 < (*node._v__ast__ConstDecl).fields.len; ++_t2) { v__ast__ConstField cfield = ((v__ast__ConstField*)(*node._v__ast__ConstDecl).fields.data)[_t2]; string ckey = cfield.name; (*(v__ast__ConstField*)map_get_and_set((map*)&all_consts, &(string[]){ckey}, &(v__ast__ConstField[]){ (v__ast__ConstField){.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.is_markused = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ = 0,.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.comptime_expr_value = v__ast__empty_comptime_const_expr(),} })) = cfield; } } - else if (node._typ == 349 /* v.ast.GlobalDecl */) { + else if (node._typ == 350 /* v.ast.GlobalDecl */) { for (int _t3 = 0; _t3 < (*node._v__ast__GlobalDecl).fields.len; ++_t3) { v__ast__GlobalField gfield = ((v__ast__GlobalField*)(*node._v__ast__GlobalDecl).fields.data)[_t3]; string gkey = gfield.name; @@ -62378,43 +62461,43 @@ void v__markused__Walker_mark_markused_globals(v__markused__Walker* w) { void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { v__ast__Stmt node = node_; - if (node._typ == 343 /* v.ast.EmptyStmt */) { + if (node._typ == 344 /* v.ast.EmptyStmt */) { } - else if (node._typ == 335 /* v.ast.AsmStmt */) { + else if (node._typ == 336 /* v.ast.AsmStmt */) { v__markused__Walker_asm_io(w, (*node._v__ast__AsmStmt).output); v__markused__Walker_asm_io(w, (*node._v__ast__AsmStmt).input); } - else if (node._typ == 336 /* v.ast.AssertStmt */) { + else if (node._typ == 337 /* v.ast.AssertStmt */) { if ((*node._v__ast__AssertStmt).is_used) { v__markused__Walker_expr(w, (*node._v__ast__AssertStmt).expr); w->n_asserts++; } } - else if (node._typ == 337 /* v.ast.AssignStmt */) { + else if (node._typ == 338 /* v.ast.AssignStmt */) { v__markused__Walker_exprs(w, (*node._v__ast__AssignStmt).left); v__markused__Walker_exprs(w, (*node._v__ast__AssignStmt).right); } - else if (node._typ == 338 /* v.ast.Block */) { + else if (node._typ == 339 /* v.ast.Block */) { v__markused__Walker_stmts(w, (*node._v__ast__Block).stmts); } - else if (node._typ == 340 /* v.ast.ComptimeFor */) { + else if (node._typ == 341 /* v.ast.ComptimeFor */) { v__markused__Walker_stmts(w, (*node._v__ast__ComptimeFor).stmts); } - else if (node._typ == 341 /* v.ast.ConstDecl */) { + else if (node._typ == 342 /* v.ast.ConstDecl */) { v__markused__Walker_const_fields(w, (*node._v__ast__ConstDecl).fields); } - else if (node._typ == 345 /* v.ast.ExprStmt */) { + else if (node._typ == 346 /* v.ast.ExprStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ExprStmt).expr); } - else if (node._typ == 218 /* v.ast.FnDecl */) { + else if (node._typ == 219 /* v.ast.FnDecl */) { v__markused__Walker_fn_decl(w, (voidptr)&/*qq*/(*node._v__ast__FnDecl)); } - else if (node._typ == 346 /* v.ast.ForCStmt */) { + else if (node._typ == 347 /* v.ast.ForCStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ForCStmt).cond); v__markused__Walker_stmt(w, (*node._v__ast__ForCStmt).inc); v__markused__Walker_stmts(w, (*node._v__ast__ForCStmt).stmts); } - else if (node._typ == 347 /* v.ast.ForInStmt */) { + else if (node._typ == 348 /* v.ast.ForInStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ForInStmt).cond); v__markused__Walker_expr(w, (*node._v__ast__ForInStmt).high); v__markused__Walker_stmts(w, (*node._v__ast__ForInStmt).stmts); @@ -62433,14 +62516,14 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { } } } - else if (node._typ == 348 /* v.ast.ForStmt */) { + else if (node._typ == 349 /* v.ast.ForStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ForStmt).cond); v__markused__Walker_stmts(w, (*node._v__ast__ForStmt).stmts); } - else if (node._typ == 356 /* v.ast.Return */) { + else if (node._typ == 357 /* v.ast.Return */) { v__markused__Walker_exprs(w, (*node._v__ast__Return).exprs); } - else if (node._typ == 357 /* v.ast.SqlStmt */) { + else if (node._typ == 358 /* v.ast.SqlStmt */) { v__markused__Walker_expr(w, (*node._v__ast__SqlStmt).db_expr); for (int _t2 = 0; _t2 < (*node._v__ast__SqlStmt).lines.len; ++_t2) { v__ast__SqlStmtLine line = ((v__ast__SqlStmtLine*)(*node._v__ast__SqlStmt).lines.data)[_t2]; @@ -62448,13 +62531,13 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { v__markused__Walker_exprs(w, line.update_exprs); } } - else if (node._typ == 358 /* v.ast.StructDecl */) { + else if (node._typ == 359 /* v.ast.StructDecl */) { v__markused__Walker_struct_fields(w, (*node._v__ast__StructDecl).fields); } - else if (node._typ == 342 /* v.ast.DeferStmt */) { + else if (node._typ == 343 /* v.ast.DeferStmt */) { v__markused__Walker_stmts(w, (*node._v__ast__DeferStmt).stmts); } - else if (node._typ == 349 /* v.ast.GlobalDecl */) { + else if (node._typ == 350 /* v.ast.GlobalDecl */) { for (int _t3 = 0; _t3 < (*node._v__ast__GlobalDecl).fields.len; ++_t3) { v__ast__GlobalField gf = ((v__ast__GlobalField*)(*node._v__ast__GlobalDecl).fields.data)[_t3]; if (gf.has_expr) { @@ -62462,25 +62545,25 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { } } } - else if (node._typ == 339 /* v.ast.BranchStmt */) { + else if (node._typ == 340 /* v.ast.BranchStmt */) { } - else if (node._typ == 344 /* v.ast.EnumDecl */) { + else if (node._typ == 345 /* v.ast.EnumDecl */) { } - else if (node._typ == 350 /* v.ast.GotoLabel */) { + else if (node._typ == 351 /* v.ast.GotoLabel */) { } - else if (node._typ == 351 /* v.ast.GotoStmt */) { + else if (node._typ == 352 /* v.ast.GotoStmt */) { } - else if (node._typ == 352 /* v.ast.HashStmt */) { + else if (node._typ == 353 /* v.ast.HashStmt */) { } - else if (node._typ == 353 /* v.ast.Import */) { + else if (node._typ == 354 /* v.ast.Import */) { } - else if (node._typ == 354 /* v.ast.InterfaceDecl */) { + else if (node._typ == 355 /* v.ast.InterfaceDecl */) { } - else if (node._typ == 355 /* v.ast.Module */) { + else if (node._typ == 356 /* v.ast.Module */) { } - else if (node._typ == 282 /* v.ast.TypeDecl */) { + else if (node._typ == 283 /* v.ast.TypeDecl */) { } - else if (node._typ == 316 /* v.ast.NodeError */) { + else if (node._typ == 317 /* v.ast.NodeError */) { } ; } @@ -62515,54 +62598,54 @@ VV_LOCAL_SYMBOL void v__markused__Walker_exprs(v__markused__Walker* w, Array_v__ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Expr node_) { v__ast__Expr node = node_; - if (node._typ == 301 /* v.ast.EmptyExpr */) { + if (node._typ == 302 /* v.ast.EmptyExpr */) { } - else if (node._typ == 298 /* v.ast.ComptimeType */) { + else if (node._typ == 299 /* v.ast.ComptimeType */) { } - else if (node._typ == 283 /* v.ast.AnonFn */) { + else if (node._typ == 284 /* v.ast.AnonFn */) { v__markused__Walker_fn_decl(w, (voidptr)&/*qq*/(*node._v__ast__AnonFn).decl); } - else if (node._typ == 285 /* v.ast.ArrayInit */) { + else if (node._typ == 286 /* v.ast.ArrayInit */) { v__markused__Walker_expr(w, (*node._v__ast__ArrayInit).len_expr); v__markused__Walker_expr(w, (*node._v__ast__ArrayInit).cap_expr); v__markused__Walker_expr(w, (*node._v__ast__ArrayInit).default_expr); v__markused__Walker_exprs(w, (*node._v__ast__ArrayInit).exprs); } - else if (node._typ == 287 /* v.ast.Assoc */) { + else if (node._typ == 288 /* v.ast.Assoc */) { v__markused__Walker_exprs(w, (*node._v__ast__Assoc).exprs); } - else if (node._typ == 284 /* v.ast.ArrayDecompose */) { + else if (node._typ == 285 /* v.ast.ArrayDecompose */) { v__markused__Walker_expr(w, (*node._v__ast__ArrayDecompose).expr); } - else if (node._typ == 291 /* v.ast.CallExpr */) { + else if (node._typ == 292 /* v.ast.CallExpr */) { v__markused__Walker_call_expr(w, (voidptr)&/*qq*/(*node._v__ast__CallExpr)); } - else if (node._typ == 292 /* v.ast.CastExpr */) { + else if (node._typ == 293 /* v.ast.CastExpr */) { v__markused__Walker_expr(w, (*node._v__ast__CastExpr).expr); v__markused__Walker_expr(w, (*node._v__ast__CastExpr).arg); } - else if (node._typ == 293 /* v.ast.ChanInit */) { + else if (node._typ == 294 /* v.ast.ChanInit */) { v__markused__Walker_expr(w, (*node._v__ast__ChanInit).cap_expr); } - else if (node._typ == 299 /* v.ast.ConcatExpr */) { + else if (node._typ == 300 /* v.ast.ConcatExpr */) { v__markused__Walker_exprs(w, (*node._v__ast__ConcatExpr).vals); } - else if (node._typ == 297 /* v.ast.ComptimeSelector */) { + else if (node._typ == 298 /* v.ast.ComptimeSelector */) { v__markused__Walker_expr(w, (*node._v__ast__ComptimeSelector).left); v__markused__Walker_expr(w, (*node._v__ast__ComptimeSelector).field_expr); } - else if (node._typ == 296 /* v.ast.ComptimeCall */) { + else if (node._typ == 297 /* v.ast.ComptimeCall */) { v__markused__Walker_expr(w, (*node._v__ast__ComptimeCall).left); if ((*node._v__ast__ComptimeCall).is_vweb) { v__markused__Walker_stmts(w, (*node._v__ast__ComptimeCall).vweb_tmpl.stmts); } } - else if (node._typ == 300 /* v.ast.DumpExpr */) { + else if (node._typ == 301 /* v.ast.DumpExpr */) { v__markused__Walker_expr(w, (*node._v__ast__DumpExpr).expr); v__markused__Walker_fn_by_name(w, _SLIT("eprint")); v__markused__Walker_fn_by_name(w, _SLIT("eprintln")); } - else if (node._typ == 304 /* v.ast.GoExpr */) { + else if (node._typ == 305 /* v.ast.GoExpr */) { v__markused__Walker_expr(w, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*node._v__ast__GoExpr).call_expr)); if (w->pref->os == v__pref__OS__windows) { v__markused__Walker_fn_by_name(w, _SLIT("panic_lasterr")); @@ -62572,7 +62655,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_fn_by_name(w, _SLIT("panic_error_number")); } } - else if (node._typ == 308 /* v.ast.IndexExpr */) { + else if (node._typ == 309 /* v.ast.IndexExpr */) { v__markused__Walker_expr(w, (*node._v__ast__IndexExpr).left); v__markused__Walker_expr(w, (*node._v__ast__IndexExpr).index); v__markused__Walker_or_block(w, (*node._v__ast__IndexExpr).or_expr); @@ -62584,7 +62667,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex w->table->used_maps++; } } - else if (node._typ == 309 /* v.ast.InfixExpr */) { + else if (node._typ == 310 /* v.ast.InfixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__InfixExpr).left); v__markused__Walker_expr(w, (*node._v__ast__InfixExpr).right); v__markused__Walker_or_block(w, (*node._v__ast__InfixExpr).or_block); @@ -62607,10 +62690,10 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex w->table->used_maps++; } } - else if (node._typ == 307 /* v.ast.IfGuardExpr */) { + else if (node._typ == 308 /* v.ast.IfGuardExpr */) { v__markused__Walker_expr(w, (*node._v__ast__IfGuardExpr).expr); } - else if (node._typ == 306 /* v.ast.IfExpr */) { + else if (node._typ == 307 /* v.ast.IfExpr */) { v__markused__Walker_expr(w, (*node._v__ast__IfExpr).left); for (int _t2 = 0; _t2 < (*node._v__ast__IfExpr).branches.len; ++_t2) { v__ast__IfBranch b = ((v__ast__IfBranch*)(*node._v__ast__IfExpr).branches.data)[_t2]; @@ -62618,7 +62701,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_stmts(w, b.stmts); } } - else if (node._typ == 305 /* v.ast.Ident */) { + else if (node._typ == 306 /* v.ast.Ident */) { if ((*node._v__ast__Ident).kind == (v__ast__IdentKind__constant)) { v__markused__Walker_mark_const_as_used(w, (*node._v__ast__Ident).name); @@ -62632,15 +62715,15 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex else { }; } - else if (node._typ == 312 /* v.ast.Likely */) { + else if (node._typ == 313 /* v.ast.Likely */) { v__markused__Walker_expr(w, (*node._v__ast__Likely).expr); } - else if (node._typ == 314 /* v.ast.MapInit */) { + else if (node._typ == 315 /* v.ast.MapInit */) { v__markused__Walker_exprs(w, (*node._v__ast__MapInit).keys); v__markused__Walker_exprs(w, (*node._v__ast__MapInit).vals); w->table->used_maps++; } - else if (node._typ == 315 /* v.ast.MatchExpr */) { + else if (node._typ == 316 /* v.ast.MatchExpr */) { v__markused__Walker_expr(w, (*node._v__ast__MatchExpr).cond); for (int _t3 = 0; _t3 < (*node._v__ast__MatchExpr).branches.len; ++_t3) { v__ast__MatchBranch b = ((v__ast__MatchBranch*)(*node._v__ast__MatchExpr).branches.data)[_t3]; @@ -62648,18 +62731,18 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_stmts(w, b.stmts); } } - else if (node._typ == 317 /* v.ast.None */) { + else if (node._typ == 318 /* v.ast.None */) { } - else if (node._typ == 320 /* v.ast.ParExpr */) { + else if (node._typ == 321 /* v.ast.ParExpr */) { v__markused__Walker_expr(w, (*node._v__ast__ParExpr).expr); } - else if (node._typ == 322 /* v.ast.PrefixExpr */) { + else if (node._typ == 323 /* v.ast.PrefixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__PrefixExpr).right); } - else if (node._typ == 321 /* v.ast.PostfixExpr */) { + else if (node._typ == 322 /* v.ast.PostfixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__PostfixExpr).expr); } - else if (node._typ == 323 /* v.ast.RangeExpr */) { + else if (node._typ == 324 /* v.ast.RangeExpr */) { if ((*node._v__ast__RangeExpr).has_low) { v__markused__Walker_expr(w, (*node._v__ast__RangeExpr).low); } @@ -62667,32 +62750,32 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_expr(w, (*node._v__ast__RangeExpr).high); } } - else if (node._typ == 326 /* v.ast.SizeOf */) { + else if (node._typ == 327 /* v.ast.SizeOf */) { v__markused__Walker_expr(w, (*node._v__ast__SizeOf).expr); } - else if (node._typ == 311 /* v.ast.IsRefType */) { + else if (node._typ == 312 /* v.ast.IsRefType */) { v__markused__Walker_expr(w, (*node._v__ast__IsRefType).expr); } - else if (node._typ == 328 /* v.ast.StringInterLiteral */) { + else if (node._typ == 329 /* v.ast.StringInterLiteral */) { v__markused__Walker_exprs(w, (*node._v__ast__StringInterLiteral).exprs); } - else if (node._typ == 325 /* v.ast.SelectorExpr */) { + else if (node._typ == 326 /* v.ast.SelectorExpr */) { v__markused__Walker_expr(w, (*node._v__ast__SelectorExpr).expr); } - else if (node._typ == 327 /* v.ast.SqlExpr */) { + else if (node._typ == 328 /* v.ast.SqlExpr */) { v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).db_expr); v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).offset_expr); v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).order_expr); v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).limit_expr); v__markused__Walker_expr(w, (*node._v__ast__SqlExpr).where_expr); } - else if (node._typ == 330 /* v.ast.StructInit */) { + else if (node._typ == 331 /* v.ast.StructInit */) { if ((*node._v__ast__StructInit).typ == 0) { return; } v__ast__TypeSymbol* sym = v__ast__Table_sym(w->table, (*node._v__ast__StructInit).typ); if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; for (int _t4 = 0; _t4 < info.fields.len; ++_t4) { v__ast__StructField ifield = ((v__ast__StructField*)info.fields.data)[_t4]; if (ifield.has_default_expr) { @@ -62718,52 +62801,52 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex v__markused__Walker_expr(w, sie.expr); } } - else if (node._typ == 332 /* v.ast.TypeOf */) { + else if (node._typ == 333 /* v.ast.TypeOf */) { v__markused__Walker_expr(w, (*node._v__ast__TypeOf).expr); } - else if (node._typ == 286 /* v.ast.AsCast */) { + else if (node._typ == 287 /* v.ast.AsCast */) { v__markused__Walker_expr(w, (*node._v__ast__AsCast).expr); } - else if (node._typ == 288 /* v.ast.AtExpr */) { + else if (node._typ == 289 /* v.ast.AtExpr */) { } - else if (node._typ == 289 /* v.ast.BoolLiteral */) { + else if (node._typ == 290 /* v.ast.BoolLiteral */) { } - else if (node._typ == 303 /* v.ast.FloatLiteral */) { + else if (node._typ == 304 /* v.ast.FloatLiteral */) { } - else if (node._typ == 294 /* v.ast.CharLiteral */) { + else if (node._typ == 295 /* v.ast.CharLiteral */) { } - else if (node._typ == 310 /* v.ast.IntegerLiteral */) { + else if (node._typ == 311 /* v.ast.IntegerLiteral */) { } - else if (node._typ == 329 /* v.ast.StringLiteral */) { + else if (node._typ == 330 /* v.ast.StringLiteral */) { } - else if (node._typ == 290 /* v.ast.CTempVar */) { + else if (node._typ == 291 /* v.ast.CTempVar */) { v__markused__Walker_expr(w, (*node._v__ast__CTempVar).orig); } - else if (node._typ == 295 /* v.ast.Comment */) { + else if (node._typ == 296 /* v.ast.Comment */) { } - else if (node._typ == 302 /* v.ast.EnumVal */) { + else if (node._typ == 303 /* v.ast.EnumVal */) { } - else if (node._typ == 313 /* v.ast.LockExpr */) { + else if (node._typ == 314 /* v.ast.LockExpr */) { v__markused__Walker_stmts(w, (*node._v__ast__LockExpr).stmts); } - else if (node._typ == 318 /* v.ast.OffsetOf */) { + else if (node._typ == 319 /* v.ast.OffsetOf */) { } - else if (node._typ == 319 /* v.ast.OrExpr */) { + else if (node._typ == 320 /* v.ast.OrExpr */) { v__markused__Walker_or_block(w, (*node._v__ast__OrExpr)); } - else if (node._typ == 324 /* v.ast.SelectExpr */) { + else if (node._typ == 325 /* v.ast.SelectExpr */) { for (int _t7 = 0; _t7 < (*node._v__ast__SelectExpr).branches.len; ++_t7) { v__ast__SelectBranch branch = ((v__ast__SelectBranch*)(*node._v__ast__SelectExpr).branches.data)[_t7]; v__markused__Walker_stmt(w, branch.stmt); v__markused__Walker_stmts(w, branch.stmts); } } - else if (node._typ == 331 /* v.ast.TypeNode */) { + else if (node._typ == 332 /* v.ast.TypeNode */) { } - else if (node._typ == 333 /* v.ast.UnsafeExpr */) { + else if (node._typ == 334 /* v.ast.UnsafeExpr */) { v__markused__Walker_expr(w, (*node._v__ast__UnsafeExpr).expr); } - else if (node._typ == 316 /* v.ast.NodeError */) { + else if (node._typ == 317 /* v.ast.NodeError */) { } ; } @@ -62876,10 +62959,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init(v__gen__c__Gen* g, v__ast__ArrayI } if (g->is_shared) { shared_styp = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(array_type.typ, v__ast__TypeFlag__shared_f)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else if (is_amp) { array_styp = v__gen__c__Gen_typ(g, array_type.typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), 0xfe10, {.d_s = array_styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), /*115 &string*/0xfe10, {.d_s = array_styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); } int len = node.exprs.len; if (array_type.unaliased_sym->kind == v__ast__Kind__array_fixed) { @@ -62890,11 +62973,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init(v__gen__c__Gen* g, v__ast__ArrayI string elem_styp = v__gen__c__Gen_typ(g, elem_type.typ); string noscan = v__gen__c__Gen_check_noscan(g, elem_type.typ); if (elem_type.unaliased_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array("), 0xfe07, {.d_i32 = len}}, {_SLIT(", "), 0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(voidptr), _MOV((voidptr["), 0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(voidptr), _MOV((voidptr["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } else if (v__gen__c__Gen_is_empty_struct(g, elem_type)) { - v__gen__c__Gen_write(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe07, {.d_i32 = len}}, {_SLIT(", "), 0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(voidptr), _MOV(("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("["), 0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(voidptr), _MOV(("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe07, {.d_i32 = len}}, {_SLIT(", "), 0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("), _MOV(("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("["), 0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("), _MOV(("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } if (len > 8) { v__gen__c__Gen_writeln(g, _SLIT("")); @@ -62902,7 +62985,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init(v__gen__c__Gen* g, v__ast__ArrayI } for (int i = 0; i < node.exprs.len; ++i) { v__ast__Expr expr = ((v__ast__Expr*)node.exprs.data)[i]; - if (v__ast__Type_alias_eq((*(v__ast__Type*)/*ee elem_sym */array_get(node.expr_types, i)), _const_v__ast__string_type) && (expr)._typ != 329 /* v.ast.StringLiteral */ && (expr)._typ != 328 /* v.ast.StringInterLiteral */) { + if (v__ast__Type_alias_eq((*(v__ast__Type*)/*ee elem_sym */array_get(node.expr_types, i)), _const_v__ast__string_type) && (expr)._typ != 330 /* v.ast.StringLiteral */ && (expr)._typ != 329 /* v.ast.StringInterLiteral */) { v__gen__c__Gen_write(g, _SLIT("string_clone(")); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); @@ -62920,7 +63003,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init(v__gen__c__Gen* g, v__ast__ArrayI } v__gen__c__Gen_write(g, _SLIT("}))")); if (g->is_shared) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp) { v__gen__c__Gen_write(g, _SLIT(")")); } @@ -62937,7 +63020,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ string ret_typ = v__gen__c__Gen_typ(g, node.typ); string elem_typ = v__gen__c__Gen_typ(g, node.elem_type); g->empty_line = true; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" ="), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("{")); if (node.has_val) { for (int i = 0; i < node.exprs.len; ++i) { @@ -62952,7 +63035,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ } } else if (node.has_default) { v__gen__c__Gen_write(g, _SLIT("0")); - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((array_type.unaliased_sym->info)._v__ast__ArrayFixed,(array_type.unaliased_sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((array_type.unaliased_sym->info)._v__ast__ArrayFixed,(array_type.unaliased_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; for (int _t1 = 1; _t1 < info.size; ++_t1) { v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_write(g, _SLIT("0")); @@ -62964,8 +63047,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_writeln(g, _SLIT("{")); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_typ}}, {_SLIT("* pelem = ("), 0xfe10, {.d_s = elem_typ}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int _len = (int)sizeof("), 0xfe10, {.d_s = tmp}}, {_SLIT(") / sizeof("), 0xfe10, {.d_s = elem_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT("* pelem = ("), /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int _len = (int)sizeof("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(") / sizeof("), /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("for(int it=0; it<_len; it++, pelem++) {")); g->indent++; v__gen__c__Gen_write(g, _SLIT("*pelem = ")); @@ -62992,7 +63075,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ stmt_str = v__gen__c__Gen_go_before_stmt(g, 0); string ret_typ = v__gen__c__Gen_typ(g, node.typ); g->empty_line = true; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("{")); if (node.has_val) { @@ -63008,7 +63091,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fixed_array_init(v__gen__c__Gen* g, v__ast__ } } else if (node.has_default) { v__gen__c__Gen_expr(g, node.default_expr); - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((array_type.unaliased_sym->info)._v__ast__ArrayFixed,(array_type.unaliased_sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((array_type.unaliased_sym->info)._v__ast__ArrayFixed,(array_type.unaliased_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; for (int _t2 = 1; _t2 < info.size; ++_t2) { v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_expr(g, node.default_expr); @@ -63038,13 +63121,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ string ret_typ = v__gen__c__Gen_typ(g, node.typ); string elem_typ = v__gen__c__Gen_typ(g, node.elem_type); g->empty_line = true; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" ="), 0, { .d_c = 0 }}}))); if (is_default_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_array_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_array_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else if (is_default_map) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_map_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_map_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } if (node.has_len) { v__gen__c__Gen_expr(g, node.len_expr); @@ -63061,33 +63144,33 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ if (elem_type.unaliased_sym->kind == v__ast__Kind__function || v__gen__c__Gen_is_empty_struct(g, elem_type)) { v__gen__c__Gen_write(g, _SLIT("sizeof(voidptr), ")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); } if (is_default_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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, _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("&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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_write(g, _SLIT("_SLIT(\"\")")); v__gen__c__Gen_write(g, _SLIT("})")); } else if (node.has_len && (elem_type.unaliased_sym->kind == v__ast__Kind__array || elem_type.unaliased_sym->kind == v__ast__Kind__map)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr)&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr)&("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); 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 { v__gen__c__Gen_write(g, _SLIT("0)")); } if (g->is_shared) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp) { v__gen__c__Gen_write(g, _SLIT(")")); } v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_writeln(g, _SLIT("{")); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_typ}}, {_SLIT("* pelem = ("), 0xfe10, {.d_s = elem_typ}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("for(int it=0; it<"), 0xfe10, {.d_s = tmp}}, {_SLIT(".len; it++, pelem++) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT("* pelem = ("), /*115 &string*/0xfe10, {.d_s = elem_typ}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("for(int it=0; it<"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".len; it++, pelem++) {"), 0, { .d_c = 0 }}}))); g->indent++; v__gen__c__Gen_write(g, _SLIT("*pelem = ")); v__gen__c__Gen_expr(g, node.default_expr); @@ -63106,11 +63189,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ return; } if (is_default_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_array_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_array_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else if (is_default_map) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_map_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_map_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_default"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array_with_default"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } if (node.has_len) { v__gen__c__Gen_expr(g, node.len_expr); @@ -63127,29 +63210,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_array_init_with_fields(v__gen__c__Gen* g, v_ if (elem_type.unaliased_sym->kind == v__ast__Kind__function || v__gen__c__Gen_is_empty_struct(g, elem_type)) { v__gen__c__Gen_write(g, _SLIT("sizeof(voidptr), ")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); } if (is_default_array || is_default_map) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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, _SLIT("}[0])")); } else if (node.has_default) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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_with_cast(g, node.default_expr, node.default_type, node.elem_type); v__gen__c__Gen_write(g, _SLIT("})")); } 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("&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + 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_write(g, _SLIT("_SLIT(\"\")")); v__gen__c__Gen_write(g, _SLIT("})")); } else if (node.has_len && (elem_type.unaliased_sym->kind == v__ast__Kind__array || elem_type.unaliased_sym->kind == v__ast__Kind__map)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr)&("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr)&("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); 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 { v__gen__c__Gen_write(g, _SLIT("0)")); } if (g->is_shared) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp) { v__gen__c__Gen_write(g, _SLIT(")")); } @@ -63164,9 +63247,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal string ret_typ = v__gen__c__Gen_typ(g, node.return_type); v__ast__TypeSymbol* ret_sym = v__ast__Table_sym(g->table, node.return_type); v__ast__TypeSymbol* inp_sym = v__ast__Table_sym(g->table, node.receiver_type); - v__ast__Array ret_info = /* as */ *(v__ast__Array*)__as_cast((ret_sym->info)._v__ast__Array,(ret_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array ret_info = /* as */ *(v__ast__Array*)__as_cast((ret_sym->info)._v__ast__Array,(ret_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string ret_elem_type = v__gen__c__Gen_typ(g, ret_info.elem_type); - v__ast__Array inp_info = /* as */ *(v__ast__Array*)__as_cast((inp_sym->info)._v__ast__Array,(inp_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array inp_info = /* as */ *(v__ast__Array*)__as_cast((inp_sym->info)._v__ast__Array,(inp_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string inp_elem_type = v__gen__c__Gen_typ(g, inp_info.elem_type); if (inp_sym->kind != v__ast__Kind__array) { v__gen__c__verror(_SLIT("map() requires an array")); @@ -63174,43 +63257,43 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal } g->empty_line = true; string noscan = v__gen__c__Gen_check_noscan(g, ret_info.elem_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); bool has_infix_left_var_name = g->infix_left_var_name.len > 0; if (has_infix_left_var_name) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); 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__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + 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 }}}))); 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")); } v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT(" = __new_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len, sizeof("), 0xfe10, {.d_s = ret_elem_type}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = __new_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len, sizeof("), /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); string i = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = inp_elem_type}}, {_SLIT(" it = (("), 0xfe10, {.d_s = inp_elem_type}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = inp_elem_type}}, {_SLIT(" it = (("), /*115 &string*/0xfe10, {.d_s = inp_elem_type}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); bool is_embed_map_filter = false; v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (expr._typ == 283 /* v.ast.AnonFn */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); + if (expr._typ == 284 /* v.ast.AnonFn */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr._v__ast__AnonFn)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 305 /* v.ast.Ident */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); + else if (expr._typ == 306 /* v.ast.Ident */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*expr._v__ast__Ident)); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, var_info.typ); if (sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } @@ -63218,22 +63301,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } } - else if (expr._typ == 291 /* v.ast.CallExpr */) { + else if (expr._typ == 292 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("map")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("any"))) { is_embed_map_filter = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_elem_type}}, {_SLIT(" ti = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } ; v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("array_push"), 0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&"), 0xfe10, {.d_s = tmp}}, {_SLIT(", &ti);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("array_push"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(", &ti);"), 0, { .d_c = 0 }}}))); g->indent--; v__gen__c__Gen_writeln(g, _SLIT("}")); if (!is_embed_map_filter) { @@ -63264,9 +63347,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort(v__gen__c__Gen* g, v__ast__Ca v__gen__c__Gen_writeln(g, _SLIT("bare_panic(_SLIT(\"sort does not work with -freestanding\"))")); return; } - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((rec_sym->info)._v__ast__Array,(rec_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((rec_sym->info)._v__ast__Array,(rec_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string elem_stype = v__gen__c__Gen_typ(g, info.elem_type); - string compare_fn = str_intp(3, _MOV((StrIntpData[]){{_SLIT("compare_"), 0xfe08, {.d_u64 = g->unique_file_path_hash}}, {_SLIT("_"), 0xfe10, {.d_s = string_replace(elem_stype, _SLIT("*"), _SLIT("_ptr"))}}, {_SLIT0, 0, { .d_c = 0 }}})); + string compare_fn = str_intp(3, _MOV((StrIntpData[]){{_SLIT("compare_"), /*117 &u64*/0xfe08, {.d_u64 = g->unique_file_path_hash}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = string_replace(elem_stype, _SLIT("*"), _SLIT("_ptr"))}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Type comparison_type = v__gen__c__Gen_unwrap(g, _const_v__ast__void_type); string left_expr = _SLIT(""); string right_expr = _SLIT(""); @@ -63283,7 +63366,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort(v__gen__c__Gen* g, v__ast__Ca left_expr = _SLIT("*a"); right_expr = _SLIT("*b"); } else { - v__ast__InfixExpr infix_expr = /* as */ *(v__ast__InfixExpr*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._v__ast__InfixExpr,((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ, 309) /*expected idx: 309, name: v.ast.InfixExpr */ ; + v__ast__InfixExpr infix_expr = /* as */ *(v__ast__InfixExpr*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._v__ast__InfixExpr,((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ, 310) /*expected idx: 310, name: v.ast.InfixExpr */ ; comparison_type = v__gen__c__Gen_unwrap(g, v__ast__Type_set_nr_muls(infix_expr.left_type, 0)); string left_name = v__ast__Expr_str(infix_expr.left); if (left_name.len > 1) { @@ -63304,19 +63387,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort(v__gen__c__Gen* g, v__ast__Ca if (string_starts_with(left_name, _SLIT("a")) != is_reverse) { left_expr = v__gen__c__Gen_expr_string(g, infix_expr.left); right_expr = v__gen__c__Gen_expr_string(g, infix_expr.right); - if ((infix_expr.left)._typ == 305 /* v.ast.Ident */) { + if ((infix_expr.left)._typ == 306 /* v.ast.Ident */) { left_expr = string__plus(_SLIT("*"), left_expr); } - if ((infix_expr.right)._typ == 305 /* v.ast.Ident */) { + if ((infix_expr.right)._typ == 306 /* v.ast.Ident */) { right_expr = string__plus(_SLIT("*"), right_expr); } } else { left_expr = v__gen__c__Gen_expr_string(g, infix_expr.right); right_expr = v__gen__c__Gen_expr_string(g, infix_expr.left); - if ((infix_expr.left)._typ == 305 /* v.ast.Ident */) { + if ((infix_expr.left)._typ == 306 /* v.ast.Ident */) { right_expr = string__plus(_SLIT("*"), right_expr); } - if ((infix_expr.right)._typ == 305 /* v.ast.Ident */) { + if ((infix_expr.right)._typ == 306 /* v.ast.Ident */) { left_expr = string__plus(_SLIT("*"), left_expr); } } @@ -63327,9 +63410,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort(v__gen__c__Gen* g, v__ast__Ca } sync__RwMutex_unlock(&g->array_sort_fn->mtx);; string stype_arg = v__gen__c__Gen_typ(g, info.elem_type); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("VV_LOCAL_SYMBOL int "), 0xfe10, {.d_s = compare_fn}}, {_SLIT("("), 0xfe10, {.d_s = stype_arg}}, {_SLIT("* a, "), 0xfe10, {.d_s = stype_arg}}, {_SLIT("* b) {"), 0, { .d_c = 0 }}}))); - string c_condition = (v__ast__TypeSymbol_has_method(comparison_type.sym, _SLIT("<")) ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, comparison_type.typ)}}, {_SLIT("__lt("), 0xfe10, {.d_s = left_expr}}, {_SLIT(", "), 0xfe10, {.d_s = right_expr}}, {_SLIT(")"), 0, { .d_c = 0 }}}))) : v__ast__TypeSymbol_has_method(comparison_type.unaliased_sym, _SLIT("<")) ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, comparison_type.unaliased)}}, {_SLIT("__lt("), 0xfe10, {.d_s = left_expr}}, {_SLIT(", "), 0xfe10, {.d_s = right_expr}}, {_SLIT(")"), 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left_expr}}, {_SLIT(" < "), 0xfe10, {.d_s = right_expr}}, {_SLIT0, 0, { .d_c = 0 }}})))); - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = c_condition}}, {_SLIT(") return -1;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("VV_LOCAL_SYMBOL int "), /*115 &string*/0xfe10, {.d_s = compare_fn}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = stype_arg}}, {_SLIT("* a, "), /*115 &string*/0xfe10, {.d_s = stype_arg}}, {_SLIT("* b) {"), 0, { .d_c = 0 }}}))); + string c_condition = (v__ast__TypeSymbol_has_method(comparison_type.sym, _SLIT("<")) ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, comparison_type.typ)}}, {_SLIT("__lt("), /*115 &string*/0xfe10, {.d_s = left_expr}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = right_expr}}, {_SLIT(")"), 0, { .d_c = 0 }}}))) : v__ast__TypeSymbol_has_method(comparison_type.unaliased_sym, _SLIT("<")) ? ( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, comparison_type.unaliased)}}, {_SLIT("__lt("), /*115 &string*/0xfe10, {.d_s = left_expr}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = right_expr}}, {_SLIT(")"), 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_expr}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = right_expr}}, {_SLIT0, 0, { .d_c = 0 }}})))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = c_condition}}, {_SLIT(") return -1;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->definitions, _SLIT("\telse return 1;")); strings__Builder_writeln(&g->definitions, _SLIT("}\n")); v__gen__c__Gen_gen_array_sort_call(g, node, compare_fn); @@ -63340,11 +63423,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_sort_call(v__gen__c__Gen* g, v__as g->empty_line = true; v__gen__c__Gen_write(g, _SLIT("qsort(")); v__gen__c__Gen_expr(g, node.left); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = deref_field}}, {_SLIT("data, "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = deref_field}}, {_SLIT("data, "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = deref_field}}, {_SLIT("len, "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = deref_field}}, {_SLIT("len, "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = deref_field}}, {_SLIT("element_size, (int (*)(const void *, const void *))&"), 0xfe10, {.d_s = compare_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = deref_field}}, {_SLIT("element_size, (int (*)(const void *, const void *))&"), /*115 &string*/0xfe10, {.d_s = compare_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__CallExpr node) { @@ -63357,48 +63440,48 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ v__gen__c__verror(_SLIT("filter() requires an array")); VUNREACHABLE(); } - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string styp = v__gen__c__Gen_typ(g, node.return_type); string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); g->empty_line = true; string noscan = v__gen__c__Gen_check_noscan(g, info.elem_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); bool has_infix_left_var_name = g->infix_left_var_name.len > 0; if (has_infix_left_var_name) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); 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__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + 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 }}}))); 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")); } v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT(" = __new_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len, sizeof("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = __new_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len, sizeof("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); string i = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); bool is_embed_map_filter = false; v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (expr._typ == 283 /* v.ast.AnonFn */) { + if (expr._typ == 284 /* v.ast.AnonFn */) { v__gen__c__Gen_write(g, _SLIT("if (")); v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr._v__ast__AnonFn)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 305 /* v.ast.Ident */) { + else if (expr._typ == 306 /* v.ast.Ident */) { v__gen__c__Gen_write(g, _SLIT("if (")); if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*expr._v__ast__Ident)); v__ast__TypeSymbol* sym_t = v__ast__Table_sym(g->table, var_info.typ); if (sym_t->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } @@ -63406,7 +63489,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } } - else if (expr._typ == 291 /* v.ast.CallExpr */) { + else if (expr._typ == 292 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("map")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("any"))) { is_embed_map_filter = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); @@ -63421,7 +63504,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ } ; v__gen__c__Gen_writeln(g, _SLIT(") {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tarray_push"), 0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&"), 0xfe10, {.d_s = tmp}}, {_SLIT(", &it);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tarray_push"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(", &it);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -63442,15 +63525,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_insert(v__gen__c__Gen* g, v__ast__CallExpr node) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, node.left_type); - v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, left_info.elem_type); v__ast__TypeSymbol* arg2_sym = v__ast__Table_sym(g->table, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 1)).typ); bool is_arg2_array = arg2_sym->kind == v__ast__Kind__array && v__ast__Type_alias_eq((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 1)).typ, node.left_type); string noscan = v__gen__c__Gen_check_noscan(g, left_info.elem_type); if (is_arg2_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_insert_many"), 0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_insert_many"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_insert"), 0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_insert"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); @@ -63462,7 +63545,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_insert(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 1)).expr); v__gen__c__Gen_write(g, _SLIT(".len)")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); if (v__ast__Type_alias_eq(left_info.elem_type, _const_v__ast__string_type)) { v__gen__c__Gen_write(g, _SLIT("string_clone(")); } @@ -63476,15 +63559,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_insert(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_prepend(v__gen__c__Gen* g, v__ast__CallExpr node) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, node.left_type); - v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, left_info.elem_type); v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(g->table, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).typ); bool is_arg_array = arg_sym->kind == v__ast__Kind__array && v__ast__Type_alias_eq((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).typ, node.left_type); string noscan = v__gen__c__Gen_check_noscan(g, left_info.elem_type); if (is_arg_array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_prepend_many"), 0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_prepend_many"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_prepend"), 0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_prepend"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(&"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.left); if (is_arg_array) { @@ -63494,7 +63577,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_prepend(v__gen__c__Gen* g, v__ast_ v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); v__gen__c__Gen_write(g, _SLIT(".len)")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr_with_cast(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).typ, left_info.elem_type); v__gen__c__Gen_write(g, _SLIT("})")); } @@ -63517,42 +63600,42 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains_methods(v__gen__c__Gen* g } array_push((array*)&done, _MOV((v__ast__Type[]){ t })); string left_type_str = v__gen__c__Gen_typ(g, t); - string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left_type_str}}, {_SLIT("_contains"), 0, { .d_c = 0 }}})); - v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_final_sym->info)._v__ast__Array,(left_final_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT("_contains"), 0, { .d_c = 0 }}})); + v__ast__Array left_info = /* as */ *(v__ast__Array*)__as_cast((left_final_sym->info)._v__ast__Array,(left_final_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, left_info.elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, left_info.elem_type); if (elem_sym->kind == v__ast__Kind__function) { left_type_str = _SLIT("Array_voidptr"); elem_type_str = _SLIT("voidptr"); } - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tfor (int i = 0; i < a.len; ++i) {")); if (elem_sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (fast_string_eq(((string*)a.data)[i], v)) {")); } else if (elem_sym->kind == v__ast__Kind__array && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__function) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (((voidptr*)a.data)[i] == v) {")); } else if (elem_sym->kind == v__ast__Kind__map && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__struct_ && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__interface_ && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__sum_type && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__alias && v__ast__Type_nr_muls(left_info.elem_type) == 0) { string ptr_typ = v__gen__c__Gen_equality_fn(g, left_info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i], v)) {"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ((("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i] == v) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ((("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)a.data)[i] == v) {"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&fn_builder, _SLIT("\t\t\treturn true;")); strings__Builder_writeln(&fn_builder, _SLIT("\t\t}")); @@ -63565,7 +63648,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains_methods(v__gen__c__Gen* g VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains(v__gen__c__Gen* g, v__ast__Type typ, v__ast__Expr left, v__ast__Expr right) { string fn_name = v__gen__c__Gen_get_array_contains_method(g, typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, strings__repeat('*', v__ast__Type_nr_muls(typ))); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { strings__Builder_go_back(&g->out, 1); @@ -63599,41 +63682,41 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_index_methods(v__gen__c__Gen* g) { array_push((array*)&done, _MOV((v__ast__Type[]){ t })); v__ast__TypeSymbol* final_left_sym = v__ast__Table_final_sym(g->table, t); string left_type_str = v__gen__c__Gen_typ(g, t); - string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left_type_str}}, {_SLIT("_index"), 0, { .d_c = 0 }}})); - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((final_left_sym->info)._v__ast__Array,(final_left_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT("_index"), 0, { .d_c = 0 }}})); + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((final_left_sym->info)._v__ast__Array,(final_left_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, info.elem_type); if (elem_sym->kind == v__ast__Kind__function) { left_type_str = _SLIT("Array_voidptr"); elem_type_str = _SLIT("voidptr"); } - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static int "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static int "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static int "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("* pelem = a.data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static int "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" v) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("* pelem = a.data;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tfor (int i = 0; i < a.len; ++i, ++pelem) {")); if (elem_sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (fast_string_eq(*pelem, v)) {")); } else if (elem_sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(info.elem_type)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__function && !v__ast__Type_is_ptr(info.elem_type)) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif ( pelem == v) {")); } else if (elem_sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(info.elem_type)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq((*pelem, v))) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq((*pelem, v))) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(info.elem_type)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__interface_) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__sum_type) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__alias) { string ptr_typ = v__gen__c__Gen_equality_fn(g, info.elem_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq(*pelem, v)) {"), 0, { .d_c = 0 }}}))); } else { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (*pelem == v) {")); } @@ -63648,7 +63731,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_index_methods(v__gen__c__Gen* g) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_index(v__gen__c__Gen* g, v__ast__CallExpr node) { string fn_name = v__gen__c__Gen_get_array_index_method(g, node.left_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(node.left_type)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -63668,7 +63751,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_wait(v__gen__c__Gen* g, v__ast__Ca v__ast__Type thread_ret_type = v__ast__TypeSymbol_thread_info(thread_sym).return_type; string eltyp = v__ast__Table_sym(g->table, thread_ret_type)->cname; string fn_name = v__gen__c__Gen_register_thread_array_wait_call(g, eltyp); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(")")); } @@ -63679,41 +63762,41 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal bool s_ends_with_ln = string_ends_with(s, _SLIT("\n")); s = string_trim_space(s); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.left_type); - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); bool has_infix_left_var_name = g->infix_left_var_name.len > 0; if (has_infix_left_var_name) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->infix_left_var_name = _SLIT(""); g->indent++; } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.left_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); string i = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); bool is_embed_map_filter = false; v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (expr._typ == 283 /* v.ast.AnonFn */) { + if (expr._typ == 284 /* v.ast.AnonFn */) { v__gen__c__Gen_write(g, _SLIT("if (")); v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr._v__ast__AnonFn)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 305 /* v.ast.Ident */) { + else if (expr._typ == 306 /* v.ast.Ident */) { v__gen__c__Gen_write(g, _SLIT("if (")); if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*expr._v__ast__Ident)); v__ast__TypeSymbol* sym_t = v__ast__Table_sym(g->table, var_info.typ); if (sym_t->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } @@ -63721,7 +63804,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } } - else if (expr._typ == 291 /* v.ast.CallExpr */) { + else if (expr._typ == 292 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("map")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("any"))) { is_embed_map_filter = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); @@ -63736,7 +63819,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal } ; v__gen__c__Gen_writeln(g, _SLIT(") {")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tbreak;")); v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; @@ -63762,42 +63845,42 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__Cal bool s_ends_with_ln = string_ends_with(s, _SLIT("\n")); s = string_trim_space(s); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.left_type); - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); bool has_infix_left_var_name = g->infix_left_var_name.len > 0; if (has_infix_left_var_name) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->infix_left_var_name = _SLIT(""); g->indent++; } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.left_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.left_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.len;"), 0, { .d_c = 0 }}}))); string i = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT(" it = (("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_orig.data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); g->empty_line = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); bool is_embed_map_filter = false; v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; - if (expr._typ == 283 /* v.ast.AnonFn */) { + if (expr._typ == 284 /* v.ast.AnonFn */) { v__gen__c__Gen_write(g, _SLIT("if (!(")); v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr._v__ast__AnonFn)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 305 /* v.ast.Ident */) { + else if (expr._typ == 306 /* v.ast.Ident */) { v__gen__c__Gen_write(g, _SLIT("if (!(")); if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else if ((*expr._v__ast__Ident).kind == v__ast__IdentKind__variable) { v__ast__IdentVar var_info = v__ast__Ident_var_info(&(*expr._v__ast__Ident)); v__ast__TypeSymbol* sym_t = v__ast__Table_sym(g->table, var_info.typ); if (sym_t->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } @@ -63805,7 +63888,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__Cal v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); } } - else if (expr._typ == 291 /* v.ast.CallExpr */) { + else if (expr._typ == 292 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("map")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*expr._v__ast__CallExpr).name, _SLIT("any"))) { is_embed_map_filter = true; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); @@ -63820,7 +63903,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__Cal } ; v__gen__c__Gen_writeln(g, _SLIT(")) {")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tbreak;")); v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; @@ -63846,7 +63929,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__A } v__ast__AssertStmt node = original_assert_statement; v__gen__c__Gen_writeln(g, _SLIT("// assert")); - if ((node.expr)._typ == 309 /* v.ast.InfixExpr */) { + if ((node.expr)._typ == 310 /* v.ast.InfixExpr */) { Option_v__ast__Expr _t1; if (_t1 = v__gen__c__Gen_assert_subexpression_to_ctemp(g, (*node.expr._v__ast__InfixExpr).left, (*node.expr._v__ast__InfixExpr).left_type), _t1.state == 0) { v__ast__Expr subst_expr = *(v__ast__Expr*)_t1.data; @@ -63866,10 +63949,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__A v__gen__c__Gen_decrement_inside_ternary(g); v__gen__c__Gen_writeln(g, _SLIT(" {")); string metaname_ok = v__gen__c__Gen_gen_assert_metainfo(g, node); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_assert_pass(test_runner._object, &"), 0xfe10, {.d_s = metaname_ok}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_assert_pass(test_runner._object, &"), /*115 &string*/0xfe10, {.d_s = metaname_ok}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("} else {")); string metaname_fail = v__gen__c__Gen_gen_assert_metainfo(g, node); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_assert_fail(test_runner._object, &"), 0xfe10, {.d_s = metaname_fail}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_assert_fail(test_runner._object, &"), /*115 &string*/0xfe10, {.d_s = metaname_fail}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assert_postfailure_mode(g, node); v__gen__c__Gen_writeln(g, _SLIT("\tlongjmp(g_jump_buffer, 1);")); v__gen__c__Gen_writeln(g, _SLIT("\t// TODO")); @@ -63882,7 +63965,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__A v__gen__c__Gen_decrement_inside_ternary(g); v__gen__c__Gen_writeln(g, _SLIT(" {")); string metaname_panic = v__gen__c__Gen_gen_assert_metainfo(g, node); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t__print_assert_failure(&"), 0xfe10, {.d_s = metaname_panic}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t__print_assert_failure(&"), /*115 &string*/0xfe10, {.d_s = metaname_panic}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assert_postfailure_mode(g, node); v__gen__c__Gen_writeln(g, _SLIT("\t_v_panic(_SLIT(\"Assertion failed...\"));")); v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -63890,23 +63973,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__A } VV_LOCAL_SYMBOL Option_v__ast__Expr v__gen__c__Gen_assert_subexpression_to_ctemp(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type expr_type) { - if (expr._typ == 291 /* v.ast.CallExpr */) { + if (expr._typ == 292 /* v.ast.CallExpr */) { Option_v__ast__Expr _t1; opt_ok(&(v__ast__Expr[]) { v__ast__CTempVar_to_sumtype_v__ast__Expr(ADDR(v__ast__CTempVar, (v__gen__c__Gen_new_ctemp_var_then_gen(g, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*expr._v__ast__CallExpr)), expr_type)))) }, (Option*)(&_t1), sizeof(v__ast__Expr)); return _t1; } - else if (expr._typ == 320 /* v.ast.ParExpr */) { - if (((*expr._v__ast__ParExpr).expr)._typ == 291 /* v.ast.CallExpr */) { + else if (expr._typ == 321 /* v.ast.ParExpr */) { + if (((*expr._v__ast__ParExpr).expr)._typ == 292 /* v.ast.CallExpr */) { Option_v__ast__Expr _t2; opt_ok(&(v__ast__Expr[]) { v__ast__CTempVar_to_sumtype_v__ast__Expr(ADDR(v__ast__CTempVar, (v__gen__c__Gen_new_ctemp_var_then_gen(g, v__ast__CallExpr_to_sumtype_v__ast__Expr(&(*(*expr._v__ast__ParExpr).expr._v__ast__CallExpr)), expr_type)))) }, (Option*)(&_t2), sizeof(v__ast__Expr)); return _t2; } } - else if (expr._typ == 325 /* v.ast.SelectorExpr */) { - if (((*expr._v__ast__SelectorExpr).expr)._typ == 291 /* v.ast.CallExpr */) { + else if (expr._typ == 326 /* v.ast.SelectorExpr */) { + if (((*expr._v__ast__SelectorExpr).expr)._typ == 292 /* v.ast.CallExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_final_sym(g->table, v__gen__c__Gen_unwrap_generic(g, (*(*expr._v__ast__SelectorExpr).expr._v__ast__CallExpr).return_type)); if (sym->kind == v__ast__Kind__struct_) { - if ((/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).is_union) { + if ((/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).is_union) { return (Option_v__ast__Expr){ .state=2, .err=_const_v__gen__c__unsupported_ctemp_assert_transform, .data={EMPTY_STRUCT_INITIALIZATION} }; } } @@ -63940,29 +64023,29 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ string fn_name = g->fn_decl->name; int line_nr = node.pos.line_nr; string src = v__gen__c__cestring(v__ast__Expr_str(node.expr)); - string metaname = str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_assert_meta_info_"), 0xfe10, {.d_s = v__gen__c__Gen_new_tmp_var(g)}}, {_SLIT0, 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tVAssertMetaInfo "), 0xfe10, {.d_s = metaname}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".fpath = "), 0xfe10, {.d_s = v__gen__c__ctoslit(mod_path)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".line_nr = "), 0xfe07, {.d_i32 = line_nr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".fn_name = "), 0xfe10, {.d_s = v__gen__c__ctoslit(fn_name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + string metaname = str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_assert_meta_info_"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_new_tmp_var(g)}}, {_SLIT0, 0, { .d_c = 0 }}})); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tVAssertMetaInfo "), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".fpath = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(mod_path)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".line_nr = "), /*100 &int*/0xfe07, {.d_i32 = line_nr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".fn_name = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(fn_name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); string metasrc = v__gen__c__cnewlines(v__gen__c__ctoslit(src)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".src = "), 0xfe10, {.d_s = metasrc}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - if (node.expr._typ == 309 /* v.ast.InfixExpr */) { + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".src = "), /*115 &string*/0xfe10, {.d_s = metasrc}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + if (node.expr._typ == 310 /* v.ast.InfixExpr */) { string expr_op_str = v__gen__c__ctoslit(v__token__Kind_str((*node.expr._v__ast__InfixExpr).op)); string expr_left_str = v__gen__c__cnewlines(v__gen__c__ctoslit(v__ast__Expr_str((*node.expr._v__ast__InfixExpr).left))); string expr_right_str = v__gen__c__cnewlines(v__gen__c__ctoslit(v__ast__Expr_str((*node.expr._v__ast__InfixExpr).right))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".op = "), 0xfe10, {.d_s = expr_op_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".llabel = "), 0xfe10, {.d_s = expr_left_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".rlabel = "), 0xfe10, {.d_s = expr_right_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".lvalue = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".op = "), /*115 &string*/0xfe10, {.d_s = expr_op_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".llabel = "), /*115 &string*/0xfe10, {.d_s = expr_left_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".rlabel = "), /*115 &string*/0xfe10, {.d_s = expr_right_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".lvalue = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assert_single_expr(g, (*node.expr._v__ast__InfixExpr).left, (*node.expr._v__ast__InfixExpr).left_type); v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".rvalue = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".rvalue = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assert_single_expr(g, (*node.expr._v__ast__InfixExpr).right, (*node.expr._v__ast__InfixExpr).right_type); v__gen__c__Gen_writeln(g, _SLIT(";")); } - else if (node.expr._typ == 291 /* v.ast.CallExpr */) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = metaname}}, {_SLIT(".op = _SLIT(\"call\");"), 0, { .d_c = 0 }}}))); + else if (node.expr._typ == 292 /* v.ast.CallExpr */) { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = metaname}}, {_SLIT(".op = _SLIT(\"call\");"), 0, { .d_c = 0 }}}))); } else { @@ -63974,39 +64057,39 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_single_expr(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type typ) { string unknown_value = _SLIT("*unknown value*"); - if (expr._typ == 292 /* v.ast.CastExpr */) { + if (expr._typ == 293 /* v.ast.CastExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 306 /* v.ast.IfExpr */) { + else if (expr._typ == 307 /* v.ast.IfExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 308 /* v.ast.IndexExpr */) { + else if (expr._typ == 309 /* v.ast.IndexExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 315 /* v.ast.MatchExpr */) { + else if (expr._typ == 316 /* v.ast.MatchExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 322 /* v.ast.PrefixExpr */) { - if (((*expr._v__ast__PrefixExpr).right)._typ == 292 /* v.ast.CastExpr */) { + else if (expr._typ == 323 /* v.ast.PrefixExpr */) { + if (((*expr._v__ast__PrefixExpr).right)._typ == 293 /* v.ast.CastExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } else { v__gen__c__Gen_gen_expr_to_string(g, expr, typ); } } - else if (expr._typ == 331 /* v.ast.TypeNode */) { + else if (expr._typ == 332 /* v.ast.TypeNode */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); - v__gen__c__Gen_write(g, v__gen__c__ctoslit( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})))); + v__gen__c__Gen_write(g, v__gen__c__ctoslit( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})))); } else { bool should_clone = true; - if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type) && (expr)._typ == 329 /* v.ast.StringLiteral */) { + if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type) && (expr)._typ == 330 /* v.ast.StringLiteral */) { should_clone = false; } - if ((expr)._typ == 290 /* v.ast.CTempVar */) { - if (((*expr._v__ast__CTempVar).orig)._typ == 291 /* v.ast.CallExpr */) { + if ((expr)._typ == 291 /* v.ast.CTempVar */) { + if (((*expr._v__ast__CTempVar).orig)._typ == 292 /* v.ast.CallExpr */) { should_clone = false; - if ((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate) { + if ((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option) { should_clone = true; } if ((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).is_method && (*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).args.len == 0 && string__eq((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).name, _SLIT("type_name"))) { @@ -64043,23 +64126,23 @@ string sref_name; g->assign_op = node.op; v__token__Kind op = (is_decl ? (v__token__Kind__assign) : (node.op)); v__ast__Expr right_expr = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.right, 0)); - if (right_expr._typ == 291 /* v.ast.CallExpr */) { + if (right_expr._typ == 292 /* v.ast.CallExpr */) { return_type = (*right_expr._v__ast__CallExpr).return_type; } - else if (right_expr._typ == 313 /* v.ast.LockExpr */) { + else if (right_expr._typ == 314 /* v.ast.LockExpr */) { return_type = (*right_expr._v__ast__LockExpr).typ; } - else if (right_expr._typ == 315 /* v.ast.MatchExpr */) { + else if (right_expr._typ == 316 /* v.ast.MatchExpr */) { return_type = (*right_expr._v__ast__MatchExpr).return_type; } - else if (right_expr._typ == 306 /* v.ast.IfExpr */) { + else if (right_expr._typ == 307 /* v.ast.IfExpr */) { return_type = (*right_expr._v__ast__IfExpr).typ; } else { } ; - af = g->is_autofree && !g->is_builtin_mod && node.op == v__token__Kind__assign && node.left_types.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 305 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 325 /* v.ast.SelectorExpr */); + af = g->is_autofree && !g->is_builtin_mod && node.op == v__token__Kind__assign && node.left_types.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 306 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 326 /* v.ast.SelectorExpr */); sref_name = _SLIT(""); type_to_free = _SLIT(""); if (af) { @@ -64069,16 +64152,16 @@ string sref_name; type_to_free = (v__ast__Type_alias_eq(first_left_type, _const_v__ast__string_type) ? (_SLIT("string")) : (_SLIT("array"))); bool ok = true; v__ast__Expr left0 = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left0)._typ == 305 /* v.ast.Ident */) { + if ((left0)._typ == 306 /* v.ast.Ident */) { if (string__eq((*left0._v__ast__Ident).name, _SLIT("_"))) { ok = false; } } if (ok) { - sref_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_sref"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_to_free}}, {_SLIT(" "), 0xfe10, {.d_s = sref_name}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); + sref_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_sref"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sref_name}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, left0); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("); // free "), 0xfe10, {.d_s = type_to_free}}, {_SLIT(" on re-assignment2"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("); // free "), /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT(" on re-assignment2"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_assign_stmt_defer_0 = true; } else { af = false; @@ -64095,7 +64178,7 @@ string sref_name; // Defer begin if (v__gen__c__Gen_gen_assign_stmt_defer_0) { if (af) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), 0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), /*115 &string*/0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } // Defer end @@ -64124,11 +64207,11 @@ string sref_name; bool blank_assign = false; v__ast__Ident ident = ((v__ast__Ident){.language = 0,.tok_kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comptime = 0,.scope = 0,.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.kind = 0,.info = {0},.is_mut = 0,}); v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, var_type)); - if ((left)->_typ == 305 /* v.ast.Ident */) { + if ((left)->_typ == 306 /* v.ast.Ident */) { ident = (*left->_v__ast__Ident); blank_assign = (*left->_v__ast__Ident).kind == v__ast__IdentKind__blank_ident; v__ast__IdentInfo left_info = (*left->_v__ast__Ident).info; - if ((left_info)._typ == 415 /* v.ast.IdentVar */) { + if ((left_info)._typ == 416 /* v.ast.IdentVar */) { v__ast__ShareType share = (*left_info._v__ast__IdentVar).share; if (share == v__ast__ShareType__shared_t) { var_type = v__ast__Type_set_flag(var_type, v__ast__TypeFlag__shared_f); @@ -64137,11 +64220,11 @@ string sref_name; var_type = v__ast__Type_set_flag(var_type, v__ast__TypeFlag__atomic_f); } } - if (((*left->_v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { - if ((val)._typ == 297 /* v.ast.ComptimeSelector */) { - if (((*val._v__ast__ComptimeSelector).field_expr)._typ == 325 /* v.ast.SelectorExpr */) { - if (((*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 305 /* v.ast.Ident */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); + if (((*left->_v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((val)._typ == 298 /* v.ast.ComptimeSelector */) { + if (((*val._v__ast__ComptimeSelector).field_expr)._typ == 326 /* v.ast.SelectorExpr */) { + if (((*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 306 /* v.ast.Ident */) { + string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); v__ast__Type* _t2 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); Option_v__ast__Type _t1 = {0}; if (_t2) { @@ -64159,8 +64242,8 @@ string sref_name; (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = var_type; } } - } else if ((val)._typ == 296 /* v.ast.ComptimeCall */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*val._v__ast__ComptimeCall).method_name}}, {_SLIT(".return_type"), 0, { .d_c = 0 }}})); + } else if ((val)._typ == 297 /* v.ast.ComptimeCall */) { + string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*val._v__ast__ComptimeCall).method_name}}, {_SLIT(".return_type"), 0, { .d_c = 0 }}})); v__ast__Type* _t4 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); Option_v__ast__Type _t3 = {0}; if (_t4) { @@ -64183,21 +64266,21 @@ string sref_name; string styp = v__gen__c__Gen_typ(g, var_type); bool is_fixed_array_init = false; bool has_val = false; - if (val._typ == 285 /* v.ast.ArrayInit */) { + if (val._typ == 286 /* v.ast.ArrayInit */) { is_fixed_array_init = (*val._v__ast__ArrayInit).is_fixed; has_val = (*val._v__ast__ArrayInit).has_val; } - else if (val._typ == 291 /* v.ast.CallExpr */) { + else if (val._typ == 292 /* v.ast.CallExpr */) { is_call = true; return_type = (*val._v__ast__CallExpr).return_type; } - else if (val._typ == 283 /* v.ast.AnonFn */) { + else if (val._typ == 284 /* v.ast.AnonFn */) { if (blank_assign) { v__gen__c__Gen_write(g, _SLIT("{")); } - if ((is_decl || blank_assign) && (left)->_typ == 305 /* v.ast.Ident */) { + if ((is_decl || blank_assign) && (left)->_typ == 306 /* v.ast.Ident */) { string ret_styp = v__gen__c__Gen_typ(g, (*val._v__ast__AnonFn).decl.return_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*"), 0xfe10, {.d_s = ident.name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = ident.name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); int def_pos = g->definitions.len; v__gen__c__Gen_fn_decl_params(g, (*val._v__ast__AnonFn).decl.params, ((voidptr)(0)), false); strings__Builder_go_back(&g->definitions, g->definitions.len - def_pos); @@ -64208,7 +64291,7 @@ string sref_name; v__gen__c__Gen_expr(g, *left); g->is_assign_lhs = false; g->is_arraymap_set = false; - if ((left)->_typ == 308 /* v.ast.IndexExpr */) { + if ((left)->_typ == 309 /* v.ast.IndexExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*left->_v__ast__IndexExpr).left_type); if (sym->kind == v__ast__Kind__map || sym->kind == v__ast__Kind__array) { v__gen__c__Gen_expr(g, val); @@ -64232,14 +64315,14 @@ string sref_name; v__ast__Type unwrapped_val_type = v__gen__c__Gen_unwrap_generic(g, val_type); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(g->table, unwrapped_val_type); v__ast__TypeSymbol* unaliased_right_sym = v__ast__Table_final_sym(g->table, unwrapped_val_type); - bool is_fixed_array_var = unaliased_right_sym->kind == v__ast__Kind__array_fixed && (val)._typ != 285 /* v.ast.ArrayInit */ && (((val)._typ == 305 /* v.ast.Ident */ || (val)._typ == 308 /* v.ast.IndexExpr */ || (val)._typ == 291 /* v.ast.CallExpr */ || (val)._typ == 325 /* v.ast.SelectorExpr */) || ((val)._typ == 292 /* v.ast.CastExpr */ && ((/* as */ *(v__ast__CastExpr*)__as_cast((val)._v__ast__CastExpr,(val)._typ, 292) /*expected idx: 292, name: v.ast.CastExpr */ ).expr)._typ != 285 /* v.ast.ArrayInit */)) && !g->pref->translated; + bool is_fixed_array_var = unaliased_right_sym->kind == v__ast__Kind__array_fixed && (val)._typ != 286 /* v.ast.ArrayInit */ && (((val)._typ == 306 /* v.ast.Ident */ || (val)._typ == 309 /* v.ast.IndexExpr */ || (val)._typ == 292 /* v.ast.CallExpr */ || (val)._typ == 326 /* v.ast.SelectorExpr */) || ((val)._typ == 293 /* v.ast.CastExpr */ && ((/* as */ *(v__ast__CastExpr*)__as_cast((val)._v__ast__CastExpr,(val)._typ, 293) /*expected idx: 293, name: v.ast.CastExpr */ ).expr)._typ != 286 /* v.ast.ArrayInit */)) && !g->pref->translated; g->is_assign_lhs = true; g->assign_op = node.op; if (v__ast__Type_has_flag(val_type, v__ast__TypeFlag__optional)) { g->right_is_opt = true; } if (blank_assign) { - if ((val)._typ == 308 /* v.ast.IndexExpr */) { + if ((val)._typ == 309 /* v.ast.IndexExpr */) { g->assign_op = v__token__Kind__decl_assign; } g->is_assign_lhs = false; @@ -64251,28 +64334,28 @@ string sref_name; } else if (g->inside_for_c_stmt) { v__gen__c__Gen_expr(g, val); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("{"), 0xfe10, {.d_s = styp}}, {_SLIT(" _ = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("{"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _ = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, val); v__gen__c__Gen_writeln(g, _SLIT(";}")); } - } else if (node.op == v__token__Kind__assign && !g->pref->translated && (is_fixed_array_init || (right_sym->kind == v__ast__Kind__array_fixed && (val)._typ == 305 /* v.ast.Ident */))) { + } else if (node.op == v__token__Kind__assign && !g->pref->translated && (is_fixed_array_init || (right_sym->kind == v__ast__Kind__array_fixed && (val)._typ == 306 /* v.ast.Ident */))) { string v_var = _SLIT(""); string arr_typ = string_trim(styp, _SLIT("*")); if (is_fixed_array_init) { - v__ast__ArrayInit right = /* as */ *(v__ast__ArrayInit*)__as_cast((val)._v__ast__ArrayInit,(val)._typ, 285) /*expected idx: 285, name: v.ast.ArrayInit */ ; + v__ast__ArrayInit right = /* as */ *(v__ast__ArrayInit*)__as_cast((val)._v__ast__ArrayInit,(val)._typ, 286) /*expected idx: 286, name: v.ast.ArrayInit */ ; v_var = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arr_typ}}, {_SLIT(" "), 0xfe10, {.d_s = v_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arr_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, v__ast__ArrayInit_to_sumtype_v__ast__Expr(&right)); v__gen__c__Gen_writeln(g, _SLIT(";")); } else { - v__ast__Ident right = /* as */ *(v__ast__Ident*)__as_cast((val)._v__ast__Ident,(val)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ; + v__ast__Ident right = /* as */ *(v__ast__Ident*)__as_cast((val)._v__ast__Ident,(val)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ; v_var = right.name; } int pos = g->out.len; v__gen__c__Gen_expr(g, *left); if (g->is_arraymap_set && g->arraymap_set_pos > 0) { strings__Builder_go_back_to(&g->out, g->arraymap_set_pos); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &"), 0xfe10, {.d_s = v_var}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &"), /*115 &string*/0xfe10, {.d_s = v_var}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); g->is_arraymap_set = false; g->arraymap_set_pos = 0; } else { @@ -64280,10 +64363,10 @@ string sref_name; bool is_var_mut = !is_decl && v__ast__Expr_is_auto_deref_var(/*rec*/*left); string addr_left = (is_var_mut ? (_SLIT("")) : (_SLIT("&"))); v__gen__c__Gen_writeln(g, _SLIT("")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("memcpy("), 0xfe10, {.d_s = addr_left}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("memcpy("), /*115 &string*/0xfe10, {.d_s = addr_left}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, *left); string addr_val = (is_fixed_array_var ? (_SLIT("")) : (_SLIT("&"))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe10, {.d_s = addr_val}}, {_SLIT0, 0xfe10, {.d_s = v_var}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = arr_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(", "), /*115 &string*/0xfe10, {.d_s = addr_val}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = v_var}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = arr_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } g->is_assign_lhs = false; } else { @@ -64302,7 +64385,7 @@ string sref_name; v__ast__Type op_expected_left = ((v__ast__Type)(0)); v__ast__Type op_expected_right = ((v__ast__Type)(0)); if (var_type == _const_v__ast__string_type_idx && node.op == v__token__Kind__plus_assign) { - if ((left)->_typ == 308 /* v.ast.IndexExpr */) { + if ((left)->_typ == 309 /* v.ast.IndexExpr */) { v__gen__c__Gen_expr(g, *left); v__gen__c__Gen_write(g, _SLIT("string__plus(")); } else { @@ -64334,11 +64417,11 @@ string sref_name; _t6 = _SLIT("unknown op"); }string extracted_op = _t6; v__gen__c__Gen_expr(g, *left); - if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).generic_types.len > 0) { - Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).concrete_types; + if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).generic_types.len > 0) { + Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).concrete_types; string method_name = string__plus(string__plus(left_sym->cname, _SLIT("_")), v__util__replace_op(extracted_op)); method_name = v__gen__c__Gen_generic_fn_name(g, concrete_types, method_name, true); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = method_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, *left); v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_expr(g, val); @@ -64346,17 +64429,17 @@ string sref_name; // Defer begin if (v__gen__c__Gen_gen_assign_stmt_defer_0) { if (af) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), 0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), /*115 &string*/0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } // Defer end return; } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = v__util__replace_op(extracted_op)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = v__util__replace_op(extracted_op)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); Option_v__ast__Fn _t7 = v__ast__Table_find_method(g->table, left_sym, extracted_op); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; - v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("assignment operator `"), 0xfe10, {.d_s = extracted_op}}, {_SLIT("=` used but no `"), 0xfe10, {.d_s = extracted_op}}, {_SLIT("` method defined"), 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("assignment operator `"), /*115 &string*/0xfe10, {.d_s = extracted_op}}, {_SLIT("=` used but no `"), /*115 &string*/0xfe10, {.d_s = extracted_op}}, {_SLIT("` method defined"), 0, { .d_c = 0 }}})), node.pos); VUNREACHABLE(); *(v__ast__Fn*) _t7.data = ((v__ast__Fn){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}); } @@ -64371,7 +64454,7 @@ string sref_name; if (is_inside_ternary && is_decl) { strings__Builder_write_string(&g->out, v__util__tabs(g->indent - g->inside_ternary)); } - v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((right_sym->info)._v__ast__FnType,(right_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((right_sym->info)._v__ast__FnType,(right_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; string ret_styp = v__gen__c__Gen_typ(g, func.func.return_type); string call_conv = _SLIT(""); string msvc_call_conv = _SLIT(""); @@ -64380,20 +64463,20 @@ string sref_name; if (string__eq(attr.name, _SLIT("callconv"))) { if (g->is_cc_msvc) { - msvc_call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = attr.arg}}, {_SLIT(" "), 0, { .d_c = 0 }}})); + msvc_call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT(" "), 0, { .d_c = 0 }}})); } else { - call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}})); + call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}})); } } else { }; } - string call_conv_attribute_suffix = (call_conv.len != 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), 0xfe10, {.d_s = call_conv}}, {_SLIT("))"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_styp}}, {_SLIT(" ("), 0xfe10, {.d_s = msvc_call_conv}}, {_SLIT("*"), 0xfe10, {.d_s = v__gen__c__Gen_get_ternary_name(g, ident.name)}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); + string call_conv_attribute_suffix = (call_conv.len != 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), /*115 &string*/0xfe10, {.d_s = call_conv}}, {_SLIT("))"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" ("), /*115 &string*/0xfe10, {.d_s = msvc_call_conv}}, {_SLIT("*"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_get_ternary_name(g, ident.name)}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); int def_pos = g->definitions.len; v__gen__c__Gen_fn_decl_params(g, func.func.params, ((voidptr)(0)), false); strings__Builder_go_back(&g->definitions, g->definitions.len - def_pos); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), 0xfe10, {.d_s = call_conv_attribute_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), /*115 &string*/0xfe10, {.d_s = call_conv_attribute_suffix}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { if (is_decl) { if (is_inside_ternary) { @@ -64402,30 +64485,30 @@ string sref_name; bool is_used_var_styp = false; if (!Array_string_contains(g->defer_vars, ident.name)) { v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, val_type); - if ((val_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((val_sym->info)._typ == 456 /* v.ast.Struct */) { if ((*val_sym->info._v__ast__Struct).generic_types.len > 0) { - if ((val)._typ == 330 /* v.ast.StructInit */) { + if ((val)._typ == 331 /* v.ast.StructInit */) { string var_styp = v__gen__c__Gen_typ(g, (*val._v__ast__StructInit).typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); is_used_var_styp = true; - } else if ((val)._typ == 322 /* v.ast.PrefixExpr */) { - if ((*val._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*val._v__ast__PrefixExpr).right)._typ == 330 /* v.ast.StructInit */) { + } else if ((val)._typ == 323 /* v.ast.PrefixExpr */) { + if ((*val._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*val._v__ast__PrefixExpr).right)._typ == 331 /* v.ast.StructInit */) { string var_styp = v__gen__c__Gen_typ(g, v__ast__Type_ref((*(*val._v__ast__PrefixExpr).right._v__ast__StructInit).typ)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); is_used_var_styp = true; } } } } if (!is_used_var_styp) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } if (is_auto_heap) { v__gen__c__Gen_write(g, _SLIT("*")); } } } - if ((left)->_typ == 305 /* v.ast.Ident */ || (left)->_typ == 325 /* v.ast.SelectorExpr */) { + if ((left)->_typ == 306 /* v.ast.Ident */ || (left)->_typ == 326 /* v.ast.SelectorExpr */) { g->prevent_sum_type_unwrapping_once = true; } if (!is_fixed_array_var || is_decl) { @@ -64440,7 +64523,7 @@ string sref_name; } } if (is_inside_ternary && is_decl) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(";\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(";\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->out, v__util__tabs(g->indent)); v__gen__c__Gen_expr(g, *left); } @@ -64450,7 +64533,7 @@ string sref_name; v__gen__c__Gen_writeln(g, _SLIT(";")); } } else if (!g->is_arraymap_set && !str_add && !op_overloaded) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } else if (str_add || op_overloaded) { v__gen__c__Gen_write(g, _SLIT(", ")); } @@ -64468,21 +64551,21 @@ string sref_name; if (is_fixed_array_var) { string typ_str = string_trim(v__gen__c__Gen_typ(g, val_type), _SLIT("*")); string ref_str = (v__ast__Type_is_ptr(val_type) ? (_SLIT("")) : (_SLIT("&"))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("memcpy(("), 0xfe10, {.d_s = typ_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("memcpy(("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, *left); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", (byte*)"), 0xfe10, {.d_s = ref_str}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", (byte*)"), /*115 &string*/0xfe10, {.d_s = ref_str}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, val); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), 0xfe10, {.d_s = typ_str}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_decl) { if (is_fixed_array_init && !has_val) { - if ((val)._typ == 285 /* v.ast.ArrayInit */) { + if ((val)._typ == 286 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*val._v__ast__ArrayInit)); } else { v__gen__c__Gen_write(g, _SLIT("{0}")); } } else { if (is_auto_heap) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), 0xfe10, {.d_s = styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); } if (v__ast__Expr_is_auto_deref_var(val)) { v__gen__c__Gen_write(g, _SLIT("*")); @@ -64522,7 +64605,7 @@ string sref_name; // Defer begin if (v__gen__c__Gen_gen_assign_stmt_defer_0) { if (af) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), 0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_to_free}}, {_SLIT("_free(&"), /*115 &string*/0xfe10, {.d_s = sref_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } // Defer end @@ -64530,27 +64613,27 @@ if (v__gen__c__Gen_gen_assign_stmt_defer_0) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_multi_return_assign(v__gen__c__Gen* g, v__ast__AssignStmt* node, v__ast__Type return_type) { bool is_opt = v__ast__Type_has_flag(return_type, v__ast__TypeFlag__optional); - string mr_var_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("mr_"), 0xfe07, {.d_i32 = node->pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string mr_var_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("mr_"), /*100 &int*/0xfe07, {.d_i32 = node->pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); string mr_styp = v__gen__c__Gen_typ(g, v__ast__Type_clear_flag(return_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mr_styp}}, {_SLIT(" "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node->right, 0))); v__gen__c__Gen_writeln(g, _SLIT(";")); for (int i = 0; i < node->left.len; ++i) { v__ast__Expr lx = ((v__ast__Expr*)node->left.data)[i]; bool is_auto_heap = false; v__ast__Ident ident = ((v__ast__Ident){.language = 0,.tok_kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comptime = 0,.scope = 0,.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.kind = 0,.info = {0},.is_mut = 0,}); - if ((lx)._typ == 305 /* v.ast.Ident */) { + if ((lx)._typ == 306 /* v.ast.Ident */) { ident = (*lx._v__ast__Ident); if ((*lx._v__ast__Ident).kind == v__ast__IdentKind__blank_ident) { continue; } - if (((*lx._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if (((*lx._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { is_auto_heap = (*(*lx._v__ast__Ident).obj._v__ast__Var).is_auto_heap; } } string styp = (Array_string_contains(g->defer_vars, ident.name) ? (_SLIT("")) : (v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i))))); if (node->op == v__token__Kind__decl_assign) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); if (is_auto_heap) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -64564,30 +64647,30 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_multi_return_assign(v__gen__c__Gen* g, v if (is_opt) { string mr_base_styp = v__gen__c__Gen_base_type(g, return_type); if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("HEAP"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = mr_base_styp}}, {_SLIT(", "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(") });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("HEAP"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = mr_base_styp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(") });"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); } } else { if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("HEAP"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(") });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("HEAP"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(") });"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); } } } else { if (is_opt) { string mr_base_styp = v__gen__c__Gen_base_type(g, return_type); if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" = HEAP"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = mr_base_styp}}, {_SLIT(", "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" = HEAP"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = mr_base_styp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else { if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" = HEAP"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" = HEAP"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = mr_var_name}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } @@ -64603,30 +64686,30 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assign_vars_autofree(v__gen__c__Gen* g, VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__ast__AssignStmt* node) { for (int i = 0; i < node->left.len; ++i) { v__ast__Expr left = ((v__ast__Expr*)node->left.data)[i]; - if (left._typ == 305 /* v.ast.Ident */) { + if (left._typ == 306 /* v.ast.Ident */) { v__ast__Type left_typ = (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i)); v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, left_typ); if (left_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), 0xfe07, {.d_i32 = (*left._v__ast__Ident).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__c_name((*left._v__ast__Ident).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__Ident).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*left._v__ast__Ident).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { string styp = v__gen__c__Gen_typ(g, left_typ); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), 0xfe07, {.d_i32 = (*left._v__ast__Ident).pos.pos}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__c_name((*left._v__ast__Ident).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__Ident).pos.pos}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*left._v__ast__Ident).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (left._typ == 308 /* v.ast.IndexExpr */) { + else if (left._typ == 309 /* v.ast.IndexExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*left._v__ast__IndexExpr).left_type); if (sym->kind == v__ast__Kind__array) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__TypeSymbol* elem_typ = v__ast__Table_sym(g->table, info.elem_type); if (elem_typ->kind == v__ast__Kind__function) { v__ast__Type left_typ = (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i)); v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, left_typ); - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), 0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(" = *(voidptr*)array_get(")); } else { string styp = v__gen__c__Gen_typ(g, info.elem_type); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), 0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT(" = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)array_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)array_get("), 0, { .d_c = 0 }}}))); } if (v__ast__Type_is_ptr((*left._v__ast__IndexExpr).left_type)) { v__gen__c__Gen_write(g, _SLIT("*")); @@ -64643,7 +64726,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a v__gen__c__Gen_expr(g, (*left._v__ast__IndexExpr).index); v__gen__c__Gen_writeln(g, _SLIT(");")); } else if (sym->kind == v__ast__Kind__map) { - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; string skeytyp = v__gen__c__Gen_typ(g, info.key_type); string styp = v__gen__c__Gen_typ(g, info.value_type); string zero = v__gen__c__Gen_type_default(g, info.value_type); @@ -64651,10 +64734,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a if (val_typ->kind == v__ast__Kind__function) { v__ast__Type left_type = (*(v__ast__Type*)/*ee elem_sym */array_get(node->left_types, i)); v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, left_type); - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), 0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((left_sym->info)._v__ast__FnType,(left_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ), str_intp(2, _MOV((StrIntpData[]){{_SLIT("_var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(" = *(voidptr*)map_get(")); } else { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), 0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT(" = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)map_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__IndexExpr).pos.pos}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)map_get("), 0, { .d_c = 0 }}}))); } if (!v__ast__Type_is_ptr((*left._v__ast__IndexExpr).left_type)) { v__gen__c__Gen_write(g, _SLIT("ADDR(map, ")); @@ -64663,19 +64746,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a } else { v__gen__c__Gen_expr(g, (*left._v__ast__IndexExpr).left); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = skeytyp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = skeytyp}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*left._v__ast__IndexExpr).index); v__gen__c__Gen_write(g, _SLIT("}")); if (val_typ->kind == v__ast__Kind__function) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &(voidptr[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &(voidptr[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = styp}}, {_SLIT("[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" });"), 0, { .d_c = 0 }}}))); } } } - else if (left._typ == 325 /* v.ast.SelectorExpr */) { + else if (left._typ == 326 /* v.ast.SelectorExpr */) { string styp = v__gen__c__Gen_typ(g, (*left._v__ast__SelectorExpr).typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), 0xfe07, {.d_i32 = (*left._v__ast__SelectorExpr).pos.pos}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _var_"), /*100 &int*/0xfe07, {.d_i32 = (*left._v__ast__SelectorExpr).pos.pos}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*left._v__ast__SelectorExpr).expr); string sel = _SLIT("."); if (v__ast__Type_is_ptr((*left._v__ast__SelectorExpr).expr_type)) { @@ -64685,7 +64768,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a sel = _SLIT("->"); } } - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sel}}, {_SLIT0, 0xfe10, {.d_s = (*left._v__ast__SelectorExpr).field_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sel}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = (*left._v__ast__SelectorExpr).field_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { @@ -64696,11 +64779,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_tmp_variable(v__gen__c__Gen* g, Array_v__ast__Expr left, v__ast__Expr val) { v__ast__Expr val_ = val; - if (val._typ == 305 /* v.ast.Ident */) { + if (val._typ == 306 /* v.ast.Ident */) { bool has_var = false; for (int _t1 = 0; _t1 < left.len; ++_t1) { v__ast__Expr lx = ((v__ast__Expr*)left.data)[_t1]; - if ((lx)._typ == 305 /* v.ast.Ident */) { + if ((lx)._typ == 306 /* v.ast.Ident */) { if (string__eq((*val._v__ast__Ident).name, (*lx._v__ast__Ident).name)) { v__gen__c__Gen_write(g, _SLIT("_var_")); v__gen__c__Gen_write(g, int_str((*lx._v__ast__Ident).pos.pos)); @@ -64713,7 +64796,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_tmp_variable(v__gen__c__Gen* g, Ar v__gen__c__Gen_expr(g, val_); } } - else if (val._typ == 308 /* v.ast.IndexExpr */) { + else if (val._typ == 309 /* v.ast.IndexExpr */) { bool has_var = false; for (int _t2 = 0; _t2 < left.len; ++_t2) { v__ast__Expr lx = ((v__ast__Expr*)left.data)[_t2]; @@ -64728,7 +64811,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_tmp_variable(v__gen__c__Gen* g, Ar v__gen__c__Gen_expr(g, val_); } } - else if (val._typ == 309 /* v.ast.InfixExpr */) { + else if (val._typ == 310 /* v.ast.InfixExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*val._v__ast__InfixExpr).left_type); Option_v__ast__Fn _t3; if (_t3 = v__ast__Table_find_method(g->table, sym, v__token__Kind_str((*val._v__ast__InfixExpr).op)), _t3.state == 0) { @@ -64748,15 +64831,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_tmp_variable(v__gen__c__Gen* g, Ar v__gen__c__Gen_gen_cross_tmp_variable(g, left, (*val._v__ast__InfixExpr).right); } } - else if (val._typ == 322 /* v.ast.PrefixExpr */) { + else if (val._typ == 323 /* v.ast.PrefixExpr */) { v__gen__c__Gen_write(g, v__token__Kind_str((*val._v__ast__PrefixExpr).op)); v__gen__c__Gen_gen_cross_tmp_variable(g, left, (*val._v__ast__PrefixExpr).right); } - else if (val._typ == 321 /* v.ast.PostfixExpr */) { + else if (val._typ == 322 /* v.ast.PostfixExpr */) { v__gen__c__Gen_gen_cross_tmp_variable(g, left, (*val._v__ast__PostfixExpr).expr); v__gen__c__Gen_write(g, v__token__Kind_str((*val._v__ast__PostfixExpr).op)); } - else if (val._typ == 325 /* v.ast.SelectorExpr */) { + else if (val._typ == 326 /* v.ast.SelectorExpr */) { bool has_var = false; for (int _t4 = 0; _t4 < left.len; ++_t4) { v__ast__Expr lx = ((v__ast__Expr*)left.data)[_t4]; @@ -64818,7 +64901,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_equality_fns(v__gen__c__Gen* g) { v__gen__c__Gen_gen_interface_equality_fn(g, needed_typ); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not generate equality function for type "), 0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not generate equality function for type "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(sym->kind)}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); }; } @@ -64833,39 +64916,39 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_sumtype_equality_fn(v__gen__c__Gen* g, } array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__ast__SumType info = v__ast__TypeSymbol_sumtype_info(left.sym); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_sumtype_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_sumtype_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_sumtype_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_sumtype_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tif (a._typ != b._typ) { return false; }")); for (int _t3 = 0; _t3 < info.variants.len; ++_t3) { v__ast__Type typ = ((v__ast__Type*)info.variants.data)[_t3]; v__gen__c__Type variant = v__gen__c__Gen_unwrap(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (a._typ == "), 0xfe07, {.d_i32 = v__ast__Type_idx(variant.typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = variant.sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (a._typ == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(variant.typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = variant.sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (variant.sym->kind == v__ast__Kind__string) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn string__eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn string__eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__alias && !v__ast__Type_is_ptr(typ)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*a."), 0xfe10, {.d_s = name}}, {_SLIT(", *b."), 0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(", *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant.sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn *((voidptr*)(*a."), 0xfe10, {.d_s = name}}, {_SLIT(")) == *((voidptr*)(*b."), 0xfe10, {.d_s = name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn *((voidptr*)(*a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(")) == *((voidptr*)(*b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn *a."), 0xfe10, {.d_s = name}}, {_SLIT(" == *b."), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn *a."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" == *b."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&fn_builder, _SLIT("\t}")); } @@ -64888,12 +64971,12 @@ strings__Builder fn_builder; } array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__ast__Struct info = v__ast__TypeSymbol_struct_info(left.sym); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("_struct_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_struct_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(512); v__gen__c__Gen_gen_struct_equality_fn_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("_struct_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_struct_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); if (v__ast__TypeSymbol_has_method(left.sym, _SLIT("=="))) { - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = fn_name}}, {_SLIT("__eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("__eq(a, b);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("}")); string _t3 = fn_name; // Defer begin @@ -64913,32 +64996,32 @@ strings__Builder fn_builder; v__gen__c__Type field_type = v__gen__c__Gen_unwrap(g, field.typ); string field_name = v__gen__c__c_name(field.name); if (field_type.sym->kind == v__ast__Kind__string) { - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string__eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string__eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__alias && !v__ast__Type_is_ptr(field.typ)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__function) { - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("*((voidptr*)(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(")) == *((voidptr*)(b."), 0xfe10, {.d_s = field_name}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("*((voidptr*)(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")) == *((voidptr*)(b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (field_type.sym->kind == v__ast__Kind__interface_) { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, field.typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a."), 0xfe10, {.d_s = field_name}}, {_SLIT(", b."), 0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(", b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("a."), 0xfe10, {.d_s = field_name}}, {_SLIT(" == b."), 0xfe10, {.d_s = field_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("a."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" == b."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } else { @@ -64963,31 +65046,31 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_alias_equality_fn(v__gen__c__Gen* g, v return _t1; } array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); - v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((left.sym->info)._v__ast__Alias,(left.sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ; - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_alias_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((left.sym->info)._v__ast__Alias,(left.sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ; + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_alias_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_alias_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_alias_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, info.parent_type); if (sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&fn_builder, _SLIT("\treturn string__eq(a, b);")); } else if (sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__interface_ && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(left.typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, info.parent_type); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a, b);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a, b);"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__function) { strings__Builder_writeln(&fn_builder, _SLIT("\treturn *((voidptr*)(a)) == *((voidptr*)(b));")); } else { @@ -65009,40 +65092,40 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_array_equality_fn(v__gen__c__Gen* g, v array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__gen__c__Type elem = v__gen__c__Gen_unwrap(g, v__ast__TypeSymbol_array_info(left.sym).elem_type); string ptr_elem_styp = v__gen__c__Gen_typ(g, elem.typ); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tif (a.len != b.len) {")); strings__Builder_writeln(&fn_builder, _SLIT("\t\treturn false;")); strings__Builder_writeln(&fn_builder, _SLIT("\t}")); strings__Builder_writeln(&fn_builder, _SLIT("\tfor (int i = 0; i < a.len; ++i) {")); if (elem.sym->kind == v__ast__Kind__string) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (!string__eq(*(("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)a.data+(i*a.element_size))), *(("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)b.data+(i*b.element_size))))) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (!string__eq(*(("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)a.data+(i*a.element_size))), *(("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)b.data+(i*b.element_size))))) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__interface_ && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__alias && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq((("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq((("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)a.data)[i], (("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)b.data)[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__function) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (*((voidptr*)((byte*)a.data+(i*a.element_size))) != *((voidptr*)((byte*)b.data+(i*b.element_size)))) {")); } else { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (*(("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)a.data+(i*a.element_size))) != *(("), 0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)b.data+(i*b.element_size)))) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (*(("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)a.data+(i*a.element_size))) != *(("), /*115 &string*/0xfe10, {.d_s = ptr_elem_styp}}, {_SLIT("*)((byte*)b.data+(i*b.element_size)))) {"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&fn_builder, _SLIT("\t\t\treturn false;")); strings__Builder_writeln(&fn_builder, _SLIT("\t\t}")); @@ -65065,33 +65148,33 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_fixed_array_equality_fn(v__gen__c__Gen v__ast__ArrayFixed elem_info = v__ast__TypeSymbol_array_fixed_info(left.sym); v__gen__c__Type elem = v__gen__c__Gen_unwrap(g, elem_info.elem_type); int size = elem_info.size; - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfor (int i = 0; i < "), 0xfe07, {.d_i32 = size}}, {_SLIT("; ++i) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfor (int i = 0; i < "), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("; ++i) {"), 0, { .d_c = 0 }}}))); if (elem.sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (!string__eq(a[i], b[i])) {")); } else if (elem.sym->kind == v__ast__Kind__sum_type && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__interface_ && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__array && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__array_fixed && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__map && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__alias && !v__ast__Type_is_ptr(elem.typ)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, elem.typ); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(a[i], b[i])) {"), 0, { .d_c = 0 }}}))); } else if (elem.sym->kind == v__ast__Kind__function) { strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (a[i] != b[i]) {")); } else { @@ -65117,9 +65200,9 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_map_equality_fn(v__gen__c__Gen* g, v__ array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__gen__c__Type value = v__gen__c__Gen_unwrap(g, v__ast__TypeSymbol_map_info(left.sym).value_type); string ptr_value_styp = v__gen__c__Gen_typ(g, value.typ); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_map_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_map_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_map_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_map_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tif (a.len != b.len) {")); strings__Builder_writeln(&fn_builder, _SLIT("\t\treturn false;")); strings__Builder_writeln(&fn_builder, _SLIT("\t}")); @@ -65129,21 +65212,21 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_map_equality_fn(v__gen__c__Gen* g, v__ strings__Builder_writeln(&fn_builder, _SLIT("\t\tif (!map_exists(&b, k)) return false;")); v__ast__Kind kind = v__ast__Table_type_kind(g->table, value.typ); if (kind == v__ast__Kind__function) { - v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((value.sym->info)._v__ast__FnType,(value.sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((value.sym->info)._v__ast__FnType,(value.sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; string ret_styp = v__gen__c__Gen_typ(g, func.func.return_type); - strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*v) ("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*v) ("), 0, { .d_c = 0 }}}))); int arg_len = func.func.params.len; for (int j = 0; j < func.func.params.len; ++j) { v__ast__Param arg = ((v__ast__Param*)func.func.params.data)[j]; string arg_styp = v__gen__c__Gen_typ(g, arg.typ); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_styp}}, {_SLIT(" "), 0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (j < arg_len - 1) { strings__Builder_write_string(&fn_builder, _SLIT(", ")); } } strings__Builder_writeln(&fn_builder, _SLIT(") = *(voidptr*)map_get(&a, k, &(voidptr[]){ 0 });")); } else { - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT(" v = *("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&a, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 });"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT(" v = *("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&a, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 });"), 0, { .d_c = 0 }}}))); } switch (kind) { case v__ast__Kind__string: @@ -65154,43 +65237,43 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_map_equality_fn(v__gen__c__Gen* g, v__ case v__ast__Kind__sum_type: { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__struct_: { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__interface_: { string eq_fn = v__gen__c__Gen_gen_interface_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_interface_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__array: { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__array_fixed: { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__map: { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__alias: { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, value.typ); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tif (!"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }), v)) {"), 0, { .d_c = 0 }}}))); break; } case v__ast__Kind__function: @@ -65230,7 +65313,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_map_equality_fn(v__gen__c__Gen* g, v__ case v__ast__Kind__thread: default: { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (*("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), 0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }) != v) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif (*("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("*)map_get(&b, k, &("), /*115 &string*/0xfe10, {.d_s = ptr_value_styp}}, {_SLIT("[]){ 0 }) != v) {"), 0, { .d_c = 0 }}}))); break; } } @@ -65257,46 +65340,46 @@ strings__Builder fn_builder; } array_push((array*)&g->generated_eq_fns, _MOV((v__ast__Type[]){ left_type })); v__ast__TypeInfo info = left.sym->info; - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("_interface_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("_interface_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(512); v__gen__c__Gen_gen_interface_equality_fn_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_interface_idx_"), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("(int sidx); // for auto eq method"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), 0xfe10, {.d_s = fn_name}}, {_SLIT("_interface_eq("), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), 0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_interface_idx_"), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("(int sidx); // for auto eq method"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static bool "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_interface_eq("), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" a, "), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT(" b) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tif (a._typ == b._typ) {")); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tint idx = v_typeof_interface_idx_"), 0xfe10, {.d_s = ptr_styp}}, {_SLIT("(a._typ);"), 0, { .d_c = 0 }}}))); - if ((info)._typ == 473 /* v.ast.Interface */) { + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tint idx = v_typeof_interface_idx_"), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("(a._typ);"), 0, { .d_c = 0 }}}))); + if ((info)._typ == 474 /* v.ast.Interface */) { for (int _t3 = 0; _t3 < (*info._v__ast__Interface).types.len; ++_t3) { v__ast__Type typ = ((v__ast__Type*)(*info._v__ast__Interface).types.data)[_t3]; - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (idx == "), 0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (idx == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&fn_builder, _SLIT("\t\t\treturn ")); v__ast__Kind _t4 = v__ast__Table_type_kind(g->table, typ); if (_t4 == (v__ast__Kind__struct_)) { string eq_fn = v__gen__c__Gen_gen_struct_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_struct_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__string)) { strings__Builder_write_string(&fn_builder, _SLIT("string__eq(*(a._string), *(b._string))")); } else if (_t4 == (v__ast__Kind__sum_type)) { string eq_fn = v__gen__c__Gen_gen_sumtype_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_sumtype_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__array)) { string eq_fn = v__gen__c__Gen_gen_array_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__array_fixed)) { string eq_fn = v__gen__c__Gen_gen_fixed_array_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_arr_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__map)) { string eq_fn = v__gen__c__Gen_gen_map_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_map_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (_t4 == (v__ast__Kind__alias)) { string eq_fn = v__gen__c__Gen_gen_alias_equality_fn(g, typ); - strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*(a._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), 0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("_alias_eq(*(a._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("), *(b._"), /*115 &string*/0xfe10, {.d_s = eq_fn}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else { strings__Builder_write_string(&fn_builder, _SLIT("false")); @@ -65320,7 +65403,7 @@ strings__Builder fn_builder; VV_LOCAL_SYMBOL string v__gen__c__Gen_get_free_method(v__gen__c__Gen* g, v__ast__Type typ) { map_set(&g->autofree_methods, &(int[]){typ}, &(bool[]) { true }); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); - if ((sym->info)._typ == 470 /* v.ast.Alias */) { + if ((sym->info)._typ == 471 /* v.ast.Alias */) { if ((*sym->info._v__ast__Alias).is_import) { sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__Alias).parent_type); } @@ -65361,7 +65444,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_free_method(v__gen__c__Gen* g, v__ast_ } map_set(&g->generated_free_methods, &(int[]){deref_typ}, &(bool[]) { true }); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); - if ((sym->info)._typ == 470 /* v.ast.Alias */) { + if ((sym->info)._typ == 471 /* v.ast.Alias */) { if ((*sym->info._v__ast__Alias).is_import) { sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__Alias).parent_type); } @@ -65370,19 +65453,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_free_method(v__gen__c__Gen* g, v__ast_ string _t2 = fn_name; return _t2; } - if (sym->info._typ == 455 /* v.ast.Struct */) { + if (sym->info._typ == 456 /* v.ast.Struct */) { v__gen__c__Gen_gen_free_for_struct(g, (*sym->info._v__ast__Struct), styp, fn_name); } - else if (sym->info._typ == 450 /* v.ast.Array */) { + else if (sym->info._typ == 451 /* v.ast.Array */) { v__gen__c__Gen_gen_free_for_array(g, (*sym->info._v__ast__Array), styp, fn_name); } - else if (sym->info._typ == 451 /* v.ast.Map */) { + else if (sym->info._typ == 452 /* v.ast.Map */) { v__gen__c__Gen_gen_free_for_map(g, (*sym->info._v__ast__Map), styp, fn_name); } else { println(v__ast__Table_type_str(g->table, typ)); - v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not generate free method '"), 0xfe10, {.d_s = fn_name}}, {_SLIT("' for type '"), 0xfe10, {.d_s = styp}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not generate free method '"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("' for type '"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } ; @@ -65393,10 +65476,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_free_method(v__gen__c__Gen* g, v__ast_ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_free_for_struct(v__gen__c__Gen* g, v__ast__Struct info, string styp, string fn_name) { bool v__gen__c__Gen_gen_free_for_struct_defer_0 = false; strings__Builder fn_builder; - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(128); v__gen__c__Gen_gen_free_for_struct_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < info.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t1]; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, field.typ)); @@ -65408,11 +65491,11 @@ strings__Builder fn_builder; if (is_shared) { field_styp = string_all_after(field_styp, _SLIT("__shared__")); } - string field_styp_fn_name = (v__ast__TypeSymbol_has_method(sym, _SLIT("free")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = field_styp}}, {_SLIT("_free"), 0, { .d_c = 0 }}}))) : (v__gen__c__Gen_gen_free_method(g, field.typ))); + string field_styp_fn_name = (v__ast__TypeSymbol_has_method(sym, _SLIT("free")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("_free"), 0, { .d_c = 0 }}}))) : (v__gen__c__Gen_gen_free_method(g, field.typ))); if (is_shared) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = field_styp_fn_name}}, {_SLIT("(&(it->"), 0xfe10, {.d_s = field.name}}, {_SLIT("->val));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = field_styp_fn_name}}, {_SLIT("(&(it->"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("->val));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = field_styp_fn_name}}, {_SLIT("(&(it->"), 0xfe10, {.d_s = field.name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = field_styp_fn_name}}, {_SLIT("(&(it->"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&fn_builder, _SLIT("}")); @@ -65426,16 +65509,16 @@ if (v__gen__c__Gen_gen_free_for_struct_defer_0) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_free_for_array(v__gen__c__Gen* g, v__ast__Array info, string styp, string fn_name) { bool v__gen__c__Gen_gen_free_for_array_defer_0 = false; strings__Builder fn_builder; - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(128); v__gen__c__Gen_gen_free_for_array_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, info.elem_type)); if (sym->kind == v__ast__Kind__string || sym->kind == v__ast__Kind__array || sym->kind == v__ast__Kind__map || sym->kind == v__ast__Kind__struct_) { strings__Builder_writeln(&fn_builder, _SLIT("\tfor (int i = 0; i < it->len; i++) {")); string elem_styp = string_replace(v__gen__c__Gen_typ(g, info.elem_type), _SLIT("*"), _SLIT("")); - string elem_styp_fn_name = (v__ast__TypeSymbol_has_method(sym, _SLIT("free")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_styp}}, {_SLIT("_free"), 0, { .d_c = 0 }}}))) : (v__gen__c__Gen_gen_free_method(g, info.elem_type))); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = elem_styp_fn_name}}, {_SLIT("(&((("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("*)it->data)[i]));"), 0, { .d_c = 0 }}}))); + string elem_styp_fn_name = (v__ast__TypeSymbol_has_method(sym, _SLIT("free")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("_free"), 0, { .d_c = 0 }}}))) : (v__gen__c__Gen_gen_free_method(g, info.elem_type))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = elem_styp_fn_name}}, {_SLIT("(&((("), /*115 &string*/0xfe10, {.d_s = elem_styp}}, {_SLIT("*)it->data)[i]));"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\t}")); } strings__Builder_writeln(&fn_builder, _SLIT("\tarray_free(it);")); @@ -65450,10 +65533,10 @@ if (v__gen__c__Gen_gen_free_for_array_defer_0) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_free_for_map(v__gen__c__Gen* g, v__ast__Map info, string styp, string fn_name) { bool v__gen__c__Gen_gen_free_for_map_defer_0 = false; strings__Builder fn_builder; - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(128); v__gen__c__Gen_gen_free_for_map_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("void "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* it) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tmap_free(it);")); strings__Builder_writeln(&fn_builder, _SLIT("}")); // Defer begin @@ -65732,15 +65815,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_default(v__gen__c__Gen* g, v__ast__T convertor = _SLIT("bool"); typename_ = _SLIT("bool"); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not generate string method for type `"), 0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not generate string method for type `"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) {"), 0, { .d_c = 0 }}}))); if (string__eq(convertor, _SLIT("bool"))) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tmp1 = string__plus(_SLIT(\""), 0xfe10, {.d_s = styp}}, {_SLIT("(\"), ("), 0xfe10, {.d_s = convertor}}, {_SLIT(")it ? _SLIT(\"true\") : _SLIT(\"false\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tmp1 = string__plus(_SLIT(\""), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("(\"), ("), /*115 &string*/0xfe10, {.d_s = convertor}}, {_SLIT(")it ? _SLIT(\"true\") : _SLIT(\"false\"));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring tmp1 = string__plus(_SLIT(\""), 0xfe10, {.d_s = styp}}, {_SLIT("(\"), tos3("), 0xfe10, {.d_s = typename_}}, {_SLIT("_str(("), 0xfe10, {.d_s = convertor}}, {_SLIT(")it).str));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring tmp1 = string__plus(_SLIT(\""), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("(\"), tos3("), /*115 &string*/0xfe10, {.d_s = typename_}}, {_SLIT("_str(("), /*115 &string*/0xfe10, {.d_s = convertor}}, {_SLIT(")it).str));"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring tmp2 = string__plus(tmp1, _SLIT(\")\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring_free(&tmp1);")); @@ -65763,13 +65846,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_str_fn(v__gen__c__Gen* g, v__ast__Type string styp = v__gen__c__Gen_typ(g, unwrapped); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, unwrapped); string str_fn_name = v__gen__c__styp_to_str_fn_name(styp); - if ((sym->info)._typ == 470 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { + if ((sym->info)._typ == 471 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { if ((*sym->info._v__ast__Alias).is_import) { sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__Alias).parent_type); str_fn_name = v__gen__c__styp_to_str_fn_name(sym->name); } } - if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && (sym->info)._typ == 455 /* v.ast.Struct */) { + if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && (sym->info)._typ == 456 /* v.ast.Struct */) { str_fn_name = v__gen__c__Gen_generic_fn_name(g, (*sym->info._v__ast__Struct).concrete_types, str_fn_name, false); } array_push((array*)&g->str_types, _MOV((v__gen__c__StrType[]){ ((v__gen__c__StrType){.styp = styp,.typ = unwrapped,}) })); @@ -65783,7 +65866,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_final_gen_str(v__gen__c__Gen* g, v__gen__c__ } array_push((array*)&g->generated_str_fns, _MOV((v__gen__c__StrType[]){ typ })); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ.typ); - if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && !v__ast__Type_has_flag(typ.typ, v__ast__TypeFlag__optional)) { + if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && !(v__ast__Type_has_flag(typ.typ, v__ast__TypeFlag__optional) || v__ast__Type_has_flag(typ.typ, v__ast__TypeFlag__result))) { return; } string styp = typ.styp; @@ -65792,49 +65875,53 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_final_gen_str(v__gen__c__Gen* g, v__gen__c__ v__gen__c__Gen_gen_str_for_option(g, typ.typ, styp, str_fn_name); return; } - if (sym->info._typ == 470 /* v.ast.Alias */) { + if (v__ast__Type_has_flag(typ.typ, v__ast__TypeFlag__result)) { + v__gen__c__Gen_gen_str_for_result(g, typ.typ, styp, str_fn_name); + return; + } + if (sym->info._typ == 471 /* v.ast.Alias */) { if ((*sym->info._v__ast__Alias).is_import) { v__gen__c__Gen_gen_str_default(g, *sym, styp, str_fn_name); } else { v__gen__c__Gen_gen_str_for_alias(g, (*sym->info._v__ast__Alias), styp, str_fn_name); } } - else if (sym->info._typ == 450 /* v.ast.Array */) { + else if (sym->info._typ == 451 /* v.ast.Array */) { v__gen__c__Gen_gen_str_for_array(g, (*sym->info._v__ast__Array), styp, str_fn_name); } - else if (sym->info._typ == 478 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 479 /* v.ast.ArrayFixed */) { v__gen__c__Gen_gen_str_for_array_fixed(g, (*sym->info._v__ast__ArrayFixed), styp, str_fn_name); } - else if (sym->info._typ == 484 /* v.ast.Enum */) { + else if (sym->info._typ == 485 /* v.ast.Enum */) { v__gen__c__Gen_gen_str_for_enum(g, (*sym->info._v__ast__Enum), styp, str_fn_name); } - else if (sym->info._typ == 482 /* v.ast.FnType */) { + else if (sym->info._typ == 483 /* v.ast.FnType */) { v__gen__c__Gen_gen_str_for_fn_type(g, (*sym->info._v__ast__FnType), styp, str_fn_name); } - else if (sym->info._typ == 455 /* v.ast.Struct */) { + else if (sym->info._typ == 456 /* v.ast.Struct */) { v__gen__c__Gen_gen_str_for_struct(g, (*sym->info._v__ast__Struct), styp, str_fn_name); } - else if (sym->info._typ == 451 /* v.ast.Map */) { + else if (sym->info._typ == 452 /* v.ast.Map */) { v__gen__c__Gen_gen_str_for_map(g, (*sym->info._v__ast__Map), styp, str_fn_name); } - else if (sym->info._typ == 481 /* v.ast.MultiReturn */) { + else if (sym->info._typ == 482 /* v.ast.MultiReturn */) { v__gen__c__Gen_gen_str_for_multi_return(g, (*sym->info._v__ast__MultiReturn), styp, str_fn_name); } - else if (sym->info._typ == 474 /* v.ast.SumType */) { + else if (sym->info._typ == 475 /* v.ast.SumType */) { v__gen__c__Gen_gen_str_for_union_sum_type(g, (*sym->info._v__ast__SumType), styp, str_fn_name); } - else if (sym->info._typ == 473 /* v.ast.Interface */) { + else if (sym->info._typ == 474 /* v.ast.Interface */) { v__gen__c__Gen_gen_str_for_interface(g, (*sym->info._v__ast__Interface), styp, str_fn_name); } - else if (sym->info._typ == 479 /* v.ast.Chan */) { + else if (sym->info._typ == 480 /* v.ast.Chan */) { v__gen__c__Gen_gen_str_for_chan(g, (*sym->info._v__ast__Chan), styp, str_fn_name); } - else if (sym->info._typ == 480 /* v.ast.Thread */) { + else if (sym->info._typ == 481 /* v.ast.Thread */) { v__gen__c__Gen_gen_str_for_thread(g, (*sym->info._v__ast__Thread), styp, str_fn_name); } else { - v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not generate string method `"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("` for type `"), 0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not generate string method `"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("` for type `"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } ; @@ -65843,41 +65930,69 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_final_gen_str(v__gen__c__Gen* g, v__gen__c__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_option(v__gen__c__Gen* g, v__ast__Type typ, string styp, string str_fn_name) { v__ast__Type parent_type = v__ast__Type_clear_flag(typ, v__ast__TypeFlag__optional); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, parent_type); - multi_return_bool_bool_int mr_6220 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_6220.arg0; + multi_return_bool_bool_int mr_6348 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_6348.arg0; string parent_str_fn_name = v__gen__c__Gen_get_str_fn(g, parent_type); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring res;")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tif (it.state == 0) {")); if (sym->kind == v__ast__Kind__string) { - string tmp_res = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data)"), 0, { .d_c = 0 }}})); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), 0xfe10, {.d_s = str_intp_sq(tmp_res)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + string tmp_res = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data)"), 0, { .d_c = 0 }}})); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = str_intp_sq(tmp_res)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = indent_"), 0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data, indent_count);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = indent_"), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data, indent_count);"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), 0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data);"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t} else {")); string tmp_str = str_intp_sub(_SLIT("error: %%"), _SLIT("IError_str(it.err)")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t}")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = str_intp_sub(_SLIT("Option(%%)"), _SLIT("res"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = str_intp_sub(_SLIT("Option(%%)"), _SLIT("res"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("}")); +} + +VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_result(v__gen__c__Gen* g, v__ast__Type typ, string styp, string str_fn_name) { + v__ast__Type parent_type = v__ast__Type_clear_flag(typ, v__ast__TypeFlag__result); + v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, parent_type); + multi_return_bool_bool_int mr_7867 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_7867.arg0; + string parent_str_fn_name = v__gen__c__Gen_get_str_fn(g, parent_type); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring res;")); + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tif (!it.is_error) {")); + if (sym->kind == v__ast__Kind__string) { + string tmp_res = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data)"), 0, { .d_c = 0 }}})); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = str_intp_sq(tmp_res)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } else if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = indent_"), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data, indent_count);"), 0, { .d_c = 0 }}}))); + } else { + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("*)it.data);"), 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t} else {")); + string tmp_str = str_intp_sub(_SLIT("error: %%"), _SLIT("IError_str(it.err)")); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tres = "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t}")); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = str_intp_sub(_SLIT("result(%%)"), _SLIT("res"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("}")); } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_alias(v__gen__c__Gen* g, v__ast__Alias info, string styp, string str_fn_name) { string parent_str_fn_name = v__gen__c__Gen_get_str_fn(g, info.parent_type); string clean_type_v_type_name = v__util__strip_main_name(string_replace(styp, _SLIT("__"), _SLIT("."))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring indents = string_repeat(_SLIT(\" \"), indent_count);")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring tmp_ds = "), 0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(it);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring res = str_intp(3, _MOV((StrIntpData[]){\n {_SLIT0, "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = indents }},\n {_SLIT(\""), 0xfe10, {.d_s = clean_type_v_type_name}}, {_SLIT("(\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = tmp_ds }},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring tmp_ds = "), /*115 &string*/0xfe10, {.d_s = parent_str_fn_name}}, {_SLIT("(it);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring res = str_intp(3, _MOV((StrIntpData[]){\n {_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = indents }},\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_type_v_type_name}}, {_SLIT("(\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = tmp_ds }},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }));"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring_free(&indents);")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstring_free(&tmp_ds);")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\treturn res;")); @@ -65885,40 +66000,40 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_alias(v__gen__c__Gen* g, v__ast_ } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_multi_return(v__gen__c__Gen* g, v__ast__MultiReturn info, string styp, string str_fn_name) { - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder sb = strings__new_builder("), 0xfe07, {.d_i32 = info.types.len}}, {_SLIT(" * 10);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder sb = strings__new_builder("), /*100 &int*/0xfe07, {.d_i32 = info.types.len}}, {_SLIT(" * 10);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\"(\"));")); for (int i = 0; i < info.types.len; ++i) { v__ast__Type typ = ((v__ast__Type*)info.types.data)[i]; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); bool is_arg_ptr = v__ast__Type_is_ptr(typ); - multi_return_bool_bool_int mr_9413 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_9413.arg0; - bool str_method_expects_ptr = mr_9413.arg1; + multi_return_bool_bool_int mr_11059 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_11059.arg0; + bool str_method_expects_ptr = mr_11059.arg1; string arg_str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("(a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("(a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__f32 || sym->kind == v__ast__Kind__f64) { if (sym->kind == v__ast__Kind__f32) { - string tmp_val = str_intp_g32( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_val}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_val = str_intp_g32( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_val}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - string tmp_val = str_intp_g64( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_val}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_val = str_intp_g64( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_val}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__string) { - string tmp_str = str_intp_sq( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_sq( str_intp(2, _MOV((StrIntpData[]){{_SLIT("a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("());"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("());"), 0, { .d_c = 0 }}}))); } else { - multi_return_string_string mr_10238 = v__gen__c__deref_kind(str_method_expects_ptr, is_arg_ptr, typ); - string deref = mr_10238.arg0; - string deref_label = mr_10238.arg1; - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), 0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a.arg"), 0xfe07, {.d_i32 = i}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + multi_return_string_string mr_11884 = v__gen__c__deref_kind(str_method_expects_ptr, is_arg_ptr, typ); + string deref = mr_11884.arg0; + string deref_label = mr_11884.arg1; + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = arg_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a.arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } if (i != info.types.len - 1) { strings__Builder_writeln(&fn_builder, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\", \"));")); @@ -65934,15 +66049,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_multi_return(v__gen__c__Gen* g, VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_enum(v__gen__c__Gen* g, v__ast__Enum info, string styp, string str_fn_name) { string s = v__util__no_dots(styp); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) { /* gen_str_for_enum */"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { /* gen_str_for_enum */"), 0, { .d_c = 0 }}}))); if (info.is_flag) { string clean_name = v__util__strip_main_name(string_replace(styp, _SLIT("__"), _SLIT("."))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring ret = _SLIT(\""), 0xfe10, {.d_s = clean_name}}, {_SLIT("{\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring ret = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_name}}, {_SLIT("{\");"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tint first = 1;")); for (int i = 0; i < info.vals.len; ++i) { string val = ((string*)info.vals.data)[i]; - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (it & (1 << "), 0xfe07, {.d_i32 = i}}, {_SLIT(")) {if (!first) {ret = string__plus(ret, _SLIT(\" | \"));} ret = string__plus(ret, _SLIT(\"."), 0xfe10, {.d_s = val}}, {_SLIT("\")); first = 0;}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (it & (1 << "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(")) {if (!first) {ret = string__plus(ret, _SLIT(\" | \"));} ret = string__plus(ret, _SLIT(\"."), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\")); first = 0;}"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tret = string__plus(ret, _SLIT(\"}\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\treturn ret;")); @@ -65956,7 +66071,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_enum(v__gen__c__Gen* g, v__ast__ } else if (info.is_multi_allowed) { array_push((array*)&seen, _MOV((string[]){ string_clone(val) })); } - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe10, {.d_s = s}}, {_SLIT("__"), 0xfe10, {.d_s = val}}, {_SLIT(": return _SLIT(\""), 0xfe10, {.d_s = val}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("__"), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(": return _SLIT(\""), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tdefault: return _SLIT(\"unknown enum value\");")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t}")); @@ -65965,9 +66080,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_enum(v__gen__c__Gen* g, v__ast__ } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_interface(v__gen__c__Gen* g, v__ast__Interface info, string styp, string str_fn_name) { - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(x, 0); }"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(x, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); string clean_interface_v_type_name = string_replace(styp, _SLIT("__"), _SLIT(".")); if (string_ends_with(styp, _SLIT("*"))) { @@ -65977,36 +66092,36 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_interface(v__gen__c__Gen* g, v__ clean_interface_v_type_name = string__plus(string_replace(string_replace(string_replace(clean_interface_v_type_name, _SLIT("Array_"), _SLIT("[]")), _SLIT("_T_"), _SLIT("<")), _SLIT("_"), _SLIT(", ")), _SLIT(">")); } clean_interface_v_type_name = v__util__strip_main_name(clean_interface_v_type_name); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count) { /* gen_str_for_interface */"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count) { /* gen_str_for_interface */"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < info.types.len; ++_t1) { v__ast__Type typ = ((v__ast__Type*)info.types.data)[_t1]; v__ast__TypeSymbol* sub_sym = v__ast__Table_sym(g->table, v__ast__mktyp(typ)); string func_name = v__gen__c__Gen_get_str_fn(g, typ); - multi_return_bool_bool_int mr_13672 = v__ast__TypeSymbol_str_method_info(sub_sym); - bool sym_has_str_method = mr_13672.arg0; - bool str_method_expects_ptr = mr_13672.arg1; + multi_return_bool_bool_int mr_15318 = v__ast__TypeSymbol_str_method_info(sub_sym); + bool sym_has_str_method = mr_15318.arg0; + bool str_method_expects_ptr = mr_15318.arg1; if (v__gen__c__should_use_indent_func(sub_sym->kind) && !sym_has_str_method) { - func_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("indent_"), 0xfe10, {.d_s = func_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + func_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("indent_"), /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT0, 0, { .d_c = 0 }}})); } string deref = (sym_has_str_method && str_method_expects_ptr ? (_SLIT(" ")) : (_SLIT("*"))); if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type)) { - string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = func_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("("), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("*)x._"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("*)x._"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__should_use_indent_func(sub_sym->kind) && !sym_has_str_method) { val = /*f*/string__plus(val, _SLIT(", indent_count")); } val = /*f*/string__plus(val, _SLIT(")")); - string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), 0xfe10, {.d_s = clean_interface_v_type_name}}, {_SLIT("(\'\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\"\')\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" return "), 0xfe10, {.d_s = res}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_interface_v_type_name}}, {_SLIT("(\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\"\')\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" return "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = func_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("("), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("*)x._"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("*)x._"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__should_use_indent_func(sub_sym->kind) && !sym_has_str_method) { val = /*f*/string__plus(val, _SLIT(", indent_count")); } val = /*f*/string__plus(val, _SLIT(")")); - string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), 0xfe10, {.d_s = clean_interface_v_type_name}}, {_SLIT("(\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" return "), 0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_interface_v_type_name}}, {_SLIT("(\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" return "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&fn_builder, _SLIT("\treturn _SLIT(\"unknown interface value\");")); @@ -66015,11 +66130,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_interface(v__gen__c__Gen* g, v__ } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_union_sum_type(v__gen__c__Gen* g, v__ast__SumType info, string styp, string str_fn_name) { - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(x, 0); }"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(x, 0); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count); // auto"), 0, { .d_c = 0 }}}))); strings__Builder fn_builder = strings__new_builder(512); - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x, int indent_count) {"), 0, { .d_c = 0 }}}))); string clean_sum_type_v_type_name = _SLIT(""); if (info.is_anon) { Array_string _t1 = {0}; @@ -66033,7 +66148,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_union_sum_type(v__gen__c__Gen* g array_push((array*)&_t1, &ti); } Array_string variant_names =_t1; - clean_sum_type_v_type_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = Array_string_join(variant_names, _SLIT(" | "))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + clean_sum_type_v_type_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = Array_string_join(variant_names, _SLIT(" | "))}}, {_SLIT(")"), 0, { .d_c = 0 }}})); } else { clean_sum_type_v_type_name = string_replace(styp, _SLIT("__"), _SLIT(".")); if (string_ends_with(styp, _SLIT("*"))) { @@ -66050,29 +66165,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_union_sum_type(v__gen__c__Gen* g string typ_str = v__gen__c__Gen_typ(g, typ); string func_name = v__gen__c__Gen_get_str_fn(g, typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); - multi_return_bool_bool_int mr_16589 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_16589.arg0; - bool str_method_expects_ptr = mr_16589.arg1; + multi_return_bool_bool_int mr_18235 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_18235.arg0; + bool str_method_expects_ptr = mr_18235.arg1; string deref = (sym_has_str_method && str_method_expects_ptr ? (_SLIT(" ")) : (_SLIT("*"))); if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { - func_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("indent_"), 0xfe10, {.d_s = func_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + func_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("indent_"), /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT0, 0, { .d_c = 0 }}})); } if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type)) { - string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = func_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("("), 0xfe10, {.d_s = typ_str}}, {_SLIT("*)x._"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("*)x._"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { val = /*f*/string__plus(val, _SLIT(", indent_count")); } val = /*f*/string__plus(val, _SLIT(")")); - string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), 0xfe10, {.d_s = clean_sum_type_v_type_name}}, {_SLIT("(\'\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\"\')\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(": return "), 0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_sum_type_v_type_name}}, {_SLIT("(\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\"\')\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(": return "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); } else { - string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = func_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("("), 0xfe10, {.d_s = typ_str}}, {_SLIT("*)x._"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string val = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = func_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("*)x._"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { val = /*f*/string__plus(val, _SLIT(", indent_count")); } val = /*f*/string__plus(val, _SLIT(")")); - string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), 0xfe10, {.d_s = clean_sum_type_v_type_name}}, {_SLIT("(\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(": return "), 0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + string res = str_intp(4, _MOV((StrIntpData[]){{_SLIT("str_intp(2, _MOV((StrIntpData[]){\n {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_sum_type_v_type_name}}, {_SLIT("(\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("}},\n {_SLIT(\")\"), 0, {.d_c = 0 }}\n }))"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(": return "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&fn_builder, _SLIT("\t\tdefault: return _SLIT(\"unknown sum type value\");")); @@ -66096,12 +66211,14 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_fn_decl_str(v__gen__c__Gen* g, v__ast__FnT fn_str = /*f*/string__plus(fn_str, _SLIT(")")); if (v__ast__Type_alias_eq(info.func.return_type, _const_v__ast__ovoid_type)) { fn_str = /*f*/string__plus(fn_str, _SLIT(" ?")); + } else if (v__ast__Type_alias_eq(info.func.return_type, _const_v__ast__rvoid_type)) { + fn_str = /*f*/string__plus(fn_str, _SLIT(" !")); } else if (!v__ast__Type_alias_eq(info.func.return_type, _const_v__ast__void_type)) { string x = v__util__strip_main_name(v__ast__Table_get_type_name(g->table, v__gen__c__Gen_unwrap_generic(g, info.func.return_type))); if (v__ast__Type_has_flag(info.func.return_type, v__ast__TypeFlag__optional)) { - fn_str = /*f*/string__plus(fn_str, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" ?"), 0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}}))); + fn_str = /*f*/string__plus(fn_str, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" ?"), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - fn_str = /*f*/string__plus(fn_str, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}}))); + fn_str = /*f*/string__plus(fn_str, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } string _t1 = fn_str; @@ -66109,20 +66226,20 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_fn_decl_str(v__gen__c__Gen* g, v__ast__FnT } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_fn_type(v__gen__c__Gen* g, v__ast__FnType info, string styp, string str_fn_name) { - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("() { return _SLIT(\""), 0xfe10, {.d_s = v__gen__c__Gen_fn_decl_str(g, info)}}, {_SLIT("\");}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("() { return _SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_fn_decl_str(g, info)}}, {_SLIT("\");}"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_chan(v__gen__c__Gen* g, v__ast__Chan info, string styp, string str_fn_name) { string elem_type_name = v__util__strip_main_name(v__ast__Table_get_type_name(g->table, v__gen__c__Gen_unwrap_generic(g, info.elem_type))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" x) { return sync__Channel_auto_str(x, _SLIT(\""), 0xfe10, {.d_s = elem_type_name}}, {_SLIT("\")); }"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" x) { return sync__Channel_auto_str(x, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = elem_type_name}}, {_SLIT("\")); }"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_thread(v__gen__c__Gen* g, v__ast__Thread info, string styp, string str_fn_name) { string ret_type_name = v__util__strip_main_name(v__ast__Table_get_type_name(g->table, info.return_type)); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" _); // auto}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" _) { return _SLIT(\"thread("), 0xfe10, {.d_s = ret_type_name}}, {_SLIT(")\");}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _); // auto}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" _) { return _SLIT(\"thread("), /*115 &string*/0xfe10, {.d_s = ret_type_name}}, {_SLIT(")\");}"), 0, { .d_c = 0 }}}))); } // Attr: [inline] @@ -66145,61 +66262,61 @@ VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__deref_kind(bool str_method VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array(v__gen__c__Gen* g, v__ast__Array info, string styp, string str_fn_name) { v__ast__Type typ = info.elem_type; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, info.elem_type); - if ((sym->info)._typ == 470 /* v.ast.Alias */) { + if ((sym->info)._typ == 471 /* v.ast.Alias */) { typ = (*sym->info._v__ast__Alias).parent_type; sym = v__ast__Table_sym(g->table, typ); } string field_styp = v__gen__c__Gen_typ(g, typ); bool is_elem_ptr = v__ast__Type_is_ptr(typ); - multi_return_bool_bool_int mr_20665 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_20665.arg0; - bool str_method_expects_ptr = mr_20665.arg1; + multi_return_bool_bool_int mr_22381 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_22381.arg0; + bool str_method_expects_ptr = mr_22381.arg1; string elem_str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); if (sym->kind == v__ast__Kind__u8) { elem_str_fn_name = string__plus(elem_str_fn_name, _SLIT("_escaped")); } - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(a, 0);}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(a, 0);}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count) {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder sb = strings__new_builder(a.len * 10);")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\"[\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tfor (int i = 0; i < a.len; ++i) {")); if (sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); } else { if (sym->kind == v__ast__Kind__array_fixed) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = field_styp}}, {_SLIT(" it;"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tmemcpy(*("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)it, (byte*)array_get(a, i), sizeof("), 0xfe10, {.d_s = field_styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT(" it;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tmemcpy(*("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)it, (byte*)array_get(a, i), sizeof("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = field_styp}}, {_SLIT(" it = *("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)array_get(a, i);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT(" it = *("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)array_get(a, i);"), 0, { .d_c = 0 }}}))); } if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { if (is_elem_ptr) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = indent_"), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*it, indent_count);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = indent_"), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*it, indent_count);"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = indent_"), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(it, indent_count);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = indent_"), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(it, indent_count);"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__f32 || sym->kind == v__ast__Kind__f64) { if (sym->kind == v__ast__Kind__f32) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = str_intp_g32(_SLIT("it"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = str_intp_g32(_SLIT("it"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = str_intp_g64(_SLIT("it"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = str_intp_g64(_SLIT("it"))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__rune) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"`\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(it) }}, {_SLIT(\"`\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"`\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(it) }}, {_SLIT(\"`\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__string) { if (is_elem_ptr) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"&\'\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = *it }}, {_SLIT(\"\'\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"&\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = *it }}, {_SLIT(\"\'\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"\'\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = it }}, {_SLIT(\"\'\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = str_intp(2, _MOV((StrIntpData[]){{_SLIT(\"\'\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s = it }}, {_SLIT(\"\'\"), 0, {.d_c = 0 }}}));\n"), 0, { .d_c = 0 }}}))); } } else { - multi_return_string_string mr_23189 = v__gen__c__deref_kind(str_method_expects_ptr, is_elem_ptr, typ); - string deref = mr_23189.arg0; - string deref_label = mr_23189.arg1; - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), 0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" it);"), 0, { .d_c = 0 }}}))); + multi_return_string_string mr_24905 = v__gen__c__deref_kind(str_method_expects_ptr, is_elem_ptr, typ); + string deref = mr_24905.arg0; + string deref_label = mr_24905.arg1; + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" it);"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tstrings__Builder_write_string(&sb, x);")); @@ -66220,56 +66337,56 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array(v__gen__c__Gen* g, v__ast_ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array_fixed(v__gen__c__Gen* g, v__ast__ArrayFixed info, string styp, string str_fn_name) { v__ast__Type typ = info.elem_type; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, info.elem_type); - if ((sym->info)._typ == 470 /* v.ast.Alias */) { + if ((sym->info)._typ == 471 /* v.ast.Alias */) { typ = (*sym->info._v__ast__Alias).parent_type; sym = v__ast__Table_sym(g->table, typ); } bool is_elem_ptr = v__ast__Type_is_ptr(typ); - multi_return_bool_bool_int mr_24571 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_24571.arg0; - bool str_method_expects_ptr = mr_24571.arg1; + multi_return_bool_bool_int mr_26287 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_26287.arg0; + bool str_method_expects_ptr = mr_26287.arg1; string elem_str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(a, 0);}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder sb = strings__new_builder("), 0xfe07, {.d_i32 = info.size}}, {_SLIT(" * 10);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(a, 0);}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" a, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstrings__Builder sb = strings__new_builder("), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(" * 10);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\"[\"));")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfor (int i = 0; i < "), 0xfe07, {.d_i32 = info.size}}, {_SLIT("; ++i) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfor (int i = 0; i < "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT("; ++i) {"), 0, { .d_c = 0 }}}))); if (sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstring x = "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tstrings__Builder_write_string(&sb, x);")); } else { - multi_return_string_string mr_25448 = v__gen__c__deref_kind(str_method_expects_ptr, is_elem_ptr, typ); - string deref = mr_25448.arg0; - string deref_label = mr_25448.arg1; + multi_return_string_string mr_27164 = v__gen__c__deref_kind(str_method_expects_ptr, is_elem_ptr, typ); + string deref = mr_27164.arg0; + string deref_label = mr_27164.arg1; if (v__gen__c__should_use_indent_func(sym->kind) && !sym_has_str_method) { if (is_elem_ptr) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), 0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = deref_label}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tif ( 0 == a[i] ) {")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t\tstrings__Builder_write_string(&sb, _SLIT(\"0\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t}else{")); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a[i]) );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a[i]) );"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t}")); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a[i]) );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a[i]) );"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__f32 || sym->kind == v__ast__Kind__f64) { if (sym->kind == v__ast__Kind__f32) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_g32(_SLIT("a[i]"))}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_g32(_SLIT("a[i]"))}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_g64(_SLIT("a[i]"))}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_g64(_SLIT("a[i]"))}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == v__ast__Kind__string) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_sq(_SLIT("a[i]"))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_sq(_SLIT("a[i]"))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__rune) { - string tmp_str = str_intp_rune( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a[i])"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_rune( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a[i])"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), 0xfe10, {.d_s = deref}}, {_SLIT(" a[i]));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("( "), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" a[i]));"), 0, { .d_c = 0 }}}))); } } - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (i < "), 0xfe07, {.d_i32 = info.size - 1}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (i < "), /*100 &int*/0xfe07, {.d_i32 = info.size - 1}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t\tstrings__Builder_write_string(&sb, _SLIT(\", \"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t}")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t}")); @@ -66283,7 +66400,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array_fixed(v__gen__c__Gen* g, v VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_map(v__gen__c__Gen* g, v__ast__Map info, string styp, string str_fn_name) { v__ast__Type key_typ = info.key_type; v__ast__TypeSymbol* key_sym = v__ast__Table_sym(g->table, key_typ); - if ((key_sym->info)._typ == 470 /* v.ast.Alias */) { + if ((key_sym->info)._typ == 471 /* v.ast.Alias */) { key_typ = (*key_sym->info._v__ast__Alias).parent_type; key_sym = v__ast__Table_sym(g->table, key_typ); } @@ -66294,7 +66411,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_map(v__gen__c__Gen* g, v__ast__M } v__ast__Type val_typ = info.value_type; v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, val_typ); - if ((val_sym->info)._typ == 470 /* v.ast.Alias */) { + if ((val_sym->info)._typ == 471 /* v.ast.Alias */) { val_typ = (*val_sym->info._v__ast__Alias).parent_type; val_sym = v__ast__Table_sym(g->table, val_typ); } @@ -66303,10 +66420,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_map(v__gen__c__Gen* g, v__ast__M if (!v__ast__TypeSymbol_has_method(val_sym, _SLIT("str"))) { v__gen__c__Gen_get_str_fn(g, val_typ); } - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" m); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" m) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(m, 0);}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" m, int indent_count); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" m, int indent_count) { /* gen_str_for_map */"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" m); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" m) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(m, 0);}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" m, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" m, int indent_count) { /* gen_str_for_map */"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder sb = strings__new_builder(m.key_values.len*10);")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tstrings__Builder_write_string(&sb, _SLIT(\"{\"));")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\tfor (int i = 0; i < m.key_values.len; ++i) {")); @@ -66314,37 +66431,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_map(v__gen__c__Gen* g, v__ast__M if (key_sym->kind == v__ast__Kind__string) { strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tstring key = *(string*)DenseArray_key(&m.key_values, i);")); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = key_styp}}, {_SLIT(" key = *("), 0xfe10, {.d_s = key_styp}}, {_SLIT("*)DenseArray_key(&m.key_values, i);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = key_styp}}, {_SLIT(" key = *("), /*115 &string*/0xfe10, {.d_s = key_styp}}, {_SLIT("*)DenseArray_key(&m.key_values, i);"), 0, { .d_c = 0 }}}))); } if (key_sym->kind == v__ast__Kind__string) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_sq(_SLIT("key"))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_sq(_SLIT("key"))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (key_sym->kind == v__ast__Kind__rune) { - string tmp_str = str_intp_rune( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = key_str_fn_name}}, {_SLIT("(key)"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_rune( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = key_str_fn_name}}, {_SLIT("(key)"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = key_str_fn_name}}, {_SLIT("(key));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = key_str_fn_name}}, {_SLIT("(key));"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tstrings__Builder_write_string(&sb, _SLIT(\": \"));")); if (val_sym->kind == v__ast__Kind__function) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("());"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("());"), 0, { .d_c = 0 }}}))); } else if (val_sym->kind == v__ast__Kind__string) { - string tmp_str = str_intp_sq( str_intp(2, _MOV((StrIntpData[]){{_SLIT("*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_sq( str_intp(2, _MOV((StrIntpData[]){{_SLIT("*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (v__gen__c__should_use_indent_func(val_sym->kind) && !v__ast__TypeSymbol_has_method(val_sym, _SLIT("str"))) { string ptr_str = string_repeat(_SLIT("*"), v__ast__Type_nr_muls(val_typ)); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, indent_"), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*"), 0xfe10, {.d_s = ptr_str}}, {_SLIT("("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i), indent_count));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, indent_"), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = ptr_str}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i), indent_count));"), 0, { .d_c = 0 }}}))); } else if (val_sym->kind == v__ast__Kind__f32 || val_sym->kind == v__ast__Kind__f64) { - string tmp_val = str_intp(2, _MOV((StrIntpData[]){{_SLIT("*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)"), 0, { .d_c = 0 }}})); + string tmp_val = str_intp(2, _MOV((StrIntpData[]){{_SLIT("*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)"), 0, { .d_c = 0 }}})); if (val_sym->kind == v__ast__Kind__f32) { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_g32(tmp_val)}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_g32(tmp_val)}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = str_intp_g64(tmp_val)}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = str_intp_g64(tmp_val)}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else if (val_sym->kind == v__ast__Kind__rune) { - string tmp_str = str_intp_rune( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i))"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + string tmp_str = str_intp_rune( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i))"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = tmp_str}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), 0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tstrings__Builder_write_string(&sb, "), /*115 &string*/0xfe10, {.d_s = elem_str_fn_name}}, {_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)DenseArray_value(&m.key_values, i)));"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\tif (i != m.key_values.len-1) {")); strings__Builder_writeln(&g->auto_str_funcs, _SLIT("\t\t\tstrings__Builder_write_string(&sb, _SLIT(\", \"));")); @@ -66414,19 +66531,19 @@ strings__Builder fn_builder; bool v__gen__c__Gen_gen_str_for_struct_defer_1 = false; v__util__Surrounder fn_body_surrounder; strings__Builder fn_body; - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0);}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it); // auto"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->auto_str_funcs, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static string "), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it) { return indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("(it, 0);}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count); // auto"), 0, { .d_c = 0 }}}))); fn_builder = strings__new_builder(512); v__gen__c__Gen_gen_str_for_struct_defer_0 = true; - strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static string indent_"), /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" it, int indent_count) {"), 0, { .d_c = 0 }}}))); string clean_struct_v_type_name = string_replace(styp, _SLIT("__"), _SLIT(".")); if (string_contains(clean_struct_v_type_name, _SLIT("_T_"))) { clean_struct_v_type_name = string__plus(string_replace(string_replace(string_replace(clean_struct_v_type_name, _SLIT("Array_"), _SLIT("[]")), _SLIT("_T_"), _SLIT("<")), _SLIT("_"), _SLIT(", ")), _SLIT(">")); } clean_struct_v_type_name = v__util__strip_main_name(clean_struct_v_type_name); if (info.fields.len == 0) { - strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn _SLIT(\""), 0xfe10, {.d_s = clean_struct_v_type_name}}, {_SLIT("{}\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn _SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_struct_v_type_name}}, {_SLIT("{}\");"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_builder, _SLIT("}")); // Defer begin if (v__gen__c__Gen_gen_str_for_struct_defer_0) { @@ -66439,8 +66556,8 @@ strings__Builder fn_body; fn_body_surrounder = v__util__new_surrounder(info.fields.len); fn_body = strings__new_builder(info.fields.len * 256); v__gen__c__Gen_gen_str_for_struct_defer_1 = true; - strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring res = str_intp( "), 0xfe07, {.d_i32 = info.fields.len * 4 + 3}}, {_SLIT(", _MOV((StrIntpData[]){"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\""), 0xfe10, {.d_s = clean_struct_v_type_name}}, {_SLIT("{\\n\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring res = str_intp( "), /*100 &int*/0xfe07, {.d_i32 = info.fields.len * 4 + 3}}, {_SLIT(", _MOV((StrIntpData[]){"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = clean_struct_v_type_name}}, {_SLIT("{\\n\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); for (int i = 0; i < info.fields.len; ++i) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[i]; string ptr_amp = (v__ast__Type_is_ptr(field.typ) ? (_SLIT("&")) : (_SLIT(""))); @@ -66455,19 +66572,19 @@ strings__Builder fn_body; prefix = _SLIT("C"); } if (i == 0) { - strings__Builder_write_string(&fn_body, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT0, "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\" "), 0xfe10, {.d_s = field.name}}, {_SLIT(": "), 0xfe10, {.d_s = ptr_amp}}, {_SLIT0, 0xfe10, {.d_s = prefix}}, {_SLIT("\"), 0, {.d_c=0}}, "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = ptr_amp}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = prefix}}, {_SLIT("\"), 0, {.d_c=0}}, "), 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&fn_body, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\"\\n\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\" "), 0xfe10, {.d_s = field.name}}, {_SLIT(": "), 0xfe10, {.d_s = ptr_amp}}, {_SLIT0, 0xfe10, {.d_s = prefix}}, {_SLIT("\"), 0, {.d_c=0}}, "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\"\\n\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(": "), /*115 &string*/0xfe10, {.d_s = ptr_amp}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = prefix}}, {_SLIT("\"), 0, {.d_c=0}}, "), 0, { .d_c = 0 }}}))); } - multi_return_bool_bool_int mr_35270 = v__ast__TypeSymbol_str_method_info(sym); - bool sym_has_str_method = mr_35270.arg0; - bool str_method_expects_ptr = mr_35270.arg1; + multi_return_bool_bool_int mr_36986 = v__ast__TypeSymbol_str_method_info(sym); + bool sym_has_str_method = mr_36986.arg0; + bool str_method_expects_ptr = mr_36986.arg1; string sftyp = v__gen__c__Gen_typ(g, field.typ); string field_styp = string_replace(sftyp, _SLIT("*"), _SLIT("")); string _t2; /* if prepend */ if (sym_has_str_method) { - string field_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = field_styp}}, {_SLIT("_str"), 0, { .d_c = 0 }}})); - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + string field_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("_str"), 0, { .d_c = 0 }}})); + if ((sym->info)._typ == 456 /* v.ast.Struct */) { field_fn_name = v__gen__c__Gen_generic_fn_name(g, (*sym->info._v__ast__Struct).concrete_types, field_fn_name, false); } _t2 = field_fn_name; @@ -66476,37 +66593,37 @@ strings__Builder fn_body; } string field_styp_fn_name = _t2; if (!(sym->kind == v__ast__Kind__f32 || sym->kind == v__ast__Kind__f64)) { - strings__Builder_write_string(&fn_body, str_intp(4, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), 0xfe10, {.d_s = quote_str}}, {_SLIT("\"), "), 0xfe07, {.d_i32 = ((int)(base_fmt))}}, {_SLIT(", {."), 0xfe10, {.d_s = v__gen__c__data_str(base_fmt)}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(4, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = quote_str}}, {_SLIT("\"), "), /*100 &int*/0xfe07, {.d_i32 = ((int)(base_fmt))}}, {_SLIT(", {."), /*115 &string*/0xfe10, {.d_s = v__gen__c__data_str(base_fmt)}}, {_SLIT("="), 0, { .d_c = 0 }}}))); } else { string g_fmt = string__plus(_SLIT("0x"), u32_hex(((((u32)(base_fmt)) | ((u32)(0x7FU)) << 9U)))); - strings__Builder_write_string(&fn_body, str_intp(4, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), 0xfe10, {.d_s = quote_str}}, {_SLIT("\"), "), 0xfe10, {.d_s = g_fmt}}, {_SLIT(", {."), 0xfe10, {.d_s = v__gen__c__data_str(base_fmt)}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(4, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = quote_str}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = g_fmt}}, {_SLIT(", {."), /*115 &string*/0xfe10, {.d_s = v__gen__c__data_str(base_fmt)}}, {_SLIT("="), 0, { .d_c = 0 }}}))); } string funcprefix = _SLIT(""); - multi_return_string_bool mr_36054 = v__gen__c__struct_auto_str_func(sym, field.typ, field_styp_fn_name, field.name, sym_has_str_method, str_method_expects_ptr); - string func = mr_36054.arg0; - bool caller_should_free = mr_36054.arg1; + multi_return_string_bool mr_37770 = v__gen__c__struct_auto_str_func(sym, field.typ, field_styp_fn_name, field.name, sym_has_str_method, str_method_expects_ptr); + string func = mr_37770.arg0; + bool caller_should_free = mr_37770.arg1; if (Array_v__ast__Type_contains(_const_v__ast__cptr_types, field.typ)) { - func = str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr) it."), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + func = str_intp(2, _MOV((StrIntpData[]){{_SLIT("(voidptr) it."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}})); caller_should_free = false; } else if (v__ast__Type_is_ptr(field.typ)) { - funcprefix = /*f*/string__plus(funcprefix, str_intp(2, _MOV((StrIntpData[]){{_SLIT("isnil(it."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + funcprefix = /*f*/string__plus(funcprefix, str_intp(2, _MOV((StrIntpData[]){{_SLIT("isnil(it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); funcprefix = /*f*/string__plus(funcprefix, _SLIT(" ? _SLIT(\"nil\") : ")); if (!(sym->kind == v__ast__Kind__struct_ || sym->kind == v__ast__Kind__alias) && !v__ast__Type_is_int_valptr(field.typ) && !v__ast__Type_is_float_valptr(field.typ)) { funcprefix = /*f*/string__plus(funcprefix, _SLIT("*")); } } if (string__eq(styp, field_styp)) { - strings__Builder_write_string(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = funcprefix}}, {_SLIT("_SLIT(\"\")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = funcprefix}}, {_SLIT("_SLIT(\"\")"), 0, { .d_c = 0 }}}))); } else { if (Array_v__ast__Type_contains(_const_v__ast__charptr_types, field.typ)) { - strings__Builder_write_string(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("tos2((byteptr)"), 0xfe10, {.d_s = func}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("tos2((byteptr)"), /*115 &string*/0xfe10, {.d_s = func}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { if (v__ast__Type_is_ptr(field.typ) && sym->kind == v__ast__Kind__struct_) { funcprefix = /*f*/string__plus(funcprefix, _SLIT("(indent_count > 25) ? _SLIT(\"\") : ")); } if (caller_should_free) { string tmpvar = v__gen__c__Gen_new_tmp_var(g); - v__util__Surrounder_add(&fn_body_surrounder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0xfe10, {.d_s = funcprefix}}, {_SLIT0, 0xfe10, {.d_s = func}}, {_SLIT(";"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), 0xfe10, {.d_s = tmpvar}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__util__Surrounder_add(&fn_body_surrounder, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tstring "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = funcprefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = func}}, {_SLIT(";"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&fn_body, tmpvar); } else { strings__Builder_write_string(&fn_body, funcprefix); @@ -66514,9 +66631,9 @@ strings__Builder fn_body; } } } - strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}}, {_SLIT(\""), 0xfe10, {.d_s = quote_str}}, {_SLIT("\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}}, {_SLIT(\""), /*115 &string*/0xfe10, {.d_s = quote_str}}, {_SLIT("\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\"\\n\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\"}\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&fn_body, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t{_SLIT(\"\\n\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(", {.d_s=indents}}, {_SLIT(\"}\"), 0, {.d_c=0}},"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&fn_body, _SLIT("\t}));")); // Defer begin if (v__gen__c__Gen_gen_str_for_struct_defer_1) { @@ -66536,42 +66653,42 @@ if (v__gen__c__Gen_gen_str_for_struct_defer_0) { } VV_LOCAL_SYMBOL multi_return_string_bool v__gen__c__struct_auto_str_func(v__ast__TypeSymbol* sym, v__ast__Type field_type, string fn_name, string field_name, bool has_custom_str, bool expects_ptr) { - multi_return_string_string mr_37966 = v__gen__c__deref_kind(expects_ptr, v__ast__Type_is_ptr(field_type), field_type); - string deref = mr_37966.arg0; + multi_return_string_string mr_39682 = v__gen__c__deref_kind(expects_ptr, v__ast__Type_is_ptr(field_type), field_type); + string deref = mr_39682.arg0; if (sym->kind == v__ast__Kind__enum_) { - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (v__gen__c__should_use_indent_func(sym->kind)) { - string obj = str_intp(2, _MOV((StrIntpData[]){{_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string obj = str_intp(2, _MOV((StrIntpData[]){{_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT0, 0, { .d_c = 0 }}})); if (has_custom_str) { - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT0, 0xfe10, {.d_s = obj}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = obj}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; } - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT("indent_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT0, 0xfe10, {.d_s = obj}}, {_SLIT(", indent_count + 1)"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT("indent_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = obj}}, {_SLIT(", indent_count + 1)"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (sym->kind == v__ast__Kind__array || sym->kind == v__ast__Kind__array_fixed || sym->kind == v__ast__Kind__map || sym->kind == v__ast__Kind__sum_type) { if (has_custom_str) { - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; } - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT("indent_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(", indent_count + 1)"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT("indent_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(", indent_count + 1)"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (sym->kind == v__ast__Kind__function) { - return (multi_return_string_bool){.arg0= str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("()"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("()"), 0, { .d_c = 0 }}})), .arg1=true}; } else { if (sym->kind == v__ast__Kind__chan) { - return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT(")"), 0, { .d_c = 0 }}})), .arg1=true}; } - string method_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("it."), 0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string method_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("it."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field_name)}}, {_SLIT0, 0, { .d_c = 0 }}})); bool caller_should_free = false; if (sym->kind == v__ast__Kind__bool) { method_str = /*f*/string__plus(method_str, _SLIT(" ? _SLIT(\"true\") : _SLIT(\"false\")")); } else if ((v__ast__Type_is_int_valptr(field_type) || v__ast__Type_is_float_valptr(field_type)) && v__ast__Type_is_ptr(field_type) && !expects_ptr) { if (sym->kind == v__ast__Kind__f32) { - return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){\n {_SLIT0, "), 0xfe10, {.d_s = _const_si_g32_code}}, {_SLIT(", {.d_f32 = *"), 0xfe10, {.d_s = method_str}}, {_SLIT(" }}\n }))"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){\n {_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_si_g32_code}}, {_SLIT(", {.d_f32 = *"), /*115 &string*/0xfe10, {.d_s = method_str}}, {_SLIT(" }}\n }))"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (sym->kind == v__ast__Kind__f64) { - return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){\n {_SLIT0, "), 0xfe10, {.d_s = _const_si_g64_code}}, {_SLIT(", {.d_f64 = *"), 0xfe10, {.d_s = method_str}}, {_SLIT(" }}\n }))"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){\n {_SLIT0, "), /*115 &string*/0xfe10, {.d_s = _const_si_g64_code}}, {_SLIT(", {.d_f64 = *"), /*115 &string*/0xfe10, {.d_s = method_str}}, {_SLIT(" }}\n }))"), 0, { .d_c = 0 }}})), .arg1=true}; } else if (sym->kind == v__ast__Kind__u64) { v__gen__c__StrIntpType fmt_type = v__gen__c__StrIntpType__si_u64; - return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), 0xfe06, {.d_u32 = (((u32)(fmt_type)) | 0xfe00U)}}, {_SLIT(", {.d_u64 = *"), 0xfe10, {.d_s = method_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), /*117 &u32*/0xfe06, {.d_u32 = (((u32)(fmt_type)) | 0xfe00U)}}, {_SLIT(", {.d_u64 = *"), /*115 &string*/0xfe10, {.d_s = method_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})), .arg1=true}; } v__gen__c__StrIntpType fmt_type = v__gen__c__StrIntpType__si_i32; - return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), 0xfe06, {.d_u32 = (((u32)(fmt_type)) | 0xfe00U)}}, {_SLIT(", {.d_i32 = *"), 0xfe10, {.d_s = method_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})), .arg1=true}; + return (multi_return_string_bool){.arg0= str_intp(3, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT0, "), /*117 &u32*/0xfe06, {.d_u32 = (((u32)(fmt_type)) | 0xfe00U)}}, {_SLIT(", {.d_i32 = *"), /*115 &string*/0xfe10, {.d_s = method_str}}, {_SLIT(" }}}))"), 0, { .d_c = 0 }}})), .arg1=true}; } return (multi_return_string_bool){.arg0=method_str, .arg1=caller_should_free}; } @@ -66632,6 +66749,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre .shared_types = strings__new_builder(100), .shared_functions = strings__new_builder(100), .options = strings__new_builder(100), + .out_results = strings__new_builder(100), .json_forward_decls = strings__new_builder(100), .sql_buf = strings__new_builder(100), .file = 0, @@ -66658,6 +66776,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre .is_cc_msvc = string__eq(pref->ccompiler, _SLIT("msvc")), .vlines_path = (string){.str=(byteptr)"", .is_lit=1}, .optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), + .results = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .done_optionals = (__shared__Array_string*)__dup_shared_array(&(__shared__Array_string){.mtx = {0}, .val =__new_array(0, 0, sizeof(string))}, sizeof(__shared__Array_string)), .chan_pop_optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .chan_push_optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), @@ -66990,7 +67109,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre string v = (*(string*)DenseArray_value(&_t35.key_values, _t36)); map_set(&global_g.optionals, &(string[]){k}, &(string[]) { v }); } - Map_string_string _t39 = g->as_cast_type_names; + Map_string_string _t39 = g->results; int _t41 = _t39.key_values.len; for (int _t40 = 0; _t40 < _t41; ++_t40 ) { int _t42 = _t39.key_values.len - _t41; @@ -67003,9 +67122,9 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre string k = /*key*/ *(string*)DenseArray_key(&_t39.key_values, _t40); k = string_clone(k); string v = (*(string*)DenseArray_value(&_t39.key_values, _t40)); - map_set(&global_g.as_cast_type_names, &(string[]){k}, &(string[]) { v }); + map_set(&global_g.results, &(string[]){k}, &(string[]) { v }); } - Map_int_bool _t43 = g->sumtype_definitions; + Map_string_string _t43 = g->as_cast_type_names; int _t45 = _t43.key_values.len; for (int _t44 = 0; _t44 < _t45; ++_t44 ) { int _t46 = _t43.key_values.len - _t45; @@ -67015,47 +67134,26 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre continue; } if (!DenseArray_has_index(&_t43.key_values, _t44)) {continue;} - int k = /*key*/ *(int*)DenseArray_key(&_t43.key_values, _t44); - bool v = (*(bool*)DenseArray_value(&_t43.key_values, _t44)); + string k = /*key*/ *(string*)DenseArray_key(&_t43.key_values, _t44); + k = string_clone(k); + string v = (*(string*)DenseArray_value(&_t43.key_values, _t44)); + map_set(&global_g.as_cast_type_names, &(string[]){k}, &(string[]) { v }); + } + Map_int_bool _t47 = g->sumtype_definitions; + int _t49 = _t47.key_values.len; + for (int _t48 = 0; _t48 < _t49; ++_t48 ) { + int _t50 = _t47.key_values.len - _t49; + _t49 = _t47.key_values.len; + if (_t50 < 0) { + _t48 = -1; + continue; + } + if (!DenseArray_has_index(&_t47.key_values, _t48)) {continue;} + int k = /*key*/ *(int*)DenseArray_key(&_t47.key_values, _t48); + bool v = (*(bool*)DenseArray_value(&_t47.key_values, _t48)); map_set(&global_g.sumtype_definitions, &(int[]){k}, &(bool[]) { v }); } - Option_int _t47 = strings__Builder_write(&global_g.json_forward_decls, g->json_forward_decls); - if (_t47.state != 0) { /*or block*/ - IError err = _t47.err; - _v_panic(IError_str(err)); - VUNREACHABLE(); - ; - } - - (*(int*)_t47.data); - Option_int _t48 = strings__Builder_write(&global_g.enum_typedefs, g->enum_typedefs); - if (_t48.state != 0) { /*or block*/ - IError err = _t48.err; - _v_panic(IError_str(err)); - VUNREACHABLE(); - ; - } - - (*(int*)_t48.data); - Option_int _t49 = strings__Builder_write(&global_g.channel_definitions, g->channel_definitions); - if (_t49.state != 0) { /*or block*/ - IError err = _t49.err; - _v_panic(IError_str(err)); - VUNREACHABLE(); - ; - } - - (*(int*)_t49.data); - Option_int _t50 = strings__Builder_write(&global_g.sql_buf, g->sql_buf); - if (_t50.state != 0) { /*or block*/ - IError err = _t50.err; - _v_panic(IError_str(err)); - VUNREACHABLE(); - ; - } - - (*(int*)_t50.data); - Option_int _t51 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.cleanups), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->cleanup); + Option_int _t51 = strings__Builder_write(&global_g.json_forward_decls, g->json_forward_decls); if (_t51.state != 0) { /*or block*/ IError err = _t51.err; _v_panic(IError_str(err)); @@ -67064,7 +67162,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t51.data); - Option_int _t52 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.inits), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->init); + Option_int _t52 = strings__Builder_write(&global_g.enum_typedefs, g->enum_typedefs); if (_t52.state != 0) { /*or block*/ IError err = _t52.err; _v_panic(IError_str(err)); @@ -67073,7 +67171,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t52.data); - Option_int _t53 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.global_inits), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->global_init); + Option_int _t53 = strings__Builder_write(&global_g.channel_definitions, g->channel_definitions); if (_t53.state != 0) { /*or block*/ IError err = _t53.err; _v_panic(IError_str(err)); @@ -67082,45 +67180,81 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t53.data); - for (int _t54 = 0; _t54 < g->str_types.len; ++_t54) { - v__gen__c__StrType str_type = ((v__gen__c__StrType*)g->str_types.data)[_t54]; + Option_int _t54 = strings__Builder_write(&global_g.sql_buf, g->sql_buf); + if (_t54.state != 0) { /*or block*/ + IError err = _t54.err; + _v_panic(IError_str(err)); + VUNREACHABLE(); + ; + } + + (*(int*)_t54.data); + Option_int _t55 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.cleanups), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->cleanup); + if (_t55.state != 0) { /*or block*/ + IError err = _t55.err; + _v_panic(IError_str(err)); + VUNREACHABLE(); + ; + } + + (*(int*)_t55.data); + Option_int _t56 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.inits), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->init); + if (_t56.state != 0) { /*or block*/ + IError err = _t56.err; + _v_panic(IError_str(err)); + VUNREACHABLE(); + ; + } + + (*(int*)_t56.data); + Option_int _t57 = strings__Builder_write(&(*(strings__Builder*)map_get(ADDR(map, global_g.global_inits), &(string[]){g->file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), g->global_init); + if (_t57.state != 0) { /*or block*/ + IError err = _t57.err; + _v_panic(IError_str(err)); + VUNREACHABLE(); + ; + } + + (*(int*)_t57.data); + for (int _t58 = 0; _t58 < g->str_types.len; ++_t58) { + v__gen__c__StrType str_type = ((v__gen__c__StrType*)g->str_types.data)[_t58]; array_push((array*)&global_g.str_types, _MOV((v__gen__c__StrType[]){ str_type })); } - for (int _t56 = 0; _t56 < g->sumtype_casting_fns.len; ++_t56) { - v__gen__c__SumtypeCastingFn scf = ((v__gen__c__SumtypeCastingFn*)g->sumtype_casting_fns.data)[_t56]; + for (int _t60 = 0; _t60 < g->sumtype_casting_fns.len; ++_t60) { + v__gen__c__SumtypeCastingFn scf = ((v__gen__c__SumtypeCastingFn*)g->sumtype_casting_fns.data)[_t60]; if (!Array_v__gen__c__SumtypeCastingFn_contains(global_g.sumtype_casting_fns, scf)) { array_push((array*)&global_g.sumtype_casting_fns, _MOV((v__gen__c__SumtypeCastingFn[]){ scf })); } } global_g.nr_closures += g->nr_closures; global_g.has_main = global_g.has_main || g->has_main; - _PUSH_MANY(&global_g.auto_fn_definitions, (g->auto_fn_definitions), _t58, Array_string); - _PUSH_MANY(&global_g.anon_fn_definitions, (g->anon_fn_definitions), _t59, Array_string); - _PUSH_MANY(&global_g.needed_equality_fns, (g->needed_equality_fns), _t60, Array_v__ast__Type); - _PUSH_MANY(&global_g.array_contains_types, (g->array_contains_types), _t61, Array_v__ast__Type); - _PUSH_MANY(&global_g.array_index_types, (g->array_index_types), _t62, Array_v__ast__Type); - _PUSH_MANY(&global_g.pcs, (g->pcs), _t63, Array_v__gen__c__ProfileCounterMeta); - _PUSH_MANY(&global_g.json_types, (g->json_types), _t64, Array_v__ast__Type); - _PUSH_MANY(&global_g.hotcode_fn_names, (g->hotcode_fn_names), _t65, Array_string); + _PUSH_MANY(&global_g.auto_fn_definitions, (g->auto_fn_definitions), _t62, Array_string); + _PUSH_MANY(&global_g.anon_fn_definitions, (g->anon_fn_definitions), _t63, Array_string); + _PUSH_MANY(&global_g.needed_equality_fns, (g->needed_equality_fns), _t64, Array_v__ast__Type); + _PUSH_MANY(&global_g.array_contains_types, (g->array_contains_types), _t65, Array_v__ast__Type); + _PUSH_MANY(&global_g.array_index_types, (g->array_index_types), _t66, Array_v__ast__Type); + _PUSH_MANY(&global_g.pcs, (g->pcs), _t67, Array_v__gen__c__ProfileCounterMeta); + _PUSH_MANY(&global_g.json_types, (g->json_types), _t68, Array_v__ast__Type); + _PUSH_MANY(&global_g.hotcode_fn_names, (g->hotcode_fn_names), _t69, Array_string); v__gen__c__Gen_free_builders(g); - Map_int_bool _t66 = g->autofree_methods; - int _t68 = _t66.key_values.len; - for (int _t67 = 0; _t67 < _t68; ++_t67 ) { - int _t69 = _t66.key_values.len - _t68; - _t68 = _t66.key_values.len; - if (_t69 < 0) { - _t67 = -1; + Map_int_bool _t70 = g->autofree_methods; + int _t72 = _t70.key_values.len; + for (int _t71 = 0; _t71 < _t72; ++_t71 ) { + int _t73 = _t70.key_values.len - _t72; + _t72 = _t70.key_values.len; + if (_t73 < 0) { + _t71 = -1; continue; } - if (!DenseArray_has_index(&_t66.key_values, _t67)) {continue;} - int k = /*key*/ *(int*)DenseArray_key(&_t66.key_values, _t67); - bool v = (*(bool*)DenseArray_value(&_t66.key_values, _t67)); + if (!DenseArray_has_index(&_t70.key_values, _t71)) {continue;} + int k = /*key*/ *(int*)DenseArray_key(&_t70.key_values, _t71); + bool v = (*(bool*)DenseArray_value(&_t70.key_values, _t71)); map_set(&global_g.autofree_methods, &(int[]){k}, &(bool[]) { v }); } } } else { - for (int _t70 = 0; _t70 < files.len; ++_t70) { - v__ast__File* file = ((v__ast__File**)files.data)[_t70]; + for (int _t74 = 0; _t74 < files.len; ++_t74) { + v__ast__File* file = ((v__ast__File**)files.data)[_t74]; global_g.file = file; v__gen__c__Gen_gen_file(&global_g); strings__Builder_drain_builder(&(*(strings__Builder*)map_get(ADDR(map, global_g.inits), &(string[]){file->mod.name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), (voidptr)&/*qq*/global_g.init, 100); @@ -67131,12 +67265,13 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } v__gen__c__Gen_gen_jsons(&global_g); v__gen__c__Gen_write_optionals(&global_g); + v__gen__c__Gen_write_results(&global_g); v__gen__c__Gen_dump_expr_definitions(&global_g); for (int i = 0; i < global_g.str_types.len; i++) { v__gen__c__Gen_final_gen_str(&global_g, (*(v__gen__c__StrType*)/*ee elem_sym */array_get(global_g.str_types, i))); } - for (int _t71 = 0; _t71 < global_g.sumtype_casting_fns.len; ++_t71) { - v__gen__c__SumtypeCastingFn sumtype_casting_fn = ((v__gen__c__SumtypeCastingFn*)global_g.sumtype_casting_fns.data)[_t71]; + for (int _t75 = 0; _t75 < global_g.sumtype_casting_fns.len; ++_t75) { + v__gen__c__SumtypeCastingFn sumtype_casting_fn = ((v__gen__c__SumtypeCastingFn*)global_g.sumtype_casting_fns.data)[_t75]; v__gen__c__Gen_write_sumtype_casting_fn(&global_g, sumtype_casting_fn); } v__gen__c__Gen_write_shareds(&global_g); @@ -67155,7 +67290,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre if (idx == 0) { continue; } - strings__Builder_writeln(&g.definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("int _v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g.definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("int _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); } } else if (g.pref->use_cache) { for (int idx = 0; idx < g.table->type_symbols.len; ++idx) { @@ -67163,7 +67298,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre if (idx == 0) { continue; } - strings__Builder_writeln(&g.definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int _v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("() { return "), 0xfe07, {.d_i32 = idx}}, {_SLIT("; };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g.definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("int _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("() { return "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("; };"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_gen_vlines_reset(&g); @@ -67195,6 +67330,8 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre strings__Builder_write_string(&b, strings__Builder_str(&g.shared_types)); strings__Builder_writeln(&b, _SLIT("\n// V Option_xxx definitions:")); strings__Builder_write_string(&b, strings__Builder_str(&g.options)); + strings__Builder_writeln(&b, _SLIT("\n// V result_xxx definitions:")); + strings__Builder_write_string(&b, strings__Builder_str(&g.out_results)); strings__Builder_writeln(&b, _SLIT("\n// V json forward decls:")); strings__Builder_write_string(&b, strings__Builder_str(&g.json_forward_decls)); strings__Builder_writeln(&b, _SLIT("\n// V definitions:")); @@ -67238,8 +67375,8 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre strings__Builder_write_string(&b, strings__Builder_str(&g.dump_funcs)); } if (g.auto_fn_definitions.len > 0) { - for (int _t72 = 0; _t72 < g.auto_fn_definitions.len; ++_t72) { - string fn_def = ((string*)g.auto_fn_definitions.data)[_t72]; + for (int _t76 = 0; _t76 < g.auto_fn_definitions.len; ++_t76) { + string fn_def = ((string*)g.auto_fn_definitions.data)[_t76]; strings__Builder_writeln(&b, fn_def); } } @@ -67248,8 +67385,8 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre strings__Builder_writeln(&b, _SLIT("\n// V closure helpers")); strings__Builder_writeln(&b, v__gen__c__c_closure_helpers(g.pref)); } - for (int _t73 = 0; _t73 < g.anon_fn_definitions.len; ++_t73) { - string fn_def = ((string*)g.anon_fn_definitions.data)[_t73]; + for (int _t77 = 0; _t77 < g.anon_fn_definitions.len; ++_t77) { + string fn_def = ((string*)g.anon_fn_definitions.data)[_t77]; strings__Builder_writeln(&b, fn_def); } } @@ -67260,8 +67397,8 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre string res = strings__Builder_str(&b); strings__Builder_free(&b); v__gen__c__Gen_free_builders(&g); - string _t74 = res; - return _t74; + string _t78 = res; + return _t78; } VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__PoolProcessor* p, int idx, int wid) { @@ -67298,6 +67435,7 @@ VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__ .shared_types = strings__new_builder(100), .shared_functions = strings__new_builder(100), .options = strings__new_builder(100), + .out_results = strings__new_builder(100), .json_forward_decls = strings__new_builder(100), .sql_buf = strings__new_builder(100), .file = file, @@ -67324,6 +67462,7 @@ VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__ .is_cc_msvc = global_g->is_cc_msvc, .vlines_path = (string){.str=(byteptr)"", .is_lit=1}, .optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), + .results = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .done_optionals = global_g->done_optionals, .chan_pop_optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .chan_push_optionals = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), @@ -67402,7 +67541,7 @@ VV_LOCAL_SYMBOL v__gen__c__Gen* v__gen__c__cgen_process_one_file_cb(sync__pool__ .returned_var_name = (string){.str=(byteptr)"", .is_lit=1}, .infix_left_var_name = (string){.str=(byteptr)"", .is_lit=1}, .called_fn_name = (string){.str=(byteptr)"", .is_lit=1}, - .timers = v__util__new_timers(((v__util__TimerParams){.should_print = global_g->timers_should_print,.label = str_intp(3, _MOV((StrIntpData[]){{_SLIT("cgen_process_one_file_cb idx: "), 0xfe07, {.d_i32 = idx}}, {_SLIT(", wid: "), 0xfe07, {.d_i32 = wid}}, {_SLIT0, 0, { .d_c = 0 }}})),})), + .timers = v__util__new_timers(((v__util__TimerParams){.should_print = global_g->timers_should_print,.label = str_intp(3, _MOV((StrIntpData[]){{_SLIT("cgen_process_one_file_cb idx: "), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT(", wid: "), /*100 &int*/0xfe07, {.d_i32 = wid}}, {_SLIT0, 0, { .d_c = 0 }}})),})), .force_main_console = 0, .as_cast_type_names = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), .obf_table = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string), @@ -67451,6 +67590,7 @@ void v__gen__c__Gen_free_builders(v__gen__c__Gen* g) { strings__Builder_free(&g->shared_functions); strings__Builder_free(&g->channel_definitions); strings__Builder_free(&g->options); + strings__Builder_free(&g->out_results); strings__Builder_free(&g->json_forward_decls); strings__Builder_free(&g->enum_typedefs); strings__Builder_free(&g->sql_buf); @@ -67497,7 +67637,7 @@ void v__gen__c__Gen_free_builders(v__gen__c__Gen* g) { } void v__gen__c__Gen_gen_file(v__gen__c__Gen* g) { - v__util__Timers_start(g->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen_file "), 0xfe10, {.d_s = g->file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_start(g->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen_file "), /*115 &string*/0xfe10, {.d_s = g->file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); g->unique_file_path_hash = hash__fnv1a__sum64_string(g->file->path); if (g->pref->is_vlines) { g->vlines_path = v__util__vlines_escape_path(g->file->path, g->pref->ccompiler); @@ -67511,7 +67651,7 @@ void v__gen__c__Gen_gen_file(v__gen__c__Gen* g) { array_push((array*)&g->embedded_files, _MOV((v__ast__EmbeddedFile[]){ path })); } } - v__util__Timers_show(g->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen_file "), 0xfe10, {.d_s = g->file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_show(g->timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen_file "), /*115 &string*/0xfe10, {.d_s = g->file->path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } string v__gen__c__Gen_hashes(v__gen__c__Gen* g) { @@ -67581,7 +67721,7 @@ void v__gen__c__Gen_init(v__gen__c__Gen* g) { strings__Builder_writeln(&g->comptime_definitions, string__plus(_SLIT("// Turned ON custom defines: "), Array_string_join(g->pref->compile_defines, _SLIT(",")))); for (int _t1 = 0; _t1 < g->pref->compile_defines.len; ++_t1) { string cdefine = ((string*)g->pref->compile_defines.data)[_t1]; - strings__Builder_writeln(&g->comptime_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define CUSTOM_DEFINE_"), 0xfe10, {.d_s = cdefine}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->comptime_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define CUSTOM_DEFINE_"), /*115 &string*/0xfe10, {.d_s = cdefine}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->comptime_definitions, _SLIT("")); } @@ -67638,7 +67778,7 @@ void v__gen__c__Gen_init(v__gen__c__Gen* g) { if (!string__eq(f.mod, _SLIT("main")) && !string__eq(key, _SLIT("main"))) { continue; } - map_set(&g->obf_table, &(string[]){key}, &(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("_f"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})) }); + map_set(&g->obf_table, &(string[]){key}, &(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("_f"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})) }); i++; } for (int _t6 = 0; _t6 < g->table->type_symbols.len; ++_t6) { @@ -67648,7 +67788,7 @@ void v__gen__c__Gen_init(v__gen__c__Gen* g) { } for (int _t7 = 0; _t7 < type_sym->methods.len; ++_t7) { v__ast__Fn method = ((v__ast__Fn*)type_sym->methods.data)[_t7]; - map_set(&g->obf_table, &(string[]){string__plus(string__plus(type_sym->name, _SLIT(".")), method.name)}, &(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("_f"), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})) }); + map_set(&g->obf_table, &(string[]){string__plus(string__plus(type_sym->name, _SLIT(".")), method.name)}, &(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("_f"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})) }); i++; } } @@ -67693,79 +67833,79 @@ void v__gen__c__Gen_write_typeof_functions(v__gen__c__Gen* g) { for (int ityp = 0; ityp < g->table->type_symbols.len; ++ityp) { v__ast__TypeSymbol* sym = ((v__ast__TypeSymbol**)g->table->type_symbols.data)[ityp]; if (sym->kind == v__ast__Kind__sum_type) { - v__ast__SumType sum_info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ; + v__ast__SumType sum_info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ; if (sum_info.is_generic) { continue; } - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_sumtype_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); if (g->pref->build_mode == v__pref__BuildMode__build_module) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif( sidx == _v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("() ) return \""), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif( sidx == _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("() ) return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < sum_info.variants.len; ++_t1) { v__ast__Type v = ((v__ast__Type*)sum_info.variants.data)[_t1]; v__ast__TypeSymbol* subtype = v__ast__Table_sym(g->table, v); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif( sidx == _v_type_idx_"), 0xfe10, {.d_s = subtype->cname}}, {_SLIT("() ) return \""), 0xfe10, {.d_s = v__util__strip_main_name(subtype->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif( sidx == _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = subtype->cname}}, {_SLIT("() ) return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(subtype->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn \"unknown "), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn \"unknown "), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); } else { int tidx = v__ast__Table_find_type_idx(g->table, sym->name); v__gen__c__Gen_writeln(g, _SLIT("\tswitch(sidx) {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = tidx}}, {_SLIT(": return \""), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = tidx}}, {_SLIT(": return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < sum_info.variants.len; ++_t2) { v__ast__Type v = ((v__ast__Type*)sum_info.variants.data)[_t2]; v__ast__TypeSymbol* subtype = v__ast__Table_sym(g->table, v); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = v__ast__Type_idx(v)}}, {_SLIT(": return \""), 0xfe10, {.d_s = v__util__strip_main_name(subtype->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(v)}}, {_SLIT(": return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(subtype->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tdefault: return \"unknown "), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tdefault: return \"unknown "), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t}")); } v__gen__c__Gen_writeln(g, _SLIT("}")); v__gen__c__Gen_writeln(g, _SLIT("")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_sumtype_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_sumtype_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); if (g->pref->build_mode == v__pref__BuildMode__build_module) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif( sidx == _v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("() ) return "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tif( sidx == _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("() ) return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); for (int _t3 = 0; _t3 < sum_info.variants.len; ++_t3) { v__ast__Type v = ((v__ast__Type*)sum_info.variants.data)[_t3]; v__ast__TypeSymbol* subtype = v__ast__Table_sym(g->table, v); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif( sidx == _v_type_idx_"), 0xfe10, {.d_s = subtype->cname}}, {_SLIT("() ) return "), 0xfe07, {.d_i32 = ((int)(v))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif( sidx == _v_type_idx_"), /*115 &string*/0xfe10, {.d_s = subtype->cname}}, {_SLIT("() ) return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(v))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { int tidx = v__ast__Table_find_type_idx(g->table, sym->name); v__gen__c__Gen_writeln(g, _SLIT("\tswitch(sidx) {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = tidx}}, {_SLIT(": return "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = tidx}}, {_SLIT(": return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); for (int _t4 = 0; _t4 < sum_info.variants.len; ++_t4) { v__ast__Type v = ((v__ast__Type*)sum_info.variants.data)[_t4]; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe07, {.d_i32 = v__ast__Type_idx(v)}}, {_SLIT(": return "), 0xfe07, {.d_i32 = ((int)(v))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(v)}}, {_SLIT(": return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(v))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tdefault: return "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tdefault: return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t}")); } v__gen__c__Gen_writeln(g, _SLIT("}")); } else if (sym->kind == v__ast__Kind__interface_) { - if ((sym->info)._typ != 473 /* v.ast.Interface */) { + if ((sym->info)._typ != 474 /* v.ast.Interface */) { continue; } - v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((sym->info)._v__ast__Interface,(sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((sym->info)._v__ast__Interface,(sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; if (inter_info.is_generic) { continue; } - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_interface_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx);"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_interface_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_interface_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static char * v_typeof_interface_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); for (int _t5 = 0; _t5 < inter_info.types.len; ++_t5) { v__ast__Type t = ((v__ast__Type*)inter_info.types.data)[_t5]; v__ast__TypeSymbol* sub_sym = v__ast__Table_sym(g->table, v__ast__mktyp(t)); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tif (sidx == _"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index) return \""), 0xfe10, {.d_s = v__util__strip_main_name(sub_sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tif (sidx == _"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index) return \""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sub_sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn \"unknown "), 0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn \"unknown "), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(sym->name)}}, {_SLIT("\";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); v__gen__c__Gen_writeln(g, _SLIT("")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_interface_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static int v_typeof_interface_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("(int sidx) { /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); for (int _t6 = 0; _t6 < inter_info.types.len; ++_t6) { v__ast__Type t = ((v__ast__Type*)inter_info.types.data)[_t6]; v__ast__TypeSymbol* sub_sym = v__ast__Table_sym(g->table, v__ast__mktyp(t)); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tif (sidx == _"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index) return "), 0xfe07, {.d_i32 = ((int)(t))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tif (sidx == _"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index) return "), /*100 &int*/0xfe07, {.d_i32 = ((int)(t))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*100 &int*/0xfe07, {.d_i32 = ((int)(ityp))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); } } @@ -67777,9 +67917,12 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_typ(v__gen__c__Gen* g, v__ast__Type t) { if (v__ast__Type_has_flag(t, v__ast__TypeFlag__optional)) { string _t1 = v__gen__c__Gen_register_optional(g, t); return _t1; - } else { - string _t2 = v__gen__c__Gen_base_type(g, t); + } else if (v__ast__Type_has_flag(t, v__ast__TypeFlag__result)) { + string _t2 = v__gen__c__Gen_register_result(g, t); return _t2; + } else { + string _t3 = v__gen__c__Gen_base_type(g, t); + return _t3; } return (string){.str=(byteptr)"", .is_lit=1}; } @@ -67857,7 +68000,16 @@ bool v__gen__c__Gen_expr_string_surround_defer_0 = false; VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_optional_type_name(v__gen__c__Gen* g, v__ast__Type t) { string base = v__gen__c__Gen_base_type(g, t); - string styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Option_"), 0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); + string styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Option_"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); + if (v__ast__Type_is_ptr(t)) { + styp = string_replace(styp, _SLIT("*"), _SLIT("_ptr")); + } + return (multi_return_string_string){.arg0=styp, .arg1=base}; +} + +VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_result_type_name(v__gen__c__Gen* g, v__ast__Type t) { + string base = v__gen__c__Gen_base_type(g, t); + string styp = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__result_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__ast__Type_is_ptr(t)) { styp = string_replace(styp, _SLIT("*"), _SLIT("_ptr")); } @@ -67866,20 +68018,36 @@ VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__Gen_optional_type_name(v__ VV_LOCAL_SYMBOL string v__gen__c__Gen_optional_type_text(v__gen__c__Gen* g, string styp, string base) { string size = (string__eq(base, _SLIT("void")) ? (_SLIT("u8")) : string_starts_with(base, _SLIT("anon_fn")) ? (_SLIT("void*")) : (base)); - string ret = str_intp(4, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = styp}}, {_SLIT(" {\n byte state;\n IError err;\n byte data[sizeof("), 0xfe10, {.d_s = size}}, {_SLIT(") > 0 ? sizeof("), 0xfe10, {.d_s = size}}, {_SLIT(") : 1];\n}"), 0, { .d_c = 0 }}})); + string ret = str_intp(4, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" {\n byte state;\n IError err;\n byte data[sizeof("), /*115 &string*/0xfe10, {.d_s = size}}, {_SLIT(") > 0 ? sizeof("), /*115 &string*/0xfe10, {.d_s = size}}, {_SLIT(") : 1];\n}"), 0, { .d_c = 0 }}})); + string _t1 = ret; + return _t1; +} + +VV_LOCAL_SYMBOL string v__gen__c__Gen_result_type_text(v__gen__c__Gen* g, string styp, string base) { + string size = (string__eq(base, _SLIT("void")) ? (_SLIT("u8")) : string_starts_with(base, _SLIT("anon_fn")) ? (_SLIT("void*")) : (base)); + string ret = str_intp(4, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" {\n bool is_error;\n IError err;\n byte data[sizeof("), /*115 &string*/0xfe10, {.d_s = size}}, {_SLIT(") > 0 ? sizeof("), /*115 &string*/0xfe10, {.d_s = size}}, {_SLIT(") : 1];\n}"), 0, { .d_c = 0 }}})); string _t1 = ret; return _t1; } VV_LOCAL_SYMBOL string v__gen__c__Gen_register_optional(v__gen__c__Gen* g, v__ast__Type t) { - multi_return_string_string mr_36790 = v__gen__c__Gen_optional_type_name(g, t); - string styp = mr_36790.arg0; - string base = mr_36790.arg1; + multi_return_string_string mr_37817 = v__gen__c__Gen_optional_type_name(g, t); + string styp = mr_37817.arg0; + string base = mr_37817.arg1; map_set(&g->optionals, &(string[]){base}, &(string[]) { styp }); string _t1 = styp; return _t1; } +VV_LOCAL_SYMBOL string v__gen__c__Gen_register_result(v__gen__c__Gen* g, v__ast__Type t) { + multi_return_string_string mr_37950 = v__gen__c__Gen_result_type_name(g, t); + string styp = mr_37950.arg0; + string base = mr_37950.arg1; + map_set(&g->results, &(string[]){base}, &(string[]) { styp }); + string _t1 = styp; + return _t1; +} + VV_LOCAL_SYMBOL void v__gen__c__Gen_write_optionals(v__gen__c__Gen* g) { Array_string done = __new_array_with_default(0, 0, sizeof(string), 0); sync__RwMutex_rlock(&g->done_optionals->mtx); @@ -67904,14 +68072,38 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_optionals(v__gen__c__Gen* g) { continue; } array_push((array*)&done, _MOV((string[]){ string_clone(base) })); - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->options, string__plus(v__gen__c__Gen_optional_type_text(g, styp, base), _SLIT(";\n\n"))); } } +VV_LOCAL_SYMBOL void v__gen__c__Gen_write_results(v__gen__c__Gen* g) { + Array_string done = __new_array_with_default(0, 0, sizeof(string), 0); + Map_string_string _t1 = g->results; + int _t3 = _t1.key_values.len; + for (int _t2 = 0; _t2 < _t3; ++_t2 ) { + int _t4 = _t1.key_values.len - _t3; + _t3 = _t1.key_values.len; + if (_t4 < 0) { + _t2 = -1; + continue; + } + if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} + string base = /*key*/ *(string*)DenseArray_key(&_t1.key_values, _t2); + base = string_clone(base); + string styp = (*(string*)DenseArray_value(&_t1.key_values, _t2)); + if (Array_string_contains(done, base)) { + continue; + } + array_push((array*)&done, _MOV((string[]){ string_clone(base) })); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->out_results, string__plus(v__gen__c__Gen_result_type_text(g, styp, base), _SLIT(";\n\n"))); + } +} + VV_LOCAL_SYMBOL string v__gen__c__Gen_find_or_register_shared(v__gen__c__Gen* g, v__ast__Type t, string base) { map_set(&g->shareds, &(int[]){v__ast__Type_idx(t)}, &(string[]) { base }); - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -67933,18 +68125,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_shareds(v__gen__c__Gen* g) { continue; } array_push((array*)&done_types, _MOV((int[]){ typ })); - string sh_typ = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); + string sh_typ = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT0, 0, { .d_c = 0 }}})); string mtx_typ = _SLIT("sync__RwMutex"); - strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = sh_typ}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = mtx_typ}}, {_SLIT(" mtx;"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = base}}, {_SLIT(" val;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = mtx_typ}}, {_SLIT(" mtx;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_types, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = base}}, {_SLIT(" val;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->shared_types, _SLIT("};")); - strings__Builder_writeln(&g->shared_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static inline voidptr __dup"), 0xfe10, {.d_s = sh_typ}}, {_SLIT("(voidptr src, int sz) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->shared_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = sh_typ}}, {_SLIT("* dest = memdup(src, sz);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("static inline voidptr __dup"), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT("(voidptr src, int sz) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->shared_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT("* dest = memdup(src, sz);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->shared_functions, _SLIT("\tsync__RwMutex_init(&dest->mtx);")); strings__Builder_writeln(&g->shared_functions, _SLIT("\treturn dest;")); strings__Builder_writeln(&g->shared_functions, _SLIT("}")); - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = sh_typ}}, {_SLIT(" "), 0xfe10, {.d_s = sh_typ}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sh_typ}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } @@ -67972,10 +68164,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_register_thread_void_wait_call(v__gen__c__Ge VV_LOCAL_SYMBOL string v__gen__c__Gen_register_thread_array_wait_call(v__gen__c__Gen* g, string eltyp) { bool is_void = string__eq(eltyp, _SLIT("void")); - string thread_typ = (is_void ? (_SLIT("__v_thread")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), 0xfe10, {.d_s = eltyp}}, {_SLIT0, 0, { .d_c = 0 }}})))); - string ret_typ = (is_void ? (_SLIT("void")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), 0xfe10, {.d_s = eltyp}}, {_SLIT0, 0, { .d_c = 0 }}})))); - string thread_arr_typ = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), 0xfe10, {.d_s = thread_typ}}, {_SLIT0, 0, { .d_c = 0 }}})); - string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = thread_arr_typ}}, {_SLIT("_wait"), 0, { .d_c = 0 }}})); + string thread_typ = (is_void ? (_SLIT("__v_thread")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string ret_typ = (is_void ? (_SLIT("void")) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string thread_arr_typ = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_"), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = thread_arr_typ}}, {_SLIT("_wait"), 0, { .d_c = 0 }}})); bool should_register = false; sync__RwMutex_lock(&g->waiter_fns->mtx); /*lock*/ { @@ -67988,15 +68180,15 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_register_thread_array_wait_call(v__gen__c_ if (should_register) { if (is_void) { v__gen__c__Gen_register_thread_void_wait_call(g); - strings__Builder_writeln(&g->gowrappers, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nvoid "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = thread_arr_typ}}, {_SLIT(" a) {\n for (int i = 0; i < a.len; ++i) {\n "), 0xfe10, {.d_s = thread_typ}}, {_SLIT(" t = (("), 0xfe10, {.d_s = thread_typ}}, {_SLIT("*)a.data)[i];\n if (t == 0) continue;\n __v_thread_wait(t);\n }\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nvoid "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = thread_arr_typ}}, {_SLIT(" a) {\n for (int i = 0; i < a.len; ++i) {\n "), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT(" t = (("), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT("*)a.data)[i];\n if (t == 0) continue;\n __v_thread_wait(t);\n }\n}"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->gowrappers, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = thread_arr_typ}}, {_SLIT(" a) {\n "), 0xfe10, {.d_s = ret_typ}}, {_SLIT(" res = __new_array_with_default(a.len, a.len, sizeof("), 0xfe10, {.d_s = eltyp}}, {_SLIT("), 0);\n for (int i = 0; i < a.len; ++i) {\n "), 0xfe10, {.d_s = thread_typ}}, {_SLIT(" t = (("), 0xfe10, {.d_s = thread_typ}}, {_SLIT("*)a.data)[i];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = thread_arr_typ}}, {_SLIT(" a) {\n "), /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" res = __new_array_with_default(a.len, a.len, sizeof("), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT("), 0);\n for (int i = 0; i < a.len; ++i) {\n "), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT(" t = (("), /*115 &string*/0xfe10, {.d_s = thread_typ}}, {_SLIT("*)a.data)[i];"), 0, { .d_c = 0 }}}))); if (g->pref->os == v__pref__OS__windows) { strings__Builder_writeln(&g->gowrappers, _SLIT("\t\tif (t.handle == 0) continue;")); } else { strings__Builder_writeln(&g->gowrappers, _SLIT("\t\tif (t == 0) continue;")); } - strings__Builder_writeln(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t(("), 0xfe10, {.d_s = eltyp}}, {_SLIT("*)res.data)[i] = __v_thread_"), 0xfe10, {.d_s = eltyp}}, {_SLIT("_wait(t);\n }\n return res;\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t(("), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT("*)res.data)[i] = __v_thread_"), /*115 &string*/0xfe10, {.d_s = eltyp}}, {_SLIT("_wait(t);\n }\n return res;\n}"), 0, { .d_c = 0 }}}))); } } string _t2 = fn_name; @@ -68026,7 +68218,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_chan_pop_optional_fns(v__gen__c__Gen* continue; } array_push((array*)&done, _MOV((string[]){ string_clone(opt_el_type) })); - strings__Builder_writeln(&g->channel_definitions, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), 0xfe10, {.d_s = opt_el_type}}, {_SLIT(" __Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0xfe10, {.d_s = styp}}, {_SLIT(" ch) {\n "), 0xfe10, {.d_s = opt_el_type}}, {_SLIT(" _tmp = {0};\n if (sync__Channel_try_pop_priv(ch, _tmp.data, false)) {\n return ("), 0xfe10, {.d_s = opt_el_type}}, {_SLIT("){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return _tmp;\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), /*115 &string*/0xfe10, {.d_s = opt_el_type}}, {_SLIT(" __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_popval("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ch) {\n "), /*115 &string*/0xfe10, {.d_s = opt_el_type}}, {_SLIT(" _tmp = {0};\n if (sync__Channel_try_pop_priv(ch, _tmp.data, false)) {\n return ("), /*115 &string*/0xfe10, {.d_s = opt_el_type}}, {_SLIT("){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return _tmp;\n}"), 0, { .d_c = 0 }}}))); } } @@ -68054,42 +68246,42 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_chan_push_optional_fns(v__gen__c__Gen* } array_push((array*)&done, _MOV((string[]){ string_clone(styp) })); v__gen__c__Gen_register_optional(g, v__ast__Type_set_flag(_const_v__ast__void_type, v__ast__TypeFlag__optional)); - strings__Builder_writeln(&g->channel_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nstatic inline Option_void __Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0xfe10, {.d_s = styp}}, {_SLIT(" ch, "), 0xfe10, {.d_s = el_type}}, {_SLIT(" e) {\n if (sync__Channel_try_push_priv(ch, &e, false)) {\n return (Option_void){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return (Option_void){0};\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nstatic inline Option_void __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ch, "), /*115 &string*/0xfe10, {.d_s = el_type}}, {_SLIT(" e) {\n if (sync__Channel_try_push_priv(ch, &e, false)) {\n return (Option_void){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return (Option_void){0};\n}"), 0, { .d_c = 0 }}}))); } } VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type typ, bool is_prefix_struct) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); string styp = sym->cname; - if (sym->info._typ == 455 /* v.ast.Struct */) { + if (sym->info._typ == 456 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { string sgtyps = _SLIT("_T"); for (int _t1 = 0; _t1 < (*sym->info._v__ast__Struct).generic_types.len; ++_t1) { v__ast__Type gt = ((v__ast__Type*)(*sym->info._v__ast__Struct).generic_types.data)[_t1]; v__ast__TypeSymbol* gts = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, gt)); - sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } styp = /*f*/string__plus(styp, sgtyps); } } - else if (sym->info._typ == 473 /* v.ast.Interface */) { + else if (sym->info._typ == 474 /* v.ast.Interface */) { if ((*sym->info._v__ast__Interface).is_generic) { string sgtyps = _SLIT("_T"); for (int _t2 = 0; _t2 < (*sym->info._v__ast__Interface).generic_types.len; ++_t2) { v__ast__Type gt = ((v__ast__Type*)(*sym->info._v__ast__Interface).generic_types.data)[_t2]; v__ast__TypeSymbol* gts = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, gt)); - sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } styp = /*f*/string__plus(styp, sgtyps); } } - else if (sym->info._typ == 474 /* v.ast.SumType */) { + else if (sym->info._typ == 475 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { string sgtyps = _SLIT("_T"); for (int _t3 = 0; _t3 < (*sym->info._v__ast__SumType).generic_types.len; ++_t3) { v__ast__Type gt = ((v__ast__Type*)(*sym->info._v__ast__SumType).generic_types.data)[_t3]; v__ast__TypeSymbol* gts = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, gt)); - sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sgtyps = /*f*/string__plus(sgtyps, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = gts->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } styp = /*f*/string__plus(styp, sgtyps); } @@ -68101,9 +68293,9 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type ty if (is_prefix_struct && sym->language == v__ast__Language__c) { styp = string_substr(styp, 3, (styp).len); if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (!info.is_typedef) { - styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = styp}}, {_SLIT0, 0, { .d_c = 0 }}})); + styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT0, 0, { .d_c = 0 }}})); } } } @@ -68115,7 +68307,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type ty inline VV_LOCAL_SYMBOL string v__gen__c__Gen_type_sidx(v__gen__c__Gen* g, v__ast__Type t) { if (g->pref->build_mode == v__pref__BuildMode__build_module) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, t); - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_type_idx_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("()"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_type_idx_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("()"), 0, { .d_c = 0 }}})); return _t1; } string _t2 = int_str(v__ast__Type_idx(t)); @@ -68130,45 +68322,45 @@ void v__gen__c__Gen_write_typedef_types(v__gen__c__Gen* g) { } if (sym->kind == (v__ast__Kind__array)) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, info.elem_type); if (elem_sym->kind != v__ast__Kind__placeholder && !v__ast__Type_has_flag(info.elem_type, v__ast__TypeFlag__generic)) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef array "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef array "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else if (sym->kind == (v__ast__Kind__array_fixed)) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, info.elem_type); if (v__ast__TypeSymbol_is_builtin(elem_sym)) { string styp = sym->cname; string len = string_after(styp, _SLIT("_")); string fixed = v__gen__c__Gen_typ(g, info.elem_type); - if ((elem_sym->info)._typ == 482 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 483 /* v.ast.FnType */) { int pos = g->out.len; v__gen__c__Gen_write_fn_ptr_decl(g, &(*elem_sym->info._v__ast__FnType), _SLIT("")); fixed = strings__Builder_cut_to(&g->out, pos); - string def_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = fixed}}, {_SLIT(";"), 0, { .d_c = 0 }}})); - def_str = string_replace_once(def_str, _SLIT("(*)"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*"), 0xfe10, {.d_s = styp}}, {_SLIT("["), 0xfe10, {.d_s = len}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + string def_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = fixed}}, {_SLIT(";"), 0, { .d_c = 0 }}})); + def_str = string_replace_once(def_str, _SLIT("(*)"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = len}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, def_str); } else { - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = fixed}}, {_SLIT(" "), 0xfe10, {.d_s = styp}}, {_SLIT(" ["), 0xfe10, {.d_s = len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = fixed}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ["), /*115 &string*/0xfe10, {.d_s = len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } } else if (sym->kind == (v__ast__Kind__chan)) { if (!string__eq(sym->name, _SLIT("chan"))) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef chan "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef chan "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__ast__Chan chan_inf = v__ast__TypeSymbol_chan_info(sym); v__ast__Type chan_elem_type = chan_inf.elem_type; if (!v__ast__Type_has_flag(chan_elem_type, v__ast__TypeFlag__generic)) { string el_stype = v__gen__c__Gen_typ(g, chan_elem_type); - strings__Builder_writeln(&g->channel_definitions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), 0xfe10, {.d_s = el_stype}}, {_SLIT(" __"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_popval("), 0xfe10, {.d_s = sym->cname}}, {_SLIT(" ch) {\n "), 0xfe10, {.d_s = el_stype}}, {_SLIT(" val;\n sync__Channel_try_pop_priv(ch, &val, false);\n return val;\n}"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->channel_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nstatic inline void __"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_pushval("), 0xfe10, {.d_s = sym->cname}}, {_SLIT(" ch, "), 0xfe10, {.d_s = el_stype}}, {_SLIT(" val) {\n sync__Channel_try_push_priv(ch, &val, false);\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" __"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_popval("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(" ch) {\n "), /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" val;\n sync__Channel_try_pop_priv(ch, &val, false);\n return val;\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nstatic inline void __"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_pushval("), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(" ch, "), /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" val) {\n sync__Channel_try_push_priv(ch, &val, false);\n}"), 0, { .d_c = 0 }}}))); } } } else if (sym->kind == (v__ast__Kind__map)) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef map "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef map "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { continue; @@ -68205,7 +68397,7 @@ void v__gen__c__Gen_write_alias_typesymbol_declaration(v__gen__c__Gen* g, v__ast bool is_c_parent = parent->name.len > 2 && string_at(parent->name, 0) == 'C' && string_at(parent->name, 1) == '.'; bool is_typedef = false; bool is_fixed_array_of_non_builtin = false; - if ((parent->info)._typ == 455 /* v.ast.Struct */) { + if ((parent->info)._typ == 456 /* v.ast.Struct */) { is_typedef = (*parent->info._v__ast__Struct).is_typedef; } string parent_styp = parent->cname; @@ -68216,10 +68408,10 @@ void v__gen__c__Gen_write_alias_typesymbol_declaration(v__gen__c__Gen* g, v__ast parent_styp = string_substr(parent->cname, 3, (parent->cname).len); } } else { - if ((sym.info)._typ == 470 /* v.ast.Alias */) { + if ((sym.info)._typ == 471 /* v.ast.Alias */) { parent_styp = v__gen__c__Gen_typ(g, (*sym.info._v__ast__Alias).parent_type); v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*sym.info._v__ast__Alias).parent_type); - if ((parent_sym->info)._typ == 478 /* v.ast.ArrayFixed */) { + if ((parent_sym->info)._typ == 479 /* v.ast.ArrayFixed */) { v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, (*parent_sym->info._v__ast__ArrayFixed).elem_type); if (!v__ast__TypeSymbol_is_builtin(elem_sym)) { is_fixed_array_of_non_builtin = true; @@ -68231,27 +68423,27 @@ void v__gen__c__Gen_write_alias_typesymbol_declaration(v__gen__c__Gen* g, v__ast return; } if (is_fixed_array_of_non_builtin) { - strings__Builder_writeln(&g->alias_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = parent_styp}}, {_SLIT(" "), 0xfe10, {.d_s = sym.cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->alias_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = parent_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = parent_styp}}, {_SLIT(" "), 0xfe10, {.d_s = sym.cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = parent_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } void v__gen__c__Gen_write_interface_typedef(v__gen__c__Gen* g, v__ast__TypeSymbol sym) { string struct_name = v__gen__c__c_name(sym.cname); - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = struct_name}}, {_SLIT(" "), 0xfe10, {.d_s = struct_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = struct_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = struct_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v__ast__TypeSymbol sym) { - if ((sym.info)._typ != 473 /* v.ast.Interface */) { + if ((sym.info)._typ != 474 /* v.ast.Interface */) { return; } - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((sym.info)._v__ast__Interface,(sym.info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((sym.info)._v__ast__Interface,(sym.info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; if (info.is_generic) { return; } string struct_name = v__gen__c__c_name(sym.cname); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, _SLIT("\tunion {")); strings__Builder_writeln(&g->type_definitions, _SLIT("\t\tvoid* _object;")); for (int _t1 = 0; _t1 < info.types.len; ++_t1) { @@ -68261,7 +68453,7 @@ void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v_ continue; } string vcname = v__ast__Table_sym(g->table, mk_typ)->cname; - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = vcname}}, {_SLIT("* _"), 0xfe10, {.d_s = vcname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = vcname}}, {_SLIT("* _"), /*115 &string*/0xfe10, {.d_s = vcname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->type_definitions, _SLIT("\t};")); strings__Builder_writeln(&g->type_definitions, _SLIT("\tint _typ;")); @@ -68269,13 +68461,13 @@ void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v_ v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t2]; string styp = v__gen__c__Gen_typ(g, field.typ); string cname = v__gen__c__c_name(field.name); - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT("* "), 0xfe10, {.d_s = cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->type_definitions, _SLIT("};")); } void v__gen__c__Gen_write_fn_typesymbol_declaration(v__gen__c__Gen* g, v__ast__TypeSymbol sym) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym.info)._v__ast__FnType,(sym.info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym.info)._v__ast__FnType,(sym.info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; v__ast__Fn func = info.func; bool is_fn_sig = (func.name).len == 0; bool not_anon = !info.is_anon; @@ -68296,16 +68488,16 @@ void v__gen__c__Gen_write_fn_typesymbol_declaration(v__gen__c__Gen* g, v__ast__T if (string__eq(attr.name, _SLIT("callconv"))) { if (g->is_cc_msvc) { - msvc_call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = attr.arg}}, {_SLIT(" "), 0, { .d_c = 0 }}})); + msvc_call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT(" "), 0, { .d_c = 0 }}})); } else { - call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}})); + call_conv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}})); } } else { }; } - string call_conv_attribute_suffix = (call_conv.len != 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), 0xfe10, {.d_s = call_conv}}, {_SLIT("))"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); - strings__Builder_write_string(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" ("), 0xfe10, {.d_s = msvc_call_conv}}, {_SLIT("*"), 0xfe10, {.d_s = fn_name}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); + string call_conv_attribute_suffix = (call_conv.len != 0 ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), /*115 &string*/0xfe10, {.d_s = call_conv}}, {_SLIT("))"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); + strings__Builder_write_string(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" ("), /*115 &string*/0xfe10, {.d_s = msvc_call_conv}}, {_SLIT("*"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); for (int i = 0; i < func.params.len; ++i) { v__ast__Param param = ((v__ast__Param*)func.params.data)[i]; strings__Builder_write_string(&g->type_definitions, v__gen__c__Gen_typ(g, param.typ)); @@ -68313,7 +68505,7 @@ void v__gen__c__Gen_write_fn_typesymbol_declaration(v__gen__c__Gen* g, v__ast__T strings__Builder_write_string(&g->type_definitions, _SLIT(",")); } } - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), 0xfe10, {.d_s = call_conv_attribute_suffix}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), /*115 &string*/0xfe10, {.d_s = call_conv_attribute_suffix}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } @@ -68340,12 +68532,12 @@ void v__gen__c__Gen_write_multi_return_types(v__gen__c__Gen* g) { if (_t2.len > 0) { continue; } - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(" "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = sym->cname}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); for (int i = 0; i < info.types.len; ++i) { v__ast__Type mr_typ = ((v__ast__Type*)info.types.data)[i]; string type_name = v__gen__c__Gen_typ(g, mr_typ); - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = type_name}}, {_SLIT(" arg"), 0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->type_definitions, _SLIT("};\n")); } @@ -68371,24 +68563,24 @@ void v__gen__c__Gen_writeln(v__gen__c__Gen* g, string s) { string v__gen__c__Gen_new_tmp_var(v__gen__c__Gen* g) { g->tmp_count++; - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), 0xfe07, {.d_i32 = g->tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), /*100 &int*/0xfe07, {.d_i32 = g->tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string v__gen__c__Gen_new_global_tmp_var(v__gen__c__Gen* g) { g->global_tmp_count++; - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), 0xfe07, {.d_i32 = g->global_tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), /*100 &int*/0xfe07, {.d_i32 = g->global_tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string v__gen__c__Gen_new_tmp_declaration_name(v__gen__c__Gen* g) { g->tmp_count_declarations++; - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d"), 0xfe07, {.d_i32 = g->tmp_count_declarations}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_d"), /*100 &int*/0xfe07, {.d_i32 = g->tmp_count_declarations}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string v__gen__c__Gen_current_tmp_var(v__gen__c__Gen* g) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), 0xfe07, {.d_i32 = g->tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_t"), /*100 &int*/0xfe07, {.d_i32 = g->tmp_count}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -68412,7 +68604,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts(v__gen__c__Gen* g, Array_v__ast__Stmt } VV_LOCAL_SYMBOL bool v__gen__c__is_noreturn_callexpr(v__ast__Expr expr) { - if ((expr)._typ == 291 /* v.ast.CallExpr */) { + if ((expr)._typ == 292 /* v.ast.CallExpr */) { bool _t1 = (*expr._v__ast__CallExpr).is_noreturn; return _t1; } @@ -68431,28 +68623,28 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts_with_tmp_var(v__gen__c__Gen* g, Array_ if (g->inside_if_optional || g->inside_match_optional) { v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); g->skip_stmt_pos = true; - if ((stmt)._typ == 345 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).typ == _const_v__ast__error_type_idx || ((*stmt._v__ast__ExprStmt).expr)._typ == 317 /* v.ast.None */) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_var}}, {_SLIT(".state = 2;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_var}}, {_SLIT(".err = "), 0, { .d_c = 0 }}}))); + if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).typ == _const_v__ast__error_type_idx || ((*stmt._v__ast__ExprStmt).expr)._typ == 318 /* v.ast.None */) { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(".state = 2;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(".err = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*stmt._v__ast__ExprStmt).expr); v__gen__c__Gen_writeln(g, _SLIT(";")); } else { string styp = v__gen__c__Gen_base_type(g, (*stmt._v__ast__ExprStmt).typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), 0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_stmt(g, stmt); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), 0xfe10, {.d_s = tmp_var}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } } } else { v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); g->skip_stmt_pos = true; bool is_noreturn = false; - if ((stmt)._typ == 345 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { is_noreturn = v__gen__c__is_noreturn_callexpr((*stmt._v__ast__ExprStmt).expr); } if (!is_noreturn) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_stmt(g, stmt); if (!string_contains(strings__Builder_last_n(&g->out, 2), _SLIT(";"))) { @@ -68461,7 +68653,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts_with_tmp_var(v__gen__c__Gen* g, Array_ } } else { v__gen__c__Gen_stmt(g, stmt); - if ((g->inside_if_optional || g->inside_match_optional) && (stmt)._typ == 345 /* v.ast.ExprStmt */) { + if ((g->inside_if_optional || g->inside_match_optional) && (stmt)._typ == 346 /* v.ast.ExprStmt */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } @@ -68477,13 +68669,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts_with_tmp_var(v__gen__c__Gen* g, Array_ } if (g->is_autofree && !g->inside_vweb_tmpl && stmts.len > 0) { v__ast__Stmt stmt = (*(v__ast__Stmt*)/*ee elem_sym */array_get(stmts, 0)); - if ((stmt)._typ != 218 /* v.ast.FnDecl */ && g->inside_ternary == 0) { + if ((stmt)._typ != 219 /* v.ast.FnDecl */ && g->inside_ternary == 0) { v__token__Pos stmt_pos = (*(stmt.pos)); if (stmt_pos.pos == 0) { - if ((stmt)._typ == 355 /* v.ast.Module */) { + if ((stmt)._typ == 356 /* v.ast.Module */) { return; } - if ((stmt)._typ == 345 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { stmt_pos = v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr); } if (stmt_pos.pos == 0) { @@ -68499,7 +68691,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmts_with_tmp_var(v__gen__c__Gen* g, Array_ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_write_v_source_line_info(v__gen__c__Gen* g, v__token__Pos pos) { if (g->inside_ternary == 0 && g->pref->is_vlines && g->is_vlines_enabled) { int nline = pos.line_nr + 1; - string lineinfo = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n#line "), 0xfe07, {.d_i32 = nline}}, {_SLIT(" \""), 0xfe10, {.d_s = g->vlines_path}}, {_SLIT("\""), 0, { .d_c = 0 }}})); + string lineinfo = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n#line "), /*100 &int*/0xfe07, {.d_i32 = nline}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = g->vlines_path}}, {_SLIT("\""), 0, { .d_c = 0 }}})); v__gen__c__Gen_writeln(g, lineinfo); } } @@ -68508,21 +68700,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { if (!g->skip_stmt_pos) { v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); } - if (node._typ == 343 /* v.ast.EmptyStmt */) { + if (node._typ == 344 /* v.ast.EmptyStmt */) { } - else if (node._typ == 335 /* v.ast.AsmStmt */) { + else if (node._typ == 336 /* v.ast.AsmStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__AsmStmt).pos); v__gen__c__Gen_gen_asm_stmt(g, (*node._v__ast__AsmStmt)); } - else if (node._typ == 336 /* v.ast.AssertStmt */) { + else if (node._typ == 337 /* v.ast.AssertStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__AssertStmt).pos); v__gen__c__Gen_gen_assert_stmt(g, (*node._v__ast__AssertStmt)); } - else if (node._typ == 337 /* v.ast.AssignStmt */) { + else if (node._typ == 338 /* v.ast.AssignStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__AssignStmt).pos); v__gen__c__Gen_gen_assign_stmt(g, (*node._v__ast__AssignStmt)); } - else if (node._typ == 338 /* v.ast.Block */) { + else if (node._typ == 339 /* v.ast.Block */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__Block).pos); if ((*node._v__ast__Block).is_unsafe) { v__gen__c__Gen_writeln(g, _SLIT("{ // Unsafe block")); @@ -68532,7 +68724,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { v__gen__c__Gen_stmts(g, (*node._v__ast__Block).stmts); v__gen__c__Gen_writeln(g, _SLIT("}")); } - else if (node._typ == 339 /* v.ast.BranchStmt */) { + else if (node._typ == 340 /* v.ast.BranchStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__BranchStmt).pos); if (((*node._v__ast__BranchStmt).label).len != 0) { v__ast__Stmt** _t2 = (v__ast__Stmt**)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->labeled_loops), &(string[]){(*node._v__ast__BranchStmt).label})); @@ -68545,23 +68737,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { ; if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT(" doesn\'t exist "), 0xfe10, {.d_s = g->file->path}}, {_SLIT(", "), 0xfe10, {.d_s = v__token__Pos_str((*node._v__ast__BranchStmt).pos)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT(" doesn\'t exist "), /*115 &string*/0xfe10, {.d_s = g->file->path}}, {_SLIT(", "), /*115 &v.token.Pos*/0xfe10, {.d_s = v__token__Pos_str((*node._v__ast__BranchStmt).pos)}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } v__ast__Stmt* x = *(v__ast__Stmt**)_t1.data; - if (x->_typ == 346 /* v.ast.ForCStmt */) { + if (x->_typ == 347 /* 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); } } - else if (x->_typ == 347 /* v.ast.ForInStmt */) { + else if (x->_typ == 348 /* v.ast.ForInStmt */) { if (v__ast__Scope_contains((*x->_v__ast__ForInStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } } - else if (x->_typ == 348 /* v.ast.ForStmt */) { + else if (x->_typ == 349 /* v.ast.ForStmt */) { if (v__ast__Scope_contains((*x->_v__ast__ForStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } @@ -68571,23 +68763,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } ; if ((*node._v__ast__BranchStmt).kind == v__token__Kind__key_break) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), 0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT("__break;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT("__break;"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), 0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT("__continue;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__BranchStmt).label}}, {_SLIT("__continue;"), 0, { .d_c = 0 }}}))); } } else { v__ast__Stmt* inner_loop = g->inner_loop; - if (inner_loop->_typ == 346 /* v.ast.ForCStmt */) { + if (inner_loop->_typ == 347 /* v.ast.ForCStmt */) { if (v__ast__Scope_contains((*inner_loop->_v__ast__ForCStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } } - else if (inner_loop->_typ == 347 /* v.ast.ForInStmt */) { + else if (inner_loop->_typ == 348 /* v.ast.ForInStmt */) { if (v__ast__Scope_contains((*inner_loop->_v__ast__ForInStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } } - else if (inner_loop->_typ == 348 /* v.ast.ForStmt */) { + else if (inner_loop->_typ == 349 /* v.ast.ForStmt */) { if (v__ast__Scope_contains((*inner_loop->_v__ast__ForStmt).scope, g->cur_lock.pos.pos)) { v__gen__c__Gen_unlock_locks(g); } @@ -68600,23 +68792,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { ; v__gen__c__Gen_autofree_scope_vars_stop(g, (*node._v__ast__BranchStmt).pos.pos - 1, (*node._v__ast__BranchStmt).pos.line_nr, true, g->branch_parent_pos); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__token__Kind_str((*node._v__ast__BranchStmt).kind)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str((*node._v__ast__BranchStmt).kind)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (node._typ == 341 /* v.ast.ConstDecl */) { + else if (node._typ == 342 /* v.ast.ConstDecl */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__ConstDecl).pos); v__gen__c__Gen_const_decl(g, (*node._v__ast__ConstDecl)); } - else if (node._typ == 340 /* v.ast.ComptimeFor */) { + else if (node._typ == 341 /* v.ast.ComptimeFor */) { v__gen__c__Gen_comptime_for(g, (*node._v__ast__ComptimeFor)); } - else if (node._typ == 342 /* v.ast.DeferStmt */) { + else if (node._typ == 343 /* v.ast.DeferStmt */) { v__ast__DeferStmt defer_stmt = (*node._v__ast__DeferStmt); defer_stmt.ifdef = g->defer_ifdef; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); array_push((array*)&g->defer_stmts, _MOV((v__ast__DeferStmt[]){ defer_stmt })); } - else if (node._typ == 344 /* v.ast.EnumDecl */) { + else if (node._typ == 345 /* v.ast.EnumDecl */) { string enum_name = v__util__no_dots((*node._v__ast__EnumDecl).name); bool is_flag = (*node._v__ast__EnumDecl).is_flag; strings__Builder_writeln(&g->enum_typedefs, _SLIT("typedef enum {")); @@ -68624,7 +68816,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { int cur_enum_offset = 0; for (int i = 0; i < (*node._v__ast__EnumDecl).fields.len; ++i) { v__ast__EnumField field = ((v__ast__EnumField*)(*node._v__ast__EnumDecl).fields.data)[i]; - strings__Builder_write_string(&g->enum_typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = enum_name}}, {_SLIT("__"), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->enum_typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("__"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (field.has_expr) { strings__Builder_write_string(&g->enum_typedefs, _SLIT(" = ")); string expr_str = v__gen__c__Gen_expr_string(g, field.expr); @@ -68633,34 +68825,34 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { cur_enum_offset = 0; } else if (is_flag) { strings__Builder_write_string(&g->enum_typedefs, _SLIT(" = ")); - cur_enum_expr = str_intp(2, _MOV((StrIntpData[]){{_SLIT("1 << "), 0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})); + cur_enum_expr = str_intp(2, _MOV((StrIntpData[]){{_SLIT("1 << "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT0, 0, { .d_c = 0 }}})); strings__Builder_write_string(&g->enum_typedefs, int_literal_str((1 << i))); cur_enum_offset = 0; } - string cur_value = (cur_enum_offset > 0 ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_enum_expr}}, {_SLIT("+"), 0xfe07, {.d_i32 = cur_enum_offset}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (cur_enum_expr)); - strings__Builder_writeln(&g->enum_typedefs, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", // "), 0xfe10, {.d_s = cur_value}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string cur_value = (cur_enum_offset > 0 ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_enum_expr}}, {_SLIT("+"), /*100 &int*/0xfe07, {.d_i32 = cur_enum_offset}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (cur_enum_expr)); + strings__Builder_writeln(&g->enum_typedefs, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", // "), /*115 &string*/0xfe10, {.d_s = cur_value}}, {_SLIT0, 0, { .d_c = 0 }}}))); cur_enum_offset++; } - strings__Builder_writeln(&g->enum_typedefs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), 0xfe10, {.d_s = enum_name}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->enum_typedefs, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 345 /* v.ast.ExprStmt */) { + else if (node._typ == 346 /* v.ast.ExprStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__ExprStmt).pos); bool old_is_void_expr_stmt = g->is_void_expr_stmt; g->is_void_expr_stmt = !(*node._v__ast__ExprStmt).is_expr; - if (!v__ast__Type_alias_eq((*node._v__ast__ExprStmt).typ, _const_v__ast__void_type) && g->expected_cast_type != 0 && ((*node._v__ast__ExprStmt).expr)._typ != 315 /* v.ast.MatchExpr */) { + if (!v__ast__Type_alias_eq((*node._v__ast__ExprStmt).typ, _const_v__ast__void_type) && g->expected_cast_type != 0 && ((*node._v__ast__ExprStmt).expr)._typ != 316 /* v.ast.MatchExpr */) { v__gen__c__Gen_expr_with_cast(g, (*node._v__ast__ExprStmt).expr, (*node._v__ast__ExprStmt).typ, g->expected_cast_type); } else { v__gen__c__Gen_expr(g, (*node._v__ast__ExprStmt).expr); } g->is_void_expr_stmt = old_is_void_expr_stmt; - if (g->inside_ternary == 0 && !g->inside_if_optional && !g->inside_match_optional && !(*node._v__ast__ExprStmt).is_expr && ((*node._v__ast__ExprStmt).expr)._typ != 306 /* v.ast.IfExpr */) { + if (g->inside_ternary == 0 && !g->inside_if_optional && !g->inside_match_optional && !(*node._v__ast__ExprStmt).is_expr && ((*node._v__ast__ExprStmt).expr)._typ != 307 /* v.ast.IfExpr */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } - else if (node._typ == 218 /* v.ast.FnDecl */) { + else if (node._typ == 219 /* v.ast.FnDecl */) { v__gen__c__Gen_fn_decl(g, (*node._v__ast__FnDecl)); } - else if (node._typ == 346 /* v.ast.ForCStmt */) { + else if (node._typ == 347 /* v.ast.ForCStmt */) { int prev_branch_parent_pos = g->branch_parent_pos; g->branch_parent_pos = (*node._v__ast__ForCStmt).pos.pos; v__ast__Stmt* save_inner_loop = g->inner_loop; @@ -68674,7 +68866,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { map_delete(&g->labeled_loops, &(string[]){(*node._v__ast__ForCStmt).label}); g->inner_loop = save_inner_loop; } - else if (node._typ == 347 /* v.ast.ForInStmt */) { + else if (node._typ == 348 /* v.ast.ForInStmt */) { int prev_branch_parent_pos = g->branch_parent_pos; g->branch_parent_pos = (*node._v__ast__ForInStmt).pos.pos; v__ast__Stmt* save_inner_loop = g->inner_loop; @@ -68688,7 +68880,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { map_delete(&g->labeled_loops, &(string[]){(*node._v__ast__ForInStmt).label}); g->inner_loop = save_inner_loop; } - else if (node._typ == 348 /* v.ast.ForStmt */) { + else if (node._typ == 349 /* v.ast.ForStmt */) { int prev_branch_parent_pos = g->branch_parent_pos; g->branch_parent_pos = (*node._v__ast__ForStmt).pos.pos; v__ast__Stmt* save_inner_loop = g->inner_loop; @@ -68702,17 +68894,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { map_delete(&g->labeled_loops, &(string[]){(*node._v__ast__ForStmt).label}); g->inner_loop = save_inner_loop; } - else if (node._typ == 349 /* v.ast.GlobalDecl */) { + else if (node._typ == 350 /* v.ast.GlobalDecl */) { v__gen__c__Gen_global_decl(g, (*node._v__ast__GlobalDecl)); } - else if (node._typ == 350 /* v.ast.GotoLabel */) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoLabel).name)}}, {_SLIT(": {}"), 0, { .d_c = 0 }}}))); + else if (node._typ == 351 /* v.ast.GotoLabel */) { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoLabel).name)}}, {_SLIT(": {}"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 351 /* v.ast.GotoStmt */) { + else if (node._typ == 352 /* v.ast.GotoStmt */) { v__gen__c__Gen_write_v_source_line_info(g, (*node._v__ast__GotoStmt).pos); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), 0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoStmt).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("goto "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoStmt).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 352 /* v.ast.HashStmt */) { + else if (node._typ == 353 /* v.ast.HashStmt */) { int line_nr = (*node._v__ast__HashStmt).pos.line_nr + 1; string ct_condition = _SLIT(""); if ((*node._v__ast__HashStmt).ct_conds.len > 0) { @@ -68727,96 +68919,99 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { ct_condition = string_trim_space(strings__Builder_cut_to(&g->out, ct_condition_start)); } if (string__eq((*node._v__ast__HashStmt).kind, _SLIT("include"))) { - string missing_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Header file "), 0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT(", needed for module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("` was not found."), 0, { .d_c = 0 }}})); + string missing_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Header file "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT(", needed for module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("` was not found."), 0, { .d_c = 0 }}})); if (((*node._v__ast__HashStmt).msg).len != 0) { - missing_message = /*f*/string__plus(missing_message, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = (*node._v__ast__HashStmt).msg}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + missing_message = /*f*/string__plus(missing_message, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).msg}}, {_SLIT("."), 0, { .d_c = 0 }}}))); } else { missing_message = /*f*/string__plus(missing_message, _SLIT(" Please install the corresponding development headers.")); } string guarded_include = v__gen__c__get_guarded_include_text((*node._v__ast__HashStmt).main, missing_message); if (string__eq((*node._v__ast__HashStmt).main, _SLIT(""))) { - guarded_include = str_intp(2, _MOV((StrIntpData[]){{_SLIT("#include "), 0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT0, 0, { .d_c = 0 }}})); + guarded_include = str_intp(2, _MOV((StrIntpData[]){{_SLIT("#include "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT0, 0, { .d_c = 0 }}})); } if (string_contains((*node._v__ast__HashStmt).main, _SLIT(".m"))) { strings__Builder_writeln(&g->definitions, _SLIT("\n")); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// added by module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), 0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), 0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// added by module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), /*115 &string*/0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->definitions, guarded_include); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->definitions, _SLIT("\n")); } else { strings__Builder_writeln(&g->includes, _SLIT("\n")); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->includes, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// added by module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), 0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), 0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// added by module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), /*115 &string*/0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->includes, guarded_include); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->includes, _SLIT("\n")); } } else if (string__eq((*node._v__ast__HashStmt).kind, _SLIT("insert"))) { if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->includes, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// inserted by module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), 0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), 0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(4, _MOV((StrIntpData[]){{_SLIT("// inserted by module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`, file: "), /*115 &string*/0xfe10, {.d_s = os__file_name((*node._v__ast__HashStmt).source_file)}}, {_SLIT(":"), /*100 &int*/0xfe07, {.d_i32 = line_nr}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->includes, (*node._v__ast__HashStmt).val); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } else if (string__eq((*node._v__ast__HashStmt).kind, _SLIT("define"))) { if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// defined by module `"), 0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define "), 0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// defined by module `"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).mod}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__HashStmt).main}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (ct_condition.len > 0) { - strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), 0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->includes, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#endif // $if "), /*115 &string*/0xfe10, {.d_s = ct_condition}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } - else if (node._typ == 353 /* v.ast.Import */) { + else if (node._typ == 354 /* v.ast.Import */) { } - else if (node._typ == 354 /* v.ast.InterfaceDecl */) { + else if (node._typ == 355 /* v.ast.InterfaceDecl */) { v__ast__TypeSymbol* ts = v__ast__Table_sym(g->table, (*node._v__ast__InterfaceDecl).typ); - if (!(/* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ).is_generic) { + if (!(/* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ).is_generic) { for (int _t4 = 0; _t4 < (*node._v__ast__InterfaceDecl).methods.len; ++_t4) { v__ast__FnDecl method = ((v__ast__FnDecl*)(*node._v__ast__InterfaceDecl).methods.data)[_t4]; if (v__ast__Type_has_flag(method.return_type, v__ast__TypeFlag__optional)) { v__gen__c__Gen_register_optional(g, method.return_type); } + if (v__ast__Type_has_flag(method.return_type, v__ast__TypeFlag__result)) { + v__gen__c__Gen_register_result(g, method.return_type); + } } } } - else if (node._typ == 355 /* v.ast.Module */) { + else if (node._typ == 356 /* v.ast.Module */) { g->is_builtin_mod = v__util__module_is_builtin((*node._v__ast__Module).name); g->cur_mod = (*node._v__ast__Module); } - else if (node._typ == 316 /* v.ast.NodeError */) { + else if (node._typ == 317 /* v.ast.NodeError */) { } - else if (node._typ == 356 /* v.ast.Return */) { + else if (node._typ == 357 /* v.ast.Return */) { v__gen__c__Gen_return_stmt(g, (*node._v__ast__Return)); } - else if (node._typ == 357 /* v.ast.SqlStmt */) { + else if (node._typ == 358 /* v.ast.SqlStmt */) { v__gen__c__Gen_sql_stmt(g, (*node._v__ast__SqlStmt)); } - else if (node._typ == 358 /* v.ast.StructDecl */) { + else if (node._typ == 359 /* v.ast.StructDecl */) { string name = ((*node._v__ast__StructDecl).language == v__ast__Language__c ? (v__util__no_dots((*node._v__ast__StructDecl).name)) : (string__eq((*node._v__ast__StructDecl).name, _SLIT("array")) || string__eq((*node._v__ast__StructDecl).name, _SLIT("string"))) ? ((*node._v__ast__StructDecl).name) : (v__gen__c__c_name((*node._v__ast__StructDecl).name))); if ((*node._v__ast__StructDecl).language == v__ast__Language__c) { return; } if ((*node._v__ast__StructDecl).is_union) { - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef union "), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef union "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (node._typ == 282 /* v.ast.TypeDecl */) { + else if (node._typ == 283 /* v.ast.TypeDecl */) { if (!g->pref->skip_unused) { v__gen__c__Gen_writeln(g, _SLIT("// TypeDecl")); } @@ -68826,7 +69021,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { array_delete_last(&g->stmt_path_pos); } if (g->is_autofree) { - if ((node)._typ != 218 /* v.ast.FnDecl */) { + if ((node)._typ != 219 /* v.ast.FnDecl */) { } } } @@ -68835,7 +69030,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_defer_stmts(v__gen__c__Gen* g) { for (int i = g->defer_stmts.len - 1; i >= 0; i--) { v__ast__DeferStmt defer_stmt = (*(v__ast__DeferStmt*)/*ee elem_sym */array_get(g->defer_stmts, i)); v__gen__c__Gen_writeln(g, _SLIT("// Defer begin")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; if (defer_stmt.ifdef.len > 0) { v__gen__c__Gen_writeln(g, defer_stmt.ifdef); @@ -68859,7 +69054,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_sumtype_casting_fn(v__gen__c__Gen* g, int i = (got | ((int)(((u32)(exp)) << 16U))); string got_cname = v__ast__Table_sym(g->table, got)->cname; string exp_cname = v__ast__Table_sym(g->table, exp)->cname; - string fn_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = got_cname}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = exp_cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fn_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = exp_cname}}, {_SLIT0, 0, { .d_c = 0 }}})); if (got == exp || (*(bool*)map_get(ADDR(map, g->sumtype_definitions), &(int[]){i}, &(bool[]){ 0 }))) { string _t1 = fn_name; return _t1; @@ -68878,8 +69073,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, string got_cname = got_sym->cname; string exp_cname = exp_sym->cname; strings__Builder sb = strings__new_builder(128); - strings__Builder_writeln(&sb, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static inline "), 0xfe10, {.d_s = exp_cname}}, {_SLIT(" "), 0xfe10, {.d_s = fun.fn_name}}, {_SLIT("("), 0xfe10, {.d_s = got_cname}}, {_SLIT("* x) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = got_cname}}, {_SLIT("* ptr = memdup(x, sizeof("), 0xfe10, {.d_s = got_cname}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static inline "), /*115 &string*/0xfe10, {.d_s = exp_cname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fun.fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT("* x) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT("* ptr = memdup(x, sizeof("), /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); Array_Array_v__ast__Type _t1 = v__ast__Table_get_embeds(g->table, got_sym, ((v__ast__GetEmbedsOptions){.preceding = __new_array(0, 0, sizeof(v__ast__Type)),})); for (int _t2 = 0; _t2 < _t1.len; ++_t2) { Array_v__ast__Type embed_hierarchy = ((Array_v__ast__Type*)_t1.data)[_t2]; @@ -68896,11 +69091,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, } accessor = /*f*/string__plus(accessor, embed_name); } - strings__Builder_writeln(&sb, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = embed_cname}}, {_SLIT("* "), 0xfe10, {.d_s = embed_name}}, {_SLIT("_ptr = memdup("), 0xfe10, {.d_s = accessor}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = embed_cname}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = embed_cname}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = embed_name}}, {_SLIT("_ptr = memdup("), /*115 &string*/0xfe10, {.d_s = accessor}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = embed_cname}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } - strings__Builder_write_string(&sb, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\treturn ("), 0xfe10, {.d_s = exp_cname}}, {_SLIT("){ ._"), 0xfe10, {.d_s = got_cname}}, {_SLIT(" = ptr, ._typ = "), 0xfe10, {.d_s = v__gen__c__Gen_type_sidx(g, got)}}, {_SLIT0, 0, { .d_c = 0 }}}))); - for (int _t3 = 0; _t3 < (/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ).fields.len; ++_t3) { - v__ast__StructField field = ((v__ast__StructField*)(/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ).fields.data)[_t3]; + strings__Builder_write_string(&sb, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\treturn ("), /*115 &string*/0xfe10, {.d_s = exp_cname}}, {_SLIT("){ ._"), /*115 &string*/0xfe10, {.d_s = got_cname}}, {_SLIT(" = ptr, ._typ = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_type_sidx(g, got)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + for (int _t3 = 0; _t3 < (/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ).fields.len; ++_t3) { + v__ast__StructField field = ((v__ast__StructField*)(/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ).fields.data)[_t3]; string ptr = _SLIT("ptr"); string type_cname = got_cname; Option_multi_return_v__ast__StructField_Array_v__ast__Type _t4 = v__ast__Table_find_field_from_embeds(g->table, got_sym, field.name); @@ -68909,18 +69104,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t4.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr = {0},.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_65944 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data); - Array_v__ast__Type embed_types = mr_65944.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_67520 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data); + Array_v__ast__Type embed_types = mr_67520.arg1; if (embed_types.len > 0) { v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types))); - ptr = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT("_ptr"), 0, { .d_c = 0 }}})); + ptr = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT("_ptr"), 0, { .d_c = 0 }}})); type_cname = embed_sym->cname; } string field_styp = v__gen__c__Gen_typ(g, field.typ); if (got_sym->kind == v__ast__Kind__sum_type || got_sym->kind == v__ast__Kind__interface_) { - strings__Builder_write_string(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", ."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = ptr->"), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", ."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = ptr->"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&sb, str_intp(7, _MOV((StrIntpData[]){{_SLIT(", ."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = ("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)"), 0xfe10, {.d_s = ptr}}, {_SLIT(" + __offsetof_ptr("), 0xfe10, {.d_s = ptr}}, {_SLIT(", "), 0xfe10, {.d_s = type_cname}}, {_SLIT(", "), 0xfe10, {.d_s = field.name}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(7, _MOV((StrIntpData[]){{_SLIT(", ."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)"), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT(" + __offsetof_ptr("), /*115 &string*/0xfe10, {.d_s = ptr}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = type_cname}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&sb, _SLIT("};\n}")); @@ -68930,14 +69125,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, VV_LOCAL_SYMBOL void v__gen__c__Gen_call_cfn_for_casting_expr(v__gen__c__Gen* g, string fname, v__ast__Expr expr, bool exp_is_ptr, string exp_styp, bool got_is_ptr, string got_styp) { int rparen_n = 1; if (exp_is_ptr) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), 0xfe10, {.d_s = exp_styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("HEAP("), /*115 &string*/0xfe10, {.d_s = exp_styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); rparen_n++; } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (!got_is_ptr) { - if (!v__ast__Expr_is_lvalue(expr) || ((expr)._typ == 305 /* v.ast.Ident */ && v__ast__ScopeObject_is_simple_define_const((/* as */ *(v__ast__Ident*)__as_cast((expr)._v__ast__Ident,(expr)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ).obj))) { + if (!v__ast__Expr_is_lvalue(expr) || ((expr)._typ == 306 /* v.ast.Ident */ && v__ast__ScopeObject_is_simple_define_const((/* as */ *(v__ast__Ident*)__as_cast((expr)._v__ast__Ident,(expr)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ).obj))) { string promotion_macro_name = (string_contains(fname, _SLIT("_to_sumtype_")) ? (_SLIT("ADDR")) : (_SLIT("HEAP"))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = promotion_macro_name}}, {_SLIT("("), 0xfe10, {.d_s = got_styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = promotion_macro_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); rparen_n += 2; } else { v__gen__c__Gen_write(g, _SLIT("&")); @@ -68963,12 +69158,12 @@ 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 == 473 /* 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 == 330 /* v.ast.StructInit */ && !v__ast__Type_is_ptr(got_type)) { + if ((exp_sym->info)._typ == 474 /* 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 == 331 /* 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); string exp_styp = exp_sym->cname; - string fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), 0xfe10, {.d_s = got_styp}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}})); if ((*exp_sym->info._v__ast__Interface).is_generic) { fname = v__gen__c__Gen_generic_fn_name(g, (*exp_sym->info._v__ast__Interface).concrete_types, fname, false); } @@ -68977,14 +69172,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex } else { string got_styp = v__gen__c__Gen_cc_type(g, got_type, true); bool got_is_shared = v__ast__Type_has_flag(got_type, v__ast__TypeFlag__shared_f); - string exp_styp = (got_is_shared ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = exp_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (exp_sym->cname)); - string fname = (got_is_shared ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("I___shared__"), 0xfe10, {.d_s = got_styp}}, {_SLIT("_to_shared_Interface_"), 0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), 0xfe10, {.d_s = got_styp}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string exp_styp = (got_is_shared ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = exp_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (exp_sym->cname)); + string fname = (got_is_shared ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("I___shared__"), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT("_to_shared_Interface_"), /*115 &string*/0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = exp_styp}}, {_SLIT0, 0, { .d_c = 0 }}})))); sync__RwMutex_lock(&g->referenced_fns->mtx); /*lock*/ { map_set(&g->referenced_fns->val, &(string[]){fname}, &(bool[]) { true }); } sync__RwMutex_unlock(&g->referenced_fns->mtx);; - fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), 0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(exp_sym)}}}))}}, {_SLIT("*/"), 0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}})); + fname = str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(exp_sym)}}}))}}, {_SLIT("*/"), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}})); if ((*exp_sym->info._v__ast__Interface).is_generic) { fname = v__gen__c__Gen_generic_fn_name(g, (*exp_sym->info._v__ast__Interface).concrete_types, fname, false); } @@ -69004,7 +69199,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex if (v__ast__Table_sumtype_has_variant(g->table, expected_deref_type, got_deref_type, false)) { bool is_already_sum_type = false; v__ast__Scope* scope = v__ast__Scope_innermost(g->file->scope, v__ast__Expr_pos(expr).pos); - if ((expr)._typ == 305 /* v.ast.Ident */) { + if ((expr)._typ == 306 /* v.ast.Ident */) { Option_v__ast__Var_ptr _t1; if (_t1 = v__ast__Scope_find_var(scope, (*expr._v__ast__Ident).name), _t1.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t1.data; @@ -69012,7 +69207,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex is_already_sum_type = true; } } - } else if ((expr)._typ == 325 /* v.ast.SelectorExpr */) { + } else if ((expr)._typ == 326 /* v.ast.SelectorExpr */) { Option_v__ast__ScopeStructField _t2; if (_t2 = v__ast__Scope_find_struct_field(scope, v__ast__Expr_str((*expr._v__ast__SelectorExpr).expr), (*expr._v__ast__SelectorExpr).expr_type, (*expr._v__ast__SelectorExpr).field_name), _t2.state == 0) { is_already_sum_type = true; @@ -69022,7 +69217,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex g->prevent_sum_type_unwrapping_once = true; v__gen__c__Gen_expr(g, expr); } else { - if ((unwrapped_got_sym->info)._typ == 468 /* v.ast.Aggregate */) { + if ((unwrapped_got_sym->info)._typ == 469 /* v.ast.Aggregate */) { unwrapped_got_type = (*(v__ast__Type*)/*ee elem_sym */array_get((*unwrapped_got_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); unwrapped_got_sym = v__ast__Table_sym(g->table, unwrapped_got_type); } @@ -69040,17 +69235,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex VUNREACHABLE(); } if (exp_sym->kind == v__ast__Kind__array) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else if (exp_sym->kind == v__ast__Kind__map) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), 0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } bool old_is_shared = g->is_shared; g->is_shared = false; v__gen__c__Gen_expr(g, expr); g->is_shared = old_is_shared; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); return; } else if (v__ast__Type_has_flag(got_type_raw, v__ast__TypeFlag__shared_f) && !v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__shared_f)) { if (v__ast__Type_is_ptr(expected_type)) { @@ -69060,7 +69255,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex v__gen__c__Gen_write(g, _SLIT("->val")); return; } - if (got_is_ptr && !expected_is_ptr && neither_void && exp_sym->kind != v__ast__Kind__placeholder && (expr)._typ != 309 /* v.ast.InfixExpr */) { + if (got_is_ptr && !expected_is_ptr && neither_void && exp_sym->kind != v__ast__Kind__placeholder && (expr)._typ != 310 /* v.ast.InfixExpr */) { v__ast__Type got_deref_type = v__ast__Type_deref(got_type); v__ast__TypeSymbol* deref_sym = v__ast__Table_sym(g->table, got_deref_type); bool deref_will_match = (v__ast__Type_alias_eq(expected_type, got_type) || v__ast__Type_alias_eq(expected_type, got_deref_type) || v__ast__Type_alias_eq(expected_type, deref_sym->parent_idx)); @@ -69069,11 +69264,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr_with_cast(v__gen__c__Gen* g, v__ast__Ex v__gen__c__Gen_write(g, _SLIT("*")); } } - if (v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional) && (expr)._typ == 317 /* v.ast.None */) { + if (v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional) && (expr)._typ == 318 /* v.ast.None */) { v__gen__c__Gen_gen_optional_error(g, expected_type, expr); return; } - if ((expr)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((expr)._typ == 311 /* v.ast.IntegerLiteral */) { if ((v__ast__Type_alias_eq(expected_type, _const_v__ast__u64_type) || v__ast__Type_alias_eq(expected_type, _const_v__ast__u32_type) || v__ast__Type_alias_eq(expected_type, _const_v__ast__u16_type)) && string_at((*expr._v__ast__IntegerLiteral).val, 0) != '-') { v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT("U")); @@ -69124,7 +69319,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_attrs(v__gen__c__Gen* g, Array_v__ast__A } for (int _t1 = 0; _t1 < attrs.len; ++_t1) { v__ast__Attr attr = ((v__ast__Attr*)attrs.data)[_t1]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Attr: ["), 0xfe10, {.d_s = attr.name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Attr: ["), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); } } @@ -69157,7 +69352,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_asm_stmt(v__gen__c__Gen* g, v__ast__AsmS } for (int i = 0; i < _v_template.args.len; ++i) { v__ast__AsmArg arg = ((v__ast__AsmArg*)_v_template.args.data)[i]; - if (stmt.arch == v__pref__Arch__amd64 && (string__eq(_v_template.name, _SLIT("call")) || string_at(_v_template.name, 0) == 'j') && (arg)._typ == 360 /* v.ast.AsmRegister */) { + if (stmt.arch == v__pref__Arch__amd64 && (string__eq(_v_template.name, _SLIT("call")) || string_at(_v_template.name, 0) == 'j') && (arg)._typ == 361 /* v.ast.AsmRegister */) { v__gen__c__Gen_write(g, _SLIT("*")); } v__gen__c__Gen_asm_arg(g, arg, stmt); @@ -69209,7 +69404,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_asm_stmt(v__gen__c__Gen* g, v__ast__AsmS } VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg arg, v__ast__AsmStmt stmt) { - if (arg._typ == 436 /* v.ast.AsmAlias */) { + if (arg._typ == 437 /* v.ast.AsmAlias */) { string name = (*arg._v__ast__AsmAlias).name; bool _t1 = (Array_string_contains(stmt.local_labels, name) || Array_string_contains(stmt.global_labels, name) || Array_string_contains(g->file->global_labels, name) || stmt.is_basic); Array_string _t3 = {0}; @@ -69238,37 +69433,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar } } if ( _t1 || ( _t2 && !Array_string_contains(_t5, name))) { - string asm_formatted_name = (Array_string_contains(stmt.global_labels, name) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("%l["), 0xfe10, {.d_s = name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))) : (name)); + string asm_formatted_name = (Array_string_contains(stmt.global_labels, name) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("%l["), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))) : (name)); v__gen__c__Gen_write(g, asm_formatted_name); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%["), 0xfe10, {.d_s = name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%["), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); } } - else if (arg._typ == 294 /* v.ast.CharLiteral */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = (*arg._v__ast__CharLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + else if (arg._typ == 295 /* v.ast.CharLiteral */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__CharLiteral).val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); } - else if (arg._typ == 310 /* v.ast.IntegerLiteral */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), 0xfe10, {.d_s = (*arg._v__ast__IntegerLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + else if (arg._typ == 311 /* v.ast.IntegerLiteral */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__IntegerLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (arg._typ == 303 /* v.ast.FloatLiteral */) { + else if (arg._typ == 304 /* v.ast.FloatLiteral */) { if (g->pref->nofloat) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), 0xfe07, {.d_i32 = string_int((*arg._v__ast__FloatLiteral).val)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), /*100 &int*/0xfe07, {.d_i32 = string_int((*arg._v__ast__FloatLiteral).val)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), 0xfe10, {.d_s = (*arg._v__ast__FloatLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__FloatLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } - else if (arg._typ == 289 /* v.ast.BoolLiteral */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), 0xfe10, {.d_s = bool_str((*arg._v__ast__BoolLiteral).val)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + else if (arg._typ == 290 /* v.ast.BoolLiteral */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("$"), /*115 &string*/0xfe10, {.d_s = bool_str((*arg._v__ast__BoolLiteral).val)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (arg._typ == 360 /* v.ast.AsmRegister */) { + else if (arg._typ == 361 /* v.ast.AsmRegister */) { if (!stmt.is_basic) { v__gen__c__Gen_write(g, _SLIT("%")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%"), 0xfe10, {.d_s = (*arg._v__ast__AsmRegister).name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__AsmRegister).name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (arg._typ == 435 /* v.ast.AsmAddressing */) { + else if (arg._typ == 436 /* v.ast.AsmAddressing */) { if (((*arg._v__ast__AsmAddressing).segment).len != 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%%"), 0xfe10, {.d_s = (*arg._v__ast__AsmAddressing).segment}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("%%"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__AsmAddressing).segment}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } v__ast__AsmArg base = (*arg._v__ast__AsmAddressing).base; v__ast__AsmArg index = (*arg._v__ast__AsmAddressing).index; @@ -69297,19 +69492,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar } case v__ast__AddressingMode__index_times_scale_plus_displacement: { - if ((displacement)._typ == 437 /* v.ast.AsmDisp */) { + if ((displacement)._typ == 438 /* v.ast.AsmDisp */) { v__gen__c__Gen_asm_arg(g, displacement, stmt); v__gen__c__Gen_write(g, _SLIT("(, ")); - } else if ((displacement)._typ == 360 /* v.ast.AsmRegister */) { + } else if ((displacement)._typ == 361 /* v.ast.AsmRegister */) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_asm_arg(g, displacement, stmt); v__gen__c__Gen_write(g, _SLIT(",")); } else { - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.AsmArg */ v_typeof_sumtype_v__ast__AsmArg( (displacement)._typ ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &string*/0xfe10, {.d_s = charptr_vstring_literal( /* v.ast.AsmArg */ v_typeof_sumtype_v__ast__AsmArg( (displacement)._typ ))}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__gen__c__Gen_asm_arg(g, index, stmt); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(","), 0xfe07, {.d_i32 = scale}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(","), /*100 &int*/0xfe07, {.d_i32 = scale}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); break; } case v__ast__AddressingMode__base_plus_index_plus_displacement: @@ -69329,7 +69524,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar v__gen__c__Gen_asm_arg(g, base, stmt); v__gen__c__Gen_write(g, _SLIT(",")); v__gen__c__Gen_asm_arg(g, index, stmt); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(","), 0xfe07, {.d_i32 = scale}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(","), /*100 &int*/0xfe07, {.d_i32 = scale}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); break; } case v__ast__AddressingMode__rip_plus_displacement: @@ -69349,7 +69544,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar } ; } - else if (arg._typ == 437 /* v.ast.AsmDisp */) { + else if (arg._typ == 438 /* v.ast.AsmDisp */) { v__gen__c__Gen_write(g, (*arg._v__ast__AsmDisp).val); } else if (arg._typ == 20 /* string */) { @@ -69362,9 +69557,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_asm_ios(v__gen__c__Gen* g, Array_v__ast_ for (int i = 0; i < ios.len; ++i) { v__ast__AsmIO io = ((v__ast__AsmIO*)ios.data)[i]; if ((io.alias).len != 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = io.alias}}, {_SLIT("] "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = io.alias}}, {_SLIT("] "), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = io.constraint}}, {_SLIT("\" ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = io.constraint}}, {_SLIT("\" ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, io.expr); v__gen__c__Gen_write(g, _SLIT(")")); if (i + 1 < ios.len) { @@ -69382,12 +69577,12 @@ VV_LOCAL_SYMBOL string v__gen__c__cnewlines(string s) { VV_LOCAL_SYMBOL void v__gen__c__Gen_write_fn_ptr_decl(v__gen__c__Gen* g, v__ast__FnType* func, string ptr_name) { string ret_styp = v__gen__c__Gen_typ(g, func->func.return_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*"), 0xfe10, {.d_s = ptr_name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = ptr_name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); int arg_len = func->func.params.len; for (int i = 0; i < func->func.params.len; ++i) { v__ast__Param arg = ((v__ast__Param*)func->func.params.data)[i]; string arg_styp = v__gen__c__Gen_typ(g, arg.typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_styp}}, {_SLIT(" "), 0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i < arg_len - 1) { v__gen__c__Gen_write(g, _SLIT(", ")); } @@ -69419,7 +69614,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_ternary_name(v__gen__c__Gen* g, string } VV_LOCAL_SYMBOL bool v__gen__c__Gen_gen_clone_assignment(v__gen__c__Gen* g, v__ast__Expr val, v__ast__Type typ, bool add_eq) { - if ((val)._typ != 305 /* v.ast.Ident */ && (val)._typ != 325 /* v.ast.SelectorExpr */) { + if ((val)._typ != 306 /* v.ast.Ident */ && (val)._typ != 326 /* v.ast.SelectorExpr */) { bool _t1 = false; return _t1; } @@ -69431,18 +69626,18 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_gen_clone_assignment(v__gen__c__Gen* g, v__a if (right_sym->kind == v__ast__Kind__array) { string shared_styp = v__gen__c__Gen_typ(g, v__ast__Type_set_nr_muls(typ, 0)); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT(" array_clone_static_to_depth(")); v__gen__c__Gen_expr(g, val); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { v__gen__c__Gen_write(g, _SLIT("->val")); } - v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((right_sym->info)._v__ast__Array,(right_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ).elem_type; + v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((right_sym->info)._v__ast__Array,(right_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ).elem_type; int array_depth = v__gen__c__Gen_get_array_depth(g, elem_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe07, {.d_i32 = array_depth}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = array_depth}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } else if (right_sym->kind == v__ast__Kind__string) { v__gen__c__Gen_write(g, _SLIT(" string_clone_static(")); @@ -69488,7 +69683,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_scope_vars2(v__gen__c__Gen* g, v__a } if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} v__ast__ScopeObject obj = (*(v__ast__ScopeObject*)DenseArray_value(&_t1.key_values, _t2)); - if (obj._typ == 363 /* v.ast.Var */) { + if (obj._typ == 364 /* v.ast.Var */) { ; if (string__eq((*obj._v__ast__Var).name, g->returned_var_name)) { ; @@ -69544,7 +69739,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_variable(v__gen__c__Gen* g, v__ast_ return; } if (sym->kind == v__ast__Kind__string) { - if (v.expr._typ == 329 /* v.ast.StringLiteral */) { + if (v.expr._typ == 330 /* v.ast.StringLiteral */) { ; } @@ -69601,9 +69796,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_var_call(v__gen__c__Gen* g, string return; } if (v.is_auto_heap) { - strings__Builder_writeln(&af, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = free_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = v__gen__c__c_name(v.name)}}, {_SLIT("); // autofreed heap var "), 0xfe10, {.d_s = g->cur_mod.name}}, {_SLIT(" "), 0xfe10, {.d_s = g->is_builtin_mod ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&af, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = free_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(v.name)}}, {_SLIT("); // autofreed heap var "), /*115 &string*/0xfe10, {.d_s = g->cur_mod.name}}, {_SLIT(" "), /*115 &bool*/0xfe10, {.d_s = g->is_builtin_mod ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&af, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = free_fn_name}}, {_SLIT("(&"), 0xfe10, {.d_s = v__gen__c__c_name(v.name)}}, {_SLIT("); // autofreed var "), 0xfe10, {.d_s = g->cur_mod.name}}, {_SLIT(" "), 0xfe10, {.d_s = g->is_builtin_mod ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&af, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = free_fn_name}}, {_SLIT("(&"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(v.name)}}, {_SLIT("); // autofreed var "), /*115 &string*/0xfe10, {.d_s = g->cur_mod.name}}, {_SLIT(" "), /*115 &bool*/0xfe10, {.d_s = g->is_builtin_mod ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } array_push((array*)&g->autofree_scope_stmts, _MOV((string[]){ string_clone(strings__Builder_str(&af)) })); @@ -69712,36 +69907,36 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) g->discard_or_result = false; } v__ast__Expr node = node_; - if (node._typ == 298 /* v.ast.ComptimeType */) { + if (node._typ == 299 /* v.ast.ComptimeType */) { v__gen__c__Gen_error(g, _SLIT("g.expr(): Unhandled ComptimeType"), (*node._v__ast__ComptimeType).pos); VUNREACHABLE(); } - else if (node._typ == 301 /* v.ast.EmptyExpr */) { + else if (node._typ == 302 /* v.ast.EmptyExpr */) { v__gen__c__Gen_error(g, _SLIT("g.expr(): unhandled EmptyExpr"), ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,})); VUNREACHABLE(); } - else if (node._typ == 283 /* v.ast.AnonFn */) { + else if (node._typ == 284 /* v.ast.AnonFn */) { v__gen__c__Gen_gen_anon_fn(g, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); } - else if (node._typ == 284 /* v.ast.ArrayDecompose */) { + else if (node._typ == 285 /* v.ast.ArrayDecompose */) { v__gen__c__Gen_expr(g, (*node._v__ast__ArrayDecompose).expr); } - else if (node._typ == 285 /* v.ast.ArrayInit */) { + else if (node._typ == 286 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*node._v__ast__ArrayInit)); } - else if (node._typ == 286 /* v.ast.AsCast */) { + else if (node._typ == 287 /* v.ast.AsCast */) { v__gen__c__Gen_as_cast(g, (*node._v__ast__AsCast)); } - else if (node._typ == 287 /* v.ast.Assoc */) { + else if (node._typ == 288 /* v.ast.Assoc */) { v__gen__c__Gen_assoc(g, (*node._v__ast__Assoc)); } - else if (node._typ == 288 /* v.ast.AtExpr */) { + else if (node._typ == 289 /* v.ast.AtExpr */) { v__gen__c__Gen_comptime_at(g, (*node._v__ast__AtExpr)); } - else if (node._typ == 289 /* v.ast.BoolLiteral */) { + else if (node._typ == 290 /* v.ast.BoolLiteral */) { v__gen__c__Gen_write(g, bool_str((*node._v__ast__BoolLiteral).val)); } - else if (node._typ == 291 /* v.ast.CallExpr */) { + else if (node._typ == 292 /* v.ast.CallExpr */) { v__ast__Type ret_type = ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__absent ? ((*node._v__ast__CallExpr).return_type) : (v__ast__Type_clear_flag((*node._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional))); string shared_styp = _SLIT(""); if (g->is_shared && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__shared_f)) { @@ -69749,11 +69944,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__ast__Type shared_typ = v__ast__Type_set_flag(ret_type, v__ast__TypeFlag__shared_f); shared_styp = v__gen__c__Gen_typ(g, shared_typ); if (ret_sym->kind == v__ast__Kind__array) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else if (ret_sym->kind == v__ast__Kind__map) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), 0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } } int last_stmt_pos = (*(int*)array_last(g->stmt_path_pos)); @@ -69766,16 +69961,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) g->strs_to_free0 = __new_array_with_default(0, 0, sizeof(string), 0); } if (g->is_shared && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__shared_f)) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } - else if (node._typ == 292 /* v.ast.CastExpr */) { + else if (node._typ == 293 /* v.ast.CastExpr */) { v__gen__c__Gen_cast_expr(g, (*node._v__ast__CastExpr)); } - else if (node._typ == 293 /* v.ast.ChanInit */) { + else if (node._typ == 294 /* v.ast.ChanInit */) { string elem_typ_str = v__gen__c__Gen_typ(g, (*node._v__ast__ChanInit).elem_type); string noscan = v__gen__c__Gen_check_noscan(g, (*node._v__ast__ChanInit).elem_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__new_channel_st"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__new_channel_st"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if ((*node._v__ast__ChanInit).has_cap) { v__gen__c__Gen_expr(g, (*node._v__ast__ChanInit).cap_expr); } else { @@ -69785,52 +69980,52 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_write(g, elem_typ_str); v__gen__c__Gen_write(g, _SLIT("))")); } - else if (node._typ == 294 /* v.ast.CharLiteral */) { + else if (node._typ == 295 /* v.ast.CharLiteral */) { v__gen__c__Gen_char_literal(g, (*node._v__ast__CharLiteral)); } - else if (node._typ == 295 /* v.ast.Comment */) { + else if (node._typ == 296 /* v.ast.Comment */) { } - else if (node._typ == 296 /* v.ast.ComptimeCall */) { + else if (node._typ == 297 /* v.ast.ComptimeCall */) { v__gen__c__Gen_comptime_call(g, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); } - else if (node._typ == 297 /* v.ast.ComptimeSelector */) { + else if (node._typ == 298 /* v.ast.ComptimeSelector */) { v__gen__c__Gen_comptime_selector(g, (*node._v__ast__ComptimeSelector)); } - else if (node._typ == 299 /* v.ast.ConcatExpr */) { + else if (node._typ == 300 /* v.ast.ConcatExpr */) { v__gen__c__Gen_concat_expr(g, (*node._v__ast__ConcatExpr)); } - else if (node._typ == 290 /* v.ast.CTempVar */) { + else if (node._typ == 291 /* v.ast.CTempVar */) { v__gen__c__Gen_write(g, (*node._v__ast__CTempVar).name); } - else if (node._typ == 300 /* v.ast.DumpExpr */) { + else if (node._typ == 301 /* v.ast.DumpExpr */) { v__gen__c__Gen_dump_expr(g, (*node._v__ast__DumpExpr)); } - else if (node._typ == 302 /* v.ast.EnumVal */) { + else if (node._typ == 303 /* v.ast.EnumVal */) { v__gen__c__Gen_enum_val(g, (*node._v__ast__EnumVal)); } - else if (node._typ == 303 /* v.ast.FloatLiteral */) { + else if (node._typ == 304 /* v.ast.FloatLiteral */) { if (g->pref->nofloat) { v__gen__c__Gen_write(g, int_str(string_int((*node._v__ast__FloatLiteral).val))); } else { v__gen__c__Gen_write(g, (*node._v__ast__FloatLiteral).val); } } - else if (node._typ == 304 /* v.ast.GoExpr */) { + else if (node._typ == 305 /* v.ast.GoExpr */) { v__gen__c__Gen_go_expr(g, (*node._v__ast__GoExpr)); } - else if (node._typ == 305 /* v.ast.Ident */) { + else if (node._typ == 306 /* v.ast.Ident */) { v__gen__c__Gen_ident(g, (*node._v__ast__Ident)); } - else if (node._typ == 306 /* v.ast.IfExpr */) { + else if (node._typ == 307 /* v.ast.IfExpr */) { v__gen__c__Gen_if_expr(g, (*node._v__ast__IfExpr)); } - else if (node._typ == 307 /* v.ast.IfGuardExpr */) { + else if (node._typ == 308 /* v.ast.IfGuardExpr */) { v__gen__c__Gen_write(g, _SLIT("/* guard */")); } - else if (node._typ == 308 /* v.ast.IndexExpr */) { + else if (node._typ == 309 /* v.ast.IndexExpr */) { v__gen__c__Gen_index_expr(g, (*node._v__ast__IndexExpr)); } - else if (node._typ == 309 /* v.ast.InfixExpr */) { + else if (node._typ == 310 /* v.ast.InfixExpr */) { if ((*node._v__ast__InfixExpr).op == v__token__Kind__left_shift || (*node._v__ast__InfixExpr).op == v__token__Kind__plus_assign || (*node._v__ast__InfixExpr).op == v__token__Kind__minus_assign) { g->inside_map_infix = true; v__gen__c__Gen_infix_expr(g, (*node._v__ast__InfixExpr)); @@ -69839,7 +70034,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_infix_expr(g, (*node._v__ast__InfixExpr)); } } - else if (node._typ == 310 /* v.ast.IntegerLiteral */) { + else if (node._typ == 311 /* v.ast.IntegerLiteral */) { if (string_starts_with((*node._v__ast__IntegerLiteral).val, _SLIT("0o"))) { v__gen__c__Gen_write(g, _SLIT("0")); v__gen__c__Gen_write(g, string_substr((*node._v__ast__IntegerLiteral).val, 2, ((*node._v__ast__IntegerLiteral).val).len)); @@ -69850,18 +70045,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_write(g, (*node._v__ast__IntegerLiteral).val); } } - else if (node._typ == 311 /* v.ast.IsRefType */) { + else if (node._typ == 312 /* v.ast.IsRefType */) { v__ast__Type typ = (v__ast__Type_alias_eq((*node._v__ast__IsRefType).typ, g->field_data_type) ? (g->comptime_for_field_value.typ) : ((*node._v__ast__IsRefType).typ)); v__ast__Type node_typ = v__gen__c__Gen_unwrap_generic(g, typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node_typ); if (sym->language == v__ast__Language__v && (sym->kind == v__ast__Kind__placeholder || sym->kind == v__ast__Kind__any)) { - v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__IsRefType).pos); + v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__IsRefType).pos); VUNREACHABLE(); } bool is_ref_type = v__gen__c__Gen_contains_ptr(g, node_typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/*IsRefType*/ "), 0xfe10, {.d_s = is_ref_type ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/*IsRefType*/ "), /*115 &bool*/0xfe10, {.d_s = is_ref_type ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (node._typ == 312 /* v.ast.Likely */) { + else if (node._typ == 313 /* v.ast.Likely */) { if ((*node._v__ast__Likely).is_likely) { v__gen__c__Gen_write(g, _SLIT("_likely_")); } else { @@ -69871,34 +70066,34 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_expr(g, (*node._v__ast__Likely).expr); v__gen__c__Gen_write(g, _SLIT(")")); } - else if (node._typ == 313 /* v.ast.LockExpr */) { + else if (node._typ == 314 /* v.ast.LockExpr */) { v__gen__c__Gen_lock_expr(g, (*node._v__ast__LockExpr)); } - else if (node._typ == 314 /* v.ast.MapInit */) { + else if (node._typ == 315 /* v.ast.MapInit */) { v__gen__c__Gen_map_init(g, (*node._v__ast__MapInit)); } - else if (node._typ == 315 /* v.ast.MatchExpr */) { + else if (node._typ == 316 /* v.ast.MatchExpr */) { v__gen__c__Gen_match_expr(g, (*node._v__ast__MatchExpr)); } - else if (node._typ == 316 /* v.ast.NodeError */) { + else if (node._typ == 317 /* v.ast.NodeError */) { } - else if (node._typ == 317 /* v.ast.None */) { + else if (node._typ == 318 /* v.ast.None */) { v__gen__c__Gen_write(g, _SLIT("_const_none__")); } - else if (node._typ == 318 /* v.ast.OffsetOf */) { + else if (node._typ == 319 /* v.ast.OffsetOf */) { string styp = v__gen__c__Gen_typ(g, (*node._v__ast__OffsetOf).struct_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*OffsetOf*/ (u32)(__offsetof("), 0xfe10, {.d_s = v__util__no_dots(styp)}}, {_SLIT(", "), 0xfe10, {.d_s = (*node._v__ast__OffsetOf).field}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*OffsetOf*/ (u32)(__offsetof("), /*115 &string*/0xfe10, {.d_s = v__util__no_dots(styp)}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__OffsetOf).field}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 319 /* v.ast.OrExpr */) { + else if (node._typ == 320 /* v.ast.OrExpr */) { } - else if (node._typ == 320 /* v.ast.ParExpr */) { + else if (node._typ == 321 /* v.ast.ParExpr */) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_expr(g, (*node._v__ast__ParExpr).expr); v__gen__c__Gen_write(g, _SLIT(")")); } - else if (node._typ == 321 /* v.ast.PostfixExpr */) { + else if (node._typ == 322 /* v.ast.PostfixExpr */) { if (((*node._v__ast__PostfixExpr).auto_locked).len != 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_lock(&"), 0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_lock(&"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); } g->inside_map_postfix = true; if (v__ast__Expr_is_auto_deref_var((*node._v__ast__PostfixExpr).expr)) { @@ -69912,10 +70107,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) v__gen__c__Gen_write(g, v__token__Kind_str((*node._v__ast__PostfixExpr).op)); if (((*node._v__ast__PostfixExpr).auto_locked).len != 0) { v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_unlock(&"), 0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_unlock(&"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx)"), 0, { .d_c = 0 }}}))); } } - else if (node._typ == 322 /* v.ast.PrefixExpr */) { + else if (node._typ == 323 /* v.ast.PrefixExpr */) { bool gen_or = (*node._v__ast__PrefixExpr).op == v__token__Kind__arrow && ((*node._v__ast__PrefixExpr).or_block.kind != v__ast__OrKind__absent || (*node._v__ast__PrefixExpr).is_option); if ((*node._v__ast__PrefixExpr).op == v__token__Kind__amp) { g->is_amp = true; @@ -69923,7 +70118,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) if ((*node._v__ast__PrefixExpr).op == v__token__Kind__arrow) { string styp = v__gen__c__Gen_typ(g, (*node._v__ast__PrefixExpr).right_type); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(g->table, (*node._v__ast__PrefixExpr).right_type); - v__ast__Chan right_inf = /* as */ *(v__ast__Chan*)__as_cast((right_sym->info)._v__ast__Chan,(right_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.Chan */ ; + v__ast__Chan right_inf = /* as */ *(v__ast__Chan*)__as_cast((right_sym->info)._v__ast__Chan,(right_sym->info)._typ, 480) /*expected idx: 480, name: v.ast.Chan */ ; v__ast__Type elem_type = right_inf.elem_type; bool is_gen_or_and_assign_rhs = gen_or && !g->discard_or_result; string _t1; /* if prepend */ @@ -69939,9 +70134,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) if (gen_or) { string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(elem_type, v__ast__TypeFlag__optional)); v__gen__c__Gen_register_chan_pop_optional_call(g, opt_elem_type, styp); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_popval("), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, (*node._v__ast__PrefixExpr).right); v__gen__c__Gen_write(g, _SLIT(")")); @@ -69951,7 +70146,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) } if (is_gen_or_and_assign_rhs) { string elem_styp = v__gen__c__Gen_typ(g, elem_type); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(";\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*("), 0xfe10, {.d_s = elem_styp}}, {_SLIT("*)"), 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_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); } } } else { @@ -69962,27 +70157,27 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) } g->is_amp = false; } - else if (node._typ == 323 /* v.ast.RangeExpr */) { + else if (node._typ == 324 /* v.ast.RangeExpr */) { } - else if (node._typ == 324 /* v.ast.SelectExpr */) { + else if (node._typ == 325 /* v.ast.SelectExpr */) { v__gen__c__Gen_select_expr(g, (*node._v__ast__SelectExpr)); } - else if (node._typ == 325 /* v.ast.SelectorExpr */) { + else if (node._typ == 326 /* v.ast.SelectorExpr */) { v__gen__c__Gen_selector_expr(g, (*node._v__ast__SelectorExpr)); } - else if (node._typ == 326 /* v.ast.SizeOf */) { + else if (node._typ == 327 /* v.ast.SizeOf */) { v__gen__c__Gen_size_of(g, (*node._v__ast__SizeOf)); } - else if (node._typ == 327 /* v.ast.SqlExpr */) { + else if (node._typ == 328 /* v.ast.SqlExpr */) { v__gen__c__Gen_sql_select_expr(g, (*node._v__ast__SqlExpr)); } - else if (node._typ == 329 /* v.ast.StringLiteral */) { + else if (node._typ == 330 /* v.ast.StringLiteral */) { v__gen__c__Gen_string_literal(g, (*node._v__ast__StringLiteral)); } - else if (node._typ == 328 /* v.ast.StringInterLiteral */) { + else if (node._typ == 329 /* v.ast.StringInterLiteral */) { v__gen__c__Gen_string_inter_literal(g, (*node._v__ast__StringInterLiteral)); } - else if (node._typ == 330 /* v.ast.StructInit */) { + else if (node._typ == 331 /* v.ast.StructInit */) { if ((*node._v__ast__StructInit).unresolved) { v__gen__c__Gen_expr(g, v__ast__resolve_init((*node._v__ast__StructInit), v__gen__c__Gen_unwrap_generic(g, (*node._v__ast__StructInit).typ), g->table)); } else { @@ -69991,16 +70186,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) g->inside_struct_init = false; } } - else if (node._typ == 331 /* v.ast.TypeNode */) { + else if (node._typ == 332 /* v.ast.TypeNode */) { v__ast__Type typ = v__gen__c__Gen_unwrap_generic(g, (*node._v__ast__TypeNode).typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); string sidx = v__gen__c__Gen_type_sidx(g, typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sidx}}, {_SLIT(" /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sidx}}, {_SLIT(" /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 332 /* v.ast.TypeOf */) { + else if (node._typ == 333 /* v.ast.TypeOf */) { v__gen__c__Gen_typeof_expr(g, (*node._v__ast__TypeOf)); } - else if (node._typ == 333 /* v.ast.UnsafeExpr */) { + else if (node._typ == 334 /* v.ast.UnsafeExpr */) { v__gen__c__Gen_expr(g, (*node._v__ast__UnsafeExpr).expr); } ; @@ -70014,7 +70209,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_char_literal(v__gen__c__Gen* g, v__ast__Char return; } if (string_len_utf8(node.val) < node.val.len) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("((rune)0x"), 0xfe10, {.d_s = int_hex(string_utf32_code(node.val))}}, {_SLIT(" /* `"), 0xfe10, {.d_s = node.val}}, {_SLIT("` */)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("((rune)0x"), /*115 &string*/0xfe10, {.d_s = int_hex(string_utf32_code(node.val))}}, {_SLIT(" /* `"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT("` */)"), 0, { .d_c = 0 }}}))); return; } if (node.val.len == 1) { @@ -70026,7 +70221,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_char_literal(v__gen__c__Gen* g, v__ast__Char return; } } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = node.val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = node.val}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_type_name(v__gen__c__Gen* g, v__ast__Type raw_type) { @@ -70035,37 +70230,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_type_name(v__gen__c__Gen* g, v__ast__Type ra string s = _SLIT(""); if (sym->kind == v__ast__Kind__function) { if (v__ast__Type_is_ptr(typ)) { - s = string__plus(_SLIT("&"), v__gen__c__Gen_fn_decl_str(g, /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ )); + s = string__plus(_SLIT("&"), v__gen__c__Gen_fn_decl_str(g, /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ )); } else { - s = v__gen__c__Gen_fn_decl_str(g, /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ); + s = v__gen__c__Gen_fn_decl_str(g, /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ); } } else { s = v__ast__Table_type_to_str(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = v__util__strip_main_name(s)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(s)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_typeof_expr(v__gen__c__Gen* g, v__ast__TypeOf node) { v__ast__Type typ = (v__ast__Type_alias_eq(node.expr_type, g->field_data_type) ? (g->comptime_for_field_value.typ) : (node.expr_type)); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); if (sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ v_typeof_sumtype_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("( ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ v_typeof_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("( ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")._typ ))")); } else if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed fixed_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed fixed_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; string typ_name = v__ast__Table_get_type_name(g->table, fixed_info.elem_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_SLIT(\"["), 0xfe07, {.d_i32 = fixed_info.size}}, {_SLIT("]"), 0xfe10, {.d_s = v__util__strip_main_name(typ_name)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_SLIT(\"["), /*100 &int*/0xfe07, {.d_i32 = fixed_info.size}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(typ_name)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = v__gen__c__Gen_fn_decl_str(g, info)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_fn_decl_str(g, info)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } else if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { v__ast__TypeSymbol* varg_elem_type_sym = v__ast__Table_sym(g->table, v__ast__Table_value_type(g->table, typ)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\"..."), 0xfe10, {.d_s = v__util__strip_main_name(varg_elem_type_sym->name)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\"..."), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(varg_elem_type_sym->name)}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } else { string x = v__ast__Table_type_to_str(g->table, typ); string y = v__util__strip_main_name(x); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = y}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = y}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } } @@ -70085,11 +70280,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel else if (node.gkind_field == (v__ast__GenericKindField__unknown)) { if (string__eq(node.field_name, _SLIT("name"))) { v__ast__Type name_type = node.name_type; - if ((node.expr)._typ == 332 /* v.ast.TypeOf */) { - if (((*node.expr._v__ast__TypeOf).expr)._typ == 297 /* v.ast.ComptimeSelector */) { - if (((*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr)._typ == 325 /* v.ast.SelectorExpr */) { - if (((*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 305 /* v.ast.Ident */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); + if ((node.expr)._typ == 333 /* v.ast.TypeOf */) { + if (((*node.expr._v__ast__TypeOf).expr)._typ == 298 /* v.ast.ComptimeSelector */) { + if (((*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr)._typ == 326 /* v.ast.SelectorExpr */) { + if (((*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 306 /* v.ast.Ident */) { + string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); v__ast__Type* _t2 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); Option_v__ast__Type _t1 = {0}; if (_t2) { @@ -70122,10 +70317,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel v__gen__c__Gen_checker_bug(g, _SLIT("unexpected SelectorExpr.expr_type = 0"), node.pos); } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.expr_type)); - bool is_optional = (node.expr)._typ == 305 /* v.ast.Ident */ && v__ast__Type_has_flag(node.expr_type, v__ast__TypeFlag__optional); + bool is_optional = (node.expr)._typ == 306 /* v.ast.Ident */ && v__ast__Type_has_flag(node.expr_type, v__ast__TypeFlag__optional); if (is_optional) { string opt_base_typ = v__gen__c__Gen_base_type(g, node.expr_type); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = opt_base_typ}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = opt_base_typ}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } if (sym->kind == v__ast__Kind__interface_ || sym->kind == v__ast__Kind__sum_type) { v__gen__c__Gen_write(g, _SLIT("(*(")); @@ -70135,11 +70330,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel v__gen__c__Gen_error(g, _SLIT("field_name should be `len`"), node.pos); VUNREACHABLE(); } - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = info.size}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT0, 0, { .d_c = 0 }}}))); return; } else if (sym->kind == v__ast__Kind__chan && (string__eq(node.field_name, _SLIT("len")) || string__eq(node.field_name, _SLIT("closed")))) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__Channel_"), 0xfe10, {.d_s = node.field_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__Channel_"), /*115 &string*/0xfe10, {.d_s = node.field_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")")); return; @@ -70168,13 +70363,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel v__ast__TypeSymbol* cast_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); if (i != 0) { string dot = (v__ast__Type_is_ptr(field.typ) ? (_SLIT("->")) : (_SLIT("."))); - sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), 0xfe10, {.d_s = dot}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")"), /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - if ((cast_sym->info)._typ == 468 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 469 /* v.ast.Aggregate */) { v__ast__TypeSymbol* agg_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx))); - sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = agg_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = agg_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sum_type_deref_field = /*f*/string__plus(sum_type_deref_field, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -70193,7 +70388,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel if (is_optional) { v__gen__c__Gen_write(g, _SLIT(".data)")); } - if ((sym->info)._typ == 455 /* v.ast.Struct */ || (sym->info)._typ == 468 /* v.ast.Aggregate */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */ || (sym->info)._typ == 469 /* v.ast.Aggregate */) { for (int i = 0; i < node.from_embed_types.len; ++i) { v__ast__Type embed = ((v__ast__Type*)node.from_embed_types.data)[i]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, embed); @@ -70216,13 +70411,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel v__gen__c__Gen_write(g, _SLIT("val.")); } if (node.expr_type == 0) { - v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("cgen: SelectorExpr | expr_type: 0 | it.expr: `"), 0xfe10, {.d_s = v__ast__Expr_str(node.expr)}}, {_SLIT("` | field: `"), 0xfe10, {.d_s = node.field_name}}, {_SLIT("` | file: "), 0xfe10, {.d_s = g->file->path}}, {_SLIT(" | line: "), 0xfe07, {.d_i32 = node.pos.line_nr}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("cgen: SelectorExpr | expr_type: 0 | it.expr: `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node.expr)}}, {_SLIT("` | field: `"), /*115 &string*/0xfe10, {.d_s = node.field_name}}, {_SLIT("` | file: "), /*115 &string*/0xfe10, {.d_s = g->file->path}}, {_SLIT(" | line: "), /*100 &int*/0xfe07, {.d_i32 = node.pos.line_nr}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } string field_name = (sym->language == v__ast__Language__v ? (v__gen__c__c_name(node.field_name)) : (node.field_name)); v__gen__c__Gen_write(g, field_name); if ((sum_type_deref_field).len != 0) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sum_type_dot}}, {_SLIT0, 0xfe10, {.d_s = sum_type_deref_field}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sum_type_dot}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = sum_type_deref_field}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } if (sym->kind == v__ast__Kind__interface_ || sym->kind == v__ast__Kind__sum_type) { v__gen__c__Gen_write(g, _SLIT("))")); @@ -70230,7 +70425,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel } VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_expr(v__gen__c__Gen* g, v__ast__Expr node) { - if (node._typ == 302 /* v.ast.EnumVal */) { + if (node._typ == 303 /* v.ast.EnumVal */) { v__gen__c__Gen_write(g, (*node._v__ast__EnumVal).val); } @@ -70250,58 +70445,58 @@ bool v__gen__c__Gen_lock_expr_defer_1 = false; if (node.is_expr) { string styp = v__gen__c__Gen_typ(g, node.typ); cur_line = v__gen__c__Gen_go_before_stmt(g, 0); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_result}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_result}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } string mtxs = _SLIT(""); if (node.lockeds.len == 0) { } else if (node.lockeds.len == 1) { string lock_prefix = ((*(bool*)/*ee elem_sym */array_get(node.is_rlock, 0)) ? (_SLIT("r")) : (_SLIT(""))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_"), 0xfe10, {.d_s = lock_prefix}}, {_SLIT("lock(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_"), /*115 &string*/0xfe10, {.d_s = lock_prefix}}, {_SLIT("lock(&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.lockeds, 0))); v__gen__c__Gen_writeln(g, _SLIT("->mtx);")); } else { mtxs = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("uintptr_t _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("bool _isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("uintptr_t _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("bool _isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); int j = 0; for (int i = 0; i < node.is_rlock.len; ++i) { bool is_rlock = ((bool*)node.is_rlock.data)[i]; if (!is_rlock) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = j}}, {_SLIT("] = (uintptr_t)&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("] = (uintptr_t)&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.lockeds, i))); v__gen__c__Gen_writeln(g, _SLIT("->mtx;")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = j}}, {_SLIT("] = false;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("] = false;"), 0, { .d_c = 0 }}}))); j++; } } for (int i = 0; i < node.is_rlock.len; ++i) { bool is_rlock = ((bool*)node.is_rlock.data)[i]; if (is_rlock) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = j}}, {_SLIT("] = (uintptr_t)&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("] = (uintptr_t)&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.lockeds, i))); v__gen__c__Gen_writeln(g, _SLIT("->mtx;")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe07, {.d_i32 = j}}, {_SLIT("] = true;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("] = true;"), 0, { .d_c = 0 }}}))); j++; } } if (node.lockeds.len == 2) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0] > _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1]) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tuintptr_t _ptr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(" = _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0] = _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1] = _ptr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tbool _bool_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(" = _isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[0] = _isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1];"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("[1] = _bool_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0] > _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1]) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tuintptr_t _ptr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(" = _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0] = _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1] = _ptr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tbool _bool_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(" = _isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[0] = _isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("[1] = _bool_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); } else { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("__sort_ptr(_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(", _isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT(", "), 0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("__sort_ptr(_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(", _isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = mtxs}}, {_SLIT("=0; "), 0xfe10, {.d_s = mtxs}}, {_SLIT("<"), 0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("; "), 0xfe10, {.d_s = mtxs}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = mtxs}}, {_SLIT(" && _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("] == _arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("-1]) continue;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (_isrlck_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_rlock((sync__RwMutex*)_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("=0; "), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("<"), /*100 &int*/0xfe07, {.d_i32 = node.lockeds.len}}, {_SLIT("; "), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT(" && _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("] == _arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("-1]) continue;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (_isrlck_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_rlock((sync__RwMutex*)_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\telse")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_lock((sync__RwMutex*)_arr_"), 0xfe10, {.d_s = mtxs}}, {_SLIT("["), 0xfe10, {.d_s = mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_lock((sync__RwMutex*)_arr_"), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); } g->mtxs = mtxs; @@ -70316,7 +70511,7 @@ bool v__gen__c__Gen_lock_expr_defer_1 = false; if (node.is_expr) { v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_write(g, cur_line); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_result}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_result}}, {_SLIT0, 0, { .d_c = 0 }}}))); } // Defer begin if (v__gen__c__Gen_lock_expr_defer_1) { @@ -70334,16 +70529,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_unlock_locks(v__gen__c__Gen* g) { if (g->cur_lock.lockeds.len == 0) { } else if (g->cur_lock.lockeds.len == 1) { string lock_prefix = ((*(bool*)/*ee elem_sym */array_get(g->cur_lock.is_rlock, 0)) ? (_SLIT("r")) : (_SLIT(""))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_"), 0xfe10, {.d_s = lock_prefix}}, {_SLIT("unlock(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_"), /*115 &string*/0xfe10, {.d_s = lock_prefix}}, {_SLIT("unlock(&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(g->cur_lock.lockeds, 0))); v__gen__c__Gen_write(g, _SLIT("->mtx);")); } else { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("="), 0xfe07, {.d_i32 = g->cur_lock.lockeds.len - 1}}, {_SLIT("; "), 0xfe10, {.d_s = g->mtxs}}, {_SLIT(">=0; "), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("--) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = g->mtxs}}, {_SLIT(" && _arr_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("] == _arr_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("-1]) continue;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (_isrlck_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_runlock((sync__RwMutex*)_arr_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("="), /*100 &int*/0xfe07, {.d_i32 = g->cur_lock.lockeds.len - 1}}, {_SLIT("; "), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT(">=0; "), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("--) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT(" && _arr_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("] == _arr_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("-1]) continue;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif (_isrlck_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_runlock((sync__RwMutex*)_arr_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\telse")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_unlock((sync__RwMutex*)_arr_"), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), 0xfe10, {.d_s = g->mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tsync__RwMutex_unlock((sync__RwMutex*)_arr_"), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = g->mtxs}}, {_SLIT("]);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("}")); } } @@ -70355,11 +70550,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_105188 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); - string hash_fn = mr_105188.arg0; - string key_eq_fn = mr_105188.arg1; - string clone_fn = mr_105188.arg2; - string free_fn = mr_105188.arg3; + multi_return_string_string_string_string mr_106764 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); + string hash_fn = mr_106764.arg0; + string key_eq_fn = mr_106764.arg1; + string clone_fn = mr_106764.arg2; + string free_fn = mr_106764.arg3; int size = node.vals.len; string shared_styp = _SLIT(""); string styp = _SLIT(""); @@ -70371,10 +70566,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit if (g->is_shared) { v__ast__Type shared_typ = v__ast__Type_set_flag(node.typ, v__ast__TypeFlag__shared_f); shared_styp = v__gen__c__Gen_typ(g, shared_typ); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup_shared_map(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val ="), 0, { .d_c = 0 }}}))); } else if (is_amp) { styp = v__gen__c__Gen_typ(g, node.typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("*)memdup(ADDR("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)memdup(ADDR("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); } string noscan_key = v__gen__c__Gen_check_noscan(g, node.key_type); string noscan_value = v__gen__c__Gen_check_noscan(g, node.value_type); @@ -70389,9 +70584,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit } if (size > 0) { if (value_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(10, _MOV((StrIntpData[]){{_SLIT("new_map_init"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(", "), 0xfe07, {.d_i32 = size}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof(voidptr), _MOV(("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("["), 0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(10, _MOV((StrIntpData[]){{_SLIT("new_map_init"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof(voidptr), _MOV(("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(11, _MOV((StrIntpData[]){{_SLIT("new_map_init"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(", "), 0xfe07, {.d_i32 = size}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = value_typ_str}}, {_SLIT("), _MOV(("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("["), 0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(11, _MOV((StrIntpData[]){{_SLIT("new_map_init"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = value_typ_str}}, {_SLIT("), _MOV(("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } for (int _t1 = 0; _t1 < node.keys.len; ++_t1) { v__ast__Expr expr = ((v__ast__Expr*)node.keys.data)[_t1]; @@ -70399,9 +70594,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit v__gen__c__Gen_write(g, _SLIT(", ")); } if (value_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}), _MOV((voidptr["), 0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}), _MOV((voidptr["), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("}), _MOV(("), 0xfe10, {.d_s = value_typ_str}}, {_SLIT("["), 0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("}), _MOV(("), /*115 &string*/0xfe10, {.d_s = value_typ_str}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = size}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); } for (int i = 0; i < node.vals.len; ++i) { v__ast__Expr expr = ((v__ast__Expr*)node.vals.data)[i]; @@ -70417,12 +70612,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_map_init(v__gen__c__Gen* g, v__ast__MapInit } v__gen__c__Gen_write(g, _SLIT("}))")); } else { - v__gen__c__Gen_write(g, str_intp(8, _MOV((StrIntpData[]){{_SLIT("new_map"), 0xfe10, {.d_s = noscan}}, {_SLIT("(sizeof("), 0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = value_typ_str}}, {_SLIT("), "), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(8, _MOV((StrIntpData[]){{_SLIT("new_map"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(sizeof("), /*115 &string*/0xfe10, {.d_s = key_typ_str}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = value_typ_str}}, {_SLIT("), "), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } if (g->is_shared) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("), sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } @@ -70454,12 +70649,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } else if (branch.is_timeout) { has_timeout = true; exception_branch = j; - timeout_expr = (/* as */ *(v__ast__ExprStmt*)__as_cast((branch.stmt)._v__ast__ExprStmt,(branch.stmt)._typ, 345) /*expected idx: 345, name: v.ast.ExprStmt */ ).expr; + timeout_expr = (/* as */ *(v__ast__ExprStmt*)__as_cast((branch.stmt)._v__ast__ExprStmt,(branch.stmt)._typ, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ).expr; } else { - if (branch.stmt._typ == 345 /* v.ast.ExprStmt */) { - v__ast__InfixExpr expr = /* as */ *(v__ast__InfixExpr*)__as_cast(((*branch.stmt._v__ast__ExprStmt).expr)._v__ast__InfixExpr,((*branch.stmt._v__ast__ExprStmt).expr)._typ, 309) /*expected idx: 309, name: v.ast.InfixExpr */ ; + if (branch.stmt._typ == 346 /* v.ast.ExprStmt */) { + v__ast__InfixExpr expr = /* as */ *(v__ast__InfixExpr*)__as_cast(((*branch.stmt._v__ast__ExprStmt).expr)._v__ast__InfixExpr,((*branch.stmt._v__ast__ExprStmt).expr)._typ, 310) /*expected idx: 310, name: v.ast.InfixExpr */ ; array_push((array*)&channels, _MOV((v__ast__Expr[]){ expr.left })); - if ((expr.right)._typ == 305 /* v.ast.Ident */ || (expr.right)._typ == 308 /* v.ast.IndexExpr */ || (expr.right)._typ == 325 /* v.ast.SelectorExpr */ || (expr.right)._typ == 330 /* v.ast.StructInit */) { + if ((expr.right)._typ == 306 /* v.ast.Ident */ || (expr.right)._typ == 309 /* v.ast.IndexExpr */ || (expr.right)._typ == 326 /* v.ast.SelectorExpr */ || (expr.right)._typ == 331 /* v.ast.StructInit */) { array_push((array*)&objs, _MOV((v__ast__Expr[]){ expr.right })); array_push((array*)&tmp_objs, _MOV((string[]){ string_clone(_SLIT("")) })); array_push((array*)&elem_types, _MOV((string[]){ string_clone(_SLIT("")) })); @@ -70468,12 +70663,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec string tmp_obj = v__gen__c__Gen_new_tmp_var(g); array_push((array*)&tmp_objs, _MOV((string[]){ string_clone(tmp_obj) })); string el_stype = v__gen__c__Gen_typ(g, v__ast__mktyp(expr.right_type)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = el_stype}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } array_push((array*)&is_push, _MOV((bool[]){ true })); } - else if (branch.stmt._typ == 337 /* v.ast.AssignStmt */) { - v__ast__PrefixExpr rec_expr = /* as */ *(v__ast__PrefixExpr*)__as_cast(((*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)))._v__ast__PrefixExpr,((*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)))._typ, 322) /*expected idx: 322, name: v.ast.PrefixExpr */ ; + else if (branch.stmt._typ == 338 /* v.ast.AssignStmt */) { + v__ast__PrefixExpr rec_expr = /* as */ *(v__ast__PrefixExpr*)__as_cast(((*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)))._v__ast__PrefixExpr,((*(v__ast__Expr*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right, 0)))._typ, 323) /*expected idx: 323, name: v.ast.PrefixExpr */ ; array_push((array*)&channels, _MOV((v__ast__Expr[]){ rec_expr.right })); array_push((array*)&is_push, _MOV((bool[]){ false })); if ((*branch.stmt._v__ast__AssignStmt).op == v__token__Kind__decl_assign || !v__ast__Type_alias_eq((*(v__ast__Type*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right_types, 0)), (*(v__ast__Type*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).left_types, 0)))) { @@ -70481,7 +70676,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec array_push((array*)&tmp_objs, _MOV((string[]){ string_clone(tmp_obj) })); string el_stype = v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get((*branch.stmt._v__ast__AssignStmt).right_types, 0))); array_push((array*)&elem_types, _MOV((string[]){ string_clone(((*branch.stmt._v__ast__AssignStmt).op == v__token__Kind__decl_assign ? (string__plus(el_stype, _SLIT(" "))) : (_SLIT("")))) })); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = el_stype}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = el_stype}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { array_push((array*)&tmp_objs, _MOV((string[]){ string_clone(_SLIT("")) })); array_push((array*)&elem_types, _MOV((string[]){ string_clone(_SLIT("")) })); @@ -70495,7 +70690,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } } string chan_array = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_sync__Channel_ptr "), 0xfe10, {.d_s = chan_array}}, {_SLIT(" = new_array_from_c_array("), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(sync__Channel*), _MOV((sync__Channel*["), 0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_sync__Channel_ptr "), /*115 &string*/0xfe10, {.d_s = chan_array}}, {_SLIT(" = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(sync__Channel*), _MOV((sync__Channel*["), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int i = 0; i < n_channels; ++i) { if (i > 0) { v__gen__c__Gen_write(g, _SLIT(", ")); @@ -70506,7 +70701,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } v__gen__c__Gen_writeln(g, _SLIT("}));\n")); string directions_array = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_sync__Direction "), 0xfe10, {.d_s = directions_array}}, {_SLIT(" = new_array_from_c_array("), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(sync__Direction), _MOV((sync__Direction["), 0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_sync__Direction "), /*115 &string*/0xfe10, {.d_s = directions_array}}, {_SLIT(" = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(sync__Direction), _MOV((sync__Direction["), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int i = 0; i < n_channels; ++i) { if (i > 0) { v__gen__c__Gen_write(g, _SLIT(", ")); @@ -70519,7 +70714,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } v__gen__c__Gen_writeln(g, _SLIT("}));\n")); string objs_array = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_voidptr "), 0xfe10, {.d_s = objs_array}}, {_SLIT(" = new_array_from_c_array("), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), 0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(voidptr), _MOV((voidptr["), 0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Array_voidptr "), /*115 &string*/0xfe10, {.d_s = objs_array}}, {_SLIT(" = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT(", sizeof(voidptr), _MOV((voidptr["), /*100 &int*/0xfe07, {.d_i32 = n_channels}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int i = 0; i < n_channels; ++i) { if (i > 0) { v__gen__c__Gen_write(g, _SLIT(", &")); @@ -70534,7 +70729,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } v__gen__c__Gen_writeln(g, _SLIT("}));\n")); string select_result = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = select_result}}, {_SLIT(" = sync__channel_select(&/*arr*/"), 0xfe10, {.d_s = chan_array}}, {_SLIT(", "), 0xfe10, {.d_s = directions_array}}, {_SLIT(", &/*arr*/"), 0xfe10, {.d_s = objs_array}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = select_result}}, {_SLIT(" = sync__channel_select(&/*arr*/"), /*115 &string*/0xfe10, {.d_s = chan_array}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = directions_array}}, {_SLIT(", &/*arr*/"), /*115 &string*/0xfe10, {.d_s = objs_array}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); if (has_timeout) { v__gen__c__Gen_expr(g, timeout_expr); } else if (has_else) { @@ -70543,23 +70738,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec v__gen__c__Gen_write(g, _SLIT("_const_time__infinite")); } v__gen__c__Gen_writeln(g, _SLIT(");")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), 0xfe10, {.d_s = objs_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), 0xfe10, {.d_s = directions_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), 0xfe10, {.d_s = chan_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), /*115 &string*/0xfe10, {.d_s = objs_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), /*115 &string*/0xfe10, {.d_s = directions_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_free(&"), /*115 &string*/0xfe10, {.d_s = chan_array}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); int i = 0; for (int j = 0; j < node.branches.len; ++j) { if (j > 0) { v__gen__c__Gen_write(g, _SLIT("} else ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = select_result}}, {_SLIT(" == "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = select_result}}, {_SLIT(" == "), 0, { .d_c = 0 }}}))); if (j == exception_branch) { v__gen__c__Gen_writeln(g, _SLIT("-1) {")); } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); if (!(*(bool*)/*ee elem_sym */array_get(is_push, i)) && ((*(string*)/*ee elem_sym */array_get(tmp_objs, i))).len != 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(elem_types, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(elem_types, i))}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(objs, i))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(tmp_objs, i))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(tmp_objs, i))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } i++; } @@ -70569,7 +70764,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec if (is_expr) { g->empty_line = false; v__gen__c__Gen_write(g, cur_line); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = select_result}}, {_SLIT(" != -2)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = select_result}}, {_SLIT(" != -2)"), 0, { .d_c = 0 }}}))); } } @@ -70598,19 +70793,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) } v__ast__IdentInfo node_info = node.info; bool is_auto_heap = false; - if ((node_info)._typ == 415 /* v.ast.IdentVar */) { + if ((node_info)._typ == 416 /* v.ast.IdentVar */) { if ((*node_info._v__ast__IdentVar).is_optional && !(g->is_assign_lhs && g->right_is_opt)) { v__gen__c__Gen_write(g, _SLIT("/*opt*/")); string styp = v__gen__c__Gen_base_type(g, (*node_info._v__ast__IdentVar).typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = name}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); return; } if (!g->is_assign_lhs && (*node_info._v__ast__IdentVar).share == v__ast__ShareType__shared_t) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT(".val"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(".val"), 0, { .d_c = 0 }}}))); return; } v__ast__ScopeObject v = node.obj; - if ((v)._typ == 363 /* v.ast.Var */) { + if ((v)._typ == 364 /* v.ast.Var */) { is_auto_heap = (*v._v__ast__Var).is_auto_heap && (!g->is_assign_lhs || g->assign_op != v__token__Kind__decl_assign); if (is_auto_heap) { v__gen__c__Gen_write(g, _SLIT("(*(")); @@ -70635,11 +70830,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) } } string dot = (is_ptr || is_auto_heap ? (_SLIT("->")) : (_SLIT("."))); - if ((cast_sym->info)._typ == 468 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 469 /* v.ast.Aggregate */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_"), 0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT(")")); } @@ -70653,7 +70848,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) v__gen__c__Gen_write(g, string__plus(_const_v__gen__c__closure_ctx, _SLIT("->"))); } } - } else if ((node_info)._typ == 414 /* v.ast.IdentFn */) { + } else if ((node_info)._typ == 415 /* v.ast.IdentFn */) { if (g->pref->translated || g->file->is_translated) { Option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { @@ -70665,7 +70860,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) } 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: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + 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) { @@ -70676,7 +70871,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) ; if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _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(); ; } @@ -70694,16 +70889,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_cast_expr(v__gen__c__Gen* g, v__ast__CastExp v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.typ); if (sym->kind == v__ast__Kind__sum_type || sym->kind == v__ast__Kind__interface_) { v__gen__c__Gen_expr_with_cast(g, node.expr, node.expr_type, node.typ); - } else if (sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(node.typ) && !(/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).is_typedef) { + } else if (sym->kind == v__ast__Kind__struct_ && !v__ast__Type_is_ptr(node.typ) && !(/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).is_typedef) { string styp = v__gen__c__Gen_typ(g, node.typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("*(("), 0xfe10, {.d_s = styp}}, {_SLIT(" *)(&"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("*(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" *)(&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT("))")); } else if (sym->kind == v__ast__Kind__alias && v__ast__Table_final_sym(g->table, node.typ)->kind == v__ast__Kind__array_fixed) { v__gen__c__Gen_expr(g, node.expr); } else if (v__ast__Type_alias_eq(node.expr_type, _const_v__ast__bool_type) && v__ast__Type_is_int(node.typ)) { string styp = v__gen__c__Gen_typ(g, node.typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("[]){("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]){("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")?1:0}[0]")); } else { @@ -70711,13 +70906,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_cast_expr(v__gen__c__Gen* g, v__ast__CastExp if ((g->pref->translated || g->file->is_translated) && sym->kind == v__ast__Kind__function) { } string cast_label = _SLIT(""); - if (sym->kind != v__ast__Kind__alias || !(v__ast__Type_alias_eq((/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type, node.expr_type) || v__ast__Type_alias_eq((/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type, _const_v__ast__string_type))) { - cast_label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + if (sym->kind != v__ast__Kind__alias || !(v__ast__Type_alias_eq((/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type, node.expr_type) || v__ast__Type_alias_eq((/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type, _const_v__ast__string_type))) { + cast_label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(")"), 0, { .d_c = 0 }}})); } - if (v__ast__Type_has_flag(node.typ, v__ast__TypeFlag__optional) && (node.expr)._typ == 317 /* v.ast.None */) { + if (v__ast__Type_has_flag(node.typ, v__ast__TypeFlag__optional) && (node.expr)._typ == 318 /* v.ast.None */) { v__gen__c__Gen_gen_optional_error(g, node.typ, node.expr); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = cast_label}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = cast_label}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (sym->kind == v__ast__Kind__alias && v__ast__Table_final_sym(g->table, node.typ)->kind == v__ast__Kind__string) { int ptr_cnt = v__ast__Type_nr_muls(node.typ) - v__ast__Type_nr_muls(node.expr_type); if (ptr_cnt > 0) { @@ -70725,7 +70920,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_cast_expr(v__gen__c__Gen* g, v__ast__CastExp } } v__gen__c__Gen_expr(g, node.expr); - if ((node.expr)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((node.expr)._typ == 311 /* v.ast.IntegerLiteral */) { if (v__ast__Type_alias_eq(node.typ, _const_v__ast__u64_type) || v__ast__Type_alias_eq(node.typ, _const_v__ast__u32_type) || v__ast__Type_alias_eq(node.typ, _const_v__ast__u16_type)) { if (!string_starts_with((*node.expr._v__ast__IntegerLiteral).val, _SLIT("-"))) { v__gen__c__Gen_write(g, _SLIT("U")); @@ -70749,10 +70944,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_concat_expr(v__gen__c__Gen* g, v__ast__Conca if (!is_multi) { v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.vals, 0))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); for (int i = 0; i < node.vals.len; ++i) { v__ast__Expr expr = ((v__ast__Expr*)node.vals.data)[i]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg"), 0xfe07, {.d_i32 = i}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("="), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); if (i < node.vals.len - 1) { v__gen__c__Gen_write(g, _SLIT(",")); @@ -70764,7 +70959,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_concat_expr(v__gen__c__Gen* g, v__ast__Conca // Attr: [inline] inline VV_LOCAL_SYMBOL bool v__gen__c__Gen_expr_is_multi_return_call(v__gen__c__Gen* g, v__ast__Expr expr) { - if ((expr)._typ == 291 /* v.ast.CallExpr */) { + if ((expr)._typ == 292 /* v.ast.CallExpr */) { bool _t1 = v__ast__Table_sym(g->table, (*expr._v__ast__CallExpr).return_type)->kind == v__ast__Kind__multi_return; return _t1; } @@ -70772,9 +70967,16 @@ inline VV_LOCAL_SYMBOL bool v__gen__c__Gen_expr_is_multi_return_call(v__gen__c__ return _t2; } +VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_result_error(v__gen__c__Gen* g, v__ast__Type target_type, v__ast__Expr expr) { + string styp = v__gen__c__Gen_typ(g, target_type); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){ .is_error=true, .err="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_expr(g, expr); + v__gen__c__Gen_write(g, _SLIT(", .data={EMPTY_STRUCT_INITIALIZATION} }")); +} + VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_optional_error(v__gen__c__Gen* g, v__ast__Type target_type, v__ast__Expr expr) { string styp = v__gen__c__Gen_typ(g, target_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){ .state=2, .err="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){ .state=2, .err="), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(", .data={EMPTY_STRUCT_INITIALIZATION} }")); } @@ -70785,7 +70987,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; g->inside_return = true; v__gen__c__Gen_return_stmt_defer_0 = true; if (node.exprs.len > 0) { - if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 296 /* v.ast.ComptimeCall */) { + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 297 /* v.ast.ComptimeCall */) { v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); v__gen__c__Gen_writeln(g, _SLIT(";")); // Defer begin @@ -70799,12 +71001,13 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, g->fn_decl->return_type); bool fn_return_is_multi = sym->kind == v__ast__Kind__multi_return; bool fn_return_is_optional = v__ast__Type_has_flag(g->fn_decl->return_type, v__ast__TypeFlag__optional); + bool fn_return_is_result = v__ast__Type_has_flag(g->fn_decl->return_type, v__ast__TypeFlag__result); bool has_semicolon = false; if (node.exprs.len == 0) { v__gen__c__Gen_write_defer_stmts_when_needed(g); - if (fn_return_is_optional) { + if (fn_return_is_optional || fn_return_is_result) { string styp = v__gen__c__Gen_typ(g, g->fn_decl->return_type); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return ("), 0xfe10, {.d_s = styp}}, {_SLIT("){0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return ("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){0};"), 0, { .d_c = 0 }}}))); } else { if (g->is_autofree) { ; @@ -70823,13 +71026,13 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; string ret_typ = v__gen__c__Gen_typ(g, v__gen__c__Gen_unwrap_generic(g, g->fn_decl->return_type)); bool use_tmp_var = g->defer_stmts.len > 0 || g->defer_profile_code.len > 0 || g->cur_lock.lockeds.len > 0; if (fn_return_is_optional) { - bool optional_none = ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 317 /* v.ast.None */; + bool optional_none = ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 318 /* v.ast.None */; string ftyp = v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0))); bool is_regular_option = string__eq(ftyp, _SLIT("Option")); if (optional_none || is_regular_option || (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)) == _const_v__ast__error_type_idx) { if (!isnil(g->fn_decl) && g->fn_decl->is_test) { string test_error_var = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = test_error_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = test_error_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_optional_error(g, g->fn_decl->return_type, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_write_defer_stmts_when_needed(g); @@ -70842,7 +71045,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; return; } if (use_tmp_var) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("return ")); } @@ -70850,7 +71053,44 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; v__gen__c__Gen_writeln(g, _SLIT(";")); if (use_tmp_var) { v__gen__c__Gen_write_defer_stmts_when_needed(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } + // Defer begin + if (v__gen__c__Gen_return_stmt_defer_0) { + g->inside_return = false; + } + // Defer end + return; + } + } + if (fn_return_is_result) { + string ftyp = v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0))); + bool is_regular_result = string__eq(ftyp, _const_v__gen__c__result_name); + if (is_regular_result || (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)) == _const_v__ast__error_type_idx) { + if (!isnil(g->fn_decl) && g->fn_decl->is_test) { + string test_error_var = v__gen__c__Gen_new_tmp_var(g); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = test_error_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_gen_result_error(g, g->fn_decl->return_type, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); + v__gen__c__Gen_writeln(g, _SLIT(";")); + v__gen__c__Gen_write_defer_stmts_when_needed(g); + v__gen__c__Gen_gen_failing_return_error_for_test_fn(g, node, test_error_var); + // Defer begin + if (v__gen__c__Gen_return_stmt_defer_0) { + g->inside_return = false; + } + // Defer end + return; + } + if (use_tmp_var) { + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + } else { + v__gen__c__Gen_write(g, _SLIT("return ")); + } + v__gen__c__Gen_gen_result_error(g, g->fn_decl->return_type, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); + v__gen__c__Gen_writeln(g, _SLIT(";")); + if (use_tmp_var) { + v__gen__c__Gen_write_defer_stmts_when_needed(g); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } // Defer begin if (v__gen__c__Gen_return_stmt_defer_0) { @@ -70861,12 +71101,12 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } } if (fn_return_is_multi && node.exprs.len > 0 && !v__gen__c__Gen_expr_is_multi_return_call(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))) { - if (node.exprs.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 306 /* v.ast.IfExpr */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 315 /* v.ast.MatchExpr */)) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + if (node.exprs.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 307 /* v.ast.IfExpr */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 316 /* v.ast.MatchExpr */)) { + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0))); v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_write_defer_stmts_when_needed(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); // Defer begin if (v__gen__c__Gen_return_stmt_defer_0) { g->inside_return = false; @@ -70875,33 +71115,33 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; return; } v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(g->table, g->fn_decl->return_type); - v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((typ_sym->info)._v__ast__MultiReturn,(typ_sym->info)._typ, 481) /*expected idx: 481, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((typ_sym->info)._v__ast__MultiReturn,(typ_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; string styp = _SLIT(""); - if (fn_return_is_optional) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + if (fn_return_is_optional || fn_return_is_result) { + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); styp = v__gen__c__Gen_base_type(g, g->fn_decl->return_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), 0xfe10, {.d_s = styp}}, {_SLIT("/*X*/[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("/*X*/[]) { "), 0, { .d_c = 0 }}}))); } else { if (use_tmp_var) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("return ")); } styp = v__gen__c__Gen_typ(g, g->fn_decl->return_type); } string multi_unpack = _SLIT(""); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); int arg_idx = 0; for (int i = 0; i < node.exprs.len; ++i) { v__ast__Expr expr = ((v__ast__Expr*)node.exprs.data)[i]; if (v__gen__c__Gen_expr_is_multi_return_call(g, expr)) { - v__ast__CallExpr c = /* as */ *(v__ast__CallExpr*)__as_cast((expr)._v__ast__CallExpr,(expr)._typ, 291) /*expected idx: 291, name: v.ast.CallExpr */ ; + v__ast__CallExpr c = /* as */ *(v__ast__CallExpr*)__as_cast((expr)._v__ast__CallExpr,(expr)._typ, 292) /*expected idx: 292, name: v.ast.CallExpr */ ; v__ast__TypeSymbol* expr_sym = v__ast__Table_sym(g->table, c.return_type); string tmp = v__gen__c__Gen_new_tmp_var(g); if (!v__ast__Type_has_flag(c.return_type, v__ast__TypeFlag__optional)) { string s = v__gen__c__Gen_go_before_stmt(g, 0); string expr_styp = v__gen__c__Gen_typ(g, c.return_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = expr_styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = expr_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("="), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_writeln(g, _SLIT(";")); multi_unpack = /*f*/string__plus(multi_unpack, v__gen__c__Gen_go_before_stmt(g, 0)); @@ -70913,11 +71153,11 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; multi_unpack = /*f*/string__plus(multi_unpack, v__gen__c__Gen_go_before_stmt(g, 0)); v__gen__c__Gen_write(g, s); string expr_styp = v__gen__c__Gen_base_type(g, c.return_type); - tmp = ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*opt*/(*("), 0xfe10, {.d_s = expr_styp}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); + tmp = ( str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*opt*/(*("), /*115 &string*/0xfe10, {.d_s = expr_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); } Array_v__ast__Type expr_types = v__ast__TypeSymbol_mr_info(expr_sym).types; for (int j = 0; j < expr_types.len; ++j) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(".arg"), 0xfe07, {.d_i32 = arg_idx}}, {_SLIT("="), 0xfe10, {.d_s = tmp}}, {_SLIT(".arg"), 0xfe07, {.d_i32 = j}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = arg_idx}}, {_SLIT("="), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (j < expr_types.len || i < node.exprs.len - 1) { v__gen__c__Gen_write(g, _SLIT(",")); } @@ -70925,7 +71165,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } continue; } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg"), 0xfe07, {.d_i32 = arg_idx}}, {_SLIT("="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg"), /*100 &int*/0xfe07, {.d_i32 = arg_idx}}, {_SLIT("="), 0, { .d_c = 0 }}}))); if (v__ast__Expr_is_auto_deref_var(expr)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -70940,30 +71180,30 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } } v__gen__c__Gen_write(g, _SLIT("}")); - if (fn_return_is_optional) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), 0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + if (fn_return_is_optional || fn_return_is_result) { + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write_defer_stmts_when_needed(g); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (multi_unpack.len > 0) { v__gen__c__Gen_insert_before_stmt(g, multi_unpack); } - if (use_tmp_var && !fn_return_is_optional) { + if (use_tmp_var && !fn_return_is_optional && !fn_return_is_result) { if (!has_semicolon) { v__gen__c__Gen_writeln(g, _SLIT(";")); } v__gen__c__Gen_write_defer_stmts_when_needed(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); has_semicolon = true; } } else if (node.exprs.len >= 1) { if (node.types.len == 0) { - v__gen__c__Gen_checker_bug(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("node.exprs.len == "), 0xfe07, {.d_i32 = node.exprs.len}}, {_SLIT(" && node.types.len == 0"), 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_checker_bug(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("node.exprs.len == "), /*100 &int*/0xfe07, {.d_i32 = node.exprs.len}}, {_SLIT(" && node.types.len == 0"), 0, { .d_c = 0 }}})), node.pos); } v__ast__TypeSymbol* return_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0))); v__ast__Expr expr0 = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)); bool _t1 = 0; - if (expr0._typ == 291 /* v.ast.CallExpr */) { + if (expr0._typ == 292 /* v.ast.CallExpr */) { _t1 = v__ast__Type_has_flag((*expr0._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional) && (*expr0._v__ast__CallExpr).or_block.kind == v__ast__OrKind__absent; } @@ -70973,10 +71213,10 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; bool expr_type_is_opt = _t1; if (fn_return_is_optional && !expr_type_is_opt && !string__eq(return_sym->name, _SLIT("Option"))) { string styp = v__gen__c__Gen_base_type(g, g->fn_decl->return_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), 0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); if (!v__ast__Type_is_ptr(g->fn_decl->return_type) && v__ast__Type_is_ptr((*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)))) { - if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 305 /* v.ast.Ident */ && !g->is_amp)) { + if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 306 /* v.ast.Ident */ && !g->is_amp)) { v__gen__c__Gen_write(g, _SLIT("*")); } } @@ -70987,10 +71227,46 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; v__gen__c__Gen_write(g, _SLIT(", ")); } } - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), 0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" }, (Option*)(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write_defer_stmts_when_needed(g); v__gen__c__Gen_autofree_scope_vars(g, node.pos.pos - 1, node.pos.line_nr, true); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + // Defer begin + if (v__gen__c__Gen_return_stmt_defer_0) { + g->inside_return = false; + } + // Defer end + return; + } + bool _t2 = 0; + if (expr0._typ == 292 /* v.ast.CallExpr */) { + _t2 = v__ast__Type_has_flag((*expr0._v__ast__CallExpr).return_type, v__ast__TypeFlag__result) && (*expr0._v__ast__CallExpr).or_block.kind == v__ast__OrKind__absent; + } + + else { + _t2 = v__ast__Type_has_flag((*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)), v__ast__TypeFlag__result); + } + bool expr_type_is_result = _t2; + if (fn_return_is_result && !expr_type_is_result && !string__eq(return_sym->name, _const_v__gen__c__result_name)) { + string styp = v__gen__c__Gen_base_type(g, g->fn_decl->return_type); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__result_name}}, {_SLIT("_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + if (!v__ast__Type_is_ptr(g->fn_decl->return_type) && v__ast__Type_is_ptr((*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)))) { + if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 306 /* v.ast.Ident */ && !g->is_amp)) { + v__gen__c__Gen_write(g, _SLIT("*")); + } + } + for (int i = 0; i < node.exprs.len; ++i) { + v__ast__Expr expr = ((v__ast__Expr*)node.exprs.data)[i]; + v__gen__c__Gen_expr_with_cast(g, expr, (*(v__ast__Type*)/*ee elem_sym */array_get(node.types, i)), v__ast__Type_clear_flag(g->fn_decl->return_type, v__ast__TypeFlag__result)); + if (i < node.exprs.len - 1) { + v__gen__c__Gen_write(g, _SLIT(", ")); + } + } + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" }, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__result_name}}, {_SLIT("*)(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_defer_stmts_when_needed(g); + v__gen__c__Gen_autofree_scope_vars(g, node.pos.pos - 1, node.pos.line_nr, true); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); // Defer begin if (v__gen__c__Gen_return_stmt_defer_0) { g->inside_return = false; @@ -71000,14 +71276,14 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } if (g->is_autofree) { v__ast__Expr expr = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)); - if ((expr)._typ == 305 /* v.ast.Ident */) { + if ((expr)._typ == 306 /* v.ast.Ident */) { g->returned_var_name = (*expr._v__ast__Ident).name; } } use_tmp_var = use_tmp_var || !g->is_builtin_mod; if (use_tmp_var) { - if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ != 305 /* v.ast.Ident */ || use_tmp_var) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ != 306 /* v.ast.Ident */ || use_tmp_var) { + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else { use_tmp_var = false; v__gen__c__Gen_write_defer_stmts_when_needed(g); @@ -71040,7 +71316,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; if (!g->is_builtin_mod) { v__gen__c__Gen_autofree_scope_vars(g, node.pos.pos - 1, node.pos.line_nr, true); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), 0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); has_semicolon = false; } } else { @@ -71071,27 +71347,27 @@ 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))); v__ast__Expr field_expr = field.expr; - if (field.expr._typ == 285 /* v.ast.ArrayInit */) { + if (field.expr._typ == 286 /* v.ast.ArrayInit */) { if ((*field.expr._v__ast__ArrayInit).is_fixed) { string styp = v__gen__c__Gen_typ(g, (*field.expr._v__ast__ArrayInit).typ); if (g->pref->build_mode != v__pref__BuildMode__build_module) { string val = v__gen__c__Gen_expr_string(g, field.expr); - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = const_name}}, {_SLIT(" = "), 0xfe10, {.d_s = val}}, {_SLIT("; // fixed array const"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("; // fixed array const"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = const_name}}, {_SLIT("; // fixed array const"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT("; // fixed array const"), 0, { .d_c = 0 }}}))); } } else { v__gen__c__Gen_const_decl_init_later(g, field.mod, name, field.expr, field.typ, false); } } - else if (field.expr._typ == 329 /* v.ast.StringLiteral */) { - strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = const_name}}, {_SLIT("; // a string literal, inited later"), 0, { .d_c = 0 }}}))); + else if (field.expr._typ == 330 /* v.ast.StringLiteral */) { + strings__Builder_writeln(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT("; // a string literal, inited later"), 0, { .d_c = 0 }}}))); if (g->pref->build_mode != v__pref__BuildMode__build_module) { string val = v__gen__c__Gen_expr_string(g, field.expr); - strings__Builder_writeln(&g->stringliterals, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = const_name}}, {_SLIT(" = "), 0xfe10, {.d_s = val}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->stringliterals, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (field.expr._typ == 291 /* v.ast.CallExpr */) { + else if (field.expr._typ == 292 /* v.ast.CallExpr */) { if (v__ast__Type_has_flag((*field.expr._v__ast__CallExpr).return_type, v__ast__TypeFlag__optional)) { g->inside_const_optional = true; bool unwrap_option = (*field.expr._v__ast__CallExpr).or_block.kind != v__ast__OrKind__absent; @@ -71130,7 +71406,7 @@ if (v__gen__c__Gen_const_decl_defer_0) { VV_LOCAL_SYMBOL bool v__gen__c__Gen_const_decl_precomputed(v__gen__c__Gen* g, string mod, string name, v__ast__ComptTimeConstValue ct_value, v__ast__Type typ) { string styp = v__gen__c__Gen_typ(g, typ); - string cname = (g->pref->translated && !g->is_builtin_mod ? (name) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string cname = (g->pref->translated && !g->is_builtin_mod ? (name) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})))); if (ct_value._typ == 5 /* i8 */) { v__gen__c__Gen_const_decl_write_precomputed(g, styp, cname, i8_str((*ct_value._i8))); } @@ -71182,20 +71458,20 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_const_decl_precomputed(v__gen__c__Gen* g, st return _t3; } string escval = v__util__smart_quote(u8_ascii_str(((u8)(rune_code))), false); - v__gen__c__Gen_const_decl_write_precomputed(g, styp, cname, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = escval}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_const_decl_write_precomputed(g, styp, cname, str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = escval}}, {_SLIT("'"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_const_decl_write_precomputed(g, styp, cname, u32_str(((u32)((*ct_value._rune))))); } } else if (ct_value._typ == 20 /* string */) { string escaped_val = v__util__smart_quote((*ct_value._string), false); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = cname}}, {_SLIT("; // str inited later"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->init, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = cname}}, {_SLIT(" = _SLIT(\""), 0xfe10, {.d_s = escaped_val}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT("; // str inited later"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->init, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = escaped_val}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); if (g->is_autofree) { - strings__Builder_writeln(&(*(strings__Builder*)map_get(ADDR(map, g->cleanups), &(string[]){mod}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&(*(strings__Builder*)map_get(ADDR(map, g->cleanups), &(string[]){mod}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })), str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } - else if (ct_value._typ == 301 /* v.ast.EmptyExpr */) { + else if (ct_value._typ == 302 /* v.ast.EmptyExpr */) { bool _t4 = false; return _t4; } @@ -71205,18 +71481,18 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_const_decl_precomputed(v__gen__c__Gen* g, st } VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_write_precomputed(v__gen__c__Gen* g, string styp, string cname, string ct_value) { - strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = cname}}, {_SLIT(" = "), 0xfe10, {.d_s = ct_value}}, {_SLIT("; // precomputed"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = ct_value}}, {_SLIT("; // precomputed"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_simple_define(v__gen__c__Gen* g, string name, string val) { - strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define _const_"), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define _const_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->definitions, val); } VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_init_later(v__gen__c__Gen* g, string mod, string name, v__ast__Expr expr, v__ast__Type typ, bool unwrap_option) { string styp = v__gen__c__Gen_typ(g, typ); - string cname = (g->pref->translated && !g->is_builtin_mod ? (name) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})))); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = cname}}, {_SLIT("; // inited later"), 0, { .d_c = 0 }}}))); + string cname = (g->pref->translated && !g->is_builtin_mod ? (name) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT("; // inited later"), 0, { .d_c = 0 }}}))); if (string__eq(cname, _SLIT("_const_os__args"))) { if (g->pref->os == v__pref__OS__windows) { strings__Builder_writeln(&g->init, _SLIT("\t_const_os__args = os__init_os_args_wide(___argc, (byteptr*)___argv);")); @@ -71226,26 +71502,26 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_init_later(v__gen__c__Gen* g, str } else { if (unwrap_option) { strings__Builder_writeln(&g->init, _SLIT("{")); - strings__Builder_writeln(&g->init, v__gen__c__Gen_expr_string_surround(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = cname}}, {_SLIT(" = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}})), expr, _SLIT(".data;"))); + strings__Builder_writeln(&g->init, v__gen__c__Gen_expr_string_surround(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}})), expr, _SLIT(".data;"))); strings__Builder_writeln(&g->init, _SLIT("}")); } else { - strings__Builder_writeln(&g->init, v__gen__c__Gen_expr_string_surround(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = cname}}, {_SLIT(" = "), 0, { .d_c = 0 }}})), expr, _SLIT(";"))); + strings__Builder_writeln(&g->init, v__gen__c__Gen_expr_string_surround(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = "), 0, { .d_c = 0 }}})), expr, _SLIT(";"))); } } if (g->is_autofree) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); if (string_starts_with(styp, _SLIT("Array_"))) { if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("free"))) { - strings__Builder_writeln(&g->cleanup, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT("_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tarray_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tarray_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else if (string__eq(styp, _SLIT("string"))) { - strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__map) { - strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmap_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmap_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (string__eq(styp, _SLIT("IError"))) { - strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError_free(&"), 0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->cleanup, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError_free(&"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } } @@ -71267,21 +71543,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_global_decl(v__gen__c__Gen* g, v__ast__Globa } string styp = v__gen__c__Gen_typ(g, field.typ); v__ast__Expr anon_fn_expr = field.expr; - if (field.has_expr && (anon_fn_expr)._typ == 283 /* v.ast.AnonFn */) { + if (field.has_expr && (anon_fn_expr)._typ == 284 /* v.ast.AnonFn */) { v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*anon_fn_expr._v__ast__AnonFn)); string fn_type_name = v__gen__c__Gen_get_anon_fn_type_name(g, (voidptr)&/*qq*/(*anon_fn_expr._v__ast__AnonFn), field.name); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_type_name}}, {_SLIT(" = "), 0xfe10, {.d_s = v__ast__Table_sym(g->table, field.typ)->name}}, {_SLIT("; // global2"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_type_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(g->table, field.typ)->name}}, {_SLIT("; // global2"), 0, { .d_c = 0 }}}))); continue; } string modifier = (field.is_volatile ? (_SLIT(" volatile ")) : (_SLIT(""))); - strings__Builder_write_string(&g->definitions, str_intp(6, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = visibility_kw}}, {_SLIT0, 0xfe10, {.d_s = modifier}}, {_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = attributes}}, {_SLIT(" "), 0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = visibility_kw}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = modifier}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = attributes}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (field.has_expr || cinit) { if (g->pref->translated) { - strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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) { - strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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"), 0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__Gen_expr_string(g, field.expr)}}, {_SLIT("; // 3global"), 0, { .d_c = 0 }}}))); + 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 }}}))); } } else if (!g->pref->translated) { string default_initializer = v__gen__c__Gen_type_default(g, field.typ); @@ -71289,7 +71565,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_global_decl(v__gen__c__Gen* g, v__ast__Globa strings__Builder_write_string(&g->definitions, _SLIT(" = {0}")); } else { if (!(string__eq(field.name, _SLIT("as_cast_type_indexes")) || string__eq(field.name, _SLIT("g_memory_block")) || string__eq(field.name, _SLIT("global_allocator")))) { - strings__Builder_writeln(&g->global_init, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = field.name}}, {_SLIT(" = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)&(("), 0xfe10, {.d_s = styp}}, {_SLIT("[]){"), 0xfe10, {.d_s = v__gen__c__Gen_type_default(g, field.typ)}}, {_SLIT("}[0]); // global"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->global_init, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)&(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]){"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_type_default(g, field.typ)}}, {_SLIT("}[0]); // global"), 0, { .d_c = 0 }}}))); } } } @@ -71303,28 +71579,28 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_assoc(v__gen__c__Gen* g, v__ast__Assoc node) return; } string styp = v__gen__c__Gen_typ(g, node.typ); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); Map_string_int inited_fields = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); for (int i = 0; i < node.fields.len; ++i) { string field = ((string*)node.fields.data)[i]; map_set(&inited_fields, &(string[]){field}, &(int[]) { i }); } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.typ); - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; for (int _t1 = 0; _t1 < info.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t1]; string field_name = v__gen__c__c_name(field.name); if (_IN_MAP(ADDR(string, field.name), ADDR(map, inited_fields))) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, (*(int*)map_get(ADDR(map, inited_fields), &(string[]){field.name}, &(int[]){ 0 }))))); v__gen__c__Gen_writeln(g, _SLIT(", ")); } else { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0xfe10, {.d_s = node.var_name}}, {_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = node.var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_write(g, _SLIT("}")); if (g->is_amp) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } @@ -71345,7 +71621,7 @@ VNORETURN VV_LOCAL_SYMBOL void v__gen__c__Gen_error(v__gen__c__Gen* g, string s, } VV_LOCAL_SYMBOL void v__gen__c__Gen_checker_bug(v__gen__c__Gen* g, string s, v__token__Pos pos) { - v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker bug; "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("checker bug; "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); VUNREACHABLE(); } @@ -71381,17 +71657,17 @@ bool v__gen__c__Gen_write_init_function_defer_0 = false; v__gen__c__Gen_writeln(g, _SLIT("\tvinit_string_literals();")); for (int _t1 = 0; _t1 < g->table->modules.len; ++_t1) { string mod_name = ((string*)g->table->modules.data)[_t1]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t{ // Initializations for module "), 0xfe10, {.d_s = mod_name}}, {_SLIT(" :"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t{ // Initializations for module "), /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(" :"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, strings__Builder_str(&(*(strings__Builder*)map_get(ADDR(map, g->inits), &(string[]){mod_name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })))); v__gen__c__Gen_write(g, strings__Builder_str(&(*(strings__Builder*)map_get(ADDR(map, g->global_inits), &(string[]){mod_name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })))); - string init_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod_name}}, {_SLIT(".init"), 0, { .d_c = 0 }}})); + string init_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(".init"), 0, { .d_c = 0 }}})); Option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, init_fn_name), _t2.state == 0) { v__ast__Fn initfn = *(v__ast__Fn*)_t2.data; if (v__ast__Type_alias_eq(initfn.return_type, _const_v__ast__void_type) && initfn.params.len == 0) { string mod_c_name = v__util__no_dots(mod_name); - string init_fn_c_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod_c_name}}, {_SLIT("__init"), 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = init_fn_c_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + string init_fn_c_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod_c_name}}, {_SLIT("__init"), 0, { .d_c = 0 }}})); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = init_fn_c_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("\t}")); @@ -71406,7 +71682,7 @@ bool v__gen__c__Gen_write_init_function_defer_0 = false; Array_string reversed_table_modules = array_reverse(g->table->modules); for (int _t3 = 0; _t3 < reversed_table_modules.len; ++_t3) { string mod_name = ((string*)reversed_table_modules.data)[_t3]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t// Cleanups for module "), 0xfe10, {.d_s = mod_name}}, {_SLIT(" :"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t// Cleanups for module "), /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(" :"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, strings__Builder_str(&(*(strings__Builder*)map_get(ADDR(map, g->cleanups), &(string[]){mod_name}, &(strings__Builder[]){ __new_array(0, 0, sizeof(u8)) })))); } v__gen__c__Gen_writeln(g, _SLIT("\tarray_free(&as_cast_type_indexes);")); @@ -71486,12 +71762,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ strings__Builder_writeln(&g->typedefs, _SLIT("typedef struct none none;")); } string name = sym->cname; - if (sym->info._typ == 455 /* v.ast.Struct */) { + if (sym->info._typ == 456 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { continue; } if (string_contains(name, _SLIT("_T_"))) { - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } int start_pos = g->type_definitions.len; string pre_pragma = _SLIT(""); @@ -71500,7 +71776,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ v__ast__Attr attr = ((v__ast__Attr*)(*sym->info._v__ast__Struct).attrs.data)[_t2]; if (string__eq(attr.name, _SLIT("_pack"))) { - pre_pragma = /*f*/string__plus(pre_pragma, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#pragma pack(push, "), 0xfe10, {.d_s = attr.arg}}, {_SLIT(")\n"), 0, { .d_c = 0 }}}))); + pre_pragma = /*f*/string__plus(pre_pragma, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#pragma pack(push, "), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT(")\n"), 0, { .d_c = 0 }}}))); post_pragma = /*f*/string__plus(post_pragma, _SLIT("#pragma pack(pop)")); } else { @@ -71508,25 +71784,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ } strings__Builder_writeln(&g->type_definitions, pre_pragma); if ((*sym->info._v__ast__Struct).is_union) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("union "), 0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("union "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); } if ((*sym->info._v__ast__Struct).fields.len > 0 || (*sym->info._v__ast__Struct).embeds.len > 0) { 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_142325 = v__gen__c__Gen_optional_type_name(g, field.typ); - string styp = mr_142325.arg0; - string base = mr_142325.arg1; + multi_return_string_string mr_146119 = v__gen__c__Gen_optional_type_name(g, field.typ); + string styp = mr_146119.arg0; + string base = mr_146119.arg1; sync__RwMutex_lock(&g->done_optionals->mtx); /*lock*/ { if (!Array_string_contains(g->done_optionals->val, base)) { array_push((array*)&g->done_optionals->val, _MOV((string[]){ string_clone(base) })); string last_text = string_clone(strings__Builder_after(&g->type_definitions, start_pos)); strings__Builder_go_back_to(&g->type_definitions, start_pos); - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_optional_type_text(g, styp, base)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_optional_type_text(g, styp, base)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->type_definitions, last_text); } } @@ -71535,50 +71811,50 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ string type_name = v__gen__c__Gen_typ(g, field.typ); string field_name = v__gen__c__c_name(field.name); string volatile_prefix = (field.is_volatile ? (_SLIT("volatile ")) : (_SLIT(""))); - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = volatile_prefix}}, {_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = field_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = volatile_prefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else { strings__Builder_writeln(&g->type_definitions, _SLIT("\tEMPTY_STRUCT_DECLARATION;")); } string ti_attrs = (Array_v__ast__Attr_contains((*sym->info._v__ast__Struct).attrs, _SLIT("packed")) ? (_SLIT("__attribute__((__packed__))")) : (_SLIT(""))); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}"), 0xfe10, {.d_s = ti_attrs}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}"), /*115 &string*/0xfe10, {.d_s = ti_attrs}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, post_pragma); } - else if (sym->info._typ == 470 /* v.ast.Alias */) { + else if (sym->info._typ == 471 /* v.ast.Alias */) { } - else if (sym->info._typ == 480 /* v.ast.Thread */) { + else if (sym->info._typ == 481 /* v.ast.Thread */) { if (g->pref->os == v__pref__OS__windows) { if (string__eq(name, _SLIT("__v_thread"))) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef HANDLE "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef HANDLE "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { strings__Builder_writeln(&g->type_definitions, _SLIT("typedef struct {")); strings__Builder_writeln(&g->type_definitions, _SLIT("\tvoid* ret_ptr;")); strings__Builder_writeln(&g->type_definitions, _SLIT("\tHANDLE handle;")); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } else { if (!g->pref->is_bare && !g->pref->no_builtin) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef pthread_t "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef pthread_t "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } - else if (sym->info._typ == 474 /* v.ast.SumType */) { + else if (sym->info._typ == 475 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { continue; } - strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), 0xfe10, {.d_s = name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->typedefs, str_intp(3, _MOV((StrIntpData[]){{_SLIT("typedef struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, _SLIT("")); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Union sum type "), 0xfe10, {.d_s = name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Union sum type "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); for (int _t5 = 0; _t5 < (*sym->info._v__ast__SumType).variants.len; ++_t5) { v__ast__Type variant = ((v__ast__Type*)(*sym->info._v__ast__SumType).variants.data)[_t5]; - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// | "), 0x8fe27, {.d_i32 = variant}}, {_SLIT(" = "), 0x28fe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_idx(variant))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// | "), /*100 &v.ast.Type*/0x8fe27, {.d_i32 = variant}}, {_SLIT(" = "), /*115 &string*/0x28fe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_idx(variant))}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), 0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, _SLIT("\tunion {")); for (int _t6 = 0; _t6 < (*sym->info._v__ast__SumType).variants.len; ++_t6) { v__ast__Type variant = ((v__ast__Type*)(*sym->info._v__ast__SumType).variants.data)[_t6]; v__ast__TypeSymbol* variant_sym = v__ast__Table_sym(g->table, variant); - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_ref(variant))}}, {_SLIT(" _"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_ref(variant))}}, {_SLIT(" _"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->type_definitions, _SLIT("\t};")); strings__Builder_writeln(&g->type_definitions, _SLIT("\tint _typ;")); @@ -71586,13 +71862,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ v__gen__c__Gen_writeln(g, _SLIT("\t// pointers to common sumtype fields")); for (int _t7 = 0; _t7 < (*sym->info._v__ast__SumType).fields.len; ++_t7) { v__ast__StructField field = ((v__ast__StructField*)(*sym->info._v__ast__SumType).fields.data)[_t7]; - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_ref(field.typ))}}, {_SLIT(" "), 0xfe10, {.d_s = field.name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, v__ast__Type_ref(field.typ))}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&g->type_definitions, _SLIT("};")); strings__Builder_writeln(&g->type_definitions, _SLIT("")); } - else if (sym->info._typ == 478 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 479 /* v.ast.ArrayFixed */) { v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__ArrayFixed).elem_type); if (!v__ast__TypeSymbol_is_builtin(elem_sym) && !v__ast__Type_has_flag((*sym->info._v__ast__ArrayFixed).elem_type, v__ast__TypeFlag__generic)) { string styp = sym->cname; @@ -71604,15 +71880,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ if (string_starts_with(fixed_elem_name, _SLIT("C__"))) { fixed_elem_name = string_substr(fixed_elem_name, 3, (fixed_elem_name).len); } - if ((elem_sym->info)._typ == 482 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 483 /* v.ast.FnType */) { int pos = g->out.len; v__gen__c__Gen_write_fn_ptr_decl(g, &(*elem_sym->info._v__ast__FnType), _SLIT("")); fixed_elem_name = strings__Builder_cut_to(&g->out, pos); - string def_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = fixed_elem_name}}, {_SLIT(";"), 0, { .d_c = 0 }}})); - def_str = string_replace_once(def_str, _SLIT("(*)"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*"), 0xfe10, {.d_s = styp}}, {_SLIT("["), 0xfe07, {.d_i32 = len}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + string def_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = fixed_elem_name}}, {_SLIT(";"), 0, { .d_c = 0 }}})); + def_str = string_replace_once(def_str, _SLIT("(*)"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->type_definitions, def_str); } else { - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = fixed_elem_name}}, {_SLIT(" "), 0xfe10, {.d_s = styp}}, {_SLIT(" ["), 0xfe07, {.d_i32 = len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = fixed_elem_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } } @@ -71640,13 +71916,13 @@ bool v__gen__c__Gen_sort_structs_defer_0 = false; continue; } Array_string field_deps = __new_array_with_default(0, 0, sizeof(string), 0); - if (sym->info._typ == 478 /* v.ast.ArrayFixed */) { + if (sym->info._typ == 479 /* v.ast.ArrayFixed */) { string dep = v__ast__Table_sym(g->table, (*sym->info._v__ast__ArrayFixed).elem_type)->name; if (Array_string_contains(type_names, dep)) { array_push((array*)&field_deps, _MOV((string[]){ string_clone(dep) })); } } - else if (sym->info._typ == 455 /* v.ast.Struct */) { + else if (sym->info._typ == 456 /* v.ast.Struct */) { for (int _t5 = 0; _t5 < (*sym->info._v__ast__Struct).embeds.len; ++_t5) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Struct).embeds.data)[_t5]; string dep = v__ast__Table_sym(g->table, embed)->name; @@ -71666,7 +71942,7 @@ bool v__gen__c__Gen_sort_structs_defer_0 = false; continue; } array_push((array*)&field_deps, _MOV((string[]){ string_clone(dep) })); - if ((fsym->info)._typ == 470 /* v.ast.Alias */) { + if ((fsym->info)._typ == 471 /* v.ast.Alias */) { string xdep = v__ast__Table_sym(g->table, (*fsym->info._v__ast__Alias).parent_type)->name; if (!Array_string_contains(type_names, xdep) || Array_string_contains(field_deps, xdep)) { continue; @@ -71742,31 +72018,35 @@ bool v__gen__c__Gen_or_block_defer_0 = false; bool is_none_ok = v__ast__Type_alias_eq(return_type, _const_v__ast__ovoid_type); v__gen__c__Gen_writeln(g, _SLIT(";")); if (is_none_ok) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".state != 0 && "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ != _IError_None___index) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".state != 0 && "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ != _IError_None___index) {"), 0, { .d_c = 0 }}}))); } else { if (return_type != 0 && v__ast__Table_sym(g->table, return_type)->kind == v__ast__Kind__function) { mr_styp = _SLIT("voidptr"); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".state != 0) { /*or block*/ "), 0, { .d_c = 0 }}}))); + if (v__ast__Type_has_flag(return_type, v__ast__TypeFlag__result)) { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".is_error) { /*or block*/ "), 0, { .d_c = 0 }}}))); + } else { + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".state != 0) { /*or block*/ "), 0, { .d_c = 0 }}}))); + } } if (or_block.kind == v__ast__OrKind__block) { g->or_expr_return_type = v__ast__Type_clear_flag(return_type, v__ast__TypeFlag__optional); if (g->inside_or_block) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\terr = "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\terr = "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError err = "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError err = "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); } g->inside_or_block = true; v__gen__c__Gen_or_block_defer_0 = true; Array_v__ast__Stmt stmts = or_block.stmts; - if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 345 /* v.ast.ExprStmt */ && !v__ast__Type_alias_eq((/* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(stmts)))._typ, 345) /*expected idx: 345, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 346 /* v.ast.ExprStmt */ && !v__ast__Type_alias_eq((/* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(stmts)))._typ, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { g->indent++; for (int i = 0; i < stmts.len; ++i) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[i]; if (i == stmts.len - 1) { - v__ast__ExprStmt expr_stmt = /* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 345) /*expected idx: 345, name: v.ast.ExprStmt */ ; + v__ast__ExprStmt expr_stmt = /* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("*("), 0xfe10, {.d_s = mr_styp}}, {_SLIT("*) "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".data = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("*("), /*115 &string*/0xfe10, {.d_s = mr_styp}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".data = "), 0, { .d_c = 0 }}}))); bool old_inside_opt_data = g->inside_opt_data; g->inside_opt_data = true; v__gen__c__Gen_expr_with_cast(g, expr_stmt.expr, expr_stmt.typ, v__ast__Type_clear_flag(return_type, v__ast__TypeFlag__optional)); @@ -71782,23 +72062,23 @@ bool v__gen__c__Gen_or_block_defer_0 = false; g->indent--; } else { v__gen__c__Gen_stmts(g, stmts); - if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 345 /* v.ast.ExprStmt */) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 346 /* v.ast.ExprStmt */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } g->or_expr_return_type = _const_v__ast__void_type; - } else if (or_block.kind == v__ast__OrKind__propagate) { + } else if (or_block.kind == v__ast__OrKind__propagate_option) { 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["), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); + 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_151479 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_151479.arg0; - string pafile = mr_151479.arg1; - string pamod = mr_151479.arg2; - string pafn = mr_151479.arg3; - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), 0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), 0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + multi_return_int_string_string_string mr_155392 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_155392.arg0; + string pafile = mr_155392.arg1; + string pamod = mr_155392.arg2; + string pafn = mr_155392.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( "), 0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + 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 }}}))); } } else if (!isnil(g->fn_decl) && g->fn_decl->is_test) { v__gen__c__Gen_gen_failing_error_propagation_for_test_fn(g, or_block, cvar_name); @@ -71809,9 +72089,36 @@ bool v__gen__c__Gen_or_block_defer_0 = false; } else { string styp = v__gen__c__Gen_typ(g, g->fn_decl->return_type); string err_obj = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(&"), 0xfe10, {.d_s = err_obj}}, {_SLIT(", &"), 0xfe10, {.d_s = cvar_name}}, {_SLIT(", sizeof(Option));"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(&"), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(", &"), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(", sizeof(Option));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } + } + } else if (or_block.kind == v__ast__OrKind__propagate_result) { + 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_156659 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_156659.arg0; + string pafile = mr_156659.arg1; + string pamod = mr_156659.arg2; + string pafn = mr_156659.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 }}}))); + } + } else if (!isnil(g->fn_decl) && g->fn_decl->is_test) { + v__gen__c__Gen_gen_failing_error_propagation_for_test_fn(g, or_block, cvar_name); + } else { + v__gen__c__Gen_write_defer_stmts(g); + if (v__ast__Type_alias_eq(g->fn_decl->return_type, _const_v__ast__void_type)) { + v__gen__c__Gen_writeln(g, _SLIT("\treturn;")); + } else { + string styp = v__gen__c__Gen_typ(g, g->fn_decl->return_type); + string err_obj = v__gen__c__Gen_new_tmp_var(g); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(&"), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(", &"), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__result_name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = err_obj}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } @@ -71828,7 +72135,7 @@ if (v__gen__c__Gen_or_block_defer_0) { inline VV_LOCAL_SYMBOL string v__gen__c__c_name(string name_) { string name = v__util__no_dots(name_); if (_IN_MAP(ADDR(string, name), ADDR(map, _const_v__gen__c__c_reserved_map))) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } string _t2 = name; @@ -71868,7 +72175,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty } case v__ast__Kind__alias: { - string _t6 = v__gen__c__Gen_type_default(g, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type); + string _t6 = v__gen__c__Gen_type_default(g, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type); return _t6; break; } @@ -71877,7 +72184,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty v__ast__Type elem_type = v__ast__TypeSymbol_chan_info(sym).elem_type; string elemtypstr = v__gen__c__Gen_typ(g, elem_type); string noscan = v__gen__c__Gen_check_noscan(g, elem_type); - string _t7 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("sync__new_channel_st"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, sizeof("), 0xfe10, {.d_s = elemtypstr}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string _t7 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("sync__new_channel_st"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, sizeof("), /*115 &string*/0xfe10, {.d_s = elemtypstr}}, {_SLIT("))"), 0, { .d_c = 0 }}})); return _t7; break; } @@ -71890,10 +72197,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty elem_type_str = string_substr(elem_type_str, 3, (elem_type_str).len); } string noscan = v__gen__c__Gen_check_noscan(g, elem_typ); - string init_str = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__new_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, 0, sizeof("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string init_str = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__new_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, 0, sizeof("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("))"), 0, { .d_c = 0 }}})); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - string atyp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); - string _t8 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = atyp}}, {_SLIT("*)__dup_shared_array(&("), 0xfe10, {.d_s = atyp}}, {_SLIT("){.mtx = {0}, .val ="), 0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), 0xfe10, {.d_s = atyp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string atyp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t8 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = atyp}}, {_SLIT("*)__dup_shared_array(&("), /*115 &string*/0xfe10, {.d_s = atyp}}, {_SLIT("){.mtx = {0}, .val ="), /*115 &string*/0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = atyp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); return _t8; } else { string _t9 = init_str; @@ -71905,11 +72212,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_154061 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); - string hash_fn = mr_154061.arg0; - string key_eq_fn = mr_154061.arg1; - string clone_fn = mr_154061.arg2; - string free_fn = mr_154061.arg3; + multi_return_string_string_string_string mr_159244 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); + string hash_fn = mr_159244.arg0; + string key_eq_fn = mr_159244.arg1; + string clone_fn = mr_159244.arg2; + string free_fn = mr_159244.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(""))); @@ -71921,10 +72228,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty noscan = /*f*/string__plus(noscan, _SLIT("_value")); } } - string init_str = str_intp(8, _MOV((StrIntpData[]){{_SLIT("new_map"), 0xfe10, {.d_s = noscan}}, {_SLIT("(sizeof("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.key_type)}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.value_type)}}, {_SLIT("), "), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + string init_str = str_intp(8, _MOV((StrIntpData[]){{_SLIT("new_map"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(sizeof("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.key_type)}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.value_type)}}, {_SLIT("), "), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(")"), 0, { .d_c = 0 }}})); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - string mtyp = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__shared__Map_"), 0xfe10, {.d_s = key_typ->cname}}, {_SLIT("_"), 0xfe10, {.d_s = v__ast__Table_sym(g->table, info.value_type)->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); - string _t10 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = mtyp}}, {_SLIT("*)__dup_shared_map(&("), 0xfe10, {.d_s = mtyp}}, {_SLIT("){.mtx = {0}, .val ="), 0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), 0xfe10, {.d_s = mtyp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string mtyp = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__shared__Map_"), /*115 &string*/0xfe10, {.d_s = key_typ->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(g->table, info.value_type)->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t10 = str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = mtyp}}, {_SLIT("*)__dup_shared_map(&("), /*115 &string*/0xfe10, {.d_s = mtyp}}, {_SLIT("){.mtx = {0}, .val ="), /*115 &string*/0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = mtyp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); return _t10; } else { string _t11 = init_str; @@ -71936,7 +72243,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty { bool has_none_zero = false; string init_str = _SLIT("{"); - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; bool typ_is_shared_f = v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f); if (sym->language == v__ast__Language__v && !typ_is_shared_f) { for (int _t12 = 0; _t12 < info.fields.len; ++_t12) { @@ -71951,17 +72258,17 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty } else { expr_str = v__gen__c__Gen_expr_string(g, field.default_expr); } - init_str = /*f*/string__plus(init_str, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0xfe10, {.d_s = expr_str}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + init_str = /*f*/string__plus(init_str, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = expr_str}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } else { string zero_str = v__gen__c__Gen_type_default(g, field.typ); if (string__eq(zero_str, _SLIT("{0}"))) { - if ((field_sym->info)._typ == 455 /* v.ast.Struct */ && field_sym->language == v__ast__Language__v) { + if ((field_sym->info)._typ == 456 /* v.ast.Struct */ && field_sym->language == v__ast__Language__v) { if ((*field_sym->info._v__ast__Struct).fields.len == 0 && (*field_sym->info._v__ast__Struct).embeds.len == 0) { zero_str = _SLIT("{EMPTY_STRUCT_INITIALIZATION}"); } } } - init_str = /*f*/string__plus(init_str, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0xfe10, {.d_s = zero_str}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + init_str = /*f*/string__plus(init_str, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = zero_str}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } has_none_zero = true; } @@ -71970,13 +72277,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty if (has_none_zero) { init_str = /*f*/string__plus(init_str, _SLIT("}")); string type_name = v__gen__c__Gen_typ(g, typ); - init_str = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = type_name}}, {_SLIT(")"), 0, { .d_c = 0 }}})), init_str); + init_str = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(")"), 0, { .d_c = 0 }}})), init_str); } else { init_str = /*f*/string__plus(init_str, _SLIT("0}")); } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__shared_f)) { - string styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), 0xfe10, {.d_s = v__ast__Table_sym(g->table, typ)->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); - string _t13 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("*)__dup"), 0xfe10, {.d_s = styp}}, {_SLIT("(&("), 0xfe10, {.d_s = styp}}, {_SLIT("){.mtx = {0}, .val ="), 0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("__shared__"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(g->table, typ)->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t13 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)__dup"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){.mtx = {0}, .val ="), /*115 &string*/0xfe10, {.d_s = init_str}}, {_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}})); return _t13; } else { string _t14 = init_str; @@ -72072,19 +72379,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_size_of(v__gen__c__Gen* g, v__ast__SizeOf no v__ast__Type node_typ = v__gen__c__Gen_unwrap_generic(g, typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node_typ); if (sym->language == v__ast__Language__v && (sym->kind == v__ast__Kind__placeholder || sym->kind == v__ast__Kind__any)) { - v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown type `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); VUNREACHABLE(); } string styp = v__gen__c__Gen_typ(g, node_typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), 0xfe10, {.d_s = v__util__no_dots(styp)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sizeof("), /*115 &string*/0xfe10, {.d_s = v__util__no_dots(styp)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } 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__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("/*enum val is_number "), 0xfe10, {.d_s = node.mod}}, {_SLIT(" styp="), 0xfe10, {.d_s = styp}}, {_SLIT("*/_const_main__"), 0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT("__"), 0xfe10, {.d_s = node.val}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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 }}}))); } } @@ -72093,20 +72401,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_as_cast(v__gen__c__Gen* g, v__ast__AsCast no string styp = v__gen__c__Gen_typ(g, unwrapped_node_typ); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, unwrapped_node_typ); v__ast__TypeSymbol* expr_type_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.expr_type)); - if ((expr_type_sym->info)._typ == 474 /* v.ast.SumType */) { + if ((expr_type_sym->info)._typ == 475 /* v.ast.SumType */) { string dot = (v__ast__Type_is_ptr(node.expr_type) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* as */ *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)__as_cast("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* as */ *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)__as_cast("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")")); v__gen__c__Gen_write(g, dot); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT(","), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")")); v__gen__c__Gen_write(g, dot); string sidx = v__gen__c__Gen_type_sidx(g, unwrapped_node_typ); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("_typ, "), 0xfe10, {.d_s = sidx}}, {_SLIT(") /*expected idx: "), 0xfe10, {.d_s = sidx}}, {_SLIT(", name: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("_typ, "), /*115 &string*/0xfe10, {.d_s = sidx}}, {_SLIT(") /*expected idx: "), /*115 &string*/0xfe10, {.d_s = sidx}}, {_SLIT(", name: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */ "), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < (*expr_type_sym->info._v__ast__SumType).variants.len; ++_t1) { v__ast__Type variant = ((v__ast__Type*)(*expr_type_sym->info._v__ast__SumType).variants.data)[_t1]; string idx = u32_str(((u32)(variant))); @@ -72117,13 +72425,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_as_cast(v__gen__c__Gen* g, v__ast__AsCast no map_set(&g->as_cast_type_names, &(string[]){idx}, &(string[]) { variant_sym->name }); } } else if (expr_type_sym->kind == v__ast__Kind__interface_ && sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), 0xfe10, {.d_s = expr_type_sym->cname}}, {_SLIT("_as_I_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), /*115 &string*/0xfe10, {.d_s = expr_type_sym->cname}}, {_SLIT("_as_I_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(node.expr_type)) { v__gen__c__Gen_write(g, _SLIT("*")); } v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(")")); - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((expr_type_sym->info)._v__ast__Interface,(expr_type_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((expr_type_sym->info)._v__ast__Interface,(expr_type_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; if (!_IN_MAP(ADDR(int, node.typ), ADDR(map, info.conversions))) { Array_v__ast__Type left_variants = (*(Array_v__ast__Type*)map_get(ADDR(map, g->table->iface_types), &(string[]){expr_type_sym->name}, &(Array_v__ast__Type[]){ __new_array(0, 0, sizeof(v__ast__Type)) })); Array_v__ast__Type right_variants = (*(Array_v__ast__Type*)map_get(ADDR(map, g->table->iface_types), &(string[]){sym->name}, &(Array_v__ast__Type[]){ __new_array(0, 0, sizeof(v__ast__Type)) })); @@ -72153,7 +72461,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_as_cast_name_table(v__gen__c__Gen* g) { } strings__Builder name_ast = strings__new_builder(1024); int casts_len = g->as_cast_type_names.len + 1; - strings__Builder_writeln(&name_ast, str_intp(4, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array("), 0xfe07, {.d_i32 = casts_len}}, {_SLIT(", "), 0xfe07, {.d_i32 = casts_len}}, {_SLIT(", sizeof(VCastTypeIndexName), _MOV((VCastTypeIndexName["), 0xfe07, {.d_i32 = casts_len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&name_ast, str_intp(4, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = casts_len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = casts_len}}, {_SLIT(", sizeof(VCastTypeIndexName), _MOV((VCastTypeIndexName["), /*100 &int*/0xfe07, {.d_i32 = casts_len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&name_ast, _SLIT("\t\t (VCastTypeIndexName){.tindex = 0, .tname = _SLIT(\"unknown\")}")); Map_string_string _t2 = g->as_cast_type_names; int _t4 = _t2.key_values.len; @@ -72168,7 +72476,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_as_cast_name_table(v__gen__c__Gen* g) { string key = /*key*/ *(string*)DenseArray_key(&_t2.key_values, _t3); key = string_clone(key); string value = (*(string*)DenseArray_value(&_t2.key_values, _t3)); - strings__Builder_writeln(&name_ast, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t, (VCastTypeIndexName){.tindex = "), 0xfe10, {.d_s = key}}, {_SLIT(", .tname = _SLIT(\""), 0xfe10, {.d_s = value}}, {_SLIT("\")}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&name_ast, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t, (VCastTypeIndexName){.tindex = "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(", .tname = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = value}}, {_SLIT("\")}"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&name_ast, _SLIT("\t}));\n")); string _t6 = strings__Builder_str(&name_ast); @@ -72194,26 +72502,26 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { if (isym->kind != v__ast__Kind__interface_) { continue; } - if ((isym->info)._typ != 473 /* v.ast.Interface */) { + if ((isym->info)._typ != 474 /* v.ast.Interface */) { continue; } - v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; if (inter_info.is_generic) { continue; } string interface_name = isym->cname; - string methods_struct_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_interface_methods"), 0, { .d_c = 0 }}})); + string methods_struct_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_interface_methods"), 0, { .d_c = 0 }}})); strings__Builder methods_struct_def = strings__new_builder(100); - strings__Builder_writeln(&methods_struct_def, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct_def, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); Map_string_int methodidx = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); for (int k = 0; k < inter_info.methods.len; ++k) { v__ast__Fn method = ((v__ast__Fn*)inter_info.methods.data)[k]; map_set(&methodidx, &(string[]){method.name}, &(int[]) { k }); string ret_styp = v__gen__c__Gen_typ(g, method.return_type); - strings__Builder_write_string(&methods_struct_def, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*_method_"), 0xfe10, {.d_s = v__gen__c__c_name(method.name)}}, {_SLIT(")(void* _"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&methods_struct_def, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*_method_"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(method.name)}}, {_SLIT(")(void* _"), 0, { .d_c = 0 }}}))); for (int i = 1; i < method.params.len; ++i) { v__ast__Param arg = (*(v__ast__Param*)/*ee elem_sym */array_get(method.params, i)); - strings__Builder_write_string(&methods_struct_def, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, arg.typ)}}, {_SLIT(" "), 0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&methods_struct_def, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, arg.typ)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&methods_struct_def, _SLIT(");")); } @@ -72221,17 +72529,17 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { strings__Builder methods_struct = strings__new_builder(100); int iname_table_length = inter_info.types.len; if (iname_table_length == 0) { - strings__Builder_writeln(&methods_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), 0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table[1];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table[1];"), 0, { .d_c = 0 }}}))); } else { if (g->pref->build_mode != v__pref__BuildMode__build_module) { - strings__Builder_writeln(&methods_struct, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), 0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table["), 0xfe07, {.d_i32 = iname_table_length}}, {_SLIT("] = {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table["), /*100 &int*/0xfe07, {.d_i32 = iname_table_length}}, {_SLIT("] = {"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&methods_struct, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), 0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table["), 0xfe07, {.d_i32 = iname_table_length}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = methods_struct_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_name_table["), /*100 &int*/0xfe07, {.d_i32 = iname_table_length}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } strings__Builder cast_functions = strings__new_builder(100); strings__Builder methods_wrapper = strings__new_builder(100); - strings__Builder_writeln(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Methods wrapper for interface \""), 0xfe10, {.d_s = interface_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// Methods wrapper for interface \""), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); Map_string_int already_generated_mwrappers = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); int iinidx_minimum_base = 1000; int current_iinidx = iinidx_minimum_base; @@ -72239,28 +72547,28 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { v__ast__Type st = ((v__ast__Type*)inter_info.types.data)[_t2]; v__ast__TypeSymbol* st_sym = v__ast__Table_sym(g->table, v__ast__mktyp(st)); string cctype = v__gen__c__Gen_cc_type(g, v__ast__mktyp(st), true); - string interface_index_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_"), 0xfe10, {.d_s = cctype}}, {_SLIT("_index"), 0, { .d_c = 0 }}})); + string interface_index_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_index"), 0, { .d_c = 0 }}})); if ((*(int*)map_get(ADDR(map, already_generated_mwrappers), &(string[]){interface_index_name}, &(int[]){ 0 })) > 0) { continue; } map_set(&already_generated_mwrappers, &(string[]){interface_index_name}, &(int[]) { current_iinidx }); current_iinidx++; if (!string__eq(isym->name, _SLIT("vweb.DbInterface"))) { - strings__Builder_writeln(&sb, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static "), 0xfe10, {.d_s = interface_name}}, {_SLIT(" I_"), 0xfe10, {.d_s = cctype}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("("), 0xfe10, {.d_s = cctype}}, {_SLIT("* x);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" I_"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("* x);"), 0, { .d_c = 0 }}}))); strings__Builder cast_struct = strings__new_builder(100); - strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = interface_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._"), 0xfe10, {.d_s = cctype}}, {_SLIT(" = x,"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._typ = "), 0xfe10, {.d_s = interface_index_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT(" = x,"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._typ = "), /*115 &string*/0xfe10, {.d_s = interface_index_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); for (int _t3 = 0; _t3 < inter_info.fields.len; ++_t3) { v__ast__StructField field = ((v__ast__StructField*)inter_info.fields.data)[_t3]; string cname = v__gen__c__c_name(field.name); string field_styp = v__gen__c__Gen_typ(g, field.typ); Option_v__ast__StructField _t4; if (_t4 = v__ast__TypeSymbol_find_field(st_sym, field.name), _t4.state == 0) { - strings__Builder_writeln(&cast_struct, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t."), 0xfe10, {.d_s = cname}}, {_SLIT(" = ("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)x + __offsetof_ptr(x, "), 0xfe10, {.d_s = cctype}}, {_SLIT(", "), 0xfe10, {.d_s = cname}}, {_SLIT(")),"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_struct, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t."), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)x + __offsetof_ptr(x, "), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(")),"), 0, { .d_c = 0 }}}))); } else { IError err = _t4.err; - strings__Builder_write_string(&cast_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t."), 0xfe10, {.d_s = cname}}, {_SLIT(" = ("), 0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)x"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&cast_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t."), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = field_styp}}, {_SLIT("*)((char*)x"), 0, { .d_c = 0 }}}))); if (v__ast__Type_alias_eq(st, _const_v__ast__voidptr_type)) { strings__Builder_write_string(&cast_struct, _SLIT("/*.... ast.voidptr_type */")); } else { @@ -72269,7 +72577,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, embed_type); Option_v__ast__StructField _t6; if (_t6 = v__ast__TypeSymbol_find_field(embed_sym, field.name), _t6.state == 0) { - strings__Builder_write_string(&cast_struct, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" + __offsetof_ptr(x, "), 0xfe10, {.d_s = cctype}}, {_SLIT(", "), 0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT(") + __offsetof_ptr(x, "), 0xfe10, {.d_s = embed_sym->cname}}, {_SLIT(", "), 0xfe10, {.d_s = cname}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&cast_struct, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" + __offsetof_ptr(x, "), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT(") + __offsetof_ptr(x, "), /*115 &string*/0xfe10, {.d_s = embed_sym->cname}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); break; } } @@ -72279,19 +72587,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } strings__Builder_write_string(&cast_struct, _SLIT("\t}")); string cast_struct_str = strings__Builder_str(&cast_struct); - strings__Builder_writeln(&cast_functions, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n// Casting functions for converting \""), 0xfe10, {.d_s = cctype}}, {_SLIT("\" to interface \""), 0xfe10, {.d_s = interface_name}}, {_SLIT("\"\nstatic inline "), 0xfe10, {.d_s = interface_name}}, {_SLIT(" I_"), 0xfe10, {.d_s = cctype}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("("), 0xfe10, {.d_s = cctype}}, {_SLIT("* x) {\n return "), 0xfe10, {.d_s = cast_struct_str}}, {_SLIT(";\n}"), 0, { .d_c = 0 }}}))); - string shared_fn_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("I___shared__"), 0xfe10, {.d_s = cctype}}, {_SLIT("_to_shared_Interface___shared__"), 0xfe10, {.d_s = interface_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + strings__Builder_writeln(&cast_functions, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n// Casting functions for converting \""), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("\" to interface \""), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("\"\nstatic inline "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" I_"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("* x) {\n return "), /*115 &string*/0xfe10, {.d_s = cast_struct_str}}, {_SLIT(";\n}"), 0, { .d_c = 0 }}}))); + string shared_fn_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("I___shared__"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_to_shared_Interface___shared__"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (v__gen__c__Gen_has_been_referenced(g, shared_fn_name)) { strings__Builder cast_shared_struct = strings__new_builder(100); - strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(__shared__"), 0xfe10, {.d_s = interface_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(__shared__"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&cast_shared_struct, _SLIT("\t\t.mtx = {0},")); strings__Builder_writeln(&cast_shared_struct, _SLIT("\t\t.val = {")); - strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t._"), 0xfe10, {.d_s = cctype}}, {_SLIT(" = &x->val,"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t._typ = "), 0xfe10, {.d_s = interface_index_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t._"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT(" = &x->val,"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_shared_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t._typ = "), /*115 &string*/0xfe10, {.d_s = interface_index_name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&cast_shared_struct, _SLIT("\t\t}")); strings__Builder_write_string(&cast_shared_struct, _SLIT("\t}")); string cast_shared_struct_str = strings__Builder_str(&cast_shared_struct); - strings__Builder_writeln(&cast_functions, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n// Casting functions for converting \"__shared__"), 0xfe10, {.d_s = cctype}}, {_SLIT("\" to interface \"__shared__"), 0xfe10, {.d_s = interface_name}}, {_SLIT("\"\nstatic inline __shared__"), 0xfe10, {.d_s = interface_name}}, {_SLIT(" "), 0xfe10, {.d_s = shared_fn_name}}, {_SLIT("(__shared__"), 0xfe10, {.d_s = cctype}}, {_SLIT("* x) {\n return "), 0xfe10, {.d_s = cast_shared_struct_str}}, {_SLIT(";\n}"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&cast_functions, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n// Casting functions for converting \"__shared__"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("\" to interface \"__shared__"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("\"\nstatic inline __shared__"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = shared_fn_name}}, {_SLIT("(__shared__"), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("* x) {\n return "), /*115 &string*/0xfe10, {.d_s = cast_shared_struct_str}}, {_SLIT(";\n}"), 0, { .d_c = 0 }}}))); } } if (g->pref->build_mode != v__pref__BuildMode__build_module) { @@ -72310,7 +72618,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { string mname = /*key*/ *(string*)DenseArray_key(&methodidx.key_values, _t7); mname = string_clone(mname); if (g->pref->build_mode != v__pref__BuildMode__build_module) { - strings__Builder_writeln(&methods_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._method_"), 0xfe10, {.d_s = v__gen__c__c_name(mname)}}, {_SLIT(" = (void*) 0,"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t._method_"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(mname)}}, {_SLIT(" = (void*) 0,"), 0, { .d_c = 0 }}}))); } } } @@ -72326,7 +72634,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { array_push((array*)&_t10, &ti); } Array_string method_names =_t10; - if (st_sym->info._typ == 455 /* v.ast.Struct */) { + if (st_sym->info._typ == 456 /* v.ast.Struct */) { if (v__ast__Type_has_flag((*st_sym->info._v__ast__Struct).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*st_sym->info._v__ast__Struct).parent_type); for (int _t12 = 0; _t12 < parent_sym->methods.len; ++_t12) { @@ -72343,7 +72651,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } } } - else if (st_sym->info._typ == 473 /* v.ast.Interface */) { + else if (st_sym->info._typ == 474 /* v.ast.Interface */) { if (v__ast__Type_has_flag((*st_sym->info._v__ast__Interface).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*st_sym->info._v__ast__Interface).parent_type); for (int _t15 = 0; _t15 < parent_sym->methods.len; ++_t15) { @@ -72360,7 +72668,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } } } - else if (st_sym->info._typ == 474 /* v.ast.SumType */) { + else if (st_sym->info._typ == 475 /* v.ast.SumType */) { if (v__ast__Type_has_flag((*st_sym->info._v__ast__SumType).parent_type, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*st_sym->info._v__ast__SumType).parent_type); for (int _t18 = 0; _t18 < parent_sym->methods.len; ++_t18) { @@ -72403,13 +72711,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { string name = method.name; if (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 == 455 /* v.ast.Struct */) { + if (parent_sym->info._typ == 456 /* v.ast.Struct */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__Struct).concrete_types, method.name, false); } - else if (parent_sym->info._typ == 473 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 474 /* v.ast.Interface */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__Interface).concrete_types, method.name, false); } - else if (parent_sym->info._typ == 474 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 475 /* v.ast.SumType */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__SumType).concrete_types, method.name, false); } @@ -72420,22 +72728,22 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { if (!_IN_MAP(ADDR(string, method.name), ADDR(map, methodidx))) { continue; } - if ((st_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((st_sym->info)._typ == 456 /* v.ast.Struct */) { if (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); } } string styp = v__gen__c__Gen_cc_type(g, (*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).typ, true); - string method_call = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string method_call = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!v__ast__Type_is_ptr((*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).typ)) { - method_call = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cctype}}, {_SLIT("_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); - string iwpostfix = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_Interface_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_method_wrapper"), 0, { .d_c = 0 }}})); - strings__Builder_write_string(&methods_wrapper, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, method.return_type)}}, {_SLIT(" "), 0xfe10, {.d_s = cctype}}, {_SLIT("_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0xfe10, {.d_s = iwpostfix}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + method_call = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string iwpostfix = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_Interface_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_method_wrapper"), 0, { .d_c = 0 }}})); + strings__Builder_write_string(&methods_wrapper, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, method.return_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cctype}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = iwpostfix}}, {_SLIT("("), 0, { .d_c = 0 }}}))); 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)).pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).name,(*(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)).type_pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_hidden,.typ = v__ast__Type_set_nr_muls(st, 1),}) }); - multi_return_Array_string_Array_string_Array_bool mr_168496 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); - Array_string fargs = mr_168496.arg0; + multi_return_Array_string_Array_string_Array_bool mr_173726 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); + Array_string fargs = mr_173726.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__")); @@ -72452,19 +72760,19 @@ 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){.is_variadic = 0,.language = 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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_168960 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); - Array_v__ast__Type embed_types = mr_168960.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_174190 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); + Array_v__ast__Type embed_types = mr_174190.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, 0xfe10, {.d_s = embed_sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); - strings__Builder_write_string(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = method_name}}, {_SLIT("("), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, 0))}}, {_SLIT0, 0, { .d_c = 0 }}}))); + 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 }}})); + strings__Builder_write_string(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, 0))}}, {_SLIT0, 0, { .d_c = 0 }}}))); for (int idx_embed = 0; idx_embed < embed_types.len; ++idx_embed) { v__ast__Type embed = ((v__ast__Type*)embed_types.data)[idx_embed]; v__ast__TypeSymbol* esym = v__ast__Table_sym(g->table, embed); if (idx_embed == 0 || v__ast__Type_is_any_kind_of_pointer((*(v__ast__Type*)/*ee elem_sym */array_get(embed_types, idx_embed - 1)))) { - strings__Builder_write_string(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("->"), 0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(esym)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("->"), /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(esym)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(esym)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(esym)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } if (fargs.len > 1) { @@ -72472,19 +72780,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } Array_string _t27; string args = Array_string_join((_t27 = fargs, array_slice(_t27, 1, _t27.len)), _SLIT(", ")); - strings__Builder_writeln(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = args}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_wrapper, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = args}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { if (string_starts_with(parameter_name, _SLIT("__shared__"))) { - strings__Builder_writeln(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = method_call}}, {_SLIT("("), 0xfe10, {.d_s = Array_string_join(fargs, _SLIT(", "))}}, {_SLIT("->val);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = method_call}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = Array_string_join(fargs, _SLIT(", "))}}, {_SLIT("->val);"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = method_call}}, {_SLIT("(*"), 0xfe10, {.d_s = Array_string_join(fargs, _SLIT(", "))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_wrapper, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = method_call}}, {_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = Array_string_join(fargs, _SLIT(", "))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } strings__Builder_writeln(&methods_wrapper, _SLIT("}")); method_call = /*f*/string__plus(method_call, iwpostfix); } if (g->pref->build_mode != v__pref__BuildMode__build_module && !v__ast__Type_alias_eq(st, _const_v__ast__voidptr_type)) { - strings__Builder_writeln(&methods_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t._method_"), 0xfe10, {.d_s = v__gen__c__c_name(method.name)}}, {_SLIT(" = (void*) "), 0xfe10, {.d_s = method_call}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&methods_struct, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t._method_"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(method.name)}}, {_SLIT(" = (void*) "), /*115 &string*/0xfe10, {.d_s = method_call}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } } if (methods.len == 0 && isym->idx == _const_v__ast__error_type_idx) { @@ -72496,9 +72804,9 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } int iin_idx = (*(int*)map_get(ADDR(map, already_generated_mwrappers), &(string[]){interface_index_name}, &(int[]){ 0 })) - iinidx_minimum_base; if (g->pref->build_mode != v__pref__BuildMode__build_module) { - strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("const int "), 0xfe10, {.d_s = interface_index_name}}, {_SLIT(" = "), 0xfe07, {.d_i32 = iin_idx}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("const int "), /*115 &string*/0xfe10, {.d_s = interface_index_name}}, {_SLIT(" = "), /*100 &int*/0xfe07, {.d_i32 = iin_idx}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("extern const int "), 0xfe10, {.d_s = interface_index_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("extern const int "), /*115 &string*/0xfe10, {.d_s = interface_index_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } Map_int_Array_v__ast__Type _t28 = inter_info.conversions; @@ -72514,23 +72822,23 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { int vtyp = /*key*/ *(int*)DenseArray_key(&_t28.key_values, _t29); Array_v__ast__Type variants = (*(Array_v__ast__Type*)DenseArray_value(&_t28.key_values, _t29)); v__ast__TypeSymbol* vsym = v__ast__Table_sym(g->table, vtyp); - strings__Builder_write_string(&conversion_functions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static inline bool I_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_is_I_"), 0xfe10, {.d_s = vsym->cname}}, {_SLIT("("), 0xfe10, {.d_s = interface_name}}, {_SLIT(" x) {\n\treturn "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&conversion_functions, str_intp(4, _MOV((StrIntpData[]){{_SLIT("static inline bool I_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_is_I_"), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" x) {\n\treturn "), 0, { .d_c = 0 }}}))); for (int i = 0; i < variants.len; ++i) { v__ast__Type variant = ((v__ast__Type*)variants.data)[i]; v__ast__TypeSymbol* variant_sym = v__ast__Table_sym(g->table, variant); if (i > 0) { strings__Builder_write_string(&conversion_functions, _SLIT(" || ")); } - strings__Builder_write_string(&conversion_functions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(x._typ == _"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&conversion_functions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(x._typ == _"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_index)"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&conversion_functions, _SLIT(";\n}")); - strings__Builder_writeln(&conversion_functions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), 0xfe10, {.d_s = vsym->cname}}, {_SLIT(" I_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_as_I_"), 0xfe10, {.d_s = vsym->cname}}, {_SLIT("("), 0xfe10, {.d_s = interface_name}}, {_SLIT(" x) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&conversion_functions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT(" I_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_as_I_"), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(" x) {"), 0, { .d_c = 0 }}}))); for (int _t32 = 0; _t32 < variants.len; ++_t32) { v__ast__Type variant = ((v__ast__Type*)variants.data)[_t32]; v__ast__TypeSymbol* variant_sym = v__ast__Table_sym(g->table, variant); - strings__Builder_writeln(&conversion_functions, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), 0xfe10, {.d_s = interface_name}}, {_SLIT("_"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_index) return I_"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_to_Interface_"), 0xfe10, {.d_s = vsym->cname}}, {_SLIT("(x._"), 0xfe10, {.d_s = variant_sym->cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&conversion_functions, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tif (x._typ == _"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_index) return I_"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT("_to_Interface_"), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT("(x._"), /*115 &string*/0xfe10, {.d_s = variant_sym->cname}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } - string pmessage = str_intp(3, _MOV((StrIntpData[]){{_SLIT("string__plus(string__plus(tos3(\"`as_cast`: cannot convert \"), tos3(v_typeof_interface_"), 0xfe10, {.d_s = interface_name}}, {_SLIT("(x._typ))), tos3(\" to "), 0xfe10, {.d_s = v__util__strip_main_name(vsym->name)}}, {_SLIT("\"))"), 0, { .d_c = 0 }}})); + string pmessage = str_intp(3, _MOV((StrIntpData[]){{_SLIT("string__plus(string__plus(tos3(\"`as_cast`: cannot convert \"), tos3(v_typeof_interface_"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("(x._typ))), tos3(\" to "), /*115 &string*/0xfe10, {.d_s = v__util__strip_main_name(vsym->name)}}, {_SLIT("\"))"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { strings__Builder_write_string(&conversion_functions, _SLIT("\tpanic_debug(1, tos3(\"builtin.v\"), tos3(\"builtin\"), tos3(\"__as_cast\"), ")); strings__Builder_write_string(&conversion_functions, pmessage); @@ -72540,10 +72848,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { strings__Builder_write_string(&conversion_functions, pmessage); strings__Builder_writeln(&conversion_functions, _SLIT(");")); } - strings__Builder_writeln(&conversion_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn ("), 0xfe10, {.d_s = vsym->cname}}, {_SLIT("){0};"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&conversion_functions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn ("), /*115 &string*/0xfe10, {.d_s = vsym->cname}}, {_SLIT("){0};"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&conversion_functions, _SLIT("}")); } - strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// ^^^ number of types for interface "), 0xfe10, {.d_s = interface_name}}, {_SLIT(": "), 0xfe07, {.d_i32 = current_iinidx - iinidx_minimum_base}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// ^^^ number of types for interface "), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT(": "), /*100 &int*/0xfe07, {.d_i32 = current_iinidx - iinidx_minimum_base}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (iname_table_length == 0) { strings__Builder_writeln(&methods_struct, _SLIT("")); } else { @@ -72576,14 +72884,14 @@ VV_LOCAL_SYMBOL multi_return_int_string_string_string v__gen__c__Gen_panic_debug } string v__gen__c__get_guarded_include_text(string iname, string imessage) { - string res = string_strip_margin( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\n |#if defined(__has_include)\n |\n |#if __has_include("), 0xfe10, {.d_s = iname}}, {_SLIT(")\n |#include "), 0xfe10, {.d_s = iname}}, {_SLIT("\n |#else\n |#error VERROR_MESSAGE "), 0xfe10, {.d_s = imessage}}, {_SLIT("\n |#endif\n |\n |#else\n |#include "), 0xfe10, {.d_s = iname}}, {_SLIT("\n |#endif\n "), 0, { .d_c = 0 }}}))); + string res = string_strip_margin( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\n |#if defined(__has_include)\n |\n |#if __has_include("), /*115 &string*/0xfe10, {.d_s = iname}}, {_SLIT(")\n |#include "), /*115 &string*/0xfe10, {.d_s = iname}}, {_SLIT("\n |#else\n |#error VERROR_MESSAGE "), /*115 &string*/0xfe10, {.d_s = imessage}}, {_SLIT("\n |#endif\n |\n |#else\n |#include "), /*115 &string*/0xfe10, {.d_s = iname}}, {_SLIT("\n |#endif\n "), 0, { .d_c = 0 }}}))); string _t1 = res; return _t1; } VV_LOCAL_SYMBOL void v__gen__c__Gen_trace(v__gen__c__Gen* g, string fbase, string message) { if (string__eq(g->file->path_base, fbase)) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> g.trace | "), 0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), 0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> g.trace | "), /*115 &string*/0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -72591,7 +72899,7 @@ int v__gen__c__Gen_get_array_depth(v__gen__c__Gen* g, v__ast__Type el_typ) { v__ast__Type typ = v__gen__c__Gen_unwrap_generic(g, el_typ); v__ast__TypeSymbol* sym = v__ast__Table_final_sym(g->table, typ); if (sym->kind == v__ast__Kind__array) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; int _t1 = 1 + v__gen__c__Gen_get_array_depth(g, info.elem_type); return _t1; } else { @@ -72638,14 +72946,14 @@ bool v__gen__c__Gen_contains_ptr(v__gen__c__Gen* g, v__ast__Type el_typ) { } case v__ast__Kind__array_fixed: { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; bool _t5 = v__gen__c__Gen_contains_ptr(g, info.elem_type); return _t5; break; } case v__ast__Kind__struct_: { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; for (int _t6 = 0; _t6 < info.embeds.len; ++_t6) { v__ast__Type embed = ((v__ast__Type*)info.embeds.data)[_t6]; if (v__gen__c__Gen_contains_ptr(g, embed)) { @@ -72666,7 +72974,7 @@ bool v__gen__c__Gen_contains_ptr(v__gen__c__Gen* g, v__ast__Type el_typ) { } case v__ast__Kind__aggregate: { - v__ast__Aggregate info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 468) /*expected idx: 468, name: v.ast.Aggregate */ ; + v__ast__Aggregate info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 469) /*expected idx: 469, name: v.ast.Aggregate */ ; for (int _t11 = 0; _t11 < info.types.len; ++_t11) { v__ast__Type atyp = ((v__ast__Type*)info.types.data)[_t11]; if (v__gen__c__Gen_contains_ptr(g, atyp)) { @@ -72680,7 +72988,7 @@ bool v__gen__c__Gen_contains_ptr(v__gen__c__Gen* g, v__ast__Type el_typ) { } case v__ast__Kind__multi_return: { - v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 481) /*expected idx: 481, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; for (int _t14 = 0; _t14 < info.types.len; ++_t14) { v__ast__Type mrtyp = ((v__ast__Type*)info.types.data)[_t14]; if (v__gen__c__Gen_contains_ptr(g, mrtyp)) { @@ -72735,86 +73043,12 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_check_noscan(v__gen__c__Gen* g, v__ast__Ty return _t2; } -VV_LOCAL_SYMBOL string v__gen__c__arm64_bytes(int nargs) { - string bytes = _SLIT("0xd0, 0xff, 0xff, 0x58, 0x6, 0xff, 0xff, 0x58, 0x00, 0x02, 0x1f, 0xd6"); - string _t1 = string_replace(bytes, _SLIT(""), int_str(nargs)); - return _t1; -} - -VV_LOCAL_SYMBOL string v__gen__c__arm32_bytes(int nargs) { - string bytes = _SLIT("0x0c, 0x90, 0x1f, 0xe5, 0x14, 0x0, 0x1f, 0xe5, 0x19, 0xff, 0x2f, 0xe1"); - string _t1 = string_replace(bytes, _SLIT(""), int_str(nargs)); - return _t1; -} - -VV_LOCAL_SYMBOL string v__gen__c__amd64_bytes(int nargs) { - - if (nargs == (1)) { - string _t1 = _SLIT("0x48, 0x8b, 0x3d, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t1; - } - else if (nargs == (2)) { - string _t2 = _SLIT("0x48, 0x8b, 0x35, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t2; - } - else if (nargs == (3)) { - string _t3 = _SLIT("0x48, 0x8b, 0x15, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t3; - } - else if (nargs == (4)) { - string _t4 = _SLIT("0x48, 0x8b, 0x0d, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t4; - } - else if (nargs == (5)) { - string _t5 = _SLIT("0x4C, 0x8b, 0x05, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t5; - } - else if (nargs == (6)) { - string _t6 = _SLIT("0x4C, 0x8b, 0x0d, 0xe9, 0xff, 0xff, 0xff, 0xff, 0x25, 0xeb, 0xff, 0xff, 0xff"); - return _t6; - } - else { - strings__Builder sb = strings__new_builder(256); - string s = u8_hex(((((((u8)(nargs)) & 1)) + 1) << 3)); - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x48, 0x83, 0xec, 0x"), 0xfe10, {.d_s = s}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&sb, _SLIT("0xff, 0x35, 0xe6, 0xff, 0xff, 0xff, ")); - string rsp_offset = u8_hex(((u8)(0x18 + ((((u8)(nargs - 7)) >> 1) << 4)))); - for (int _t7 = 0; _t7 < nargs - 7; ++_t7) { - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0xff, 0xb4, 0x24, 0x"), 0xfe10, {.d_s = rsp_offset}}, {_SLIT(", 0x00, 0x00, 0x00, "), 0, { .d_c = 0 }}}))); - } - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0xff, 0x15, 0x"), 0xfe10, {.d_s = u8_hex(((u8)(256 - sb.len / 6 - 6 - 8)))}}, {_SLIT(", 0xff, 0xff, 0xff, "), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x48, 0x81, 0xc4, 0x"), 0xfe10, {.d_s = rsp_offset}}, {_SLIT(", 0x00, 0x00, 0x00, "), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&sb, _SLIT("0xc3")); - string _t8 = strings__Builder_str(&sb); - return _t8; - }; - return (string){.str=(byteptr)"", .is_lit=1}; -} - VV_LOCAL_SYMBOL string v__gen__c__c_closure_helpers(v__pref__Preferences* pref) { - if (pref->os == v__pref__OS__windows) { - v__gen__c__verror(_SLIT("closures are not implemented on Windows yet")); - VUNREACHABLE(); - } - if (!(pref->arch == v__pref__Arch__amd64 || pref->arch == v__pref__Arch__arm64 || pref->arch == v__pref__Arch__arm32)) { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("closures are not implemented on this architecture yet: "), 0xfe10, {.d_s = v__pref__Arch_str(pref->arch)}}, {_SLIT0, 0, { .d_c = 0 }}}))); - VUNREACHABLE(); - } strings__Builder builder = strings__new_builder(2048); if (pref->os != v__pref__OS__windows) { strings__Builder_writeln(&builder, _SLIT("#include ")); } - if (pref->arch == v__pref__Arch__amd64) { - strings__Builder_write_string(&builder, str_intp(33, _MOV((StrIntpData[]){{_SLIT("\nstatic unsigned char __closure_thunk[32]["), 0xfe07, {.d_i32 = v__gen__c__amd64_bytes(31).len / 6 + 2}}, {_SLIT("] = {\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(1)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(2)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(3)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(4)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(5)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(6)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(7)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(8)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(9)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(10)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(11)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(12)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(13)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(14)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(15)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(16)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(17)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(18)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(19)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(20)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(21)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(22)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(23)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(24)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(25)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(26)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(27)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(28)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(29)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(30)}}, {_SLIT(" },\n { "), 0xfe10, {.d_s = v__gen__c__amd64_bytes(31)}}, {_SLIT(" },\n};\n"), 0, { .d_c = 0 }}}))); - } else if (pref->arch == v__pref__Arch__arm64) { - strings__Builder_write_string(&builder, str_intp(9, _MOV((StrIntpData[]){{_SLIT("\nstatic unsigned char __closure_thunk[8][12] = {\n {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(0)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(1)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(2)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(3)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(4)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(5)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(6)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm64_bytes(7)}}, {_SLIT("\n },\n};\n"), 0, { .d_c = 0 }}}))); - } else if (pref->arch == v__pref__Arch__arm32) { - strings__Builder_write_string(&builder, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\nstatic unsigned char __closure_thunk[4][12] = {\n {\n "), 0xfe10, {.d_s = v__gen__c__arm32_bytes(0)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm32_bytes(1)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm32_bytes(2)}}, {_SLIT("\n }, {\n "), 0xfe10, {.d_s = v__gen__c__arm32_bytes(3)}}, {_SLIT("\n },\n};\n"), 0, { .d_c = 0 }}}))); - } - strings__Builder_write_string(&builder, _SLIT("\nstatic void __closure_set_data(void *closure, void *data) {\n void **p = closure;\n p[-2] = data;\n}\n\nstatic void __closure_set_function(void *closure, void *f) {\n void **p = closure;\n p[-1] = f;\n}\n\nstatic inline int __closure_check_nargs(int nargs) {\n\011if (nargs > (int)_ARR_LEN(__closure_thunk)) {\n\011\011_v_panic(_SLIT(\"Closure too large. Reduce the number of parameters, or pass the parameters by reference.\"));\n\011\011VUNREACHABLE();\n\011}\n\011return nargs;\n}\n")); - if (pref->os != v__pref__OS__windows) { - strings__Builder_write_string(&builder, _SLIT("\nstatic void * __closure_create(void *f, int nargs, void *userdata) {\n long page_size = sysconf(_SC_PAGESIZE);\n int prot = PROT_READ | PROT_WRITE;\n int flags = MAP_ANONYMOUS | MAP_PRIVATE;\n char *p = mmap(0, page_size * 2, prot, flags, -1, 0);\n if (p == MAP_FAILED)\n return 0;\n void *closure = p + page_size;\n memcpy(closure, __closure_thunk[nargs - 1], sizeof(__closure_thunk[0]));\n mprotect(closure, page_size, PROT_READ | PROT_EXEC);\n __closure_set_function(closure, f);\n __closure_set_data(closure, userdata);\n return closure;\n}\n\nstatic void __closure_destroy(void *closure) {\n long page_size = sysconf(_SC_PAGESIZE);\n munmap((char *)closure - page_size, page_size * 2);\n}\n")); - } + strings__Builder_write_string(&builder, _SLIT("\n#ifdef _MSC_VER\n\011#define __RETURN_ADDRESS() _ReturnAddress()\n#elif defined(__TINYC__) && defined(_WIN32)\n\011#define __RETURN_ADDRESS() __builtin_return_address(0)\n#else\n\011#define __RETURN_ADDRESS() __builtin_extract_return_addr(__builtin_return_address(0))\n#endif\n\n#ifdef __V_amd64\n#ifdef _WIN32\nstatic const char __closure_thunk[] = {\n\0110x48, 0x89, 0x0d, 0xc1, 0xff, 0xff, 0xff, // mov qword ptr [rip - 63], rcx # <_orig_rcx>\n\0110x8f, 0x05, 0xc3, 0xff, 0xff, 0xff, // pop qword ptr [rip - 61] # <_orig_rbp>\n\0110xff, 0x15, 0xd5, 0xff, 0xff, 0xff, // call qword ptr [rip - 43] # \n\0110x48, 0x8b, 0x0d, 0xae, 0xff, 0xff, 0xff, // mov rcx, qword ptr [rip - 82] # <_orig_rcx>\n\0110xff, 0x15, 0xc0, 0xff, 0xff, 0xff, // call qword ptr [rip - 64] # \n\0110xff, 0x35, 0xaa, 0xff, 0xff, 0xff, // push qword ptr [rip - 86] # <_orig_rbp>\n\0110xc3 // ret\n};\n#else\nstatic const char __closure_thunk[] = {\n\0110x48, 0x89, 0x3d, 0xc1, 0xff, 0xff, 0xff, // mov qword ptr [rip - 63], rdi # <_orig_rdi>\n\0110x8f, 0x05, 0xc3, 0xff, 0xff, 0xff, // pop qword ptr [rip - 61] # <_orig_rbp>\n\0110xff, 0x15, 0xd5, 0xff, 0xff, 0xff, // call qword ptr [rip - 43] # \n\0110x48, 0x8b, 0x3d, 0xae, 0xff, 0xff, 0xff, // mov rdi, qword ptr [rip - 82] # <_orig_rdi>\n\0110xff, 0x15, 0xc0, 0xff, 0xff, 0xff, // call qword ptr [rip - 64] # \n\0110xff, 0x35, 0xaa, 0xff, 0xff, 0xff, // push qword ptr [rip - 86] # <_orig_rbp>\n\0110xc3 // ret\n};\n#endif\n#define __CLOSURE_WRAPPER_OFFSET 19\n#define __CLOSURE_UNWRAPPER_OFFSET 32\n#define __CLOSURE_WRAPPER_EXTRA_PARAM void* _t\n#define __CLOSURE_WRAPPER_EXTRA_PARAM_COMMA ,\n#elif defined(__V_x86)\nstatic char __closure_thunk[] = {\n 0xe8, 0x00, 0x00, 0x00, 0x00, // call 4\n 0x58, // pop eax\n 0x8f, 0x40, 0xe3, // pop dword ptr [eax - 29] # <_orig_rbp>\n 0xff, 0x50, 0xef, // call dword ptr [eax - 17] # \n 0xe8, 0x00, 0x00, 0x00, 0x00, // call 4\n 0x58, // pop eax\n 0xff, 0x50, 0xdf, // call dword ptr [eax - 33] # \n 0xe8, 0x00, 0x00, 0x00, 0x00, // call 4\n 0x58, // pop eax\n 0xff, 0x70, 0xce, // push dword ptr [eax - 50] # <_orig_rbp>\n 0xc3 // ret\n};\n\n#define __CLOSURE_WRAPPER_OFFSET 12\n#define __CLOSURE_UNWRAPPER_OFFSET 21\n#define __CLOSURE_WRAPPER_EXTRA_PARAM void* _t\n#define __CLOSURE_WRAPPER_EXTRA_PARAM_COMMA ,\n\n#elif defined(__V_arm64)\nstatic char __closure_thunk[] = {\n\0110x10, 0x00, 0x00, 0x10, // adr x16, start\n\0110x08, 0x82, 0x1c, 0xf8, // str x8, _orig_x8\n\0110x1e, 0x02, 0x1d, 0xf8, // str x30, _orig_x30\n\0110xf0, 0xfe, 0xff, 0x58, // ldr x16, wrapper\n\0110x00, 0x02, 0x3f, 0xd6, // blr x16\n\0110x70, 0xff, 0xff, 0x10, // adr x16, start\n\0110x08, 0x82, 0x5c, 0xf8, // ldr x8, _orig_x8\n\0110x30, 0xfe, 0xff, 0x58, // ldr x16, unwrapper\n\0110x00, 0x02, 0x3f, 0xd6, // blr x16\n\0110xf0, 0xfe, 0xff, 0x10, // adr x16, start\n\0110x1e, 0x02, 0x5d, 0xf8, // ldr x30, _orig_x30\n\0110xc0, 0x03, 0x5f, 0xd6 // ret\n};\n#define __CLOSURE_WRAPPER_OFFSET 20\n#define __CLOSURE_UNWRAPPER_OFFSET 36\n#define __CLOSURE_WRAPPER_EXTRA_PARAM\n#define __CLOSURE_WRAPPER_EXTRA_PARAM_COMMA\n#elif defined(__V_arm32)\nstatic char __closure_thunk[] = {\n 0x24, 0x00, 0x0f, 0xe5, // str r0, orig_r0\n 0x24, 0xe0, 0x0f, 0xe5, // str lr, orig_lr\n 0x1c, 0xc0, 0x1f, 0xe5, // ldr ip, wrapper\n 0x3c, 0xff, 0x2f, 0xe1, // blx ip\n 0x34, 0x00, 0x1f, 0xe5, // ldr r0, orig_r0\n 0x2c, 0xc0, 0x1f, 0xe5, // ldr ip, unwrapper\n 0x3c, 0xff, 0x2f, 0xe1, // blx ip\n 0x3c, 0xe0, 0x1f, 0xe5, // ldr lr, orig_lr\n 0x1e, 0xff, 0x2f, 0xe1 // bx lr\n};\n#define __CLOSURE_WRAPPER_OFFSET 16\n#define __CLOSURE_UNWRAPPER_OFFSET 28\n#define __CLOSURE_WRAPPER_EXTRA_PARAM void* _t\n#define __CLOSURE_WRAPPER_EXTRA_PARAM_COMMA ,\n#endif\n\nstatic int _V_PAGE_SIZE = 4096; // pre-initialized to the most common value, in case _vinit is not called (in a DLL, for example)\n\nstatic inline void __closure_set_data(void* closure, void* data) {\n void** p = closure;\n p[-1] = data;\n}\n\nstatic inline void __closure_set_function(void* closure, void* f) {\n void** p = closure;\n p[-2] = f;\n}\n\nstatic inline void __closure_set_wrapper(void* closure, void* f) {\n void** p = closure;\n p[-3] = f;\n}\n\nstatic inline void __closure_set_unwrapper(void* closure, void* f) {\n void** p = closure;\n p[-4] = f;\n}\n\nstatic inline void __closure_set_base_ptr(void* closure, void* bp) {\n void** p = closure;\n p[-5] = bp;\n}\n\nstatic void* __closure_create(void* fn, void* wrapper, void* unwrapper, void* data) {\n#ifdef _WIN32\n\011SYSTEM_INFO si;\n\011GetNativeSystemInfo(&si);\n\011uint32_t page_size = si.dwPageSize;\n\011char* p = VirtualAlloc(NULL, page_size * 2, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);\n\011if (p == NULL) return 0;\n#else\n\011uint32_t page_size = sysconf(_SC_PAGESIZE);\n\011int prot = PROT_READ | PROT_WRITE;\n\011int flags = MAP_ANONYMOUS | MAP_PRIVATE;\n\011char* p = mmap(0, page_size * 2, prot, flags, -1, 0);\n\011if (p == MAP_FAILED) return 0;\n#endif\n\n\011void* closure = p + page_size;\n\011memcpy(closure, __closure_thunk, sizeof(__closure_thunk));\n\n#ifdef _WIN32\n\011DWORD _tmp;\n\011VirtualProtect(closure, page_size, PAGE_EXECUTE_READ, &_tmp);\n#else\n\011mprotect(closure, page_size, PROT_READ | PROT_EXEC);\n#endif\n\n\011__closure_set_data(closure, data);\n\011__closure_set_function(closure, fn);\n\011__closure_set_wrapper(closure, wrapper);\n\011__closure_set_unwrapper(closure, unwrapper);\n\011__closure_set_base_ptr(closure, p);\n\011return closure;\n}\n")); string _t1 = strings__Builder_str(&builder); return _t1; } @@ -72853,7 +73087,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_vlines_reset(v__gen__c__Gen* g) { g->vlines_path = v__util__vlines_escape_path(g->pref->out_name_c, g->pref->ccompiler); v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("\n// Reset the file/line numbers")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n#line "), 0xfe07, {.d_i32 = lines_so_far}}, {_SLIT(" \""), 0xfe10, {.d_s = g->vlines_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n#line "), /*100 &int*/0xfe07, {.d_i32 = lines_so_far}}, {_SLIT(" \""), /*115 &string*/0xfe10, {.d_s = g->vlines_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("")); } } @@ -72943,8 +73177,8 @@ void v__gen__c__Gen_gen_failing_error_propagation_for_test_fn(v__gen__c__Gen* g, string pafile = mr_5046.arg1; string pamod = mr_5046.arg2; string pafn = mr_5046.arg3; - string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_fn_error(test_runner._object, "), 0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), 0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + 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 }}})); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_fn_error(test_runner._object, "), /*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 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tlongjmp(g_jump_buffer, 1);")); } @@ -72954,8 +73188,8 @@ void v__gen__c__Gen_gen_failing_return_error_for_test_fn(v__gen__c__Gen* g, v__a string pafile = mr_5737.arg1; string pamod = mr_5737.arg2; string pafn = mr_5737.arg3; - string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_fn_error(test_runner._object, "), 0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), 0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); + 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 }}})); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmain__TestRunner_name_table[test_runner._typ]._method_fn_error(test_runner._object, "), /*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 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tlongjmp(g_jump_buffer, 1);")); } @@ -72978,17 +73212,17 @@ void v__gen__c__Gen_gen_c_main_for_tests(v__gen__c__Gen* g) { v__gen__c__Gen_writeln(g, _SLIT("\t_vinit(___argc, (voidptr)___argv);")); Array_string all_tfuncs = v__gen__c__Gen_get_all_test_function_names(g); all_tfuncs = v__gen__c__Gen_filter_only_matching_fn_names(g, all_tfuncs); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring v_test_file = "), 0xfe10, {.d_s = v__gen__c__ctoslit(g->pref->path)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring v_test_file = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(g->pref->path)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); if (g->pref->is_stats) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__BenchedTests bt = main__start_testing("), 0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(", v_test_file);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tmain__BenchedTests bt = main__start_testing("), /*100 &int*/0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(", v_test_file);"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("\tstruct _main__TestRunner_interface_methods _vtrunner = main__TestRunner_name_table[test_runner._typ];")); v__gen__c__Gen_writeln(g, _SLIT("\tvoid * _vtobj = test_runner._object;")); v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("\tmain__VTestFileMetaInfo_free(test_runner.file_test_info);")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t*(test_runner.file_test_info) = main__vtest_new_filemetainfo(v_test_file, "), 0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t_vtrunner._method_start(_vtobj, "), 0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t*(test_runner.file_test_info) = main__vtest_new_filemetainfo(v_test_file, "), /*100 &int*/0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t_vtrunner._method_start(_vtobj, "), /*100 &int*/0xfe07, {.d_i32 = all_tfuncs.len}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("")); for (int tnumber = 0; tnumber < all_tfuncs.len; ++tnumber) { string tname = ((string*)all_tfuncs.data)[tnumber]; @@ -72996,16 +73230,16 @@ void v__gen__c__Gen_gen_c_main_for_tests(v__gen__c__Gen* g) { v__ast__Fn testfn = (*(v__ast__Fn*)map_get(ADDR(map, g->table->fns), &(string[]){tname}, &(v__ast__Fn[]){ (v__ast__Fn){.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,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (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,.name = (string){.str=(byteptr)"", .is_lit=1},.params = __new_array(0, 0, sizeof(v__ast__Param)),.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,} })); int lnum = testfn.pos.line_nr + 1; v__gen__c__Gen_writeln(g, _SLIT("\tmain__VTestFnMetaInfo_free(test_runner.fn_test_info);")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcname_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = _SLIT(\""), 0xfe10, {.d_s = tcname}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcmod_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = _SLIT(\""), 0xfe10, {.d_s = testfn.mod}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcfile_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__ctoslit(testfn.file)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(test_runner.fn_test_info) = main__vtest_new_metainfo(tcname_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(", tcmod_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(", tcfile_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(", "), 0xfe07, {.d_i32 = lnum}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcname_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = tcname}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcmod_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = testfn.mod}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring tcfile_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(testfn.file)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(test_runner.fn_test_info) = main__vtest_new_metainfo(tcname_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(", tcmod_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(", tcfile_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = lnum}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t_vtrunner._method_fn_start(_vtobj);")); v__gen__c__Gen_writeln(g, _SLIT("\tif (!setjmp(g_jump_buffer)) {")); if (g->pref->is_stats) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tmain__BenchedTests_testing_step_start(&bt, tcname_"), 0xfe07, {.d_i32 = tnumber}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tmain__BenchedTests_testing_step_start(&bt, tcname_"), /*100 &int*/0xfe07, {.d_i32 = tnumber}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), 0xfe10, {.d_s = tcname}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t"), /*115 &string*/0xfe10, {.d_s = tcname}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t\t_vtrunner._method_fn_pass(_vtobj);")); v__gen__c__Gen_writeln(g, _SLIT("\t}else{")); v__gen__c__Gen_writeln(g, _SLIT("\t\t_vtrunner._method_fn_fail(_vtobj);")); @@ -73068,8 +73302,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_selector(v__gen__c__Gen* g, v__ast_ } else { v__gen__c__Gen_write(g, _SLIT(".")); } - if ((node.field_expr)._typ == 325 /* v.ast.SelectorExpr */) { - if (((*node.field_expr._v__ast__SelectorExpr).expr)._typ == 305 /* v.ast.Ident */) { + if ((node.field_expr)._typ == 326 /* v.ast.SelectorExpr */) { + if (((*node.field_expr._v__ast__SelectorExpr).expr)._typ == 306 /* v.ast.Ident */) { if (string__eq((*(*node.field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name, g->comptime_for_field_var) && string__eq((*node.field_expr._v__ast__SelectorExpr).field_name, _SLIT("name"))) { v__gen__c__Gen_write(g, v__gen__c__c_name(g->comptime_for_field_value.name)); return; @@ -73086,7 +73320,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com } if (string__eq(node->method_name, _SLIT("env"))) { string val = v__util__cescaped_path(os__getenv(node->args_var)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); return; } if (node->is_vweb) { @@ -73097,7 +73331,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com } for (int _t1 = 0; _t1 < node->vweb_tmpl.stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)node->vweb_tmpl.stmts.data)[_t1]; - if ((stmt)._typ == 218 /* v.ast.FnDecl */) { + if ((stmt)._typ == 219 /* v.ast.FnDecl */) { if (string_starts_with((*stmt._v__ast__FnDecl).name, _SLIT("main.vweb_tmpl"))) { if (is_html) { g->inside_vweb_tmpl = true; @@ -73109,7 +73343,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com for (int _t3 = 0; _t3 < _t2_len; ++_t3) { v__ast__Stmt it = ((v__ast__Stmt*) _t2_orig.data)[_t3]; - if ((it)._typ != 356 /* v.ast.Return */) { + if ((it)._typ != 357 /* v.ast.Return */) { array_push((array*)&_t2, &it); } } @@ -73121,13 +73355,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com } string fn_name = string__plus(string_replace(g->fn_decl->name, _SLIT("."), _SLIT("__")), int_str(node->pos.pos)); if (is_html) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("vweb__Context_html(&app->Context, _tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("); strings__Builder_free(&sb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("); string_free(&_tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("vweb__Context_html(&app->Context, _tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("); strings__Builder_free(&sb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("); string_free(&_tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, cur_line); if (g->inside_return) { v__gen__c__Gen_write(g, _SLIT("return ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } return; } @@ -73145,23 +73379,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com if (node->args.len > 0 && m.params.len - 1 >= node->args.len) { v__ast__CallArg arg = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)); v__ast__Param param = (*(v__ast__Param*)/*ee elem_sym */array_get(m.params, node->args.len)); - _t5 = (arg.expr)._typ == 305 /* v.ast.Ident */ && string__eq(v__ast__Table_type_to_str(g->table, arg.typ), _SLIT("[]string")) && !string__eq(v__ast__Table_type_to_str(g->table, param.typ), _SLIT("[]string")); + _t5 = (arg.expr)._typ == 306 /* v.ast.Ident */ && string__eq(v__ast__Table_type_to_str(g->table, arg.typ), _SLIT("[]string")) && !string__eq(v__ast__Table_type_to_str(g->table, param.typ), _SLIT("[]string")); } else { _t5 = false; } bool expand_strs = _t5; if (m.params.len - 1 != node->args.len && !expand_strs) { if (g->inside_call) { - v__gen__c__Gen_error(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("expected "), 0xfe07, {.d_i32 = m.params.len - 1}}, {_SLIT(" arguments to method "), 0xfe10, {.d_s = sym->name}}, {_SLIT("."), 0xfe10, {.d_s = m.name}}, {_SLIT(", but got "), 0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); + v__gen__c__Gen_error(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("expected "), /*100 &int*/0xfe07, {.d_i32 = m.params.len - 1}}, {_SLIT(" arguments to method "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = m.name}}, {_SLIT(", but got "), /*100 &int*/0xfe07, {.d_i32 = node->args.len}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); VUNREACHABLE(); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* skipping "), 0xfe10, {.d_s = sym->name}}, {_SLIT("."), 0xfe10, {.d_s = m.name}}, {_SLIT(" due to mismatched arguments list */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* skipping "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = m.name}}, {_SLIT(" due to mismatched arguments list */"), 0, { .d_c = 0 }}}))); } return; } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__util__no_dots(sym->name)}}, {_SLIT("_"), 0xfe10, {.d_s = g->comptime_for_method}}, {_SLIT("("), 0, { .d_c = 0 }}}))); - if ((node->left)._typ == 305 /* v.ast.Ident */) { - if (((*node->left._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__util__no_dots(sym->name)}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = g->comptime_for_method}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + if ((node->left)._typ == 306 /* v.ast.Ident */) { + if (((*node->left._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { if (v__ast__Type_is_ptr((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, 0)).typ) && !v__ast__Type_is_ptr((*((*node->left._v__ast__Ident).obj.typ)))) { v__gen__c__Gen_write(g, _SLIT("&")); } @@ -73172,7 +73406,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com v__gen__c__Gen_write(g, _SLIT(", ")); } for (int i = 1; i < m.params.len; ++i) { - if ((node->left)._typ == 305 /* v.ast.Ident */) { + if ((node->left)._typ == 306 /* v.ast.Ident */) { if (string__eq((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, i)).name, (*node->left._v__ast__Ident).name)) { continue; } @@ -73187,9 +73421,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com int idx = i - node->args.len; if (v__ast__Type_is_int((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, i)).typ) || v__ast__Type_idx((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, i)).typ) == _const_v__ast__bool_type_idx) { string type_name = v__ast__TypeSymbol_str((*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(g->table->type_symbols, ((int)((*(v__ast__Param*)/*ee elem_sym */array_get(m.params, i)).typ))))); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string_"), 0xfe10, {.d_s = type_name}}, {_SLIT("(((string*)"), 0xfe10, {.d_s = v__ast__CallArg_str((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)))}}, {_SLIT(".data) ["), 0xfe07, {.d_i32 = idx}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("string_"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("(((string*)"), /*115 &v.ast.CallArg*/0xfe10, {.d_s = v__ast__CallArg_str((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)))}}, {_SLIT(".data) ["), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("])"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("((string*)"), 0xfe10, {.d_s = v__ast__CallArg_str((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)))}}, {_SLIT(".data) ["), 0xfe07, {.d_i32 = idx}}, {_SLIT("] "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("((string*)"), /*115 &v.ast.CallArg*/0xfe10, {.d_s = v__ast__CallArg_str((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, node->args.len - 1)))}}, {_SLIT(".data) ["), /*100 &int*/0xfe07, {.d_i32 = idx}}, {_SLIT("] "), 0, { .d_c = 0 }}}))); } if (i < m.params.len - 1) { v__gen__c__Gen_write(g, _SLIT(", ")); @@ -73217,9 +73451,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com if (j > 0) { v__gen__c__Gen_write(g, _SLIT(" else ")); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (string__eq("), 0xfe10, {.d_s = node->method_name}}, {_SLIT(", _SLIT(\""), 0xfe10, {.d_s = method.name}}, {_SLIT("\"))) "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (string__eq("), /*115 &string*/0xfe10, {.d_s = node->method_name}}, {_SLIT(", _SLIT(\""), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("\"))) "), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__util__no_dots(sym->name)}}, {_SLIT("_"), 0xfe10, {.d_s = method.name}}, {_SLIT("("), 0xfe10, {.d_s = amp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__util__no_dots(sym->name)}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = amp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node->left); v__gen__c__Gen_writeln(g, _SLIT(");")); j++; @@ -73232,9 +73466,9 @@ VV_LOCAL_SYMBOL Array_string v__gen__c__cgen_attrs(Array_v__ast__Attr attrs) { v__ast__Attr attr = ((v__ast__Attr*)attrs.data)[_t1]; string s = attr.name; if (attr.arg.len > 0) { - s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(": "), 0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}}))); + s = /*f*/string__plus(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT(": "), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = s}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&res, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))) })); } Array_string _t3 = res; return _t3; @@ -73243,10 +73477,10 @@ VV_LOCAL_SYMBOL Array_string v__gen__c__cgen_attrs(Array_v__ast__Attr attrs) { VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_at(v__gen__c__Gen* g, v__ast__AtExpr node) { if (node.kind == v__token__AtKind__vmod_file) { string val = v__gen__c__cescape_nonascii(v__util__smart_quote(node.val, false)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } else { string val = string_replace(node.val, _SLIT("\\"), _SLIT("\\\\")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } } @@ -73256,7 +73490,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_if(v__gen__c__Gen* g, v__ast__IfExp return; } if (!g->pref->output_cross_c) { - if (((*(v__ast__IfBranch*)/*ee elem_sym */array_get(node.branches, 0)).cond)._typ == 305 /* v.ast.Ident */) { + if (((*(v__ast__IfBranch*)/*ee elem_sym */array_get(node.branches, 0)).cond)._typ == 306 /* v.ast.Ident */) { Option_v__pref__OS _t1 = v__pref__os_from_string((*(*(v__ast__IfBranch*)/*ee elem_sym */array_get(node.branches, 0)).cond._v__ast__Ident).name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; @@ -73302,21 +73536,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_if(v__gen__c__Gen* g, v__ast__IfExp if (node.is_expr) { int len = branch.stmts.len; if (len > 0) { - v__ast__ExprStmt last = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(branch.stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(branch.stmts)))._typ, 345) /*expected idx: 345, name: v.ast.ExprStmt */ ; + v__ast__ExprStmt last = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)array_last(branch.stmts)))._v__ast__ExprStmt,((*(v__ast__Stmt*)array_last(branch.stmts)))._typ, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ; if (len > 1) { string tmp = v__gen__c__Gen_new_tmp_var(g); string styp = v__gen__c__Gen_typ(g, last.typ); g->indent++; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("{")); v__gen__c__Gen_stmts(g, array_slice(branch.stmts, 0, len - 1)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_stmt(g, v__ast__ExprStmt_to_sumtype_v__ast__Stmt(&last)); v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = line}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = line}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_stmt(g, v__ast__ExprStmt_to_sumtype_v__ast__Stmt(&last)); } } @@ -73338,25 +73572,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_if(v__gen__c__Gen* g, v__ast__IfExp } VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__Expr cond, bool pkg_exist) { - if (cond._typ == 289 /* v.ast.BoolLiteral */) { + if (cond._typ == 290 /* v.ast.BoolLiteral */) { v__gen__c__Gen_expr(g, cond); bool _t1 = true; return _t1; } - else if (cond._typ == 320 /* v.ast.ParExpr */) { + else if (cond._typ == 321 /* v.ast.ParExpr */) { v__gen__c__Gen_write(g, _SLIT("(")); bool is_cond_true = v__gen__c__Gen_comptime_if_cond(g, (*cond._v__ast__ParExpr).expr, pkg_exist); v__gen__c__Gen_write(g, _SLIT(")")); bool _t2 = is_cond_true; return _t2; } - else if (cond._typ == 322 /* v.ast.PrefixExpr */) { + else if (cond._typ == 323 /* v.ast.PrefixExpr */) { v__gen__c__Gen_write(g, v__token__Kind_str((*cond._v__ast__PrefixExpr).op)); bool _t3 = v__gen__c__Gen_comptime_if_cond(g, (*cond._v__ast__PrefixExpr).right, pkg_exist); return _t3; } - else if (cond._typ == 321 /* v.ast.PostfixExpr */) { - Option_string _t4 = v__gen__c__Gen_comptime_if_to_ifdef(g, (/* as */ *(v__ast__Ident*)__as_cast(((*cond._v__ast__PostfixExpr).expr)._v__ast__Ident,((*cond._v__ast__PostfixExpr).expr)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ).name, true); + else if (cond._typ == 322 /* v.ast.PostfixExpr */) { + Option_string _t4 = v__gen__c__Gen_comptime_if_to_ifdef(g, (/* as */ *(v__ast__Ident*)__as_cast(((*cond._v__ast__PostfixExpr).expr)._v__ast__Ident,((*cond._v__ast__PostfixExpr).expr)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ).name, true); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; v__gen__c__verror(IError_name_table[err._typ]._method_msg(err._object)); @@ -73366,15 +73600,15 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ } string ifdef = (*(string*)_t4.data); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("defined("), 0xfe10, {.d_s = ifdef}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("defined("), /*115 &string*/0xfe10, {.d_s = ifdef}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); bool _t6 = true; return _t6; } - else if (cond._typ == 309 /* v.ast.InfixExpr */) { + else if (cond._typ == 310 /* v.ast.InfixExpr */) { if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__and) || (*cond._v__ast__InfixExpr).op == (v__token__Kind__logical_or)) { bool l = v__gen__c__Gen_comptime_if_cond(g, (*cond._v__ast__InfixExpr).left, pkg_exist); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str((*cond._v__ast__InfixExpr).op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str((*cond._v__ast__InfixExpr).op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); bool r = v__gen__c__Gen_comptime_if_cond(g, (*cond._v__ast__InfixExpr).right, pkg_exist); bool _t7 = ((*cond._v__ast__InfixExpr).op == v__token__Kind__and ? (l && r) : (l || r)); return _t7; @@ -73382,7 +73616,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ else if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__key_is) || (*cond._v__ast__InfixExpr).op == (v__token__Kind__not_is)) { v__ast__Expr left = (*cond._v__ast__InfixExpr).left; string name = _SLIT(""); - if ((left)._typ == 331 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 298 /* v.ast.ComptimeType */) { + if ((left)._typ == 332 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 299 /* v.ast.ComptimeType */) { v__ast__Type checked_type = v__gen__c__Gen_unwrap_generic(g, (*left._v__ast__TypeNode).typ); bool is_true = v__ast__Table_is_comptime_type(g->table, checked_type, (*(*cond._v__ast__InfixExpr).right._v__ast__ComptimeType)); if ((*cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { @@ -73404,10 +73638,10 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ } } v__ast__Type exp_type = ((v__ast__Type)(0)); - v__ast__Type got_type = (/* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).right)._typ, 331) /*expected idx: 331, name: v.ast.TypeNode */ ).typ; - if ((left)._typ == 331 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 331 /* v.ast.TypeNode */ && v__ast__Table_sym(g->table, got_type)->kind == v__ast__Kind__interface_) { + v__ast__Type got_type = (/* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).right)._typ, 332) /*expected idx: 332, name: v.ast.TypeNode */ ).typ; + if ((left)._typ == 332 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 332 /* v.ast.TypeNode */ && v__ast__Table_sym(g->table, got_type)->kind == v__ast__Kind__interface_) { v__ast__TypeSymbol* interface_sym = v__ast__Table_sym(g->table, got_type); - if ((interface_sym->info)._typ == 473 /* v.ast.Interface */) { + if ((interface_sym->info)._typ == 474 /* v.ast.Interface */) { v__ast__Type checked_type = v__gen__c__Gen_unwrap_generic(g, (*left._v__ast__TypeNode).typ); bool is_true = v__ast__Table_does_type_implement_interface(g->table, checked_type, got_type); if ((*cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { @@ -73428,22 +73662,22 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ return _t11; } } - } else if ((left)._typ == 325 /* v.ast.SelectorExpr */) { + } else if ((left)._typ == 326 /* v.ast.SelectorExpr */) { if ((*left._v__ast__SelectorExpr).gkind_field == v__ast__GenericKindField__typ) { exp_type = v__gen__c__Gen_unwrap_generic(g, (*left._v__ast__SelectorExpr).name_type); } else { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str((*left._v__ast__SelectorExpr).expr)}}, {_SLIT("."), 0xfe10, {.d_s = (*left._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*left._v__ast__SelectorExpr).expr)}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*left._v__ast__SelectorExpr).field_name}}, {_SLIT0, 0, { .d_c = 0 }}})); exp_type = (*(v__ast__Type*)map_get(ADDR(map, g->comptime_var_type_map), &(string[]){name}, &(v__ast__Type[]){ 0 })); } - } else if ((left)._typ == 331 /* v.ast.TypeNode */) { + } else if ((left)._typ == 332 /* v.ast.TypeNode */) { exp_type = v__gen__c__Gen_unwrap_generic(g, (*left._v__ast__TypeNode).typ); } if ((*cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = v__ast__Type_idx(exp_type)}}, {_SLIT(" == "), 0xfe07, {.d_i32 = v__ast__Type_idx(got_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(exp_type)}}, {_SLIT(" == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(got_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); bool _t12 = v__ast__Type_alias_eq(exp_type, got_type); return _t12; } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = v__ast__Type_idx(exp_type)}}, {_SLIT(" != "), 0xfe07, {.d_i32 = v__ast__Type_idx(got_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(exp_type)}}, {_SLIT(" != "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(got_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); bool _t13 = !v__ast__Type_alias_eq(exp_type, got_type); return _t13; } @@ -73458,7 +73692,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ return _t15; }; } - else if (cond._typ == 305 /* v.ast.Ident */) { + else if (cond._typ == 306 /* v.ast.Ident */) { Option_string _t16 = v__gen__c__Gen_comptime_if_to_ifdef(g, (*cond._v__ast__Ident).name, false); if (_t16.state != 0) { /*or block*/ IError err = _t16.err; @@ -73466,12 +73700,12 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ } string ifdef = (*(string*)_t16.data); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("defined("), 0xfe10, {.d_s = ifdef}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("defined("), /*115 &string*/0xfe10, {.d_s = ifdef}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); bool _t17 = true; return _t17; } - else if (cond._typ == 296 /* v.ast.ComptimeCall */) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = pkg_exist ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); + else if (cond._typ == 297 /* v.ast.ComptimeCall */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &bool*/0xfe10, {.d_s = pkg_exist ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); bool _t18 = true; return _t18; } @@ -73487,7 +73721,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__ComptimeFor node) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.typ)); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("/* $for "), 0xfe10, {.d_s = node.val_var}}, {_SLIT(" in "), 0xfe10, {.d_s = sym->name}}, {_SLIT("("), 0xfe10, {.d_s = v__ast__ComptimeForKind_str(node.kind)}}, {_SLIT(") */ {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("/* $for "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" in "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__ast__ComptimeForKind_str(node.kind)}}, {_SLIT(") */ {"), 0, { .d_c = 0 }}}))); g->indent++; int i = 0; if (node.kind == v__ast__ComptimeForKind__methods) { @@ -73517,34 +73751,34 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp Array_v__ast__Fn methods_with_attrs =_t3; _PUSH_MANY(&methods, (methods_with_attrs), _t5, Array_v__ast__Fn); if (methods.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("FunctionData "), 0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("FunctionData "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); } for (int _t6 = 0; _t6 < methods.len; ++_t6) { v__ast__Fn method = ((v__ast__Fn*)methods.data)[_t6]; g->comptime_for_method = method.name; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* method "), 0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = method.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* method "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); if (method.attrs.len == 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = __new_array_with_default(0, 0, sizeof(string), 0);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = __new_array_with_default(0, 0, sizeof(string), 0);"), 0, { .d_c = 0 }}}))); } else { Array_string attrs = v__gen__c__cgen_attrs(method.attrs); - v__gen__c__Gen_writeln(g, string__plus(string__plus( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = new_array_from_c_array("), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", sizeof(string), _MOV((string["), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}})), Array_string_join(attrs, _SLIT(", "))), _SLIT("}));\n"))); + v__gen__c__Gen_writeln(g, string__plus(string__plus( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", sizeof(string), _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}})), Array_string_join(attrs, _SLIT(", "))), _SLIT("}));\n"))); } if (method.params.len < 2) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".args = __new_array_with_default(0, 0, sizeof(MethodArgs), 0);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".args = __new_array_with_default(0, 0, sizeof(MethodArgs), 0);"), 0, { .d_c = 0 }}}))); } else { int len = method.params.len - 1; - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".args = new_array_from_c_array("), 0xfe07, {.d_i32 = len}}, {_SLIT(", "), 0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(MethodArgs), _MOV((MethodArgs["), 0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".args = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT(", sizeof(MethodArgs), _MOV((MethodArgs["), /*100 &int*/0xfe07, {.d_i32 = len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); Array_v__ast__Param _t8; Array_v__ast__Param _t7 = (_t8 = method.params, array_slice(_t8, 1, _t8.len)); for (int j = 0; j < _t7.len; ++j) { v__ast__Param arg = ((v__ast__Param*)_t7.data)[j]; int typ = v__ast__Type_idx(arg.typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("{"), 0xfe10, {.d_s = int_str(typ)}}, {_SLIT(", _SLIT(\""), 0xfe10, {.d_s = arg.name}}, {_SLIT("\")}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("{"), /*115 &string*/0xfe10, {.d_s = int_str(typ)}}, {_SLIT(", _SLIT(\""), /*115 &string*/0xfe10, {.d_s = arg.name}}, {_SLIT("\")}"), 0, { .d_c = 0 }}}))); if (j < len - 1) { v__gen__c__Gen_write(g, _SLIT(", ")); } - map_set(&g->comptime_var_type_map, &(string[]){ str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.val_var}}, {_SLIT(".args["), 0xfe07, {.d_i32 = j}}, {_SLIT("].typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { typ }); + map_set(&g->comptime_var_type_map, &(string[]){ str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".args["), /*100 &int*/0xfe07, {.d_i32 = j}}, {_SLIT("].typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { typ }); } v__gen__c__Gen_writeln(g, _SLIT("}));\n")); } @@ -73554,18 +73788,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp for (int j = 0; j < _t9.len; ++j) { v__ast__Param arg = ((v__ast__Param*)_t9.data)[j]; v__ast__Type typ = v__ast__Type_set_nr_muls(arg.typ, 0); - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(typ)}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (j < method.params.len - 2) { sig = /*f*/string__plus(sig, _SLIT("_")); } } - sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = v__ast__Type_str(method.return_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sig = /*f*/string__plus(sig, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &v.ast.Type*/0xfe10, {.d_s = v__ast__Type_str(method.return_type)}}, {_SLIT0, 0, { .d_c = 0 }}}))); int styp = v__ast__Table_find_type_idx(g->table, sig); int ret_typ = v__ast__Type_idx(method.return_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ = "), 0xfe07, {.d_i32 = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".return_type = "), 0xfe07, {.d_i32 = ret_typ}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.val_var}}, {_SLIT(".return_type"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { ret_typ }); - map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { styp }); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ = "), /*100 &int*/0xfe07, {.d_i32 = styp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".return_type = "), /*100 &int*/0xfe07, {.d_i32 = ret_typ}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".return_type"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { ret_typ }); + map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { styp }); v__gen__c__Gen_stmts(g, node.stmts); i++; v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -73593,9 +73827,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp } } else if (node.kind == v__ast__ComptimeForKind__fields) { if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (sym_info.fields.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tFieldData "), 0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tFieldData "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); } g->inside_comptime_for_field = true; for (int _t17 = 0; _t17 < sym_info.fields.len; ++_t17) { @@ -73603,20 +73837,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp g->comptime_for_field_var = node.val_var; g->comptime_for_field_value = field; g->comptime_for_field_type = field.typ; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* field "), 0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = field.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* field "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); if (field.attrs.len == 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = __new_array_with_default(0, 0, sizeof(string), 0);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = __new_array_with_default(0, 0, sizeof(string), 0);"), 0, { .d_c = 0 }}}))); } else { Array_string attrs = v__gen__c__cgen_attrs(field.attrs); - v__gen__c__Gen_writeln(g, string__plus(string__plus( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = new_array_from_c_array("), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", sizeof(string), _MOV((string["), 0xfe07, {.d_i32 = attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}})), Array_string_join(attrs, _SLIT(", "))), _SLIT("}));\n"))); + v__gen__c__Gen_writeln(g, string__plus(string__plus( str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".attrs = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT(", sizeof(string), _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}})), Array_string_join(attrs, _SLIT(", "))), _SLIT("}));\n"))); } v__ast__Type styp = field.typ; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ = "), 0xfe07, {.d_i32 = v__ast__Type_idx(styp)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_pub = "), 0xfe10, {.d_s = field.is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_mut = "), 0xfe10, {.d_s = field.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_shared = "), 0xfe10, {.d_s = v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__shared_f) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { styp }); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ = "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(styp)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_pub = "), /*115 &bool*/0xfe10, {.d_s = field.is_pub ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_mut = "), /*115 &bool*/0xfe10, {.d_s = field.is_mut ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".is_shared = "), /*115 &bool*/0xfe10, {.d_s = v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__shared_f) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + map_set(&g->comptime_var_type_map, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".typ"), 0, { .d_c = 0 }}}))}, &(v__ast__Type[]) { styp }); v__gen__c__Gen_stmts(g, node.stmts); i++; v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -73626,17 +73860,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp map_delete(&g->comptime_var_type_map, &(string[]){node.val_var}); } } else if (node.kind == v__ast__ComptimeForKind__attributes) { - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).attrs.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tStructAttribute "), 0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tStructAttribute "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); } for (int _t18 = 0; _t18 < (*sym->info._v__ast__Struct).attrs.len; ++_t18) { v__ast__Attr attr = ((v__ast__Attr*)(*sym->info._v__ast__Struct).attrs.data)[_t18]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* attribute "), 0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = attr.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".has_arg = "), 0xfe10, {.d_s = attr.has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".arg = _SLIT(\""), 0xfe10, {.d_s = attr.arg}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.val_var}}, {_SLIT(".kind = AttributeKind__"), 0xfe10, {.d_s = v__ast__AttrKind_str(attr.kind)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* attribute "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(" */ {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".has_arg = "), /*115 &bool*/0xfe10, {.d_s = attr.has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".arg = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(".kind = AttributeKind__"), /*115 &v.ast.AttrKind*/0xfe10, {.d_s = v__ast__AttrKind_str(attr.kind)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_stmts(g, node.stmts); v__gen__c__Gen_writeln(g, _SLIT("}")); } @@ -73838,33 +74072,43 @@ VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen opt_ok(&(string[]) { _SLIT("__V_arm64") }, (Option*)(&_t38), sizeof(string)); return _t38; } - else if (string__eq(name, _SLIT("x64"))) { + else if (string__eq(name, _SLIT("arm32"))) { Option_string _t39; - opt_ok(&(string[]) { _SLIT("TARGET_IS_64BIT") }, (Option*)(&_t39), sizeof(string)); + opt_ok(&(string[]) { _SLIT("__V_arm32") }, (Option*)(&_t39), sizeof(string)); return _t39; } - else if (string__eq(name, _SLIT("x32"))) { + else if (string__eq(name, _SLIT("i386"))) { Option_string _t40; - opt_ok(&(string[]) { _SLIT("TARGET_IS_32BIT") }, (Option*)(&_t40), sizeof(string)); + opt_ok(&(string[]) { _SLIT("__V_x86") }, (Option*)(&_t40), sizeof(string)); return _t40; } - else if (string__eq(name, _SLIT("little_endian"))) { + else if (string__eq(name, _SLIT("x64"))) { Option_string _t41; - opt_ok(&(string[]) { _SLIT("TARGET_ORDER_IS_LITTLE") }, (Option*)(&_t41), sizeof(string)); + opt_ok(&(string[]) { _SLIT("TARGET_IS_64BIT") }, (Option*)(&_t41), sizeof(string)); return _t41; } - else if (string__eq(name, _SLIT("big_endian"))) { + else if (string__eq(name, _SLIT("x32"))) { Option_string _t42; - opt_ok(&(string[]) { _SLIT("TARGET_ORDER_IS_BIG") }, (Option*)(&_t42), sizeof(string)); + opt_ok(&(string[]) { _SLIT("TARGET_IS_32BIT") }, (Option*)(&_t42), sizeof(string)); return _t42; } + else if (string__eq(name, _SLIT("little_endian"))) { + Option_string _t43; + opt_ok(&(string[]) { _SLIT("TARGET_ORDER_IS_LITTLE") }, (Option*)(&_t43), sizeof(string)); + return _t43; + } + else if (string__eq(name, _SLIT("big_endian"))) { + Option_string _t44; + opt_ok(&(string[]) { _SLIT("TARGET_ORDER_IS_BIG") }, (Option*)(&_t44), sizeof(string)); + return _t44; + } else { if (is_comptime_optional || (g->pref->compile_defines_all.len > 0 && Array_string_contains(g->pref->compile_defines_all, name))) { - Option_string _t43; - opt_ok(&(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("CUSTOM_DEFINE_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t43), sizeof(string)); - return _t43; + Option_string _t45; + opt_ok(&(string[]) { str_intp(2, _MOV((StrIntpData[]){{_SLIT("CUSTOM_DEFINE_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t45), sizeof(string)); + return _t45; } - return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("bad os ifdef name \""), 0xfe10, {.d_s = name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("bad os ifdef name \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; }; return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } @@ -73883,7 +74127,7 @@ VV_LOCAL_SYMBOL v__ast__CTempVar v__gen__c__Gen_new_ctemp_var_then_gen(v__gen__c VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_ctemp_var(v__gen__c__Gen* g, v__ast__CTempVar tvar) { string styp = v__gen__c__Gen_typ(g, tvar.typ); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tvar.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tvar.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, tvar.orig); v__gen__c__Gen_writeln(g, _SLIT(";")); } @@ -73896,8 +74140,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_dump_expr(v__gen__c__Gen* g, v__ast__DumpExp v__gen__c__Gen_expr(g, node.expr); return; } - string dump_fn_name = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_dump_expr_"), 0xfe10, {.d_s = node.cname}}, {_SLIT0, 0, { .d_c = 0 }}})), ((v__ast__Type_is_ptr(node.expr_type) ? (_SLIT("_ptr")) : (_SLIT(""))))); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = dump_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = v__gen__c__ctoslit(fpath)}}, {_SLIT(", "), 0xfe07, {.d_i32 = line}}, {_SLIT(", "), 0xfe10, {.d_s = sexpr}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + string dump_fn_name = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_dump_expr_"), /*115 &string*/0xfe10, {.d_s = node.cname}}, {_SLIT0, 0, { .d_c = 0 }}})), ((v__ast__Type_is_ptr(node.expr_type) ? (_SLIT("_ptr")) : (_SLIT(""))))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dump_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(fpath)}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = line}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = sexpr}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); v__gen__c__Gen_write(g, _SLIT(" )")); } @@ -73926,27 +74170,27 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_dump_expr_definitions(v__gen__c__Gen* g) { string deref = mr_830.arg0; string to_string_fn_name = v__gen__c__Gen_get_str_fn(g, dump_type); string ptr_asterisk = (is_ptr ? (_SLIT("*")) : (_SLIT(""))); - string str_dumparg_type = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cname}}, {_SLIT0, 0xfe10, {.d_s = ptr_asterisk}}, {_SLIT0, 0, { .d_c = 0 }}})); + string str_dumparg_type = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_asterisk}}, {_SLIT0, 0, { .d_c = 0 }}})); if (dump_sym->kind == v__ast__Kind__function) { - v__ast__FnType fninfo = /* as */ *(v__ast__FnType*)__as_cast((dump_sym->info)._v__ast__FnType,(dump_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; - str_dumparg_type = str_intp(2, _MOV((StrIntpData[]){{_SLIT("DumpFNType_"), 0xfe10, {.d_s = cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + v__ast__FnType fninfo = /* as */ *(v__ast__FnType*)__as_cast((dump_sym->info)._v__ast__FnType,(dump_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; + str_dumparg_type = str_intp(2, _MOV((StrIntpData[]){{_SLIT("DumpFNType_"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, 0, { .d_c = 0 }}})); int tdef_pos = g->out.len; v__gen__c__Gen_write_fn_ptr_decl(g, &fninfo, str_dumparg_type); string str_tdef = strings__Builder_after(&g->out, tdef_pos); strings__Builder_go_back(&g->out, str_tdef.len); - map_set(&dump_typedefs, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), 0xfe10, {.d_s = str_tdef}}, {_SLIT(";"), 0, { .d_c = 0 }}}))}, &(bool[]) { true }); + map_set(&dump_typedefs, &(string[]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("typedef "), /*115 &string*/0xfe10, {.d_s = str_tdef}}, {_SLIT(";"), 0, { .d_c = 0 }}}))}, &(bool[]) { true }); } - string dump_fn_name = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_dump_expr_"), 0xfe10, {.d_s = cname}}, {_SLIT0, 0, { .d_c = 0 }}})), ((is_ptr ? (_SLIT("_ptr")) : (_SLIT(""))))); - strings__Builder_writeln(&dump_fn_defs, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" "), 0xfe10, {.d_s = dump_fn_name}}, {_SLIT("(string fpath, int line, string sexpr, "), 0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" dump_arg);"), 0, { .d_c = 0 }}}))); - if (v__gen__c__Gen_writeln_fn_header(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" "), 0xfe10, {.d_s = dump_fn_name}}, {_SLIT("(string fpath, int line, string sexpr, "), 0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" dump_arg)"), 0, { .d_c = 0 }}})), (voidptr)&/*qq*/dump_fns)) { + string dump_fn_name = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_dump_expr_"), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, 0, { .d_c = 0 }}})), ((is_ptr ? (_SLIT("_ptr")) : (_SLIT(""))))); + strings__Builder_writeln(&dump_fn_defs, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dump_fn_name}}, {_SLIT("(string fpath, int line, string sexpr, "), /*115 &string*/0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" dump_arg);"), 0, { .d_c = 0 }}}))); + if (v__gen__c__Gen_writeln_fn_header(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dump_fn_name}}, {_SLIT("(string fpath, int line, string sexpr, "), /*115 &string*/0xfe10, {.d_s = str_dumparg_type}}, {_SLIT(" dump_arg)"), 0, { .d_c = 0 }}})), (voidptr)&/*qq*/dump_fns)) { continue; } v__util__Surrounder surrounder = v__util__new_surrounder(3); v__util__Surrounder_add(&surrounder, _SLIT("\tstring sline = int_str(line);"), _SLIT("\tstring_free(&sline);")); if (dump_sym->kind == v__ast__Kind__function) { - v__util__Surrounder_add(&surrounder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring value = "), 0xfe10, {.d_s = to_string_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}})), _SLIT("\tstring_free(&value);")); + v__util__Surrounder_add(&surrounder, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tstring value = "), /*115 &string*/0xfe10, {.d_s = to_string_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}})), _SLIT("\tstring_free(&value);")); } else { - v__util__Surrounder_add(&surrounder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring value = "), 0xfe10, {.d_s = to_string_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = deref}}, {_SLIT("dump_arg);"), 0, { .d_c = 0 }}})), _SLIT("\tstring_free(&value);")); + v__util__Surrounder_add(&surrounder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tstring value = "), /*115 &string*/0xfe10, {.d_s = to_string_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT("dump_arg);"), 0, { .d_c = 0 }}})), _SLIT("\tstring_free(&value);")); } v__util__Surrounder_add(&surrounder, _SLIT("\n\011strings__Builder sb = strings__new_builder(256);\n"), _SLIT("\n\011string res;\n\011res = strings__Builder_str(&sb);\n\011eprint(res);\n\011string_free(&res);\n\011strings__Builder_free(&sb);\n")); v__util__Surrounder_builder_write_befores(&surrounder, (voidptr)&/*qq*/dump_fns); @@ -73987,11 +74231,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_dump_expr_definitions(v__gen__c__Gen* g) { VV_LOCAL_SYMBOL bool v__gen__c__Gen_writeln_fn_header(v__gen__c__Gen* g, string s, strings__Builder* sb) { if (g->pref->build_mode == v__pref__BuildMode__build_module) { - strings__Builder_writeln(sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = s}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); bool _t1 = true; return _t1; } - strings__Builder_writeln(sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = s}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); bool _t2 = false; return _t2; } @@ -74010,7 +74254,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as Option_Array_u8 _t1 = os__read_bytes(node->embed_file.apath); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to read file: \""), 0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to read file: \""), /*115 &string*/0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -74034,10 +74278,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as } string cache_path = os__join_path(cache_dir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){cache_key}))); string vexe = v__pref__vexe_path(); - string compress_cmd = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" compress "), 0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(node->embed_file.apath)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(cache_path)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string compress_cmd = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" compress "), /*115 &string*/0xfe10, {.d_s = node->embed_file.compression_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(node->embed_file.apath)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(cache_path)}}, {_SLIT0, 0, { .d_c = 0 }}})); os__Result result = os__execute(compress_cmd); if (result.exit_code != 0) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("unable to compress file \""), 0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT("\": "), 0xfe10, {.d_s = result.output}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("unable to compress file \""), /*115 &string*/0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT("\": "), /*115 &string*/0xfe10, {.d_s = result.output}}, {_SLIT0, 0, { .d_c = 0 }}}))); node->embed_file.bytes = file_bytes; } else { Option_Array_u8 _t3 = os__read_bytes(cache_path); @@ -74066,7 +74310,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as node->embed_file.len = file_bytes.len; } u64 ef_idx = v__ast__EmbeddedFile_hash(node->embed_file); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_embed_file_metadata( "), 0xfe08, {.d_u64 = ef_idx}}, {_SLIT("U )"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_embed_file_metadata( "), /*117 &u64*/0xfe08, {.d_u64 = ef_idx}}, {_SLIT("U )"), 0, { .d_c = 0 }}}))); array_push((array*)&g->file->embedded_files, _MOV((v__ast__EmbeddedFile[]){ node->embed_file })); } @@ -74078,20 +74322,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_metadata(v__gen__c__Gen* g) { for (int _t1 = 0; _t1 < g->embedded_files.len; ++_t1) { v__ast__EmbeddedFile emfile = ((v__ast__EmbeddedFile*)g->embedded_files.data)[_t1]; u64 ef_idx = v__ast__EmbeddedFile_hash(emfile); - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), 0xfe08, {.d_u64 = ef_idx}}, {_SLIT("U: {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.path = "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcase "), /*117 &u64*/0xfe08, {.d_u64 = ef_idx}}, {_SLIT("U: {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.path = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); if (v__gen__c__Gen_embed_file_is_prod_mode(g)) { - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.apath = "), 0xfe10, {.d_s = v__gen__c__ctoslit(_SLIT(""))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.apath = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(_SLIT(""))}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.apath = "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.apath)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.apath = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.apath)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } if (v__gen__c__Gen_embed_file_is_prod_mode(g)) { if (emfile.is_compressed) { - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.compression_type = "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.compressed = v__embed_file__find_index_entry_by_path((voidptr)_v_embed_file_index, "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(", "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(")->data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.compression_type = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.compressed = v__embed_file__find_index_entry_by_path((voidptr)_v_embed_file_index, "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(")->data;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tres.uncompressed = NULL;")); } else { - strings__Builder_writeln(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.uncompressed = v__embed_file__find_index_entry_by_path((voidptr)_v_embed_file_index, "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(", "), 0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(")->data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.uncompressed = v__embed_file__find_index_entry_by_path((voidptr)_v_embed_file_index, "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.rpath)}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__ctoslit(emfile.compression_type)}}, {_SLIT(")->data;"), 0, { .d_c = 0 }}}))); } } else { strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tres.uncompressed = NULL;")); @@ -74099,16 +74343,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_metadata(v__gen__c__Gen* g) { strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tres.free_compressed = 0;")); strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tres.free_uncompressed = 0;")); if (v__gen__c__Gen_embed_file_is_prod_mode(g)) { - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.len = "), 0xfe07, {.d_i32 = emfile.len}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.len = "), /*100 &int*/0xfe07, {.d_i32 = emfile.len}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { u64 file_size = os__file_size(emfile.apath); if (file_size > 5242880U) { eprintln(_SLIT("Warning: embedding of files >= ~5MB is currently not supported")); } - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.len = "), 0xfe08, {.d_u64 = file_size}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tres.len = "), /*117 &u64*/0xfe08, {.d_u64 = file_size}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->embedded_data, _SLIT("\t\t\tbreak;")); - strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t} // case "), 0xfe08, {.d_u64 = ef_idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t} // case "), /*117 &u64*/0xfe08, {.d_u64 = ef_idx}}, {_SLIT0, 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->embedded_data, _SLIT("\t\tdefault: _v_panic(_SLIT(\"unknown embed file\"));")); strings__Builder_writeln(&g->embedded_data, _SLIT("\t} // switch")); @@ -74119,13 +74363,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_metadata(v__gen__c__Gen* g) { VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_data(v__gen__c__Gen* g) { for (int i = 0; i < g->embedded_files.len; ++i) { v__ast__EmbeddedFile emfile = ((v__ast__EmbeddedFile*)g->embedded_files.data)[i]; - strings__Builder_write_string(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static const unsigned char _v_embed_blob_"), 0xfe07, {.d_i32 = i}}, {_SLIT("["), 0xfe07, {.d_i32 = emfile.bytes.len}}, {_SLIT("] = {\n "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->embedded_data, str_intp(3, _MOV((StrIntpData[]){{_SLIT("static const unsigned char _v_embed_blob_"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = emfile.bytes.len}}, {_SLIT("] = {\n "), 0, { .d_c = 0 }}}))); for (int j = 0; j < emfile.bytes.len; j++) { string b = u8_hex((*(u8*)/*ee elem_sym */array_get(emfile.bytes, j))); if (j < emfile.bytes.len - 1) { - strings__Builder_write_string(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x"), 0xfe10, {.d_s = b}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x"), /*115 &string*/0xfe10, {.d_s = b}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x"), 0xfe10, {.d_s = b}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->embedded_data, str_intp(2, _MOV((StrIntpData[]){{_SLIT("0x"), /*115 &string*/0xfe10, {.d_s = b}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (0 == ((j + 1) % 16)) { strings__Builder_write_string(&g->embedded_data, _SLIT("\n ")); @@ -74137,7 +74381,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_data(v__gen__c__Gen* g) { strings__Builder_writeln(&g->embedded_data, _SLIT("const v__embed_file__EmbedFileIndexEntry _v_embed_file_index[] = {")); for (int i = 0; i < g->embedded_files.len; ++i) { v__ast__EmbeddedFile emfile = ((v__ast__EmbeddedFile*)g->embedded_files.data)[i]; - strings__Builder_writeln(&g->embedded_data, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\t{"), 0xfe07, {.d_i32 = i}}, {_SLIT(", { .str=(byteptr)(\""), 0xfe10, {.d_s = v__gen__c__cestring(emfile.rpath)}}, {_SLIT("\"), .len="), 0xfe07, {.d_i32 = emfile.rpath.len}}, {_SLIT(", .is_lit=1 }, { .str=(byteptr)(\""), 0xfe10, {.d_s = v__gen__c__cestring(emfile.compression_type)}}, {_SLIT("\"), .len="), 0xfe07, {.d_i32 = emfile.compression_type.len}}, {_SLIT(", .is_lit=1 }, _v_embed_blob_"), 0xfe07, {.d_i32 = i}}, {_SLIT("},"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->embedded_data, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\t{"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT(", { .str=(byteptr)(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__cestring(emfile.rpath)}}, {_SLIT("\"), .len="), /*100 &int*/0xfe07, {.d_i32 = emfile.rpath.len}}, {_SLIT(", .is_lit=1 }, { .str=(byteptr)(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__cestring(emfile.compression_type)}}, {_SLIT("\"), .len="), /*100 &int*/0xfe07, {.d_i32 = emfile.compression_type.len}}, {_SLIT(", .is_lit=1 }, _v_embed_blob_"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("},"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->embedded_data, _SLIT("\t{-1, { .str=(byteptr)(\"\"), .len=0, .is_lit=1 }, { .str=(byteptr)(\"\"), .len=0, .is_lit=1 }, NULL}")); strings__Builder_writeln(&g->embedded_data, _SLIT("};")); @@ -74183,7 +74427,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_decl(v__gen__c__Gen* g, v__ast__FnDecl no skip = false; } if (!skip && g->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("build module `"), 0xfe10, {.d_s = g->module_built}}, {_SLIT("` fn `"), 0xfe10, {.d_s = node.name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("build module `"), /*115 &string*/0xfe10, {.d_s = g->module_built}}, {_SLIT("` fn `"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } } if (g->pref->use_cache) { @@ -74279,7 +74523,7 @@ int ctmp; array_push((array*)&_t4, &ti); } string the_type = Array_string_join(_t4, _SLIT(", ")); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("gen fn `"), 0xfe10, {.d_s = node->name}}, {_SLIT("` for type `"), 0xfe10, {.d_s = the_type}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("gen fn `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` for type `"), /*115 &string*/0xfe10, {.d_s = the_type}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } g->cur_concrete_types = concrete_types; v__gen__c__Gen_gen_fn_decl(g, node, skip); @@ -74311,7 +74555,8 @@ int ctmp; bool is_closure = v__ast__Scope_has_inherited_vars(node->scope); string cur_closure_ctx = _SLIT(""); if (is_closure) { - cur_closure_ctx = v__gen__c__closure_ctx_struct(*node); + multi_return_string_string mr_5443 = v__gen__c__closure_ctx(*node); + cur_closure_ctx = mr_5443.arg0; strings__Builder_write_string(&g->definitions, cur_closure_ctx); strings__Builder_writeln(&g->definitions, _SLIT(";")); } @@ -74323,7 +74568,7 @@ int ctmp; bool is_livemode = g->pref->is_livemain || g->pref->is_liveshared; bool is_live_wrap = is_livefn && is_livemode; if (is_livefn && !is_livemode) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("INFO: compile with `v -live "), 0xfe10, {.d_s = g->pref->path}}, {_SLIT(" `, if you want to use the [live] function "), 0xfe10, {.d_s = node->name}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("INFO: compile with `v -live "), /*115 &string*/0xfe10, {.d_s = g->pref->path}}, {_SLIT(" `, if you want to use the [live] function "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); } Option_string _t6 = v__gen__c__Gen_c_fn_name(g, node); if (_t6.state != 0) { /*or block*/ @@ -74359,7 +74604,7 @@ int ctmp; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node->receiver.typ); key = string__plus(string__plus(sym->name, _SLIT(".")), node->name); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t8 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); Option_string _t7 = {0}; if (_t8) { @@ -74370,7 +74615,7 @@ int ctmp; ; if (_t7.state != 0) { /*or block*/ IError err = _t7.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: fn_decl: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: fn_decl: obf name \""), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -74382,19 +74627,19 @@ int ctmp; } string impl_fn_name = name; if (is_live_wrap) { - impl_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("impl_live_"), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + impl_fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("impl_live_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } last_fn_c_name_save = g->last_fn_c_name; v__gen__c__Gen_gen_fn_decl_defer_4 = true; g->last_fn_c_name = impl_fn_name; if (is_live_wrap) { if (is_livemain) { - strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" (* "), 0xfe10, {.d_s = impl_fn_name}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" no_impl_"), 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" (* "), /*115 &string*/0xfe10, {.d_s = impl_fn_name}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" no_impl_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } if (is_liveshared) { - strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } } else { if (!(node->is_pub || g->pref->is_debug)) { @@ -74404,17 +74649,17 @@ int ctmp; } } string visibility_kw = (g->cur_concrete_types.len > 0 && (g->pref->build_mode == v__pref__BuildMode__build_module || g->pref->use_cache) ? (_SLIT("static ")) : (_SLIT(""))); - string fn_header = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = visibility_kw}}, {_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = fn_attrs}}, {_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})); + string fn_header = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = visibility_kw}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fn_attrs}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})); strings__Builder_write_string(&g->definitions, fn_header); v__gen__c__Gen_write(g, fn_header); } int arg_start_pos = g->out.len; - multi_return_Array_string_Array_string_Array_bool mr_8611 = v__gen__c__Gen_fn_decl_params(g, node->params, node->scope, node->is_variadic); - Array_string fargs = mr_8611.arg0; - Array_string fargtypes = mr_8611.arg1; - Array_bool heap_promoted = mr_8611.arg2; + multi_return_Array_string_Array_string_Array_bool mr_8607 = v__gen__c__Gen_fn_decl_params(g, node->params, node->scope, node->is_variadic); + Array_string fargs = mr_8607.arg0; + Array_string fargtypes = mr_8607.arg1; + Array_bool heap_promoted = mr_8607.arg2; if (is_closure) { - string s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_closure_ctx}}, {_SLIT(" *"), 0xfe10, {.d_s = _const_v__gen__c__closure_ctx}}, {_SLIT0, 0, { .d_c = 0 }}})); + string s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_closure_ctx}}, {_SLIT(" *"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__closure_ctx}}, {_SLIT0, 0, { .d_c = 0 }}})); if (node->params.len > 0) { s = string__plus(_SLIT(", "), s); } else { @@ -74423,10 +74668,6 @@ int ctmp; strings__Builder_write_string(&g->definitions, s); v__gen__c__Gen_write(g, s); g->nr_closures++; - if (g->pref->os == v__pref__OS__windows) { - v__gen__c__Gen_error(g, _SLIT("closures are not yet implemented on windows"), node->pos); - VUNREACHABLE(); - } } string arg_str = strings__Builder_after(&g->out, arg_start_pos); if (node->no_body || ((g->pref->use_cache && g->pref->build_mode != v__pref__BuildMode__build_module) && node->is_builtin && !g->pref->is_test) || skip) { @@ -74467,12 +74708,12 @@ int ctmp; for (int i = 0; i < heap_promoted.len; ++i) { bool is_promoted = ((bool*)heap_promoted.data)[i]; if (is_promoted) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, i))}}, {_SLIT("* "), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, i))}}, {_SLIT(" = HEAP("), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, i))}}, {_SLIT(", _v_toheap_"), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, i))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, i))}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, i))}}, {_SLIT(" = HEAP("), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, i))}}, {_SLIT(", _v_toheap_"), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargs, i))}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } for (int _t10 = 0; _t10 < node->defer_stmts.len; ++_t10) { v__ast__DeferStmt defer_stmt = ((v__ast__DeferStmt*)node->defer_stmts.data)[_t10]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_defer_flag_var(g, (voidptr)&/*qq*/defer_stmt)}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); for (int _t11 = 0; _t11 < defer_stmt.defer_vars.len; ++_t11) { v__ast__Ident var = ((v__ast__Ident*)defer_stmt.defer_vars.data)[_t11]; if (Array_string_contains(fargs, var.name) || var.kind == v__ast__IdentKind__constant) { @@ -74489,9 +74730,9 @@ int ctmp; deref = _SLIT("*"); } } - v__ast__Var info = /* as */ *(v__ast__Var*)__as_cast((var.obj)._v__ast__Var,(var.obj)._typ, 363) /*expected idx: 363, name: v.ast.Var */ ; + v__ast__Var info = /* as */ *(v__ast__Var*)__as_cast((var.obj)._v__ast__Var,(var.obj)._typ, 364) /*expected idx: 364, name: v.ast.Var */ ; if (v__ast__Table_sym(g->table, info.typ)->kind != v__ast__Kind__function) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.typ)}}, {_SLIT0, 0xfe10, {.d_s = deref}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(var.name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, info.typ)}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = deref}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(var.name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } @@ -74501,20 +74742,20 @@ int ctmp; Array_string fn_args_list = __new_array_with_default(0, 0, sizeof(string), 0); for (int ia = 0; ia < fargs.len; ++ia) { string fa = ((string*)fargs.data)[ia]; - array_push((array*)&fn_args_list, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, ia))}}, {_SLIT(" "), 0xfe10, {.d_s = fa}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&fn_args_list, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(fargtypes, ia))}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fa}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } - string live_fncall = string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fargs, _SLIT(", "))), _SLIT(");")); + string live_fncall = string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = impl_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fargs, _SLIT(", "))), _SLIT(");")); string live_fnreturn = _SLIT(""); if (!string__eq(type_name, _SLIT("void"))) { - live_fncall = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" res = "), 0xfe10, {.d_s = live_fncall}}, {_SLIT0, 0, { .d_c = 0 }}})); + live_fncall = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" res = "), /*115 &string*/0xfe10, {.d_s = live_fncall}}, {_SLIT0, 0, { .d_c = 0 }}})); live_fnreturn = _SLIT("return res;"); } - strings__Builder_writeln(&g->definitions, string__plus(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fn_args_list, _SLIT(", "))), _SLIT(");"))); - strings__Builder_writeln(&g->hotcode_definitions, string__plus(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fn_args_list, _SLIT(", "))), _SLIT("){"))); + strings__Builder_writeln(&g->definitions, string__plus(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fn_args_list, _SLIT(", "))), _SLIT(");"))); + strings__Builder_writeln(&g->hotcode_definitions, string__plus(string__plus( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}})), Array_string_join(fn_args_list, _SLIT(", "))), _SLIT("){"))); strings__Builder_writeln(&g->hotcode_definitions, _SLIT(" pthread_mutex_lock(&live_fn_mutex);")); - strings__Builder_writeln(&g->hotcode_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = live_fncall}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->hotcode_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = live_fncall}}, {_SLIT0, 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->hotcode_definitions, _SLIT(" pthread_mutex_unlock(&live_fn_mutex);")); - strings__Builder_writeln(&g->hotcode_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = live_fnreturn}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->hotcode_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = live_fnreturn}}, {_SLIT0, 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->hotcode_definitions, _SLIT("}")); } if (g->pref->is_prof && g->pref->build_mode != v__pref__BuildMode__build_module) { @@ -74540,12 +74781,12 @@ int ctmp; } else { g->defer_stmts = __new_array_with_default(0, 0, sizeof(v__ast__DeferStmt), 0); } - if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && node->stmts.len > 0 && ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 356 /* v.ast.Return */ && !Array_v__ast__Attr_contains(node->attrs, _SLIT("_naked"))) { + if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type) && node->stmts.len > 0 && ((*(v__ast__Stmt*)array_last(node->stmts)))._typ != 357 /* v.ast.Return */ && !Array_v__ast__Attr_contains(node->attrs, _SLIT("_naked"))) { string default_expr = v__gen__c__Gen_type_default(g, node->return_type); if (string__eq(default_expr, _SLIT("{0}"))) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\treturn ("), 0xfe10, {.d_s = type_name}}, {_SLIT(")"), 0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\treturn ("), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -74555,11 +74796,11 @@ int ctmp; for (int _t15 = 0; _t15 < node->attrs.len; ++_t15) { v__ast__Attr attr = ((v__ast__Attr*)node->attrs.data)[_t15]; if (string__eq(attr.name, _SLIT("export"))) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// export alias: "), 0xfe10, {.d_s = attr.arg}}, {_SLIT(" -> "), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}}))); - string export_alias = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = type_name}}, {_SLIT(" "), 0xfe10, {.d_s = fn_attrs}}, {_SLIT0, 0xfe10, {.d_s = attr.arg}}, {_SLIT("("), 0xfe10, {.d_s = arg_str}}, {_SLIT(")"), 0, { .d_c = 0 }}})); - strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("VV_EXPORTED_SYMBOL "), 0xfe10, {.d_s = export_alias}}, {_SLIT("; // exported fn "), 0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = export_alias}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("// export alias: "), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT(" -> "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string export_alias = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = fn_attrs}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = arg_str}}, {_SLIT(")"), 0, { .d_c = 0 }}})); + strings__Builder_writeln(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("VV_EXPORTED_SYMBOL "), /*115 &string*/0xfe10, {.d_s = export_alias}}, {_SLIT("; // exported fn "), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = export_alias}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, Array_string_join(fargs, _SLIT(", "))); v__gen__c__Gen_writeln(g, _SLIT(");")); v__gen__c__Gen_writeln(g, _SLIT("}")); @@ -74625,9 +74866,8 @@ VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast return _t2; } -VV_LOCAL_SYMBOL string v__gen__c__closure_ctx_struct(v__ast__FnDecl node) { - string _t1 = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _V_"), 0xfe10, {.d_s = node.name}}, {_SLIT("_Ctx"), 0, { .d_c = 0 }}})); - return _t1; +VV_LOCAL_SYMBOL multi_return_string_string v__gen__c__closure_ctx(v__ast__FnDecl node) { + return (multi_return_string_string){.arg0= str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _V_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("_Ctx"), 0, { .d_c = 0 }}})), .arg1= str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct _V_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("_Args"), 0, { .d_c = 0 }}}))}; } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn(v__gen__c__Gen* g, v__ast__AnonFn* node) { @@ -74636,26 +74876,64 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn(v__gen__c__Gen* g, v__ast__AnonF v__gen__c__Gen_write(g, node->decl.name); return; } - string ctx_struct = v__gen__c__closure_ctx_struct(node->decl); - strings__Builder size_sb = strings__new_builder(node->decl.params.len * 50); - for (int _t1 = 0; _t1 < node->decl.params.len; ++_t1) { - v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[_t1]; - strings__Builder_write_string(&size_sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_REG_WIDTH_BOUNDED("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, param.typ)}}, {_SLIT(") + "), 0, { .d_c = 0 }}}))); - } - if (g->pref->arch == v__pref__Arch__amd64 && !v__ast__Type_alias_eq(node->decl.return_type, _const_v__ast__void_type)) { - strings__Builder_write_string(&size_sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(_REG_WIDTH("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node->decl.return_type)}}, {_SLIT(") > 2) + "), 0, { .d_c = 0 }}}))); - } - strings__Builder_write_string(&size_sb, _SLIT("1")); - string args_size = strings__Builder_str(&size_sb); - v__gen__c__Gen_writeln(g, _SLIT("")); - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("__closure_create("), 0xfe10, {.d_s = node->decl.name}}, {_SLIT(", __closure_check_nargs("), 0xfe10, {.d_s = args_size}}, {_SLIT("), ("), 0xfe10, {.d_s = ctx_struct}}, {_SLIT("*) memdup(&("), 0xfe10, {.d_s = ctx_struct}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + multi_return_string_string mr_14615 = v__gen__c__closure_ctx(node->decl); + string ctx_struct = mr_14615.arg0; + string arg_struct = mr_14615.arg1; + v__gen__c__Gen_write(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("__closure_create("), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT("_wrapper, "), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT("_unwrapper, ("), /*115 &string*/0xfe10, {.d_s = ctx_struct}}, {_SLIT("*) memdup(&("), /*115 &string*/0xfe10, {.d_s = ctx_struct}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); g->indent++; - for (int _t2 = 0; _t2 < node->inherited_vars.len; ++_t2) { - v__ast__Param var = ((v__ast__Param*)node->inherited_vars.data)[_t2]; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = var.name}}, {_SLIT(" = "), 0xfe10, {.d_s = var.name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + for (int _t1 = 0; _t1 < node->inherited_vars.len; ++_t1) { + v__ast__Param var = ((v__ast__Param*)node->inherited_vars.data)[_t1]; + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = var.name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = var.name}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } g->indent--; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = ctx_struct}}, {_SLIT(")))"), 0, { .d_c = 0 }}}))); + int ps = g->table->pointer_size; + int is_big_cutoff = (g->pref->os == v__pref__OS__windows || g->pref->arch == v__pref__Arch__arm32 ? (ps) : (ps * 2)); + bool is_big = v__ast__Table_type_size(g->table, node->decl.return_type) > is_big_cutoff; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = ctx_struct}}, {_SLIT(")))"), 0, { .d_c = 0 }}}))); + strings__Builder sb = strings__new_builder(512); + string ret_styp = v__gen__c__Gen_typ(g, node->decl.return_type); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" VV_LOCAL_SYMBOL void "), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT("_wrapper("), 0, { .d_c = 0 }}}))); + if (is_big) { + strings__Builder_write_string(&sb, _SLIT("__CLOSURE_WRAPPER_EXTRA_PARAM ")); + if (node->decl.params.len > 0) { + strings__Builder_write_string(&sb, _SLIT("__CLOSURE_WRAPPER_EXTRA_PARAM_COMMA ")); + } + } + for (int i = 0; i < node->decl.params.len; ++i) { + v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[i]; + if (i > 0) { + strings__Builder_write_string(&sb, _SLIT(", ")); + } + strings__Builder_write_string(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, param.typ)}}, {_SLIT(" a"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&sb, _SLIT(") {")); + if (node->decl.params.len > 0) { + strings__Builder_writeln(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("void** closure_start = (void**)((char*)__RETURN_ADDRESS() - __CLOSURE_WRAPPER_OFFSET);\n "), /*115 &string*/0xfe10, {.d_s = arg_struct}}, {_SLIT("* args = closure_start[-5];"), 0, { .d_c = 0 }}}))); + for (int i = 0; i < node->decl.params.len; ++i) { + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\targs->a"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" = a"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } + } + strings__Builder_writeln(&sb, _SLIT("}\n")); + strings__Builder_writeln(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT(" VV_LOCAL_SYMBOL "), /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = node->decl.name}}, {_SLIT("_unwrapper(void) {\n void** closure_start = (void**)((char*)__RETURN_ADDRESS() - __CLOSURE_UNWRAPPER_OFFSET);\n void* userdata = closure_start[-1];"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node->decl.return_type)}}, {_SLIT(" (*fn)("), 0, { .d_c = 0 }}}))); + for (int i = 0; i < node->decl.params.len; ++i) { + v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[i]; + strings__Builder_write_string(&sb, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, param.typ)}}, {_SLIT(" a"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&sb, _SLIT("void* userdata) = closure_start[-2];")); + if (node->decl.params.len > 0) { + strings__Builder_writeln(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = arg_struct}}, {_SLIT("* args = closure_start[-5];"), 0, { .d_c = 0 }}}))); + } + if (node->decl.return_type == _const_v__ast__void_type_idx) { + strings__Builder_write_string(&sb, _SLIT("\tfn(")); + } else { + strings__Builder_write_string(&sb, _SLIT("\treturn fn(")); + } + for (int i = 0; i < node->decl.params.len; ++i) { + strings__Builder_write_string(&sb, str_intp(2, _MOV((StrIntpData[]){{_SLIT("args->a"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&sb, _SLIT("userdata);\n}")); + array_push((array*)&g->anon_fn_definitions, _MOV((string[]){ string_clone(strings__Builder_str(&sb)) })); g->empty_line = false; } @@ -74666,14 +74944,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn_decl(v__gen__c__Gen* g, v__ast__ node->has_gen = true; strings__Builder builder = strings__new_builder(256); if (node->inherited_vars.len > 0) { - string ctx_struct = v__gen__c__closure_ctx_struct(node->decl); - strings__Builder_writeln(&builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ctx_struct}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + multi_return_string_string mr_17084 = v__gen__c__closure_ctx(node->decl); + string ctx_struct = mr_17084.arg0; + string arg_struct = mr_17084.arg1; + strings__Builder_writeln(&builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ctx_struct}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < node->inherited_vars.len; ++_t1) { v__ast__Param var = ((v__ast__Param*)node->inherited_vars.data)[_t1]; string styp = v__gen__c__Gen_typ(g, var.typ); - strings__Builder_writeln(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = var.name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = var.name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&builder, _SLIT("};\n")); + if (node->decl.params.len > 0) { + strings__Builder_writeln(&builder, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_struct}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + for (int i = 0; i < node->decl.params.len; ++i) { + v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[i]; + strings__Builder_writeln(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, param.typ)}}, {_SLIT(" a"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + } + strings__Builder_writeln(&builder, _SLIT("};\n")); + } } int pos = g->out.len; bool was_anon_fn = g->anon_fn; @@ -74685,7 +74973,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_anon_fn_decl(v__gen__c__Gen* g, v__ast__ } VV_LOCAL_SYMBOL string v__gen__c__Gen_defer_flag_var(v__gen__c__Gen* g, v__ast__DeferStmt* stmt) { - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = g->last_fn_c_name}}, {_SLIT("_defer_"), 0xfe07, {.d_i32 = stmt->idx_in_fn}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = g->last_fn_c_name}}, {_SLIT("_defer_"), /*100 &int*/0xfe07, {.d_i32 = stmt->idx_in_fn}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t1; } @@ -74716,10 +75004,10 @@ VV_LOCAL_SYMBOL multi_return_Array_string_Array_string_Array_bool v__gen__c__Gen v__ast__TypeSymbol* arg_type_sym = v__ast__Table_sym(g->table, typ); string arg_type_name = v__gen__c__Gen_typ(g, typ); if (arg_type_sym->kind == v__ast__Kind__function) { - v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((arg_type_sym->info)._v__ast__FnType,(arg_type_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((arg_type_sym->info)._v__ast__FnType,(arg_type_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ; v__ast__Fn func = info.func; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" (*"), 0xfe10, {.d_s = caname}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); - strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" (*"), 0xfe10, {.d_s = caname}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = caname}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, func.return_type)}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = caname}}, {_SLIT(")("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_fn_decl_params(g, func.params, ((voidptr)(0)), func.is_variadic); v__gen__c__Gen_write(g, _SLIT(")")); strings__Builder_write_string(&g->definitions, _SLIT(")")); @@ -74740,7 +75028,7 @@ VV_LOCAL_SYMBOL multi_return_Array_string_Array_string_Array_bool v__gen__c__Gen } string var_name_prefix = (heap_prom ? (_SLIT("_v_toheap_")) : (_SLIT(""))); string const_prefix = (v__ast__Type_is_any_kind_of_pointer(arg.typ) && !arg.is_mut && string_starts_with(arg.name, _SLIT("const_")) ? (_SLIT("const ")) : (_SLIT(""))); - string s = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = const_prefix}}, {_SLIT0, 0xfe10, {.d_s = arg_type_name}}, {_SLIT(" "), 0xfe10, {.d_s = var_name_prefix}}, {_SLIT0, 0xfe10, {.d_s = caname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string s = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = const_prefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_type_name}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = var_name_prefix}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = caname}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Gen_write(g, s); strings__Builder_write_string(&g->definitions, s); array_push((array*)&fargs, _MOV((string[]){ string_clone(caname) })); @@ -74762,14 +75050,14 @@ VV_LOCAL_SYMBOL multi_return_Array_string_Array_string_Array_bool v__gen__c__Gen VV_LOCAL_SYMBOL string v__gen__c__Gen_get_anon_fn_type_name(v__gen__c__Gen* g, v__ast__AnonFn* node, string var_name) { strings__Builder builder = strings__new_builder(64); string return_styp = v__gen__c__Gen_typ(g, node->decl.return_type); - strings__Builder_write_string(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = return_styp}}, {_SLIT(" (*"), 0xfe10, {.d_s = var_name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = return_styp}}, {_SLIT(" (*"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(") ("), 0, { .d_c = 0 }}}))); if (node->decl.params.len == 0) { strings__Builder_write_string(&builder, _SLIT("void)")); } else { for (int i = 0; i < node->decl.params.len; ++i) { v__ast__Param param = ((v__ast__Param*)node->decl.params.data)[i]; string param_styp = v__gen__c__Gen_typ(g, param.typ); - strings__Builder_write_string(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = param_styp}}, {_SLIT(" "), 0xfe10, {.d_s = param.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&builder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = param_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i != node->decl.params.len - 1) { strings__Builder_write_string(&builder, _SLIT(", ")); } @@ -74782,13 +75070,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_anon_fn_type_name(v__gen__c__Gen* g, v VV_LOCAL_SYMBOL void v__gen__c__Gen_call_expr(v__gen__c__Gen* g, v__ast__CallExpr node) { bool v__gen__c__Gen_call_expr_defer_0 = false; - if ((node.left)._typ == 283 /* v.ast.AnonFn */) { + if ((node.left)._typ == 284 /* v.ast.AnonFn */) { v__gen__c__Gen_expr(g, node.left); - } else if ((node.left)._typ == 308 /* v.ast.IndexExpr */ && (node.name).len == 0) { + } else if ((node.left)._typ == 309 /* v.ast.IndexExpr */ && (node.name).len == 0) { g->is_fn_index_call = true; v__gen__c__Gen_expr(g, node.left); g->is_fn_index_call = false; - } else if ((node.left)._typ == 291 /* v.ast.CallExpr */ && (node.name).len == 0) { + } else if ((node.left)._typ == 292 /* v.ast.CallExpr */ && (node.name).len == 0) { v__gen__c__Gen_expr(g, node.left); } if (node.should_be_skipped) { @@ -74811,17 +75099,14 @@ bool v__gen__c__Gen_call_expr_defer_0 = false; string tmp_opt = (gen_or || gen_keep_alive ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); if (gen_or || gen_keep_alive) { v__ast__Type ret_typ = node.return_type; - if (gen_or) { - ret_typ = v__ast__Type_set_flag(ret_typ, v__ast__TypeFlag__optional); - } string styp = v__gen__c__Gen_typ(g, ret_typ); if (gen_or && !is_gen_or_and_assign_rhs) { cur_line = v__gen__c__Gen_go_before_stmt(g, 0); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } if (node.is_method && !node.is_field) { - if (string__eq(node.name, _SLIT("writeln")) && g->pref->experimental && node.args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ == 328 /* v.ast.StringInterLiteral */ && string__eq(v__ast__Table_sym(g->table, node.receiver_type)->name, _SLIT("strings.Builder"))) { + if (string__eq(node.name, _SLIT("writeln")) && g->pref->experimental && node.args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ == 329 /* v.ast.StringInterLiteral */ && string__eq(v__ast__Table_sym(g->table, node.receiver_type)->name, _SLIT("strings.Builder"))) { v__gen__c__Gen_string_inter_literal_sb_optimized(g, node); } else { v__gen__c__Gen_method_call(g, node); @@ -74831,22 +75116,22 @@ bool v__gen__c__Gen_call_expr_defer_0 = false; } if (gen_or) { v__gen__c__Gen_or_block(g, tmp_opt, node.or_block, node.return_type); - v__ast__Type unwrapped_typ = v__ast__Type_clear_flag(node.return_type, v__ast__TypeFlag__optional); + v__ast__Type unwrapped_typ = v__ast__Type_clear_flag(v__ast__Type_clear_flag(node.return_type, v__ast__TypeFlag__optional), v__ast__TypeFlag__result); string unwrapped_styp = v__gen__c__Gen_typ(g, unwrapped_typ); if (v__ast__Type_alias_eq(unwrapped_typ, _const_v__ast__void_type)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { if (!g->inside_const_optional) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT(" (*("), 0xfe10, {.d_s = unwrapped_styp}}, {_SLIT("*)"), 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 = unwrapped_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data)"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } else if (gen_keep_alive) { if (v__ast__Type_alias_eq(node.return_type, _const_v__ast__void_type)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n "), 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } if (node.is_noreturn) { @@ -74871,10 +75156,10 @@ if (v__gen__c__Gen_call_expr_defer_0) { } VV_LOCAL_SYMBOL void v__gen__c__Gen_conversion_function_call(v__gen__c__Gen* g, string prefix, string postfix, v__ast__CallExpr node) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = prefix}}, {_SLIT("( ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = prefix}}, {_SLIT("( ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); string dot = (v__ast__Type_is_ptr(node.left_type) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(")"), 0xfe10, {.d_s = dot}}, {_SLIT("_typ )"), 0xfe10, {.d_s = postfix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(")"), /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ )"), /*115 &string*/0xfe10, {.d_s = postfix}}, {_SLIT0, 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallExpr node) { @@ -74889,7 +75174,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE unwrapped_rec_type = v__gen__c__Gen_unwrap_generic(g, node.receiver_type); } else { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.receiver_type); - if (sym->info._typ == 455 /* v.ast.Struct */) { + if (sym->info._typ == 456 /* v.ast.Struct */) { Array_string _t1 = {0}; Array_v__ast__Type _t1_orig = (*sym->info._v__ast__Struct).generic_types; int _t1_len = _t1_orig.len; @@ -74908,7 +75193,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE unwrapped_rec_type = utyp; } } - else if (sym->info._typ == 473 /* v.ast.Interface */) { + else if (sym->info._typ == 474 /* v.ast.Interface */) { Array_string _t4 = {0}; Array_v__ast__Type _t4_orig = (*sym->info._v__ast__Interface).generic_types; int _t4_len = _t4_orig.len; @@ -74927,7 +75212,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE unwrapped_rec_type = utyp; } } - else if (sym->info._typ == 474 /* v.ast.SumType */) { + else if (sym->info._typ == 475 /* v.ast.SumType */) { Array_string _t7 = {0}; Array_v__ast__Type _t7_orig = (*sym->info._v__ast__SumType).generic_types; int _t7_len = _t7_orig.len; @@ -74953,16 +75238,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(g->table, unwrapped_rec_type); if (typ_sym->kind == v__ast__Kind__alias && !string__eq(node.name, _SLIT("str")) && !v__ast__TypeSymbol_has_method(typ_sym, node.name)) { - unwrapped_rec_type = (/* as */ *(v__ast__Alias*)__as_cast((typ_sym->info)._v__ast__Alias,(typ_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type; + unwrapped_rec_type = (/* as */ *(v__ast__Alias*)__as_cast((typ_sym->info)._v__ast__Alias,(typ_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; typ_sym = v__ast__Table_sym(g->table, unwrapped_rec_type); } string rec_cc_type = v__gen__c__Gen_cc_type(g, unwrapped_rec_type, false); string receiver_type_name = v__util__no_dots(rec_cc_type); - if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ )), node.name)) { + if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ )), node.name)) { bool left_is_shared = v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f); string left_cc_type = v__gen__c__Gen_cc_type(g, node.left_type, false); string left_type_name = v__util__no_dots(left_cc_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(left_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(left_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); if (v__ast__Expr_is_auto_deref_var(node.left) && v__ast__Type_nr_muls(node.left_type) > 1) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_write(g, string_repeat(_SLIT("*"), v__ast__Type_nr_muls(node.left_type) - 1)); @@ -74973,7 +75258,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } string dot = (left_is_shared ? (_SLIT("->val.")) : v__ast__Type_is_ptr(node.left_type) ? (_SLIT("->")) : (_SLIT("."))); string mname = v__gen__c__c_name(node.name); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_"), 0xfe10, {.d_s = mname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_"), /*115 &string*/0xfe10, {.d_s = mname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Expr_is_auto_deref_var(node.left) && v__ast__Type_nr_muls(node.left_type) > 1) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_write(g, string_repeat(_SLIT("*"), v__ast__Type_nr_muls(node.left_type) - 1)); @@ -74982,7 +75267,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } else { v__gen__c__Gen_expr(g, node.left); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); if (node.args.len > 0) { v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_call_args(g, node); @@ -75038,7 +75323,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE }; } if (left_sym->kind == v__ast__Kind__map && string__eq(node.name, _SLIT("delete"))) { - v__ast__Map left_info = /* as */ *(v__ast__Map*)__as_cast((left_sym->info)._v__ast__Map,(left_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map left_info = /* as */ *(v__ast__Map*)__as_cast((left_sym->info)._v__ast__Map,(left_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; string elem_type_str = v__gen__c__Gen_typ(g, left_info.key_type); v__gen__c__Gen_write(g, _SLIT("map_delete(")); if (v__ast__Type_is_ptr(node.left_type)) { @@ -75047,7 +75332,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE v__gen__c__Gen_write(g, _SLIT("&")); v__gen__c__Gen_expr(g, node.left); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr); v__gen__c__Gen_write(g, _SLIT("})")); return; @@ -75067,21 +75352,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE if (left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_) { if (string__eq(node.name, _SLIT("type_name"))) { if (left_sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_sumtype_"), 0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(")"), node); + v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_sumtype_"), /*115 &string*/0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(")"), node); return; } if (left_sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_interface_"), 0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(")"), node); + v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("charptr_vstring_literal( /* "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_interface_"), /*115 &string*/0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(")"), node); return; } } if (string__eq(node.name, _SLIT("type_idx"))) { if (left_sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_sumtype_idx_"), 0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(""), node); + v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_sumtype_idx_"), /*115 &string*/0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(""), node); return; } if (left_sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* "), 0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_interface_idx_"), 0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(""), node); + v__gen__c__Gen_conversion_function_call(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/* "), /*115 &string*/0xfe10, {.d_s = left_sym->name}}, {_SLIT(" */ v_typeof_interface_idx_"), /*115 &string*/0xfe10, {.d_s = typ_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(""), node); return; } } @@ -75091,10 +75376,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE if (v__ast__Type_has_flag(rec_type, v__ast__TypeFlag__shared_f)) { rec_type = v__ast__Type_set_nr_muls(v__ast__Type_clear_flag(rec_type, v__ast__TypeFlag__shared_f), 0); } - if ((node.left)._typ == 297 /* v.ast.ComptimeSelector */) { - if (((*node.left._v__ast__ComptimeSelector).field_expr)._typ == 325 /* v.ast.SelectorExpr */) { - if (((*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 305 /* v.ast.Ident */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); + if ((node.left)._typ == 298 /* v.ast.ComptimeSelector */) { + if (((*node.left._v__ast__ComptimeSelector).field_expr)._typ == 326 /* v.ast.SelectorExpr */) { + if (((*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 306 /* v.ast.Ident */) { + string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); v__ast__Type* _t11 = (v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->comptime_var_type_map), &(string[]){key_str})); Option_v__ast__Type _t10 = {0}; if (_t11) { @@ -75113,7 +75398,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE return; } } - } else if ((node.left)._typ == 296 /* v.ast.ComptimeCall */) { + } else if ((node.left)._typ == 297 /* v.ast.ComptimeCall */) { if (string__eq((*node.left._v__ast__ComptimeCall).method_name, _SLIT("method"))) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, (*node.left._v__ast__ComptimeCall).left_type)); Option_v__ast__Fn _t12; @@ -75124,8 +75409,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE return; } } - } else if ((node.left)._typ == 305 /* v.ast.Ident */) { - if (((*node.left._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + } else if ((node.left)._typ == 306 /* v.ast.Ident */) { + if (((*node.left._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { if (g->comptime_var_type_map.len > 0) { rec_type = (*(*node.left._v__ast__Ident).obj._v__ast__Var).typ; v__gen__c__Gen_gen_expr_to_string(g, node.left, rec_type); @@ -75133,7 +75418,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } else if ((*(*node.left._v__ast__Ident).obj._v__ast__Var).smartcasts.len > 0) { rec_type = v__gen__c__Gen_unwrap_generic(g, (*(v__ast__Type*)array_last((*(*node.left._v__ast__Ident).obj._v__ast__Var).smartcasts))); v__ast__TypeSymbol* cast_sym = v__ast__Table_sym(g->table, rec_type); - if ((cast_sym->info)._typ == 468 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 469 /* v.ast.Aggregate */) { rec_type = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } v__gen__c__Gen_gen_expr_to_string(g, node.left, rec_type); @@ -75154,32 +75439,32 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE receiver_type_name = _SLIT("map"); } if (final_left_sym->kind == v__ast__Kind__array && (string__eq(node.name, _SLIT("repeat")) || string__eq(node.name, _SLIT("sort_with_compare")) || string__eq(node.name, _SLIT("free")) || string__eq(node.name, _SLIT("push_many")) || string__eq(node.name, _SLIT("trim")) || string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("pop")) || string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("reverse")) || string__eq(node.name, _SLIT("slice")) || string__eq(node.name, _SLIT("pointers")))) { - if (!((left_sym->info)._typ == 470 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) { + if (!((left_sym->info)._typ == 471 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) { receiver_type_name = _SLIT("array"); } if (string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("pop"))) { string return_type_str = v__gen__c__Gen_typ(g, node.return_type); has_cast = true; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = return_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = return_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } } - string name = v__util__no_dots( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = receiver_type_name}}, {_SLIT("_"), 0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string name = v__util__no_dots( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = receiver_type_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}}))); int array_depth = -1; string noscan = _SLIT(""); if (left_sym->kind == v__ast__Kind__array) { bool needs_depth = (string__eq(node.name, _SLIT("clone")) || string__eq(node.name, _SLIT("repeat"))); if (needs_depth) { - v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ).elem_type; + v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ).elem_type; array_depth = v__gen__c__Gen_get_array_depth(g, elem_type); } bool maybe_noscan = needs_depth || (string__eq(node.name, _SLIT("pop")) || string__eq(node.name, _SLIT("push")) || string__eq(node.name, _SLIT("push_many")) || string__eq(node.name, _SLIT("reverse")) || string__eq(node.name, _SLIT("grow_cap")) || string__eq(node.name, _SLIT("grow_len"))); if (maybe_noscan) { - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; noscan = v__gen__c__Gen_check_noscan(g, info.elem_type); } } else if (left_sym->kind == v__ast__Kind__chan) { if (string__eq(node.name, _SLIT("close")) || string__eq(node.name, _SLIT("try_pop")) || string__eq(node.name, _SLIT("try_push"))) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__Channel_"), 0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__Channel_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}})); } } else if (final_left_sym->kind == v__ast__Kind__map) { if (string__eq(node.name, _SLIT("keys"))) { @@ -75189,7 +75474,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE if (g->pref->obfuscate && string__eq(g->cur_mod.name, _SLIT("main")) && string_starts_with(name, _SLIT("main__")) && !string__eq(node.name, _SLIT("str"))) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, node.receiver_type); string key = string__plus(string__plus(sym->name, _SLIT(".")), node.name); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf method call: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf method call: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t14 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); Option_string _t13 = {0}; if (_t14) { @@ -75200,7 +75485,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE ; if (_t13.state != 0) { /*or block*/ IError err = _t13.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _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(); ; } @@ -75209,10 +75494,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } bool is_range_slice = false; if (v__ast__Type_is_ptr(node.receiver_type) && !v__ast__Type_is_ptr(node.left_type)) { - if ((node.left)._typ == 308 /* v.ast.IndexExpr */) { + if ((node.left)._typ == 309 /* v.ast.IndexExpr */) { v__ast__Expr idx = (*node.left._v__ast__IndexExpr).index; - if ((idx)._typ == 323 /* v.ast.RangeExpr */) { - name = v__util__no_dots( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = receiver_type_name}}, {_SLIT("_"), 0xfe10, {.d_s = node.name}}, {_SLIT("_static"), 0, { .d_c = 0 }}}))); + if ((idx)._typ == 324 /* v.ast.RangeExpr */) { + name = v__util__no_dots( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = receiver_type_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("_static"), 0, { .d_c = 0 }}}))); is_range_slice = true; } } @@ -75228,15 +75513,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE if (array_depth >= 0) { name = string__plus(name, _SLIT("_to_depth")); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT0, 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } } if (v__ast__Type_is_ptr(node.receiver_type) && (!v__ast__Type_is_ptr(node.left_type) || v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__variadic) || node.from_embed_types.len != 0 || (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) && !string__eq(node.name, _SLIT("str"))))) { if (!is_range_slice) { if (!v__ast__Expr_is_lvalue(node.left)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), 0xfe10, {.d_s = rec_cc_type}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), /*115 &string*/0xfe10, {.d_s = rec_cc_type}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); has_cast = true; } else { v__gen__c__Gen_write(g, _SLIT("&")); @@ -75250,19 +75535,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE int diff = v__ast__Type_nr_muls(node.left_type) - v__ast__Type_nr_muls(node.receiver_type); if (diff < 0) { } else if (diff > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/*diff="), 0xfe07, {.d_i32 = diff}}, {_SLIT("*/"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/*diff="), /*100 &int*/0xfe07, {.d_i32 = diff}}, {_SLIT("*/"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, Array_u8_bytestr(__new_array_with_default(diff, 0, sizeof(u8), &(u8[]){'*'}))); } } if (g->is_autofree && node.free_receiver && !g->inside_lambda && !g->is_builtin_mod) { string fn_name = string_replace(node.name, _SLIT("."), _SLIT("_")); - string arg_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("_0_"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string arg_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_0_"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Gen_write(g, string__plus(_SLIT("/*af receiver arg*/"), arg_name)); } else { if (left_sym->kind == v__ast__Kind__array && v__ast__Expr_is_auto_deref_var(node.left) && (string__eq(node.name, _SLIT("first")) || string__eq(node.name, _SLIT("last")) || string__eq(node.name, _SLIT("repeat")))) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((node.left)._typ == 314 /* v.ast.MapInit */) { + if ((node.left)._typ == 315 /* v.ast.MapInit */) { v__gen__c__Gen_write(g, _SLIT("(map[]){")); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT("}[0]")); @@ -75294,7 +75579,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } v__gen__c__Gen_call_args(g, node); if (array_depth >= 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe07, {.d_i32 = array_depth}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = array_depth}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT(")")); } @@ -75331,8 +75616,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr v__ast__CallExpr node_ = node; for (int i = 0; i < node_.args.len; ++i) { v__ast__CallArg* call_arg = ((v__ast__CallArg*)node_.args.data) + i; - if ((call_arg->expr)._typ == 305 /* v.ast.Ident */) { - if (((*call_arg->expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((call_arg->expr)._typ == 306 /* v.ast.Ident */) { + if (((*call_arg->expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { (*(v__ast__CallArg*)/*ee elem_sym */array_get(node_.args, i)).typ = (*(*call_arg->expr._v__ast__Ident).obj._v__ast__Var).typ; } } @@ -75358,7 +75643,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr string encode_name = v__gen__c__js_enc_name(json_type_str); g->empty_line = true; v__gen__c__Gen_writeln(g, _SLIT("// json.encode")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cJSON* "), 0xfe10, {.d_s = json_obj}}, {_SLIT(" = "), 0xfe10, {.d_s = encode_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cJSON* "), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = encode_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -75366,28 +75651,28 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr v__gen__c__Gen_writeln(g, _SLIT(");")); tmp2 = v__gen__c__Gen_new_tmp_var(g); if (is_json_encode) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = tmp2}}, {_SLIT(" = json__json_print("), 0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = tmp2}}, {_SLIT(" = json__json_print("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = tmp2}}, {_SLIT(" = json__json_print_pretty("), 0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = tmp2}}, {_SLIT(" = json__json_print_pretty("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else { - v__ast__TypeNode ast_type = /* as */ *(v__ast__TypeNode*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._v__ast__TypeNode,((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ, 331) /*expected idx: 331, name: v.ast.TypeNode */ ; + v__ast__TypeNode ast_type = /* as */ *(v__ast__TypeNode*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._v__ast__TypeNode,((*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr)._typ, 332) /*expected idx: 332, name: v.ast.TypeNode */ ; string typ = v__gen__c__c_name(v__gen__c__Gen_typ(g, ast_type.typ)); string fn_name = string__plus(string__plus(v__gen__c__c_name(name), _SLIT("_")), typ); v__gen__c__Gen_gen_json_for_type(g, ast_type.typ); g->empty_line = true; v__gen__c__Gen_writeln(g, _SLIT("// json.decode")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cJSON* "), 0xfe10, {.d_s = json_obj}}, {_SLIT(" = json__json_parse("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cJSON* "), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(" = json__json_parse("), 0, { .d_c = 0 }}}))); g->is_js_call = true; v__gen__c__Gen_call_args(g, node); v__gen__c__Gen_writeln(g, _SLIT(");")); tmp2 = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Option_"), 0xfe10, {.d_s = typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp2}}, {_SLIT(" = "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("Option_"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp2}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } if (!g->is_autofree) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cJSON_Delete("), 0xfe10, {.d_s = json_obj}}, {_SLIT("); // del"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cJSON_Delete("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT("); // del"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT0, 0, { .d_c = 0 }}}))); name = _SLIT(""); json_obj = tmp2; } @@ -75407,7 +75692,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr } 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: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + 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) { @@ -75418,7 +75703,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr ; if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _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(); ; } @@ -75447,29 +75732,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr if (!v__ast__Type_alias_eq(typ, _const_v__ast__string_type) || g->comptime_for_method.len > 0) { v__ast__Expr expr = (*(v__ast__CallArg*)/*ee elem_sym */array_get(node.args, 0)).expr; v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(g->table, typ); - if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ )), _SLIT("str"))) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ )), _SLIT("str"))) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); string rec_type_name = v__util__no_dots(v__gen__c__Gen_cc_type(g, typ, false)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); string dot = (v__ast__Type_is_ptr(typ) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_str("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_str("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("));")); return; } if (g->is_autofree && !v__ast__Type_has_flag(typ, v__ast__TypeFlag__optional)) { string tmp = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_gen_expr_to_string(g, expr, typ); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("; "), 0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0xfe10, {.d_s = tmp}}, {_SLIT("); string_free(&"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("; "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("); string_free(&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); - if ((expr)._typ == 297 /* v.ast.ComptimeSelector */) { - if (((*expr._v__ast__ComptimeSelector).field_expr)._typ == 325 /* v.ast.SelectorExpr */) { - if (((*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 305 /* v.ast.Ident */) { - string key_str = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr._v__ast__Ident).name}}, {_SLIT(".typ"), 0, { .d_c = 0 }}})); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(print_method)}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + if ((expr)._typ == 298 /* v.ast.ComptimeSelector */) { + if (((*expr._v__ast__ComptimeSelector).field_expr)._typ == 326 /* v.ast.SelectorExpr */) { + if (((*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 306 /* 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) { @@ -75486,7 +75771,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr typ = *(v__ast__Type*)_t6.data; } } - } else if ((expr)._typ == 296 /* v.ast.ComptimeCall */) { + } else if ((expr)._typ == 297 /* 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; @@ -75495,13 +75780,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr typ = m.return_type; } } - } else if ((expr)._typ == 305 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + } else if ((expr)._typ == 306 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { typ = (*(*expr._v__ast__Ident).obj._v__ast__Var).typ; if ((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts.len > 0) { typ = v__gen__c__Gen_unwrap_generic(g, (*(v__ast__Type*)array_last((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts))); v__ast__TypeSymbol* cast_sym = v__ast__Table_sym(g->table, typ); - if ((cast_sym->info)._typ == 468 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 469 /* v.ast.Aggregate */) { typ = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } } @@ -75515,12 +75800,12 @@ 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_40533 = v__gen__c__Gen_panic_debug_info(g, node.pos); - int paline = mr_40533.arg0; - string pafile = mr_40533.arg1; - string pamod = mr_40533.arg2; - string pafn = mr_40533.arg3; - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), 0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), 0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), 0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); + multi_return_int_string_string_string mr_41672 = v__gen__c__Gen_panic_debug_info(g, node.pos); + int paline = mr_41672.arg0; + string pafile = mr_41672.arg1; + string pamod = mr_41672.arg2; + string pafn = mr_41672.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 { @@ -75528,7 +75813,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr 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; - if (obj._typ == 363 /* v.ast.Var */) { + if (obj._typ == 364 /* v.ast.Var */) { if ((*obj._v__ast__Var).smartcasts.len > 0) { for (int _t10 = 0; _t10 < (*obj._v__ast__Var).smartcasts.len; ++_t10) { v__gen__c__Gen_write(g, _SLIT("(*")); @@ -75544,11 +75829,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr } } string dot = (is_ptr ? (_SLIT("->")) : (_SLIT("."))); - if ((cast_sym->info)._typ == 468 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 469 /* v.ast.Aggregate */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_"), 0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_"), 0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = cast_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT(")")); } @@ -75579,7 +75864,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr if (i > 0) { v__gen__c__Gen_write(g, _SLIT(", ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__tmp_arg_"), 0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__tmp_arg_"), /*100 &int*/0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } else { v__gen__c__Gen_call_args(g, node); @@ -75616,19 +75901,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_call_pregen(v__gen__c__Gen* g, v__a if (!arg.is_tmp_autofree) { continue; } - if ((arg.expr)._typ == 291 /* v.ast.CallExpr */) { + if ((arg.expr)._typ == 292 /* v.ast.CallExpr */) { v__gen__c__Gen_autofree_call_pregen(g, (*arg.expr._v__ast__CallExpr)); } free_tmp_arg_vars = true; string fn_name = string_replace(node.name, _SLIT("."), _SLIT("_")); - string t = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("_"), 0xfe07, {.d_i32 = i}}, {_SLIT("_"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string t = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); bool used = false; - string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); + string s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); if (used) { Option_v__ast__ScopeObject _t2; if (_t2 = v__ast__Scope_find(scope, t), _t2.state == 0) { v__ast__ScopeObject x = *(v__ast__ScopeObject*)_t2.data; - if (x._typ == 363 /* v.ast.Var */) { + if (x._typ == 364 /* v.ast.Var */) { (*x._v__ast__Var).is_used = false; } @@ -75636,10 +75921,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_call_pregen(v__gen__c__Gen* g, v__a } ; } - s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); + s = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); } else { v__ast__Scope_register(scope, v__ast__Var_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__Var, (((v__ast__Var){.name = t,.share = 0,.is_mut = 0,.is_autofree_tmp = true,.is_arg = 0,.is_auto_deref = 0,.is_inherited = 0,.expr = {0},.typ = _const_v__ast__string_type,.orig_type = 0,.smartcasts = __new_array(0, 0, sizeof(v__ast__Type)),.pos = node.pos,.is_used = 0,.is_changed = 0,.is_or = 0,.is_tmp = 0,.is_auto_heap = 0,.is_stack_obj = 0,}))))); - s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), 0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); + s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("string "), /*115 &string*/0xfe10, {.d_s = t}}, {_SLIT(" = "), 0, { .d_c = 0 }}})); } s = /*f*/string__plus(s, v__gen__c__Gen_expr_string(g, arg.expr)); s = /*f*/string__plus(s, _SLIT(";// new af2 pre")); @@ -75663,7 +75948,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_call_postgen(v__gen__c__Gen* g, int } if (!DenseArray_has_index(&_t1.key_values, _t2)) {continue;} v__ast__ScopeObject* obj = &(*(v__ast__ScopeObject*)DenseArray_value(&_t1.key_values, _t2)); - if (obj->_typ == 363 /* v.ast.Var */) { + if (obj->_typ == 364 /* v.ast.Var */) { bool is_optional = v__ast__Type_has_flag((*obj->_v__ast__Var).typ, v__ast__TypeFlag__optional); if (is_optional) { continue; @@ -75756,7 +76041,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp if (use_tmp_var_autofree) { if (arg.is_tmp_autofree) { string fn_name = string_replace(node.name, _SLIT("."), _SLIT("_")); - string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("_"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT("_"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Gen_write(g, string__plus(_SLIT("/*af arg*/"), name)); } } else { @@ -75765,7 +76050,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } else { if (use_tmp_var_autofree) { string fn_name = string_replace(node.name, _SLIT("."), _SLIT("_")); - string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("_"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT("_"), 0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("_arg_expr_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = node.pos.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); v__gen__c__Gen_write(g, string__plus(_SLIT("/*af arg2*/"), name)); } else { v__gen__c__Gen_expr(g, arg.expr); @@ -75780,7 +76065,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp v__ast__Type varg_type = (*(v__ast__Type*)array_last(expected_types)); int variadic_count = args.len - arg_nr; v__ast__TypeSymbol* arr_sym = v__ast__Table_sym(g->table, varg_type); - v__ast__Array arr_info = /* as */ *(v__ast__Array*)__as_cast((arr_sym->info)._v__ast__Array,(arr_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array arr_info = /* as */ *(v__ast__Array*)__as_cast((arr_sym->info)._v__ast__Array,(arr_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; if (v__ast__Type_has_flag(varg_type, v__ast__TypeFlag__generic)) { Option_v__ast__Fn _t10; if (_t10 = v__ast__Table_find_fn(g->table, node.name), _t10.state == 0) { @@ -75793,19 +76078,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } } else { IError err = _t10.err; - v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to find function "), 0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_error(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unable to find function "), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT0, 0, { .d_c = 0 }}})), node.pos); VUNREACHABLE(); } } string elem_type = v__gen__c__Gen_typ(g, arr_info.elem_type); if ((g->pref->translated || g->file->is_translated) && args.len == 1) { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(args, 0)).expr); - } else if (args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(args, args.len - 1)).expr)._typ == 284 /* v.ast.ArrayDecompose */) { + } else if (args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(args, args.len - 1)).expr)._typ == 285 /* v.ast.ArrayDecompose */) { v__gen__c__Gen_expr(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(args, args.len - 1)).expr); } else { if (variadic_count > 0) { string noscan = v__gen__c__Gen_check_noscan(g, arr_info.elem_type); - v__gen__c__Gen_write(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0xfe07, {.d_i32 = variadic_count}}, {_SLIT(", "), 0xfe07, {.d_i32 = variadic_count}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = elem_type}}, {_SLIT("), _MOV(("), 0xfe10, {.d_s = elem_type}}, {_SLIT("["), 0xfe07, {.d_i32 = variadic_count}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), /*100 &int*/0xfe07, {.d_i32 = variadic_count}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = variadic_count}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = elem_type}}, {_SLIT("), _MOV(("), /*115 &string*/0xfe10, {.d_s = elem_type}}, {_SLIT("["), /*100 &int*/0xfe07, {.d_i32 = variadic_count}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int j = arg_nr; j < args.len; ++j) { v__gen__c__Gen_ref_or_deref_arg(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(args, j)), arr_info.elem_type, node.language); if (j < args.len - 1) { @@ -75814,7 +76099,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } v__gen__c__Gen_write(g, _SLIT("}))")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array(0, 0, sizeof("), 0xfe10, {.d_s = elem_type}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__new_array(0, 0, sizeof("), /*115 &string*/0xfe10, {.d_s = elem_type}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } } } @@ -75838,7 +76123,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no if (expr.is_method) { v__ast__TypeSymbol* receiver_sym = v__ast__Table_sym(g->table, expr.receiver_type); name = string__plus(string__plus(receiver_sym->name, _SLIT("_")), name); - } else if ((expr.left)._typ == 283 /* v.ast.AnonFn */) { + } else if ((expr.left)._typ == 284 /* v.ast.AnonFn */) { v__gen__c__Gen_gen_anon_fn_decl(g, (voidptr)&/*qq*/(*expr.left._v__ast__AnonFn)); name = (*expr.left._v__ast__AnonFn).decl.name; } else if (expr.is_fn_var) { @@ -75851,7 +76136,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, expr.receiver_type); key = string__plus(string__plus(sym->name, _SLIT(".")), expr.name); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf go: "), 0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf go: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t2 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); Option_string _t1 = {0}; if (_t2) { @@ -75862,7 +76147,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no ; if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - _v_panic( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cgen: obf name \""), 0xfe10, {.d_s = key}}, {_SLIT("\" not found, this should never happen"), 0, { .d_c = 0 }}}))); + _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(); ; } @@ -75874,21 +76159,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no string wrapper_struct_name = string__plus(_SLIT("thread_arg_"), name); string wrapper_fn_name = string__plus(name, _SLIT("_thread_wrapper")); string arg_tmp_var = string__plus(_SLIT("arg_"), tmp); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *"), 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(" = malloc(sizeof(thread_arg_"), 0xfe10, {.d_s = name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *"), /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(" = malloc(sizeof(thread_arg_"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); if (expr.is_method) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->arg0 = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->arg0 = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr.left); v__gen__c__Gen_writeln(g, _SLIT(";")); } for (int i = 0; i < expr.args.len; ++i) { v__ast__CallArg arg = ((v__ast__CallArg*)expr.args.data)[i]; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->arg"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->arg"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, arg.expr); v__gen__c__Gen_writeln(g, _SLIT(";")); } string s_ret_typ = v__gen__c__Gen_typ(g, node.call_expr.return_type); if (g->pref->os == v__pref__OS__windows && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->ret_ptr = malloc(sizeof("), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->ret_ptr = malloc(sizeof("), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } bool is_opt = v__ast__Type_has_flag(node.call_expr.return_type, v__ast__TypeFlag__optional); string gohandle_name = _SLIT(""); @@ -75896,39 +76181,39 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no gohandle_name = (is_opt ? (_SLIT("__v_thread_Option_void")) : (_SLIT("__v_thread"))); } else { string opt = (is_opt ? (_SLIT("Option_")) : (_SLIT(""))); - gohandle_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), 0xfe10, {.d_s = opt}}, {_SLIT0, 0xfe10, {.d_s = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.call_expr.return_type))->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); + gohandle_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT("__v_thread_"), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.call_expr.return_type))->cname}}, {_SLIT0, 0, { .d_c = 0 }}})); } if (g->pref->os == v__pref__OS__windows) { - string simple_handle = (node.is_expr && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_handle_"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("HANDLE "), 0xfe10, {.d_s = simple_handle}}, {_SLIT(" = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)"), 0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT(", "), 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(", 0, 0);"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (!"), 0xfe10, {.d_s = simple_handle}}, {_SLIT(") panic_lasterr(tos3(\"`go "), 0xfe10, {.d_s = name}}, {_SLIT("()`: \"));"), 0, { .d_c = 0 }}}))); + string simple_handle = (node.is_expr && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_handle_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("HANDLE "), /*115 &string*/0xfe10, {.d_s = simple_handle}}, {_SLIT(" = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)"), /*115 &string*/0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(", 0, 0);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("if (!"), /*115 &string*/0xfe10, {.d_s = simple_handle}}, {_SLIT(") panic_lasterr(tos3(\"`go "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("()`: \"));"), 0, { .d_c = 0 }}}))); if (node.is_expr && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = gohandle_name}}, {_SLIT(" thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t.ret_ptr = "), 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->ret_ptr,"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t.handle = thread_handle_"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = gohandle_name}}, {_SLIT(" thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t.ret_ptr = "), /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT("->ret_ptr,"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t.handle = thread_handle_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("};")); } if (!node.is_expr) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("CloseHandle(thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("CloseHandle(thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } else { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_t thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_t thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); string sthread_attributes = _SLIT("NULL"); if (g->pref->os != v__pref__OS__vinix) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_attr_t thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT("_attributes;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_attr_init(&thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT("_attributes);"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("pthread_attr_setstacksize(&thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT("_attributes, "), 0xfe07, {.d_i32 = g->pref->thread_stack_size}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - sthread_attributes = str_intp(2, _MOV((StrIntpData[]){{_SLIT("&thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT("_attributes"), 0, { .d_c = 0 }}})); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_attr_t thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_attributes;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_attr_init(&thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_attributes);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("pthread_attr_setstacksize(&thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_attributes, "), /*100 &int*/0xfe07, {.d_i32 = g->pref->thread_stack_size}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + sthread_attributes = str_intp(2, _MOV((StrIntpData[]){{_SLIT("&thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_attributes"), 0, { .d_c = 0 }}})); } - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res = pthread_create(&thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(", "), 0xfe10, {.d_s = sthread_attributes}}, {_SLIT(", (void*)"), 0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT(", "), 0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res) panic_error_number(tos3(\"`go "), 0xfe10, {.d_s = name}}, {_SLIT("()`: \"), "), 0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res = pthread_create(&thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = sthread_attributes}}, {_SLIT(", (void*)"), /*115 &string*/0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = arg_tmp_var}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res) panic_error_number(tos3(\"`go "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("()`: \"), "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_thr_res);"), 0, { .d_c = 0 }}}))); if (!node.is_expr) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_detach(thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("pthread_detach(thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("// end go")); if (node.is_expr) { - handle = str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})); + handle = str_intp(2, _MOV((StrIntpData[]){{_SLIT("thread_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})); string waiter_fn_name = string__plus(gohandle_name, _SLIT("_wait")); bool should_register = false; sync__RwMutex_lock(&g->waiter_fns->mtx); @@ -75940,10 +76225,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } sync__RwMutex_unlock(&g->waiter_fns->mtx);; if (should_register) { - strings__Builder_writeln(&g->gowrappers, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT(" "), 0xfe10, {.d_s = waiter_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = gohandle_name}}, {_SLIT(" thread) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = waiter_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = gohandle_name}}, {_SLIT(" thread) {"), 0, { .d_c = 0 }}}))); string c_ret_ptr_ptr = _SLIT("NULL"); if (!v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { - strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("* ret_ptr;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("* ret_ptr;"), 0, { .d_c = 0 }}}))); c_ret_ptr_ptr = _SLIT("&ret_ptr"); } if (g->pref->os == v__pref__OS__windows) { @@ -75954,7 +76239,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no strings__Builder_writeln(&g->gowrappers, _SLIT("\tret_ptr = thread.ret_ptr;")); } } else { - strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tint stat = pthread_join(thread, (void **)"), 0xfe10, {.d_s = c_ret_ptr_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tint stat = pthread_join(thread, (void **)"), /*115 &string*/0xfe10, {.d_s = c_ret_ptr_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->gowrappers, _SLIT("\tif (stat != 0) { _v_panic(_SLIT(\"unable to join thread\")); }")); if (g->pref->os == v__pref__OS__windows) { @@ -75965,7 +76250,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } } if (!v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { - strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT(" ret = *ret_ptr;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT(" ret = *ret_ptr;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&g->gowrappers, _SLIT("\tfree(ret_ptr);")); strings__Builder_writeln(&g->gowrappers, _SLIT("\treturn ret;")); } @@ -75982,10 +76267,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } sync__RwMutex_unlock(&g->threaded_fns->mtx);; if (should_register) { - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\ntypedef struct "), 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\ntypedef struct "), /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" {"), 0, { .d_c = 0 }}}))); if (expr.is_method) { string styp = v__gen__c__Gen_typ(g, expr.receiver_type); - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" arg0;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" arg0;"), 0, { .d_c = 0 }}}))); } bool need_return_ptr = g->pref->os == v__pref__OS__windows && !v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type); if (expr.args.len == 0 && !need_return_ptr) { @@ -75994,21 +76279,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no for (int i = 0; i < expr.args.len; ++i) { v__ast__CallArg arg = ((v__ast__CallArg*)expr.args.data)[i]; string styp = v__gen__c__Gen_typ(g, arg.typ); - strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" arg"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" arg"), /*100 &int*/0xfe07, {.d_i32 = i + 1}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } if (need_return_ptr) { strings__Builder_writeln(&g->type_definitions, _SLIT("\tvoid* ret_ptr;")); } - strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("} "), /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); string thread_ret_type = (g->pref->os == v__pref__OS__windows ? (_SLIT("u32")) : (_SLIT("void*"))); - strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = thread_ret_type}}, {_SLIT(" "), 0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *arg);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->gowrappers, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = thread_ret_type}}, {_SLIT(" "), 0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *arg) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->type_definitions, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = thread_ret_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *arg);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = thread_ret_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = wrapper_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = wrapper_struct_name}}, {_SLIT(" *arg) {"), 0, { .d_c = 0 }}}))); if (!v__ast__Type_alias_eq(node.call_expr.return_type, _const_v__ast__void_type)) { if (g->pref->os == v__pref__OS__windows) { - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t*(("), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("*)(arg->ret_ptr)) = "), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t*(("), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("*)(arg->ret_ptr)) = "), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("* ret_ptr = malloc(sizeof("), 0xfe10, {.d_s = s_ret_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("* ret_ptr = malloc(sizeof("), /*115 &string*/0xfe10, {.d_s = s_ret_typ}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->gowrappers, _SLIT("\t*ret_ptr = ")); } } else { @@ -76017,25 +76302,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no if (expr.is_method) { v__ast__Type unwrapped_rec_type = v__gen__c__Gen_unwrap_generic(g, expr.receiver_type); v__ast__TypeSymbol* typ_sym = v__ast__Table_sym(g->table, unwrapped_rec_type); - if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ )), expr.name)) { + if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ )), expr.name)) { string rec_cc_type = v__gen__c__Gen_cc_type(g, unwrapped_rec_type, false); string receiver_type_name = v__util__no_dots(rec_cc_type); - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(receiver_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(receiver_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->gowrappers, _SLIT("arg->arg0")); string dot = (v__ast__Type_is_ptr(expr.left_type) ? (_SLIT("->")) : (_SLIT("."))); string mname = v__gen__c__c_name(expr.name); - strings__Builder_write_string(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_"), 0xfe10, {.d_s = mname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_"), /*115 &string*/0xfe10, {.d_s = mname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->gowrappers, _SLIT("arg->arg0")); - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&g->gowrappers, _SLIT("arg->arg0")); } if (expr.args.len > 0) { strings__Builder_write_string(&g->gowrappers, _SLIT(", ")); } } else { - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); } if (expr.args.len > 0) { bool has_cast = false; @@ -76053,7 +76338,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no Array_string rep_group = __new_array_with_default(0, 2 * expr.args.len, sizeof(string), 0); for (int i = 0; i < expr.args.len; ++i) { array_push((array*)&rep_group, _MOV((string[]){ string_clone(v__gen__c__Gen_expr_string(g, (*(v__ast__CallArg*)/*ee elem_sym */array_get(expr.args, i)).expr)) })); - array_push((array*)&rep_group, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("arg->arg"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&rep_group, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("arg->arg"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } call_args_str = string_replace_each(call_args_str, rep_group); strings__Builder_write_string(&g->gowrappers, call_args_str); @@ -76066,7 +76351,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } else if (arg_nr_muls < expected_nr_muls) { strings__Builder_write_string(&g->gowrappers, string_repeat(_SLIT("&"), expected_nr_muls - arg_nr_muls)); } - strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("arg->arg"), 0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_write_string(&g->gowrappers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("arg->arg"), /*100 &int literal*/0xfe07, {.d_i32 = i + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (i != expr.args.len - 1) { strings__Builder_write_string(&g->gowrappers, _SLIT(", ")); } @@ -76098,7 +76383,7 @@ VV_LOCAL_SYMBOL int v__gen__c__Gen_keep_alive_call_pregen(v__gen__c__Gen* g, v__ v__ast__CallArg arg = ((v__ast__CallArg*)node.args.data)[i]; v__ast__Type expected_type = (*(v__ast__Type*)/*ee elem_sym */array_get(node.expected_arg_types, i)); string typ = v__ast__Table_sym(g->table, expected_type)->cname; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = typ}}, {_SLIT(" __tmp_arg_"), 0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT(" __tmp_arg_"), /*100 &int*/0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_ref_or_deref_arg(g, arg, expected_type, node.language); v__gen__c__Gen_writeln(g, _SLIT(";")); } @@ -76112,7 +76397,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_keep_alive_call_postgen(v__gen__c__Gen* g, v for (int i = 0; i < node.expected_arg_types.len; ++i) { v__ast__Type expected_type = ((v__ast__Type*)node.expected_arg_types.data)[i]; if (v__ast__Type_is_ptr(expected_type) || v__ast__Type_is_pointer(expected_type)) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("GC_reachable_here(__tmp_arg_"), 0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("GC_reachable_here(__tmp_arg_"), /*100 &int*/0xfe07, {.d_i32 = tmp_cnt_save + i}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } } @@ -76133,7 +76418,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_ref_or_deref_arg(v__gen__c__Gen* g, v if (arg.is_mut) { v__ast__TypeSymbol* arg_sym = v__ast__Table_sym(g->table, arg_typ); if (exp_sym->kind == v__ast__Kind__array) { - if (((arg.expr)._typ == 305 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((arg.expr)._v__ast__Ident,(arg.expr)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ).kind == v__ast__IdentKind__variable) || (arg.expr)._typ == 325 /* v.ast.SelectorExpr */) { + if (((arg.expr)._typ == 306 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((arg.expr)._v__ast__Ident,(arg.expr)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ).kind == v__ast__IdentKind__variable) || (arg.expr)._typ == 326 /* v.ast.SelectorExpr */) { v__gen__c__Gen_write(g, _SLIT("&/*arr*/")); v__gen__c__Gen_expr(g, arg.expr); } else { @@ -76142,11 +76427,11 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_ref_or_deref_arg(v__gen__c__Gen* g, v v__gen__c__Gen_write(g, _SLIT("}[0]")); } return; - } else if (arg_sym->kind == v__ast__Kind__sum_type && exp_sym->kind == v__ast__Kind__sum_type && ((arg.expr)._typ == 305 /* v.ast.Ident */ || (arg.expr)._typ == 325 /* v.ast.SelectorExpr */)) { + } else if (arg_sym->kind == v__ast__Kind__sum_type && exp_sym->kind == v__ast__Kind__sum_type && ((arg.expr)._typ == 306 /* v.ast.Ident */ || (arg.expr)._typ == 326 /* v.ast.SelectorExpr */)) { v__gen__c__Gen_write(g, _SLIT("&/*sum*/")); v__gen__c__Gen_expr(g, arg.expr); return; - } else if (arg_sym->kind == v__ast__Kind__interface_ && exp_sym->kind == v__ast__Kind__interface_ && ((arg.expr)._typ == 305 /* v.ast.Ident */ || (arg.expr)._typ == 325 /* v.ast.SelectorExpr */)) { + } else if (arg_sym->kind == v__ast__Kind__interface_ && exp_sym->kind == v__ast__Kind__interface_ && ((arg.expr)._typ == 306 /* v.ast.Ident */ || (arg.expr)._typ == 326 /* v.ast.SelectorExpr */)) { v__gen__c__Gen_write(g, _SLIT("&/*iface*/")); v__gen__c__Gen_expr(g, arg.expr); return; @@ -76171,7 +76456,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_ref_or_deref_arg(v__gen__c__Gen* g, v v__gen__c__Gen_write(g, _SLIT("(voidptr)&/*qq*/")); } else { needs_closing = true; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, atype)}}, {_SLIT("/*qq*/, "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, atype)}}, {_SLIT("/*qq*/, "), 0, { .d_c = 0 }}}))); } } } @@ -76183,10 +76468,10 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_ref_or_deref_arg(v__gen__c__Gen* g, v v__gen__c__Gen_expr(g, arg.expr); v__gen__c__Gen_write(g, _SLIT("->val")); return; - } else if ((arg.expr)._typ == 285 /* v.ast.ArrayInit */) { + } else if ((arg.expr)._typ == 286 /* v.ast.ArrayInit */) { if ((*arg.expr._v__ast__ArrayInit).is_fixed) { if (!(*arg.expr._v__ast__ArrayInit).has_it) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*arg.expr._v__ast__ArrayInit).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*arg.expr._v__ast__ArrayInit).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } } } @@ -76283,7 +76568,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_write_fn_attrs(v__gen__c__Gen* g, Array_v_ } VV_LOCAL_SYMBOL string v__gen__c__call_convention_attribute(string cconvention, bool is_cc_msvc) { - string _t1 = (is_cc_msvc ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = cconvention}}, {_SLIT(" "), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), 0xfe10, {.d_s = cconvention}}, {_SLIT(")) "), 0, { .d_c = 0 }}})))); + string _t1 = (is_cc_msvc ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = cconvention}}, {_SLIT(" "), 0, { .d_c = 0 }}}))) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("__attribute__(("), /*115 &string*/0xfe10, {.d_s = cconvention}}, {_SLIT(")) "), 0, { .d_c = 0 }}})))); return _t1; } @@ -76293,7 +76578,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_c_stmt(v__gen__c__Gen* g, v__ast__ForCSt g->is_vlines_enabled = false; g->inside_for_c_stmt = true; if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("{")); g->indent++; @@ -76321,19 +76606,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_c_stmt(v__gen__c__Gen* g, v__ast__ForCSt g->inside_for_c_stmt = false; v__gen__c__Gen_stmts(g, node.stmts); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("}")); g->indent--; v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); } } else { g->is_vlines_enabled = false; g->inside_for_c_stmt = true; if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("for (")); if (!node.has_init) { @@ -76358,11 +76643,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_c_stmt(v__gen__c__Gen* g, v__ast__ForCSt g->inside_for_c_stmt = false; v__gen__c__Gen_stmts(g, node.stmts); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); } } g->loop_depth--; @@ -76372,7 +76657,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_stmt(v__gen__c__Gen* g, v__ast__ForStmt g->loop_depth++; g->is_vlines_enabled = false; if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("for (;;) {")); if (!node.is_inf) { @@ -76386,11 +76671,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_stmt(v__gen__c__Gen* g, v__ast__ForStmt g->is_vlines_enabled = true; v__gen__c__Gen_stmts(g, node.stmts); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); } g->loop_depth--; } @@ -76398,26 +76683,26 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_stmt(v__gen__c__Gen* g, v__ast__ForStmt VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForInStmt node) { g->loop_depth++; if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.label}}, {_SLIT(": {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT(": {}"), 0, { .d_c = 0 }}}))); } if (node.is_range) { string i = (string__eq(node.val_var, _SLIT("_")) ? (v__gen__c__Gen_new_tmp_var(g)) : (v__gen__c__c_name(node.val_var))); v__ast__Type val_typ = v__ast__mktyp(node.val_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for ("), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, val_typ)}}, {_SLIT(" "), 0xfe10, {.d_s = i}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for ("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, val_typ)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.high); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); } else if (node.kind == v__ast__Kind__array) { string styp = v__gen__c__Gen_typ(g, node.val_type); v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, node.val_type); string cond_var = _SLIT(""); - if ((node.cond)._typ == 305 /* v.ast.Ident */ || (node.cond)._typ == 325 /* v.ast.SelectorExpr */) { + if ((node.cond)._typ == 306 /* v.ast.Ident */ || (node.cond)._typ == 326 /* v.ast.SelectorExpr */) { cond_var = v__gen__c__Gen_expr_string(g, node.cond); } else { cond_var = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_write(g, v__gen__c__Gen_typ(g, node.cond_type)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); } @@ -76426,38 +76711,38 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn string share_accessor = (v__ast__Type_share(node.cond_type) == v__ast__ShareType__shared_t ? (_SLIT("val.")) : (_SLIT(""))); string op_field = string__plus(field_accessor, share_accessor); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); if (!string__eq(node.val_var, _SLIT("_"))) { if (val_sym->kind == v__ast__Kind__function) { v__gen__c__Gen_write(g, _SLIT("\t")); - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = ((voidptr*)"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("data)["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = ((voidptr*)"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } else if (val_sym->kind == v__ast__Kind__array_fixed && !node.val_is_mut) { - string right = str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("data)["), 0xfe10, {.d_s = i}}, {_SLIT("]"), 0, { .d_c = 0 }}})); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(*("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)"), 0xfe10, {.d_s = right}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + string right = str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("]"), 0, { .d_c = 0 }}})); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(*("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)"), /*115 &string*/0xfe10, {.d_s = right}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { - string right = (node.val_is_mut ? ( str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = styp}}, {_SLIT(")"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("data) + "), 0xfe10, {.d_s = i}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = op_field}}, {_SLIT("data)["), 0xfe10, {.d_s = i}}, {_SLIT("]"), 0, { .d_c = 0 }}})))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = "), 0xfe10, {.d_s = right}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + string right = (node.val_is_mut ? ( str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("data) + "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ( str_intp(5, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = op_field}}, {_SLIT("data)["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("]"), 0, { .d_c = 0 }}})))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = right}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } else if (node.kind == v__ast__Kind__array_fixed) { string cond_var = _SLIT(""); bool cond_type_is_ptr = v__ast__Type_is_ptr(node.cond_type); - bool cond_is_literal = (node.cond)._typ == 285 /* v.ast.ArrayInit */; + bool cond_is_literal = (node.cond)._typ == 286 /* v.ast.ArrayInit */; if (cond_is_literal) { cond_var = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_write(g, v__gen__c__Gen_typ(g, node.cond_type)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); } else if (cond_type_is_ptr) { cond_var = v__gen__c__Gen_new_tmp_var(g); string cond_var_type = string_trim(v__gen__c__Gen_typ(g, node.cond_type), _SLIT("*")); if (!v__ast__Expr_is_lvalue(node.cond)) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var_type}}, {_SLIT(" *"), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = (("), 0xfe10, {.d_s = cond_var_type}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var_type}}, {_SLIT(" *"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = (("), /*115 &string*/0xfe10, {.d_s = cond_var_type}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var_type}}, {_SLIT(" *"), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var_type}}, {_SLIT(" *"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(");")); @@ -76466,43 +76751,43 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } string idx = ((string__eq(node.key_var, _SLIT("")) || string__eq(node.key_var, _SLIT("_"))) ? (v__gen__c__Gen_new_tmp_var(g)) : (node.key_var)); v__ast__TypeSymbol* cond_sym = v__ast__Table_sym(g->table, node.cond_type); - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((cond_sym->info)._v__ast__ArrayFixed,(cond_sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = idx}}, {_SLIT(" != "), 0xfe07, {.d_i32 = info.size}}, {_SLIT("; ++"), 0xfe10, {.d_s = idx}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((cond_sym->info)._v__ast__ArrayFixed,(cond_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" != "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT("; ++"), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); if (!string__eq(node.val_var, _SLIT("_"))) { v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, node.val_type); bool is_fixed_array = val_sym->kind == v__ast__Kind__array_fixed && !node.val_is_mut; if (val_sym->kind == v__ast__Kind__function) { v__gen__c__Gen_write(g, _SLIT("\t")); - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); } else if (is_fixed_array) { string styp = v__gen__c__Gen_typ(g, node.val_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(*("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)"), 0xfe10, {.d_s = cond_var}}, {_SLIT("["), 0xfe10, {.d_s = idx}}, {_SLIT("], sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\tmemcpy(*("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("], sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { string styp = v__gen__c__Gen_typ(g, node.val_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (!is_fixed_array) { string addr = (node.val_is_mut ? (_SLIT("&")) : (_SLIT(""))); if (cond_type_is_ptr) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = addr}}, {_SLIT("(*"), 0xfe10, {.d_s = cond_var}}, {_SLIT(")["), 0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT("(*"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(")["), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } else if (cond_is_literal) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = addr}}, {_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT("["), 0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT("["), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), 0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), 0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } } } else if (node.kind == v__ast__Kind__map) { string cond_var = _SLIT(""); - if ((node.cond)._typ == 305 /* v.ast.Ident */) { + if ((node.cond)._typ == 306 /* v.ast.Ident */) { cond_var = v__gen__c__Gen_expr_string(g, node.cond); } else { cond_var = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_write(g, v__gen__c__Gen_typ(g, node.cond_type)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); } @@ -76513,61 +76798,61 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn string idx = v__gen__c__Gen_new_tmp_var(g); string map_len = v__gen__c__Gen_new_tmp_var(g); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = map_len}}, {_SLIT(" = "), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = idx}}, {_SLIT(" < "), 0xfe10, {.d_s = map_len}}, {_SLIT("; ++"), 0xfe10, {.d_s = idx}}, {_SLIT(" ) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = map_len}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = map_len}}, {_SLIT("; ++"), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" ) {"), 0, { .d_c = 0 }}}))); g->indent++; string diff = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = diff}}, {_SLIT(" = "), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len - "), 0xfe10, {.d_s = map_len}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = map_len}}, {_SLIT(" = "), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len;"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = diff}}, {_SLIT(" < 0) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = idx}}, {_SLIT(" = -1;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = diff}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len - "), /*115 &string*/0xfe10, {.d_s = map_len}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = map_len}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values.len;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = diff}}, {_SLIT(" < 0) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = -1;"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\tcontinue;")); v__gen__c__Gen_writeln(g, _SLIT("}")); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if (!DenseArray_has_index(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT(")) {continue;}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if (!DenseArray_has_index(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(")) {continue;}"), 0, { .d_c = 0 }}}))); if (!string__eq(node.key_var, _SLIT("_"))) { string key_styp = v__gen__c__Gen_typ(g, node.key_type); string key = v__gen__c__c_name(node.key_var); - v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = key_styp}}, {_SLIT(" "), 0xfe10, {.d_s = key}}, {_SLIT(" = /*key*/ *("), 0xfe10, {.d_s = key_styp}}, {_SLIT("*)DenseArray_key(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = key_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" = /*key*/ *("), /*115 &string*/0xfe10, {.d_s = key_styp}}, {_SLIT("*)DenseArray_key(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); if (v__ast__Type_alias_eq(node.key_type, _const_v__ast__string_type)) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = key}}, {_SLIT(" = string_clone("), 0xfe10, {.d_s = key}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" = string_clone("), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } if (!string__eq(node.val_var, _SLIT("_"))) { v__ast__TypeSymbol* val_sym = v__ast__Table_sym(g->table, node.val_type); if (val_sym->kind == v__ast__Kind__function) { - v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 482) /*expected idx: 482, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); + v__gen__c__Gen_write_fn_ptr_decl(g, ADDR(v__ast__FnType/*qq*/, /* as */ *(v__ast__FnType*)__as_cast((val_sym->info)._v__ast__FnType,(val_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ), v__gen__c__c_name(node.val_var)); v__gen__c__Gen_write(g, _SLIT(" = (*(voidptr*)")); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("DenseArray_value(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("DenseArray_value(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else if (val_sym->kind == v__ast__Kind__array_fixed && !node.val_is_mut) { string val_styp = v__gen__c__Gen_typ(g, node.val_type); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("memcpy(*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)DenseArray_value(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = val_styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("memcpy(*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(", (byte*)DenseArray_value(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else { string val_styp = v__gen__c__Gen_typ(g, node.val_type); if (v__ast__Type_is_ptr(node.val_type)) { if (node.val_is_mut) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = &(*("), 0xfe10, {.d_s = val_styp}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = &(*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = (*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = (*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } } else { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = (*("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = (*("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("DenseArray_value(&"), 0xfe10, {.d_s = cond_var}}, {_SLIT0, 0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), 0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("DenseArray_value(&"), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = arw_or_pt}}, {_SLIT("key_values, "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } } g->indent--; } else if (node.kind == v__ast__Kind__string) { - v__ast__Expr cond = ((node.cond)._typ == 329 /* v.ast.StringLiteral */ || (node.cond)._typ == 328 /* v.ast.StringInterLiteral */ ? (v__ast__CTempVar_to_sumtype_v__ast__Expr(ADDR(v__ast__CTempVar, (v__gen__c__Gen_new_ctemp_var_then_gen(g, node.cond, _const_v__ast__string_type))))) : (node.cond)); + v__ast__Expr cond = ((node.cond)._typ == 330 /* v.ast.StringLiteral */ || (node.cond)._typ == 329 /* v.ast.StringInterLiteral */ ? (v__ast__CTempVar_to_sumtype_v__ast__Expr(ADDR(v__ast__CTempVar, (v__gen__c__Gen_new_ctemp_var_then_gen(g, node.cond, _const_v__ast__string_type))))) : (node.cond)); string field_accessor = (v__ast__Type_is_ptr(node.cond_type) ? (_SLIT("->")) : (_SLIT("."))); string i = ((string__eq(node.key_var, _SLIT("")) || string__eq(node.key_var, _SLIT("_"))) ? (v__gen__c__Gen_new_tmp_var(g)) : (node.key_var)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, cond); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = field_accessor}}, {_SLIT("len; ++"), 0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = field_accessor}}, {_SLIT("len; ++"), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); if (!string__eq(node.val_var, _SLIT("_"))) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tu8 "), 0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tu8 "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(node.val_var)}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, cond); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = field_accessor}}, {_SLIT("str["), 0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = field_accessor}}, {_SLIT("str["), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT("];"), 0, { .d_c = 0 }}}))); } } else if (node.kind == v__ast__Kind__struct_) { v__ast__TypeSymbol* cond_type_sym = v__ast__Table_sym(g->table, node.cond_type); @@ -76582,51 +76867,51 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn v__ast__Fn next_fn = (*(v__ast__Fn*)_t1.data); v__ast__Type ret_typ = next_fn.return_type; string t_expr = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.cond_type)}}, {_SLIT(" "), 0xfe10, {.d_s = t_expr}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.cond_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = t_expr}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); if (string__eq(node.key_var, _SLIT("")) || string__eq(node.key_var, _SLIT("_"))) { v__gen__c__Gen_writeln(g, _SLIT("while (1) {")); } else { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for (size_t "), 0xfe10, {.d_s = node.key_var}}, {_SLIT(" = 0;; ++"), 0xfe10, {.d_s = node.key_var}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for (size_t "), /*115 &string*/0xfe10, {.d_s = node.key_var}}, {_SLIT(" = 0;; ++"), /*115 &string*/0xfe10, {.d_s = node.key_var}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); } string t_var = v__gen__c__Gen_new_tmp_var(g); v__ast__Type receiver_typ = (*(v__ast__Param*)/*ee elem_sym */array_get(next_fn.params, 0)).typ; string receiver_styp = v__gen__c__Gen_typ(g, receiver_typ); string fn_name = string__plus(string_replace_each(receiver_styp, new_array_from_c_array(4, 4, sizeof(string), _MOV((string[4]){_SLIT("*"), _SLIT(""), _SLIT("."), _SLIT("__")}))), _SLIT("_next")); v__ast__TypeSymbol* receiver_sym = v__ast__Table_sym(g->table, receiver_typ); - if ((receiver_sym->info)._typ == 455 /* v.ast.Struct */) { + if ((receiver_sym->info)._typ == 456 /* v.ast.Struct */) { if ((*receiver_sym->info._v__ast__Struct).concrete_types.len > 0) { fn_name = v__gen__c__Gen_generic_fn_name(g, (*receiver_sym->info._v__ast__Struct).concrete_types, fn_name, false); } } - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = v__gen__c__Gen_typ(g, ret_typ)}}, {_SLIT(" "), 0xfe10, {.d_s = t_var}}, {_SLIT(" = "), 0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, ret_typ)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = t_var}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (!v__ast__Type_is_ptr(node.cond_type) && v__ast__Type_is_ptr(receiver_typ)) { v__gen__c__Gen_write(g, _SLIT("&")); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = t_expr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = t_var}}, {_SLIT(".state != 0) break;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = t_expr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = t_var}}, {_SLIT(".state != 0) break;"), 0, { .d_c = 0 }}}))); string val = ((string__eq(node.val_var, _SLIT("")) || string__eq(node.val_var, _SLIT("_"))) ? (v__gen__c__Gen_new_tmp_var(g)) : (node.val_var)); string val_styp = v__gen__c__Gen_typ(g, node.val_type); if (node.val_is_mut) { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = val}}, {_SLIT(" = ("), 0xfe10, {.d_s = val_styp}}, {_SLIT(")"), 0xfe10, {.d_s = t_var}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = t_var}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = val_styp}}, {_SLIT(" "), 0xfe10, {.d_s = val}}, {_SLIT(" = *("), 0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), 0xfe10, {.d_s = t_var}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = val_styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = t_var}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } } else { string typ_str = v__ast__Table_type_to_str(g->table, node.cond_type); - v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for in: unhandled symbol `"), 0xfe10, {.d_s = v__ast__Expr_str(node.cond)}}, {_SLIT("` of type `"), 0xfe10, {.d_s = typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); + v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("for in: unhandled symbol `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node.cond)}}, {_SLIT("` of type `"), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node.pos); VUNREACHABLE(); } v__gen__c__Gen_stmts(g, node.stmts); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__continue: {}"), 0, { .d_c = 0 }}}))); } if (node.kind == v__ast__Kind__map) { } v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.label.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = node.label}}, {_SLIT("__break: {}"), 0, { .d_c = 0 }}}))); } g->loop_depth--; } @@ -76639,22 +76924,22 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_need_tmp_var_in_if(v__gen__c__Gen* g, v__ast } for (int _t2 = 0; _t2 < node.branches.len; ++_t2) { v__ast__IfBranch branch = ((v__ast__IfBranch*)node.branches.data)[_t2]; - if ((branch.cond)._typ == 307 /* v.ast.IfGuardExpr */ || branch.stmts.len > 1) { + if ((branch.cond)._typ == 308 /* v.ast.IfGuardExpr */ || branch.stmts.len > 1) { bool _t3 = true; return _t3; } if (branch.stmts.len == 1) { - if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 345 /* v.ast.ExprStmt */) { - v__ast__ExprStmt stmt = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._v__ast__ExprStmt,((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ, 345) /*expected idx: 345, name: v.ast.ExprStmt */ ; + if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 346 /* v.ast.ExprStmt */) { + v__ast__ExprStmt stmt = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._v__ast__ExprStmt,((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ; if (v__gen__c__is_noreturn_callexpr(stmt.expr)) { bool _t4 = true; return _t4; } - if ((stmt.expr)._typ == 315 /* v.ast.MatchExpr */) { + if ((stmt.expr)._typ == 316 /* v.ast.MatchExpr */) { bool _t5 = true; return _t5; } - if ((stmt.expr)._typ == 291 /* v.ast.CallExpr */) { + if ((stmt.expr)._typ == 292 /* v.ast.CallExpr */) { if ((*stmt.expr._v__ast__CallExpr).is_method) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, (*stmt.expr._v__ast__CallExpr).receiver_type); if (left_sym->kind == v__ast__Kind__array || left_sym->kind == v__ast__Kind__array_fixed || left_sym->kind == v__ast__Kind__map) { @@ -76689,9 +76974,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no string styp = v__gen__c__Gen_typ(g, node.typ); cur_line = v__gen__c__Gen_go_before_stmt(g, 0); g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("; /* if prepend */"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("; /* if prepend */"), 0, { .d_c = 0 }}}))); if (g->infix_left_var_name.len > 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; } } else if (node.is_expr || g->inside_ternary != 0) { @@ -76726,16 +77011,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no for (int i = 0; i < node.branches.len; ++i) { v__ast__IfBranch branch = ((v__ast__IfBranch*)node.branches.data)[i]; v__ast__Expr cond = branch.cond; - if ((cond)._typ == 307 /* v.ast.IfGuardExpr */) { + if ((cond)._typ == 308 /* v.ast.IfGuardExpr */) { if (!is_guard) { is_guard = true; guard_idx = i; guard_vars = __new_array_with_default(node.branches.len, 0, sizeof(string), &(string[]){_SLIT("")}); } - if (((*cond._v__ast__IfGuardExpr).expr)._typ != 308 /* v.ast.IndexExpr */ && ((*cond._v__ast__IfGuardExpr).expr)._typ != 322 /* v.ast.PrefixExpr */) { + if (((*cond._v__ast__IfGuardExpr).expr)._typ != 309 /* v.ast.IndexExpr */ && ((*cond._v__ast__IfGuardExpr).expr)._typ != 323 /* v.ast.PrefixExpr */) { string var_name = v__gen__c__Gen_new_tmp_var(g); array_set(&guard_vars, i, &(string[]) { var_name }); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*cond._v__ast__IfGuardExpr).expr_type)}}, {_SLIT(" "), 0xfe10, {.d_s = var_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*cond._v__ast__IfGuardExpr).expr_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } else { array_set(&guard_vars, i, &(string[]) { _SLIT("") }); } @@ -76750,9 +77035,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no v__gen__c__Gen_writeln(g, _SLIT("{")); if (is_guard && guard_idx == i - 1) { string cvar_name = (*(string*)/*ee elem_sym */array_get(guard_vars, guard_idx)); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError err = "), 0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tIError err = "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); } - } else if ((branch.cond)._typ == 307 /* v.ast.IfGuardExpr */) { + } else if ((branch.cond)._typ == 308 /* v.ast.IfGuardExpr */) { string var_name = (*(string*)/*ee elem_sym */array_get(guard_vars, i)); bool short_opt = false; if ((var_name).len == 0) { @@ -76760,17 +77045,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no var_name = v__gen__c__Gen_new_tmp_var(g); array_set(&guard_vars, i, &(string[]) { var_name }); g->tmp_count--; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = var_name}}, {_SLIT(".state == 0) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".state == 0) {"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*branch.cond._v__ast__IfGuardExpr).expr); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe10, {.d_s = var_name}}, {_SLIT(".state == 0) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".state == 0) {"), 0, { .d_c = 0 }}}))); } if (short_opt || !string__eq((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name, _SLIT("_"))) { string base_type = v__gen__c__Gen_base_type(g, (*branch.cond._v__ast__IfGuardExpr).expr_type); if (short_opt) { - string cond_var_name = (string__eq((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name, _SLIT("_")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_dummy_"), 0xfe07, {.d_i32 = g->tmp_count + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = base_type}}, {_SLIT(" "), 0xfe10, {.d_s = cond_var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + string cond_var_name = (string__eq((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name, _SLIT("_")) ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("_dummy_"), /*100 &int*/0xfe07, {.d_i32 = g->tmp_count + 1}}, {_SLIT0, 0, { .d_c = 0 }}}))) : ((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name)); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*branch.cond._v__ast__IfGuardExpr).expr); v__gen__c__Gen_writeln(g, _SLIT(";")); } else { @@ -76786,9 +77071,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no if ((*branch.cond._v__ast__IfGuardExpr).vars.len == 1) { string left_var_name = v__gen__c__c_name((*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name); if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = base_type}}, {_SLIT("* "), 0xfe10, {.d_s = left_var_name}}, {_SLIT(" = HEAP("), 0xfe10, {.d_s = base_type}}, {_SLIT(", *("), 0xfe10, {.d_s = base_type}}, {_SLIT("*)"), 0xfe10, {.d_s = var_name}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = left_var_name}}, {_SLIT(" = HEAP("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT(", *("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = base_type}}, {_SLIT(" "), 0xfe10, {.d_s = left_var_name}}, {_SLIT(" = *("), 0xfe10, {.d_s = base_type}}, {_SLIT("*)"), 0xfe10, {.d_s = var_name}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = left_var_name}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } } else if ((*branch.cond._v__ast__IfGuardExpr).vars.len > 1) { for (int vi = 0; vi < (*branch.cond._v__ast__IfGuardExpr).vars.len; ++vi) { @@ -76796,13 +77081,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no string left_var_name = v__gen__c__c_name(var.name); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*branch.cond._v__ast__IfGuardExpr).expr_type); if (sym->kind == v__ast__Kind__multi_return) { - v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 481) /*expected idx: 481, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; if (mr_info.types.len == (*branch.cond._v__ast__IfGuardExpr).vars.len) { string var_typ = v__gen__c__Gen_typ(g, (*(v__ast__Type*)/*ee elem_sym */array_get(mr_info.types, vi))); if (is_auto_heap) { - v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = var_typ}}, {_SLIT("* "), 0xfe10, {.d_s = left_var_name}}, {_SLIT(" = (HEAP("), 0xfe10, {.d_s = base_type}}, {_SLIT(", *("), 0xfe10, {.d_s = base_type}}, {_SLIT("*)"), 0xfe10, {.d_s = var_name}}, {_SLIT(".data).arg"), 0xfe07, {.d_i32 = vi}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = var_typ}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = left_var_name}}, {_SLIT(" = (HEAP("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT(", *("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".data).arg"), /*100 &int*/0xfe07, {.d_i32 = vi}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = var_typ}}, {_SLIT(" "), 0xfe10, {.d_s = left_var_name}}, {_SLIT(" = (*("), 0xfe10, {.d_s = base_type}}, {_SLIT("*)"), 0xfe10, {.d_s = var_name}}, {_SLIT(".data).arg"), 0xfe07, {.d_i32 = vi}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = var_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = left_var_name}}, {_SLIT(" = (*("), /*115 &string*/0xfe10, {.d_s = base_type}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT(".data).arg"), /*100 &int*/0xfe07, {.d_i32 = vi}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } } @@ -76812,8 +77097,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no } } else { bool no_needs_par = false; - if ((branch.cond)._typ == 309 /* v.ast.InfixExpr */) { - if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_in && ((*branch.cond._v__ast__InfixExpr).left)._typ != 309 /* v.ast.InfixExpr */ && ((*branch.cond._v__ast__InfixExpr).right)._typ == 285 /* v.ast.ArrayInit */) { + if ((branch.cond)._typ == 310 /* v.ast.InfixExpr */) { + if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_in && ((*branch.cond._v__ast__InfixExpr).left)._typ != 310 /* v.ast.InfixExpr */ && ((*branch.cond._v__ast__InfixExpr).right)._typ == 286 /* v.ast.ArrayInit */) { no_needs_par = true; } } @@ -76852,7 +77137,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no v__gen__c__Gen_writeln(g, _SLIT("}")); } g->empty_line = false; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (v__ast__Type_has_flag(node.typ, v__ast__TypeFlag__optional)) { g->inside_if_optional = false; @@ -76860,7 +77145,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no } VV_LOCAL_SYMBOL void v__gen__c__Gen_index_expr(v__gen__c__Gen* g, v__ast__IndexExpr node) { - if ((node.index)._typ == 323 /* v.ast.RangeExpr */) { + if ((node.index)._typ == 324 /* v.ast.RangeExpr */) { v__gen__c__Gen_range_expr(g, node, (*node.index._v__ast__RangeExpr)); } else { v__ast__TypeSymbol* sym = v__ast__Table_final_sym(g->table, node.left_type); @@ -76884,7 +77169,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_expr(v__gen__c__Gen* g, v__ast__IndexE string cur_line = v__gen__c__Gen_go_before_stmt(g, 0); strings__Builder_write_string(&g->out, v__util__tabs(g->indent)); string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(_const_v__ast__byte_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = string_at_with_check("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = string_at_with_check("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); v__gen__c__Gen_expr(g, node.index); @@ -76892,7 +77177,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_expr(v__gen__c__Gen* g, v__ast__IndexE if (!node.is_option) { v__gen__c__Gen_or_block(g, tmp_opt, node.or_expr, _const_v__ast__byte_type); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*(byte*)&"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT("*(byte*)&"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("string_at(")); v__gen__c__Gen_expr(g, node.left); @@ -76925,7 +77210,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE cur_line = v__gen__c__Gen_go_before_stmt(g, 0); strings__Builder_write_string(&g->out, v__util__tabs(g->indent)); string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(_const_v__ast__string_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = string_substr_with_check("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = string_substr_with_check("), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("string_substr(")); } @@ -76938,8 +77223,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE if (!range.has_high) { tmp_left = v__gen__c__Gen_new_tmp_var(g); string tmp_type = v__gen__c__Gen_typ(g, node.left_type); - v__gen__c__Gen_insert_before_stmt(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__util__tabs(g->indent)}}, {_SLIT0, 0xfe10, {.d_s = tmp_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_left}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = tmp_left}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_insert_before_stmt(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__util__tabs(g->indent)}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_left}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = tmp_left}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); } @@ -76957,16 +77242,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE v__gen__c__Gen_write(g, tmp_left); } } else if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; string noscan = v__gen__c__Gen_check_noscan(g, info.elem_type); if (node.is_gated) { v__gen__c__Gen_write(g, _SLIT("array_slice_ni(")); } else { v__gen__c__Gen_write(g, _SLIT("array_slice(")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("new_array_from_c_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); string ctype = v__gen__c__Gen_typ(g, info.elem_type); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = info.size}}, {_SLIT(", "), 0xfe07, {.d_i32 = info.size}}, {_SLIT(", sizeof("), 0xfe10, {.d_s = ctype}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = ctype}}, {_SLIT("), "), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(node.left_type)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -76985,13 +77270,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE if (range.has_high) { v__gen__c__Gen_expr(g, range.high); } else if (sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = info.size}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__array) { if (v__ast__Type_is_ptr(node.left_type)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_left}}, {_SLIT("->"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_left}}, {_SLIT("->"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_left}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_left}}, {_SLIT("."), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("len)")); } else { @@ -77004,28 +77289,28 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE if (!node.is_option) { v__gen__c__Gen_or_block(g, tmp_opt, node.or_expr, _const_v__ast__string_type); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*(string*)&"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT("*(string*)&"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data"), 0, { .d_c = 0 }}}))); } } VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__IndexExpr node, v__ast__TypeSymbol sym) { bool gen_or = node.or_expr.kind != v__ast__OrKind__absent || node.is_option; bool left_is_ptr = v__ast__Type_is_ptr(node.left_type); - v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string elem_type_str = v__gen__c__Gen_typ(g, info.elem_type); v__ast__Type elem_type = info.elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type); if (elem_sym->kind == v__ast__Kind__function) { elem_type_str = _SLIT("voidptr"); } - bool is_selector = (node.left)._typ == 325 /* v.ast.SelectorExpr */; + bool is_selector = (node.left)._typ == 326 /* v.ast.SelectorExpr */; if (g->is_assign_lhs && !is_selector && node.is_setter) { bool is_direct_array_access = (g->fn_decl != 0 && g->fn_decl->is_direct_arr) || node.is_direct; bool is_op_assign = g->assign_op != v__token__Kind__assign && !v__ast__Type_alias_eq(info.elem_type, _const_v__ast__string_type); if (is_direct_array_access) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } else if (is_op_assign) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)array_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)array_get("), 0, { .d_c = 0 }}}))); if (left_is_ptr && !v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -77059,7 +77344,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In if (!is_op_assign) { bool need_wrapper = true; if (need_wrapper) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT(", &")); } @@ -77083,24 +77368,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In string tmp_opt = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); string tmp_opt_ptr = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); if (gen_or) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT("* "), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(" = ("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_ptr_typ */(array_get_with_check("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_ptr_typ */(array_get_with_check("), 0, { .d_c = 0 }}}))); } else { if (needs_clone) { v__gen__c__Gen_write(g, _SLIT("/*2*/string_clone(")); } if (g->is_fn_index_call) { - if ((elem_sym->info)._typ == 482 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 483 /* v.ast.FnType */) { v__gen__c__Gen_write(g, _SLIT("((")); v__gen__c__Gen_write_fn_ptr_decl(g, &(*elem_sym->info._v__ast__FnType), _SLIT("")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(")(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); } if (left_is_ptr && !v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("*")); } } else if (is_direct_array_access) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); if (left_is_ptr && !v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -77138,25 +77423,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In if (gen_or) { v__gen__c__Gen_writeln(g, _SLIT(";")); string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(elem_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)&"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data) = *(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)&"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data) = *(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("} else {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".state = 2; "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".err = _v_error(_SLIT(\"array index out of range\"));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".state = 2; "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".err = _v_error(_SLIT(\"array index out of range\"));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); 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"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 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 }}}))); } } } VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_fixed_array(v__gen__c__Gen* g, v__ast__IndexExpr node, v__ast__TypeSymbol sym) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym.info)._v__ast__ArrayFixed,(sym.info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym.info)._v__ast__ArrayFixed,(sym.info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; v__ast__Type elem_type = info.elem_type; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, elem_type); - bool is_fn_index_call = g->is_fn_index_call && (elem_sym->info)._typ == 482 /* v.ast.FnType */; + bool is_fn_index_call = g->is_fn_index_call && (elem_sym->info)._typ == 483 /* v.ast.FnType */; if (is_fn_index_call) { v__gen__c__Gen_write(g, _SLIT("(*")); } @@ -77169,12 +77454,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_fixed_array(v__gen__c__Gen* g, v__a } v__gen__c__Gen_write(g, _SLIT("[")); bool direct = g->fn_decl != 0 && g->fn_decl->is_direct_arr; - if ((direct || (node.index)._typ == 310 /* v.ast.IntegerLiteral */) || g->pref->translated) { + if ((direct || (node.index)._typ == 311 /* v.ast.IntegerLiteral */) || g->pref->translated) { v__gen__c__Gen_expr(g, node.index); } else { v__gen__c__Gen_write(g, _SLIT("v_fixed_index(")); v__gen__c__Gen_expr(g, node.index); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe07, {.d_i32 = info.size}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = info.size}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("]")); if (is_fn_index_call) { @@ -77185,7 +77470,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_fixed_array(v__gen__c__Gen* g, v__a VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__IndexExpr node, v__ast__TypeSymbol sym) { bool gen_or = node.or_expr.kind != v__ast__OrKind__absent || node.is_option; bool left_is_ptr = v__ast__Type_is_ptr(node.left_type); - v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; string key_type_str = v__gen__c__Gen_typ(g, info.key_type); v__ast__Type elem_type = info.value_type; string elem_type_str = v__gen__c__Gen_typ(g, elem_type); @@ -77200,15 +77485,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde v__gen__c__Gen_write(g, _SLIT("map_set(")); } else { if (node.is_setter) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get_and_set((map*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get_and_set((map*)"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get((map*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get((map*)"), 0, { .d_c = 0 }}}))); } } if (!left_is_ptr || v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("&")); } - if ((node.left)._typ == 308 /* v.ast.IndexExpr */) { + if ((node.left)._typ == 309 /* v.ast.IndexExpr */) { g->inside_map_index = true; v__gen__c__Gen_expr(g, node.left); g->inside_map_index = false; @@ -77218,7 +77503,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde if (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("->val")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); bool old_is_arraymap_set = g->is_arraymap_set; bool old_is_assign_lhs = g->is_assign_lhs; g->is_arraymap_set = false; @@ -77228,17 +77513,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde g->is_assign_lhs = old_is_assign_lhs; v__gen__c__Gen_write(g, _SLIT("}")); g->arraymap_set_pos = g->out.len; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); if (g->assign_op != v__token__Kind__assign && !v__ast__Type_alias_eq(info.value_type, _const_v__ast__string_type)) { string zero = v__gen__c__Gen_type_default(g, info.value_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = zero}}, {_SLIT(" })))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" })))"), 0, { .d_c = 0 }}}))); } } else if (g->inside_map_postfix || g->inside_map_infix || g->inside_map_index || (g->is_assign_lhs && !g->is_arraymap_set && get_and_set_types)) { string zero = v__gen__c__Gen_type_default(g, info.value_type); if (node.is_setter) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get_and_set((map*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get_and_set((map*)"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get((map*)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get((map*)"), 0, { .d_c = 0 }}}))); } if (!left_is_ptr || v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("&")); @@ -77247,9 +77532,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde if (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("->val")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.index); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("}, &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" }))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("}, &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" }))"), 0, { .d_c = 0 }}}))); } else { string zero = v__gen__c__Gen_type_default(g, info.value_type); bool is_gen_or_and_assign_rhs = gen_or && !g->discard_or_result; @@ -77265,16 +77550,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde string tmp_opt = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); string tmp_opt_ptr = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); if (gen_or) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = elem_type_str}}, {_SLIT("* "), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(" = ("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_ptr_typ */(map_get_check("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("* "), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_ptr_typ */(map_get_check("), 0, { .d_c = 0 }}}))); } else { if (g->is_fn_index_call) { - if ((elem_sym->info)._typ == 482 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 483 /* v.ast.FnType */) { v__gen__c__Gen_write(g, _SLIT("((")); v__gen__c__Gen_write_fn_ptr_decl(g, &(*elem_sym->info._v__ast__FnType), _SLIT("")); v__gen__c__Gen_write(g, _SLIT(")(*(voidptr*)map_get(")); } } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)map_get("), 0, { .d_c = 0 }}}))); } } if (!left_is_ptr || v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f)) { @@ -77291,36 +77576,36 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde v__gen__c__Gen_write(g, _SLIT(".val")); } } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("), &("), 0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("), &("), /*115 &string*/0xfe10, {.d_s = key_type_str}}, {_SLIT("[]){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.index); v__gen__c__Gen_write(g, _SLIT("}")); if (gen_or) { v__gen__c__Gen_write(g, _SLIT("))")); } else if (g->is_fn_index_call) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &(voidptr[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" })))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", &(voidptr[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" })))"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", &("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), 0xfe10, {.d_s = zero}}, {_SLIT(" }))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(", &("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" }))"), 0, { .d_c = 0 }}}))); } if (gen_or) { v__gen__c__Gen_writeln(g, _SLIT(";")); string opt_elem_type = v__gen__c__Gen_typ(g, v__ast__Type_set_flag(elem_type, v__ast__TypeFlag__optional)); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)&"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data) = *(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opt_elem_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t*(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)&"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".data) = *(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp_opt_ptr}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("} else {")); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".state = 2; "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(".err = _v_error(_SLIT(\"array index out of range\"));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".state = 2; "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(".err = _v_error(_SLIT(\"array index out of range\"));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); 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"), 0xfe10, {.d_s = cur_line}}, {_SLIT("*("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)"), 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 }}}))); } } } VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr(v__gen__c__Gen* g, v__ast__InfixExpr node) { if ((node.auto_locked).len != 0) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_lock(&"), 0xfe10, {.d_s = node.auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_lock(&"), /*115 &string*/0xfe10, {.d_s = node.auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); } switch (node.op) { case v__token__Kind__arrow: @@ -77486,22 +77771,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr(v__gen__c__Gen* g, v__ast__InfixE ; if ((node.auto_locked).len != 0) { v__gen__c__Gen_writeln(g, _SLIT(";")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_unlock(&"), 0xfe10, {.d_s = node.auto_locked}}, {_SLIT("->mtx)"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sync__RwMutex_unlock(&"), /*115 &string*/0xfe10, {.d_s = node.auto_locked}}, {_SLIT("->mtx)"), 0, { .d_c = 0 }}}))); } } VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_arrow_op(v__gen__c__Gen* g, v__ast__InfixExpr node) { v__gen__c__Type left = v__gen__c__Gen_unwrap(g, node.left_type); string styp = left.sym->cname; - v__ast__Type elem_type = (/* as */ *(v__ast__Chan*)__as_cast((left.sym->info)._v__ast__Chan,(left.sym->info)._typ, 479) /*expected idx: 479, name: v.ast.Chan */ ).elem_type; + v__ast__Type elem_type = (/* as */ *(v__ast__Chan*)__as_cast((left.sym->info)._v__ast__Chan,(left.sym->info)._typ, 480) /*expected idx: 480, name: v.ast.Chan */ ).elem_type; bool gen_or = node.or_block.kind != v__ast__OrKind__absent; string tmp_opt = (gen_or ? (v__gen__c__Gen_new_tmp_var(g)) : (_SLIT(""))); if (gen_or) { string elem_styp = v__gen__c__Gen_typ(g, elem_type); v__gen__c__Gen_register_chan_push_optional_fn(g, elem_styp, styp); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), 0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("__"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); @@ -77520,15 +77805,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ v__gen__c__Type left = v__gen__c__Gen_unwrap(g, node.left_type); v__gen__c__Type right = v__gen__c__Gen_unwrap(g, node.right_type); bool has_defined_eq_operator = v__ast__Table_has_method(g->table, left.sym, _SLIT("==")); - bool has_alias_eq_op_overload = (left.sym->info)._typ == 470 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(left.sym, _SLIT("==")); + bool has_alias_eq_op_overload = (left.sym->info)._typ == 471 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(left.sym, _SLIT("==")); if ((v__ast__Type_is_ptr(left.typ) && v__ast__Type_is_int(right.typ)) || (v__ast__Type_is_ptr(right.typ) && v__ast__Type_is_int(left.typ))) { v__gen__c__Gen_gen_plain_infix_expr(g, node); - } else if ((v__ast__Type_idx(left.typ) == _const_v__ast__string_type_idx || (!has_defined_eq_operator && v__ast__Type_idx(left.unaliased) == _const_v__ast__string_type_idx)) && (node.right)._typ == 329 /* v.ast.StringLiteral */ && ((/* as */ *(v__ast__StringLiteral*)__as_cast((node.right)._v__ast__StringLiteral,(node.right)._typ, 329) /*expected idx: 329, name: v.ast.StringLiteral */ ).val).len == 0) { + } else if ((v__ast__Type_idx(left.typ) == _const_v__ast__string_type_idx || (!has_defined_eq_operator && v__ast__Type_idx(left.unaliased) == _const_v__ast__string_type_idx)) && (node.right)._typ == 330 /* v.ast.StringLiteral */ && ((/* as */ *(v__ast__StringLiteral*)__as_cast((node.right)._v__ast__StringLiteral,(node.right)._typ, 330) /*expected idx: 330, name: v.ast.StringLiteral */ ).val).len == 0) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(")")); string arrow = (v__ast__Type_is_ptr(left.typ) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = arrow}}, {_SLIT("len "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" 0"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = arrow}}, {_SLIT("len "), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" 0"), 0, { .d_c = 0 }}}))); } else if (has_defined_eq_operator) { if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); @@ -77553,7 +77838,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -77572,7 +77857,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ) && !v__ast__Type_has_flag(left.typ, v__ast__TypeFlag__shared_f)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -77597,22 +77882,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((node.left)._typ == 285 /* v.ast.ArrayInit */) { + if ((node.left)._typ == 286 /* v.ast.ArrayInit */) { if (!(*node.left._v__ast__ArrayInit).has_it) { string s = v__gen__c__Gen_typ(g, left.unaliased); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); - if ((node.right)._typ == 285 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 286 /* v.ast.ArrayInit */) { if (!(*node.right._v__ast__ArrayInit).has_it) { string s = v__gen__c__Gen_typ(g, right.unaliased); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_expr(g, node.right); @@ -77625,7 +77910,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -77644,7 +77929,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -77663,7 +77948,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -77682,7 +77967,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (node.op == v__token__Kind__ne) { v__gen__c__Gen_write(g, _SLIT("!")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -77753,11 +78038,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_cmp_op(v__gen__c__Gen* g, v__ast_ v__gen__c__Type left = v__gen__c__Gen_unwrap(g, node.left_type); v__gen__c__Type right = v__gen__c__Gen_unwrap(g, node.right_type); bool has_operator_overloading = v__ast__Table_has_method(g->table, left.sym, _SLIT("<")); - if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).generic_types.len > 0) { + if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).generic_types.len > 0) { if (node.op == v__token__Kind__le || node.op == v__token__Kind__ge) { v__gen__c__Gen_write(g, _SLIT("!")); } - Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).concrete_types; + Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).concrete_types; string method_name = string__plus(left.sym->cname, _SLIT("__lt")); method_name = v__gen__c__Gen_generic_fn_name(g, concrete_types, method_name, true); v__gen__c__Gen_write(g, method_name); @@ -77834,7 +78119,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } if (right.unaliased_sym->kind == v__ast__Kind__array) { if (left.sym->kind == v__ast__Kind__sum_type || left.sym->kind == v__ast__Kind__interface_) { - if ((node.right)._typ == 285 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 286 /* v.ast.ArrayInit */) { if ((*node.right._v__ast__ArrayInit).exprs.len > 0) { Array_v__ast__InfixExpr infix_exprs = __new_array_with_default(0, 0, sizeof(v__ast__InfixExpr), 0); for (int i = 0; i < (*node.right._v__ast__ArrayInit).exprs.len; ++i) { @@ -77847,7 +78132,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } } } - if ((node.right)._typ == 285 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 286 /* v.ast.ArrayInit */) { if ((*node.right._v__ast__ArrayInit).exprs.len > 0) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_infix_expr_in_optimization(g, node.left, (*node.right._v__ast__ArrayInit)); @@ -77855,7 +78140,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ return; } } - if ((right.sym->info)._typ == 450 /* v.ast.Array */) { + if ((right.sym->info)._typ == 451 /* v.ast.Array */) { v__ast__Type elem_type = (*right.sym->info._v__ast__Array).elem_type; v__gen__c__Type elem_type_ = v__gen__c__Gen_unwrap(g, elem_type); if (elem_type_.sym->kind == v__ast__Kind__sum_type) { @@ -77871,7 +78156,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_write(g, _SLIT("_IN_MAP(")); if (!v__ast__Type_is_ptr(left.typ)) { string styp = v__gen__c__Gen_typ(g, node.left_type); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(")")); } else { @@ -77891,7 +78176,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_write(g, _SLIT(")")); } else if (right.unaliased_sym->kind == v__ast__Kind__array_fixed) { if (left.sym->kind == v__ast__Kind__sum_type || left.sym->kind == v__ast__Kind__interface_) { - if ((node.right)._typ == 285 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 286 /* v.ast.ArrayInit */) { if ((*node.right._v__ast__ArrayInit).exprs.len > 0) { Array_v__ast__InfixExpr infix_exprs = __new_array_with_default(0, 0, sizeof(v__ast__InfixExpr), 0); for (int i = 0; i < (*node.right._v__ast__ArrayInit).exprs.len; ++i) { @@ -77904,7 +78189,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } } } - if ((node.right)._typ == 285 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 286 /* v.ast.ArrayInit */) { if ((*node.right._v__ast__ArrayInit).exprs.len > 0) { v__gen__c__Gen_write(g, _SLIT("(")); v__gen__c__Gen_infix_expr_in_optimization(g, node.left, (*node.right._v__ast__ArrayInit)); @@ -77912,7 +78197,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ return; } } - if ((right.sym->info)._typ == 450 /* v.ast.Array */) { + if ((right.sym->info)._typ == 451 /* v.ast.Array */) { v__ast__Type elem_type = (*right.sym->info._v__ast__Array).elem_type; v__gen__c__Type elem_type_ = v__gen__c__Gen_unwrap(g, elem_type); if (elem_type_.sym->kind == v__ast__Kind__sum_type) { @@ -77944,17 +78229,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_optimization(v__gen__c__Gen* g } else { string ptr_typ = v__gen__c__Gen_equality_fn(g, right.elem_type); if (elem_sym->kind == v__ast__Kind__alias) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_alias_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_sumtype_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__map) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_interface_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__array) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0, { .d_c = 0 }}}))); } else if (elem_sym->kind == v__ast__Kind__struct_) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_expr(g, left); @@ -77977,7 +78262,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, node.left_type); bool is_aggregate = left_sym->kind == v__ast__Kind__aggregate; if (is_aggregate) { - v__ast__Type parent_left_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 468) /*expected idx: 468, name: v.ast.Aggregate */ ).sum_type; + v__ast__Type parent_left_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 469) /*expected idx: 469, name: v.ast.Aggregate */ ).sum_type; left_sym = v__ast__Table_sym(g->table, parent_left_type); } v__ast__TypeSymbol* right_sym = v__ast__Table_sym(g->table, node.right_type); @@ -77988,7 +78273,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ string cmp_op = (node.op == v__token__Kind__key_is ? (_SLIT("==")) : (_SLIT("!="))); v__gen__c__Gen_write(g, _SLIT("(")); if (is_aggregate) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__ast__Expr_str(node.left)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node.left)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_expr(g, node.left); } @@ -77999,12 +78284,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ v__gen__c__Gen_write(g, _SLIT(".")); } if (left_sym->kind == v__ast__Kind__interface_) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_typ "), 0xfe10, {.d_s = cmp_op}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_typ "), /*115 &string*/0xfe10, {.d_s = cmp_op}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); v__ast__Type _t1 = 0; - if (node.right._typ == 331 /* v.ast.TypeNode */) { + if (node.right._typ == 332 /* v.ast.TypeNode */) { _t1 = v__gen__c__Gen_unwrap_generic(g, (*node.right._v__ast__TypeNode).typ); } - else if (node.right._typ == 317 /* v.ast.None */) { + else if (node.right._typ == 318 /* v.ast.None */) { _t1 = (*(int*)map_get(ADDR(map, g->table->type_idxs), &(string[]){_SLIT("None__")}, &(int[]){ 0 })); } @@ -78013,10 +78298,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ } v__ast__Type sub_type = _t1; v__ast__TypeSymbol* sub_sym = v__ast__Table_sym(g->table, sub_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), 0xfe10, {.d_s = left_sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_"), /*115 &string*/0xfe10, {.d_s = left_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sub_sym->cname}}, {_SLIT("_index"), 0, { .d_c = 0 }}}))); return; } else if (left_sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_typ "), 0xfe10, {.d_s = cmp_op}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_typ "), /*115 &string*/0xfe10, {.d_s = cmp_op}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.right); } @@ -78024,7 +78309,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_interface_is_op(v__gen__c__Gen* g, v__ast__InfixExpr node) { v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, node.left_type); v__ast__TypeSymbol* right_sym = v__ast__Table_sym(g->table, node.right_type); - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((left_sym->info)._v__ast__Interface,(left_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((left_sym->info)._v__ast__Interface,(left_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; Array_v__ast__Type* _t2 = (Array_v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, info.conversions), &(int[]){node.right_type})); Option_Array_v__ast__Type _t1 = {0}; if (_t2) { @@ -78059,7 +78344,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_interface_is_op(v__gen__c__Gen* g, v__as v__gen__c__Gen_write(g, _SLIT("false")); return; } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), 0xfe10, {.d_s = left_sym->cname}}, {_SLIT("_is_I_"), 0xfe10, {.d_s = right_sym->cname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("I_"), /*115 &string*/0xfe10, {.d_s = left_sym->cname}}, {_SLIT("_is_I_"), /*115 &string*/0xfe10, {.d_s = right_sym->cname}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Type_is_ptr(node.left_type)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -78070,8 +78355,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_interface_is_op(v__gen__c__Gen* g, v__as VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_arithmetic_op(v__gen__c__Gen* g, v__ast__InfixExpr node) { v__gen__c__Type left = v__gen__c__Gen_unwrap(g, node.left_type); v__gen__c__Type right = v__gen__c__Gen_unwrap(g, node.right_type); - if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).generic_types.len > 0) { - Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ).concrete_types; + if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).generic_types.len > 0) { + Array_v__ast__Type concrete_types = (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).concrete_types; string method_name = string__plus(string__plus(left.sym->cname, _SLIT("_")), v__util__replace_op(v__token__Kind_str(node.op))); method_name = v__gen__c__Gen_generic_fn_name(g, concrete_types, method_name, true); v__gen__c__Gen_write(g, method_name); @@ -78106,10 +78391,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, v__gen__c__Type right = v__gen__c__Gen_unwrap(g, node.right_type); if (left.unaliased_sym->kind == v__ast__Kind__array) { string tmp_var = v__gen__c__Gen_new_tmp_var(g); - v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left.unaliased_sym->info)._v__ast__Array,(left.unaliased_sym->info)._typ, 450) /*expected idx: 450, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((left.unaliased_sym->info)._v__ast__Array,(left.unaliased_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; string noscan = v__gen__c__Gen_check_noscan(g, array_info.elem_type); if (right.unaliased_sym->kind == v__ast__Kind__array && !v__ast__Type_alias_eq(array_info.elem_type, right.typ)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_PUSH_MANY"), 0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_PUSH_MANY"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__ast__Type expected_push_many_atype = left.typ; bool is_shared = v__ast__Type_has_flag(expected_push_many_atype, v__ast__TypeFlag__shared_f); if (!v__ast__Type_is_ptr(expected_push_many_atype)) { @@ -78130,12 +78415,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, v__gen__c__Gen_write(g, _SLIT(", (")); v__gen__c__Gen_expr_with_cast(g, node.right, node.right_type, v__ast__Type_clear_flag(left.unaliased, v__ast__TypeFlag__shared_f)); string styp = v__gen__c__Gen_typ(g, expected_push_many_atype); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("), "), 0xfe10, {.d_s = tmp_var}}, {_SLIT(", "), 0xfe10, {.d_s = styp}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("), "), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } else { string elem_type_str = v__gen__c__Gen_typ(g, array_info.elem_type); v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(g->table, array_info.elem_type); - bool elem_is_array_var = (elem_sym->kind == v__ast__Kind__array || elem_sym->kind == v__ast__Kind__array_fixed) && (node.right)._typ == 305 /* v.ast.Ident */; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_push"), 0xfe10, {.d_s = noscan}}, {_SLIT("((array*)"), 0, { .d_c = 0 }}}))); + bool elem_is_array_var = (elem_sym->kind == v__ast__Kind__array || elem_sym->kind == v__ast__Kind__array_fixed) && (node.right)._typ == 306 /* v.ast.Ident */; + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("array_push"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("((array*)"), 0, { .d_c = 0 }}}))); if (!v__ast__Type_is_ptr(left.typ) || (v__ast__Type_has_flag(node.left_type, v__ast__TypeFlag__shared_f) && !v__ast__Type_is_ptr(v__ast__Type_deref(node.left_type)))) { v__gen__c__Gen_write(g, _SLIT("&")); } @@ -78147,9 +78432,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, v__gen__c__Gen_write(g, _SLIT(", _MOV((voidptr[]){ ")); } else if (elem_is_array_var) { string addr = (elem_sym->kind == v__ast__Kind__array_fixed ? (_SLIT("")) : (_SLIT("&"))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), 0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", "), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", _MOV(("), 0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", _MOV(("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("[]){ "), 0, { .d_c = 0 }}}))); } bool needs_clone = !g->is_builtin_mod && v__ast__Type_idx(array_info.elem_type) == _const_v__ast__string_type_idx && v__ast__Type_nr_muls(array_info.elem_type) == 0; if (needs_clone) { @@ -78171,37 +78456,37 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, } VV_LOCAL_SYMBOL bool v__gen__c__Gen_need_tmp_var_in_array_call(v__gen__c__Gen* g, v__ast__Expr node) { - if (node._typ == 291 /* v.ast.CallExpr */) { + if (node._typ == 292 /* v.ast.CallExpr */) { if ((*node._v__ast__CallExpr).left_type != 0 && v__ast__Table_sym(g->table, (*node._v__ast__CallExpr).left_type)->kind == v__ast__Kind__array && (string__eq((*node._v__ast__CallExpr).name, _SLIT("all")) || string__eq((*node._v__ast__CallExpr).name, _SLIT("any")) || string__eq((*node._v__ast__CallExpr).name, _SLIT("filter")) || string__eq((*node._v__ast__CallExpr).name, _SLIT("map")))) { bool _t1 = true; return _t1; } } - else if (node._typ == 308 /* v.ast.IndexExpr */) { + else if (node._typ == 309 /* v.ast.IndexExpr */) { bool _t2 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__IndexExpr).left); return _t2; } - else if (node._typ == 309 /* v.ast.InfixExpr */) { + else if (node._typ == 310 /* v.ast.InfixExpr */) { bool _t3 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__InfixExpr).left) || v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__InfixExpr).right); return _t3; } - else if (node._typ == 320 /* v.ast.ParExpr */) { + else if (node._typ == 321 /* v.ast.ParExpr */) { bool _t4 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__ParExpr).expr); return _t4; } - else if (node._typ == 321 /* v.ast.PostfixExpr */) { + else if (node._typ == 322 /* v.ast.PostfixExpr */) { bool _t5 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__PostfixExpr).expr); return _t5; } - else if (node._typ == 322 /* v.ast.PrefixExpr */) { + else if (node._typ == 323 /* v.ast.PrefixExpr */) { bool _t6 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__PrefixExpr).right); return _t6; } - else if (node._typ == 323 /* v.ast.RangeExpr */) { + else if (node._typ == 324 /* v.ast.RangeExpr */) { bool _t7 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__RangeExpr).low) || v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__RangeExpr).high); return _t7; } - else if (node._typ == 325 /* v.ast.SelectorExpr */) { + else if (node._typ == 326 /* v.ast.SelectorExpr */) { bool _t8 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__SelectorExpr).expr); return _t8; } @@ -78214,19 +78499,19 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_need_tmp_var_in_array_call(v__gen__c__Gen* g } VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_and_or_op(v__gen__c__Gen* g, v__ast__InfixExpr node) { - if ((node.right)._typ == 306 /* v.ast.IfExpr */) { + if ((node.right)._typ == 307 /* v.ast.IfExpr */) { int prev_inside_ternary = g->inside_ternary; g->inside_ternary = 0; if (v__gen__c__Gen_need_tmp_var_in_if(g, (*node.right._v__ast__IfExpr))) { string tmp = v__gen__c__Gen_new_tmp_var(g); string cur_line = string_trim_space(v__gen__c__Gen_go_before_stmt(g, 0)); g->empty_line = true; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_writeln(g, _SLIT(");")); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); - g->infix_left_var_name = (node.op == v__token__Kind__and ? (tmp) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + g->infix_left_var_name = (node.op == v__token__Kind__and ? (tmp) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); v__gen__c__Gen_expr(g, node.right); g->infix_left_var_name = _SLIT(""); g->inside_ternary = prev_inside_ternary; @@ -78238,15 +78523,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_and_or_op(v__gen__c__Gen* g, v__a string cur_line = string_trim_space(v__gen__c__Gen_go_before_stmt(g, 0)); g->empty_line = true; if (g->infix_left_var_name.len > 0) { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = (("), 0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = (("), /*115 &string*/0xfe10, {.d_s = g->infix_left_var_name}}, {_SLIT(") "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("bool "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_writeln(g, _SLIT(");")); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cur_line}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); - g->infix_left_var_name = (node.op == v__token__Kind__and ? (tmp) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cur_line}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + g->infix_left_var_name = (node.op == v__token__Kind__and ? (tmp) : ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("!"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}})))); v__gen__c__Gen_expr(g, node.right); g->infix_left_var_name = _SLIT(""); return; @@ -78259,7 +78544,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_plain_infix_expr(v__gen__c__Gen* g, v__a v__gen__c__Gen_write(g, _SLIT("*")); } v__gen__c__Gen_expr(g, node.left); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node.op)}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr_with_cast(g, node.right, node.right_type, node.left_type); } @@ -78274,7 +78559,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_op_arg(v__gen__c__Gen* g, v__ast__Expr expr, v__gen__c__Gen_write(g, _SLIT("&")); } else { string styp = v__gen__c__Gen_typ(g, v__ast__Type_set_nr_muls(got, 0)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), 0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("ADDR("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); needs_closing = true; } } @@ -78290,7 +78575,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_safe_integer_infix_expr(v__gen__c__Gen* int bitsize = (v__ast__Type_idx(cfg.unsigned_type) == _const_v__ast__u32_type_idx && v__ast__Type_idx(cfg.signed_type) != _const_v__ast__i64_type_idx ? (32) : (64)); int op_idx = ((int)(cfg.op)) - ((int)(v__token__Kind__eq)); string op_str = (cfg.reverse ? ((*(string*)/*ee elem_sym */array_get(_const_v__gen__c__cmp_rev, op_idx))) : ((*(string*)/*ee elem_sym */array_get(_const_v__gen__c__cmp_str, op_idx)))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_us"), 0xfe07, {.d_i32 = bitsize}}, {_SLIT("_"), 0xfe10, {.d_s = op_str}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_us"), /*100 &int*/0xfe07, {.d_i32 = bitsize}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = op_str}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, cfg.unsigned_expr); v__gen__c__Gen_write(g, _SLIT(",")); v__gen__c__Gen_expr(g, cfg.signed_expr); @@ -78320,11 +78605,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { string styp = v__gen__c__Gen_typ(g, utyp); v__gen__c__Gen_register_optional(g, utyp); string dec_fn_name = v__gen__c__js_dec_name(styp); - string dec_fn_dec = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = dec_fn_name}}, {_SLIT("(cJSON* root)"), 0, { .d_c = 0 }}})); - string init_styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" res"), 0, { .d_c = 0 }}})); + string dec_fn_dec = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dec_fn_name}}, {_SLIT("(cJSON* root)"), 0, { .d_c = 0 }}})); + string init_styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" res"), 0, { .d_c = 0 }}})); if (sym->kind == v__ast__Kind__struct_) { int skips = 0; - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; for (int _t2 = 0; _t2 < info.fields.len; ++_t2) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t2]; for (int _t3 = 0; _t3 < field.attrs.len; ++_t3) { @@ -78339,25 +78624,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { init_styp = /*f*/string__plus(init_styp, v__gen__c__Gen_expr_string(g, v__ast__StructInit_to_sumtype_v__ast__Expr(ADDR(v__ast__StructInit, (((v__ast__StructInit){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_short = 0,.is_short_syntax = 0,.unresolved = 0,.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.typ_str = styp,.typ = utyp,.update_expr = {0},.update_expr_type = 0,.update_expr_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.is_update_embed = 0,.has_update_expr = 0,.fields = __new_array(0, 0, sizeof(v__ast__StructInitField)),.embeds = __new_array(0, 0, sizeof(v__ast__StructInitEmbed)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),})))))); } } - strings__Builder_writeln(&dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = dec_fn_dec}}, {_SLIT(" {\n "), 0xfe10, {.d_s = init_styp}}, {_SLIT(";\n if (!root) {\n const char *error_ptr = cJSON_GetErrorPtr();\n if (error_ptr != NULL) {\n const int error_pos = (int)cJSON_GetErrorPos();\n int maxcontext_chars = 30;\n byte *buf = vcalloc_noscan(maxcontext_chars + 10);\n if(error_pos > 0) {\n int backlines = 1;\n int backchars = error_pos < maxcontext_chars-7 ? (int)error_pos : maxcontext_chars-7 ;\n char *prevline_ptr = (char*)error_ptr;\n while(backchars--){\n char prevc = *(prevline_ptr - 1);\n if(0==prevc){\n break;\n }\n if(10==prevc && !backlines--){\n break;\n }\n prevline_ptr--;\n if(123==prevc) {\n break; // stop at `{` too\n }\n }\n int maxchars = vstrlen_char(prevline_ptr);\n vmemcpy(buf, prevline_ptr, (maxchars < maxcontext_chars ? maxchars : maxcontext_chars));\n }\n return (Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("){.state = 2,.err = _v_error(tos2(buf)),.data = {0}};\n }\n }\n"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->json_forward_decls, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dec_fn_dec}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = dec_fn_dec}}, {_SLIT(" {\n "), /*115 &string*/0xfe10, {.d_s = init_styp}}, {_SLIT(";\n if (!root) {\n const char *error_ptr = cJSON_GetErrorPtr();\n if (error_ptr != NULL) {\n const int error_pos = (int)cJSON_GetErrorPos();\n int maxcontext_chars = 30;\n byte *buf = vcalloc_noscan(maxcontext_chars + 10);\n if(error_pos > 0) {\n int backlines = 1;\n int backchars = error_pos < maxcontext_chars-7 ? (int)error_pos : maxcontext_chars-7 ;\n char *prevline_ptr = (char*)error_ptr;\n while(backchars--){\n char prevc = *(prevline_ptr - 1);\n if(0==prevc){\n break;\n }\n if(10==prevc && !backlines--){\n break;\n }\n prevline_ptr--;\n if(123==prevc) {\n break; // stop at `{` too\n }\n }\n int maxchars = vstrlen_char(prevline_ptr);\n vmemcpy(buf, prevline_ptr, (maxchars < maxcontext_chars ? maxchars : maxcontext_chars));\n }\n return (Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){.state = 2,.err = _v_error(tos2(buf)),.data = {0}};\n }\n }\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->json_forward_decls, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dec_fn_dec}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); string enc_fn_name = v__gen__c__js_enc_name(styp); - string enc_fn_dec = str_intp(3, _MOV((StrIntpData[]){{_SLIT("cJSON* "), 0xfe10, {.d_s = enc_fn_name}}, {_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT(" val)"), 0, { .d_c = 0 }}})); - strings__Builder_writeln(&g->json_forward_decls, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = enc_fn_dec}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), 0xfe10, {.d_s = enc_fn_dec}}, {_SLIT(" {\n\tcJSON *o;"), 0, { .d_c = 0 }}}))); + string enc_fn_dec = str_intp(3, _MOV((StrIntpData[]){{_SLIT("cJSON* "), /*115 &string*/0xfe10, {.d_s = enc_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val)"), 0, { .d_c = 0 }}})); + strings__Builder_writeln(&g->json_forward_decls, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = enc_fn_dec}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\n"), /*115 &string*/0xfe10, {.d_s = enc_fn_dec}}, {_SLIT(" {\n\tcJSON *o;"), 0, { .d_c = 0 }}}))); if (sym->kind == v__ast__Kind__array) { v__ast__Type value_type = v__ast__Table_value_type(g->table, utyp); v__gen__c__Gen_gen_json_for_type(g, value_type); strings__Builder_writeln(&dec, v__gen__c__Gen_decode_array(g, value_type)); strings__Builder_writeln(&enc, v__gen__c__Gen_encode_array(g, value_type)); } else if (sym->kind == v__ast__Kind__map) { - v__ast__Map m = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Map */ ; + v__ast__Map m = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Map */ ; v__gen__c__Gen_gen_json_for_type(g, m.key_type); v__gen__c__Gen_gen_json_for_type(g, m.value_type); strings__Builder_writeln(&dec, v__gen__c__Gen_decode_map(g, m.key_type, m.value_type)); strings__Builder_writeln(&enc, v__gen__c__Gen_encode_map(g, m.key_type, m.value_type)); } else if (sym->kind == v__ast__Kind__alias) { - v__ast__Alias a = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ; + v__ast__Alias a = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ; v__ast__Type parent_typ = a.parent_type; v__ast__TypeSymbol* psym = v__ast__Table_sym(g->table, parent_typ); if (v__gen__c__is_js_prim(v__gen__c__Gen_typ(g, parent_typ))) { @@ -78365,31 +78650,31 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { continue; } strings__Builder_writeln(&enc, _SLIT("\to = cJSON_CreateObject();")); - if ((psym->info)._typ == 455 /* v.ast.Struct */) { + if ((psym->info)._typ == 456 /* v.ast.Struct */) { v__gen__c__Gen_gen_struct_enc_dec(g, psym->info, styp, (voidptr)&/*qq*/enc, (voidptr)&/*qq*/dec); } else if (psym->kind == v__ast__Kind__sum_type) { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" aliased sumtypes does not work at the moment"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" aliased sumtypes does not work at the moment"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } } else if (sym->kind == v__ast__Kind__sum_type) { strings__Builder_writeln(&enc, _SLIT("\to = cJSON_CreateObject();")); - if ((sym->info)._typ != 474 /* v.ast.SumType */) { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" is not a sumtype"), 0, { .d_c = 0 }}}))); + if ((sym->info)._typ != 475 /* v.ast.SumType */) { + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" is not a sumtype"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__gen__c__Gen_gen_sumtype_enc_dec(g, *sym, (voidptr)&/*qq*/enc, (voidptr)&/*qq*/dec); } else { strings__Builder_writeln(&enc, _SLIT("\to = cJSON_CreateObject();")); - if ((sym->info)._typ != 455 /* v.ast.Struct */) { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct"), 0, { .d_c = 0 }}}))); + if ((sym->info)._typ != 456 /* v.ast.Struct */) { + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("json: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" is not struct"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__gen__c__Gen_gen_struct_enc_dec(g, sym->info, styp, (voidptr)&/*qq*/enc, (voidptr)&/*qq*/dec); } - strings__Builder_writeln(&dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tOption_"), 0xfe10, {.d_s = styp}}, {_SLIT(" ret;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tOption_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ret;"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&dec, _SLIT("\topt_ok(&res, (Option*)&ret, sizeof(res));")); strings__Builder_writeln(&dec, _SLIT("\treturn ret;\n}")); strings__Builder_writeln(&enc, _SLIT("\treturn o;\n}")); @@ -78400,16 +78685,16 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { // Attr: [inline] inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g, v__ast__TypeSymbol sym, strings__Builder* enc, strings__Builder* dec) { - v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym.info)._v__ast__SumType,(sym.info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym.info)._v__ast__SumType,(sym.info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ; string type_var = v__gen__c__Gen_new_tmp_var(g); int typ = (*(int*)map_get(ADDR(map, g->table->type_idxs), &(string[]){sym.name}, &(int[]){ 0 })); #if !defined(CUSTOM_DEFINE_json_no_inline_sumtypes) { string type_tmp = v__gen__c__Gen_new_tmp_var(g); strings__Builder_writeln(dec, _SLIT("\tif (cJSON_IsObject(root)) {")); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON* "), 0xfe10, {.d_s = type_tmp}}, {_SLIT(" = js_get(root, \"_type\");"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), 0xfe10, {.d_s = type_tmp}}, {_SLIT(" != 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tchar* "), 0xfe10, {.d_s = type_var}}, {_SLIT(" = cJSON_GetStringValue("), 0xfe10, {.d_s = type_tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON* "), /*115 &string*/0xfe10, {.d_s = type_tmp}}, {_SLIT(" = js_get(root, \"_type\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif ("), /*115 &string*/0xfe10, {.d_s = type_tmp}}, {_SLIT(" != 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tchar* "), /*115 &string*/0xfe10, {.d_s = type_var}}, {_SLIT(" = cJSON_GetStringValue("), /*115 &string*/0xfe10, {.d_s = type_tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } #endif Array_string variant_types = __new_array_with_default(0, 0, sizeof(string), 0); @@ -78425,23 +78710,23 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g string unmangled_variant_name = (*(string*)array_last(string_split(variant_sym->name, _SLIT(".")))); v__gen__c__Gen_gen_json_for_type(g, variant); v__gen__c__Gen_get_sumtype_casting_fn(g, variant, typ); - strings__Builder_writeln(&g->definitions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), 0xfe10, {.d_s = sym.cname}}, {_SLIT(" "), 0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("("), 0xfe10, {.d_s = variant_typ}}, {_SLIT("* x);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (val._typ == "), 0xfe07, {.d_i32 = v__ast__Type_idx(variant)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->definitions, str_intp(5, _MOV((StrIntpData[]){{_SLIT("static inline "), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("* x);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif (val._typ == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(variant)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); #if defined(CUSTOM_DEFINE_json_no_inline_sumtypes) { } #else { if (v__gen__c__is_js_prim(variant_typ)) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), 0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (variant_sym->kind == v__ast__Kind__enum_) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), 0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("u64"))}}, {_SLIT("(*val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("u64"))}}, {_SLIT("(*val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (string__eq(variant_sym->name, _SLIT("time.Time"))) { - strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"_type\", cJSON_CreateString(\""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"value\", "), 0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("i64"))}}, {_SLIT("(val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT("->_v_unix));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"_type\", cJSON_CreateString(\""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"value\", "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(_SLIT("i64"))}}, {_SLIT("(val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("->_v_unix));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), 0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"_type\", cJSON_CreateString(\""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\to = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_enc_name(variant_typ)}}, {_SLIT("(*val._"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tcJSON_AddItemToObject(o, \"_type\", cJSON_CreateString(\""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); } } #endif @@ -78453,18 +78738,18 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g #else { if (string__eq(variant_sym->name, _SLIT("time.Time"))) { - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tif (strcmp(\"Time\", "), 0xfe10, {.d_s = type_var}}, {_SLIT(") == 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tif (strcmp(\"Time\", "), /*115 &string*/0xfe10, {.d_s = type_var}}, {_SLIT(") == 0) {"), 0, { .d_c = 0 }}}))); v__gen__c__gen_js_get(sym.cname, tmp, _SLIT("value"), dec, true); - strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = time__unix("), 0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("i64"))}}, {_SLIT("(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tres = "), 0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = time__unix("), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("i64"))}}, {_SLIT("(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t\t}")); } else if (!v__gen__c__is_js_prim(variant_typ) && variant_sym->kind != v__ast__Kind__enum_) { - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tif (strcmp(\""), 0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), 0xfe10, {.d_s = type_var}}, {_SLIT(") == 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tOption_"), 0xfe10, {.d_s = variant_typ}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(variant_typ)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tif ("), 0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\treturn (Option_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("){ .state = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tif (strcmp(\""), /*115 &string*/0xfe10, {.d_s = unmangled_variant_name}}, {_SLIT("\", "), /*115 &string*/0xfe10, {.d_s = type_var}}, {_SLIT(") == 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tOption_"), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(variant_typ)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tif ("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\treturn (Option_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("){ .state = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t\t\t}")); - strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tres = "), 0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(("), 0xfe10, {.d_s = variant_typ}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(("), /*115 &string*/0xfe10, {.d_s = variant_typ}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t\t}")); } } @@ -78481,8 +78766,8 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g if (Array_string_contains(variant_types, _SLIT("bool"))) { string var_t = _SLIT("bool"); strings__Builder_writeln(dec, _SLIT("\t\tif (cJSON_IsBool(root)) {")); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), 0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } for (int i = 0; i < variant_types.len; ++i) { @@ -78491,51 +78776,51 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g if (number_is_met) { string var_num = string_replace(var_t, _SLIT("__"), _SLIT(".")); string last_num = string_replace(last_number_type, _SLIT("__"), _SLIT(".")); - v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many numeric types (conflict of `"), 0xfe10, {.d_s = last_num}}, {_SLIT("` and `"), 0xfe10, {.d_s = var_num}}, {_SLIT("`), you can try to use alias for `"), 0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many numeric types (conflict of `"), /*115 &string*/0xfe10, {.d_s = last_num}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("`), you can try to use alias for `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } number_is_met = true; last_number_type = var_t; strings__Builder_writeln(dec, _SLIT("\t\tif (cJSON_IsNumber(root)) {")); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), 0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("u64"))}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(_SLIT("u64"))}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } if (string__eq(var_t, _SLIT("string")) || string__eq(var_t, _SLIT("rune"))) { if (string_is_met) { string var_num = string_replace(var_t, _SLIT("__"), _SLIT(".")); - v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many string types (conflict of `string` and `rune`), you can try to use alias for `"), 0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many string types (conflict of `string` and `rune`), you can try to use alias for `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } string_is_met = true; strings__Builder_writeln(dec, _SLIT("\t\tif (cJSON_IsString(root)) {")); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), 0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } if (string_starts_with(var_t, _SLIT("Array_"))) { string tmp = v__gen__c__Gen_new_tmp_var(g); string judge_elem_typ = (string_ends_with(var_t, _SLIT("string")) ? (_SLIT("cJSON_IsString(root->child)")) : string_ends_with(var_t, _SLIT("bool")) ? (_SLIT("cJSON_IsBool(root->child)")) : (_SLIT("cJSON_IsNumber(root->child)"))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (cJSON_IsArray(root) && "), 0xfe10, {.d_s = judge_elem_typ}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\tOption_"), 0xfe10, {.d_s = var_t}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tif ("), 0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\treturn (Option_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("){ .state = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\tif (cJSON_IsArray(root) && "), /*115 &string*/0xfe10, {.d_s = judge_elem_typ}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\tOption_"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\tif ("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\t\t\treturn (Option_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("){ .state = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t\t}")); - strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(("), 0xfe10, {.d_s = var_t}}, {_SLIT("*)"), 0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(("), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } if (string__eq(var_t, _SLIT("i64")) || string__eq(var_t, _SLIT("int")) || string__eq(var_t, _SLIT("i8")) || string__eq(var_t, _SLIT("u64")) || string__eq(var_t, _SLIT("u32")) || string__eq(var_t, _SLIT("u16")) || string__eq(var_t, _SLIT("byte")) || string__eq(var_t, _SLIT("u8")) || string__eq(var_t, _SLIT("rune")) || string__eq(var_t, _SLIT("f64")) || string__eq(var_t, _SLIT("f32"))) { if (number_is_met) { string var_num = string_replace(var_t, _SLIT("__"), _SLIT(".")); string last_num = string_replace(last_number_type, _SLIT("__"), _SLIT(".")); - v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), 0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many numeric types (conflict of `"), 0xfe10, {.d_s = last_num}}, {_SLIT("` and `"), 0xfe10, {.d_s = var_num}}, {_SLIT("`), you can try to use alias for `"), 0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(5, _MOV((StrIntpData[]){{_SLIT("json: can not decode `"), /*115 &string*/0xfe10, {.d_s = sym.name}}, {_SLIT("` sumtype, too many numeric types (conflict of `"), /*115 &string*/0xfe10, {.d_s = last_num}}, {_SLIT("` and `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("`), you can try to use alias for `"), /*115 &string*/0xfe10, {.d_s = var_num}}, {_SLIT("` or compile v with `json_no_inline_sumtypes` flag"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } number_is_met = true; last_number_type = var_t; strings__Builder_writeln(dec, _SLIT("\t\tif (cJSON_IsNumber(root)) {")); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), 0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), 0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), 0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), 0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT(" value = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__js_dec_name(var_t)}}, {_SLIT("(root);"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\t\tres = "), /*115 &string*/0xfe10, {.d_s = var_t}}, {_SLIT("_to_sumtype_"), /*115 &string*/0xfe10, {.d_s = sym.cname}}, {_SLIT("(&value);"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t\t}")); } } @@ -78547,7 +78832,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g // Attr: [inline] inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_struct_enc_dec(v__gen__c__Gen* g, v__ast__TypeInfo type_info, string styp, strings__Builder* enc, strings__Builder* dec) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_info)._v__ast__Struct,(type_info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_info)._v__ast__Struct,(type_info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; for (int _t1 = 0; _t1 < info.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[_t1]; string name = field.name; @@ -78582,90 +78867,90 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_struct_enc_dec(v__gen__c__Gen* g, string field_type = v__gen__c__Gen_typ(g, field.typ); v__ast__TypeSymbol* field_sym = v__ast__Table_sym(g->table, field.typ); if (is_raw) { - strings__Builder_writeln(dec, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = tos5(cJSON_PrintUnformatted("), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("js_get(root, \""), 0xfe10, {.d_s = name}}, {_SLIT("\")));"), 0, { .d_c = 0 }}})))); + strings__Builder_writeln(dec, string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = tos5(cJSON_PrintUnformatted("), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("js_get(root, \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\")));"), 0, { .d_c = 0 }}})))); } else { v__gen__c__Gen_gen_json_for_type(g, field.typ); string dec_name = v__gen__c__js_dec_name(field_type); if (v__gen__c__is_js_prim(field_type)) { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = "), 0xfe10, {.d_s = dec_name}}, {_SLIT(" (jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = dec_name}}, {_SLIT(" (jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (field_sym->kind == v__ast__Kind__enum_) { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = json__decode_u64(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = json__decode_u64(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else if (string__eq(field_sym->name, _SLIT("time.Time"))) { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = time__unix(json__decode_u64(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = time__unix(json__decode_u64(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); } else if (field_sym->kind == v__ast__Kind__alias) { - v__ast__Alias alias = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ; + v__ast__Alias alias = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ; string parent_type = v__gen__c__Gen_typ(g, alias.parent_type); string parent_dec_name = v__gen__c__js_dec_name(parent_type); if (v__gen__c__is_js_prim(parent_type)) { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = "), 0xfe10, {.d_s = parent_dec_name}}, {_SLIT(" (jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = parent_dec_name}}, {_SLIT(" (jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_gen_json_for_type(g, field.typ); string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get_opt(dec_name, field_type, styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = *("), 0xfe10, {.d_s = field_type}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = field_type}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } } else { string tmp = v__gen__c__Gen_new_tmp_var(g); v__gen__c__gen_js_get_opt(dec_name, field_type, styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = *("), 0xfe10, {.d_s = field_type}}, {_SLIT("*) "), 0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tres."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = field_type}}, {_SLIT("*) "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".data;"), 0, { .d_c = 0 }}}))); } } string enc_name = v__gen__c__js_enc_name(field_type); if (is_omit_empty) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t if (val."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" != "), 0xfe10, {.d_s = v__gen__c__Gen_type_default(g, field.typ)}}, {_SLIT(") \n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t if (val."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT(" != "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_type_default(g, field.typ)}}, {_SLIT(") \n"), 0, { .d_c = 0 }}}))); } if (!v__gen__c__is_js_prim(field_type)) { if (field_sym->kind == v__ast__Kind__alias) { - v__ast__Alias ainfo = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ; + v__ast__Alias ainfo = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ; enc_name = v__gen__c__js_enc_name(v__gen__c__Gen_typ(g, ainfo.parent_type)); } } if (field_sym->kind == v__ast__Kind__enum_) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), 0xfe10, {.d_s = name}}, {_SLIT("\", json__encode_u64(val."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\", json__encode_u64(val."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); } else { if (string__eq(field_sym->name, _SLIT("time.Time"))) { - strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), 0xfe10, {.d_s = name}}, {_SLIT("\", json__encode_u64(val."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("._v_unix));"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\", json__encode_u64(val."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("._v_unix));"), 0, { .d_c = 0 }}}))); } else { - strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), 0xfe10, {.d_s = name}}, {_SLIT("\", "), 0xfe10, {.d_s = enc_name}}, {_SLIT("(val."), 0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(enc, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\tcJSON_AddItemToObject(o, \""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\", "), /*115 &string*/0xfe10, {.d_s = enc_name}}, {_SLIT("(val."), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(field.name)}}, {_SLIT("));\n"), 0, { .d_c = 0 }}}))); } } } } VV_LOCAL_SYMBOL void v__gen__c__gen_js_get(string styp, string tmp, string name, strings__Builder* dec, bool is_required) { - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON *jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(" = js_get(root,\""), 0xfe10, {.d_s = name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tcJSON *jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = js_get(root,\""), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))); if (is_required) { - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif(jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(" == 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn (Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("){ .state = 2, .err = _v_error(_SLIT(\"expected field \'"), 0xfe10, {.d_s = name}}, {_SLIT("\' is missing\")), .data = {0} };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif(jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" == 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t\treturn (Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){ .state = 2, .err = _v_error(_SLIT(\"expected field \'"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("\' is missing\")), .data = {0} };"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t}")); } } VV_LOCAL_SYMBOL void v__gen__c__gen_js_get_opt(string dec_name, string field_type, string styp, string tmp, string name, strings__Builder* dec, bool is_required) { v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); - strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\tOption_"), 0xfe10, {.d_s = field_type}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = "), 0xfe10, {.d_s = dec_name}}, {_SLIT(" (jsonroot_"), 0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif("), 0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn (Option_"), 0xfe10, {.d_s = styp}}, {_SLIT("){ .state = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), 0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\tOption_"), /*115 &string*/0xfe10, {.d_s = field_type}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = dec_name}}, {_SLIT(" (jsonroot_"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tif("), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state != 0) {"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(dec, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn (Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){ .state = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".state, .err = "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(".err, .data = {0} };"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(dec, _SLIT("\t}")); } VV_LOCAL_SYMBOL string v__gen__c__js_enc_name(string typ) { string suffix = (string_ends_with(typ, _SLIT("*")) ? (string_replace(typ, _SLIT("*"), _SLIT(""))) : (typ)); - string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("json__encode_"), 0xfe10, {.d_s = suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("json__encode_"), /*115 &string*/0xfe10, {.d_s = suffix}}, {_SLIT0, 0, { .d_c = 0 }}})); string _t1 = v__util__no_dots(name); return _t1; } VV_LOCAL_SYMBOL string v__gen__c__js_dec_name(string typ) { - string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("json__decode_"), 0xfe10, {.d_s = typ}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("json__decode_"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT0, 0, { .d_c = 0 }}})); string _t1 = v__util__no_dots(name); return _t1; } @@ -78680,19 +78965,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_decode_array(v__gen__c__Gen* g, v__ast__Ty string fn_name = v__gen__c__js_dec_name(styp); string s = _SLIT(""); if (v__gen__c__is_js_prim(styp)) { - s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" val = "), 0xfe10, {.d_s = fn_name}}, {_SLIT("((cJSON *)jsval); "), 0, { .d_c = 0 }}})); + s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val = "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("((cJSON *)jsval); "), 0, { .d_c = 0 }}})); } else { - s = str_intp(6, _MOV((StrIntpData[]){{_SLIT("\n Option_"), 0xfe10, {.d_s = styp}}, {_SLIT(" val2 = "), 0xfe10, {.d_s = fn_name}}, {_SLIT(" ((cJSON *)jsval);\n if(val2.state != 0) {\n array_free(&res);\n return *(Option_Array_"), 0xfe10, {.d_s = styp}}, {_SLIT("*)&val2;\n }\n "), 0xfe10, {.d_s = styp}}, {_SLIT(" val = *("), 0xfe10, {.d_s = styp}}, {_SLIT("*)val2.data;\n"), 0, { .d_c = 0 }}})); + s = str_intp(6, _MOV((StrIntpData[]){{_SLIT("\n Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val2 = "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" ((cJSON *)jsval);\n if(val2.state != 0) {\n array_free(&res);\n return *(Option_Array_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)&val2;\n }\n "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val = *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)val2.data;\n"), 0, { .d_c = 0 }}})); } string noscan = v__gen__c__Gen_check_noscan(g, value_type); - string _t1 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("\n if(root && !cJSON_IsArray(root) && !cJSON_IsNull(root)) {\n return (Option_Array_"), 0xfe10, {.d_s = styp}}, {_SLIT("){.state = 2, .err = _v_error(string__plus(_SLIT(\"Json element is not an array: \"), tos2((byteptr)cJSON_PrintUnformatted(root)))), .data = {0}};\n }\n res = __new_array"), 0xfe10, {.d_s = noscan}}, {_SLIT("(0, 0, sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("));\n const cJSON *jsval = NULL;\n cJSON_ArrayForEach(jsval, root)\n {\n "), 0xfe10, {.d_s = s}}, {_SLIT("\n array_push"), 0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&res, &val);\n }\n"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(6, _MOV((StrIntpData[]){{_SLIT("\n if(root && !cJSON_IsArray(root) && !cJSON_IsNull(root)) {\n return (Option_Array_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){.state = 2, .err = _v_error(string__plus(_SLIT(\"Json element is not an array: \"), tos2((byteptr)cJSON_PrintUnformatted(root)))), .data = {0}};\n }\n res = __new_array"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("(0, 0, sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));\n const cJSON *jsval = NULL;\n cJSON_ArrayForEach(jsval, root)\n {\n "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\n array_push"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("((array*)&res, &val);\n }\n"), 0, { .d_c = 0 }}})); return _t1; } VV_LOCAL_SYMBOL string v__gen__c__Gen_encode_array(v__gen__c__Gen* g, v__ast__Type value_type) { string styp = v__gen__c__Gen_typ(g, value_type); string fn_name = v__gen__c__js_enc_name(styp); - string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n o = cJSON_CreateArray();\n for (int i = 0; i < val.len; i++){\n cJSON_AddItemToArray(o, "), 0xfe10, {.d_s = fn_name}}, {_SLIT(" ( (("), 0xfe10, {.d_s = styp}}, {_SLIT("*)val.data)[i] ));\n }\n"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\n o = cJSON_CreateArray();\n for (int i = 0; i < val.len; i++){\n cJSON_AddItemToArray(o, "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" ( (("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)val.data)[i] ));\n }\n"), 0, { .d_c = 0 }}})); return _t1; } @@ -78708,11 +78993,11 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_decode_map(v__gen__c__Gen* g, v__ast__Type string fn_name_v = v__gen__c__js_dec_name(styp_v); string s = _SLIT(""); if (v__gen__c__is_js_prim(styp_v)) { - s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp_v}}, {_SLIT(" val = "), 0xfe10, {.d_s = fn_name_v}}, {_SLIT(" (js_get(root, jsval->string));"), 0, { .d_c = 0 }}})); + s = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT(" val = "), /*115 &string*/0xfe10, {.d_s = fn_name_v}}, {_SLIT(" (js_get(root, jsval->string));"), 0, { .d_c = 0 }}})); } else { - s = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n Option_"), 0xfe10, {.d_s = styp_v}}, {_SLIT(" val2 = "), 0xfe10, {.d_s = fn_name_v}}, {_SLIT(" (js_get(root, jsval->string));\n if(val2.state != 0) {\n map_free(&res);\n return *(Option_Map_"), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = styp_v}}, {_SLIT("*)&val2;\n }\n "), 0xfe10, {.d_s = styp_v}}, {_SLIT(" val = *("), 0xfe10, {.d_s = styp_v}}, {_SLIT("*)val2.data;\n"), 0, { .d_c = 0 }}})); + s = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n Option_"), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT(" val2 = "), /*115 &string*/0xfe10, {.d_s = fn_name_v}}, {_SLIT(" (js_get(root, jsval->string));\n if(val2.state != 0) {\n map_free(&res);\n return *(Option_Map_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("*)&val2;\n }\n "), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT(" val = *("), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("*)val2.data;\n"), 0, { .d_c = 0 }}})); } - string _t1 = str_intp(10, _MOV((StrIntpData[]){{_SLIT("\n if(!cJSON_IsObject(root) && !cJSON_IsNull(root)) {\n return (Option_Map_"), 0xfe10, {.d_s = styp}}, {_SLIT("_"), 0xfe10, {.d_s = styp_v}}, {_SLIT("){ .state = 2, .err = _v_error(string__plus(_SLIT(\"Json element is not an object: \"), tos2((byteptr)cJSON_PrintUnformatted(root)))), .data = {0}};\n }\n res = new_map(sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("), sizeof("), 0xfe10, {.d_s = styp_v}}, {_SLIT("), "), 0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), 0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), 0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), 0xfe10, {.d_s = free_fn}}, {_SLIT(");\n cJSON *jsval = NULL;\n cJSON_ArrayForEach(jsval, root)\n {\n "), 0xfe10, {.d_s = s}}, {_SLIT("\n string key = tos2((byteptr)jsval->string);\n map_set(&res, &key, &val);\n }\n"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(10, _MOV((StrIntpData[]){{_SLIT("\n if(!cJSON_IsObject(root) && !cJSON_IsNull(root)) {\n return (Option_Map_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("){ .state = 2, .err = _v_error(string__plus(_SLIT(\"Json element is not an object: \"), tos2((byteptr)cJSON_PrintUnformatted(root)))), .data = {0}};\n }\n res = new_map(sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("), "), /*115 &string*/0xfe10, {.d_s = hash_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = key_eq_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = clone_fn}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = free_fn}}, {_SLIT(");\n cJSON *jsval = NULL;\n cJSON_ArrayForEach(jsval, root)\n {\n "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("\n string key = tos2((byteptr)jsval->string);\n map_set(&res, &key, &val);\n }\n"), 0, { .d_c = 0 }}})); return _t1; } @@ -78724,12 +79009,12 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_encode_map(v__gen__c__Gen* g, v__ast__Type string keys_tmp = v__gen__c__Gen_new_tmp_var(g); string key = _SLIT("string key = "); if (v__ast__Type_is_string(key_type)) { - key = /*f*/string__plus(key, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(("), 0xfe10, {.d_s = styp}}, {_SLIT("*)"), 0xfe10, {.d_s = keys_tmp}}, {_SLIT(".data)[i];"), 0, { .d_c = 0 }}}))); + key = /*f*/string__plus(key, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)"), /*115 &string*/0xfe10, {.d_s = keys_tmp}}, {_SLIT(".data)[i];"), 0, { .d_c = 0 }}}))); } else { v__gen__c__verror(_SLIT("json: encode only maps with string keys")); VUNREACHABLE(); } - string _t1 = str_intp(10, _MOV((StrIntpData[]){{_SLIT("\n o = cJSON_CreateObject();\n Array_"), 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = keys_tmp}}, {_SLIT(" = map_keys(&val);\n for (int i = 0; i < "), 0xfe10, {.d_s = keys_tmp}}, {_SLIT(".len; ++i) {\n "), 0xfe10, {.d_s = key}}, {_SLIT("\n cJSON_AddItemToObject(o, (char*) key.str, "), 0xfe10, {.d_s = fn_name_v}}, {_SLIT(" ( *("), 0xfe10, {.d_s = styp_v}}, {_SLIT("*) map_get(&val, &key, &("), 0xfe10, {.d_s = styp_v}}, {_SLIT("[]) { "), 0xfe10, {.d_s = zero}}, {_SLIT(" } ) ) );\n }\n array_free(&"), 0xfe10, {.d_s = keys_tmp}}, {_SLIT(");\n"), 0, { .d_c = 0 }}})); + string _t1 = str_intp(10, _MOV((StrIntpData[]){{_SLIT("\n o = cJSON_CreateObject();\n Array_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = keys_tmp}}, {_SLIT(" = map_keys(&val);\n for (int i = 0; i < "), /*115 &string*/0xfe10, {.d_s = keys_tmp}}, {_SLIT(".len; ++i) {\n "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("\n cJSON_AddItemToObject(o, (char*) key.str, "), /*115 &string*/0xfe10, {.d_s = fn_name_v}}, {_SLIT(" ( *("), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("*) map_get(&val, &key, &("), /*115 &string*/0xfe10, {.d_s = styp_v}}, {_SLIT("[]) { "), /*115 &string*/0xfe10, {.d_s = zero}}, {_SLIT(" } ) ) );\n }\n array_free(&"), /*115 &string*/0xfe10, {.d_s = keys_tmp}}, {_SLIT(");\n"), 0, { .d_c = 0 }}})); return _t1; } @@ -78763,13 +79048,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_generate_hotcode_reloader_code(v__gen__c__Ge if (g->pref->os != v__pref__OS__windows) { for (int _t1 = 0; _t1 < g->hotcode_fn_names.len; ++_t1) { string so_fn = ((string*)g->hotcode_fn_names.data)[_t1]; - array_push((array*)&load_code, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("impl_live_"), 0xfe10, {.d_s = so_fn}}, {_SLIT(" = dlsym(live_lib, \"impl_live_"), 0xfe10, {.d_s = so_fn}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&load_code, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("impl_live_"), /*115 &string*/0xfe10, {.d_s = so_fn}}, {_SLIT(" = dlsym(live_lib, \"impl_live_"), /*115 &string*/0xfe10, {.d_s = so_fn}}, {_SLIT("\");"), 0, { .d_c = 0 }}}))) })); } phd = _const_v__gen__c__posix_hotcode_definitions_1; } else { for (int _t3 = 0; _t3 < g->hotcode_fn_names.len; ++_t3) { string so_fn = ((string*)g->hotcode_fn_names.data)[_t3]; - array_push((array*)&load_code, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("impl_live_"), 0xfe10, {.d_s = so_fn}}, {_SLIT(" = (void *)GetProcAddress(live_lib, \"impl_live_"), 0xfe10, {.d_s = so_fn}}, {_SLIT("\"); "), 0, { .d_c = 0 }}}))) })); + array_push((array*)&load_code, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("impl_live_"), /*115 &string*/0xfe10, {.d_s = so_fn}}, {_SLIT(" = (void *)GetProcAddress(live_lib, \"impl_live_"), /*115 &string*/0xfe10, {.d_s = so_fn}}, {_SLIT("\"); "), 0, { .d_c = 0 }}}))) })); } phd = _const_v__gen__c__windows_hotcode_definitions_1; } @@ -78787,21 +79072,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_generate_hotcode_reloading_main_caller(v__ge v__gen__c__Gen_writeln(g, _SLIT("\t\t// initialization of live function pointers")); for (int _t1 = 0; _t1 < g->hotcode_fn_names.len; ++_t1) { string fname = ((string*)g->hotcode_fn_names.data)[_t1]; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\timpl_live_"), 0xfe10, {.d_s = fname}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\timpl_live_"), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); } string vexe = v__util__cescaped_path(v__pref__vexe_path()); string file = v__util__cescaped_path(g->pref->path); string msvc = (string__eq(g->pref->ccompiler, _SLIT("msvc")) ? (_SLIT("-cc msvc")) : (_SLIT(""))); string so_debug_flag = (g->pref->is_debug ? (_SLIT("-cg")) : (_SLIT(""))); - string vopts = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = msvc}}, {_SLIT(" "), 0xfe10, {.d_s = so_debug_flag}}, {_SLIT(" -sharedlive -shared"), 0, { .d_c = 0 }}})); + string vopts = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = msvc}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = so_debug_flag}}, {_SLIT(" -sharedlive -shared"), 0, { .d_c = 0 }}})); v__gen__c__Gen_writeln(g, _SLIT("\t\t// start background reloading thread")); if (g->pref->os == v__pref__OS__windows) { v__gen__c__Gen_writeln(g, _SLIT("\t\tlive_fn_mutex = CreateMutexA(0, 0, 0);")); } v__gen__c__Gen_writeln(g, _SLIT("\t\tv__live__LiveReloadInfo* live_info = v__live__executable__new_live_reload_info(")); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), 0xfe10, {.d_s = file}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), 0xfe10, {.d_s = vexe}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), 0xfe10, {.d_s = vopts}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), /*115 &string*/0xfe10, {.d_s = file}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), /*115 &string*/0xfe10, {.d_s = vexe}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\t tos2(\""), /*115 &string*/0xfe10, {.d_s = vopts}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("\t\t\t\t\t &live_fn_mutex,")); v__gen__c__Gen_writeln(g, _SLIT("\t\t\t\t\t v_bind_live_symbols")); v__gen__c__Gen_writeln(g, _SLIT("\t\t);")); @@ -78838,9 +79123,9 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_need_tmp_var_in_match(v__gen__c__Gen* g, v__ return _t6; } if (branch.stmts.len == 1) { - if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 345 /* v.ast.ExprStmt */) { - v__ast__ExprStmt stmt = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._v__ast__ExprStmt,((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ, 345) /*expected idx: 345, name: v.ast.ExprStmt */ ; - if (((stmt.expr)._typ == 291 /* v.ast.CallExpr */ || (stmt.expr)._typ == 306 /* v.ast.IfExpr */ || (stmt.expr)._typ == 315 /* v.ast.MatchExpr */) || ((stmt.expr)._typ == 308 /* v.ast.IndexExpr */ && (/* as */ *(v__ast__IndexExpr*)__as_cast((stmt.expr)._v__ast__IndexExpr,(stmt.expr)._typ, 308) /*expected idx: 308, name: v.ast.IndexExpr */ ).or_expr.kind != v__ast__OrKind__absent)) { + if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 346 /* v.ast.ExprStmt */) { + v__ast__ExprStmt stmt = /* as */ *(v__ast__ExprStmt*)__as_cast(((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._v__ast__ExprStmt,((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ; + if (((stmt.expr)._typ == 292 /* v.ast.CallExpr */ || (stmt.expr)._typ == 307 /* v.ast.IfExpr */ || (stmt.expr)._typ == 316 /* v.ast.MatchExpr */) || ((stmt.expr)._typ == 309 /* v.ast.IndexExpr */ && (/* as */ *(v__ast__IndexExpr*)__as_cast((stmt.expr)._v__ast__IndexExpr,(stmt.expr)._typ, 309) /*expected idx: 309, name: v.ast.IndexExpr */ ).or_expr.kind != v__ast__OrKind__absent)) { bool _t7 = true; return _t7; } @@ -78872,7 +79157,7 @@ bool old; v__gen__c__Gen_match_expr_defer_0 = true; g->inside_match_optional = true; } - if ((node.cond)._typ == 305 /* v.ast.Ident */ || (node.cond)._typ == 325 /* v.ast.SelectorExpr */ || (node.cond)._typ == 310 /* v.ast.IntegerLiteral */ || (node.cond)._typ == 329 /* v.ast.StringLiteral */ || (node.cond)._typ == 303 /* v.ast.FloatLiteral */) { + if ((node.cond)._typ == 306 /* v.ast.Ident */ || (node.cond)._typ == 326 /* v.ast.SelectorExpr */ || (node.cond)._typ == 311 /* v.ast.IntegerLiteral */ || (node.cond)._typ == 330 /* v.ast.StringLiteral */ || (node.cond)._typ == 304 /* v.ast.FloatLiteral */) { cond_var = v__gen__c__Gen_expr_string(g, node.cond); } else { string _t1; /* if prepend */ @@ -78884,7 +79169,7 @@ bool old; } string line = _t1; cond_var = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.cond_type)}}, {_SLIT(" "), 0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.cond_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.cond); v__gen__c__Gen_writeln(g, _SLIT(";")); v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); @@ -78894,7 +79179,7 @@ bool old; g->empty_line = true; cur_line = string_trim_left(v__gen__c__Gen_go_before_stmt(g, 0), _SLIT(" \t")); tmp_var = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.return_type)}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), 0xfe10, {.d_s = v__gen__c__Gen_type_default(g, node.return_type)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, node.return_type)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_type_default(g, node.return_type)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } if (is_expr && !need_tmp_var) { v__gen__c__Gen_write(g, _SLIT("(")); @@ -78910,7 +79195,7 @@ bool old; v__gen__c__Gen_set_current_pos_as_last_stmt_pos(g); v__gen__c__Gen_write(g, cur_line); if (need_tmp_var) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp_var}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (is_expr && !need_tmp_var) { v__gen__c__Gen_write(g, _SLIT(")")); @@ -78960,15 +79245,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_sumtype(v__gen__c__Gen* g, v__ast v__gen__c__Gen_write(g, cond_var); string dot_or_ptr = (v__ast__Type_is_ptr(node.cond_type) ? (_SLIT("->")) : (_SLIT("."))); if (sym->kind == v__ast__Kind__sum_type) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index))); } else if (sym->kind == v__ast__Kind__interface_) { - if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 331 /* v.ast.TypeNode */) { - v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast(((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._v__ast__TypeNode,((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ, 331) /*expected idx: 331, name: v.ast.TypeNode */ ; + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 332 /* v.ast.TypeNode */) { + v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast(((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._v__ast__TypeNode,((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ, 332) /*expected idx: 332, name: v.ast.TypeNode */ ; v__ast__TypeSymbol* branch_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, typ.typ)); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == _"), 0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), 0xfe10, {.d_s = branch_sym->cname}}, {_SLIT("_index"), 0, { .d_c = 0 }}}))); - } else if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 317 /* v.ast.None */ && sym->idx == _const_v__ast__error_type_idx) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == _IError_None___index"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == _"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = branch_sym->cname}}, {_SLIT("_index"), 0, { .d_c = 0 }}}))); + } else if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 318 /* v.ast.None */ && sym->idx == _const_v__ast__error_type_idx) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot_or_ptr}}, {_SLIT("_typ == _IError_None___index"), 0, { .d_c = 0 }}}))); } } if (is_expr && tmp_var.len == 0) { @@ -78996,20 +79281,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_sumtype(v__gen__c__Gen* g, v__ast } VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast__MatchExpr node, bool is_expr, string cond_var, string tmp_var, v__ast__TypeSymbol enum_typ) { - string cname = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = enum_typ.cname}}, {_SLIT("__"), 0, { .d_c = 0 }}})); - Array_string covered_enum = __new_array_with_default(0, (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 484) /*expected idx: 484, name: v.ast.Enum */ ).vals.len, sizeof(string), 0); + string cname = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = enum_typ.cname}}, {_SLIT("__"), 0, { .d_c = 0 }}})); + Array_string covered_enum = __new_array_with_default(0, (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 485) /*expected idx: 485, name: v.ast.Enum */ ).vals.len, sizeof(string), 0); Array_v__ast__MatchBranch range_branches = __new_array_with_default(0, node.branches.len, sizeof(v__ast__MatchBranch), 0); bool default_generated = false; g->empty_line = true; - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("switch ("), 0xfe10, {.d_s = cond_var}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("switch ("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); g->indent++; for (int _t1 = 0; _t1 < node.branches.len; ++_t1) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)node.branches.data)[_t1]; if (branch.is_else) { - for (int _t2 = 0; _t2 < (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 484) /*expected idx: 484, name: v.ast.Enum */ ).vals.len; ++_t2) { - string val = ((string*)(/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 484) /*expected idx: 484, name: v.ast.Enum */ ).vals.data)[_t2]; + for (int _t2 = 0; _t2 < (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 485) /*expected idx: 485, name: v.ast.Enum */ ).vals.len; ++_t2) { + string val = ((string*)(/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 485) /*expected idx: 485, name: v.ast.Enum */ ).vals.data)[_t2]; if (!Array_string_contains(covered_enum, val)) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("case "), 0xfe10, {.d_s = cname}}, {_SLIT0, 0xfe10, {.d_s = val}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("case "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("default:")); @@ -79024,24 +79309,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ if (i > 0) { v__gen__c__Gen_write(g, _SLIT(" || ")); } - if ((expr)._typ == 323 /* v.ast.RangeExpr */) { + if ((expr)._typ == 324 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 310 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 311 /* v.ast.IntegerLiteral */) { if ((v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u16_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u32_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u64_type)) && string__eq((*(*expr._v__ast__RangeExpr).low._v__ast__IntegerLiteral).val, _SLIT("0"))) { skip_low = true; } } v__gen__c__Gen_write(g, _SLIT("(")); if (!skip_low) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).low); v__gen__c__Gen_write(g, _SLIT(" && ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).high); v__gen__c__Gen_write(g, _SLIT(")")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } @@ -79059,7 +79344,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ int _t4_len = _t4_orig.len; for (int _t5 = 0; _t5 < _t4_len; ++_t5) { v__ast__Expr it = ((v__ast__Expr*) _t4_orig.data)[_t5]; - if ((it)._typ == 323 /* v.ast.RangeExpr */) { + if ((it)._typ == 324 /* v.ast.RangeExpr */) { _t4 = true; break; } @@ -79070,7 +79355,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ } for (int _t7 = 0; _t7 < branch.exprs.len; ++_t7) { v__ast__Expr expr = ((v__ast__Expr*)branch.exprs.data)[_t7]; - if ((expr)._typ == 302 /* v.ast.EnumVal */) { + if ((expr)._typ == 303 /* v.ast.EnumVal */) { array_push((array*)&covered_enum, _MOV((string[]){ string_clone((*expr._v__ast__EnumVal).val) })); v__gen__c__Gen_write(g, _SLIT("case ")); v__gen__c__Gen_expr(g, expr); @@ -79100,24 +79385,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ if (i > 0) { v__gen__c__Gen_write(g, _SLIT(" || ")); } - if ((expr)._typ == 323 /* v.ast.RangeExpr */) { + if ((expr)._typ == 324 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 310 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 311 /* v.ast.IntegerLiteral */) { if ((v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u16_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u32_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u64_type)) && string__eq((*(*expr._v__ast__RangeExpr).low._v__ast__IntegerLiteral).val, _SLIT("0"))) { skip_low = true; } } v__gen__c__Gen_write(g, _SLIT("(")); if (!skip_low) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).low); v__gen__c__Gen_write(g, _SLIT(" && ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).high); v__gen__c__Gen_write(g, _SLIT(")")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } @@ -79175,52 +79460,52 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_classic(v__gen__c__Gen* g, v__ast if (type_sym->kind == (v__ast__Kind__array)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, node.cond_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (type_sym->kind == (v__ast__Kind__array_fixed)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, node.cond_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_arr_eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (type_sym->kind == (v__ast__Kind__map)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, node.cond_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_map_eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (type_sym->kind == (v__ast__Kind__string)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string__eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("string__eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (type_sym->kind == (v__ast__Kind__struct_)) { string ptr_typ = v__gen__c__Gen_equality_fn(g, node.cond_type); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), 0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ptr_typ}}, {_SLIT("_struct_eq("), /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else { - if ((expr)._typ == 323 /* v.ast.RangeExpr */) { + if ((expr)._typ == 324 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 310 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 311 /* v.ast.IntegerLiteral */) { if ((v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u16_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u32_type) || v__ast__Type_alias_eq(node.cond_type, _const_v__ast__u64_type)) && string__eq((*(*expr._v__ast__RangeExpr).low._v__ast__IntegerLiteral).val, _SLIT("0"))) { skip_low = true; } } v__gen__c__Gen_write(g, _SLIT("(")); if (!skip_low) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" >= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).low); v__gen__c__Gen_write(g, _SLIT(" && ")); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" <= "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, (*expr._v__ast__RangeExpr).high); v__gen__c__Gen_write(g, _SLIT(")")); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cond_var}}, {_SLIT(" == ("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } @@ -79254,22 +79539,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_profile_fn(v__gen__c__Gen* g, v__ast__FnDecl g->defer_profile_code = _SLIT(""); } else { string measure_fn_name = (g->pref->os == v__pref__OS__macos ? (_SLIT("time__vpc_now_darwin")) : (_SLIT("time__vpc_now"))); - string fn_profile_counter_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("vpc_"), 0xfe10, {.d_s = cfn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); - string fn_profile_counter_name_calls = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT("_calls"), 0, { .d_c = 0 }}})); + string fn_profile_counter_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("vpc_"), /*115 &string*/0xfe10, {.d_s = cfn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string fn_profile_counter_name_calls = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT("_calls"), 0, { .d_c = 0 }}})); v__gen__c__Gen_writeln(g, _SLIT("")); bool should_restore_v__profile_enabled = g->pref->profile_fns.len > 0 && Array_string_contains(g->pref->profile_fns, cfn_name); if (should_restore_v__profile_enabled) { v__gen__c__Gen_writeln(g, _SLIT("\tbool _prev_v__profile_enabled = v__profile_enabled;")); v__gen__c__Gen_writeln(g, _SLIT("\tv__profile_enabled = true;")); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tdouble _PROF_FN_START = "), 0xfe10, {.d_s = measure_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif(v__profile_enabled) { "), 0xfe10, {.d_s = fn_profile_counter_name_calls}}, {_SLIT("++; } // "), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tdouble _PROF_FN_START = "), /*115 &string*/0xfe10, {.d_s = measure_fn_name}}, {_SLIT("();"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif(v__profile_enabled) { "), /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name_calls}}, {_SLIT("++; } // "), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("")); - g->defer_profile_code = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif(v__profile_enabled) { "), 0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT(" += "), 0xfe10, {.d_s = measure_fn_name}}, {_SLIT("() - _PROF_FN_START; }"), 0, { .d_c = 0 }}})); + g->defer_profile_code = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\tif(v__profile_enabled) { "), /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT(" += "), /*115 &string*/0xfe10, {.d_s = measure_fn_name}}, {_SLIT("() - _PROF_FN_START; }"), 0, { .d_c = 0 }}})); if (should_restore_v__profile_enabled) { g->defer_profile_code = /*f*/string__plus(g->defer_profile_code, _SLIT("\n\t\tv__profile_enabled = _prev_v__profile_enabled;")); } - strings__Builder_writeln(&g->pcs_declarations, str_intp(3, _MOV((StrIntpData[]){{_SLIT("double "), 0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT(" = 0.0; u64 "), 0xfe10, {.d_s = fn_profile_counter_name_calls}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(3, _MOV((StrIntpData[]){{_SLIT("double "), /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name}}, {_SLIT(" = 0.0; u64 "), /*115 &string*/0xfe10, {.d_s = fn_profile_counter_name_calls}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); array_push((array*)&g->pcs, _MOV((v__gen__c__ProfileCounterMeta[]){ ((v__gen__c__ProfileCounterMeta){.fn_name = cfn_name,.vpc_name = fn_profile_counter_name,.vpc_calls = fn_profile_counter_name_calls,}) })); } } @@ -79280,14 +79565,14 @@ void v__gen__c__Gen_gen_vprint_profile_stats(v__gen__c__Gen* g) { if (string__eq(g->pref->profile_file, _SLIT("-"))) { for (int _t1 = 0; _t1 < g->pcs.len; ++_t1) { v__gen__c__ProfileCounterMeta pc_meta = ((v__gen__c__ProfileCounterMeta*)g->pcs.data)[_t1]; - strings__Builder_writeln(&g->pcs_declarations, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(") printf("), 0xfe10, {.d_s = fstring}}, {_SLIT(", "), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", "), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/1000000.0, "), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/"), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", \""), 0xfe10, {.d_s = pc_meta.fn_name}}, {_SLIT("\" );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(") printf("), /*115 &string*/0xfe10, {.d_s = fstring}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/1000000.0, "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", \""), /*115 &string*/0xfe10, {.d_s = pc_meta.fn_name}}, {_SLIT("\" );"), 0, { .d_c = 0 }}}))); } } else { strings__Builder_writeln(&g->pcs_declarations, _SLIT("\tFILE * fp;")); - strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfp = fopen (\""), 0xfe10, {.d_s = g->pref->profile_file}}, {_SLIT("\", \"w+\");"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tfp = fopen (\""), /*115 &string*/0xfe10, {.d_s = g->pref->profile_file}}, {_SLIT("\", \"w+\");"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < g->pcs.len; ++_t2) { v__gen__c__ProfileCounterMeta pc_meta = ((v__gen__c__ProfileCounterMeta*)g->pcs.data)[_t2]; - strings__Builder_writeln(&g->pcs_declarations, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\tif ("), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(") fprintf(fp, "), 0xfe10, {.d_s = fstring}}, {_SLIT(", "), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", "), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/1000000.0, "), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/"), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", \""), 0xfe10, {.d_s = pc_meta.fn_name}}, {_SLIT("\" );"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(8, _MOV((StrIntpData[]){{_SLIT("\tif ("), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(") fprintf(fp, "), /*115 &string*/0xfe10, {.d_s = fstring}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/1000000.0, "), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT("/"), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(", \""), /*115 &string*/0xfe10, {.d_s = pc_meta.fn_name}}, {_SLIT("\" );"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->pcs_declarations, _SLIT("\tfclose(fp);")); } @@ -79296,8 +79581,8 @@ void v__gen__c__Gen_gen_vprint_profile_stats(v__gen__c__Gen* g) { strings__Builder_writeln(&g->pcs_declarations, _SLIT("void vreset_profile_stats(){")); for (int _t3 = 0; _t3 < g->pcs.len; ++_t3) { v__gen__c__ProfileCounterMeta pc_meta = ((v__gen__c__ProfileCounterMeta*)g->pcs.data)[_t3]; - strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT(" = 0.0;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_calls}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&g->pcs_declarations, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = pc_meta.vpc_name}}, {_SLIT(" = 0.0;"), 0, { .d_c = 0 }}}))); } strings__Builder_writeln(&g->pcs_declarations, _SLIT("}")); strings__Builder_writeln(&g->pcs_declarations, _SLIT("")); @@ -79307,7 +79592,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt(v__gen__c__Gen* g, v__ast__SqlStmt string conn = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("// orm")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__Connection "), 0xfe10, {.d_s = conn}}, {_SLIT(" = (orm__Connection){._"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__Connection "), /*115 &string*/0xfe10, {.d_s = conn}}, {_SLIT(" = (orm__Connection){._"), 0, { .d_c = 0 }}}))); string fn_prefix = _SLIT(""); v__gen__c__SqlType typ = v__gen__c__Gen_parse_db_type(g, node.db_expr); @@ -79321,12 +79606,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt(v__gen__c__Gen* g, v__ast__SqlStmt fn_prefix = _SLIT("pg__DB"); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("This database type `"), 0xfe10, {.d_s = v__gen__c__SqlType_str(typ)}}, {_SLIT("` is not implemented yet in orm"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("This database type `"), /*115 &v.gen.c.SqlType*/0xfe10, {.d_s = v__gen__c__SqlType_str(typ)}}, {_SLIT("` is not implemented yet in orm"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); }; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_prefix}}, {_SLIT(" = &"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_prefix}}, {_SLIT(" = &"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.db_expr); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", ._typ = _orm__Connection_"), 0xfe10, {.d_s = fn_prefix}}, {_SLIT("_index};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", ._typ = _orm__Connection_"), /*115 &string*/0xfe10, {.d_s = fn_prefix}}, {_SLIT("_index};"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < node.lines.len; ++_t1) { v__ast__SqlStmtLine line = ((v__ast__SqlStmtLine*)node.lines.data)[_t1]; v__gen__c__Gen_sql_stmt_line(g, line, conn); @@ -79363,27 +79648,27 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt_line(v__gen__c__Gen* g, v__ast__Sql array_free(&fields); } if (node.kind == v__ast__SqlStmtKind__create) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_create_table(g, node, expr, table_name); subs = true; } else if (node.kind == v__ast__SqlStmtKind__drop) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("drop("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("drop("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"));"), 0, { .d_c = 0 }}}))); subs = true; } else if (node.kind == v__ast__SqlStmtKind__insert) { string arr = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_orm__Primitive "), 0xfe10, {.d_s = arr}}, {_SLIT(" = new_array_from_c_array(0, 0, sizeof(orm__Primitive), NULL);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("Array_orm__Primitive "), /*115 &string*/0xfe10, {.d_s = arr}}, {_SLIT(" = new_array_from_c_array(0, 0, sizeof(orm__Primitive), NULL);"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_insert(g, node, expr, table_name, arr, res, _SLIT(""), false, _SLIT("")); dcheck = true; } else if (node.kind == v__ast__SqlStmtKind__update) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_update(g, node, expr, table_name); } else if (node.kind == v__ast__SqlStmtKind__delete) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_delete(g, node, expr, table_name); } if (!dcheck) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && "), 0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str("), 0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); } if (subs) { Map_int_v__ast__SqlStmtLine _t4 = node.sub_structs; @@ -79403,32 +79688,32 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt_line(v__gen__c__Gen* g, v__ast__Sql } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_create_table(v__gen__c__Gen* g, v__ast__SqlStmtLine node, string expr, string table_name) { - v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("create("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"), new_array_from_c_array("), 0xfe07, {.d_i32 = node.fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = node.fields.len}}, {_SLIT(", sizeof(orm__TableField),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("create("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"), new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = node.fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = node.fields.len}}, {_SLIT(", sizeof(orm__TableField),"), 0, { .d_c = 0 }}}))); if (node.fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__TableField["), 0xfe07, {.d_i32 = node.fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__TableField["), /*100 &int*/0xfe07, {.d_i32 = node.fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < node.fields.len; ++_t1) { v__ast__StructField field = ((v__ast__StructField*)node.fields.data)[_t1]; v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); v__gen__c__Gen_write(g, _SLIT("(orm__TableField){")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = field.name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); int typ = ((int)(field.typ)); if (string__eq(sym->name, _SLIT("time.Time"))) { typ = -2; } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".typ = "), 0xfe07, {.d_i32 = typ}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_arr = "), 0xfe10, {.d_s = sym->kind == v__ast__Kind__array ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_time = "), 0xfe10, {.d_s = string__eq(v__ast__Table_get_type_name(g->table, field.typ), _SLIT("time__Time")) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".default_val = (string){.str = (byteptr) \""), 0xfe10, {.d_s = field.default_val}}, {_SLIT("\", .is_lit = 1},"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".attrs = new_array_from_c_array("), 0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT(", sizeof(StructAttribute),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".typ = "), /*100 &int*/0xfe07, {.d_i32 = typ}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_arr = "), /*115 &bool*/0xfe10, {.d_s = sym->kind == v__ast__Kind__array ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_time = "), /*115 &bool*/0xfe10, {.d_s = string__eq(v__ast__Table_get_type_name(g->table, field.typ), _SLIT("time__Time")) ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".default_val = (string){.str = (byteptr) \""), /*115 &string*/0xfe10, {.d_s = field.default_val}}, {_SLIT("\", .is_lit = 1},"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".attrs = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT(", sizeof(StructAttribute),"), 0, { .d_c = 0 }}}))); if (field.attrs.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((StructAttribute["), 0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((StructAttribute["), /*100 &int*/0xfe07, {.d_i32 = field.attrs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < field.attrs.len; ++_t2) { v__ast__Attr attr = ((v__ast__Attr*)field.attrs.data)[_t2]; v__gen__c__Gen_write(g, _SLIT("(StructAttribute){")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = attr.name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_arg = "), 0xfe10, {.d_s = attr.has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg = _SLIT(\""), 0xfe10, {.d_s = attr.arg}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".kind = "), 0xfe07, {.d_i32 = ((int)(attr.kind))}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_arg = "), /*115 &bool*/0xfe10, {.d_s = attr.has_arg ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".arg = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = attr.arg}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".kind = "), /*100 &int*/0xfe07, {.d_i32 = ((int)(attr.kind))}}, {_SLIT(","), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("},")); } v__gen__c__Gen_write(g, _SLIT("})")); @@ -79493,43 +79778,43 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_insert(v__gen__c__Gen* g, v__ast__SqlStm for (int _t9 = 0; _t9 < subs.len; ++_t9) { v__ast__SqlStmtLine sub = ((v__ast__SqlStmtLine*)subs.data)[_t9]; v__gen__c__Gen_sql_stmt_line(g, sub, expr); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("array_push(&"), 0xfe10, {.d_s = last_ids_arr}}, {_SLIT(", _MOV((orm__Primitive[]){orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_last_id("), 0xfe10, {.d_s = expr}}, {_SLIT("._object)}));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("array_push(&"), /*115 &string*/0xfe10, {.d_s = last_ids_arr}}, {_SLIT(", _MOV((orm__Primitive[]){orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_last_id("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object)}));"), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("insert("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"), (orm__QueryData){"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Option_void "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("insert("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"), (orm__QueryData){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); if (fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_MOV((string["), 0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_MOV((string["), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t10 = 0; _t10 < fields.len; ++_t10) { v__ast__StructField f = ((v__ast__StructField*)fields.data)[_t10]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = v__gen__c__Gen_get_field_name(g, f)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_get_field_name(g, f)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); if (fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), 0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); int structs = 0; for (int _t11 = 0; _t11 < fields.len; ++_t11) { v__ast__StructField f = ((v__ast__StructField*)fields.data)[_t11]; if (string__eq(f.name, fkey)) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = pid}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = pid}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); continue; } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, f.typ); string typ = sym->cname; if (sym->kind == v__ast__Kind__struct_ && !string__eq(typ, _SLIT("time__Time"))) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*(orm__Primitive*) array_get("), 0xfe10, {.d_s = last_ids_arr}}, {_SLIT(", "), 0xfe07, {.d_i32 = structs}}, {_SLIT(")),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("(*(orm__Primitive*) array_get("), /*115 &string*/0xfe10, {.d_s = last_ids_arr}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = structs}}, {_SLIT(")),"), 0, { .d_c = 0 }}}))); structs++; continue; } if (string__eq(typ, _SLIT("time__Time"))) { typ = _SLIT("time"); } - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("orm__"), 0xfe10, {.d_s = typ}}, {_SLIT("_to_primitive("), 0xfe10, {.d_s = node.object_var_name}}, {_SLIT("."), 0xfe10, {.d_s = f.name}}, {_SLIT("),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("orm__"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT("_to_primitive("), /*115 &string*/0xfe10, {.d_s = node.object_var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = f.name}}, {_SLIT("),"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { @@ -79540,19 +79825,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_insert(v__gen__c__Gen* g, v__ast__SqlStm v__gen__c__Gen_write(g, _SLIT(".kinds = new_array_from_c_array(0, 0, sizeof(orm__OperationKind), NULL),")); v__gen__c__Gen_write(g, _SLIT(".is_and = new_array_from_c_array(0, 0, sizeof(bool), NULL),")); v__gen__c__Gen_writeln(g, _SLIT("});")); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && "), 0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str("), 0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); if (arrs.len > 0) { string id_name = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("orm__Primitive "), 0xfe10, {.d_s = id_name}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_last_id("), 0xfe10, {.d_s = expr}}, {_SLIT("._object);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("orm__Primitive "), /*115 &string*/0xfe10, {.d_s = id_name}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_last_id("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object);"), 0, { .d_c = 0 }}}))); for (int i = 0; i < arrs.len; ++i) { v__ast__SqlStmtLine* arr = ((v__ast__SqlStmtLine*)arrs.data) + i; string idx = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("for (int "), 0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), 0xfe10, {.d_s = idx}}, {_SLIT(" < "), 0xfe10, {.d_s = arr->object_var_name}}, {_SLIT("."), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(field_names, i))}}, {_SLIT(".len; "), 0xfe10, {.d_s = idx}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("for (int "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = arr->object_var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(field_names, i))}}, {_SLIT(".len; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); string last_ids = v__gen__c__Gen_new_tmp_var(g); string res_ = v__gen__c__Gen_new_tmp_var(g); string tmp_var = v__gen__c__Gen_new_tmp_var(g); string ctyp = v__gen__c__Gen_typ(g, arr->table_expr.typ); - v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ctyp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp_var}}, {_SLIT(" = (*("), 0xfe10, {.d_s = ctyp}}, {_SLIT("*)array_get("), 0xfe10, {.d_s = arr->object_var_name}}, {_SLIT("."), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(field_names, i))}}, {_SLIT(", "), 0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(7, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ctyp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT(" = (*("), /*115 &string*/0xfe10, {.d_s = ctyp}}, {_SLIT("*)array_get("), /*115 &string*/0xfe10, {.d_s = arr->object_var_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(field_names, i))}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); arr->object_var_name = tmp_var; Array_v__ast__StructField fff = __new_array_with_default(0, 0, sizeof(v__ast__StructField), 0); for (int _t12 = 0; _t12 < arr->fields.len; ++_t12) { @@ -79581,25 +79866,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_insert(v__gen__c__Gen* g, v__ast__SqlStm } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_update(v__gen__c__Gen* g, v__ast__SqlStmtLine node, string expr, string table_name) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("update("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"), (orm__QueryData){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("update("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"), (orm__QueryData){"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(".kinds = new_array_from_c_array(0, 0, sizeof(orm__OperationKind), NULL),")); v__gen__c__Gen_write(g, _SLIT(".is_and = new_array_from_c_array(0, 0, sizeof(bool), NULL),")); v__gen__c__Gen_write(g, _SLIT(".types = new_array_from_c_array(0, 0, sizeof(int), NULL),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), 0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); if (node.updated_columns.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), 0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = node.updated_columns.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < node.updated_columns.len; ++_t1) { string field = ((string*)node.updated_columns.data)[_t1]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = field}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = field}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), 0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); if (node.update_exprs.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), 0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), /*100 &int*/0xfe07, {.d_i32 = node.update_exprs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < node.update_exprs.len; ++_t2) { v__ast__Expr e = ((v__ast__Expr*)node.update_exprs.data)[_t2]; v__gen__c__Gen_sql_expr_to_orm_primitive(g, e); @@ -79612,29 +79897,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_update(v__gen__c__Gen* g, v__ast__SqlStm } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_delete(v__gen__c__Gen* g, v__ast__SqlStmtLine node, string expr, string table_name) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_v_delete("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("_v_delete("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_gen_where_data(g, node.where_expr); v__gen__c__Gen_writeln(g, _SLIT(");")); } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_expr_to_orm_primitive(v__gen__c__Gen* g, v__ast__Expr expr) { - if (expr._typ == 309 /* v.ast.InfixExpr */) { + if (expr._typ == 310 /* v.ast.InfixExpr */) { v__gen__c__Gen_sql_write_orm_primitive(g, v__ast__Table_find_type_idx(g->table, _SLIT("orm.InfixType")), expr); } - else if (expr._typ == 329 /* v.ast.StringLiteral */) { + else if (expr._typ == 330 /* v.ast.StringLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__string_type, expr); } - else if (expr._typ == 310 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__int_type, expr); } - else if (expr._typ == 289 /* v.ast.BoolLiteral */) { + else if (expr._typ == 290 /* v.ast.BoolLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__bool_type, expr); } - else if (expr._typ == 305 /* v.ast.Ident */) { - v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast(((*expr._v__ast__Ident).info)._v__ast__IdentVar,((*expr._v__ast__Ident).info)._typ, 415) /*expected idx: 415, name: v.ast.IdentVar */ ; + else if (expr._typ == 306 /* v.ast.Ident */) { + v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast(((*expr._v__ast__Ident).info)._v__ast__IdentVar,((*expr._v__ast__Ident).info)._typ, 416) /*expected idx: 416, name: v.ast.IdentVar */ ; v__gen__c__Gen_sql_write_orm_primitive(g, info.typ, expr); } - else if (expr._typ == 325 /* v.ast.SelectorExpr */) { + else if (expr._typ == 326 /* v.ast.SelectorExpr */) { v__gen__c__Gen_sql_write_orm_primitive(g, (*expr._v__ast__SelectorExpr).typ, expr); } @@ -79660,12 +79945,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_write_orm_primitive(v__gen__c__Gen* g, v if (string__eq(typ, _SLIT("orm__InfixType"))) { typ = _SLIT("infix"); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__"), 0xfe10, {.d_s = typ}}, {_SLIT("_to_primitive("), 0, { .d_c = 0 }}}))); - if ((expr)._typ == 309 /* v.ast.InfixExpr */) { + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT("_to_primitive("), 0, { .d_c = 0 }}}))); + if ((expr)._typ == 310 /* v.ast.InfixExpr */) { v__gen__c__Gen_write(g, _SLIT("(orm__InfixType){")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), 0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__InfixExpr).left)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".name = _SLIT(\""), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*expr._v__ast__InfixExpr).left)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); string kind = (((*expr._v__ast__InfixExpr).op == (v__token__Kind__plus)) ? (_SLIT("orm__MathOperationKind__add")) : ((*expr._v__ast__InfixExpr).op == (v__token__Kind__minus)) ? (_SLIT("orm__MathOperationKind__sub")) : ((*expr._v__ast__InfixExpr).op == (v__token__Kind__div)) ? (_SLIT("orm__MathOperationKind__div")) : ((*expr._v__ast__InfixExpr).op == (v__token__Kind__mul)) ? (_SLIT("orm__MathOperationKind__mul")) : (_SLIT(""))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".operator = "), 0xfe10, {.d_s = kind}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".operator = "), /*115 &string*/0xfe10, {.d_s = kind}}, {_SLIT(","), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(".right = ")); v__gen__c__Gen_sql_expr_to_orm_primitive(g, (*expr._v__ast__InfixExpr).right); v__gen__c__Gen_write(g, _SLIT("}")); @@ -79676,7 +79961,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_write_orm_primitive(v__gen__c__Gen* g, v } VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_where_data(v__gen__c__Gen* g, v__ast__Expr expr, Array_string* fields, Array_string* kinds, Array_v__ast__Expr* data, Array_bool* is_and) { - if (expr._typ == 309 /* v.ast.InfixExpr */) { + if (expr._typ == 310 /* v.ast.InfixExpr */) { g->sql_side = v__gen__c__SqlExprSide__left; v__gen__c__Gen_sql_where_data(g, (*expr._v__ast__InfixExpr).left, fields, kinds, data, is_and); string _t1 = (string){.str=(byteptr)"", .is_lit=1}; @@ -79836,29 +80121,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_where_data(v__gen__c__Gen* g, v__ast__Ex kind = _SLIT("orm__OperationKind__eq"); } } - if (((*expr._v__ast__InfixExpr).left)._typ != 309 /* v.ast.InfixExpr */ && ((*expr._v__ast__InfixExpr).right)._typ != 309 /* v.ast.InfixExpr */) { + if (((*expr._v__ast__InfixExpr).left)._typ != 310 /* v.ast.InfixExpr */ && ((*expr._v__ast__InfixExpr).right)._typ != 310 /* v.ast.InfixExpr */) { array_push((array*)kinds, _MOV((string[]){ string_clone(kind) })); } g->sql_side = v__gen__c__SqlExprSide__right; v__gen__c__Gen_sql_where_data(g, (*expr._v__ast__InfixExpr).right, fields, kinds, data, is_and); } - else if (expr._typ == 305 /* v.ast.Ident */) { + else if (expr._typ == 306 /* v.ast.Ident */) { if (g->sql_side == v__gen__c__SqlExprSide__left) { array_push((array*)fields, _MOV((string[]){ string_clone(v__gen__c__Gen_get_field_name(g, v__gen__c__Gen_get_struct_field(g, (*expr._v__ast__Ident).name))) })); } else { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } } - else if (expr._typ == 329 /* v.ast.StringLiteral */) { + else if (expr._typ == 330 /* v.ast.StringLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 310 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 325 /* v.ast.SelectorExpr */) { + else if (expr._typ == 326 /* v.ast.SelectorExpr */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 289 /* v.ast.BoolLiteral */) { + else if (expr._typ == 290 /* v.ast.BoolLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } @@ -79875,21 +80160,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_gen_where_data(v__gen__c__Gen* g, v__ast Array_bool is_and = __new_array_with_default(0, 0, sizeof(bool), 0); v__gen__c__Gen_sql_where_data(g, where_expr, &/*arr*/fields, &/*arr*/kinds, &/*arr*/data, &/*arr*/is_and); v__gen__c__Gen_write(g, _SLIT(".types = new_array_from_c_array(0, 0, sizeof(int), NULL),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); if (fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), 0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t1 = 0; _t1 < fields.len; ++_t1) { string field = ((string*)fields.data)[_t1]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = field}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = field}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), 0xfe07, {.d_i32 = data.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = data.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = data.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = data.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); if (data.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), 0xfe07, {.d_i32 = data.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), /*100 &int*/0xfe07, {.d_i32 = data.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < data.len; ++_t2) { v__ast__Expr e = ((v__ast__Expr*)data.data)[_t2]; v__gen__c__Gen_sql_expr_to_orm_primitive(g, e); @@ -79897,24 +80182,24 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_gen_where_data(v__gen__c__Gen* g, v__ast v__gen__c__Gen_write(g, _SLIT("})")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".kinds = new_array_from_c_array("), 0xfe07, {.d_i32 = kinds.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = kinds.len}}, {_SLIT(", sizeof(orm__OperationKind),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".kinds = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = kinds.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = kinds.len}}, {_SLIT(", sizeof(orm__OperationKind),"), 0, { .d_c = 0 }}}))); if (kinds.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__OperationKind["), 0xfe07, {.d_i32 = kinds.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__OperationKind["), /*100 &int*/0xfe07, {.d_i32 = kinds.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t3 = 0; _t3 < kinds.len; ++_t3) { string k = ((string*)kinds.data)[_t3]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = k}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = k}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".is_and = new_array_from_c_array("), 0xfe07, {.d_i32 = is_and.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = is_and.len}}, {_SLIT(", sizeof(bool),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".is_and = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = is_and.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = is_and.len}}, {_SLIT(", sizeof(bool),"), 0, { .d_c = 0 }}}))); if (is_and.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((bool["), 0xfe07, {.d_i32 = is_and.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((bool["), /*100 &int*/0xfe07, {.d_i32 = is_and.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t4 = 0; _t4 < is_and.len; ++_t4) { bool b = ((bool*)is_and.data)[_t4]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = b ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &bool*/0xfe10, {.d_s = b ? _SLIT("true") : _SLIT("false")}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { @@ -79928,7 +80213,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select_expr(v__gen__c__Gen* g, v__ast__S string conn = v__gen__c__Gen_new_tmp_var(g); v__gen__c__Gen_writeln(g, _SLIT("")); v__gen__c__Gen_writeln(g, _SLIT("// orm")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__Connection "), 0xfe10, {.d_s = conn}}, {_SLIT(" = (orm__Connection){._"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm__Connection "), /*115 &string*/0xfe10, {.d_s = conn}}, {_SLIT(" = (orm__Connection){._"), 0, { .d_c = 0 }}}))); string fn_prefix = _SLIT(""); v__gen__c__SqlType typ = v__gen__c__Gen_parse_db_type(g, node.db_expr); @@ -79942,12 +80227,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select_expr(v__gen__c__Gen* g, v__ast__S fn_prefix = _SLIT("pg__DB"); } else { - v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("This database type `"), 0xfe10, {.d_s = v__gen__c__SqlType_str(typ)}}, {_SLIT("` is not implemented yet in orm"), 0, { .d_c = 0 }}}))); + v__gen__c__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("This database type `"), /*115 &v.gen.c.SqlType*/0xfe10, {.d_s = v__gen__c__SqlType_str(typ)}}, {_SLIT("` is not implemented yet in orm"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); }; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = fn_prefix}}, {_SLIT(" = &"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = fn_prefix}}, {_SLIT(" = &"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.db_expr); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", ._typ = _orm__Connection_"), 0xfe10, {.d_s = fn_prefix}}, {_SLIT("_index};"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", ._typ = _orm__Connection_"), /*115 &string*/0xfe10, {.d_s = fn_prefix}}, {_SLIT("_index};"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_sql_select(g, node, conn, left); } @@ -79973,12 +80258,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp string res = v__gen__c__Gen_new_tmp_var(g); string table_name = v__gen__c__Gen_get_table_name(g, node.table_expr); g->sql_table_name = v__ast__Table_sym(g->table, node.table_expr.typ)->name; - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("Option_Array_Array_orm__Primitive _o"), 0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), 0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_select("), 0xfe10, {.d_s = expr}}, {_SLIT("._object, "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("Option_Array_Array_orm__Primitive _o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = orm__Connection_name_table["), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._typ]._method_select("), /*115 &string*/0xfe10, {.d_s = expr}}, {_SLIT("._object, "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("(orm__SelectConfig){")); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".table = _SLIT(\""), 0xfe10, {.d_s = table_name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_count = "), 0xfe10, {.d_s = node.is_count ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_where = "), 0xfe10, {.d_s = node.has_where ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_order = "), 0xfe10, {.d_s = node.has_order ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".table = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = table_name}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".is_count = "), /*115 &bool*/0xfe10, {.d_s = node.is_count ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_where = "), /*115 &bool*/0xfe10, {.d_s = node.has_where ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_order = "), /*115 &bool*/0xfe10, {.d_s = node.has_order ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); if (node.has_order) { v__gen__c__Gen_write(g, _SLIT(".order = _SLIT(\"")); v__gen__c__Gen_expr(g, node.order_expr); @@ -79989,10 +80274,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__gen__c__Gen_write(g, _SLIT(".order_type = orm__OrderType__asc,")); } } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_limit = "), 0xfe10, {.d_s = node.has_limit ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_offset = "), 0xfe10, {.d_s = node.has_offset ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_limit = "), /*115 &bool*/0xfe10, {.d_s = node.has_limit ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".has_offset = "), /*115 &bool*/0xfe10, {.d_s = node.has_offset ? _SLIT("true") : _SLIT("false")}}, {_SLIT(","), 0, { .d_c = 0 }}}))); if ((prim).len != 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".primary = _SLIT(\""), 0xfe10, {.d_s = prim}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(".primary = _SLIT(\""), /*115 &string*/0xfe10, {.d_s = prim}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); } Array_v__ast__StructField _t4 = {0}; Array_v__ast__StructField _t4_orig = fields; @@ -80006,13 +80291,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp } } Array_v__ast__StructField select_fields =_t4; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), 0xfe07, {.d_i32 = select_fields.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = select_fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".fields = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = select_fields.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = select_fields.len}}, {_SLIT(", sizeof(string),"), 0, { .d_c = 0 }}}))); Array_int types = __new_array_with_default(0, 0, sizeof(int), 0); if (select_fields.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), 0xfe07, {.d_i32 = select_fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((string["), /*100 &int*/0xfe07, {.d_i32 = select_fields.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t6 = 0; _t6 < select_fields.len; ++_t6) { v__ast__StructField field = ((v__ast__StructField*)select_fields.data)[_t6]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = v__gen__c__Gen_get_field_name(g, field)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_get_field_name(g, field)}}, {_SLIT("\"),"), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); if (string__eq(sym->name, _SLIT("time.Time"))) { array_push((array*)&types, _MOV((int[]){ -2 })); @@ -80029,12 +80314,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__gen__c__Gen_write(g, _SLIT("NULL")); } v__gen__c__Gen_write(g, _SLIT("),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".types = new_array_from_c_array("), 0xfe07, {.d_i32 = types.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = types.len}}, {_SLIT(", sizeof(int),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".types = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = types.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = types.len}}, {_SLIT(", sizeof(int),"), 0, { .d_c = 0 }}}))); if (types.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((int["), 0xfe07, {.d_i32 = types.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((int["), /*100 &int*/0xfe07, {.d_i32 = types.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t10 = 0; _t10 < types.len; ++_t10) { int typ = ((int*)types.data)[_t10]; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = typ}}, {_SLIT(","), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = typ}}, {_SLIT(","), 0, { .d_c = 0 }}}))); } v__gen__c__Gen_write(g, _SLIT("})")); } else { @@ -80052,9 +80337,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__gen__c__Gen_write(g, _SLIT(".types = new_array_from_c_array(0, 0, sizeof(int), NULL),")); v__gen__c__Gen_write(g, _SLIT(".kinds = new_array_from_c_array(0, 0, sizeof(orm__OperationKind), NULL),")); v__gen__c__Gen_write(g, _SLIT(".is_and = new_array_from_c_array(0, 0, sizeof(bool), NULL),")); - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), 0xfe07, {.d_i32 = exprs.len}}, {_SLIT(", "), 0xfe07, {.d_i32 = exprs.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT(".data = new_array_from_c_array("), /*100 &int*/0xfe07, {.d_i32 = exprs.len}}, {_SLIT(", "), /*100 &int*/0xfe07, {.d_i32 = exprs.len}}, {_SLIT(", sizeof(orm__Primitive),"), 0, { .d_c = 0 }}}))); if (exprs.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), 0xfe07, {.d_i32 = exprs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" _MOV((orm__Primitive["), /*100 &int*/0xfe07, {.d_i32 = exprs.len}}, {_SLIT("]){"), 0, { .d_c = 0 }}}))); for (int _t13 = 0; _t13 < exprs.len; ++_t13) { v__ast__Expr e = ((v__ast__Expr*)exprs.data)[_t13]; v__gen__c__Gen_sql_expr_to_orm_primitive(g, e); @@ -80070,22 +80355,22 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__gen__c__Gen_write(g, _SLIT("(orm__QueryData) {}")); } v__gen__c__Gen_writeln(g, _SLIT(");")); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if (_o"), 0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && _o"), 0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str(_o"), 0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Array_Array_orm__Primitive "), 0xfe10, {.d_s = res}}, {_SLIT(" = (*(Array_Array_orm__Primitive*)_o"), 0xfe10, {.d_s = res}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("if (_o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".state != 0 && _o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err._typ != _IError_None___index) { _v_panic(IError_str(_o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".err)); }"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("Array_Array_orm__Primitive "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(" = (*(Array_Array_orm__Primitive*)_o"), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".data);"), 0, { .d_c = 0 }}}))); if (node.is_count) { - v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left}}, {_SLIT(" *((*(orm__Primitive*) array_get((*(Array_orm__Primitive*)array_get("), 0xfe10, {.d_s = res}}, {_SLIT(", 0)), 0))._int);"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left}}, {_SLIT(" *((*(orm__Primitive*) array_get((*(Array_orm__Primitive*)array_get("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(", 0)), 0))._int);"), 0, { .d_c = 0 }}}))); } else { string tmp = v__gen__c__Gen_new_tmp_var(g); string styp = v__gen__c__Gen_typ(g, node.typ); string idx = v__gen__c__Gen_new_tmp_var(g); - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("int "), 0xfe10, {.d_s = idx}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("int "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" = 0;"), 0, { .d_c = 0 }}}))); string typ_str = _SLIT(""); if (node.is_array) { v__ast__Array info = v__ast__TypeSymbol_array_info(v__ast__Table_sym(g->table, node.typ)); typ_str = v__gen__c__Gen_typ(g, info.elem_type); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT("_array = __new_array(0, "), 0xfe10, {.d_s = res}}, {_SLIT(".len, sizeof("), 0xfe10, {.d_s = typ_str}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("for (; "), 0xfe10, {.d_s = idx}}, {_SLIT(" < "), 0xfe10, {.d_s = res}}, {_SLIT(".len; "), 0xfe10, {.d_s = idx}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), 0xfe10, {.d_s = typ_str}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0xfe10, {.d_s = typ_str}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_array = __new_array(0, "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".len, sizeof("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("for (; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(" < "), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".len; "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT("++) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); v__ast__Struct inf = v__ast__TypeSymbol_struct_info(v__ast__Table_sym(g->table, info.elem_type)); for (int i = 0; i < inf.fields.len; ++i) { v__ast__StructField field = ((v__ast__StructField*)inf.fields.data)[i]; @@ -80096,7 +80381,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp } v__gen__c__Gen_writeln(g, _SLIT("};")); } else { - v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = styp}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = ("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); v__ast__Struct info = v__ast__TypeSymbol_struct_info(v__ast__Table_sym(g->table, node.typ)); for (int i = 0; i < info.fields.len; ++i) { v__ast__StructField field = ((v__ast__StructField*)info.fields.data)[i]; @@ -80107,26 +80392,26 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp } v__gen__c__Gen_writeln(g, _SLIT("};")); } - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), 0xfe10, {.d_s = res}}, {_SLIT(".len > 0) {"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("if ("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(".len > 0) {"), 0, { .d_c = 0 }}}))); for (int i = 0; i < fields.len; ++i) { v__ast__StructField field = ((v__ast__StructField*)fields.data)[i]; - string sel = str_intp(4, _MOV((StrIntpData[]){{_SLIT("(*(orm__Primitive*) array_get((*(Array_orm__Primitive*) array_get("), 0xfe10, {.d_s = res}}, {_SLIT(", "), 0xfe10, {.d_s = idx}}, {_SLIT(")), "), 0xfe07, {.d_i32 = i}}, {_SLIT("))"), 0, { .d_c = 0 }}})); + string sel = str_intp(4, _MOV((StrIntpData[]){{_SLIT("(*(orm__Primitive*) array_get((*(Array_orm__Primitive*) array_get("), /*115 &string*/0xfe10, {.d_s = res}}, {_SLIT(", "), /*115 &string*/0xfe10, {.d_s = idx}}, {_SLIT(")), "), /*100 &int*/0xfe07, {.d_i32 = i}}, {_SLIT("))"), 0, { .d_c = 0 }}})); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); if (sym->kind == v__ast__Kind__struct_ && !string__eq(sym->name, _SLIT("time.Time"))) { v__ast__SqlExpr sub = (*(v__ast__SqlExpr*)map_get(ADDR(map, node.sub_structs), &(int[]){((int)(field.typ))}, &(v__ast__SqlExpr[]){ (v__ast__SqlExpr){.typ = 0,.is_count = 0,.has_where = 0,.has_order = 0,.has_limit = 0,.has_offset = 0,.has_desc = 0,.is_array = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.table_expr = (v__ast__TypeNode){.typ = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlExpr), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop),} })); - v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 309) /*expected idx: 309, name: v.ast.InfixExpr */ ; - v__ast__Ident ident = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ; + v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 310) /*expected idx: 310, name: v.ast.InfixExpr */ ; + v__ast__Ident ident = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ; string name = sel; int s = v__ast__Table_find_type_idx(g->table, _SLIT("orm.Primitive")); if (s != 0) { - if ((ident.info)._typ == 415 /* v.ast.IdentVar */) { + if ((ident.info)._typ == 416 /* v.ast.IdentVar */) { (*ident.info._v__ast__IdentVar).typ = s; } } ident.name = name; where_expr.right = v__ast__Ident_to_sumtype_v__ast__Expr(&ident); sub.where_expr = v__ast__InfixExpr_to_sumtype_v__ast__Expr(&where_expr); - v__gen__c__Gen_sql_select(g, sub, expr, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_sql_select(g, sub, expr, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else if (sym->kind == v__ast__Kind__array) { string fkey = _SLIT(""); for (int _t14 = 0; _t14 < field.attrs.len; ++_t14) { @@ -80142,9 +80427,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp v__ast__Array info = v__ast__TypeSymbol_array_info(sym); v__ast__Type arr_typ = info.elem_type; v__ast__SqlExpr sub = (*(v__ast__SqlExpr*)map_get(ADDR(map, node.sub_structs), &(int[]){((int)(arr_typ))}, &(v__ast__SqlExpr[]){ (v__ast__SqlExpr){.typ = 0,.is_count = 0,.has_where = 0,.has_order = 0,.has_limit = 0,.has_offset = 0,.has_desc = 0,.is_array = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.table_expr = (v__ast__TypeNode){.typ = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlExpr), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop),} })); - v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 309) /*expected idx: 309, name: v.ast.InfixExpr */ ; - v__ast__Ident l = /* as */ *(v__ast__Ident*)__as_cast((where_expr.left)._v__ast__Ident,(where_expr.left)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ; - v__ast__Ident r = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 305) /*expected idx: 305, name: v.ast.Ident */ ; + v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 310) /*expected idx: 310, name: v.ast.InfixExpr */ ; + v__ast__Ident l = /* as */ *(v__ast__Ident*)__as_cast((where_expr.left)._v__ast__Ident,(where_expr.left)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ; + v__ast__Ident r = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 306) /*expected idx: 306, name: v.ast.Ident */ ; l.name = fkey; r.name = tmp; where_expr.left = v__ast__Ident_to_sumtype_v__ast__Expr(&l); @@ -80155,7 +80440,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp .mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}, .next_token = 0, .expr = v__ast__Ident_to_sumtype_v__ast__Expr(&r), - .expr_type = (/* as */ *(v__ast__IdentVar*)__as_cast((r.info)._v__ast__IdentVar,(r.info)._typ, 415) /*expected idx: 415, name: v.ast.IdentVar */ ).typ, + .expr_type = (/* as */ *(v__ast__IdentVar*)__as_cast((r.info)._v__ast__IdentVar,(r.info)._typ, 416) /*expected idx: 416, name: v.ast.IdentVar */ ).typ, .typ = _const_v__ast__int_type, .name_type = 0, .gkind_field = 0, @@ -80181,18 +80466,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp .fields = sub.fields, .sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlExpr), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop), }); - v__gen__c__Gen_sql_select(g, arr, expr, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_sql_select(g, arr, expr, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); } else { string typ = sym->cname; - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = tmp}}, {_SLIT("."), 0xfe10, {.d_s = field.name}}, {_SLIT(" = *("), 0xfe10, {.d_s = sel}}, {_SLIT("._"), 0xfe10, {.d_s = typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT(" = *("), /*115 &string*/0xfe10, {.d_s = sel}}, {_SLIT("._"), /*115 &string*/0xfe10, {.d_s = typ}}, {_SLIT(");"), 0, { .d_c = 0 }}}))); } } v__gen__c__Gen_writeln(g, _SLIT("}")); if (node.is_array) { - v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("array_push(&"), 0xfe10, {.d_s = tmp}}, {_SLIT("_array, _MOV(("), 0xfe10, {.d_s = typ_str}}, {_SLIT("[]){ "), 0xfe10, {.d_s = tmp}}, {_SLIT(" }));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT("array_push(&"), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT("_array, _MOV(("), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("[]){ "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" }));"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_writeln(g, _SLIT("}")); } - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = left}}, {_SLIT(" "), 0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (node.is_array) { v__gen__c__Gen_write(g, _SLIT("_array")); } @@ -80203,13 +80488,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp } VV_LOCAL_SYMBOL v__gen__c__SqlType v__gen__c__Gen_parse_db_type(v__gen__c__Gen* g, v__ast__Expr expr) { - if (expr._typ == 305 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).info)._typ == 415 /* v.ast.IdentVar */) { + if (expr._typ == 306 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).info)._typ == 416 /* v.ast.IdentVar */) { v__gen__c__SqlType _t1 = v__gen__c__Gen_parse_db_from_type_string(g, v__ast__Table_get_type_name(g->table, (*(*expr._v__ast__Ident).info._v__ast__IdentVar).typ)); return _t1; } } - else if (expr._typ == 325 /* v.ast.SelectorExpr */) { + else if (expr._typ == 326 /* v.ast.SelectorExpr */) { v__gen__c__SqlType _t2 = v__gen__c__Gen_parse_db_from_type_string(g, v__ast__Table_get_type_name(g->table, (*expr._v__ast__SelectorExpr).typ)); return _t2; } @@ -80286,7 +80571,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_field_name(v__gen__c__Gen* g, v__ast__ } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); if (sym->kind == v__ast__Kind__struct_ && !string__eq(sym->name, _SLIT("time.Time"))) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT("_id"), 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("_id"), 0, { .d_c = 0 }}})); } string _t2 = name; return _t2; @@ -80295,14 +80580,14 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_get_field_name(v__gen__c__Gen* g, v__ast__ VV_LOCAL_SYMBOL void v__gen__c__Gen_string_literal(v__gen__c__Gen* g, v__ast__StringLiteral node) { string escaped_val = v__gen__c__cescape_nonascii(v__util__smart_quote(node.val, node.is_raw)); if (node.language == v__ast__Language__c) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = escaped_val}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = escaped_val}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), 0xfe10, {.d_s = escaped_val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("_SLIT(\""), /*115 &string*/0xfe10, {.d_s = escaped_val}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } } VV_LOCAL_SYMBOL void v__gen__c__Gen_string_inter_literal_sb_optimized(v__gen__c__Gen* g, v__ast__CallExpr call_expr) { - v__ast__StringInterLiteral node = /* as */ *(v__ast__StringInterLiteral*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(call_expr.args, 0)).expr)._v__ast__StringInterLiteral,((*(v__ast__CallArg*)/*ee elem_sym */array_get(call_expr.args, 0)).expr)._typ, 328) /*expected idx: 328, name: v.ast.StringInterLiteral */ ; + v__ast__StringInterLiteral node = /* as */ *(v__ast__StringInterLiteral*)__as_cast(((*(v__ast__CallArg*)/*ee elem_sym */array_get(call_expr.args, 0)).expr)._v__ast__StringInterLiteral,((*(v__ast__CallArg*)/*ee elem_sym */array_get(call_expr.args, 0)).expr)._typ, 329) /*expected idx: 329, name: v.ast.StringInterLiteral */ ; v__gen__c__Gen_writeln(g, _SLIT("// sb inter opt")); bool is_nl = string__eq(call_expr.name, _SLIT("writeln")); for (int i = 0; i < node.vals.len; ++i) { @@ -80343,7 +80628,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast typ = v__ast__Type_set_nr_muls(v__ast__Type_clear_flag(typ, v__ast__TypeFlag__shared_f), 0); } v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); - if ((sym->info)._typ == 470 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { + if ((sym->info)._typ == 471 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(g->table, (*sym->info._v__ast__Alias).parent_type); if (v__ast__TypeSymbol_has_method(parent_sym, _SLIT("str"))) { typ = (*sym->info._v__ast__Alias).parent_type; @@ -80355,7 +80640,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast bool str_method_expects_ptr = mr_2219.arg1; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type)) { @@ -80369,9 +80654,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast } else if (sym->kind == v__ast__Kind__none_) { v__gen__c__Gen_write(g, _SLIT("_SLIT(\"\")")); } else if (sym->kind == v__ast__Kind__enum_) { - if ((expr)._typ != 302 /* v.ast.EnumVal */) { + if ((expr)._typ != 303 /* v.ast.EnumVal */) { string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_enum_expr(g, expr); v__gen__c__Gen_write(g, _SLIT(")")); } else { @@ -80384,19 +80669,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast bool is_var_mut = v__ast__Expr_is_auto_deref_var(expr); string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); if (is_ptr && !is_var_mut) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\"&\"), "), 0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(" ,{.d_s="), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("str_intp(1, _MOV((StrIntpData[]){{_SLIT(\"&\"), "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__si_s_code}}, {_SLIT(" ,{.d_s="), 0, { .d_c = 0 }}}))); } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (str_method_expects_ptr && !is_ptr) { v__gen__c__Gen_write(g, _SLIT("&")); } else if ((!str_method_expects_ptr && is_ptr && !is_shared) || is_var_mut) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((expr)._typ == 285 /* v.ast.ArrayInit */) { + if ((expr)._typ == 286 /* v.ast.ArrayInit */) { if ((*expr._v__ast__ArrayInit).is_fixed) { string s = v__gen__c__Gen_typ(g, (*expr._v__ast__ArrayInit).typ); if (!(*expr._v__ast__ArrayInit).has_it) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); } } } @@ -80410,7 +80695,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast } } else { string str_fn_name = v__gen__c__Gen_get_str_fn(g, typ); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); if (v__ast__Expr_is_auto_deref_var(expr)) { v__gen__c__Gen_write(g, _SLIT("*")); } @@ -80427,11 +80712,12 @@ VV_LOCAL_SYMBOL multi_return_u64_string v__gen__c__Gen_str_format(v__gen__c__Gen v__ast__Type typ = v__gen__c__Gen_unwrap_generic(g, (*(v__ast__Type*)/*ee elem_sym */array_get(node.expr_types, i))); v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, typ); if (sym->kind == v__ast__Kind__alias) { - typ = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type; + typ = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; } bool remove_tail_zeros = false; u8 fspec = (*(u8*)/*ee elem_sym */array_get(node.fmts, i)); StrIntpType fmt_type = ((StrIntpType){0}); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("/*"), /*117 &u8*/0xfe02, {.d_u8 = fspec}}, {_SLIT(" "), /*115 &v.ast.TypeSymbol*/0xfe10, {.d_s = str_intp(1, _MOV((StrIntpData[]){{_SLIT("&"), 0xfe10 ,{.d_s=v__ast__TypeSymbol_str(sym)}}}))}}, {_SLIT("*/"), 0, { .d_c = 0 }}}))); if ((fspec - 'A') <= ('Z' - 'A')) { upper_case = true; } @@ -80547,25 +80833,25 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_str_val(v__gen__c__Gen* g, v__ast__StringInt } v__gen__c__Gen_expr(g, expr); } - } else if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ )), _SLIT("str"))) { + } else if (typ_sym->kind == v__ast__Kind__interface_ && v__ast__Interface_defines_method(ADDR(v__ast__Interface, (/* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ )), _SLIT("str"))) { string rec_type_name = v__util__no_dots(v__gen__c__Gen_cc_type(g, typ, false)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); string dot = (v__ast__Type_is_ptr(typ) ? (_SLIT("->")) : (_SLIT("."))); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_str("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_typ]._method_str("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, expr); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_object"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT(")")); } else if ((*(u8*)/*ee elem_sym */array_get(node.fmts, i)) == 's' || v__ast__Type_has_flag(typ, v__ast__TypeFlag__variadic)) { v__ast__Type exp_typ = typ; - if ((expr)._typ == 305 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((expr)._typ == 306 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { if (g->comptime_var_type_map.len > 0 || g->comptime_for_method.len > 0) { exp_typ = (*(*expr._v__ast__Ident).obj._v__ast__Var).typ; } else if ((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts.len > 0) { exp_typ = v__gen__c__Gen_unwrap_generic(g, (*(v__ast__Type*)array_last((*(*expr._v__ast__Ident).obj._v__ast__Var).smartcasts))); v__ast__TypeSymbol* cast_sym = v__ast__Table_sym(g->table, exp_typ); - if ((cast_sym->info)._typ == 468 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 469 /* v.ast.Aggregate */) { exp_typ = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } } @@ -80607,20 +80893,20 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_string_inter_literal(v__gen__c__Gen* g, v__a v__ast__StringInterLiteral node_ = node; for (int i = 0; i < node_.exprs.len; ++i) { v__ast__Expr* expr = ((v__ast__Expr*)node_.exprs.data) + i; - if ((expr)->_typ == 305 /* v.ast.Ident */) { - if (((*expr->_v__ast__Ident).obj)._typ == 363 /* v.ast.Var */) { + if ((expr)->_typ == 306 /* v.ast.Ident */) { + if (((*expr->_v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { (*(v__ast__Type*)/*ee elem_sym */array_get(node_.expr_types, i)) = (*(*expr->_v__ast__Ident).obj._v__ast__Var).typ; } } } } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" str_intp("), 0xfe07, {.d_i32 = node.vals.len}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(" str_intp("), /*100 &int*/0xfe07, {.d_i32 = node.vals.len}}, {_SLIT(", "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("_MOV((StrIntpData[]){")); for (int i = 0; i < node.vals.len; ++i) { string val = ((string*)node.vals.data)[i]; string escaped_val = v__util__smart_quote(val, false); if (escaped_val.len > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), 0xfe10, {.d_s = escaped_val}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("{_SLIT(\""), /*115 &string*/0xfe10, {.d_s = escaped_val}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_write(g, _SLIT("{_SLIT0, ")); } @@ -80628,10 +80914,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_string_inter_literal(v__gen__c__Gen* g, v__a v__gen__c__Gen_write(g, _SLIT("0, { .d_c = 0 }}")); break; } - multi_return_u64_string mr_5683 = v__gen__c__Gen_str_format(g, node, i); - u64 ft_u64 = mr_5683.arg0; - string ft_str = mr_5683.arg1; - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("0x"), 0xfe10, {.d_s = u64_hex(ft_u64)}}, {_SLIT(", {.d_"), 0xfe10, {.d_s = ft_str}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + multi_return_u64_string mr_5711 = v__gen__c__Gen_str_format(g, node, i); + u64 ft_u64 = mr_5711.arg0; + string ft_str = mr_5711.arg1; + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("0x"), /*115 &string*/0xfe10, {.d_s = u64_hex(ft_u64)}}, {_SLIT(", {.d_"), /*115 &string*/0xfe10, {.d_s = ft_str}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); if (ft_str.str[0] == 'p') { v__gen__c__Gen_write(g, _SLIT("(void*)(")); v__gen__c__Gen_str_val(g, node, i); @@ -80667,21 +80953,21 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; if (g->is_shared && !g->inside_opt_data && !g->is_arraymap_set) { v__ast__Type shared_typ = v__ast__Type_set_flag(node.typ, v__ast__TypeFlag__shared_f); shared_styp = v__gen__c__Gen_typ(g, shared_typ); - v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), 0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val =("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("*)__dup"), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("(&("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("){.mtx = {0}, .val =("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } else if (is_amp || g->inside_cast_in_heap > 0) { - v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("*)memdup(&("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)memdup(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } else if (v__ast__Type_is_ptr(node.typ)) { string basetyp = v__gen__c__Gen_typ(g, v__ast__Type_set_nr_muls(node.typ, 0)); if (is_multiline) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), 0xfe10, {.d_s = basetyp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), /*115 &string*/0xfe10, {.d_s = basetyp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), 0xfe10, {.d_s = basetyp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("&("), /*115 &string*/0xfe10, {.d_s = basetyp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } } else { if (is_multiline) { - v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } else { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), 0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("){"), 0, { .d_c = 0 }}}))); } } Map_string_int inited_fields = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); @@ -80698,7 +80984,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; map_set(&inited_fields, &(string[]){field.name}, &(int[]) { i }); if (sym->kind != v__ast__Kind__struct_) { string field_name = (sym->language == v__ast__Language__v ? (v__gen__c__c_name(field.name)) : (field.name)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); if (field.typ == 0) { v__gen__c__Gen_checker_bug(g, _SLIT("struct init, field.typ is 0"), field.pos); } @@ -80730,7 +81016,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; g->is_shared = old_is_shared; int nr_fields = 1; if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; nr_fields = info.fields.len; if (info.is_union && node.fields.len > 1) { v__gen__c__verror(_SLIT("union must not have more than 1 initializer")); @@ -80767,7 +81053,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, embed); string embed_name = v__ast__TypeSymbol_embed_name(embed_sym); if (!_IN_MAP(ADDR(string, embed_name), ADDR(map, inited_fields))) { - v__ast__Struct embed_info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct embed_info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; Array_string _t6 = {0}; Array_v__ast__StructField _t6_orig = embed_info.fields; int _t6_len = _t6_orig.len; @@ -80805,7 +81091,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; v__ast__StructInit default_init = ((v__ast__StructInit){node.pos,node.name_pos,node.is_short,node.is_short_syntax,node.unresolved,node.pre_comments,node.typ_str,.typ = embed,node.update_expr,node.update_expr_type,node.update_expr_comments,.is_update_embed = true,node.has_update_expr,.fields = init_fields_to_embed,node.embeds,node.generic_types,}); int inside_cast_in_heap = g->inside_cast_in_heap; g->inside_cast_in_heap = 0; - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = embed_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = embed_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_struct_init(g, default_init); g->inside_cast_in_heap = inside_cast_in_heap; if (is_multiline) { @@ -80823,7 +81109,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; if (!v__ast__Type_has_flag(field->typ, v__ast__TypeFlag__shared_f)) { g->is_shared = false; } - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { int found_equal_fields = 0; for (int _t14 = 0; _t14 < (*sym->info._v__ast__Struct).fields.len; ++_t14) { v__ast__StructField* sifield = ((v__ast__StructField*)(*sym->info._v__ast__Struct).fields.data) + _t14; @@ -80842,7 +81128,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; if (sfield.typ == 0) { continue; } - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); v__ast__TypeSymbol* field_type_sym = v__ast__Table_sym(g->table, sfield.typ); bool cloned = false; if (g->is_autofree && !v__ast__Type_is_ptr(sfield.typ) && (field_type_sym->kind == v__ast__Kind__array || field_type_sym->kind == v__ast__Kind__string)) { @@ -80852,12 +81138,12 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; } } if (!cloned) { - if (field_type_sym->kind == v__ast__Kind__array_fixed && (sfield.expr)._typ == 305 /* v.ast.Ident */) { - v__ast__ArrayFixed fixed_array_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((field_type_sym->info)._v__ast__ArrayFixed,(field_type_sym->info)._typ, 478) /*expected idx: 478, name: v.ast.ArrayFixed */ ; + if (field_type_sym->kind == v__ast__Kind__array_fixed && (sfield.expr)._typ == 306 /* v.ast.Ident */) { + v__ast__ArrayFixed fixed_array_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((field_type_sym->info)._v__ast__ArrayFixed,(field_type_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; v__gen__c__Gen_write(g, _SLIT("{")); for (int i = 0; i < fixed_array_info.size; ++i) { v__gen__c__Gen_expr(g, sfield.expr); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), 0xfe07, {.d_i32 = i}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("["), /*100 &int literal*/0xfe07, {.d_i32 = i}}, {_SLIT("]"), 0, { .d_c = 0 }}}))); if (i != fixed_array_info.size - 1) { v__gen__c__Gen_write(g, _SLIT(", ")); } @@ -80883,7 +81169,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; } if (v__ast__Type_has_flag(field->typ, v__ast__TypeFlag__optional)) { string field_name = v__gen__c__c_name(field->name); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = {EMPTY_STRUCT_INITIALIZATION},"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = {EMPTY_STRUCT_INITIALIZATION},"), 0, { .d_c = 0 }}}))); initialized = true; continue; } @@ -80948,9 +81234,9 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; } v__gen__c__Gen_write(g, _SLIT("}")); if (g->is_shared && !g->inside_opt_data && !g->is_arraymap_set) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), 0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("}, sizeof("), /*115 &string*/0xfe10, {.d_s = shared_styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } else if (is_amp || g->inside_cast_in_heap > 0) { - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), 0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT(", sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("))"), 0, { .d_c = 0 }}}))); } // Defer begin if (v__gen__c__Gen_struct_init_defer_0) { @@ -80962,14 +81248,14 @@ if (v__gen__c__Gen_struct_init_defer_0) { VV_LOCAL_SYMBOL bool v__gen__c__Gen_zero_struct_field(v__gen__c__Gen* g, v__ast__StructField field) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, field.typ); if (sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (info.fields.len == 0) { bool _t1 = false; return _t1; } } string field_name = (sym->language == v__ast__Language__v ? (v__gen__c__c_name(field.name)) : (field.name)); - v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); if (field.has_default_expr) { if (sym->kind == v__ast__Kind__sum_type || sym->kind == v__ast__Kind__interface_) { v__gen__c__Gen_expr_with_cast(g, field.default_expr, field.default_expr_typ, field.typ); @@ -80986,7 +81272,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_zero_struct_field(v__gen__c__Gen* g, v__ast_ VV_LOCAL_SYMBOL bool v__gen__c__Gen_is_empty_struct(v__gen__c__Gen* g, v__gen__c__Type t) { v__ast__TypeSymbol* sym = t.unaliased_sym; - if (sym->info._typ == 455 /* v.ast.Struct */) { + if (sym->info._typ == 456 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).fields.len > 0 || (*sym->info._v__ast__Struct).embeds.len > 0) { bool _t1 = false; return _t1; @@ -81030,7 +81316,7 @@ VV_LOCAL_SYMBOL v__gen__c__Type v__gen__c__Gen_unwrap(v__gen__c__Gen* g, v__ast_ Option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref) { if (!os__is_file(file_path)) { - return (Option_v__scanner__Scanner_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = file_path}}, {_SLIT(" is not a .v file"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_v__scanner__Scanner_ptr){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = file_path}}, {_SLIT(" is not a .v file"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_string _t2 = v__util__read_file(file_path); if (_t2.state != 0) { /*or block*/ @@ -81269,7 +81555,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_bin_number(v__scanner__Scanner* v__scanner__Scanner_error(s, _SLIT("number part of this binary is not provided")); } else if (has_wrong_digit) { s->pos = first_wrong_digit_pos; - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this binary number has unsuitable digit `"), 0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this binary number has unsuitable digit `"), /*115 &string*/0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } string number = v__scanner__Scanner_num_lit(s, start_pos, s->pos); s->pos--; @@ -81316,7 +81602,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_hex_number(v__scanner__Scanner* v__scanner__Scanner_error(s, _SLIT("number part of this hexadecimal is not provided")); } else if (has_wrong_digit) { s->pos = first_wrong_digit_pos; - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this hexadecimal number has unsuitable digit `"), 0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this hexadecimal number has unsuitable digit `"), /*115 &string*/0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } string number = v__scanner__Scanner_num_lit(s, start_pos, s->pos); s->pos--; @@ -81358,7 +81644,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_oct_number(v__scanner__Scanner* v__scanner__Scanner_error(s, _SLIT("number part of this octal is not provided")); } else if (has_wrong_digit) { s->pos = first_wrong_digit_pos; - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this octal number has unsuitable digit `"), 0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this octal number has unsuitable digit `"), /*115 &string*/0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } string number = v__scanner__Scanner_num_lit(s, start_pos, s->pos); s->pos--; @@ -81429,7 +81715,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_dec_number(v__scanner__Scanner* symbol_length++; } string float_symbol = string_substr(s->text, s->pos - 2 - symbol_length, s->pos - 1); - v__scanner__Scanner_warn(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("float literals should have a digit after the decimal point, e.g. `"), 0xfe10, {.d_s = float_symbol}}, {_SLIT(".0`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_warn(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("float literals should have a digit after the decimal point, e.g. `"), /*115 &string*/0xfe10, {.d_s = float_symbol}}, {_SLIT(".0`"), 0, { .d_c = 0 }}}))); } } } @@ -81461,7 +81747,7 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_dec_number(v__scanner__Scanner* if (has_wrong_digit) { s->pos = first_wrong_digit_pos; if (!s->pref->translated) { - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this number has unsuitable digit `"), 0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("this number has unsuitable digit `"), /*115 &string*/0xfe10, {.d_s = rune_str(first_wrong_digit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } } else if (s->text.str[ s->pos - 1] == 'e' || s->text.str[ s->pos - 1] == 'E') { s->pos--; @@ -81527,7 +81813,7 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_end_of_file(v__scanner__Scan s->eofs++; if (s->eofs > 50) { s->line_nr--; - _v_panic(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the end of file `"), 0xfe10, {.d_s = s->file_path}}, {_SLIT("` has been reached 50 times already, the v parser is probably stuck.\n"), 0, { .d_c = 0 }}})), _SLIT("This should not happen. Please report the bug here, and include the last 2-3 lines of your source code:\n")), _SLIT("https://github.com/vlang/v/issues/new?labels=Bug&template=bug_report.md"))); + _v_panic(string__plus(string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT("the end of file `"), /*115 &string*/0xfe10, {.d_s = s->file_path}}, {_SLIT("` has been reached 50 times already, the v parser is probably stuck.\n"), 0, { .d_c = 0 }}})), _SLIT("This should not happen. Please report the bug here, and include the last 2-3 lines of your source code:\n")), _SLIT("https://github.com/vlang/v/issues/new?labels=Bug&template=bug_report.md"))); VUNREACHABLE(); } if (s->pos != s->text.len && s->eofs == 1) { @@ -81673,7 +81959,7 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_text_scan(v__scanner__Scanne } } if (s->is_inter_start && next_char == '\\' && !(v__scanner__Scanner_look_ahead(s, 2) == 'x' || v__scanner__Scanner_look_ahead(s, 2) == 'n' || v__scanner__Scanner_look_ahead(s, 2) == 'r' || v__scanner__Scanner_look_ahead(s, 2) == '\\' || v__scanner__Scanner_look_ahead(s, 2) == 't' || v__scanner__Scanner_look_ahead(s, 2) == 'e' || v__scanner__Scanner_look_ahead(s, 2) == '"' || v__scanner__Scanner_look_ahead(s, 2) == '\'')) { - v__scanner__Scanner_warn(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown escape sequence \\"), 0xfe02, {.d_u8 = v__scanner__Scanner_look_ahead(s, 2)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__scanner__Scanner_warn(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown escape sequence \\"), /*117 &u8*/0xfe02, {.d_u8 = v__scanner__Scanner_look_ahead(s, 2)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (s->is_inter_start && next_char == '(') { if (v__scanner__Scanner_look_ahead(s, 2) != ')') { @@ -81893,7 +82179,7 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_text_scan(v__scanner__Scanne if (!v__token__is_key(name)) { string at_error_msg = _SLIT("@ must be used before keywords or compile time variables (e.g. `@type string` or `@FN`)"); if (string_is_upper(name)) { - at_error_msg = /*f*/string__plus(at_error_msg, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\nAvailable compile time variables:\n"), 0xfe10, {.d_s = Array_string_str(_const_v__token__valid_at_tokens)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + at_error_msg = /*f*/string__plus(at_error_msg, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\nAvailable compile time variables:\n"), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(_const_v__token__valid_at_tokens)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__scanner__Scanner_error(s, at_error_msg); } @@ -82067,7 +82353,7 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_text_scan(v__scanner__Scanne v__token__Token _t78 = v__scanner__Scanner_new_token(s, v__token__Kind__not_is, _SLIT(""), 3); return _t78; } else { - v__token__Token _t79 = v__scanner__Scanner_new_token(s, v__token__Kind__not, _SLIT(""), 1); + v__token__Token _t79 = v__scanner__Scanner_new_token(s, v__token__Kind__not, _SLIT("!"), 1); return _t79; } } @@ -82162,7 +82448,7 @@ VV_LOCAL_SYMBOL void v__scanner__Scanner_invalid_character(v__scanner__Scanner* int len = utf8_char_len(string_at(s->text, s->pos)); int end = v__mathutil__min_T_int(s->pos + len, s->text.len); string c = string_substr(s->text, s->pos, end); - v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid character `"), 0xfe10, {.d_s = c}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid character `"), /*115 &string*/0xfe10, {.d_s = c}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } VV_LOCAL_SYMBOL int v__scanner__Scanner_current_column(v__scanner__Scanner* s) { @@ -82443,10 +82729,10 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_char(v__scanner__Scanner* s) { Array_rune u = string_runes(c); if (u.len != 1) { if (escaped_hex || escaped_unicode) { - v__scanner__Scanner_error(s, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid character literal `"), 0xfe10, {.d_s = orig}}, {_SLIT("` => `"), 0xfe10, {.d_s = c}}, {_SLIT("` ("), 0xfe10, {.d_s = Array_rune_str(u)}}, {_SLIT(") (escape sequence did not refer to a singular rune)"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid character literal `"), /*115 &string*/0xfe10, {.d_s = orig}}, {_SLIT("` => `"), /*115 &string*/0xfe10, {.d_s = c}}, {_SLIT("` ("), /*115 &[]rune*/0xfe10, {.d_s = Array_rune_str(u)}}, {_SLIT(") (escape sequence did not refer to a singular rune)"), 0, { .d_c = 0 }}}))); } else { v__scanner__Scanner_add_error_detail_with_pos(s, _SLIT("use quotes for strings, backticks for characters"), lspos); - v__scanner__Scanner_error(s, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid character literal `"), 0xfe10, {.d_s = orig}}, {_SLIT("` => `"), 0xfe10, {.d_s = c}}, {_SLIT("` ("), 0xfe10, {.d_s = Array_rune_str(u)}}, {_SLIT(") (more than one character)"), 0, { .d_c = 0 }}}))); + v__scanner__Scanner_error(s, str_intp(4, _MOV((StrIntpData[]){{_SLIT("invalid character literal `"), /*115 &string*/0xfe10, {.d_s = orig}}, {_SLIT("` => `"), /*115 &string*/0xfe10, {.d_s = c}}, {_SLIT("` ("), /*115 &[]rune*/0xfe10, {.d_s = Array_rune_str(u)}}, {_SLIT(") (more than one character)"), 0, { .d_c = 0 }}}))); } } } @@ -82590,7 +82876,7 @@ VV_LOCAL_SYMBOL void v__scanner__Scanner_vet_error(v__scanner__Scanner* s, strin VV_LOCAL_SYMBOL void v__scanner__Scanner_trace(v__scanner__Scanner* s, string fbase, string message) { if (string__eq(s->file_base, fbase)) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> s.trace | "), 0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), 0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> s.trace | "), /*115 &string*/0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -82641,7 +82927,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; p->expr_level++; v__parser__Parser_check_undefined_variables_defer_0 = true; if (p->expr_level > _const_v__parser__max_expr_level) { - Option_void _t1 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("expr level > "), 0xfe07, {.d_i32 = _const_v__parser__max_expr_level}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + Option_void _t1 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("expr level > "), /*100 &int literal*/0xfe07, {.d_i32 = _const_v__parser__max_expr_level}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; @@ -82649,13 +82935,13 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; // Defer end return _t1; } - if (val._typ == 305 /* v.ast.Ident */) { + if (val._typ == 306 /* v.ast.Ident */) { for (int _t2 = 0; _t2 < exprs.len; ++_t2) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t2]; - if ((expr)._typ == 305 /* v.ast.Ident */) { + if ((expr)._typ == 306 /* v.ast.Ident */) { if (string__eq((*expr._v__ast__Ident).name, (*val._v__ast__Ident).name) && (*expr._v__ast__Ident).kind != v__ast__IdentKind__blank_ident) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable: `"), 0xfe10, {.d_s = (*val._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*val._v__ast__Ident).pos); - Option_void _t3 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable: `"), 0xfe10, {.d_s = (*val._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable: `"), /*115 &string*/0xfe10, {.d_s = (*val._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*val._v__ast__Ident).pos); + Option_void _t3 = (Option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined variable: `"), /*115 &string*/0xfe10, {.d_s = (*val._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; @@ -82666,7 +82952,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 285 /* v.ast.ArrayInit */) { + else if (val._typ == 286 /* v.ast.ArrayInit */) { if ((*val._v__ast__ArrayInit).has_cap) { Option_void _t4 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).cap_expr); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { @@ -82729,7 +83015,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 291 /* v.ast.CallExpr */) { + else if (val._typ == 292 /* v.ast.CallExpr */) { Option_void _t13 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__CallExpr).left); if (_t13.state != 0 && _t13.err._typ != _IError_None___index) { // Defer begin @@ -82760,7 +83046,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 309 /* v.ast.InfixExpr */) { + else if (val._typ == 310 /* v.ast.InfixExpr */) { Option_void _t18 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__InfixExpr).left); if (_t18.state != 0 && _t18.err._typ != _IError_None___index) { // Defer begin @@ -82788,7 +83074,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } - else if (val._typ == 306 /* v.ast.IfExpr */) { + else if (val._typ == 307 /* v.ast.IfExpr */) { Option_void _t22 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__IfExpr).left); if (_t22.state != 0 && _t22.err._typ != _IError_None___index) { // Defer begin @@ -82819,7 +83105,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; for (int _t27 = 0; _t27 < branch.stmts.len; ++_t27) { v__ast__Stmt stmt = ((v__ast__Stmt*)branch.stmts.data)[_t27]; - if ((stmt)._typ == 345 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { Option_void _t28 = v__parser__Parser_check_undefined_variables(p, exprs, (*stmt._v__ast__ExprStmt).expr); if (_t28.state != 0 && _t28.err._typ != _IError_None___index) { // Defer begin @@ -82837,7 +83123,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 314 /* v.ast.MapInit */) { + else if (val._typ == 315 /* v.ast.MapInit */) { for (int _t30 = 0; _t30 < (*val._v__ast__MapInit).keys.len; ++_t30) { v__ast__Expr key = ((v__ast__Expr*)(*val._v__ast__MapInit).keys.data)[_t30]; Option_void _t31 = v__parser__Parser_check_undefined_variables(p, exprs, key); @@ -82871,7 +83157,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 315 /* v.ast.MatchExpr */) { + else if (val._typ == 316 /* v.ast.MatchExpr */) { Option_void _t36 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__MatchExpr).cond); if (_t36.state != 0 && _t36.err._typ != _IError_None___index) { // Defer begin @@ -82905,7 +83191,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } for (int _t42 = 0; _t42 < branch.stmts.len; ++_t42) { v__ast__Stmt stmt = ((v__ast__Stmt*)branch.stmts.data)[_t42]; - if ((stmt)._typ == 345 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { Option_void _t43 = v__parser__Parser_check_undefined_variables(p, exprs, (*stmt._v__ast__ExprStmt).expr); if (_t43.state != 0 && _t43.err._typ != _IError_None___index) { // Defer begin @@ -82923,7 +83209,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 320 /* v.ast.ParExpr */) { + else if (val._typ == 321 /* v.ast.ParExpr */) { Option_void _t45 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ParExpr).expr); if (_t45.state != 0 && _t45.err._typ != _IError_None___index) { // Defer begin @@ -82938,7 +83224,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } - else if (val._typ == 321 /* v.ast.PostfixExpr */) { + else if (val._typ == 322 /* v.ast.PostfixExpr */) { Option_void _t47 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__PostfixExpr).expr); if (_t47.state != 0 && _t47.err._typ != _IError_None___index) { // Defer begin @@ -82953,7 +83239,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } - else if (val._typ == 322 /* v.ast.PrefixExpr */) { + else if (val._typ == 323 /* v.ast.PrefixExpr */) { Option_void _t49 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__PrefixExpr).right); if (_t49.state != 0 && _t49.err._typ != _IError_None___index) { // Defer begin @@ -82968,7 +83254,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } - else if (val._typ == 328 /* v.ast.StringInterLiteral */) { + else if (val._typ == 329 /* v.ast.StringInterLiteral */) { for (int _t51 = 0; _t51 < (*val._v__ast__StringInterLiteral).exprs.len; ++_t51) { v__ast__Expr expr_ = ((v__ast__Expr*)(*val._v__ast__StringInterLiteral).exprs.data)[_t51]; Option_void _t52 = v__parser__Parser_check_undefined_variables(p, exprs, expr_); @@ -82986,7 +83272,7 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 330 /* v.ast.StructInit */) { + else if (val._typ == 331 /* v.ast.StructInit */) { for (int _t54 = 0; _t54 < (*val._v__ast__StructInit).fields.len; ++_t54) { v__ast__StructInitField field = ((v__ast__StructInitField*)(*val._v__ast__StructInit).fields.data)[_t54]; Option_void _t55 = v__parser__Parser_check_undefined_variables(p, exprs, field.expr); @@ -83018,10 +83304,10 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val) { string val_str = v__ast__Expr_str(val); - if (val._typ == 305 /* v.ast.Ident */) { + if (val._typ == 306 /* v.ast.Ident */) { for (int _t1 = 0; _t1 < exprs.len; ++_t1) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t1]; - if ((expr)._typ == 305 /* v.ast.Ident */) { + if ((expr)._typ == 306 /* v.ast.Ident */) { if (string__eq((*expr._v__ast__Ident).name, (*val._v__ast__Ident).name)) { bool _t2 = true; return _t2; @@ -83029,7 +83315,7 @@ VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* } } } - else if (val._typ == 308 /* v.ast.IndexExpr */) { + else if (val._typ == 309 /* v.ast.IndexExpr */) { for (int _t3 = 0; _t3 < exprs.len; ++_t3) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t3]; if (string__eq(v__ast__Expr_str(expr), val_str)) { @@ -83038,19 +83324,19 @@ VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* } } } - else if (val._typ == 309 /* v.ast.InfixExpr */) { + else if (val._typ == 310 /* v.ast.InfixExpr */) { bool _t5 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__InfixExpr).left) || v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__InfixExpr).right); return _t5; } - else if (val._typ == 322 /* v.ast.PrefixExpr */) { + else if (val._typ == 323 /* v.ast.PrefixExpr */) { bool _t6 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__PrefixExpr).right); return _t6; } - else if (val._typ == 321 /* v.ast.PostfixExpr */) { + else if (val._typ == 322 /* v.ast.PostfixExpr */) { bool _t7 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__PostfixExpr).expr); return _t7; } - else if (val._typ == 325 /* v.ast.SelectorExpr */) { + else if (val._typ == 326 /* v.ast.SelectorExpr */) { for (int _t8 = 0; _t8 < exprs.len; ++_t8) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t8]; if (string__eq(v__ast__Expr_str(expr), val_str)) { @@ -83088,14 +83374,14 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa for (int i = 0; i < left.len; ++i) { v__ast__Expr lx_ = ((v__ast__Expr*)left.data)[i]; v__ast__Expr lx = lx_; - if (lx._typ == 305 /* v.ast.Ident */) { + if (lx._typ == 306 /* v.ast.Ident */) { if (op == v__token__Kind__decl_assign) { if (v__ast__Scope_known_var(p->scope, (*lx._v__ast__Ident).name)) { - v__ast__Stmt _t4 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of `"), 0xfe10, {.d_s = (*lx._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*lx._v__ast__Ident).pos)))); + v__ast__Stmt _t4 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of `"), /*115 &string*/0xfe10, {.d_s = (*lx._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*lx._v__ast__Ident).pos)))); return _t4; } v__ast__ShareType share = ((v__ast__ShareType)(0)); - if (((*lx._v__ast__Ident).info)._typ == 415 /* v.ast.IdentVar */) { + if (((*lx._v__ast__Ident).info)._typ == 416 /* v.ast.IdentVar */) { share = (*(*lx._v__ast__Ident).info._v__ast__IdentVar).share; if ((*(*lx._v__ast__Ident).info._v__ast__IdentVar).is_static) { if (!p->pref->translated && !p->is_translated && !p->pref->is_fmt && !p->inside_unsafe_fn) { @@ -83130,7 +83416,7 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa .is_stack_obj = p->inside_for, }); if (p->pref->autofree) { - if ((r0)._typ == 291 /* v.ast.CallExpr */) { + if ((r0)._typ == 292 /* v.ast.CallExpr */) { if ((*r0._v__ast__CallExpr).or_block.pos.pos > 0 && (*r0._v__ast__CallExpr).or_block.stmts.len > 0) { v.is_or = true; } @@ -83141,18 +83427,18 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa v__ast__Scope_register(p->scope, obj); } } - else if (lx._typ == 308 /* v.ast.IndexExpr */) { + else if (lx._typ == 309 /* v.ast.IndexExpr */) { if (op == v__token__Kind__decl_assign) { - v__ast__Stmt _t6 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("non-name `"), 0xfe10, {.d_s = v__ast__Expr_str((*lx._v__ast__IndexExpr).left)}}, {_SLIT("["), 0xfe10, {.d_s = v__ast__Expr_str((*lx._v__ast__IndexExpr).index)}}, {_SLIT("]` on left side of `:=`"), 0, { .d_c = 0 }}})), (*lx._v__ast__IndexExpr).pos)))); + v__ast__Stmt _t6 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("non-name `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*lx._v__ast__IndexExpr).left)}}, {_SLIT("["), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*lx._v__ast__IndexExpr).index)}}, {_SLIT("]` on left side of `:=`"), 0, { .d_c = 0 }}})), (*lx._v__ast__IndexExpr).pos)))); return _t6; } (*lx._v__ast__IndexExpr).is_setter = true; } - else if (lx._typ == 320 /* v.ast.ParExpr */) { + else if (lx._typ == 321 /* v.ast.ParExpr */) { } - else if (lx._typ == 322 /* v.ast.PrefixExpr */) { + else if (lx._typ == 323 /* v.ast.PrefixExpr */) { } - else if (lx._typ == 325 /* v.ast.SelectorExpr */) { + else if (lx._typ == 326 /* v.ast.SelectorExpr */) { if (op == v__token__Kind__decl_assign) { v__ast__Stmt _t7 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("struct fields can only be declared during the initialization"), (*lx._v__ast__SelectorExpr).pos)))); return _t7; @@ -83180,7 +83466,7 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa v__ast__Expr r = ((v__ast__Expr*)right.data)[_t11]; has_cross_var = v__parser__Parser_check_cross_variables(p, left, r); if (!(op == v__token__Kind__assign || op == v__token__Kind__decl_assign)) { - v__ast__Stmt _t12 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Kind_str(op)}}, {_SLIT(", expecting := or = or comma"), 0, { .d_c = 0 }}})), pos)))); + v__ast__Stmt _t12 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(op)}}, {_SLIT(", expecting := or = or comma"), 0, { .d_c = 0 }}})), pos)))); return _t12; } if (has_cross_var) { @@ -83211,7 +83497,7 @@ v__ast__ComptimeType v__parser__Parser_parse_comptime_type(v__parser__Parser* p) v__parser__Parser_check(p, v__token__Kind__dollar); string name = v__parser__Parser_check_name(p); if (!Array_string_contains(_const_v__parser__comptime_types, name)) { - v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unsupported compile-time type `"), 0xfe10, {.d_s = name}}, {_SLIT("`: only "), 0xfe10, {.d_s = Array_string_str(_const_v__parser__comptime_types)}}, {_SLIT(" are supported"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unsupported compile-time type `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`: only "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(_const_v__parser__comptime_types)}}, {_SLIT(" are supported"), 0, { .d_c = 0 }}}))); } v__ast__ComptimeTypeKind cty = v__ast__ComptimeTypeKind__map_; @@ -83253,7 +83539,7 @@ VV_LOCAL_SYMBOL v__ast__HashStmt v__parser__Parser_hash(v__parser__Parser* p) { v__parser__Parser_next(p); string main_str = _SLIT(""); string msg = _SLIT(""); - string content = string_all_before(string_all_after(val, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = kind}}, {_SLIT(" "), 0, { .d_c = 0 }}}))), _SLIT("//")); + string content = string_all_before(string_all_after(val, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = kind}}, {_SLIT(" "), 0, { .d_c = 0 }}}))), _SLIT("//")); if (string_contains(content, _SLIT(" #"))) { main_str = string_trim_space(string_all_before(content, _SLIT(" #"))); msg = string_trim_space(string_all_after(content, _SLIT(" #"))); @@ -83376,12 +83662,12 @@ VV_LOCAL_SYMBOL v__ast__ComptimeCall v__parser__Parser_comptime_call(v__parser__ if (!os__exists(abs_path)) { epath = os__real_path(os__join_path_single(os__dir(p->file_name), epath)); if (!os__exists(epath)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = epath}}, {_SLIT("\" does not exist so it cannot be embedded"), 0, { .d_c = 0 }}})), spos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = epath}}, {_SLIT("\" does not exist so it cannot be embedded"), 0, { .d_c = 0 }}})), spos); v__ast__ComptimeCall _t6 = (*(err_node)); return _t6; } if (!os__is_file(epath)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = epath}}, {_SLIT("\" is not a file so it cannot be embedded"), 0, { .d_c = 0 }}})), spos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = epath}}, {_SLIT("\" is not a file so it cannot be embedded"), 0, { .d_c = 0 }}})), spos); v__ast__ComptimeCall _t7 = (*(err_node)); return _t7; } @@ -83399,7 +83685,7 @@ VV_LOCAL_SYMBOL v__ast__ComptimeCall v__parser__Parser_comptime_call(v__parser__ Array_string fn_path = string_split(p->cur_fn_name, _SLIT("_")); string fn_path_joined = Array_string_join(fn_path, _const_os__path_separator); string compiled_vfile_path = os__real_path(string_replace(p->scanner->file_path, _SLIT("/"), _const_os__path_separator)); - string tmpl_path = (is_html ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = (*(string*)array_last(fn_path))}}, {_SLIT(".html"), 0, { .d_c = 0 }}}))) : (path_of_literal_string_param)); + string tmpl_path = (is_html ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = (*(string*)array_last(fn_path))}}, {_SLIT(".html"), 0, { .d_c = 0 }}}))) : (path_of_literal_string_param)); string dir = os__dir(compiled_vfile_path); string path = os__join_path_single(dir, fn_path_joined); path = /*f*/string__plus(path, _SLIT(".html")); @@ -83422,9 +83708,9 @@ VV_LOCAL_SYMBOL v__ast__ComptimeCall v__parser__Parser_comptime_call(v__parser__ return _t9; } if (is_html) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("vweb HTML template \""), 0xfe10, {.d_s = path}}, {_SLIT("\" not found"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("vweb HTML template \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\" not found"), 0, { .d_c = 0 }}}))); } else { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("template file \""), 0xfe10, {.d_s = path}}, {_SLIT("\" not found"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("template file \""), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT("\" not found"), 0, { .d_c = 0 }}}))); } v__ast__ComptimeCall _t10 = (*(err_node)); return _t10; @@ -83480,7 +83766,7 @@ VV_LOCAL_SYMBOL v__ast__ComptimeFor v__parser__Parser_comptime_for(v__parser__Pa v__ast__Scope_register(p->scope, v__ast__Var_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__Var, (((v__ast__Var){.name = val_var,.share = 0,.is_mut = 0,.is_autofree_tmp = 0,.is_arg = 0,.is_auto_deref = 0,.is_inherited = 0,.expr = {0},.typ = v__ast__Table_find_type_idx(p->table, _SLIT("StructAttribute")),.orig_type = 0,.smartcasts = __new_array(0, 0, sizeof(v__ast__Type)),.pos = var_pos,.is_used = 0,.is_changed = 0,.is_or = 0,.is_tmp = 0,.is_auto_heap = 0,.is_stack_obj = 0,}))))); kind = v__ast__ComptimeForKind__attributes; } else { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown kind `"), 0xfe10, {.d_s = for_val}}, {_SLIT("`, available are: `methods`, `fields` or `attributes`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown kind `"), /*115 &string*/0xfe10, {.d_s = for_val}}, {_SLIT("`, available are: `methods`, `fields` or `attributes`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); v__ast__ComptimeFor _t1 = ((v__ast__ComptimeFor){.val_var = (string){.str=(byteptr)"", .is_lit=1},.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ = 0,}); return _t1; } @@ -83618,7 +83904,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser v__token__Pos pos = v__token__Token_pos(&p->tok); string n = v__parser__Parser_check_name(p); if (!string__eq(n, _SLIT("init"))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `init:`, not `"), 0xfe10, {.d_s = n}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `init:`, not `"), /*115 &string*/0xfe10, {.d_s = n}}, {_SLIT("`"), 0, { .d_c = 0 }}})), pos); v__ast__ArrayInit _t4 = ((v__ast__ArrayInit){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.elem_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.ecmnts = __new_array(0, 0, sizeof(Array_v__ast__Comment)),.pre_cmnts = __new_array(0, 0, sizeof(v__ast__Comment)),.is_fixed = 0,.has_val = 0,.mod = (string){.str=(byteptr)"", .is_lit=1},.has_len = 0,.has_cap = 0,.has_default = 0,.has_it = 0,.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.len_expr = {0},.cap_expr = {0},.default_expr = {0},.expr_types = __new_array(0, 0, sizeof(v__ast__Type)),.elem_type = 0,.default_type = 0,.typ = 0,}); return _t4; } @@ -83706,7 +83992,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser v__parser__Parser_close_scope(p); } else { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrong field `"), 0xfe10, {.d_s = key}}, {_SLIT("`, expecting `len`, `cap`, or `init`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrong field `"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("`, expecting `len`, `cap`, or `init`"), 0, { .d_c = 0 }}}))); v__ast__ArrayInit _t9 = ((v__ast__ArrayInit){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.elem_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.ecmnts = __new_array(0, 0, sizeof(Array_v__ast__Comment)),.pre_cmnts = __new_array(0, 0, sizeof(v__ast__Comment)),.is_fixed = 0,.has_val = 0,.mod = (string){.str=(byteptr)"", .is_lit=1},.has_len = 0,.has_cap = 0,.has_default = 0,.has_it = 0,.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.len_expr = {0},.cap_expr = {0},.default_expr = {0},.expr_types = __new_array(0, 0, sizeof(v__ast__Type)),.elem_type = 0,.default_type = 0,.typ = 0,}); return _t9; }; @@ -83771,7 +84057,7 @@ v__ast__Expr v__parser__Parser_expr(v__parser__Parser* p, int precedence) { Option_v__ast__Expr _t2 = v__parser__Parser_check_expr(p, precedence); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - *(v__ast__Expr*) _t2.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + *(v__ast__Expr*) _t2.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); } v__ast__Expr _t1 = (*(v__ast__Expr*)_t2.data); @@ -84085,7 +84371,7 @@ bool inside_array_lit; v__parser__Parser_check(p, v__token__Kind__comma); if (p->tok.kind != v__token__Kind__name) { Option_v__ast__Expr _t9; - opt_ok(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`, expecting struct field"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))) }, (Option*)(&_t9), sizeof(v__ast__Expr)); + opt_ok(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`, expecting struct field"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))) }, (Option*)(&_t9), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84286,7 +84572,7 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr node = v__ast__IndexExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__IndexExpr, (v__parser__Parser_index_expr(p, node, false)))); } p->is_stmt_ident = is_stmt_ident; - if (p->tok.kind == v__token__Kind__lpar && p->tok.line_nr == p->prev_tok.line_nr && (node)._typ == 308 /* v.ast.IndexExpr */) { + if (p->tok.kind == v__token__Kind__lpar && p->tok.line_nr == p->prev_tok.line_nr && (node)._typ == 309 /* v.ast.IndexExpr */) { v__parser__Parser_next(p); v__token__Pos pos = v__token__Token_pos(&p->tok); Array_v__ast__CallArg args = v__parser__Parser_call_args(p); @@ -84310,7 +84596,7 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr v__parser__Parser_next(p); v__ast__Expr right = v__parser__Parser_expr(p, precedence - 1); v__token__Pos_update_last_line(&pos, p->prev_tok.line_nr); - if ((node)._typ == 308 /* v.ast.IndexExpr */) { + if ((node)._typ == 309 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*node._v__ast__IndexExpr)); } node = v__ast__InfixExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__InfixExpr, (((v__ast__InfixExpr){.op = tok.kind,.pos = pos,.is_stmt = true,.left = node,.right = right,.left_type = 0,.right_type = 0,.auto_locked = (string){.str=(byteptr)"", .is_lit=1},.or_block = (v__ast__OrExpr){.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.ct_left_value_evaled = 0,.ct_left_value = v__ast__empty_comptime_const_expr(),.ct_right_value_evaled = 0,.ct_right_value = v__ast__empty_comptime_const_expr(),})))); @@ -84320,7 +84606,7 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr v__ast__Expr _t4 = node; return _t4; } - v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("move infix `"), 0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` operator before new line (if infix intended) or use brackets for a prefix expression"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("move infix `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` operator before new line (if infix intended) or use brackets for a prefix expression"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } node = v__parser__Parser_infix_expr(p, node); if (p->tok.kind == v__token__Kind__key_as && p->inside_if) { @@ -84330,13 +84616,13 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr } else if ((p->tok.kind == v__token__Kind__inc || p->tok.kind == v__token__Kind__dec) || (p->tok.kind == v__token__Kind__question && p->inside_ct_if_expr)) { if (p->peek_tok.kind == v__token__Kind__rpar || p->peek_tok.kind == v__token__Kind__rsbr) { if (!p->inside_ct_if_expr) { - v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` operator can only be used as a statement"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->peek_tok)); + v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` operator can only be used as a statement"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->peek_tok)); } } if ((p->tok.kind == v__token__Kind__inc || p->tok.kind == v__token__Kind__dec) && p->prev_tok.line_nr != p->tok.line_nr) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" must be on the same line as the previous token"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" must be on the same line as the previous token"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } - if ((node)._typ == 308 /* v.ast.IndexExpr */) { + if ((node)._typ == 309 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_mapset_is_setter(&(*node._v__ast__IndexExpr), true); } node = v__ast__PostfixExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__PostfixExpr, (((v__ast__PostfixExpr){.op = p->tok.kind,.pos = v__token__Token_pos(&p->tok),.expr = node,.auto_locked = (string){.str=(byteptr)"", .is_lit=1},})))); @@ -84376,7 +84662,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_infix_expr(v__parser__Parser* p, p->inside_in_array = false; } p->expecting_type = prev_expecting_type; - if (p->pref->is_vet && (op == v__token__Kind__key_in || op == v__token__Kind__not_in) && (right)._typ == 285 /* v.ast.ArrayInit */ && (/* as */ *(v__ast__ArrayInit*)__as_cast((right)._v__ast__ArrayInit,(right)._typ, 285) /*expected idx: 285, name: v.ast.ArrayInit */ ).exprs.len == 1) { + if (p->pref->is_vet && (op == v__token__Kind__key_in || op == v__token__Kind__not_in) && (right)._typ == 286 /* v.ast.ArrayInit */ && (/* as */ *(v__ast__ArrayInit*)__as_cast((right)._v__ast__ArrayInit,(right)._typ, 286) /*expected idx: 286, name: v.ast.ArrayInit */ ).exprs.len == 1) { v__parser__Parser_vet_error(p, _SLIT("Use `var == value` instead of `var in [value]`"), pos.line_nr, v__vet__FixKind__vfmt, v__vet__ErrorType__default); } Array_v__ast__Stmt or_stmts = __new_array_with_default(0, 0, sizeof(v__ast__Stmt), 0); @@ -84397,7 +84683,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_infix_expr(v__parser__Parser* p, } if (p->tok.kind == v__token__Kind__question) { v__parser__Parser_next(p); - or_kind = v__ast__OrKind__propagate; + or_kind = v__ast__OrKind__propagate_option; } p->or_is_handled = false; } @@ -84439,28 +84725,28 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_prefix_expr(v__parser__Parser* p) v__ast__Expr right = v__parser__Parser_expr(p, ((int)(v__token__Precedence__prefix))); p->is_amp = false; if (op == v__token__Kind__amp) { - if ((right)._typ == 292 /* v.ast.CastExpr */) { + if ((right)._typ == 293 /* v.ast.CastExpr */) { v__parser__Parser_recast_as_pointer(p, (voidptr)&/*qq*/(*right._v__ast__CastExpr), pos); v__ast__Expr _t1 = v__ast__CastExpr_to_sumtype_v__ast__Expr(&(*right._v__ast__CastExpr)); return _t1; } - if ((right)._typ == 325 /* v.ast.SelectorExpr */) { - if (((*right._v__ast__SelectorExpr).expr)._typ == 292 /* v.ast.CastExpr */) { + if ((right)._typ == 326 /* v.ast.SelectorExpr */) { + if (((*right._v__ast__SelectorExpr).expr)._typ == 293 /* v.ast.CastExpr */) { v__parser__Parser_recast_as_pointer(p, (voidptr)&/*qq*/(*(*right._v__ast__SelectorExpr).expr._v__ast__CastExpr), pos); v__ast__Expr _t2 = v__ast__SelectorExpr_to_sumtype_v__ast__Expr(&(*right._v__ast__SelectorExpr)); return _t2; } } - if ((right)._typ == 308 /* v.ast.IndexExpr */) { - if (((*right._v__ast__IndexExpr).left)._typ == 292 /* v.ast.CastExpr */) { + if ((right)._typ == 309 /* v.ast.IndexExpr */) { + if (((*right._v__ast__IndexExpr).left)._typ == 293 /* v.ast.CastExpr */) { v__parser__Parser_recast_as_pointer(p, (voidptr)&/*qq*/(*(*right._v__ast__IndexExpr).left._v__ast__CastExpr), pos); v__ast__Expr _t3 = v__ast__IndexExpr_to_sumtype_v__ast__Expr(&(*right._v__ast__IndexExpr)); return _t3; } } - if ((right)._typ == 320 /* v.ast.ParExpr */) { - if (((*right._v__ast__ParExpr).expr)._typ == 330 /* v.ast.StructInit */) { - v__parser__Parser_note_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unnecessary `()`, use `&"), 0xfe10, {.d_s = v__ast__Expr_str((*right._v__ast__ParExpr).expr)}}, {_SLIT("` instead of `&("), 0xfe10, {.d_s = v__ast__Expr_str((*right._v__ast__ParExpr).expr)}}, {_SLIT(")`"), 0, { .d_c = 0 }}})), (*right._v__ast__ParExpr).pos); + if ((right)._typ == 321 /* v.ast.ParExpr */) { + if (((*right._v__ast__ParExpr).expr)._typ == 331 /* v.ast.StructInit */) { + v__parser__Parser_note_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unnecessary `()`, use `&"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*right._v__ast__ParExpr).expr)}}, {_SLIT("` instead of `&("), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str((*right._v__ast__ParExpr).expr)}}, {_SLIT(")`"), 0, { .d_c = 0 }}})), (*right._v__ast__ParExpr).pos); right = (*right._v__ast__ParExpr).expr; } } @@ -84483,7 +84769,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_prefix_expr(v__parser__Parser* p) } if (p->tok.kind == v__token__Kind__question) { v__parser__Parser_next(p); - or_kind = v__ast__OrKind__propagate; + or_kind = v__ast__OrKind__propagate_option; } p->or_is_handled = false; } @@ -84502,7 +84788,7 @@ v__ast__CallExpr v__parser__Parser_call_expr(v__parser__Parser* p, v__ast__Langu bool v__parser__Parser_call_expr_defer_0 = false; string old_expr_mod; v__token__Pos first_pos = v__token__Token_pos(&p->tok); - string fn_name = (language == v__ast__Language__c ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), 0xfe10, {.d_s = v__parser__Parser_check_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : language == v__ast__Language__js ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), 0xfe10, {.d_s = v__parser__Parser_check_js_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : mod.len > 0 ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod}}, {_SLIT("."), 0xfe10, {.d_s = v__parser__Parser_check_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (v__parser__Parser_check_name(p))); + string fn_name = (language == v__ast__Language__c ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_check_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : language == v__ast__Language__js ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_check_js_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : mod.len > 0 ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = v__parser__Parser_check_name(p)}}, {_SLIT0, 0, { .d_c = 0 }}}))) : (v__parser__Parser_check_name(p))); if (language != v__ast__Language__v) { v__parser__Parser_check_for_impure_v(p, language, first_pos); } @@ -84525,9 +84811,6 @@ string old_expr_mod; Array_v__ast__CallArg args = v__parser__Parser_call_args(p); v__token__Pos last_pos = v__token__Token_pos(&p->tok); v__parser__Parser_check(p, v__token__Kind__rpar); - if (p->tok.kind == v__token__Kind__not) { - v__parser__Parser_next(p); - } v__token__Pos pos = v__token__Pos_extend(first_pos, last_pos); Array_v__ast__Stmt or_stmts = __new_array_with_default(0, 0, sizeof(v__ast__Stmt), 0); v__token__Pos or_pos = v__token__Token_pos(&p->tok); @@ -84543,12 +84826,13 @@ string old_expr_mod; v__parser__Parser_close_scope(p); p->inside_or_expr = was_inside_or_expr; } - if (p->tok.kind == v__token__Kind__question) { + if (p->tok.kind == v__token__Kind__question || p->tok.kind == v__token__Kind__not) { + bool is_not = p->tok.kind == v__token__Kind__not; v__parser__Parser_next(p); if (p->inside_defer) { v__parser__Parser_error_with_pos(p, _SLIT("error propagation not allowed inside `defer` blocks"), v__token__Token_pos(&p->prev_tok)); } - or_kind = v__ast__OrKind__propagate; + or_kind = (is_not ? (v__ast__OrKind__propagate_result) : (v__ast__OrKind__propagate_option)); } if (_IN_MAP(ADDR(string, fn_name), ADDR(map, p->imported_symbols))) { fn_name = (*(string*)map_get(ADDR(map, p->imported_symbols), &(string[]){fn_name}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); @@ -84624,7 +84908,7 @@ Array_v__ast__CallArg v__parser__Parser_call_args(v__parser__Parser* p) { if (array_decompose) { expr = v__ast__ArrayDecompose_to_sumtype_v__ast__Expr(ADDR(v__ast__ArrayDecompose, (((v__ast__ArrayDecompose){.pos = v__token__Token_pos(&p->tok),.expr = expr,.expr_type = 0,.arg_type = 0,})))); } - if ((expr)._typ == 330 /* v.ast.StructInit */) { + if ((expr)._typ == 331 /* v.ast.StructInit */) { _PUSH_MANY(&(*expr._v__ast__StructInit).pre_comments, (comments), _t2, Array_v__ast__Comment); comments = __new_array_with_default(0, 0, sizeof(v__ast__Comment), 0); } @@ -84779,19 +85063,19 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { if (is_method) { bool is_duplicate = v__ast__TypeSymbol_has_method(type_sym, name); if (type_sym->kind == v__ast__Kind__interface_ && is_duplicate) { - if ((type_sym->info)._typ == 473 /* v.ast.Interface */) { + if ((type_sym->info)._typ == 474 /* v.ast.Interface */) { is_duplicate = !v__ast__Interface_has_method(&(*type_sym->info._v__ast__Interface), name); } } if (is_duplicate) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); v__ast__FnDecl _t8 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t8; } } if (!p->pref->is_fmt) { if (_IN_MAP(ADDR(string, name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot redefine imported function `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot redefine imported function `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); v__ast__FnDecl _t9 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t9; } @@ -84809,11 +85093,11 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { v__ast__FnDecl _t10 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t10; } - multi_return_Array_v__ast__Type_Array_string mr_8867 = v__parser__Parser_parse_generic_types(p); - Array_string generic_names = mr_8867.arg1; + multi_return_Array_v__ast__Type_Array_string mr_8890 = v__parser__Parser_parse_generic_types(p); + Array_string generic_names = mr_8890.arg1; if (is_method && v__ast__Type_has_flag(rec.typ, v__ast__TypeFlag__generic)) { v__ast__TypeSymbol* sym = v__ast__Table_sym(p->table, rec.typ); - if ((sym->info)._typ == 455 /* v.ast.Struct */) { + if ((sym->info)._typ == 456 /* v.ast.Struct */) { Array_string _t11 = {0}; Array_v__ast__Type _t11_orig = (*sym->info._v__ast__Struct).generic_types; int _t11_len = _t11_orig.len; @@ -84833,10 +85117,10 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { } } } - multi_return_Array_v__ast__Param_bool_bool mr_9302 = v__parser__Parser_fn_args(p); - Array_v__ast__Param args2 = mr_9302.arg0; - bool are_args_type_only = mr_9302.arg1; - bool is_variadic = mr_9302.arg2; + multi_return_Array_v__ast__Param_bool_bool mr_9325 = v__parser__Parser_fn_args(p); + Array_v__ast__Param args2 = mr_9325.arg0; + bool are_args_type_only = mr_9325.arg1; + bool is_variadic = mr_9325.arg2; if (is_c2v_variadic) { is_variadic = true; } @@ -84845,7 +85129,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { for (int _t16 = 0; _t16 < params.len; ++_t16) { v__ast__Param param = ((v__ast__Param*)params.data)[_t16]; if (v__ast__Scope_known_var(p->scope, param.name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of parameter `"), 0xfe10, {.d_s = param.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), param.pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), param.pos); v__ast__FnDecl _t17 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t17; } @@ -84896,7 +85180,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { is_non_local = elem_type_sym->mod.len > 0 && !string__eq(elem_type_sym->mod, p->mod) && elem_type_sym->language == v__ast__Language__v; } if (is_non_local) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot define new methods on non-local type "), 0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), rec.type_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot define new methods on non-local type "), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), rec.type_pos); v__ast__FnDecl _t18 = ((v__ast__FnDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.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,.receiver = (v__ast__StructField){.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.has_default_expr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_pub = 0,.default_val = (string){.str=(byteptr)"", .is_lit=1},.is_mut = 0,.is_global = 0,.is_volatile = 0,.default_expr_typ = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,},.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_method = 0,.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.rec_mut = 0,.rec_share = 0,.language = 0,.file_mode = 0,.no_body = 0,.is_builtin = 0,.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.file = (string){.str=(byteptr)"", .is_lit=1},.generic_names = __new_array(0, 0, sizeof(string)),.is_direct_arr = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.ctdefine_idx = -1,.idx = 0,.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)),.return_type = 0,.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_return = 0,.should_be_skipped = 0,.ninstances = 0,.has_await = 0,.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)),.source_file = 0,.scope = 0,.label_names = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t18; } @@ -84932,9 +85216,9 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { })); } else { if (language == v__ast__Language__c) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } else if (language == v__ast__Language__js) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { name = v__parser__Parser_prepend_mod(p, name); } @@ -84952,7 +85236,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { if ((existing.name).len != 0) { if (file_mode == v__ast__Language__v && existing.file_mode != v__ast__Language__v) { if (!p->pref->is_fmt) { - name = v__parser__Parser_prepend_mod(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("pure_v_but_overriden_by_"), 0xfe10, {.d_s = v__ast__Language_str(existing.file_mode)}}, {_SLIT("_"), 0xfe10, {.d_s = short_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + name = v__parser__Parser_prepend_mod(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("pure_v_but_overriden_by_"), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(existing.file_mode)}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = short_fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } else { array_push((array*)&p->table->redefined_fns, _MOV((string[]){ string_clone(name) })); @@ -85131,7 +85415,7 @@ bool v__parser__Parser_fn_receiver_defer_0 = false; v__ast__TypeSymbol* type_sym = v__ast__Table_sym(p->table, rec->typ); bool is_auto_rec = false; if (type_sym->kind == v__ast__Kind__struct_) { - v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 455) /*expected idx: 455, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; if (!rec->is_mut && !v__ast__Type_is_ptr(rec->typ) && info.fields.len > 8) { rec->typ = v__ast__Type_ref(rec->typ); is_auto_rec = true; @@ -85177,9 +85461,9 @@ bool v__parser__Parser_anon_fn_defer_0 = false; v__parser__Parser_anon_fn_defer_0 = true; p->scope->detached_from_parent = true; Array_v__ast__Param inherited_vars = (p->tok.kind == v__token__Kind__lsbr ? (v__parser__Parser_closure_vars(p)) : (__new_array_with_default(0, 0, sizeof(v__ast__Param), 0))); - multi_return_Array_v__ast__Param_bool_bool mr_18767 = v__parser__Parser_fn_args(p); - Array_v__ast__Param args = mr_18767.arg0; - bool is_variadic = mr_18767.arg2; + multi_return_Array_v__ast__Param_bool_bool mr_18790 = v__parser__Parser_fn_args(p); + Array_v__ast__Param args = mr_18790.arg0; + bool is_variadic = mr_18790.arg2; for (int _t2 = 0; _t2 < args.len; ++_t2) { v__ast__Param arg = ((v__ast__Param*)args.data)[_t2]; if (arg.name.len == 0 && v__ast__Table_sym(p->table, arg.typ)->kind != v__ast__Kind__placeholder) { @@ -85215,18 +85499,18 @@ bool v__parser__Parser_anon_fn_defer_0 = false; return_type = v__parser__Parser_parse_type(p); return_type_pos = v__token__Pos_extend(return_type_pos, v__token__Token_pos(&p->tok)); } else if (p->tok.kind != v__token__Kind__lcbr) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected return type, not "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" for anonymous function"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected return type, not "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" for anonymous function"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } } Array_v__ast__Stmt stmts = __new_array_with_default(0, 0, sizeof(v__ast__Stmt), 0); bool no_body = p->tok.kind != v__token__Kind__lcbr; same_line = p->tok.line_nr == p->prev_tok.line_nr; if (no_body && same_line) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" after anonymous function signature, expecting `{`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(" after anonymous function signature, expecting `{`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } Array_string label_names = __new_array_with_default(0, 0, sizeof(string), 0); v__ast__Fn func = ((v__ast__Fn){.is_variadic = is_variadic,.language = 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 = false,.no_body = 0,.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.file_mode = 0,.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 = return_type,.receiver_type = 0,.name = (string){.str=(byteptr)"", .is_lit=1},.params = args,.source_fn = 0,.usages = 0,.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.is_conditional = 0,.ctdefine_idx = 0,}); - string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("anon_fn_"), 0xfe10, {.d_s = p->unique_prefix}}, {_SLIT("_"), 0xfe10, {.d_s = v__ast__Table_fn_type_signature(p->table, (voidptr)&/*qq*/func)}}, {_SLIT("_"), 0xfe07, {.d_i32 = p->tok.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(4, _MOV((StrIntpData[]){{_SLIT("anon_fn_"), /*115 &string*/0xfe10, {.d_s = p->unique_prefix}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_fn_type_signature(p->table, (voidptr)&/*qq*/func)}}, {_SLIT("_"), /*100 &int*/0xfe07, {.d_i32 = p->tok.pos}}, {_SLIT0, 0, { .d_c = 0 }}})); string keep_fn_name = p->cur_fn_name; p->cur_fn_name = name; if (p->tok.kind == v__token__Kind__lcbr) { @@ -85361,7 +85645,7 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Param_bool_bool v__parser__Parser_fn_ } if (p->tok.kind == v__token__Kind__comma) { if (is_variadic) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use ...(variadic) with non-final parameter no "), 0xfe07, {.d_i32 = arg_no}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use ...(variadic) with non-final parameter no "), /*100 &int*/0xfe07, {.d_i32 = arg_no}}, {_SLIT0, 0, { .d_c = 0 }}})), pos); return (multi_return_Array_v__ast__Param_bool_bool){.arg0=__new_array_with_default(0, 0, sizeof(v__ast__Param), 0), .arg1=false, .arg2=false}; } v__parser__Parser_next(p); @@ -85394,13 +85678,13 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Param_bool_bool v__parser__Parser_fn_ string name = v__parser__Parser_check_name(p); Array_string arg_names = new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){string_clone(name)})); if (name.len > 0 && p->fn_language == v__ast__Language__v && u8_is_capital(string_at(name, 0))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter name must not begin with upper case letter (`"), 0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(arg_names, 0))}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parameter name must not begin with upper case letter (`"), /*115 &string*/0xfe10, {.d_s = (*(string*)/*ee elem_sym */array_get(arg_names, 0))}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); } Array_v__token__Pos type_pos = new_array_from_c_array(1, 1, sizeof(v__token__Pos), _MOV((v__token__Pos[1]){v__token__Token_pos(&p->tok)})); for (;;) { if (!(p->tok.kind == v__token__Kind__comma)) break; if (!p->pref->is_fmt) { - v__parser__Parser_warn(p, string__plus(_SLIT("`fn f(x, y Type)` syntax has been deprecated and will soon be removed. "), str_intp(2, _MOV((StrIntpData[]){{_SLIT("Use `fn f(x Type, y Type)` instead. You can run `v fmt -w \""), 0xfe10, {.d_s = p->scanner->file_path}}, {_SLIT("\"` to automatically fix your code."), 0, { .d_c = 0 }}})))); + v__parser__Parser_warn(p, string__plus(_SLIT("`fn f(x, y Type)` syntax has been deprecated and will soon be removed. "), str_intp(2, _MOV((StrIntpData[]){{_SLIT("Use `fn f(x Type, y Type)` instead. You can run `v fmt -w \""), /*115 &string*/0xfe10, {.d_s = p->scanner->file_path}}, {_SLIT("\"` to automatically fix your code."), 0, { .d_c = 0 }}})))); } v__parser__Parser_next(p); array_push((array*)&arg_pos, _MOV((v__token__Pos[]){ v__token__Token_pos(&p->tok) })); @@ -85457,7 +85741,7 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Param_bool_bool v__parser__Parser_fn_ } array_push((array*)&args, _MOV((v__ast__Param[]){ ((v__ast__Param){.pos = (*(v__token__Pos*)/*ee elem_sym */array_get(arg_pos, i)),.name = arg_name,.is_mut = is_mut,.is_auto_rec = 0,.type_pos = (*(v__token__Pos*)/*ee elem_sym */array_get(type_pos, i)),.is_hidden = 0,.typ = typ,}) })); if (is_variadic && p->tok.kind == v__token__Kind__comma) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use ...(variadic) with non-final parameter "), 0xfe10, {.d_s = arg_name}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(arg_pos, i))); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use ...(variadic) with non-final parameter "), /*115 &string*/0xfe10, {.d_s = arg_name}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(v__token__Pos*)/*ee elem_sym */array_get(arg_pos, i))); return (multi_return_Array_v__ast__Param_bool_bool){.arg0=__new_array_with_default(0, 0, sizeof(v__ast__Param), 0), .arg1=false, .arg2=false}; } } @@ -85479,7 +85763,7 @@ VV_LOCAL_SYMBOL v__ast__GoExpr v__parser__Parser_go_expr(v__parser__Parser* p) { v__token__Pos spos = v__token__Token_pos(&p->tok); v__ast__Expr expr = v__parser__Parser_expr(p, 0); v__ast__CallExpr _t1; /* if prepend */ - if ((expr)._typ == 291 /* v.ast.CallExpr */) { + if ((expr)._typ == 292 /* v.ast.CallExpr */) { _t1 = (*expr._v__ast__CallExpr); } else { v__parser__Parser_error_with_pos(p, _SLIT("expression in `go` must be a function call"), v__ast__Expr_pos(expr)); @@ -85509,7 +85793,7 @@ VV_LOCAL_SYMBOL Array_v__ast__Param v__parser__Parser_closure_vars(v__parser__Pa Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(p->scope->parent, var_name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), 0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("undefined ident: `"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); continue; } @@ -85539,14 +85823,14 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_mutable_arguments(v__parser__Par return; } if (sym->kind == v__ast__Kind__alias) { - v__ast__Type atyp = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Alias */ ).parent_type; + v__ast__Type atyp = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; v__parser__Parser_check_fn_mutable_arguments(p, atyp, pos); return; } if (p->fn_language == v__ast__Language__c) { return; } - v__parser__Parser_error_with_pos(p, string__plus(_SLIT("mutable arguments are only allowed for arrays, interfaces, maps, pointers, structs or their aliases\n"), str_intp(4, _MOV((StrIntpData[]){{_SLIT("return values instead: `fn foo(mut n "), 0xfe10, {.d_s = sym->name}}, {_SLIT(") {` => `fn foo(n "), 0xfe10, {.d_s = sym->name}}, {_SLIT(") "), 0xfe10, {.d_s = sym->name}}, {_SLIT(" {`"), 0, { .d_c = 0 }}}))), pos); + v__parser__Parser_error_with_pos(p, string__plus(_SLIT("mutable arguments are only allowed for arrays, interfaces, maps, pointers, structs or their aliases\n"), str_intp(4, _MOV((StrIntpData[]){{_SLIT("return values instead: `fn foo(mut n "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(") {` => `fn foo(n "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(") "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" {`"), 0, { .d_c = 0 }}}))), pos); } VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_shared_arguments(v__parser__Parser* p, v__ast__Type typ, v__token__Pos pos) { @@ -85559,14 +85843,14 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_shared_arguments(v__parser__Pars VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_atomic_arguments(v__parser__Parser* p, v__ast__Type typ, v__token__Pos pos) { v__ast__TypeSymbol* sym = v__ast__Table_sym(p->table, typ); if (!(sym->kind == v__ast__Kind__u32 || sym->kind == v__ast__Kind__int || sym->kind == v__ast__Kind__u64)) { - v__parser__Parser_error_with_pos(p, string__plus(_SLIT("atomic arguments are only allowed for 32/64 bit integers\n"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("use shared arguments instead: `fn foo(atomic n "), 0xfe10, {.d_s = sym->name}}, {_SLIT(") {` => `fn foo(shared n "), 0xfe10, {.d_s = sym->name}}, {_SLIT(") {`"), 0, { .d_c = 0 }}}))), pos); + v__parser__Parser_error_with_pos(p, string__plus(_SLIT("atomic arguments are only allowed for 32/64 bit integers\n"), str_intp(3, _MOV((StrIntpData[]){{_SLIT("use shared arguments instead: `fn foo(atomic n "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(") {` => `fn foo(shared n "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(") {`"), 0, { .d_c = 0 }}}))), pos); } } VV_LOCAL_SYMBOL bool v__parser__have_fn_main(Array_v__ast__Stmt stmts) { for (int _t1 = 0; _t1 < stmts.len; ++_t1) { v__ast__Stmt stmt = ((v__ast__Stmt*)stmts.data)[_t1]; - if ((stmt)._typ == 218 /* v.ast.FnDecl */) { + if ((stmt)._typ == 219 /* v.ast.FnDecl */) { if (string__eq((*stmt._v__ast__FnDecl).name, _SLIT("main.main"))) { bool _t2 = true; return _t2; @@ -85613,7 +85897,7 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_for_stmt(v__parser__Parser* p) { v__parser__Parser_check(p, v__token__Kind__semicolon); if (p->tok.kind != v__token__Kind__semicolon) { if (p->tok.kind == v__token__Kind__name && (p->peek_tok.kind == v__token__Kind__inc || p->peek_tok.kind == v__token__Kind__dec)) { - v__ast__Stmt _t4 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use "), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT0, 0xfe10, {.d_s = v__token__Kind_str(p->peek_tok.kind)}}, {_SLIT(" as value"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t4 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot use "), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT0, /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(p->peek_tok.kind)}}, {_SLIT(" as value"), 0, { .d_c = 0 }}})))))); return _t4; } cond = v__parser__Parser_expr(p, 0); @@ -85673,21 +85957,21 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_for_stmt(v__parser__Parser* p) { return _t6; } if (v__ast__Scope_known_var(p->scope, key_var_name)) { - v__ast__Stmt _t7 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of key iteration variable `"), 0xfe10, {.d_s = key_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t7 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of key iteration variable `"), /*115 &string*/0xfe10, {.d_s = key_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); return _t7; } if (v__ast__Scope_known_var(p->scope, val_var_name)) { - v__ast__Stmt _t8 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of value iteration variable `"), 0xfe10, {.d_s = val_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t8 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of value iteration variable `"), /*115 &string*/0xfe10, {.d_s = val_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); return _t8; } v__ast__Scope_register(p->scope, v__ast__Var_to_sumtype_v__ast__ScopeObject(ADDR(v__ast__Var, (((v__ast__Var){.name = key_var_name,.share = 0,.is_mut = 0,.is_autofree_tmp = 0,.is_arg = 0,.is_auto_deref = 0,.is_inherited = 0,.expr = {0},.typ = _const_v__ast__int_type,.orig_type = 0,.smartcasts = __new_array(0, 0, sizeof(v__ast__Type)),.pos = key_var_pos,.is_used = 0,.is_changed = 0,.is_or = 0,.is_tmp = true,.is_auto_heap = 0,.is_stack_obj = true,}))))); } else if (v__ast__Scope_known_var(p->scope, val_var_name)) { - v__ast__Stmt _t9 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of value iteration variable `"), 0xfe10, {.d_s = val_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t9 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of value iteration variable `"), /*115 &string*/0xfe10, {.d_s = val_var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); return _t9; } v__parser__Parser_check(p, v__token__Kind__key_in); if (p->tok.kind == v__token__Kind__name && (string__eq(p->tok.lit, key_var_name) || string__eq(p->tok.lit, val_var_name))) { - v__ast__Stmt _t10 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("in a `for x in array` loop, the key or value iteration variable `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` can not be the same as the array variable"), 0, { .d_c = 0 }}})))))); + v__ast__Stmt _t10 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("in a `for x in array` loop, the key or value iteration variable `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` can not be the same as the array variable"), 0, { .d_c = 0 }}})))))); return _t10; } v__ast__Expr cond = v__parser__Parser_expr(p, 0); @@ -85850,7 +86134,7 @@ bool was_inside_ct_if_expr; var.pos = v__token__Token_pos(&p->tok); var.name = v__parser__Parser_check_name(p); if (v__ast__Scope_known_var(p->scope, var.name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of `"), 0xfe10, {.d_s = var.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), var.pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of `"), /*115 &string*/0xfe10, {.d_s = var.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), var.pos); } array_push((array*)&vars, _MOV((v__ast__IfGuardVar[]){ var })); if (p->tok.kind != v__token__Kind__comma) { @@ -85862,7 +86146,7 @@ bool was_inside_ct_if_expr; v__parser__Parser_check(p, v__token__Kind__decl_assign); _PUSH_MANY(&comments, (v__parser__Parser_eat_comments(p, ((v__parser__EatCommentsConfig){.same_line = 0,.follow_up = 0,}))), _t9, Array_v__ast__Comment); v__ast__Expr expr = v__parser__Parser_expr(p, 0); - if (!((expr)._typ == 291 /* v.ast.CallExpr */ || (expr)._typ == 308 /* v.ast.IndexExpr */ || (expr)._typ == 322 /* v.ast.PrefixExpr */)) { + if (!((expr)._typ == 292 /* v.ast.CallExpr */ || (expr)._typ == 309 /* v.ast.IndexExpr */ || (expr)._typ == 323 /* v.ast.PrefixExpr */)) { v__parser__Parser_error_with_pos(p, _SLIT("if guard condition expression is illegal, it should return optional"), v__ast__Expr_pos(expr)); } cond = v__ast__IfGuardExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__IfGuardExpr, (((v__ast__IfGuardExpr){.vars = vars,.expr = expr,.expr_type = 0,})))); @@ -86136,14 +86420,14 @@ VV_LOCAL_SYMBOL v__ast__SelectExpr v__parser__Parser_select_expr(v__parser__Pars } p->inside_match = false; p->inside_select = false; - if (stmt._typ == 345 /* v.ast.ExprStmt */) { + if (stmt._typ == 346 /* v.ast.ExprStmt */) { bool check_timeout = false; if (!(*stmt._v__ast__ExprStmt).is_expr) { v__parser__Parser_error_with_pos(p, _SLIT("select: invalid expression"), (*stmt._v__ast__ExprStmt).pos); v__ast__SelectExpr _t4 = ((v__ast__SelectExpr){.branches = __new_array(0, 0, sizeof(v__ast__SelectBranch)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_exception = 0,.is_expr = 0,.expected_type = 0,}); return _t4; } else { - if ((*stmt._v__ast__ExprStmt).expr._typ == 309 /* v.ast.InfixExpr */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 310 /* v.ast.InfixExpr */) { if ((*(*stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).op != v__token__Kind__arrow) { check_timeout = true; } else if (is_gt) { @@ -86171,9 +86455,9 @@ VV_LOCAL_SYMBOL v__ast__SelectExpr v__parser__Parser_select_expr(v__parser__Pars has_timeout = true; } } - else if (stmt._typ == 337 /* v.ast.AssignStmt */) { + else if (stmt._typ == 338 /* v.ast.AssignStmt */) { v__ast__Expr expr = (*(v__ast__Expr*)/*ee elem_sym */array_get((*stmt._v__ast__AssignStmt).right, 0)); - if (expr._typ == 322 /* v.ast.PrefixExpr */) { + if (expr._typ == 323 /* v.ast.PrefixExpr */) { if ((*expr._v__ast__PrefixExpr).op != v__token__Kind__arrow) { v__parser__Parser_error_with_pos(p, _SLIT("select key: `<-` operator expected"), (*expr._v__ast__PrefixExpr).pos); v__ast__SelectExpr _t7 = ((v__ast__SelectExpr){.branches = __new_array(0, 0, sizeof(v__ast__SelectBranch)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.has_exception = 0,.is_expr = 0,.expected_type = 0,}); @@ -86235,7 +86519,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_lockable(v__parser__Parser* p) { v__token__Pos pos = v__token__Token_pos(&p->tok); for (;;) { if (p->tok.kind != v__token__Kind__name) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` (field/variable name expected)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` (field/variable name expected)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } array_push((array*)&names, _MOV((string[]){ string_clone(p->tok.lit) })); array_push((array*)&positions, _MOV((v__token__Pos[]){ pos })); @@ -86285,7 +86569,7 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Expr_Array_v__ast__Comment v__parser_ Array_v__ast__Comment comments = __new_array_with_default(0, 0, sizeof(v__ast__Comment), 0); for (;;) { v__ast__Expr expr = v__parser__Parser_lockable(p); - if ((expr)._typ == 295 /* v.ast.Comment */) { + if ((expr)._typ == 296 /* v.ast.Comment */) { array_push((array*)&comments, _MOV((v__ast__Comment[]){ (*expr._v__ast__Comment) })); } else { array_push((array*)&exprs, _MOV((v__ast__Expr[]){ expr })); @@ -86308,7 +86592,7 @@ VV_LOCAL_SYMBOL v__ast__LockExpr v__parser__Parser_lock_expr(v__parser__Parser* for (;;) { bool is_rlock = p->tok.kind == v__token__Kind__key_rlock; if (!is_rlock && p->tok.kind != v__token__Kind__key_lock) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT("`, expected `lock` or `rlock`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected `"), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT("`, expected `lock` or `rlock`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); } v__parser__Parser_next(p); if (p->tok.kind == v__token__Kind__lcbr) { @@ -86321,7 +86605,7 @@ VV_LOCAL_SYMBOL v__ast__LockExpr v__parser__Parser_lock_expr(v__parser__Parser* for (int _t1 = 0; _t1 < exprs.len; ++_t1) { v__ast__Expr e = ((v__ast__Expr*)exprs.data)[_t1]; if (!v__ast__Expr_is_lockable(&e)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = v__ast__Expr_str(e)}}, {_SLIT("` cannot be locked - only `x` or `x.y` are supported"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(e)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(e)}}, {_SLIT("` cannot be locked - only `x` or `x.y` are supported"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(e)); } array_push((array*)&lockeds, _MOV((v__ast__Expr[]){ e })); array_push((array*)&is_rlocked, _MOV((bool[]){ is_rlock })); @@ -86394,8 +86678,8 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check_unused_imports(v__parser__Parser* p string alias = import_m.alias; string mod = import_m.mod; if (!v__parser__Parser_is_used_import(p, alias)) { - string mod_alias = (string__eq(alias, mod) ? (alias) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = alias}}, {_SLIT(" ("), 0xfe10, {.d_s = mod}}, {_SLIT(")"), 0, { .d_c = 0 }}})))); - v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("module '"), 0xfe10, {.d_s = mod_alias}}, {_SLIT("' is imported but never used"), 0, { .d_c = 0 }}})), import_m.mod_pos); + string mod_alias = (string__eq(alias, mod) ? (alias) : ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = alias}}, {_SLIT(" ("), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT(")"), 0, { .d_c = 0 }}})))); + v__parser__Parser_warn_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("module '"), /*115 &string*/0xfe10, {.d_s = mod_alias}}, {_SLIT("' is imported but never used"), 0, { .d_c = 0 }}})), import_m.mod_pos); } } } @@ -86408,21 +86692,21 @@ v__ast__Type v__parser__Parser_parse_array_type(v__parser__Parser* p, v__token__ if (p->pref->is_fmt) { fixed_size = 987654321; } else { - if (size_expr._typ == 310 /* v.ast.IntegerLiteral */) { + if (size_expr._typ == 311 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*size_expr._v__ast__IntegerLiteral).val); } - else if (size_expr._typ == 305 /* v.ast.Ident */) { + else if (size_expr._typ == 306 /* v.ast.Ident */) { bool show_non_const_error = false; Option_v__ast__ConstField_ptr _t1; - if (_t1 = v__ast__Scope_find_const(p->table->global_scope, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = p->mod}}, {_SLIT("."), 0xfe10, {.d_s = (*size_expr._v__ast__Ident).name}}, {_SLIT0, 0, { .d_c = 0 }}}))), _t1.state == 0) { + if (_t1 = v__ast__Scope_find_const(p->table->global_scope, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = p->mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = (*size_expr._v__ast__Ident).name}}, {_SLIT0, 0, { .d_c = 0 }}}))), _t1.state == 0) { v__ast__ConstField* const_field = *(v__ast__ConstField**)_t1.data; - if ((const_field->expr)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((const_field->expr)._typ == 311 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*const_field->expr._v__ast__IntegerLiteral).val); } else { - if ((const_field->expr)._typ == 309 /* v.ast.InfixExpr */) { + if ((const_field->expr)._typ == 310 /* v.ast.InfixExpr */) { v__transformer__Transformer* t = v__transformer__new_transformer(p->pref); v__ast__Expr folded_expr = v__transformer__Transformer_infix_expr(t, (voidptr)&/*qq*/(*const_field->expr._v__ast__InfixExpr)); - if ((folded_expr)._typ == 310 /* v.ast.IntegerLiteral */) { + if ((folded_expr)._typ == 311 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*folded_expr._v__ast__IntegerLiteral).val); } else { show_non_const_error = true; @@ -86440,7 +86724,7 @@ v__ast__Type v__parser__Parser_parse_array_type(v__parser__Parser* p, v__token__ } } if (show_non_const_error) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-constant array bound `"), 0xfe10, {.d_s = (*size_expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*size_expr._v__ast__Ident).pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("non-constant array bound `"), /*115 &string*/0xfe10, {.d_s = (*size_expr._v__ast__Ident).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*size_expr._v__ast__Ident).pos); } } @@ -86514,7 +86798,7 @@ v__ast__Type v__parser__Parser_parse_map_type(v__parser__Parser* p) { return _t3; } string s = v__ast__Table_type_to_str(p->table, key_type); - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("maps only support string, integer, float, rune, enum or voidptr keys for now (not `"), 0xfe10, {.d_s = s}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("maps only support string, integer, float, rune, enum or voidptr keys for now (not `"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); v__ast__Type _t4 = 0; return _t4; } @@ -86725,7 +87009,7 @@ v__ast__Type v__parser__Parser_parse_inline_sum_type(v__parser__Parser* p) { if (variants.len > 1) { if (variants.len > _const_v__parser__maximum_inline_sum_type_variants) { v__token__Pos pos = v__token__Pos_extend((*(v__ast__TypeNode*)/*ee elem_sym */array_get(variants, 0)).pos, (*(v__ast__TypeNode*)/*ee elem_sym */array_get(variants, variants.len - 1)).pos); - v__parser__Parser_warn_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("an inline sum type expects a maximum of "), 0xfe07, {.d_i32 = _const_v__parser__maximum_inline_sum_type_variants}}, {_SLIT(" types ("), 0xfe07, {.d_i32 = variants.len}}, {_SLIT(" were given)"), 0, { .d_c = 0 }}})), pos); + v__parser__Parser_warn_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("an inline sum type expects a maximum of "), /*100 &int literal*/0xfe07, {.d_i32 = _const_v__parser__maximum_inline_sum_type_variants}}, {_SLIT(" types ("), /*100 &int*/0xfe07, {.d_i32 = variants.len}}, {_SLIT(" were given)"), 0, { .d_c = 0 }}})), pos); } Array_string _t1 = {0}; Array_v__ast__TypeNode _t1_orig = variants; @@ -86739,7 +87023,7 @@ v__ast__Type v__parser__Parser_parse_inline_sum_type(v__parser__Parser* p) { } Array_string variant_names =_t1; qsort(variant_names.data, variant_names.len, variant_names.element_size, (int (*)(const void *, const void *))&compare_7932637671395545435_string); - string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_anon_sum_type_"), 0xfe10, {.d_s = Array_string_join(variant_names, _SLIT("_"))}}, {_SLIT0, 0, { .d_c = 0 }}})); + string name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_v_anon_sum_type_"), /*115 &string*/0xfe10, {.d_s = Array_string_join(variant_names, _SLIT("_"))}}, {_SLIT0, 0, { .d_c = 0 }}})); Array_v__ast__Type _t3 = {0}; Array_v__ast__TypeNode _t3_orig = variants; int _t3_len = _t3_orig.len; @@ -86796,19 +87080,25 @@ bool v__parser__Parser_parse_sum_type_variants_defer_0 = false; v__ast__Type v__parser__Parser_parse_type(v__parser__Parser* p) { bool is_optional = false; + bool is_result = false; + int line_nr = p->tok.line_nr; v__token__Pos optional_pos = v__token__Token_pos(&p->tok); if (p->tok.kind == v__token__Kind__question) { - int line_nr = p->tok.line_nr; v__parser__Parser_next(p); is_optional = true; - if (p->tok.line_nr > line_nr) { - v__ast__Type typ = _const_v__ast__void_type; - if (is_optional) { - typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__optional); - } - v__ast__Type _t1 = typ; - return _t1; + } else if (p->tok.kind == v__token__Kind__not) { + v__parser__Parser_next(p); + is_result = true; + } + if ((is_optional || is_result) && p->tok.line_nr > line_nr) { + v__ast__Type typ = _const_v__ast__void_type; + if (is_optional) { + typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__optional); + } else if (is_result) { + typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__result); } + v__ast__Type _t1 = typ; + return _t1; } bool is_shared = p->tok.kind == v__token__Kind__key_shared; bool is_atomic = p->tok.kind == v__token__Kind__key_atomic; @@ -86858,13 +87148,16 @@ v__ast__Type v__parser__Parser_parse_type(v__parser__Parser* p) { return _t4; } v__ast__TypeSymbol* sym = v__ast__Table_sym(p->table, typ); - if (is_optional && (sym->info)._typ == 474 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 474) /*expected idx: 474, name: v.ast.SumType */ ).is_anon) { + if (is_optional && (sym->info)._typ == 475 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 475) /*expected idx: 475, name: v.ast.SumType */ ).is_anon) { v__parser__Parser_error_with_pos(p, _SLIT("an inline sum type cannot be optional"), v__token__Pos_extend(optional_pos, v__token__Token_pos(&p->prev_tok))); } } if (is_optional) { typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__optional); } + if (is_result) { + typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__result); + } if (is_shared) { typ = v__ast__Type_set_flag(typ, v__ast__TypeFlag__shared_f); } @@ -86886,9 +87179,9 @@ v__ast__Type v__parser__Parser_parse_type(v__parser__Parser* p) { v__ast__Type v__parser__Parser_parse_any_type(v__parser__Parser* p, v__ast__Language language, bool is_ptr, bool check_dot) { string name = p->tok.lit; if (language == v__ast__Language__c) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } else if (language == v__ast__Language__js) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } else if (p->peek_tok.kind == v__token__Kind__dot && check_dot) { string mod = name; v__token__Pos mod_pos = v__token__Token_pos(&p->tok); @@ -86899,14 +87192,14 @@ v__ast__Type v__parser__Parser_parse_any_type(v__parser__Parser* p, v__ast__Lang if (!(p->peek_tok.kind == v__token__Kind__dot)) break; mod_pos = v__token__Pos_extend(mod_pos, v__token__Token_pos(&p->tok)); mod_last_part = p->tok.lit; - mod = /*f*/string__plus(mod, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe10, {.d_s = mod_last_part}}, {_SLIT0, 0, { .d_c = 0 }}}))); + mod = /*f*/string__plus(mod, str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*115 &string*/0xfe10, {.d_s = mod_last_part}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__parser__Parser_next(p); v__parser__Parser_check(p, v__token__Kind__dot); } if (!v__parser__Parser_known_import(p, mod) && !p->pref->is_fmt) { - string msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown module `"), 0xfe10, {.d_s = mod}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string msg = str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown module `"), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("`"), 0, { .d_c = 0 }}})); if (mod.len > mod_last_part.len && v__parser__Parser_known_import(p, mod_last_part)) { - msg = /*f*/string__plus(msg, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; did you mean `"), 0xfe10, {.d_s = mod_last_part}}, {_SLIT("`?"), 0, { .d_c = 0 }}}))); + msg = /*f*/string__plus(msg, str_intp(2, _MOV((StrIntpData[]){{_SLIT("; did you mean `"), /*115 &string*/0xfe10, {.d_s = mod_last_part}}, {_SLIT("`?"), 0, { .d_c = 0 }}}))); } v__parser__Parser_error_with_pos(p, msg, mod_pos); v__ast__Type _t1 = 0; @@ -86916,7 +87209,7 @@ v__ast__Type v__parser__Parser_parse_any_type(v__parser__Parser* p, v__ast__Lang v__parser__Parser_register_used_import(p, mod); mod = (*(string*)map_get(ADDR(map, p->imports), &(string[]){mod}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); } - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod}}, {_SLIT("."), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT0, 0, { .d_c = 0 }}})); if (p->tok.lit.len > 0 && !u8_is_capital(string_at(p->tok.lit, 0))) { v__parser__Parser_error(p, _SLIT("imported types must start with a capital letter")); v__ast__Type _t2 = 0; @@ -87112,25 +87405,25 @@ v__ast__Type v__parser__Parser_parse_generic_inst_type(v__parser__Parser* p, str parent_idx = v__ast__Table_add_placeholder_type(p->table, name, v__ast__Language__v); } v__ast__TypeSymbol* parent_sym = v__ast__Table_sym(p->table, v__ast__new_type(parent_idx)); - if (parent_sym->info._typ == 455 /* v.ast.Struct */) { + if (parent_sym->info._typ == 456 /* v.ast.Struct */) { if ((*parent_sym->info._v__ast__Struct).generic_types.len == 0) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } else if ((*parent_sym->info._v__ast__Struct).generic_types.len != concrete_types.len) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of struct `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of struct `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } } - else if (parent_sym->info._typ == 473 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 474 /* v.ast.Interface */) { if ((*parent_sym->info._v__ast__Interface).generic_types.len == 0) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("interface `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } else if ((*parent_sym->info._v__ast__Interface).generic_types.len != concrete_types.len) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of interfce `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of interfce `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } } - else if (parent_sym->info._typ == 474 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 475 /* v.ast.SumType */) { if ((*parent_sym->info._v__ast__SumType).generic_types.len == 0) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sumtype `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sumtype `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } else if ((*parent_sym->info._v__ast__SumType).generic_types.len != concrete_types.len) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of sumtype `"), 0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the number of generic types of sumtype `"), /*115 &string*/0xfe10, {.d_s = parent_sym->name}}, {_SLIT("` is inconsistent with the concrete types"), 0, { .d_c = 0 }}})), concrete_types_pos); } } @@ -87622,7 +87915,7 @@ bool v__parser__Parser_parse_defer_0 = false; break; } v__ast__Stmt stmt = v__parser__Parser_top_stmt(p); - if (!((stmt)._typ == 345 /* v.ast.ExprStmt */ && ((/* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 345) /*expected idx: 345, name: v.ast.ExprStmt */ ).expr)._typ == 295 /* v.ast.Comment */)) { + if (!((stmt)._typ == 346 /* v.ast.ExprStmt */ && ((/* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ).expr)._typ == 296 /* v.ast.Comment */)) { p->attrs = __new_array_with_default(0, 0, sizeof(v__ast__Attr), 0); } array_push((array*)&stmts, _MOV((v__ast__Stmt[]){ stmt })); @@ -87674,13 +87967,13 @@ bool v__parser__Parser_parse_defer_0 = false; } Array_v__ast__File_ptr v__parser__parse_files(Array_string paths, v__ast__Table* table, v__pref__Preferences* pref) { - v__util__Timers* timers = v__util__new_timers(((v__util__TimerParams){.should_print = false,.label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_files: "), 0xfe10, {.d_s = Array_string_str(paths)}}, {_SLIT0, 0, { .d_c = 0 }}})),})); + v__util__Timers* timers = v__util__new_timers(((v__util__TimerParams){.should_print = false,.label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_files: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(paths)}}, {_SLIT0, 0, { .d_c = 0 }}})),})); Array_v__ast__File_ptr files = __new_array_with_default(0, paths.len, sizeof(v__ast__File*), 0); for (int _t1 = 0; _t1 < paths.len; ++_t1) { string path = ((string*)paths.data)[_t1]; - v__util__Timers_start(timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_file "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_start(timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_file "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); array_push((array*)&files, _MOV((v__ast__File*[]){ v__parser__parse_file(path, table, v__scanner__CommentsMode__skip_comments, pref) })); - v__util__Timers_show(timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_file "), 0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__util__Timers_show(timers, str_intp(2, _MOV((StrIntpData[]){{_SLIT("parse_file "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (codegen_files.len > 0) { _PUSH_MANY(&files, (codegen_files), _t3, Array_v__ast__File_ptr); @@ -87757,10 +88050,10 @@ Array_v__ast__Stmt v__parser__Parser_parse_block_no_scope(v__parser__Parser* p, array_push((array*)&stmts, _MOV((v__ast__Stmt[]){ v__parser__Parser_stmt(p, is_top_level) })); count++; if (count % 100000 == 0) { - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("parsed "), 0xfe07, {.d_i32 = count}}, {_SLIT(" statements so far from fn "), 0xfe10, {.d_s = p->cur_fn_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("parsed "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT(" statements so far from fn "), /*115 &string*/0xfe10, {.d_s = p->cur_fn_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } if (count > 1000000) { - v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("parsed over "), 0xfe07, {.d_i32 = count}}, {_SLIT(" statements from fn "), 0xfe10, {.d_s = p->cur_fn_name}}, {_SLIT(", the parser is probably stuck"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("parsed over "), /*100 &int*/0xfe07, {.d_i32 = count}}, {_SLIT(" statements from fn "), /*115 &string*/0xfe10, {.d_s = p->cur_fn_name}}, {_SLIT(", the parser is probably stuck"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); Array_v__ast__Stmt _t2 = __new_array_with_default(0, 0, sizeof(v__ast__Stmt), 0); return _t2; } @@ -87790,9 +88083,9 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check(v__parser__Parser* p, v__token__Kin } string s = v__token__Kind_str(expected); if (v__token__is_key(s) || (s.len > 0 && !u8_is_letter(string_at(s, 0)))) { - s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + s = str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT("`"), 0, { .d_c = 0 }}})); } - v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting "), 0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting "), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -87800,7 +88093,7 @@ VV_LOCAL_SYMBOL string v__parser__Parser_check_js_name(v__parser__Parser* p) { string name = _SLIT(""); for (;;) { if (!(p->peek_tok.kind == v__token__Kind__dot)) break; - name = /*f*/string__plus(name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + name = /*f*/string__plus(name, str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("."), 0, { .d_c = 0 }}}))); v__parser__Parser_next(p); v__parser__Parser_next(p); } @@ -88088,7 +88381,7 @@ v__ast__Stmt v__parser__Parser_stmt(v__parser__Parser* p, bool is_top_level) { v__token__Pos spos = v__token__Token_pos(&p->tok); string name = v__parser__Parser_check_name(p); if (Array_string_contains(p->label_names, name)) { - v__ast__Stmt _t5 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate label `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), spos)))); + v__ast__Stmt _t5 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate label `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), spos)))); return _t5; } array_push((array*)&p->label_names, _MOV((string[]){ string_clone(name) })); @@ -88096,17 +88389,17 @@ v__ast__Stmt v__parser__Parser_stmt(v__parser__Parser* p, bool is_top_level) { if (p->tok.kind == v__token__Kind__key_for) { v__token__Pos for_pos = v__token__Token_pos(&p->tok); v__ast__Stmt stmt = v__parser__Parser_stmt(p, is_top_level); - if (stmt._typ == 348 /* v.ast.ForStmt */) { + if (stmt._typ == 349 /* v.ast.ForStmt */) { (*stmt._v__ast__ForStmt).label = name; v__ast__Stmt _t7 = v__ast__ForStmt_to_sumtype_v__ast__Stmt(&(*stmt._v__ast__ForStmt)); return _t7; } - else if (stmt._typ == 347 /* v.ast.ForInStmt */) { + else if (stmt._typ == 348 /* v.ast.ForInStmt */) { (*stmt._v__ast__ForInStmt).label = name; v__ast__Stmt _t8 = v__ast__ForInStmt_to_sumtype_v__ast__Stmt(&(*stmt._v__ast__ForInStmt)); return _t8; } - else if (stmt._typ == 346 /* v.ast.ForCStmt */) { + else if (stmt._typ == 347 /* v.ast.ForCStmt */) { (*stmt._v__ast__ForCStmt).label = name; v__ast__Stmt _t9 = v__ast__ForCStmt_to_sumtype_v__ast__Stmt(&(*stmt._v__ast__ForCStmt)); return _t9; @@ -88121,10 +88414,10 @@ v__ast__Stmt v__parser__Parser_stmt(v__parser__Parser* p, bool is_top_level) { v__ast__Stmt _t11 = v__ast__GotoLabel_to_sumtype_v__ast__Stmt(ADDR(v__ast__GotoLabel, (((v__ast__GotoLabel){.name = name,.pos = v__token__Pos_extend(spos, v__token__Token_pos(&p->tok)),})))); return _t11; } else if (p->peek_tok.kind == v__token__Kind__name) { - v__ast__Stmt _t12 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected name `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + v__ast__Stmt _t12 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected name `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); return _t12; } else if (!p->inside_if_expr && !p->inside_match_body && !p->inside_or_expr && (p->peek_tok.kind == v__token__Kind__rcbr || p->peek_tok.kind == v__token__Kind__eof) && !v__parser__Parser_mark_var_as_used(p, p->tok.lit)) { - v__ast__Stmt _t13 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` evaluated but not used"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + v__ast__Stmt _t13 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` evaluated but not used"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); return _t13; } v__ast__Stmt _t14 = v__parser__Parser_parse_multi_expr(p, is_top_level); @@ -88472,10 +88765,10 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; } else if (p->tok.kind == (v__token__Kind__number)) { v__ast__Expr number_lit = v__parser__Parser_parse_number_literal(p); - if (number_lit._typ == 303 /* v.ast.FloatLiteral */) { + if (number_lit._typ == 304 /* v.ast.FloatLiteral */) { array_push((array*)&args, _MOV((v__ast__AsmArg[]){ v__ast__FloatLiteral_to_sumtype_v__ast__AsmArg(ADDR(v__ast__FloatLiteral, (((v__ast__FloatLiteral){(*number_lit._v__ast__FloatLiteral).val,(*number_lit._v__ast__FloatLiteral).pos,})))) })); } - else if (number_lit._typ == 310 /* v.ast.IntegerLiteral */) { + else if (number_lit._typ == 311 /* v.ast.IntegerLiteral */) { if (is_directive) { array_push((array*)&args, _MOV((v__ast__AsmArg[]){ v__ast__AsmDisp_to_sumtype_v__ast__AsmArg(ADDR(v__ast__AsmDisp, (((v__ast__AsmDisp){.val = (*number_lit._v__ast__IntegerLiteral).val,.pos = (*number_lit._v__ast__IntegerLiteral).pos,})))) })); } else { @@ -88484,7 +88777,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; } else { - v__parser__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("p.parse_number_literal() invalid output: `"), 0xfe10, {.d_s = v__ast__Expr_str(number_lit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("p.parse_number_literal() invalid output: `"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(number_lit)}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } ; @@ -88530,7 +88823,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; if (is_directive && (string__eq(name, _SLIT("globl")) || string__eq(name, _SLIT("global")))) { for (int _t12 = 0; _t12 < args.len; ++_t12) { v__ast__AsmArg arg = ((v__ast__AsmArg*)args.data)[_t12]; - array_push((array*)&p->global_labels, _MOV((string[]){ string_clone((/* as */ *(v__ast__AsmAlias*)__as_cast((arg)._v__ast__AsmAlias,(arg)._typ, 436) /*expected idx: 436, name: v.ast.AsmAlias */ ).name) })); + array_push((array*)&p->global_labels, _MOV((string[]){ string_clone((/* as */ *(v__ast__AsmAlias*)__as_cast((arg)._v__ast__AsmAlias,(arg)._typ, 437) /*expected idx: 437, name: v.ast.AsmAlias */ ).name) })); } } array_push((array*)&templates, _MOV((v__ast__AsmTemplate[]){ ((v__ast__AsmTemplate){ @@ -88632,7 +88925,7 @@ VV_LOCAL_SYMBOL v__ast__AsmArg v__parser__Parser_reg_or_alias(v__parser__Parser* } if (_IN_MAP(ADDR(string, p->prev_tok.lit), ADDR(map, p->scope->objects))) { v__ast__ScopeObject x = (*(v__ast__ScopeObject*)map_get(ADDR(map, p->scope->objects), &(string[]){p->prev_tok.lit}, &(v__ast__ScopeObject[]){ {0} })); - if ((x)._typ == 360 /* v.ast.AsmRegister */) { + if ((x)._typ == 361 /* v.ast.AsmRegister */) { v__ast__AsmArg _t1 = v__ast__AsmRegister_to_sumtype_v__ast__AsmArg(ADDR(v__ast__AsmRegister, ((*x._v__ast__AsmRegister)))); return _t1; } else { @@ -88806,7 +89099,7 @@ VV_LOCAL_SYMBOL Array_v__ast__AsmIO v__parser__Parser_asm_ios(v__parser__Parser* } } v__ast__Expr expr = v__parser__Parser_expr(p, 0); - if ((expr)._typ == 320 /* v.ast.ParExpr */) { + if ((expr)._typ == 321 /* v.ast.ParExpr */) { expr = (*expr._v__ast__ParExpr).expr; } else { v__parser__Parser_error(p, _SLIT("asm in/output must be enclosed in brackets")); @@ -88816,7 +89109,7 @@ VV_LOCAL_SYMBOL Array_v__ast__AsmIO v__parser__Parser_asm_ios(v__parser__Parser* v__parser__Parser_next(p); alias = p->tok.lit; v__parser__Parser_check(p, v__token__Kind__name); - } else if ((expr)._typ == 305 /* v.ast.Ident */) { + } else if ((expr)._typ == 306 /* v.ast.Ident */) { alias = (*expr._v__ast__Ident).name; } Array_v__ast__Comment comments = __new_array_with_default(0, 0, sizeof(v__ast__Comment), 0); @@ -88839,7 +89132,7 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Expr_Array_v__ast__Comment v__parser_ Array_v__ast__Comment comments = __new_array_with_default(0, 0, sizeof(v__ast__Comment), 0); for (;;) { v__ast__Expr expr = v__parser__Parser_expr(p, 0); - if ((expr)._typ == 295 /* v.ast.Comment */) { + if ((expr)._typ == 296 /* v.ast.Comment */) { array_push((array*)&comments, _MOV((v__ast__Comment[]){ (*expr._v__ast__Comment) })); } else { array_push((array*)&exprs, _MOV((v__ast__Expr[]){ expr })); @@ -88886,12 +89179,12 @@ VV_LOCAL_SYMBOL void v__parser__Parser_attributes(v__parser__Parser* p) { v__token__Pos start_pos = v__token__Token_pos(&p->tok); v__ast__Attr attr = v__parser__Parser_parse_attr(p); if (Array_v__ast__Attr_contains(p->attrs, attr.name) && !string__eq(attr.name, _SLIT("wasm_export"))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate attribute `"), 0xfe10, {.d_s = attr.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok))); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate attribute `"), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok))); return; } if (attr.kind == v__ast__AttrKind__comptime_define) { if (has_ctdefine) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only one `[if flag]` may be applied at a time `"), 0xfe10, {.d_s = attr.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok))); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only one `[if flag]` may be applied at a time `"), /*115 &string*/0xfe10, {.d_s = attr.name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok))); return; } else { has_ctdefine = true; @@ -88903,7 +89196,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_attributes(v__parser__Parser* p) { v__parser__Parser_next(p); break; } - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting `;`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting `;`"), 0, { .d_c = 0 }}}))); return; } v__parser__Parser_next(p); @@ -88937,7 +89230,7 @@ VV_LOCAL_SYMBOL v__ast__Attr v__parser__Parser_parse_attr(v__parser__Parser* p) p->comptime_if_cond = false; p->inside_if_expr = false; p->inside_ct_if_expr = false; - if ((comptime_cond)._typ == 321 /* v.ast.PostfixExpr */) { + if ((comptime_cond)._typ == 322 /* v.ast.PostfixExpr */) { comptime_cond_opt = true; } name = v__ast__Expr_str(comptime_cond); @@ -88971,7 +89264,7 @@ VV_LOCAL_SYMBOL v__ast__Attr v__parser__Parser_parse_attr(v__parser__Parser* p) arg = v__token__Kind_str(p->tok.kind); v__parser__Parser_next(p); } else { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", an argument is expected after `:`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", an argument is expected after `:`"), 0, { .d_c = 0 }}}))); } } } @@ -88991,12 +89284,12 @@ VV_LOCAL_SYMBOL v__ast__Attr v__parser__Parser_parse_attr(v__parser__Parser* p) void v__parser__Parser_language_not_allowed_error(v__parser__Parser* p, v__ast__Language language, v__token__Pos pos) { string upcase_language = string_to_upper(v__ast__Language_str(language)); - v__parser__Parser_error_with_pos(p, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = upcase_language}}, {_SLIT(" code is not allowed in ."), 0xfe10, {.d_s = v__ast__Language_str(p->file_backend_mode)}}, {_SLIT(".v files, please move it to a ."), 0xfe10, {.d_s = v__ast__Language_str(language)}}, {_SLIT(".v file"), 0, { .d_c = 0 }}})), pos); + v__parser__Parser_error_with_pos(p, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = upcase_language}}, {_SLIT(" code is not allowed in ."), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(p->file_backend_mode)}}, {_SLIT(".v files, please move it to a ."), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(language)}}, {_SLIT(".v file"), 0, { .d_c = 0 }}})), pos); } void v__parser__Parser_language_not_allowed_warning(v__parser__Parser* p, v__ast__Language language, v__token__Pos pos) { string upcase_language = string_to_upper(v__ast__Language_str(language)); - v__parser__Parser_warn_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = upcase_language}}, {_SLIT(" code will not be allowed in pure .v files, please move it to a ."), 0xfe10, {.d_s = v__ast__Language_str(language)}}, {_SLIT(".v file instead"), 0, { .d_c = 0 }}})), pos); + v__parser__Parser_warn_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = upcase_language}}, {_SLIT(" code will not be allowed in pure .v files, please move it to a ."), /*115 &v.ast.Language*/0xfe10, {.d_s = v__ast__Language_str(language)}}, {_SLIT(".v file instead"), 0, { .d_c = 0 }}})), pos); } void v__parser__Parser_check_for_impure_v(v__parser__Parser* p, v__ast__Language language, v__token__Pos pos) { @@ -89169,8 +89462,8 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_parse_multi_expr(v__parser__Parse } else if (!p->pref->translated && !p->is_translated && !p->pref->is_fmt && !(tok.kind == v__token__Kind__key_if || tok.kind == v__token__Kind__key_match || tok.kind == v__token__Kind__key_lock || tok.kind == v__token__Kind__key_rlock || tok.kind == v__token__Kind__key_select)) { for (int _t4 = 0; _t4 < left.len; ++_t4) { v__ast__Expr node = ((v__ast__Expr*)left.data)[_t4]; - if ((is_top_level || p->tok.kind != v__token__Kind__rcbr) && (node)._typ != 291 /* v.ast.CallExpr */ && (node)._typ != 321 /* v.ast.PostfixExpr */ && (node)._typ != 296 /* v.ast.ComptimeCall */ && (node)._typ != 325 /* v.ast.SelectorExpr */ && (node)._typ != 300 /* v.ast.DumpExpr */) { - bool is_complex_infix_expr = (node)._typ == 309 /* v.ast.InfixExpr */ && ((/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 309) /*expected idx: 309, name: v.ast.InfixExpr */ ).op == v__token__Kind__left_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 309) /*expected idx: 309, name: v.ast.InfixExpr */ ).op == v__token__Kind__right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 309) /*expected idx: 309, name: v.ast.InfixExpr */ ).op == v__token__Kind__unsigned_right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 309) /*expected idx: 309, name: v.ast.InfixExpr */ ).op == v__token__Kind__arrow); + if ((is_top_level || p->tok.kind != v__token__Kind__rcbr) && (node)._typ != 292 /* v.ast.CallExpr */ && (node)._typ != 322 /* v.ast.PostfixExpr */ && (node)._typ != 297 /* v.ast.ComptimeCall */ && (node)._typ != 326 /* v.ast.SelectorExpr */ && (node)._typ != 301 /* v.ast.DumpExpr */) { + bool is_complex_infix_expr = (node)._typ == 310 /* v.ast.InfixExpr */ && ((/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 310) /*expected idx: 310, name: v.ast.InfixExpr */ ).op == v__token__Kind__left_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 310) /*expected idx: 310, name: v.ast.InfixExpr */ ).op == v__token__Kind__right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 310) /*expected idx: 310, name: v.ast.InfixExpr */ ).op == v__token__Kind__unsigned_right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 310) /*expected idx: 310, name: v.ast.InfixExpr */ ).op == v__token__Kind__arrow); if (!is_complex_infix_expr) { v__ast__Stmt _t5 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("expression evaluated but not used"), v__ast__Expr_pos(node))))); return _t5; @@ -89209,9 +89502,9 @@ v__ast__Ident v__parser__Parser_parse_ident(v__parser__Parser* p, v__ast__Langua } if (p->tok.kind != v__token__Kind__name) { if (is_mut || is_static || is_volatile) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the `"), 0xfe10, {.d_s = v__token__Kind_str(modifier_kind)}}, {_SLIT("` keyword is invalid here"), 0, { .d_c = 0 }}})), mut_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("the `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(modifier_kind)}}, {_SLIT("` keyword is invalid here"), 0, { .d_c = 0 }}})), mut_pos); } else { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected token `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected token `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } v__ast__Ident _t1 = ((v__ast__Ident){.language = 0,.tok_kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comptime = 0,.scope = p->scope,.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.kind = 0,.info = {0},.is_mut = 0,}); return _t1; @@ -89238,7 +89531,7 @@ v__ast__Ident v__parser__Parser_parse_ident(v__parser__Parser* p, v__ast__Langua if (p->inside_match_body && string__eq(name, _SLIT("it"))) { } if (p->expr_mod.len > 0) { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = p->expr_mod}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = p->expr_mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } v__ast__Ident _t3 = ((v__ast__Ident){ .language = language, @@ -89418,11 +89711,11 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { cap_expr = v__parser__Parser_expr(p, 0); } else if (string__eq(key, _SLIT("len")) || string__eq(key, _SLIT("init"))) { - v__ast__Expr _t5 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = key}}, {_SLIT("` cannot be initialized for `chan`. Did you mean `cap`?"), 0, { .d_c = 0 }}})))))); + v__ast__Expr _t5 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("` cannot be initialized for `chan`. Did you mean `cap`?"), 0, { .d_c = 0 }}})))))); return _t5; } else { - v__ast__Expr _t6 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrong field `"), 0xfe10, {.d_s = key}}, {_SLIT("`, expecting `cap`"), 0, { .d_c = 0 }}})))))); + v__ast__Expr _t6 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("wrong field `"), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT("`, expecting `cap`"), 0, { .d_c = 0 }}})))))); return _t6; }; last_pos = v__token__Token_pos(&p->tok); @@ -89436,13 +89729,13 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { v__ast__Expr _t8 = v__parser__Parser_string_expr(p); return _t8; } else { - v__ast__Expr _t9 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only `c`, `r`, `js` are recognized string prefixes, but you tried to use `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); + v__ast__Expr _t9 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("only `c`, `r`, `js` are recognized string prefixes, but you tried to use `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})))))); return _t9; } } if (p->peek_tok.kind == v__token__Kind__chartoken && p->tok.lit.len == 1 && (string_at(p->tok.lit, 0) == 'r' || string_at(p->tok.lit, 0) == 'c')) { string opt = (string__eq(p->tok.lit, _SLIT("r")) ? (_SLIT("`r` (raw string)")) : (_SLIT("`c` (c string)"))); - v__ast__Expr _t10 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use "), 0xfe10, {.d_s = opt}}, {_SLIT(" with `byte` and `rune`"), 0, { .d_c = 0 }}})))))); + v__ast__Expr _t10 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot use "), /*115 &string*/0xfe10, {.d_s = opt}}, {_SLIT(" with `byte` and `rune`"), 0, { .d_c = 0 }}})))))); return _t10; } bool known_var = (v__token__Kind_is_assign(p->peek_tok.kind) ? (v__ast__Scope_known_var(p->scope, p->tok.lit)) : (v__parser__Parser_mark_var_as_used(p, p->tok.lit))); @@ -89511,7 +89804,7 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { } else if (p->peek_tok.kind == v__token__Kind__lpar || is_generic_call || is_generic_cast || (is_optional && v__parser__Parser_peek_token(p, 2).kind == v__token__Kind__lpar)) { string name = (is_optional ? (p->peek_tok.lit) : (p->tok.lit)); if (mod.len > 0) { - name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod}}, {_SLIT("."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); } string name_w_mod = v__parser__Parser_prepend_mod(p, name); if ((!known_var && (_IN_MAP(ADDR(string, name), ADDR(map, p->table->type_idxs)) || _IN_MAP(ADDR(string, name_w_mod), ADDR(map, p->table->type_idxs))) && !(string__eq(name, _SLIT("C.stat")) || string__eq(name, _SLIT("C.sigaction")))) || is_mod_cast || is_generic_cast || (language == v__ast__Language__v && name.len > 0 && u8_is_capital(string_at(name, 0)))) { @@ -89544,7 +89837,7 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { return _t18; } else { if (is_optional) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->prev_tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->prev_tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); } node = v__ast__CallExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__CallExpr, (v__parser__Parser_call_expr(p, language, mod)))); if (p->tok.kind == v__token__Kind__lpar && p->prev_tok.line_nr == p->tok.line_nr) { @@ -89666,7 +89959,7 @@ VV_LOCAL_SYMBOL v__ast__IndexExpr v__parser__Parser_index_expr(v__parser__Parser } if (p->tok.kind == v__token__Kind__question) { or_pos_high = v__token__Token_pos(&p->tok); - or_kind_high = v__ast__OrKind__propagate; + or_kind_high = v__ast__OrKind__propagate_option; v__parser__Parser_next(p); } } @@ -89710,7 +90003,7 @@ VV_LOCAL_SYMBOL v__ast__IndexExpr v__parser__Parser_index_expr(v__parser__Parser } if (p->tok.kind == v__token__Kind__question) { or_pos_low = v__token__Token_pos(&p->tok); - or_kind_low = v__ast__OrKind__propagate; + or_kind_low = v__ast__OrKind__propagate_option; v__parser__Parser_next(p); } } @@ -89745,7 +90038,7 @@ VV_LOCAL_SYMBOL v__ast__IndexExpr v__parser__Parser_index_expr(v__parser__Parser } if (p->tok.kind == v__token__Kind__question) { or_pos = v__token__Token_pos(&p->tok); - or_kind = v__ast__OrKind__propagate; + or_kind = v__ast__OrKind__propagate_option; v__parser__Parser_next(p); } } @@ -89822,12 +90115,13 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_dot_expr(v__parser__Parser* p, v_ v__parser__Parser_close_scope(p); p->inside_or_expr = was_inside_or_expr; } - if (p->tok.kind == v__token__Kind__question) { + if (p->tok.kind == v__token__Kind__question || p->tok.kind == v__token__Kind__not) { + bool is_not = p->tok.kind == v__token__Kind__not; v__parser__Parser_next(p); if (p->inside_defer) { v__parser__Parser_error_with_pos(p, _SLIT("error propagation not allowed inside `defer` blocks"), v__token__Token_pos(&p->prev_tok)); } - or_kind = v__ast__OrKind__propagate; + or_kind = (is_not ? (v__ast__OrKind__propagate_result) : (v__ast__OrKind__propagate_option)); } v__token__Pos end_pos = v__token__Token_pos(&p->prev_tok); v__token__Pos pos = v__token__Pos_extend(name_pos, end_pos); @@ -89870,11 +90164,11 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_dot_expr(v__parser__Parser* p, v_ bool is_mut = false; v__token__Pos mut_pos = ((v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}); if (p->inside_match || p->inside_if_expr || p->inside_for) { - if (left._typ == 305 /* v.ast.Ident */) { + if (left._typ == 306 /* v.ast.Ident */) { is_mut = (*left._v__ast__Ident).is_mut; mut_pos = (*left._v__ast__Ident).mut_pos; } - else if (left._typ == 325 /* v.ast.SelectorExpr */) { + else if (left._typ == 326 /* v.ast.SelectorExpr */) { is_mut = (*left._v__ast__SelectorExpr).is_mut; mut_pos = (*left._v__ast__SelectorExpr).mut_pos; } @@ -89927,10 +90221,10 @@ VV_LOCAL_SYMBOL multi_return_Array_v__ast__Type_Array_string v__parser__Parser_p v__parser__Parser_error(p, _SLIT("generic parameter name needs to be exactly one char")); } if (!v__util__is_generic_type_name(p->tok.lit)) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` is a reserved name and cannot be used for generics"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` is a reserved name and cannot be used for generics"), 0, { .d_c = 0 }}}))); } if (Array_string_contains(param_names, name)) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicated generic parameter `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicated generic parameter `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); } if (count > 8) { v__parser__Parser_error(p, _SLIT("cannot have more than 9 generic parameters")); @@ -90149,18 +90443,18 @@ VV_LOCAL_SYMBOL v__ast__Module v__parser__Parser_module_decl(v__parser__Parser* name = v__parser__Parser_check_name(p); mod_node = ((v__ast__Module){.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.pos = module_pos,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_skipped = 0,}); if (module_pos.line_nr != name_pos.line_nr) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`module` and `"), 0xfe10, {.d_s = name}}, {_SLIT("` must be at same line"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`module` and `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` must be at same line"), 0, { .d_c = 0 }}})), name_pos); v__ast__Module _t2 = mod_node; return _t2; } v__token__Pos n_pos = v__token__Token_pos(&p->tok); if (module_pos.line_nr == n_pos.line_nr && p->tok.kind != v__token__Kind__comment && p->tok.kind != v__token__Kind__eof) { if (p->tok.kind == v__token__Kind__name) { - v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`module "), 0xfe10, {.d_s = name}}, {_SLIT("`, you can only declare one module, unexpected `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})), n_pos); + v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`module "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, you can only declare one module, unexpected `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("`"), 0, { .d_c = 0 }}})), n_pos); v__ast__Module _t3 = mod_node; return _t3; } else { - v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`module "), 0xfe10, {.d_s = name}}, {_SLIT("`, unexpected `"), 0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` after module name"), 0, { .d_c = 0 }}})), n_pos); + v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`module "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, unexpected `"), /*115 &v.token.Kind*/0xfe10, {.d_s = v__token__Kind_str(p->tok.kind)}}, {_SLIT("` after module name"), 0, { .d_c = 0 }}})), n_pos); v__ast__Module _t4 = mod_node; return _t4; } @@ -90205,7 +90499,7 @@ VV_LOCAL_SYMBOL v__ast__Module v__parser__Parser_module_decl(v__parser__Parser* p->is_translated = true; } else { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown module attribute `["), 0xfe10, {.d_s = ma.name}}, {_SLIT("]`"), 0, { .d_c = 0 }}})), ma.pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown module attribute `["), /*115 &string*/0xfe10, {.d_s = ma.name}}, {_SLIT("]`"), 0, { .d_c = 0 }}})), ma.pos); v__ast__Module _t6 = mod_node; return _t6; }; @@ -90263,7 +90557,7 @@ VV_LOCAL_SYMBOL v__ast__Import v__parser__Parser_import_stmt(v__parser__Parser* v__token__Pos alias_pos = v__token__Token_pos(&p->tok); mod_alias = v__parser__Parser_check_name(p); if (string__eq(mod_alias, (*(string*)array_last(mod_name_arr)))) { - v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("import alias `"), 0xfe10, {.d_s = mod_name}}, {_SLIT(" as "), 0xfe10, {.d_s = mod_alias}}, {_SLIT("` is redundant"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); + v__parser__Parser_error_with_pos(p, str_intp(3, _MOV((StrIntpData[]){{_SLIT("import alias `"), /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(" as "), /*115 &string*/0xfe10, {.d_s = mod_alias}}, {_SLIT("` is redundant"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); v__ast__Import _t7 = import_node; return _t7; } @@ -90297,7 +90591,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_import_syms(v__parser__Parser* p, v__ast_ v__parser__Parser_next(p); v__token__Pos pos_t = v__token__Token_pos(&p->tok); if (p->tok.kind == v__token__Kind__rcbr) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("empty `"), 0xfe10, {.d_s = parent->mod}}, {_SLIT("` import set, remove `{}`"), 0, { .d_c = 0 }}})), pos_t); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("empty `"), /*115 &string*/0xfe10, {.d_s = parent->mod}}, {_SLIT("` import set, remove `{}`"), 0, { .d_c = 0 }}})), pos_t); return; } if (p->tok.kind != v__token__Kind__name) { @@ -90430,9 +90724,9 @@ VV_LOCAL_SYMBOL v__ast__Return v__parser__Parser_return_stmt(v__parser__Parser* v__ast__Return _t1 = ((v__ast__Return){.pos = first_pos,.comments = comments,.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.types = __new_array(0, 0, sizeof(v__ast__Type)),}); return _t1; } - multi_return_Array_v__ast__Expr_Array_v__ast__Comment mr_84307 = v__parser__Parser_expr_list(p); - Array_v__ast__Expr exprs = mr_84307.arg0; - Array_v__ast__Comment comments2 = mr_84307.arg1; + multi_return_Array_v__ast__Expr_Array_v__ast__Comment mr_84411 = v__parser__Parser_expr_list(p); + Array_v__ast__Expr exprs = mr_84411.arg0; + Array_v__ast__Comment comments2 = mr_84411.arg1; _PUSH_MANY(&comments, (comments2), _t2, Array_v__ast__Comment); v__token__Pos end_pos = v__ast__Expr_pos((*(v__ast__Expr*)array_last(exprs))); v__ast__Return _t3 = ((v__ast__Return){.pos = v__token__Pos_extend(first_pos, end_pos),.comments = comments,.exprs = exprs,.types = __new_array(0, 0, sizeof(v__ast__Type)),}); @@ -90491,40 +90785,40 @@ VV_LOCAL_SYMBOL v__ast__GlobalDecl v__parser__Parser_global_decl(v__parser__Pars if (has_expr) { v__parser__Parser_next(p); expr = v__parser__Parser_expr(p, 0); - if (expr._typ == 292 /* v.ast.CastExpr */) { + if (expr._typ == 293 /* v.ast.CastExpr */) { typ = (*expr._v__ast__CastExpr).typ; } - else if (expr._typ == 330 /* v.ast.StructInit */) { + else if (expr._typ == 331 /* v.ast.StructInit */) { typ = (*expr._v__ast__StructInit).typ; } - else if (expr._typ == 285 /* v.ast.ArrayInit */) { + else if (expr._typ == 286 /* v.ast.ArrayInit */) { typ = (*expr._v__ast__ArrayInit).typ; } - else if (expr._typ == 293 /* v.ast.ChanInit */) { + else if (expr._typ == 294 /* v.ast.ChanInit */) { typ = (*expr._v__ast__ChanInit).typ; } - else if (expr._typ == 289 /* v.ast.BoolLiteral */) { + else if (expr._typ == 290 /* v.ast.BoolLiteral */) { typ = _const_v__ast__bool_type; } - else if (expr._typ == 311 /* v.ast.IsRefType */) { + else if (expr._typ == 312 /* v.ast.IsRefType */) { typ = _const_v__ast__bool_type; } - else if (expr._typ == 294 /* v.ast.CharLiteral */) { + else if (expr._typ == 295 /* v.ast.CharLiteral */) { typ = _const_v__ast__char_type; } - else if (expr._typ == 303 /* v.ast.FloatLiteral */) { + else if (expr._typ == 304 /* v.ast.FloatLiteral */) { typ = _const_v__ast__f64_type; } - else if (expr._typ == 310 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { typ = _const_v__ast__int_type; } - else if (expr._typ == 326 /* v.ast.SizeOf */) { + else if (expr._typ == 327 /* v.ast.SizeOf */) { typ = _const_v__ast__int_type; } - else if (expr._typ == 329 /* v.ast.StringLiteral */) { + else if (expr._typ == 330 /* v.ast.StringLiteral */) { typ = _const_v__ast__string_type; } - else if (expr._typ == 328 /* v.ast.StringInterLiteral */) { + else if (expr._typ == 329 /* v.ast.StringInterLiteral */) { typ = _const_v__ast__string_type; } @@ -90583,7 +90877,7 @@ VV_LOCAL_SYMBOL v__ast__EnumDecl v__parser__Parser_enum_decl(v__parser__Parser* return _t1; } if (_IN_MAP(ADDR(string, enum_name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register enum `"), 0xfe10, {.d_s = enum_name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), end_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register enum `"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), end_pos); v__ast__EnumDecl _t2 = ((v__ast__EnumDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.is_flag = 0,.is_multi_allowed = 0,.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.fields = __new_array(0, 0, sizeof(v__ast__EnumField)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},}); return _t2; } @@ -90632,7 +90926,7 @@ VV_LOCAL_SYMBOL v__ast__EnumDecl v__parser__Parser_enum_decl(v__parser__Parser* } } string pubfn = (string__eq(p->mod, _SLIT("main")) ? (_SLIT("fn")) : (_SLIT("pub fn"))); - v__parser__Parser_codegen(p, str_intp(21, _MOV((StrIntpData[]){{_SLIT("\n//\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), 0xfe10, {.d_s = enum_name}}, {_SLIT(") is_empty() bool { return int(*e) == 0 }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), 0xfe10, {.d_s = enum_name}}, {_SLIT(") has(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") bool { return (int(*e) & (int(flag))) != 0 }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), 0xfe10, {.d_s = enum_name}}, {_SLIT(") all(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") bool { return (int(*e) & (int(flag))) == int(flag) }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") set(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), 0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) | (int(flag))) } }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") clear(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), 0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) & ~(int(flag))) } }\n[inline] "), 0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") toggle(flag "), 0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), 0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) ^ (int(flag))) } }\n//\n"), 0, { .d_c = 0 }}}))); + v__parser__Parser_codegen(p, str_intp(21, _MOV((StrIntpData[]){{_SLIT("\n//\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") is_empty() bool { return int(*e) == 0 }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") has(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") bool { return (int(*e) & (int(flag))) != 0 }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" ( e &"), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") all(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") bool { return (int(*e) & (int(flag))) == int(flag) }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") set(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) | (int(flag))) } }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") clear(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) & ~(int(flag))) } }\n[inline] "), /*115 &string*/0xfe10, {.d_s = pubfn}}, {_SLIT(" (mut e "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") toggle(flag "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(") { unsafe{ *e = "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT("(int(*e) ^ (int(flag))) } }\n//\n"), 0, { .d_c = 0 }}}))); } int idx = v__ast__Table_register_sym(p->table, ((v__ast__TypeSymbol){ .parent_idx = 0, @@ -90647,7 +90941,7 @@ VV_LOCAL_SYMBOL v__ast__EnumDecl v__parser__Parser_enum_decl(v__parser__Parser* .idx = 0, })); if (idx == -1) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register enum `"), 0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), end_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register enum `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), end_pos); } v__ast__EnumDecl enum_decl = ((v__ast__EnumDecl){ .name = name, @@ -90681,13 +90975,13 @@ VV_LOCAL_SYMBOL v__ast__TypeDecl v__parser__Parser_type_decl(v__parser__Parser* return _t1; } if (_IN_MAP(ADDR(string, name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register alias `"), 0xfe10, {.d_s = name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), end_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register alias `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), end_pos); v__ast__TypeDecl _t2 = v__ast__AliasTypeDecl_to_sumtype_v__ast__TypeDecl(ADDR(v__ast__AliasTypeDecl, (((v__ast__AliasTypeDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.parent_type = 0,.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),})))); return _t2; } Array_v__ast__TypeNode sum_variants = __new_array_with_default(0, 0, sizeof(v__ast__TypeNode), 0); - multi_return_Array_v__ast__Type_Array_string mr_90504 = v__parser__Parser_parse_generic_types(p); - Array_v__ast__Type generic_types = mr_90504.arg0; + multi_return_Array_v__ast__Type_Array_string mr_90608 = v__parser__Parser_parse_generic_types(p); + Array_v__ast__Type generic_types = mr_90608.arg0; v__token__Pos decl_pos_with_generics = v__token__Pos_extend(decl_pos, v__token__Token_pos(&p->prev_tok)); v__parser__Parser_check(p, v__token__Kind__assign); v__token__Pos type_pos = v__token__Token_pos(&p->tok); @@ -90747,7 +91041,7 @@ VV_LOCAL_SYMBOL v__ast__TypeDecl v__parser__Parser_type_decl(v__parser__Parser* .idx = 0, })); if (typ == _const_v__ast__invalid_type_idx) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register sum type `"), 0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register sum type `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); v__ast__TypeDecl _t9 = v__ast__SumTypeDecl_to_sumtype_v__ast__TypeDecl(ADDR(v__ast__SumTypeDecl, (((v__ast__SumTypeDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.typ = 0,.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.variants = __new_array(0, 0, sizeof(v__ast__TypeNode)),})))); return _t9; } @@ -90788,13 +91082,13 @@ VV_LOCAL_SYMBOL v__ast__TypeDecl v__parser__Parser_type_decl(v__parser__Parser* })); v__token__Pos type_end_pos = v__token__Token_pos(&p->prev_tok); if (idx == _const_v__ast__invalid_type_idx) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register alias `"), 0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register alias `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); v__ast__TypeDecl _t12 = v__ast__AliasTypeDecl_to_sumtype_v__ast__TypeDecl(ADDR(v__ast__AliasTypeDecl, (((v__ast__AliasTypeDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.parent_type = 0,.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),})))); return _t12; } if (idx == pidx) { v__token__Pos type_alias_pos = (*(v__ast__TypeNode*)/*ee elem_sym */array_get(sum_variants, 0)).pos; - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("a type alias can not refer to itself: "), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Pos_extend(decl_pos, type_alias_pos)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("a type alias can not refer to itself: "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Pos_extend(decl_pos, type_alias_pos)); v__ast__TypeDecl _t13 = v__ast__AliasTypeDecl_to_sumtype_v__ast__TypeDecl(ADDR(v__ast__AliasTypeDecl, (((v__ast__AliasTypeDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.is_pub = 0,.parent_type = 0,.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,},.comments = __new_array(0, 0, sizeof(v__ast__Comment)),})))); return _t13; } @@ -90816,7 +91110,7 @@ VV_LOCAL_SYMBOL v__ast__Assoc v__parser__Parser_assoc(v__parser__Parser* p) { Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(p->scope, var_name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown variable `"), 0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown variable `"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); v__ast__Assoc _t2 = ((v__ast__Assoc){.var_name = (string){.str=(byteptr)"", .is_lit=1},.fields = __new_array(0, 0, sizeof(string)),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.typ = 0,.scope = 0,}); return _t2; } @@ -90889,12 +91183,12 @@ bool v__parser__Parser_mark_var_as_used(v__parser__Parser* p, string varname) { Option_v__ast__ScopeObject _t1; if (_t1 = v__ast__Scope_find(p->scope, varname), _t1.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t1.data; - if (obj._typ == 363 /* v.ast.Var */) { + if (obj._typ == 364 /* v.ast.Var */) { (*obj._v__ast__Var).is_used = true; bool _t2 = true; return _t2; } - else if (obj._typ == 362 /* v.ast.GlobalField */) { + else if (obj._typ == 363 /* v.ast.GlobalField */) { bool _t3 = true; return _t3; } @@ -90931,7 +91225,7 @@ bool v__parser__Parser_unsafe_stmt_defer_0 = false; v__parser__Parser_unsafe_stmt_defer_0 = true; v__ast__Stmt stmt = v__parser__Parser_stmt(p, false); if (p->tok.kind == v__token__Kind__rcbr) { - if ((stmt)._typ == 345 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { if (v__ast__Expr_is_expr((*stmt._v__ast__ExprStmt).expr)) { v__parser__Parser_next(p); v__token__Pos_update_last_line(&pos, p->prev_tok.line_nr); @@ -90967,7 +91261,7 @@ bool v__parser__Parser_unsafe_stmt_defer_0 = false; VV_LOCAL_SYMBOL void v__parser__Parser_trace(v__parser__Parser* p, string fbase, string message) { if (string__eq(p->file_base, fbase)) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> p.trace | "), 0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), 0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("> p.trace | "), /*115 &string*/0x14fe10, {.d_s = fbase}}, {_SLIT(" | "), /*115 &string*/0xfe10, {.d_s = message}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } @@ -90977,7 +91271,7 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_sql_expr(v__parser__Parser* p) { Option_v__ast__Expr _t1 = v__parser__Parser_check_expr(p, 0); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - *(v__ast__Expr*) _t1.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting database"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + *(v__ast__Expr*) _t1.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting database"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); } v__ast__Expr db_expr = (*(v__ast__Expr*)_t1.data); @@ -90998,13 +91292,13 @@ VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_sql_expr(v__parser__Parser* p) { if (has_where) { v__parser__Parser_next(p); where_expr = v__parser__Parser_expr(p, 0); - if (!is_count && (where_expr)._typ == 309 /* v.ast.InfixExpr */) { - if ((*where_expr._v__ast__InfixExpr).op == v__token__Kind__eq && ((*where_expr._v__ast__InfixExpr).left)._typ == 305 /* v.ast.Ident */) { + if (!is_count && (where_expr)._typ == 310 /* v.ast.InfixExpr */) { + if ((*where_expr._v__ast__InfixExpr).op == v__token__Kind__eq && ((*where_expr._v__ast__InfixExpr).left)._typ == 306 /* v.ast.Ident */) { if (string__eq((*(*where_expr._v__ast__InfixExpr).left._v__ast__Ident).name, _SLIT("id"))) { query_one = true; } } - if (((*where_expr._v__ast__InfixExpr).right)._typ == 305 /* v.ast.Ident */) { + if (((*where_expr._v__ast__InfixExpr).right)._typ == 306 /* v.ast.Ident */) { if (!v__ast__Scope_known_var(p->scope, (*(*where_expr._v__ast__InfixExpr).right._v__ast__Ident).name)) { Option_void _t2 = v__parser__Parser_check_undefined_variables(p, new_array_from_c_array(1, 1, sizeof(v__ast__Expr), _MOV((v__ast__Expr[1]){(*where_expr._v__ast__InfixExpr).left})), (*where_expr._v__ast__InfixExpr).right); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { @@ -91091,7 +91385,7 @@ bool v__parser__Parser_sql_stmt_defer_0 = false; Option_v__ast__Expr _t1 = v__parser__Parser_check_expr(p, 0); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - *(v__ast__Expr*) _t1.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), 0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting database"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); + *(v__ast__Expr*) _t1.data = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid expression: unexpected "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT(", expecting database"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); } v__ast__Expr db_expr = (*(v__ast__Expr*)_t1.data); @@ -91124,7 +91418,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par kind = v__ast__SqlStmtKind__create; string table = v__parser__Parser_check_name(p); if (!string__eq(table, _SLIT("table"))) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `table` got `"), 0xfe10, {.d_s = table}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `table` got `"), /*115 &string*/0xfe10, {.d_s = table}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); v__ast__SqlStmtLine _t1 = ((v__ast__SqlStmtLine){.kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.where_expr = {0},.update_exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.object_var_name = (string){.str=(byteptr)"", .is_lit=1},.updated_columns = __new_array(0, 0, sizeof(string)),.table_expr = (v__ast__TypeNode){.typ = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlStmtLine), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop),}); return _t1; } @@ -91136,7 +91430,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par kind = v__ast__SqlStmtKind__drop; string table = v__parser__Parser_check_name(p); if (!string__eq(table, _SLIT("table"))) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `table` got `"), 0xfe10, {.d_s = table}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("expected `table` got `"), /*115 &string*/0xfe10, {.d_s = table}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); v__ast__SqlStmtLine _t3 = ((v__ast__SqlStmtLine){.kind = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.where_expr = {0},.update_exprs = __new_array(0, 0, sizeof(v__ast__Expr)),.object_var_name = (string){.str=(byteptr)"", .is_lit=1},.updated_columns = __new_array(0, 0, sizeof(string)),.table_expr = (v__ast__TypeNode){.typ = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},},.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.sub_structs = new_map(sizeof(int), sizeof(v__ast__SqlStmtLine), &map_hash_int_4, &map_eq_int_4, &map_clone_int_4, &map_free_nop),}); return _t3; } @@ -91152,7 +91446,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par table_type = v__parser__Parser_parse_type(p); } else if (kind == v__ast__SqlStmtKind__insert) { v__ast__Expr expr = v__parser__Parser_expr(p, 0); - if ((expr)._typ == 305 /* v.ast.Ident */) { + if ((expr)._typ == 306 /* v.ast.Ident */) { inserted_var_name = (*expr._v__ast__Ident).name; } else { v__parser__Parser_error(p, _SLIT("can only insert variables")); @@ -91234,7 +91528,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par VV_LOCAL_SYMBOL Option_bool v__parser__Parser_check_sql_keyword(v__parser__Parser* p, string name) { if (!string__eq(v__parser__Parser_check_name(p), name)) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm: expecting `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("orm: expecting `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } Option_bool _t2; @@ -91280,7 +91574,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; Array_v__ast__Type generic_types = mr_1547.arg0; bool no_body = p->tok.kind != v__token__Kind__lcbr; if (language == v__ast__Language__v && no_body) { - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` lacks body"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` lacks body"), 0, { .d_c = 0 }}}))); v__ast__StructDecl _t2 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -91290,7 +91584,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; return _t2; } if (language == v__ast__Language__v && !p->builtin_mod && !p->is_translated && name.len > 0 && !u8_is_capital(string_at(name, 0)) && !p->pref->translated && !p->is_translated) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct name `"), 0xfe10, {.d_s = name}}, {_SLIT("` must begin with capital letter"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct name `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("` must begin with capital letter"), 0, { .d_c = 0 }}})), name_pos); v__ast__StructDecl _t3 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -91310,7 +91604,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; return _t4; } if (_IN_MAP(ADDR(string, name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register struct `"), 0xfe10, {.d_s = name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register struct `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), name_pos); v__ast__StructDecl _t5 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -91321,10 +91615,10 @@ bool v__parser__Parser_struct_decl_defer_0 = false; } string orig_name = name; if (language == v__ast__Language__c) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); orig_name = name; } else if (language == v__ast__Language__js) { - name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), 0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); + name = str_intp(2, _MOV((StrIntpData[]){{_SLIT("JS."), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT0, 0, { .d_c = 0 }}})); orig_name = name; } else { name = v__parser__Parser_prepend_mod(p, name); @@ -91483,7 +91777,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; } v__ast__TypeSymbol* sym = v__ast__Table_sym(p->table, typ); if (Array_v__ast__Type_contains(embed_types, typ)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot embed `"), 0xfe10, {.d_s = sym->name}}, {_SLIT("` more than once"), 0, { .d_c = 0 }}})), type_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot embed `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("` more than once"), 0, { .d_c = 0 }}})), type_pos); v__ast__StructDecl _t15 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -91494,7 +91788,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; } field_name = v__ast__TypeSymbol_embed_name(sym); if (Array_string_contains(embed_field_names, field_name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate field `"), 0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), type_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate field `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), type_pos); v__ast__StructDecl _t16 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -91540,7 +91834,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; if (p->tok.kind == v__token__Kind__assign) { v__parser__Parser_next(p); default_expr = v__parser__Parser_expr(p, 0); - if (default_expr._typ == 302 /* v.ast.EnumVal */) { + if (default_expr._typ == 303 /* v.ast.EnumVal */) { (*default_expr._v__ast__EnumVal).typ = typ; } @@ -91613,7 +91907,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; .idx = 0, }); if (v__ast__Table_has_deep_child_no_ref(p->table, &t, name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid recursive struct `"), 0xfe10, {.d_s = orig_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("invalid recursive struct `"), /*115 &string*/0xfe10, {.d_s = orig_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), name_pos); v__ast__StructDecl _t26 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -91625,7 +91919,7 @@ bool v__parser__Parser_struct_decl_defer_0 = false; int ret = 0; ret = v__ast__Table_register_sym(p->table, t); if (ret == -1 && language != v__ast__Language__c) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register struct `"), 0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register struct `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); v__ast__StructDecl _t27 = ((v__ast__StructDecl){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = (string){.str=(byteptr)"", .is_lit=1},.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.is_pub = 0,.mut_pos = 0,.pub_pos = 0,.pub_mut_pos = 0,.global_pos = 0,.module_pos = 0,.language = 0,.is_union = 0,.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.embeds = __new_array(0, 0, sizeof(v__ast__Embed)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),}); // Defer begin if (v__parser__Parser_struct_decl_defer_0) { @@ -91782,7 +92076,7 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser v__parser__Parser_check(p, v__token__Kind__lcbr); Array_v__ast__Comment pre_comments = v__parser__Parser_eat_comments(p, ((v__parser__EatCommentsConfig){.same_line = 0,.follow_up = 0,})); if (_IN_MAP(ADDR(string, modless_name), ADDR(map, p->imported_symbols))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register interface `"), 0xfe10, {.d_s = interface_name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register interface `"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("`, this type was already imported"), 0, { .d_c = 0 }}})), name_pos); v__ast__InterfaceDecl _t1 = ((v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.language = 0,.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,}); return _t1; } @@ -91799,13 +92093,13 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser .idx = 0, })); if (reg_idx == -1) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register interface `"), 0xfe10, {.d_s = interface_name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot register interface `"), /*115 &string*/0xfe10, {.d_s = interface_name}}, {_SLIT("`, another type with this name exists"), 0, { .d_c = 0 }}})), name_pos); v__ast__InterfaceDecl _t2 = ((v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.language = 0,.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,}); return _t2; } v__ast__Type typ = v__ast__new_type(reg_idx); v__ast__TypeSymbol* ts = v__ast__Table_sym(p->table, typ); - v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 473) /*expected idx: 473, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 474) /*expected idx: 474, name: v.ast.Interface */ ; ts->methods = __new_array_with_default(0, 20, sizeof(v__ast__Fn), 0); Array_v__ast__StructField fields = __new_array_with_default(0, 20, sizeof(v__ast__StructField), 0); Array_v__ast__FnDecl methods = __new_array_with_default(0, 20, sizeof(v__ast__FnDecl), 0); @@ -91814,7 +92108,7 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser Array_v__ast__InterfaceEmbedding ifaces = __new_array_with_default(0, 0, sizeof(v__ast__InterfaceEmbedding), 0); for (;;) { if (!(p->tok.kind != v__token__Kind__rcbr && p->tok.kind != v__token__Kind__eof)) break; - if (p->tok.kind == v__token__Kind__name && p->tok.lit.len > 0 && u8_is_capital(string_at(p->tok.lit, 0)) && p->peek_tok.kind != v__token__Kind__lpar) { + if (p->tok.kind == v__token__Kind__name && p->tok.lit.len > 0 && u8_is_capital(string_at(p->tok.lit, 0)) && (p->peek_tok.line_nr != p->tok.line_nr || !(p->peek_tok.kind == v__token__Kind__name || p->peek_tok.kind == v__token__Kind__amp || p->peek_tok.kind == v__token__Kind__lsbr || p->peek_tok.kind == v__token__Kind__lpar))) { v__token__Pos iface_pos = v__token__Token_pos(&p->tok); string iface_name = p->tok.lit; v__ast__Type iface_type = v__parser__Parser_parse_type(p); @@ -91830,12 +92124,12 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser } if (p->tok.kind == v__token__Kind__name && p->peek_tok.kind == v__token__Kind__dot) { if (!_IN_MAP(ADDR(string, p->tok.lit), ADDR(map, p->imports))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("mod `"), 0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` not imported"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("mod `"), /*115 &string*/0xfe10, {.d_s = p->tok.lit}}, {_SLIT("` not imported"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok)); break; } string mod_name = p->tok.lit; v__ast__Type from_mod_typ = v__parser__Parser_parse_type(p); - string from_mod_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = mod_name}}, {_SLIT("."), 0xfe10, {.d_s = p->prev_tok.lit}}, {_SLIT0, 0, { .d_c = 0 }}})); + string from_mod_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = p->prev_tok.lit}}, {_SLIT0, 0, { .d_c = 0 }}})); if (string_is_lower(from_mod_name)) { v__parser__Parser_error_with_pos(p, _SLIT("The interface name need to have the pascal case"), v__token__Token_pos(&p->prev_tok)); break; @@ -91862,18 +92156,18 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser int line_nr = p->tok.line_nr; string name = v__parser__Parser_check_name(p); if (string__eq(name, _SLIT("type_name")) || string__eq(name, _SLIT("type_idx"))) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot override built-in method `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method_start_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot override built-in method `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method_start_pos); v__ast__InterfaceDecl _t6 = ((v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.language = 0,.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,}); return _t6; } if (v__ast__TypeSymbol_has_method(ts, name)) { - v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method_start_pos); + v__parser__Parser_error_with_pos(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("duplicate method `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), method_start_pos); v__ast__InterfaceDecl _t7 = ((v__ast__InterfaceDecl){.name = (string){.str=(byteptr)"", .is_lit=1},.typ = 0,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.language = 0,.field_names = __new_array(0, 0, sizeof(string)),.is_pub = 0,.mut_pos = 0,.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.methods = __new_array(0, 0, sizeof(v__ast__FnDecl)),.fields = __new_array(0, 0, sizeof(v__ast__StructField)),.embeds = __new_array(0, 0, sizeof(v__ast__InterfaceEmbedding)),.are_embeds_expanded = 0,}); return _t7; } - multi_return_Array_v__ast__Param_bool_bool mr_16079 = v__parser__Parser_fn_args(p); - Array_v__ast__Param args2 = mr_16079.arg0; - bool is_variadic = mr_16079.arg2; + multi_return_Array_v__ast__Param_bool_bool mr_16146 = v__parser__Parser_fn_args(p); + Array_v__ast__Param args2 = mr_16146.arg0; + bool is_variadic = mr_16146.arg2; Array_v__ast__Param args = new_array_from_c_array(1, 1, sizeof(v__ast__Param), _MOV((v__ast__Param[1]){((v__ast__Param){.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.name = _SLIT("x"),.is_mut = is_mut,.is_auto_rec = 0,.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.is_hidden = true,.typ = typ,})})); _PUSH_MANY(&args, (args2), _t8, Array_v__ast__Param); v__ast__FnDecl method = ((v__ast__FnDecl){ @@ -92090,7 +92384,7 @@ VV_LOCAL_SYMBOL bool v__parser__is_html_open_tag(string name, string s) { bool _t7 = false; return _t7; } - if (!string__eq(string_substr(sub, 0, len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = name}}, {_SLIT(" "), 0, { .d_c = 0 }}})))) { + if (!string__eq(string_substr(sub, 0, len + 1), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(" "), 0, { .d_c = 0 }}})))) { bool _t8 = false; return _t8; } @@ -92101,7 +92395,7 @@ VV_LOCAL_SYMBOL bool v__parser__is_html_open_tag(string name, string s) { } VV_LOCAL_SYMBOL string v__parser__insert_template_code(string fn_name, string tmpl_str_start, string line) { - string trailing_bs = string__plus(string__plus(_const_v__parser__tmpl_str_end, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(".write_u8(92)\n"), 0, { .d_c = 0 }}}))), tmpl_str_start); + string trailing_bs = string__plus(string__plus(_const_v__parser__tmpl_str_end, str_intp(2, _MOV((StrIntpData[]){{_SLIT("sb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(".write_u8(92)\n"), 0, { .d_c = 0 }}}))), tmpl_str_start); Array_string round1 = new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("\\"), _SLIT("\\\\"), _SLIT("'"), _SLIT("\\'"), _SLIT("@"), _SLIT("$")})); Array_string round2 = new_array_from_c_array(4, 4, sizeof(string), _MOV((string[4]){_SLIT("$$"), _SLIT("\\@"), _SLIT(".$"), _SLIT(".@")})); string rline = string_replace_each(string_replace_each(line, round1), round2); @@ -92116,7 +92410,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp Option_Array_string _t1 = os__read_lines(template_file); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("reading from "), 0xfe10, {.d_s = template_file}}, {_SLIT(" failed"), 0, { .d_c = 0 }}}))); + v__parser__Parser_error(p, str_intp(2, _MOV((StrIntpData[]){{_SLIT("reading from "), /*115 &string*/0xfe10, {.d_s = template_file}}, {_SLIT(" failed"), 0, { .d_c = 0 }}}))); string _t2 = _SLIT(""); return _t2; } @@ -92124,9 +92418,9 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp Array_string lines = (*(Array_string*)_t1.data); string basepath = os__dir(template_file); int lstartlength = lines.len * 30; - string tmpl_str_start = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tsb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(".write_string('"), 0, { .d_c = 0 }}})); + string tmpl_str_start = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tsb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(".write_string('"), 0, { .d_c = 0 }}})); strings__Builder source = strings__new_builder(1000); - strings__Builder_writeln(&source, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nimport strings\n// === vweb html template ===\nfn vweb_tmpl_"), 0xfe10, {.d_s = fn_name}}, {_SLIT("() string {\n mut sb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(" := strings.new_builder("), 0xfe07, {.d_i32 = lstartlength}}, {_SLIT(")\n\n\n"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\nimport strings\n// === vweb html template ===\nfn vweb_tmpl_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("() string {\n mut sb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" := strings.new_builder("), /*100 &int*/0xfe07, {.d_i32 = lstartlength}}, {_SLIT(")\n\n\n"), 0, { .d_c = 0 }}}))); strings__Builder_write_string(&source, tmpl_str_start); v__parser__State state = v__parser__State__simple; string template_ext = os__file_ext(template_file); @@ -92179,7 +92473,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp if (string_contains(file_name, _SLIT("/")) && string_starts_with(file_name, _SLIT("/"))) { templates_folder = _SLIT(""); } - string file_path = os__real_path(os__join_path_single(templates_folder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = file_name}}, {_SLIT0, 0xfe10, {.d_s = file_ext}}, {_SLIT0, 0, { .d_c = 0 }}})))); + string file_path = os__real_path(os__join_path_single(templates_folder, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = file_name}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = file_ext}}, {_SLIT0, 0, { .d_c = 0 }}})))); Option_string _t5 = os__read_file(file_path); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; @@ -92190,7 +92484,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } int position = (*(int*)_t6.data) + 9; - v__parser__Parser_error_with_error(p, ((v__errors__Error){.message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Reading file "), 0xfe10, {.d_s = file_name}}, {_SLIT(" from path: "), 0xfe10, {.d_s = file_path}}, {_SLIT(" failed"), 0, { .d_c = 0 }}})),.details = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to @include '"), 0xfe10, {.d_s = file_name}}, {_SLIT("'"), 0, { .d_c = 0 }}})),.file_path = template_file,.pos = ((v__token__Pos){.len = 9 + file_name.len,.line_nr = tline_number,.pos = start_of_line_pos + position,.col = 0,.last_line = lines.len,}),.backtrace = (string){.str=(byteptr)"", .is_lit=1},.reporter = v__errors__Reporter__parser,})); + v__parser__Parser_error_with_error(p, ((v__errors__Error){.message = str_intp(3, _MOV((StrIntpData[]){{_SLIT("Reading file "), /*115 &string*/0xfe10, {.d_s = file_name}}, {_SLIT(" from path: "), /*115 &string*/0xfe10, {.d_s = file_path}}, {_SLIT(" failed"), 0, { .d_c = 0 }}})),.details = str_intp(2, _MOV((StrIntpData[]){{_SLIT("Failed to @include '"), /*115 &string*/0xfe10, {.d_s = file_name}}, {_SLIT("'"), 0, { .d_c = 0 }}})),.file_path = template_file,.pos = ((v__token__Pos){.len = 9 + file_name.len,.line_nr = tline_number,.pos = start_of_line_pos + position,.col = 0,.last_line = lines.len,}),.backtrace = (string){.str=(byteptr)"", .is_lit=1},.reporter = v__errors__Reporter__parser,})); *(string*) _t5.data = _SLIT(""); } @@ -92281,18 +92575,18 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp string line_t = string_trim_space(line); if (string_starts_with(line_t, _SLIT("span.")) && string_ends_with(line, _SLIT("{"))) { string _v_class = string_trim_space(string_find_between(line, _SLIT("span."), _SLIT("{"))); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT(""), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT(""), 0, { .d_c = 0 }}}))); in_span = true; continue; } else if (string_starts_with(line_t, _SLIT(".")) && string_ends_with(line, _SLIT("{"))) { string _v_class = string_trim_space(string_find_between(line, _SLIT("."), _SLIT("{"))); string trimmed = string_trim_space(line); strings__Builder_write_string(&source, strings__repeat('\t', line.len - trimmed.len)); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("
"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("
"), 0, { .d_c = 0 }}}))); continue; } else if (string_starts_with(line_t, _SLIT("#")) && string_ends_with(line, _SLIT("{"))) { string _v_class = string_trim_space(string_find_between(line, _SLIT("#"), _SLIT("{"))); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("
"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("
"), 0, { .d_c = 0 }}}))); continue; } else if (string__eq(line_t, _SLIT("}"))) { strings__Builder_write_string(&source, strings__repeat('\t', line.len - line_t.len)); @@ -92322,17 +92616,17 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp strings__Builder_writeln(&source, v__parser__insert_template_code(fn_name, tmpl_str_start, line)); } strings__Builder_writeln(&source, _const_v__parser__tmpl_str_end); - strings__Builder_writeln(&source, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(" := sb_"), 0xfe10, {.d_s = fn_name}}, {_SLIT(".str() "), 0, { .d_c = 0 }}}))); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn _tmpl_res_"), 0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t_tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(" := sb_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT(".str() "), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\treturn _tmpl_res_"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); strings__Builder_writeln(&source, _SLIT("}")); - strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// === end of vweb html template_file: "), 0xfe10, {.d_s = template_file}}, {_SLIT(" ==="), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&source, str_intp(2, _MOV((StrIntpData[]){{_SLIT("// === end of vweb html template_file: "), /*115 &string*/0xfe10, {.d_s = template_file}}, {_SLIT(" ==="), 0, { .d_c = 0 }}}))); string result = strings__Builder_str(&source); string _t12 = result; return _t12; } void v__callgraph__show(v__ast__Table* table, v__pref__Preferences* pref, Array_v__ast__File_ptr ast_files) { - v__callgraph__Mapper* mapper = ((v__callgraph__Mapper*)memdup(&(v__callgraph__Mapper){.pos = 0,.pref = pref,.table = table,.file = 0,.node = 0,.fn_decl = 0,.caller_name = (string){.str=(byteptr)"", .is_lit=1},.dot_caller_name = (string){.str=(byteptr)"", .is_lit=1},.is_caller_used = 0,.dg = *v__dotgraph__new(_SLIT("CallGraph"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("CallGraph for "), 0xfe10, {.d_s = pref->path}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("green")),}, sizeof(v__callgraph__Mapper))); + v__callgraph__Mapper* mapper = ((v__callgraph__Mapper*)memdup(&(v__callgraph__Mapper){.pos = 0,.pref = pref,.table = table,.file = 0,.node = 0,.fn_decl = 0,.caller_name = (string){.str=(byteptr)"", .is_lit=1},.dot_caller_name = (string){.str=(byteptr)"", .is_lit=1},.is_caller_used = 0,.dg = *v__dotgraph__new(_SLIT("CallGraph"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("CallGraph for "), /*115 &string*/0xfe10, {.d_s = pref->path}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("green")),}, sizeof(v__callgraph__Mapper))); for (int _t1 = 0; _t1 < ast_files.len; ++_t1) { v__ast__File* afile = ((v__ast__File**)ast_files.data)[_t1]; v__ast__walker__walk(HEAP(v__ast__walker__Visitor, /*&v.ast.walker.Visitor*/I_v__callgraph__Mapper_to_Interface_v__ast__walker__Visitor(mapper)), HEAP(v__ast__Node, v__ast__File_to_sumtype_v__ast__Node(afile))); @@ -92356,7 +92650,7 @@ VV_LOCAL_SYMBOL string v__callgraph__Mapper_fn_name(v__callgraph__Mapper* m, str return _t1; } v__ast__TypeSymbol* rec_sym = v__ast__Table_sym(m->table, receiver_type); - string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = rec_sym->name}}, {_SLIT("."), 0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}})); + string _t2 = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = rec_sym->name}}, {_SLIT("."), /*115 &string*/0xfe10, {.d_s = fname}}, {_SLIT0, 0, { .d_c = 0 }}})); return _t2; } @@ -92371,11 +92665,11 @@ VV_LOCAL_SYMBOL string v__callgraph__Mapper_dot_fn_name(v__callgraph__Mapper* m, VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node) { m->node = node; - if (node->_typ == 209 /* v.ast.File */) { + if (node->_typ == 210 /* v.ast.File */) { m->file = &(*node->_v__ast__File); } - else if (node->_typ == 359 /* v.ast.Stmt */) { - if ((*node->_v__ast__Stmt)._typ == 218 /* v.ast.FnDecl */) { + else if (node->_typ == 360 /* v.ast.Stmt */) { + if ((*node->_v__ast__Stmt)._typ == 219 /* v.ast.FnDecl */) { m->is_caller_used = true; if (m->pref->skip_unused) { m->is_caller_used = (*(bool*)map_get(ADDR(map, m->table->used_fns), &(string[]){v__ast__FnDecl_fkey(&(*(*node->_v__ast__Stmt)._v__ast__FnDecl))}, &(bool[]){ 0 })); @@ -92392,8 +92686,8 @@ VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, } ; } - else if (node->_typ == 334 /* v.ast.Expr */) { - if ((*node->_v__ast__Expr)._typ == 291 /* v.ast.CallExpr */) { + else if (node->_typ == 335 /* v.ast.Expr */) { + if ((*node->_v__ast__Expr)._typ == 292 /* v.ast.CallExpr */) { if (m->is_caller_used) { string dot_called_name = v__callgraph__Mapper_dot_fn_name(m, (*(*node->_v__ast__Expr)._v__ast__CallExpr).name, (*(*node->_v__ast__Expr)._v__ast__CallExpr).receiver_type, (*(*node->_v__ast__Expr)._v__ast__CallExpr).is_method); v__dotgraph__DotGraph_new_edge(&m->dg, m->dot_caller_name, dot_called_name, ((v__dotgraph__NewEdgeConfig){.should_highlight = string__eq(m->caller_name, _SLIT("main.main")),.ctx = ((voidptr)(0)),.name2node_fn = v__dotgraph__node_name,})); @@ -92560,14 +92854,14 @@ bool v__builder__Builder_parse_imports_defer_0 = false; Option_string _t11 = v__builder__Builder_find_module_path(b, mod, ast_file->path); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; - array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), 0xfe10, {.d_s = mod}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); + array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); break; } string import_path = (*(string*)_t11.data); Array_string v_files = v__builder__Builder_v_files_from_dir(b, import_path); if (v_files.len == 0) { - array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), 0xfe10, {.d_s = mod}}, {_SLIT("\" (no .v files in \""), 0xfe10, {.d_s = import_path}}, {_SLIT("\")"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); + array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" (no .v files in \""), /*115 &string*/0xfe10, {.d_s = import_path}}, {_SLIT("\")"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); continue; } Array_v__ast__File_ptr parsed_files = v__parser__parse_files(v_files, b->table, b->pref); @@ -92580,7 +92874,7 @@ bool v__builder__Builder_parse_imports_defer_0 = false; string sname = string_all_after_last(name, _SLIT(".")); string smod = string_all_after_last(mod, _SLIT(".")); if (!string__eq(sname, smod)) { - string msg = str_intp(5, _MOV((StrIntpData[]){{_SLIT("bad module definition: "), 0xfe10, {.d_s = ast_file->path}}, {_SLIT(" imports module \""), 0xfe10, {.d_s = mod}}, {_SLIT("\" but "), 0xfe10, {.d_s = file->path}}, {_SLIT(" is defined as module `"), 0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); + string msg = str_intp(5, _MOV((StrIntpData[]){{_SLIT("bad module definition: "), /*115 &string*/0xfe10, {.d_s = ast_file->path}}, {_SLIT(" imports module \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" but "), /*115 &string*/0xfe10, {.d_s = file->path}}, {_SLIT(" is defined as module `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}})); array_push((array*)&(*(v__ast__File**)/*ee elem_sym */array_get(b->parsed_files, i))->errors, _MOV((v__errors__Error[]){ v__builder__Builder_error_with_pos(b, msg, ast_file->path, imp.pos) })); } } @@ -92686,10 +92980,10 @@ Array_string v__builder__Builder_v_files_from_dir(v__builder__Builder* b, string println(_SLIT("looks like you are trying to build V with an old command")); println(_SLIT("use `v -o v cmd/v` instead of `v -o v compiler`")); } - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT(" doesn't exist"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" doesn't exist"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } else if (!os__is_dir(dir)) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT(" isn't a directory!"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" isn't a directory!"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } Option_Array_string _t1 = os__ls(dir); @@ -92702,7 +92996,7 @@ Array_string v__builder__Builder_v_files_from_dir(v__builder__Builder* b, string Array_string files = (*(Array_string*)_t1.data); if (b->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_files_from_dir (\""), 0xfe10, {.d_s = dir}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("v_files_from_dir (\""), /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); } Array_string _t2 = v__pref__Preferences_should_compile_filtered_files(b->pref, dir, files); return _t2; @@ -92749,11 +93043,11 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin string search_path = ((string*)module_lookup_paths.data)[_t5]; string try_path = os__join_path(search_path, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){mod_path}))); if (b->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" >> trying to find "), 0xfe10, {.d_s = mod}}, {_SLIT(" in "), 0xfe10, {.d_s = try_path}}, {_SLIT(" .."), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" >> trying to find "), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT(" in "), /*115 &string*/0xfe10, {.d_s = try_path}}, {_SLIT(" .."), 0, { .d_c = 0 }}}))); } if (os__is_dir(try_path)) { if (b->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" << found "), 0xfe10, {.d_s = try_path}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" << found "), /*115 &string*/0xfe10, {.d_s = try_path}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); } Option_string _t6; opt_ok(&(string[]) { try_path }, (Option*)(&_t6), sizeof(string)); @@ -92765,7 +93059,7 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin string p1 = Array_string_join(array_slice(path_parts, 0, i), _const_os__path_separator); string try_path = os__join_path(p1, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){mod_path}))); if (b->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" >> trying to find "), 0xfe10, {.d_s = mod}}, {_SLIT(" in "), 0xfe10, {.d_s = try_path}}, {_SLIT(" .."), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" >> trying to find "), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT(" in "), /*115 &string*/0xfe10, {.d_s = try_path}}, {_SLIT(" .."), 0, { .d_c = 0 }}}))); } if (os__is_dir(try_path)) { Option_string _t7; @@ -92774,7 +93068,7 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin } } string smodule_lookup_paths = Array_string_join(module_lookup_paths, _SLIT(", ")); - return (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("module \""), 0xfe10, {.d_s = mod}}, {_SLIT("\" not found in:\n"), 0xfe10, {.d_s = smodule_lookup_paths}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (Option_string){ .state=2, .err=_v_error( str_intp(3, _MOV((StrIntpData[]){{_SLIT("module \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" not found in:\n"), /*115 &string*/0xfe10, {.d_s = smodule_lookup_paths}}, {_SLIT0, 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; } void v__builder__Builder_show_total_warns_and_errors_stats(v__builder__Builder* b) { @@ -92794,9 +93088,9 @@ void v__builder__Builder_show_total_warns_and_errors_stats(v__builder__Builder* string wstring = v__util__bold(int_str(nr_warnings)); string nstring = v__util__bold(int_str(nr_notices)); if (b->pref->check_only) { - println( str_intp(4, _MOV((StrIntpData[]){{_SLIT("summary: "), 0xfe10, {.d_s = estring}}, {_SLIT(" V errors, "), 0xfe10, {.d_s = wstring}}, {_SLIT(" V warnings, "), 0xfe10, {.d_s = nstring}}, {_SLIT(" V notices"), 0, { .d_c = 0 }}}))); + println( str_intp(4, _MOV((StrIntpData[]){{_SLIT("summary: "), /*115 &string*/0xfe10, {.d_s = estring}}, {_SLIT(" V errors, "), /*115 &string*/0xfe10, {.d_s = wstring}}, {_SLIT(" V warnings, "), /*115 &string*/0xfe10, {.d_s = nstring}}, {_SLIT(" V notices"), 0, { .d_c = 0 }}}))); } else { - println( str_intp(4, _MOV((StrIntpData[]){{_SLIT("checker summary: "), 0xfe10, {.d_s = estring}}, {_SLIT(" V errors, "), 0xfe10, {.d_s = wstring}}, {_SLIT(" V warnings, "), 0xfe10, {.d_s = nstring}}, {_SLIT(" V notices"), 0, { .d_c = 0 }}}))); + println( str_intp(4, _MOV((StrIntpData[]){{_SLIT("checker summary: "), /*115 &string*/0xfe10, {.d_s = estring}}, {_SLIT(" V errors, "), /*115 &string*/0xfe10, {.d_s = wstring}}, {_SLIT(" V warnings, "), /*115 &string*/0xfe10, {.d_s = nstring}}, {_SLIT(" V notices"), 0, { .d_c = 0 }}}))); } } } @@ -92828,11 +93122,11 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; if (!b->pref->skip_warnings) { for (int _t3 = 0; _t3 < file->notices.len; ++_t3) { v__errors__Notice err = ((v__errors__Notice*)file->notices.data)[_t3]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" notice #"), 0xfe07, {.d_i32 = b->nr_notices}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("notice:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" notice #"), /*100 &int*/0xfe07, {.d_i32 = b->nr_notices}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("notice:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -92841,11 +93135,11 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; v__ast__File* file = ((v__ast__File**)b->parsed_files.data)[_t4]; for (int _t5 = 0; _t5 < file->errors.len; ++_t5) { v__errors__Error err = ((v__errors__Error*)file->errors.data)[_t5]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" error #"), 0xfe07, {.d_i32 = b->nr_errors}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("error:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" error #"), /*100 &int*/0xfe07, {.d_i32 = b->nr_errors}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("error:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -92854,11 +93148,11 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; if (!b->pref->skip_warnings) { for (int _t7 = 0; _t7 < file->warnings.len; ++_t7) { v__errors__Warning err = ((v__errors__Warning*)file->warnings.data)[_t7]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" warning #"), 0xfe07, {.d_i32 = b->nr_warnings}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("warning:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" warning #"), /*100 &int*/0xfe07, {.d_i32 = b->nr_warnings}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("warning:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } @@ -92872,44 +93166,44 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; VUNREACHABLE(); } if (b->pref->is_verbose && b->checker->nr_warnings > 1) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = b->checker->nr_warnings}}, {_SLIT(" warnings"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_warnings}}, {_SLIT(" warnings"), 0, { .d_c = 0 }}}))); } if (b->pref->is_verbose && b->checker->nr_notices > 1) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = b->checker->nr_notices}}, {_SLIT(" notices"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_notices}}, {_SLIT(" notices"), 0, { .d_c = 0 }}}))); } if (b->checker->nr_notices > 0 && !b->pref->skip_warnings) { for (int _t8 = 0; _t8 < b->checker->notices.len; ++_t8) { v__errors__Notice err = ((v__errors__Notice*)b->checker->notices.data)[_t8]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" notice #"), 0xfe07, {.d_i32 = b->checker->nr_notices}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("notice:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" notice #"), /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_notices}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("notice:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } if (b->checker->nr_warnings > 0 && !b->pref->skip_warnings) { for (int _t9 = 0; _t9 < b->checker->warnings.len; ++_t9) { v__errors__Warning err = ((v__errors__Warning*)b->checker->warnings.data)[_t9]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" warning #"), 0xfe07, {.d_i32 = b->checker->nr_warnings}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("warning:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" warning #"), /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_warnings}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("warning:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } } if (b->pref->is_verbose && b->checker->nr_errors > 1) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe07, {.d_i32 = b->checker->nr_errors}}, {_SLIT(" errors"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_errors}}, {_SLIT(" errors"), 0, { .d_c = 0 }}}))); } if (b->checker->nr_errors > 0) { for (int _t10 = 0; _t10 < b->checker->errors.len; ++_t10) { v__errors__Error err = ((v__errors__Error*)b->checker->errors.data)[_t10]; - string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" error #"), 0xfe07, {.d_i32 = b->checker->nr_errors}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("error:"))); + string kind = (b->pref->is_verbose ? ( str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &v.errors.Reporter*/0xfe10, {.d_s = v__errors__Reporter_str(err.reporter)}}, {_SLIT(" error #"), /*100 &int*/0xfe07, {.d_i32 = b->checker->nr_errors}}, {_SLIT(":"), 0, { .d_c = 0 }}}))) : (_SLIT("error:"))); string ferror = v__util__formatted_error(kind, err.message, err.file_path, err.pos); eprintln(ferror); if (err.details.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), 0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Details: "), /*115 &string*/0xfe10, {.d_s = err.details}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } v__builder__Builder_show_total_warns_and_errors_stats(b); @@ -92926,7 +93220,7 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; v__ast__File* file = ((v__ast__File**)b->parsed_files.data)[_t12]; for (int _t13 = 0; _t13 < file->stmts.len; ++_t13) { v__ast__Stmt stmt = ((v__ast__Stmt*)file->stmts.data)[_t13]; - if ((stmt)._typ == 218 /* v.ast.FnDecl */) { + if ((stmt)._typ == 219 /* v.ast.FnDecl */) { if (string__eq((*stmt._v__ast__FnDecl).name, fn_name)) { string fheader = v__ast__FnDecl_stringify(&(*stmt._v__ast__FnDecl), b->table, _SLIT("main"), new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string)); array_push((array*)&redefines, _MOV((v__builder__FunctionRedefinition[]){ ((v__builder__FunctionRedefinition){.fpath = file->path,.fline = (*stmt._v__ast__FnDecl).pos.line_nr,.fheader = fheader,.f = (*stmt._v__ast__FnDecl),}) })); @@ -92936,7 +93230,7 @@ bool v__builder__Builder_print_warnings_and_errors_defer_0 = false; } } if (redefines.len > 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of function `"), 0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("redefinition of function `"), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); for (int _t15 = 0; _t15 < redefines.len; ++_t15) { v__builder__FunctionRedefinition redefine = ((v__builder__FunctionRedefinition*)redefines.data)[_t15]; eprintln(v__util__formatted_error(_SLIT("conflicting declaration:"), redefine.fheader, redefine.fpath, redefine.f.pos)); @@ -92976,10 +93270,10 @@ VNORETURN void v__builder__verror(string s) { } Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { - os__Result ccompiler_version_res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(v->pref->ccompiler)}}, {_SLIT(" -v"), 0, { .d_c = 0 }}}))); + os__Result ccompiler_version_res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(v->pref->ccompiler)}}, {_SLIT(" -v"), 0, { .d_c = 0 }}}))); if (ccompiler_version_res.exit_code != 0) { if (v->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v->pref->ccompiler}}, {_SLIT(" not found, looking for msvc..."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v->pref->ccompiler}}, {_SLIT(" not found, looking for msvc..."), 0, { .d_c = 0 }}}))); } Option_v__builder__MsvcResult _t1 = v__builder__find_msvc(v->pref->m64); if (_t1.state != 0) { /*or block*/ @@ -92989,7 +93283,7 @@ Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { } string vpath = os__dir(v__pref__vexe_path()); string thirdparty_tcc = os__join_path(vpath, new_array_from_c_array(3, 3, sizeof(string), _MOV((string[3]){_SLIT("thirdparty"), _SLIT("tcc"), _SLIT("tcc.exe")}))); - os__Result tcc_version_res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(thirdparty_tcc)}}, {_SLIT(" -v"), 0, { .d_c = 0 }}}))); + os__Result tcc_version_res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(thirdparty_tcc)}}, {_SLIT(" -v"), 0, { .d_c = 0 }}}))); if (tcc_version_res.exit_code != 0) { if (v->pref->is_verbose) { println(_SLIT("tcc not found")); @@ -93025,7 +93319,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__build string tmpfile = ((string*)v->pref->cleanup_files.data)[_t1]; if (os__is_file(tmpfile)) { if (v->pref->is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> remove tmp file: "), 0xfe10, {.d_s = tmpfile}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(">> remove tmp file: "), /*115 &string*/0xfe10, {.d_s = tmpfile}}, {_SLIT0, 0, { .d_c = 0 }}}))); } Option_void _t2 = os__rm(tmpfile); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { @@ -93071,9 +93365,9 @@ VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__build VV_LOCAL_SYMBOL void v__builder__Builder_show_cc(v__builder__Builder* v, string cmd, string response_file, string response_file_content) { if (v->pref->is_verbose || v->pref->show_cc) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> C compiler cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> C compiler cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (v->pref->show_cc && !v->pref->no_rsp) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> C compiler response file \""), 0xfe10, {.d_s = response_file}}, {_SLIT("\":"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("> C compiler response file \""), /*115 &string*/0xfe10, {.d_s = response_file}}, {_SLIT("\":"), 0, { .d_c = 0 }}}))); println(response_file_content); } } @@ -93107,7 +93401,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_ccompiler_options(v__builder__Bui ccoptions.debug_mode = v->pref->is_debug; ccoptions.guessed_compiler = v->pref->ccompiler; if (string__eq(ccoptions.guessed_compiler, _SLIT("cc")) && v->pref->is_prod) { - os__Result ccversion = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(_SLIT("cc"))}}, {_SLIT(" --version"), 0, { .d_c = 0 }}}))); + os__Result ccversion = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(_SLIT("cc"))}}, {_SLIT(" --version"), 0, { .d_c = 0 }}}))); if (ccversion.exit_code == 0) { if (string_contains(ccversion.output, _SLIT("This is free software;")) && string_contains(ccversion.output, _SLIT("Free Software Foundation, Inc."))) { ccoptions.guessed_compiler = _SLIT("gcc"); @@ -93217,7 +93511,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_ccompiler_options(v__builder__Bui array_push((array*)&ccoptions.source_args, _MOV((string[]){ string_clone(_SLIT("-x objective-c")) })); } } - array_push((array*)&ccoptions.source_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = v->out_name_c}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&ccoptions.source_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = v->out_name_c}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); if (v->pref->os == v__pref__OS__macos) { array_push((array*)&ccoptions.source_args, _MOV((string[]){ string_clone(_SLIT("-x none")) })); } @@ -93295,7 +93589,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_output_name(v__builder__Builder* if (!v->pref->is_shared && v->pref->build_mode != v__pref__BuildMode__build_module && string__eq(os__user_os(), _SLIT("windows")) && !string_ends_with(v->pref->out_name, _SLIT(".exe"))) { v->pref->out_name = /*f*/string__plus(v->pref->out_name, _SLIT(".exe")); } - v__builder__Builder_log(v, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cc() isprod="), 0xfe10, {.d_s = v->pref->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" outname="), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(3, _MOV((StrIntpData[]){{_SLIT("cc() isprod="), /*115 &bool*/0xfe10, {.d_s = v->pref->is_prod ? _SLIT("true") : _SLIT("false")}}, {_SLIT(" outname="), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (v->pref->is_shared) { if (!string_ends_with(v->pref->out_name, v->ccoptions.shared_postfix)) { v->pref->out_name = /*f*/string__plus(v->pref->out_name, v->ccoptions.shared_postfix); @@ -93304,9 +93598,9 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_output_name(v__builder__Builder* if (v->pref->build_mode == v__pref__BuildMode__build_module) { v->pref->out_name = v__vcache__CacheManager_postfix_with_key2cpath(&v->pref->cache_manager, _SLIT(".o"), v->pref->path); if (v->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Building "), 0xfe10, {.d_s = v->pref->path}}, {_SLIT(" to "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Building "), /*115 &string*/0xfe10, {.d_s = v->pref->path}}, {_SLIT(" to "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } - Option_string _t1 = v__vcache__CacheManager_save(&v->pref->cache_manager, _SLIT(".description.txt"), v->pref->path, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0x3cfe10, {.d_s = v->pref->path}}, {_SLIT(" @ "), 0xfe10, {.d_s = v->pref->cache_manager.vopts}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + Option_string _t1 = v__vcache__CacheManager_save(&v->pref->cache_manager, _SLIT(".description.txt"), v->pref->path, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x3cfe10, {.d_s = v->pref->path}}, {_SLIT(" @ "), /*115 &string*/0xfe10, {.d_s = v->pref->cache_manager.vopts}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -93317,10 +93611,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_output_name(v__builder__Builder* (*(string*)_t1.data); } if (os__is_dir(v->pref->out_name)) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("' is a directory"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("'"), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("' is a directory"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } - array_push((array*)&v->ccoptions.o_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o \""), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&v->ccoptions.o_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o \""), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); } VV_LOCAL_SYMBOL void v__builder__Builder_dump_c_options(v__builder__Builder* v, Array_string all_args) { @@ -93358,7 +93652,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { return; } if (v->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("builder.cc() pref.out_name=\""), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("builder.cc() pref.out_name=\""), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } if (v->pref->only_check_syntax) { if (v->pref->is_verbose) { @@ -93395,7 +93689,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { bool ends_with_js = string_ends_with(v->pref->out_name, _SLIT(".js")); if (ends_with_c || ends_with_js) { v->pref->skip_running = true; - string msg_mv = str_intp(3, _MOV((StrIntpData[]){{_SLIT("os.mv_by_cp "), 0xfe10, {.d_s = v->out_name_c}}, {_SLIT(" => "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}})); + string msg_mv = str_intp(3, _MOV((StrIntpData[]){{_SLIT("os.mv_by_cp "), /*115 &string*/0xfe10, {.d_s = v->out_name_c}}, {_SLIT(" => "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}})); v__util__timing_start(msg_mv); Option_void _t3 = os__mv_by_cp(v->out_name_c, v->pref->out_name); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { @@ -93433,7 +93727,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { v__builder__Builder_build_thirdparty_obj_files(v); v__builder__Builder_setup_output_name(v); if (v->pref->os != v__pref__OS__windows && string_contains(ccompiler, _SLIT("++"))) { - string cpp_atomic_h_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("/woodpecker/src/git.rustybever.be/Chewing_Bever/v")}}, {_SLIT("/thirdparty/stdatomic/nix/cpp/atomic.h"), 0, { .d_c = 0 }}})); + string cpp_atomic_h_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("/woodpecker/src/git.rustybever.be/Chewing_Bever/v")}}, {_SLIT("/thirdparty/stdatomic/nix/cpp/atomic.h"), 0, { .d_c = 0 }}})); if (!os__exists(cpp_atomic_h_path)) { for (int _t4 = 0; _t4 < v->parsed_files.len; ++_t4) { v__ast__File* file = ((v__ast__File**)v->parsed_files.data)[_t4]; @@ -93448,8 +93742,8 @@ void v__builder__Builder_cc(v__builder__Builder* v) { } } if (_t5) { - string cppgenv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("/woodpecker/src/git.rustybever.be/Chewing_Bever/v")}}, {_SLIT("/thirdparty/stdatomic/nix/cpp/gen.v"), 0, { .d_c = 0 }}})); - os__execute( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" run "), 0xfe10, {.d_s = os__quoted_path(cppgenv)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string cppgenv = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("/woodpecker/src/git.rustybever.be/Chewing_Bever/v")}}, {_SLIT("/thirdparty/stdatomic/nix/cpp/gen.v"), 0, { .d_c = 0 }}})); + os__execute( str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" run "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(cppgenv)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT0, 0, { .d_c = 0 }}}))); break; } } @@ -93466,18 +93760,18 @@ void v__builder__Builder_cc(v__builder__Builder* v) { Array_string all_args = v__builder__Builder_all_args(v, v->ccoptions); v__builder__Builder_dump_c_options(v, all_args); string str_args = Array_string_join(all_args, _SLIT(" ")); - string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT(" "), 0xfe10, {.d_s = str_args}}, {_SLIT0, 0, { .d_c = 0 }}})); + string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = str_args}}, {_SLIT0, 0, { .d_c = 0 }}})); string response_file = _SLIT(""); string response_file_content = str_args; if (!v->pref->no_rsp) { - response_file = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = v->out_name_c}}, {_SLIT(".rsp"), 0, { .d_c = 0 }}})); + response_file = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = v->out_name_c}}, {_SLIT(".rsp"), 0, { .d_c = 0 }}})); response_file_content = string_replace(str_args, _SLIT("\\"), _SLIT("\\\\")); - string rspexpr = str_intp(2, _MOV((StrIntpData[]){{_SLIT("@"), 0xfe10, {.d_s = response_file}}, {_SLIT0, 0, { .d_c = 0 }}})); - cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT(" "), 0xfe10, {.d_s = os__quoted_path(rspexpr)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string rspexpr = str_intp(2, _MOV((StrIntpData[]){{_SLIT("@"), /*115 &string*/0xfe10, {.d_s = response_file}}, {_SLIT0, 0, { .d_c = 0 }}})); + cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(ccompiler)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(rspexpr)}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_void _t8 = os__write_file(response_file, response_file_content); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { IError err = _t8.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to write to C response file \""), 0xfe10, {.d_s = response_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to write to C response file \""), /*115 &string*/0xfe10, {.d_s = response_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -93492,7 +93786,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { } if (v->ccoptions.is_cc_tcc) { string def_name = string_substr(v->pref->out_name, 0, v->pref->out_name.len - 4); - array_push((array*)&v->pref->cleanup_files, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = def_name}}, {_SLIT(".def"), 0, { .d_c = 0 }}}))) })); + array_push((array*)&v->pref->cleanup_files, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = def_name}}, {_SLIT(".def"), 0, { .d_c = 0 }}}))) })); } Option_void _t12 = os__chdir(vdir); if (_t12.state != 0 && _t12.err._typ != _IError_None___index) { @@ -93502,7 +93796,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { ; array_push((array*)&tried_compilation_commands, _MOV((string[]){ string_clone(cmd) })); v__builder__Builder_show_cc(v, cmd, response_file, response_file_content); - string ccompiler_label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C "), 0x6fe30, {.d_s = os__file_name(ccompiler)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string ccompiler_label = str_intp(2, _MOV((StrIntpData[]){{_SLIT("C "), /*115 &string*/0x6fe30, {.d_s = os__file_name(ccompiler)}}, {_SLIT0, 0, { .d_c = 0 }}})); v__util__timing_start(ccompiler_label); os__Result res = os__execute(cmd); v__util__timing_measure(ccompiler_label); @@ -93521,10 +93815,10 @@ void v__builder__Builder_cc(v__builder__Builder* v) { if (res.exit_code != 0) { if (string_contains(ccompiler, _SLIT("tcc.exe"))) { if (tried_compilation_commands.len > 1) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Recompilation loop detected (ccompiler: "), 0xfe10, {.d_s = ccompiler}}, {_SLIT("):"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Recompilation loop detected (ccompiler: "), /*115 &string*/0xfe10, {.d_s = ccompiler}}, {_SLIT("):"), 0, { .d_c = 0 }}}))); for (int _t15 = 0; _t15 < tried_compilation_commands.len; ++_t15) { string recompile_command = ((string*)tried_compilation_commands.data)[_t15]; - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), 0xfe10, {.d_s = recompile_command}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT(" "), /*115 &string*/0xfe10, {.d_s = recompile_command}}, {_SLIT0, 0, { .d_c = 0 }}}))); } _v_exit(101); VUNREACHABLE(); @@ -93533,13 +93827,13 @@ void v__builder__Builder_cc(v__builder__Builder* v) { tcc_output = res; v__pref__Preferences_default_c_compiler(v->pref); if (v->pref->is_verbose) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Compilation with tcc failed. Retrying with "), 0xfe10, {.d_s = v->pref->ccompiler}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Compilation with tcc failed. Retrying with "), /*115 &string*/0xfe10, {.d_s = v->pref->ccompiler}}, {_SLIT(" ..."), 0, { .d_c = 0 }}}))); } continue; } } if (res.exit_code == 127) { - v__builder__verror(string__plus(string__plus(string__plus(string__plus(string__plus(_SLIT("C compiler error, while attempting to run: \n-----------------------------------------------------------\n"), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = cmd}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), _SLIT("-----------------------------------------------------------\n")), _SLIT("Probably your C compiler is missing. \n")), _SLIT("Please reinstall it, or make it available in your PATH.\n\n")), v__builder__missing_compiler_info())); + v__builder__verror(string__plus(string__plus(string__plus(string__plus(string__plus(_SLIT("C compiler error, while attempting to run: \n-----------------------------------------------------------\n"), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))), _SLIT("-----------------------------------------------------------\n")), _SLIT("Probably your C compiler is missing. \n")), _SLIT("Please reinstall it, or make it available in your PATH.\n\n")), v__builder__missing_compiler_info())); VUNREACHABLE(); } } @@ -93551,7 +93845,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { } } if (v->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = ccompiler}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = ccompiler}}, {_SLIT0, 0, { .d_c = 0 }}}))); println(_SLIT("=========\n")); } break; @@ -93559,14 +93853,14 @@ void v__builder__Builder_cc(v__builder__Builder* v) { if (v->pref->compress) { println(_SLIT("-compress does not work on Windows for now")); return; - int ret = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strip "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + int ret = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("strip "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (ret != 0) { println(_SLIT("strip failed")); return; } - int ret2 = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("upx --lzma -qqq "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + int ret2 = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("upx --lzma -qqq "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (ret2 != 0) { - ret2 = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("upx -qqq "), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); + ret2 = os__system( str_intp(2, _MOV((StrIntpData[]){{_SLIT("upx -qqq "), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } if (ret2 != 0) { println(_SLIT("upx failed")); @@ -93587,9 +93881,9 @@ VV_LOCAL_SYMBOL void v__builder__Builder_ensure_linuxroot_exists(v__builder__Bui } if (!os__is_dir(sysroot)) { println(_SLIT("Downloading files for Linux cross compilation (~22MB) ...")); - os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT("git clone "), 0xfe10, {.d_s = crossrepo_url}}, {_SLIT(" "), 0xfe10, {.d_s = sysroot}}, {_SLIT0, 0, { .d_c = 0 }}}))); + os__system( str_intp(3, _MOV((StrIntpData[]){{_SLIT("git clone "), /*115 &string*/0xfe10, {.d_s = crossrepo_url}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT0, 0, { .d_c = 0 }}}))); if (!os__exists(sysroot_git_config_path)) { - v__builder__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Failed to clone `"), 0xfe10, {.d_s = crossrepo_url}}, {_SLIT("` to `"), 0xfe10, {.d_s = sysroot}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Failed to clone `"), /*115 &string*/0xfe10, {.d_s = crossrepo_url}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } Option_void _t2 = os__chmod(os__join_path(sysroot, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("ld.lld")}))), 0755); @@ -93634,13 +93928,13 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-c")) })); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-target x86_64-linux-gnu")) })); _PUSH_MANY(&cc_args, (defines), _t6, Array_string); - array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I "), 0xfe10, {.d_s = sysroot}}, {_SLIT("/include "), 0, { .d_c = 0 }}}))) })); + array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I "), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/include "), 0, { .d_c = 0 }}}))) })); _PUSH_MANY(&cc_args, (others), _t8, Array_string); - array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o \""), 0xfe10, {.d_s = obj_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-c \""), 0xfe10, {.d_s = b->out_name_c}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o \""), /*115 &string*/0xfe10, {.d_s = obj_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&cc_args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-c \""), /*115 &string*/0xfe10, {.d_s = b->out_name_c}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); _PUSH_MANY(&cc_args, (libs), _t11, Array_string); v__builder__Builder_dump_c_options(b, cc_args); - string cc_cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(_SLIT("cc"))}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(cc_args, _SLIT(" "))); + string cc_cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(_SLIT("cc"))}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(cc_args, _SLIT(" "))); if (b->pref->show_cc) { println(cc_cmd); } @@ -93652,12 +93946,12 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) return; } Array_string linker_args = new_array_from_c_array(14, 14, sizeof(string), _MOV((string[14]){ - str_intp(2, _MOV((StrIntpData[]){{_SLIT("-L"), 0xfe10, {.d_s = sysroot}}, {_SLIT("/usr/lib/x86_64-linux-gnu/"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("-L"), 0xfe10, {.d_s = sysroot}}, {_SLIT("/lib/x86_64-linux-gnu"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("--sysroot="), 0xfe10, {.d_s = sysroot}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-v"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), 0xfe10, {.d_s = b->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-m elf_x86_64"), _SLIT("-dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2"), str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sysroot}}, {_SLIT("/crt1.o "), 0xfe10, {.d_s = sysroot}}, {_SLIT("/crti.o "), 0xfe10, {.d_s = obj_file}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-lc"), - _SLIT("-lcrypto"), _SLIT("-lssl"), _SLIT("-lpthread"), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sysroot}}, {_SLIT("/crtn.o"), 0, { .d_c = 0 }}})), _SLIT("-lm")})); + str_intp(2, _MOV((StrIntpData[]){{_SLIT("-L"), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/usr/lib/x86_64-linux-gnu/"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("-L"), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/lib/x86_64-linux-gnu"), 0, { .d_c = 0 }}})), str_intp(2, _MOV((StrIntpData[]){{_SLIT("--sysroot="), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-v"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), /*115 &string*/0xfe10, {.d_s = b->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-m elf_x86_64"), _SLIT("-dynamic-linker /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2"), str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/crt1.o "), /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/crti.o "), /*115 &string*/0xfe10, {.d_s = obj_file}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT("-lc"), + _SLIT("-lcrypto"), _SLIT("-lssl"), _SLIT("-lpthread"), str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/crtn.o"), 0, { .d_c = 0 }}})), _SLIT("-lm")})); _PUSH_MANY(&linker_args, (Array_v__cflag__CFlag_c_options_only_object_files(cflags)), _t12, Array_string); v__builder__Builder_dump_c_options(b, linker_args); - string ldlld = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = sysroot}}, {_SLIT("/ld.lld"), 0, { .d_c = 0 }}})); - string linker_cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(ldlld)}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(linker_args, _SLIT(" "))); + string ldlld = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = sysroot}}, {_SLIT("/ld.lld"), 0, { .d_c = 0 }}})); + string linker_cmd = string__plus( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(ldlld)}}, {_SLIT(" "), 0, { .d_c = 0 }}})), Array_string_join(linker_args, _SLIT(" "))); if (b->pref->show_cc) { println(linker_cmd); } @@ -93681,8 +93975,8 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_windows_cross(v__builder__Builder* c } c->pref->out_name = os__quoted_path(c->pref->out_name); Array_string args = __new_array_with_default(0, 0, sizeof(string), 0); - array_push((array*)&args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = c->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), 0xfe10, {.d_s = c->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = c->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&args, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), /*115 &string*/0xfe10, {.d_s = c->pref->out_name}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); array_push((array*)&args, _MOV((string[]){ string_clone(_SLIT("-w -L.")) })); Array_v__cflag__CFlag cflags = v__builder__Builder_get_os_cflags(c); if (string__eq(c->pref->ccompiler, _SLIT("msvc"))) { @@ -93704,15 +93998,15 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_windows_cross(v__builder__Builder* c } Array_string libs = __new_array_with_default(0, 0, sizeof(string), 0); if (false && c->pref->build_mode == v__pref__BuildMode__default_mode) { - string builtin_o = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = _const_v__pref__default_module_path}}, {_SLIT("/vlib/builtin.o\""), 0, { .d_c = 0 }}})); + string builtin_o = str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = _const_v__pref__default_module_path}}, {_SLIT("/vlib/builtin.o\""), 0, { .d_c = 0 }}})); array_push((array*)&libs, _MOV((string[]){ string_clone(builtin_o) })); if (!os__exists(builtin_o)) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = builtin_o}}, {_SLIT(" not found"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = builtin_o}}, {_SLIT(" not found"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } for (int _t7 = 0; _t7 < c->table->imports.len; ++_t7) { string imp = ((string*)c->table->imports.data)[_t7]; - array_push((array*)&libs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = _const_v__pref__default_module_path}}, {_SLIT("/vlib/"), 0xfe10, {.d_s = imp}}, {_SLIT(".o\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&libs, _MOV((string[]){ string_clone( str_intp(3, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = _const_v__pref__default_module_path}}, {_SLIT("/vlib/"), /*115 &string*/0xfe10, {.d_s = imp}}, {_SLIT(".o\""), 0, { .d_c = 0 }}}))) })); } } _PUSH_MANY(&args, (Array_v__cflag__CFlag_c_options_only_object_files(cflags)), _t9, Array_string); @@ -93747,7 +94041,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_windows_cross(v__builder__Builder* c } VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_files(v__builder__Builder* b) { - v__builder__Builder_log(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("build_thirdparty_obj_files: v.ast.cflags: "), 0xfe10, {.d_s = Array_v__cflag__CFlag_str(b->table->cflags)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__Builder_log(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("build_thirdparty_obj_files: v.ast.cflags: "), /*115 &[]v.cflag.CFlag*/0xfe10, {.d_s = Array_v__cflag__CFlag_str(b->table->cflags)}}, {_SLIT0, 0, { .d_c = 0 }}}))); Array_v__cflag__CFlag _t1 = v__builder__Builder_get_os_cflags(b); for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__cflag__CFlag flag = ((v__cflag__CFlag*)_t1.data)[_t2]; @@ -93764,12 +94058,12 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_files(v__builder__ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__Builder* v, string path, Array_v__cflag__CFlag moduleflags) { string obj_path = os__real_path(path); - string cfile = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = string_substr(obj_path, 0, obj_path.len - 2)}}, {_SLIT(".c"), 0, { .d_c = 0 }}})); + string cfile = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = string_substr(obj_path, 0, obj_path.len - 2)}}, {_SLIT(".c"), 0, { .d_c = 0 }}})); string opath = v__vcache__CacheManager_postfix_with_key2cpath(&v->pref->cache_manager, _SLIT(".o"), obj_path); - string rebuild_reason_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = obj_path}}, {_SLIT(" not found, building it in "), 0xfe10, {.d_s = opath}}, {_SLIT(" ..."), 0, { .d_c = 0 }}})); + string rebuild_reason_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = obj_path}}, {_SLIT(" not found, building it in "), /*115 &string*/0xfe10, {.d_s = opath}}, {_SLIT(" ..."), 0, { .d_c = 0 }}})); if (os__exists(opath)) { if (os__exists(cfile) && os__file_last_mod_unix(opath) < os__file_last_mod_unix(cfile)) { - rebuild_reason_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = opath}}, {_SLIT(" is older than "), 0xfe10, {.d_s = cfile}}, {_SLIT(", rebuilding ..."), 0, { .d_c = 0 }}})); + rebuild_reason_message = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = opath}}, {_SLIT(" is older than "), /*115 &string*/0xfe10, {.d_s = cfile}}, {_SLIT(", rebuilding ..."), 0, { .d_c = 0 }}})); } else { return; } @@ -93799,10 +94093,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B Array_string all_options = __new_array_with_default(0, 0, sizeof(string), 0); array_push((array*)&all_options, _MOV((string[]){ string_clone(v->pref->third_party_option) })); _PUSH_MANY(&all_options, (Array_v__cflag__CFlag_c_options_before_target(moduleflags)), _t4, Array_string); - array_push((array*)&all_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), 0xfe10, {.d_s = os__quoted_path(opath)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - array_push((array*)&all_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-c "), 0xfe10, {.d_s = os__quoted_path(cfile)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-o "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(opath)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&all_options, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-c "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(cfile)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); string cc_options = Array_string_join(v__builder__Builder_thirdparty_object_args(v, v->ccoptions, all_options), _SLIT(" ")); - string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(v->pref->ccompiler)}}, {_SLIT(" "), 0xfe10, {.d_s = cc_options}}, {_SLIT0, 0, { .d_c = 0 }}})); + string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(v->pref->ccompiler)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = cc_options}}, {_SLIT0, 0, { .d_c = 0 }}})); os__Result res = os__execute(cmd); Option_void _t7 = os__chdir(current_folder); if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { @@ -93811,12 +94105,12 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B ; if (res.exit_code != 0) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed thirdparty object build cmd:\n"), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("failed thirdparty object build cmd:\n"), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__builder__verror(res.output); VUNREACHABLE(); return; } - Option_string _t8 = v__vcache__CacheManager_save(&v->pref->cache_manager, _SLIT(".description.txt"), obj_path, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0x3cfe10, {.d_s = obj_path}}, {_SLIT(" @ "), 0xfe10, {.d_s = cmd}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); + Option_string _t8 = v__vcache__CacheManager_save(&v->pref->cache_manager, _SLIT(".description.txt"), obj_path, str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x3cfe10, {.d_s = obj_path}}, {_SLIT(" @ "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT("\n"), 0, { .d_c = 0 }}}))); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; _v_panic(IError_str(err)); @@ -93933,7 +94227,7 @@ void v__builder__compile(string command, v__pref__Preferences* pref, void (*back v__util__Timers_show_remaining(timers); if (pref->is_stats) { i64 compilation_time_micros = 1 + time__Duration_microseconds(time__StopWatch_elapsed(sw)); - string scompilation_time_ms = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xc062d, {.d_f64 = ((f64)(compilation_time_micros)) / 1000.0}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string scompilation_time_ms = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*102 &f64*/0xc062d, {.d_f64 = ((f64)(compilation_time_micros)) / 1000.0}}, {_SLIT0, 0, { .d_c = 0 }}}))); int all_v_source_lines = 0; int all_v_source_bytes = 0; for (int _t2 = 0; _t2 < b.parsed_files.len; ++_t2) { @@ -93943,17 +94237,17 @@ void v__builder__compile(string command, v__pref__Preferences* pref, void (*back } string sall_v_source_lines = int_str(all_v_source_lines); string sall_v_source_bytes = int_str(all_v_source_bytes); - sall_v_source_lines = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x14fe30, {.d_s = sall_v_source_lines}}, {_SLIT0, 0, { .d_c = 0 }}}))); - sall_v_source_bytes = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x14fe30, {.d_s = sall_v_source_bytes}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" V source code size: "), 0xfe10, {.d_s = sall_v_source_lines}}, {_SLIT(" lines, "), 0xfe10, {.d_s = sall_v_source_bytes}}, {_SLIT(" bytes"), 0, { .d_c = 0 }}}))); + sall_v_source_lines = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x14fe30, {.d_s = sall_v_source_lines}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sall_v_source_bytes = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x14fe30, {.d_s = sall_v_source_bytes}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT(" V source code size: "), /*115 &string*/0xfe10, {.d_s = sall_v_source_lines}}, {_SLIT(" lines, "), /*115 &string*/0xfe10, {.d_s = sall_v_source_bytes}}, {_SLIT(" bytes"), 0, { .d_c = 0 }}}))); string slines = int_str(b.stats_lines); string sbytes = int_str(b.stats_bytes); - slines = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x14fe30, {.d_s = slines}}, {_SLIT0, 0, { .d_c = 0 }}}))); - sbytes = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0x14fe30, {.d_s = sbytes}}, {_SLIT0, 0, { .d_c = 0 }}}))); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("generated target code size: "), 0xfe10, {.d_s = slines}}, {_SLIT(" lines, "), 0xfe10, {.d_s = sbytes}}, {_SLIT(" bytes"), 0, { .d_c = 0 }}}))); + slines = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x14fe30, {.d_s = slines}}, {_SLIT0, 0, { .d_c = 0 }}}))); + sbytes = v__util__bold( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0x14fe30, {.d_s = sbytes}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("generated target code size: "), /*115 &string*/0xfe10, {.d_s = slines}}, {_SLIT(" lines, "), /*115 &string*/0xfe10, {.d_s = sbytes}}, {_SLIT(" bytes"), 0, { .d_c = 0 }}}))); int vlines_per_second = ((int)(1000000.0 * ((f64)(all_v_source_lines)) / ((f64)(compilation_time_micros)))); string svlines_per_second = v__util__bold(int_str(vlines_per_second)); - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("compilation took: "), 0xfe10, {.d_s = scompilation_time_ms}}, {_SLIT(" ms, compilation speed: "), 0xfe10, {.d_s = svlines_per_second}}, {_SLIT(" vlines/s"), 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("compilation took: "), /*115 &string*/0xfe10, {.d_s = scompilation_time_ms}}, {_SLIT(" ms, compilation speed: "), /*115 &string*/0xfe10, {.d_s = svlines_per_second}}, {_SLIT(" vlines/s"), 0, { .d_c = 0 }}}))); } v__builder__Builder_exit_on_invalid_syntax(&b); v__builder__Builder_myfree(&b); @@ -93966,9 +94260,9 @@ string v__builder__Builder_get_vtmp_filename(v__builder__Builder* b, string base string vtmp = v__util__get_vtmp_folder(); string uniq = _SLIT(""); if (!b->pref->reuse_tmpc) { - uniq = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), 0xfe08, {.d_u64 = rand__u64()}}, {_SLIT0, 0, { .d_c = 0 }}})); + uniq = str_intp(2, _MOV((StrIntpData[]){{_SLIT("."), /*117 &u64*/0xfe08, {.d_u64 = rand__u64()}}, {_SLIT0, 0, { .d_c = 0 }}})); } - string fname = string__plus(os__file_name(os__real_path(base_file_name)), str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = uniq}}, {_SLIT0, 0xfe10, {.d_s = postfix}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string fname = string__plus(os__file_name(os__real_path(base_file_name)), str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = uniq}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = postfix}}, {_SLIT0, 0, { .d_c = 0 }}}))); string _t1 = os__real_path(os__join_path(vtmp, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){fname})))); return _t1; } @@ -94045,7 +94339,7 @@ Option_string _t2 = os__find_abs_path_of_executable(node_basename); os__Process* run_process = os__new_process(run_file); os__Process_set_args(run_process, run_args); if (b->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("running "), 0xfe10, {.d_s = run_process->filename}}, {_SLIT(" with arguments "), 0xfe10, {.d_s = Array_string_str(run_process->args)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("running "), /*115 &string*/0xfe10, {.d_s = run_process->filename}}, {_SLIT(" with arguments "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(run_process->args)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } Option_os__SignalHandler _t5 = os__signal_opt(os__Signal__int, (voidptr)v__builder__eshcb); if (_t5.state != 0) { /*or block*/ @@ -94082,7 +94376,7 @@ VV_LOCAL_SYMBOL void v__builder__eshcb(os__Signal _d1) { // Attr: [noreturn] VNORETURN VV_LOCAL_SYMBOL void v__builder__serror(string reason, IError e) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not "), 0xfe10, {.d_s = reason}}, {_SLIT(" handler"), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("could not "), /*115 &string*/0xfe10, {.d_s = reason}}, {_SLIT(" handler"), 0, { .d_c = 0 }}}))); _v_panic(IError_str(e)); VUNREACHABLE(); while(1); @@ -94090,10 +94384,10 @@ VNORETURN VV_LOCAL_SYMBOL void v__builder__serror(string reason, IError e) { VV_LOCAL_SYMBOL void v__builder__Builder_cleanup_run_executable_after_exit(v__builder__Builder* v, string exefile) { if (v->pref->reuse_tmpc) { - v__pref__Preferences_vrun_elog(v->pref, str_intp(2, _MOV((StrIntpData[]){{_SLIT("keeping executable: "), 0xfe10, {.d_s = exefile}}, {_SLIT(" , because -keepc was passed"), 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(v->pref, str_intp(2, _MOV((StrIntpData[]){{_SLIT("keeping executable: "), /*115 &string*/0xfe10, {.d_s = exefile}}, {_SLIT(" , because -keepc was passed"), 0, { .d_c = 0 }}}))); return; } - v__pref__Preferences_vrun_elog(v->pref, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove run executable: "), 0xfe10, {.d_s = exefile}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__pref__Preferences_vrun_elog(v->pref, str_intp(2, _MOV((StrIntpData[]){{_SLIT("remove run executable: "), /*115 &string*/0xfe10, {.d_s = exefile}}, {_SLIT0, 0, { .d_c = 0 }}}))); Option_void _t1 = os__rm(exefile); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; @@ -94110,7 +94404,7 @@ void v__builder__Builder_set_module_lookup_paths(v__builder__Builder* v) { array_push((array*)&v->module_search_paths, _MOV((string[]){ string_clone(v->compiled_dir) })); string x = os__join_path(v->compiled_dir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("modules")}))); if (v->pref->is_verbose) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("x: \""), 0xfe10, {.d_s = x}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("x: \""), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } array_push((array*)&v->module_search_paths, _MOV((string[]){ string_clone(os__join_path(v->compiled_dir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("modules")})))) })); _PUSH_MANY(&v->module_search_paths, (v->pref->lookup_path), _t4, Array_string); @@ -94126,7 +94420,7 @@ Array_string v__builder__Builder_get_builtin_files(v__builder__Builder* v) { Array_string _t1 = __new_array_with_default(0, 0, sizeof(string), 0); return _t1; } - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("v.pref.lookup_path: "), 0xfe10, {.d_s = Array_string_str(v->pref->lookup_path)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("v.pref.lookup_path: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(v->pref->lookup_path)}}, {_SLIT0, 0, { .d_c = 0 }}}))); for (int _t2 = 0; _t2 < v->pref->lookup_path.len; ++_t2) { string location = ((string*)v->pref->lookup_path.data)[_t2]; if (os__exists(os__join_path(location, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("builtin")}))))) { @@ -94160,7 +94454,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { return _t1; } string dir = v->pref->path; - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("get_v_files("), 0xfe10, {.d_s = dir}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("get_v_files("), /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); Array_string user_files = __new_array_with_default(0, 0, sizeof(string), 0); string vroot = os__dir(v__pref__vexe_path()); string preludes_path = os__join_path(vroot, new_array_from_c_array(3, 3, sizeof(string), _MOV((string[3]){_SLIT("vlib"), _SLIT("v"), _SLIT("preludes")}))); @@ -94186,10 +94480,10 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { v_test_runner_prelude = _SLIT("normal"); } if (!string_contains(v_test_runner_prelude, _SLIT("/")) && !string_contains(v_test_runner_prelude, _SLIT("\\")) && !string_ends_with(v_test_runner_prelude, _SLIT(".v"))) { - v_test_runner_prelude = os__join_path(preludes_path, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("test_runner_"), 0xfe10, {.d_s = v_test_runner_prelude}}, {_SLIT(".v"), 0, { .d_c = 0 }}}))}))); + v_test_runner_prelude = os__join_path(preludes_path, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){ str_intp(2, _MOV((StrIntpData[]){{_SLIT("test_runner_"), /*115 &string*/0xfe10, {.d_s = v_test_runner_prelude}}, {_SLIT(".v"), 0, { .d_c = 0 }}}))}))); } if (!os__is_file(v_test_runner_prelude) || !os__is_readable(v_test_runner_prelude)) { - eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("test runner error: File "), 0xfe10, {.d_s = v_test_runner_prelude}}, {_SLIT(" should be readable."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(2, _MOV((StrIntpData[]){{_SLIT("test runner error: File "), /*115 &string*/0xfe10, {.d_s = v_test_runner_prelude}}, {_SLIT(" should be readable."), 0, { .d_c = 0 }}}))); v__builder__verror(_SLIT("supported test runners are: tap, json, simple, normal")); VUNREACHABLE(); } @@ -94210,7 +94504,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { Option_string _t10 = v__util__read_file(dir); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -94234,7 +94528,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { if (is_internal_module_test) { string single_test_v_file = os__real_path(dir); if (v->pref->is_verbose) { - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Compiling an internal module _test.v file "), 0xfe10, {.d_s = single_test_v_file}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> Compiling an internal module _test.v file "), /*115 &string*/0xfe10, {.d_s = single_test_v_file}}, {_SLIT(" ."), 0, { .d_c = 0 }}}))); v__builder__Builder_log(v, _SLIT("> That brings in all other ordinary .v files in the same module too .")); } array_push((array*)&user_files, _MOV((string[]){ string_clone(single_test_v_file) })); @@ -94242,7 +94536,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { } bool does_exist = os__exists(dir); if (!does_exist) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = dir}}, {_SLIT(" doesn't exist"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" doesn't exist"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } bool is_real_file = does_exist && !os__is_dir(dir); @@ -94251,17 +94545,17 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { string single_v_file = (string_ends_with(resolved_link, _SLIT(".vsh")) ? (resolved_link) : (dir)); array_push((array*)&user_files, _MOV((string[]){ string_clone(single_v_file) })); if (v->pref->is_verbose) { - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> just compile one file: \""), 0xfe10, {.d_s = single_v_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> just compile one file: \""), /*115 &string*/0xfe10, {.d_s = single_v_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); } } else if (os__is_dir(dir)) { if (v->pref->is_verbose) { - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> add all .v files from directory \""), 0xfe10, {.d_s = dir}}, {_SLIT("\" ..."), 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("> add all .v files from directory \""), /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT("\" ..."), 0, { .d_c = 0 }}}))); } _PUSH_MANY(&user_files, (v__builder__Builder_v_files_from_dir(v, dir)), _t14, Array_string); } else { println(_SLIT("usage: `v file.v` or `v directory`")); string ext = os__file_ext(dir); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown file extension `"), 0xfe10, {.d_s = ext}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("unknown file extension `"), /*115 &string*/0xfe10, {.d_s = ext}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -94271,7 +94565,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { VUNREACHABLE(); } if (v->pref->is_verbose) { - v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("user_files: "), 0xfe10, {.d_s = Array_string_str(user_files)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__Builder_log(v, str_intp(2, _MOV((StrIntpData[]){{_SLIT("user_files: "), /*115 &[]string*/0xfe10, {.d_s = Array_string_str(user_files)}}, {_SLIT0, 0, { .d_c = 0 }}}))); } Array_string _t15 = user_files; return _t15; @@ -94387,10 +94681,10 @@ VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__new_windows_kit(string highest_path = f; } } - string kit_lib_highest = string__plus(kit_lib, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\"), 0xfe10, {.d_s = highest_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + string kit_lib_highest = string__plus(kit_lib, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\"), /*115 &string*/0xfe10, {.d_s = highest_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); string kit_include_highest = string_replace(kit_lib_highest, _SLIT("Lib"), _SLIT("Include")); Option_v__builder__WindowsKit _t4; - opt_ok(&(v__builder__WindowsKit[]) { ((v__builder__WindowsKit){.um_lib_path = string__plus(kit_lib_highest, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\um\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))),.ucrt_lib_path = string__plus(kit_lib_highest, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\ucrt\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))),.um_include_path = string__plus(kit_include_highest, _SLIT("\\um")),.ucrt_include_path = string__plus(kit_include_highest, _SLIT("\\ucrt")),.shared_include_path = string__plus(kit_include_highest, _SLIT("\\shared")),}) }, (Option*)(&_t4), sizeof(v__builder__WindowsKit)); + opt_ok(&(v__builder__WindowsKit[]) { ((v__builder__WindowsKit){.um_lib_path = string__plus(kit_lib_highest, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\um\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))),.ucrt_lib_path = string__plus(kit_lib_highest, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\\ucrt\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}}))),.um_include_path = string__plus(kit_include_highest, _SLIT("\\um")),.ucrt_include_path = string__plus(kit_include_highest, _SLIT("\\ucrt")),.shared_include_path = string__plus(kit_include_highest, _SLIT("\\shared")),}) }, (Option*)(&_t4), sizeof(v__builder__WindowsKit)); return _t4; } @@ -94434,12 +94728,12 @@ VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs(string vsw VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(string vswhere_dir, string host_arch, string target_arch) { #if defined(_WIN32) { - os__Result res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = vswhere_dir}}, {_SLIT("\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath"), 0, { .d_c = 0 }}}))); + os__Result res = os__execute( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = vswhere_dir}}, {_SLIT("\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath"), 0, { .d_c = 0 }}}))); if (res.exit_code != 0) { return (Option_v__builder__VsInstallation){ .state=2, .err=error_with_code(res.output, res.exit_code), .data={EMPTY_STRUCT_INITIALIZATION} }; } string res_output = string_trim_space(res.output); - Option_string _t2 = os__read_file( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.txt"), 0, { .d_c = 0 }}}))); + Option_string _t2 = os__read_file( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.txt"), 0, { .d_c = 0 }}}))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Unable to find vs installation")), .data={EMPTY_STRUCT_INITIALIZATION} }; @@ -94447,15 +94741,15 @@ VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(str string version = (*(string*)_t2.data); string v = string_trim_space(version); - string lib_path = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), 0xfe10, {.d_s = v}}, {_SLIT("\\lib\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); - string include_path = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), 0xfe10, {.d_s = v}}, {_SLIT("\\include"), 0, { .d_c = 0 }}})); - if (os__exists( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = lib_path}}, {_SLIT("\\vcruntime.lib"), 0, { .d_c = 0 }}})))) { - string p = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), 0xfe10, {.d_s = v}}, {_SLIT("\\bin\\Host"), 0xfe10, {.d_s = host_arch}}, {_SLIT("\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string lib_path = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("\\lib\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string include_path = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("\\include"), 0, { .d_c = 0 }}})); + if (os__exists( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = lib_path}}, {_SLIT("\\vcruntime.lib"), 0, { .d_c = 0 }}})))) { + string p = str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = res_output}}, {_SLIT("\\VC\\Tools\\MSVC\\"), /*115 &string*/0xfe10, {.d_s = v}}, {_SLIT("\\bin\\Host"), /*115 &string*/0xfe10, {.d_s = host_arch}}, {_SLIT("\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); Option_v__builder__VsInstallation _t4; opt_ok(&(v__builder__VsInstallation[]) { ((v__builder__VsInstallation){.include_path = include_path,.lib_path = lib_path,.exe_path = p,}) }, (Option*)(&_t4), sizeof(v__builder__VsInstallation)); return _t4; } - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to find vs installation (attempted to use lib path \""), 0xfe10, {.d_s = lib_path}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to find vs installation (attempted to use lib path \""), /*115 &string*/0xfe10, {.d_s = lib_path}}, {_SLIT("\")"), 0, { .d_c = 0 }}}))); return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Unable to find vs exe folder")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #else @@ -94474,9 +94768,9 @@ VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_env(str if ((vc_tools_dir).len == 0) { return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("empty VCToolsInstallDir")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - string bin_dir = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("bin\\Host"), 0xfe10, {.d_s = host_arch}}, {_SLIT("\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); - string lib_path = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("lib\\"), 0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); - string include_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("include"), 0, { .d_c = 0 }}})); + string bin_dir = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("bin\\Host"), /*115 &string*/0xfe10, {.d_s = host_arch}}, {_SLIT("\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string lib_path = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("lib\\"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT0, 0, { .d_c = 0 }}})); + string include_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = vc_tools_dir}}, {_SLIT("include"), 0, { .d_c = 0 }}})); Option_v__builder__VsInstallation _t3; opt_ok(&(v__builder__VsInstallation[]) { ((v__builder__VsInstallation){.include_path = include_path,.lib_path = lib_path,.exe_path = bin_dir,}) }, (Option*)(&_t3), sizeof(v__builder__VsInstallation)); return _t3; @@ -94536,18 +94830,18 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { string out_name_cmd_line = os__real_path(string__plus(v->out_name_c, _SLIT(".rsp"))); Array_string a = __new_array_with_default(0, 0, sizeof(string), 0); string env_cflags = os__getenv(_SLIT("CFLAGS")); - string all_cflags = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = env_cflags}}, {_SLIT(" "), 0xfe10, {.d_s = v->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}})); + string all_cflags = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = env_cflags}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!string__eq(all_cflags, _SLIT(" "))) { array_push((array*)&a, _MOV((string[]){ string_clone(all_cflags) })); } - _PUSH_MANY(&a, (new_array_from_c_array(5, 5, sizeof(string), _MOV((string[5]){_SLIT("-w"), _SLIT("/we4013"), _SLIT("/volatile:ms"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("/Fo\""), 0xfe10, {.d_s = out_name_obj}}, {_SLIT("\""), 0, { .d_c = 0 }}})), _SLIT("/F 16777216")}))), _t2, Array_string); + _PUSH_MANY(&a, (new_array_from_c_array(5, 5, sizeof(string), _MOV((string[5]){_SLIT("-w"), _SLIT("/we4013"), _SLIT("/volatile:ms"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("/Fo\""), /*115 &string*/0xfe10, {.d_s = out_name_obj}}, {_SLIT("\""), 0, { .d_c = 0 }}})), _SLIT("/F 16777216")}))), _t2, Array_string); if (v->pref->is_prod) { array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/O2")) })); } if (v->pref->is_debug) { array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/MDd")) })); array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/D_DEBUG")) })); - _PUSH_MANY(&a, (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("/Zi"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("/Fd\""), 0xfe10, {.d_s = out_name_pdb}}, {_SLIT("\""), 0, { .d_c = 0 }}}))}))), _t6, Array_string); + _PUSH_MANY(&a, (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("/Zi"), str_intp(2, _MOV((StrIntpData[]){{_SLIT("/Fd\""), /*115 &string*/0xfe10, {.d_s = out_name_pdb}}, {_SLIT("\""), 0, { .d_c = 0 }}}))}))), _t6, Array_string); } else { array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/MD")) })); array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/DNDEBUG")) })); @@ -94576,20 +94870,20 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { Array_string lib_paths = sflags.lib_paths; Array_string defines = sflags.defines; Array_string other_flags = sflags.other_flags; - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = r.ucrt_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = r.vs_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = r.um_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = r.shared_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = r.ucrt_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = r.vs_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = r.um_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = r.shared_include_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); _PUSH_MANY(&a, (defines), _t17, Array_string); _PUSH_MANY(&a, (inc_paths), _t18, Array_string); _PUSH_MANY(&a, (other_flags), _t19, Array_string); array_push((array*)&a, _MOV((string[]){ string_clone(Array_string_join(real_libs, _SLIT(" "))) })); array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/link")) })); array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/NOLOGO")) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/OUT:\""), 0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), 0xfe10, {.d_s = r.ucrt_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), 0xfe10, {.d_s = r.um_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); - array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), 0xfe10, {.d_s = r.vs_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/OUT:\""), /*115 &string*/0xfe10, {.d_s = v->pref->out_name}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), /*115 &string*/0xfe10, {.d_s = r.ucrt_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), /*115 &string*/0xfe10, {.d_s = r.um_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&a, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/LIBPATH:\""), /*115 &string*/0xfe10, {.d_s = r.vs_lib_path}}, {_SLIT("\""), 0, { .d_c = 0 }}}))) })); if (!string_contains(all_cflags, _SLIT("/DEBUG"))) { array_push((array*)&a, _MOV((string[]){ string_clone(_SLIT("/DEBUG:FULL")) })); } @@ -94607,16 +94901,16 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { Option_void _t33 = os__write_file(out_name_cmd_line, args); if (_t33.state != 0 && _t33.err._typ != _IError_None___index) { IError err = _t33.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to write response file to \""), 0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Unable to write response file to \""), /*115 &string*/0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } ; - string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = r.full_cl_exe_path}}, {_SLIT("\" \"@"), 0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}})); + string cmd = str_intp(3, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = r.full_cl_exe_path}}, {_SLIT("\" \"@"), /*115 &string*/0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}})); v__builder__Builder_show_cc(v, cmd, out_name_cmd_line, args); if (!string__eq(os__user_os(), _SLIT("windows")) && !string_ends_with(v->pref->out_name, _SLIT(".c"))) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Cannot build with msvc on "), 0xfe10, {.d_s = os__user_os()}}, {_SLIT0, 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("Cannot build with msvc on "), /*115 &string*/0xfe10, {.d_s = os__user_os()}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); } v__util__timing_start(_SLIT("C msvc")); @@ -94647,20 +94941,20 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file_with_msvc(v__ VUNREACHABLE(); } string path_without_o_postfix = string_substr(path, 0, path.len - 2); - string obj_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path_without_o_postfix}}, {_SLIT(".obj"), 0, { .d_c = 0 }}})); + string obj_path = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path_without_o_postfix}}, {_SLIT(".obj"), 0, { .d_c = 0 }}})); obj_path = os__real_path(obj_path); if (os__exists(obj_path)) { return; } - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = obj_path}}, {_SLIT(" not found, building it (with msvc)..."), 0, { .d_c = 0 }}}))); - string cfile = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = path_without_o_postfix}}, {_SLIT(".c"), 0, { .d_c = 0 }}})); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = obj_path}}, {_SLIT(" not found, building it (with msvc)..."), 0, { .d_c = 0 }}}))); + string cfile = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = path_without_o_postfix}}, {_SLIT(".c"), 0, { .d_c = 0 }}})); v__builder__MsvcStringFlags flags = v__builder__msvc_string_flags(moduleflags); string inc_dirs = Array_string_join(flags.inc_paths, _SLIT(" ")); string defines = Array_string_join(flags.defines, _SLIT(" ")); - string include_string = str_intp(6, _MOV((StrIntpData[]){{_SLIT("-I \""), 0xfe10, {.d_s = msvc.ucrt_include_path}}, {_SLIT("\" -I \""), 0xfe10, {.d_s = msvc.vs_include_path}}, {_SLIT("\" -I \""), 0xfe10, {.d_s = msvc.um_include_path}}, {_SLIT("\" -I \""), 0xfe10, {.d_s = msvc.shared_include_path}}, {_SLIT("\" "), 0xfe10, {.d_s = inc_dirs}}, {_SLIT0, 0, { .d_c = 0 }}})); + string include_string = str_intp(6, _MOV((StrIntpData[]){{_SLIT("-I \""), /*115 &string*/0xfe10, {.d_s = msvc.ucrt_include_path}}, {_SLIT("\" -I \""), /*115 &string*/0xfe10, {.d_s = msvc.vs_include_path}}, {_SLIT("\" -I \""), /*115 &string*/0xfe10, {.d_s = msvc.um_include_path}}, {_SLIT("\" -I \""), /*115 &string*/0xfe10, {.d_s = msvc.shared_include_path}}, {_SLIT("\" "), /*115 &string*/0xfe10, {.d_s = inc_dirs}}, {_SLIT0, 0, { .d_c = 0 }}})); Array_string oargs = __new_array_with_default(0, 0, sizeof(string), 0); string env_cflags = os__getenv(_SLIT("CFLAGS")); - string all_cflags = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = env_cflags}}, {_SLIT(" "), 0xfe10, {.d_s = v->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}})); + string all_cflags = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = env_cflags}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = v->pref->cflags}}, {_SLIT0, 0, { .d_c = 0 }}})); if (!string__eq(all_cflags, _SLIT(" "))) { array_push((array*)&oargs, _MOV((string[]){ string_clone(all_cflags) })); } @@ -94677,10 +94971,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file_with_msvc(v__ array_push((array*)&oargs, _MOV((string[]){ string_clone(env_ldflags) })); } string str_oargs = Array_string_join(oargs, _SLIT(" ")); - string cmd = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = msvc.full_cl_exe_path}}, {_SLIT("\" /volatile:ms "), 0xfe10, {.d_s = str_oargs}}, {_SLIT(" "), 0xfe10, {.d_s = defines}}, {_SLIT(" "), 0xfe10, {.d_s = include_string}}, {_SLIT(" /c \""), 0xfe10, {.d_s = cfile}}, {_SLIT("\" /Fo\""), 0xfe10, {.d_s = obj_path}}, {_SLIT("\""), 0, { .d_c = 0 }}})); + string cmd = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = msvc.full_cl_exe_path}}, {_SLIT("\" /volatile:ms "), /*115 &string*/0xfe10, {.d_s = str_oargs}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = defines}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = include_string}}, {_SLIT(" /c \""), /*115 &string*/0xfe10, {.d_s = cfile}}, {_SLIT("\" /Fo\""), /*115 &string*/0xfe10, {.d_s = obj_path}}, {_SLIT("\""), 0, { .d_c = 0 }}})); os__Result res = os__execute(cmd); if (res.exit_code != 0) { - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("msvc: failed to build a thirdparty object; cmd: "), 0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("msvc: failed to build a thirdparty object; cmd: "), /*115 &string*/0xfe10, {.d_s = cmd}}, {_SLIT0, 0, { .d_c = 0 }}}))); v__builder__verror(res.output); VUNREACHABLE(); } @@ -94697,7 +94991,7 @@ v__builder__MsvcStringFlags v__builder__msvc_string_flags(Array_v__cflag__CFlag v__cflag__CFlag flag = ((v__cflag__CFlag*)cflags.data)[_t1]; if (string__eq(flag.name, _SLIT("-l"))) { if (string_ends_with(flag.value, _SLIT(".dll"))) { - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("MSVC cannot link against a dll (`#flag -l "), 0xfe10, {.d_s = flag.value}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("MSVC cannot link against a dll (`#flag -l "), /*115 &string*/0xfe10, {.d_s = flag.value}}, {_SLIT("`)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); } string lib_lib = string__plus(flag.value, _SLIT(".lib")); @@ -94705,14 +94999,14 @@ v__builder__MsvcStringFlags v__builder__msvc_string_flags(Array_v__cflag__CFlag } else if (string__eq(flag.name, _SLIT("-I"))) { array_push((array*)&inc_paths, _MOV((string[]){ string_clone(v__cflag__CFlag_format(&flag)) })); } else if (string__eq(flag.name, _SLIT("-D"))) { - array_push((array*)&defines, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/D"), 0xfe10, {.d_s = flag.value}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&defines, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/D"), /*115 &string*/0xfe10, {.d_s = flag.value}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else if (string__eq(flag.name, _SLIT("-L"))) { array_push((array*)&lib_paths, _MOV((string[]){ string_clone(flag.value) })); array_push((array*)&lib_paths, _MOV((string[]){ string_clone(string__plus(string__plus(flag.value, _const_os__path_separator), _SLIT("msvc"))) })); } else if (string_ends_with(flag.value, _SLIT(".o"))) { - array_push((array*)&other_flags, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), 0xfe10, {.d_s = flag.value}}, {_SLIT("bj\""), 0, { .d_c = 0 }}}))) })); + array_push((array*)&other_flags, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("\""), /*115 &string*/0xfe10, {.d_s = flag.value}}, {_SLIT("bj\""), 0, { .d_c = 0 }}}))) })); } else if (string_starts_with(flag.value, _SLIT("-D"))) { - array_push((array*)&defines, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/D"), 0xfe10, {.d_s = string_substr(flag.value, 2, (flag.value).len)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); + array_push((array*)&defines, _MOV((string[]){ string_clone( str_intp(2, _MOV((StrIntpData[]){{_SLIT("/D"), /*115 &string*/0xfe10, {.d_s = string_substr(flag.value, 2, (flag.value).len)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); } else { array_push((array*)&other_flags, _MOV((string[]){ string_clone(flag.value) })); } @@ -94730,7 +95024,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { if (!b->pref->use_cache || b->pref->build_mode == v__pref__BuildMode__build_module) { return; } - v__util__timing_start( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" source_hashing"), 0, { .d_c = 0 }}}))); + v__util__timing_start( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" source_hashing"), 0, { .d_c = 0 }}}))); Map_string_string new_hashes = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); Map_string_string old_hashes = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); strings__Builder sb_new_hashes = strings__new_builder(1024); @@ -94788,9 +95082,9 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { } (*(string*)_t7.data); - v__util__timing_measure( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" source_hashing"), 0, { .d_c = 0 }}}))); + v__util__timing_measure( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" source_hashing"), 0, { .d_c = 0 }}}))); if (!Map_string_string_map_eq(new_hashes, old_hashes)) { - v__util__timing_start( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" rebuilding"), 0, { .d_c = 0 }}}))); + v__util__timing_start( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" rebuilding"), 0, { .d_c = 0 }}}))); Map_string_int invalidated_paths = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); Map_string_int invalidated_mod_paths = new_map(sizeof(string), sizeof(int), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string); int _t9 = new_hashes.key_values.len; @@ -94908,7 +95202,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { v__builder__Builder_v_build_module(b, vexe, imp); } } - v__util__timing_measure( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" rebuilding"), 0, { .d_c = 0 }}}))); + v__util__timing_measure( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _SLIT("Builder.rebuild_modules")}}, {_SLIT(" rebuilding"), 0, { .d_c = 0 }}}))); } } @@ -94925,7 +95219,7 @@ string pwd; ; string boptions = Array_string_join(b->pref->build_options, _SLIT(" ")); - string rebuild_cmd = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), 0xfe10, {.d_s = boptions}}, {_SLIT(" build-module "), 0xfe10, {.d_s = os__quoted_path(imp_path)}}, {_SLIT0, 0, { .d_c = 0 }}})); + string rebuild_cmd = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = os__quoted_path(vexe)}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = boptions}}, {_SLIT(" build-module "), /*115 &string*/0xfe10, {.d_s = os__quoted_path(imp_path)}}, {_SLIT0, 0, { .d_c = 0 }}})); ; os__system(rebuild_cmd); // Defer begin @@ -94945,13 +95239,13 @@ VV_LOCAL_SYMBOL string v__builder__Builder_rebuild_cached_module(v__builder__Bui if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (b->pref->is_verbose) { - println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Cached "), 0xfe10, {.d_s = imp_path}}, {_SLIT(" .o file not found... Building .o file for "), 0xfe10, {.d_s = imp_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + println( str_intp(3, _MOV((StrIntpData[]){{_SLIT("Cached "), /*115 &string*/0xfe10, {.d_s = imp_path}}, {_SLIT(" .o file not found... Building .o file for "), /*115 &string*/0xfe10, {.d_s = imp_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); } v__builder__Builder_v_build_module(b, vexe, imp_path); Option_string _t2 = v__vcache__CacheManager_exists(&b->pref->cache_manager, _SLIT(".o"), imp_path); if (_t2.state != 0) { /*or block*/ err = _t2.err; - _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not rebuild cache module for "), 0xfe10, {.d_s = imp_path}}, {_SLIT(", error: "), 0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}}))); + _v_panic( str_intp(3, _MOV((StrIntpData[]){{_SLIT("could not rebuild cache module for "), /*115 &string*/0xfe10, {.d_s = imp_path}}, {_SLIT(", error: "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}}))); VUNREACHABLE(); ; } @@ -94980,7 +95274,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_handle_usecache(v__builder__Builder* b, Option_string _t3 = v__builder__Builder_find_module_path(b, ast_file->mod.name, ast_file->path); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), 0xfe10, {.d_s = ast_file->mod.name}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), /*115 &string*/0xfe10, {.d_s = ast_file->mod.name}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); break; } @@ -95008,7 +95302,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_handle_usecache(v__builder__Builder* b, Option_string _t7 = v__builder__Builder_find_module_path(b, imp, ast_file->path); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; - v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), 0xfe10, {.d_s = imp}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); + v__builder__verror( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot import module \""), /*115 &string*/0xfe10, {.d_s = imp}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); VUNREACHABLE(); break; } @@ -95081,7 +95375,7 @@ string v__builder__cbuilder__gen_c(v__builder__Builder* b, Array_string v_files) void v__builder__cbuilder__build_c(v__builder__Builder* b, Array_string v_files, string out_file) { b->out_name_c = out_file; b->pref->out_name_c = os__real_path(out_file); - v__builder__Builder_info(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("build_c("), 0xfe10, {.d_s = out_file}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); + v__builder__Builder_info(b, str_intp(2, _MOV((StrIntpData[]){{_SLIT("build_c("), /*115 &string*/0xfe10, {.d_s = out_file}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); string output2 = v__builder__cbuilder__gen_c(b, v_files); Option_void _t1 = os__write_file(out_file, output2); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { @@ -95131,9 +95425,9 @@ v__util__Timers* timers; } Array_string _t5; Array_string args_and_flags = (_t5 = v__util__join_env_vflags_and_os_args(), array_slice(_t5, 1, _t5.len)); - multi_return_ref_v__pref__Preferences_string mr_1761 = v__pref__parse_args_and_show_errors(_const_main__external_tools, args_and_flags, true); - v__pref__Preferences* prefs = mr_1761.arg0; - string command = mr_1761.arg1; + multi_return_ref_v__pref__Preferences_string mr_1774 = v__pref__parse_args_and_show_errors(_const_main__external_tools, args_and_flags, true); + v__pref__Preferences* prefs = mr_1774.arg0; + string command = mr_1774.arg1; if (prefs->use_cache && string__eq(os__user_os(), _SLIT("windows"))) { eprintln(_SLIT("-usecache is currently disabled on windows")); _v_exit(1); @@ -95237,7 +95531,7 @@ v__util__Timers* timers; if (prefs->is_help) { main__invoke_help_and_exit(args); } - eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("v "), 0xfe10, {.d_s = command}}, {_SLIT(": unknown command\nRun "), 0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT(" for usage."), 0, { .d_c = 0 }}}))); + eprintln( str_intp(3, _MOV((StrIntpData[]){{_SLIT("v "), /*115 &string*/0xfe10, {.d_s = command}}, {_SLIT(": unknown command\nRun "), /*115 &string*/0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT(" for usage."), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -95252,8 +95546,8 @@ VV_LOCAL_SYMBOL void main__invoke_help_and_exit(Array_string remaining) { } else { }; - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, 0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT(": provide only one help topic."), 0, { .d_c = 0 }}}))); - println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("For usage information, use "), 0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT("."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT(": provide only one help topic."), 0, { .d_c = 0 }}}))); + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("For usage information, use "), /*115 &string*/0xfe10, {.d_s = term__highlight_command(_SLIT("v help"))}}, {_SLIT("."), 0, { .d_c = 0 }}}))); _v_exit(1); VUNREACHABLE(); } @@ -95264,106 +95558,106 @@ void _vinit(int ___argc, voidptr ___argv) { #endif as_cast_type_indexes = new_array_from_c_array(102, 102, sizeof(VCastTypeIndexName), _MOV((VCastTypeIndexName[102]){ (VCastTypeIndexName){.tindex = 0, .tname = _SLIT("unknown")} - , (VCastTypeIndexName){.tindex = 468, .tname = _SLIT("v.ast.Aggregate")} - , (VCastTypeIndexName){.tindex = 470, .tname = _SLIT("v.ast.Alias")} - , (VCastTypeIndexName){.tindex = 450, .tname = _SLIT("v.ast.Array")} - , (VCastTypeIndexName){.tindex = 478, .tname = _SLIT("v.ast.ArrayFixed")} - , (VCastTypeIndexName){.tindex = 479, .tname = _SLIT("v.ast.Chan")} - , (VCastTypeIndexName){.tindex = 484, .tname = _SLIT("v.ast.Enum")} - , (VCastTypeIndexName){.tindex = 482, .tname = _SLIT("v.ast.FnType")} - , (VCastTypeIndexName){.tindex = 483, .tname = _SLIT("v.ast.GenericInst")} - , (VCastTypeIndexName){.tindex = 473, .tname = _SLIT("v.ast.Interface")} - , (VCastTypeIndexName){.tindex = 451, .tname = _SLIT("v.ast.Map")} - , (VCastTypeIndexName){.tindex = 481, .tname = _SLIT("v.ast.MultiReturn")} - , (VCastTypeIndexName){.tindex = 455, .tname = _SLIT("v.ast.Struct")} - , (VCastTypeIndexName){.tindex = 474, .tname = _SLIT("v.ast.SumType")} - , (VCastTypeIndexName){.tindex = 480, .tname = _SLIT("v.ast.Thread")} - , (VCastTypeIndexName){.tindex = 414, .tname = _SLIT("v.ast.IdentFn")} - , (VCastTypeIndexName){.tindex = 415, .tname = _SLIT("v.ast.IdentVar")} - , (VCastTypeIndexName){.tindex = 283, .tname = _SLIT("v.ast.AnonFn")} - , (VCastTypeIndexName){.tindex = 284, .tname = _SLIT("v.ast.ArrayDecompose")} - , (VCastTypeIndexName){.tindex = 285, .tname = _SLIT("v.ast.ArrayInit")} - , (VCastTypeIndexName){.tindex = 286, .tname = _SLIT("v.ast.AsCast")} - , (VCastTypeIndexName){.tindex = 287, .tname = _SLIT("v.ast.Assoc")} - , (VCastTypeIndexName){.tindex = 288, .tname = _SLIT("v.ast.AtExpr")} - , (VCastTypeIndexName){.tindex = 289, .tname = _SLIT("v.ast.BoolLiteral")} - , (VCastTypeIndexName){.tindex = 290, .tname = _SLIT("v.ast.CTempVar")} - , (VCastTypeIndexName){.tindex = 291, .tname = _SLIT("v.ast.CallExpr")} - , (VCastTypeIndexName){.tindex = 292, .tname = _SLIT("v.ast.CastExpr")} - , (VCastTypeIndexName){.tindex = 293, .tname = _SLIT("v.ast.ChanInit")} - , (VCastTypeIndexName){.tindex = 294, .tname = _SLIT("v.ast.CharLiteral")} - , (VCastTypeIndexName){.tindex = 295, .tname = _SLIT("v.ast.Comment")} - , (VCastTypeIndexName){.tindex = 296, .tname = _SLIT("v.ast.ComptimeCall")} - , (VCastTypeIndexName){.tindex = 297, .tname = _SLIT("v.ast.ComptimeSelector")} - , (VCastTypeIndexName){.tindex = 298, .tname = _SLIT("v.ast.ComptimeType")} - , (VCastTypeIndexName){.tindex = 299, .tname = _SLIT("v.ast.ConcatExpr")} - , (VCastTypeIndexName){.tindex = 300, .tname = _SLIT("v.ast.DumpExpr")} - , (VCastTypeIndexName){.tindex = 301, .tname = _SLIT("v.ast.EmptyExpr")} - , (VCastTypeIndexName){.tindex = 302, .tname = _SLIT("v.ast.EnumVal")} - , (VCastTypeIndexName){.tindex = 303, .tname = _SLIT("v.ast.FloatLiteral")} - , (VCastTypeIndexName){.tindex = 304, .tname = _SLIT("v.ast.GoExpr")} - , (VCastTypeIndexName){.tindex = 305, .tname = _SLIT("v.ast.Ident")} - , (VCastTypeIndexName){.tindex = 306, .tname = _SLIT("v.ast.IfExpr")} - , (VCastTypeIndexName){.tindex = 307, .tname = _SLIT("v.ast.IfGuardExpr")} - , (VCastTypeIndexName){.tindex = 308, .tname = _SLIT("v.ast.IndexExpr")} - , (VCastTypeIndexName){.tindex = 309, .tname = _SLIT("v.ast.InfixExpr")} - , (VCastTypeIndexName){.tindex = 310, .tname = _SLIT("v.ast.IntegerLiteral")} - , (VCastTypeIndexName){.tindex = 311, .tname = _SLIT("v.ast.IsRefType")} - , (VCastTypeIndexName){.tindex = 312, .tname = _SLIT("v.ast.Likely")} - , (VCastTypeIndexName){.tindex = 313, .tname = _SLIT("v.ast.LockExpr")} - , (VCastTypeIndexName){.tindex = 314, .tname = _SLIT("v.ast.MapInit")} - , (VCastTypeIndexName){.tindex = 315, .tname = _SLIT("v.ast.MatchExpr")} - , (VCastTypeIndexName){.tindex = 316, .tname = _SLIT("v.ast.NodeError")} - , (VCastTypeIndexName){.tindex = 317, .tname = _SLIT("v.ast.None")} - , (VCastTypeIndexName){.tindex = 318, .tname = _SLIT("v.ast.OffsetOf")} - , (VCastTypeIndexName){.tindex = 319, .tname = _SLIT("v.ast.OrExpr")} - , (VCastTypeIndexName){.tindex = 320, .tname = _SLIT("v.ast.ParExpr")} - , (VCastTypeIndexName){.tindex = 321, .tname = _SLIT("v.ast.PostfixExpr")} - , (VCastTypeIndexName){.tindex = 322, .tname = _SLIT("v.ast.PrefixExpr")} - , (VCastTypeIndexName){.tindex = 323, .tname = _SLIT("v.ast.RangeExpr")} - , (VCastTypeIndexName){.tindex = 324, .tname = _SLIT("v.ast.SelectExpr")} - , (VCastTypeIndexName){.tindex = 325, .tname = _SLIT("v.ast.SelectorExpr")} - , (VCastTypeIndexName){.tindex = 326, .tname = _SLIT("v.ast.SizeOf")} - , (VCastTypeIndexName){.tindex = 327, .tname = _SLIT("v.ast.SqlExpr")} - , (VCastTypeIndexName){.tindex = 328, .tname = _SLIT("v.ast.StringInterLiteral")} - , (VCastTypeIndexName){.tindex = 329, .tname = _SLIT("v.ast.StringLiteral")} - , (VCastTypeIndexName){.tindex = 330, .tname = _SLIT("v.ast.StructInit")} - , (VCastTypeIndexName){.tindex = 331, .tname = _SLIT("v.ast.TypeNode")} - , (VCastTypeIndexName){.tindex = 332, .tname = _SLIT("v.ast.TypeOf")} - , (VCastTypeIndexName){.tindex = 333, .tname = _SLIT("v.ast.UnsafeExpr")} - , (VCastTypeIndexName){.tindex = 360, .tname = _SLIT("v.ast.AsmRegister")} - , (VCastTypeIndexName){.tindex = 361, .tname = _SLIT("v.ast.ConstField")} - , (VCastTypeIndexName){.tindex = 362, .tname = _SLIT("v.ast.GlobalField")} - , (VCastTypeIndexName){.tindex = 363, .tname = _SLIT("v.ast.Var")} - , (VCastTypeIndexName){.tindex = 335, .tname = _SLIT("v.ast.AsmStmt")} - , (VCastTypeIndexName){.tindex = 336, .tname = _SLIT("v.ast.AssertStmt")} - , (VCastTypeIndexName){.tindex = 337, .tname = _SLIT("v.ast.AssignStmt")} - , (VCastTypeIndexName){.tindex = 338, .tname = _SLIT("v.ast.Block")} - , (VCastTypeIndexName){.tindex = 339, .tname = _SLIT("v.ast.BranchStmt")} - , (VCastTypeIndexName){.tindex = 340, .tname = _SLIT("v.ast.ComptimeFor")} - , (VCastTypeIndexName){.tindex = 341, .tname = _SLIT("v.ast.ConstDecl")} - , (VCastTypeIndexName){.tindex = 342, .tname = _SLIT("v.ast.DeferStmt")} - , (VCastTypeIndexName){.tindex = 343, .tname = _SLIT("v.ast.EmptyStmt")} - , (VCastTypeIndexName){.tindex = 344, .tname = _SLIT("v.ast.EnumDecl")} - , (VCastTypeIndexName){.tindex = 345, .tname = _SLIT("v.ast.ExprStmt")} - , (VCastTypeIndexName){.tindex = 218, .tname = _SLIT("v.ast.FnDecl")} - , (VCastTypeIndexName){.tindex = 346, .tname = _SLIT("v.ast.ForCStmt")} - , (VCastTypeIndexName){.tindex = 347, .tname = _SLIT("v.ast.ForInStmt")} - , (VCastTypeIndexName){.tindex = 348, .tname = _SLIT("v.ast.ForStmt")} - , (VCastTypeIndexName){.tindex = 349, .tname = _SLIT("v.ast.GlobalDecl")} - , (VCastTypeIndexName){.tindex = 350, .tname = _SLIT("v.ast.GotoLabel")} - , (VCastTypeIndexName){.tindex = 351, .tname = _SLIT("v.ast.GotoStmt")} - , (VCastTypeIndexName){.tindex = 352, .tname = _SLIT("v.ast.HashStmt")} - , (VCastTypeIndexName){.tindex = 353, .tname = _SLIT("v.ast.Import")} - , (VCastTypeIndexName){.tindex = 354, .tname = _SLIT("v.ast.InterfaceDecl")} - , (VCastTypeIndexName){.tindex = 355, .tname = _SLIT("v.ast.Module")} - , (VCastTypeIndexName){.tindex = 356, .tname = _SLIT("v.ast.Return")} - , (VCastTypeIndexName){.tindex = 357, .tname = _SLIT("v.ast.SqlStmt")} - , (VCastTypeIndexName){.tindex = 358, .tname = _SLIT("v.ast.StructDecl")} - , (VCastTypeIndexName){.tindex = 282, .tname = _SLIT("v.ast.TypeDecl")} - , (VCastTypeIndexName){.tindex = 435, .tname = _SLIT("v.ast.AsmAddressing")} - , (VCastTypeIndexName){.tindex = 436, .tname = _SLIT("v.ast.AsmAlias")} - , (VCastTypeIndexName){.tindex = 437, .tname = _SLIT("v.ast.AsmDisp")} + , (VCastTypeIndexName){.tindex = 469, .tname = _SLIT("v.ast.Aggregate")} + , (VCastTypeIndexName){.tindex = 471, .tname = _SLIT("v.ast.Alias")} + , (VCastTypeIndexName){.tindex = 451, .tname = _SLIT("v.ast.Array")} + , (VCastTypeIndexName){.tindex = 479, .tname = _SLIT("v.ast.ArrayFixed")} + , (VCastTypeIndexName){.tindex = 480, .tname = _SLIT("v.ast.Chan")} + , (VCastTypeIndexName){.tindex = 485, .tname = _SLIT("v.ast.Enum")} + , (VCastTypeIndexName){.tindex = 483, .tname = _SLIT("v.ast.FnType")} + , (VCastTypeIndexName){.tindex = 484, .tname = _SLIT("v.ast.GenericInst")} + , (VCastTypeIndexName){.tindex = 474, .tname = _SLIT("v.ast.Interface")} + , (VCastTypeIndexName){.tindex = 452, .tname = _SLIT("v.ast.Map")} + , (VCastTypeIndexName){.tindex = 482, .tname = _SLIT("v.ast.MultiReturn")} + , (VCastTypeIndexName){.tindex = 456, .tname = _SLIT("v.ast.Struct")} + , (VCastTypeIndexName){.tindex = 475, .tname = _SLIT("v.ast.SumType")} + , (VCastTypeIndexName){.tindex = 481, .tname = _SLIT("v.ast.Thread")} + , (VCastTypeIndexName){.tindex = 415, .tname = _SLIT("v.ast.IdentFn")} + , (VCastTypeIndexName){.tindex = 416, .tname = _SLIT("v.ast.IdentVar")} + , (VCastTypeIndexName){.tindex = 284, .tname = _SLIT("v.ast.AnonFn")} + , (VCastTypeIndexName){.tindex = 285, .tname = _SLIT("v.ast.ArrayDecompose")} + , (VCastTypeIndexName){.tindex = 286, .tname = _SLIT("v.ast.ArrayInit")} + , (VCastTypeIndexName){.tindex = 287, .tname = _SLIT("v.ast.AsCast")} + , (VCastTypeIndexName){.tindex = 288, .tname = _SLIT("v.ast.Assoc")} + , (VCastTypeIndexName){.tindex = 289, .tname = _SLIT("v.ast.AtExpr")} + , (VCastTypeIndexName){.tindex = 290, .tname = _SLIT("v.ast.BoolLiteral")} + , (VCastTypeIndexName){.tindex = 291, .tname = _SLIT("v.ast.CTempVar")} + , (VCastTypeIndexName){.tindex = 292, .tname = _SLIT("v.ast.CallExpr")} + , (VCastTypeIndexName){.tindex = 293, .tname = _SLIT("v.ast.CastExpr")} + , (VCastTypeIndexName){.tindex = 294, .tname = _SLIT("v.ast.ChanInit")} + , (VCastTypeIndexName){.tindex = 295, .tname = _SLIT("v.ast.CharLiteral")} + , (VCastTypeIndexName){.tindex = 296, .tname = _SLIT("v.ast.Comment")} + , (VCastTypeIndexName){.tindex = 297, .tname = _SLIT("v.ast.ComptimeCall")} + , (VCastTypeIndexName){.tindex = 298, .tname = _SLIT("v.ast.ComptimeSelector")} + , (VCastTypeIndexName){.tindex = 299, .tname = _SLIT("v.ast.ComptimeType")} + , (VCastTypeIndexName){.tindex = 300, .tname = _SLIT("v.ast.ConcatExpr")} + , (VCastTypeIndexName){.tindex = 301, .tname = _SLIT("v.ast.DumpExpr")} + , (VCastTypeIndexName){.tindex = 302, .tname = _SLIT("v.ast.EmptyExpr")} + , (VCastTypeIndexName){.tindex = 303, .tname = _SLIT("v.ast.EnumVal")} + , (VCastTypeIndexName){.tindex = 304, .tname = _SLIT("v.ast.FloatLiteral")} + , (VCastTypeIndexName){.tindex = 305, .tname = _SLIT("v.ast.GoExpr")} + , (VCastTypeIndexName){.tindex = 306, .tname = _SLIT("v.ast.Ident")} + , (VCastTypeIndexName){.tindex = 307, .tname = _SLIT("v.ast.IfExpr")} + , (VCastTypeIndexName){.tindex = 308, .tname = _SLIT("v.ast.IfGuardExpr")} + , (VCastTypeIndexName){.tindex = 309, .tname = _SLIT("v.ast.IndexExpr")} + , (VCastTypeIndexName){.tindex = 310, .tname = _SLIT("v.ast.InfixExpr")} + , (VCastTypeIndexName){.tindex = 311, .tname = _SLIT("v.ast.IntegerLiteral")} + , (VCastTypeIndexName){.tindex = 312, .tname = _SLIT("v.ast.IsRefType")} + , (VCastTypeIndexName){.tindex = 313, .tname = _SLIT("v.ast.Likely")} + , (VCastTypeIndexName){.tindex = 314, .tname = _SLIT("v.ast.LockExpr")} + , (VCastTypeIndexName){.tindex = 315, .tname = _SLIT("v.ast.MapInit")} + , (VCastTypeIndexName){.tindex = 316, .tname = _SLIT("v.ast.MatchExpr")} + , (VCastTypeIndexName){.tindex = 317, .tname = _SLIT("v.ast.NodeError")} + , (VCastTypeIndexName){.tindex = 318, .tname = _SLIT("v.ast.None")} + , (VCastTypeIndexName){.tindex = 319, .tname = _SLIT("v.ast.OffsetOf")} + , (VCastTypeIndexName){.tindex = 320, .tname = _SLIT("v.ast.OrExpr")} + , (VCastTypeIndexName){.tindex = 321, .tname = _SLIT("v.ast.ParExpr")} + , (VCastTypeIndexName){.tindex = 322, .tname = _SLIT("v.ast.PostfixExpr")} + , (VCastTypeIndexName){.tindex = 323, .tname = _SLIT("v.ast.PrefixExpr")} + , (VCastTypeIndexName){.tindex = 324, .tname = _SLIT("v.ast.RangeExpr")} + , (VCastTypeIndexName){.tindex = 325, .tname = _SLIT("v.ast.SelectExpr")} + , (VCastTypeIndexName){.tindex = 326, .tname = _SLIT("v.ast.SelectorExpr")} + , (VCastTypeIndexName){.tindex = 327, .tname = _SLIT("v.ast.SizeOf")} + , (VCastTypeIndexName){.tindex = 328, .tname = _SLIT("v.ast.SqlExpr")} + , (VCastTypeIndexName){.tindex = 329, .tname = _SLIT("v.ast.StringInterLiteral")} + , (VCastTypeIndexName){.tindex = 330, .tname = _SLIT("v.ast.StringLiteral")} + , (VCastTypeIndexName){.tindex = 331, .tname = _SLIT("v.ast.StructInit")} + , (VCastTypeIndexName){.tindex = 332, .tname = _SLIT("v.ast.TypeNode")} + , (VCastTypeIndexName){.tindex = 333, .tname = _SLIT("v.ast.TypeOf")} + , (VCastTypeIndexName){.tindex = 334, .tname = _SLIT("v.ast.UnsafeExpr")} + , (VCastTypeIndexName){.tindex = 361, .tname = _SLIT("v.ast.AsmRegister")} + , (VCastTypeIndexName){.tindex = 362, .tname = _SLIT("v.ast.ConstField")} + , (VCastTypeIndexName){.tindex = 363, .tname = _SLIT("v.ast.GlobalField")} + , (VCastTypeIndexName){.tindex = 364, .tname = _SLIT("v.ast.Var")} + , (VCastTypeIndexName){.tindex = 336, .tname = _SLIT("v.ast.AsmStmt")} + , (VCastTypeIndexName){.tindex = 337, .tname = _SLIT("v.ast.AssertStmt")} + , (VCastTypeIndexName){.tindex = 338, .tname = _SLIT("v.ast.AssignStmt")} + , (VCastTypeIndexName){.tindex = 339, .tname = _SLIT("v.ast.Block")} + , (VCastTypeIndexName){.tindex = 340, .tname = _SLIT("v.ast.BranchStmt")} + , (VCastTypeIndexName){.tindex = 341, .tname = _SLIT("v.ast.ComptimeFor")} + , (VCastTypeIndexName){.tindex = 342, .tname = _SLIT("v.ast.ConstDecl")} + , (VCastTypeIndexName){.tindex = 343, .tname = _SLIT("v.ast.DeferStmt")} + , (VCastTypeIndexName){.tindex = 344, .tname = _SLIT("v.ast.EmptyStmt")} + , (VCastTypeIndexName){.tindex = 345, .tname = _SLIT("v.ast.EnumDecl")} + , (VCastTypeIndexName){.tindex = 346, .tname = _SLIT("v.ast.ExprStmt")} + , (VCastTypeIndexName){.tindex = 219, .tname = _SLIT("v.ast.FnDecl")} + , (VCastTypeIndexName){.tindex = 347, .tname = _SLIT("v.ast.ForCStmt")} + , (VCastTypeIndexName){.tindex = 348, .tname = _SLIT("v.ast.ForInStmt")} + , (VCastTypeIndexName){.tindex = 349, .tname = _SLIT("v.ast.ForStmt")} + , (VCastTypeIndexName){.tindex = 350, .tname = _SLIT("v.ast.GlobalDecl")} + , (VCastTypeIndexName){.tindex = 351, .tname = _SLIT("v.ast.GotoLabel")} + , (VCastTypeIndexName){.tindex = 352, .tname = _SLIT("v.ast.GotoStmt")} + , (VCastTypeIndexName){.tindex = 353, .tname = _SLIT("v.ast.HashStmt")} + , (VCastTypeIndexName){.tindex = 354, .tname = _SLIT("v.ast.Import")} + , (VCastTypeIndexName){.tindex = 355, .tname = _SLIT("v.ast.InterfaceDecl")} + , (VCastTypeIndexName){.tindex = 356, .tname = _SLIT("v.ast.Module")} + , (VCastTypeIndexName){.tindex = 357, .tname = _SLIT("v.ast.Return")} + , (VCastTypeIndexName){.tindex = 358, .tname = _SLIT("v.ast.SqlStmt")} + , (VCastTypeIndexName){.tindex = 359, .tname = _SLIT("v.ast.StructDecl")} + , (VCastTypeIndexName){.tindex = 283, .tname = _SLIT("v.ast.TypeDecl")} + , (VCastTypeIndexName){.tindex = 436, .tname = _SLIT("v.ast.AsmAddressing")} + , (VCastTypeIndexName){.tindex = 437, .tname = _SLIT("v.ast.AsmAlias")} + , (VCastTypeIndexName){.tindex = 438, .tname = _SLIT("v.ast.AsmDisp")} , (VCastTypeIndexName){.tindex = 20, .tname = _SLIT("string")} })); @@ -96002,6 +96296,7 @@ void _vinit(int ___argc, voidptr ___argv) { _const_v__ast__string_type_idxs = new_array_from_c_array(1, 1, sizeof(int), _MOV((int[1]){_const_v__ast__string_type_idx})); _const_v__ast__void_type = v__ast__new_type(_const_v__ast__void_type_idx); _const_v__ast__ovoid_type = v__ast__Type_set_flag(v__ast__new_type(_const_v__ast__void_type_idx), v__ast__TypeFlag__optional); + _const_v__ast__rvoid_type = v__ast__Type_set_flag(v__ast__new_type(_const_v__ast__void_type_idx), v__ast__TypeFlag__result); _const_v__ast__voidptr_type = v__ast__new_type(_const_v__ast__voidptr_type_idx); _const_v__ast__byteptr_type = v__ast__new_type(_const_v__ast__byteptr_type_idx); _const_v__ast__charptr_type = v__ast__new_type(_const_v__ast__charptr_type_idx); @@ -96052,9 +96347,9 @@ void _vinit(int ___argc, voidptr ___argv) { _const_v__checker__array_builtin_methods = new_array_from_c_array(15, 15, sizeof(string), _MOV((string[15]){ _SLIT("filter"), _SLIT("clone"), _SLIT("repeat"), _SLIT("reverse"), _SLIT("map"), _SLIT("slice"), _SLIT("sort"), _SLIT("contains"), _SLIT("index"), _SLIT("wait"), _SLIT("any"), _SLIT("all"), _SLIT("first"), _SLIT("last"), _SLIT("pop")})); - _const_v__checker__reserved_type_names = new_array_from_c_array(15, 15, sizeof(string), _MOV((string[15]){ - _SLIT("bool"), _SLIT("char"), _SLIT("i8"), _SLIT("i16"), _SLIT("int"), _SLIT("i64"), _SLIT("byte"), _SLIT("u16"), _SLIT("u32"), - _SLIT("u64"), _SLIT("f32"), _SLIT("f64"), _SLIT("map"), _SLIT("string"), _SLIT("rune")})); + _const_v__checker__reserved_type_names = new_array_from_c_array(16, 16, sizeof(string), _MOV((string[16]){ + _SLIT("byte"), _SLIT("bool"), _SLIT("char"), _SLIT("i8"), _SLIT("i16"), _SLIT("int"), _SLIT("i64"), _SLIT("u8"), _SLIT("u16"), + _SLIT("u32"), _SLIT("u64"), _SLIT("f32"), _SLIT("f64"), _SLIT("map"), _SLIT("string"), _SLIT("rune")})); } { // Initializations for module v.transformer : } @@ -96074,9 +96369,9 @@ void _vinit(int ___argc, voidptr ___argv) { _const_v__gen__c__c_reserved_map = v__gen__c__string_array_to_map(_const_v__gen__c__c_reserved); _const_v__gen__c__cmp_str = new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("eq"), _SLIT("ne"), _SLIT("gt"), _SLIT("lt"), _SLIT("ge"), _SLIT("le")})); _const_v__gen__c__cmp_rev = new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("eq"), _SLIT("ne"), _SLIT("lt"), _SLIT("gt"), _SLIT("le"), _SLIT("ge")})); - _const_v__gen__c__builtins = new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){_SLIT("string"), _SLIT("array"), _SLIT("DenseArray"), _SLIT("map"), _SLIT("Error"), _SLIT("IError"), _SLIT("Option")})); - _const_v__gen__c__c_headers = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__)\n #define __V_amd64 1\n #undef __V_architecture\n #define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__)\n #define __V_arm64 1\n #undef __V_architecture\n #define __V_architecture 2\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n #define __V_GCC__\n#endif\n#ifdef __TINYC__\n #undef __V_GCC__\n#endif\n#ifdef __cplusplus\n #undef __V_GCC__\n#endif\n#ifdef __clang__\n #undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n #undef __V_GCC__\n #undef EMPTY_STRUCT_INITIALIZATION\n #define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n #define _Atomic volatile\n #undef EMPTY_STRUCT_DECLARATION\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #undef EMPTY_ARRAY_OF_ELEMS\n #define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n #undef __NOINLINE\n #undef __IRQHANDLER\n // tcc does not support inlining at all\n #define __NOINLINE\n #define __IRQHANDLER\n #undef TCCSKIP\n #define TCCSKIP(x)\n // #include \n #ifndef _WIN32\n #include \n int tcc_backtrace(const char *fmt, ...);\n #endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n #define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n// returns the number of CPU registers that TYPE takes up\n#define _REG_WIDTH(T) (((sizeof(T) + sizeof(void*) - 1) & ~(sizeof(void*) - 1)) / sizeof(void*))\n// parameters of size <= 2 registers are spilled across those two registers; larger types are passed as one pointer to some stack location\n#define _REG_WIDTH_BOUNDED(T) (_REG_WIDTH(T) <= 2 ? _REG_WIDTH(T) : 1)\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n #ifdef PRIx64\n #define V64_PRINTFORMAT \"0x%\"PRIx64\n #elif defined(__WIN32__)\n #define V64_PRINTFORMAT \"0x%I64x\"\n #elif defined(__linux__) && defined(__LP64__)\n #define V64_PRINTFORMAT \"0x%lx\"\n #else\n #define V64_PRINTFORMAT \"0x%llx\"\n #endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n #define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n #define VV_LOCAL_SYMBOL static\n#else\n // 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n // and does not support __has_attribute(visibility) ...\n #ifndef __has_attribute\n #define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n #endif\n #if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n #ifdef ARM\n #define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n #else\n #define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n #endif\n #if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n #define VV_LOCAL_SYMBOL static\n #else\n #define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n #endif\n #else\n #define VV_EXPORTED_SYMBOL extern\n #define VV_LOCAL_SYMBOL static\n #endif\n#endif\n\n#ifdef __cplusplus\n #include \n #define _MOV std::move\n#else\n #define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n #define VWEAK __attribute__((weak))\n #ifdef _MSC_VER\n #undef VWEAK\n #define VWEAK\n #endif\n#endif\n\n#if !defined(VNORETURN)\n #if defined(__TINYC__)\n #include \n #define VNORETURN noreturn\n #endif\n # if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n # define VNORETURN _Noreturn\n # elif defined(__GNUC__) && __GNUC__ >= 2\n # define VNORETURN __attribute__((noreturn))\n # endif\n #ifndef VNORETURN\n #define VNORETURN\n #endif\n#endif\n\n#if !defined(VUNREACHABLE)\n #if defined(__GNUC__) && !defined(__clang__)\n #define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n #if (V_GCC_VERSION >= 40500L)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #if defined(__clang__) && defined(__has_builtin)\n #if __has_builtin(__builtin_unreachable)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #ifndef VUNREACHABLE\n #define VUNREACHABLE() do { } while (0)\n #endif\n #if defined(__FreeBSD__) && defined(__TINYC__)\n #define VUNREACHABLE() do { } while (0)\n #endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n #define _likely_(x) __builtin_expect(x,1)\n #define _unlikely_(x) __builtin_expect(x,0)\n#else\n #define _likely_(x) (x)\n #define _unlikely_(x) (x)\n#endif\n\n\n// c_headers\ntypedef int (*qsort_callback_func)(const void*, const void*);\n#include // TODO remove all these includes, define all function signatures and types manually\n#include \n#include \n\n#ifndef _WIN32\n #if defined __has_include\n #if __has_include ()\n #include \n #else\n // Most probably musl OR __ANDROID__ ...\n int backtrace (void **__array, int __size) { return 0; }\n char **backtrace_symbols (void *const *__array, int __size){ return 0; }\n void backtrace_symbols_fd (void *const *__array, int __size, int __fd){}\n #endif\n #endif\n#endif\n\n#include // for va_list\n\n//================================== GLOBALS =================================*/\nint load_so(byteptr);\nvoid _vinit(int ___argc, voidptr ___argv);\nvoid _vcleanup(void);\n#define sigaction_size sizeof(sigaction);\n#define _ARR_LEN(a) ( (sizeof(a)) / (sizeof(a[0])) )\n\nvoid v_free(voidptr ptr);\nvoidptr memdup(voidptr src, int sz);\n\n#if INTPTR_MAX == INT32_MAX\n #define TARGET_IS_32BIT 1\n#elif INTPTR_MAX == INT64_MAX\n #define TARGET_IS_64BIT 1\n#else\n #error \"The environment is not 32 or 64-bit.\"\n#endif\n\n#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__)\n #define TARGET_ORDER_IS_BIG 1\n#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_IX86)\n #define TARGET_ORDER_IS_LITTLE 1\n#else\n #error \"Unknown architecture endianness\"\n#endif\n\n#ifndef _WIN32\n #include \n #include // tolower\n #include \n #include // sleep\n extern char **environ;\n#endif\n\n#if defined(__CYGWIN__) && !defined(_WIN32)\n #error Cygwin is not supported, please use MinGW or Visual Studio.\n#endif\n\n#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__vinix__) || defined(__serenity__) || defined(__sun)\n #include \n #include // os__wait uses wait on nix\n#endif\n\n#ifdef __OpenBSD__\n #include \n #include \n #include // os__wait uses wait on nix\n#endif\n\n#ifdef __NetBSD__\n #include // os__wait uses wait on nix\n#endif\n\n#ifdef _WIN32\n #define WINVER 0x0600\n #ifdef _WIN32_WINNT\n #undef _WIN32_WINNT\n #endif\n #define _WIN32_WINNT 0x0600\n #ifndef WIN32_FULL\n #define WIN32_LEAN_AND_MEAN\n #endif\n #ifndef _UNICODE\n #define _UNICODE\n #endif\n #ifndef UNICODE\n #define UNICODE\n #endif\n #include \n\n #include // _waccess\n #include // _wgetcwd\n #include // signal and SIGSEGV for segmentation fault handler\n\n #ifdef _MSC_VER\n // On MSVC these are the same (as long as /volatile:ms is passed)\n #define _Atomic volatile\n\n // MSVC cannot parse some things properly\n #undef EMPTY_STRUCT_DECLARATION\n #undef OPTION_CAST\n\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #define OPTION_CAST(x)\n #undef __NOINLINE\n #undef __IRQHANDLER\n #define __NOINLINE __declspec(noinline)\n #define __IRQHANDLER __declspec(naked)\n\n #include \n #pragma comment(lib, \"Dbghelp\")\n #endif\n#else\n #include \n #ifndef PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP\n // musl does not have that\n #define pthread_rwlockattr_setkind_np(a, b)\n #endif\n#endif\n\n// g_live_info is used by live.info()\nstatic void* g_live_info = NULL;\n\n#if defined(__MINGW32__) || defined(__MINGW64__) || (defined(_WIN32) && defined(__TINYC__))\n #undef PRId64\n #undef PRIi64\n #undef PRIo64\n #undef PRIu64\n #undef PRIx64\n #undef PRIX64\n #define PRId64 \"lld\"\n #define PRIi64 \"lli\"\n #define PRIo64 \"llo\"\n #define PRIu64 \"llu\"\n #define PRIx64 \"llx\"\n #define PRIX64 \"llX\"\n#endif\n\n#ifdef _VFREESTANDING\n#undef _VFREESTANDING\n#endif\n"); - _const_v__gen__c__c_bare_headers = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__)\n #define __V_amd64 1\n #undef __V_architecture\n #define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__)\n #define __V_arm64 1\n #undef __V_architecture\n #define __V_architecture 2\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n #define __V_GCC__\n#endif\n#ifdef __TINYC__\n #undef __V_GCC__\n#endif\n#ifdef __cplusplus\n #undef __V_GCC__\n#endif\n#ifdef __clang__\n #undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n #undef __V_GCC__\n #undef EMPTY_STRUCT_INITIALIZATION\n #define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n #define _Atomic volatile\n #undef EMPTY_STRUCT_DECLARATION\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #undef EMPTY_ARRAY_OF_ELEMS\n #define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n #undef __NOINLINE\n #undef __IRQHANDLER\n // tcc does not support inlining at all\n #define __NOINLINE\n #define __IRQHANDLER\n #undef TCCSKIP\n #define TCCSKIP(x)\n // #include \n #ifndef _WIN32\n #include \n int tcc_backtrace(const char *fmt, ...);\n #endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n #define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n// returns the number of CPU registers that TYPE takes up\n#define _REG_WIDTH(T) (((sizeof(T) + sizeof(void*) - 1) & ~(sizeof(void*) - 1)) / sizeof(void*))\n// parameters of size <= 2 registers are spilled across those two registers; larger types are passed as one pointer to some stack location\n#define _REG_WIDTH_BOUNDED(T) (_REG_WIDTH(T) <= 2 ? _REG_WIDTH(T) : 1)\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n #ifdef PRIx64\n #define V64_PRINTFORMAT \"0x%\"PRIx64\n #elif defined(__WIN32__)\n #define V64_PRINTFORMAT \"0x%I64x\"\n #elif defined(__linux__) && defined(__LP64__)\n #define V64_PRINTFORMAT \"0x%lx\"\n #else\n #define V64_PRINTFORMAT \"0x%llx\"\n #endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n #define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n #define VV_LOCAL_SYMBOL static\n#else\n // 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n // and does not support __has_attribute(visibility) ...\n #ifndef __has_attribute\n #define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n #endif\n #if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n #ifdef ARM\n #define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n #else\n #define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n #endif\n #if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n #define VV_LOCAL_SYMBOL static\n #else\n #define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n #endif\n #else\n #define VV_EXPORTED_SYMBOL extern\n #define VV_LOCAL_SYMBOL static\n #endif\n#endif\n\n#ifdef __cplusplus\n #include \n #define _MOV std::move\n#else\n #define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n #define VWEAK __attribute__((weak))\n #ifdef _MSC_VER\n #undef VWEAK\n #define VWEAK\n #endif\n#endif\n\n#if !defined(VNORETURN)\n #if defined(__TINYC__)\n #include \n #define VNORETURN noreturn\n #endif\n # if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n # define VNORETURN _Noreturn\n # elif defined(__GNUC__) && __GNUC__ >= 2\n # define VNORETURN __attribute__((noreturn))\n # endif\n #ifndef VNORETURN\n #define VNORETURN\n #endif\n#endif\n\n#if !defined(VUNREACHABLE)\n #if defined(__GNUC__) && !defined(__clang__)\n #define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n #if (V_GCC_VERSION >= 40500L)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #if defined(__clang__) && defined(__has_builtin)\n #if __has_builtin(__builtin_unreachable)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #ifndef VUNREACHABLE\n #define VUNREACHABLE() do { } while (0)\n #endif\n #if defined(__FreeBSD__) && defined(__TINYC__)\n #define VUNREACHABLE() do { } while (0)\n #endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n #define _likely_(x) __builtin_expect(x,1)\n #define _unlikely_(x) __builtin_expect(x,0)\n#else\n #define _likely_(x) (x)\n #define _unlikely_(x) (x)\n#endif\n\n\n#define _VFREESTANDING\n\ntypedef long unsigned int size_t;\n\n// Memory allocation related headers\nvoid *malloc(size_t size);\nvoid *calloc(size_t nitems, size_t size);\nvoid *realloc(void *ptr, size_t size);\nvoid *memcpy(void *dest, void *src, size_t n);\nvoid *memset(void *s, int c, size_t n);\nvoid *memmove(void *dest, void *src, size_t n);\n\n// varargs implementation, TODO: works on tcc and gcc, but is very unportable and hacky\ntypedef __builtin_va_list va_list;\n#define va_start(a, b) __builtin_va_start(a, b)\n#define va_end(a) __builtin_va_end(a)\n#define va_arg(a, b) __builtin_va_arg(a, b)\n#define va_copy(a, b) __builtin_va_copy(a, b)\n\n//================================== GLOBALS =================================*/\nint load_so(byteptr);\nvoid _vinit(int ___argc, voidptr ___argv);\nvoid _vcleanup();\n#define sigaction_size sizeof(sigaction);\n#define _ARR_LEN(a) ( (sizeof(a)) / (sizeof(a[0])) )\n\nvoid v_free(voidptr ptr);\nvoidptr memdup(voidptr src, int sz);\n\n"); + _const_v__gen__c__builtins = new_array_from_c_array(8, 8, sizeof(string), _MOV((string[8]){_SLIT("string"), _SLIT("array"), _SLIT("DenseArray"), _SLIT("map"), _SLIT("Error"), _SLIT("IError"), _SLIT("Option"), string_clone(_const_v__gen__c__result_name)})); + _const_v__gen__c__c_headers = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__) || defined(_M_AMD64)\n #define __V_amd64 1\n #undef __V_architecture\n #define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)\n #define __V_arm64 1\n #undef __V_architecture\n #define __V_architecture 2\n#endif\n\n#if defined(__arm__) || defined(_M_ARM)\n #define __V_arm32 1\n #undef __V_architecture\n #define __V_architecture 3\n#endif\n\n#if defined(__i386__) || defined(_M_IX86)\n #define __V_x86 1\n #undef __V_architecture\n #define __V_architecture 6\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n #define __V_GCC__\n#endif\n#ifdef __TINYC__\n #undef __V_GCC__\n#endif\n#ifdef __cplusplus\n #undef __V_GCC__\n#endif\n#ifdef __clang__\n #undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n #undef __V_GCC__\n #undef EMPTY_STRUCT_INITIALIZATION\n #define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n #define _Atomic volatile\n #undef EMPTY_STRUCT_DECLARATION\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #undef EMPTY_ARRAY_OF_ELEMS\n #define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n #undef __NOINLINE\n #undef __IRQHANDLER\n // tcc does not support inlining at all\n #define __NOINLINE\n #define __IRQHANDLER\n #undef TCCSKIP\n #define TCCSKIP(x)\n // #include \n #ifndef _WIN32\n #include \n int tcc_backtrace(const char *fmt, ...);\n #endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n #define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n #ifdef PRIx64\n #define V64_PRINTFORMAT \"0x%\"PRIx64\n #elif defined(__WIN32__)\n #define V64_PRINTFORMAT \"0x%I64x\"\n #elif defined(__linux__) && defined(__LP64__)\n #define V64_PRINTFORMAT \"0x%lx\"\n #else\n #define V64_PRINTFORMAT \"0x%llx\"\n #endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n #define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n #define VV_LOCAL_SYMBOL static\n#else\n // 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n // and does not support __has_attribute(visibility) ...\n #ifndef __has_attribute\n #define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n #endif\n #if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n #ifdef ARM\n #define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n #else\n #define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n #endif\n #if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n #define VV_LOCAL_SYMBOL static\n #else\n #define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n #endif\n #else\n #define VV_EXPORTED_SYMBOL extern\n #define VV_LOCAL_SYMBOL static\n #endif\n#endif\n\n#ifdef __cplusplus\n #include \n #define _MOV std::move\n#else\n #define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n #define VWEAK __attribute__((weak))\n #ifdef _MSC_VER\n #undef VWEAK\n #define VWEAK\n #endif\n#endif\n\n#if !defined(VNORETURN)\n #if defined(__TINYC__)\n #include \n #define VNORETURN noreturn\n #endif\n # if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n # define VNORETURN _Noreturn\n # elif defined(__GNUC__) && __GNUC__ >= 2\n # define VNORETURN __attribute__((noreturn))\n # endif\n #ifndef VNORETURN\n #define VNORETURN\n #endif\n#endif\n\n#if !defined(VUNREACHABLE)\n #if defined(__GNUC__) && !defined(__clang__)\n #define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n #if (V_GCC_VERSION >= 40500L)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #if defined(__clang__) && defined(__has_builtin)\n #if __has_builtin(__builtin_unreachable)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #ifndef VUNREACHABLE\n #define VUNREACHABLE() do { } while (0)\n #endif\n #if defined(__FreeBSD__) && defined(__TINYC__)\n #define VUNREACHABLE() do { } while (0)\n #endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n #define _likely_(x) __builtin_expect(x,1)\n #define _unlikely_(x) __builtin_expect(x,0)\n#else\n #define _likely_(x) (x)\n #define _unlikely_(x) (x)\n#endif\n\n\n// c_headers\ntypedef int (*qsort_callback_func)(const void*, const void*);\n#include // TODO remove all these includes, define all function signatures and types manually\n#include \n#include \n\n#ifndef _WIN32\n #if defined __has_include\n #if __has_include ()\n #include \n #else\n // Most probably musl OR __ANDROID__ ...\n int backtrace (void **__array, int __size) { return 0; }\n char **backtrace_symbols (void *const *__array, int __size){ return 0; }\n void backtrace_symbols_fd (void *const *__array, int __size, int __fd){}\n #endif\n #endif\n#endif\n\n#include // for va_list\n\n//================================== GLOBALS =================================*/\nint load_so(byteptr);\nvoid _vinit(int ___argc, voidptr ___argv);\nvoid _vcleanup(void);\n#define sigaction_size sizeof(sigaction);\n#define _ARR_LEN(a) ( (sizeof(a)) / (sizeof(a[0])) )\n\nvoid v_free(voidptr ptr);\nvoidptr memdup(voidptr src, int sz);\n\n#if INTPTR_MAX == INT32_MAX\n #define TARGET_IS_32BIT 1\n#elif INTPTR_MAX == INT64_MAX\n #define TARGET_IS_64BIT 1\n#else\n #error \"The environment is not 32 or 64-bit.\"\n#endif\n\n#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ || defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__)\n #define TARGET_ORDER_IS_BIG 1\n#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ || defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) || defined(_M_AMD64) || defined(_M_X64) || defined(_M_IX86)\n #define TARGET_ORDER_IS_LITTLE 1\n#else\n #error \"Unknown architecture endianness\"\n#endif\n\n#ifndef _WIN32\n #include \n #include // tolower\n #include \n #include // sleep\n extern char **environ;\n#endif\n\n#if defined(__CYGWIN__) && !defined(_WIN32)\n #error Cygwin is not supported, please use MinGW or Visual Studio.\n#endif\n\n#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__vinix__) || defined(__serenity__) || defined(__sun)\n #include \n #include // os__wait uses wait on nix\n#endif\n\n#ifdef __OpenBSD__\n #include \n #include \n #include // os__wait uses wait on nix\n#endif\n\n#ifdef __NetBSD__\n #include // os__wait uses wait on nix\n#endif\n\n#ifdef _WIN32\n #define WINVER 0x0600\n #ifdef _WIN32_WINNT\n #undef _WIN32_WINNT\n #endif\n #define _WIN32_WINNT 0x0600\n #ifndef WIN32_FULL\n #define WIN32_LEAN_AND_MEAN\n #endif\n #ifndef _UNICODE\n #define _UNICODE\n #endif\n #ifndef UNICODE\n #define UNICODE\n #endif\n #include \n\n #include // _waccess\n #include // _wgetcwd\n #include // signal and SIGSEGV for segmentation fault handler\n\n #ifdef _MSC_VER\n // On MSVC these are the same (as long as /volatile:ms is passed)\n #define _Atomic volatile\n\n // MSVC cannot parse some things properly\n #undef EMPTY_STRUCT_DECLARATION\n #undef OPTION_CAST\n\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #define OPTION_CAST(x)\n #undef __NOINLINE\n #undef __IRQHANDLER\n #define __NOINLINE __declspec(noinline)\n #define __IRQHANDLER __declspec(naked)\n\n #include \n #pragma comment(lib, \"Dbghelp\")\n #endif\n#else\n #include \n #ifndef PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP\n // musl does not have that\n #define pthread_rwlockattr_setkind_np(a, b)\n #endif\n#endif\n\n// g_live_info is used by live.info()\nstatic void* g_live_info = NULL;\n\n#if defined(__MINGW32__) || defined(__MINGW64__) || (defined(_WIN32) && defined(__TINYC__))\n #undef PRId64\n #undef PRIi64\n #undef PRIo64\n #undef PRIu64\n #undef PRIx64\n #undef PRIX64\n #define PRId64 \"lld\"\n #define PRIi64 \"lli\"\n #define PRIo64 \"llo\"\n #define PRIu64 \"llu\"\n #define PRIx64 \"llx\"\n #define PRIX64 \"llX\"\n#endif\n\n#ifdef _VFREESTANDING\n#undef _VFREESTANDING\n#endif\n"); + _const_v__gen__c__c_bare_headers = _SLIT("//============================== HELPER C MACROS =============================*/\n// _SLIT0 is used as NULL string for literal arguments\n// `\"\" s` is used to enforce a string literal argument\n#define _SLIT0 (string){.str=(byteptr)(\"\"), .len=0, .is_lit=1}\n#define _SLIT(s) ((string){.str=(byteptr)(\"\" s), .len=(sizeof(s)-1), .is_lit=1})\n#define _SLEN(s, n) ((string){.str=(byteptr)(\"\" s), .len=n, .is_lit=1})\n\n// take the address of an rvalue\n#define ADDR(type, expr) (&((type[]){expr}[0]))\n\n// copy something to the heap\n#define HEAP(type, expr) ((type*)memdup((void*)&((type[]){expr}[0]), sizeof(type)))\n#define HEAP_noscan(type, expr) ((type*)memdup_noscan((void*)&((type[]){expr}[0]), sizeof(type)))\n\n#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}\n#define _PUSH_MANY_noscan(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many_noscan(arr, tmp.data, tmp.len);}\n\n// unsigned/signed comparisons\nstatic inline bool _us32_gt(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a > b; }\nstatic inline bool _us32_ge(uint32_t a, int32_t b) { return a >= INT32_MAX || (int32_t)a >= b; }\nstatic inline bool _us32_eq(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a == b; }\nstatic inline bool _us32_ne(uint32_t a, int32_t b) { return a > INT32_MAX || (int32_t)a != b; }\nstatic inline bool _us32_le(uint32_t a, int32_t b) { return a <= INT32_MAX && (int32_t)a <= b; }\nstatic inline bool _us32_lt(uint32_t a, int32_t b) { return a < INT32_MAX && (int32_t)a < b; }\nstatic inline bool _us64_gt(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a > b; }\nstatic inline bool _us64_ge(uint64_t a, int64_t b) { return a >= INT64_MAX || (int64_t)a >= b; }\nstatic inline bool _us64_eq(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a == b; }\nstatic inline bool _us64_ne(uint64_t a, int64_t b) { return a > INT64_MAX || (int64_t)a != b; }\nstatic inline bool _us64_le(uint64_t a, int64_t b) { return a <= INT64_MAX && (int64_t)a <= b; }\nstatic inline bool _us64_lt(uint64_t a, int64_t b) { return a < INT64_MAX && (int64_t)a < b; }\n\n#define EMPTY_VARG_INITIALIZATION 0\n#define EMPTY_STRUCT_INITIALIZATION 0\n#define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n// Due to a tcc bug, the length of an array needs to be specified, but GCC crashes if it is...\n#define EMPTY_ARRAY_OF_ELEMS(x,n) (x[])\n#define TCCSKIP(x) x\n\n#define __NOINLINE __attribute__((noinline))\n#define __IRQHANDLER __attribute__((interrupt))\n\n#define __V_architecture 0\n#if defined(__x86_64__) || defined(_M_AMD64)\n #define __V_amd64 1\n #undef __V_architecture\n #define __V_architecture 1\n#endif\n\n#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)\n #define __V_arm64 1\n #undef __V_architecture\n #define __V_architecture 2\n#endif\n\n#if defined(__arm__) || defined(_M_ARM)\n #define __V_arm32 1\n #undef __V_architecture\n #define __V_architecture 3\n#endif\n\n#if defined(__i386__) || defined(_M_IX86)\n #define __V_x86 1\n #undef __V_architecture\n #define __V_architecture 6\n#endif\n\n// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:\n#ifdef __GNUC__\n #define __V_GCC__\n#endif\n#ifdef __TINYC__\n #undef __V_GCC__\n#endif\n#ifdef __cplusplus\n #undef __V_GCC__\n#endif\n#ifdef __clang__\n #undef __V_GCC__\n#endif\n#ifdef _MSC_VER\n #undef __V_GCC__\n #undef EMPTY_STRUCT_INITIALIZATION\n #define EMPTY_STRUCT_INITIALIZATION 0\n#endif\n\n#ifdef __TINYC__\n #define _Atomic volatile\n #undef EMPTY_STRUCT_DECLARATION\n #define EMPTY_STRUCT_DECLARATION voidptr _dummy_pad\n #undef EMPTY_ARRAY_OF_ELEMS\n #define EMPTY_ARRAY_OF_ELEMS(x,n) (x[n])\n #undef __NOINLINE\n #undef __IRQHANDLER\n // tcc does not support inlining at all\n #define __NOINLINE\n #define __IRQHANDLER\n #undef TCCSKIP\n #define TCCSKIP(x)\n // #include \n #ifndef _WIN32\n #include \n int tcc_backtrace(const char *fmt, ...);\n #endif\n#endif\n\n// Use __offsetof_ptr instead of __offset_of, when you *do* have a valid pointer, to avoid UB:\n#ifndef __offsetof_ptr\n #define __offsetof_ptr(ptr,PTYPE,FIELDNAME) ((size_t)((byte *)&((PTYPE *)ptr)->FIELDNAME - (byte *)ptr))\n#endif\n\n// for __offset_of\n#ifndef __offsetof\n #define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))\n#endif\n\n#define OPTION_CAST(x) (x)\n\n#ifndef V64_PRINTFORMAT\n #ifdef PRIx64\n #define V64_PRINTFORMAT \"0x%\"PRIx64\n #elif defined(__WIN32__)\n #define V64_PRINTFORMAT \"0x%I64x\"\n #elif defined(__linux__) && defined(__LP64__)\n #define V64_PRINTFORMAT \"0x%lx\"\n #else\n #define V64_PRINTFORMAT \"0x%llx\"\n #endif\n#endif\n\n#if defined(_WIN32) || defined(__CYGWIN__)\n #define VV_EXPORTED_SYMBOL extern __declspec(dllexport)\n #define VV_LOCAL_SYMBOL static\n#else\n // 4 < gcc < 5 is used by some older Ubuntu LTS and Centos versions,\n // and does not support __has_attribute(visibility) ...\n #ifndef __has_attribute\n #define __has_attribute(x) 0 // Compatibility with non-clang compilers.\n #endif\n #if (defined(__GNUC__) && (__GNUC__ >= 4)) || (defined(__clang__) && __has_attribute(visibility))\n #ifdef ARM\n #define VV_EXPORTED_SYMBOL extern __attribute__((externally_visible,visibility(\"default\")))\n #else\n #define VV_EXPORTED_SYMBOL extern __attribute__((visibility(\"default\")))\n #endif\n #if defined(__clang__) && (defined(_VUSECACHE) || defined(_VBUILDMODULE))\n #define VV_LOCAL_SYMBOL static\n #else\n #define VV_LOCAL_SYMBOL __attribute__ ((visibility (\"hidden\")))\n #endif\n #else\n #define VV_EXPORTED_SYMBOL extern\n #define VV_LOCAL_SYMBOL static\n #endif\n#endif\n\n#ifdef __cplusplus\n #include \n #define _MOV std::move\n#else\n #define _MOV\n#endif\n\n// tcc does not support has_include properly yet, turn it off completely\n#if defined(__TINYC__) && defined(__has_include)\n#undef __has_include\n#endif\n\n\n#if !defined(VWEAK)\n #define VWEAK __attribute__((weak))\n #ifdef _MSC_VER\n #undef VWEAK\n #define VWEAK\n #endif\n#endif\n\n#if !defined(VNORETURN)\n #if defined(__TINYC__)\n #include \n #define VNORETURN noreturn\n #endif\n # if !defined(__TINYC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L\n # define VNORETURN _Noreturn\n # elif defined(__GNUC__) && __GNUC__ >= 2\n # define VNORETURN __attribute__((noreturn))\n # endif\n #ifndef VNORETURN\n #define VNORETURN\n #endif\n#endif\n\n#if !defined(VUNREACHABLE)\n #if defined(__GNUC__) && !defined(__clang__)\n #define V_GCC_VERSION (__GNUC__ * 10000L + __GNUC_MINOR__ * 100L + __GNUC_PATCHLEVEL__)\n #if (V_GCC_VERSION >= 40500L)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #if defined(__clang__) && defined(__has_builtin)\n #if __has_builtin(__builtin_unreachable)\n #define VUNREACHABLE() do { __builtin_unreachable(); } while (0)\n #endif\n #endif\n #ifndef VUNREACHABLE\n #define VUNREACHABLE() do { } while (0)\n #endif\n #if defined(__FreeBSD__) && defined(__TINYC__)\n #define VUNREACHABLE() do { } while (0)\n #endif\n#endif\n\n//likely and unlikely macros\n#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)\n #define _likely_(x) __builtin_expect(x,1)\n #define _unlikely_(x) __builtin_expect(x,0)\n#else\n #define _likely_(x) (x)\n #define _unlikely_(x) (x)\n#endif\n\n\n#define _VFREESTANDING\n\ntypedef long unsigned int size_t;\n\n// Memory allocation related headers\nvoid *malloc(size_t size);\nvoid *calloc(size_t nitems, size_t size);\nvoid *realloc(void *ptr, size_t size);\nvoid *memcpy(void *dest, void *src, size_t n);\nvoid *memset(void *s, int c, size_t n);\nvoid *memmove(void *dest, void *src, size_t n);\n\n// varargs implementation, TODO: works on tcc and gcc, but is very unportable and hacky\ntypedef __builtin_va_list va_list;\n#define va_start(a, b) __builtin_va_start(a, b)\n#define va_end(a) __builtin_va_end(a)\n#define va_arg(a, b) __builtin_va_arg(a, b)\n#define va_copy(a, b) __builtin_va_copy(a, b)\n\n//================================== GLOBALS =================================*/\nint load_so(byteptr);\nvoid _vinit(int ___argc, voidptr ___argv);\nvoid _vcleanup();\n#define sigaction_size sizeof(sigaction);\n#define _ARR_LEN(a) ( (sizeof(a)) / (sizeof(a[0])) )\n\nvoid v_free(voidptr ptr);\nvoidptr memdup(voidptr src, int sz);\n\n"); _const_v__gen__c__skip_struct_init = new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("struct stat"), _SLIT("struct addrinfo")})); } { // Initializations for module v.scanner : @@ -96097,11 +96392,11 @@ void _vinit(int ___argc, voidptr ___argv) { { // Initializations for module v.builder.cbuilder : } { // Initializations for module main : - _const_main__external_tools = new_array_from_c_array(32, 32, sizeof(string), _MOV((string[32]){ + _const_main__external_tools = new_array_from_c_array(33, 33, sizeof(string), _MOV((string[33]){ _SLIT("ast"), _SLIT("bin2v"), _SLIT("bug"), _SLIT("build-examples"), _SLIT("build-tools"), _SLIT("build-vbinaries"), _SLIT("bump"), _SLIT("check-md"), _SLIT("complete"), - _SLIT("compress"), _SLIT("doc"), _SLIT("doctor"), _SLIT("fmt"), _SLIT("gret"), _SLIT("repl"), _SLIT("self"), _SLIT("setup-freetype"), - _SLIT("shader"), _SLIT("should-compile-all"), _SLIT("symlink"), _SLIT("scan"), _SLIT("test"), _SLIT("test-all"), _SLIT("test-cleancode"), _SLIT("test-fmt"), - _SLIT("test-parser"), _SLIT("test-self"), _SLIT("tracev"), _SLIT("up"), _SLIT("vet"), _SLIT("wipe-cache"), _SLIT("watch")})); + _SLIT("compress"), _SLIT("doc"), _SLIT("doctor"), _SLIT("fmt"), _SLIT("gret"), _SLIT("missdoc"), _SLIT("repl"), _SLIT("self"), + _SLIT("setup-freetype"), _SLIT("shader"), _SLIT("should-compile-all"), _SLIT("symlink"), _SLIT("scan"), _SLIT("test"), _SLIT("test-all"), _SLIT("test-cleancode"), + _SLIT("test-fmt"), _SLIT("test-parser"), _SLIT("test-self"), _SLIT("tracev"), _SLIT("up"), _SLIT("vet"), _SLIT("wipe-cache"), _SLIT("watch")})); _const_main__list_of_flags_that_allow_duplicates = new_array_from_c_array(5, 5, sizeof(string), _MOV((string[5]){_SLIT("cc"), _SLIT("d"), _SLIT("define"), _SLIT("cf"), _SLIT("cflags")})); } }