diff --git a/v.c b/v.c index 772cb98..2f91659 100644 --- a/v.c +++ b/v.c @@ -1,11 +1,11 @@ -#define V_COMMIT_HASH "3afb88c4e" +#define V_COMMIT_HASH "0bd8d872d" #ifndef V_COMMIT_HASH - #define V_COMMIT_HASH "c405c1916" + #define V_COMMIT_HASH "3afb88c4e" #endif #ifndef V_CURRENT_COMMIT_HASH - #define V_CURRENT_COMMIT_HASH "3afb88c" + #define V_CURRENT_COMMIT_HASH "0bd8d87" #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 _option _option; typedef struct _result _result; typedef struct VMemoryBlock VMemoryBlock; typedef struct SortedMap SortedMap; @@ -337,70 +338,70 @@ typedef struct v__builder__MsvcResult v__builder__MsvcResult; typedef struct v__builder__WindowsKit v__builder__WindowsKit; typedef struct v__builder__VsInstallation v__builder__VsInstallation; typedef struct v__builder__MsvcStringFlags v__builder__MsvcStringFlags; -typedef struct Option_int Option_int; -typedef struct Option_f64 Option_f64; -typedef struct Option_u64 Option_u64; -typedef struct Option_i64 Option_i64; -typedef struct Option_rune Option_rune; -typedef struct Option_string Option_string; -typedef struct Option_u8 Option_u8; -typedef struct Option_os__File Option_os__File; -typedef struct Option_FILE_ptr Option_FILE_ptr; -typedef struct Option_void Option_void; -typedef struct Option_Array_u8 Option_Array_u8; -typedef struct Option_Array_string Option_Array_string; -typedef struct Option_bool Option_bool; -typedef struct Option_os__SignalHandler Option_os__SignalHandler; -typedef struct Option_v__token__Kind Option_v__token__Kind; -typedef struct Option_flag__Flag Option_flag__Flag; -typedef struct Option_semver__Range Option_semver__Range; -typedef struct Option_semver__Version Option_semver__Version; -typedef struct Option_semver__ComparatorSet Option_semver__ComparatorSet; -typedef struct Option_semver__Comparator Option_semver__Comparator; -typedef struct Option_term__Coord Option_term__Coord; -typedef struct Option_v__vmod__Manifest Option_v__vmod__Manifest; -typedef struct Option_multi_return_Array_string_int Option_multi_return_Array_string_int; -typedef struct Option_v__pkgconfig__PkgConfig_ptr Option_v__pkgconfig__PkgConfig_ptr; -typedef struct Option_v__pkgconfig__Main_ptr Option_v__pkgconfig__Main_ptr; -typedef struct Option_time__Time Option_time__Time; -typedef struct Option_multi_return_int_int_int Option_multi_return_int_int_int; -typedef struct Option_multi_return_int_int_int_int_i64_bool Option_multi_return_int_int_int_int_i64_bool; -typedef struct Option_u32 Option_u32; -typedef struct Option_f32 Option_f32; -typedef struct Option_v__pref__OS Option_v__pref__OS; -typedef struct Option_v__pref__Arch Option_v__pref__Arch; -typedef struct Option_v__pref__Backend Option_v__pref__Backend; -typedef struct Option_time__StopWatch Option_time__StopWatch; -typedef struct Option_v__ast__Ident Option_v__ast__Ident; -typedef struct Option_i8 Option_i8; -typedef struct Option_i16 Option_i16; -typedef struct Option_u16 Option_u16; -typedef struct Option_v__ast__ComptTimeConstValue Option_v__ast__ComptTimeConstValue; -typedef struct Option_v__ast__ScopeObject Option_v__ast__ScopeObject; -typedef struct Option_v__ast__ScopeStructField Option_v__ast__ScopeStructField; -typedef struct Option_v__ast__Var_ptr Option_v__ast__Var_ptr; -typedef struct Option_v__ast__GlobalField_ptr Option_v__ast__GlobalField_ptr; -typedef struct Option_v__ast__ConstField_ptr Option_v__ast__ConstField_ptr; -typedef struct Option_v__ast__Fn Option_v__ast__Fn; -typedef struct Option_multi_return_v__ast__Fn_Array_v__ast__Type Option_multi_return_v__ast__Fn_Array_v__ast__Type; -typedef struct Option_v__ast__StructField Option_v__ast__StructField; -typedef struct Option_multi_return_v__ast__StructField_Array_v__ast__Type Option_multi_return_v__ast__StructField_Array_v__ast__Type; -typedef struct Option_v__ast__TypeSymbol_ptr Option_v__ast__TypeSymbol_ptr; -typedef struct Option_Array_Array_v__ast__Type Option_Array_Array_v__ast__Type; -typedef struct Option_v__ast__Type Option_v__ast__Type; -typedef struct Option_v__ast__InterfaceDecl Option_v__ast__InterfaceDecl; -typedef struct Option_v__ast__EnumDecl Option_v__ast__EnumDecl; -typedef struct Option_v__ast__Expr Option_v__ast__Expr; -typedef struct Option_v__ast__Param Option_v__ast__Param; -typedef struct Option_Array_v__ast__Type Option_Array_v__ast__Type; -typedef struct Option_v__ast__ConstField Option_v__ast__ConstField; -typedef struct Option_v__ast__GlobalField Option_v__ast__GlobalField; -typedef struct Option_v__ast__FnDecl Option_v__ast__FnDecl; -typedef struct Option_v__ast__Stmt_ptr Option_v__ast__Stmt_ptr; -typedef struct Option_v__scanner__Scanner_ptr Option_v__scanner__Scanner_ptr; -typedef struct Option_v__builder__MsvcResult Option_v__builder__MsvcResult; -typedef struct Option_v__builder__WindowsKit Option_v__builder__WindowsKit; -typedef struct Option_v__builder__VsInstallation Option_v__builder__VsInstallation; +typedef struct _option_int _option_int; +typedef struct _option_f64 _option_f64; +typedef struct _option_u64 _option_u64; +typedef struct _option_i64 _option_i64; +typedef struct _option_rune _option_rune; +typedef struct _option_string _option_string; +typedef struct _option_u8 _option_u8; +typedef struct _option_os__File _option_os__File; +typedef struct _option_FILE_ptr _option_FILE_ptr; +typedef struct _option_void _option_void; +typedef struct _option_Array_u8 _option_Array_u8; +typedef struct _option_Array_string _option_Array_string; +typedef struct _option_bool _option_bool; +typedef struct _option_os__SignalHandler _option_os__SignalHandler; +typedef struct _option_v__token__Kind _option_v__token__Kind; +typedef struct _option_flag__Flag _option_flag__Flag; +typedef struct _option_semver__Range _option_semver__Range; +typedef struct _option_semver__Version _option_semver__Version; +typedef struct _option_semver__ComparatorSet _option_semver__ComparatorSet; +typedef struct _option_semver__Comparator _option_semver__Comparator; +typedef struct _option_term__Coord _option_term__Coord; +typedef struct _option_v__vmod__Manifest _option_v__vmod__Manifest; +typedef struct _option_multi_return_Array_string_int _option_multi_return_Array_string_int; +typedef struct _option_v__pkgconfig__PkgConfig_ptr _option_v__pkgconfig__PkgConfig_ptr; +typedef struct _option_v__pkgconfig__Main_ptr _option_v__pkgconfig__Main_ptr; +typedef struct _option_time__Time _option_time__Time; +typedef struct _option_multi_return_int_int_int _option_multi_return_int_int_int; +typedef struct _option_multi_return_int_int_int_int_i64_bool _option_multi_return_int_int_int_int_i64_bool; +typedef struct _option_u32 _option_u32; +typedef struct _option_f32 _option_f32; +typedef struct _option_v__pref__OS _option_v__pref__OS; +typedef struct _option_v__pref__Arch _option_v__pref__Arch; +typedef struct _option_v__pref__Backend _option_v__pref__Backend; +typedef struct _option_time__StopWatch _option_time__StopWatch; +typedef struct _option_v__ast__Ident _option_v__ast__Ident; +typedef struct _option_i8 _option_i8; +typedef struct _option_i16 _option_i16; +typedef struct _option_u16 _option_u16; +typedef struct _option_v__ast__ComptTimeConstValue _option_v__ast__ComptTimeConstValue; +typedef struct _option_v__ast__ScopeObject _option_v__ast__ScopeObject; +typedef struct _option_v__ast__ScopeStructField _option_v__ast__ScopeStructField; +typedef struct _option_v__ast__Var_ptr _option_v__ast__Var_ptr; +typedef struct _option_v__ast__GlobalField_ptr _option_v__ast__GlobalField_ptr; +typedef struct _option_v__ast__ConstField_ptr _option_v__ast__ConstField_ptr; +typedef struct _option_v__ast__Fn _option_v__ast__Fn; +typedef struct _option_multi_return_v__ast__Fn_Array_v__ast__Type _option_multi_return_v__ast__Fn_Array_v__ast__Type; +typedef struct _option_v__ast__StructField _option_v__ast__StructField; +typedef struct _option_multi_return_v__ast__StructField_Array_v__ast__Type _option_multi_return_v__ast__StructField_Array_v__ast__Type; +typedef struct _option_v__ast__TypeSymbol_ptr _option_v__ast__TypeSymbol_ptr; +typedef struct _option_Array_Array_v__ast__Type _option_Array_Array_v__ast__Type; +typedef struct _option_v__ast__Type _option_v__ast__Type; +typedef struct _option_v__ast__InterfaceDecl _option_v__ast__InterfaceDecl; +typedef struct _option_v__ast__EnumDecl _option_v__ast__EnumDecl; +typedef struct _option_v__ast__Expr _option_v__ast__Expr; +typedef struct _option_v__ast__Param _option_v__ast__Param; +typedef struct _option_Array_v__ast__Type _option_Array_v__ast__Type; +typedef struct _option_v__ast__ConstField _option_v__ast__ConstField; +typedef struct _option_v__ast__GlobalField _option_v__ast__GlobalField; +typedef struct _option_v__ast__FnDecl _option_v__ast__FnDecl; +typedef struct _option_v__ast__Stmt_ptr _option_v__ast__Stmt_ptr; +typedef struct _option_v__scanner__Scanner_ptr _option_v__scanner__Scanner_ptr; +typedef struct _option_v__builder__MsvcResult _option_v__builder__MsvcResult; +typedef struct _option_v__builder__WindowsKit _option_v__builder__WindowsKit; +typedef struct _option_v__builder__VsInstallation _option_v__builder__VsInstallation; typedef struct __shared__Array_string __shared__Array_string; typedef struct __shared__Map_string_bool __shared__Map_string_bool; @@ -2825,8 +2826,8 @@ struct DenseArray { int len; u32 deletes; u8* all_deleted; - u8* values; u8* keys; + u8* values; }; @@ -2856,7 +2857,7 @@ struct Error { -struct Option { +struct _option { u8 state; IError err; }; @@ -3154,9 +3155,9 @@ struct v__vmod__ModFileAndFolder { // Union sum type v__ast__TypeDecl = -// | 241 = v__ast__AliasTypeDecl -// | 242 = v__ast__FnTypeDecl -// | 243 = v__ast__SumTypeDecl +// | 242 = v__ast__AliasTypeDecl +// | 243 = v__ast__FnTypeDecl +// | 244 = v__ast__SumTypeDecl struct v__ast__TypeDecl { union { v__ast__AliasTypeDecl* _v__ast__AliasTypeDecl; @@ -3172,57 +3173,57 @@ struct v__ast__TypeDecl { // Union sum type v__ast__Expr = -// | 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 +// | 246 = v__ast__AnonFn +// | 247 = v__ast__ArrayDecompose +// | 248 = v__ast__ArrayInit +// | 249 = v__ast__AsCast +// | 250 = v__ast__Assoc +// | 251 = v__ast__AtExpr +// | 252 = v__ast__BoolLiteral +// | 253 = v__ast__CTempVar +// | 254 = v__ast__CallExpr +// | 255 = v__ast__CastExpr +// | 256 = v__ast__ChanInit +// | 257 = v__ast__CharLiteral +// | 258 = v__ast__Comment +// | 259 = v__ast__ComptimeCall +// | 260 = v__ast__ComptimeSelector +// | 261 = v__ast__ComptimeType +// | 262 = v__ast__ConcatExpr +// | 263 = v__ast__DumpExpr +// | 264 = v__ast__EmptyExpr +// | 265 = v__ast__EnumVal +// | 266 = v__ast__FloatLiteral +// | 267 = v__ast__GoExpr +// | 268 = v__ast__Ident +// | 269 = v__ast__IfExpr +// | 270 = v__ast__IfGuardExpr +// | 271 = v__ast__IndexExpr +// | 272 = v__ast__InfixExpr +// | 273 = v__ast__IntegerLiteral +// | 274 = v__ast__IsRefType +// | 275 = v__ast__Likely +// | 276 = v__ast__LockExpr +// | 277 = v__ast__MapInit +// | 278 = v__ast__MatchExpr +// | 279 = v__ast__NodeError +// | 280 = v__ast__None +// | 281 = v__ast__OffsetOf +// | 282 = v__ast__OrExpr +// | 283 = v__ast__ParExpr +// | 284 = v__ast__PostfixExpr +// | 285 = v__ast__PrefixExpr +// | 286 = v__ast__RangeExpr +// | 287 = v__ast__SelectExpr +// | 288 = v__ast__SelectorExpr +// | 289 = v__ast__SizeOf +// | 290 = v__ast__SqlExpr +// | 291 = v__ast__StringInterLiteral +// | 292 = v__ast__StringLiteral +// | 293 = v__ast__StructInit +// | 294 = v__ast__TypeNode +// | 295 = v__ast__TypeOf +// | 296 = v__ast__UnsafeExpr struct v__ast__Expr { union { v__ast__AnonFn* _v__ast__AnonFn; @@ -3282,33 +3283,33 @@ struct v__ast__Expr { // Union sum type v__ast__Stmt = -// | 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 +// | 298 = v__ast__AsmStmt +// | 299 = v__ast__AssertStmt +// | 300 = v__ast__AssignStmt +// | 301 = v__ast__Block +// | 302 = v__ast__BranchStmt +// | 303 = v__ast__ComptimeFor +// | 304 = v__ast__ConstDecl +// | 305 = v__ast__DeferStmt +// | 306 = v__ast__EmptyStmt +// | 307 = v__ast__EnumDecl +// | 308 = v__ast__ExprStmt +// | 185 = v__ast__FnDecl +// | 309 = v__ast__ForCStmt +// | 310 = v__ast__ForInStmt +// | 311 = v__ast__ForStmt +// | 312 = v__ast__GlobalDecl +// | 313 = v__ast__GotoLabel +// | 314 = v__ast__GotoStmt +// | 315 = v__ast__HashStmt +// | 316 = v__ast__Import +// | 317 = v__ast__InterfaceDecl +// | 318 = v__ast__Module +// | 279 = v__ast__NodeError +// | 319 = v__ast__Return +// | 320 = v__ast__SqlStmt +// | 321 = v__ast__StructDecl +// | 245 = v__ast__TypeDecl struct v__ast__Stmt { union { v__ast__AsmStmt* _v__ast__AsmStmt; @@ -3345,10 +3346,10 @@ struct v__ast__Stmt { // Union sum type v__ast__ScopeObject = -// | 322 = v__ast__AsmRegister -// | 323 = v__ast__ConstField -// | 324 = v__ast__GlobalField -// | 325 = v__ast__Var +// | 323 = v__ast__AsmRegister +// | 324 = v__ast__ConstField +// | 325 = v__ast__GlobalField +// | 326 = v__ast__Var struct v__ast__ScopeObject { union { v__ast__AsmRegister* _v__ast__AsmRegister; @@ -3363,22 +3364,22 @@ struct v__ast__ScopeObject { // Union sum type v__ast__Node = -// | 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 +// | 328 = v__ast__CallArg +// | 324 = v__ast__ConstField +// | 329 = v__ast__EmptyNode +// | 330 = v__ast__EnumField +// | 297 = v__ast__Expr +// | 176 = v__ast__File +// | 325 = v__ast__GlobalField +// | 331 = v__ast__IfBranch +// | 332 = v__ast__MatchBranch +// | 279 = v__ast__NodeError +// | 333 = v__ast__Param +// | 327 = v__ast__ScopeObject +// | 334 = v__ast__SelectBranch +// | 322 = v__ast__Stmt +// | 335 = v__ast__StructField +// | 336 = v__ast__StructInitField struct v__ast__Node { union { v__ast__CallArg* _v__ast__CallArg; @@ -3403,7 +3404,7 @@ struct v__ast__Node { // Union sum type v__ast__ComptTimeConstValue = -// | 263 = v__ast__EmptyExpr +// | 264 = v__ast__EmptyExpr // | 15 = f32 // | 16 = f64 // | 6 = i16 @@ -3437,8 +3438,8 @@ struct v__ast__ComptTimeConstValue { // Union sum type v__ast__IdentInfo = -// | 376 = v__ast__IdentFn -// | 377 = v__ast__IdentVar +// | 377 = v__ast__IdentFn +// | 378 = v__ast__IdentVar struct v__ast__IdentInfo { union { v__ast__IdentFn* _v__ast__IdentFn; @@ -3449,14 +3450,14 @@ struct v__ast__IdentInfo { // Union sum type v__ast__AsmArg = -// | 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 +// | 398 = v__ast__AsmAddressing +// | 399 = v__ast__AsmAlias +// | 400 = v__ast__AsmDisp +// | 323 = v__ast__AsmRegister +// | 252 = v__ast__BoolLiteral +// | 257 = v__ast__CharLiteral +// | 266 = v__ast__FloatLiteral +// | 273 = v__ast__IntegerLiteral // | 20 = string struct v__ast__AsmArg { union { @@ -3475,20 +3476,20 @@ struct v__ast__AsmArg { // Union sum type v__ast__TypeInfo = -// | 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 +// | 431 = v__ast__Aggregate +// | 433 = v__ast__Alias +// | 413 = v__ast__Array +// | 441 = v__ast__ArrayFixed +// | 442 = v__ast__Chan +// | 447 = v__ast__Enum +// | 445 = v__ast__FnType +// | 446 = v__ast__GenericInst +// | 436 = v__ast__Interface +// | 414 = v__ast__Map +// | 444 = v__ast__MultiReturn +// | 418 = v__ast__Struct +// | 437 = v__ast__SumType +// | 443 = v__ast__Thread struct v__ast__TypeInfo { union { v__ast__Aggregate* _v__ast__Aggregate; @@ -3631,6 +3632,13 @@ struct MessageError { +struct Option { + u8 state; + IError err; +}; + + + struct VMemoryBlock { int id; isize cap; @@ -6823,385 +6831,385 @@ struct __shared__Map_string_bool { }; // V Option_xxx definitions: -struct Option_int { +struct _option_int { byte state; IError err; byte data[sizeof(int) > 0 ? sizeof(int) : 1]; }; -struct Option_f64 { +struct _option_f64 { byte state; IError err; byte data[sizeof(f64) > 0 ? sizeof(f64) : 1]; }; -struct Option_u64 { +struct _option_u64 { byte state; IError err; byte data[sizeof(u64) > 0 ? sizeof(u64) : 1]; }; -struct Option_i64 { +struct _option_i64 { byte state; IError err; byte data[sizeof(i64) > 0 ? sizeof(i64) : 1]; }; -struct Option_rune { +struct _option_rune { byte state; IError err; byte data[sizeof(rune) > 0 ? sizeof(rune) : 1]; }; -struct Option_string { +struct _option_string { byte state; IError err; byte data[sizeof(string) > 0 ? sizeof(string) : 1]; }; -struct Option_u8 { +struct _option_u8 { byte state; IError err; byte data[sizeof(u8) > 0 ? sizeof(u8) : 1]; }; -struct Option_os__File { +struct _option_os__File { byte state; IError err; byte data[sizeof(os__File) > 0 ? sizeof(os__File) : 1]; }; -struct Option_FILE_ptr { +struct _option_FILE_ptr { byte state; IError err; byte data[sizeof(FILE*) > 0 ? sizeof(FILE*) : 1]; }; -struct Option_void { +struct _option_void { byte state; IError err; byte data[sizeof(u8) > 0 ? sizeof(u8) : 1]; }; -struct Option_Array_u8 { +struct _option_Array_u8 { byte state; IError err; byte data[sizeof(Array_u8) > 0 ? sizeof(Array_u8) : 1]; }; -struct Option_Array_string { +struct _option_Array_string { byte state; IError err; byte data[sizeof(Array_string) > 0 ? sizeof(Array_string) : 1]; }; -struct Option_bool { +struct _option_bool { byte state; IError err; byte data[sizeof(bool) > 0 ? sizeof(bool) : 1]; }; -struct Option_os__SignalHandler { +struct _option_os__SignalHandler { byte state; IError err; byte data[sizeof(os__SignalHandler) > 0 ? sizeof(os__SignalHandler) : 1]; }; -struct Option_v__token__Kind { +struct _option_v__token__Kind { byte state; IError err; byte data[sizeof(v__token__Kind) > 0 ? sizeof(v__token__Kind) : 1]; }; -struct Option_flag__Flag { +struct _option_flag__Flag { byte state; IError err; byte data[sizeof(flag__Flag) > 0 ? sizeof(flag__Flag) : 1]; }; -struct Option_semver__Range { +struct _option_semver__Range { byte state; IError err; byte data[sizeof(semver__Range) > 0 ? sizeof(semver__Range) : 1]; }; -struct Option_semver__Version { +struct _option_semver__Version { byte state; IError err; byte data[sizeof(semver__Version) > 0 ? sizeof(semver__Version) : 1]; }; -struct Option_semver__ComparatorSet { +struct _option_semver__ComparatorSet { byte state; IError err; byte data[sizeof(semver__ComparatorSet) > 0 ? sizeof(semver__ComparatorSet) : 1]; }; -struct Option_semver__Comparator { +struct _option_semver__Comparator { byte state; IError err; byte data[sizeof(semver__Comparator) > 0 ? sizeof(semver__Comparator) : 1]; }; -struct Option_term__Coord { +struct _option_term__Coord { byte state; IError err; byte data[sizeof(term__Coord) > 0 ? sizeof(term__Coord) : 1]; }; -struct Option_v__vmod__Manifest { +struct _option_v__vmod__Manifest { byte state; IError err; byte data[sizeof(v__vmod__Manifest) > 0 ? sizeof(v__vmod__Manifest) : 1]; }; -struct Option_multi_return_Array_string_int { +struct _option_multi_return_Array_string_int { byte state; IError err; byte data[sizeof(multi_return_Array_string_int) > 0 ? sizeof(multi_return_Array_string_int) : 1]; }; -struct Option_v__pkgconfig__PkgConfig_ptr { +struct _option_v__pkgconfig__PkgConfig_ptr { byte state; IError err; byte data[sizeof(v__pkgconfig__PkgConfig*) > 0 ? sizeof(v__pkgconfig__PkgConfig*) : 1]; }; -struct Option_v__pkgconfig__Main_ptr { +struct _option_v__pkgconfig__Main_ptr { byte state; IError err; byte data[sizeof(v__pkgconfig__Main*) > 0 ? sizeof(v__pkgconfig__Main*) : 1]; }; -struct Option_time__Time { +struct _option_time__Time { byte state; IError err; byte data[sizeof(time__Time) > 0 ? sizeof(time__Time) : 1]; }; -struct Option_multi_return_int_int_int { +struct _option_multi_return_int_int_int { byte state; IError err; byte data[sizeof(multi_return_int_int_int) > 0 ? sizeof(multi_return_int_int_int) : 1]; }; -struct Option_multi_return_int_int_int_int_i64_bool { +struct _option_multi_return_int_int_int_int_i64_bool { byte state; IError err; byte data[sizeof(multi_return_int_int_int_int_i64_bool) > 0 ? sizeof(multi_return_int_int_int_int_i64_bool) : 1]; }; -struct Option_u32 { +struct _option_u32 { byte state; IError err; byte data[sizeof(u32) > 0 ? sizeof(u32) : 1]; }; -struct Option_f32 { +struct _option_f32 { byte state; IError err; byte data[sizeof(f32) > 0 ? sizeof(f32) : 1]; }; -struct Option_v__pref__OS { +struct _option_v__pref__OS { byte state; IError err; byte data[sizeof(v__pref__OS) > 0 ? sizeof(v__pref__OS) : 1]; }; -struct Option_v__pref__Arch { +struct _option_v__pref__Arch { byte state; IError err; byte data[sizeof(v__pref__Arch) > 0 ? sizeof(v__pref__Arch) : 1]; }; -struct Option_v__pref__Backend { +struct _option_v__pref__Backend { byte state; IError err; byte data[sizeof(v__pref__Backend) > 0 ? sizeof(v__pref__Backend) : 1]; }; -struct Option_time__StopWatch { +struct _option_time__StopWatch { byte state; IError err; byte data[sizeof(time__StopWatch) > 0 ? sizeof(time__StopWatch) : 1]; }; -struct Option_v__ast__Ident { +struct _option_v__ast__Ident { byte state; IError err; byte data[sizeof(v__ast__Ident) > 0 ? sizeof(v__ast__Ident) : 1]; }; -struct Option_i8 { +struct _option_i8 { byte state; IError err; byte data[sizeof(i8) > 0 ? sizeof(i8) : 1]; }; -struct Option_i16 { +struct _option_i16 { byte state; IError err; byte data[sizeof(i16) > 0 ? sizeof(i16) : 1]; }; -struct Option_u16 { +struct _option_u16 { byte state; IError err; byte data[sizeof(u16) > 0 ? sizeof(u16) : 1]; }; -struct Option_v__ast__ComptTimeConstValue { +struct _option_v__ast__ComptTimeConstValue { byte state; IError err; byte data[sizeof(v__ast__ComptTimeConstValue) > 0 ? sizeof(v__ast__ComptTimeConstValue) : 1]; }; -struct Option_v__ast__ScopeObject { +struct _option_v__ast__ScopeObject { byte state; IError err; byte data[sizeof(v__ast__ScopeObject) > 0 ? sizeof(v__ast__ScopeObject) : 1]; }; -struct Option_v__ast__ScopeStructField { +struct _option_v__ast__ScopeStructField { byte state; IError err; byte data[sizeof(v__ast__ScopeStructField) > 0 ? sizeof(v__ast__ScopeStructField) : 1]; }; -struct Option_v__ast__Var_ptr { +struct _option_v__ast__Var_ptr { byte state; IError err; byte data[sizeof(v__ast__Var*) > 0 ? sizeof(v__ast__Var*) : 1]; }; -struct Option_v__ast__GlobalField_ptr { +struct _option_v__ast__GlobalField_ptr { byte state; IError err; byte data[sizeof(v__ast__GlobalField*) > 0 ? sizeof(v__ast__GlobalField*) : 1]; }; -struct Option_v__ast__ConstField_ptr { +struct _option_v__ast__ConstField_ptr { byte state; IError err; byte data[sizeof(v__ast__ConstField*) > 0 ? sizeof(v__ast__ConstField*) : 1]; }; -struct Option_v__ast__Fn { +struct _option_v__ast__Fn { byte state; IError err; byte data[sizeof(v__ast__Fn) > 0 ? sizeof(v__ast__Fn) : 1]; }; -struct Option_multi_return_v__ast__Fn_Array_v__ast__Type { +struct _option_multi_return_v__ast__Fn_Array_v__ast__Type { byte state; IError err; byte data[sizeof(multi_return_v__ast__Fn_Array_v__ast__Type) > 0 ? sizeof(multi_return_v__ast__Fn_Array_v__ast__Type) : 1]; }; -struct Option_v__ast__StructField { +struct _option_v__ast__StructField { byte state; IError err; byte data[sizeof(v__ast__StructField) > 0 ? sizeof(v__ast__StructField) : 1]; }; -struct Option_multi_return_v__ast__StructField_Array_v__ast__Type { +struct _option_multi_return_v__ast__StructField_Array_v__ast__Type { byte state; IError err; byte data[sizeof(multi_return_v__ast__StructField_Array_v__ast__Type) > 0 ? sizeof(multi_return_v__ast__StructField_Array_v__ast__Type) : 1]; }; -struct Option_v__ast__TypeSymbol_ptr { +struct _option_v__ast__TypeSymbol_ptr { byte state; IError err; byte data[sizeof(v__ast__TypeSymbol*) > 0 ? sizeof(v__ast__TypeSymbol*) : 1]; }; -struct Option_Array_Array_v__ast__Type { +struct _option_Array_Array_v__ast__Type { byte state; IError err; byte data[sizeof(Array_Array_v__ast__Type) > 0 ? sizeof(Array_Array_v__ast__Type) : 1]; }; -struct Option_v__ast__Type { +struct _option_v__ast__Type { byte state; IError err; byte data[sizeof(v__ast__Type) > 0 ? sizeof(v__ast__Type) : 1]; }; -struct Option_v__ast__InterfaceDecl { +struct _option_v__ast__InterfaceDecl { byte state; IError err; byte data[sizeof(v__ast__InterfaceDecl) > 0 ? sizeof(v__ast__InterfaceDecl) : 1]; }; -struct Option_v__ast__EnumDecl { +struct _option_v__ast__EnumDecl { byte state; IError err; byte data[sizeof(v__ast__EnumDecl) > 0 ? sizeof(v__ast__EnumDecl) : 1]; }; -struct Option_v__ast__Expr { +struct _option_v__ast__Expr { byte state; IError err; byte data[sizeof(v__ast__Expr) > 0 ? sizeof(v__ast__Expr) : 1]; }; -struct Option_v__ast__Param { +struct _option_v__ast__Param { byte state; IError err; byte data[sizeof(v__ast__Param) > 0 ? sizeof(v__ast__Param) : 1]; }; -struct Option_Array_v__ast__Type { +struct _option_Array_v__ast__Type { byte state; IError err; byte data[sizeof(Array_v__ast__Type) > 0 ? sizeof(Array_v__ast__Type) : 1]; }; -struct Option_v__ast__ConstField { +struct _option_v__ast__ConstField { byte state; IError err; byte data[sizeof(v__ast__ConstField) > 0 ? sizeof(v__ast__ConstField) : 1]; }; -struct Option_v__ast__GlobalField { +struct _option_v__ast__GlobalField { byte state; IError err; byte data[sizeof(v__ast__GlobalField) > 0 ? sizeof(v__ast__GlobalField) : 1]; }; -struct Option_v__ast__FnDecl { +struct _option_v__ast__FnDecl { byte state; IError err; byte data[sizeof(v__ast__FnDecl) > 0 ? sizeof(v__ast__FnDecl) : 1]; }; -struct Option_v__ast__Stmt_ptr { +struct _option_v__ast__Stmt_ptr { byte state; IError err; byte data[sizeof(v__ast__Stmt*) > 0 ? sizeof(v__ast__Stmt*) : 1]; }; -struct Option_v__scanner__Scanner_ptr { +struct _option_v__scanner__Scanner_ptr { byte state; IError err; byte data[sizeof(v__scanner__Scanner*) > 0 ? sizeof(v__scanner__Scanner*) : 1]; }; -struct Option_v__builder__MsvcResult { +struct _option_v__builder__MsvcResult { byte state; IError err; byte data[sizeof(v__builder__MsvcResult) > 0 ? sizeof(v__builder__MsvcResult) : 1]; }; -struct Option_v__builder__WindowsKit { +struct _option_v__builder__WindowsKit { byte state; IError err; byte data[sizeof(v__builder__WindowsKit) > 0 ? sizeof(v__builder__WindowsKit) : 1]; }; -struct Option_v__builder__VsInstallation { +struct _option_v__builder__VsInstallation { byte state; IError err; byte data[sizeof(v__builder__VsInstallation) > 0 ? sizeof(v__builder__VsInstallation) : 1]; @@ -7224,10 +7232,10 @@ strings__Builder strings__new_builder(int initial_size); void strings__Builder_write_ptr(strings__Builder* b, u8* ptr, int len); void strings__Builder_write_rune(strings__Builder* b, rune r); void strings__Builder_write_runes(strings__Builder* b, Array_rune runes); -void strings__Builder_write_b(strings__Builder* b, u8 data); +void strings__Builder_clear(strings__Builder* b); void strings__Builder_write_u8(strings__Builder* b, u8 data); void strings__Builder_write_byte(strings__Builder* b, byte data); -Option_int strings__Builder_write(strings__Builder* b, Array_u8 data); +_option_int strings__Builder_write(strings__Builder* b, Array_u8 data); void strings__Builder_drain_builder(strings__Builder* b, strings__Builder* other, int other_new_cap); u8 strings__Builder_byte_at(strings__Builder* b, int n); void strings__Builder_write_string(strings__Builder* b, string s); @@ -7331,19 +7339,19 @@ VV_LOCAL_SYMBOL bool strconv__is_space(u8 x); VV_LOCAL_SYMBOL bool strconv__is_exp(u8 x); VV_LOCAL_SYMBOL multi_return_strconv__ParserState_strconv__PrepNumber strconv__parser(string s); VV_LOCAL_SYMBOL u64 strconv__converter(strconv__PrepNumber* pn); -Option_f64 strconv__atof64(string s); +_option_f64 strconv__atof64(string s); f64 strconv__atof_quick(string s); Array_u64 _const_strconv__pos_exp; // inited later Array_u64 _const_strconv__neg_exp; // inited later #define _const_strconv__int_size 32 u64 _const_strconv__max_u64 = 18446744073709551615U; // precomputed u8 strconv__byte_to_lower(u8 c); -Option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit); +_option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit); multi_return_u64_int strconv__common_parse_uint2(string s, int _base, int _bit_size); -Option_u64 strconv__parse_uint(string s, int _base, int _bit_size); -Option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit); -Option_i64 strconv__parse_int(string _s, int base, int _bit_size); -Option_int strconv__atoi(string s); +_option_u64 strconv__parse_uint(string s, int _base, int _bit_size); +_option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit); +_option_i64 strconv__parse_int(string _s, int base, int _bit_size); +_option_int strconv__atoi(string s); VV_LOCAL_SYMBOL bool strconv__underscore_ok(string s); Array_u32 _const_strconv__ten_pow_table_32; // inited later u32 _const_strconv__mantbits32 = 23; // precomputed @@ -7602,7 +7610,7 @@ string u8_str_escaped(u8 b); bool u8_is_capital(u8 c); Array_u8 Array_u8_clone(Array_u8 b); string Array_u8_bytestr(Array_u8 b); -Option_rune Array_u8_byterune(Array_u8 b); +_option_rune Array_u8_byterune(Array_u8 b); string u8_repeat(u8 b, int count); VV_LOCAL_SYMBOL string _Atomic__int_str(int x); VV_LOCAL_SYMBOL bool fast_string_eq(string a, string b); @@ -7656,6 +7664,7 @@ VV_LOCAL_SYMBOL bool map_exists(map* m, voidptr key); VV_LOCAL_SYMBOL void DenseArray_delete(DenseArray* d, int i); void map_delete(map* m, voidptr key); array map_keys(map* m); +array map_values(map* m); VV_LOCAL_SYMBOL DenseArray DenseArray_clone(DenseArray* d); map map_clone(map* m); void map_free(map* m); @@ -7671,6 +7680,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 opt_ok2(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 @@ -7750,8 +7760,8 @@ u8 string_u8(string s); u16 string_u16(string s); u32 string_u32(string s); u64 string_u64(string s); -Option_u64 string_parse_uint(string s, int _base, int _bit_size); -Option_i64 string_parse_int(string s, int _base, int _bit_size); +_option_u64 string_parse_uint(string s, int _base, int _bit_size); +_option_i64 string_parse_int(string s, int _base, int _bit_size); VV_LOCAL_SYMBOL bool string__eq(string s, string a); int string_compare(string s, string a); VV_LOCAL_SYMBOL bool string__lt(string s, string a); @@ -7762,14 +7772,14 @@ Array_string string_split_nth(string s, string delim, int nth); Array_string string_split_into_lines(string s); VV_LOCAL_SYMBOL string string_substr2(string s, int start, int _end, bool end_max); string string_substr(string s, int start, int end); -Option_string string_substr_with_check(string s, int start, int end); +_option_string string_substr_with_check(string s, int start, int end); string string_substr_ni(string s, int _start, int _end); VV_LOCAL_SYMBOL int string_index_(string s, string p); -Option_int string_index(string s, string p); +_option_int string_index(string s, string p); VV_LOCAL_SYMBOL int string_index_kmp(string s, string p); int string_index_any(string s, string chars); VV_LOCAL_SYMBOL int string_last_index_(string s, string p); -Option_int string_last_index(string s, string p); +_option_int string_last_index(string s, string p); int string_index_after(string s, string p, int start); int string_index_u8(string s, u8 c); int string_last_index_u8(string s, u8 c); @@ -7804,7 +7814,7 @@ void Array_string_sort_ignore_case(Array_string* s); void Array_string_sort_by_len(Array_string* s); string string_str(string s); VV_LOCAL_SYMBOL byte string_at(string s, int idx); -VV_LOCAL_SYMBOL Option_u8 string_at_with_check(string s, int idx); +VV_LOCAL_SYMBOL _option_u8 string_at_with_check(string s, int idx); bool u8_is_space(u8 c); bool u8_is_digit(u8 c); bool u8_is_hex_digit(u8 c); @@ -7867,7 +7877,7 @@ string utf32_to_str_no_malloc(u32 code, u8* buf); int utf32_decode_to_buffer(u32 code, u8* buf); int utf8_str_len(string s); int string_utf32_code(string _rune); -Option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes); +_option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes); VV_LOCAL_SYMBOL int utf8_len(u8 c); int utf8_str_visible_length(string s); bool ArrayFlags_is_empty(ArrayFlags* e); @@ -7890,7 +7900,7 @@ Array_string os__args_before(string cut_word); #define _const_os__o_nonblock 2048 #define _const_os__o_sync 1052672 string os__getenv(string key); -Option_string os__getenv_opt(string key); +_option_string os__getenv_opt(string key); int os__setenv(string name, string value, bool overwrite); int os__unsetenv(string name); VV_LOCAL_SYMBOL char** os__unix_environ(void); @@ -7899,46 +7909,46 @@ int os__fd_close(int fd); void os__fd_write(int fd, string s); Array_string os__fd_slurp(int fd); multi_return_string_int os__fd_read(int fd, int maxbytes); -Option_os__File os__open_file(string path, string mode, Array_int options); -Option_os__File os__open(string path); -Option_os__File os__create(string path); +_option_os__File os__open_file(string path, string mode, Array_int options); +_option_os__File os__open(string path); +_option_os__File os__create(string path); os__File os__stdin(void); os__File os__stdout(void); os__File os__stderr(void); -Option_int os__File_read(os__File* f, Array_u8* buf); -Option_int os__File_write(os__File* f, Array_u8 buf); -Option_int os__File_writeln(os__File* f, string s); -Option_int os__File_write_string(os__File* f, string s); -Option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf); +_option_int os__File_read(os__File* f, Array_u8* buf); +_option_int os__File_write(os__File* f, Array_u8 buf); +_option_int os__File_writeln(os__File* f, string s); +_option_int os__File_write_string(os__File* f, string s); +_option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf); int os__File_write_ptr(os__File* f, voidptr data, int size); -Option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer_len); +_option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer_len); int os__File_write_ptr_at(os__File* f, voidptr data, int size, u64 pos); -VV_LOCAL_SYMBOL Option_int os__fread(voidptr ptr, int item_size, int items, FILE* stream); +VV_LOCAL_SYMBOL _option_int os__fread(voidptr ptr, int item_size, int items, FILE* stream); Array_u8 os__File_read_bytes(os__File* f, int size); Array_u8 os__File_read_bytes_at(os__File* f, int size, u64 pos); -Option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf); -Option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf); -Option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf); -Option_int os__File_read_into_ptr(os__File* f, u8* ptr, int max_size); +_option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf); +_option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf); +_option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf); +_option_int os__File_read_into_ptr(os__File* f, u8* ptr, int max_size); void os__File_flush(os__File* f); string os__FileNotOpenedError_msg(os__FileNotOpenedError err); string os__SizeOfTypeIs0Error_msg(os__SizeOfTypeIs0Error err); VV_LOCAL_SYMBOL IError os__error_file_not_opened(void); VV_LOCAL_SYMBOL IError os__error_size_of_type_0(void); -Option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode); -Option_i64 os__File_tell(os__File* f); +_option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode); +_option_i64 os__File_tell(os__File* f); u32 os__FilePermission_bitmask(os__FilePermission p); u32 os__FileMode_bitmask(os__FileMode m); os__FileMode os__inode(string path); Array_string _const_os__args; // inited later -Option_Array_u8 os__read_bytes(string path); -Option_string os__read_file(string path); -Option_void os__truncate(string path, u64 len); +_option_Array_u8 os__read_bytes(string path); +_option_string os__read_file(string path); +_option_void os__truncate(string path, u64 len); VV_LOCAL_SYMBOL void os__eprintln_unknown_file_size(void); u64 os__file_size(string path); -Option_void os__mv(string src, string dst); -Option_void os__cp(string src, string dst); -Option_FILE_ptr os__vfopen(string path, string mode); +_option_void os__mv(string src, string dst); +_option_void os__cp(string src, string dst); +_option_FILE_ptr os__vfopen(string path, string mode); int os__fileno(voidptr cfile); VV_LOCAL_SYMBOL voidptr os__vpopen(string path); VV_LOCAL_SYMBOL multi_return_int_bool os__posix_wait4_to_exit_status(int waitret); @@ -7949,15 +7959,15 @@ bool os__exists(string path); bool os__is_executable(string path); bool os__is_writable(string path); bool os__is_readable(string path); -Option_void os__rm(string path); -Option_void os__rmdir(string path); +_option_void os__rm(string path); +_option_void os__rmdir(string path); VV_LOCAL_SYMBOL void os__print_c_errno(void); string os__get_raw_line(void); Array_u8 os__get_raw_stdin(void); string os__executable(void); bool os__is_dir(string path); bool os__is_link(string path); -Option_void os__chdir(string path); +_option_void os__chdir(string path); VV_LOCAL_SYMBOL int os__max_path_bufffer_size(void); string os__getwd(void); string os__real_path(string fpath); @@ -7966,14 +7976,14 @@ int os__fork(void); int os__wait(void); i64 os__file_last_mod_unix(string path); void os__flush(void); -Option_void os__chmod(string path, int mode); -Option_void os__chown(string path, int owner, int group); -Option_os__File os__open_append(string path); -Option_void os__execvp(string cmdpath, Array_string cmdargs); -Option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs); +_option_void os__chmod(string path, int mode); +_option_void os__chown(string path, int owner, int group); +_option_os__File os__open_append(string path); +_option_void os__execvp(string cmdpath, Array_string cmdargs); +_option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs); int os__is_atty(int fd); -Option_void os__write_file_array(string path, array buffer); -Option_Array_string os__glob(Array_string patterns); +_option_void os__write_file_array(string path, array buffer); +_option_Array_string os__glob(Array_string patterns); VV_LOCAL_SYMBOL int compare_3677745349018262865_string(string* a, string* b) { if (string__lt(*a, *b)) return -1; else return 1; @@ -7987,17 +7997,17 @@ string _const_os__wd_at_startup; // inited later #define _const_os__w_ok 2 #define _const_os__r_ok 4 void os__Result_free(os__Result* result); -Option_void os__cp_all(string src, string dst, bool overwrite); -Option_void os__mv_by_cp(string source, string target); -Option_Array_string os__read_lines(string path); +_option_void os__cp_all(string src, string dst, bool overwrite); +_option_void os__mv_by_cp(string source, string target); +_option_Array_string os__read_lines(string path); string os__sigint_to_signal_name(int si); -Option_void os__rmdir_all(string path); +_option_void os__rmdir_all(string path); bool os__is_dir_empty(string path); string os__file_ext(string path); string os__dir(string opath); string os__base(string opath); string os__file_name(string opath); -Option_string os__input_opt(string prompt); +_option_string os__input_opt(string prompt); string os__input(string prompt); string os__get_line(void); Array_string os__get_lines(void); @@ -8006,11 +8016,11 @@ string os__get_raw_lines_joined(void); string os__user_os(void); string os__home_dir(void); string os__expand_tilde_to_home(string path); -Option_void os__write_file(string path, string text); +_option_void os__write_file(string path, string text); VV_LOCAL_SYMBOL string os__executable_fallback(void); string os__ExecutableNotFoundError_msg(os__ExecutableNotFoundError err); VV_LOCAL_SYMBOL IError os__error_failed_to_find_executable(void); -Option_string os__find_abs_path_of_executable(string exepath); +_option_string os__find_abs_path_of_executable(string exepath); bool os__exists_in_system_path(string prog); bool os__is_file(string path); bool os__is_abs_path(string path); @@ -8021,7 +8031,7 @@ VV_LOCAL_SYMBOL void os__impl_walk_ext(string path, string ext, Array_string* ou void os__walk(string path, void (*f)(string )); void os__walk_with_context(string path, voidptr context, void (*fcb)(voidptr , string )); void os__log(string s); -Option_void os__mkdir_all(string opath); +_option_void os__mkdir_all(string opath); string os__cache_dir(void); string os__temp_dir(void); VV_LOCAL_SYMBOL string os__default_vmodules_path(void); @@ -8031,7 +8041,7 @@ string os__resource_abs_path(string path); os__Result os__execute_or_panic(string cmd); os__Result os__execute_or_exit(string cmd); string os__quoted_path(string path); -Option_string os__config_dir(void); +_option_string os__config_dir(void); #define _const_os__prot_read 1 #define _const_os__prot_write 2 #define _const_os__map_private 2 @@ -8062,24 +8072,24 @@ string _const_os__path_delimiter; // a string literal, inited later #define _const_os__s_iwoth 2 #define _const_os__s_ixoth 1 VV_LOCAL_SYMBOL Array_string os__glob_match(string dir, string pattern, string next_pattern, Array_string* matches); -VV_LOCAL_SYMBOL Option_void os__native_glob_pattern(string pattern, Array_string* matches); -Option_void os__utime(string path, int actime, int modtime); +VV_LOCAL_SYMBOL _option_void os__native_glob_pattern(string pattern, Array_string* matches); +_option_void os__utime(string path, int actime, int modtime); os__Uname os__uname(void); string os__hostname(void); string os__loginname(void); VV_LOCAL_SYMBOL Array_string os__init_os_args(int argc, u8** argv); -Option_Array_string os__ls(string path); -Option_bool os__mkdir(string path); +_option_Array_string os__ls(string path); +_option_bool os__mkdir(string path); os__Result os__execute(string cmd); -Option_void os__Command_start(os__Command* c); +_option_void os__Command_start(os__Command* c); string os__Command_read_line(os__Command* c); -Option_void os__Command_close(os__Command* c); -Option_bool os__symlink(string origin, string target); -Option_bool os__link(string origin, string target); +_option_void os__Command_close(os__Command* c); +_option_bool os__symlink(string origin, string target); +_option_bool os__link(string origin, string target); string os__get_error_msg(int code); void os__File_close(os__File* f); bool os__debugger_present(void); -Option_bool os__is_writable_folder(string folder); +_option_bool os__is_writable_folder(string folder); int os__getpid(void); int os__getppid(void); int os__getuid(void); @@ -8130,8 +8140,8 @@ 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); VV_LOCAL_SYMBOL multi_return_string_int os__Process_win_read_string(os__Process* p, int idx, int maxbytes); VV_LOCAL_SYMBOL string os__Process_win_slurp(os__Process* p, int idx); -Option_os__SignalHandler os__signal_opt(os__Signal signum, void (*handler)(os__Signal )); -Option_void os__open_uri(string uri); +_option_os__SignalHandler os__signal_opt(os__Signal signum, void (*handler)(os__Signal )); +_option_void os__open_uri(string uri); strings__textscanner__TextScanner strings__textscanner__new(string input); void strings__textscanner__TextScanner_free(strings__textscanner__TextScanner* ss); int strings__textscanner__TextScanner_remaining(strings__textscanner__TextScanner* ss); @@ -8193,7 +8203,7 @@ bool v__token__Kind_is_prefix(v__token__Kind kind); bool v__token__Kind_is_infix(v__token__Kind kind); bool v__token__Kind_is_postfix(v__token__Kind kind); string v__token__kind_to_string(v__token__Kind k); -Option_v__token__Kind v__token__kind_from_string(string s); +_option_v__token__Kind v__token__kind_from_string(string s); int v__mathutil__min_T_int(int a, int b); int v__mathutil__max_T_int(int a, int b); void v__dotgraph__start_digraph(void); @@ -8306,26 +8316,26 @@ void flag__FlagParser_skip_executable(flag__FlagParser* fs); void flag__FlagParser_allow_unknown_args(flag__FlagParser* fs); VV_LOCAL_SYMBOL void flag__FlagParser_add_flag(flag__FlagParser* fs, string name, u8 abbr, string usage, string desc); VV_LOCAL_SYMBOL Array_string flag__FlagParser_parse_value(flag__FlagParser* fs, string longhand, u8 shorthand); -VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser* fs, string longhand, u8 shorthand); -Option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); +VV_LOCAL_SYMBOL _option_string flag__FlagParser_parse_bool_value(flag__FlagParser* fs, string longhand, u8 shorthand); +_option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); bool flag__FlagParser_bool(flag__FlagParser* fs, string name, u8 abbr, bool bdefault, string usage); Array_int flag__FlagParser_int_multi(flag__FlagParser* fs, string name, u8 abbr, string usage); -Option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); +_option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); int flag__FlagParser_int(flag__FlagParser* fs, string name, u8 abbr, int idefault, string usage); Array_f64 flag__FlagParser_float_multi(flag__FlagParser* fs, string name, u8 abbr, string usage); -Option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); +_option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); f64 flag__FlagParser_float(flag__FlagParser* fs, string name, u8 abbr, f64 fdefault, string usage); Array_string flag__FlagParser_string_multi(flag__FlagParser* fs, string name, u8 abbr, string usage); -Option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); +_option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); string flag__FlagParser_string(flag__FlagParser* fs, string name, u8 abbr, string sdefault, string usage); -Option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, int n); -Option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, int n); -Option_void flag__FlagParser_limit_free_args(flag__FlagParser* fs, int min, int max); +_option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, int n); +_option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, int n); +_option_void flag__FlagParser_limit_free_args(flag__FlagParser* fs, int min, int max); void flag__FlagParser_arguments_description(flag__FlagParser* fs, string description); string flag__FlagParser_usage(flag__FlagParser* fs); -VV_LOCAL_SYMBOL Option_flag__Flag flag__FlagParser_find_existing_flag(flag__FlagParser* fs, string fname); +VV_LOCAL_SYMBOL _option_flag__Flag flag__FlagParser_find_existing_flag(flag__FlagParser* fs, string fname); VV_LOCAL_SYMBOL void flag__FlagParser_handle_builtin_options(flag__FlagParser* fs); -Option_Array_string flag__FlagParser_finalize(flag__FlagParser* fs); +_option_Array_string flag__FlagParser_finalize(flag__FlagParser* fs); Array_string flag__FlagParser_remaining_parameters(flag__FlagParser* fs); VV_LOCAL_SYMBOL bool semver__version_satisfies(semver__Version ver, string input); VV_LOCAL_SYMBOL bool semver__compare_eq(semver__Version v1, semver__Version v2); @@ -8340,9 +8350,9 @@ Array_int _const_semver__versions; // inited later VV_LOCAL_SYMBOL semver__RawVersion semver__parse(string input); VV_LOCAL_SYMBOL bool semver__RawVersion_is_valid(semver__RawVersion ver); VV_LOCAL_SYMBOL bool semver__RawVersion_is_missing(semver__RawVersion ver, int typ); -VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_coerce(semver__RawVersion raw_ver); +VV_LOCAL_SYMBOL _option_semver__Version semver__RawVersion_coerce(semver__RawVersion raw_ver); VV_LOCAL_SYMBOL semver__RawVersion semver__RawVersion_complete(semver__RawVersion raw_ver); -VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_validate(semver__RawVersion raw_ver); +VV_LOCAL_SYMBOL _option_semver__Version semver__RawVersion_validate(semver__RawVersion raw_ver); VV_LOCAL_SYMBOL semver__Version semver__RawVersion_to_version(semver__RawVersion raw_ver); string _const_semver__comparator_sep; // a string literal, inited later string _const_semver__comparator_set_sep; // a string literal, inited later @@ -8351,21 +8361,21 @@ string _const_semver__x_range_symbols; // a string literal, inited later VV_LOCAL_SYMBOL bool semver__Range_satisfies(semver__Range r, semver__Version ver); VV_LOCAL_SYMBOL bool semver__ComparatorSet_satisfies(semver__ComparatorSet set, semver__Version ver); VV_LOCAL_SYMBOL bool semver__Comparator_satisfies(semver__Comparator c, semver__Version ver); -VV_LOCAL_SYMBOL Option_semver__Range semver__parse_range(string input); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__parse_comparator_set(string input); -VV_LOCAL_SYMBOL Option_semver__Comparator semver__parse_comparator(string input); -VV_LOCAL_SYMBOL Option_semver__Version semver__parse_xrange(string input); +VV_LOCAL_SYMBOL _option_semver__Range semver__parse_range(string input); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__parse_comparator_set(string input); +VV_LOCAL_SYMBOL _option_semver__Comparator semver__parse_comparator(string input); +VV_LOCAL_SYMBOL _option_semver__Version semver__parse_xrange(string input); VV_LOCAL_SYMBOL bool semver__can_expand(string input); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_comparator_set(string input); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_tilda(string raw_version); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_caret(string raw_version); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_hyphen(string raw_range); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_xrange(string raw_range); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_comparator_set(string input); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_tilda(string raw_version); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_caret(string raw_version); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_hyphen(string raw_range); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_xrange(string raw_range); VV_LOCAL_SYMBOL semver__ComparatorSet semver__make_comparator_set_ge_lt(semver__Version min, semver__Version max); VV_LOCAL_SYMBOL semver__ComparatorSet semver__make_comparator_set_ge_le(semver__Version min, semver__Version max); string semver__EmptyInputError_msg(semver__EmptyInputError err); string semver__InvalidVersionFormatError_msg(semver__InvalidVersionFormatError err); -Option_semver__Version semver__from(string input); +_option_semver__Version semver__from(string input); semver__Version semver__build(int major, int minor, int patch); semver__Version semver__Version_increment(semver__Version ver, semver__Increment typ); bool semver__Version_satisfies(semver__Version ver, string input); @@ -8375,10 +8385,10 @@ bool semver__Version_lt(semver__Version v1, semver__Version v2); bool semver__Version_ge(semver__Version v1, semver__Version v2); bool semver__Version_le(semver__Version v1, semver__Version v2); string semver__Version_str(semver__Version ver); -Option_semver__Version semver__coerce(string input); +_option_semver__Version semver__coerce(string input); bool semver__is_valid(string input); VV_LOCAL_SYMBOL bool semver__is_version_valid(string input); -VV_LOCAL_SYMBOL Option_semver__Version semver__coerce_version(string input); +VV_LOCAL_SYMBOL _option_semver__Version semver__coerce_version(string input); VV_LOCAL_SYMBOL semver__Version semver__increment_version(semver__Version ver, semver__Increment typ); VV_LOCAL_SYMBOL bool semver__is_valid_string(string input); VV_LOCAL_SYMBOL bool semver__is_valid_number(string input); @@ -8474,7 +8484,7 @@ string term__header(string text, string divider); VV_LOCAL_SYMBOL int term__imax(int x, int y); VV_LOCAL_SYMBOL bool term__supports_escape_sequences(int fd); multi_return_int_int term__get_terminal_size(void); -Option_term__Coord term__get_cursor_position(void); +_option_term__Coord term__get_cursor_position(void); bool term__set_terminal_title(string title); void term__clear(void); string _const_v__util__version__v_version; // a string literal, inited later @@ -8486,13 +8496,13 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts); void v__vcache__CacheManager_set_temporary_options(v__vcache__CacheManager* cm, Array_string new_opts); string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key); string v__vcache__CacheManager_postfix_with_key2cpath(v__vcache__CacheManager* cm, string postfix, string key); -Option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key); -Option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content); -Option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key); +_option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key); +_option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content); +_option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key); VV_LOCAL_SYMBOL int v__vcache__mypid(void); string _const_v__vmod__err_label; // a string literal, inited later -Option_v__vmod__Manifest v__vmod__from_file(string vmod_path); -Option_v__vmod__Manifest v__vmod__decode(string contents); +_option_v__vmod__Manifest v__vmod__from_file(string vmod_path); +_option_v__vmod__Manifest v__vmod__decode(string contents); VV_LOCAL_SYMBOL void v__vmod__Scanner_tokenize(v__vmod__Scanner* s, v__vmod__TokenKind t_type, string val); VV_LOCAL_SYMBOL void v__vmod__Scanner_skip_whitespace(v__vmod__Scanner* s); VV_LOCAL_SYMBOL bool v__vmod__is_name_alpha(u8 chr); @@ -8500,8 +8510,8 @@ VV_LOCAL_SYMBOL string v__vmod__Scanner_create_string(v__vmod__Scanner* s, u8 q) VV_LOCAL_SYMBOL string v__vmod__Scanner_create_ident(v__vmod__Scanner* s); VV_LOCAL_SYMBOL bool v__vmod__Scanner_peek_char(v__vmod__Scanner s, u8 c); VV_LOCAL_SYMBOL void v__vmod__Scanner_scan_all(v__vmod__Scanner* s); -VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content(Array_v__vmod__Token tokens, int st_idx); -VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* p); +VV_LOCAL_SYMBOL _option_multi_return_Array_string_int v__vmod__get_array_content(Array_v__vmod__Token tokens, int st_idx); +VV_LOCAL_SYMBOL _option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* p); v__vmod__ModFileCacher* v__vmod__new_mod_file_cacher(void); void v__vmod__ModFileCacher_debug(v__vmod__ModFileCacher* mcache); v__vmod__ModFileAndFolder v__vmod__ModFileCacher_get_by_file(v__vmod__ModFileCacher* mcache, string vfile); @@ -8799,14 +8809,14 @@ f64 math__f64_from_bits(u64 b); f64 math__with_set_low_word(f64 f, u32 lo); f64 math__with_set_high_word(f64 f, u32 hi); u32 math__get_high_word(f64 f); -VV_LOCAL_SYMBOL Option_string v__pkgconfig__desc(string mod); -Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args); +VV_LOCAL_SYMBOL _option_string v__pkgconfig__desc(string mod); +_option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args); VV_LOCAL_SYMBOL int compare_10129308118656229290_string(string* a, string* b) { if (string__lt(*a, *b)) return -1; else return 1; } -Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m); +_option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m); VV_LOCAL_SYMBOL string v__pkgconfig__filter(Array_string libs, string prefix, string prefix2); VV_LOCAL_SYMBOL v__pkgconfig__MainOptions* v__pkgconfig__parse_options(flag__FlagParser* fp); Array_string _const_v__pkgconfig__default_paths; // inited later @@ -8816,15 +8826,15 @@ VV_LOCAL_SYMBOL Array_string v__pkgconfig__PkgConfig_parse_list(v__pkgconfig__Pk VV_LOCAL_SYMBOL string v__pkgconfig__PkgConfig_parse_line(v__pkgconfig__PkgConfig* pc, string s); VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_setvar(v__pkgconfig__PkgConfig* pc, string line); VV_LOCAL_SYMBOL bool v__pkgconfig__PkgConfig_parse(v__pkgconfig__PkgConfig* pc, string file); -VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgConfig* pc, string pkgname); +VV_LOCAL_SYMBOL _option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgConfig* pc, string pkgname); bool v__pkgconfig__atleast(string v); bool v__pkgconfig__PkgConfig_atleast(v__pkgconfig__PkgConfig* pc, string v); -Option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkgconfig__PkgConfig* pcdep); -VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__PkgConfig* pc); -VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__PkgConfig* pc, string dep); +_option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkgconfig__PkgConfig* pcdep); +VV_LOCAL_SYMBOL _option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__PkgConfig* pc); +VV_LOCAL_SYMBOL _option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__PkgConfig* pc, string dep); VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_add_path(v__pkgconfig__PkgConfig* pc, string path); VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_load_paths(v__pkgconfig__PkgConfig* pc); -Option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconfig__Options options); +_option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconfig__Options options); Array_string v__pkgconfig__list(void); int runtime__nr_jobs(void); bool runtime__is_32bit(void); @@ -8858,12 +8868,12 @@ string time__Time_utc_string(time__Time t); bool time__Time__eq(time__Time t1, time__Time t2); bool time__Time__lt(time__Time t1, time__Time t2); time__Duration time__Time__minus(time__Time lhs, time__Time rhs); -Option_time__Time time__parse_rfc3339(string s); -Option_time__Time time__parse(string s); -Option_time__Time time__parse_iso8601(string s); -Option_time__Time time__parse_rfc2822(string s); -VV_LOCAL_SYMBOL Option_multi_return_int_int_int time__parse_iso8601_date(string s); -VV_LOCAL_SYMBOL Option_multi_return_int_int_int_int_i64_bool time__parse_iso8601_time(string s); +_option_time__Time time__parse_rfc3339(string s); +_option_time__Time time__parse(string s); +_option_time__Time time__parse_iso8601(string s); +_option_time__Time time__parse_rfc2822(string s); +VV_LOCAL_SYMBOL _option_multi_return_int_int_int time__parse_iso8601_date(string s); +VV_LOCAL_SYMBOL _option_multi_return_int_int_int_int_i64_bool time__parse_iso8601_time(string s); string time__TimeParseError_msg(time__TimeParseError err); VV_LOCAL_SYMBOL IError time__error_invalid_time(int code); time__StopWatch time__new_stopwatch(time__StopWatchOptions opts); @@ -8907,7 +8917,7 @@ int time__Time_day_of_week(time__Time* t); string time__Time_weekday_str(time__Time* t); string time__Time_long_weekday_str(time__Time* t); bool time__is_leap_year(int year); -Option_int time__days_in_month(int month, int year); +_option_int time__days_in_month(int month, int year); string time__Time_debug(time__Time* t); time__Duration _const_time__nanosecond; // inited later time__Duration _const_time__microsecond; // inited later @@ -8945,7 +8955,7 @@ time__Time time__unix(i64 abs); time__Time time__unix2(i64 abs, int microsecond); VV_LOCAL_SYMBOL multi_return_int_int_int time__calculate_date_from_offset(i64 day_offset_); VV_LOCAL_SYMBOL multi_return_int_int_int time__calculate_time_from_offset(i64 second_offset_); -Option_string v__util__diff__find_working_diff_command(void); +_option_string v__util__diff__find_working_diff_command(void); VV_LOCAL_SYMBOL bool v__util__diff__opendiff_exists(void); string v__util__diff__color_compare_files(string diff_cmd, string file1, string file2); string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefix, string expected, string found); @@ -8974,28 +8984,28 @@ VV_LOCAL_SYMBOL void rand__init(void); VV_LOCAL_SYMBOL void rand__read_32(rand__PRNG* rng, Array_u8* buf); VV_LOCAL_SYMBOL void rand__read_64(rand__PRNG* rng, Array_u8* buf); VV_LOCAL_SYMBOL void rand__read_internal(rand__PRNG* rng, Array_u8* buf); -Option_Array_u8 rand__PRNG_bytes(rand__PRNG* rng, int bytes_needed); +_option_Array_u8 rand__PRNG_bytes(rand__PRNG* rng, int bytes_needed); void rand__PRNG_read(rand__PRNG* rng, Array_u8* buf); -Option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max); -Option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max); -Option_u32 rand__PRNG_u32_in_range(rand__PRNG* rng, u32 min, u32 max); -Option_u64 rand__PRNG_u64_in_range(rand__PRNG* rng, u64 min, u64 max); +_option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max); +_option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max); +_option_u32 rand__PRNG_u32_in_range(rand__PRNG* rng, u32 min, u32 max); +_option_u64 rand__PRNG_u64_in_range(rand__PRNG* rng, u64 min, u64 max); i8 rand__PRNG_i8(rand__PRNG* rng); i16 rand__PRNG_i16(rand__PRNG* rng); int rand__PRNG_int(rand__PRNG* rng); i64 rand__PRNG_i64(rand__PRNG* rng); int rand__PRNG_int31(rand__PRNG* rng); i64 rand__PRNG_int63(rand__PRNG* rng); -Option_int rand__PRNG_intn(rand__PRNG* rng, int max); -Option_i64 rand__PRNG_i64n(rand__PRNG* rng, i64 max); -Option_int rand__PRNG_int_in_range(rand__PRNG* rng, int min, int max); -Option_i64 rand__PRNG_i64_in_range(rand__PRNG* rng, i64 min, i64 max); +_option_int rand__PRNG_intn(rand__PRNG* rng, int max); +_option_i64 rand__PRNG_i64n(rand__PRNG* rng, i64 max); +_option_int rand__PRNG_int_in_range(rand__PRNG* rng, int min, int max); +_option_i64 rand__PRNG_i64_in_range(rand__PRNG* rng, i64 min, i64 max); f32 rand__PRNG_f32(rand__PRNG* rng); f64 rand__PRNG_f64(rand__PRNG* rng); -Option_f32 rand__PRNG_f32n(rand__PRNG* rng, f32 max); -Option_f64 rand__PRNG_f64n(rand__PRNG* rng, f64 max); -Option_f32 rand__PRNG_f32_in_range(rand__PRNG* rng, f32 min, f32 max); -Option_f64 rand__PRNG_f64_in_range(rand__PRNG* rng, f64 min, f64 max); +_option_f32 rand__PRNG_f32n(rand__PRNG* rng, f32 max); +_option_f64 rand__PRNG_f64n(rand__PRNG* rng, f64 max); +_option_f32 rand__PRNG_f32_in_range(rand__PRNG* rng, f32 min, f32 max); +_option_f64 rand__PRNG_f64_in_range(rand__PRNG* rng, f64 min, f64 max); string rand__PRNG_ulid(rand__PRNG* rng); string rand__PRNG_ulid_at_millisecond(rand__PRNG* rng, u64 unix_time_milli); string rand__PRNG_string_from_set(rand__PRNG* rng, string charset, int len); @@ -9009,27 +9019,27 @@ void rand__set_rng(rand__PRNG* rng); void rand__seed(Array_u32 seed); u32 rand__u32(void); u64 rand__u64(void); -Option_u32 rand__u32n(u32 max); -Option_u64 rand__u64n(u64 max); -Option_u32 rand__u32_in_range(u32 min, u32 max); -Option_u64 rand__u64_in_range(u64 min, u64 max); +_option_u32 rand__u32n(u32 max); +_option_u64 rand__u64n(u64 max); +_option_u32 rand__u32_in_range(u32 min, u32 max); +_option_u64 rand__u64_in_range(u64 min, u64 max); i16 rand__i16(void); int rand__int(void); -Option_int rand__intn(int max); +_option_int rand__intn(int max); u8 rand__u8(void); -Option_int rand__int_in_range(int min, int max); +_option_int rand__int_in_range(int min, int max); int rand__int31(void); i64 rand__i64(void); -Option_i64 rand__i64n(i64 max); -Option_i64 rand__i64_in_range(i64 min, i64 max); +_option_i64 rand__i64n(i64 max); +_option_i64 rand__i64_in_range(i64 min, i64 max); i64 rand__int63(void); f32 rand__f32(void); f64 rand__f64(void); -Option_f32 rand__f32n(f32 max); -Option_f64 rand__f64n(f64 max); -Option_f32 rand__f32_in_range(f32 min, f32 max); -Option_f64 rand__f64_in_range(f64 min, f64 max); -Option_Array_u8 rand__bytes(int bytes_needed); +_option_f32 rand__f32n(f32 max); +_option_f64 rand__f64n(f64 max); +_option_f32 rand__f32_in_range(f32 min, f32 max); +_option_f64 rand__f64_in_range(f64 min, f64 max); +_option_Array_u8 rand__bytes(int bytes_needed); void rand__read(Array_u8* buf); string _const_rand__english_letters; // a string literal, inited later string _const_rand__hex_chars; // a string literal, inited later @@ -9050,7 +9060,7 @@ string v__pref__default_tcc_compiler(void); void v__pref__Preferences_default_c_compiler(v__pref__Preferences* p); string v__pref__vexe_path(void); string v__pref__Preferences_vcross_compiler_name(v__pref__Preferences* p); -Option_v__pref__OS v__pref__os_from_string(string os_str); +_option_v__pref__OS v__pref__os_from_string(string os_str); string v__pref__OS_str(v__pref__OS o); v__pref__OS v__pref__get_host_os(void); bool v__pref__Backend_is_js(v__pref__Backend b); @@ -9061,10 +9071,10 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors void v__pref__eprintln_cond(bool condition, string s); void v__pref__Preferences_vrun_elog(v__pref__Preferences* pref, string s); bool v__pref__Preferences_should_output_to_stdout(v__pref__Preferences* pref); -Option_v__pref__Arch v__pref__arch_from_string(string arch_str); +_option_v__pref__Arch v__pref__arch_from_string(string arch_str); VV_LOCAL_SYMBOL void v__pref__must_exist(string path); VV_LOCAL_SYMBOL bool v__pref__is_source_file(string path); -Option_v__pref__Backend v__pref__backend_from_string(string s); +_option_v__pref__Backend v__pref__backend_from_string(string s); v__pref__CompilerType v__pref__cc_from_string(string cc_str); v__pref__Arch v__pref__get_host_arch(void); VV_LOCAL_SYMBOL void v__pref__Preferences_parse_define(v__pref__Preferences* prefs, string define); @@ -9135,7 +9145,7 @@ VV_LOCAL_SYMBOL int compare_1468091262560489642_string(string* a, string* b) { else return 1; } -Option_string v__util__find_working_diff_command(void); +_option_string v__util__find_working_diff_command(void); string v__util__color_compare_files(string diff_cmd, string file1, string file2); string v__util__color_compare_strings(string diff_cmd, string unique_prefix, string expected, string found); #define _const_v__util__error_context_before 2 @@ -9155,7 +9165,7 @@ void v__util__verror(string kind, string s); string v__util__vlines_escape_path(string path, string ccompiler); string v__util__qualify_import(v__pref__Preferences* pref, string mod, string file_path); string v__util__qualify_module(v__pref__Preferences* pref, string mod, string file_path); -VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preferences* pref, string mod, string path); +VV_LOCAL_SYMBOL _option_string v__util__mod_path_to_full_name(v__pref__Preferences* pref, string mod, string path); Array_u8 _const_v__util__invalid_escapes; // inited later #define _const_v__util__backslash 92 #define _const_v__util__backslash_r 13 @@ -9219,19 +9229,19 @@ Array_string _const_v__util__builtin_module_names; // inited later bool v__util__module_is_builtin(string mod); string v__util__tabs(int n); void v__util__set_vroot_folder(string vroot_path); -Option_string v__util__resolve_vmodroot(string str, string dir); -Option_string v__util__resolve_env_value(string str, bool check_for_presence); +_option_string v__util__resolve_vmodroot(string str, string dir); +_option_string v__util__resolve_env_value(string str, bool check_for_presence); void v__util__launch_tool(bool is_verbose, string tool_name, Array_string args); bool v__util__should_recompile_tool(string vexe, string tool_source, string tool_name, string tool_exe); VV_LOCAL_SYMBOL multi_return_string_string v__util__tool_source2name_and_exe(string tool_source); string v__util__quote_path(string s); string v__util__args_quote_paths(Array_string args); string v__util__path_of_executable(string path); -Option_string v__util__cached_read_source_file(string path); +_option_string v__util__cached_read_source_file(string path); string v__util__replace_op(string s); Array_string v__util__join_env_vflags_and_os_args(void); 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); +_option_bool v__util__check_module_is_installed(string modulename, bool is_verbose); void v__util__ensure_modules_for_all_tools_are_installed(bool is_verbose); string v__util__strip_mod_name(string name); string v__util__strip_main_name(string name); @@ -9242,9 +9252,9 @@ void v__util__prepare_tool_when_needed(string source_name); void v__util__recompile_file(string vexe, string file); string v__util__get_vtmp_folder(void); bool v__util__should_bundle_module(string mod); -Option_Array_string v__util__find_all_v_files(Array_string roots); +_option_Array_string v__util__find_all_v_files(Array_string roots); void v__util__free_caches(void); -Option_string v__util__read_file(string file_path); +_option_string v__util__read_file(string file_path); voidptr _const_sync__pool__no_result; // inited later sync__pool__PoolProcessor* sync__pool__new_pool_processor(sync__pool__PoolProcessorConfig context); void sync__pool__PoolProcessor_set_max_jobs(sync__pool__PoolProcessor* pool, int njobs); @@ -9261,7 +9271,7 @@ string v__ast__ComptimeType_str(v__ast__ComptimeType cty); v__ast__Expr v__ast__empty_expr(void); v__ast__Stmt v__ast__empty_stmt(void); v__ast__Node v__ast__empty_node(void); -Option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e); +_option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e); bool v__ast__StructField_equals(v__ast__StructField* f, v__ast__StructField* o); void v__ast__File_free(v__ast__File* f); bool v__ast__Ident_is_mut(v__ast__Ident* i); @@ -9279,7 +9289,7 @@ bool v__ast__Expr_is_expr(v__ast__Expr expr); bool v__ast__Expr_is_lit(v__ast__Expr expr); bool v__ast__Expr_is_auto_deref_var(v__ast__Expr expr); bool v__ast__Expr_is_lockable(v__ast__Expr* e); -Option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt); +_option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt); v__token__Pos v__ast__Node_pos(v__ast__Node node); 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); @@ -9292,22 +9302,22 @@ VV_LOCAL_SYMBOL v__token__KeywordsMatcher v__ast__build_builtin_type_names_match string v__ast__Attr_debug(v__ast__Attr* a); string v__ast__Attr_str(v__ast__Attr* a); bool Array_v__ast__Attr_contains(Array_v__ast__Attr attrs, string str); -Option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs); +_option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs); VV_LOCAL_SYMBOL bool v__ast__Table_has_cflag(v__ast__Table* t, v__cflag__CFlag flag); -Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines); +_option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines); v__ast__ComptTimeConstValue v__ast__empty_comptime_const_expr(void); -Option_i8 v__ast__ComptTimeConstValue_i8(v__ast__ComptTimeConstValue val); -Option_i16 v__ast__ComptTimeConstValue_i16(v__ast__ComptTimeConstValue val); -Option_int v__ast__ComptTimeConstValue_int(v__ast__ComptTimeConstValue val); -Option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val); -Option_u8 v__ast__ComptTimeConstValue_u8(v__ast__ComptTimeConstValue val); -Option_u16 v__ast__ComptTimeConstValue_u16(v__ast__ComptTimeConstValue val); -Option_u32 v__ast__ComptTimeConstValue_u32(v__ast__ComptTimeConstValue val); -Option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val); -Option_f32 v__ast__ComptTimeConstValue_f32(v__ast__ComptTimeConstValue val); -Option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val); -Option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val); -Option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast__ConstField* obj); +_option_i8 v__ast__ComptTimeConstValue_i8(v__ast__ComptTimeConstValue val); +_option_i16 v__ast__ComptTimeConstValue_i16(v__ast__ComptTimeConstValue val); +_option_int v__ast__ComptTimeConstValue_int(v__ast__ComptTimeConstValue val); +_option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val); +_option_u8 v__ast__ComptTimeConstValue_u8(v__ast__ComptTimeConstValue val); +_option_u16 v__ast__ComptTimeConstValue_u16(v__ast__ComptTimeConstValue val); +_option_u32 v__ast__ComptTimeConstValue_u32(v__ast__ComptTimeConstValue val); +_option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val); +_option_f32 v__ast__ComptTimeConstValue_f32(v__ast__ComptTimeConstValue val); +_option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val); +_option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val); +_option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast__ConstField* obj); bool v__ast__ConstField_is_simple_define_const(v__ast__ConstField* obj); bool v__ast__ScopeObject_is_simple_define_const(v__ast__ScopeObject obj); u64 v__ast__EmbeddedFile_hash(v__ast__EmbeddedFile e); @@ -9315,11 +9325,11 @@ v__ast__Expr v__ast__resolve_init(v__ast__StructInit node, v__ast__Type typ, v__ Array_string _const_v__ast__native_builtins; // inited later void v__ast__Scope_free(v__ast__Scope* s); VV_LOCAL_SYMBOL bool v__ast__Scope_dont_lookup_parent(v__ast__Scope* s); -Option_v__ast__ScopeObject v__ast__Scope_find(v__ast__Scope* s, string name); -Option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s, string name, v__ast__Type struct_type, string field_name); -Option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name); -Option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, string name); -Option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string name); +_option_v__ast__ScopeObject v__ast__Scope_find(v__ast__Scope* s, string name); +_option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s, string name, v__ast__Type struct_type, string field_name); +_option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name); +_option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, string name); +_option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string name); bool v__ast__Scope_known_var(v__ast__Scope* s, string name); 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); @@ -9360,29 +9370,29 @@ void v__ast__set_global_table(v__ast__Table* t); string v__ast__Table_fn_type_signature(v__ast__Table* t, v__ast__Fn* f); 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); -Option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name); +_option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name); bool v__ast__Table_known_fn(v__ast__Table* t, string name); void v__ast__Table_mark_module_as_deprecated(v__ast__Table* t, string mname, string message); void v__ast__Table_mark_module_as_deprecated_after(v__ast__Table* t, string mname, string after_date); void v__ast__Table_register_fn(v__ast__Table* t, v__ast__Fn new_fn); void v__ast__Table_register_interface(v__ast__Table* t, v__ast__InterfaceDecl idecl); 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); +_option_v__ast__Fn v__ast__Table_register_aggregate_method(v__ast__Table* t, v__ast__TypeSymbol* sym, string name); bool v__ast__Table_has_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name); -Option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name); +_option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name); Array_Array_v__ast__Type v__ast__Table_get_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, v__ast__GetEmbedsOptions options); -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); -Option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name); +_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); +_option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name); Array_v__ast__Fn v__ast__Table_get_embed_methods(v__ast__Table* t, v__ast__TypeSymbol* sym); -VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Table_register_aggregate_field(v__ast__Table* t, v__ast__TypeSymbol* sym, string name); +VV_LOCAL_SYMBOL _option_v__ast__StructField v__ast__Table_register_aggregate_field(v__ast__Table* t, v__ast__TypeSymbol* sym, string name); bool v__ast__Table_struct_has_field(v__ast__Table* t, v__ast__TypeSymbol* struct_, string name); Array_v__ast__StructField v__ast__Table_struct_fields(v__ast__Table* t, v__ast__TypeSymbol* sym); -Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__TypeSymbol* s, string name); -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); -Option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name); +_option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__TypeSymbol* s, string name); +_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); +_option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name); void v__ast__Table_resolve_common_sumtype_fields(v__ast__Table* t, v__ast__TypeSymbol* sym_); int v__ast__Table_find_type_idx(v__ast__Table* t, string name); -Option_v__ast__TypeSymbol_ptr v__ast__Table_find_sym(v__ast__Table* t, string name); +_option_v__ast__TypeSymbol_ptr v__ast__Table_find_sym(v__ast__Table* t, string name); multi_return_ref_v__ast__TypeSymbol_int v__ast__Table_find_sym_and_type_idx(v__ast__Table* t, string name); v__ast__TypeSymbol* _const_v__ast__invalid_type_symbol; // inited later v__ast__TypeSymbol* v__ast__Table_sym_by_idx(v__ast__Table* t, int idx); @@ -9433,7 +9443,7 @@ bool v__ast__Table_has_deep_child_no_ref(v__ast__Table* t, v__ast__TypeSymbol* t void v__ast__Table_complete_interface_check(v__ast__Table* t); v__ast__Type v__ast__Table_bitsize_to_type(v__ast__Table* t, int bit_size); bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type typ, v__ast__Type inter_typ); -Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, v__ast__Type generic_type, Array_string generic_names, Array_v__ast__Type concrete_types); +_option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, v__ast__Type generic_type, Array_string generic_names, Array_v__ast__Type concrete_types); v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type typ, Array_string generic_names, Array_v__ast__Type concrete_types); void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Array_v__ast__Type generic_types); void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t); @@ -9593,29 +9603,29 @@ string v__ast__TypeSymbol_symbol_name_except_generic(v__ast__TypeSymbol* t); string v__ast__TypeSymbol_embed_name(v__ast__TypeSymbol* t); bool v__ast__TypeSymbol_has_method(v__ast__TypeSymbol* t, string name); bool v__ast__TypeSymbol_has_method_with_generic_parent(v__ast__TypeSymbol* t, string name); -Option_v__ast__Fn v__ast__TypeSymbol_find_method(v__ast__TypeSymbol* t, string name); -Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__TypeSymbol* t, string name); +_option_v__ast__Fn v__ast__TypeSymbol_find_method(v__ast__TypeSymbol* t, string name); +_option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__TypeSymbol* t, string name); bool v__ast__TypeSymbol_is_js_compatible(v__ast__TypeSymbol* t); multi_return_bool_bool_int v__ast__TypeSymbol_str_method_info(v__ast__TypeSymbol* t); -Option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name); -VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Aggregate_find_field(v__ast__Aggregate* a, string name); -Option_v__ast__StructField v__ast__Interface_find_field(v__ast__Interface* i, string name); -Option_v__ast__Fn v__ast__Interface_find_method(v__ast__Interface* i, string name); +_option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name); +VV_LOCAL_SYMBOL _option_v__ast__StructField v__ast__Aggregate_find_field(v__ast__Aggregate* a, string name); +_option_v__ast__StructField v__ast__Interface_find_field(v__ast__Interface* i, string name); +_option_v__ast__Fn v__ast__Interface_find_method(v__ast__Interface* i, string name); bool v__ast__Interface_has_method(v__ast__Interface* i, string name); -Option_v__ast__StructField v__ast__Struct_find_field(v__ast__Struct* s, string name); +_option_v__ast__StructField v__ast__Struct_find_field(v__ast__Struct* s, string name); v__ast__StructField v__ast__Struct_get_field(v__ast__Struct* s, string name); -Option_v__ast__StructField v__ast__SumType_find_field(v__ast__SumType* s, string name); +_option_v__ast__StructField v__ast__SumType_find_field(v__ast__SumType* s, string name); bool v__ast__Interface_defines_method(v__ast__Interface* i, string name); void v__checker__Checker_assign_stmt(v__checker__Checker* c, v__ast__AssignStmt* node); bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); -Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg); +_option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg); VV_LOCAL_SYMBOL bool v__checker__Checker_check_same_module(v__checker__Checker _v_toheap_c, v__ast__Type got, v__ast__Type expected); bool v__checker__Checker_check_basic(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); bool v__checker__Checker_check_matching_function_symbols(v__checker__Checker* c, v__ast__TypeSymbol* got_type_sym, v__ast__TypeSymbol* exp_type_sym); 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); v__ast__Type v__checker__Checker_promote(v__checker__Checker* c, v__ast__Type left_type, v__ast__Type right_type); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_promote_num(v__checker__Checker* c, v__ast__Type left_type, v__ast__Type right_type); -Option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); +_option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); VV_LOCAL_SYMBOL string v__checker__Checker_expected_msg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); bool v__checker__Checker_symmetric_check(v__checker__Checker* c, v__ast__Type left, v__ast__Type right); void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__Fn func, v__ast__CallExpr* node); @@ -9684,9 +9694,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast(v__checker__Checker* c, v__as v__ast__Type v__checker__Checker_select_expr(v__checker__Checker* c, v__ast__SelectExpr* node); v__ast__Type v__checker__Checker_lock_expr(v__checker__Checker* c, v__ast__LockExpr* node); v__ast__Type v__checker__Checker_unsafe_expr(v__checker__Checker* c, v__ast__UnsafeExpr* node); -VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_definition(v__checker__Checker* c, v__ast__Ident ident); -VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_obj_definition(v__checker__Checker* c, v__ast__ScopeObject obj); -VV_LOCAL_SYMBOL Option_bool v__checker__Checker_has_return(v__checker__Checker* c, Array_v__ast__Stmt stmts); +VV_LOCAL_SYMBOL _option_v__ast__Expr v__checker__Checker_find_definition(v__checker__Checker* c, v__ast__Ident ident); +VV_LOCAL_SYMBOL _option_v__ast__Expr v__checker__Checker_find_obj_definition(v__checker__Checker* c, v__ast__ScopeObject obj); +VV_LOCAL_SYMBOL _option_bool v__checker__Checker_has_return(v__checker__Checker* c, Array_v__ast__Stmt stmts); v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__PostfixExpr* node); void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr* node, bool as_interface); string v__checker__Checker_get_base_name(v__checker__Checker* c, v__ast__Expr* node); @@ -9706,12 +9716,12 @@ VV_LOCAL_SYMBOL void v__checker__Checker_warn_or_error(v__checker__Checker* c, s VV_LOCAL_SYMBOL bool v__checker__Checker_fileis(v__checker__Checker* c, string s); VV_LOCAL_SYMBOL string v__checker__Checker_fetch_field_name(v__checker__Checker* c, v__ast__StructField field); VV_LOCAL_SYMBOL void v__checker__Checker_trace(v__checker__Checker* c, string fbase, string message); -VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__Checker* c, v__ast__Type typ, v__token__Pos pos); +VV_LOCAL_SYMBOL _option_void v__checker__Checker_ensure_type_exists(v__checker__Checker* c, v__ast__Type typ, v__token__Pos pos); void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr expr, v__ast__Type typ, string what); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Checker* c, v__ast__ComptimeCall* node); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_selector(v__checker__Checker* c, v__ast__ComptimeSelector* node); VV_LOCAL_SYMBOL void v__checker__Checker_comptime_for(v__checker__Checker* c, v__ast__ComptimeFor node); -VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comptime_const_expr(v__checker__Checker* c, v__ast__Expr expr, int nlevel); +VV_LOCAL_SYMBOL _option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comptime_const_expr(v__checker__Checker* c, v__ast__Expr expr, int nlevel); VV_LOCAL_SYMBOL multi_return_bool_int_int v__checker__Checker_verify_vweb_params_for_method(v__checker__Checker* c, v__ast__Fn node); VV_LOCAL_SYMBOL void v__checker__Checker_verify_all_vweb_routes(v__checker__Checker* c); VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__checker__Checker* c, v__ast__Attr* node); @@ -9731,7 +9741,7 @@ 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); VV_LOCAL_SYMBOL string v__checker__semicolonize(string main, string details); VV_LOCAL_SYMBOL void v__checker__Checker_post_process_generic_fns(v__checker__Checker* c); -Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Fn* f); +_option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Fn* f); 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); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Type left_type, v__ast__TypeSymbol left_sym); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Type left_type, v__ast__TypeSymbol left_sym); @@ -9836,7 +9846,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__CallExpr node); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__AssertStmt original_assert_statement); IError _const_v__gen__c__unsupported_ctemp_assert_transform; // inited later -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); +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); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_postfailure_mode(v__gen__c__Gen* g, v__ast__AssertStmt node); VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ast__AssertStmt node); 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); @@ -9892,6 +9902,7 @@ 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 +string _const_v__gen__c__option_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); @@ -9973,6 +9984,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_char_literal(v__gen__c__Gen* g, v__ast__Char VV_LOCAL_SYMBOL void v__gen__c__Gen_type_name(v__gen__c__Gen* g, v__ast__Type raw_type); VV_LOCAL_SYMBOL void v__gen__c__Gen_typeof_expr(v__gen__c__Gen* g, v__ast__TypeOf node); VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__SelectorExpr node); +VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_decl(v__gen__c__Gen* g, v__ast__EnumDecl node); VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_expr(v__gen__c__Gen* g, v__ast__Expr node); VV_LOCAL_SYMBOL void v__gen__c__Gen_lock_expr(v__gen__c__Gen* g, v__ast__LockExpr node); VV_LOCAL_SYMBOL void v__gen__c__Gen_unlock_locks(v__gen__c__Gen* g); @@ -10052,7 +10064,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_at(v__gen__c__Gen* g, v__ast__AtExp VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_if(v__gen__c__Gen* g, v__ast__IfExpr node); VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__Expr cond, bool pkg_exist); VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__ComptimeFor node); -VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen* g, string name, bool is_comptime_optional); +VV_LOCAL_SYMBOL _option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen* g, string name, bool is_comptime_optional); VV_LOCAL_SYMBOL v__ast__CTempVar v__gen__c__Gen_new_ctemp_var(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type expr_type); VV_LOCAL_SYMBOL v__ast__CTempVar v__gen__c__Gen_new_ctemp_var_then_gen(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type expr_type); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_ctemp_var(v__gen__c__Gen* g, v__ast__CTempVar tvar); @@ -10066,7 +10078,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_data(v__gen__c__Gen* g); VV_LOCAL_SYMBOL bool v__gen__c__Gen_is_used_by_main(v__gen__c__Gen* g, v__ast__FnDecl node); VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_decl(v__gen__c__Gen* g, v__ast__FnDecl node); 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); +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 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); @@ -10176,9 +10188,8 @@ rune _const_v__scanner__num_sep = '_'; // precomputed #define _const_v__scanner__b_lf 10 #define _const_v__scanner__b_cr 13 #define _const_v__scanner__backslash '\\' -Option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref); +_option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref); v__scanner__Scanner* v__scanner__new_scanner(string text, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref); -VV_LOCAL_SYMBOL void v__scanner__Scanner_init_scanner(v__scanner__Scanner* s); void v__scanner__Scanner_free(v__scanner__Scanner* s); VV_LOCAL_SYMBOL bool v__scanner__Scanner_should_parse_comment(v__scanner__Scanner* s); void v__scanner__Scanner_set_is_inside_toplevel_statement(v__scanner__Scanner* s, bool newstate); @@ -10195,10 +10206,9 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_dec_number(v__scanner__Scanner* VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_number(v__scanner__Scanner* s); VV_LOCAL_SYMBOL void v__scanner__Scanner_skip_whitespace(v__scanner__Scanner* s); VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_end_of_file(v__scanner__Scanner* s); -void v__scanner__Scanner_scan_all_tokens_in_buffer(v__scanner__Scanner* s, v__scanner__CommentsMode mode); +void v__scanner__Scanner_scan_all_tokens_in_buffer(v__scanner__Scanner* s); void v__scanner__Scanner_scan_remaining_text(v__scanner__Scanner* s); v__token__Token v__scanner__Scanner_scan(v__scanner__Scanner* s); -v__token__Token v__scanner__Scanner_buffer_scan(v__scanner__Scanner* s); v__token__Token v__scanner__Scanner_peek_token(v__scanner__Scanner* s, int n); VV_LOCAL_SYMBOL u8 v__scanner__Scanner_look_ahead(v__scanner__Scanner* s, int n); VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_text_scan(v__scanner__Scanner* s); @@ -10223,12 +10233,12 @@ void v__scanner__Scanner_warn(v__scanner__Scanner* s, string msg); void v__scanner__Scanner_error(v__scanner__Scanner* s, string msg); VV_LOCAL_SYMBOL void v__scanner__Scanner_vet_error(v__scanner__Scanner* s, string msg, v__vet__FixKind fix); VV_LOCAL_SYMBOL void v__scanner__Scanner_trace(v__scanner__Scanner* s, string fbase, string message); -Option_void v__ast__walker__Inspector_visit(v__ast__walker__Inspector* i, v__ast__Node* node); +_option_void v__ast__walker__Inspector_visit(v__ast__walker__Inspector* i, v__ast__Node* node); void v__ast__walker__inspect(v__ast__Node* node, voidptr data, bool (*inspector_callback)(v__ast__Node* node, voidptr data)); void v__ast__walker__walk(v__ast__walker__Visitor* visitor, v__ast__Node* node); VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_assign_stmt(v__parser__Parser* p); #define _const_v__parser__max_expr_level 100 -VV_LOCAL_SYMBOL Option_void v__parser__Parser_check_undefined_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val); +VV_LOCAL_SYMBOL _option_void v__parser__Parser_check_undefined_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val); VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val); VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Parser* p, Array_v__ast__Expr left, Array_v__ast__Comment left_comments); Array_string _const_v__parser__supported_comptime_calls; // inited later @@ -10243,7 +10253,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser VV_LOCAL_SYMBOL v__ast__MapInit v__parser__Parser_map_init(v__parser__Parser* p); VV_LOCAL_SYMBOL void v__parser__Parser_scope_register_it_as_index(v__parser__Parser* p); v__ast__Expr v__parser__Parser_expr(v__parser__Parser* p, int precedence); -Option_v__ast__Expr v__parser__Parser_check_expr(v__parser__Parser* p, int precedence); +_option_v__ast__Expr v__parser__Parser_check_expr(v__parser__Parser* p, int precedence); v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr left, int precedence, bool is_stmt_ident); VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_infix_expr(v__parser__Parser* p, v__ast__Expr left); VV_LOCAL_SYMBOL bool v__parser__Parser_fileis(v__parser__Parser* p, string s); @@ -10252,7 +10262,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_recast_as_pointer(v__parser__Parser* p, v v__ast__CallExpr v__parser__Parser_call_expr(v__parser__Parser* p, v__ast__Language language, string mod); Array_v__ast__CallArg v__parser__Parser_call_args(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p); -VV_LOCAL_SYMBOL Option_void v__parser__Parser_fn_receiver(v__parser__Parser* p, Array_v__ast__Param* params, v__parser__ReceiverParsingInfo* rec); +VV_LOCAL_SYMBOL _option_void v__parser__Parser_fn_receiver(v__parser__Parser* p, Array_v__ast__Param* params, v__parser__ReceiverParsingInfo* rec); VV_LOCAL_SYMBOL v__ast__AnonFn v__parser__Parser_anon_fn(v__parser__Parser* p); VV_LOCAL_SYMBOL multi_return_Array_v__ast__Param_bool_bool v__parser__Parser_fn_args(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__GoExpr v__parser__Parser_go_expr(v__parser__Parser* p); @@ -10384,7 +10394,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_trace(v__parser__Parser* p, string fbase, VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_sql_expr(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__SqlStmt v__parser__Parser_sql_stmt(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__parser__Parser* p); -VV_LOCAL_SYMBOL Option_bool v__parser__Parser_check_sql_keyword(v__parser__Parser* p, string name); +VV_LOCAL_SYMBOL _option_bool v__parser__Parser_check_sql_keyword(v__parser__Parser* p, string name); VV_LOCAL_SYMBOL v__ast__StructDecl v__parser__Parser_struct_decl(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__StructInit v__parser__Parser_struct_init(v__parser__Parser* p, string typ_str, bool short_syntax); VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser__Parser* p); @@ -10397,11 +10407,11 @@ void v__callgraph__show(v__ast__Table* table, v__pref__Preferences* pref, Array_ VV_LOCAL_SYMBOL string v__callgraph__Mapper_dot_normalise_node_name(v__callgraph__Mapper* m, string name); VV_LOCAL_SYMBOL string v__callgraph__Mapper_fn_name(v__callgraph__Mapper* m, string fname, v__ast__Type receiver_type, bool is_method); VV_LOCAL_SYMBOL string v__callgraph__Mapper_dot_fn_name(v__callgraph__Mapper* m, string fname, v__ast__Type recv_type, bool is_method); -VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node); +VV_LOCAL_SYMBOL _option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node); v__builder__Builder v__builder__new_builder(v__pref__Preferences* pref); -Option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_string v_files); -Option_void v__builder__Builder_middle_stages(v__builder__Builder* b); -Option_void v__builder__Builder_front_and_middle_stages(v__builder__Builder* b, Array_string v_files); +_option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_string v_files); +_option_void v__builder__Builder_middle_stages(v__builder__Builder* b); +_option_void v__builder__Builder_front_and_middle_stages(v__builder__Builder* b, Array_string v_files); void v__builder__Builder_parse_imports(v__builder__Builder* b); void v__builder__Builder_resolve_deps(v__builder__Builder* b); v__depgraph__DepGraph* v__builder__Builder_import_graph(v__builder__Builder* b); @@ -10409,7 +10419,7 @@ Array_string v__builder__Builder_v_files_from_dir(v__builder__Builder* b, string void v__builder__Builder_log(v__builder__Builder* b, string s); void v__builder__Builder_info(v__builder__Builder* b, string s); string v__builder__module_path(string mod); -Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, string mod, string fpath); +_option_string v__builder__Builder_find_module_path(v__builder__Builder* b, string mod, string fpath); void v__builder__Builder_show_total_warns_and_errors_stats(v__builder__Builder* b); void v__builder__Builder_print_warnings_and_errors(v__builder__Builder* b); v__errors__Error v__builder__Builder_error_with_pos(v__builder__Builder* b, string s, string fpath, v__token__Pos pos); @@ -10417,7 +10427,7 @@ void v__builder__verror(string s); string _const_v__builder__c_verror_message_marker; // a string literal, inited later string _const_v__builder__c_error_info; // a string literal, inited later string _const_v__builder__no_compiler_error; // a string literal, inited later -Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v); +_option_void v__builder__Builder_find_win_cc(v__builder__Builder* v); VV_LOCAL_SYMBOL void v__builder__Builder_show_c_compiler_output(v__builder__Builder* v, os__Result res); VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__builder__Builder* v, os__Result res); VV_LOCAL_SYMBOL void v__builder__Builder_show_cc(v__builder__Builder* v, string cmd, string response_file, string response_file_content); @@ -10451,15 +10461,15 @@ v__builder__RegKey _const_v__builder__hkey_local_machine; // inited later #define _const_v__builder__key_query_value 1 #define _const_v__builder__key_wow64_32key 512 #define _const_v__builder__key_enumerate_sub_keys 8 -VV_LOCAL_SYMBOL Option_string v__builder__find_windows_kit_internal(v__builder__RegKey key, Array_string versions); -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root(string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_reg(string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__new_windows_kit(string kit_root, string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_env(string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs(string vswhere_dir, string host_arch, string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(string vswhere_dir, string host_arch, string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_env(string host_arch, string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__MsvcResult v__builder__find_msvc(bool m64_target); +VV_LOCAL_SYMBOL _option_string v__builder__find_windows_kit_internal(v__builder__RegKey key, Array_string versions); +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root(string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_reg(string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__new_windows_kit(string kit_root, string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_env(string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs(string vswhere_dir, string host_arch, string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs_by_reg(string vswhere_dir, string host_arch, string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs_by_env(string host_arch, string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__MsvcResult v__builder__find_msvc(bool m64_target); void v__builder__Builder_cc_msvc(v__builder__Builder* v); VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file_with_msvc(v__builder__Builder* v, string path, Array_v__cflag__CFlag moduleflags); v__builder__MsvcStringFlags v__builder__msvc_string_flags(Array_v__cflag__CFlag cflags); @@ -10972,7 +10982,7 @@ const int _v__ast__walker__Visitor_v__callgraph__Mapper_index = 1; // Methods wrapper for interface "v__ast__walker__Visitor" struct _v__ast__walker__Visitor_interface_methods { - Option_void (*_method_visit)(void* _, v__ast__Node* node); + _option_void (*_method_visit)(void* _, v__ast__Node* node); }; struct _v__ast__walker__Visitor_interface_methods v__ast__walker__Visitor_name_table[2] = { @@ -11094,6 +11104,7 @@ void vinit_string_literals(void){ _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__option_name = _SLIT("_option"); _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"); @@ -11586,59 +11597,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 430: return str_intp(2, _MOV((StrIntpData[]){ + case 431: 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 432: return str_intp(2, _MOV((StrIntpData[]){ + case 433: 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 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__Array_str(*(v__ast__Array*)x._v__ast__Array, 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__ArrayFixed_str(*(v__ast__ArrayFixed*)x._v__ast__ArrayFixed, 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__Chan_str(*(v__ast__Chan*)x._v__ast__Chan, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 446: return str_intp(2, _MOV((StrIntpData[]){ + case 447: 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 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__FnType_str(*(v__ast__FnType*)x._v__ast__FnType, 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__GenericInst_str(*(v__ast__GenericInst*)x._v__ast__GenericInst, 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__Interface_str(*(v__ast__Interface*)x._v__ast__Interface, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 413: return str_intp(2, _MOV((StrIntpData[]){ + case 414: 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 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__MultiReturn_str(*(v__ast__MultiReturn*)x._v__ast__MultiReturn, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 417: return str_intp(2, _MOV((StrIntpData[]){ + case 418: 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 436: return str_intp(2, _MOV((StrIntpData[]){ + case 437: 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 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__Thread_str(*(v__ast__Thread*)x._v__ast__Thread, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); @@ -11749,7 +11760,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 263: return str_intp(2, _MOV((StrIntpData[]){ + case 264: 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 }} })); @@ -12222,212 +12233,212 @@ static string indent_v__ast__StructField_str(v__ast__StructField it, int indent_ 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 = 263}; + return (v__ast__Expr){ ._v__ast__EmptyExpr = ptr, ._typ = 264}; } 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 = 305, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EmptyStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__EmptyStmt = ptr, ._typ = 306, .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 = 328}; + return (v__ast__Node){ ._v__ast__EmptyNode = ptr, ._typ = 329}; } 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 = 296}; + return (v__ast__Node){ ._v__ast__Expr = ptr, ._typ = 297}; } 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 = 321}; + return (v__ast__Node){ ._v__ast__Stmt = ptr, ._typ = 322}; } 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 = 335}; + return (v__ast__Node){ ._v__ast__StructInitField = ptr, ._typ = 336}; } 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 = 184, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__FnDecl = ptr, ._typ = 185, .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 = 327}; + return (v__ast__Node){ ._v__ast__CallArg = ptr, ._typ = 328}; } 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 = 281}; + return (v__ast__Expr){ ._v__ast__OrExpr = ptr, ._typ = 282}; } 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 = 330}; + return (v__ast__Node){ ._v__ast__IfBranch = ptr, ._typ = 331}; } 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 = 331}; + return (v__ast__Node){ ._v__ast__MatchBranch = ptr, ._typ = 332}; } 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 = 333}; + return (v__ast__Node){ ._v__ast__SelectBranch = ptr, ._typ = 334}; } 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 = 334}; + return (v__ast__Node){ ._v__ast__StructField = ptr, ._typ = 335}; } 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 = 324}; + return (v__ast__Node){ ._v__ast__GlobalField = ptr, ._typ = 325}; } 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 = 323}; + return (v__ast__Node){ ._v__ast__ConstField = ptr, ._typ = 324}; } 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 = 329}; + return (v__ast__Node){ ._v__ast__EnumField = ptr, ._typ = 330}; } 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 = 332}; + return (v__ast__Node){ ._v__ast__Param = ptr, ._typ = 333}; } 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 = 293}; + return (v__ast__Expr){ ._v__ast__TypeNode = ptr, ._typ = 294}; } 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 = 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))}; + return (v__ast__ScopeObject){ ._v__ast__AsmRegister = ptr, ._typ = 323, .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 = 263}; + return (v__ast__ComptTimeConstValue){ ._v__ast__EmptyExpr = ptr, ._typ = 264}; } 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 = 247}; + return (v__ast__Expr){ ._v__ast__ArrayInit = ptr, ._typ = 248}; } 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 = 291}; + return (v__ast__Expr){ ._v__ast__StringLiteral = ptr, ._typ = 292}; } 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 = 276}; + return (v__ast__Expr){ ._v__ast__MapInit = ptr, ._typ = 277}; } 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 = 292}; + return (v__ast__Expr){ ._v__ast__StructInit = ptr, ._typ = 293}; } 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 = 436}; + return (v__ast__TypeInfo){ ._v__ast__SumType = ptr, ._typ = 437}; } 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 = 441}; + return (v__ast__TypeInfo){ ._v__ast__Chan = ptr, ._typ = 442}; } 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 = 413}; + return (v__ast__TypeInfo){ ._v__ast__Map = ptr, ._typ = 414}; } 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 = 442}; + return (v__ast__TypeInfo){ ._v__ast__Thread = ptr, ._typ = 443}; } 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 = 417}; + return (v__ast__TypeInfo){ ._v__ast__Struct = ptr, ._typ = 418}; } 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 = 412}; + return (v__ast__TypeInfo){ ._v__ast__Array = ptr, ._typ = 413}; } 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 = 440}; + return (v__ast__TypeInfo){ ._v__ast__ArrayFixed = ptr, ._typ = 441}; } 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 = 443}; + return (v__ast__TypeInfo){ ._v__ast__MultiReturn = ptr, ._typ = 444}; } 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 = 444}; + return (v__ast__TypeInfo){ ._v__ast__FnType = ptr, ._typ = 445}; } 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 = 279}; + return (v__ast__Expr){ ._v__ast__None = ptr, ._typ = 280}; } 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 = 435}; + return (v__ast__TypeInfo){ ._v__ast__Interface = ptr, ._typ = 436}; } 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 = 377}; + return (v__ast__IdentInfo){ ._v__ast__IdentVar = ptr, ._typ = 378}; } 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 = 271}; + return (v__ast__Expr){ ._v__ast__InfixExpr = ptr, ._typ = 272}; } 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 = 254}; + return (v__ast__Expr){ ._v__ast__CastExpr = ptr, ._typ = 255}; } 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 = 322}; + return (v__ast__AsmArg){ ._v__ast__AsmRegister = ptr, ._typ = 323}; } 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 = 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))}; + return (v__ast__ScopeObject){ ._v__ast__Var = ptr, ._typ = 326, .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 = 376}; + return (v__ast__IdentInfo){ ._v__ast__IdentFn = ptr, ._typ = 377}; } 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 = 270}; + return (v__ast__Expr){ ._v__ast__IndexExpr = ptr, ._typ = 271}; } static inline v__ast__ComptTimeConstValue int_to_sumtype_v__ast__ComptTimeConstValue(int* x) { @@ -12492,402 +12503,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 = 318, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Return, pos))}; + return (v__ast__Stmt){ ._v__ast__Return = ptr, ._typ = 319, .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 = 430}; + return (v__ast__TypeInfo){ ._v__ast__Aggregate = ptr, ._typ = 431}; } 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 = 267}; + return (v__ast__Expr){ ._v__ast__Ident = ptr, ._typ = 268}; } 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 = 298, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssertStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AssertStmt = ptr, ._typ = 299, .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 = 268}; + return (v__ast__Expr){ ._v__ast__IfExpr = ptr, ._typ = 269}; } 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 = 251}; + return (v__ast__Expr){ ._v__ast__BoolLiteral = ptr, ._typ = 252}; } 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 = 277}; + return (v__ast__Expr){ ._v__ast__MatchExpr = ptr, ._typ = 278}; } 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 = 308, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForCStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForCStmt = ptr, ._typ = 309, .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 = 310, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForStmt = ptr, ._typ = 311, .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 = 316, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__InterfaceDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__InterfaceDecl = ptr, ._typ = 317, .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 = 253}; + return (v__ast__Expr){ ._v__ast__CallExpr = ptr, ._typ = 254}; } 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 = 272}; + return (v__ast__Expr){ ._v__ast__IntegerLiteral = ptr, ._typ = 273}; } 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 = 265}; + return (v__ast__Expr){ ._v__ast__FloatLiteral = ptr, ._typ = 266}; } 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 = 289}; + return (v__ast__Expr){ ._v__ast__SqlExpr = ptr, ._typ = 290}; } 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 = 252}; + return (v__ast__Expr){ ._v__ast__CTempVar = ptr, ._typ = 253}; } 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 = 287}; + return (v__ast__Expr){ ._v__ast__SelectorExpr = ptr, ._typ = 288}; } 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 = 309, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForInStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForInStmt = ptr, ._typ = 310, .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 = 307, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ExprStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ExprStmt = ptr, ._typ = 308, .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 = 278, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__NodeError, pos))}; + return (v__ast__Stmt){ ._v__ast__NodeError = ptr, ._typ = 279, .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 = 299, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssignStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AssignStmt = ptr, ._typ = 300, .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 = 258}; + return (v__ast__Expr){ ._v__ast__ComptimeCall = ptr, ._typ = 259}; } 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 = 259}; + return (v__ast__Expr){ ._v__ast__ComptimeSelector = ptr, ._typ = 260}; } 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 = 278}; + return (v__ast__Expr){ ._v__ast__NodeError = ptr, ._typ = 279}; } 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 = 257}; + return (v__ast__Expr){ ._v__ast__Comment = ptr, ._typ = 258}; } 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 = 264}; + return (v__ast__Expr){ ._v__ast__EnumVal = ptr, ._typ = 265}; } 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 = 250}; + return (v__ast__Expr){ ._v__ast__AtExpr = ptr, ._typ = 251}; } 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 = 260}; + return (v__ast__Expr){ ._v__ast__ComptimeType = ptr, ._typ = 261}; } 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 = 256}; + return (v__ast__Expr){ ._v__ast__CharLiteral = ptr, ._typ = 257}; } 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 = 266}; + return (v__ast__Expr){ ._v__ast__GoExpr = ptr, ._typ = 267}; } 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 = 286}; + return (v__ast__Expr){ ._v__ast__SelectExpr = ptr, ._typ = 287}; } 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 = 282}; + return (v__ast__Expr){ ._v__ast__ParExpr = ptr, ._typ = 283}; } 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 = 295}; + return (v__ast__Expr){ ._v__ast__UnsafeExpr = ptr, ._typ = 296}; } 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 = 275}; + return (v__ast__Expr){ ._v__ast__LockExpr = ptr, ._typ = 276}; } 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 = 273}; + return (v__ast__Expr){ ._v__ast__IsRefType = ptr, ._typ = 274}; } 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 = 288}; + return (v__ast__Expr){ ._v__ast__SizeOf = ptr, ._typ = 289}; } 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 = 294}; + return (v__ast__Expr){ ._v__ast__TypeOf = ptr, ._typ = 295}; } 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 = 262}; + return (v__ast__Expr){ ._v__ast__DumpExpr = ptr, ._typ = 263}; } 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 = 280}; + return (v__ast__Expr){ ._v__ast__OffsetOf = ptr, ._typ = 281}; } 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 = 274}; + return (v__ast__Expr){ ._v__ast__Likely = ptr, ._typ = 275}; } 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 = 245}; + return (v__ast__Expr){ ._v__ast__AnonFn = ptr, ._typ = 246}; } 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 = 248}; + return (v__ast__Expr){ ._v__ast__AsCast = ptr, ._typ = 249}; } 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 = 283}; + return (v__ast__Expr){ ._v__ast__PostfixExpr = ptr, ._typ = 284}; } 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 = 284}; + return (v__ast__Expr){ ._v__ast__PrefixExpr = ptr, ._typ = 285}; } 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 = 246}; + return (v__ast__Expr){ ._v__ast__ArrayDecompose = ptr, ._typ = 247}; } 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 = 269}; + return (v__ast__Expr){ ._v__ast__IfGuardExpr = ptr, ._typ = 270}; } 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 = 285}; + return (v__ast__Expr){ ._v__ast__RangeExpr = ptr, ._typ = 286}; } 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 = 445}; + return (v__ast__TypeInfo){ ._v__ast__GenericInst = ptr, ._typ = 446}; } 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 = 317, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Module, pos))}; + return (v__ast__Stmt){ ._v__ast__Module = ptr, ._typ = 318, .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 = 315, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Import, pos))}; + return (v__ast__Stmt){ ._v__ast__Import = ptr, ._typ = 316, .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 = 303, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__ConstDecl = ptr, ._typ = 304, .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 = 320, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__StructDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__StructDecl = ptr, ._typ = 321, .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 = 306, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EnumDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__EnumDecl = ptr, ._typ = 307, .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 = 244, .pos = ptr->pos}; + return (v__ast__Stmt){ ._v__ast__TypeDecl = ptr, ._typ = 245, .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 = 297, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AsmStmt = ptr, ._typ = 298, .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 = 311, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__GlobalDecl = ptr, ._typ = 312, .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 = 314, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__HashStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__HashStmt = ptr, ._typ = 315, .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 = 300, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Block, pos))}; + return (v__ast__Stmt){ ._v__ast__Block = ptr, ._typ = 301, .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 = 319, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SqlStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__SqlStmt = ptr, ._typ = 320, .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 = 312, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoLabel, pos))}; + return (v__ast__Stmt){ ._v__ast__GotoLabel = ptr, ._typ = 313, .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 = 302, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ComptimeFor, pos))}; + return (v__ast__Stmt){ ._v__ast__ComptimeFor = ptr, ._typ = 303, .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 = 301, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__BranchStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__BranchStmt = ptr, ._typ = 302, .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 = 304, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__DeferStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__DeferStmt = ptr, ._typ = 305, .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 = 313, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__GotoStmt = ptr, ._typ = 314, .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 = 265}; + return (v__ast__AsmArg){ ._v__ast__FloatLiteral = ptr, ._typ = 266}; } 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 = 399}; + return (v__ast__AsmArg){ ._v__ast__AsmDisp = ptr, ._typ = 400}; } 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 = 272}; + return (v__ast__AsmArg){ ._v__ast__IntegerLiteral = ptr, ._typ = 273}; } 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 = 256}; + return (v__ast__AsmArg){ ._v__ast__CharLiteral = ptr, ._typ = 257}; } 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 = 397}; + return (v__ast__AsmArg){ ._v__ast__AsmAddressing = ptr, ._typ = 398}; } 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 = 398}; + return (v__ast__AsmArg){ ._v__ast__AsmAlias = ptr, ._typ = 399}; } 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 = 261}; + return (v__ast__Expr){ ._v__ast__ConcatExpr = ptr, ._typ = 262}; } 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 = 255}; + return (v__ast__Expr){ ._v__ast__ChanInit = ptr, ._typ = 256}; } 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 = 290}; + return (v__ast__Expr){ ._v__ast__StringInterLiteral = ptr, ._typ = 291}; } 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 = 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))}; + return (v__ast__ScopeObject){ ._v__ast__ConstField = ptr, ._typ = 324, .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 = 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))}; + return (v__ast__ScopeObject){ ._v__ast__GlobalField = ptr, ._typ = 325, .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 = 446}; + return (v__ast__TypeInfo){ ._v__ast__Enum = ptr, ._typ = 447}; } 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 = 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))}; + return (v__ast__TypeDecl){ ._v__ast__FnTypeDecl = ptr, ._typ = 243, .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 = 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))}; + return (v__ast__TypeDecl){ ._v__ast__AliasTypeDecl = ptr, ._typ = 242, .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 = 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))}; + return (v__ast__TypeDecl){ ._v__ast__SumTypeDecl = ptr, ._typ = 244, .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 = 432}; + return (v__ast__TypeInfo){ ._v__ast__Alias = ptr, ._typ = 433}; } 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 = 175}; + return (v__ast__Node){ ._v__ast__File = ptr, ._typ = 176}; } static bool Array_string_contains(Array_string a, string v) { @@ -13171,16 +13182,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 65648; - if (sidx == _IError_os__SizeOfTypeIs0Error_index) return 65649; - if (sidx == _IError_os__ExecutableNotFoundError_index) return 65662; - if (sidx == _IError_flag__UnkownFlagError_index) return 66097; - if (sidx == _IError_flag__ArgsCountError_index) return 66098; - if (sidx == _IError_semver__InvalidComparatorFormatError_index) return 66108; - if (sidx == _IError_semver__EmptyInputError_index) return 66110; - if (sidx == _IError_semver__InvalidVersionFormatError_index) return 66111; - if (sidx == _IError_time__TimeParseError_index) return 221; - if (sidx == _IError_v__gen__c__UnsupportedAssertCtempTransform_index) return 500; + if (sidx == _IError_os__FileNotOpenedError_index) return 65649; + if (sidx == _IError_os__SizeOfTypeIs0Error_index) return 65650; + if (sidx == _IError_os__ExecutableNotFoundError_index) return 65663; + if (sidx == _IError_flag__UnkownFlagError_index) return 66098; + if (sidx == _IError_flag__ArgsCountError_index) return 66099; + if (sidx == _IError_semver__InvalidComparatorFormatError_index) return 66109; + if (sidx == _IError_semver__EmptyInputError_index) return 66111; + if (sidx == _IError_semver__InvalidVersionFormatError_index) return 66112; + if (sidx == _IError_time__TimeParseError_index) return 222; + if (sidx == _IError_v__gen__c__UnsupportedAssertCtempTransform_index) return 501; return 29; } static char * v_typeof_interface_rand__PRNG(int sidx) { /* rand.PRNG */ @@ -13189,90 +13200,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 65737; - return 197; + if (sidx == _rand__PRNG_rand__wyrand__WyRandRNG_index) return 65738; + return 198; } static char * v_typeof_sumtype_v__ast__TypeDecl(int sidx) { /* v.ast.TypeDecl */ switch(sidx) { - case 244: return "v.ast.TypeDecl"; - case 241: return "v.ast.AliasTypeDecl"; - case 242: return "v.ast.FnTypeDecl"; - case 243: return "v.ast.SumTypeDecl"; + case 245: return "v.ast.TypeDecl"; + case 242: return "v.ast.AliasTypeDecl"; + case 243: return "v.ast.FnTypeDecl"; + case 244: 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 244: return 244; - case 241: return 241; + case 245: return 245; case 242: return 242; case 243: return 243; - default: return 244; + case 244: return 244; + default: return 245; } } static char * v_typeof_sumtype_v__ast__Expr(int sidx) { /* v.ast.Expr */ switch(sidx) { - 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"; + case 297: return "v.ast.Expr"; + case 246: return "v.ast.AnonFn"; + case 247: return "v.ast.ArrayDecompose"; + case 248: return "v.ast.ArrayInit"; + case 249: return "v.ast.AsCast"; + case 250: return "v.ast.Assoc"; + case 251: return "v.ast.AtExpr"; + case 252: return "v.ast.BoolLiteral"; + case 253: return "v.ast.CTempVar"; + case 254: return "v.ast.CallExpr"; + case 255: return "v.ast.CastExpr"; + case 256: return "v.ast.ChanInit"; + case 257: return "v.ast.CharLiteral"; + case 258: return "v.ast.Comment"; + case 259: return "v.ast.ComptimeCall"; + case 260: return "v.ast.ComptimeSelector"; + case 261: return "v.ast.ComptimeType"; + case 262: return "v.ast.ConcatExpr"; + case 263: return "v.ast.DumpExpr"; + case 264: return "v.ast.EmptyExpr"; + case 265: return "v.ast.EnumVal"; + case 266: return "v.ast.FloatLiteral"; + case 267: return "v.ast.GoExpr"; + case 268: return "v.ast.Ident"; + case 269: return "v.ast.IfExpr"; + case 270: return "v.ast.IfGuardExpr"; + case 271: return "v.ast.IndexExpr"; + case 272: return "v.ast.InfixExpr"; + case 273: return "v.ast.IntegerLiteral"; + case 274: return "v.ast.IsRefType"; + case 275: return "v.ast.Likely"; + case 276: return "v.ast.LockExpr"; + case 277: return "v.ast.MapInit"; + case 278: return "v.ast.MatchExpr"; + case 279: return "v.ast.NodeError"; + case 280: return "v.ast.None"; + case 281: return "v.ast.OffsetOf"; + case 282: return "v.ast.OrExpr"; + case 283: return "v.ast.ParExpr"; + case 284: return "v.ast.PostfixExpr"; + case 285: return "v.ast.PrefixExpr"; + case 286: return "v.ast.RangeExpr"; + case 287: return "v.ast.SelectExpr"; + case 288: return "v.ast.SelectorExpr"; + case 289: return "v.ast.SizeOf"; + case 290: return "v.ast.SqlExpr"; + case 291: return "v.ast.StringInterLiteral"; + case 292: return "v.ast.StringLiteral"; + case 293: return "v.ast.StructInit"; + case 294: return "v.ast.TypeNode"; + case 295: return "v.ast.TypeOf"; + case 296: 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 296: return 296; - case 245: return 245; + case 297: return 297; case 246: return 246; case 247: return 247; case 248: return 248; @@ -13323,47 +13333,47 @@ static int v_typeof_sumtype_idx_v__ast__Expr(int sidx) { /* v.ast.Expr */ case 293: return 293; case 294: return 294; case 295: return 295; - default: return 296; + case 296: return 296; + default: return 297; } } static char * v_typeof_sumtype_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ switch(sidx) { - 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"; + case 322: return "v.ast.Stmt"; + case 298: return "v.ast.AsmStmt"; + case 299: return "v.ast.AssertStmt"; + case 300: return "v.ast.AssignStmt"; + case 301: return "v.ast.Block"; + case 302: return "v.ast.BranchStmt"; + case 303: return "v.ast.ComptimeFor"; + case 304: return "v.ast.ConstDecl"; + case 305: return "v.ast.DeferStmt"; + case 306: return "v.ast.EmptyStmt"; + case 307: return "v.ast.EnumDecl"; + case 308: return "v.ast.ExprStmt"; + case 185: return "v.ast.FnDecl"; + case 309: return "v.ast.ForCStmt"; + case 310: return "v.ast.ForInStmt"; + case 311: return "v.ast.ForStmt"; + case 312: return "v.ast.GlobalDecl"; + case 313: return "v.ast.GotoLabel"; + case 314: return "v.ast.GotoStmt"; + case 315: return "v.ast.HashStmt"; + case 316: return "v.ast.Import"; + case 317: return "v.ast.InterfaceDecl"; + case 318: return "v.ast.Module"; + case 279: return "v.ast.NodeError"; + case 319: return "v.ast.Return"; + case 320: return "v.ast.SqlStmt"; + case 321: return "v.ast.StructDecl"; + case 245: 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 321: return 321; - case 297: return 297; + case 322: return 322; case 298: return 298; case 299: return 299; case 300: return 300; @@ -13374,8 +13384,8 @@ static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ case 305: return 305; case 306: return 306; case 307: return 307; - case 184: return 184; case 308: return 308; + case 185: return 185; case 309: return 309; case 310: return 310; case 311: return 311; @@ -13385,84 +13395,85 @@ static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ case 315: return 315; case 316: return 316; case 317: return 317; - case 278: return 278; case 318: return 318; + case 279: return 279; case 319: return 319; case 320: return 320; - case 244: return 244; - default: return 321; + case 321: return 321; + case 245: return 245; + default: return 322; } } static char * v_typeof_sumtype_v__ast__ScopeObject(int sidx) { /* v.ast.ScopeObject */ switch(sidx) { - 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"; + case 327: return "v.ast.ScopeObject"; + case 323: return "v.ast.AsmRegister"; + case 324: return "v.ast.ConstField"; + case 325: return "v.ast.GlobalField"; + case 326: 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 326: return 326; - case 322: return 322; + case 327: return 327; case 323: return 323; case 324: return 324; case 325: return 325; - default: return 326; + case 326: return 326; + default: return 327; } } static char * v_typeof_sumtype_v__ast__Node(int sidx) { /* v.ast.Node */ switch(sidx) { - 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"; + case 337: return "v.ast.Node"; + case 328: return "v.ast.CallArg"; + case 324: return "v.ast.ConstField"; + case 329: return "v.ast.EmptyNode"; + case 330: return "v.ast.EnumField"; + case 297: return "v.ast.Expr"; + case 176: return "v.ast.File"; + case 325: return "v.ast.GlobalField"; + case 331: return "v.ast.IfBranch"; + case 332: return "v.ast.MatchBranch"; + case 279: return "v.ast.NodeError"; + case 333: return "v.ast.Param"; + case 327: return "v.ast.ScopeObject"; + case 334: return "v.ast.SelectBranch"; + case 322: return "v.ast.Stmt"; + case 335: return "v.ast.StructField"; + case 336: 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 336: return 336; - case 327: return 327; - case 323: return 323; + case 337: return 337; case 328: return 328; - case 329: return 329; - case 296: return 296; - case 175: return 175; case 324: return 324; + case 329: return 329; case 330: return 330; + case 297: return 297; + case 176: return 176; + case 325: return 325; case 331: return 331; - case 278: return 278; case 332: return 332; - case 326: return 326; + case 279: return 279; case 333: return 333; - case 321: return 321; + case 327: return 327; case 334: return 334; + case 322: return 322; case 335: return 335; - default: return 336; + case 336: return 336; + default: return 337; } } static char * v_typeof_sumtype_v__ast__ComptTimeConstValue(int sidx) { /* v.ast.ComptTimeConstValue */ switch(sidx) { - case 350: return "v.ast.ComptTimeConstValue"; - case 263: return "v.ast.EmptyExpr"; + case 351: return "v.ast.ComptTimeConstValue"; + case 264: return "v.ast.EmptyExpr"; case 15: return "f32"; case 16: return "f64"; case 6: return "i16"; @@ -13481,8 +13492,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 350: return 350; - case 263: return 263; + case 351: return 351; + case 264: return 264; case 15: return 15; case 16: return 16; case 6: return 6; @@ -13495,37 +13506,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 350; + default: return 351; } } static char * v_typeof_sumtype_v__ast__IdentInfo(int sidx) { /* v.ast.IdentInfo */ switch(sidx) { - case 378: return "v.ast.IdentInfo"; - case 376: return "v.ast.IdentFn"; - case 377: return "v.ast.IdentVar"; + case 379: return "v.ast.IdentInfo"; + case 377: return "v.ast.IdentFn"; + case 378: 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 378: return 378; - case 376: return 376; + case 379: return 379; case 377: return 377; - default: return 378; + case 378: return 378; + default: return 379; } } static char * v_typeof_sumtype_v__ast__AsmArg(int sidx) { /* v.ast.AsmArg */ switch(sidx) { - 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 396: return "v.ast.AsmArg"; + case 398: return "v.ast.AsmAddressing"; + case 399: return "v.ast.AsmAlias"; + case 400: return "v.ast.AsmDisp"; + case 323: return "v.ast.AsmRegister"; + case 252: return "v.ast.BoolLiteral"; + case 257: return "v.ast.CharLiteral"; + case 266: return "v.ast.FloatLiteral"; + case 273: return "v.ast.IntegerLiteral"; case 20: return "string"; default: return "unknown v.ast.AsmArg"; } @@ -13533,58 +13544,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 395: return 395; - case 397: return 397; + case 396: return 396; case 398: return 398; 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 400: return 400; + case 323: return 323; + case 252: return 252; + case 257: return 257; + case 266: return 266; + case 273: return 273; case 20: return 20; - default: return 395; + default: return 396; } } static char * v_typeof_sumtype_v__ast__TypeInfo(int sidx) { /* v.ast.TypeInfo */ switch(sidx) { - 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"; + case 448: return "v.ast.TypeInfo"; + case 431: return "v.ast.Aggregate"; + case 433: return "v.ast.Alias"; + case 413: return "v.ast.Array"; + case 441: return "v.ast.ArrayFixed"; + case 442: return "v.ast.Chan"; + case 447: return "v.ast.Enum"; + case 445: return "v.ast.FnType"; + case 446: return "v.ast.GenericInst"; + case 436: return "v.ast.Interface"; + case 414: return "v.ast.Map"; + case 444: return "v.ast.MultiReturn"; + case 418: return "v.ast.Struct"; + case 437: return "v.ast.SumType"; + case 443: 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 447: return 447; - case 430: return 430; - case 432: return 432; - case 412: return 412; - case 440: return 440; - case 441: return 441; - case 446: return 446; - case 444: return 444; - case 445: return 445; - case 435: return 435; + case 448: return 448; + case 431: return 431; + case 433: return 433; case 413: return 413; - case 443: return 443; - case 417: return 417; - case 436: return 436; + case 441: return 441; case 442: return 442; - default: return 447; + case 447: return 447; + case 445: return 445; + case 446: return 446; + case 436: return 436; + case 414: return 414; + case 444: return 444; + case 418: return 418; + case 437: return 437; + case 443: return 443; + default: return 448; } } static char * v_typeof_interface_hash__Hasher(int sidx) { /* hash.Hasher */ @@ -13592,21 +13603,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 495; + return 496; } 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 496; + return 497; } 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 497; + return 498; } 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"; @@ -13615,9 +13626,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 535; - if (sidx == _v__ast__walker__Visitor_v__callgraph__Mapper_index) return 66024; - return 533; + if (sidx == _v__ast__walker__Visitor_v__ast__walker__Inspector_index) return 536; + if (sidx == _v__ast__walker__Visitor_v__callgraph__Mapper_index) return 66025; + return 534; } // << typeof() support for sum types @@ -13627,7 +13638,9 @@ static int v_typeof_interface_idx_v__ast__walker__Visitor(int sidx) { /* v.ast.w // TypeDecl strings__Builder strings__new_builder(int initial_size) { strings__Builder res = ((__new_array_with_default(0, initial_size, sizeof(u8), 0))); - ArrayFlags_set(&res.flags, ArrayFlags__noslices); + { // Unsafe block + res.flags = ArrayFlags__noslices; + } return res; } @@ -13661,10 +13674,8 @@ void strings__Builder_write_runes(strings__Builder* b, Array_rune runes) { } } -// Attr: [deprecated] -// Attr: [deprecated_after] -void strings__Builder_write_b(strings__Builder* b, u8 data) { - array_push((array*)b, _MOV((u8[]){ data })); +void strings__Builder_clear(strings__Builder* b) { + *b = __new_array_with_default(0, b->cap, sizeof(u8), 0); } void strings__Builder_write_u8(strings__Builder* b, u8 data) { @@ -13675,21 +13686,21 @@ void strings__Builder_write_byte(strings__Builder* b, byte data) { array_push((array*)b, _MOV((u8[]){ data })); } -Option_int strings__Builder_write(strings__Builder* b, Array_u8 data) { +_option_int strings__Builder_write(strings__Builder* b, Array_u8 data) { if (data.len == 0) { - Option_int _t1; - opt_ok(&(int[]) { 0 }, (Option*)(&_t1), sizeof(int)); + _option_int _t1; + opt_ok2(&(int[]) { 0 }, (_option*)(&_t1), sizeof(int)); return _t1; } _PUSH_MANY(b, (data), _t2, strings__Builder); - Option_int _t3; - opt_ok(&(int[]) { data.len }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { data.len }, (_option*)(&_t3), sizeof(int)); return _t3; } // Attr: [manualfree] void strings__Builder_drain_builder(strings__Builder* b, strings__Builder* other, int other_new_cap) { - Option_int _t1 = strings__Builder_write(b, *other); + _option_int _t1 = strings__Builder_write(b, *other); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -13704,7 +13715,7 @@ void strings__Builder_drain_builder(strings__Builder* b, strings__Builder* other // Attr: [inline] inline u8 strings__Builder_byte_at(strings__Builder* b, int n) { - return (*(u8*)/*ee elem_sym */array_get(*(((Array_u8*)(b))), n)); + return ((u8*)(b->data))[n]; } // Attr: [inline] @@ -13750,10 +13761,15 @@ void strings__Builder_go_back_to(strings__Builder* b, int pos) { // Attr: [inline] inline void strings__Builder_writeln(strings__Builder* b, string s) { - if (s.len > 0) { - array_push_many(b, s.str, s.len); + int new_len = b->len + s.len + 1; + strings__Builder_ensure_cap(b, new_len); + { // Unsafe block + ((u8*)(b->data))[new_len - 1] = ((u8)('\n')); + if (s.len > 0) { + vmemcpy(((u8*)(b->data)) + b->len, s.str, s.len); + } + b->len = new_len; } - array_push((array*)b, _MOV((u8[]){ ((u8)('\n')) })); } string strings__Builder_last_n(strings__Builder* b, int n) { @@ -13782,12 +13798,10 @@ void strings__Builder_ensure_cap(strings__Builder* b, int n) { if (n <= b->cap) { return; } - u8* new_data = vcalloc(n * b->element_size); - if (b->data != ((voidptr)(0))) { - vmemcpy(new_data, b->data, b->len * b->element_size); - if (ArrayFlags_has(&b->flags, ArrayFlags__noslices)) { - _v_free(b->data); - } + u8* new_data = _v_malloc(((u64)(n)) * ((u64)(b->element_size))); + if (b->data != 0) { + vmemcpy(new_data, b->data, b->len); + _v_free(b->data); } { // Unsafe block b->data = new_data; @@ -14620,9 +14634,9 @@ VV_LOCAL_SYMBOL u64 strconv__converter(strconv__PrepNumber* pn) { return result; } -Option_f64 strconv__atof64(string s) { +_option_f64 strconv__atof64(string s) { if (s.len == 0) { - return (Option_f64){ .state=2, .err=_v_error(_SLIT("expected a number found an empty string")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_v_error(_SLIT("expected a number found an empty string")), .data={EMPTY_STRUCT_INITIALIZATION} }; } strconv__Float64u res = ((strconv__Float64u){0}); multi_return_strconv__ParserState_strconv__PrepNumber mr_9209 = strconv__parser(s); @@ -14656,13 +14670,13 @@ Option_f64 strconv__atof64(string s) { } case strconv__ParserState__invalid_number: { - return (Option_f64){ .state=2, .err=_v_error(_SLIT("not a number")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_v_error(_SLIT("not a number")), .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } ; - Option_f64 _t3; - opt_ok(&(f64[]) { res.f }, (Option*)(&_t3), sizeof(f64)); + _option_f64 _t3; + opt_ok2(&(f64[]) { res.f }, (_option*)(&_t3), sizeof(f64)); return _t3; } @@ -14775,27 +14789,27 @@ u8 strconv__byte_to_lower(u8 c) { return (c | ('x' - 'X')); } -Option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit) { +_option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit) { multi_return_u64_int mr_820 = strconv__common_parse_uint2(s, _base, _bit_size); u64 result = mr_820.arg0; int err = mr_820.arg1; 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 "), /*100 &int*/0xfe07, {.d_i32 = _base}}, {_SLIT(" for "), /*115 &string*/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 "), /*100 &int*/0xfe07, {.d_i32 = _bit_size}}, {_SLIT(" for "), /*115 &string*/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 "), /*115 &string*/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 "), /*115 &string*/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; - opt_ok(&(u64[]) { result }, (Option*)(&_t5), sizeof(u64)); + _option_u64 _t5; + opt_ok2(&(u64[]) { result }, (_option*)(&_t5), sizeof(u64)); return _t5; } @@ -14868,16 +14882,16 @@ multi_return_u64_int strconv__common_parse_uint2(string s, int _base, int _bit_s return (multi_return_u64_int){.arg0=n, .arg1=0}; } -Option_u64 strconv__parse_uint(string s, int _base, int _bit_size) { +_option_u64 strconv__parse_uint(string s, int _base, int _bit_size) { return strconv__common_parse_uint(s, _base, _bit_size, true, true); } -Option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit) { +_option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit) { string s = _s; int bit_size = _bit_size; if (s.len < 1) { - Option_i64 _t1; - opt_ok(&(i64[]) { ((i64)(0)) }, (Option*)(&_t1), sizeof(i64)); + _option_i64 _t1; + opt_ok2(&(i64[]) { ((i64)(0)) }, (_option*)(&_t1), sizeof(i64)); return _t1; } bool neg = false; @@ -14887,17 +14901,17 @@ Option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool er neg = true; s = string_substr(s, 1, (s).len); } - Option_u64 _t2 = strconv__common_parse_uint(s, base, bit_size, error_on_non_digit, error_on_high_digit); + _option_u64 _t2 = strconv__common_parse_uint(s, base, bit_size, error_on_non_digit, error_on_high_digit); if (_t2.state != 0) { /*or block*/ - Option_i64 _t3; + _option_i64 _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } u64 un = (*(u64*)_t2.data); if (un == 0U) { - Option_i64 _t4; - opt_ok(&(i64[]) { ((i64)(0)) }, (Option*)(&_t4), sizeof(i64)); + _option_i64 _t4; + opt_ok2(&(i64[]) { ((i64)(0)) }, (_option*)(&_t4), sizeof(i64)); return _t4; } if (bit_size == 0) { @@ -14905,66 +14919,66 @@ Option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool er } u64 cutoff = ((u64)(1U)) << ((u64)(bit_size - 1)); if (!neg && un >= cutoff) { - Option_i64 _t5; - opt_ok(&(i64[]) { ((i64)(cutoff - ((u64)(1U)))) }, (Option*)(&_t5), sizeof(i64)); + _option_i64 _t5; + opt_ok2(&(i64[]) { ((i64)(cutoff - ((u64)(1U)))) }, (_option*)(&_t5), sizeof(i64)); return _t5; } if (neg && un > cutoff) { - Option_i64 _t6; - opt_ok(&(i64[]) { -((i64)(cutoff)) }, (Option*)(&_t6), sizeof(i64)); + _option_i64 _t6; + opt_ok2(&(i64[]) { -((i64)(cutoff)) }, (_option*)(&_t6), sizeof(i64)); return _t6; } - Option_i64 _t8; /* if prepend */ + _option_i64 _t8; /* if prepend */ if (neg) { - opt_ok(&(i64[]) { -((i64)(un)) }, (Option*)(&_t8), sizeof(i64)); + opt_ok2(&(i64[]) { -((i64)(un)) }, (_option*)(&_t8), sizeof(i64)); } else { - opt_ok(&(i64[]) { ((i64)(un)) }, (Option*)(&_t8), sizeof(i64)); + opt_ok2(&(i64[]) { ((i64)(un)) }, (_option*)(&_t8), sizeof(i64)); } return _t8; } -Option_i64 strconv__parse_int(string _s, int base, int _bit_size) { +_option_i64 strconv__parse_int(string _s, int base, int _bit_size) { return strconv__common_parse_int(_s, base, _bit_size, true, true); } -Option_int strconv__atoi(string s) { +_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 \""), /*115 &string*/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 \""), /*115 &string*/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 \""), /*115 &string*/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)); } - Option_int _t5; /* if prepend */ + _option_int _t5; /* if prepend */ if (string_at(s, 0) == '-') { - opt_ok(&(int[]) { -n }, (Option*)(&_t5), sizeof(int)); + opt_ok2(&(int[]) { -n }, (_option*)(&_t5), sizeof(int)); } else { - opt_ok(&(int[]) { n }, (Option*)(&_t5), sizeof(int)); + opt_ok2(&(int[]) { n }, (_option*)(&_t5), sizeof(int)); } return _t5; } - Option_i64 _t6 = strconv__parse_int(s, 10, 0); + _option_i64 _t6 = strconv__parse_int(s, 10, 0); if (_t6.state != 0) { /*or block*/ - Option_int _t7; + _option_int _t7; memcpy(&_t7, &_t6, sizeof(Option)); return _t7; } i64 int64 = (*(i64*)_t6.data); - Option_int _t8; - opt_ok(&(int[]) { ((int)(int64)) }, (Option*)(&_t8), sizeof(int)); + _option_int _t8; + opt_ok2(&(int[]) { ((int)(int64)) }, (_option*)(&_t8), sizeof(int)); return _t8; } @@ -17653,7 +17667,7 @@ array array_clone_to_depth(array* a, int depth) { } return arr; } else { - if (!isnil(a->data)) { + if (a->data != 0) { vmemcpy(((u8*)(arr.data)), a->data, ((u64)(a->cap)) * ((u64)(a->element_size))); } return arr; @@ -17690,12 +17704,12 @@ VV_LOCAL_SYMBOL void array_push(array* a, voidptr val) { // Attr: [unsafe] void array_push_many(array* a3, voidptr val, int size) { array_ensure_cap(a3, a3->len + size); - if (a3->data == val && !isnil(a3->data)) { + if (a3->data == val && a3->data != 0) { array copy = array_clone(a3); - vmemcpy(array_get_unsafe(/*rec*/*a3, a3->len), copy.data, ((u64)(a3->element_size)) * ((u64)(size))); + vmemcpy(((u8*)(a3->data)) + ((u64)(a3->element_size)) * ((u64)(a3->len)), copy.data, ((u64)(a3->element_size)) * ((u64)(size))); } else { - if (!isnil(a3->data) && !isnil(val)) { - vmemcpy(array_get_unsafe(/*rec*/*a3, a3->len), val, ((u64)(a3->element_size)) * ((u64)(size))); + if (a3->data != 0 && val != 0) { + vmemcpy(((u8*)(a3->data)) + ((u64)(a3->element_size)) * ((u64)(a3->len)), val, ((u64)(a3->element_size)) * ((u64)(size))); } } a3->len += size; @@ -19477,17 +19491,17 @@ string Array_u8_bytestr(Array_u8 b) { return (string){.str=(byteptr)"", .is_lit=1}; } -Option_rune Array_u8_byterune(Array_u8 b) { - Option_rune _t1 = Array_u8_utf8_to_utf32(b); +_option_rune Array_u8_byterune(Array_u8 b) { + _option_rune _t1 = Array_u8_utf8_to_utf32(b); if (_t1.state != 0) { /*or block*/ - Option_rune _t2; + _option_rune _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } rune r = (*(rune*)_t1.data); - Option_rune _t3; - opt_ok(&(rune[]) { ((rune)(r)) }, (Option*)(&_t3), sizeof(rune)); + _option_rune _t3; + opt_ok2(&(rune[]) { ((rune)(r)) }, (_option*)(&_t3), sizeof(rune)); return _t3; } @@ -19593,8 +19607,8 @@ inline VV_LOCAL_SYMBOL DenseArray new_dense_array(int key_bytes, int value_bytes .len = 0, .deletes = 0U, .all_deleted = 0, - .values = _v_malloc(cap * value_bytes), .keys = _v_malloc(cap * key_bytes), + .values = _v_malloc(cap * value_bytes), }); } @@ -19616,8 +19630,8 @@ inline VV_LOCAL_SYMBOL bool DenseArray_has_index(DenseArray* d, int i) { // Attr: [inline] inline VV_LOCAL_SYMBOL int DenseArray_expand(DenseArray* d) { int old_cap = d->cap; - int old_value_size = d->value_bytes * old_cap; int old_key_size = d->key_bytes * old_cap; + int old_value_size = d->value_bytes * old_cap; if (d->cap == d->len) { d->cap += d->cap >> 3; { // Unsafe block @@ -20072,6 +20086,26 @@ array map_keys(map* m) { return keys; } +array map_values(map* m) { + array values = __new_array(m->len, 0, m->value_bytes); + u8* item = ((u8*)(values.data)); + if (m->key_values.deletes == 0U) { + vmemcpy(item, m->key_values.values, m->value_bytes * m->key_values.len); + return values; + } + for (int i = 0; i < m->key_values.len; i++) { + if (!DenseArray_has_index(&m->key_values, i)) { + continue; + } + { // Unsafe block + voidptr pvalue = DenseArray_value(&m->key_values, i); + vmemcpy(item, pvalue, m->value_bytes); + item = item + m->value_bytes; + } + } + return values; +} + // Attr: [unsafe] VV_LOCAL_SYMBOL DenseArray DenseArray_clone(DenseArray* d) { DenseArray res = ((DenseArray){ @@ -20081,8 +20115,8 @@ VV_LOCAL_SYMBOL DenseArray DenseArray_clone(DenseArray* d) { .len = d->len, .deletes = d->deletes, .all_deleted = 0, - .values = 0, .keys = 0, + .values = 0, }); { // Unsafe block if (d->deletes != 0U) { @@ -20224,6 +20258,13 @@ VV_LOCAL_SYMBOL void opt_ok(voidptr data, Option* option, int size) { } } +VV_LOCAL_SYMBOL void opt_ok2(voidptr data, _option* option, int size) { + { // Unsafe block + *option = ((_option){.state = 0,.err = _const_none__,}); + vmemcpy(((u8*)(&option->err)) + sizeof(IError), data, size); + } +} + VV_LOCAL_SYMBOL void _result_ok(voidptr data, _result* res, int size) { { // Unsafe block *res = ((_result){.is_error = 0,.err = _const_none__,}); @@ -21042,7 +21083,7 @@ bool string_bool(string s) { } int string_int(string s) { - Option_i64 _t2 = strconv__common_parse_int(s, 0, 32, false, false); + _option_i64 _t2 = strconv__common_parse_int(s, 0, 32, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(i64*) _t2.data = 0; @@ -21052,7 +21093,7 @@ int string_int(string s) { } i64 string_i64(string s) { - Option_i64 _t2 = strconv__common_parse_int(s, 0, 64, false, false); + _option_i64 _t2 = strconv__common_parse_int(s, 0, 64, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(i64*) _t2.data = 0; @@ -21062,7 +21103,7 @@ i64 string_i64(string s) { } i8 string_i8(string s) { - Option_i64 _t2 = strconv__common_parse_int(s, 0, 8, false, false); + _option_i64 _t2 = strconv__common_parse_int(s, 0, 8, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(i64*) _t2.data = 0; @@ -21072,7 +21113,7 @@ i8 string_i8(string s) { } i16 string_i16(string s) { - Option_i64 _t2 = strconv__common_parse_int(s, 0, 16, false, false); + _option_i64 _t2 = strconv__common_parse_int(s, 0, 16, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(i64*) _t2.data = 0; @@ -21082,7 +21123,7 @@ i16 string_i16(string s) { } f32 string_f32(string s) { - Option_f64 _t2 = strconv__atof64(s); + _option_f64 _t2 = strconv__atof64(s); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(f64*) _t2.data = 0; @@ -21092,7 +21133,7 @@ f32 string_f32(string s) { } f64 string_f64(string s) { - Option_f64 _t2 = strconv__atof64(s); + _option_f64 _t2 = strconv__atof64(s); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(f64*) _t2.data = 0; @@ -21102,7 +21143,7 @@ f64 string_f64(string s) { } u8 string_u8(string s) { - Option_u64 _t2 = strconv__common_parse_uint(s, 0, 8, false, false); + _option_u64 _t2 = strconv__common_parse_uint(s, 0, 8, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(u64*) _t2.data = 0U; @@ -21112,7 +21153,7 @@ u8 string_u8(string s) { } u16 string_u16(string s) { - Option_u64 _t2 = strconv__common_parse_uint(s, 0, 16, false, false); + _option_u64 _t2 = strconv__common_parse_uint(s, 0, 16, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(u64*) _t2.data = 0U; @@ -21122,7 +21163,7 @@ u16 string_u16(string s) { } u32 string_u32(string s) { - Option_u64 _t2 = strconv__common_parse_uint(s, 0, 32, false, false); + _option_u64 _t2 = strconv__common_parse_uint(s, 0, 32, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(u64*) _t2.data = 0U; @@ -21132,7 +21173,7 @@ u32 string_u32(string s) { } u64 string_u64(string s) { - Option_u64 _t2 = strconv__common_parse_uint(s, 0, 64, false, false); + _option_u64 _t2 = strconv__common_parse_uint(s, 0, 64, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(u64*) _t2.data = 0U; @@ -21141,11 +21182,11 @@ u64 string_u64(string s) { return (*(u64*)_t2.data); } -Option_u64 string_parse_uint(string s, int _base, int _bit_size) { +_option_u64 string_parse_uint(string s, int _base, int _bit_size) { return strconv__parse_uint(s, _base, _bit_size); } -Option_i64 string_parse_int(string s, int _base, int _bit_size) { +_option_i64 string_parse_int(string s, int _base, int _bit_size) { return strconv__parse_int(s, _base, _bit_size); } @@ -21375,14 +21416,14 @@ 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) { +_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("), /*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} }; + 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) { - Option_string _t2; - opt_ok(&(string[]) { string_clone(s) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { string_clone(s) }, (_option*)(&_t2), sizeof(string)); return _t2; } string res = ((string){.str = malloc_noscan(len + 1), .len = len}); @@ -21394,8 +21435,8 @@ Option_string string_substr_with_check(string s, int start, int end) { { // Unsafe block res.str[len] = 0; } - Option_string _t3; - opt_ok(&(string[]) { res }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { res }, (_option*)(&_t3), sizeof(string)); return _t3; } @@ -21462,13 +21503,13 @@ VV_LOCAL_SYMBOL int string_index_(string s, string p) { return -1; } -Option_int string_index(string s, string p) { +_option_int string_index(string s, string p) { int idx = string_index_(s, p); if (idx == -1) { - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t2; - opt_ok(&(int[]) { idx }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { idx }, (_option*)(&_t2), sizeof(int)); return _t2; } @@ -21555,13 +21596,13 @@ VV_LOCAL_SYMBOL int string_last_index_(string s, string p) { return -1; } -Option_int string_last_index(string s, string p) { +_option_int string_last_index(string s, string p) { int idx = string_last_index_(s, p); if (idx == -1) { - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t2; - opt_ok(&(int[]) { idx }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { idx }, (_option*)(&_t2), sizeof(int)); return _t2; } @@ -21998,16 +22039,16 @@ VV_LOCAL_SYMBOL byte string_at(string s, int idx) { return 0; } -VV_LOCAL_SYMBOL Option_u8 string_at_with_check(string s, int idx) { +VV_LOCAL_SYMBOL _option_u8 string_at_with_check(string s, int idx) { if (idx < 0 || idx >= s.len) { - return (Option_u8){ .state=2, .err=_v_error(_SLIT("string index out of range")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u8){ .state=2, .err=_v_error(_SLIT("string index out of range")), .data={EMPTY_STRUCT_INITIALIZATION} }; } { // Unsafe block - Option_u8 _t2; - opt_ok(&(u8[]) { s.str[idx] }, (Option*)(&_t2), sizeof(u8)); + _option_u8 _t2; + opt_ok2(&(u8[]) { s.str[idx] }, (_option*)(&_t2), sizeof(u8)); return _t2; } - return (Option_u8){0}; + return (_option_u8){0}; } // Attr: [inline] @@ -23112,7 +23153,7 @@ inline string str_intp_g64(string in_str) { // Attr: [manualfree] string str_intp_sub(string base_str, string in_str) { - Option_int _t1 = string_index(base_str, _SLIT("%%")); + _option_int _t1 = string_index(base_str, _SLIT("%%")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; eprintln(_SLIT("No strin interpolation %% parameteres")); @@ -23306,7 +23347,7 @@ int utf8_str_len(string s) { } int string_utf32_code(string _rune) { - Option_rune _t2 = Array_u8_utf8_to_utf32(string_bytes(_rune)); + _option_rune _t2 = Array_u8_utf8_to_utf32(string_bytes(_rune)); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(rune*) _t2.data = ((rune)(0)); @@ -23315,19 +23356,19 @@ int string_utf32_code(string _rune) { return ((int)( (*(rune*)_t2.data))); } -Option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes) { +_option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes) { if (_bytes.len == 0) { - Option_rune _t1; - opt_ok(&(rune[]) { 0 }, (Option*)(&_t1), sizeof(rune)); + _option_rune _t1; + opt_ok2(&(rune[]) { 0 }, (_option*)(&_t1), sizeof(rune)); return _t1; } if (_bytes.len == 1) { - Option_rune _t2; - opt_ok(&(rune[]) { ((rune)((*(u8*)/*ee elem_sym */array_get(_bytes, 0)))) }, (Option*)(&_t2), sizeof(rune)); + _option_rune _t2; + opt_ok2(&(rune[]) { ((rune)((*(u8*)/*ee elem_sym */array_get(_bytes, 0)))) }, (_option*)(&_t2), sizeof(rune)); return _t2; } if (_bytes.len > 4) { - return (Option_rune){ .state=2, .err=_v_error(_SLIT("attempted to decode too many bytes, utf-8 is limited to four bytes maximum")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_rune){ .state=2, .err=_v_error(_SLIT("attempted to decode too many bytes, utf-8 is limited to four bytes maximum")), .data={EMPTY_STRUCT_INITIALIZATION} }; } u8 b = ((u8)(((int)((*(u8*)/*ee elem_sym */array_get(_bytes, 0)))))); b = b << _bytes.len; @@ -23339,8 +23380,8 @@ Option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes) { res |= (c & 63); shift = 6; } - Option_rune _t4; - opt_ok(&(rune[]) { res }, (Option*)(&_t4), sizeof(rune)); + _option_rune _t4; + opt_ok2(&(rune[]) { res }, (_option*)(&_t4), sizeof(rune)); return _t4; } @@ -23493,7 +23534,7 @@ Array_string os__args_before(string cut_word) { } string os__getenv(string key) { - Option_string _t2 = os__getenv_opt(key); + _option_string _t2 = os__getenv_opt(key); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(string*) _t2.data = _SLIT(""); @@ -23504,7 +23545,7 @@ string os__getenv(string key) { } // Attr: [manualfree] -Option_string os__getenv_opt(string key) { +_option_string os__getenv_opt(string key) { bool os__getenv_opt_defer_0 = false; u16* kw; { // Unsafe block @@ -23514,7 +23555,7 @@ u16* kw; os__getenv_opt_defer_0 = true; voidptr s = _wgetenv(kw); if (s == 0) { - Option_string _t1 = (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_string _t1 = (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__getenv_opt_defer_0) { #if defined(_WIN32) @@ -23525,8 +23566,8 @@ u16* kw; // Defer end return _t1; } - Option_string _t2; - opt_ok(&(string[]) { string_from_wide(s) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { string_from_wide(s) }, (_option*)(&_t2), sizeof(string)); // Defer begin if (os__getenv_opt_defer_0) { #if defined(_WIN32) @@ -23541,7 +23582,7 @@ u16* kw; { char* s = getenv(((char*)(key.str))); if (s == ((voidptr)(0))) { - Option_string _t3 = (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_string _t3 = (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__getenv_opt_defer_0) { #if defined(_WIN32) @@ -23552,8 +23593,8 @@ u16* kw; // Defer end return _t3; } - Option_string _t4; - opt_ok(&(string[]) { cstring_to_vstring(s) }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { cstring_to_vstring(s) }, (_option*)(&_t4), sizeof(string)); // Defer begin if (os__getenv_opt_defer_0) { #if defined(_WIN32) @@ -23566,7 +23607,7 @@ u16* kw; } #endif } - return (Option_string){0}; + return (_option_string){0}; } int os__setenv(string name, string value, bool overwrite) { @@ -23723,7 +23764,7 @@ multi_return_string_int os__fd_read(int fd, int maxbytes) { return (multi_return_string_int){0}; } -Option_os__File os__open_file(string path, string mode, Array_int options) { +_option_os__File os__open_file(string path, string mode, Array_int options) { int flags = 0; for (int _t1 = 0; _t1 < mode.len; ++_t1) { u8 m = mode.str[_t1]; @@ -23785,44 +23826,44 @@ Option_os__File os__open_file(string path, string mode, Array_int options) { #endif int fd = open(((char*)(p.str)), flags, permission); if (fd == -1) { - return (Option_os__File){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_os__File){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } 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 \""), /*115 &string*/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)); + _option_os__File _t4; + opt_ok2(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (_option*)(&_t4), sizeof(os__File)); return _t4; } -Option_os__File os__open(string path) { - Option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); +_option_os__File os__open(string path) { + _option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); if (_t1.state != 0) { /*or block*/ - Option_os__File _t2; + _option_os__File _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } FILE* cfile = (*(FILE**)_t1.data); int fd = os__fileno(cfile); - Option_os__File _t3; - opt_ok(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (Option*)(&_t3), sizeof(os__File)); + _option_os__File _t3; + opt_ok2(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (_option*)(&_t3), sizeof(os__File)); return _t3; } -Option_os__File os__create(string path) { - Option_FILE_ptr _t1 = os__vfopen(path, _SLIT("wb")); +_option_os__File os__create(string path) { + _option_FILE_ptr _t1 = os__vfopen(path, _SLIT("wb")); if (_t1.state != 0) { /*or block*/ - Option_os__File _t2; + _option_os__File _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } FILE* cfile = (*(FILE**)_t1.data); int fd = os__fileno(cfile); - Option_os__File _t3; - opt_ok(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (Option*)(&_t3), sizeof(os__File)); + _option_os__File _t3; + opt_ok2(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (_option*)(&_t3), sizeof(os__File)); return _t3; } @@ -23841,72 +23882,72 @@ os__File os__stderr(void) { return _t1; } -Option_int os__File_read(os__File* f, Array_u8* buf) { +_option_int os__File_read(os__File* f, Array_u8* buf) { if (buf->len == 0) { - Option_int _t1; - opt_ok(&(int[]) { 0 }, (Option*)(&_t1), sizeof(int)); + _option_int _t1; + opt_ok2(&(int[]) { 0 }, (_option*)(&_t1), sizeof(int)); return _t1; } - Option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t2.state != 0) { /*or block*/ - Option_int _t3; + _option_int _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } int nbytes = (*(int*)_t2.data); - Option_int _t4; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t4), sizeof(int)); return _t4; } -Option_int os__File_write(os__File* f, Array_u8 buf) { +_option_int os__File_write(os__File* f, Array_u8 buf) { if (!f->is_opened) { - return (Option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } int written = ((int)(fwrite(buf.data, 1, buf.len, f->cfile))); if (written == 0 && buf.len != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t3; - opt_ok(&(int[]) { written }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { written }, (_option*)(&_t3), sizeof(int)); return _t3; } -Option_int os__File_writeln(os__File* f, string s) { +_option_int os__File_writeln(os__File* f, string s) { if (!f->is_opened) { - return (Option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } int written = ((int)(fwrite(s.str, 1, s.len, f->cfile))); if (written == 0 && s.len != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; } int x = fputs("\n", f->cfile); if (x < 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("could not add newline")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("could not add newline")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t4; - opt_ok(&(int[]) { written + 1 }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { written + 1 }, (_option*)(&_t4), sizeof(int)); return _t4; } -Option_int os__File_write_string(os__File* f, string s) { - Option_void _t1 = os__File_write_full_buffer(f, s.str, ((usize)(s.len))); +_option_int os__File_write_string(os__File* f, string s) { + _option_void _t1 = os__File_write_full_buffer(f, s.str, ((usize)(s.len))); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_int _t2; + _option_int _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } ; - Option_int _t3; - opt_ok(&(int[]) { s.len }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { s.len }, (_option*)(&_t3), sizeof(int)); return _t3; } -Option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf) { +_option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf) { if (!f->is_opened) { - return (Option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } #if defined(TARGET_IS_64BIT) { @@ -23915,11 +23956,11 @@ Option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf) { _fseeki64(f->cfile, pos, SEEK_SET); int res = ((int)(fwrite(buf.data, 1, buf.len, f->cfile))); if (res == 0 && buf.len != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; } _fseeki64(f->cfile, 0U, SEEK_END); - Option_int _t3; - opt_ok(&(int[]) { res }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { res }, (_option*)(&_t3), sizeof(int)); return _t3; } #else @@ -23927,11 +23968,11 @@ Option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf) { fseeko(f->cfile, pos, SEEK_SET); int res = ((int)(fwrite(buf.data, 1, buf.len, f->cfile))); if (res == 0 && buf.len != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; } fseeko(f->cfile, 0U, SEEK_END); - Option_int _t5; - opt_ok(&(int[]) { res }, (Option*)(&_t5), sizeof(int)); + _option_int _t5; + opt_ok2(&(int[]) { res }, (_option*)(&_t5), sizeof(int)); return _t5; } #endif @@ -23942,15 +23983,15 @@ Option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf) { fseek(f->cfile, pos, SEEK_SET); int res = ((int)(fwrite(buf.data, 1, buf.len, f->cfile))); if (res == 0 && buf.len != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; } fseek(f->cfile, 0, SEEK_END); - Option_int _t7; - opt_ok(&(int[]) { res }, (Option*)(&_t7), sizeof(int)); + _option_int _t7; + opt_ok2(&(int[]) { res }, (_option*)(&_t7), sizeof(int)); return _t7; } #endif - return (Option_int){ .state=2, .err=_v_error(_SLIT("Could not write to file")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("Could not write to file")), .data={EMPTY_STRUCT_INITIALIZATION} }; } // Attr: [unsafe] @@ -23960,12 +24001,12 @@ int os__File_write_ptr(os__File* f, voidptr data, int size) { } // Attr: [unsafe] -Option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer_len) { +_option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer_len) { if (buffer_len <= ((usize)(0))) { - return (Option_void){0}; + return (_option_void){0}; } if (!f->is_opened) { - return (Option_void){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } u8* ptr = ((u8*)(buffer)); i64 remaining_bytes = ((i64)(buffer_len)); @@ -23976,11 +24017,11 @@ Option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer ptr += x; remaining_bytes -= x; if (x <= 0) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("C.fwrite returned 0")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("C.fwrite returned 0")), .data={EMPTY_STRUCT_INITIALIZATION} }; } } } - return (Option_void){0}; + return (_option_void){0}; } // Attr: [unsafe] @@ -24019,18 +24060,18 @@ int os__File_write_ptr_at(os__File* f, voidptr data, int size, u64 pos) { return _t4; } -VV_LOCAL_SYMBOL Option_int os__fread(voidptr ptr, int item_size, int items, FILE* stream) { +VV_LOCAL_SYMBOL _option_int os__fread(voidptr ptr, int item_size, int items, FILE* stream) { int nbytes = ((int)(fread(ptr, item_size, items, stream))); if (nbytes <= 0) { if (feof(stream) != 0) { - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } if (ferror(stream) != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("file read error")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("file read error")), .data={EMPTY_STRUCT_INITIALIZATION} }; } } - Option_int _t3; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t3), sizeof(int)); return _t3; } @@ -24041,7 +24082,7 @@ Array_u8 os__File_read_bytes(os__File* f, int size) { Array_u8 os__File_read_bytes_at(os__File* f, int size, u64 pos) { Array_u8 arr = __new_array_with_default(size, 0, sizeof(u8), 0); - Option_int _t1 = os__File_read_bytes_into(f, pos, &/*arr*/arr); + _option_int _t1 = os__File_read_bytes_into(f, pos, &/*arr*/arr); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; Array_u8 _t2 = __new_array_with_default(0, 0, sizeof(u8), 0); @@ -24053,9 +24094,9 @@ Array_u8 os__File_read_bytes_at(os__File* f, int size, u64 pos) { return _t3; } -Option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf) { +_option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf) { if (buf->len == 0) { - return (Option_int){ .state=2, .err=_v_error(string__plus(_SLIT("read_bytes_into_newline"), _SLIT(": `buf.len` == 0"))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(string__plus(_SLIT("read_bytes_into_newline"), _SLIT(": `buf.len` == 0"))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int newline = 10; int c = 0; @@ -24068,19 +24109,19 @@ Option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf) { if (c == (EOF)) { if (feof(stream) != 0) { - Option_int _t2; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t2), sizeof(int)); return _t2; } if (ferror(stream) != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("file read error")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("file read error")), .data={EMPTY_STRUCT_INITIALIZATION} }; } } else if (c == (newline)) { array_set(buf, buf_ptr, &(u8[]) { ((u8)(c)) }); nbytes++; - Option_int _t4; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t4), sizeof(int)); return _t4; } else { @@ -24089,23 +24130,23 @@ Option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf) { nbytes++; }; } - Option_int _t5; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t5), sizeof(int)); + _option_int _t5; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t5), sizeof(int)); return _t5; } -Option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf) { +_option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf) { if (buf->len == 0) { - return (Option_int){ .state=2, .err=_v_error(string__plus(_SLIT("read_bytes_into"), _SLIT(": `buf.len` == 0"))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(string__plus(_SLIT("read_bytes_into"), _SLIT(": `buf.len` == 0"))), .data={EMPTY_STRUCT_INITIALIZATION} }; } #if defined(TARGET_IS_64BIT) { #if defined(_WIN32) { _fseeki64(f->cfile, pos, SEEK_SET); - Option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t2.state != 0) { /*or block*/ - Option_int _t3; + _option_int _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } @@ -24116,16 +24157,16 @@ Option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf) { _fseeki64(f->cfile, 0U, SEEK_SET); } #endif - Option_int _t4; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t4), sizeof(int)); return _t4; } #else { fseeko(f->cfile, pos, SEEK_SET); - Option_int _t5 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t5 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t5.state != 0) { /*or block*/ - Option_int _t6; + _option_int _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } @@ -24136,8 +24177,8 @@ Option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf) { fseeko(f->cfile, 0U, SEEK_SET); } #endif - Option_int _t7; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t7), sizeof(int)); + _option_int _t7; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t7), sizeof(int)); return _t7; } #endif @@ -24146,9 +24187,9 @@ Option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf) { #if defined(TARGET_IS_32BIT) { fseek(f->cfile, pos, SEEK_SET); - Option_int _t8 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t8 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t8.state != 0) { /*or block*/ - Option_int _t9; + _option_int _t9; memcpy(&_t9, &_t8, sizeof(Option)); return _t9; } @@ -24159,18 +24200,18 @@ Option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf) { fseek(f->cfile, 0, SEEK_SET); } #endif - Option_int _t10; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t10), sizeof(int)); + _option_int _t10; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t10), sizeof(int)); return _t10; } #endif - return (Option_int){ .state=2, .err=_v_error(_SLIT("Could not read file")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("Could not read file")), .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf) { +_option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf) { if (buf->len == 0) { - Option_int _t1; - opt_ok(&(int[]) { 0 }, (Option*)(&_t1), sizeof(int)); + _option_int _t1; + opt_ok2(&(int[]) { 0 }, (_option*)(&_t1), sizeof(int)); return _t1; } #if defined(TARGET_IS_64BIT) @@ -24184,40 +24225,40 @@ Option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf) { fseeko(f->cfile, pos, SEEK_SET); } #endif - Option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t2.state != 0) { /*or block*/ - Option_int _t3; + _option_int _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } int nbytes = (*(int*)_t2.data); - Option_int _t4; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t4), sizeof(int)); return _t4; } #endif #if defined(TARGET_IS_32BIT) { fseek(f->cfile, pos, SEEK_SET); - Option_int _t5 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t5 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t5.state != 0) { /*or block*/ - Option_int _t6; + _option_int _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } int nbytes = (*(int*)_t5.data); - Option_int _t7; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t7), sizeof(int)); + _option_int _t7; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t7), sizeof(int)); return _t7; } #endif - return (Option_int){ .state=2, .err=_v_error(_SLIT("Could not read file")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("Could not read file")), .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_int os__File_read_into_ptr(os__File* f, u8* ptr, int max_size) { - Option_int _t1 = os__fread(ptr, 1, max_size, f->cfile); +_option_int os__File_read_into_ptr(os__File* f, u8* ptr, int max_size) { + _option_int _t1 = os__fread(ptr, 1, max_size, f->cfile); return _t1; } @@ -24248,9 +24289,9 @@ VV_LOCAL_SYMBOL IError os__error_size_of_type_0(void) { return _t1; } -Option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode) { +_option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode) { if (!f->is_opened) { - return (Option_void){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } int whence = ((int)(mode)); int res = 0; @@ -24273,21 +24314,21 @@ Option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode) { } #endif if (res == -1) { - return (Option_void){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } -Option_i64 os__File_tell(os__File* f) { +_option_i64 os__File_tell(os__File* f) { if (!f->is_opened) { - return (Option_i64){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } i64 pos = ftell(f->cfile); if (pos == -1) { - return (Option_i64){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_i64 _t3; - opt_ok(&(i64[]) { pos }, (Option*)(&_t3), sizeof(i64)); + _option_i64 _t3; + opt_ok2(&(i64[]) { pos }, (_option*)(&_t3), sizeof(i64)); return _t3; } @@ -24348,12 +24389,12 @@ os__FileMode os__inode(string path) { } // Attr: [manualfree] -Option_Array_u8 os__read_bytes(string path) { +_option_Array_u8 os__read_bytes(string path) { bool os__read_bytes_defer_0 = false; FILE* fp; - Option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); + _option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); if (_t1.state != 0) { /*or block*/ - Option_Array_u8 _t2; + _option_Array_u8 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -24362,7 +24403,7 @@ FILE* fp; os__read_bytes_defer_0 = true; int cseek = fseek(fp, 0, SEEK_END); if (cseek != 0) { - Option_Array_u8 _t3 = (Option_Array_u8){ .state=2, .err=_v_error(_SLIT("fseek failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_Array_u8 _t3 = (_option_Array_u8){ .state=2, .err=_v_error(_SLIT("fseek failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -24372,7 +24413,7 @@ FILE* fp; } i64 fsize = ftell(fp); if (fsize < 0) { - Option_Array_u8 _t4 = (Option_Array_u8){ .state=2, .err=_v_error(_SLIT("ftell failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_Array_u8 _t4 = (_option_Array_u8){ .state=2, .err=_v_error(_SLIT("ftell failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -24382,7 +24423,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, /*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} }; + _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); @@ -24394,7 +24435,7 @@ FILE* fp; Array_u8 res = __new_array_with_default(len, 0, sizeof(u8), 0); int nr_read_elements = ((int)(fread(res.data, len, 1, fp))); if (nr_read_elements == 0 && fsize > 0) { - Option_Array_u8 _t6 = (Option_Array_u8){ .state=2, .err=_v_error(_SLIT("fread failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_Array_u8 _t6 = (_option_Array_u8){ .state=2, .err=_v_error(_SLIT("fread failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -24403,8 +24444,8 @@ FILE* fp; return _t6; } array_trim(&res, nr_read_elements * len); - Option_Array_u8 _t7; - opt_ok(&(Array_u8[]) { res }, (Option*)(&_t7), sizeof(Array_u8)); + _option_Array_u8 _t7; + opt_ok2(&(Array_u8[]) { res }, (_option*)(&_t7), sizeof(Array_u8)); // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -24413,13 +24454,13 @@ FILE* fp; return _t7; } -Option_string os__read_file(string path) { +_option_string os__read_file(string path) { bool os__read_file_defer_0 = false; FILE* fp; string mode = _SLIT("rb"); - Option_FILE_ptr _t1 = os__vfopen(path, mode); + _option_FILE_ptr _t1 = os__vfopen(path, mode); if (_t1.state != 0) { /*or block*/ - Option_string _t2; + _option_string _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -24428,7 +24469,7 @@ FILE* fp; os__read_file_defer_0 = true; int cseek = fseek(fp, 0, SEEK_END); if (cseek != 0) { - Option_string _t3 = (Option_string){ .state=2, .err=_v_error(_SLIT("fseek failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_string _t3 = (_option_string){ .state=2, .err=_v_error(_SLIT("fseek failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -24438,7 +24479,7 @@ FILE* fp; } i64 fsize = ftell(fp); if (fsize < 0) { - Option_string _t4 = (Option_string){ .state=2, .err=_v_error(_SLIT("ftell failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_string _t4 = (_option_string){ .state=2, .err=_v_error(_SLIT("ftell failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -24449,7 +24490,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, /*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} }; + _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); @@ -24464,7 +24505,7 @@ FILE* fp; int is_error = ((int)(ferror(fp))); if (is_eof == 0 && is_error != 0) { _v_free(str); - Option_string _t6 = (Option_string){ .state=2, .err=_v_error(_SLIT("fread failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_string _t6 = (_option_string){ .state=2, .err=_v_error(_SLIT("fread failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -24474,8 +24515,8 @@ FILE* fp; } str[nelements] = 0; if (nelements == 0) { - Option_string _t7; - opt_ok(&(string[]) { u8_vstring(str) }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { u8_vstring(str) }, (_option*)(&_t7), sizeof(string)); // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -24483,8 +24524,8 @@ FILE* fp; // Defer end return _t7; } - Option_string _t8; - opt_ok(&(string[]) { u8_vstring_with_len(str, nelements) }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(string[]) { u8_vstring_with_len(str, nelements) }, (_option*)(&_t8), sizeof(string)); // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -24492,16 +24533,16 @@ FILE* fp; // Defer end return _t8; } - return (Option_string){0}; + return (_option_string){0}; } -Option_void os__truncate(string path, u64 len) { +_option_void os__truncate(string path, u64 len) { bool os__truncate_defer_0 = false; int fp; fp = open(((char*)(path.str)), (_const_os__o_wronly | _const_os__o_trunc), 0); os__truncate_defer_0 = true; if (fp < 0) { - Option_void _t1 = (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t1 = (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__truncate_defer_0) { close(fp); @@ -24512,7 +24553,7 @@ int fp; #if defined(_WIN32) { if (_chsize_s(fp, len) != 0) { - Option_void _t2 = (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t2 = (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__truncate_defer_0) { close(fp); @@ -24524,7 +24565,7 @@ int fp; #else { if (ftruncate(fp, len) != 0) { - Option_void _t3 = (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t3 = (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__truncate_defer_0) { close(fp); @@ -24539,7 +24580,7 @@ int fp; close(fp); } // Defer end - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL void os__eprintln_unknown_file_size(void) { @@ -24610,7 +24651,7 @@ u64 os__file_size(string path) { return _t9; } -Option_void os__mv(string src, string dst) { +_option_void os__mv(string src, string dst) { string rdst = dst; if (os__is_dir(rdst)) { rdst = os__join_path_single(string_trim_right(rdst, _const_os__path_separator), os__file_name(string_trim_right(src, _const_os__path_separator))); @@ -24621,40 +24662,40 @@ 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 "), /*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} }; + 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 "), /*115 &string*/0xfe10, {.d_s = src}}, {_SLIT(" to "), /*115 &string*/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 - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__cp(string src, string dst) { +_option_void os__cp(string src, string dst) { #if defined(_WIN32) { string w_src = string_replace(src, _SLIT("/"), _SLIT("\\")); 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 "), /*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} }; + 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 "), /*115 &string*/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 "), /*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} }; + 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; @@ -24666,7 +24707,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 "), /*115 &string*/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; @@ -24674,18 +24715,18 @@ 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 "), /*115 &string*/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); } #endif - return (Option_void){0}; + return (_option_void){0}; } -Option_FILE_ptr os__vfopen(string path, string mode) { +_option_FILE_ptr os__vfopen(string path, string mode) { if (path.len == 0) { - return (Option_FILE_ptr){ .state=2, .err=_v_error(_SLIT("vfopen called with \"\"")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_FILE_ptr){ .state=2, .err=_v_error(_SLIT("vfopen called with \"\"")), .data={EMPTY_STRUCT_INITIALIZATION} }; } voidptr fp = ((voidptr)(0)); #if defined(_WIN32) @@ -24698,13 +24739,13 @@ 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 \""), /*115 &string*/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*)); + _option_FILE_ptr _t3; + opt_ok2(&(FILE*[]) { fp }, (_option*)(&_t3), sizeof(FILE*)); return _t3; } - return (Option_FILE_ptr){0}; + return (_option_FILE_ptr){0}; } int os__fileno(voidptr cfile) { @@ -24925,7 +24966,7 @@ bool os__is_readable(string path) { return 0; } -Option_void os__rm(string path) { +_option_void os__rm(string path) { int rc = 0; #if defined(_WIN32) { @@ -24937,28 +24978,28 @@ 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 \""), /*115 &string*/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}; + return (_option_void){0}; } -Option_void os__rmdir(string path) { +_option_void os__rmdir(string path) { #if defined(_WIN32) { 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 \""), /*115 &string*/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 { int rc = rmdir(((char*)(path.str))); if (rc == -1) { - return (Option_void){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } } #endif - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL void os__print_c_errno(void) { @@ -25565,7 +25606,7 @@ bool os__is_link(string path) { return 0; } -Option_void os__chdir(string path) { +_option_void os__chdir(string path) { #if defined(_WIN32) int ret = _wchdir(string_to_wide(path)); #else @@ -25573,9 +25614,9 @@ Option_void os__chdir(string path) { #endif ; if (ret == -1) { - return (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL int os__max_path_bufffer_size(void) { @@ -25847,29 +25888,29 @@ void os__flush(void) { fflush(stdout); } -Option_void os__chmod(string path, int mode) { +_option_void os__chmod(string path, int mode) { if (chmod(((char*)(path.str)), mode) != 0) { - return (Option_void){ .state=2, .err=error_with_code(string__plus(_SLIT("chmod failed: "), os__posix_get_error_msg(errno)), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(string__plus(_SLIT("chmod failed: "), os__posix_get_error_msg(errno)), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__chown(string path, int owner, int group) { +_option_void os__chown(string path, int owner, int group) { #if defined(_WIN32) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("os.chown() not implemented for Windows")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("os.chown() not implemented for Windows")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #else { if (chown(((char*)(path.str)), owner, group) != 0) { - return (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } } #endif - return (Option_void){0}; + return (_option_void){0}; } -Option_os__File os__open_append(string path) { +_option_os__File os__open_append(string path) { os__File file = ((os__File){.cfile = 0,.fd = 0,.is_opened = 0,}); #if defined(_WIN32) { @@ -25884,15 +25925,15 @@ 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 \""), /*115 &string*/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; - opt_ok(&(os__File[]) { file }, (Option*)(&_t2), sizeof(os__File)); + _option_os__File _t2; + opt_ok2(&(os__File[]) { file }, (_option*)(&_t2), sizeof(os__File)); return _t2; } -Option_void os__execvp(string cmdpath, Array_string cmdargs) { +_option_void os__execvp(string cmdpath, Array_string cmdargs) { Array_char_ptr cargs = __new_array_with_default(0, 0, sizeof(char*), 0); array_push((array*)&cargs, _MOV((char*[]){ ((char*)(cmdpath.str)) })); for (int i = 0; i < cmdargs.len; ++i) { @@ -25910,14 +25951,14 @@ Option_void os__execvp(string cmdpath, Array_string cmdargs) { } #endif if (res == -1) { - return (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } _v_exit(res); VUNREACHABLE(); - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs) { +_option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs) { Array_char_ptr cargv = __new_array_with_default(0, 0, sizeof(char*), 0); Array_char_ptr cenvs = __new_array_with_default(0, 0, sizeof(char*), 0); array_push((array*)&cargv, _MOV((char*[]){ ((char*)(cmdpath.str)) })); @@ -25940,9 +25981,9 @@ Option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs) } #endif if (res == -1) { - return (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } int os__is_atty(int fd) { @@ -25963,34 +26004,34 @@ int os__is_atty(int fd) { return 0; } -Option_void os__write_file_array(string path, array buffer) { - Option_os__File _t1 = os__create(path); +_option_void os__write_file_array(string path, array buffer) { + _option_os__File _t1 = os__create(path); if (_t1.state != 0) { /*or block*/ - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } os__File f = (*(os__File*)_t1.data); - Option_void _t3 = os__File_write_full_buffer(&f, buffer.data, ((usize)(buffer.len * buffer.element_size))); + _option_void _t3 = os__File_write_full_buffer(&f, buffer.data, ((usize)(buffer.len * buffer.element_size))); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } ; os__File_close(&f); - return (Option_void){0}; + return (_option_void){0}; } -Option_Array_string os__glob(Array_string patterns) { +_option_Array_string os__glob(Array_string patterns) { Array_string matches = __new_array_with_default(0, 0, sizeof(string), 0); for (int _t1 = 0; _t1 < patterns.len; ++_t1) { string pattern = ((string*)patterns.data)[_t1]; - Option_void _t2 = os__native_glob_pattern(pattern, &/*arr*/matches); + _option_void _t2 = os__native_glob_pattern(pattern, &/*arr*/matches); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { - Option_Array_string _t3; + _option_Array_string _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } @@ -25998,8 +26039,8 @@ Option_Array_string os__glob(Array_string patterns) { ; } qsort(matches.data, matches.len, matches.element_size, (int (*)(const void *, const void *))&compare_3677745349018262865_string); - Option_Array_string _t4; - opt_ok(&(Array_string[]) { matches }, (Option*)(&_t4), sizeof(Array_string)); + _option_Array_string _t4; + opt_ok2(&(Array_string[]) { matches }, (_option*)(&_t4), sizeof(Array_string)); return _t4; } @@ -26027,43 +26068,43 @@ void os__Result_free(os__Result* result) { string_free(&result->output); } -Option_void os__cp_all(string src, string dst, bool overwrite) { +_option_void os__cp_all(string src, string dst, bool overwrite) { string source_path = os__real_path(src); string dest_path = os__real_path(dst); if (!os__exists(source_path)) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("Source path doesn't exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("Source path doesn't exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__is_dir(source_path)) { string fname = os__file_name(source_path); string adjusted_path = (os__is_dir(dest_path) ? (os__join_path_single(dest_path, fname)) : (dest_path)); if (os__exists(adjusted_path)) { if (overwrite) { - Option_void _t2 = os__rm(adjusted_path); + _option_void _t2 = os__rm(adjusted_path); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { - Option_void _t3; + _option_void _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } ; } else { - return (Option_void){ .state=2, .err=_v_error(_SLIT("Destination file path already exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("Destination file path already exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; } } - Option_void _t5 = os__cp(source_path, adjusted_path); + _option_void _t5 = os__cp(source_path, adjusted_path); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { - Option_void _t6; + _option_void _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } ; - return (Option_void){0}; + return (_option_void){0}; } if (!os__exists(dest_path)) { - Option_bool _t7 = os__mkdir(dest_path); + _option_bool _t7 = os__mkdir(dest_path); if (_t7.state != 0) { /*or block*/ - Option_void _t8; + _option_void _t8; memcpy(&_t8, &_t7, sizeof(Option)); return _t8; } @@ -26071,11 +26112,11 @@ Option_void os__cp_all(string src, string dst, bool overwrite) { (*(bool*)_t7.data); } if (!os__is_dir(dest_path)) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("Destination path is not a valid directory")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("Destination path is not a valid directory")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_Array_string _t10 = os__ls(source_path); + _option_Array_string _t10 = os__ls(source_path); if (_t10.state != 0) { /*or block*/ - Option_void _t11; + _option_void _t11; memcpy(&_t11, &_t10, sizeof(Option)); return _t11; } @@ -26087,9 +26128,9 @@ Option_void os__cp_all(string src, string dst, bool overwrite) { string dp = os__join_path_single(dest_path, file); if (os__is_dir(sp)) { if (!os__exists(dp)) { - Option_bool _t13 = os__mkdir(dp); + _option_bool _t13 = os__mkdir(dp); if (_t13.state != 0) { /*or block*/ - Option_void _t14; + _option_void _t14; memcpy(&_t14, &_t13, sizeof(Option)); return _t14; } @@ -26097,49 +26138,49 @@ Option_void os__cp_all(string src, string dst, bool overwrite) { (*(bool*)_t13.data); } } - Option_void _t15 = os__cp_all(sp, dp, overwrite); + _option_void _t15 = os__cp_all(sp, dp, overwrite); if (_t15.state != 0 && _t15.err._typ != _IError_None___index) { IError err = _t15.err; - Option_void _t16 = os__rmdir(dp); + _option_void _t16 = os__rmdir(dp); if (_t16.state != 0 && _t16.err._typ != _IError_None___index) { err = _t16.err; - return (Option_void){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } ; - return (Option_void){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } ; } - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__mv_by_cp(string source, string target) { - Option_void _t1 = os__cp(source, target); +_option_void os__mv_by_cp(string source, string target) { + _option_void _t1 = os__cp(source, target); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } ; - Option_void _t3 = os__rm(source); + _option_void _t3 = os__rm(source); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } ; - return (Option_void){0}; + return (_option_void){0}; } // Attr: [manualfree] -Option_Array_string os__read_lines(string path) { - Option_string _t1 = os__read_file(path); +_option_Array_string os__read_lines(string path) { + _option_string _t1 = os__read_file(path); if (_t1.state != 0) { /*or block*/ - Option_Array_string _t2; + _option_Array_string _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -26147,8 +26188,8 @@ Option_Array_string os__read_lines(string path) { string buf = (*(string*)_t1.data); Array_string res = string_split_into_lines(buf); string_free(&buf); - Option_Array_string _t3; - opt_ok(&(Array_string[]) { res }, (Option*)(&_t3), sizeof(Array_string)); + _option_Array_string _t3; + opt_ok2(&(Array_string[]) { res }, (_option*)(&_t3), sizeof(Array_string)); return _t3; } @@ -26251,11 +26292,11 @@ string os__sigint_to_signal_name(int si) { return _t22; } -Option_void os__rmdir_all(string path) { +_option_void os__rmdir_all(string path) { string ret_err = _SLIT(""); - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -26265,7 +26306,7 @@ Option_void os__rmdir_all(string path) { string item = ((string*)items.data)[_t3]; string fullpath = os__join_path_single(path, item); if (os__is_dir(fullpath) && !os__is_link(fullpath)) { - Option_void _t4 = os__rmdir_all(fullpath); + _option_void _t4 = os__rmdir_all(fullpath); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; ret_err = IError_name_table[err._typ]._method_msg(err._object); @@ -26273,7 +26314,7 @@ Option_void os__rmdir_all(string path) { ; } else { - Option_void _t5 = os__rm(fullpath); + _option_void _t5 = os__rm(fullpath); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { IError err = _t5.err; ret_err = IError_name_table[err._typ]._method_msg(err._object); @@ -26282,7 +26323,7 @@ Option_void os__rmdir_all(string path) { ; } } - Option_void _t6 = os__rmdir(path); + _option_void _t6 = os__rmdir(path); if (_t6.state != 0 && _t6.err._typ != _IError_None___index) { IError err = _t6.err; ret_err = IError_name_table[err._typ]._method_msg(err._object); @@ -26290,14 +26331,14 @@ Option_void os__rmdir_all(string path) { ; if (ret_err.len > 0) { - return (Option_void){ .state=2, .err=_v_error(ret_err), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(ret_err), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } // Attr: [manualfree] bool os__is_dir_empty(string path) { - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = true; @@ -26312,7 +26353,7 @@ bool os__is_dir_empty(string path) { } string os__file_ext(string path) { - Option_int _t1 = string_last_index(path, _SLIT(".")); + _option_int _t1 = string_last_index(path, _SLIT(".")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; string _t2 = _SLIT(""); @@ -26330,7 +26371,7 @@ string os__dir(string opath) { return _t1; } string path = string_replace_each(opath, new_array_from_c_array(4, 4, sizeof(string), _MOV((string[4]){_SLIT("/"), string_clone(_const_os__path_separator), _SLIT("\\"), string_clone(_const_os__path_separator)}))); - Option_int _t2 = string_last_index(path, _const_os__path_separator); + _option_int _t2 = string_last_index(path, _const_os__path_separator); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; string _t3 = _SLIT("."); @@ -26358,7 +26399,7 @@ string os__base(string opath) { } if (string_ends_with(path, _const_os__path_separator)) { string path2 = string_substr(path, 0, path.len - 1); - Option_int _t3 = string_last_index(path2, _const_os__path_separator); + _option_int _t3 = string_last_index(path2, _const_os__path_separator); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; string _t4 = string_clone(path2); @@ -26369,7 +26410,7 @@ string os__base(string opath) { string _t5 = string_substr(path2, pos + 1, (path2).len); return _t5; } - Option_int _t6 = string_last_index(path, _const_os__path_separator); + _option_int _t6 = string_last_index(path, _const_os__path_separator); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; string _t7 = string_clone(path); @@ -26387,20 +26428,20 @@ string os__file_name(string opath) { return _t1; } -Option_string os__input_opt(string prompt) { +_option_string os__input_opt(string prompt) { print(prompt); os__flush(); string res = os__get_raw_line(); if (res.len > 0) { - Option_string _t1; - opt_ok(&(string[]) { string_trim_right(res, _SLIT("\r\n")) }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { string_trim_right(res, _SLIT("\r\n")) }, (_option*)(&_t1), sizeof(string)); return _t1; } - return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } string os__input(string prompt) { - Option_string _t1 = os__input_opt(prompt); + _option_string _t1 = os__input_opt(prompt); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; string _t2 = _SLIT(""); @@ -26574,25 +26615,25 @@ string os__expand_tilde_to_home(string path) { return _t3; } -Option_void os__write_file(string path, string text) { - Option_os__File _t1 = os__create(path); +_option_void os__write_file(string path, string text) { + _option_os__File _t1 = os__create(path); if (_t1.state != 0) { /*or block*/ - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } os__File f = (*(os__File*)_t1.data); - Option_void _t3 = os__File_write_full_buffer(&f, text.str, ((usize)(text.len))); + _option_void _t3 = os__File_write_full_buffer(&f, text.str, ((usize)(text.len))); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } ; os__File_close(&f); - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL string os__executable_fallback(void) { @@ -26613,7 +26654,7 @@ VV_LOCAL_SYMBOL string os__executable_fallback(void) { if (string_contains(rexepath, _const_os__path_separator)) { exepath = os__join_path_single(_const_os__wd_at_startup, exepath); } else { - Option_string _t2 = os__find_abs_path_of_executable(exepath); + _option_string _t2 = os__find_abs_path_of_executable(exepath); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(string*) _t2.data = _SLIT(""); @@ -26640,13 +26681,13 @@ VV_LOCAL_SYMBOL IError os__error_failed_to_find_executable(void) { return _t1; } -Option_string os__find_abs_path_of_executable(string exepath) { +_option_string os__find_abs_path_of_executable(string exepath) { if ((exepath).len == 0) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("expected non empty `exepath`")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("expected non empty `exepath`")), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (os__is_abs_path(exepath)) { - Option_string _t2; - opt_ok(&(string[]) { os__real_path(exepath) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { os__real_path(exepath) }, (_option*)(&_t2), sizeof(string)); return _t2; } string res = _SLIT(""); @@ -26661,15 +26702,15 @@ Option_string os__find_abs_path_of_executable(string exepath) { } } if (res.len > 0) { - Option_string _t4; - opt_ok(&(string[]) { os__real_path(res) }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { os__real_path(res) }, (_option*)(&_t4), sizeof(string)); return _t4; } - return (Option_string){ .state=2, .err=os__error_failed_to_find_executable(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=os__error_failed_to_find_executable(), .data={EMPTY_STRUCT_INITIALIZATION} }; } bool os__exists_in_system_path(string prog) { - Option_string _t1 = os__find_abs_path_of_executable(prog); + _option_string _t1 = os__find_abs_path_of_executable(prog); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -26769,7 +26810,7 @@ VV_LOCAL_SYMBOL void os__impl_walk_ext(string path, string ext, Array_string* ou if (!os__is_dir(path)) { return; } - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; return; @@ -26798,7 +26839,7 @@ void os__walk(string path, void (*f)(string )) { if (!os__is_dir(path)) { return; } - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; return; @@ -26829,7 +26870,7 @@ void os__walk_with_context(string path, voidptr context, void (*fcb)(voidptr , s if (!os__is_dir(path)) { return; } - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; return; @@ -26856,7 +26897,7 @@ void os__log(string s) { println(string__plus(_SLIT("os.log: "), s)); } -Option_void os__mkdir_all(string opath) { +_option_void os__mkdir_all(string opath) { string path = string_replace(opath, _SLIT("/"), _const_os__path_separator); string p = (string_starts_with(path, _const_os__path_separator) ? (_const_os__path_separator) : (_SLIT(""))); Array_string path_parts = string_split(string_trim_left(path, _const_os__path_separator), _const_os__path_separator); @@ -26866,15 +26907,15 @@ Option_void os__mkdir_all(string opath) { if (os__exists(p) && os__is_dir(p)) { continue; } - Option_bool _t2 = os__mkdir(p); + _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: "), /*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} }; + 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); } - return (Option_void){0}; + return (_option_void){0}; } string os__cache_dir(void) { @@ -26885,7 +26926,7 @@ string os__cache_dir(void) { } string cdir = os__join_path_single(os__home_dir(), _SLIT(".cache")); if (!os__is_dir(cdir) && !os__is_link(cdir)) { - Option_bool _t2 = os__mkdir(cdir); + _option_bool _t2 = os__mkdir(cdir); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; _v_panic(IError_str(err)); @@ -27042,13 +27083,13 @@ string os__quoted_path(string path) { return (string){.str=(byteptr)"", .is_lit=1}; } -Option_string os__config_dir(void) { +_option_string os__config_dir(void) { #if defined(_WIN32) { string app_data = os__getenv(_SLIT("AppData")); if ((app_data).len != 0) { - Option_string _t1; - opt_ok(&(string[]) { app_data }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { app_data }, (_option*)(&_t1), sizeof(string)); return _t1; } } @@ -27056,8 +27097,8 @@ Option_string os__config_dir(void) { { string home = os__home_dir(); if ((home).len != 0) { - Option_string _t2; - opt_ok(&(string[]) { string__plus(home, _SLIT("/Library/Application Support")) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { string__plus(home, _SLIT("/Library/Application Support")) }, (_option*)(&_t2), sizeof(string)); return _t2; } } @@ -27065,19 +27106,19 @@ Option_string os__config_dir(void) { { string xdg_home = os__getenv(_SLIT("XDG_CONFIG_HOME")); if ((xdg_home).len != 0) { - Option_string _t3; - opt_ok(&(string[]) { xdg_home }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { xdg_home }, (_option*)(&_t3), sizeof(string)); return _t3; } string home = os__home_dir(); if ((home).len != 0) { - Option_string _t4; - opt_ok(&(string[]) { string__plus(home, _SLIT("/.config")) }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { string__plus(home, _SLIT("/.config")) }, (_option*)(&_t4), sizeof(string)); return _t4; } } #endif - return (Option_string){ .state=2, .err=_v_error(_SLIT("Cannot find config directory")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("Cannot find config directory")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #if !defined(__sun) && !defined(__HAIKU__) @@ -27088,7 +27129,7 @@ VV_LOCAL_SYMBOL Array_string os__glob_match(string dir, string pattern, string n Array_string _t1 = subdirs; return _t1; } - Option_Array_string _t2 = os__ls(dir); + _option_Array_string _t2 = os__ls(dir); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; Array_string _t3 = subdirs; @@ -27177,7 +27218,7 @@ VV_LOCAL_SYMBOL Array_string os__glob_match(string dir, string pattern, string n return _t13; } -VV_LOCAL_SYMBOL Option_void os__native_glob_pattern(string pattern, Array_string* matches) { +VV_LOCAL_SYMBOL _option_void os__native_glob_pattern(string pattern, Array_string* matches) { Array_string steps = string_split(pattern, _const_os__path_separator); string cwd = (string_starts_with(pattern, _const_os__path_separator) ? (_const_os__path_separator) : (_SLIT("."))); Array_string subdirs = new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){string_clone(cwd)})); @@ -27203,15 +27244,15 @@ VV_LOCAL_SYMBOL Option_void os__native_glob_pattern(string pattern, Array_string } subdirs = array_clone_to_depth(&subs, 0); } - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__utime(string path, int actime, int modtime) { +_option_void os__utime(string path, int actime, int modtime) { struct utimbuf u = ((struct utimbuf){.actime = actime,.modtime = modtime,}); if (utime(((char*)(path.str)), ((voidptr)(&u))) != 0) { - return (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } os__Uname os__uname(void) { @@ -27266,14 +27307,14 @@ VV_LOCAL_SYMBOL Array_string os__init_os_args(int argc, u8** argv) { return _t1; } -Option_Array_string os__ls(string path) { +_option_Array_string os__ls(string path) { if (path.len == 0) { - return (Option_Array_string){ .state=2, .err=_v_error(_SLIT("ls() expects a folder, not an empty string")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=_v_error(_SLIT("ls() expects a folder, not an empty string")), .data={EMPTY_STRUCT_INITIALIZATION} }; } 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 \""), /*115 &string*/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 (;;) { @@ -27290,24 +27331,24 @@ Option_Array_string os__ls(string path) { } } closedir(dir); - Option_Array_string _t4; - opt_ok(&(Array_string[]) { res }, (Option*)(&_t4), sizeof(Array_string)); + _option_Array_string _t4; + opt_ok2(&(Array_string[]) { res }, (_option*)(&_t4), sizeof(Array_string)); return _t4; } -Option_bool os__mkdir(string path) { +_option_bool os__mkdir(string path) { if (string__eq(path, _SLIT("."))) { - Option_bool _t1; - opt_ok(&(bool[]) { true }, (Option*)(&_t1), sizeof(bool)); + _option_bool _t1; + opt_ok2(&(bool[]) { true }, (_option*)(&_t1), sizeof(bool)); return _t1; } string apath = os__real_path(path); int r = mkdir(((char*)(apath.str)), 511U); if (r == -1) { - return (Option_bool){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_bool _t3; - opt_ok(&(bool[]) { true }, (Option*)(&_t3), sizeof(bool)); + _option_bool _t3; + opt_ok2(&(bool[]) { true }, (_option*)(&_t3), sizeof(bool)); return _t3; } @@ -27360,14 +27401,14 @@ strings__Builder res; } // Attr: [manualfree] -Option_void os__Command_start(os__Command* c) { +_option_void os__Command_start(os__Command* c) { bool os__Command_start_defer_0 = false; string pcmd; pcmd = string__plus(c->path, _SLIT(" 2>&1")); 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(\""), /*115 &string*/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); @@ -27380,7 +27421,7 @@ string pcmd; string_free(&pcmd); } // Defer end - return (Option_void){0}; + return (_option_void){0}; } // Attr: [manualfree] @@ -27422,32 +27463,32 @@ strings__Builder res; return _t2; } -Option_void os__Command_close(os__Command* c) { +_option_void os__Command_close(os__Command* c) { c->exit_code = os__vpclose(c->f); if (c->exit_code == 127) { - return (Option_void){ .state=2, .err=error_with_code(_SLIT("error"), 127), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(_SLIT("error"), 127), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } -Option_bool os__symlink(string origin, string target) { +_option_bool os__symlink(string origin, string target) { int res = symlink(((char*)(origin.str)), ((char*)(target.str))); if (res == 0) { - Option_bool _t1; - opt_ok(&(bool[]) { true }, (Option*)(&_t1), sizeof(bool)); + _option_bool _t1; + opt_ok2(&(bool[]) { true }, (_option*)(&_t1), sizeof(bool)); return _t1; } - return (Option_bool){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_bool os__link(string origin, string target) { +_option_bool os__link(string origin, string target) { int res = link(((char*)(origin.str)), ((char*)(target.str))); if (res == 0) { - Option_bool _t1; - opt_ok(&(bool[]) { true }, (Option*)(&_t1), sizeof(bool)); + _option_bool _t1; + opt_ok2(&(bool[]) { true }, (_option*)(&_t1), sizeof(bool)); return _t1; } - return (Option_bool){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } string os__get_error_msg(int code) { @@ -27482,21 +27523,21 @@ inline bool os__debugger_present(void) { } // Attr: [manualfree] -Option_bool os__is_writable_folder(string folder) { +_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("`"), /*115 &string*/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} }; + return (_option_bool){ .state=2, .err=_v_error(_SLIT("`folder` is not a folder")), .data={EMPTY_STRUCT_INITIALIZATION} }; } tmp_perm_check = os__join_path_single(folder, _SLIT("XXXXXX")); os__is_writable_folder_defer_0 = true; { // 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 `"), /*115 &string*/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); @@ -27506,21 +27547,21 @@ string tmp_perm_check; } close(x); } - Option_void _t4 = os__rm(tmp_perm_check); + _option_void _t4 = os__rm(tmp_perm_check); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { // Defer begin if (os__is_writable_folder_defer_0) { string_free(&tmp_perm_check); } // Defer end - Option_bool _t5; + _option_bool _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } ; - Option_bool _t6; - opt_ok(&(bool[]) { true }, (Option*)(&_t6), sizeof(bool)); + _option_bool _t6; + opt_ok2(&(bool[]) { true }, (_option*)(&_t6), sizeof(bool)); // Defer begin if (os__is_writable_folder_defer_0) { string_free(&tmp_perm_check); @@ -27956,7 +27997,7 @@ VV_LOCAL_SYMBOL int os__Process_unix_spawn_process(os__Process* p) { os__fd_close(pipeset[3]); os__fd_close(pipeset[5]); } - Option_void _t2 = os__execve(p->filename, p->args, p->env); + _option_void _t2 = os__execve(p->filename, p->args, p->env); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; eprintln(IError_str(err)); @@ -28068,19 +28109,19 @@ VV_LOCAL_SYMBOL string os__Process_win_slurp(os__Process* p, int idx) { return _t1; } -Option_os__SignalHandler os__signal_opt(os__Signal signum, void (*handler)(os__Signal )) { +_option_os__SignalHandler os__signal_opt(os__Signal signum, void (*handler)(os__Signal )) { errno = 0; voidptr prev_handler = signal(((int)(signum)), (voidptr)handler); if (prev_handler == SIG_ERR) { - return (Option_os__SignalHandler){ .state=2, .err=error_with_code(os__posix_get_error_msg(EINVAL), EINVAL), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_os__SignalHandler){ .state=2, .err=error_with_code(os__posix_get_error_msg(EINVAL), EINVAL), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_os__SignalHandler _t2; - opt_ok(&(os__SignalHandler[]) { (voidptr)((os__SignalHandler)(prev_handler)) }, (Option*)(&_t2), sizeof(os__SignalHandler)); + _option_os__SignalHandler _t2; + opt_ok2(&(os__SignalHandler[]) { (voidptr)((os__SignalHandler)(prev_handler)) }, (_option*)(&_t2), sizeof(os__SignalHandler)); return _t2; } // TypeDecl -Option_void os__open_uri(string uri) { +_option_void os__open_uri(string uri) { string vopen_uri_cmd = os__getenv(_SLIT("VOPEN_URI_CMD")); if ((vopen_uri_cmd).len == 0) { #if defined(__APPLE__) @@ -28105,13 +28146,13 @@ Option_void os__open_uri(string uri) { #endif } if ((vopen_uri_cmd).len == 0) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("unsupported platform")), .data={EMPTY_STRUCT_INITIALIZATION} }; + 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, /*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: "), /*115 &string*/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}; + return (_option_void){0}; } // TypeDecl @@ -29352,358 +29393,358 @@ string v__token__kind_to_string(v__token__Kind k) { return _t1; } -Option_v__token__Kind v__token__kind_from_string(string s) { - Option_v__token__Kind _t2 = {0}; +_option_v__token__Kind v__token__kind_from_string(string s) { + _option_v__token__Kind _t2 = {0}; if (string__eq(s, _SLIT("unknown"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__unknown }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__unknown }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("eof"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__eof }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__eof }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("name"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__name }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__name }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("number"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__number }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__number }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("string"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__string }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__string }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("str_inter"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__str_inter }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__str_inter }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("chartoken"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__chartoken }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__chartoken }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("plus"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__plus }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__plus }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("minus"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__minus }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__minus }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("mul"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__mul }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__mul }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("div"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__div }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__div }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("mod"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__mod }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__mod }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("xor"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__xor }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__xor }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("pipe"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__pipe }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__pipe }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("inc"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__inc }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__inc }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("dec"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__dec }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__dec }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("and"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__and }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__and }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("logical_or"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__logical_or }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__logical_or }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("not"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__not }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__not }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("bit_not"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__bit_not }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__bit_not }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("question"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__question }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__question }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("comma"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__comma }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__comma }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("semicolon"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__semicolon }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__semicolon }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("colon"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__colon }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__colon }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("arrow"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__arrow }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__arrow }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("amp"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__amp }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__amp }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("hash"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__hash }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__hash }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("dollar"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__dollar }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__dollar }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("at"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__at }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__at }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("str_dollar"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__str_dollar }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__str_dollar }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("left_shift"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__left_shift }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__left_shift }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("right_shift"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__right_shift }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__right_shift }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("unsigned_right_shift"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__unsigned_right_shift }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__unsigned_right_shift }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("not_in"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__not_in }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__not_in }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("not_is"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__not_is }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__not_is }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("decl_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__decl_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__decl_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("plus_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__plus_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__plus_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("minus_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__minus_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__minus_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("div_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__div_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__div_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("mult_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__mult_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__mult_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("xor_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__xor_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__xor_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("mod_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__mod_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__mod_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("or_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__or_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__or_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("and_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__and_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__and_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("right_shift_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__right_shift_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__right_shift_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("left_shift_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__left_shift_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__left_shift_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("unsigned_right_shift_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__unsigned_right_shift_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__unsigned_right_shift_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("lcbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__lcbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__lcbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("rcbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__rcbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__rcbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("lpar"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__lpar }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__lpar }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("rpar"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__rpar }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__rpar }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("lsbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__lsbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__lsbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("nilsbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__nilsbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__nilsbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("rsbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__rsbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__rsbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("eq"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__eq }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__eq }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("ne"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__ne }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__ne }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("gt"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__gt }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__gt }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("lt"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__lt }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__lt }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("ge"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__ge }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__ge }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("le"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__le }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__le }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("comment"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__comment }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__comment }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("nl"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__nl }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__nl }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("dot"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__dot }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__dot }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("dotdot"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__dotdot }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__dotdot }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("ellipsis"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__ellipsis }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__ellipsis }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("keyword_beg"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__keyword_beg }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__keyword_beg }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_as"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_as }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_as }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_asm"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_asm }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_asm }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_assert"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_assert }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_assert }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_atomic"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_atomic }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_atomic }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_break"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_break }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_break }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_const"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_const }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_const }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_continue"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_continue }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_continue }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_defer"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_defer }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_defer }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_else"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_else }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_else }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_enum"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_enum }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_enum }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_false"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_false }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_false }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_for"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_for }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_for }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_fn"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_fn }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_fn }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_global"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_global }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_global }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_go"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_go }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_go }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_goto"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_goto }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_goto }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_if"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_if }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_if }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_import"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_import }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_import }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_in"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_in }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_in }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_interface"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_interface }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_interface }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_is"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_is }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_is }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_match"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_match }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_match }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_module"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_module }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_module }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_mut"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_mut }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_mut }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_shared"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_shared }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_shared }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_lock"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_lock }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_lock }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_rlock"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_rlock }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_rlock }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_none"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_none }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_none }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_return"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_return }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_return }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_select"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_select }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_select }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_sizeof"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_sizeof }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_sizeof }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_isreftype"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_isreftype }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_isreftype }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_likely"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_likely }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_likely }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_unlikely"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_unlikely }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_unlikely }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_offsetof"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_offsetof }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_offsetof }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_struct"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_struct }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_struct }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_true"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_true }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_true }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_type"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_type }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_type }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_typeof"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_typeof }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_typeof }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_dump"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_dump }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_dump }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_orelse"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_orelse }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_orelse }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_union"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_union }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_union }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_pub"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_pub }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_pub }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_static"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_static }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_static }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_volatile"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_volatile }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_volatile }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_unsafe"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_unsafe }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_unsafe }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("keyword_end"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__keyword_end }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__keyword_end }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("_end_"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind___end_ }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind___end_ }, (_option*)(&_t2), sizeof(v__token__Kind)); } else { _t2.state = 2; _t2.err = _v_error(_SLIT("unknown")); - }Option_v__token__Kind _t1 = _t2; + }_option_v__token__Kind _t1 = _t2; return _t1; } @@ -30119,7 +30160,7 @@ Array_int to_delete; return _t8; } -VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser* fs, string longhand, u8 shorthand) { +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("--"), /*115 &string*/0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); for (int i = 0; i < fs->args.len; ++i) { @@ -30135,53 +30176,53 @@ VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser string val = (*(string*)/*ee elem_sym */array_get(fs->args, i + 1)); array_delete(&fs->args, i + 1); array_delete(&fs->args, i); - Option_string _t1; - opt_ok(&(string[]) { val }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { val }, (_option*)(&_t1), sizeof(string)); return _t1; } else { array_delete(&fs->args, i); - Option_string _t2; - opt_ok(&(string[]) { _SLIT("true") }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { _SLIT("true") }, (_option*)(&_t2), sizeof(string)); return _t2; } } 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; - opt_ok(&(string[]) { val }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { val }, (_option*)(&_t3), sizeof(string)); return _t3; } if (arg.len > 1 && string_at(arg, 0) == '-' && string_at(arg, 1) != '-' && string_index_u8(arg, shorthand) != -1) { - Option_string _t4; - opt_ok(&(string[]) { _SLIT("true") }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { _SLIT("true") }, (_option*)(&_t4), sizeof(string)); return _t4; } } } - 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} }; + 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) { +_option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { bool res = false; { flag__FlagParser_add_flag(fs, name, abbr, usage, _SLIT("")); - Option_string _t1 = flag__FlagParser_parse_bool_value(fs, name, 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 '"), /*115 &string*/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); res = string__eq(parsed, _SLIT("true")); } - Option_bool _t3; - opt_ok(&(bool[]) { res }, (Option*)(&_t3), sizeof(bool)); + _option_bool _t3; + opt_ok2(&(bool[]) { res }, (_option*)(&_t3), sizeof(bool)); return _t3; } bool flag__FlagParser_bool(flag__FlagParser* fs, string name, u8 abbr, bool bdefault, string usage) { - Option_bool _t1 = flag__FlagParser_bool_opt(fs, name, abbr, usage); + _option_bool _t1 = flag__FlagParser_bool_opt(fs, name, abbr, usage); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = bdefault; @@ -30205,24 +30246,24 @@ Array_int flag__FlagParser_int_multi(flag__FlagParser* fs, string name, u8 abbr, return _t3; } -Option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { +_option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { int res = 0; { 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 '"), /*115 &string*/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); } - Option_int _t2; - opt_ok(&(int[]) { res }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { res }, (_option*)(&_t2), sizeof(int)); return _t2; } int flag__FlagParser_int(flag__FlagParser* fs, string name, u8 abbr, int idefault, string usage) { - Option_int _t1 = flag__FlagParser_int_opt(fs, name, abbr, usage); + _option_int _t1 = flag__FlagParser_int_opt(fs, name, abbr, usage); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; int _t2 = idefault; @@ -30246,23 +30287,23 @@ Array_f64 flag__FlagParser_float_multi(flag__FlagParser* fs, string name, u8 abb return _t3; } -Option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { +_option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { f64 res = 0.0; { 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 '"), /*115 &string*/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))); } - Option_f64 _t2; - opt_ok(&(f64[]) { res }, (Option*)(&_t2), sizeof(f64)); + _option_f64 _t2; + opt_ok2(&(f64[]) { res }, (_option*)(&_t2), sizeof(f64)); return _t2; } f64 flag__FlagParser_float(flag__FlagParser* fs, string name, u8 abbr, f64 fdefault, string usage) { - Option_f64 _t1 = flag__FlagParser_float_opt(fs, name, abbr, usage); + _option_f64 _t1 = flag__FlagParser_float_opt(fs, name, abbr, usage); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; f64 _t2 = fdefault; @@ -30280,23 +30321,23 @@ Array_string flag__FlagParser_string_multi(flag__FlagParser* fs, string name, u8 return _t1; } -Option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { +_option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { string res = _SLIT(""); { 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 '"), /*115 &string*/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)); } - Option_string _t2; - opt_ok(&(string[]) { res }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { res }, (_option*)(&_t2), sizeof(string)); return _t2; } string flag__FlagParser_string(flag__FlagParser* fs, string name, u8 abbr, string sdefault, string usage) { - Option_string _t1 = flag__FlagParser_string_opt(fs, name, abbr, usage); + _option_string _t1 = flag__FlagParser_string_opt(fs, name, abbr, usage); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; string _t2 = sdefault; @@ -30308,36 +30349,36 @@ string flag__FlagParser_string(flag__FlagParser* fs, string name, u8 abbr, strin return _t3; } -Option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, int n) { +_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 "), /*100 &int literal*/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} }; + 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} }; } fs->min_free_args = n; - return (Option_void){0}; + return (_option_void){0}; } -Option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, int n) { +_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 "), /*100 &int literal*/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} }; + 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} }; } fs->min_free_args = n; fs->max_free_args = n; - return (Option_void){0}; + return (_option_void){0}; } -Option_void flag__FlagParser_limit_free_args(flag__FlagParser* fs, int min, int max) { +_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 "), /*100 &int*/0xfe07, {.d_i32 = min}}, {_SLIT(" >= "), /*100 &int*/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; - return (Option_void){0}; + return (_option_void){0}; } void flag__FlagParser_arguments_description(flag__FlagParser* fs, string description) { @@ -30428,29 +30469,29 @@ string flag__FlagParser_usage(flag__FlagParser* fs) { return _t23; } -VV_LOCAL_SYMBOL Option_flag__Flag flag__FlagParser_find_existing_flag(flag__FlagParser* fs, string fname) { +VV_LOCAL_SYMBOL _option_flag__Flag flag__FlagParser_find_existing_flag(flag__FlagParser* fs, string fname) { for (int _t1 = 0; _t1 < fs->flags.len; ++_t1) { flag__Flag f = ((flag__Flag*)fs->flags.data)[_t1]; if (string__eq(f.name, fname)) { - Option_flag__Flag _t2; - opt_ok(&(flag__Flag[]) { f }, (Option*)(&_t2), sizeof(flag__Flag)); + _option_flag__Flag _t2; + opt_ok2(&(flag__Flag[]) { f }, (_option*)(&_t2), sizeof(flag__Flag)); return _t2; } } - return (Option_flag__Flag){ .state=2, .err=_v_error(_SLIT("no such flag")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_flag__Flag){ .state=2, .err=_v_error(_SLIT("no such flag")), .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL void flag__FlagParser_handle_builtin_options(flag__FlagParser* fs) { bool show_version = false; bool show_help = false; - Option_flag__Flag _t1 = flag__FlagParser_find_existing_flag(fs, _SLIT("help")); + _option_flag__Flag _t1 = flag__FlagParser_find_existing_flag(fs, _SLIT("help")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; show_help = flag__FlagParser_bool(fs, _SLIT("help"), 'h', false, fs->default_help_label); } (*(flag__Flag*)_t1.data); - Option_flag__Flag _t2 = flag__FlagParser_find_existing_flag(fs, _SLIT("version")); + _option_flag__Flag _t2 = flag__FlagParser_find_existing_flag(fs, _SLIT("version")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; show_version = flag__FlagParser_bool(fs, _SLIT("version"), 0, false, fs->default_version_label); @@ -30469,34 +30510,34 @@ VV_LOCAL_SYMBOL void flag__FlagParser_handle_builtin_options(flag__FlagParser* f } } -Option_Array_string flag__FlagParser_finalize(flag__FlagParser* fs) { +_option_Array_string flag__FlagParser_finalize(flag__FlagParser* fs) { flag__FlagParser_handle_builtin_options(fs); Array_string remaining = array_clone_to_depth(&fs->args, 0); if (!fs->allow_unknown_args) { for (int _t1 = 0; _t1 < remaining.len; ++_t1) { string a = ((string*)remaining.data)[_t1]; if ((a.len >= 2 && string__eq(string_substr(a, 0, 2), _SLIT("--"))) || (a.len == 2 && string_at(a, 0) == '-')) { - return (Option_Array_string){ .state=2, .err=/*&IError*/I_flag__UnkownFlagError_to_Interface_IError(((flag__UnkownFlagError*)memdup(&(flag__UnkownFlagError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.flag = a,}, sizeof(flag__UnkownFlagError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=/*&IError*/I_flag__UnkownFlagError_to_Interface_IError(((flag__UnkownFlagError*)memdup(&(flag__UnkownFlagError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.flag = a,}, sizeof(flag__UnkownFlagError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } } if (remaining.len < fs->min_free_args && fs->min_free_args > 0) { - return (Option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = fs->min_free_args,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = fs->min_free_args,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (remaining.len > fs->max_free_args && fs->max_free_args > 0) { - return (Option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = fs->max_free_args,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = fs->max_free_args,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (remaining.len > 0 && fs->max_free_args == 0 && fs->min_free_args == 0) { - return (Option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = 0,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = 0,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } _PUSH_MANY(&remaining, (fs->all_after_dashdash), _t6, Array_string); - Option_Array_string _t7; - opt_ok(&(Array_string[]) { remaining }, (Option*)(&_t7), sizeof(Array_string)); + _option_Array_string _t7; + opt_ok2(&(Array_string[]) { remaining }, (_option*)(&_t7), sizeof(Array_string)); return _t7; } Array_string flag__FlagParser_remaining_parameters(flag__FlagParser* fs) { - Option_Array_string _t2 = flag__FlagParser_finalize(fs); + _option_Array_string _t2 = flag__FlagParser_finalize(fs); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; eprintln(IError_name_table[err._typ]._method_msg(err._object)); @@ -30512,7 +30553,7 @@ Array_string flag__FlagParser_remaining_parameters(flag__FlagParser* fs) { // Attr: [inline] inline VV_LOCAL_SYMBOL bool semver__version_satisfies(semver__Version ver, string input) { - Option_semver__Range _t1 = semver__parse_range(input); + _option_semver__Range _t1 = semver__parse_range(input); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -30593,7 +30634,7 @@ VV_LOCAL_SYMBOL semver__RawVersion semver__parse(string input) { string raw_version = input; string prerelease = _SLIT(""); string metadata = _SLIT(""); - Option_int _t1 = string_last_index(raw_version, _SLIT("+")); + _option_int _t1 = string_last_index(raw_version, _SLIT("+")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(int*) _t1.data = -1; @@ -30604,7 +30645,7 @@ VV_LOCAL_SYMBOL semver__RawVersion semver__parse(string input) { metadata = string_substr(raw_version, (plus_idx + 1), (raw_version).len); raw_version = string_substr(raw_version, 0, plus_idx); } - Option_int _t2 = string_index(raw_version, _SLIT("-")); + _option_int _t2 = string_index(raw_version, _SLIT("-")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(int*) _t2.data = -1; @@ -30634,13 +30675,13 @@ VV_LOCAL_SYMBOL bool semver__RawVersion_is_missing(semver__RawVersion ver, int t return _t1; } -VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_coerce(semver__RawVersion raw_ver) { +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: "), /*115 &[]string*/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)); + _option_semver__Version _t2; + opt_ok2(&(semver__Version[]) { semver__RawVersion_to_version(ver) }, (_option*)(&_t2), sizeof(semver__Version)); return _t2; } @@ -30654,12 +30695,12 @@ VV_LOCAL_SYMBOL semver__RawVersion semver__RawVersion_complete(semver__RawVersio return _t2; } -VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_validate(semver__RawVersion raw_ver) { +VV_LOCAL_SYMBOL _option_semver__Version semver__RawVersion_validate(semver__RawVersion raw_ver) { if (!semver__RawVersion_is_valid(raw_ver)) { - return (Option_semver__Version){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Version){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_semver__Version _t2; - opt_ok(&(semver__Version[]) { semver__RawVersion_to_version(raw_ver) }, (Option*)(&_t2), sizeof(semver__Version)); + _option_semver__Version _t2; + opt_ok2(&(semver__Version[]) { semver__RawVersion_to_version(raw_ver) }, (_option*)(&_t2), sizeof(semver__Version)); return _t2; } @@ -30715,59 +30756,59 @@ VV_LOCAL_SYMBOL bool semver__Comparator_satisfies(semver__Comparator c, semver__ return _t6; } -VV_LOCAL_SYMBOL Option_semver__Range semver__parse_range(string input) { +VV_LOCAL_SYMBOL _option_semver__Range semver__parse_range(string input) { Array_string raw_comparator_sets = string_split(input, _const_semver__comparator_set_sep); Array_semver__ComparatorSet comparator_sets = __new_array_with_default(0, 0, sizeof(semver__ComparatorSet), 0); for (int _t1 = 0; _t1 < raw_comparator_sets.len; ++_t1) { string raw_comp_set = ((string*)raw_comparator_sets.data)[_t1]; if (semver__can_expand(raw_comp_set)) { - Option_semver__ComparatorSet _t2 = semver__expand_comparator_set(raw_comp_set); + _option_semver__ComparatorSet _t2 = semver__expand_comparator_set(raw_comp_set); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_semver__Range){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Range){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__ComparatorSet s = (*(semver__ComparatorSet*)_t2.data); array_push((array*)&comparator_sets, _MOV((semver__ComparatorSet[]){ s })); } else { - Option_semver__ComparatorSet _t5 = semver__parse_comparator_set(raw_comp_set); + _option_semver__ComparatorSet _t5 = semver__parse_comparator_set(raw_comp_set); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - return (Option_semver__Range){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Range){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__ComparatorSet s = (*(semver__ComparatorSet*)_t5.data); array_push((array*)&comparator_sets, _MOV((semver__ComparatorSet[]){ s })); } } - Option_semver__Range _t8; - opt_ok(&(semver__Range[]) { ((semver__Range){.comparator_sets = comparator_sets,}) }, (Option*)(&_t8), sizeof(semver__Range)); + _option_semver__Range _t8; + opt_ok2(&(semver__Range[]) { ((semver__Range){.comparator_sets = comparator_sets,}) }, (_option*)(&_t8), sizeof(semver__Range)); return _t8; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__parse_comparator_set(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 \""), /*115 &string*/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) { string raw_comp = ((string*)raw_comparators.data)[_t2]; - Option_semver__Comparator _t3 = semver__parse_comparator(raw_comp); + _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 \""), /*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} }; + 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); array_push((array*)&comparators, _MOV((semver__Comparator[]){ c })); } - Option_semver__ComparatorSet _t6; - opt_ok(&(semver__ComparatorSet[]) { ((semver__ComparatorSet){.comparators = comparators,}) }, (Option*)(&_t6), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t6; + opt_ok2(&(semver__ComparatorSet[]) { ((semver__ComparatorSet){.comparators = comparators,}) }, (_option*)(&_t6), sizeof(semver__ComparatorSet)); return _t6; } -VV_LOCAL_SYMBOL Option_semver__Comparator semver__parse_comparator(string input) { +VV_LOCAL_SYMBOL _option_semver__Comparator semver__parse_comparator(string input) { semver__Operator op = semver__Operator__eq; string raw_version = _SLIT(""); if (string_starts_with(input, _SLIT(">="))) { @@ -30787,19 +30828,19 @@ VV_LOCAL_SYMBOL Option_semver__Comparator semver__parse_comparator(string input) } else { raw_version = input; } - Option_semver__Version _t1 = semver__coerce_version(raw_version); + _option_semver__Version _t1 = semver__coerce_version(raw_version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__Comparator){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Comparator){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version version = (*(semver__Version*)_t1.data); - Option_semver__Comparator _t3; - opt_ok(&(semver__Comparator[]) { ((semver__Comparator){.ver = version,.op = op,}) }, (Option*)(&_t3), sizeof(semver__Comparator)); + _option_semver__Comparator _t3; + opt_ok2(&(semver__Comparator[]) { ((semver__Comparator){.ver = version,.op = op,}) }, (_option*)(&_t3), sizeof(semver__Comparator)); return _t3; } -VV_LOCAL_SYMBOL Option_semver__Version semver__parse_xrange(string input) { +VV_LOCAL_SYMBOL _option_semver__Version semver__parse_xrange(string input) { semver__RawVersion raw_ver = semver__RawVersion_complete(semver__parse(input)); for (int _t1 = 0; _t1 < _const_semver__versions.len; ++_t1) { int typ = ((int*)_const_semver__versions.data)[_t1]; @@ -30823,10 +30864,10 @@ VV_LOCAL_SYMBOL Option_semver__Version semver__parse_xrange(string input) { }; } if (!semver__RawVersion_is_valid(raw_ver)) { - return (Option_semver__Version){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Version){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_semver__Version _t3; - opt_ok(&(semver__Version[]) { semver__RawVersion_to_version(raw_ver) }, (Option*)(&_t3), sizeof(semver__Version)); + _option_semver__Version _t3; + opt_ok2(&(semver__Version[]) { semver__RawVersion_to_version(raw_ver) }, (_option*)(&_t3), sizeof(semver__Version)); return _t3; } @@ -30835,32 +30876,32 @@ VV_LOCAL_SYMBOL bool semver__can_expand(string input) { return _t1; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_comparator_set(string input) { +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_comparator_set(string input) { u8 _t1 = string_at(input, 0); if (_t1 == ('~')) { - Option_semver__ComparatorSet _t2 = semver__expand_tilda(string_substr(input, 1, (input).len)); + _option_semver__ComparatorSet _t2 = semver__expand_tilda(string_substr(input, 1, (input).len)); return _t2; } else if (_t1 == ('^')) { - Option_semver__ComparatorSet _t3 = semver__expand_caret(string_substr(input, 1, (input).len)); + _option_semver__ComparatorSet _t3 = semver__expand_caret(string_substr(input, 1, (input).len)); return _t3; } else { }; if (string_contains(input, _const_semver__hyphen_range_sep)) { - Option_semver__ComparatorSet _t4 = semver__expand_hyphen(input); + _option_semver__ComparatorSet _t4 = semver__expand_hyphen(input); return _t4; } - Option_semver__ComparatorSet _t5 = semver__expand_xrange(input); + _option_semver__ComparatorSet _t5 = semver__expand_xrange(input); return _t5; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_tilda(string raw_version) { - Option_semver__Version _t1 = semver__coerce_version(raw_version); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_tilda(string raw_version) { + _option_semver__Version _t1 = semver__coerce_version(raw_version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version min_ver = (*(semver__Version*)_t1.data); @@ -30870,16 +30911,16 @@ VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_tilda(string raw_ver } else { max_ver = semver__Version_increment(min_ver, semver__Increment__minor); } - Option_semver__ComparatorSet _t3; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (Option*)(&_t3), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t3; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (_option*)(&_t3), sizeof(semver__ComparatorSet)); return _t3; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_caret(string raw_version) { - Option_semver__Version _t1 = semver__coerce_version(raw_version); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_caret(string raw_version) { + _option_semver__Version _t1 = semver__coerce_version(raw_version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version min_ver = (*(semver__Version*)_t1.data); @@ -30889,57 +30930,57 @@ VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_caret(string raw_ver } else { max_ver = semver__Version_increment(min_ver, semver__Increment__major); } - Option_semver__ComparatorSet _t3; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (Option*)(&_t3), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t3; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (_option*)(&_t3), sizeof(semver__ComparatorSet)); return _t3; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_hyphen(string raw_range) { +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_hyphen(string raw_range) { Array_string raw_versions = string_split(raw_range, _const_semver__hyphen_range_sep); if (raw_versions.len != 2) { - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_semver__Version _t2 = semver__coerce_version((*(string*)/*ee elem_sym */array_get(raw_versions, 0))); + _option_semver__Version _t2 = semver__coerce_version((*(string*)/*ee elem_sym */array_get(raw_versions, 0))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version min_ver = (*(semver__Version*)_t2.data); semver__RawVersion raw_max_ver = semver__parse((*(string*)/*ee elem_sym */array_get(raw_versions, 1))); if (semver__RawVersion_is_missing(raw_max_ver, _const_semver__ver_major)) { - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_semver__Version _t5 = semver__RawVersion_coerce(raw_max_ver); + _option_semver__Version _t5 = semver__RawVersion_coerce(raw_max_ver); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version max_ver = (*(semver__Version*)_t5.data); if (semver__RawVersion_is_missing(raw_max_ver, _const_semver__ver_minor)) { max_ver = semver__Version_increment(max_ver, semver__Increment__minor); - Option_semver__ComparatorSet _t7; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (Option*)(&_t7), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t7; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (_option*)(&_t7), sizeof(semver__ComparatorSet)); return _t7; } - Option_semver__ComparatorSet _t8; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_le(min_ver, max_ver) }, (Option*)(&_t8), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t8; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_le(min_ver, max_ver) }, (_option*)(&_t8), sizeof(semver__ComparatorSet)); return _t8; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_xrange(string raw_range) { - Option_semver__Version _t1 = semver__parse_xrange(raw_range); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_xrange(string raw_range) { + _option_semver__Version _t1 = semver__parse_xrange(raw_range); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version min_ver = (*(semver__Version*)_t1.data); if (min_ver.major == 0) { Array_semver__Comparator comparators = new_array_from_c_array(1, 1, sizeof(semver__Comparator), _MOV((semver__Comparator[1]){((semver__Comparator){.ver = min_ver,.op = semver__Operator__ge,})})); - Option_semver__ComparatorSet _t3; - opt_ok(&(semver__ComparatorSet[]) { ((semver__ComparatorSet){.comparators = comparators,}) }, (Option*)(&_t3), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t3; + opt_ok2(&(semver__ComparatorSet[]) { ((semver__ComparatorSet){.comparators = comparators,}) }, (_option*)(&_t3), sizeof(semver__ComparatorSet)); return _t3; } semver__Version max_ver = min_ver; @@ -30948,8 +30989,8 @@ VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_xrange(string raw_ra } else { max_ver = semver__Version_increment(min_ver, semver__Increment__minor); } - Option_semver__ComparatorSet _t4; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (Option*)(&_t4), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t4; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (_option*)(&_t4), sizeof(semver__ComparatorSet)); return _t4; } @@ -30975,20 +31016,20 @@ string semver__InvalidVersionFormatError_msg(semver__InvalidVersionFormatError e return _t1; } -Option_semver__Version semver__from(string input) { +_option_semver__Version semver__from(string input) { if (input.len == 0) { - return (Option_semver__Version){ .state=2, .err=/*&IError*/I_semver__EmptyInputError_to_Interface_IError(((semver__EmptyInputError*)memdup(&(semver__EmptyInputError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),}, sizeof(semver__EmptyInputError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Version){ .state=2, .err=/*&IError*/I_semver__EmptyInputError_to_Interface_IError(((semver__EmptyInputError*)memdup(&(semver__EmptyInputError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),}, sizeof(semver__EmptyInputError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__RawVersion raw_version = semver__parse(input); - Option_semver__Version _t2 = semver__RawVersion_validate(raw_version); + _option_semver__Version _t2 = semver__RawVersion_validate(raw_version); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_semver__Version){ .state=2, .err=/*&IError*/I_semver__InvalidVersionFormatError_to_Interface_IError(((semver__InvalidVersionFormatError*)memdup(&(semver__InvalidVersionFormatError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.input = input,}, sizeof(semver__InvalidVersionFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Version){ .state=2, .err=/*&IError*/I_semver__InvalidVersionFormatError_to_Interface_IError(((semver__InvalidVersionFormatError*)memdup(&(semver__InvalidVersionFormatError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.input = input,}, sizeof(semver__InvalidVersionFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version version = (*(semver__Version*)_t2.data); - Option_semver__Version _t4; - opt_ok(&(semver__Version[]) { version }, (Option*)(&_t4), sizeof(semver__Version)); + _option_semver__Version _t4; + opt_ok2(&(semver__Version[]) { version }, (_option*)(&_t4), sizeof(semver__Version)); return _t4; } @@ -31040,8 +31081,8 @@ string semver__Version_str(semver__Version ver) { return _t1; } -Option_semver__Version semver__coerce(string input) { - Option_semver__Version _t1 = semver__coerce_version(input); +_option_semver__Version semver__coerce(string input) { + _option_semver__Version _t1 = semver__coerce_version(input); return _t1; } @@ -31058,17 +31099,17 @@ inline VV_LOCAL_SYMBOL bool semver__is_version_valid(string input) { } // Attr: [inline] -inline VV_LOCAL_SYMBOL Option_semver__Version semver__coerce_version(string input) { +inline VV_LOCAL_SYMBOL _option_semver__Version semver__coerce_version(string input) { semver__RawVersion raw_ver = semver__parse(input); - Option_semver__Version _t1 = semver__RawVersion_coerce(raw_ver); + _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 \""), /*115 &string*/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); - Option_semver__Version _t3; - opt_ok(&(semver__Version[]) { ver }, (Option*)(&_t3), sizeof(semver__Version)); + _option_semver__Version _t3; + opt_ok2(&(semver__Version[]) { ver }, (_option*)(&_t3), sizeof(semver__Version)); return _t3; } @@ -31769,22 +31810,22 @@ multi_return_int_int term__get_terminal_size(void) { return (multi_return_int_int){.arg0=((int)(w.ws_col)), .arg1=((int)(w.ws_row))}; } -Option_term__Coord term__get_cursor_position(void) { +_option_term__Coord term__get_cursor_position(void) { bool term__get_cursor_position_defer_0 = false; struct termios old_state; if (os__is_atty(1) <= 0 || string__eq(os__getenv(_SLIT("TERM")), _SLIT("dumb"))) { - Option_term__Coord _t1; - opt_ok(&(term__Coord[]) { ((term__Coord){.x = 0,.y = 0,}) }, (Option*)(&_t1), sizeof(term__Coord)); + _option_term__Coord _t1; + opt_ok2(&(term__Coord[]) { ((term__Coord){.x = 0,.y = 0,}) }, (_option*)(&_t1), sizeof(term__Coord)); return _t1; } old_state = ((struct termios){.c_iflag = 0,.c_oflag = 0,.c_cflag = 0,.c_lflag = 0,.c_cc = {0},}); if (tcgetattr(0, &old_state) != 0) { - return (Option_term__Coord){ .state=2, .err=os__last_error(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_term__Coord){ .state=2, .err=os__last_error(), .data={EMPTY_STRUCT_INITIALIZATION} }; } term__get_cursor_position_defer_0 = true; struct termios state = ((struct termios){.c_iflag = 0,.c_oflag = 0,.c_cflag = 0,.c_lflag = 0,.c_cc = {0},}); if (tcgetattr(0, &state) != 0) { - Option_term__Coord _t3 = (Option_term__Coord){ .state=2, .err=os__last_error(), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_term__Coord _t3 = (_option_term__Coord){ .state=2, .err=os__last_error(), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (term__get_cursor_position_defer_0) { tcsetattr(0, TCSANOW, &old_state); @@ -31801,7 +31842,7 @@ struct termios old_state; for (;;) { int w = getchar(); if (w < 0) { - Option_term__Coord _t4 = (Option_term__Coord){ .state=2, .err=error_with_code(_SLIT("Failed to read from stdin"), 888), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_term__Coord _t4 = (_option_term__Coord){ .state=2, .err=error_with_code(_SLIT("Failed to read from stdin"), 888), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (term__get_cursor_position_defer_0) { tcsetattr(0, TCSANOW, &old_state); @@ -31824,8 +31865,8 @@ struct termios old_state; break; } } - Option_term__Coord _t5; - opt_ok(&(term__Coord[]) { ((term__Coord){.x = x,.y = y,}) }, (Option*)(&_t5), sizeof(term__Coord)); + _option_term__Coord _t5; + opt_ok2(&(term__Coord[]) { ((term__Coord){.x = x,.y = y,}) }, (_option*)(&_t5), sizeof(term__Coord)); // Defer begin if (term__get_cursor_position_defer_0) { tcsetattr(0, TCSANOW, &old_state); @@ -31893,7 +31934,7 @@ string v__util__version__githash(bool should_get_from_filesystem) { if (!os__exists(git_head_file)) { break; } - Option_string _t1 = os__read_file(git_head_file); + _option_string _t1 = os__read_file(git_head_file); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; break; @@ -31907,7 +31948,7 @@ string v__util__version__githash(bool should_get_from_filesystem) { if (!os__exists(gcbranch_file)) { break; } - Option_string _t2 = os__read_file(gcbranch_file); + _option_string _t2 = os__read_file(gcbranch_file); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; break; @@ -31942,7 +31983,7 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts) { } ; if (!os__is_dir(vcache_basepath)) { - Option_void _t1 = os__mkdir_all(vcache_basepath); + _option_void _t1 = os__mkdir_all(vcache_basepath); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; _v_panic(IError_str(err)); @@ -31956,7 +31997,7 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts) { string readme_file = os__join_path(vcache_basepath, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("README.md")}))); if (!os__is_file(readme_file)) { string readme_content = string_strip_margin(_SLIT("This folder contains cached build artifacts from the V build system.\n\011\011|You can safely delete it, if it is getting too large.\n\011\011|It will be recreated the next time you compile something with V.\n\011\011|You can change its location with the VCACHE environment variable.\n\011\011")); - Option_void _t2 = os__write_file(readme_file, readme_content); + _option_void _t2 = os__write_file(readme_file, readme_content); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -31979,7 +32020,7 @@ void v__vcache__CacheManager_set_temporary_options(v__vcache__CacheManager* cm, string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key) { string* _t2 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, cm->k2cpath), &(string[]){key})); - Option_string _t1 = {0}; + _option_string _t1 = {0}; if (_t2) { *((string*)&_t1.data) = *((string*)_t2); } else { @@ -32001,7 +32042,7 @@ string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key string cprefix_folder = os__join_path(cm->basepath, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){prefix}))); cpath = os__join_path(cprefix_folder, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){khash}))); if (!os__is_dir(cprefix_folder)) { - Option_void _t3 = os__mkdir_all(cprefix_folder); + _option_void _t3 = os__mkdir_all(cprefix_folder); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; _v_panic(IError_str(err)); @@ -32010,7 +32051,7 @@ string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key } ; - Option_void _t4 = os__chmod(cprefix_folder, 0777); + _option_void _t4 = os__chmod(cprefix_folder, 0777); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; _v_panic(IError_str(err)); @@ -32038,53 +32079,53 @@ string v__vcache__CacheManager_postfix_with_key2cpath(v__vcache__CacheManager* c return _t1; } -Option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key) { +_option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key) { string fpath = v__vcache__CacheManager_postfix_with_key2cpath(cm, postfix, key); ; if (!os__exists(fpath)) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("does not exist yet")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("does not exist yet")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t2; - opt_ok(&(string[]) { fpath }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { fpath }, (_option*)(&_t2), sizeof(string)); return _t2; } -Option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content) { +_option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content) { string fpath = v__vcache__CacheManager_postfix_with_key2cpath(cm, postfix, key); - Option_void _t1 = os__write_file(fpath, content); + _option_void _t1 = os__write_file(fpath, content); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_string _t2; + _option_string _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } ; ; - Option_string _t3; - opt_ok(&(string[]) { fpath }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { fpath }, (_option*)(&_t3), sizeof(string)); return _t3; } -Option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key) { - Option_string _t1 = v__vcache__CacheManager_exists(cm, postfix, key); +_option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key) { + _option_string _t1 = v__vcache__CacheManager_exists(cm, postfix, key); if (_t1.state != 0) { /*or block*/ - Option_string _t2; + _option_string _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } string fpath = (*(string*)_t1.data); - Option_string _t3 = os__read_file(fpath); + _option_string _t3 = os__read_file(fpath); if (_t3.state != 0) { /*or block*/ - Option_string _t4; + _option_string _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } string content = (*(string*)_t3.data); ; - Option_string _t5; - opt_ok(&(string[]) { content }, (Option*)(&_t5), sizeof(string)); + _option_string _t5; + opt_ok2(&(string[]) { content }, (_option*)(&_t5), sizeof(string)); return _t5; } @@ -32098,24 +32139,24 @@ VV_LOCAL_SYMBOL int v__vcache__mypid(void) { return _t1; } -Option_v__vmod__Manifest v__vmod__from_file(string vmod_path) { +_option_v__vmod__Manifest v__vmod__from_file(string vmod_path) { if (!os__exists(vmod_path)) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error(_SLIT("v.mod: v.mod file not found.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__vmod__Manifest){ .state=2, .err=_v_error(_SLIT("v.mod: v.mod file not found.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t2 = os__read_file(vmod_path); + _option_string _t2 = os__read_file(vmod_path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(string*) _t2.data = _SLIT(""); } string contents = (*(string*)_t2.data); - Option_v__vmod__Manifest _t3 = v__vmod__decode(contents); + _option_v__vmod__Manifest _t3 = v__vmod__decode(contents); return _t3; } -Option_v__vmod__Manifest v__vmod__decode(string contents) { +_option_v__vmod__Manifest v__vmod__decode(string contents) { v__vmod__Parser parser = ((v__vmod__Parser){.file_path = (string){.str=(byteptr)"", .is_lit=1},.scanner = ((v__vmod__Scanner){.pos = 0,.line = 1,.text = contents,.inside_text = 0,.tokens = __new_array(0, 0, sizeof(v__vmod__Token)),}),}); - Option_v__vmod__Manifest _t1 = v__vmod__Parser_parse(&parser); + _option_v__vmod__Manifest _t1 = v__vmod__Parser_parse(&parser); return _t1; } @@ -32228,11 +32269,11 @@ VV_LOCAL_SYMBOL void v__vmod__Scanner_scan_all(v__vmod__Scanner* s) { v__vmod__Scanner_tokenize(s, v__vmod__TokenKind__eof, _SLIT("eof")); } -VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content(Array_v__vmod__Token tokens, int st_idx) { +VV_LOCAL_SYMBOL _option_multi_return_Array_string_int v__vmod__get_array_content(Array_v__vmod__Token tokens, int st_idx) { 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, /*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} }; + 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 (;;) { @@ -32241,7 +32282,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, /*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} }; + 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)); } @@ -32250,23 +32291,23 @@ 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, /*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} }; + 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; - opt_ok(&(multi_return_Array_string_int/*X*/[]) { (multi_return_Array_string_int){.arg0=vals, .arg1=idx} }, (Option*)(&_t5), sizeof(multi_return_Array_string_int)); + _option_multi_return_Array_string_int _t5; + opt_ok2(&(multi_return_Array_string_int/*X*/[]) { (multi_return_Array_string_int){.arg0=vals, .arg1=idx} }, (_option*)(&_t5), sizeof(multi_return_Array_string_int)); return _t5; } -VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* p) { +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, /*115 &string*/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, /*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} }; + 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 (;;) { @@ -32275,7 +32316,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, /*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} }; + 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; @@ -32286,7 +32327,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, /*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} }; + 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; @@ -32309,9 +32350,9 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* mn.author = field_value; } else if (string__eq(field_name, _SLIT("dependencies"))) { - Option_multi_return_Array_string_int _t5 = v__vmod__get_array_content(tokens, i + 1); + _option_multi_return_Array_string_int _t5 = v__vmod__get_array_content(tokens, i + 1); if (_t5.state != 0) { /*or block*/ - Option_v__vmod__Manifest _t6; + _option_v__vmod__Manifest _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } @@ -32325,9 +32366,9 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* } else { if ((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__labr) { - Option_multi_return_Array_string_int _t7 = v__vmod__get_array_content(tokens, i + 1); + _option_multi_return_Array_string_int _t7 = v__vmod__get_array_content(tokens, i + 1); if (_t7.state != 0) { /*or block*/ - Option_v__vmod__Manifest _t8; + _option_v__vmod__Manifest _t8; memcpy(&_t8, &_t7, sizeof(Option)); return _t8; } @@ -32346,17 +32387,17 @@ 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, /*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} }; + 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, /*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} }; + 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; - opt_ok(&(v__vmod__Manifest[]) { mn }, (Option*)(&_t11), sizeof(v__vmod__Manifest)); + _option_v__vmod__Manifest _t11; + opt_ok2(&(v__vmod__Manifest[]) { mn }, (_option*)(&_t11), sizeof(v__vmod__Manifest)); return _t11; } @@ -32500,7 +32541,7 @@ VV_LOCAL_SYMBOL Array_string v__vmod__ModFileCacher_get_files(v__vmod__ModFileCa } Array_string files = __new_array_with_default(0, 0, sizeof(string), 0); if (os__exists(cfolder) && os__is_dir(cfolder)) { - Option_Array_string _t2; + _option_Array_string _t2; if (_t2 = os__ls(cfolder), _t2.state == 0) { Array_string listing = *(Array_string*)_t2.data; files = array_clone_to_depth(&listing, 0); @@ -32562,7 +32603,7 @@ void v__depgraph__OrderedDepMap_add(v__depgraph__OrderedDepMap* o, string name, Array_string v__depgraph__OrderedDepMap_get(v__depgraph__OrderedDepMap* o, string name) { Array_string* _t2 = (Array_string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, o->data), &(string[]){name})); - Option_Array_string _t1 = {0}; + _option_Array_string _t1 = {0}; if (_t2) { *((Array_string*)&_t1.data) = *((Array_string*)_t2); } else { @@ -34926,21 +34967,21 @@ u32 math__get_high_word(f64 f) { return ((u32)(math__f64_bits(f) >> 32U)); } -VV_LOCAL_SYMBOL Option_string v__pkgconfig__desc(string mod) { +VV_LOCAL_SYMBOL _option_string v__pkgconfig__desc(string mod) { v__pkgconfig__Options options = ((v__pkgconfig__Options){.path = (string){.str=(byteptr)"", .is_lit=1},.debug = 0,.norecurse = 0,.only_description = true,.use_default_paths = true,}); - Option_v__pkgconfig__PkgConfig_ptr _t1 = v__pkgconfig__load(mod, options); + _option_v__pkgconfig__PkgConfig_ptr _t1 = v__pkgconfig__load(mod, options); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_string){ .state=2, .err=_v_error(_SLIT("cannot parse")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("cannot parse")), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__pkgconfig__PkgConfig* pc = (*(v__pkgconfig__PkgConfig**)_t1.data); - Option_string _t3; - opt_ok(&(string[]) { pc->description }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { pc->description }, (_option*)(&_t3), sizeof(string)); return _t3; } -Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { +_option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { flag__FlagParser* fp = flag__new_flag_parser(args); flag__FlagParser_application(fp, _SLIT("pkgconfig")); flag__FlagParser_version(fp, _const_v__pkgconfig__version); @@ -34956,7 +34997,7 @@ Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { if (opt->description) { for (int _t1 = 0; _t1 < modules.len; ++_t1) { string mod = ((string*)modules.data)[_t1]; - Option_string _t2 = v__pkgconfig__desc(mod); + _option_string _t2 = v__pkgconfig__desc(mod); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; continue; @@ -34970,25 +35011,25 @@ Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { m->res = Array_string_join(modules, _SLIT("\n")); } } else if (opt->args.len == 0) { - return (Option_v__pkgconfig__Main_ptr){ .state=2, .err=_v_error(_SLIT("No packages given")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__pkgconfig__Main_ptr){ .state=2, .err=_v_error(_SLIT("No packages given")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__pkgconfig__Main_ptr _t4; - opt_ok(&(v__pkgconfig__Main*[]) { m }, (Option*)(&_t4), sizeof(v__pkgconfig__Main*)); + _option_v__pkgconfig__Main_ptr _t4; + opt_ok2(&(v__pkgconfig__Main*[]) { m }, (_option*)(&_t4), sizeof(v__pkgconfig__Main*)); return _t4; } -Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { +_option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { v__pkgconfig__Options options = ((v__pkgconfig__Options){.path = (string){.str=(byteptr)"", .is_lit=1},.debug = m->opt->debug,.norecurse = 0,.only_description = 0,.use_default_paths = true,}); v__pkgconfig__MainOptions* opt = m->opt; v__pkgconfig__PkgConfig* pc = ((v__pkgconfig__PkgConfig*)(0)); string res = m->res; for (int _t1 = 0; _t1 < opt->args.len; ++_t1) { string arg = ((string*)opt->args.data)[_t1]; - Option_v__pkgconfig__PkgConfig_ptr _t2 = v__pkgconfig__load(arg, options); + _option_v__pkgconfig__PkgConfig_ptr _t2 = v__pkgconfig__load(arg, options); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; if (!opt->exists) { - return (Option_string){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } continue; } @@ -35001,9 +35042,9 @@ Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { res = /*f*/string__plus(res, pcdep->description); } if (pc != 0) { - Option_string _t4 = v__pkgconfig__PkgConfig_extend(pc, pcdep); + _option_string _t4 = v__pkgconfig__PkgConfig_extend(pc, pcdep); if (_t4.state != 0) { /*or block*/ - Option_string _t5; + _option_string _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } @@ -35014,32 +35055,32 @@ Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { } } if (opt->exists) { - Option_string _t6; - opt_ok(&(string[]) { res }, (Option*)(&_t6), sizeof(string)); + _option_string _t6; + opt_ok2(&(string[]) { res }, (_option*)(&_t6), sizeof(string)); return _t6; } if ((opt->exactversion).len != 0) { if (!string__eq(pc->version, opt->exactversion)) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t8; - opt_ok(&(string[]) { res }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(string[]) { res }, (_option*)(&_t8), sizeof(string)); return _t8; } if ((opt->atleast).len != 0) { if (v__pkgconfig__PkgConfig_atleast(pc, opt->atleast)) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t10; - opt_ok(&(string[]) { res }, (Option*)(&_t10), sizeof(string)); + _option_string _t10; + opt_ok2(&(string[]) { res }, (_option*)(&_t10), sizeof(string)); return _t10; } if ((opt->atleastpc).len != 0) { if (v__pkgconfig__atleast(opt->atleastpc)) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t12; - opt_ok(&(string[]) { res }, (Option*)(&_t12), sizeof(string)); + _option_string _t12; + opt_ok2(&(string[]) { res }, (_option*)(&_t12), sizeof(string)); return _t12; } if (opt->variables) { @@ -35077,8 +35118,8 @@ Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { if (opt->modversion) { array_push((array*)&r, _MOV((string[]){ string_clone(pc->version) })); } - Option_string _t22; - opt_ok(&(string[]) { string__plus(res, Array_string_join(r, _SLIT(" "))) }, (Option*)(&_t22), sizeof(string)); + _option_string _t22; + opt_ok2(&(string[]) { string__plus(res, Array_string_join(r, _SLIT(" "))) }, (_option*)(&_t22), sizeof(string)); return _t22; } @@ -35158,14 +35199,14 @@ VV_LOCAL_SYMBOL string v__pkgconfig__PkgConfig_parse_line(v__pkgconfig__PkgConfi string r = string_trim_space(s); for (;;) { if (!(string_contains(r, _SLIT("${")))) break; - Option_int _t1 = string_index(r, _SLIT("${")); + _option_int _t1 = string_index(r, _SLIT("${")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; break; } int tok0 = (*(int*)_t1.data); - Option_int _t2 = string_index(string_substr(r, tok0, (r).len), _SLIT("}")); + _option_int _t2 = string_index(string_substr(r, tok0, (r).len), _SLIT("}")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; break; @@ -35190,7 +35231,7 @@ VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_setvar(v__pkgconfig__PkgConfig* pc, } VV_LOCAL_SYMBOL bool v__pkgconfig__PkgConfig_parse(v__pkgconfig__PkgConfig* pc, string file) { - Option_string _t1 = os__read_file(file); + _option_string _t1 = os__read_file(file); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -35246,11 +35287,11 @@ VV_LOCAL_SYMBOL bool v__pkgconfig__PkgConfig_parse(v__pkgconfig__PkgConfig* pc, return _t5; } -VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgConfig* pc, string pkgname) { +VV_LOCAL_SYMBOL _option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgConfig* pc, string pkgname) { if (string_ends_with(pkgname, _SLIT(".pc"))) { if (os__exists(pkgname)) { - Option_string _t1; - opt_ok(&(string[]) { pkgname }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { pkgname }, (_option*)(&_t1), sizeof(string)); return _t1; } } else { @@ -35261,17 +35302,17 @@ VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgC string path = ((string*)pc->paths.data)[_t3]; 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)); + _option_string _t4; + opt_ok2(&(string[]) { file }, (_option*)(&_t4), sizeof(string)); return _t4; } } } - 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} }; + 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) { - Option_semver__Version _t1 = semver__from(_const_v__pkgconfig__version); + _option_semver__Version _t1 = semver__from(_const_v__pkgconfig__version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -35279,7 +35320,7 @@ bool v__pkgconfig__atleast(string v) { } semver__Version v0 = (*(semver__Version*)_t1.data); - Option_semver__Version _t3 = semver__from(v); + _option_semver__Version _t3 = semver__from(v); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; bool _t4 = false; @@ -35292,7 +35333,7 @@ bool v__pkgconfig__atleast(string v) { } bool v__pkgconfig__PkgConfig_atleast(v__pkgconfig__PkgConfig* pc, string v) { - Option_semver__Version _t1 = semver__from(pc->version); + _option_semver__Version _t1 = semver__from(pc->version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -35300,7 +35341,7 @@ bool v__pkgconfig__PkgConfig_atleast(v__pkgconfig__PkgConfig* pc, string v) { } semver__Version v0 = (*(semver__Version*)_t1.data); - Option_semver__Version _t3 = semver__from(v); + _option_semver__Version _t3 = semver__from(v); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; bool _t4 = false; @@ -35312,7 +35353,7 @@ bool v__pkgconfig__PkgConfig_atleast(v__pkgconfig__PkgConfig* pc, string v) { return _t5; } -Option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkgconfig__PkgConfig* pcdep) { +_option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkgconfig__PkgConfig* pcdep) { for (int _t1 = 0; _t1 < pcdep->cflags.len; ++_t1) { string flag = ((string*)pcdep->cflags.data)[_t1]; if (Array_string_index(pc->cflags, flag) == -1) { @@ -35331,15 +35372,15 @@ Option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkg array_push((array*)&pc->libs_private, _MOV((string[]){ string_clone(lib) })); } } - return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__PkgConfig* pc) { +VV_LOCAL_SYMBOL _option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__PkgConfig* pc) { for (int _t1 = 0; _t1 < pc->requires.len; ++_t1) { string dep = ((string*)pc->requires.data)[_t1]; - Option_void _t2 = v__pkgconfig__PkgConfig_load_require(pc, dep); + _option_void _t2 = v__pkgconfig__PkgConfig_load_require(pc, dep); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { - Option_void _t3; + _option_void _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } @@ -35348,50 +35389,50 @@ VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__ } for (int _t4 = 0; _t4 < pc->requires_private.len; ++_t4) { string dep = ((string*)pc->requires_private.data)[_t4]; - Option_void _t5 = v__pkgconfig__PkgConfig_load_require(pc, dep); + _option_void _t5 = v__pkgconfig__PkgConfig_load_require(pc, dep); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { - Option_void _t6; + _option_void _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } ; } - return (Option_void){0}; + return (_option_void){0}; } -VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__PkgConfig* pc, string dep) { +VV_LOCAL_SYMBOL _option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__PkgConfig* pc, string dep) { v__pkgconfig__PkgConfig pcdep = ((v__pkgconfig__PkgConfig){.options = (v__pkgconfig__Options){.path = (string){.str=(byteptr)"", .is_lit=1},.debug = 0,.norecurse = 0,.only_description = 0,.use_default_paths = true,},.name = (string){.str=(byteptr)"", .is_lit=1},.modname = (string){.str=(byteptr)"", .is_lit=1},.url = (string){.str=(byteptr)"", .is_lit=1},.version = (string){.str=(byteptr)"", .is_lit=1},.description = (string){.str=(byteptr)"", .is_lit=1},.libs = __new_array(0, 0, sizeof(string)),.libs_private = __new_array(0, 0, sizeof(string)),.cflags = __new_array(0, 0, sizeof(string)),.paths = pc->paths,.vars = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.requires = __new_array(0, 0, sizeof(string)),.requires_private = __new_array(0, 0, sizeof(string)),.conflicts = __new_array(0, 0, sizeof(string)),}); - Option_string _t1 = v__pkgconfig__PkgConfig_resolve(&pcdep, dep); + _option_string _t1 = v__pkgconfig__PkgConfig_resolve(&pcdep, dep); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (pc->options.debug) { 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 "), /*115 &string*/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 \""), /*115 &string*/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); + _option_void _t4 = v__pkgconfig__PkgConfig_load_requires(&pcdep); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { - Option_void _t5; + _option_void _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } ; - Option_string _t6 = v__pkgconfig__PkgConfig_extend(pc, (voidptr)&/*qq*/pcdep); + _option_string _t6 = v__pkgconfig__PkgConfig_extend(pc, (voidptr)&/*qq*/pcdep); if (_t6.state != 0) { /*or block*/ - Option_void _t7; + _option_void _t7; memcpy(&_t7, &_t6, sizeof(Option)); return _t7; } (*(string*)_t6.data); - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_add_path(v__pkgconfig__PkgConfig* pc, string path) { @@ -35426,31 +35467,31 @@ VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_load_paths(v__pkgconfig__PkgConfig* } } -Option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconfig__Options options) { +_option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconfig__Options options) { v__pkgconfig__PkgConfig* pc = ((v__pkgconfig__PkgConfig*)memdup(&(v__pkgconfig__PkgConfig){.options = options,.name = (string){.str=(byteptr)"", .is_lit=1},.modname = pkgname,.url = (string){.str=(byteptr)"", .is_lit=1},.version = (string){.str=(byteptr)"", .is_lit=1},.description = (string){.str=(byteptr)"", .is_lit=1},.libs = __new_array(0, 0, sizeof(string)),.libs_private = __new_array(0, 0, sizeof(string)),.cflags = __new_array(0, 0, sizeof(string)),.paths = __new_array(0, 0, sizeof(string)),.vars = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.requires = __new_array(0, 0, sizeof(string)),.requires_private = __new_array(0, 0, sizeof(string)),.conflicts = __new_array(0, 0, sizeof(string)),}, sizeof(v__pkgconfig__PkgConfig))); v__pkgconfig__PkgConfig_load_paths(pc); - Option_string _t1 = v__pkgconfig__PkgConfig_resolve(pc, pkgname); + _option_string _t1 = v__pkgconfig__PkgConfig_resolve(pc, pkgname); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_v__pkgconfig__PkgConfig_ptr){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__pkgconfig__PkgConfig_ptr){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } 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 \""), /*115 &string*/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); + _option_void _t4 = v__pkgconfig__PkgConfig_load_requires(pc); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { - Option_v__pkgconfig__PkgConfig_ptr _t5; + _option_v__pkgconfig__PkgConfig_ptr _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } ; } - Option_v__pkgconfig__PkgConfig_ptr _t6; - opt_ok(&(v__pkgconfig__PkgConfig*[]) { pc }, (Option*)(&_t6), sizeof(v__pkgconfig__PkgConfig*)); + _option_v__pkgconfig__PkgConfig_ptr _t6; + opt_ok2(&(v__pkgconfig__PkgConfig*[]) { pc }, (_option*)(&_t6), sizeof(v__pkgconfig__PkgConfig*)); return _t6; } @@ -35460,7 +35501,7 @@ Array_string v__pkgconfig__list(void) { Array_string modules = __new_array_with_default(0, 0, sizeof(string), 0); for (int _t1 = 0; _t1 < pc->paths.len; ++_t1) { string path = ((string*)pc->paths.data)[_t1]; - Option_Array_string _t2 = os__ls(path); + _option_Array_string _t2 = os__ls(path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; continue; @@ -36024,12 +36065,12 @@ inline time__Duration time__Time__minus(time__Time lhs, time__Time rhs) { return _t1; } -Option_time__Time time__parse_rfc3339(string s) { +_option_time__Time time__parse_rfc3339(string s) { if ((s).len == 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; } string sn = string_replace_each(s, new_array_from_c_array(4, 4, sizeof(string), _MOV((string[4]){_SLIT("t"), _SLIT("T"), _SLIT("z"), _SLIT("Z")}))); - Option_time__Time _t2 = time__parse_iso8601(sn); + _option_time__Time _t2 = time__parse_iso8601(sn); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(time__Time*) _t2.data = ((time__Time){.year = 0,.month = 0,.day = 0,.hour = 0,.minute = 0,.second = 0,.microsecond = 0,._v_unix = 0,.is_local = 0,}); @@ -36037,11 +36078,11 @@ Option_time__Time time__parse_rfc3339(string s) { time__Time t = (*(time__Time*)_t2.data); if (!time__Time__eq(t, ((time__Time){.year = 0,.month = 0,.day = 0,.hour = 0,.minute = 0,.second = 0,.microsecond = 0,._v_unix = 0,.is_local = 0,}))) { - Option_time__Time _t3; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t3), sizeof(time__Time)); + _option_time__Time _t3; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t3), sizeof(time__Time)); return _t3; } - Option_int _t4 = string_index(sn, _SLIT("T")); + _option_int _t4 = string_index(sn, _SLIT("T")); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(int*) _t4.data = -1; @@ -36050,9 +36091,9 @@ Option_time__Time time__parse_rfc3339(string s) { int t_i = (*(int*)_t4.data); Array_string parts = (t_i != -1 ? (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){string_clone(string_substr(sn, 0, t_i)), string_clone(string_substr(sn, t_i + 1, (sn).len))}))) : (string_split(sn, _SLIT(" ")))); if (!string_contains_any((*(string*)/*ee elem_sym */array_get(parts, 0)), _SLIT(" Z")) && string_contains((*(string*)/*ee elem_sym */array_get(parts, 0)), _SLIT("-"))) { - Option_multi_return_int_int_int _t5 = time__parse_iso8601_date(sn); + _option_multi_return_int_int_int _t5 = time__parse_iso8601_date(sn); if (_t5.state != 0) { /*or block*/ - Option_time__Time _t6; + _option_time__Time _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } @@ -36062,8 +36103,8 @@ Option_time__Time time__parse_rfc3339(string s) { int month = mr_1001.arg1; int day = mr_1001.arg2; t = time__new_time(((time__Time){.year = year,.month = month,.day = day,.hour = 0,.minute = 0,.second = 0,.microsecond = 0,._v_unix = 0,.is_local = 0,})); - Option_time__Time _t7; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t7), sizeof(time__Time)); + _option_time__Time _t7; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t7), sizeof(time__Time)); return _t7; } if (!string_contains((*(string*)/*ee elem_sym */array_get(parts, 0)), _SLIT("-")) && string_contains((*(string*)/*ee elem_sym */array_get(parts, 0)), _SLIT(":"))) { @@ -36073,9 +36114,9 @@ Option_time__Time time__parse_rfc3339(string s) { int microsecond_ = 0; i64 unix_offset = ((i64)(0)); bool is_local_time = true; - Option_multi_return_int_int_int_int_i64_bool _t8 = time__parse_iso8601_time((*(string*)/*ee elem_sym */array_get(parts, 0))); + _option_multi_return_int_int_int_int_i64_bool _t8 = time__parse_iso8601_time((*(string*)/*ee elem_sym */array_get(parts, 0))); if (_t8.state != 0) { /*or block*/ - Option_time__Time _t9; + _option_time__Time _t9; memcpy(&_t9, &_t8, sizeof(Option)); return _t9; } @@ -36089,8 +36130,8 @@ Option_time__Time time__parse_rfc3339(string s) { is_local_time = mr_1384.arg5; t = time__new_time(((time__Time){.year = 0,.month = 0,.day = 0,.hour = hour_,.minute = minute_,.second = second_,.microsecond = microsecond_,._v_unix = 0,.is_local = 0,})); if (is_local_time) { - Option_time__Time _t10; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t10), sizeof(time__Time)); + _option_time__Time _t10; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t10), sizeof(time__Time)); return _t10; } i64 unix_time = t._v_unix; @@ -36100,28 +36141,28 @@ Option_time__Time time__parse_rfc3339(string s) { unix_time += unix_offset; } t = time__unix2(((i64)(unix_time)), t.microsecond); - Option_time__Time _t11; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t11), sizeof(time__Time)); + _option_time__Time _t11; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t11), sizeof(time__Time)); return _t11; } - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(9), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(9), .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_time__Time time__parse(string s) { +_option_time__Time time__parse(string s) { if ((s).len == 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t2 = string_index(s, _SLIT(" ")); + _option_int _t2 = string_index(s, _SLIT(" ")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(1), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(1), .data={EMPTY_STRUCT_INITIALIZATION} }; } int pos = (*(int*)_t2.data); string symd = string_substr(s, 0, pos); Array_string ymd = string_split(symd, _SLIT("-")); if (ymd.len != 3) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(2), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(2), .data={EMPTY_STRUCT_INITIALIZATION} }; } string shms = string_substr(s, pos, (s).len); Array_string hms = string_split(shms, _SLIT(":")); @@ -36135,22 +36176,22 @@ Option_time__Time time__parse(string s) { int iminute = string_int(minute_); int isecond = string_int(second_); if (iyear > 9999 || iyear < -9999) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(3), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(3), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (imonth > 12 || imonth < 1) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(4), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(4), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (iday > 31 || iday < 1) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(5), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(5), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (ihour > 23 || ihour < 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(6), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(6), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (iminute > 59 || iminute < 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(7), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(7), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (isecond > 59 || isecond < 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(8), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(8), .data={EMPTY_STRUCT_INITIALIZATION} }; } time__Time res = time__new_time(((time__Time){ .year = iyear, @@ -36163,16 +36204,16 @@ Option_time__Time time__parse(string s) { ._v_unix = 0, .is_local = 0, })); - Option_time__Time _t11; - opt_ok(&(time__Time[]) { res }, (Option*)(&_t11), sizeof(time__Time)); + _option_time__Time _t11; + opt_ok2(&(time__Time[]) { res }, (_option*)(&_t11), sizeof(time__Time)); return _t11; } -Option_time__Time time__parse_iso8601(string s) { +_option_time__Time time__parse_iso8601(string s) { if ((s).len == 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t2 = string_index(s, _SLIT("T")); + _option_int _t2 = string_index(s, _SLIT("T")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(int*) _t2.data = -1; @@ -36181,11 +36222,11 @@ Option_time__Time time__parse_iso8601(string s) { int t_i = (*(int*)_t2.data); Array_string parts = (t_i != -1 ? (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){string_clone(string_substr(s, 0, t_i)), string_clone(string_substr(s, t_i + 1, (s).len))}))) : (string_split(s, _SLIT(" ")))); if (!(parts.len == 1 || parts.len == 2)) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(12), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(12), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_multi_return_int_int_int _t4 = time__parse_iso8601_date((*(string*)/*ee elem_sym */array_get(parts, 0))); + _option_multi_return_int_int_int _t4 = time__parse_iso8601_date((*(string*)/*ee elem_sym */array_get(parts, 0))); if (_t4.state != 0) { /*or block*/ - Option_time__Time _t5; + _option_time__Time _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } @@ -36201,9 +36242,9 @@ Option_time__Time time__parse_iso8601(string s) { i64 unix_offset = ((i64)(0)); bool is_local_time = true; if (parts.len == 2) { - Option_multi_return_int_int_int_int_i64_bool _t6 = time__parse_iso8601_time((*(string*)/*ee elem_sym */array_get(parts, 1))); + _option_multi_return_int_int_int_int_i64_bool _t6 = time__parse_iso8601_time((*(string*)/*ee elem_sym */array_get(parts, 1))); if (_t6.state != 0) { /*or block*/ - Option_time__Time _t7; + _option_time__Time _t7; memcpy(&_t7, &_t6, sizeof(Option)); return _t7; } @@ -36228,8 +36269,8 @@ Option_time__Time time__parse_iso8601(string s) { .is_local = 0, })); if (is_local_time) { - Option_time__Time _t8; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t8), sizeof(time__Time)); + _option_time__Time _t8; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t8), sizeof(time__Time)); return _t8; } i64 unix_time = t._v_unix; @@ -36239,23 +36280,23 @@ Option_time__Time time__parse_iso8601(string s) { unix_time += unix_offset; } t = time__unix2(((i64)(unix_time)), t.microsecond); - Option_time__Time _t9; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t9), sizeof(time__Time)); + _option_time__Time _t9; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t9), sizeof(time__Time)); return _t9; } -Option_time__Time time__parse_rfc2822(string s) { +_option_time__Time time__parse_rfc2822(string s) { if ((s).len == 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; } Array_string fields = string_split(s, _SLIT(" ")); if (fields.len < 5) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(1), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(1), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t3 = string_index(_const_time__months_string, (*(string*)/*ee elem_sym */array_get(fields, 2))); + _option_int _t3 = string_index(_const_time__months_string, (*(string*)/*ee elem_sym */array_get(fields, 2))); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(2), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(2), .data={EMPTY_STRUCT_INITIALIZATION} }; } int pos = (*(int*)_t3.data); @@ -36263,58 +36304,79 @@ Option_time__Time time__parse_rfc2822(string s) { { // Unsafe block u8* tmstr = malloc_noscan(s.len * 2); int count = snprintf(((char*)(tmstr)), (s.len * 2), "%s-%02d-%s %s", (*(string*)/*ee elem_sym */array_get(fields, 3)).str, mm, (*(string*)/*ee elem_sym */array_get(fields, 1)).str, (*(string*)/*ee elem_sym */array_get(fields, 4)).str); - Option_time__Time _t5 = time__parse(tos(tmstr, count)); + _option_time__Time _t5 = time__parse(tos(tmstr, count)); return _t5; } - return (Option_time__Time){0}; + return (_option_time__Time){0}; } -VV_LOCAL_SYMBOL Option_multi_return_int_int_int time__parse_iso8601_date(string s) { +VV_LOCAL_SYMBOL _option_multi_return_int_int_int time__parse_iso8601_date(string s) { int year = 0; int month = 0; int day = 0; u8 dummy = ((u8)(0)); int count = sscanf(((char*)(s.str)), "%4d-%2d-%2d%c", &year, &month, &day, &dummy); if (count != 3) { - return (Option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(10), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(10), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (year > 9999) { - return (Option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(13), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(13), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (month > 12) { - return (Option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(14), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(14), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (day > 31) { - return (Option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(15), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(15), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_multi_return_int_int_int _t5; - opt_ok(&(multi_return_int_int_int/*X*/[]) { (multi_return_int_int_int){.arg0=year, .arg1=month, .arg2=day} }, (Option*)(&_t5), sizeof(multi_return_int_int_int)); + _option_multi_return_int_int_int _t5; + opt_ok2(&(multi_return_int_int_int/*X*/[]) { (multi_return_int_int_int){.arg0=year, .arg1=month, .arg2=day} }, (_option*)(&_t5), sizeof(multi_return_int_int_int)); return _t5; } -VV_LOCAL_SYMBOL Option_multi_return_int_int_int_int_i64_bool time__parse_iso8601_time(string s) { +VV_LOCAL_SYMBOL _option_multi_return_int_int_int_int_i64_bool time__parse_iso8601_time(string s) { int hour_ = 0; int minute_ = 0; int second_ = 0; int microsecond_ = 0; + int nanosecond_ = 0; rune plus_min_z = 'a'; int offset_hour = 0; int offset_minute = 0; - int count = sscanf(((char*)(s.str)), "%2d:%2d:%2d.%6d%c%2d:%2d", &hour_, &minute_, &second_, µsecond_, ((char*)(&plus_min_z)), &offset_hour, &offset_minute); - if (count < 4) { - count = sscanf(((char*)(s.str)), "%2d:%2d:%2d%c%2d:%2d", &hour_, &minute_, &second_, ((char*)(&plus_min_z)), &offset_hour, &offset_minute); - count++; - } - if (count < 4) { - return (Option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(10), .data={EMPTY_STRUCT_INITIALIZATION} }; + int count = 0; + count = sscanf(((char*)(s.str)), "%2d:%2d:%2d.%9d%c", &hour_, &minute_, &second_, &nanosecond_, ((char*)(&plus_min_z))); + if (count == 5 && plus_min_z == 'Z') { + int ndigits = 0; + _option_int _t1; + if (_t1 = string_index(s, _SLIT(".")), _t1.state == 0) { + int pos = *(int*)_t1.data; + pos++; + for (; pos < s.len && u8_is_digit(string_at(s, pos)); pos++) { + ndigits++; + } + } + for (;;) { + if (!(ndigits < 9)) break; + nanosecond_ *= 10; + ndigits++; + } + microsecond_ = nanosecond_ / 1000; + } else { + count = sscanf(((char*)(s.str)), "%2d:%2d:%2d.%6d%c%2d:%2d", &hour_, &minute_, &second_, µsecond_, ((char*)(&plus_min_z)), &offset_hour, &offset_minute); + if (count < 4) { + count = sscanf(((char*)(s.str)), "%2d:%2d:%2d%c%2d:%2d", &hour_, &minute_, &second_, ((char*)(&plus_min_z)), &offset_hour, &offset_minute); + count++; + } + if (count < 4) { + return (_option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(10), .data={EMPTY_STRUCT_INITIALIZATION} }; + } } bool is_local_time = plus_min_z == 'a' && count == 4; bool is_utc = plus_min_z == 'Z' && count == 5; if (!(count == 7 || is_local_time || is_utc)) { - return (Option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(11), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(11), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (plus_min_z != '+' && plus_min_z != '-' && !is_utc && !is_local_time) { - return (Option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(12), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(12), .data={EMPTY_STRUCT_INITIALIZATION} }; } int unix_offset = 0; if (offset_hour > 0) { @@ -36326,9 +36388,9 @@ VV_LOCAL_SYMBOL Option_multi_return_int_int_int_int_i64_bool time__parse_iso8601 if (plus_min_z == '+') { unix_offset *= -1; } - Option_multi_return_int_int_int_int_i64_bool _t4; - opt_ok(&(multi_return_int_int_int_int_i64_bool/*X*/[]) { (multi_return_int_int_int_int_i64_bool){.arg0=hour_, .arg1=minute_, .arg2=second_, .arg3=microsecond_, .arg4=unix_offset, .arg5=is_local_time} }, (Option*)(&_t4), sizeof(multi_return_int_int_int_int_i64_bool)); - return _t4; + _option_multi_return_int_int_int_int_i64_bool _t5; + opt_ok2(&(multi_return_int_int_int_int_i64_bool/*X*/[]) { (multi_return_int_int_int_int_i64_bool){.arg0=hour_, .arg1=minute_, .arg2=second_, .arg3=microsecond_, .arg4=unix_offset, .arg5=is_local_time} }, (_option*)(&_t5), sizeof(multi_return_int_int_int_int_i64_bool)); + return _t5; } string time__TimeParseError_msg(time__TimeParseError err) { @@ -36717,14 +36779,14 @@ bool time__is_leap_year(int year) { return _t1; } -Option_int time__days_in_month(int month, 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: "), /*100 &int*/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; - Option_int _t2; - opt_ok(&(int[]) { res }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { res }, (_option*)(&_t2), sizeof(int)); return _t2; } @@ -37082,12 +37144,12 @@ VV_LOCAL_SYMBOL multi_return_int_int_int time__calculate_time_from_offset(i64 se return (multi_return_int_int_int){.arg0=((int)(hour_)), .arg1=((int)(min)), .arg2=((int)(second_offset))}; } -Option_string v__util__diff__find_working_diff_command(void) { +_option_string v__util__diff__find_working_diff_command(void) { string env_difftool = os__getenv(_SLIT("VDIFF_TOOL")); 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, /*115 &string*/0xfe10, {.d_s = env_difftool}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(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); @@ -37099,8 +37161,8 @@ Option_string v__util__diff__find_working_diff_command(void) { string diffcmd = ((string*)known_diff_tools.data)[_t4]; if (string__eq(diffcmd, _SLIT("opendiff"))) { if (v__util__diff__opendiff_exists()) { - Option_string _t5; - opt_ok(&(string[]) { diffcmd }, (Option*)(&_t5), sizeof(string)); + _option_string _t5; + opt_ok2(&(string[]) { diffcmd }, (_option*)(&_t5), sizeof(string)); return _t5; } continue; @@ -37110,20 +37172,20 @@ Option_string v__util__diff__find_working_diff_command(void) { 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 "), /*115 &string*/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, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT(" -d"), 0, { .d_c = 0 }}})) }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(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, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(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; } } - return (Option_string){ .state=2, .err=_v_error(_SLIT("No working \"diff\" command found")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("No working \"diff\" command found")), .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL bool v__util__diff__opendiff_exists(void) { @@ -37159,7 +37221,7 @@ string v__util__diff__color_compare_files(string diff_cmd, string file1, string string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefix, string expected, string found) { string cdir = os__join_path_single(os__cache_dir(), unique_prefix); - Option_bool _t1 = os__mkdir(cdir); + _option_bool _t1 = os__mkdir(cdir); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; } @@ -37168,7 +37230,7 @@ string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefi u64 ctime = time__sys_mono_now(); 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); + _option_void _t2 = os__write_file(e_file, expected); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -37177,7 +37239,7 @@ string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefi } ; - Option_void _t3 = os__write_file(f_file, found); + _option_void _t3 = os__write_file(f_file, found); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; _v_panic(IError_str(err)); @@ -37187,7 +37249,7 @@ string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefi ; string res = v__util__diff__color_compare_files(diff_cmd, e_file, f_file); - Option_void _t4 = os__rmdir_all(cdir); + _option_void _t4 = os__rmdir_all(cdir); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; } @@ -37411,7 +37473,7 @@ VV_LOCAL_SYMBOL string rand__internal_string_from_set(rand__PRNG* rng, string ch u8* buf = malloc_noscan(len + 1); for (int i = 0; i < len; ++i) { { // Unsafe block - Option_int _t2 = rand__intn(charset.len); + _option_int _t2 = rand__intn(charset.len); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(int*) _t2.data = 0; @@ -37482,14 +37544,14 @@ VV_LOCAL_SYMBOL void rand__read_internal(rand__PRNG* rng, Array_u8* buf) { } // Attr: [inline] -inline Option_Array_u8 rand__PRNG_bytes(rand__PRNG* rng, int bytes_needed) { +inline _option_Array_u8 rand__PRNG_bytes(rand__PRNG* rng, int bytes_needed) { if (bytes_needed < 0) { - return (Option_Array_u8){ .state=2, .err=_v_error(_SLIT("can not read < 0 random bytes")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_u8){ .state=2, .err=_v_error(_SLIT("can not read < 0 random bytes")), .data={EMPTY_STRUCT_INITIALIZATION} }; } Array_u8 buffer = __new_array_with_default(bytes_needed, 0, sizeof(u8), 0); rand__read_internal(rng, &/*arr*/buffer); - Option_Array_u8 _t2; - opt_ok(&(Array_u8[]) { buffer }, (Option*)(&_t2), sizeof(Array_u8)); + _option_Array_u8 _t2; + opt_ok2(&(Array_u8[]) { buffer }, (_option*)(&_t2), sizeof(Array_u8)); return _t2; } @@ -37498,17 +37560,17 @@ void rand__PRNG_read(rand__PRNG* rng, Array_u8* buf) { } // Attr: [inline] -inline Option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max) { +inline _option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max) { if (max == 0U) { - return (Option_u32){ .state=2, .err=_v_error(_SLIT("max must be positive integer")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u32){ .state=2, .err=_v_error(_SLIT("max must be positive integer")), .data={EMPTY_STRUCT_INITIALIZATION} }; } int bit_len = math__bits__len_32(max); if (bit_len == 32) { for (;;) { u32 value = rand__PRNG_name_table[rng->_typ]._method_u32(rng->_object); if (value < max) { - Option_u32 _t2; - opt_ok(&(u32[]) { value }, (Option*)(&_t2), sizeof(u32)); + _option_u32 _t2; + opt_ok2(&(u32[]) { value }, (_option*)(&_t2), sizeof(u32)); return _t2; } } @@ -37517,29 +37579,29 @@ inline Option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max) { for (;;) { u32 value = (rand__PRNG_name_table[rng->_typ]._method_u32(rng->_object) & mask); if (value < max) { - Option_u32 _t3; - opt_ok(&(u32[]) { value }, (Option*)(&_t3), sizeof(u32)); + _option_u32 _t3; + opt_ok2(&(u32[]) { value }, (_option*)(&_t3), sizeof(u32)); return _t3; } } } - Option_u32 _t4; - opt_ok(&(u32[]) { ((u32)(0U)) }, (Option*)(&_t4), sizeof(u32)); + _option_u32 _t4; + opt_ok2(&(u32[]) { ((u32)(0U)) }, (_option*)(&_t4), sizeof(u32)); return _t4; } // Attr: [inline] -inline Option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max) { +inline _option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max) { if (max == 0U) { - return (Option_u64){ .state=2, .err=_v_error(_SLIT("max must be positive integer")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u64){ .state=2, .err=_v_error(_SLIT("max must be positive integer")), .data={EMPTY_STRUCT_INITIALIZATION} }; } int bit_len = math__bits__len_64(max); if (bit_len == 64) { for (;;) { u64 value = rand__PRNG_name_table[rng->_typ]._method_u64(rng->_object); if (value < max) { - Option_u64 _t2; - opt_ok(&(u64[]) { value }, (Option*)(&_t2), sizeof(u64)); + _option_u64 _t2; + opt_ok2(&(u64[]) { value }, (_option*)(&_t2), sizeof(u64)); return _t2; } } @@ -37548,48 +37610,48 @@ inline Option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max) { for (;;) { u64 value = (rand__PRNG_name_table[rng->_typ]._method_u64(rng->_object) & mask); if (value < max) { - Option_u64 _t3; - opt_ok(&(u64[]) { value }, (Option*)(&_t3), sizeof(u64)); + _option_u64 _t3; + opt_ok2(&(u64[]) { value }, (_option*)(&_t3), sizeof(u64)); return _t3; } } } - Option_u64 _t4; - opt_ok(&(u64[]) { ((u64)(0U)) }, (Option*)(&_t4), sizeof(u64)); + _option_u64 _t4; + opt_ok2(&(u64[]) { ((u64)(0U)) }, (_option*)(&_t4), sizeof(u64)); return _t4; } // Attr: [inline] -inline Option_u32 rand__PRNG_u32_in_range(rand__PRNG* rng, u32 min, u32 max) { +inline _option_u32 rand__PRNG_u32_in_range(rand__PRNG* rng, u32 min, u32 max) { if (max <= min) { - return (Option_u32){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u32){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_u32 _t3 = rand__PRNG_u32n(rng, max - min); + _option_u32 _t3 = rand__PRNG_u32n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_u32 _t4; + _option_u32 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_u32 _t2; - opt_ok(&(u32[]) { min + (*(u32*)_t3.data) }, (Option*)(&_t2), sizeof(u32)); + _option_u32 _t2; + opt_ok2(&(u32[]) { min + (*(u32*)_t3.data) }, (_option*)(&_t2), sizeof(u32)); return _t2; } // Attr: [inline] -inline Option_u64 rand__PRNG_u64_in_range(rand__PRNG* rng, u64 min, u64 max) { +inline _option_u64 rand__PRNG_u64_in_range(rand__PRNG* rng, u64 min, u64 max) { if (max <= min) { - return (Option_u64){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u64){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_u64 _t3 = rand__PRNG_u64n(rng, max - min); + _option_u64 _t3 = rand__PRNG_u64n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_u64 _t4; + _option_u64 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_u64 _t2; - opt_ok(&(u64[]) { min + (*(u64*)_t3.data) }, (Option*)(&_t2), sizeof(u64)); + _option_u64 _t2; + opt_ok2(&(u64[]) { min + (*(u64*)_t3.data) }, (_option*)(&_t2), sizeof(u64)); return _t2; } @@ -37630,70 +37692,70 @@ inline i64 rand__PRNG_int63(rand__PRNG* rng) { } // Attr: [inline] -inline Option_int rand__PRNG_intn(rand__PRNG* rng, int max) { +inline _option_int rand__PRNG_intn(rand__PRNG* rng, int max) { if (max <= 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("max has to be positive.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("max has to be positive.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_u32 _t3 = rand__PRNG_u32n(rng, ((u32)(max))); + _option_u32 _t3 = rand__PRNG_u32n(rng, ((u32)(max))); if (_t3.state != 0) { /*or block*/ - Option_int _t4; + _option_int _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_int _t2; - opt_ok(&(int[]) { ((int)( (*(u32*)_t3.data))) }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { ((int)( (*(u32*)_t3.data))) }, (_option*)(&_t2), sizeof(int)); return _t2; } // Attr: [inline] -inline Option_i64 rand__PRNG_i64n(rand__PRNG* rng, i64 max) { +inline _option_i64 rand__PRNG_i64n(rand__PRNG* rng, i64 max) { if (max <= 0) { - return (Option_i64){ .state=2, .err=_v_error(_SLIT("max has to be positive.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=_v_error(_SLIT("max has to be positive.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_u64 _t3 = rand__PRNG_u64n(rng, ((u64)(max))); + _option_u64 _t3 = rand__PRNG_u64n(rng, ((u64)(max))); if (_t3.state != 0) { /*or block*/ - Option_i64 _t4; + _option_i64 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_i64 _t2; - opt_ok(&(i64[]) { ((i64)( (*(u64*)_t3.data))) }, (Option*)(&_t2), sizeof(i64)); + _option_i64 _t2; + opt_ok2(&(i64[]) { ((i64)( (*(u64*)_t3.data))) }, (_option*)(&_t2), sizeof(i64)); return _t2; } // Attr: [inline] -inline Option_int rand__PRNG_int_in_range(rand__PRNG* rng, int min, int max) { +inline _option_int rand__PRNG_int_in_range(rand__PRNG* rng, int min, int max) { if (max <= min) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t3 = rand__PRNG_intn(rng, max - min); + _option_int _t3 = rand__PRNG_intn(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_int _t4; + _option_int _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_int _t2; - opt_ok(&(int[]) { min + (*(int*)_t3.data) }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { min + (*(int*)_t3.data) }, (_option*)(&_t2), sizeof(int)); return _t2; } // Attr: [inline] -inline Option_i64 rand__PRNG_i64_in_range(rand__PRNG* rng, i64 min, i64 max) { +inline _option_i64 rand__PRNG_i64_in_range(rand__PRNG* rng, i64 min, i64 max) { if (max <= min) { - return (Option_i64){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_i64 _t3 = rand__PRNG_i64n(rng, max - min); + _option_i64 _t3 = rand__PRNG_i64n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_i64 _t4; + _option_i64 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_i64 _t2; - opt_ok(&(i64[]) { min + (*(i64*)_t3.data) }, (Option*)(&_t2), sizeof(i64)); + _option_i64 _t2; + opt_ok2(&(i64[]) { min + (*(i64*)_t3.data) }, (_option*)(&_t2), sizeof(i64)); return _t2; } @@ -37710,56 +37772,56 @@ inline f64 rand__PRNG_f64(rand__PRNG* rng) { } // Attr: [inline] -inline Option_f32 rand__PRNG_f32n(rand__PRNG* rng, f32 max) { +inline _option_f32 rand__PRNG_f32n(rand__PRNG* rng, f32 max) { if (max < 0) { - return (Option_f32){ .state=2, .err=_v_error(_SLIT("max has to be non-negative.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f32){ .state=2, .err=_v_error(_SLIT("max has to be non-negative.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_f32 _t2; - opt_ok(&(f32[]) { rand__PRNG_f32(rng) * max }, (Option*)(&_t2), sizeof(f32)); + _option_f32 _t2; + opt_ok2(&(f32[]) { rand__PRNG_f32(rng) * max }, (_option*)(&_t2), sizeof(f32)); return _t2; } // Attr: [inline] -inline Option_f64 rand__PRNG_f64n(rand__PRNG* rng, f64 max) { +inline _option_f64 rand__PRNG_f64n(rand__PRNG* rng, f64 max) { if (max < 0) { - return (Option_f64){ .state=2, .err=_v_error(_SLIT("max has to be non-negative.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_v_error(_SLIT("max has to be non-negative.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_f64 _t2; - opt_ok(&(f64[]) { rand__PRNG_f64(rng) * max }, (Option*)(&_t2), sizeof(f64)); + _option_f64 _t2; + opt_ok2(&(f64[]) { rand__PRNG_f64(rng) * max }, (_option*)(&_t2), sizeof(f64)); return _t2; } // Attr: [inline] -inline Option_f32 rand__PRNG_f32_in_range(rand__PRNG* rng, f32 min, f32 max) { +inline _option_f32 rand__PRNG_f32_in_range(rand__PRNG* rng, f32 min, f32 max) { if (max < min) { - return (Option_f32){ .state=2, .err=_v_error(_SLIT("max must be greater than or equal to min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f32){ .state=2, .err=_v_error(_SLIT("max must be greater than or equal to min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_f32 _t3 = rand__PRNG_f32n(rng, max - min); + _option_f32 _t3 = rand__PRNG_f32n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_f32 _t4; + _option_f32 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_f32 _t2; - opt_ok(&(f32[]) { min + (*(f32*)_t3.data) }, (Option*)(&_t2), sizeof(f32)); + _option_f32 _t2; + opt_ok2(&(f32[]) { min + (*(f32*)_t3.data) }, (_option*)(&_t2), sizeof(f32)); return _t2; } // Attr: [inline] -inline Option_f64 rand__PRNG_f64_in_range(rand__PRNG* rng, f64 min, f64 max) { +inline _option_f64 rand__PRNG_f64_in_range(rand__PRNG* rng, f64 min, f64 max) { if (max < min) { - return (Option_f64){ .state=2, .err=_v_error(_SLIT("max must be greater than or equal to min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_v_error(_SLIT("max must be greater than or equal to min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_f64 _t3 = rand__PRNG_f64n(rng, max - min); + _option_f64 _t3 = rand__PRNG_f64n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_f64 _t4; + _option_f64 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_f64 _t2; - opt_ok(&(f64[]) { min + (*(f64*)_t3.data) }, (Option*)(&_t2), sizeof(f64)); + _option_f64 _t2; + opt_ok2(&(f64[]) { min + (*(f64*)_t3.data) }, (_option*)(&_t2), sizeof(f64)); return _t2; } @@ -37825,23 +37887,23 @@ u64 rand__u64(void) { return _t1; } -Option_u32 rand__u32n(u32 max) { - Option_u32 _t1 = rand__PRNG_u32n(default_rng, max); +_option_u32 rand__u32n(u32 max) { + _option_u32 _t1 = rand__PRNG_u32n(default_rng, max); return _t1; } -Option_u64 rand__u64n(u64 max) { - Option_u64 _t1 = rand__PRNG_u64n(default_rng, max); +_option_u64 rand__u64n(u64 max) { + _option_u64 _t1 = rand__PRNG_u64n(default_rng, max); return _t1; } -Option_u32 rand__u32_in_range(u32 min, u32 max) { - Option_u32 _t1 = rand__PRNG_u32_in_range(default_rng, min, max); +_option_u32 rand__u32_in_range(u32 min, u32 max) { + _option_u32 _t1 = rand__PRNG_u32_in_range(default_rng, min, max); return _t1; } -Option_u64 rand__u64_in_range(u64 min, u64 max) { - Option_u64 _t1 = rand__PRNG_u64_in_range(default_rng, min, max); +_option_u64 rand__u64_in_range(u64 min, u64 max) { + _option_u64 _t1 = rand__PRNG_u64_in_range(default_rng, min, max); return _t1; } @@ -37855,8 +37917,8 @@ int rand__int(void) { return _t1; } -Option_int rand__intn(int max) { - Option_int _t1 = rand__PRNG_intn(default_rng, max); +_option_int rand__intn(int max) { + _option_int _t1 = rand__PRNG_intn(default_rng, max); return _t1; } @@ -37865,8 +37927,8 @@ u8 rand__u8(void) { return _t1; } -Option_int rand__int_in_range(int min, int max) { - Option_int _t1 = rand__PRNG_int_in_range(default_rng, min, max); +_option_int rand__int_in_range(int min, int max) { + _option_int _t1 = rand__PRNG_int_in_range(default_rng, min, max); return _t1; } @@ -37880,13 +37942,13 @@ i64 rand__i64(void) { return _t1; } -Option_i64 rand__i64n(i64 max) { - Option_i64 _t1 = rand__PRNG_i64n(default_rng, max); +_option_i64 rand__i64n(i64 max) { + _option_i64 _t1 = rand__PRNG_i64n(default_rng, max); return _t1; } -Option_i64 rand__i64_in_range(i64 min, i64 max) { - Option_i64 _t1 = rand__PRNG_i64_in_range(default_rng, min, max); +_option_i64 rand__i64_in_range(i64 min, i64 max) { + _option_i64 _t1 = rand__PRNG_i64_in_range(default_rng, min, max); return _t1; } @@ -37905,28 +37967,28 @@ f64 rand__f64(void) { return _t1; } -Option_f32 rand__f32n(f32 max) { - Option_f32 _t1 = rand__PRNG_f32n(default_rng, max); +_option_f32 rand__f32n(f32 max) { + _option_f32 _t1 = rand__PRNG_f32n(default_rng, max); return _t1; } -Option_f64 rand__f64n(f64 max) { - Option_f64 _t1 = rand__PRNG_f64n(default_rng, max); +_option_f64 rand__f64n(f64 max) { + _option_f64 _t1 = rand__PRNG_f64n(default_rng, max); return _t1; } -Option_f32 rand__f32_in_range(f32 min, f32 max) { - Option_f32 _t1 = rand__PRNG_f32_in_range(default_rng, min, max); +_option_f32 rand__f32_in_range(f32 min, f32 max) { + _option_f32 _t1 = rand__PRNG_f32_in_range(default_rng, min, max); return _t1; } -Option_f64 rand__f64_in_range(f64 min, f64 max) { - Option_f64 _t1 = rand__PRNG_f64_in_range(default_rng, min, max); +_option_f64 rand__f64_in_range(f64 min, f64 max) { + _option_f64 _t1 = rand__PRNG_f64_in_range(default_rng, min, max); return _t1; } -Option_Array_u8 rand__bytes(int bytes_needed) { - Option_Array_u8 _t1 = rand__PRNG_bytes(default_rng, bytes_needed); +_option_Array_u8 rand__bytes(int bytes_needed) { + _option_Array_u8 _t1 = rand__PRNG_bytes(default_rng, bytes_needed); return _t1; } @@ -38040,7 +38102,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) { } #endif } - string vhash = _SLIT("c405c1916"); + string vhash = _SLIT("3afb88c4e"); 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; @@ -38184,137 +38246,137 @@ string v__pref__Preferences_vcross_compiler_name(v__pref__Preferences* p) { return _t5; } -Option_v__pref__OS v__pref__os_from_string(string os_str) { +_option_v__pref__OS v__pref__os_from_string(string os_str) { if (string__eq(os_str, _SLIT("linux"))) { - Option_v__pref__OS _t1; - opt_ok(&(v__pref__OS[]) { v__pref__OS__linux }, (Option*)(&_t1), sizeof(v__pref__OS)); + _option_v__pref__OS _t1; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__linux }, (_option*)(&_t1), sizeof(v__pref__OS)); return _t1; } else if (string__eq(os_str, _SLIT("windows"))) { - Option_v__pref__OS _t2; - opt_ok(&(v__pref__OS[]) { v__pref__OS__windows }, (Option*)(&_t2), sizeof(v__pref__OS)); + _option_v__pref__OS _t2; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__windows }, (_option*)(&_t2), sizeof(v__pref__OS)); return _t2; } else if (string__eq(os_str, _SLIT("ios"))) { - Option_v__pref__OS _t3; - opt_ok(&(v__pref__OS[]) { v__pref__OS__ios }, (Option*)(&_t3), sizeof(v__pref__OS)); + _option_v__pref__OS _t3; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__ios }, (_option*)(&_t3), sizeof(v__pref__OS)); return _t3; } else if (string__eq(os_str, _SLIT("macos"))) { - Option_v__pref__OS _t4; - opt_ok(&(v__pref__OS[]) { v__pref__OS__macos }, (Option*)(&_t4), sizeof(v__pref__OS)); + _option_v__pref__OS _t4; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__macos }, (_option*)(&_t4), sizeof(v__pref__OS)); return _t4; } else if (string__eq(os_str, _SLIT("darwin"))) { - Option_v__pref__OS _t5; - opt_ok(&(v__pref__OS[]) { v__pref__OS__macos }, (Option*)(&_t5), sizeof(v__pref__OS)); + _option_v__pref__OS _t5; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__macos }, (_option*)(&_t5), sizeof(v__pref__OS)); return _t5; } else if (string__eq(os_str, _SLIT("freebsd"))) { - Option_v__pref__OS _t6; - opt_ok(&(v__pref__OS[]) { v__pref__OS__freebsd }, (Option*)(&_t6), sizeof(v__pref__OS)); + _option_v__pref__OS _t6; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__freebsd }, (_option*)(&_t6), sizeof(v__pref__OS)); return _t6; } else if (string__eq(os_str, _SLIT("openbsd"))) { - Option_v__pref__OS _t7; - opt_ok(&(v__pref__OS[]) { v__pref__OS__openbsd }, (Option*)(&_t7), sizeof(v__pref__OS)); + _option_v__pref__OS _t7; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__openbsd }, (_option*)(&_t7), sizeof(v__pref__OS)); return _t7; } else if (string__eq(os_str, _SLIT("netbsd"))) { - Option_v__pref__OS _t8; - opt_ok(&(v__pref__OS[]) { v__pref__OS__netbsd }, (Option*)(&_t8), sizeof(v__pref__OS)); + _option_v__pref__OS _t8; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__netbsd }, (_option*)(&_t8), sizeof(v__pref__OS)); return _t8; } else if (string__eq(os_str, _SLIT("dragonfly"))) { - Option_v__pref__OS _t9; - opt_ok(&(v__pref__OS[]) { v__pref__OS__dragonfly }, (Option*)(&_t9), sizeof(v__pref__OS)); + _option_v__pref__OS _t9; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__dragonfly }, (_option*)(&_t9), sizeof(v__pref__OS)); return _t9; } else if (string__eq(os_str, _SLIT("js")) || string__eq(os_str, _SLIT("js_node"))) { - Option_v__pref__OS _t10; - opt_ok(&(v__pref__OS[]) { v__pref__OS__js_node }, (Option*)(&_t10), sizeof(v__pref__OS)); + _option_v__pref__OS _t10; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__js_node }, (_option*)(&_t10), sizeof(v__pref__OS)); return _t10; } else if (string__eq(os_str, _SLIT("js_freestanding"))) { - Option_v__pref__OS _t11; - opt_ok(&(v__pref__OS[]) { v__pref__OS__js_freestanding }, (Option*)(&_t11), sizeof(v__pref__OS)); + _option_v__pref__OS _t11; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__js_freestanding }, (_option*)(&_t11), sizeof(v__pref__OS)); return _t11; } else if (string__eq(os_str, _SLIT("js_browser"))) { - Option_v__pref__OS _t12; - opt_ok(&(v__pref__OS[]) { v__pref__OS__js_browser }, (Option*)(&_t12), sizeof(v__pref__OS)); + _option_v__pref__OS _t12; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__js_browser }, (_option*)(&_t12), sizeof(v__pref__OS)); return _t12; } else if (string__eq(os_str, _SLIT("solaris"))) { - Option_v__pref__OS _t13; - opt_ok(&(v__pref__OS[]) { v__pref__OS__solaris }, (Option*)(&_t13), sizeof(v__pref__OS)); + _option_v__pref__OS _t13; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__solaris }, (_option*)(&_t13), sizeof(v__pref__OS)); return _t13; } else if (string__eq(os_str, _SLIT("serenity"))) { - Option_v__pref__OS _t14; - opt_ok(&(v__pref__OS[]) { v__pref__OS__serenity }, (Option*)(&_t14), sizeof(v__pref__OS)); + _option_v__pref__OS _t14; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__serenity }, (_option*)(&_t14), sizeof(v__pref__OS)); return _t14; } else if (string__eq(os_str, _SLIT("vinix"))) { - Option_v__pref__OS _t15; - opt_ok(&(v__pref__OS[]) { v__pref__OS__vinix }, (Option*)(&_t15), sizeof(v__pref__OS)); + _option_v__pref__OS _t15; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__vinix }, (_option*)(&_t15), sizeof(v__pref__OS)); return _t15; } else if (string__eq(os_str, _SLIT("android"))) { - Option_v__pref__OS _t16; - opt_ok(&(v__pref__OS[]) { v__pref__OS__android }, (Option*)(&_t16), sizeof(v__pref__OS)); + _option_v__pref__OS _t16; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__android }, (_option*)(&_t16), sizeof(v__pref__OS)); return _t16; } else if (string__eq(os_str, _SLIT("haiku"))) { - Option_v__pref__OS _t17; - opt_ok(&(v__pref__OS[]) { v__pref__OS__haiku }, (Option*)(&_t17), sizeof(v__pref__OS)); + _option_v__pref__OS _t17; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__haiku }, (_option*)(&_t17), sizeof(v__pref__OS)); return _t17; } else if (string__eq(os_str, _SLIT("raw"))) { - Option_v__pref__OS _t18; - opt_ok(&(v__pref__OS[]) { v__pref__OS__raw }, (Option*)(&_t18), sizeof(v__pref__OS)); + _option_v__pref__OS _t18; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__raw }, (_option*)(&_t18), sizeof(v__pref__OS)); return _t18; } else if (string__eq(os_str, _SLIT("nix"))) { - Option_v__pref__OS _t19; - opt_ok(&(v__pref__OS[]) { v__pref__OS__linux }, (Option*)(&_t19), sizeof(v__pref__OS)); + _option_v__pref__OS _t19; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__linux }, (_option*)(&_t19), sizeof(v__pref__OS)); return _t19; } else if (string__eq(os_str, _SLIT("wasm32"))) { - Option_v__pref__OS _t20; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32 }, (Option*)(&_t20), sizeof(v__pref__OS)); + _option_v__pref__OS _t20; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32 }, (_option*)(&_t20), sizeof(v__pref__OS)); return _t20; } else if (string__eq(os_str, _SLIT("wasm32-wasi"))) { - Option_v__pref__OS _t21; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32_wasi }, (Option*)(&_t21), sizeof(v__pref__OS)); + _option_v__pref__OS _t21; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32_wasi }, (_option*)(&_t21), sizeof(v__pref__OS)); return _t21; } else if (string__eq(os_str, _SLIT("wasm32-emscripten"))) { - Option_v__pref__OS _t22; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32_emscripten }, (Option*)(&_t22), sizeof(v__pref__OS)); + _option_v__pref__OS _t22; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32_emscripten }, (_option*)(&_t22), sizeof(v__pref__OS)); return _t22; } else if (string__eq(os_str, _SLIT("wasm32_wasi"))) { - Option_v__pref__OS _t23; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32_wasi }, (Option*)(&_t23), sizeof(v__pref__OS)); + _option_v__pref__OS _t23; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32_wasi }, (_option*)(&_t23), sizeof(v__pref__OS)); return _t23; } else if (string__eq(os_str, _SLIT("wasm32_emscripten"))) { - Option_v__pref__OS _t24; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32_emscripten }, (Option*)(&_t24), sizeof(v__pref__OS)); + _option_v__pref__OS _t24; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32_emscripten }, (_option*)(&_t24), sizeof(v__pref__OS)); return _t24; } else if (string__eq(os_str, _SLIT(""))) { - Option_v__pref__OS _t25; - opt_ok(&(v__pref__OS[]) { v__pref__OS___auto }, (Option*)(&_t25), sizeof(v__pref__OS)); + _option_v__pref__OS _t25; + opt_ok2(&(v__pref__OS[]) { v__pref__OS___auto }, (_option*)(&_t25), sizeof(v__pref__OS)); return _t25; } else { - 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){ .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}; + return (_option_v__pref__OS){0}; } string v__pref__OS_str(v__pref__OS o) { @@ -38634,7 +38696,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors else if (string__eq(arg, _SLIT("-arch"))) { string target_arch = os__cmdline__option(current_args, _SLIT("-arch"), _SLIT("")); i++; - Option_v__pref__Arch _t3 = v__pref__arch_from_string(target_arch); + _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 `"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); @@ -38960,7 +39022,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors else if (string__eq(arg, _SLIT("-os"))) { string target_os = os__cmdline__option(current_args, _SLIT("-os"), _SLIT("")); i++; - Option_v__pref__OS _t22 = v__pref__os_from_string(target_os); + _option_v__pref__OS _t22 = v__pref__os_from_string(target_os); if (_t22.state != 0) { /*or block*/ IError err = _t22.err; if (string__eq(target_os, _SLIT("cross"))) { @@ -39033,7 +39095,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, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sbackend}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - Option_v__pref__Backend _t28 = v__pref__backend_from_string(sbackend); + _option_v__pref__Backend _t28 = v__pref__backend_from_string(sbackend); if (_t28.state != 0) { /*or block*/ IError err = _t28.err; continue; @@ -39064,7 +39126,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors 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, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - Option_string _t32 = os__read_file(path); + _option_string _t32 = os__read_file(path); if (_t32.state != 0) { /*or block*/ IError err = _t32.err; 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 }}}))); @@ -39148,7 +39210,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } 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 _t34 = os__write_file(tmp_v_file_path, contents); + _option_void _t34 = os__write_file(tmp_v_file_path, contents); if (_t34.state != 0 && _t34.err._typ != _IError_None___index) { IError err = _t34.err; _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 }}}))); @@ -39167,7 +39229,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("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: "), /*115 &string*/0xfe10, {.d_s = tmp_exe_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); - Option_void _t36 = os__rm(tmp_exe_file_path); + _option_void _t36 = os__rm(tmp_exe_file_path); if (_t36.state != 0 && _t36.err._typ != _IError_None___index) { IError err = _t36.err; } @@ -39175,7 +39237,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: "), /*115 &string*/0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); - Option_void _t37 = os__rm(tmp_v_file_path); + _option_void _t37 = os__rm(tmp_v_file_path); if (_t37.state != 0 && _t37.err._typ != _IError_None___index) { IError err = _t37.err; } @@ -39253,62 +39315,62 @@ bool v__pref__Preferences_should_output_to_stdout(v__pref__Preferences* pref) { return _t1; } -Option_v__pref__Arch v__pref__arch_from_string(string arch_str) { +_option_v__pref__Arch v__pref__arch_from_string(string arch_str) { if (string__eq(arch_str, _SLIT("amd64")) || string__eq(arch_str, _SLIT("x86_64")) || string__eq(arch_str, _SLIT("x64")) || string__eq(arch_str, _SLIT("x86"))) { - Option_v__pref__Arch _t1; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__amd64 }, (Option*)(&_t1), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t1; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__amd64 }, (_option*)(&_t1), sizeof(v__pref__Arch)); return _t1; } else if (string__eq(arch_str, _SLIT("aarch64")) || string__eq(arch_str, _SLIT("arm64"))) { - Option_v__pref__Arch _t2; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__arm64 }, (Option*)(&_t2), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t2; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__arm64 }, (_option*)(&_t2), sizeof(v__pref__Arch)); return _t2; } else if (string__eq(arch_str, _SLIT("aarch32")) || string__eq(arch_str, _SLIT("arm32")) || string__eq(arch_str, _SLIT("arm"))) { - Option_v__pref__Arch _t3; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__arm32 }, (Option*)(&_t3), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t3; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__arm32 }, (_option*)(&_t3), sizeof(v__pref__Arch)); return _t3; } else if (string__eq(arch_str, _SLIT("rv64")) || string__eq(arch_str, _SLIT("riscv64")) || string__eq(arch_str, _SLIT("risc-v64")) || string__eq(arch_str, _SLIT("riscv")) || string__eq(arch_str, _SLIT("risc-v"))) { - Option_v__pref__Arch _t4; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__rv64 }, (Option*)(&_t4), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t4; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__rv64 }, (_option*)(&_t4), sizeof(v__pref__Arch)); return _t4; } else if (string__eq(arch_str, _SLIT("rv32")) || string__eq(arch_str, _SLIT("riscv32"))) { - Option_v__pref__Arch _t5; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__rv32 }, (Option*)(&_t5), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t5; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__rv32 }, (_option*)(&_t5), sizeof(v__pref__Arch)); return _t5; } else if (string__eq(arch_str, _SLIT("x86_32")) || string__eq(arch_str, _SLIT("x32")) || string__eq(arch_str, _SLIT("i386")) || string__eq(arch_str, _SLIT("IA-32")) || string__eq(arch_str, _SLIT("ia-32")) || string__eq(arch_str, _SLIT("ia32"))) { - Option_v__pref__Arch _t6; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__i386 }, (Option*)(&_t6), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t6; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__i386 }, (_option*)(&_t6), sizeof(v__pref__Arch)); return _t6; } else if (string__eq(arch_str, _SLIT("js")) || string__eq(arch_str, _SLIT("js_node"))) { - Option_v__pref__Arch _t7; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__js_node }, (Option*)(&_t7), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t7; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__js_node }, (_option*)(&_t7), sizeof(v__pref__Arch)); return _t7; } else if (string__eq(arch_str, _SLIT("js_browser"))) { - Option_v__pref__Arch _t8; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__js_browser }, (Option*)(&_t8), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t8; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__js_browser }, (_option*)(&_t8), sizeof(v__pref__Arch)); return _t8; } else if (string__eq(arch_str, _SLIT("js_freestanding"))) { - Option_v__pref__Arch _t9; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__js_freestanding }, (Option*)(&_t9), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t9; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__js_freestanding }, (_option*)(&_t9), sizeof(v__pref__Arch)); return _t9; } else if (string__eq(arch_str, _SLIT(""))) { - Option_v__pref__Arch _t10; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch___auto }, (Option*)(&_t10), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t10; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch___auto }, (_option*)(&_t10), sizeof(v__pref__Arch)); return _t10; } else { - 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){ .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}; + return (_option_v__pref__Arch){0}; } VV_LOCAL_SYMBOL void v__pref__must_exist(string path) { @@ -39325,47 +39387,47 @@ inline VV_LOCAL_SYMBOL bool v__pref__is_source_file(string path) { return _t1; } -Option_v__pref__Backend v__pref__backend_from_string(string s) { +_option_v__pref__Backend v__pref__backend_from_string(string s) { if (string__eq(s, _SLIT("c"))) { - Option_v__pref__Backend _t1; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__c }, (Option*)(&_t1), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t1; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__c }, (_option*)(&_t1), sizeof(v__pref__Backend)); return _t1; } else if (string__eq(s, _SLIT("js"))) { - Option_v__pref__Backend _t2; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__js_node }, (Option*)(&_t2), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t2; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__js_node }, (_option*)(&_t2), sizeof(v__pref__Backend)); return _t2; } else if (string__eq(s, _SLIT("js_node"))) { - Option_v__pref__Backend _t3; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__js_node }, (Option*)(&_t3), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t3; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__js_node }, (_option*)(&_t3), sizeof(v__pref__Backend)); return _t3; } else if (string__eq(s, _SLIT("js_browser"))) { - Option_v__pref__Backend _t4; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__js_browser }, (Option*)(&_t4), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t4; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__js_browser }, (_option*)(&_t4), sizeof(v__pref__Backend)); return _t4; } else if (string__eq(s, _SLIT("js_freestanding"))) { - Option_v__pref__Backend _t5; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__js_freestanding }, (Option*)(&_t5), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t5; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__js_freestanding }, (_option*)(&_t5), sizeof(v__pref__Backend)); return _t5; } else if (string__eq(s, _SLIT("native"))) { - Option_v__pref__Backend _t6; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__native }, (Option*)(&_t6), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t6; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__native }, (_option*)(&_t6), sizeof(v__pref__Backend)); return _t6; } else if (string__eq(s, _SLIT("interpret"))) { - Option_v__pref__Backend _t7; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__interpret }, (Option*)(&_t7), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t7; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__interpret }, (_option*)(&_t7), sizeof(v__pref__Backend)); return _t7; } else { - 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){ .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}; + return (_option_v__pref__Backend){0}; } v__pref__CompilerType v__pref__cc_from_string(string cc_str) { @@ -39647,7 +39709,7 @@ bool v__pref__Preferences_should_compile_asm(v__pref__Preferences* prefs, string return _t1; } string file = string_all_before_last(path, _SLIT(".v")); - Option_v__pref__Arch _t2 = v__pref__arch_from_string(string_all_after_last(file, _SLIT("."))); + _option_v__pref__Arch _t2 = v__pref__arch_from_string(string_all_after_last(file, _SLIT("."))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(v__pref__Arch*) _t2.data = v__pref__Arch___auto; @@ -39658,7 +39720,7 @@ bool v__pref__Preferences_should_compile_asm(v__pref__Preferences* prefs, string bool _t3 = false; return _t3; } - Option_v__pref__OS _t4 = v__pref__os_from_string(string_all_before(string_all_after_last(file, _SLIT("_")), _SLIT("."))); + _option_v__pref__OS _t4 = v__pref__os_from_string(string_all_before(string_all_after_last(file, _SLIT("_")), _SLIT("."))); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(v__pref__OS*) _t4.data = v__pref__OS___auto; @@ -40270,7 +40332,7 @@ int sync__channel_select(Array_sync__Channel_ptr* channels, Array_sync__Directio int event_idx = -1; outer: for (;;) { - Option_int _t3 = rand__intn(channels->len); + _option_int _t3 = rand__intn(channels->len); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; *(int*) _t3.data = 0; @@ -40653,7 +40715,7 @@ void help__print_and_exit(string topic) { 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, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(".txt"), 0, { .d_c = 0 }}}))}))); - Option_string _t2 = os__read_file(target_topic); + _option_string _t2 = os__read_file(target_topic); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; eprintln(_const_help__unknown_topic); @@ -40672,7 +40734,7 @@ void help__print_and_exit(string topic) { VV_LOCAL_SYMBOL string help__known_topics(string topicdir) { Array_string res = __new_array_with_default(0, 0, sizeof(string), 0); array_push((array*)&res, _MOV((string[]){ string_clone(_SLIT("Known help topics: ")) })); - Option_Array_string _t2 = os__glob(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){os__join_path(topicdir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("*.txt")})))}))); + _option_Array_string _t2 = os__glob(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){os__join_path(topicdir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("*.txt")})))}))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(Array_string*) _t2.data = __new_array_with_default(0, 0, sizeof(string), 0); @@ -40697,8 +40759,8 @@ VV_LOCAL_SYMBOL string help__known_topics(string topicdir) { return _t7; } -Option_string v__util__find_working_diff_command(void) { - Option_string _t1 = v__util__diff__find_working_diff_command(); +_option_string v__util__find_working_diff_command(void) { + _option_string _t1 = v__util__diff__find_working_diff_command(); return _t1; } @@ -40774,7 +40836,7 @@ string v__util__formatted_error(string kind, string omsg, string filepath, v__to Array_string v__util__cached_file2sourcelines(string path) { Array_string* _t2 = (Array_string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, lines_cache->lines), &(string[]){path})); - Option_Array_string _t1 = {0}; + _option_Array_string _t1 = {0}; if (_t2) { *((Array_string*)&_t1.data) = *((Array_string*)_t2); } else { @@ -40786,7 +40848,7 @@ Array_string v__util__cached_file2sourcelines(string path) { Array_string _t3 = res; return _t3; } - Option_string _t4 = v__util__read_file(path); + _option_string _t4 = v__util__read_file(path); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(string*) _t4.data = _SLIT(""); @@ -40871,7 +40933,7 @@ string v__util__qualify_import(v__pref__Preferences* pref, string mod, string fi string search_path = ((string*)mod_paths.data)[_t2]; string try_path = os__join_path_single(search_path, mod_path); if (os__is_dir(try_path)) { - Option_string _t3; + _option_string _t3; if (_t3 = v__util__mod_path_to_full_name(pref, mod, try_path), _t3.state == 0) { string m1 = *(string*)_t3.data; ; @@ -40880,7 +40942,7 @@ string v__util__qualify_import(v__pref__Preferences* pref, string mod, string fi } } } - Option_string _t5; + _option_string _t5; if (_t5 = v__util__mod_path_to_full_name(pref, mod, file_path), _t5.state == 0) { string m1 = *(string*)_t5.data; ; @@ -40904,7 +40966,7 @@ string v__util__qualify_module(v__pref__Preferences* pref, string mod, string fi string _t2 = mod; return _t2; } - Option_string _t3; + _option_string _t3; if (_t3 = v__util__mod_path_to_full_name(pref, mod, clean_file_path), _t3.state == 0) { string m1 = *(string*)_t3.data; ; @@ -40916,7 +40978,7 @@ string v__util__qualify_module(v__pref__Preferences* pref, string mod, string fi return _t5; } -VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preferences* pref, string mod, string path) { +VV_LOCAL_SYMBOL _option_string v__util__mod_path_to_full_name(v__pref__Preferences* pref, string mod, string path) { Array_string vmod_folders = new_array_from_c_array(3, 3, sizeof(string), _MOV((string[3]){_SLIT("vlib"), _SLIT(".vmodules"), _SLIT("modules")})); Array_string _t1 = {0}; Array_string _t1_orig = pref->lookup_path; @@ -40954,8 +41016,8 @@ VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preference if (Array_string_contains(vmod_folders, path_part)) { Array_string _t6; string mod_full_name = Array_string_join((_t6 = string_split(try_path, _const_os__path_separator), array_slice(_t6, j + 1, _t6.len)), _SLIT(".")); - Option_string _t7; - opt_ok(&(string[]) { mod_full_name }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { mod_full_name }, (_option*)(&_t7), sizeof(string)); return _t7; } } @@ -40964,7 +41026,7 @@ VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preference int last_v_mod = -1; for (int j = try_path_parts.len; j > 0; j--) { string parent = Array_string_join(array_slice(try_path_parts, 0, j), _const_os__path_separator); - Option_Array_string _t8; + _option_Array_string _t8; if (_t8 = os__ls(parent), _t8.state == 0) { Array_string ls = *(Array_string*)_t8.data; if (Array_string_contains(ls, _SLIT("v.mod")) && (try_path_parts.len > i && !string__eq((*(string*)/*ee elem_sym */array_get(try_path_parts, i)), _SLIT("v")) && !Array_string_contains(ls, _SLIT("vlib")))) { @@ -40977,8 +41039,8 @@ VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preference if (last_v_mod > -1) { Array_string _t9; string mod_full_name = Array_string_join((_t9 = try_path_parts, array_slice(_t9, last_v_mod, _t9.len)), _SLIT(".")); - Option_string _t10; - opt_ok(&(string[]) { mod_full_name }, (Option*)(&_t10), sizeof(string)); + _option_string _t10; + opt_ok2(&(string[]) { mod_full_name }, (_option*)(&_t10), sizeof(string)); return _t10; } } @@ -40988,12 +41050,12 @@ VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preference string rel_mod_path = string_replace(path, string__plus(string_all_before_last(pref->path, _const_os__path_separator), _const_os__path_separator), _SLIT("")); if (!string__eq(rel_mod_path, path)) { string full_mod_name = string_replace(rel_mod_path, _const_os__path_separator, _SLIT(".")); - Option_string _t11; - opt_ok(&(string[]) { full_mod_name }, (Option*)(&_t11), sizeof(string)); + _option_string _t11; + opt_ok2(&(string[]) { full_mod_name }, (_option*)(&_t11), sizeof(string)); return _t11; } } - return (Option_string){ .state=2, .err=_v_error(_SLIT("module not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("module not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; } // Attr: [direct_array_access] @@ -41389,7 +41451,7 @@ void v__util__timing_set_should_print(bool should_print) { void v__util__Timers_start(v__util__Timers* t, string name) { time__StopWatch* _t2 = (time__StopWatch*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, t->swatches), &(string[]){name})); - Option_time__StopWatch _t1 = {0}; + _option_time__StopWatch _t1 = {0}; if (_t2) { *((time__StopWatch*)&_t1.data) = *((time__StopWatch*)_t2); } else { @@ -41545,24 +41607,24 @@ void v__util__set_vroot_folder(string vroot_path) { os__setenv(_SLIT("VCHILD"), _SLIT("true"), true); } -Option_string v__util__resolve_vmodroot(string str, string dir) { +_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 "), /*115 &string*/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; - opt_ok(&(string[]) { string_replace(str, _SLIT("@VMODROOT"), os__real_path(vmod_path)) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { string_replace(str, _SLIT("@VMODROOT"), os__real_path(vmod_path)) }, (_option*)(&_t2), sizeof(string)); return _t2; } -Option_string v__util__resolve_env_value(string str, bool check_for_presence) { +_option_string v__util__resolve_env_value(string str, bool check_for_presence) { string env_ident = _SLIT("$env('"); - Option_int _t1 = string_index(str, env_ident); + _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 \""), /*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} }; + 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); @@ -41575,19 +41637,19 @@ Option_string v__util__resolve_env_value(string str, bool check_for_presence) { } else { if (!(ch == '\'' || ch == ')')) { 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(_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 \""), /*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} }; + 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} }; } } } if ((env_lit).len == 0) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("supply an env variable name like HOME, PATH or USER")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("supply an env variable name like HOME, PATH or USER")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string env_value = _SLIT(""); if (check_for_presence) { string* _t7 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, os__environ()), &(string[]){env_lit})); - Option_string _t6 = {0}; + _option_string _t6 = {0}; if (_t7) { *((string*)&_t6.data) = *((string*)_t7); } else { @@ -41596,23 +41658,23 @@ 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 \""), /*115 &string*/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 \""), /*115 &string*/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); } string rep = string_replace_once(str, string__plus(string__plus(string__plus(env_ident, env_lit), _SLIT("'")), _SLIT(")")), env_value); if (string_contains(rep, env_ident)) { - Option_string _t10 = v__util__resolve_env_value(rep, check_for_presence); + _option_string _t10 = v__util__resolve_env_value(rep, check_for_presence); return _t10; } - Option_string _t11; - opt_ok(&(string[]) { rep }, (Option*)(&_t11), sizeof(string)); + _option_string _t11; + opt_ok2(&(string[]) { rep }, (_option*)(&_t11), sizeof(string)); return _t11; } @@ -41650,7 +41712,7 @@ VNORETURN void v__util__launch_tool(bool is_verbose, string tool_name, Array_str 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)) })); for (int _t1 = 0; _t1 < emodules.len; ++_t1) { string emodule = ((string*)emodules.data)[_t1]; - Option_bool _t2 = v__util__check_module_is_installed(emodule, is_verbose); + _option_bool _t2 = v__util__check_module_is_installed(emodule, is_verbose); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; _v_panic(IError_str(err)); @@ -41690,7 +41752,7 @@ VNORETURN void v__util__launch_tool(bool is_verbose, string tool_name, Array_str } #else { - Option_void _t3 = os__execvp(tool_exe, args); + _option_void _t3 = os__execvp(tool_exe, args); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; _v_panic(IError_str(err)); @@ -41781,19 +41843,24 @@ string v__util__path_of_executable(string path) { } // Attr: [unsafe] -Option_string v__util__cached_read_source_file(string path) { +_option_string v__util__cached_read_source_file(string path) { static v__util__SourceCache* cache = ((v__util__SourceCache*)(0)); if (isnil(cache)) { cache = ((v__util__SourceCache*)memdup(&(v__util__SourceCache){.sources = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}, sizeof(v__util__SourceCache))); } + #if defined(CUSTOM_DEFINE_trace_cached_read_source_file) + { + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cached_read_source_file "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } + #endif if (path.len == 0) { map_free(&cache->sources); _v_free(cache); cache = ((v__util__SourceCache*)(0)); - return (Option_string){ .state=2, .err=_v_error(_SLIT("memory source file cache cleared")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("memory source file cache cleared")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string* _t3 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, cache->sources), &(string[]){path})); - Option_string _t2 = {0}; + _option_string _t2 = {0}; if (_t3) { *((string*)&_t2.data) = *((string*)_t3); } else { @@ -41802,21 +41869,31 @@ Option_string v__util__cached_read_source_file(string path) { if (_t2.state == 0) { string res = *(string*)_t2.data; - Option_string _t4; - opt_ok(&(string[]) { res }, (Option*)(&_t4), sizeof(string)); + #if defined(CUSTOM_DEFINE_trace_cached_read_source_file_cached) + { + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cached_read_source_file cached "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } + #endif + _option_string _t4; + opt_ok2(&(string[]) { res }, (_option*)(&_t4), sizeof(string)); return _t4; } - Option_string _t5 = os__read_file(path); + #if defined(CUSTOM_DEFINE_trace_cached_read_source_file_not_cached) + { + println( str_intp(2, _MOV((StrIntpData[]){{_SLIT("cached_read_source_file not cached "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))); + } + #endif + _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 "), /*115 &string*/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); string res = v__util__skip_bom(raw_text); map_set(&cache->sources, &(string[]){path}, &(string[]) { res }); - Option_string _t7; - opt_ok(&(string[]) { res }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { res }, (_option*)(&_t7), sizeof(string)); return _t7; } @@ -41863,7 +41940,7 @@ VV_LOCAL_SYMBOL Array_string v__util__non_empty(Array_string arg) { return _t1; } -Option_bool v__util__check_module_is_installed(string modulename, bool is_verbose) { +_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/"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT0, 0, { .d_c = 0 }}})); @@ -41880,7 +41957,7 @@ Option_bool v__util__check_module_is_installed(string modulename, bool is_verbos } 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 "), /*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} }; + 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: `"), /*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 }}}))); @@ -41890,8 +41967,8 @@ Option_bool v__util__check_module_is_installed(string modulename, bool is_verbos } eprintln(string_repeat(_SLIT("-"), 50)); } - Option_bool _t2; - opt_ok(&(bool[]) { true }, (Option*)(&_t2), sizeof(bool)); + _option_bool _t2; + opt_ok2(&(bool[]) { true }, (_option*)(&_t2), sizeof(bool)); return _t2; } if (is_verbose) { @@ -41899,19 +41976,19 @@ Option_bool v__util__check_module_is_installed(string modulename, bool is_verbos } 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: "), /*115 &string*/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: "), /*115 &string*/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, "), /*115 &string*/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")); } - Option_bool _t6; - opt_ok(&(bool[]) { true }, (Option*)(&_t6), sizeof(bool)); + _option_bool _t6; + opt_ok2(&(bool[]) { true }, (_option*)(&_t6), sizeof(bool)); return _t6; } @@ -41933,7 +42010,7 @@ void v__util__ensure_modules_for_all_tools_are_installed(bool is_verbose) { } for (int _t4 = 0; _t4 < tool_modules.len; ++_t4) { string emodule = ((string*)tool_modules.data)[_t4]; - Option_bool _t5 = v__util__check_module_is_installed(emodule, is_verbose); + _option_bool _t5 = v__util__check_module_is_installed(emodule, is_verbose); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; _v_panic(IError_str(err)); @@ -41984,9 +42061,9 @@ void v__util__prepare_tool_when_needed(string source_name) { string vexe = os__getenv(_SLIT("VEXE")); string vroot = os__dir(vexe); string stool = os__join_path(vroot, new_array_from_c_array(3, 3, sizeof(string), _MOV((string[3]){_SLIT("cmd"), _SLIT("tools"), source_name}))); - multi_return_string_string mr_14629 = v__util__tool_source2name_and_exe(stool); - string tool_name = mr_14629.arg0; - string tool_exe = mr_14629.arg1; + multi_return_string_string mr_14964 = v__util__tool_source2name_and_exe(stool); + string tool_name = mr_14964.arg0; + string tool_exe = mr_14964.arg1; if (v__util__should_recompile_tool(vexe, stool, tool_name, tool_exe)) { time__sleep(1001 * _const_time__millisecond); v__util__recompile_file(vexe, stool); @@ -42017,7 +42094,7 @@ string v__util__get_vtmp_folder(void) { int uid = os__getuid(); 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); + _option_void _t2 = os__mkdir_all(vtmp); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -42037,7 +42114,7 @@ bool v__util__should_bundle_module(string mod) { return _t1; } -Option_Array_string v__util__find_all_v_files(Array_string roots) { +_option_Array_string v__util__find_all_v_files(Array_string roots) { Array_string files = __new_array_with_default(0, 0, sizeof(string), 0); for (int _t1 = 0; _t1 < roots.len; ++_t1) { string file = ((string*)roots.data)[_t1]; @@ -42047,22 +42124,22 @@ 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: \""), /*115 &string*/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("\""), /*115 &string*/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) })); } - Option_Array_string _t7; - opt_ok(&(Array_string[]) { files }, (Option*)(&_t7), sizeof(Array_string)); + _option_Array_string _t7; + opt_ok2(&(Array_string[]) { files }, (_option*)(&_t7), sizeof(Array_string)); return _t7; } void v__util__free_caches(void) { { // Unsafe block v__util__cached_file2sourcelines(_SLIT("")); - Option_string _t1 = v__util__cached_read_source_file(_SLIT("")); + _option_string _t1 = v__util__cached_read_source_file(_SLIT("")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(string*) _t1.data = _SLIT(""); @@ -42072,8 +42149,8 @@ void v__util__free_caches(void) { } } -Option_string v__util__read_file(string file_path) { - Option_string _t1 = v__util__cached_read_source_file(file_path); +_option_string v__util__read_file(string file_path) { + _option_string _t1 = v__util__cached_read_source_file(file_path); return _t1; } @@ -42252,18 +42329,18 @@ v__ast__Node v__ast__empty_node(void) { return _t1; } -Option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e) { +_option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e) { v__ast__Expr root = e->expr; for (;;) { - if (!((root)._typ == 287 /* v.ast.SelectorExpr */)) break; + if (!((root)._typ == 288 /* v.ast.SelectorExpr */)) break; root = (*root._v__ast__SelectorExpr).expr; } - 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)); + if ((root)._typ == 268 /* v.ast.Ident */) { + _option_v__ast__Ident _t1; + opt_ok2(&(v__ast__Ident[]) { (*root._v__ast__Ident) }, (_option*)(&_t1), sizeof(v__ast__Ident)); return _t1; } - return (Option_v__ast__Ident){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Ident){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__StructField_equals(v__ast__StructField* f, v__ast__StructField* o) { @@ -42291,19 +42368,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 == 325 /* v.ast.Var */) { + if (i->obj._typ == 326 /* v.ast.Var */) { bool _t1 = (*i->obj._v__ast__Var).is_mut; return _t1; } - else if (i->obj._typ == 323 /* v.ast.ConstField */) { + else if (i->obj._typ == 324 /* v.ast.ConstField */) { bool _t2 = false; return _t2; } - else if (i->obj._typ == 322 /* v.ast.AsmRegister */) { + else if (i->obj._typ == 323 /* v.ast.AsmRegister */) { bool _t3 = true; return _t3; } - else if (i->obj._typ == 324 /* v.ast.GlobalField */) { + else if (i->obj._typ == 325 /* v.ast.GlobalField */) { bool _t4 = true; return _t4; } @@ -42312,7 +42389,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 == 377 /* v.ast.IdentVar */) { + if (i->info._typ == 378 /* v.ast.IdentVar */) { v__ast__IdentVar _t1 = (*i->info._v__ast__IdentVar); return _t1; } @@ -42328,7 +42405,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 == 267 /* v.ast.Ident */) { + if ((expr)._typ == 268 /* v.ast.Ident */) { bool _t1 = (*expr._v__ast__Ident).kind == v__ast__IdentKind__blank_ident; return _t1; } @@ -42337,199 +42414,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 == 245 /* v.ast.AnonFn */) { + if (expr._typ == 246 /* v.ast.AnonFn */) { v__token__Pos _t1 = (*expr._v__ast__AnonFn).decl.pos; return _t1; } - else if (expr._typ == 252 /* v.ast.CTempVar */) { + else if (expr._typ == 253 /* 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 == 263 /* v.ast.EmptyExpr */) { + else if (expr._typ == 264 /* 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 == 278 /* v.ast.NodeError */) { + else if (expr._typ == 279 /* v.ast.NodeError */) { v__token__Pos _t4 = (*expr._v__ast__NodeError).pos; return _t4; } - else if (expr._typ == 246 /* v.ast.ArrayDecompose */) { + else if (expr._typ == 247 /* v.ast.ArrayDecompose */) { v__token__Pos _t5 = (*expr._v__ast__ArrayDecompose).pos; return _t5; } - else if (expr._typ == 247 /* v.ast.ArrayInit */) { + else if (expr._typ == 248 /* v.ast.ArrayInit */) { v__token__Pos _t6 = (*expr._v__ast__ArrayInit).pos; return _t6; } - else if (expr._typ == 248 /* v.ast.AsCast */) { + else if (expr._typ == 249 /* v.ast.AsCast */) { v__token__Pos _t7 = (*expr._v__ast__AsCast).pos; return _t7; } - else if (expr._typ == 249 /* v.ast.Assoc */) { + else if (expr._typ == 250 /* v.ast.Assoc */) { v__token__Pos _t8 = (*expr._v__ast__Assoc).pos; return _t8; } - else if (expr._typ == 250 /* v.ast.AtExpr */) { + else if (expr._typ == 251 /* v.ast.AtExpr */) { v__token__Pos _t9 = (*expr._v__ast__AtExpr).pos; return _t9; } - else if (expr._typ == 251 /* v.ast.BoolLiteral */) { + else if (expr._typ == 252 /* v.ast.BoolLiteral */) { v__token__Pos _t10 = (*expr._v__ast__BoolLiteral).pos; return _t10; } - else if (expr._typ == 253 /* v.ast.CallExpr */) { + else if (expr._typ == 254 /* v.ast.CallExpr */) { v__token__Pos _t11 = (*expr._v__ast__CallExpr).pos; return _t11; } - else if (expr._typ == 254 /* v.ast.CastExpr */) { + else if (expr._typ == 255 /* v.ast.CastExpr */) { v__token__Pos _t12 = (*expr._v__ast__CastExpr).pos; return _t12; } - else if (expr._typ == 255 /* v.ast.ChanInit */) { + else if (expr._typ == 256 /* v.ast.ChanInit */) { v__token__Pos _t13 = (*expr._v__ast__ChanInit).pos; return _t13; } - else if (expr._typ == 256 /* v.ast.CharLiteral */) { + else if (expr._typ == 257 /* v.ast.CharLiteral */) { v__token__Pos _t14 = (*expr._v__ast__CharLiteral).pos; return _t14; } - else if (expr._typ == 261 /* v.ast.ConcatExpr */) { + else if (expr._typ == 262 /* v.ast.ConcatExpr */) { v__token__Pos _t15 = (*expr._v__ast__ConcatExpr).pos; return _t15; } - else if (expr._typ == 257 /* v.ast.Comment */) { + else if (expr._typ == 258 /* v.ast.Comment */) { v__token__Pos _t16 = (*expr._v__ast__Comment).pos; return _t16; } - else if (expr._typ == 258 /* v.ast.ComptimeCall */) { + else if (expr._typ == 259 /* v.ast.ComptimeCall */) { v__token__Pos _t17 = (*expr._v__ast__ComptimeCall).pos; return _t17; } - else if (expr._typ == 259 /* v.ast.ComptimeSelector */) { + else if (expr._typ == 260 /* v.ast.ComptimeSelector */) { v__token__Pos _t18 = (*expr._v__ast__ComptimeSelector).pos; return _t18; } - else if (expr._typ == 264 /* v.ast.EnumVal */) { + else if (expr._typ == 265 /* v.ast.EnumVal */) { v__token__Pos _t19 = (*expr._v__ast__EnumVal).pos; return _t19; } - else if (expr._typ == 262 /* v.ast.DumpExpr */) { + else if (expr._typ == 263 /* v.ast.DumpExpr */) { v__token__Pos _t20 = (*expr._v__ast__DumpExpr).pos; return _t20; } - else if (expr._typ == 265 /* v.ast.FloatLiteral */) { + else if (expr._typ == 266 /* v.ast.FloatLiteral */) { v__token__Pos _t21 = (*expr._v__ast__FloatLiteral).pos; return _t21; } - else if (expr._typ == 266 /* v.ast.GoExpr */) { + else if (expr._typ == 267 /* v.ast.GoExpr */) { v__token__Pos _t22 = (*expr._v__ast__GoExpr).pos; return _t22; } - else if (expr._typ == 267 /* v.ast.Ident */) { + else if (expr._typ == 268 /* v.ast.Ident */) { v__token__Pos _t23 = (*expr._v__ast__Ident).pos; return _t23; } - else if (expr._typ == 268 /* v.ast.IfExpr */) { + else if (expr._typ == 269 /* v.ast.IfExpr */) { v__token__Pos _t24 = (*expr._v__ast__IfExpr).pos; return _t24; } - else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 273 /* v.ast.IntegerLiteral */) { v__token__Pos _t25 = (*expr._v__ast__IntegerLiteral).pos; return _t25; } - else if (expr._typ == 273 /* v.ast.IsRefType */) { + else if (expr._typ == 274 /* v.ast.IsRefType */) { v__token__Pos _t26 = (*expr._v__ast__IsRefType).pos; return _t26; } - else if (expr._typ == 274 /* v.ast.Likely */) { + else if (expr._typ == 275 /* v.ast.Likely */) { v__token__Pos _t27 = (*expr._v__ast__Likely).pos; return _t27; } - else if (expr._typ == 275 /* v.ast.LockExpr */) { + else if (expr._typ == 276 /* v.ast.LockExpr */) { v__token__Pos _t28 = (*expr._v__ast__LockExpr).pos; return _t28; } - else if (expr._typ == 276 /* v.ast.MapInit */) { + else if (expr._typ == 277 /* v.ast.MapInit */) { v__token__Pos _t29 = (*expr._v__ast__MapInit).pos; return _t29; } - else if (expr._typ == 277 /* v.ast.MatchExpr */) { + else if (expr._typ == 278 /* v.ast.MatchExpr */) { v__token__Pos _t30 = (*expr._v__ast__MatchExpr).pos; return _t30; } - else if (expr._typ == 279 /* v.ast.None */) { + else if (expr._typ == 280 /* v.ast.None */) { v__token__Pos _t31 = (*expr._v__ast__None).pos; return _t31; } - else if (expr._typ == 280 /* v.ast.OffsetOf */) { + else if (expr._typ == 281 /* v.ast.OffsetOf */) { v__token__Pos _t32 = (*expr._v__ast__OffsetOf).pos; return _t32; } - else if (expr._typ == 281 /* v.ast.OrExpr */) { + else if (expr._typ == 282 /* v.ast.OrExpr */) { v__token__Pos _t33 = (*expr._v__ast__OrExpr).pos; return _t33; } - else if (expr._typ == 282 /* v.ast.ParExpr */) { + else if (expr._typ == 283 /* v.ast.ParExpr */) { v__token__Pos _t34 = (*expr._v__ast__ParExpr).pos; return _t34; } - else if (expr._typ == 283 /* v.ast.PostfixExpr */) { + else if (expr._typ == 284 /* v.ast.PostfixExpr */) { v__token__Pos _t35 = (*expr._v__ast__PostfixExpr).pos; return _t35; } - else if (expr._typ == 284 /* v.ast.PrefixExpr */) { + else if (expr._typ == 285 /* v.ast.PrefixExpr */) { v__token__Pos _t36 = (*expr._v__ast__PrefixExpr).pos; return _t36; } - else if (expr._typ == 285 /* v.ast.RangeExpr */) { + else if (expr._typ == 286 /* v.ast.RangeExpr */) { v__token__Pos _t37 = (*expr._v__ast__RangeExpr).pos; return _t37; } - else if (expr._typ == 286 /* v.ast.SelectExpr */) { + else if (expr._typ == 287 /* v.ast.SelectExpr */) { v__token__Pos _t38 = (*expr._v__ast__SelectExpr).pos; return _t38; } - else if (expr._typ == 287 /* v.ast.SelectorExpr */) { + else if (expr._typ == 288 /* v.ast.SelectorExpr */) { v__token__Pos _t39 = (*expr._v__ast__SelectorExpr).pos; return _t39; } - else if (expr._typ == 288 /* v.ast.SizeOf */) { + else if (expr._typ == 289 /* v.ast.SizeOf */) { v__token__Pos _t40 = (*expr._v__ast__SizeOf).pos; return _t40; } - else if (expr._typ == 289 /* v.ast.SqlExpr */) { + else if (expr._typ == 290 /* v.ast.SqlExpr */) { v__token__Pos _t41 = (*expr._v__ast__SqlExpr).pos; return _t41; } - else if (expr._typ == 290 /* v.ast.StringInterLiteral */) { + else if (expr._typ == 291 /* v.ast.StringInterLiteral */) { v__token__Pos _t42 = (*expr._v__ast__StringInterLiteral).pos; return _t42; } - else if (expr._typ == 291 /* v.ast.StringLiteral */) { + else if (expr._typ == 292 /* v.ast.StringLiteral */) { v__token__Pos _t43 = (*expr._v__ast__StringLiteral).pos; return _t43; } - else if (expr._typ == 292 /* v.ast.StructInit */) { + else if (expr._typ == 293 /* v.ast.StructInit */) { v__token__Pos _t44 = (*expr._v__ast__StructInit).pos; return _t44; } - else if (expr._typ == 293 /* v.ast.TypeNode */) { + else if (expr._typ == 294 /* v.ast.TypeNode */) { v__token__Pos _t45 = (*expr._v__ast__TypeNode).pos; return _t45; } - else if (expr._typ == 294 /* v.ast.TypeOf */) { + else if (expr._typ == 295 /* v.ast.TypeOf */) { v__token__Pos _t46 = (*expr._v__ast__TypeOf).pos; return _t46; } - else if (expr._typ == 295 /* v.ast.UnsafeExpr */) { + else if (expr._typ == 296 /* v.ast.UnsafeExpr */) { v__token__Pos _t47 = (*expr._v__ast__UnsafeExpr).pos; return _t47; } - else if (expr._typ == 260 /* v.ast.ComptimeType */) { + else if (expr._typ == 261 /* v.ast.ComptimeType */) { v__token__Pos _t48 = (*expr._v__ast__ComptimeType).pos; return _t48; } - else if (expr._typ == 270 /* v.ast.IndexExpr */) { + else if (expr._typ == 271 /* 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; @@ -42537,11 +42614,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 == 269 /* v.ast.IfGuardExpr */) { + else if (expr._typ == 270 /* v.ast.IfGuardExpr */) { v__token__Pos _t51 = v__ast__Expr_pos((*expr._v__ast__IfGuardExpr).expr); return _t51; } - else if (expr._typ == 271 /* v.ast.InfixExpr */) { + else if (expr._typ == 272 /* 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,}); @@ -42552,27 +42629,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 == 267 /* v.ast.Ident */) { + if (expr._typ == 268 /* v.ast.Ident */) { bool _t1 = true; return _t1; } - else if (expr._typ == 252 /* v.ast.CTempVar */) { + else if (expr._typ == 253 /* v.ast.CTempVar */) { bool _t2 = true; return _t2; } - else if (expr._typ == 270 /* v.ast.IndexExpr */) { + else if (expr._typ == 271 /* v.ast.IndexExpr */) { bool _t3 = v__ast__Expr_is_lvalue((*expr._v__ast__IndexExpr).left); return _t3; } - else if (expr._typ == 287 /* v.ast.SelectorExpr */) { + else if (expr._typ == 288 /* v.ast.SelectorExpr */) { bool _t4 = v__ast__Expr_is_lvalue((*expr._v__ast__SelectorExpr).expr); return _t4; } - else if (expr._typ == 282 /* v.ast.ParExpr */) { + else if (expr._typ == 283 /* v.ast.ParExpr */) { bool _t5 = v__ast__Expr_is_lvalue((*expr._v__ast__ParExpr).expr); return _t5; } - else if (expr._typ == 284 /* v.ast.PrefixExpr */) { + else if (expr._typ == 285 /* v.ast.PrefixExpr */) { bool _t6 = v__ast__Expr_is_lvalue((*expr._v__ast__PrefixExpr).right); return _t6; } @@ -42585,19 +42662,19 @@ bool v__ast__Expr_is_lvalue(v__ast__Expr expr) { } bool v__ast__Expr_is_expr(v__ast__Expr expr) { - if (expr._typ == 268 /* v.ast.IfExpr */) { + if (expr._typ == 269 /* v.ast.IfExpr */) { bool _t1 = (*expr._v__ast__IfExpr).is_expr; return _t1; } - else if (expr._typ == 275 /* v.ast.LockExpr */) { + else if (expr._typ == 276 /* v.ast.LockExpr */) { bool _t2 = (*expr._v__ast__LockExpr).is_expr; return _t2; } - else if (expr._typ == 277 /* v.ast.MatchExpr */) { + else if (expr._typ == 278 /* v.ast.MatchExpr */) { bool _t3 = (*expr._v__ast__MatchExpr).is_expr; return _t3; } - else if (expr._typ == 286 /* v.ast.SelectExpr */) { + else if (expr._typ == 287 /* v.ast.SelectExpr */) { bool _t4 = (*expr._v__ast__SelectExpr).is_expr; return _t4; } @@ -42610,20 +42687,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 == 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)); + bool _t1 = ((expr._typ == 252 /* v.ast.BoolLiteral */) ? (true) : (expr._typ == 257 /* v.ast.CharLiteral */) ? (true) : (expr._typ == 292 /* v.ast.StringLiteral */) ? (true) : (expr._typ == 273 /* v.ast.IntegerLiteral */) ? (true) : (false)); return _t1; } bool v__ast__Expr_is_auto_deref_var(v__ast__Expr expr) { - if (expr._typ == 267 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if (expr._typ == 268 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 326 /* v.ast.Var */) { if ((*(*expr._v__ast__Ident).obj._v__ast__Var).is_auto_deref) { bool _t1 = true; return _t1; } } } - else if (expr._typ == 284 /* v.ast.PrefixExpr */) { + else if (expr._typ == 285 /* 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; @@ -42638,11 +42715,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 == 267 /* v.ast.Ident */) { + if (e->_typ == 268 /* v.ast.Ident */) { bool _t1 = true; return _t1; } - else if (e->_typ == 287 /* v.ast.SelectorExpr */) { + else if (e->_typ == 288 /* v.ast.SelectorExpr */) { bool _t2 = v__ast__Expr_is_lockable(&(*e->_v__ast__SelectorExpr).expr); return _t2; } @@ -42655,56 +42732,56 @@ bool v__ast__Expr_is_lockable(v__ast__Expr* e) { return 0; } -Option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt) { - if (stmt._typ == 299 /* v.ast.AssignStmt */) { - return (Option_void){0}; +_option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt) { + if (stmt._typ == 300 /* v.ast.AssignStmt */) { + return (_option_void){0}; } - else if (stmt._typ == 308 /* v.ast.ForCStmt */) { - return (Option_void){0}; + else if (stmt._typ == 309 /* v.ast.ForCStmt */) { + return (_option_void){0}; } - else if (stmt._typ == 309 /* v.ast.ForInStmt */) { - return (Option_void){0}; + else if (stmt._typ == 310 /* v.ast.ForInStmt */) { + return (_option_void){0}; } - else if (stmt._typ == 310 /* v.ast.ForStmt */) { - return (Option_void){0}; + else if (stmt._typ == 311 /* v.ast.ForStmt */) { + return (_option_void){0}; } - else if (stmt._typ == 307 /* v.ast.ExprStmt */) { + else if (stmt._typ == 308 /* v.ast.ExprStmt */) { if (v__ast__Expr_is_expr((*stmt._v__ast__ExprStmt).expr)) { - return (Option_void){0}; + return (_option_void){0}; } - 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} }; + 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 (`"), /*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} }; + 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 == 278 /* v.ast.NodeError */) { + if (node._typ == 279 /* 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 == 328 /* v.ast.EmptyNode */) { + else if (node._typ == 329 /* 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 == 321 /* v.ast.Stmt */) { + else if (node._typ == 322 /* v.ast.Stmt */) { v__token__Pos pos = (*((*node._v__ast__Stmt).pos)); - if (((*node._v__ast__Stmt))._typ == 315 /* v.ast.Import */) { + if (((*node._v__ast__Stmt))._typ == 316 /* 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 == 244 /* v.ast.TypeDecl */) { - if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 242 /* v.ast.FnTypeDecl */) { + } else if (((*node._v__ast__Stmt))._typ == 245 /* v.ast.TypeDecl */) { + if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 243 /* 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 == 241 /* v.ast.AliasTypeDecl */) { + else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 242 /* 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 == 243 /* v.ast.SumTypeDecl */) { + else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 244 /* 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); @@ -42712,81 +42789,81 @@ v__token__Pos v__ast__Node_pos(v__ast__Node node) { } ; } - if (((*node._v__ast__Stmt))._typ == 299 /* v.ast.AssignStmt */) { + if (((*node._v__ast__Stmt))._typ == 300 /* 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 == 298 /* v.ast.AssertStmt */) { + if (((*node._v__ast__Stmt))._typ == 299 /* 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 == 296 /* v.ast.Expr */) { + else if (node._typ == 297 /* v.ast.Expr */) { v__token__Pos _t8 = v__ast__Expr_pos((*node._v__ast__Expr)); return _t8; } - else if (node._typ == 334 /* v.ast.StructField */) { + else if (node._typ == 335 /* 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 == 331 /* v.ast.MatchBranch */) { + else if (node._typ == 332 /* v.ast.MatchBranch */) { v__token__Pos _t10 = (*node._v__ast__MatchBranch).pos; return _t10; } - else if (node._typ == 333 /* v.ast.SelectBranch */) { + else if (node._typ == 334 /* v.ast.SelectBranch */) { v__token__Pos _t11 = (*node._v__ast__SelectBranch).pos; return _t11; } - else if (node._typ == 329 /* v.ast.EnumField */) { + else if (node._typ == 330 /* v.ast.EnumField */) { v__token__Pos _t12 = (*node._v__ast__EnumField).pos; return _t12; } - else if (node._typ == 323 /* v.ast.ConstField */) { + else if (node._typ == 324 /* v.ast.ConstField */) { v__token__Pos _t13 = (*node._v__ast__ConstField).pos; return _t13; } - else if (node._typ == 335 /* v.ast.StructInitField */) { + else if (node._typ == 336 /* v.ast.StructInitField */) { v__token__Pos _t14 = (*node._v__ast__StructInitField).pos; return _t14; } - else if (node._typ == 324 /* v.ast.GlobalField */) { + else if (node._typ == 325 /* v.ast.GlobalField */) { v__token__Pos _t15 = (*node._v__ast__GlobalField).pos; return _t15; } - else if (node._typ == 327 /* v.ast.CallArg */) { + else if (node._typ == 328 /* v.ast.CallArg */) { v__token__Pos _t16 = (*node._v__ast__CallArg).pos; return _t16; } - else if (node._typ == 332 /* v.ast.Param */) { + else if (node._typ == 333 /* 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 == 330 /* v.ast.IfBranch */) { + else if (node._typ == 331 /* 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 == 326 /* v.ast.ScopeObject */) { - if ((*node._v__ast__ScopeObject)._typ == 323 /* v.ast.ConstField */) { + else if (node._typ == 327 /* v.ast.ScopeObject */) { + if ((*node._v__ast__ScopeObject)._typ == 324 /* v.ast.ConstField */) { v__token__Pos _t19 = (*(*node._v__ast__ScopeObject)._v__ast__ConstField).pos; return _t19; } - else if ((*node._v__ast__ScopeObject)._typ == 324 /* v.ast.GlobalField */) { + else if ((*node._v__ast__ScopeObject)._typ == 325 /* v.ast.GlobalField */) { v__token__Pos _t20 = (*(*node._v__ast__ScopeObject)._v__ast__GlobalField).pos; return _t20; } - else if ((*node._v__ast__ScopeObject)._typ == 325 /* v.ast.Var */) { + else if ((*node._v__ast__ScopeObject)._typ == 326 /* v.ast.Var */) { v__token__Pos _t21 = (*(*node._v__ast__ScopeObject)._v__ast__Var).pos; return _t21; } - else if ((*node._v__ast__ScopeObject)._typ == 322 /* v.ast.AsmRegister */) { + else if ((*node._v__ast__ScopeObject)._typ == 323 /* 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 == 175 /* v.ast.File */) { + else if (node._typ == 176 /* 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)); @@ -42802,8 +42879,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 == 296 /* v.ast.Expr */) { - if ((*node._v__ast__Expr)._typ == 290 /* v.ast.StringInterLiteral */) { + if ((node)._typ == 297 /* v.ast.Expr */) { + if ((*node._v__ast__Expr)._typ == 291 /* 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; @@ -42817,7 +42894,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 == 249 /* v.ast.Assoc */) { + else if ((*node._v__ast__Expr)._typ == 250 /* 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; @@ -42831,7 +42908,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 == 247 /* v.ast.ArrayInit */) { + else if ((*node._v__ast__Expr)._typ == 248 /* 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; @@ -42845,37 +42922,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 == 287 /* v.ast.SelectorExpr */) { + else if ((*node._v__ast__Expr)._typ == 288 /* 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 == 283 /* v.ast.PostfixExpr */) { + else if ((*node._v__ast__Expr)._typ == 284 /* 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 == 295 /* v.ast.UnsafeExpr */) { + else if ((*node._v__ast__Expr)._typ == 296 /* 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 == 248 /* v.ast.AsCast */) { + else if ((*node._v__ast__Expr)._typ == 249 /* 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 == 282 /* v.ast.ParExpr */) { + else if ((*node._v__ast__Expr)._typ == 283 /* 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 == 269 /* v.ast.IfGuardExpr */) { + else if ((*node._v__ast__Expr)._typ == 270 /* 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 == 288 /* v.ast.SizeOf */) { + else if ((*node._v__ast__Expr)._typ == 289 /* 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 == 274 /* v.ast.Likely */) { + else if ((*node._v__ast__Expr)._typ == 275 /* 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 == 294 /* v.ast.TypeOf */) { + else if ((*node._v__ast__Expr)._typ == 295 /* 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 == 246 /* v.ast.ArrayDecompose */) { + else if ((*node._v__ast__Expr)._typ == 247 /* 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 == 275 /* v.ast.LockExpr */) { + else if ((*node._v__ast__Expr)._typ == 276 /* 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; @@ -42889,7 +42966,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 == 281 /* v.ast.OrExpr */) { + else if ((*node._v__ast__Expr)._typ == 282 /* 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; @@ -42903,7 +42980,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 == 292 /* v.ast.StructInit */) { + else if ((*node._v__ast__Expr)._typ == 293 /* 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; @@ -42917,10 +42994,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 == 245 /* v.ast.AnonFn */) { + else if ((*node._v__ast__Expr)._typ == 246 /* 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 == 253 /* v.ast.CallExpr */) { + else if ((*node._v__ast__Expr)._typ == 254 /* 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; @@ -42935,18 +43012,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 == 271 /* v.ast.InfixExpr */) { + else if ((*node._v__ast__Expr)._typ == 272 /* 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 == 284 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__Expr)._typ == 285 /* 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 == 270 /* v.ast.IndexExpr */) { + else if ((*node._v__ast__Expr)._typ == 271 /* 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 == 268 /* v.ast.IfExpr */) { + else if ((*node._v__ast__Expr)._typ == 269 /* 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; @@ -42960,7 +43037,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 == 277 /* v.ast.MatchExpr */) { + else if ((*node._v__ast__Expr)._typ == 278 /* 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; @@ -42974,7 +43051,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 == 286 /* v.ast.SelectExpr */) { + else if ((*node._v__ast__Expr)._typ == 287 /* 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; @@ -42988,10 +43065,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 == 255 /* v.ast.ChanInit */) { + else if ((*node._v__ast__Expr)._typ == 256 /* 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 == 276 /* v.ast.MapInit */) { + else if ((*node._v__ast__Expr)._typ == 277 /* 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; @@ -43015,15 +43092,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 == 285 /* v.ast.RangeExpr */) { + else if ((*node._v__ast__Expr)._typ == 286 /* 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 == 254 /* v.ast.CastExpr */) { + else if ((*node._v__ast__Expr)._typ == 255 /* 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 == 261 /* v.ast.ConcatExpr */) { + else if ((*node._v__ast__Expr)._typ == 262 /* 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; @@ -43037,18 +43114,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 == 258 /* v.ast.ComptimeCall */) { + else if ((*node._v__ast__Expr)._typ == 259 /* 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 == 259 /* v.ast.ComptimeSelector */) { + else if ((*node._v__ast__Expr)._typ == 260 /* 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 == 321 /* v.ast.Stmt */) { - if ((*node._v__ast__Stmt)._typ == 300 /* v.ast.Block */) { + } else if ((node)._typ == 322 /* v.ast.Stmt */) { + if ((*node._v__ast__Stmt)._typ == 301 /* 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; @@ -43062,7 +43139,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 == 304 /* v.ast.DeferStmt */) { + else if ((*node._v__ast__Stmt)._typ == 305 /* 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; @@ -43076,7 +43153,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 == 308 /* v.ast.ForCStmt */) { + else if ((*node._v__ast__Stmt)._typ == 309 /* 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; @@ -43090,7 +43167,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 == 309 /* v.ast.ForInStmt */) { + else if ((*node._v__ast__Stmt)._typ == 310 /* 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; @@ -43104,7 +43181,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 == 310 /* v.ast.ForStmt */) { + else if ((*node._v__ast__Stmt)._typ == 311 /* 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; @@ -43118,7 +43195,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 == 302 /* v.ast.ComptimeFor */) { + else if ((*node._v__ast__Stmt)._typ == 303 /* 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; @@ -43132,13 +43209,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 == 307 /* v.ast.ExprStmt */) { + else if ((*node._v__ast__Stmt)._typ == 308 /* 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 == 298 /* v.ast.AssertStmt */) { + else if ((*node._v__ast__Stmt)._typ == 299 /* 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 == 316 /* v.ast.InterfaceDecl */) { + else if ((*node._v__ast__Stmt)._typ == 317 /* 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; @@ -43162,7 +43239,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 == 299 /* v.ast.AssignStmt */) { + else if ((*node._v__ast__Stmt)._typ == 300 /* 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; @@ -43186,7 +43263,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 == 318 /* v.ast.Return */) { + else if ((*node._v__ast__Stmt)._typ == 319 /* 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; @@ -43200,7 +43277,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 == 320 /* v.ast.StructDecl */) { + else if ((*node._v__ast__Stmt)._typ == 321 /* 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; @@ -43214,7 +43291,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 == 311 /* v.ast.GlobalDecl */) { + else if ((*node._v__ast__Stmt)._typ == 312 /* 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; @@ -43228,7 +43305,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 == 303 /* v.ast.ConstDecl */) { + else if ((*node._v__ast__Stmt)._typ == 304 /* 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; @@ -43242,7 +43319,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 == 306 /* v.ast.EnumDecl */) { + else if ((*node._v__ast__Stmt)._typ == 307 /* 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; @@ -43256,7 +43333,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 == 184 /* v.ast.FnDecl */) { + else if ((*node._v__ast__Stmt)._typ == 185 /* 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) })); } @@ -43283,8 +43360,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 == 244 /* v.ast.TypeDecl */) { - if (((*(*node._v__ast__Stmt)._v__ast__TypeDecl))._typ == 243 /* v.ast.SumTypeDecl */) { + else if ((*node._v__ast__Stmt)._typ == 245 /* v.ast.TypeDecl */) { + if (((*(*node._v__ast__Stmt)._v__ast__TypeDecl))._typ == 244 /* 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; @@ -43302,36 +43379,36 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { else { } ; - } else if ((node)._typ == 326 /* v.ast.ScopeObject */) { - if ((*node._v__ast__ScopeObject)._typ == 324 /* v.ast.GlobalField */) { + } else if ((node)._typ == 327 /* v.ast.ScopeObject */) { + if ((*node._v__ast__ScopeObject)._typ == 325 /* 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 == 323 /* v.ast.ConstField */) { + else if ((*node._v__ast__ScopeObject)._typ == 324 /* 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 == 325 /* v.ast.Var */) { + else if ((*node._v__ast__ScopeObject)._typ == 326 /* 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 == 322 /* v.ast.AsmRegister */) { + else if ((*node._v__ast__ScopeObject)._typ == 323 /* v.ast.AsmRegister */) { } ; } else { - if (node._typ == 324 /* v.ast.GlobalField */) { + if (node._typ == 325 /* 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 == 323 /* v.ast.ConstField */) { + else if (node._typ == 324 /* 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 == 329 /* v.ast.EnumField */) { + else if (node._typ == 330 /* 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 == 335 /* v.ast.StructInitField */) { + else if (node._typ == 336 /* 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 == 327 /* v.ast.CallArg */) { + else if (node._typ == 328 /* 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 == 333 /* v.ast.SelectBranch */) { + else if (node._typ == 334 /* 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; @@ -43345,7 +43422,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 == 330 /* v.ast.IfBranch */) { + else if (node._typ == 331 /* 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; @@ -43359,7 +43436,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 == 175 /* v.ast.File */) { + else if (node._typ == 176 /* 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; @@ -43373,7 +43450,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 == 331 /* v.ast.MatchBranch */) { + else if (node._typ == 332 /* 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; @@ -43408,7 +43485,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 == 270 /* v.ast.IndexExpr */) { + if ((lx->left)._typ == 271 /* v.ast.IndexExpr */) { if ((*lx->left._v__ast__IndexExpr).is_map) { v__ast__IndexExpr_recursive_mapset_is_setter(&(*lx->left._v__ast__IndexExpr), val); } @@ -43417,10 +43494,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 == 270 /* v.ast.IndexExpr */) { + if ((lx->left)._typ == 271 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*lx->left._v__ast__IndexExpr)); - } else if ((lx->left)._typ == 287 /* v.ast.SelectorExpr */) { - if (((*lx->left._v__ast__SelectorExpr).expr)._typ == 270 /* v.ast.IndexExpr */) { + } else if ((lx->left)._typ == 288 /* v.ast.SelectorExpr */) { + if (((*lx->left._v__ast__SelectorExpr).expr)._typ == 271 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*(*lx->left._v__ast__SelectorExpr).expr._v__ast__IndexExpr)); } } @@ -43472,7 +43549,7 @@ Map_string_v__ast__ScopeObject v__ast__all_registers(v__ast__Table* t, v__pref__ name = string_clone(name); int max_num = (*(int*)DenseArray_value(&_v_array.key_values, _t8)); for (int i = 0; i < max_num; ++i) { - Option_int _t11 = string_index(name, _SLIT("#")); + _option_int _t11 = string_index(name, _SLIT("#")); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; _v_panic(_SLIT("all_registers: no hashtag found")); @@ -43600,7 +43677,7 @@ VV_LOCAL_SYMBOL Map_string_v__ast__ScopeObject v__ast__gen_all_registers(v__ast_ name = string_clone(name); int max_num = (*(int*)DenseArray_value(&with_numbers.key_values, _t2)); for (int i = 0; i < max_num; ++i) { - Option_int _t5 = string_index(name, _SLIT("#")); + _option_int _t5 = string_index(name, _SLIT("#")); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; _v_panic(_SLIT("all_registers: no hashtag found")); @@ -43618,43 +43695,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 == 251 /* v.ast.BoolLiteral */) { + if (expr._typ == 252 /* v.ast.BoolLiteral */) { bool _t1 = true; return _t1; } - else if (expr._typ == 256 /* v.ast.CharLiteral */) { + else if (expr._typ == 257 /* v.ast.CharLiteral */) { bool _t2 = true; return _t2; } - else if (expr._typ == 265 /* v.ast.FloatLiteral */) { + else if (expr._typ == 266 /* v.ast.FloatLiteral */) { bool _t3 = true; return _t3; } - else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 273 /* v.ast.IntegerLiteral */) { bool _t4 = true; return _t4; } - else if (expr._typ == 284 /* v.ast.PrefixExpr */) { + else if (expr._typ == 285 /* v.ast.PrefixExpr */) { bool _t5 = v__ast__Expr_is_literal((*expr._v__ast__PrefixExpr).right); return _t5; } - else if (expr._typ == 271 /* v.ast.InfixExpr */) { + else if (expr._typ == 272 /* 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 == 282 /* v.ast.ParExpr */) { + else if (expr._typ == 283 /* v.ast.ParExpr */) { bool _t7 = v__ast__Expr_is_literal((*expr._v__ast__ParExpr).expr); return _t7; } - else if (expr._typ == 254 /* v.ast.CastExpr */) { + else if (expr._typ == 255 /* 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 == 288 /* v.ast.SizeOf */) { + else if (expr._typ == 289 /* 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 == 273 /* v.ast.IsRefType */) { + else if (expr._typ == 274 /* v.ast.IsRefType */) { bool _t10 = (*expr._v__ast__IsRefType).is_type || v__ast__Expr_is_literal((*expr._v__ast__IsRefType).expr); return _t10; } @@ -43728,15 +43805,15 @@ bool Array_v__ast__Attr_contains(Array_v__ast__Attr attrs, string str) { return _t1; } -Option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs) { +_option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs) { for (int idx = 0; idx < attrs.len; ++idx) { if ((*(v__ast__Attr*)/*ee elem_sym */array_get(attrs, idx)).kind == v__ast__AttrKind__comptime_define) { - Option_int _t1; - opt_ok(&(int[]) { idx }, (Option*)(&_t1), sizeof(int)); + _option_int _t1; + opt_ok2(&(int[]) { idx }, (_option*)(&_t1), sizeof(int)); return _t1; } } - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL bool v__ast__Table_has_cflag(v__ast__Table* t, v__cflag__CFlag flag) { @@ -43751,13 +43828,13 @@ VV_LOCAL_SYMBOL bool v__ast__Table_has_cflag(v__ast__Table* t, v__cflag__CFlag f return _t3; } -Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines) { +_option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines) { Array_string allowed_flags = new_array_from_c_array(9, 9, sizeof(string), _MOV((string[9]){ _SLIT("framework"), _SLIT("library"), _SLIT("Wa"), _SLIT("Wl"), _SLIT("Wp"), _SLIT("I"), _SLIT("l"), _SLIT("L"), _SLIT("D")})); string flag_orig = string_trim_space(cflg); string flag = flag_orig; if ((flag).len == 0) { - return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } string fos = _SLIT(""); Array_string allowed_os_overrides = new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){_SLIT("linux"), _SLIT("darwin"), _SLIT("freebsd"), _SLIT("openbsd"), _SLIT("windows"), _SLIT("mingw"), _SLIT("solaris")})); @@ -43767,10 +43844,10 @@ Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, if (!string_starts_with(flag, os_override)) { continue; } - Option_int _t4 = string_index(flag, _SLIT(" ")); + _option_int _t4 = string_index(flag, _SLIT(" ")); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; - return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } int pos = (*(int*)_t4.data); @@ -43791,7 +43868,7 @@ Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, } } } - Option_int _t7 = string_index(flag, _SLIT(" -")); + _option_int _t7 = string_index(flag, _SLIT(" -")); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; *(int*) _t7.data = -1; @@ -43821,7 +43898,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 `"), /*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} }; + 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)) { @@ -43831,8 +43908,8 @@ Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, break; } } - Option_bool _t11; - opt_ok(&(bool[]) { true }, (Option*)(&_t11), sizeof(bool)); + _option_bool _t11; + opt_ok2(&(bool[]) { true }, (_option*)(&_t11), sizeof(bool)); return _t11; } @@ -43842,418 +43919,418 @@ v__ast__ComptTimeConstValue v__ast__empty_comptime_const_expr(void) { return _t1; } -Option_i8 v__ast__ComptTimeConstValue_i8(v__ast__ComptTimeConstValue val) { - Option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); +_option_i8 v__ast__ComptTimeConstValue_i8(v__ast__ComptTimeConstValue val) { + _option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); if (_t1.state != 0) { /*or block*/ - Option_i8 _t2; + _option_i8 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } i64 x = (*(i64*)_t1.data); if (x > -129 && x < 128) { - Option_i8 _t3; - opt_ok(&(i8[]) { ((i8)(x)) }, (Option*)(&_t3), sizeof(i8)); + _option_i8 _t3; + opt_ok2(&(i8[]) { ((i8)(x)) }, (_option*)(&_t3), sizeof(i8)); return _t3; } - return (Option_i8){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i8){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_i16 v__ast__ComptTimeConstValue_i16(v__ast__ComptTimeConstValue val) { - Option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); +_option_i16 v__ast__ComptTimeConstValue_i16(v__ast__ComptTimeConstValue val) { + _option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); if (_t1.state != 0) { /*or block*/ - Option_i16 _t2; + _option_i16 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } i64 x = (*(i64*)_t1.data); if (x > -32769 && x < 32768) { - Option_i16 _t3; - opt_ok(&(i16[]) { ((i16)(x)) }, (Option*)(&_t3), sizeof(i16)); + _option_i16 _t3; + opt_ok2(&(i16[]) { ((i16)(x)) }, (_option*)(&_t3), sizeof(i16)); return _t3; } - return (Option_i16){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i16){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_int v__ast__ComptTimeConstValue_int(v__ast__ComptTimeConstValue val) { - Option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); +_option_int v__ast__ComptTimeConstValue_int(v__ast__ComptTimeConstValue val) { + _option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); if (_t1.state != 0) { /*or block*/ - Option_int _t2; + _option_int _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } i64 x = (*(i64*)_t1.data); if (x > -2147483649 && x < 2147483648) { - Option_int _t3; - opt_ok(&(int[]) { ((int)(x)) }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { ((int)(x)) }, (_option*)(&_t3), sizeof(int)); return _t3; } - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val) { +_option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val) { if (val._typ == 5 /* i8 */) { - Option_i64 _t1; - opt_ok(&(i64[]) { ((i64)((*val._i8))) }, (Option*)(&_t1), sizeof(i64)); + _option_i64 _t1; + opt_ok2(&(i64[]) { ((i64)((*val._i8))) }, (_option*)(&_t1), sizeof(i64)); return _t1; } else if (val._typ == 6 /* i16 */) { - Option_i64 _t2; - opt_ok(&(i64[]) { ((i64)((*val._i16))) }, (Option*)(&_t2), sizeof(i64)); + _option_i64 _t2; + opt_ok2(&(i64[]) { ((i64)((*val._i16))) }, (_option*)(&_t2), sizeof(i64)); return _t2; } else if (val._typ == 7 /* int */) { - Option_i64 _t3; - opt_ok(&(i64[]) { ((i64)((*val._int))) }, (Option*)(&_t3), sizeof(i64)); + _option_i64 _t3; + opt_ok2(&(i64[]) { ((i64)((*val._int))) }, (_option*)(&_t3), sizeof(i64)); return _t3; } else if (val._typ == 8 /* i64 */) { - Option_i64 _t4; - opt_ok(&(i64[]) { ((i64)((*val._i64))) }, (Option*)(&_t4), sizeof(i64)); + _option_i64 _t4; + opt_ok2(&(i64[]) { ((i64)((*val._i64))) }, (_option*)(&_t4), sizeof(i64)); return _t4; } else if (val._typ == 10 /* u8 */) { - Option_i64 _t5; - opt_ok(&(i64[]) { ((i64)((*val._u8))) }, (Option*)(&_t5), sizeof(i64)); + _option_i64 _t5; + opt_ok2(&(i64[]) { ((i64)((*val._u8))) }, (_option*)(&_t5), sizeof(i64)); return _t5; } else if (val._typ == 11 /* u16 */) { - Option_i64 _t6; - opt_ok(&(i64[]) { ((i64)((*val._u16))) }, (Option*)(&_t6), sizeof(i64)); + _option_i64 _t6; + opt_ok2(&(i64[]) { ((i64)((*val._u16))) }, (_option*)(&_t6), sizeof(i64)); return _t6; } else if (val._typ == 12 /* u32 */) { - Option_i64 _t7; - opt_ok(&(i64[]) { ((i64)((*val._u32))) }, (Option*)(&_t7), sizeof(i64)); + _option_i64 _t7; + opt_ok2(&(i64[]) { ((i64)((*val._u32))) }, (_option*)(&_t7), sizeof(i64)); return _t7; } else if (val._typ == 13 /* u64 */) { if ((*val._u64) <= 9223372036854775807U) { - Option_i64 _t8; - opt_ok(&(i64[]) { ((i64)((*val._u64))) }, (Option*)(&_t8), sizeof(i64)); + _option_i64 _t8; + opt_ok2(&(i64[]) { ((i64)((*val._u64))) }, (_option*)(&_t8), sizeof(i64)); return _t8; } } else if (val._typ == 15 /* f32 */) { if (-9223372036854775808.0 <= (*val._f32) && (*val._f32) <= 9223372036854775807.0) { - Option_i64 _t9; - opt_ok(&(i64[]) { ((i64)((*val._f32))) }, (Option*)(&_t9), sizeof(i64)); + _option_i64 _t9; + opt_ok2(&(i64[]) { ((i64)((*val._f32))) }, (_option*)(&_t9), sizeof(i64)); return _t9; } } else if (val._typ == 16 /* f64 */) { if (-9223372036854775808.0 <= (*val._f64) && (*val._f64) <= 9223372036854775807.0) { - Option_i64 _t10; - opt_ok(&(i64[]) { ((i64)((*val._f64))) }, (Option*)(&_t10), sizeof(i64)); + _option_i64 _t10; + opt_ok2(&(i64[]) { ((i64)((*val._f64))) }, (_option*)(&_t10), sizeof(i64)); return _t10; } } else if (val._typ == 20 /* string */) { - Option_i64 _t11; - opt_ok(&(i64[]) { string_i64((*val._string)) }, (Option*)(&_t11), sizeof(i64)); + _option_i64 _t11; + opt_ok2(&(i64[]) { string_i64((*val._string)) }, (_option*)(&_t11), sizeof(i64)); return _t11; } else if (val._typ == 21 /* rune */) { - Option_i64 _t12; - opt_ok(&(i64[]) { ((int)((*val._rune))) }, (Option*)(&_t12), sizeof(i64)); + _option_i64 _t12; + opt_ok2(&(i64[]) { ((int)((*val._rune))) }, (_option*)(&_t12), sizeof(i64)); return _t12; } - else if (val._typ == 263 /* v.ast.EmptyExpr */) { + else if (val._typ == 264 /* v.ast.EmptyExpr */) { } ; - return (Option_i64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_u8 v__ast__ComptTimeConstValue_u8(v__ast__ComptTimeConstValue val) { - Option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); +_option_u8 v__ast__ComptTimeConstValue_u8(v__ast__ComptTimeConstValue val) { + _option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); if (_t1.state != 0) { /*or block*/ - Option_u8 _t2; + _option_u8 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } u64 x = (*(u64*)_t1.data); if (x < 256U) { - Option_u8 _t3; - opt_ok(&(u8[]) { ((u8)(x)) }, (Option*)(&_t3), sizeof(u8)); + _option_u8 _t3; + opt_ok2(&(u8[]) { ((u8)(x)) }, (_option*)(&_t3), sizeof(u8)); return _t3; } - return (Option_u8){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u8){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_u16 v__ast__ComptTimeConstValue_u16(v__ast__ComptTimeConstValue val) { - Option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); +_option_u16 v__ast__ComptTimeConstValue_u16(v__ast__ComptTimeConstValue val) { + _option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); if (_t1.state != 0) { /*or block*/ - Option_u16 _t2; + _option_u16 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } u64 x = (*(u64*)_t1.data); if (x < 65536U) { - Option_u16 _t3; - opt_ok(&(u16[]) { ((u16)(x)) }, (Option*)(&_t3), sizeof(u16)); + _option_u16 _t3; + opt_ok2(&(u16[]) { ((u16)(x)) }, (_option*)(&_t3), sizeof(u16)); return _t3; } - return (Option_u16){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u16){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_u32 v__ast__ComptTimeConstValue_u32(v__ast__ComptTimeConstValue val) { - Option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); +_option_u32 v__ast__ComptTimeConstValue_u32(v__ast__ComptTimeConstValue val) { + _option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); if (_t1.state != 0) { /*or block*/ - Option_u32 _t2; + _option_u32 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } u64 x = (*(u64*)_t1.data); if (x < 4294967296U) { - Option_u32 _t3; - opt_ok(&(u32[]) { ((u32)(x)) }, (Option*)(&_t3), sizeof(u32)); + _option_u32 _t3; + opt_ok2(&(u32[]) { ((u32)(x)) }, (_option*)(&_t3), sizeof(u32)); return _t3; } - return (Option_u32){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u32){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val) { +_option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val) { if (val._typ == 5 /* i8 */) { if ((*val._i8) >= 0) { - Option_u64 _t1; - opt_ok(&(u64[]) { ((u64)((*val._i8))) }, (Option*)(&_t1), sizeof(u64)); + _option_u64 _t1; + opt_ok2(&(u64[]) { ((u64)((*val._i8))) }, (_option*)(&_t1), sizeof(u64)); return _t1; } } else if (val._typ == 6 /* i16 */) { if ((*val._i16) >= 0) { - Option_u64 _t2; - opt_ok(&(u64[]) { ((u64)((*val._i16))) }, (Option*)(&_t2), sizeof(u64)); + _option_u64 _t2; + opt_ok2(&(u64[]) { ((u64)((*val._i16))) }, (_option*)(&_t2), sizeof(u64)); return _t2; } } else if (val._typ == 7 /* int */) { if ((*val._int) >= 0) { - Option_u64 _t3; - opt_ok(&(u64[]) { ((u64)((*val._int))) }, (Option*)(&_t3), sizeof(u64)); + _option_u64 _t3; + opt_ok2(&(u64[]) { ((u64)((*val._int))) }, (_option*)(&_t3), sizeof(u64)); return _t3; } } else if (val._typ == 8 /* i64 */) { if ((*val._i64) >= 0) { - Option_u64 _t4; - opt_ok(&(u64[]) { ((u64)((*val._i64))) }, (Option*)(&_t4), sizeof(u64)); + _option_u64 _t4; + opt_ok2(&(u64[]) { ((u64)((*val._i64))) }, (_option*)(&_t4), sizeof(u64)); return _t4; } } else if (val._typ == 10 /* u8 */) { - Option_u64 _t5; - opt_ok(&(u64[]) { ((u64)((*val._u8))) }, (Option*)(&_t5), sizeof(u64)); + _option_u64 _t5; + opt_ok2(&(u64[]) { ((u64)((*val._u8))) }, (_option*)(&_t5), sizeof(u64)); return _t5; } else if (val._typ == 11 /* u16 */) { - Option_u64 _t6; - opt_ok(&(u64[]) { ((u64)((*val._u16))) }, (Option*)(&_t6), sizeof(u64)); + _option_u64 _t6; + opt_ok2(&(u64[]) { ((u64)((*val._u16))) }, (_option*)(&_t6), sizeof(u64)); return _t6; } else if (val._typ == 12 /* u32 */) { - Option_u64 _t7; - opt_ok(&(u64[]) { ((u64)((*val._u32))) }, (Option*)(&_t7), sizeof(u64)); + _option_u64 _t7; + opt_ok2(&(u64[]) { ((u64)((*val._u32))) }, (_option*)(&_t7), sizeof(u64)); return _t7; } else if (val._typ == 13 /* u64 */) { - Option_u64 _t8; - opt_ok(&(u64[]) { (*val._u64) }, (Option*)(&_t8), sizeof(u64)); + _option_u64 _t8; + opt_ok2(&(u64[]) { (*val._u64) }, (_option*)(&_t8), sizeof(u64)); return _t8; } else if (val._typ == 15 /* f32 */) { if ((*val._f32) <= 18446744073709551615.0) { - Option_u64 _t9; - opt_ok(&(u64[]) { ((u64)((*val._f32))) }, (Option*)(&_t9), sizeof(u64)); + _option_u64 _t9; + opt_ok2(&(u64[]) { ((u64)((*val._f32))) }, (_option*)(&_t9), sizeof(u64)); return _t9; } } else if (val._typ == 16 /* f64 */) { if ((*val._f64) <= 18446744073709551615.0) { - Option_u64 _t10; - opt_ok(&(u64[]) { ((u64)((*val._f64))) }, (Option*)(&_t10), sizeof(u64)); + _option_u64 _t10; + opt_ok2(&(u64[]) { ((u64)((*val._f64))) }, (_option*)(&_t10), sizeof(u64)); return _t10; } } else if (val._typ == 20 /* string */) { - Option_u64 _t11; - opt_ok(&(u64[]) { string_u64((*val._string)) }, (Option*)(&_t11), sizeof(u64)); + _option_u64 _t11; + opt_ok2(&(u64[]) { string_u64((*val._string)) }, (_option*)(&_t11), sizeof(u64)); return _t11; } else if (val._typ == 21 /* rune */) { } - else if (val._typ == 263 /* v.ast.EmptyExpr */) { + else if (val._typ == 264 /* v.ast.EmptyExpr */) { } ; - return (Option_u64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_f32 v__ast__ComptTimeConstValue_f32(v__ast__ComptTimeConstValue val) { - Option_f64 _t1 = v__ast__ComptTimeConstValue_f64(val); +_option_f32 v__ast__ComptTimeConstValue_f32(v__ast__ComptTimeConstValue val) { + _option_f64 _t1 = v__ast__ComptTimeConstValue_f64(val); if (_t1.state != 0) { /*or block*/ - Option_f32 _t2; + _option_f32 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } f64 x = (*(f64*)_t1.data); - Option_f32 _t3; - opt_ok(&(f32[]) { ((f32)(x)) }, (Option*)(&_t3), sizeof(f32)); + _option_f32 _t3; + opt_ok2(&(f32[]) { ((f32)(x)) }, (_option*)(&_t3), sizeof(f32)); return _t3; } -Option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val) { +_option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val) { if (val._typ == 5 /* i8 */) { - Option_f64 _t1; - opt_ok(&(f64[]) { ((f64)((*val._i8))) }, (Option*)(&_t1), sizeof(f64)); + _option_f64 _t1; + opt_ok2(&(f64[]) { ((f64)((*val._i8))) }, (_option*)(&_t1), sizeof(f64)); return _t1; } else if (val._typ == 6 /* i16 */) { - Option_f64 _t2; - opt_ok(&(f64[]) { ((f64)((*val._i16))) }, (Option*)(&_t2), sizeof(f64)); + _option_f64 _t2; + opt_ok2(&(f64[]) { ((f64)((*val._i16))) }, (_option*)(&_t2), sizeof(f64)); return _t2; } else if (val._typ == 7 /* int */) { - Option_f64 _t3; - opt_ok(&(f64[]) { ((f64)((*val._int))) }, (Option*)(&_t3), sizeof(f64)); + _option_f64 _t3; + opt_ok2(&(f64[]) { ((f64)((*val._int))) }, (_option*)(&_t3), sizeof(f64)); return _t3; } else if (val._typ == 8 /* i64 */) { - Option_f64 _t4; - opt_ok(&(f64[]) { ((f64)((*val._i64))) }, (Option*)(&_t4), sizeof(f64)); + _option_f64 _t4; + opt_ok2(&(f64[]) { ((f64)((*val._i64))) }, (_option*)(&_t4), sizeof(f64)); return _t4; } else if (val._typ == 10 /* u8 */) { - Option_f64 _t5; - opt_ok(&(f64[]) { ((f64)((*val._u8))) }, (Option*)(&_t5), sizeof(f64)); + _option_f64 _t5; + opt_ok2(&(f64[]) { ((f64)((*val._u8))) }, (_option*)(&_t5), sizeof(f64)); return _t5; } else if (val._typ == 11 /* u16 */) { - Option_f64 _t6; - opt_ok(&(f64[]) { ((f64)((*val._u16))) }, (Option*)(&_t6), sizeof(f64)); + _option_f64 _t6; + opt_ok2(&(f64[]) { ((f64)((*val._u16))) }, (_option*)(&_t6), sizeof(f64)); return _t6; } else if (val._typ == 12 /* u32 */) { - Option_f64 _t7; - opt_ok(&(f64[]) { ((f64)((*val._u32))) }, (Option*)(&_t7), sizeof(f64)); + _option_f64 _t7; + opt_ok2(&(f64[]) { ((f64)((*val._u32))) }, (_option*)(&_t7), sizeof(f64)); return _t7; } else if (val._typ == 13 /* u64 */) { - Option_f64 _t8; - opt_ok(&(f64[]) { ((f64)((*val._u64))) }, (Option*)(&_t8), sizeof(f64)); + _option_f64 _t8; + opt_ok2(&(f64[]) { ((f64)((*val._u64))) }, (_option*)(&_t8), sizeof(f64)); return _t8; } else if (val._typ == 15 /* f32 */) { - Option_f64 _t9; - opt_ok(&(f64[]) { ((f64)((*val._f32))) }, (Option*)(&_t9), sizeof(f64)); + _option_f64 _t9; + opt_ok2(&(f64[]) { ((f64)((*val._f32))) }, (_option*)(&_t9), sizeof(f64)); return _t9; } else if (val._typ == 16 /* f64 */) { - Option_f64 _t10; - opt_ok(&(f64[]) { (*val._f64) }, (Option*)(&_t10), sizeof(f64)); + _option_f64 _t10; + opt_ok2(&(f64[]) { (*val._f64) }, (_option*)(&_t10), sizeof(f64)); return _t10; } else if (val._typ == 20 /* string */) { - Option_f64 _t11; - opt_ok(&(f64[]) { string_f64((*val._string)) }, (Option*)(&_t11), sizeof(f64)); + _option_f64 _t11; + opt_ok2(&(f64[]) { string_f64((*val._string)) }, (_option*)(&_t11), sizeof(f64)); return _t11; } else if (val._typ == 21 /* rune */) { } - else if (val._typ == 263 /* v.ast.EmptyExpr */) { + else if (val._typ == 264 /* v.ast.EmptyExpr */) { } ; - return (Option_f64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val) { +_option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val) { if (val._typ == 5 /* i8 */) { - Option_string _t1; - opt_ok(&(string[]) { i8_str((*val._i8)) }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { i8_str((*val._i8)) }, (_option*)(&_t1), sizeof(string)); return _t1; } else if (val._typ == 6 /* i16 */) { - Option_string _t2; - opt_ok(&(string[]) { i16_str((*val._i16)) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { i16_str((*val._i16)) }, (_option*)(&_t2), sizeof(string)); return _t2; } else if (val._typ == 7 /* int */) { - Option_string _t3; - opt_ok(&(string[]) { int_str((*val._int)) }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { int_str((*val._int)) }, (_option*)(&_t3), sizeof(string)); return _t3; } else if (val._typ == 8 /* i64 */) { - Option_string _t4; - opt_ok(&(string[]) { i64_str((*val._i64)) }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { i64_str((*val._i64)) }, (_option*)(&_t4), sizeof(string)); return _t4; } else if (val._typ == 10 /* u8 */) { - Option_string _t5; - opt_ok(&(string[]) { u8_str((*val._u8)) }, (Option*)(&_t5), sizeof(string)); + _option_string _t5; + opt_ok2(&(string[]) { u8_str((*val._u8)) }, (_option*)(&_t5), sizeof(string)); return _t5; } else if (val._typ == 11 /* u16 */) { - Option_string _t6; - opt_ok(&(string[]) { u16_str((*val._u16)) }, (Option*)(&_t6), sizeof(string)); + _option_string _t6; + opt_ok2(&(string[]) { u16_str((*val._u16)) }, (_option*)(&_t6), sizeof(string)); return _t6; } else if (val._typ == 12 /* u32 */) { - Option_string _t7; - opt_ok(&(string[]) { u32_str((*val._u32)) }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { u32_str((*val._u32)) }, (_option*)(&_t7), sizeof(string)); return _t7; } else if (val._typ == 13 /* u64 */) { - Option_string _t8; - opt_ok(&(string[]) { u64_str((*val._u64)) }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(string[]) { u64_str((*val._u64)) }, (_option*)(&_t8), sizeof(string)); return _t8; } else if (val._typ == 15 /* f32 */) { - Option_string _t9; - opt_ok(&(string[]) { f32_str((*val._f32)) }, (Option*)(&_t9), sizeof(string)); + _option_string _t9; + opt_ok2(&(string[]) { f32_str((*val._f32)) }, (_option*)(&_t9), sizeof(string)); return _t9; } else if (val._typ == 16 /* f64 */) { - Option_string _t10; - opt_ok(&(string[]) { f64_str((*val._f64)) }, (Option*)(&_t10), sizeof(string)); + _option_string _t10; + opt_ok2(&(string[]) { f64_str((*val._f64)) }, (_option*)(&_t10), sizeof(string)); return _t10; } else if (val._typ == 21 /* rune */) { - Option_string _t11; - opt_ok(&(string[]) { rune_str((*val._rune)) }, (Option*)(&_t11), sizeof(string)); + _option_string _t11; + opt_ok2(&(string[]) { rune_str((*val._rune)) }, (_option*)(&_t11), sizeof(string)); return _t11; } else if (val._typ == 20 /* string */) { - Option_string _t12; - opt_ok(&(string[]) { (*val._string) }, (Option*)(&_t12), sizeof(string)); + _option_string _t12; + opt_ok2(&(string[]) { (*val._string) }, (_option*)(&_t12), sizeof(string)); return _t12; } - else if (val._typ == 263 /* v.ast.EmptyExpr */) { + else if (val._typ == 264 /* v.ast.EmptyExpr */) { } ; - return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + 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 != 263 /* v.ast.EmptyExpr */) { - Option_v__ast__ComptTimeConstValue _t1; - opt_ok(&(v__ast__ComptTimeConstValue[]) { obj->comptime_expr_value }, (Option*)(&_t1), sizeof(v__ast__ComptTimeConstValue)); +_option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast__ConstField* obj) { + if ((obj->comptime_expr_value)._typ != 264 /* v.ast.EmptyExpr */) { + _option_v__ast__ComptTimeConstValue _t1; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { obj->comptime_expr_value }, (_option*)(&_t1), sizeof(v__ast__ComptTimeConstValue)); return _t1; } - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__ConstField_is_simple_define_const(v__ast__ConstField* obj) { - 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)); + bool _t1 = ((obj->expr._typ == 257 /* v.ast.CharLiteral */) ? (true) : (obj->expr._typ == 266 /* v.ast.FloatLiteral */) ? (true) : (obj->expr._typ == 273 /* v.ast.IntegerLiteral */) ? (true) : (false)); return _t1; } bool v__ast__ScopeObject_is_simple_define_const(v__ast__ScopeObject obj) { - if ((obj)._typ == 323 /* v.ast.ConstField */) { + if ((obj)._typ == 324 /* v.ast.ConstField */) { bool _t1 = v__ast__ConstField_is_simple_define_const(&(*obj._v__ast__ConstField)); return _t1; } @@ -44269,7 +44346,7 @@ u64 v__ast__EmbeddedFile_hash(v__ast__EmbeddedFile e) { 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, name: v.ast.Array */ ; bool has_len = false; bool has_cap = false; bool has_default = false; @@ -44319,7 +44396,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, 413) /*expected idx: 413, 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, 414) /*expected idx: 414, 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) { @@ -44352,24 +44429,24 @@ VV_LOCAL_SYMBOL bool v__ast__Scope_dont_lookup_parent(v__ast__Scope* s) { return _t1; } -Option_v__ast__ScopeObject v__ast__Scope_find(v__ast__Scope* s, string name) { +_option_v__ast__ScopeObject v__ast__Scope_find(v__ast__Scope* s, string name) { for (v__ast__Scope* sc = s; true; sc = sc->parent) { if (_IN_MAP(ADDR(string, name), ADDR(map, sc->objects))) { - Option_v__ast__ScopeObject _t1; - opt_ok(&(v__ast__ScopeObject[]) { (*(v__ast__ScopeObject*)map_get(ADDR(map, sc->objects), &(string[]){name}, &(v__ast__ScopeObject[]){ {0} })) }, (Option*)(&_t1), sizeof(v__ast__ScopeObject)); + _option_v__ast__ScopeObject _t1; + opt_ok2(&(v__ast__ScopeObject[]) { (*(v__ast__ScopeObject*)map_get(ADDR(map, sc->objects), &(string[]){name}, &(v__ast__ScopeObject[]){ {0} })) }, (_option*)(&_t1), sizeof(v__ast__ScopeObject)); return _t1; } if (v__ast__Scope_dont_lookup_parent(sc)) { break; } } - return (Option_v__ast__ScopeObject){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ScopeObject){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s, string name, v__ast__Type struct_type, string field_name) { +_option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s, string name, v__ast__Type struct_type, string field_name) { for (v__ast__Scope* sc = s; true; sc = sc->parent) { v__ast__ScopeStructField* _t2 = (v__ast__ScopeStructField*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, sc->struct_fields), &(string[]){name})); - Option_v__ast__ScopeStructField _t1 = {0}; + _option_v__ast__ScopeStructField _t1 = {0}; if (_t2) { *((v__ast__ScopeStructField*)&_t1.data) = *((v__ast__ScopeStructField*)_t2); } else { @@ -44379,8 +44456,8 @@ Option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s if (_t1.state == 0) { v__ast__ScopeStructField field = *(v__ast__ScopeStructField*)_t1.data; if (v__ast__Type_alias_eq(field.struct_type, struct_type) && string__eq(field.name, field_name)) { - Option_v__ast__ScopeStructField _t3; - opt_ok(&(v__ast__ScopeStructField[]) { field }, (Option*)(&_t3), sizeof(v__ast__ScopeStructField)); + _option_v__ast__ScopeStructField _t3; + opt_ok2(&(v__ast__ScopeStructField[]) { field }, (_option*)(&_t3), sizeof(v__ast__ScopeStructField)); return _t3; } } @@ -44388,16 +44465,16 @@ Option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s break; } } - return (Option_v__ast__ScopeStructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ScopeStructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name) { - Option_v__ast__ScopeObject _t1; +_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 == 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*)); + if ((*(obj))._typ == 326 /* v.ast.Var */) { + _option_v__ast__Var_ptr _t2; + opt_ok2(&(v__ast__Var*[]) { &(*((obj->_v__ast__Var))) }, (_option*)(&_t2), sizeof(v__ast__Var*)); return _t2; } @@ -44405,16 +44482,16 @@ Option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name) { } ; } - return (Option_v__ast__Var_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Var_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, string name) { - Option_v__ast__ScopeObject _t1; +_option_v__ast__GlobalField_ptr v__ast__Scope_find_global(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.GlobalField */) { - Option_v__ast__GlobalField_ptr _t2; - opt_ok(&(v__ast__GlobalField*[]) { &(*((obj->_v__ast__GlobalField))) }, (Option*)(&_t2), sizeof(v__ast__GlobalField*)); + if ((*(obj))._typ == 325 /* v.ast.GlobalField */) { + _option_v__ast__GlobalField_ptr _t2; + opt_ok2(&(v__ast__GlobalField*[]) { &(*((obj->_v__ast__GlobalField))) }, (_option*)(&_t2), sizeof(v__ast__GlobalField*)); return _t2; } @@ -44422,16 +44499,16 @@ Option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, strin } ; } - return (Option_v__ast__GlobalField_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__GlobalField_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string name) { - Option_v__ast__ScopeObject _t1; +_option_v__ast__ConstField_ptr v__ast__Scope_find_const(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 == 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*)); + if ((*(obj))._typ == 324 /* v.ast.ConstField */) { + _option_v__ast__ConstField_ptr _t2; + opt_ok2(&(v__ast__ConstField*[]) { &(*((obj->_v__ast__ConstField))) }, (_option*)(&_t2), sizeof(v__ast__ConstField*)); return _t2; } @@ -44439,11 +44516,11 @@ Option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string } ; } - return (Option_v__ast__ConstField_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ConstField_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__Scope_known_var(v__ast__Scope* s, string name) { - Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(s, name); + _option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(s, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -44456,7 +44533,7 @@ bool v__ast__Scope_known_var(v__ast__Scope* s, string name) { } bool v__ast__Scope_known_const(v__ast__Scope* s, string name) { - Option_v__ast__ConstField_ptr _t1 = v__ast__Scope_find_const(s, name); + _option_v__ast__ConstField_ptr _t1 = v__ast__Scope_find_const(s, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -44470,7 +44547,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 == 325 /* v.ast.Var */) { + if ((obj)._typ == 326 /* v.ast.Var */) { if (!v__ast__Type_alias_eq((*obj._v__ast__Var).typ, typ)) { (*obj._v__ast__Var).typ = typ; } @@ -44479,7 +44556,7 @@ void v__ast__Scope_update_var_type(v__ast__Scope* s, string name, v__ast__Type t void v__ast__Scope_register_struct_field(v__ast__Scope* s, string name, v__ast__ScopeStructField field) { v__ast__ScopeStructField* _t2 = (v__ast__ScopeStructField*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, s->struct_fields), &(string[]){name})); - Option_v__ast__ScopeStructField _t1 = {0}; + _option_v__ast__ScopeStructField _t1 = {0}; if (_t2) { *((v__ast__ScopeStructField*)&_t1.data) = *((v__ast__ScopeStructField*)_t2); } else { @@ -44548,7 +44625,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 == 325 /* v.ast.Var */) { + if ((obj)._typ == 326 /* v.ast.Var */) { if ((*obj._v__ast__Var).is_inherited) { bool _t5 = true; return _t5; @@ -44578,10 +44655,10 @@ 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 == 323 /* v.ast.ConstField */) { + if (obj._typ == 324 /* 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 == 325 /* v.ast.Var */) { + else if (obj._typ == 326 /* 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 }}}))); } @@ -44714,7 +44791,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 == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* 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; @@ -44835,24 +44912,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 == 267 /* v.ast.Ident */) { + if (sub_expr._typ == 268 /* v.ast.Ident */) { if (string_at((*sub_expr._v__ast__Ident).name, 0) == '@') { needs_braces = true; } break; } - else if (sub_expr._typ == 253 /* v.ast.CallExpr */) { + else if (sub_expr._typ == 254 /* 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 == 253 /* v.ast.CallExpr */) { + } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 254 /* v.ast.CallExpr */) { sub_expr = (*sub_expr._v__ast__CallExpr).left; continue; - } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 254 /* v.ast.CastExpr */ || ((*sub_expr._v__ast__CallExpr).left)._typ == 270 /* v.ast.IndexExpr */) { + } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 255 /* v.ast.CastExpr */ || ((*sub_expr._v__ast__CallExpr).left)._typ == 271 /* v.ast.IndexExpr */) { needs_braces = true; } break; } - else if (sub_expr._typ == 287 /* v.ast.SelectorExpr */) { + else if (sub_expr._typ == 288 /* v.ast.SelectorExpr */) { if (string_at((*sub_expr._v__ast__SelectorExpr).field_name, 0) == '@') { needs_braces = true; break; @@ -44890,19 +44967,19 @@ multi_return_string_bool v__ast__StringInterLiteral_get_fspec_braces(v__ast__Str } string v__ast__Expr_str(v__ast__Expr x) { - if (x._typ == 245 /* v.ast.AnonFn */) { + if (x._typ == 246 /* v.ast.AnonFn */) { string _t1 = _SLIT("anon_fn"); return _t1; } - else if (x._typ == 260 /* v.ast.ComptimeType */) { + else if (x._typ == 261 /* v.ast.ComptimeType */) { string _t2 = v__ast__ComptimeType_str((*x._v__ast__ComptimeType)); return _t2; } - else if (x._typ == 262 /* v.ast.DumpExpr */) { + else if (x._typ == 263 /* 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 == 247 /* v.ast.ArrayInit */) { + else if (x._typ == 248 /* 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: "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).len_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); @@ -44921,27 +44998,27 @@ string v__ast__Expr_str(v__ast__Expr x) { return _t8; } } - else if (x._typ == 248 /* v.ast.AsCast */) { + else if (x._typ == 249 /* 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 == 250 /* v.ast.AtExpr */) { + else if (x._typ == 251 /* 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 == 252 /* v.ast.CTempVar */) { + else if (x._typ == 253 /* v.ast.CTempVar */) { string _t11 = v__ast__Expr_str((*x._v__ast__CTempVar).orig); return _t11; } - else if (x._typ == 251 /* v.ast.BoolLiteral */) { + else if (x._typ == 252 /* v.ast.BoolLiteral */) { string _t12 = bool_str((*x._v__ast__BoolLiteral).val); return _t12; } - else if (x._typ == 254 /* v.ast.CastExpr */) { + else if (x._typ == 255 /* 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 == 253 /* v.ast.CallExpr */) { + else if (x._typ == 254 /* 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_option ? (_SLIT(" ?")) : (_SLIT(""))); if ((*x._v__ast__CallExpr).is_method) { @@ -44963,11 +45040,11 @@ string v__ast__Expr_str(v__ast__Expr x) { 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 == 256 /* v.ast.CharLiteral */) { + else if (x._typ == 257 /* 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 == 257 /* v.ast.Comment */) { + else if (x._typ == 258 /* 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("/* "), /*100 &int*/0xfe07, {.d_i32 = lines.len}}, {_SLIT(" lines comment */"), 0, { .d_c = 0 }}})); @@ -44978,11 +45055,11 @@ string v__ast__Expr_str(v__ast__Expr x) { return _t21; } } - else if (x._typ == 259 /* v.ast.ComptimeSelector */) { + else if (x._typ == 260 /* 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 == 261 /* v.ast.ConcatExpr */) { + else if (x._typ == 262 /* v.ast.ConcatExpr */) { Array_string _t24 = {0}; Array_v__ast__Expr _t24_orig = (*x._v__ast__ConcatExpr).vals; int _t24_len = _t24_orig.len; @@ -44996,27 +45073,27 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t23 = Array_string_join(_t24, _SLIT(",")); return _t23; } - else if (x._typ == 264 /* v.ast.EnumVal */) { + else if (x._typ == 265 /* 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 == 265 /* v.ast.FloatLiteral */) { + else if (x._typ == 266 /* v.ast.FloatLiteral */) { string _t27 = (*x._v__ast__FloatLiteral).val; return _t27; } - else if (x._typ == 272 /* v.ast.IntegerLiteral */) { + else if (x._typ == 273 /* v.ast.IntegerLiteral */) { string _t28 = (*x._v__ast__IntegerLiteral).val; return _t28; } - else if (x._typ == 266 /* v.ast.GoExpr */) { + else if (x._typ == 267 /* 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 == 267 /* v.ast.Ident */) { + else if (x._typ == 268 /* v.ast.Ident */) { string _t30 = (*x._v__ast__Ident).name; return _t30; } - else if (x._typ == 268 /* v.ast.IfExpr */) { + else if (x._typ == 269 /* 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) { @@ -45036,15 +45113,15 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t36 = Array_string_join(parts, _SLIT("")); return _t36; } - else if (x._typ == 270 /* v.ast.IndexExpr */) { + else if (x._typ == 271 /* 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 == 271 /* v.ast.InfixExpr */) { + else if (x._typ == 272 /* 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 == 276 /* v.ast.MapInit */) { + else if (x._typ == 277 /* 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]; @@ -45054,11 +45131,11 @@ string v__ast__Expr_str(v__ast__Expr x) { 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 == 282 /* v.ast.ParExpr */) { + else if (x._typ == 283 /* 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 == 283 /* v.ast.PostfixExpr */) { + else if (x._typ == 284 /* v.ast.PostfixExpr */) { if ((*x._v__ast__PostfixExpr).op == v__token__Kind__question) { 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; @@ -45066,11 +45143,11 @@ string v__ast__Expr_str(v__ast__Expr x) { 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 == 284 /* v.ast.PrefixExpr */) { + else if (x._typ == 285 /* 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 == 285 /* v.ast.RangeExpr */) { + else if (x._typ == 286 /* v.ast.RangeExpr */) { string s = _SLIT(".."); if ((*x._v__ast__RangeExpr).has_low) { 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); @@ -45081,15 +45158,15 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t45 = s; return _t45; } - else if (x._typ == 286 /* v.ast.SelectExpr */) { + else if (x._typ == 287 /* v.ast.SelectExpr */) { string _t46 = _SLIT("ast.SelectExpr"); return _t46; } - else if (x._typ == 287 /* v.ast.SelectorExpr */) { + else if (x._typ == 288 /* 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 == 288 /* v.ast.SizeOf */) { + else if (x._typ == 289 /* v.ast.SizeOf */) { if ((*x._v__ast__SizeOf).is_type) { 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; @@ -45097,11 +45174,11 @@ string v__ast__Expr_str(v__ast__Expr x) { 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 == 280 /* v.ast.OffsetOf */) { + else if (x._typ == 281 /* 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 == 290 /* v.ast.StringInterLiteral */) { + else if (x._typ == 291 /* 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) { @@ -45127,35 +45204,35 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t51 = strings__Builder_str(&res); return _t51; } - else if (x._typ == 291 /* v.ast.StringLiteral */) { + else if (x._typ == 292 /* 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 == 293 /* v.ast.TypeNode */) { + else if (x._typ == 294 /* 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 == 294 /* v.ast.TypeOf */) { + else if (x._typ == 295 /* 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 == 274 /* v.ast.Likely */) { + else if (x._typ == 275 /* 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 == 295 /* v.ast.UnsafeExpr */) { + else if (x._typ == 296 /* 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 == 279 /* v.ast.None */) { + else if (x._typ == 280 /* v.ast.None */) { string _t57 = _SLIT("none"); return _t57; } - else if (x._typ == 273 /* v.ast.IsRefType */) { + else if (x._typ == 274 /* 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 == 269 /* v.ast.IfGuardExpr */) { + else if (x._typ == 270 /* 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]; @@ -45167,48 +45244,48 @@ 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 == 292 /* v.ast.StructInit */) { + else if (x._typ == 293 /* 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, /*115 &string*/0xfe10, {.d_s = sname}}, {_SLIT("{....}"), 0, { .d_c = 0 }}})); return _t60; } - else if (x._typ == 246 /* v.ast.ArrayDecompose */) { + else if (x._typ == 247 /* v.ast.ArrayDecompose */) { string _t61 = _SLIT("ast.ArrayDecompose"); return _t61; } - else if (x._typ == 249 /* v.ast.Assoc */) { + else if (x._typ == 250 /* v.ast.Assoc */) { string _t62 = _SLIT("ast.Assoc"); return _t62; } - else if (x._typ == 255 /* v.ast.ChanInit */) { + else if (x._typ == 256 /* v.ast.ChanInit */) { string _t63 = _SLIT("ast.ChanInit"); return _t63; } - else if (x._typ == 258 /* v.ast.ComptimeCall */) { + else if (x._typ == 259 /* v.ast.ComptimeCall */) { string _t64 = _SLIT("ast.ComptimeCall"); return _t64; } - else if (x._typ == 263 /* v.ast.EmptyExpr */) { + else if (x._typ == 264 /* v.ast.EmptyExpr */) { string _t65 = _SLIT("ast.EmptyExpr"); return _t65; } - else if (x._typ == 275 /* v.ast.LockExpr */) { + else if (x._typ == 276 /* v.ast.LockExpr */) { string _t66 = _SLIT("ast.LockExpr"); return _t66; } - else if (x._typ == 277 /* v.ast.MatchExpr */) { + else if (x._typ == 278 /* v.ast.MatchExpr */) { string _t67 = _SLIT("ast.MatchExpr"); return _t67; } - else if (x._typ == 278 /* v.ast.NodeError */) { + else if (x._typ == 279 /* v.ast.NodeError */) { string _t68 = _SLIT("ast.NodeError"); return _t68; } - else if (x._typ == 281 /* v.ast.OrExpr */) { + else if (x._typ == 282 /* v.ast.OrExpr */) { string _t69 = _SLIT("ast.OrExpr"); return _t69; } - else if (x._typ == 289 /* v.ast.SqlExpr */) { + else if (x._typ == 290 /* v.ast.SqlExpr */) { string _t70 = _SLIT("ast.SqlExpr"); return _t70; } @@ -45246,15 +45323,15 @@ string v__ast__BranchStmt_str(v__ast__BranchStmt* node) { } string v__ast__Stmt_str(v__ast__Stmt node) { - if (node._typ == 298 /* v.ast.AssertStmt */) { + if (node._typ == 299 /* 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 == 299 /* v.ast.AssignStmt */) { + else if (node._typ == 300 /* 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 == 267 /* v.ast.Ident */) { + if ((left)._typ == 268 /* 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 ")); @@ -45276,11 +45353,11 @@ string v__ast__Stmt_str(v__ast__Stmt node) { string _t2 = out; return _t2; } - else if (node._typ == 301 /* v.ast.BranchStmt */) { + else if (node._typ == 302 /* v.ast.BranchStmt */) { string _t3 = v__ast__BranchStmt_str(&(*node._v__ast__BranchStmt)); return _t3; } - else if (node._typ == 303 /* v.ast.ConstDecl */) { + else if (node._typ == 304 /* v.ast.ConstDecl */) { Array_string _t4 = {0}; Array_v__ast__ConstField _t4_orig = (*node._v__ast__ConstDecl).fields; int _t4_len = _t4_orig.len; @@ -45295,23 +45372,23 @@ string v__ast__Stmt_str(v__ast__Stmt node) { 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 == 307 /* v.ast.ExprStmt */) { + else if (node._typ == 308 /* v.ast.ExprStmt */) { string _t7 = v__ast__Expr_str((*node._v__ast__ExprStmt).expr); return _t7; } - else if (node._typ == 184 /* v.ast.FnDecl */) { + else if (node._typ == 185 /* 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 == 306 /* v.ast.EnumDecl */) { + else if (node._typ == 307 /* 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 == 317 /* v.ast.Module */) { + else if (node._typ == 318 /* 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 == 315 /* v.ast.Import */) { + else if (node._typ == 316 /* 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 "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__Import).alias}}, {_SLIT0, 0, { .d_c = 0 }}}))); @@ -45319,7 +45396,7 @@ string v__ast__Stmt_str(v__ast__Stmt node) { string _t11 = out; return _t11; } - else if (node._typ == 320 /* v.ast.StructDecl */) { + else if (node._typ == 321 /* 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; } @@ -45564,9 +45641,9 @@ string v__ast__Table_is_same_method(v__ast__Table* t, v__ast__Fn* f, v__ast__Fn* return _t6; } -Option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name) { +_option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name) { v__ast__Fn* _t2 = (v__ast__Fn*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, t->fns), &(string[]){name})); - Option_v__ast__Fn _t1 = {0}; + _option_v__ast__Fn _t1 = {0}; if (_t2) { *((v__ast__Fn*)&_t1.data) = *((v__ast__Fn*)_t2); } else { @@ -45575,15 +45652,15 @@ Option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name) { if (_t1.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t1.data; - Option_v__ast__Fn _t3; - opt_ok(&(v__ast__Fn[]) { f }, (Option*)(&_t3), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t3; + opt_ok2(&(v__ast__Fn[]) { f }, (_option*)(&_t3), sizeof(v__ast__Fn)); return _t3; } - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__Table_known_fn(v__ast__Table* t, string name) { - Option_v__ast__Fn _t1 = v__ast__Table_find_fn(t, name); + _option_v__ast__Fn _t1 = v__ast__Table_find_fn(t, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -45601,7 +45678,7 @@ void v__ast__Table_mark_module_as_deprecated(v__ast__Table* t, string mname, str } void v__ast__Table_mark_module_as_deprecated_after(v__ast__Table* t, string mname, string after_date) { - Option_time__Time _t1 = time__parse_iso8601(after_date); + _option_time__Time _t1 = time__parse_iso8601(after_date); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(time__Time*) _t1.data = time__now(); @@ -45627,38 +45704,38 @@ int v__ast__TypeSymbol_register_method(v__ast__TypeSymbol* t, v__ast__Fn new_fn) return _t2; } -Option_v__ast__Fn v__ast__Table_register_aggregate_method(v__ast__Table* t, v__ast__TypeSymbol* sym, string name) { +_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: "), /*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, 430) /*expected idx: 430, name: v.ast.Aggregate */ ; + v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Aggregate */ ; bool found_once = false; v__ast__Fn new_fn = ((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}); for (int _t1 = 0; _t1 < agg_info.types.len; ++_t1) { v__ast__Type typ = ((v__ast__Type*)agg_info.types.data)[_t1]; v__ast__TypeSymbol* ts = v__ast__Table_sym(t, typ); - Option_v__ast__Fn _t2; + _option_v__ast__Fn _t2; if (_t2 = v__ast__TypeSymbol_find_method(ts, name), _t2.state == 0) { v__ast__Fn type_method = *(v__ast__Fn*)_t2.data; if (!found_once) { 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 `"), /*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} }; + 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: `"), /*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} }; + 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); - Option_v__ast__Fn _t5; - opt_ok(&(v__ast__Fn[]) { new_fn }, (Option*)(&_t5), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t5; + opt_ok2(&(v__ast__Fn[]) { new_fn }, (_option*)(&_t5), sizeof(v__ast__Fn)); return _t5; } bool v__ast__Table_has_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { - Option_v__ast__Fn _t1 = v__ast__Table_find_method(t, s, name); + _option_v__ast__Fn _t1 = v__ast__Table_find_method(t, s, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -45670,18 +45747,18 @@ bool v__ast__Table_has_method(v__ast__Table* t, v__ast__TypeSymbol* s, string na return _t3; } -Option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { +_option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { v__ast__TypeSymbol* ts = s; for (;;) { - Option_v__ast__Fn _t1; + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method(ts, name), _t1.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t1.data; - Option_v__ast__Fn _t2; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t2), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t2; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t2), sizeof(v__ast__Fn)); return _t2; } if (ts->kind == v__ast__Kind__aggregate) { - Option_v__ast__Fn _t3 = v__ast__Table_register_aggregate_method(t, ts, name); + _option_v__ast__Fn _t3 = v__ast__Table_register_aggregate_method(t, ts, name); return _t3; } if (ts->parent_idx == 0) { @@ -45689,13 +45766,13 @@ Option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol } ts = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, ts->parent_idx)); } - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } 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 == 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 */) { + v__ast__TypeSymbol* unalias_sym = ((sym->info)._typ == 433 /* v.ast.Alias */ ? (v__ast__Table_sym(t, (*sym->info._v__ast__Alias).parent_type)) : (sym)); + if ((unalias_sym->info)._typ == 418 /* 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); @@ -45711,21 +45788,21 @@ Array_Array_v__ast__Type v__ast__Table_get_embeds(v__ast__Table* t, v__ast__Type return _t5; } -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 == 417 /* v.ast.Struct */) { +_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 == 418 /* 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) { 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); - Option_v__ast__Fn _t2; + _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_method(t, embed_sym, method_name), _t2.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t2.data; array_push((array*)&found_methods, _MOV((v__ast__Fn[]){ m })); array_push((array*)&embed_of_found_methods, _MOV((v__ast__Type[]){ embed })); } else { IError err = _t2.err; - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t5 = v__ast__Table_find_method_from_embeds(t, embed_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t5 = v__ast__Table_find_method_from_embeds(t, embed_sym, method_name); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; continue; @@ -45740,26 +45817,26 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from } } if (found_methods.len == 1) { - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t9; - 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)); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t9; + opt_ok2(&(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 `"), /*115 &string*/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 == 435 /* v.ast.Interface */) { + } else if ((sym->info)._typ == 436 /* 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) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Interface).embeds.data)[_t11]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(t, embed); - Option_v__ast__Fn _t12; + _option_v__ast__Fn _t12; if (_t12 = v__ast__Table_find_method(t, embed_sym, method_name), _t12.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t12.data; array_push((array*)&found_methods, _MOV((v__ast__Fn[]){ m })); array_push((array*)&embed_of_found_methods, _MOV((v__ast__Type[]){ embed })); } else { IError err = _t12.err; - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t15 = v__ast__Table_find_method_from_embeds(t, embed_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t15 = v__ast__Table_find_method_from_embeds(t, embed_sym, method_name); if (_t15.state != 0) { /*or block*/ IError err = _t15.err; continue; @@ -45774,17 +45851,17 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from } } if (found_methods.len == 1) { - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t19; - 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)); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t19; + opt_ok2(&(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 `"), /*115 &string*/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 == 430 /* v.ast.Aggregate */) { + } else if ((sym->info)._typ == 431 /* 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); - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t22 = v__ast__Table_find_method_from_embeds(t, agg_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t22 = v__ast__Table_find_method_from_embeds(t, agg_sym, method_name); if (_t22.state != 0) { /*or block*/ IError err = _t22.err; continue; @@ -45794,43 +45871,43 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from v__ast__Fn method = mr_13582.arg0; Array_v__ast__Type embed_types = mr_13582.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)); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t23; + opt_ok2(&(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)); return _t23; } } } - return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name) { - Option_v__ast__Fn _t1; +_option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name) { + _option_v__ast__Fn _t1; if (_t1 = v__ast__Table_find_method(t, sym, method_name), _t1.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t1.data; - Option_v__ast__Fn _t2; - opt_ok(&(v__ast__Fn[]) { func }, (Option*)(&_t2), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t2; + opt_ok2(&(v__ast__Fn[]) { func }, (_option*)(&_t2), sizeof(v__ast__Fn)); return _t2; } else { IError err = _t1.err; IError first_err = err; - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t3 = v__ast__Table_find_method_from_embeds(t, sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t3 = v__ast__Table_find_method_from_embeds(t, sym, method_name); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_v__ast__Fn){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; } multi_return_v__ast__Fn_Array_v__ast__Type mr_14043 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t3.data); v__ast__Fn func = mr_14043.arg0; - Option_v__ast__Fn _t5; - opt_ok(&(v__ast__Fn[]) { func }, (Option*)(&_t5), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t5; + opt_ok2(&(v__ast__Fn[]) { func }, (_option*)(&_t5), sizeof(v__ast__Fn)); return _t5; } - return (Option_v__ast__Fn){0}; + return (_option_v__ast__Fn){0}; } 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 == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* 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); @@ -45842,39 +45919,39 @@ Array_v__ast__Fn v__ast__Table_get_embed_methods(v__ast__Table* t, v__ast__TypeS return _t4; } -VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Table_register_aggregate_field(v__ast__Table* t, v__ast__TypeSymbol* sym, string name) { +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: "), /*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, 430) /*expected idx: 430, name: v.ast.Aggregate */ ; + v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Aggregate */ ; bool found_once = false; v__ast__StructField new_field = ((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}); for (int _t1 = 0; _t1 < agg_info.types.len; ++_t1) { v__ast__Type typ = ((v__ast__Type*)agg_info.types.data)[_t1]; v__ast__TypeSymbol* ts = v__ast__Table_sym(t, typ); - Option_v__ast__StructField _t2; + _option_v__ast__StructField _t2; if (_t2 = v__ast__Table_find_field(t, ts, name), _t2.state == 0) { v__ast__StructField type_field = *(v__ast__StructField*)_t2.data; if (!found_once) { 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 `"), /*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} }; + 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.comments,new_field.attrs,new_field.default_val,new_field.default_expr,new_field.name,new_field.pos,new_field.type_pos,new_field.i,new_field.default_expr_typ,new_field.typ,new_field.has_default_expr,.is_pub = new_field.is_pub && type_field.is_pub,.is_mut = new_field.is_mut && type_field.is_mut,new_field.is_global,new_field.is_volatile,}); } else { IError err = _t2.err; - 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} }; + 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 })); - Option_v__ast__StructField _t6; - opt_ok(&(v__ast__StructField[]) { new_field }, (Option*)(&_t6), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t6; + opt_ok2(&(v__ast__StructField[]) { new_field }, (_option*)(&_t6), sizeof(v__ast__StructField)); return _t6; } bool v__ast__Table_struct_has_field(v__ast__Table* t, v__ast__TypeSymbol* struct_, string name) { - Option_v__ast__StructField _t1 = v__ast__Table_find_field(t, struct_, name); + _option_v__ast__StructField _t1 = v__ast__Table_find_field(t, struct_, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -45888,7 +45965,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 == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* 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]; @@ -45900,56 +45977,56 @@ Array_v__ast__StructField v__ast__Table_struct_fields(v__ast__Table* t, v__ast__ return _t4; } -Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { +_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 == 417 /* v.ast.Struct */) { - Option_v__ast__StructField _t1; + if (ts->info._typ == 418 /* 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; - Option_v__ast__StructField _t2; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t2), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t2; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t2), sizeof(v__ast__StructField)); return _t2; } } - else if (ts->info._typ == 430 /* v.ast.Aggregate */) { - Option_v__ast__StructField _t3; + else if (ts->info._typ == 431 /* 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; - Option_v__ast__StructField _t4; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t4), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t4; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t4), sizeof(v__ast__StructField)); return _t4; } - Option_v__ast__StructField _t5 = v__ast__Table_register_aggregate_field(t, ts, name); + _option_v__ast__StructField _t5 = v__ast__Table_register_aggregate_field(t, ts, name); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - return (Option_v__ast__StructField){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__StructField field = (*(v__ast__StructField*)_t5.data); - Option_v__ast__StructField _t7; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t7), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t7; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t7), sizeof(v__ast__StructField)); return _t7; } - else if (ts->info._typ == 435 /* v.ast.Interface */) { - Option_v__ast__StructField _t8; + else if (ts->info._typ == 436 /* 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; - Option_v__ast__StructField _t9; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t9), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t9; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t9), sizeof(v__ast__StructField)); return _t9; } } - else if (ts->info._typ == 436 /* v.ast.SumType */) { + else if (ts->info._typ == 437 /* v.ast.SumType */) { v__ast__Table_resolve_common_sumtype_fields(t, ts); - Option_v__ast__StructField _t10; + _option_v__ast__StructField _t10; if (_t10 = v__ast__SumType_find_field(&(*ts->info._v__ast__SumType), name), _t10.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t10.data; - Option_v__ast__StructField _t11; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t11), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t11; + opt_ok2(&(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 `"), /*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} }; + 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 { @@ -45960,24 +46037,24 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty } ts = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, ts->parent_idx)); } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -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 == 417 /* v.ast.Struct */) { +_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 == 418 /* 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) { 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); - Option_v__ast__StructField _t2; + _option_v__ast__StructField _t2; if (_t2 = v__ast__Table_find_field(t, embed_sym, field_name), _t2.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t2.data; array_push((array*)&found_fields, _MOV((v__ast__StructField[]){ field })); array_push((array*)&embeds_of_found_fields, _MOV((v__ast__Type[]){ embed })); } else { IError err = _t2.err; - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t5 = v__ast__Table_find_field_from_embeds(t, embed_sym, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t5 = v__ast__Table_find_field_from_embeds(t, embed_sym, field_name); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; continue; @@ -45992,17 +46069,17 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi } } if (found_fields.len == 1) { - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t9; - 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)); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t9; + opt_ok2(&(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 `"), /*115 &string*/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 == 430 /* v.ast.Aggregate */) { + } else if ((sym->info)._typ == 431 /* 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); - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t12 = v__ast__Table_find_field_from_embeds(t, agg_sym, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t12 = v__ast__Table_find_field_from_embeds(t, agg_sym, field_name); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; continue; @@ -46012,47 +46089,47 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi v__ast__StructField field = mr_17743.arg0; Array_v__ast__Type embed_types = mr_17743.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)); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t13; + opt_ok2(&(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 == 432 /* v.ast.Alias */) { + } else if ((sym->info)._typ == 433 /* 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); + _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; } - return (Option_multi_return_v__ast__StructField_Array_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_v__ast__StructField_Array_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name) { - Option_v__ast__StructField _t1; +_option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name) { + _option_v__ast__StructField _t1; if (_t1 = v__ast__Table_find_field(t, sym, field_name), _t1.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t1.data; - Option_v__ast__StructField _t2; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t2), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t2; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t2), sizeof(v__ast__StructField)); return _t2; } else { IError err = _t1.err; IError first_err = err; - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t3 = v__ast__Table_find_field_from_embeds(t, sym, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t3 = v__ast__Table_find_field_from_embeds(t, sym, field_name); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_v__ast__StructField){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; } multi_return_v__ast__StructField_Array_v__ast__Type mr_18341 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t3.data); v__ast__StructField field = mr_18341.arg0; - Option_v__ast__StructField _t5; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t5), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t5; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t5), sizeof(v__ast__StructField)); return _t5; } - return (Option_v__ast__StructField){0}; + return (_option_v__ast__StructField){0}; } 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, 436) /*expected idx: 436, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 437) /*expected idx: 437, name: v.ast.SumType */ ; if (info.found_fields) { return; } @@ -46062,10 +46139,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 == 417 /* v.ast.Struct */) { + if (v_sym->info._typ == 418 /* v.ast.Struct */) { _t2 = v__ast__Table_struct_fields(t, v_sym); } - else if (v_sym->info._typ == 436 /* v.ast.SumType */) { + else if (v_sym->info._typ == 437 /* v.ast.SumType */) { v__ast__Table_resolve_common_sumtype_fields(t, v_sym); _t2 = (*v_sym->info._v__ast__SumType).fields; } @@ -46111,14 +46188,14 @@ inline int v__ast__Table_find_type_idx(v__ast__Table* t, string name) { } // Attr: [inline] -inline Option_v__ast__TypeSymbol_ptr v__ast__Table_find_sym(v__ast__Table* t, string name) { +inline _option_v__ast__TypeSymbol_ptr v__ast__Table_find_sym(v__ast__Table* t, string name) { int idx = (*(int*)map_get(ADDR(map, t->type_idxs), &(string[]){name}, &(int[]){ 0 })); if (idx > 0) { - Option_v__ast__TypeSymbol_ptr _t1; - opt_ok(&(v__ast__TypeSymbol*[]) { (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)) }, (Option*)(&_t1), sizeof(v__ast__TypeSymbol*)); + _option_v__ast__TypeSymbol_ptr _t1; + opt_ok2(&(v__ast__TypeSymbol*[]) { (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)) }, (_option*)(&_t1), sizeof(v__ast__TypeSymbol*)); return _t1; } - return (Option_v__ast__TypeSymbol_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__TypeSymbol_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } // Attr: [inline] @@ -46153,7 +46230,7 @@ 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, 432) /*expected idx: 432, 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, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type); } v__ast__TypeSymbol* _t1 = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)); return _t1; @@ -46174,7 +46251,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, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; + v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 433) /*expected idx: 433, 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; @@ -46188,7 +46265,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, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; + v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type; v__ast__Type _t1 = pt; return _t1; } @@ -46313,15 +46390,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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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, 440) /*expected idx: 440, 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, 441) /*expected idx: 441, 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, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 414) /*expected idx: 414, 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; } @@ -46361,7 +46438,7 @@ 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 == 263 /* v.ast.EmptyExpr */ || size != 987654321 ? (int_str(size)) : (v__ast__Expr_str(size_expr))); + string size_str = ((size_expr)._typ == 264 /* 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; } @@ -46456,7 +46533,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 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_"), /*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; } @@ -46572,9 +46649,9 @@ 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_31399 = (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_31399.arg0; - string cref = mr_31399.arg1; + multi_return_string_string mr_31400 = (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_31400.arg0; + string cref = mr_31400.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) { @@ -46619,22 +46696,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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 413) /*expected idx: 413, 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 413) /*expected idx: 413, 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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, 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, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 414) /*expected idx: 414, name: v.ast.Map */ ; v__ast__Type _t4 = info.value_type; return _t4; } @@ -46660,7 +46737,7 @@ void v__ast__Table_register_fn_generic_types(v__ast__Table* t, string fn_name) { bool v__ast__Table_register_fn_concrete_types(v__ast__Table* t, string fn_name, Array_v__ast__Type types) { Array_Array_v__ast__Type* _t2 = (Array_Array_v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, t->fn_generic_types), &(string[]){fn_name})); - Option_Array_Array_v__ast__Type _t1 = {0}; + _option_Array_Array_v__ast__Type _t1 = {0}; if (_t2) { *((Array_Array_v__ast__Type*)&_t1.data) = *((Array_Array_v__ast__Type*)_t2); } else { @@ -46687,7 +46764,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, 436) /*expected idx: 436, 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, 437) /*expected idx: 437, name: v.ast.SumType */ ; v__ast__TypeSymbol* var_sym = v__ast__Table_sym(t, variant); if (var_sym->kind == (v__ast__Kind__aggregate)) { @@ -46720,7 +46797,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, 430) /*expected idx: 430, 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, 431) /*expected idx: 431, 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)) { @@ -46733,9 +46810,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, 436) /*expected idx: 436, 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, 437) /*expected idx: 437, 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, 432) /*expected idx: 432, 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, 433) /*expected idx: 433, 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; } @@ -46778,7 +46855,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 == 417 /* v.ast.Struct */) { + if ((ts->info)._typ == 418 /* 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); @@ -46877,7 +46954,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 == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { bool _t4 = false; return _t4; @@ -46888,7 +46965,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 == 435 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 436 /* 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){.field_names = __new_array(0, 0, sizeof(string)),.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)),.name = (string){.str=(byteptr)"", .is_lit=1},.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ = 0,.mut_pos = 0,.is_pub = 0,.are_embeds_expanded = 0,} })).attrs; for (int _t6 = 0; _t6 < attrs.len; ++_t6) { v__ast__Attr attr = ((v__ast__Attr*)attrs.data)[_t6]; @@ -46906,7 +46983,7 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type } for (int _t10 = 0; _t10 < (*inter_sym->info._v__ast__Interface).methods.len; ++_t10) { v__ast__Fn imethod = ((v__ast__Fn*)(*inter_sym->info._v__ast__Interface).methods.data)[_t10]; - Option_v__ast__Fn _t11; + _option_v__ast__Fn _t11; if (_t11 = v__ast__Table_find_method_with_embeds(t, sym, imethod.name), _t11.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t11.data; string msg = v__ast__Table_is_same_method(t, (voidptr)&/*qq*/imethod, (voidptr)&/*qq*/method); @@ -46929,7 +47006,7 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type return _t15; } } - Option_v__ast__StructField _t16; + _option_v__ast__StructField _t16; if (_t16 = v__ast__Table_find_field_with_embeds(t, sym, ifield.name), _t16.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t16.data; if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { @@ -46955,91 +47032,94 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type return _t23; } -Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, v__ast__Type generic_type, Array_string generic_names, Array_v__ast__Type concrete_types) { +_option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, v__ast__Type generic_type, Array_string generic_names, Array_v__ast__Type concrete_types) { + if (generic_names.len != concrete_types.len) { + return (_option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + } v__ast__TypeSymbol* sym = v__ast__Table_sym(t, generic_type); if (Array_string_contains(generic_names, sym->name)) { int index = Array_string_index(generic_names, sym->name); if (index >= concrete_types.len) { - return (Option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__Type typ = (*(v__ast__Type*)/*ee elem_sym */array_get(concrete_types, index)); if (typ == 0) { - return (Option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t3; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(typ, generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t3), sizeof(v__ast__Type)); - return _t3; - } else { - Option_v__ast__Type _t4; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(typ, generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t4), sizeof(v__ast__Type)); + _option_v__ast__Type _t4; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(typ, generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t4), sizeof(v__ast__Type)); return _t4; + } else { + _option_v__ast__Type _t5; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(typ, generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t5), sizeof(v__ast__Type)); + return _t5; } } - if (sym->info._typ == 412 /* v.ast.Array */) { + if (sym->info._typ == 413 /* 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 == 412 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 413 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; } - Option_v__ast__Type _t5; - if (_t5 = v__ast__Table_resolve_generic_to_concrete(t, elem_type, generic_names, concrete_types), _t5.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t5.data; + _option_v__ast__Type _t6; + if (_t6 = v__ast__Table_resolve_generic_to_concrete(t, elem_type, generic_names, concrete_types), _t6.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t6.data; int idx = v__ast__Table_find_or_register_array_with_dims(t, typ, dims); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t6; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t6), sizeof(v__ast__Type)); - return _t6; - } else { - Option_v__ast__Type _t7; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t7), sizeof(v__ast__Type)); + _option_v__ast__Type _t7; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t7), sizeof(v__ast__Type)); return _t7; + } else { + _option_v__ast__Type _t8; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t8), sizeof(v__ast__Type)); + return _t8; } } } - 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; + else if (sym->info._typ == 441 /* v.ast.ArrayFixed */) { + _option_v__ast__Type _t9; + if (_t9 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__ArrayFixed).elem_type, generic_names, concrete_types), _t9.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t9.data; int idx = v__ast__Table_find_or_register_array_fixed(t, typ, (*sym->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,},}))))); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t9; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t9), sizeof(v__ast__Type)); - return _t9; - } else { - Option_v__ast__Type _t10; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t10), sizeof(v__ast__Type)); + _option_v__ast__Type _t10; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t10), sizeof(v__ast__Type)); return _t10; + } else { + _option_v__ast__Type _t11; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t11), sizeof(v__ast__Type)); + return _t11; } } } - 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; + else if (sym->info._typ == 442 /* v.ast.Chan */) { + _option_v__ast__Type _t12; + if (_t12 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Chan).elem_type, generic_names, concrete_types), _t12.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t12.data; int idx = v__ast__Table_find_or_register_chan(t, typ, v__ast__Type_nr_muls(typ) > 0); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t12; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t12), sizeof(v__ast__Type)); - return _t12; - } else { - Option_v__ast__Type _t13; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t13), sizeof(v__ast__Type)); + _option_v__ast__Type _t13; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t13), sizeof(v__ast__Type)); return _t13; + } else { + _option_v__ast__Type _t14; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t14), sizeof(v__ast__Type)); + return _t14; } } } - else if (sym->info._typ == 444 /* v.ast.FnType */) { + else if (sym->info._typ == 445 /* 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)) { - Option_v__ast__Type _t14; - if (_t14 = v__ast__Table_resolve_generic_to_concrete(t, func.return_type, generic_names, concrete_types), _t14.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t14.data; + _option_v__ast__Type _t15; + if (_t15 = v__ast__Table_resolve_generic_to_concrete(t, func.return_type, generic_names, concrete_types), _t15.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t15.data; func.return_type = typ; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { has_generic = true; @@ -47047,12 +47127,12 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } func.params = array_clone_to_depth(&func.params, 0); - for (int _t15 = 0; _t15 < func.params.len; ++_t15) { - v__ast__Param* param = ((v__ast__Param*)func.params.data) + _t15; + for (int _t16 = 0; _t16 < func.params.len; ++_t16) { + v__ast__Param* param = ((v__ast__Param*)func.params.data) + _t16; if (v__ast__Type_has_flag(param->typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t16; - if (_t16 = v__ast__Table_resolve_generic_to_concrete(t, param->typ, generic_names, concrete_types), _t16.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t16.data; + _option_v__ast__Type _t17; + if (_t17 = v__ast__Table_resolve_generic_to_concrete(t, param->typ, generic_names, concrete_types), _t17.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t17.data; param->typ = typ; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { has_generic = true; @@ -47063,89 +47143,89 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, func.name = _SLIT(""); int idx = v__ast__Table_find_or_register_fn_type(t, _SLIT(""), func, true, false); if (has_generic) { - Option_v__ast__Type _t17; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t17), sizeof(v__ast__Type)); - return _t17; - } else { - Option_v__ast__Type _t18; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t18), sizeof(v__ast__Type)); + _option_v__ast__Type _t18; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t18), sizeof(v__ast__Type)); return _t18; + } else { + _option_v__ast__Type _t19; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t19), sizeof(v__ast__Type)); + return _t19; } } - else if (sym->info._typ == 443 /* v.ast.MultiReturn */) { + else if (sym->info._typ == 444 /* 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) { - v__ast__Type ret_type = ((v__ast__Type*)(*sym->info._v__ast__MultiReturn).types.data)[_t19]; - Option_v__ast__Type _t20; - if (_t20 = v__ast__Table_resolve_generic_to_concrete(t, ret_type, generic_names, concrete_types), _t20.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t20.data; + for (int _t20 = 0; _t20 < (*sym->info._v__ast__MultiReturn).types.len; ++_t20) { + v__ast__Type ret_type = ((v__ast__Type*)(*sym->info._v__ast__MultiReturn).types.data)[_t20]; + _option_v__ast__Type _t21; + if (_t21 = v__ast__Table_resolve_generic_to_concrete(t, ret_type, generic_names, concrete_types), _t21.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t21.data; array_push((array*)&types, _MOV((v__ast__Type[]){ typ })); type_changed = true; } else { - IError err = _t20.err; + IError err = _t21.err; array_push((array*)&types, _MOV((v__ast__Type[]){ ret_type })); } } if (type_changed) { int idx = v__ast__Table_find_or_register_multi_return(t, types); - bool _t23 = false; - Array_v__ast__Type _t23_orig = types; - int _t23_len = _t23_orig.len; - for (int _t24 = 0; _t24 < _t23_len; ++_t24) { - v__ast__Type it = ((v__ast__Type*) _t23_orig.data)[_t24]; + bool _t24 = false; + Array_v__ast__Type _t24_orig = types; + int _t24_len = _t24_orig.len; + for (int _t25 = 0; _t25 < _t24_len; ++_t25) { + v__ast__Type it = ((v__ast__Type*) _t24_orig.data)[_t25]; if (v__ast__Type_has_flag(it, v__ast__TypeFlag__generic)) { - _t23 = true; + _t24 = true; break; } } - if (_t23) { - Option_v__ast__Type _t25; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t25), sizeof(v__ast__Type)); - return _t25; - } else { - Option_v__ast__Type _t26; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t26), sizeof(v__ast__Type)); + if (_t24) { + _option_v__ast__Type _t26; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t26), sizeof(v__ast__Type)); return _t26; + } else { + _option_v__ast__Type _t27; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t27), sizeof(v__ast__Type)); + return _t27; } } } - else if (sym->info._typ == 413 /* v.ast.Map */) { + else if (sym->info._typ == 414 /* 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; - Option_v__ast__Type _t27; - if (_t27 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Map).key_type, generic_names, concrete_types), _t27.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t27.data; + _option_v__ast__Type _t28; + if (_t28 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Map).key_type, generic_names, concrete_types), _t28.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t28.data; unwrapped_key_type = typ; type_changed = true; } - Option_v__ast__Type _t28; - if (_t28 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Map).value_type, generic_names, concrete_types), _t28.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t28.data; + _option_v__ast__Type _t29; + if (_t29 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Map).value_type, generic_names, concrete_types), _t29.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t29.data; unwrapped_value_type = typ; type_changed = true; } if (type_changed) { int idx = v__ast__Table_find_or_register_map(t, unwrapped_key_type, unwrapped_value_type); if (v__ast__Type_has_flag(unwrapped_key_type, v__ast__TypeFlag__generic) || v__ast__Type_has_flag(unwrapped_value_type, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t29; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t29), sizeof(v__ast__Type)); - return _t29; - } else { - Option_v__ast__Type _t30; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t30), sizeof(v__ast__Type)); + _option_v__ast__Type _t30; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t30), sizeof(v__ast__Type)); return _t30; + } else { + _option_v__ast__Type _t31; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t31), sizeof(v__ast__Type)); + return _t31; } } } - else if (sym->info._typ == 417 /* v.ast.Struct */) { + else if (sym->info._typ == 418 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { 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) { - v__ast__Type ct = *(v__ast__Type*)_t31.data; + _option_v__ast__Type _t32; + if (_t32 = 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), _t32.state == 0) { + v__ast__Type ct = *(v__ast__Type*)_t32.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); nrt = /*f*/string__plus(nrt, gts->name); if (i != (*sym->info._v__ast__Struct).generic_types.len - 1) { @@ -47158,18 +47238,18 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, if (idx == 0) { idx = v__ast__Table_add_placeholder_type(t, nrt, v__ast__Language__v); } - Option_v__ast__Type _t32; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t32), sizeof(v__ast__Type)); - return _t32; + _option_v__ast__Type _t33; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t33), sizeof(v__ast__Type)); + return _t33; } } - else if (sym->info._typ == 435 /* v.ast.Interface */) { + else if (sym->info._typ == 436 /* v.ast.Interface */) { if ((*sym->info._v__ast__Interface).is_generic) { 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) { - v__ast__Type ct = *(v__ast__Type*)_t33.data; + _option_v__ast__Type _t34; + if (_t34 = 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), _t34.state == 0) { + v__ast__Type ct = *(v__ast__Type*)_t34.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); nrt = /*f*/string__plus(nrt, gts->name); if (i != (*sym->info._v__ast__Interface).generic_types.len - 1) { @@ -47182,18 +47262,18 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, if (idx == 0) { idx = v__ast__Table_add_placeholder_type(t, nrt, v__ast__Language__v); } - Option_v__ast__Type _t34; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t34), sizeof(v__ast__Type)); - return _t34; + _option_v__ast__Type _t35; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t35), sizeof(v__ast__Type)); + return _t35; } } - else if (sym->info._typ == 436 /* v.ast.SumType */) { + else if (sym->info._typ == 437 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { 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) { - v__ast__Type ct = *(v__ast__Type*)_t35.data; + _option_v__ast__Type _t36; + if (_t36 = 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), _t36.state == 0) { + v__ast__Type ct = *(v__ast__Type*)_t36.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); nrt = /*f*/string__plus(nrt, gts->name); if (i != (*sym->info._v__ast__SumType).generic_types.len - 1) { @@ -47206,16 +47286,16 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, if (idx == 0) { idx = v__ast__Table_add_placeholder_type(t, nrt, v__ast__Language__v); } - Option_v__ast__Type _t36; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t36), sizeof(v__ast__Type)); - return _t36; + _option_v__ast__Type _t37; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t37), sizeof(v__ast__Type)); + return _t37; } } else { } ; - return (Option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type typ, Array_string generic_names, Array_v__ast__Type concrete_types) { @@ -47225,12 +47305,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 == 412 /* v.ast.Array */) { + if (ts->info._typ == 413 /* 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 == 412 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 413 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; @@ -47240,26 +47320,26 @@ 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 == 440 /* v.ast.ArrayFixed */) { + else if (ts->info._typ == 441 /* 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 == 441 /* v.ast.Chan */) { + else if (ts->info._typ == 442 /* 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 == 413 /* v.ast.Map */) { + else if (ts->info._typ == 414 /* 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 == 417 /* v.ast.Struct */) { + else if (ts->info._typ == 418 /* v.ast.Struct */) { if (!(*ts->info._v__ast__Struct).is_generic) { v__ast__Type _t5 = typ; return _t5; @@ -47267,7 +47347,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty 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; + _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) { v__ast__Type ct = *(v__ast__Type*)_t6.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); @@ -47292,7 +47372,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ) != v__ast__Type_idx(typ)) { (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = v__ast__Table_unwrap_generic_type(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types); } else { - Option_v__ast__Type _t8; + _option_v__ast__Type _t8; if (_t8 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types), _t8.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t8.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -47301,7 +47381,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } for (int i = 0; i < (*ts->info._v__ast__Struct).generic_types.len; ++i) { - Option_v__ast__Type _t9; + _option_v__ast__Type _t9; if (_t9 = 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), _t9.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t9.data; array_push((array*)&final_concrete_types, _MOV((v__ast__Type[]){ t_typ })); @@ -47327,7 +47407,7 @@ 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.Interface */) { + else if (ts->info._typ == 436 /* v.ast.Interface */) { if (!(*ts->info._v__ast__Interface).is_generic) { v__ast__Type _t14 = typ; return _t14; @@ -47335,7 +47415,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty 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; + _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) { v__ast__Type ct = *(v__ast__Type*)_t15.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); @@ -47360,7 +47440,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ) != v__ast__Type_idx(typ)) { (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = v__ast__Table_unwrap_generic_type(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types); } else { - Option_v__ast__Type _t17; + _option_v__ast__Type _t17; if (_t17 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types), _t17.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t17.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -47369,7 +47449,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } for (int i = 0; i < (*ts->info._v__ast__Interface).generic_types.len; ++i) { - Option_v__ast__Type _t18; + _option_v__ast__Type _t18; if (_t18 = 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), _t18.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t18.data; array_push((array*)&final_concrete_types, _MOV((v__ast__Type[]){ t_typ })); @@ -47395,7 +47475,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } } - else if (ts->info._typ == 436 /* v.ast.SumType */) { + else if (ts->info._typ == 437 /* v.ast.SumType */) { if (!(*ts->info._v__ast__SumType).is_generic) { v__ast__Type _t23 = typ; return _t23; @@ -47403,7 +47483,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty 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; + _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) { v__ast__Type ct = *(v__ast__Type*)_t24.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); @@ -47428,7 +47508,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ) != v__ast__Type_idx(typ)) { (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = v__ast__Table_unwrap_generic_type(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types); } else { - Option_v__ast__Type _t26; + _option_v__ast__Type _t26; if (_t26 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types), _t26.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t26.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -47437,7 +47517,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } for (int i = 0; i < (*ts->info._v__ast__SumType).generic_types.len; ++i) { - Option_v__ast__Type _t27; + _option_v__ast__Type _t27; if (_t27 = 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), _t27.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t27.data; array_push((array*)&final_concrete_types, _MOV((v__ast__Type[]){ t_typ })); @@ -47467,7 +47547,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty else { } ; - if (ts->info._typ == 417 /* v.ast.Struct */) { + if (ts->info._typ == 418 /* v.ast.Struct */) { v__ast__Struct info = (*ts->info._v__ast__Struct); info.is_generic = false; info.concrete_types = final_concrete_types; @@ -47481,7 +47561,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 == 436 /* v.ast.SumType */) { + else if (ts->info._typ == 437 /* 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)) { @@ -47489,7 +47569,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty if (sym->kind == v__ast__Kind__struct_ || sym->kind == v__ast__Kind__sum_type || sym->kind == v__ast__Kind__interface_) { array_set(&variants, i, &(v__ast__Type[]) { v__ast__Table_unwrap_generic_type(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, concrete_types) }); } else { - Option_v__ast__Type _t34; + _option_v__ast__Type _t34; if (_t34 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, concrete_types), _t34.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t34.data; array_set(&variants, i, &(v__ast__Type[]) { t_typ }); @@ -47511,18 +47591,18 @@ 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 == 435 /* v.ast.Interface */) { + else if (ts->info._typ == 436 /* 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; - Option_v__ast__Type _t38; + _option_v__ast__Type _t38; if (_t38 = v__ast__Table_resolve_generic_to_concrete(t, method->return_type, generic_names, concrete_types), _t38.state == 0) { v__ast__Type unwrap_typ = *(v__ast__Type*)_t38.data; method->return_type = unwrap_typ; } for (int _t39 = 0; _t39 < method->params.len; ++_t39) { v__ast__Param* param = ((v__ast__Param*)method->params.data) + _t39; - Option_v__ast__Type _t40; + _option_v__ast__Type _t40; if (_t40 = v__ast__Table_resolve_generic_to_concrete(t, param->typ, generic_names, concrete_types), _t40.state == 0) { v__ast__Type unwrap_typ = *(v__ast__Type*)_t40.data; param->typ = unwrap_typ; @@ -47564,29 +47644,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 == 412 /* v.ast.Array */) { + if (ts->info._typ == 413 /* 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 == 412 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 413 /* 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 == 440 /* v.ast.ArrayFixed */) { + else if (ts->info._typ == 441 /* v.ast.ArrayFixed */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__ArrayFixed).elem_type, generic_types); } - else if (ts->info._typ == 441 /* v.ast.Chan */) { + else if (ts->info._typ == 442 /* v.ast.Chan */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__Chan).elem_type, generic_types); } - else if (ts->info._typ == 413 /* v.ast.Map */) { + else if (ts->info._typ == 414 /* 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 == 417 /* v.ast.Struct */) { + else if (ts->info._typ == 418 /* 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; @@ -47600,7 +47680,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra Array_string generic_names =_t1; for (int i = 0; i < (*ts->info._v__ast__Struct).fields.len; ++i) { if (v__ast__Type_has_flag((*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Struct).fields, i)).typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t3; + _option_v__ast__Type _t3; if (_t3 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Struct).fields, i)).typ, generic_names, generic_types), _t3.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t3.data; (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Struct).fields, i)).typ = t_typ; @@ -47609,7 +47689,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 == 435 /* v.ast.Interface */) { + else if (ts->info._typ == 436 /* 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; @@ -47623,7 +47703,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra Array_string generic_names =_t4; for (int i = 0; i < (*ts->info._v__ast__Interface).fields.len; ++i) { if (v__ast__Type_has_flag((*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Interface).fields, i)).typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t6; + _option_v__ast__Type _t6; if (_t6 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Interface).fields, i)).typ, generic_names, generic_types), _t6.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t6.data; (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Interface).fields, i)).typ = t_typ; @@ -47632,7 +47712,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 == 436 /* v.ast.SumType */) { + else if (ts->info._typ == 437 /* 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; @@ -47646,7 +47726,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra Array_string generic_names =_t7; for (int i = 0; i < (*ts->info._v__ast__SumType).fields.len; ++i) { if (v__ast__Type_has_flag((*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__SumType).fields, i)).typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t9; + _option_v__ast__Type _t9; if (_t9 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__SumType).fields, i)).typ, generic_names, generic_types), _t9.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t9.data; (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__SumType).fields, i)).typ = t_typ; @@ -47665,13 +47745,13 @@ 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, 445) /*expected idx: 445, name: v.ast.GenericInst */ ; + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast(((*typ)->info)._v__ast__GenericInst,((*typ)->info)._typ, 446) /*expected idx: 446, 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 == 417 /* v.ast.Struct */) { + if (parent->info._typ == 418 /* 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 `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); @@ -47696,7 +47776,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { if (v__ast__Type_idx((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ) != info.parent_idx) { (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = v__ast__Table_unwrap_generic_type(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, info.concrete_types); } - Option_v__ast__Type _t4; + _option_v__ast__Type _t4; if (_t4 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, info.concrete_types), _t4.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t4.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -47722,7 +47802,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { VUNREACHABLE(); } } - else if (parent->info._typ == 435 /* v.ast.Interface */) { + else if (parent->info._typ == 436 /* 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 `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); @@ -47743,7 +47823,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } Array_string generic_names =_t6; for (int i = 0; i < fields.len; ++i) { - Option_v__ast__Type _t8; + _option_v__ast__Type _t8; if (_t8 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, info.concrete_types), _t8.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t8.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -47753,7 +47833,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { for (int _t9 = 0; _t9 < imethods.len; ++_t9) { v__ast__Fn* method = ((v__ast__Fn*)imethods.data) + _t9; array_clear(&method->generic_names); - Option_v__ast__Type _t10; + _option_v__ast__Type _t10; if (_t10 = v__ast__Table_resolve_generic_to_concrete(t, method->return_type, generic_names, info.concrete_types), _t10.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t10.data; method->return_type = pt; @@ -47761,7 +47841,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { method->params = array_clone_to_depth(&method->params, 0); for (int _t11 = 0; _t11 < method->params.len; ++_t11) { v__ast__Param* param = ((v__ast__Param*)method->params.data) + _t11; - Option_v__ast__Type _t12; + _option_v__ast__Type _t12; if (_t12 = v__ast__Table_resolve_generic_to_concrete(t, param->typ, generic_names, info.concrete_types), _t12.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t12.data; param->typ = pt; @@ -47788,7 +47868,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { VUNREACHABLE(); } } - else if (parent->info._typ == 436 /* v.ast.SumType */) { + else if (parent->info._typ == 437 /* 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 `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); @@ -47810,7 +47890,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } Array_string generic_names =_t15; for (int i = 0; i < fields.len; ++i) { - Option_v__ast__Type _t17; + _option_v__ast__Type _t17; if (_t17 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, info.concrete_types), _t17.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t17.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -47822,7 +47902,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))) != info.parent_idx) { array_set(&variants, i, &(v__ast__Type[]) { v__ast__Table_unwrap_generic_type(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, info.concrete_types) }); } else { - Option_v__ast__Type _t18; + _option_v__ast__Type _t18; if (_t18 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, info.concrete_types), _t18.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t18.data; array_set(&variants, i, &(v__ast__Type[]) { t_typ }); @@ -48334,13 +48414,13 @@ VNORETURN VV_LOCAL_SYMBOL void v__ast__TypeSymbol_no_info_panic(v__ast__TypeSymb // Attr: [inline] inline v__ast__Enum v__ast__TypeSymbol_enum_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 446 /* v.ast.Enum */) { + if ((t->info)._typ == 447 /* v.ast.Enum */) { v__ast__Enum _t1 = (*t->info._v__ast__Enum); return _t1; } - if ((t->info)._typ == 432 /* v.ast.Alias */) { + if ((t->info)._typ == 433 /* 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 == 446 /* v.ast.Enum */) { + if ((fsym->info)._typ == 447 /* v.ast.Enum */) { v__ast__Enum _t2 = (*fsym->info._v__ast__Enum); return _t2; } @@ -48352,13 +48432,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 == 443 /* v.ast.MultiReturn */) { + if ((t->info)._typ == 444 /* v.ast.MultiReturn */) { v__ast__MultiReturn _t1 = (*t->info._v__ast__MultiReturn); return _t1; } - if ((t->info)._typ == 432 /* v.ast.Alias */) { + if ((t->info)._typ == 433 /* 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 == 443 /* v.ast.MultiReturn */) { + if ((fsym->info)._typ == 444 /* v.ast.MultiReturn */) { v__ast__MultiReturn _t2 = (*fsym->info._v__ast__MultiReturn); return _t2; } @@ -48370,13 +48450,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 == 412 /* v.ast.Array */) { + if ((t->info)._typ == 413 /* v.ast.Array */) { v__ast__Array _t1 = (*t->info._v__ast__Array); return _t1; } - if ((t->info)._typ == 432 /* v.ast.Alias */) { + if ((t->info)._typ == 433 /* 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.Array */) { + if ((fsym->info)._typ == 413 /* v.ast.Array */) { v__ast__Array _t2 = (*fsym->info._v__ast__Array); return _t2; } @@ -48388,13 +48468,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 == 440 /* v.ast.ArrayFixed */) { + if ((t->info)._typ == 441 /* v.ast.ArrayFixed */) { v__ast__ArrayFixed _t1 = (*t->info._v__ast__ArrayFixed); return _t1; } - if ((t->info)._typ == 432 /* v.ast.Alias */) { + if ((t->info)._typ == 433 /* 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.ArrayFixed */) { + if ((fsym->info)._typ == 441 /* v.ast.ArrayFixed */) { v__ast__ArrayFixed _t2 = (*fsym->info._v__ast__ArrayFixed); return _t2; } @@ -48406,13 +48486,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 == 441 /* v.ast.Chan */) { + if ((t->info)._typ == 442 /* v.ast.Chan */) { v__ast__Chan _t1 = (*t->info._v__ast__Chan); return _t1; } - if ((t->info)._typ == 432 /* v.ast.Alias */) { + if ((t->info)._typ == 433 /* 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.Chan */) { + if ((fsym->info)._typ == 442 /* v.ast.Chan */) { v__ast__Chan _t2 = (*fsym->info._v__ast__Chan); return _t2; } @@ -48424,13 +48504,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 == 442 /* v.ast.Thread */) { + if ((t->info)._typ == 443 /* v.ast.Thread */) { v__ast__Thread _t1 = (*t->info._v__ast__Thread); return _t1; } - if ((t->info)._typ == 432 /* v.ast.Alias */) { + if ((t->info)._typ == 433 /* 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.Thread */) { + if ((fsym->info)._typ == 443 /* v.ast.Thread */) { v__ast__Thread _t2 = (*fsym->info._v__ast__Thread); return _t2; } @@ -48442,13 +48522,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 == 413 /* v.ast.Map */) { + if ((t->info)._typ == 414 /* v.ast.Map */) { v__ast__Map _t1 = (*t->info._v__ast__Map); return _t1; } - if ((t->info)._typ == 432 /* v.ast.Alias */) { + if ((t->info)._typ == 433 /* 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 == 413 /* v.ast.Map */) { + if ((fsym->info)._typ == 414 /* v.ast.Map */) { v__ast__Map _t2 = (*fsym->info._v__ast__Map); return _t2; } @@ -48460,13 +48540,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 == 417 /* v.ast.Struct */) { + if ((t->info)._typ == 418 /* v.ast.Struct */) { v__ast__Struct _t1 = (*t->info._v__ast__Struct); return _t1; } - if ((t->info)._typ == 432 /* v.ast.Alias */) { + if ((t->info)._typ == 433 /* 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 == 417 /* v.ast.Struct */) { + if ((fsym->info)._typ == 418 /* v.ast.Struct */) { v__ast__Struct _t2 = (*fsym->info._v__ast__Struct); return _t2; } @@ -48478,13 +48558,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 == 436 /* v.ast.SumType */) { + if ((t->info)._typ == 437 /* v.ast.SumType */) { v__ast__SumType _t1 = (*t->info._v__ast__SumType); return _t1; } - if ((t->info)._typ == 436 /* v.ast.SumType */) { + if ((t->info)._typ == 437 /* 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 == 436 /* v.ast.SumType */) { + if ((fsym->info)._typ == 437 /* v.ast.SumType */) { v__ast__SumType _t2 = (*fsym->info._v__ast__SumType); return _t2; } @@ -48496,7 +48576,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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((t->info)._v__ast__Struct,(t->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ; bool _t1 = info.is_heap; return _t1; } else { @@ -48550,7 +48630,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, 432) /*expected idx: 432, 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, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type); return _t1; } bool _t2 = res; @@ -48660,7 +48740,7 @@ multi_return_int_int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) } case v__ast__Kind__alias: { - multi_return_int_int mr_21155 = 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); + multi_return_int_int mr_21155 = v__ast__Table_type_size(t, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type); size = mr_21155.arg0; align = mr_21155.arg1; break; @@ -48672,7 +48752,7 @@ multi_return_int_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 _t4; /* if prepend */ - if ((sym->info)._typ == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* v.ast.Struct */) { Array_v__ast__Type _t5 = {0}; Array_v__ast__StructField _t5_orig = (*sym->info._v__ast__Struct).fields; int _t5_len = _t5_orig.len; @@ -48685,7 +48765,7 @@ multi_return_int_int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) } _t4 =_t5; } else { - _t4 = (/* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ).types; + _t4 = (/* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 444) /*expected idx: 444, name: v.ast.MultiReturn */ ).types; } Array_v__ast__Type types = _t4; for (int _t7 = 0; _t7 < types.len; ++_t7) { @@ -48706,15 +48786,15 @@ multi_return_int_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 == 436 /* v.ast.SumType */) { + if (sym->info._typ == 437 /* v.ast.SumType */) { size = ((*sym->info._v__ast__SumType).fields.len + 2) * t->pointer_size; align = t->pointer_size; } - else if (sym->info._typ == 430 /* v.ast.Aggregate */) { + else if (sym->info._typ == 431 /* v.ast.Aggregate */) { size = ((*sym->info._v__ast__Aggregate).fields.len + 2) * t->pointer_size; align = t->pointer_size; } - else if (sym->info._typ == 435 /* v.ast.Interface */) { + else if (sym->info._typ == 436 /* v.ast.Interface */) { size = ((*sym->info._v__ast__Interface).fields.len + 2) * t->pointer_size; align = t->pointer_size; for (int _t8 = 0; _t8 < (*sym->info._v__ast__Interface).embeds.len; ++_t8) { @@ -48732,7 +48812,7 @@ multi_return_int_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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ; multi_return_int_int mr_22224 = v__ast__Table_type_size(t, info.elem_type); int elem_size = mr_22224.arg0; int elem_align = mr_22224.arg1; @@ -49047,7 +49127,7 @@ 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 == 412 /* v.ast.Array */) { + if ((sym->info)._typ == 413 /* 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("[]"), /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { @@ -49058,9 +49138,9 @@ 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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, 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 == 263 /* v.ast.EmptyExpr */) { + if ((info.size_expr)._typ == 264 /* 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("["), /*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 }}})); @@ -49070,7 +49150,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty 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, 441) /*expected idx: 441, name: v.ast.Chan */ ; + v__ast__Chan info = /* as */ *(v__ast__Chan*)__as_cast((sym->info)._v__ast__Chan,(sym->info)._typ, 442) /*expected idx: 442, name: v.ast.Chan */ ; v__ast__Type elem_type = info.elem_type; string mut_str = _SLIT(""); if (info.is_mut) { @@ -49084,7 +49164,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } case v__ast__Kind__function: { - 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__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 445) /*expected idx: 445, 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 { @@ -49113,7 +49193,7 @@ 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, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 414) /*expected idx: 414, 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["), /*115 &string*/0xfe10, {.d_s = key_str}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = val_str}}, {_SLIT0, 0, { .d_c = 0 }}})); @@ -49122,7 +49202,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty 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, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 444) /*expected idx: 444, 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) { @@ -49138,7 +49218,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 == 417 /* v.ast.Struct */) { + if (sym->info._typ == 418 /* 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]; @@ -49149,7 +49229,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.Interface */) { + else if (sym->info._typ == 436 /* 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]; @@ -49160,7 +49240,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 == 436 /* v.ast.SumType */) { + else if (sym->info._typ == 437 /* 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]; @@ -49175,7 +49255,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty else { } ; - } 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) { + } else if ((sym->info)._typ == 437 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 437) /*expected idx: 437, 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; @@ -49195,7 +49275,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, 445) /*expected idx: 445, name: v.ast.GenericInst */ ; + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast((sym->info)._v__ast__GenericInst,(sym->info)._typ, 446) /*expected idx: 446, 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) { @@ -49274,7 +49354,7 @@ VV_LOCAL_SYMBOL string v__ast__Table_shorten_user_defined_typenames(v__ast__Tabl res = (*(string*)map_get(ADDR(map, import_aliases), &(string[]){res}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); } else { if (string_contains(res, _SLIT("[]"))) { - Option_int _t1 = string_index(res, _SLIT(".")); + _option_int _t1 = string_index(res, _SLIT(".")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(int*) _t1.data = -1; @@ -49383,7 +49463,7 @@ bool v__ast__TypeSymbol_has_method(v__ast__TypeSymbol* t, string name) { } bool v__ast__TypeSymbol_has_method_with_generic_parent(v__ast__TypeSymbol* t, string name) { - Option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(t, name); + _option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(t, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -49395,35 +49475,35 @@ bool v__ast__TypeSymbol_has_method_with_generic_parent(v__ast__TypeSymbol* t, st return _t3; } -Option_v__ast__Fn v__ast__TypeSymbol_find_method(v__ast__TypeSymbol* t, string name) { +_option_v__ast__Fn v__ast__TypeSymbol_find_method(v__ast__TypeSymbol* t, string name) { Array_v__ast__Fn _t1 = t->methods; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__Fn* method = ((v__ast__Fn*)_t1.data) + _t2; if (string__eq(method->name, name)) { - Option_v__ast__Fn _t3; - opt_ok(&(v__ast__Fn[]) { *method }, (Option*)(&_t3), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t3; + opt_ok2(&(v__ast__Fn[]) { *method }, (_option*)(&_t3), sizeof(v__ast__Fn)); return _t3; } } - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__TypeSymbol* t, string name) { - Option_v__ast__Fn _t1; +_option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__TypeSymbol* t, string name) { + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method(t, name), _t1.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t1.data; - Option_v__ast__Fn _t2; - opt_ok(&(v__ast__Fn[]) { m }, (Option*)(&_t2), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t2; + opt_ok2(&(v__ast__Fn[]) { m }, (_option*)(&_t2), sizeof(v__ast__Fn)); return _t2; } v__ast__Table* table = global_table; - if (t->info._typ == 417 /* v.ast.Struct */) { + if (t->info._typ == 418 /* 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; + _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 == 417 /* v.ast.Struct */) { + if (parent_sym->info._typ == 418 /* 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; @@ -49440,7 +49520,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types); } else { - Option_v__ast__Type _t6; + _option_v__ast__Type _t6; if (_t6 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types), _t6.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t6.data; method.return_type = rt; @@ -49449,18 +49529,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t7 = 0; _t7 < method.params.len; ++_t7) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t7; - Option_v__ast__Type _t8; + _option_v__ast__Type _t8; if (_t8 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Struct).concrete_types), _t8.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t8.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t9; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t9), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t9; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t9), sizeof(v__ast__Fn)); return _t9; } - else if (parent_sym->info._typ == 435 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 436 /* 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; @@ -49477,7 +49557,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types); } else { - Option_v__ast__Type _t12; + _option_v__ast__Type _t12; if (_t12 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types), _t12.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t12.data; method.return_type = rt; @@ -49486,18 +49566,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t13 = 0; _t13 < method.params.len; ++_t13) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t13; - Option_v__ast__Type _t14; + _option_v__ast__Type _t14; if (_t14 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Interface).concrete_types), _t14.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t14.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t15; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t15), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t15; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t15), sizeof(v__ast__Fn)); return _t15; } - else if (parent_sym->info._typ == 436 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 437 /* 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; @@ -49514,7 +49594,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types); } else { - Option_v__ast__Type _t18; + _option_v__ast__Type _t18; if (_t18 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types), _t18.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t18.data; method.return_type = rt; @@ -49523,15 +49603,15 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t19 = 0; _t19 < method.params.len; ++_t19) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t19; - Option_v__ast__Type _t20; + _option_v__ast__Type _t20; if (_t20 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__SumType).concrete_types), _t20.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t20.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t21; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t21), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t21; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t21), sizeof(v__ast__Fn)); return _t21; } @@ -49541,13 +49621,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ } } } - else if (t->info._typ == 435 /* v.ast.Interface */) { + else if (t->info._typ == 436 /* 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; + _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 == 417 /* v.ast.Struct */) { + if (parent_sym->info._typ == 418 /* 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; @@ -49564,7 +49644,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types); } else { - Option_v__ast__Type _t25; + _option_v__ast__Type _t25; if (_t25 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types), _t25.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t25.data; method.return_type = rt; @@ -49573,18 +49653,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t26 = 0; _t26 < method.params.len; ++_t26) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t26; - Option_v__ast__Type _t27; + _option_v__ast__Type _t27; if (_t27 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Struct).concrete_types), _t27.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t27.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t28; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t28), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t28; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t28), sizeof(v__ast__Fn)); return _t28; } - else if (parent_sym->info._typ == 435 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 436 /* 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; @@ -49601,7 +49681,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types); } else { - Option_v__ast__Type _t31; + _option_v__ast__Type _t31; if (_t31 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types), _t31.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t31.data; method.return_type = rt; @@ -49610,18 +49690,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t32 = 0; _t32 < method.params.len; ++_t32) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t32; - Option_v__ast__Type _t33; + _option_v__ast__Type _t33; if (_t33 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Interface).concrete_types), _t33.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t33.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t34; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t34), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t34; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t34), sizeof(v__ast__Fn)); return _t34; } - else if (parent_sym->info._typ == 436 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 437 /* 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; @@ -49638,7 +49718,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types); } else { - Option_v__ast__Type _t37; + _option_v__ast__Type _t37; if (_t37 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types), _t37.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t37.data; method.return_type = rt; @@ -49647,15 +49727,15 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t38 = 0; _t38 < method.params.len; ++_t38) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t38; - Option_v__ast__Type _t39; + _option_v__ast__Type _t39; if (_t39 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__SumType).concrete_types), _t39.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t39.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t40; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t40), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t40; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t40), sizeof(v__ast__Fn)); return _t40; } @@ -49665,13 +49745,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ } } } - else if (t->info._typ == 436 /* v.ast.SumType */) { + else if (t->info._typ == 437 /* 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; + _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 == 417 /* v.ast.Struct */) { + if (parent_sym->info._typ == 418 /* 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; @@ -49688,7 +49768,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types); } else { - Option_v__ast__Type _t44; + _option_v__ast__Type _t44; if (_t44 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types), _t44.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t44.data; method.return_type = rt; @@ -49697,18 +49777,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t45 = 0; _t45 < method.params.len; ++_t45) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t45; - Option_v__ast__Type _t46; + _option_v__ast__Type _t46; if (_t46 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Struct).concrete_types), _t46.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t46.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t47; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t47), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t47; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t47), sizeof(v__ast__Fn)); return _t47; } - else if (parent_sym->info._typ == 435 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 436 /* 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; @@ -49725,7 +49805,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types); } else { - Option_v__ast__Type _t50; + _option_v__ast__Type _t50; if (_t50 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types), _t50.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t50.data; method.return_type = rt; @@ -49734,18 +49814,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t51 = 0; _t51 < method.params.len; ++_t51) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t51; - Option_v__ast__Type _t52; + _option_v__ast__Type _t52; if (_t52 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Interface).concrete_types), _t52.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t52.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t53; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t53), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t53; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t53), sizeof(v__ast__Fn)); return _t53; } - else if (parent_sym->info._typ == 436 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 437 /* 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; @@ -49762,7 +49842,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types); } else { - Option_v__ast__Type _t56; + _option_v__ast__Type _t56; if (_t56 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types), _t56.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t56.data; method.return_type = rt; @@ -49771,15 +49851,15 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t57 = 0; _t57 < method.params.len; ++_t57) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t57; - Option_v__ast__Type _t58; + _option_v__ast__Type _t58; if (_t58 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__SumType).concrete_types), _t58.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t58.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t59; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t59), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t59; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t59), sizeof(v__ast__Fn)); return _t59; } @@ -49793,7 +49873,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ else { } ; - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__TypeSymbol_is_js_compatible(v__ast__TypeSymbol* t) { @@ -49810,7 +49890,7 @@ bool v__ast__TypeSymbol_is_js_compatible(v__ast__TypeSymbol* t) { bool _t3 = true; return _t3; } - if (t->info._typ == 436 /* v.ast.SumType */) { + if (t->info._typ == 437 /* 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); @@ -49835,7 +49915,7 @@ multi_return_bool_bool_int v__ast__TypeSymbol_str_method_info(v__ast__TypeSymbol bool has_str_method = false; bool expects_ptr = false; int nr_args = 0; - Option_v__ast__Fn _t1; + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method_with_generic_parent(t, _SLIT("str")), _t1.state == 0) { v__ast__Fn sym_str_method = *(v__ast__Fn*)_t1.data; has_str_method = true; @@ -49847,68 +49927,68 @@ multi_return_bool_bool_int v__ast__TypeSymbol_str_method_info(v__ast__TypeSymbol return (multi_return_bool_bool_int){.arg0=has_str_method, .arg1=expects_ptr, .arg2=nr_args}; } -Option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name) { - if (t->info._typ == 430 /* v.ast.Aggregate */) { - Option_v__ast__StructField _t1 = v__ast__Aggregate_find_field(&(*t->info._v__ast__Aggregate), name); +_option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name) { + if (t->info._typ == 431 /* 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 == 417 /* v.ast.Struct */) { - Option_v__ast__StructField _t2 = v__ast__Struct_find_field(&(*t->info._v__ast__Struct), name); + else if (t->info._typ == 418 /* 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 == 435 /* v.ast.Interface */) { - Option_v__ast__StructField _t3 = v__ast__Interface_find_field(&(*t->info._v__ast__Interface), name); + else if (t->info._typ == 436 /* 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 == 436 /* v.ast.SumType */) { - Option_v__ast__StructField _t4 = v__ast__SumType_find_field(&(*t->info._v__ast__SumType), name); + else if (t->info._typ == 437 /* v.ast.SumType */) { + _option_v__ast__StructField _t4 = v__ast__SumType_find_field(&(*t->info._v__ast__SumType), name); return _t4; } else { - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } ; - return (Option_v__ast__StructField){0}; + return (_option_v__ast__StructField){0}; } -VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Aggregate_find_field(v__ast__Aggregate* a, string name) { +VV_LOCAL_SYMBOL _option_v__ast__StructField v__ast__Aggregate_find_field(v__ast__Aggregate* a, string name) { Array_v__ast__StructField _t1 = a->fields; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__StructField* field = ((v__ast__StructField*)_t1.data) + _t2; if (string__eq(field->name, name)) { - Option_v__ast__StructField _t3; - opt_ok(&(v__ast__StructField[]) { *field }, (Option*)(&_t3), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t3; + opt_ok2(&(v__ast__StructField[]) { *field }, (_option*)(&_t3), sizeof(v__ast__StructField)); return _t3; } } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__StructField v__ast__Interface_find_field(v__ast__Interface* i, string name) { +_option_v__ast__StructField v__ast__Interface_find_field(v__ast__Interface* i, string name) { Array_v__ast__StructField _t1 = i->fields; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__StructField* field = ((v__ast__StructField*)_t1.data) + _t2; if (string__eq(field->name, name)) { - Option_v__ast__StructField _t3; - opt_ok(&(v__ast__StructField[]) { *field }, (Option*)(&_t3), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t3; + opt_ok2(&(v__ast__StructField[]) { *field }, (_option*)(&_t3), sizeof(v__ast__StructField)); return _t3; } } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__Fn v__ast__Interface_find_method(v__ast__Interface* i, string name) { +_option_v__ast__Fn v__ast__Interface_find_method(v__ast__Interface* i, string name) { Array_v__ast__Fn _t1 = i->methods; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__Fn* method = ((v__ast__Fn*)_t1.data) + _t2; if (string__eq(method->name, name)) { - Option_v__ast__Fn _t3; - opt_ok(&(v__ast__Fn[]) { *method }, (Option*)(&_t3), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t3; + opt_ok2(&(v__ast__Fn[]) { *method }, (_option*)(&_t3), sizeof(v__ast__Fn)); return _t3; } } - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__Interface_has_method(v__ast__Interface* i, string name) { @@ -49924,21 +50004,21 @@ bool v__ast__Interface_has_method(v__ast__Interface* i, string name) { return _t4; } -Option_v__ast__StructField v__ast__Struct_find_field(v__ast__Struct* s, string name) { +_option_v__ast__StructField v__ast__Struct_find_field(v__ast__Struct* s, string name) { Array_v__ast__StructField _t1 = s->fields; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__StructField* field = ((v__ast__StructField*)_t1.data) + _t2; if (string__eq(field->name, name)) { - Option_v__ast__StructField _t3; - opt_ok(&(v__ast__StructField[]) { *field }, (Option*)(&_t3), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t3; + opt_ok2(&(v__ast__StructField[]) { *field }, (_option*)(&_t3), sizeof(v__ast__StructField)); return _t3; } } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__StructField v__ast__Struct_get_field(v__ast__Struct* s, string name) { - Option_v__ast__StructField _t1; + _option_v__ast__StructField _t1; if (_t1 = v__ast__Struct_find_field(s, name), _t1.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t1.data; v__ast__StructField _t2 = field; @@ -49949,17 +50029,17 @@ v__ast__StructField v__ast__Struct_get_field(v__ast__Struct* s, string name) { return (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}; } -Option_v__ast__StructField v__ast__SumType_find_field(v__ast__SumType* s, string name) { +_option_v__ast__StructField v__ast__SumType_find_field(v__ast__SumType* s, string name) { Array_v__ast__StructField _t1 = s->fields; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__StructField* field = ((v__ast__StructField*)_t1.data) + _t2; if (string__eq(field->name, name)) { - Option_v__ast__StructField _t3; - opt_ok(&(v__ast__StructField[]) { *field }, (Option*)(&_t3), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t3; + opt_ok2(&(v__ast__StructField[]) { *field }, (_option*)(&_t3), sizeof(v__ast__StructField)); return _t3; } } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__Interface_defines_method(v__ast__Interface* i, string name) { @@ -49986,8 +50066,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 == 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)))) { + if ((right)->_typ == 254 /* v.ast.CallExpr */ || (right)->_typ == 269 /* v.ast.IfExpr */ || (right)->_typ == 276 /* v.ast.LockExpr */ || (right)->_typ == 278 /* v.ast.MatchExpr */) { + if (((right)->_typ == 269 /* v.ast.IfExpr */ || (right)->_typ == 278 /* v.ast.MatchExpr */) && node->left.len == node->right.len && !is_decl && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 268 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 288 /* 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); @@ -50007,22 +50087,22 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; right_len = 0; } } - if ((right)->_typ == 271 /* v.ast.InfixExpr */) { + if ((right)->_typ == 272 /* 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 == 267 /* v.ast.Ident */) { + if ((right)->_typ == 268 /* 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 == 279 /* v.ast.None */) { + if ((right)->_typ == 280 /* 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 == 253 /* v.ast.CallExpr */) { + if ((right_first)._typ == 254 /* 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) { @@ -50044,21 +50124,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 == 253 /* v.ast.CallExpr */) { + if ((left)->_typ == 254 /* 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) { + } else if ((left)->_typ == 285 /* v.ast.PrefixExpr */) { + if (((*left->_v__ast__PrefixExpr).right)._typ == 254 /* 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 == 270 /* v.ast.IndexExpr */) { - if (((*left->_v__ast__IndexExpr).index)._typ == 285 /* v.ast.RangeExpr */) { + } else if ((left)->_typ == 271 /* v.ast.IndexExpr */) { + if (((*left->_v__ast__IndexExpr).index)._typ == 286 /* 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 == 267 /* v.ast.Ident */ || (left)->_typ == 287 /* v.ast.SelectorExpr */) { + if ((left)->_typ == 268 /* v.ast.Ident */ || (left)->_typ == 288 /* v.ast.SelectorExpr */) { c->prevent_sum_type_unwrapping_once = true; } left_type = v__checker__Checker_expr(c, *left); @@ -50066,8 +50146,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 == 267 /* v.ast.Ident */) { - if (((*left->_v__ast__Ident).info)._typ == 377 /* v.ast.IdentVar */) { + if ((left)->_typ == 268 /* v.ast.Ident */) { + if (((*left->_v__ast__Ident).info)._typ == 378 /* 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; } } @@ -50081,28 +50161,28 @@ 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 == 267 /* v.ast.Ident */) { + if ((right)._typ == 268 /* v.ast.Ident */) { v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); - if ((right_sym->info)._typ == 417 /* v.ast.Struct */) { + if ((right_sym->info)._typ == 418 /* v.ast.Struct */) { if ((*right_sym->info._v__ast__Struct).generic_types.len > 0) { - Option_v__ast__ScopeObject _t2; + _option_v__ast__ScopeObject _t2; if (_t2 = v__ast__Scope_find((*right._v__ast__Ident).scope, (*right._v__ast__Ident).name), _t2.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t2.data; right_type = (*(obj.typ)); } } } - } else if ((right)._typ == 259 /* v.ast.ComptimeSelector */) { + } else if ((right)._typ == 260 /* v.ast.ComptimeSelector */) { right_type = c->comptime_fields_default_type; } if (is_decl) { - if ((right)._typ == 292 /* v.ast.StructInit */) { + if ((right)._typ == 293 /* 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 == 284 /* v.ast.PrefixExpr */) { - if ((*right._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*right._v__ast__PrefixExpr).right)._typ == 292 /* v.ast.StructInit */) { + } else if ((right)._typ == 285 /* v.ast.PrefixExpr */) { + if ((*right._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*right._v__ast__PrefixExpr).right)._typ == 293 /* v.ast.StructInit */) { right_type = v__checker__Checker_expr(c, right); } } @@ -50112,7 +50192,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 == 272 /* v.ast.IntegerLiteral */) { + if ((right)._typ == 273 /* 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); @@ -50127,11 +50207,11 @@ 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 == 267 /* v.ast.Ident */) { - if (((*right._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((right)._typ == 268 /* v.ast.Ident */) { + if (((*right._v__ast__Ident).obj)._typ == 326 /* 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); + _option_v__ast__Var_ptr _t3 = v__ast__Scope_find_var(c->fn_scope, (*(*right._v__ast__Ident).obj._v__ast__Var).name); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; *(v__ast__Var**) _t3.data = obj; @@ -50149,21 +50229,21 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } } - 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)) { + if (!is_decl && (left)->_typ == 268 /* 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="), /*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 == 267 /* v.ast.Ident */) { + if (left->_typ == 268 /* 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 != 377 /* v.ast.IdentVar */) { + } else if (((*left->_v__ast__Ident).info)._typ != 378 /* 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) { @@ -50172,7 +50252,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; 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, 377) /*expected idx: 377, 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, 378) /*expected idx: 378, 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) { @@ -50191,7 +50271,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 == 325 /* v.ast.Var */) { + if ((*left->_v__ast__Ident).obj._typ == 326 /* 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; @@ -50202,14 +50282,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 == 272 /* v.ast.IntegerLiteral */) { + if ((right)._typ == 273 /* 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 == 324 /* v.ast.GlobalField */) { + else if ((*left->_v__ast__Ident).obj._typ == 325 /* v.ast.GlobalField */) { (*(*left->_v__ast__Ident).obj._v__ast__GlobalField).typ = left_type; } @@ -50219,22 +50299,22 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } if (is_decl) { 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; + _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 == 323 /* v.ast.ConstField */) { + if ((obj)._typ == 324 /* 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 == 284 /* v.ast.PrefixExpr */) { + else if (left->_typ == 285 /* 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 == 267 /* v.ast.Ident */) { - if (((*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + } else if (((*left->_v__ast__PrefixExpr).right)._typ == 268 /* v.ast.Ident */) { + if (((*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj)._typ == 326 /* v.ast.Var */) { (*(*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj._v__ast__Var).is_used = true; } } @@ -50243,8 +50323,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 == 287 /* v.ast.SelectorExpr */) { - if (((*left->_v__ast__SelectorExpr).expr)._typ == 270 /* v.ast.IndexExpr */) { + else if (left->_typ == 288 /* v.ast.SelectorExpr */) { + if (((*left->_v__ast__SelectorExpr).expr)._typ == 271 /* 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; } @@ -50252,7 +50332,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } else { - if ((left)->_typ == 270 /* v.ast.IndexExpr */) { + if ((left)->_typ == 271 /* 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); } @@ -50275,26 +50355,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 == 267 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 267 /* v.ast.Ident */) { + 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 == 268 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 268 /* 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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 == 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 (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 == 268 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 268 /* v.ast.Ident */) { + if ((right_sym->info)._typ == 441 /* 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 == 267 /* 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 == 268 /* 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); @@ -50306,7 +50386,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; 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 `"), /*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 == 292 /* 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 == 293 /* 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)) { @@ -50421,10 +50501,10 @@ 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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, name: v.ast.Struct */ ).generic_types.len > 0) { continue; } - Option_v__ast__Fn _t8; + _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)) { @@ -50443,7 +50523,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } if (!is_blank_ident && !v__ast__Expr_is_auto_deref_var(/*rec*/*left) && !v__ast__Expr_is_auto_deref_var(right) && right_sym->kind != v__ast__Kind__placeholder && left_sym->kind != v__ast__Kind__interface_ && !v__ast__Type_has_flag(right_type, v__ast__TypeFlag__generic) && !v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic)) { - Option_void _t9 = v__checker__Checker_check_expected(c, right_type_unwrapped, left_type_unwrapped); + _option_void _t9 = v__checker__Checker_check_expected(c, right_type_unwrapped, left_type_unwrapped); if (_t9.state != 0 && _t9.err._typ != _IError_None___index) { IError err = _t9.err; if (v__ast__Type_is_ptr(left_type_unwrapped) && v__ast__Type_is_int(right_type_unwrapped) && (node->op == v__token__Kind__plus_assign || node->op == v__token__Kind__minus_assign)) { @@ -50466,13 +50546,13 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } } - if ((right_first)._typ == 284 /* v.ast.PrefixExpr */) { + if ((right_first)._typ == 285 /* 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 == 267 /* v.ast.Ident */) { + if ((left_first)._typ == 268 /* 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 == 377 /* v.ast.IdentVar */) { + if (((*left_first._v__ast__Ident).info)._typ == 378 /* 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; @@ -50480,8 +50560,8 @@ 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 == 267 /* v.ast.Ident */) { - if (((*right_node.right._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((right_node.right)._typ == 268 /* v.ast.Ident */) { + if (((*right_node.right._v__ast__Ident).obj)._typ == 326 /* v.ast.Var */) { v__ast__Var v = (*(*right_node.right._v__ast__Ident).obj._v__ast__Var); right_type0 = v.typ; } @@ -50533,7 +50613,7 @@ bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v bool _t4 = true; return _t4; } - if (v__ast__Type_alias_eq(expected, _const_v__ast__bool_type) && (v__ast__Type_is_any_kind_of_pointer(got) || v__ast__Type_is_int(got))) { + if ((v__ast__Type_alias_eq(expected, _const_v__ast__bool_type) && (v__ast__Type_is_any_kind_of_pointer(got) || v__ast__Type_is_int(got))) || ((v__ast__Type_is_any_kind_of_pointer(expected) || v__ast__Type_is_int(expected)) && v__ast__Type_alias_eq(got, _const_v__ast__bool_type))) { bool _t5 = true; return _t5; } @@ -50557,126 +50637,133 @@ bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v return _t8; } } else if (got_sym->kind == v__ast__Kind__array_fixed) { - if (v__ast__TypeSymbol_is_number(expected_sym)) { + if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) { bool _t9 = true; return _t9; - } else if (v__ast__Type_is_any_kind_of_pointer(expected)) { - bool _t10 = true; - return _t10; } } else if (expected_sym->kind == v__ast__Kind__array_fixed) { if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) { - bool _t11 = true; - return _t11; + bool _t10 = true; + return _t10; } else if (got_sym->kind == v__ast__Kind__array) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; - v__ast__Array info2 = /* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ; + v__ast__Array info2 = /* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ; if (v__checker__Checker_check_types(c, info.elem_type, info2.elem_type)) { - bool _t12 = true; - return _t12; + bool _t11 = true; + return _t11; } } + } else if (got_sym->kind == v__ast__Kind__array) { + if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) { + bool _t12 = true; + return _t12; + } + } else if (expected_sym->kind == v__ast__Kind__array) { + if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) { + bool _t13 = true; + return _t13; + } } if (expected_sym->kind == v__ast__Kind__enum_ && v__ast__TypeSymbol_is_number(got_sym)) { - bool _t13 = true; - return _t13; + bool _t14 = true; + return _t14; } if (got_is_ptr && exp_is_ptr) { if (v__ast__TypeSymbol_is_number(expected_sym) && v__ast__TypeSymbol_is_number(got_sym)) { - bool _t14 = true; - return _t14; + bool _t15 = true; + return _t15; } } } if (got_is_ptr && exp_is_ptr) { if (v__ast__Type_nr_muls(got) != v__ast__Type_nr_muls(expected)) { - bool _t15 = false; - return _t15; + bool _t16 = false; + return _t16; } } int exp_idx = v__ast__Type_idx(expected); int got_idx = v__ast__Type_idx(got); if (exp_idx == got_idx) { - bool _t16 = true; - return _t16; + bool _t17 = true; + return _t17; } if (exp_idx == _const_v__ast__voidptr_type_idx || exp_idx == _const_v__ast__byteptr_type_idx || (v__ast__Type_is_ptr(expected) && v__ast__Type_idx(v__ast__Type_deref(expected)) == _const_v__ast__byte_type_idx)) { if (v__ast__Type_is_ptr(got) || v__ast__Type_is_pointer(got)) { - bool _t17 = true; - return _t17; - } - } - if (v__ast__Type_is_real_pointer(expected)) { - if (v__ast__Type_alias_eq(got, _const_v__ast__int_literal_type)) { bool _t18 = true; return _t18; } } - if (got_idx == _const_v__ast__voidptr_type_idx || got_idx == _const_v__ast__byteptr_type_idx || (got_idx == _const_v__ast__byte_type_idx && v__ast__Type_is_ptr(got))) { - if (v__ast__Type_is_ptr(expected) || v__ast__Type_is_pointer(expected)) { + if (v__ast__Type_is_real_pointer(expected)) { + if (v__ast__Type_alias_eq(got, _const_v__ast__int_literal_type)) { bool _t19 = true; return _t19; } } + if (got_idx == _const_v__ast__voidptr_type_idx || got_idx == _const_v__ast__byteptr_type_idx || (got_idx == _const_v__ast__byte_type_idx && v__ast__Type_is_ptr(got))) { + if (v__ast__Type_is_ptr(expected) || v__ast__Type_is_pointer(expected)) { + bool _t20 = true; + return _t20; + } + } if (v__ast__Type_alias_eq(expected, _const_v__ast__charptr_type) && v__ast__Type_alias_eq(got, v__ast__Type_ref(_const_v__ast__char_type))) { - bool _t20 = true; - return _t20; + bool _t21 = true; + return _t21; } 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))) && 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 _t21 = true; - return _t21; - } 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 _t22 = false; + bool _t22 = true; return _t22; + } 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 _t23 = false; + return _t23; } } if (!v__checker__Checker_check_basic(c, got, expected)) { - bool _t23 = false; - return _t23; + bool _t24 = false; + return _t24; } if (v__ast__Type_is_number(got) && v__ast__Type_is_number(expected)) { if (v__ast__Type_alias_eq(got, _const_v__ast__rune_type) && v__ast__Type_alias_eq(expected, _const_v__ast__byte_type)) { - bool _t24 = true; - return _t24; - } else if (v__ast__Type_alias_eq(expected, _const_v__ast__rune_type) && v__ast__Type_alias_eq(got, _const_v__ast__byte_type)) { bool _t25 = true; return _t25; + } else if (v__ast__Type_alias_eq(expected, _const_v__ast__rune_type) && v__ast__Type_alias_eq(got, _const_v__ast__byte_type)) { + bool _t26 = true; + return _t26; } if (!v__ast__Type_alias_eq(v__checker__Checker_promote_num(c, expected, got), expected)) { - bool _t26 = false; - return _t26; + bool _t27 = false; + return _t27; } } if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__generic)) { - bool _t27 = false; - return _t27; + bool _t28 = false; + return _t28; } - bool _t28 = true; - return _t28; + bool _t29 = true; + return _t29; } -Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg) { +_option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg) { if (got == 0) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("unexpected 0 type")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("unexpected 0 type")), .data={EMPTY_STRUCT_INITIALIZATION} }; } 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, name: v.ast.Array */ ; expected = exp_info.elem_type; } if (language == v__ast__Language__c) { if (v__ast__Type_is_number(got) && v__ast__Type_is_number(expected)) { - return (Option_void){0}; + return (_option_void){0}; } if ((v__ast__Type_idx(got) == _const_v__ast__bool_type_idx && (v__ast__Type_idx(expected) == _const_v__ast__int_type_idx || v__ast__Type_idx(expected) == _const_v__ast__int_literal_type_idx)) || (v__ast__Type_idx(expected) == _const_v__ast__bool_type_idx && (v__ast__Type_idx(got) == _const_v__ast__int_type_idx || v__ast__Type_idx(got) == _const_v__ast__int_literal_type_idx))) { - return (Option_void){0}; + return (_option_void){0}; } v__ast__TypeSymbol* exp_sym = v__ast__Table_sym(c->table, expected); if (v__ast__Type_is_ptr(expected) && exp_sym->language == v__ast__Language__c && (exp_sym->kind == v__ast__Kind__placeholder || exp_sym->kind == v__ast__Kind__struct_) && got == _const_v__ast__int_type_idx) { - return (Option_void){0}; + return (_option_void){0}; } } int idx_got = v__ast__Type_idx(got); @@ -50685,24 +50772,24 @@ Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, int igot = ((int)(got)); int iexpected = ((int)(expected)); if ((igot == _const_v__ast__byteptr_type_idx && iexpected == 65545) || (iexpected == _const_v__ast__byteptr_type_idx && igot == 65545)) { - return (Option_void){0}; + return (_option_void){0}; } if ((igot == _const_v__ast__charptr_type_idx && iexpected == 65551) || (iexpected == _const_v__ast__charptr_type_idx && igot == 65551)) { - return (Option_void){0}; + return (_option_void){0}; } int muls_got = v__ast__Type_nr_muls(got); int muls_expected = v__ast__Type_nr_muls(expected); if (idx_got == _const_v__ast__byteptr_type_idx && idx_expected == _const_v__ast__byte_type_idx && muls_got + 1 == muls_expected) { - return (Option_void){0}; + return (_option_void){0}; } if (idx_expected == _const_v__ast__byteptr_type_idx && idx_got == _const_v__ast__byte_type_idx && muls_expected + 1 == muls_got) { - return (Option_void){0}; + return (_option_void){0}; } if (idx_got == _const_v__ast__charptr_type_idx && idx_expected == _const_v__ast__char_type_idx && muls_got + 1 == muls_expected) { - return (Option_void){0}; + return (_option_void){0}; } if (idx_expected == _const_v__ast__charptr_type_idx && idx_got == _const_v__ast__char_type_idx && muls_expected + 1 == muls_got) { - return (Option_void){0}; + return (_option_void){0}; } } v__ast__TypeSymbol* got_typ_sym = v__ast__Table_sym(c->table, got); @@ -50711,24 +50798,24 @@ 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 (v__checker__Checker_check_types(c, got, expected)) { if (language != v__ast__Language__v || v__ast__Type_is_ptr(expected) == v__ast__Type_is_ptr(got) || arg.is_mut || v__ast__Expr_is_auto_deref_var(arg.expr) || v__ast__Type_has_flag(got, v__ast__TypeFlag__shared_f) || !(v__ast__Table_sym(c->table, expected_)->kind == v__ast__Kind__array || v__ast__Table_sym(c->table, expected_)->kind == v__ast__Kind__map)) { - return (Option_void){0}; + return (_option_void){0}; } } else { 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 `"), /*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){ .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}; + 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(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(arg.expr)}}, {_SLIT("` (no value) used as value"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(arg.expr)}}, {_SLIT("` (no value) used as value"), 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){ .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} }; } 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 `"), /*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){ .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}; + return (_option_void){0}; } VV_LOCAL_SYMBOL bool v__checker__Checker_check_same_module(v__checker__Checker _v_toheap_c, v__ast__Type got, v__ast__Type expected) { @@ -50833,8 +50920,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, 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__FnType got_info = /* as */ *(v__ast__FnType*)__as_cast((got_type_sym->info)._v__ast__FnType,(got_type_sym->info)._typ, 445) /*expected idx: 445, 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, 445) /*expected idx: 445, 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) { @@ -50875,7 +50962,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, 432) /*expected idx: 432, 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, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type)) { v__ast__Type _t1 = left_type; return _t1; } @@ -50895,7 +50982,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker return _t4; } if (!node->ct_left_value_evaled) { - Option_v__ast__ComptTimeConstValue _t5; + _option_v__ast__ComptTimeConstValue _t5; if (_t5 = v__checker__Checker_eval_comptime_const_expr(c, node->left, 0), _t5.state == 0) { v__ast__ComptTimeConstValue lval = *(v__ast__ComptTimeConstValue*)_t5.data; node->ct_left_value_evaled = true; @@ -50903,7 +50990,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker } } if (!node->ct_right_value_evaled) { - Option_v__ast__ComptTimeConstValue _t6; + _option_v__ast__ComptTimeConstValue _t6; if (_t6 = v__checker__Checker_eval_comptime_const_expr(c, node->right, 0), _t6.state == 0) { v__ast__ComptTimeConstValue rval = *(v__ast__ComptTimeConstValue*)_t6.data; node->ct_right_value_evaled = true; @@ -50918,8 +51005,8 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker 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 != 263 /* v.ast.EmptyExpr */) { - Option_i64 _t7 = v__ast__ComptTimeConstValue_i64(node->ct_right_value); + if ((node->ct_right_value)._typ != 264 /* v.ast.EmptyExpr */) { + _option_i64 _t7 = v__ast__ComptTimeConstValue_i64(node->ct_right_value); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; *(i64*) _t7.data = -999; @@ -50938,7 +51025,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker return _t9; } if (node->ct_left_value_evaled) { - Option_i64 _t10; + _option_i64 _t10; if (_t10 = v__ast__ComptTimeConstValue_i64(node->ct_left_value), _t10.state == 0) { i64 lval = *(i64*)_t10.data; if (lval < 0) { @@ -51002,10 +51089,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_17770 = type_hi; - v__ast__Type _var_17779 = type_lo; - type_hi = _var_17779; - type_lo = _var_17770; + v__ast__Type _var_18084 = type_hi; + v__ast__Type _var_18093 = type_lo; + type_hi = _var_18093; + type_lo = _var_18084; } int idx_hi = v__ast__Type_idx(type_hi); int idx_lo = v__ast__Type_idx(type_lo); @@ -51052,11 +51139,11 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_promote_num(v__checker__Checker return 0; } -Option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected) { +_option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected) { if (!v__checker__Checker_check_types(c, got, expected)) { - return (Option_void){ .state=2, .err=_v_error(v__checker__Checker_expected_msg(c, got, expected)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(v__checker__Checker_expected_msg(c, got, expected)), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL string v__checker__Checker_expected_msg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected) { @@ -51097,7 +51184,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 == 417 /* v.ast.Struct */) { + if (sym->info._typ == 418 /* 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); @@ -51121,7 +51208,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } - else if (sym->info._typ == 435 /* v.ast.Interface */) { + else if (sym->info._typ == 436 /* 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); @@ -51145,7 +51232,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } - else if (sym->info._typ == 436 /* v.ast.SumType */) { + else if (sym->info._typ == 437 /* 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); @@ -51184,7 +51271,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 == 444 /* v.ast.FnType */) { + if ((sym->info)._typ == 445 /* 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); @@ -51204,15 +51291,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, 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__Array arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_sym->info)._v__ast__Array,(arg_sym->info)._typ, 413) /*expected idx: 413, 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, 413) /*expected idx: 413, 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, name: v.ast.Array */ ; param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); } else { if (string__eq(param_elem_sym->name, gt_name)) { @@ -51222,15 +51309,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, 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__ArrayFixed arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_sym->info)._v__ast__ArrayFixed,(arg_sym->info)._typ, 441) /*expected idx: 441, 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, 441) /*expected idx: 441, 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, 440) /*expected idx: 440, 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, 441) /*expected idx: 441, 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, 440) /*expected idx: 440, 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, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ; param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); } else { if (string__eq(param_elem_sym->name, gt_name)) { @@ -51240,8 +51327,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, 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 */ ; + v__ast__Map arg_map_info = /* as */ *(v__ast__Map*)__as_cast((arg_sym->info)._v__ast__Map,(arg_sym->info)._typ, 414) /*expected idx: 414, 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, 414) /*expected idx: 414, 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; } @@ -51249,8 +51336,8 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ typ = arg_map_info.value_type; } } else if (arg_sym->kind == v__ast__Kind__function && param_type_sym->kind == v__ast__Kind__function) { - v__ast__Fn arg_type_func = (/* as */ *(v__ast__FnType*)__as_cast((arg_sym->info)._v__ast__FnType,(arg_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ).func; - v__ast__Fn param_type_func = (/* as */ *(v__ast__FnType*)__as_cast((param_type_sym->info)._v__ast__FnType,(param_type_sym->info)._typ, 444) /*expected idx: 444, name: v.ast.FnType */ ).func; + v__ast__Fn arg_type_func = (/* as */ *(v__ast__FnType*)__as_cast((arg_sym->info)._v__ast__FnType,(arg_sym->info)._typ, 445) /*expected idx: 445, name: v.ast.FnType */ ).func; + v__ast__Fn param_type_func = (/* as */ *(v__ast__FnType*)__as_cast((param_type_sym->info)._v__ast__FnType,(param_type_sym->info)._typ, 445) /*expected idx: 445, name: v.ast.FnType */ ).func; if (param_type_func.params.len == arg_type_func.params.len) { for (int n = 0; n < param_type_func.params.len; ++n) { v__ast__Param fn_param = ((v__ast__Param*)param_type_func.params.data)[n]; @@ -51265,15 +51352,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 == 417 /* v.ast.Struct */) { + if (arg_sym->info._typ == 418 /* 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 == 435 /* v.ast.Interface */) { + else if (arg_sym->info._typ == 436 /* 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 == 436 /* v.ast.SumType */) { + else if (arg_sym->info._typ == 437 /* v.ast.SumType */) { generic_types = (*arg_sym->info._v__ast__SumType).generic_types; concrete_types = (*arg_sym->info._v__ast__SumType).concrete_types; } @@ -51405,7 +51492,7 @@ void v__checker__Checker_check(v__checker__Checker* c, v__ast__File* ast_file_) 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 == 303 /* v.ast.ConstDecl */ || (stmt)->_typ == 307 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 304 /* v.ast.ConstDecl */ || (stmt)->_typ == 308 /* v.ast.ExprStmt */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -51416,7 +51503,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 == 311 /* v.ast.GlobalDecl */) { + if ((stmt)->_typ == 312 /* v.ast.GlobalDecl */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -51427,7 +51514,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 != 303 /* v.ast.ConstDecl */ && (stmt)->_typ != 311 /* v.ast.GlobalDecl */ && (stmt)->_typ != 307 /* v.ast.ExprStmt */) { + if ((stmt)->_typ != 304 /* v.ast.ConstDecl */ && (stmt)->_typ != 312 /* v.ast.GlobalDecl */ && (stmt)->_typ != 308 /* v.ast.ExprStmt */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -51451,7 +51538,7 @@ 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 == 325 /* v.ast.Var */) { + if (obj._typ == 326 /* 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: `"), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*obj._v__ast__Var).pos); } @@ -51653,7 +51740,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 == 184 /* v.ast.FnDecl */) { + if ((stmt)._typ == 185 /* 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); @@ -51690,7 +51777,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_valid_snake_case(v__checker__Chec } VV_LOCAL_SYMBOL string v__checker__stripped_name(string name) { - Option_int _t1 = string_last_index(name, _SLIT(".")); + _option_int _t1 = string_last_index(name, _SLIT(".")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(int*) _t1.data = -1; @@ -51709,13 +51796,13 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_valid_pascal_case(v__checker__Che } void v__checker__Checker_type_decl(v__checker__Checker* c, v__ast__TypeDecl node) { - if (node._typ == 241 /* v.ast.AliasTypeDecl */) { + if (node._typ == 242 /* v.ast.AliasTypeDecl */) { v__checker__Checker_alias_type_decl(c, (*node._v__ast__AliasTypeDecl)); } - else if (node._typ == 242 /* v.ast.FnTypeDecl */) { + else if (node._typ == 243 /* v.ast.FnTypeDecl */) { v__checker__Checker_fn_type_decl(c, (*node._v__ast__FnTypeDecl)); } - else if (node._typ == 243 /* v.ast.SumTypeDecl */) { + else if (node._typ == 244 /* v.ast.SumTypeDecl */) { v__checker__Checker_sum_type_decl(c, (*node._v__ast__SumTypeDecl)); } ; @@ -51725,7 +51812,7 @@ void v__checker__Checker_alias_type_decl(v__checker__Checker* c, v__ast__AliasTy if (!string__eq(c->file->mod.name, _SLIT("builtin"))) { v__checker__Checker_check_valid_pascal_case(c, node.name, _SLIT("type alias"), node.pos); } - Option_void _t1 = v__checker__Checker_ensure_type_exists(c, node.parent_type, node.type_pos); + _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node.parent_type, node.type_pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; return; @@ -51736,7 +51823,7 @@ void v__checker__Checker_alias_type_decl(v__checker__Checker* c, v__ast__AliasTy 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 `"), /*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, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type); + 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, 433) /*expected idx: 433, 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); @@ -51746,9 +51833,9 @@ 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, 444) /*expected idx: 444, 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, 445) /*expected idx: 445, 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); + _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) { IError err = _t1.err; } @@ -51760,7 +51847,7 @@ void v__checker__Checker_fn_type_decl(v__checker__Checker* c, v__ast__FnTypeDecl } for (int _t2 = 0; _t2 < fn_info.params.len; ++_t2) { v__ast__Param arg = ((v__ast__Param*)fn_info.params.data)[_t2]; - Option_void _t3 = v__checker__Checker_ensure_type_exists(c, arg.typ, arg.type_pos); + _option_void _t3 = v__checker__Checker_ensure_type_exists(c, arg.typ, arg.type_pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; return; @@ -51782,7 +51869,7 @@ void v__checker__Checker_sum_type_decl(v__checker__Checker* c, v__ast__SumTypeDe if (v__ast__Type_is_ptr(variant.typ)) { v__checker__Checker_error(c, _SLIT("sum type cannot hold a reference type"), variant.pos); } - Option_void _t2 = v__checker__Checker_ensure_type_exists(c, variant.typ, variant.pos); + _option_void _t2 = v__checker__Checker_ensure_type_exists(c, variant.typ, variant.pos); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -51820,7 +51907,7 @@ Array_v__ast__InterfaceEmbedding v__checker__Checker_expand_iface_embeds(v__chec for (int _t3 = 0; _t3 < iface_embeds.len; ++_t3) { v__ast__InterfaceEmbedding ie = ((v__ast__InterfaceEmbedding*)iface_embeds.data)[_t3]; v__ast__InterfaceDecl* _t5 = (v__ast__InterfaceDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, c->table->interfaces), &(int[]){ie.typ})); - Option_v__ast__InterfaceDecl _t4 = {0}; + _option_v__ast__InterfaceDecl _t4 = {0}; if (_t5) { *((v__ast__InterfaceDecl*)&_t4.data) = *((v__ast__InterfaceDecl*)_t5); } else { @@ -51859,19 +51946,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 == 265 /* v.ast.FloatLiteral */) { + if (expr._typ == 266 /* 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, /*115 &string*/0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__FloatLiteral).pos); } } - else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 273 /* 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, /*115 &string*/0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__IntegerLiteral).pos); } } - else if (expr._typ == 254 /* v.ast.CastExpr */) { + else if (expr._typ == 255 /* v.ast.CastExpr */) { v__checker__Checker_check_div_mod_by_zero(c, (*expr._v__ast__CastExpr).expr, op_kind); } @@ -51919,12 +52006,12 @@ v__ast__Type former_expected_type; } v__ast__Type return_type = left_type; if (node->op != v__token__Kind__key_is) { - if (node->left._typ == 267 /* v.ast.Ident */) { + if (node->left._typ == 268 /* 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 == 287 /* v.ast.SelectorExpr */) { + else if (node->left._typ == 288 /* 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); } @@ -51934,12 +52021,12 @@ v__ast__Type former_expected_type; } ; } - if (node->right._typ == 267 /* v.ast.Ident */) { + if (node->right._typ == 268 /* 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 == 287 /* v.ast.SelectorExpr */) { + else if (node->right._typ == 288 /* 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); } @@ -51959,12 +52046,12 @@ v__ast__Type former_expected_type; } 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 == 272 /* v.ast.IntegerLiteral */) { + if (!is_left_type_signed && (node->right)._typ == 273 /* 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("`"), /*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 == 272 /* v.ast.IntegerLiteral */) { + } else if (!is_right_type_signed && (node->left)._typ == 273 /* 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 `"), /*115 &string*/0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node->left._v__ast__IntegerLiteral).pos); @@ -51990,7 +52077,7 @@ v__ast__Type former_expected_type; if (right_final->kind == (v__ast__Kind__array)) { if (!(left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_)) { v__ast__Type elem_type = v__ast__TypeSymbol_array_info(right_final).elem_type; - Option_void _t1 = v__checker__Checker_check_expected(c, left_type, elem_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 `"), /*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); @@ -52002,7 +52089,7 @@ v__ast__Type former_expected_type; } else if (right_final->kind == (v__ast__Kind__map)) { v__ast__Map map_info = v__ast__TypeSymbol_map_info(right_final); - Option_void _t2 = v__checker__Checker_check_expected(c, left_type, map_info.key_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 `"), /*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); @@ -52015,7 +52102,7 @@ v__ast__Type former_expected_type; else if (right_final->kind == (v__ast__Kind__array_fixed)) { if (!(left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_)) { v__ast__Type elem_type = v__ast__TypeSymbol_array_fixed_info(right_final).elem_type; - Option_void _t3 = v__checker__Checker_check_expected(c, left_type, elem_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 `"), /*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); @@ -52046,17 +52133,17 @@ v__ast__Type former_expected_type; case v__token__Kind__amp: case v__token__Kind__pipe: { - 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 ((right_sym->info)._typ == 433 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 433) /*expected idx: 433, 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, 433) /*expected idx: 433, 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, 433) /*expected idx: 433, 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 ((left_sym->info)._typ == 433 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 433) /*expected idx: 433, 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, 433) /*expected idx: 433, 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, 433) /*expected idx: 433, 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 == 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)))) { + } else if (!c->pref->translated && left_sym->kind == v__ast__Kind__alias && (left_sym->info)._typ == 433 /* 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, 433) /*expected idx: 433, 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; + _option_v__ast__Fn _t5; if (_t5 = v__ast__TypeSymbol_find_method(left_sym, v__token__Kind_str(node->op)), _t5.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t5.data; return_type = method.return_type; @@ -52073,9 +52160,9 @@ v__ast__Type former_expected_type; 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 == 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)))) { + } else if (!c->pref->translated && right_sym->kind == v__ast__Kind__alias && (right_sym->info)._typ == 433 /* 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, 433) /*expected idx: 433, 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; + _option_v__ast__Fn _t6; if (_t6 = v__ast__TypeSymbol_find_method(right_sym, v__token__Kind_str(node->op)), _t6.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t6.data; return_type = method.return_type; @@ -52095,7 +52182,7 @@ v__ast__Type former_expected_type; } if (!c->pref->translated && (left_sym->kind == v__ast__Kind__array || left_sym->kind == v__ast__Kind__array_fixed || left_sym->kind == v__ast__Kind__map || left_sym->kind == v__ast__Kind__struct_)) { if (v__ast__TypeSymbol_has_method_with_generic_parent(left_sym, v__token__Kind_str(node->op))) { - Option_v__ast__Fn _t7; + _option_v__ast__Fn _t7; if (_t7 = v__ast__TypeSymbol_find_method_with_generic_parent(left_sym, v__token__Kind_str(node->op)), _t7.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t7.data; return_type = method.return_type; @@ -52114,7 +52201,7 @@ v__ast__Type former_expected_type; } } 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_)) { if (v__ast__TypeSymbol_has_method_with_generic_parent(right_sym, v__token__Kind_str(node->op))) { - Option_v__ast__Fn _t8; + _option_v__ast__Fn _t8; if (_t8 = v__ast__TypeSymbol_find_method_with_generic_parent(right_sym, v__token__Kind_str(node->op)), _t8.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t8.data; return_type = method.return_type; @@ -52180,7 +52267,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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, 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) { @@ -52221,13 +52308,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 == 272 /* v.ast.IntegerLiteral */) { + if ((node->right)._typ == 273 /* 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 == 272 /* v.ast.IntegerLiteral */) { + if ((node->left)._typ == 273 /* 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); } @@ -52388,10 +52475,10 @@ v__ast__Type former_expected_type; { v__ast__Expr right_expr = node->right; v__ast__Type _t20 = 0; - if (right_expr._typ == 293 /* v.ast.TypeNode */) { + if (right_expr._typ == 294 /* v.ast.TypeNode */) { _t20 = (*right_expr._v__ast__TypeNode).typ; } - else if (right_expr._typ == 279 /* v.ast.None */) { + else if (right_expr._typ == 280 /* v.ast.None */) { _t20 = _const_v__ast__none_type_idx; } @@ -52407,12 +52494,12 @@ v__ast__Type former_expected_type; 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, 430) /*expected idx: 430, 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, 431) /*expected idx: 431, 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("`"), /*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 */) { + } else if ((left_sym->info)._typ == 437 /* 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("`"), /*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); } @@ -52465,7 +52552,7 @@ v__ast__Type former_expected_type; 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 == 271 /* v.ast.InfixExpr */) { + if ((node->left)._typ == 272 /* 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); } @@ -52574,8 +52661,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, 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 */ ; + v__ast__Enum left_enum = /* as */ *(v__ast__Enum*)__as_cast((left_sym->info)._v__ast__Enum,(left_sym->info)._typ, 447) /*expected idx: 447, 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, 447) /*expected idx: 447, 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); @@ -52629,14 +52716,14 @@ 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 == 254 /* v.ast.CastExpr */) { + if (expr._typ == 255 /* v.ast.CastExpr */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 259 /* v.ast.ComptimeSelector */) { + else if (expr._typ == 260 /* v.ast.ComptimeSelector */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 267 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + else if (expr._typ == 268 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 326 /* 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("`"), /*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); } @@ -52654,25 +52741,25 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im pos = (*expr._v__ast__Ident).pos; } } - } else if (((*expr._v__ast__Ident).obj)._typ == 323 /* v.ast.ConstField */ && Array_string_contains(c->const_names, (*expr._v__ast__Ident).name)) { + } else if (((*expr._v__ast__Ident).obj)._typ == 324 /* v.ast.ConstField */ && Array_string_contains(c->const_names, (*expr._v__ast__Ident).name)) { if (!c->inside_unsafe && !c->pref->translated) { 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 == 270 /* v.ast.IndexExpr */) { + else if (expr._typ == 271 /* 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 == 412 /* v.ast.Array */) { + if (left_sym->info._typ == 413 /* v.ast.Array */) { elem_type = (*left_sym->info._v__ast__Array).elem_type; kind = _SLIT("array"); } - else if (left_sym->info._typ == 440 /* v.ast.ArrayFixed */) { + else if (left_sym->info._typ == 441 /* v.ast.ArrayFixed */) { elem_type = (*left_sym->info._v__ast__ArrayFixed).elem_type; kind = _SLIT("fixed array"); } - else if (left_sym->info._typ == 413 /* v.ast.Map */) { + else if (left_sym->info._typ == 414 /* v.ast.Map */) { elem_type = (*left_sym->info._v__ast__Map).value_type; kind = _SLIT("map"); } @@ -52687,21 +52774,21 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im to_lock = mr_44503.arg0; pos = mr_44503.arg1; } - else if (expr._typ == 282 /* v.ast.ParExpr */) { + else if (expr._typ == 283 /* v.ast.ParExpr */) { multi_return_string_v__token__Pos mr_44572 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); to_lock = mr_44572.arg0; pos = mr_44572.arg1; } - else if (expr._typ == 284 /* v.ast.PrefixExpr */) { + else if (expr._typ == 285 /* v.ast.PrefixExpr */) { multi_return_string_v__token__Pos mr_44644 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); to_lock = mr_44644.arg0; pos = mr_44644.arg1; } - else if (expr._typ == 287 /* v.ast.SelectorExpr */) { + else if (expr._typ == 288 /* v.ast.SelectorExpr */) { if ((*expr._v__ast__SelectorExpr).expr_type == 0) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - Option_void _t4 = v__checker__Checker_ensure_type_exists(c, (*expr._v__ast__SelectorExpr).expr_type, (*expr._v__ast__SelectorExpr).pos); + _option_void _t4 = v__checker__Checker_ensure_type_exists(c, (*expr._v__ast__SelectorExpr).expr_type, (*expr._v__ast__SelectorExpr).pos); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; @@ -52713,7 +52800,7 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im case v__ast__Kind__struct_: { bool has_field = true; - Option_v__ast__StructField _t6 = v__ast__Table_find_field_with_embeds(c->table, typ_sym, (*expr._v__ast__SelectorExpr).field_name); + _option_v__ast__StructField _t6 = v__ast__Table_find_field_with_embeds(c->table, typ_sym, (*expr._v__ast__SelectorExpr).field_name); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; has_field = false; @@ -52756,8 +52843,8 @@ 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, 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); + v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 436) /*expected idx: 436, 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); @@ -52776,8 +52863,8 @@ 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, 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); + v__ast__SumType sumtype_info = /* as */ *(v__ast__SumType*)__as_cast((typ_sym->info)._v__ast__SumType,(typ_sym->info)._typ, 437) /*expected idx: 437, 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); @@ -52851,7 +52938,7 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } ; } - else if (expr._typ == 253 /* v.ast.CallExpr */) { + else if (expr._typ == 254 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("slice"))) { multi_return_string_v__token__Pos mr_47931 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); to_lock = mr_47931.arg0; @@ -52861,14 +52948,14 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } } } - else if (expr._typ == 247 /* v.ast.ArrayInit */) { + else if (expr._typ == 248 /* 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 == 292 /* v.ast.StructInit */) { + else if (expr._typ == 293 /* v.ast.StructInit */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 271 /* v.ast.InfixExpr */) { + else if (expr._typ == 272 /* v.ast.InfixExpr */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } @@ -52903,12 +52990,12 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, bool _t2 = true; return _t2; } - if ((inter_sym->info)._typ == 435 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 436 /* 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 == 435 /* v.ast.Interface */) { + if ((parent_sym->info)._typ == 436 /* v.ast.Interface */) { generic_type = (*inter_sym->info._v__ast__Interface).parent_type; generic_info = (*parent_sym->info._v__ast__Interface); } @@ -52930,7 +53017,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, return _t5; } } - if ((inter_sym->info)._typ == 435 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 436 /* 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)) { @@ -52951,18 +53038,18 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, 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 `"), /*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, 435) /*expected idx: 435, 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, 436) /*expected idx: 436, 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]; - Option_v__ast__Fn _t11 = v__ast__Table_find_method_with_embeds(c->table, typ_sym, imethod.name); + _option_v__ast__Fn _t11 = v__ast__Table_find_method_with_embeds(c->table, typ_sym, imethod.name); 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("`"), /*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); + _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("`"), /*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); @@ -52985,10 +53072,10 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, } } } - if ((inter_sym->info)._typ == 435 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 436 /* 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; + _option_v__ast__StructField _t15; if (_t15 = v__ast__Table_find_field_with_embeds(c->table, typ_sym, ifield.name), _t15.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t15.data; if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { @@ -53018,7 +53105,7 @@ 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 == 253 /* v.ast.CallExpr */) { + if ((expr)._typ == 254 /* 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("!"))); @@ -53038,7 +53125,7 @@ v__ast__Type v__checker__Checker_check_expr_opt_call(v__checker__Checker* c, v__ } 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 == 270 /* v.ast.IndexExpr */) { + } else if ((expr)._typ == 271 /* 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, v__ast__Type_set_flag(ret_type, v__ast__TypeFlag__optional)); } @@ -53079,7 +53166,7 @@ void v__checker__Checker_check_or_expr(v__checker__Checker* c, v__ast__OrExpr no 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 == 307 /* v.ast.ExprStmt */) { + if (stmt._typ == 308 /* 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); @@ -53091,13 +53178,13 @@ 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 == 268 /* v.ast.IfExpr */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 269 /* 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 == 277 /* v.ast.MatchExpr */) { + } else if (((*stmt._v__ast__ExprStmt).expr)._typ == 278 /* 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); @@ -53110,13 +53197,13 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* 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 == 301 /* v.ast.BranchStmt */) { + else if (stmt._typ == 302 /* 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 == 318 /* v.ast.Return */) { + else if (stmt._typ == 319 /* v.ast.Return */) { } else { @@ -53124,14 +53211,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* 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 == 307 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).expr._typ == 268 /* v.ast.IfExpr */) { + } else if ((stmt)._typ == 308 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 269 /* 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 == 277 /* v.ast.MatchExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 278 /* 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); @@ -53164,14 +53251,14 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S c->using_new_err_struct = true; } int name_type = 0; - if (node->expr._typ == 267 /* v.ast.Ident */) { + if (node->expr._typ == 268 /* 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 == 294 /* v.ast.TypeOf */) { + else if (node->expr._typ == 295 /* v.ast.TypeOf */) { name_type = v__checker__Checker_expr(c, (*node->expr._v__ast__TypeOf).expr); } @@ -53206,8 +53293,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 == 267 /* v.ast.Ident */) { - if (((*node->expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((node->expr)._typ == 268 /* v.ast.Ident */) { + if (((*node->expr._v__ast__Ident).obj)._typ == 326 /* v.ast.Var */) { typ = (*(*node->expr._v__ast__Ident).obj._v__ast__Var).typ; } } @@ -53219,7 +53306,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 == 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)) { + if (v__ast__Type_has_flag(node->expr_type, v__ast__TypeFlag__optional) && !((node->expr)._typ == 268 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->expr)._v__ast__Ident,(node->expr)._typ, 268) /*expected idx: 268, 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; @@ -53243,7 +53330,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S 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){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}); - 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) { + if (field_name.len > 0 && u8_is_capital(string_at(field_name, 0)) && (sym->info)._typ == 418 /* 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); @@ -53254,7 +53341,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S } } } else { - Option_v__ast__StructField _t12; + _option_v__ast__StructField _t12; if (_t12 = v__ast__Table_find_field(c->table, sym, field_name), _t12.state == 0) { v__ast__StructField f = *(v__ast__StructField*)_t12.data; has_field = true; @@ -53263,7 +53350,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S IError err = _t12.err; has_field = true; Array_v__ast__Type embed_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t13 = v__ast__Table_find_field_from_embeds(c->table, sym, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t13 = v__ast__Table_find_field_from_embeds(c->table, sym, field_name); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; if ((IError_name_table[err._typ]._method_msg(err._object)).len != 0) { @@ -53282,7 +53369,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S } } if (!c->inside_unsafe) { - if ((sym->info)._typ == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* 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); } @@ -53290,7 +53377,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic) && !has_field) { v__ast__TypeSymbol* gs = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, typ)); - Option_v__ast__StructField _t14; + _option_v__ast__StructField _t14; if (_t14 = v__ast__Table_find_field(c->table, gs, field_name), _t14.state == 0) { v__ast__StructField f = *(v__ast__StructField*)_t14.data; has_field = true; @@ -53299,7 +53386,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S IError err = _t14.err; has_field = true; Array_v__ast__Type embed_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t15 = v__ast__Table_find_field_from_embeds(c->table, gs, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t15 = v__ast__Table_find_field_from_embeds(c->table, gs, field_name); if (_t15.state != 0) { /*or block*/ IError err = _t15.err; if ((IError_name_table[err._typ]._method_msg(err._object)).len != 0) { @@ -53317,7 +53404,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S } } if (sym->idx == _const_v__ast__error_type_idx && !c->is_just_builtin_mod && (string__eq(field_name, _SLIT("msg")) || string__eq(field_name, _SLIT("code")))) { - Option_v__ast__Fn _t16 = v__ast__Table_find_method(c->table, sym, field_name); + _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: "), /*115 &IError*/0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); @@ -53338,7 +53425,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S 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_) { if (!prevent_sum_type_unwrapping_once) { - Option_v__ast__ScopeStructField _t19; + _option_v__ast__ScopeStructField _t19; if (_t19 = v__ast__Scope_find_struct_field(node->scope, v__ast__Expr_str(node->expr), typ, field_name), _t19.state == 0) { v__ast__ScopeStructField scope_field = *(v__ast__ScopeStructField*)_t19.data; v__ast__Type _t20 = (*(v__ast__Type*)array_last(scope_field.smartcasts)); @@ -53361,7 +53448,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S 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 == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* 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); } @@ -53409,7 +53496,7 @@ void v__checker__Checker_const_decl(v__checker__Checker* c, v__ast__ConstDecl* n c->const_decl = field->name; array_push((array*)&c->const_deps, _MOV((string[]){ string_clone(field->name) })); v__ast__Type typ = v__checker__Checker_check_expr_opt_call(c, field->expr, v__checker__Checker_expr(c, field->expr)); - Option_v__ast__ComptTimeConstValue _t4; + _option_v__ast__ComptTimeConstValue _t4; if (_t4 = v__checker__Checker_eval_comptime_const_expr(c, field->expr, 0), _t4.state == 0) { v__ast__ComptTimeConstValue ct_value = *(v__ast__ComptTimeConstValue*)_t4.data; field->comptime_expr_value = ct_value; @@ -53439,7 +53526,7 @@ void v__checker__Checker_enum_decl(v__checker__Checker* c, v__ast__EnumDecl* nod } } if (field->has_expr) { - if (field->expr._typ == 272 /* v.ast.IntegerLiteral */) { + if (field->expr._typ == 273 /* 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 `"), /*100 &i64*/0xfe09, {.d_i64 = val}}, {_SLIT("` overflows int"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); @@ -53448,14 +53535,14 @@ void v__checker__Checker_enum_decl(v__checker__Checker* c, v__ast__EnumDecl* nod } array_push((array*)&seen, _MOV((i64[]){ ((i64)(val)) })); } - else if (field->expr._typ == 284 /* v.ast.PrefixExpr */) { + else if (field->expr._typ == 285 /* v.ast.PrefixExpr */) { } - else if (field->expr._typ == 271 /* v.ast.InfixExpr */) { + else if (field->expr._typ == 272 /* v.ast.InfixExpr */) { v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*field->expr._v__ast__InfixExpr)); } else { - if ((field->expr)._typ == 267 /* v.ast.Ident */) { + if ((field->expr)._typ == 268 /* v.ast.Ident */) { if ((*field->expr._v__ast__Ident).language == v__ast__Language__c) { continue; } @@ -53504,38 +53591,38 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St } #endif c->expected_type = _const_v__ast__void_type; - if (node._typ == 305 /* v.ast.EmptyStmt */) { + if (node._typ == 306 /* v.ast.EmptyStmt */) { if (c->pref->is_verbose) { eprintln(_SLIT("Checker.stmt() EmptyStmt")); print_backtrace(); } } - else if (node._typ == 278 /* v.ast.NodeError */) { + else if (node._typ == 279 /* v.ast.NodeError */) { } - else if (node._typ == 297 /* v.ast.AsmStmt */) { + else if (node._typ == 298 /* v.ast.AsmStmt */) { v__checker__Checker_asm_stmt(c, (voidptr)&/*qq*/(*node._v__ast__AsmStmt)); } - else if (node._typ == 298 /* v.ast.AssertStmt */) { + else if (node._typ == 299 /* v.ast.AssertStmt */) { v__checker__Checker_assert_stmt(c, (*node._v__ast__AssertStmt)); } - else if (node._typ == 299 /* v.ast.AssignStmt */) { + else if (node._typ == 300 /* v.ast.AssignStmt */) { v__checker__Checker_assign_stmt(c, (voidptr)&/*qq*/(*node._v__ast__AssignStmt)); } - else if (node._typ == 300 /* v.ast.Block */) { + else if (node._typ == 301 /* v.ast.Block */) { v__checker__Checker_block(c, (*node._v__ast__Block)); } - else if (node._typ == 301 /* v.ast.BranchStmt */) { + else if (node._typ == 302 /* v.ast.BranchStmt */) { v__checker__Checker_branch_stmt(c, (*node._v__ast__BranchStmt)); } - else if (node._typ == 302 /* v.ast.ComptimeFor */) { + else if (node._typ == 303 /* v.ast.ComptimeFor */) { v__checker__Checker_comptime_for(c, (*node._v__ast__ComptimeFor)); } - else if (node._typ == 303 /* v.ast.ConstDecl */) { + else if (node._typ == 304 /* 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 == 304 /* v.ast.DeferStmt */) { + else if (node._typ == 305 /* 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) })); @@ -53546,7 +53633,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 == 377 /* v.ast.IdentVar */) { + if ((id.info)._typ == 378 /* 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){.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = _SLIT(""),.info = {0},.scope = 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,},.tok_kind = 0,.language = 0,.kind = 0,.comptime = 0,.is_mut = 0,}); continue; @@ -53563,20 +53650,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 == 306 /* v.ast.EnumDecl */) { + else if (node._typ == 307 /* v.ast.EnumDecl */) { v__checker__Checker_enum_decl(c, (voidptr)&/*qq*/(*node._v__ast__EnumDecl)); } - else if (node._typ == 307 /* v.ast.ExprStmt */) { + else if (node._typ == 308 /* 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 == 270 /* v.ast.IndexExpr */) { + if ((*node._v__ast__ExprStmt).expr._typ == 271 /* 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 == 284 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__ExprStmt).expr._typ == 285 /* 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; @@ -53587,7 +53674,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 == 271 /* v.ast.InfixExpr */) { + if (((*node._v__ast__ExprStmt).expr)._typ == 272 /* 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) { @@ -53598,24 +53685,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 == 184 /* v.ast.FnDecl */) { + else if (node._typ == 185 /* v.ast.FnDecl */) { v__checker__Checker_fn_decl(c, (voidptr)&/*qq*/(*node._v__ast__FnDecl)); } - else if (node._typ == 308 /* v.ast.ForCStmt */) { + else if (node._typ == 309 /* v.ast.ForCStmt */) { v__checker__Checker_for_c_stmt(c, (*node._v__ast__ForCStmt)); } - else if (node._typ == 309 /* v.ast.ForInStmt */) { + else if (node._typ == 310 /* v.ast.ForInStmt */) { v__checker__Checker_for_in_stmt(c, (voidptr)&/*qq*/(*node._v__ast__ForInStmt)); } - else if (node._typ == 310 /* v.ast.ForStmt */) { + else if (node._typ == 311 /* v.ast.ForStmt */) { v__checker__Checker_for_stmt(c, (voidptr)&/*qq*/(*node._v__ast__ForStmt)); } - else if (node._typ == 311 /* v.ast.GlobalDecl */) { + else if (node._typ == 312 /* v.ast.GlobalDecl */) { v__checker__Checker_global_decl(c, (voidptr)&/*qq*/(*node._v__ast__GlobalDecl)); } - else if (node._typ == 312 /* v.ast.GotoLabel */) { + else if (node._typ == 313 /* v.ast.GotoLabel */) { } - else if (node._typ == 313 /* v.ast.GotoStmt */) { + else if (node._typ == 314 /* 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); } @@ -53626,32 +53713,32 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St 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 == 314 /* v.ast.HashStmt */) { + else if (node._typ == 315 /* v.ast.HashStmt */) { v__checker__Checker_hash_stmt(c, (voidptr)&/*qq*/(*node._v__ast__HashStmt)); } - else if (node._typ == 315 /* v.ast.Import */) { + else if (node._typ == 316 /* v.ast.Import */) { v__checker__Checker_import_stmt(c, (*node._v__ast__Import)); } - else if (node._typ == 316 /* v.ast.InterfaceDecl */) { + else if (node._typ == 317 /* v.ast.InterfaceDecl */) { v__checker__Checker_interface_decl(c, (voidptr)&/*qq*/(*node._v__ast__InterfaceDecl)); } - else if (node._typ == 317 /* v.ast.Module */) { + else if (node._typ == 318 /* 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 == 318 /* v.ast.Return */) { + else if (node._typ == 319 /* v.ast.Return */) { v__checker__Checker_return_stmt(c, (voidptr)&/*qq*/(*node._v__ast__Return)); c->scope_returns = true; } - else if (node._typ == 319 /* v.ast.SqlStmt */) { + else if (node._typ == 320 /* v.ast.SqlStmt */) { v__checker__Checker_sql_stmt(c, (voidptr)&/*qq*/(*node._v__ast__SqlStmt)); } - else if (node._typ == 320 /* v.ast.StructDecl */) { + else if (node._typ == 321 /* v.ast.StructDecl */) { v__checker__Checker_struct_decl(c, (voidptr)&/*qq*/(*node._v__ast__StructDecl)); } - else if (node._typ == 244 /* v.ast.TypeDecl */) { + else if (node._typ == 245 /* v.ast.TypeDecl */) { v__checker__Checker_type_decl(c, (*node._v__ast__TypeDecl)); } ; @@ -53704,11 +53791,11 @@ VV_LOCAL_SYMBOL void v__checker__Checker_global_decl(v__checker__Checker* c, v__ 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 == 245 /* v.ast.AnonFn */ && string__eq(field->name, _SLIT("main"))) { + if ((field->expr)._typ == 246 /* 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); - Option_v__ast__GlobalField_ptr _t2 = v__ast__Scope_find_global(c->file->global_scope, field->name); + _option_v__ast__GlobalField_ptr _t2 = v__ast__Scope_find_global(c->file->global_scope, field->name); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; _v_panic(_SLIT("internal compiler error - could not find global in scope")); @@ -53755,9 +53842,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 == 398 /* v.ast.AsmAlias */) { + if (arg._typ == 399 /* v.ast.AsmAlias */) { } - else if (arg._typ == 397 /* v.ast.AsmAddressing */) { + else if (arg._typ == 398 /* 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); } @@ -53765,17 +53852,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 == 251 /* v.ast.BoolLiteral */) { + else if (arg._typ == 252 /* v.ast.BoolLiteral */) { } - else if (arg._typ == 265 /* v.ast.FloatLiteral */) { + else if (arg._typ == 266 /* v.ast.FloatLiteral */) { } - else if (arg._typ == 256 /* v.ast.CharLiteral */) { + else if (arg._typ == 257 /* v.ast.CharLiteral */) { } - else if (arg._typ == 272 /* v.ast.IntegerLiteral */) { + else if (arg._typ == 273 /* v.ast.IntegerLiteral */) { } - else if (arg._typ == 322 /* v.ast.AsmRegister */) { + else if (arg._typ == 323 /* v.ast.AsmRegister */) { } - else if (arg._typ == 399 /* v.ast.AsmDisp */) { + else if (arg._typ == 400 /* v.ast.AsmDisp */) { } else if (arg._typ == 20 /* string */) { } @@ -53841,7 +53928,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as string original_flag = node->main; string flag = node->main; if (string_contains(flag, _SLIT("@VROOT"))) { - Option_string _t1 = v__util__resolve_vmodroot(string_replace(flag, _SLIT("@VROOT"), _SLIT("@VMODROOT")), c->file->path); + _option_string _t1 = v__util__resolve_vmodroot(string_replace(flag, _SLIT("@VROOT"), _SLIT("@VMODROOT")), c->file->path); 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->pos); @@ -53860,7 +53947,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as flag = vroot; } if (string_contains(flag, _SLIT("@VMODROOT"))) { - Option_string _t2 = v__util__resolve_vmodroot(flag, c->file->path); + _option_string _t2 = v__util__resolve_vmodroot(flag, c->file->path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -53873,7 +53960,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as flag = vroot; } if (string_contains(flag, _SLIT("$env("))) { - Option_string _t3 = v__util__resolve_env_value(flag, true); + _option_string _t3 = v__util__resolve_env_value(flag, true); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -53894,7 +53981,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as v__checker__Checker_error(c, _SLIT("inserting .c or .h files, should use `\"header_file.h\"` quoting"), node->pos); } node->main = string_trim(node->main, _SLIT("\"")); - Option_string _t4; + _option_string _t4; if (_t4 = os__read_file(node->main), _t4.state == 0) { string fcontent = *(string*)_t4.data; node->val = fcontent; @@ -53915,7 +54002,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } 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 "), /*115 &string*/0xfe10, {.d_s = node->main}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(" ")))); - Option_v__pkgconfig__Main_ptr _t5 = v__pkgconfig__main(args); + _option_v__pkgconfig__Main_ptr _t5 = v__pkgconfig__main(args); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -53923,7 +54010,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } v__pkgconfig__Main* m = (*(v__pkgconfig__Main**)_t5.data); - Option_string _t6 = v__pkgconfig__Main_run(m); + _option_string _t6 = v__pkgconfig__Main_run(m); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -53931,7 +54018,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } string cflags = (*(string*)_t6.data); - Option_bool _t7 = v__ast__Table_parse_cflag(c->table, cflags, c->mod, c->pref->compile_defines_all); + _option_bool _t7 = v__ast__Table_parse_cflag(c->table, cflags, c->mod, c->pref->compile_defines_all); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -53943,7 +54030,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as else if (string__eq(node->kind, _SLIT("flag"))) { string flag = node->main; if (string_contains(flag, _SLIT("@VROOT"))) { - Option_string _t8 = v__util__resolve_vmodroot(string_replace(flag, _SLIT("@VROOT"), _SLIT("@VMODROOT")), c->file->path); + _option_string _t8 = v__util__resolve_vmodroot(string_replace(flag, _SLIT("@VROOT"), _SLIT("@VMODROOT")), c->file->path); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -53956,7 +54043,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as flag = string_replace(flag, _SLIT("@VEXEROOT"), os__dir(v__pref__vexe_path())); } if (string_contains(flag, _SLIT("@VMODROOT"))) { - Option_string _t9 = v__util__resolve_vmodroot(flag, c->file->path); + _option_string _t9 = v__util__resolve_vmodroot(flag, c->file->path); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -53966,7 +54053,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as flag = (*(string*)_t9.data); } if (string_contains(flag, _SLIT("$env("))) { - Option_string _t10 = v__util__resolve_env_value(flag, true); + _option_string _t10 = v__util__resolve_env_value(flag, true); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -53984,7 +54071,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } } } - Option_bool _t13 = v__ast__Table_parse_cflag(c->table, flag, c->mod, c->pref->compile_defines_all); + _option_bool _t13 = v__ast__Table_parse_cflag(c->table, flag, c->mod, c->pref->compile_defines_all); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -54006,7 +54093,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ v__ast__ImportSymbol sym = ((v__ast__ImportSymbol*)node.syms.data)[_t1]; 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; + _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) { @@ -54019,7 +54106,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ 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; + _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) { @@ -54027,14 +54114,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ } continue; } - Option_v__ast__ConstField_ptr _t4; + _option_v__ast__ConstField_ptr _t4; 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 `"), /*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}; + _option_time__Time _t5 = {0}; if (_t6) { *((time__Time*)&_t5.data) = *((time__Time*)_t6); } else { @@ -54077,7 +54164,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmts_ending_with_expression(v__checker } } v__checker__Checker_stmt(c, stmt); - if ((stmt)._typ == 312 /* v.ast.GotoLabel */) { + if ((stmt)._typ == 313 /* v.ast.GotoLabel */) { unreachable = ((v__token__Pos){.len = 0,.line_nr = -1,.pos = 0,.col = 0,.last_line = 0,}); c->scope_returns = false; } @@ -54095,7 +54182,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmts_ending_with_expression(v__checker v__ast__Type v__checker__Checker_unwrap_generic(v__checker__Checker* c, v__ast__Type typ) { if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t1; + _option_v__ast__Type _t1; if (_t1 = v__ast__Table_resolve_generic_to_concrete(c->table, typ, c->table->cur_fn->generic_names, c->table->cur_concrete_types), _t1.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t1.data; v__ast__Type _t2 = t_typ; @@ -54121,15 +54208,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t1; } - if (node._typ == 278 /* v.ast.NodeError */) { + if (node._typ == 279 /* v.ast.NodeError */) { } - else if (node._typ == 260 /* v.ast.ComptimeType */) { + else if (node._typ == 261 /* v.ast.ComptimeType */) { v__checker__Checker_error(c, _SLIT("incorrect use of compile-time type"), (*node._v__ast__ComptimeType).pos); } - else if (node._typ == 263 /* v.ast.EmptyExpr */) { + else if (node._typ == 264 /* 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 == 252 /* v.ast.CTempVar */) { + else if (node._typ == 253 /* v.ast.CTempVar */) { v__ast__Type _t2 = (*node._v__ast__CTempVar).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54138,7 +54225,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t2; } - else if (node._typ == 245 /* v.ast.AnonFn */) { + else if (node._typ == 246 /* 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) { @@ -54147,7 +54234,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t3; } - else if (node._typ == 246 /* v.ast.ArrayDecompose */) { + else if (node._typ == 247 /* 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) { @@ -54160,7 +54247,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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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; @@ -54172,7 +54259,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t5; } - else if (node._typ == 247 /* v.ast.ArrayInit */) { + else if (node._typ == 248 /* 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) { @@ -54181,12 +54268,12 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t6; } - else if (node._typ == 248 /* v.ast.AsCast */) { + else if (node._typ == 249 /* v.ast.AsCast */) { (*node._v__ast__AsCast).expr_type = v__checker__Checker_expr(c, (*node._v__ast__AsCast).expr); v__ast__TypeSymbol* expr_type_sym = v__ast__Table_sym(c->table, (*node._v__ast__AsCast).expr_type); v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, (*node._v__ast__AsCast).typ); if (expr_type_sym->kind == v__ast__Kind__sum_type) { - Option_void _t7 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); + _option_void _t7 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { IError err = _t7.err; } @@ -54197,7 +54284,7 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__AsCast).pos); } } else if (expr_type_sym->kind == v__ast__Kind__interface_ && type_sym->kind == v__ast__Kind__interface_) { - Option_void _t8 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); + _option_void _t8 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { IError err = _t8.err; } @@ -54218,8 +54305,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t9; } - 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); + else if (node._typ == 250 /* 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; _v_panic(IError_str(err)); @@ -54240,7 +54327,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t11; } - else if (node._typ == 251 /* v.ast.BoolLiteral */) { + else if (node._typ == 252 /* v.ast.BoolLiteral */) { v__ast__Type _t12 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54249,7 +54336,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t12; } - else if (node._typ == 254 /* v.ast.CastExpr */) { + else if (node._typ == 255 /* 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) { @@ -54258,7 +54345,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t13; } - else if (node._typ == 253 /* v.ast.CallExpr */) { + else if (node._typ == 254 /* v.ast.CallExpr */) { v__ast__Type ret_type = v__checker__Checker_call_expr(c, (voidptr)&/*qq*/(*node._v__ast__CallExpr)); if (!v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional) && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__result)) { if ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__block) { @@ -54283,7 +54370,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t14; } - else if (node._typ == 255 /* v.ast.ChanInit */) { + else if (node._typ == 256 /* 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) { @@ -54292,7 +54379,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t15; } - else if (node._typ == 256 /* v.ast.CharLiteral */) { + else if (node._typ == 257 /* v.ast.CharLiteral */) { v__ast__Type _t16 = _const_v__ast__rune_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54301,7 +54388,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t16; } - else if (node._typ == 257 /* v.ast.Comment */) { + else if (node._typ == 258 /* v.ast.Comment */) { v__ast__Type _t17 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54310,7 +54397,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t17; } - else if (node._typ == 250 /* v.ast.AtExpr */) { + else if (node._typ == 251 /* 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) { @@ -54319,7 +54406,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t18; } - else if (node._typ == 258 /* v.ast.ComptimeCall */) { + else if (node._typ == 259 /* 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) { @@ -54328,7 +54415,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t19; } - else if (node._typ == 259 /* v.ast.ComptimeSelector */) { + else if (node._typ == 260 /* v.ast.ComptimeSelector */) { v__ast__Type _t20 = v__checker__Checker_comptime_selector(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeSelector)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54337,7 +54424,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t20; } - else if (node._typ == 261 /* v.ast.ConcatExpr */) { + else if (node._typ == 262 /* v.ast.ConcatExpr */) { v__ast__Type _t21 = v__checker__Checker_concat_expr(c, (voidptr)&/*qq*/(*node._v__ast__ConcatExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54346,8 +54433,9 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t21; } - else if (node._typ == 262 /* v.ast.DumpExpr */) { + else if (node._typ == 263 /* v.ast.DumpExpr */) { (*node._v__ast__DumpExpr).expr_type = v__checker__Checker_expr(c, (*node._v__ast__DumpExpr).expr); + v__checker__Checker_check_expr_opt_call(c, (*node._v__ast__DumpExpr).expr, (*node._v__ast__DumpExpr).expr_type); int etidx = v__ast__Type_idx((*node._v__ast__DumpExpr).expr_type); if (etidx == _const_v__ast__void_type_idx) { v__checker__Checker_error(c, _SLIT("dump expression can not be void"), v__ast__Expr_pos((*node._v__ast__DumpExpr).expr)); @@ -54379,7 +54467,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t24; } - else if (node._typ == 264 /* v.ast.EnumVal */) { + else if (node._typ == 265 /* v.ast.EnumVal */) { v__ast__Type _t25 = v__checker__Checker_enum_val(c, (voidptr)&/*qq*/(*node._v__ast__EnumVal)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54388,7 +54476,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t25; } - else if (node._typ == 265 /* v.ast.FloatLiteral */) { + else if (node._typ == 266 /* v.ast.FloatLiteral */) { v__ast__Type _t26 = _const_v__ast__float_literal_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54397,7 +54485,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t26; } - else if (node._typ == 266 /* v.ast.GoExpr */) { + else if (node._typ == 267 /* v.ast.GoExpr */) { v__ast__Type _t27 = v__checker__Checker_go_expr(c, (voidptr)&/*qq*/(*node._v__ast__GoExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54406,7 +54494,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t27; } - else if (node._typ == 267 /* v.ast.Ident */) { + else if (node._typ == 268 /* v.ast.Ident */) { v__ast__Type res = v__checker__Checker_ident(c, (voidptr)&/*qq*/(*node._v__ast__Ident)); v__ast__Type _t28 = res; // Defer begin @@ -54416,7 +54504,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t28; } - else if (node._typ == 268 /* v.ast.IfExpr */) { + else if (node._typ == 269 /* v.ast.IfExpr */) { v__ast__Type _t29 = v__checker__Checker_if_expr(c, (voidptr)&/*qq*/(*node._v__ast__IfExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54425,19 +54513,19 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t29; } - else if (node._typ == 269 /* v.ast.IfGuardExpr */) { + else if (node._typ == 270 /* 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 == 270 /* v.ast.IndexExpr */) { + if ((*node._v__ast__IfGuardExpr).expr._typ == 271 /* 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 == 284 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__IfGuardExpr).expr._typ == 285 /* 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); @@ -54460,7 +54548,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t30; } - else if (node._typ == 270 /* v.ast.IndexExpr */) { + else if (node._typ == 271 /* v.ast.IndexExpr */) { v__ast__Type _t31 = v__checker__Checker_index_expr(c, (voidptr)&/*qq*/(*node._v__ast__IndexExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54469,7 +54557,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t31; } - else if (node._typ == 271 /* v.ast.InfixExpr */) { + else if (node._typ == 272 /* v.ast.InfixExpr */) { v__ast__Type _t32 = v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*node._v__ast__InfixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54478,7 +54566,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t32; } - else if (node._typ == 272 /* v.ast.IntegerLiteral */) { + else if (node._typ == 273 /* v.ast.IntegerLiteral */) { v__ast__Type _t33 = v__checker__Checker_int_lit(c, (voidptr)&/*qq*/(*node._v__ast__IntegerLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54487,7 +54575,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t33; } - else if (node._typ == 275 /* v.ast.LockExpr */) { + else if (node._typ == 276 /* v.ast.LockExpr */) { v__ast__Type _t34 = v__checker__Checker_lock_expr(c, (voidptr)&/*qq*/(*node._v__ast__LockExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54496,7 +54584,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t34; } - else if (node._typ == 276 /* v.ast.MapInit */) { + else if (node._typ == 277 /* v.ast.MapInit */) { v__ast__Type _t35 = v__checker__Checker_map_init(c, (voidptr)&/*qq*/(*node._v__ast__MapInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54505,7 +54593,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t35; } - else if (node._typ == 277 /* v.ast.MatchExpr */) { + else if (node._typ == 278 /* v.ast.MatchExpr */) { v__ast__Type _t36 = v__checker__Checker_match_expr(c, (voidptr)&/*qq*/(*node._v__ast__MatchExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54514,7 +54602,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t36; } - else if (node._typ == 283 /* v.ast.PostfixExpr */) { + else if (node._typ == 284 /* v.ast.PostfixExpr */) { v__ast__Type _t37 = v__checker__Checker_postfix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PostfixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54523,7 +54611,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t37; } - else if (node._typ == 284 /* v.ast.PrefixExpr */) { + else if (node._typ == 285 /* v.ast.PrefixExpr */) { v__ast__Type _t38 = v__checker__Checker_prefix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PrefixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54532,7 +54620,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t38; } - else if (node._typ == 279 /* v.ast.None */) { + else if (node._typ == 280 /* v.ast.None */) { v__ast__Type _t39 = _const_v__ast__none_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54541,7 +54629,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t39; } - else if (node._typ == 281 /* v.ast.OrExpr */) { + else if (node._typ == 282 /* v.ast.OrExpr */) { v__ast__Type _t40 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54550,8 +54638,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t40; } - else if (node._typ == 282 /* v.ast.ParExpr */) { - if (((*node._v__ast__ParExpr).expr)._typ == 282 /* v.ast.ParExpr */) { + else if (node._typ == 283 /* v.ast.ParExpr */) { + if (((*node._v__ast__ParExpr).expr)._typ == 283 /* v.ast.ParExpr */) { v__checker__Checker_warn(c, _SLIT("redundant parentheses are used"), (*node._v__ast__ParExpr).pos); } v__ast__Type _t41 = v__checker__Checker_expr(c, (*node._v__ast__ParExpr).expr); @@ -54562,7 +54650,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t41; } - else if (node._typ == 285 /* v.ast.RangeExpr */) { + else if (node._typ == 286 /* v.ast.RangeExpr */) { v__ast__Type _t42 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54571,7 +54659,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t42; } - else if (node._typ == 286 /* v.ast.SelectExpr */) { + else if (node._typ == 287 /* v.ast.SelectExpr */) { v__ast__Type _t43 = v__checker__Checker_select_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54580,7 +54668,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t43; } - else if (node._typ == 287 /* v.ast.SelectorExpr */) { + else if (node._typ == 288 /* v.ast.SelectorExpr */) { v__ast__Type _t44 = v__checker__Checker_selector_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectorExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54589,7 +54677,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t44; } - else if (node._typ == 288 /* v.ast.SizeOf */) { + else if (node._typ == 289 /* 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); } @@ -54601,7 +54689,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t45; } - else if (node._typ == 273 /* v.ast.IsRefType */) { + else if (node._typ == 274 /* 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); } @@ -54613,7 +54701,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t46; } - else if (node._typ == 280 /* v.ast.OffsetOf */) { + else if (node._typ == 281 /* v.ast.OffsetOf */) { v__ast__Type _t47 = v__checker__Checker_offset_of(c, (*node._v__ast__OffsetOf)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54622,7 +54710,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t47; } - else if (node._typ == 289 /* v.ast.SqlExpr */) { + else if (node._typ == 290 /* v.ast.SqlExpr */) { v__ast__Type _t48 = v__checker__Checker_sql_expr(c, (voidptr)&/*qq*/(*node._v__ast__SqlExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54631,7 +54719,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t48; } - else if (node._typ == 291 /* v.ast.StringLiteral */) { + else if (node._typ == 292 /* v.ast.StringLiteral */) { if ((*node._v__ast__StringLiteral).language == v__ast__Language__c) { v__ast__Type _t49 = v__ast__Type_set_nr_muls(_const_v__ast__byte_type, 1); // Defer begin @@ -54649,7 +54737,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t50; } - else if (node._typ == 290 /* v.ast.StringInterLiteral */) { + else if (node._typ == 291 /* v.ast.StringInterLiteral */) { v__ast__Type _t51 = v__checker__Checker_string_inter_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringInterLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54658,7 +54746,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t51; } - else if (node._typ == 292 /* v.ast.StructInit */) { + else if (node._typ == 293 /* v.ast.StructInit */) { if ((*node._v__ast__StructInit).unresolved) { v__ast__Type _t52 = v__checker__Checker_expr(c, v__ast__resolve_init((*node._v__ast__StructInit), v__checker__Checker_unwrap_generic(c, (*node._v__ast__StructInit).typ), c->table)); // Defer begin @@ -54676,7 +54764,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t53; } - else if (node._typ == 293 /* v.ast.TypeNode */) { + else if (node._typ == 294 /* v.ast.TypeNode */) { v__ast__Type _t54 = (*node._v__ast__TypeNode).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54685,7 +54773,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t54; } - else if (node._typ == 294 /* v.ast.TypeOf */) { + else if (node._typ == 295 /* v.ast.TypeOf */) { (*node._v__ast__TypeOf).expr_type = v__checker__Checker_expr(c, (*node._v__ast__TypeOf).expr); v__ast__Type _t55 = _const_v__ast__string_type; // Defer begin @@ -54695,7 +54783,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t55; } - else if (node._typ == 295 /* v.ast.UnsafeExpr */) { + else if (node._typ == 296 /* v.ast.UnsafeExpr */) { v__ast__Type _t56 = v__checker__Checker_unsafe_expr(c, (voidptr)&/*qq*/(*node._v__ast__UnsafeExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -54704,7 +54792,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t56; } - else if (node._typ == 274 /* v.ast.Likely */) { + else if (node._typ == 275 /* 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); @@ -54742,7 +54830,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE return _t1; } if (to_sym->language != v__ast__Language__c) { - Option_void _t2 = v__checker__Checker_ensure_type_exists(c, to_type, node->pos); + _option_void _t2 = v__checker__Checker_ensure_type_exists(c, to_type, node->pos); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -54766,17 +54854,17 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE 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 `"), /*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 == 432 /* v.ast.Alias */ && !(final_to_sym->kind == v__ast__Kind__struct_ && v__ast__Type_is_ptr(to_type))) { + } else if ((to_sym->info)._typ == 433 /* 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 `"), /*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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, 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, 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 */ ; + v__ast__Struct from_type_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 418) /*expected idx: 418, 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, 418) /*expected idx: 418, 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 `"), /*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); } @@ -54789,7 +54877,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE 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, 435) /*expected idx: 435, name: v.ast.Interface */ ).is_generic) { + if ((/* as */ *(v__ast__Interface*)__as_cast((to_sym->info)._v__ast__Interface,(to_sym->info)._typ, 436) /*expected idx: 436, 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; @@ -54866,7 +54954,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE 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 `"), /*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)._typ == 292 /* 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 `"), /*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 }}}))); } @@ -54878,11 +54966,11 @@ 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 == 272 /* v.ast.IntegerLiteral */) { + if ((node->expr)._typ == 273 /* 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})); - Option_v__ast__EnumDecl _t3 = {0}; + _option_v__ast__EnumDecl _t3 = {0}; if (_t4) { *((v__ast__EnumDecl*)&_t3.data) = *((v__ast__EnumDecl*)_t4); } else { @@ -54899,7 +54987,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 == 272 /* v.ast.IntegerLiteral */) { + if ((enum_field.expr)._typ == 273 /* v.ast.IntegerLiteral */) { enum_val = string_int((*enum_field.expr._v__ast__IntegerLiteral).val); } if (node_val == enum_val) { @@ -54984,7 +55072,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_at_expr(v__checker__Checker* c, if (vmod_file_location.vmod_file.len == 0) { v__checker__Checker_error(c, _SLIT("@VMOD_FILE can be used only in projects, that have v.mod file"), node->pos); } - Option_string _t1 = os__read_file(vmod_file_location.vmod_file); + _option_string _t1 = os__read_file(vmod_file_location.vmod_file); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(string*) _t1.data = _SLIT(""); @@ -55045,28 +55133,28 @@ 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, 377) /*expected idx: 377, name: v.ast.IdentVar */ ; + v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast((node->info)._v__ast__IdentVar,(node->info)._typ, 378) /*expected idx: 378, 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, 376) /*expected idx: 376, name: v.ast.IdentFn */ ; + v__ast__IdentFn info = /* as */ *(v__ast__IdentFn*)__as_cast((node->info)._v__ast__IdentFn,(node->info)._typ, 377) /*expected idx: 377, name: v.ast.IdentFn */ ; v__ast__Type _t5 = info.typ; return _t5; } else if (node->kind == v__ast__IdentKind__unresolved) { if (node->tok_kind == v__token__Kind__assign && node->is_mut) { v__checker__Checker_error(c, _SLIT("`mut` not allowed with `=` (use `:=` to declare a variable)"), node->pos); } - Option_v__ast__ScopeObject _t6; + _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 == 324 /* v.ast.GlobalField */) { + if (obj._typ == 325 /* 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,.share = 0,.is_mut = 0,.is_static = 0,.is_volatile = 0,.is_optional = 0,})))); node->obj = obj; v__ast__Type _t7 = (*obj._v__ast__GlobalField).typ; return _t7; } - else if (obj._typ == 325 /* v.ast.Var */) { + else if (obj._typ == 326 /* 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 `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` (used before declaration)"), 0, { .d_c = 0 }}})), node->pos); @@ -55081,17 +55169,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 == 267 /* v.ast.Ident */) { + if (((*obj._v__ast__Var).expr)._typ == 268 /* 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: `"), /*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 == 269 /* v.ast.IfGuardExpr */) { + if (((*obj._v__ast__Var).expr)._typ == 270 /* 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, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 444) /*expected idx: 444, 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]; @@ -55132,10 +55220,10 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no } else if (!string_contains(name, _SLIT(".")) && !string__eq(node->mod, _SLIT("builtin"))) { 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; + _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 == 323 /* v.ast.ConstField */) { + if (obj._typ == 324 /* 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 `"), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } @@ -55147,7 +55235,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 == 253 /* v.ast.CallExpr */) { + if (((*obj._v__ast__ConstField).expr)._typ == 254 /* 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); } @@ -55166,7 +55254,7 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no } ; } - Option_v__ast__Fn _t14; + _option_v__ast__Fn _t14; if (_t14 = v__ast__Table_find_fn(c->table, name), _t14.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t14.data; v__ast__Type fn_type = v__ast__new_type(v__ast__Table_find_or_register_fn_type(c->table, node->mod, func, false, true)); @@ -55186,7 +55274,7 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no return _t17; } if (c->inside_sql) { - Option_v__ast__StructField _t18; + _option_v__ast__StructField _t18; if (_t18 = v__ast__Table_find_field(c->table, (voidptr)&/*qq*/c->cur_orm_ts, node->name), _t18.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t18.data; v__ast__Type _t19 = field.typ; @@ -55247,19 +55335,19 @@ 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 == 287 /* v.ast.SelectorExpr */) { + if (expr._typ == 288 /* 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); int orig_type = 0; - Option_v__ast__StructField _t1; + _option_v__ast__StructField _t1; if (_t1 = v__ast__Table_find_field(c->table, expr_sym, (*expr._v__ast__SelectorExpr).field_name), _t1.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t1.data; if (field.is_mut) { - Option_v__ast__Ident _t2; + _option_v__ast__Ident _t2; if (_t2 = v__ast__SelectorExpr_root_ident(&(*expr._v__ast__SelectorExpr)), _t2.state == 0) { v__ast__Ident root_ident = *(v__ast__Ident*)_t2.data; - Option_v__ast__Var_ptr _t3; + _option_v__ast__Var_ptr _t3; if (_t3 = v__ast__Scope_find_var(scope, root_ident.name), _t3.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t3.data; is_mut = v->is_mut; @@ -55270,7 +55358,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast(v__checker__Checker* c, v__as orig_type = field.typ; } } - Option_v__ast__ScopeStructField _t4; + _option_v__ast__ScopeStructField _t4; if (_t4 = 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), _t4.state == 0) { v__ast__ScopeStructField field = *(v__ast__ScopeStructField*)_t4.data; _PUSH_MANY(&smartcasts, (field.smartcasts), _t5, Array_v__ast__Type); @@ -55289,12 +55377,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 == 267 /* v.ast.Ident */) { + else if (expr._typ == 268 /* 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 == 325 /* v.ast.Var */) { + if (((*expr._v__ast__Ident).obj)._typ == 326 /* 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; @@ -55341,15 +55429,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 == 307 /* v.ast.ExprStmt */) { + if (branch.stmt._typ == 308 /* 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 `"), /*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 == 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 */) { + if (((*branch.stmt._v__ast__ExprStmt).expr)._typ == 272 /* v.ast.InfixExpr */) { + if (((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 268 /* v.ast.Ident */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 288 /* v.ast.SelectorExpr */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 271 /* 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 { @@ -55357,10 +55445,10 @@ v__ast__Type v__checker__Checker_select_expr(v__checker__Checker* c, v__ast__Sel } } } - else if (branch.stmt._typ == 299 /* v.ast.AssignStmt */) { + else if (branch.stmt._typ == 300 /* 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 == 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 */) { + if (expr._typ == 285 /* v.ast.PrefixExpr */) { + if (((*expr._v__ast__PrefixExpr).right)._typ != 268 /* v.ast.Ident */ && ((*expr._v__ast__PrefixExpr).right)._typ != 288 /* v.ast.SelectorExpr */ && ((*expr._v__ast__PrefixExpr).right)._typ != 271 /* 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) { @@ -55395,7 +55483,7 @@ 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 == 267 /* v.ast.Ident */ ? (_SLIT("variable")) : (_SLIT("struct element"))); + string obj_type = (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))._typ == 268 /* 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)) { @@ -55415,7 +55503,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 == 307 /* v.ast.ExprStmt */) { + if ((last_stmt)._typ == 308 /* v.ast.ExprStmt */) { ret_type = (*last_stmt._v__ast__ExprStmt).typ; } } @@ -55435,79 +55523,79 @@ v__ast__Type v__checker__Checker_unsafe_expr(v__checker__Checker* c, v__ast__Uns return _t1; } -VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_definition(v__checker__Checker* c, v__ast__Ident ident) { +VV_LOCAL_SYMBOL _option_v__ast__Expr v__checker__Checker_find_definition(v__checker__Checker* c, v__ast__Ident ident) { if (ident.kind == (v__ast__IdentKind__unresolved) || ident.kind == (v__ast__IdentKind__blank_ident)) { - return (Option_v__ast__Expr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Expr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (ident.kind == (v__ast__IdentKind__variable) || ident.kind == (v__ast__IdentKind__constant)) { - Option_v__ast__Expr _t2 = v__checker__Checker_find_obj_definition(c, ident.obj); + _option_v__ast__Expr _t2 = v__checker__Checker_find_obj_definition(c, ident.obj); 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, /*115 &string*/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, /*115 &string*/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}; + 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) { +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 == 325 /* v.ast.Var */) { + if (obj._typ == 326 /* v.ast.Var */) { name = (*obj._v__ast__Var).name; } - else if (obj._typ == 323 /* v.ast.ConstField */) { + else if (obj._typ == 324 /* v.ast.ConstField */) { name = (*obj._v__ast__ConstField).name; } - else if (obj._typ == 324 /* v.ast.GlobalField */) { + else if (obj._typ == 325 /* v.ast.GlobalField */) { name = (*obj._v__ast__GlobalField).name; } - else if (obj._typ == 322 /* v.ast.AsmRegister */) { + else if (obj._typ == 323 /* v.ast.AsmRegister */) { name = (*obj._v__ast__AsmRegister).name; } ; v__ast__Expr expr = v__ast__empty_expr(); - if ((obj)._typ == 325 /* v.ast.Var */) { + if ((obj)._typ == 326 /* 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("`"), /*115 &string*/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 == 323 /* v.ast.ConstField */) { + } else if ((obj)._typ == 324 /* 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("`"), /*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} }; + 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 == 267 /* v.ast.Ident */) { - Option_v__ast__Expr _t3 = v__checker__Checker_find_definition(c, (*expr._v__ast__Ident)); + if ((expr)._typ == 268 /* 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 `"), /*115 &string*/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)); + _option_v__ast__Expr _t5; + opt_ok2(&(v__ast__Expr[]) { expr }, (_option*)(&_t5), sizeof(v__ast__Expr)); return _t5; } -VV_LOCAL_SYMBOL Option_bool v__checker__Checker_has_return(v__checker__Checker* c, Array_v__ast__Stmt stmts) { +VV_LOCAL_SYMBOL _option_bool v__checker__Checker_has_return(v__checker__Checker* c, Array_v__ast__Stmt stmts) { 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 == 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 */) { + if ((s)._typ == 308 /* v.ast.ExprStmt */) { + if (((*s._v__ast__ExprStmt).expr)._typ == 269 /* v.ast.IfExpr */ || ((*s._v__ast__ExprStmt).expr)._typ == 278 /* v.ast.MatchExpr */) { has_complexity = true; break; } } } if (!has_complexity || !c->returns) { - Option_bool _t2; - opt_ok(&(bool[]) { v__checker__has_top_return(stmts) }, (Option*)(&_t2), sizeof(bool)); + _option_bool _t2; + opt_ok2(&(bool[]) { v__checker__has_top_return(stmts) }, (_option*)(&_t2), sizeof(bool)); return _t2; } - return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__PostfixExpr* node) { @@ -55521,19 +55609,19 @@ v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__Po string typ_str = v__ast__Table_type_to_str(c->table, typ); v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid operation: "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" (non-numeric type `"), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); } else { - multi_return_string_v__token__Pos mr_116421 = v__checker__Checker_fail_if_immutable(c, node->expr); - node->auto_locked = mr_116421.arg0; + multi_return_string_v__token__Pos mr_116473 = v__checker__Checker_fail_if_immutable(c, node->expr); + node->auto_locked = mr_116473.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 == 267 /* v.ast.Ident */) { - if (((*node->_v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if (node->_typ == 268 /* v.ast.Ident */) { + if (((*node->_v__ast__Ident).obj)._typ == 326 /* 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); + _option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(c->fn_scope, (*(*node->_v__ast__Ident).obj._v__ast__Var).name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(v__ast__Var**) _t1.data = obj; @@ -55554,7 +55642,7 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ; if (!info.is_heap) { (*(*node->_v__ast__Ident).obj._v__ast__Var).is_auto_heap = true; } @@ -55565,12 +55653,12 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } } } - else if (node->_typ == 287 /* v.ast.SelectorExpr */) { + else if (node->_typ == 288 /* 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 == 270 /* v.ast.IndexExpr */) { + else if (node->_typ == 271 /* v.ast.IndexExpr */) { v__checker__Checker_mark_as_referenced(c, &(*node->_v__ast__IndexExpr).left, as_interface); } @@ -55580,15 +55668,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 == 267 /* v.ast.Ident */) { + if (node->_typ == 268 /* v.ast.Ident */) { string _t1 = (*node->_v__ast__Ident).name; return _t1; } - else if (node->_typ == 287 /* v.ast.SelectorExpr */) { + else if (node->_typ == 288 /* v.ast.SelectorExpr */) { string _t2 = v__checker__Checker_get_base_name(c, &(*node->_v__ast__SelectorExpr).expr); return _t2; } - else if (node->_typ == 270 /* v.ast.IndexExpr */) { + else if (node->_typ == 271 /* v.ast.IndexExpr */) { string _t3 = v__checker__Checker_get_base_name(c, &(*node->_v__ast__IndexExpr).left); return _t3; } @@ -55608,14 +55696,14 @@ 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 == 284 /* v.ast.PrefixExpr */) { + if ((node->right)._typ == 285 /* 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); } - } else if ((node->right)._typ == 287 /* v.ast.SelectorExpr */) { + } else if ((node->right)._typ == 288 /* v.ast.SelectorExpr */) { v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); v__ast__TypeSymbol* expr_sym = v__ast__Table_sym(c->table, (*node->right._v__ast__SelectorExpr).expr_type); - if (expr_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((expr_sym->info)._v__ast__Struct,(expr_sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ).is_minify && ((*node->right._v__ast__SelectorExpr).typ == _const_v__ast__bool_type_idx || (right_sym->kind == v__ast__Kind__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 */ ).is_flag && !(/* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 446) /*expected idx: 446, name: v.ast.Enum */ ).uses_exprs))) { + if (expr_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((expr_sym->info)._v__ast__Struct,(expr_sym->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ).is_minify && ((*node->right._v__ast__SelectorExpr).typ == _const_v__ast__bool_type_idx || (right_sym->kind == v__ast__Kind__enum_ && !(/* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 447) /*expected idx: 447, name: v.ast.Enum */ ).is_flag && !(/* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 447) /*expected idx: 447, name: v.ast.Enum */ ).uses_exprs))) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot take address of field in struct `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, (*node->right._v__ast__SelectorExpr).expr_type)}}, {_SLIT("`, which is tagged as `[minify]`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(node->pos, (*node->right._v__ast__SelectorExpr).pos)); } } @@ -55623,19 +55711,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 == 282 /* v.ast.ParExpr */)) break; + if (!((expr)._typ == 283 /* v.ast.ParExpr */)) break; expr = (*expr._v__ast__ParExpr).expr; } - 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 */) { + if ((expr)._typ == 252 /* v.ast.BoolLiteral */ || (expr)._typ == 254 /* v.ast.CallExpr */ || (expr)._typ == 257 /* v.ast.CharLiteral */ || (expr)._typ == 266 /* v.ast.FloatLiteral */ || (expr)._typ == 273 /* v.ast.IntegerLiteral */ || (expr)._typ == 272 /* v.ast.InfixExpr */ || (expr)._typ == 292 /* v.ast.StringLiteral */ || (expr)._typ == 291 /* 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 == 270 /* v.ast.IndexExpr */) { + if ((node->right)._typ == 271 /* 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 == 267 /* v.ast.Ident */) { + if (((*node->right._v__ast__IndexExpr).left)._typ == 268 /* 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 == 325 /* v.ast.Var */) { + if ((ident_obj)._typ == 326 /* v.ast.Var */) { is_mut = (*ident_obj._v__ast__Var).is_mut; } } @@ -55653,7 +55741,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 != 254 /* v.ast.CastExpr */) { + } else if (node->op == v__token__Kind__amp && (node->right)._typ != 255 /* v.ast.CastExpr */) { if (!c->inside_fn_arg && !c->inside_unsafe) { v__checker__Checker_mark_as_referenced(c, &node->right, false); } @@ -55700,16 +55788,16 @@ 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, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type)) || (c->pref->translated && v__ast__Type_is_any_kind_of_pointer(index_type)))) { + 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, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type)) || (c->pref->translated && v__ast__Type_is_any_kind_of_pointer(index_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 == 272 /* v.ast.IntegerLiteral */ && !is_gated) { + if ((index)._typ == 273 /* 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 `"), /*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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((typ_sym->info)._v__ast__ArrayFixed,(typ_sym->info)._typ, 441) /*expected idx: 441, 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: "), /*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); } @@ -55734,7 +55822,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 == 285 /* v.ast.RangeExpr */) { + if (node->or_expr.kind != v__ast__OrKind__absent && (node->index)._typ == 286 /* 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; @@ -55769,19 +55857,19 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde } 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 == 267 /* v.ast.Ident */) { - if (((*node->left._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((node->left)._typ == 268 /* v.ast.Ident */) { + if (((*node->left._v__ast__Ident).obj)._typ == 326 /* 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 == 285 /* v.ast.RangeExpr */) { + if (!is_ok && (node->index)._typ == 286 /* 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 `"), /*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 == 285 /* v.ast.RangeExpr */) { + if ((node->index)._typ == 286 /* 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); @@ -55799,7 +55887,7 @@ 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, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((typ_sym->info)._v__ast__Map,(typ_sym->info)._typ, 414) /*expected idx: 414, 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)) { @@ -55858,7 +55946,7 @@ 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, name: v.ast.Array */ ; typ = array_info.elem_type; typ_sym = v__ast__Table_sym(c->table, typ); } @@ -55868,7 +55956,7 @@ v__ast__Type v__checker__Checker_enum_val(v__checker__Checker* c, v__ast__EnumVa v__ast__Type _t5 = _const_v__ast__void_type; return _t5; } - if ((fsym->info)._typ != 446 /* v.ast.Enum */) { + if ((fsym->info)._typ != 447 /* 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; @@ -55919,19 +56007,19 @@ 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 == 291 /* v.ast.StringLiteral */) { + if ((key_i)._typ == 292 /* 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 == 291 /* v.ast.StringLiteral */) { + if ((key_j)._typ == 292 /* 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 \""), /*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 == 272 /* v.ast.IntegerLiteral */) { + } else if ((key_i)._typ == 273 /* 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 == 272 /* v.ast.IntegerLiteral */) { + if ((key_j)._typ == 273 /* 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 \""), /*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); } @@ -56092,10 +56180,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_trace(v__checker__Checker* c, string fb } } -VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__Checker* c, v__ast__Type typ, v__token__Pos pos) { +VV_LOCAL_SYMBOL _option_void v__checker__Checker_ensure_type_exists(v__checker__Checker* c, v__ast__Type typ, v__token__Pos pos) { if (typ == 0) { v__checker__Checker_error(c, _SLIT("unknown type"), pos); - return (Option_void){0}; + return (_option_void){0}; } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, typ); switch (sym->kind) { @@ -56103,7 +56191,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C { 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 `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), pos); - return (Option_void){0}; + return (_option_void){0}; } break; } @@ -56113,15 +56201,15 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C if (!c->is_builtin_mod) { 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}; + return (_option_void){0}; } break; } 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, name: v.ast.Array */ ).elem_type, pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -56131,9 +56219,9 @@ 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, 440) /*expected idx: 440, 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, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ).elem_type, pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } @@ -56143,18 +56231,18 @@ 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, 413) /*expected idx: 413, name: v.ast.Map */ ; - Option_void _t5 = v__checker__Checker_ensure_type_exists(c, info.key_type, pos); + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 414) /*expected idx: 414, 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; + _option_void _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } ; - Option_void _t7 = v__checker__Checker_ensure_type_exists(c, info.value_type, pos); + _option_void _t7 = v__checker__Checker_ensure_type_exists(c, info.value_type, pos); if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { - Option_void _t8; + _option_void _t8; memcpy(&_t8, &_t7, sizeof(Option)); return _t8; } @@ -56164,12 +56252,12 @@ 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, 436) /*expected idx: 436, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 437) /*expected idx: 437, 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); + _option_void _t10 = v__checker__Checker_ensure_type_exists(c, concrete_typ, pos); if (_t10.state != 0 && _t10.err._typ != _IError_None___index) { - Option_void _t11; + _option_void _t11; memcpy(&_t11, &_t10, sizeof(Option)); return _t11; } @@ -56216,12 +56304,12 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } } ; - return (Option_void){0}; + return (_option_void){0}; } 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 == 267 /* v.ast.Ident */) { + if (expr._typ == 268 /* 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"))); @@ -56230,7 +56318,7 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr } return; } - else if (expr._typ == 287 /* v.ast.SelectorExpr */) { + else if (expr._typ == 288 /* 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, /*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 }}})); @@ -56243,21 +56331,21 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__SelectorExpr).expr, (*expr._v__ast__SelectorExpr).expr_type, what); } } - else if (expr._typ == 253 /* v.ast.CallExpr */) { + else if (expr._typ == 254 /* 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 == 275 /* v.ast.LockExpr */) { + else if (expr._typ == 276 /* v.ast.LockExpr */) { return; } - else if (expr._typ == 270 /* v.ast.IndexExpr */) { + else if (expr._typ == 271 /* 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 == 271 /* v.ast.InfixExpr */) { + else if (expr._typ == 272 /* 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); @@ -56275,7 +56363,7 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Checker* c, v__ast__ComptimeCall* node) { node->left_type = v__checker__Checker_expr(c, node->left); if (node->is_env) { - 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); + _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); @@ -56339,7 +56427,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check v__ast__Type _t12 = _const_v__ast__string_type; return _t12; } - Option_v__ast__Var_ptr _t13 = v__ast__Scope_find_var(node->scope, node->method_name); + _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 `"), /*115 &string*/0xfe10, {.d_s = node->method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); @@ -56355,13 +56443,13 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check return _t15; } string method_name = _SLIT(""); - if ((v->expr)._typ == 291 /* v.ast.StringLiteral */) { + if ((v->expr)._typ == 292 /* 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); } v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, node->left_type)); - Option_v__ast__Fn _t16 = v__ast__TypeSymbol_find_method(left_sym, method_name); + _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 `"), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); @@ -56382,7 +56470,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_selector(v__checker__C 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 `"), /*115 &string*/0xfe10, {.d_s = expr_sym->name}}, {_SLIT("` (e.g. `field.name`)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->field_expr)); } - if ((node->field_expr)._typ == 287 /* v.ast.SelectorExpr */) { + if ((node->field_expr)._typ == 288 /* v.ast.SelectorExpr */) { v__token__Pos left_pos = v__ast__Expr_pos((*node->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); @@ -56408,7 +56496,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_comptime_for(v__checker__Checker* c, v_ } 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, 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]; @@ -56423,189 +56511,189 @@ VV_LOCAL_SYMBOL void v__checker__Checker_comptime_for(v__checker__Checker* c, v_ } } -VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comptime_const_expr(v__checker__Checker* c, v__ast__Expr expr, int nlevel) { +VV_LOCAL_SYMBOL _option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comptime_const_expr(v__checker__Checker* c, v__ast__Expr expr, int nlevel) { if (nlevel > 100) { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - 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); + if (expr._typ == 283 /* 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 == 288 /* v.ast.SizeOf */) { + else if (expr._typ == 289 /* v.ast.SizeOf */) { multi_return_int_int mr_4612 = v__ast__Table_type_size(c->table, (*expr._v__ast__SizeOf).typ); int s = mr_4612.arg0; - Option_v__ast__ComptTimeConstValue _t3; - opt_ok(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(&s) }, (Option*)(&_t3), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t3; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(&s) }, (_option*)(&_t3), sizeof(v__ast__ComptTimeConstValue)); return _t3; } - else if (expr._typ == 265 /* v.ast.FloatLiteral */) { + else if (expr._typ == 266 /* 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)); + _option_v__ast__ComptTimeConstValue _t4; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { f64_to_sumtype_v__ast__ComptTimeConstValue(&x) }, (_option*)(&_t4), sizeof(v__ast__ComptTimeConstValue)); return _t4; } - else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 273 /* v.ast.IntegerLiteral */) { u64 x = string_u64((*expr._v__ast__IntegerLiteral).val); if (x > 9223372036854775807U) { - Option_v__ast__ComptTimeConstValue _t5; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(&x) }, (Option*)(&_t5), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t5; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(&x) }, (_option*)(&_t5), sizeof(v__ast__ComptTimeConstValue)); return _t5; } - Option_v__ast__ComptTimeConstValue _t6; - 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)); + _option_v__ast__ComptTimeConstValue _t6; + opt_ok2(&(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 == 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)); + else if (expr._typ == 292 /* v.ast.StringLiteral */) { + _option_v__ast__ComptTimeConstValue _t7; + opt_ok2(&(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 == 256 /* v.ast.CharLiteral */) { + else if (expr._typ == 257 /* v.ast.CharLiteral */) { Array_rune runes = string_runes((*expr._v__ast__CharLiteral).val); if (runes.len > 0) { - Option_v__ast__ComptTimeConstValue _t8; - opt_ok(&(v__ast__ComptTimeConstValue[]) { rune_to_sumtype_v__ast__ComptTimeConstValue(&(*(rune*)/*ee elem_sym */array_get(runes, 0))) }, (Option*)(&_t8), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t8; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { rune_to_sumtype_v__ast__ComptTimeConstValue(&(*(rune*)/*ee elem_sym */array_get(runes, 0))) }, (_option*)(&_t8), sizeof(v__ast__ComptTimeConstValue)); return _t8; } - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - 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); + else if (expr._typ == 268 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 324 /* 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 == 254 /* v.ast.CastExpr */) { - Option_v__ast__ComptTimeConstValue _t11 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__CastExpr).expr, nlevel + 1); + else if (expr._typ == 255 /* 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; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__ComptTimeConstValue cast_expr_value = (*(v__ast__ComptTimeConstValue*)_t11.data); if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i8_type)) { - Option_i8 _t14 = v__ast__ComptTimeConstValue_i8(cast_expr_value); + _option_i8 _t14 = v__ast__ComptTimeConstValue_i8(cast_expr_value); if (_t14.state != 0) { /*or block*/ IError err = _t14.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t13; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i8, ( (*(i8*)_t14.data)))) }, (Option*)(&_t13), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t13; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i8, ( (*(i8*)_t14.data)))) }, (_option*)(&_t13), sizeof(v__ast__ComptTimeConstValue)); return _t13; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i16_type)) { - Option_i16 _t17 = v__ast__ComptTimeConstValue_i16(cast_expr_value); + _option_i16 _t17 = v__ast__ComptTimeConstValue_i16(cast_expr_value); if (_t17.state != 0) { /*or block*/ IError err = _t17.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t16; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i16_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i16, ( (*(i16*)_t17.data)))) }, (Option*)(&_t16), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t16; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i16_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i16, ( (*(i16*)_t17.data)))) }, (_option*)(&_t16), sizeof(v__ast__ComptTimeConstValue)); return _t16; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__int_type)) { - Option_int _t20 = v__ast__ComptTimeConstValue_int(cast_expr_value); + _option_int _t20 = v__ast__ComptTimeConstValue_int(cast_expr_value); if (_t20.state != 0) { /*or block*/ IError err = _t20.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t19; - opt_ok(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(ADDR(int, ( (*(int*)_t20.data)))) }, (Option*)(&_t19), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t19; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(ADDR(int, ( (*(int*)_t20.data)))) }, (_option*)(&_t19), sizeof(v__ast__ComptTimeConstValue)); return _t19; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i64_type)) { - Option_i64 _t23 = v__ast__ComptTimeConstValue_i64(cast_expr_value); + _option_i64 _t23 = v__ast__ComptTimeConstValue_i64(cast_expr_value); if (_t23.state != 0) { /*or block*/ IError err = _t23.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t22; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ( (*(i64*)_t23.data)))) }, (Option*)(&_t22), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t22; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ( (*(i64*)_t23.data)))) }, (_option*)(&_t22), sizeof(v__ast__ComptTimeConstValue)); return _t22; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__byte_type)) { - Option_u8 _t26 = v__ast__ComptTimeConstValue_u8(cast_expr_value); + _option_u8 _t26 = v__ast__ComptTimeConstValue_u8(cast_expr_value); if (_t26.state != 0) { /*or block*/ IError err = _t26.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t25; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ( (*(u8*)_t26.data)))) }, (Option*)(&_t25), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t25; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ( (*(u8*)_t26.data)))) }, (_option*)(&_t25), sizeof(v__ast__ComptTimeConstValue)); return _t25; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u16_type)) { - Option_u16 _t29 = v__ast__ComptTimeConstValue_u16(cast_expr_value); + _option_u16 _t29 = v__ast__ComptTimeConstValue_u16(cast_expr_value); if (_t29.state != 0) { /*or block*/ IError err = _t29.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t28; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u16_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u16, ( (*(u16*)_t29.data)))) }, (Option*)(&_t28), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t28; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u16_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u16, ( (*(u16*)_t29.data)))) }, (_option*)(&_t28), sizeof(v__ast__ComptTimeConstValue)); return _t28; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u32_type)) { - Option_u32 _t32 = v__ast__ComptTimeConstValue_u32(cast_expr_value); + _option_u32 _t32 = v__ast__ComptTimeConstValue_u32(cast_expr_value); if (_t32.state != 0) { /*or block*/ IError err = _t32.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t31; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u32_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u32, ( (*(u32*)_t32.data)))) }, (Option*)(&_t31), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t31; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u32_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u32, ( (*(u32*)_t32.data)))) }, (_option*)(&_t31), sizeof(v__ast__ComptTimeConstValue)); return _t31; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u64_type)) { - Option_u64 _t35 = v__ast__ComptTimeConstValue_u64(cast_expr_value); + _option_u64 _t35 = v__ast__ComptTimeConstValue_u64(cast_expr_value); if (_t35.state != 0) { /*or block*/ IError err = _t35.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t34; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ( (*(u64*)_t35.data)))) }, (Option*)(&_t34), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t34; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ( (*(u64*)_t35.data)))) }, (_option*)(&_t34), sizeof(v__ast__ComptTimeConstValue)); return _t34; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__f32_type)) { - Option_f32 _t38 = v__ast__ComptTimeConstValue_f32(cast_expr_value); + _option_f32 _t38 = v__ast__ComptTimeConstValue_f32(cast_expr_value); if (_t38.state != 0) { /*or block*/ IError err = _t38.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t37; - opt_ok(&(v__ast__ComptTimeConstValue[]) { f32_to_sumtype_v__ast__ComptTimeConstValue(ADDR(f32, ( (*(f32*)_t38.data)))) }, (Option*)(&_t37), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t37; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { f32_to_sumtype_v__ast__ComptTimeConstValue(ADDR(f32, ( (*(f32*)_t38.data)))) }, (_option*)(&_t37), sizeof(v__ast__ComptTimeConstValue)); return _t37; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__f64_type)) { - Option_f64 _t41 = v__ast__ComptTimeConstValue_f64(cast_expr_value); + _option_f64 _t41 = v__ast__ComptTimeConstValue_f64(cast_expr_value); if (_t41.state != 0) { /*or block*/ IError err = _t41.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t40; - opt_ok(&(v__ast__ComptTimeConstValue[]) { f64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(f64, ( (*(f64*)_t41.data)))) }, (Option*)(&_t40), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t40; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { f64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(f64, ( (*(f64*)_t41.data)))) }, (_option*)(&_t40), sizeof(v__ast__ComptTimeConstValue)); return _t40; } } - 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); + else if (expr._typ == 272 /* 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; + _option_v__ast__ComptTimeConstValue _t44; memcpy(&_t44, &_t43, sizeof(Option)); return _t44; } v__ast__ComptTimeConstValue left = (*(v__ast__ComptTimeConstValue*)_t43.data); - Option_v__ast__ComptTimeConstValue _t45 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__InfixExpr).right, nlevel + 1); + _option_v__ast__ComptTimeConstValue _t45 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__InfixExpr).right, nlevel + 1); if (_t45.state != 0) { /*or block*/ - Option_v__ast__ComptTimeConstValue _t46; + _option_v__ast__ComptTimeConstValue _t46; memcpy(&_t46, &_t45, sizeof(Option)); return _t46; } @@ -56614,89 +56702,89 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp if ((left)._typ == 20 /* string */ && (right)._typ == 20 /* string */) { if ((*expr._v__ast__InfixExpr).op == (v__token__Kind__plus)) { - Option_v__ast__ComptTimeConstValue _t47; - opt_ok(&(v__ast__ComptTimeConstValue[]) { string_to_sumtype_v__ast__ComptTimeConstValue(ADDR(string, (string__plus((*left._string), (*right._string))))) }, (Option*)(&_t47), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t47; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { string_to_sumtype_v__ast__ComptTimeConstValue(ADDR(string, (string__plus((*left._string), (*right._string))))) }, (_option*)(&_t47), sizeof(v__ast__ComptTimeConstValue)); return _t47; } else { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; }; } else if ((left)._typ == 13 /* u64 */ && (right)._typ == 8 /* i64 */) { switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t49; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) + ((i64)((*right._i64)))))) }, (Option*)(&_t49), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t49; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) + ((i64)((*right._i64)))))) }, (_option*)(&_t49), sizeof(v__ast__ComptTimeConstValue)); return _t49; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t50; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) - ((i64)((*right._i64)))))) }, (Option*)(&_t50), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t50; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) - ((i64)((*right._i64)))))) }, (_option*)(&_t50), sizeof(v__ast__ComptTimeConstValue)); return _t50; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t51; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) * ((i64)((*right._i64)))))) }, (Option*)(&_t51), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t51; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) * ((i64)((*right._i64)))))) }, (_option*)(&_t51), sizeof(v__ast__ComptTimeConstValue)); return _t51; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t52; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) / ((i64)((*right._i64)))))) }, (Option*)(&_t52), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t52; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) / ((i64)((*right._i64)))))) }, (_option*)(&_t52), sizeof(v__ast__ComptTimeConstValue)); return _t52; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t53; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) % ((i64)((*right._i64)))))) }, (Option*)(&_t53), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t53; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) % ((i64)((*right._i64)))))) }, (_option*)(&_t53), sizeof(v__ast__ComptTimeConstValue)); return _t53; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t54; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) ^ ((i64)((*right._i64))))))) }, (Option*)(&_t54), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t54; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) ^ ((i64)((*right._i64))))))) }, (_option*)(&_t54), sizeof(v__ast__ComptTimeConstValue)); return _t54; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t55; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) | ((i64)((*right._i64))))))) }, (Option*)(&_t55), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t55; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) | ((i64)((*right._i64))))))) }, (_option*)(&_t55), sizeof(v__ast__ComptTimeConstValue)); return _t55; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t56; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) & ((i64)((*right._i64))))))) }, (Option*)(&_t56), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t56; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) & ((i64)((*right._i64))))))) }, (_option*)(&_t56), sizeof(v__ast__ComptTimeConstValue)); return _t56; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t57; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._u64))) << ((i64)((*right._i64)))))))) }, (Option*)(&_t57), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t57; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._u64))) << ((i64)((*right._i64)))))))) }, (_option*)(&_t57), sizeof(v__ast__ComptTimeConstValue)); return _t57; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t58; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._u64))) >> ((i64)((*right._i64)))))))) }, (Option*)(&_t58), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t58; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._u64))) >> ((i64)((*right._i64)))))))) }, (_option*)(&_t58), sizeof(v__ast__ComptTimeConstValue)); return _t58; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t59; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._u64))))) >> ((i64)((*right._i64)))))))) }, (Option*)(&_t59), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t59; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._u64))))) >> ((i64)((*right._i64)))))))) }, (_option*)(&_t59), sizeof(v__ast__ComptTimeConstValue)); return _t59; break; } @@ -56806,7 +56894,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -56815,78 +56903,78 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t61; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) + ((i64)((*right._u64)))))) }, (Option*)(&_t61), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t61; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) + ((i64)((*right._u64)))))) }, (_option*)(&_t61), sizeof(v__ast__ComptTimeConstValue)); return _t61; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t62; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) - ((i64)((*right._u64)))))) }, (Option*)(&_t62), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t62; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) - ((i64)((*right._u64)))))) }, (_option*)(&_t62), sizeof(v__ast__ComptTimeConstValue)); return _t62; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t63; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) * ((i64)((*right._u64)))))) }, (Option*)(&_t63), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t63; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) * ((i64)((*right._u64)))))) }, (_option*)(&_t63), sizeof(v__ast__ComptTimeConstValue)); return _t63; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t64; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) / ((i64)((*right._u64)))))) }, (Option*)(&_t64), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t64; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) / ((i64)((*right._u64)))))) }, (_option*)(&_t64), sizeof(v__ast__ComptTimeConstValue)); return _t64; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t65; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) % ((i64)((*right._u64)))))) }, (Option*)(&_t65), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t65; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) % ((i64)((*right._u64)))))) }, (_option*)(&_t65), sizeof(v__ast__ComptTimeConstValue)); return _t65; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t66; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) ^ ((i64)((*right._u64))))))) }, (Option*)(&_t66), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t66; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) ^ ((i64)((*right._u64))))))) }, (_option*)(&_t66), sizeof(v__ast__ComptTimeConstValue)); return _t66; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t67; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) | ((i64)((*right._u64))))))) }, (Option*)(&_t67), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t67; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) | ((i64)((*right._u64))))))) }, (_option*)(&_t67), sizeof(v__ast__ComptTimeConstValue)); return _t67; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t68; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) & ((i64)((*right._u64))))))) }, (Option*)(&_t68), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t68; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) & ((i64)((*right._u64))))))) }, (_option*)(&_t68), sizeof(v__ast__ComptTimeConstValue)); return _t68; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t69; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) << ((i64)((*right._u64)))))))) }, (Option*)(&_t69), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t69; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) << ((i64)((*right._u64)))))))) }, (_option*)(&_t69), sizeof(v__ast__ComptTimeConstValue)); return _t69; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t70; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) >> ((i64)((*right._u64)))))))) }, (Option*)(&_t70), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t70; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) >> ((i64)((*right._u64)))))))) }, (_option*)(&_t70), sizeof(v__ast__ComptTimeConstValue)); return _t70; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t71; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._i64))))) >> ((i64)((*right._u64)))))))) }, (Option*)(&_t71), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t71; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._i64))))) >> ((i64)((*right._u64)))))))) }, (_option*)(&_t71), sizeof(v__ast__ComptTimeConstValue)); return _t71; break; } @@ -56996,7 +57084,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -57005,78 +57093,78 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t73; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) + (*right._u64)))) }, (Option*)(&_t73), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t73; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) + (*right._u64)))) }, (_option*)(&_t73), sizeof(v__ast__ComptTimeConstValue)); return _t73; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t74; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) - (*right._u64)))) }, (Option*)(&_t74), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t74; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) - (*right._u64)))) }, (_option*)(&_t74), sizeof(v__ast__ComptTimeConstValue)); return _t74; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t75; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) * (*right._u64)))) }, (Option*)(&_t75), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t75; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) * (*right._u64)))) }, (_option*)(&_t75), sizeof(v__ast__ComptTimeConstValue)); return _t75; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t76; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) / (*right._u64)))) }, (Option*)(&_t76), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t76; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) / (*right._u64)))) }, (_option*)(&_t76), sizeof(v__ast__ComptTimeConstValue)); return _t76; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t77; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) % (*right._u64)))) }, (Option*)(&_t77), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t77; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) % (*right._u64)))) }, (_option*)(&_t77), sizeof(v__ast__ComptTimeConstValue)); return _t77; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t78; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) ^ (*right._u64))))) }, (Option*)(&_t78), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t78; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) ^ (*right._u64))))) }, (_option*)(&_t78), sizeof(v__ast__ComptTimeConstValue)); return _t78; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t79; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) | (*right._u64))))) }, (Option*)(&_t79), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t79; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) | (*right._u64))))) }, (_option*)(&_t79), sizeof(v__ast__ComptTimeConstValue)); return _t79; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t80; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) & (*right._u64))))) }, (Option*)(&_t80), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t80; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) & (*right._u64))))) }, (_option*)(&_t80), sizeof(v__ast__ComptTimeConstValue)); return _t80; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t81; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) << (*right._u64)))) }, (Option*)(&_t81), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t81; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) << (*right._u64)))) }, (_option*)(&_t81), sizeof(v__ast__ComptTimeConstValue)); return _t81; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t82; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) >> (*right._u64)))) }, (Option*)(&_t82), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t82; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) >> (*right._u64)))) }, (_option*)(&_t82), sizeof(v__ast__ComptTimeConstValue)); return _t82; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t83; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((u64)((*left._u64))) >> (*right._u64)))) }, (Option*)(&_t83), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t83; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((u64)((*left._u64))) >> (*right._u64)))) }, (_option*)(&_t83), sizeof(v__ast__ComptTimeConstValue)); return _t83; break; } @@ -57186,7 +57274,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -57195,78 +57283,78 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t85; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) + (*right._i64)))) }, (Option*)(&_t85), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t85; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) + (*right._i64)))) }, (_option*)(&_t85), sizeof(v__ast__ComptTimeConstValue)); return _t85; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t86; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) - (*right._i64)))) }, (Option*)(&_t86), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t86; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) - (*right._i64)))) }, (_option*)(&_t86), sizeof(v__ast__ComptTimeConstValue)); return _t86; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t87; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) * (*right._i64)))) }, (Option*)(&_t87), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t87; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) * (*right._i64)))) }, (_option*)(&_t87), sizeof(v__ast__ComptTimeConstValue)); return _t87; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t88; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) / (*right._i64)))) }, (Option*)(&_t88), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t88; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) / (*right._i64)))) }, (_option*)(&_t88), sizeof(v__ast__ComptTimeConstValue)); return _t88; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t89; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) % (*right._i64)))) }, (Option*)(&_t89), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t89; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) % (*right._i64)))) }, (_option*)(&_t89), sizeof(v__ast__ComptTimeConstValue)); return _t89; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t90; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) ^ (*right._i64))))) }, (Option*)(&_t90), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t90; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) ^ (*right._i64))))) }, (_option*)(&_t90), sizeof(v__ast__ComptTimeConstValue)); return _t90; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t91; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) | (*right._i64))))) }, (Option*)(&_t91), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t91; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) | (*right._i64))))) }, (_option*)(&_t91), sizeof(v__ast__ComptTimeConstValue)); return _t91; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t92; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) & (*right._i64))))) }, (Option*)(&_t92), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t92; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) & (*right._i64))))) }, (_option*)(&_t92), sizeof(v__ast__ComptTimeConstValue)); return _t92; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t93; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) << (*right._i64)))))) }, (Option*)(&_t93), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t93; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) << (*right._i64)))))) }, (_option*)(&_t93), sizeof(v__ast__ComptTimeConstValue)); return _t93; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t94; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) >> (*right._i64)))))) }, (Option*)(&_t94), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t94; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) >> (*right._i64)))))) }, (_option*)(&_t94), sizeof(v__ast__ComptTimeConstValue)); return _t94; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t95; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._i64))))) >> (*right._i64)))))) }, (Option*)(&_t95), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t95; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._i64))))) >> (*right._i64)))))) }, (_option*)(&_t95), sizeof(v__ast__ComptTimeConstValue)); return _t95; break; } @@ -57376,7 +57464,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -57385,78 +57473,78 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t97; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) + (*right._u8)))) }, (Option*)(&_t97), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t97; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) + (*right._u8)))) }, (_option*)(&_t97), sizeof(v__ast__ComptTimeConstValue)); return _t97; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t98; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) - (*right._u8)))) }, (Option*)(&_t98), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t98; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) - (*right._u8)))) }, (_option*)(&_t98), sizeof(v__ast__ComptTimeConstValue)); return _t98; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t99; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) * (*right._u8)))) }, (Option*)(&_t99), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t99; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) * (*right._u8)))) }, (_option*)(&_t99), sizeof(v__ast__ComptTimeConstValue)); return _t99; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t100; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) / (*right._u8)))) }, (Option*)(&_t100), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t100; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) / (*right._u8)))) }, (_option*)(&_t100), sizeof(v__ast__ComptTimeConstValue)); return _t100; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t101; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) % (*right._u8)))) }, (Option*)(&_t101), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t101; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) % (*right._u8)))) }, (_option*)(&_t101), sizeof(v__ast__ComptTimeConstValue)); return _t101; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t102; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) ^ (*right._u8))))) }, (Option*)(&_t102), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t102; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) ^ (*right._u8))))) }, (_option*)(&_t102), sizeof(v__ast__ComptTimeConstValue)); return _t102; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t103; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) | (*right._u8))))) }, (Option*)(&_t103), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t103; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) | (*right._u8))))) }, (_option*)(&_t103), sizeof(v__ast__ComptTimeConstValue)); return _t103; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t104; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) & (*right._u8))))) }, (Option*)(&_t104), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t104; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) & (*right._u8))))) }, (_option*)(&_t104), sizeof(v__ast__ComptTimeConstValue)); return _t104; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t105; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) << (*right._u8)))) }, (Option*)(&_t105), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t105; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) << (*right._u8)))) }, (_option*)(&_t105), sizeof(v__ast__ComptTimeConstValue)); return _t105; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t106; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) >> (*right._u8)))) }, (Option*)(&_t106), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t106; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) >> (*right._u8)))) }, (_option*)(&_t106), sizeof(v__ast__ComptTimeConstValue)); return _t106; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t107; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((u8)((*left._u8))) >> (*right._u8)))) }, (Option*)(&_t107), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t107; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((u8)((*left._u8))) >> (*right._u8)))) }, (_option*)(&_t107), sizeof(v__ast__ComptTimeConstValue)); return _t107; break; } @@ -57566,7 +57654,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -57575,10 +57663,10 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp } else { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } ; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL multi_return_bool_int_int v__checker__Checker_verify_vweb_params_for_method(v__checker__Checker* c, v__ast__Fn node) { @@ -57645,7 +57733,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 == 267 /* v.ast.Ident */) { + if ((node->ct_expr)._typ == 268 /* 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); @@ -57682,15 +57770,15 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__ } VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime_if_branch(v__checker__Checker* c, v__ast__Expr cond, v__token__Pos pos) { - if (cond._typ == 251 /* v.ast.BoolLiteral */) { + if (cond._typ == 252 /* v.ast.BoolLiteral */) { v__checker__ComptimeBranchSkipState _t1 = ((*cond._v__ast__BoolLiteral).val ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); return _t1; } - else if (cond._typ == 282 /* v.ast.ParExpr */) { + else if (cond._typ == 283 /* v.ast.ParExpr */) { v__checker__ComptimeBranchSkipState _t2 = v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__ParExpr).expr, pos); return _t2; } - else if (cond._typ == 284 /* v.ast.PrefixExpr */) { + else if (cond._typ == 285 /* 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); } @@ -57698,17 +57786,17 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime v__checker__ComptimeBranchSkipState _t3 = (reversed == v__checker__ComptimeBranchSkipState__eval ? (v__checker__ComptimeBranchSkipState__skip) : reversed == v__checker__ComptimeBranchSkipState__skip ? (v__checker__ComptimeBranchSkipState__eval) : (reversed)); return _t3; } - else if (cond._typ == 283 /* v.ast.PostfixExpr */) { + else if (cond._typ == 284 /* 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 == 267 /* v.ast.Ident */) { + } else if (((*cond._v__ast__PostfixExpr).expr)._typ == 268 /* v.ast.Ident */) { v__checker__ComptimeBranchSkipState _t4 = (Array_string_contains(c->pref->compile_defines_all, (*(*cond._v__ast__PostfixExpr).expr._v__ast__Ident).name) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); return _t4; } else { v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__PostfixExpr).pos); } } - else if (cond._typ == 271 /* v.ast.InfixExpr */) { + else if (cond._typ == 272 /* v.ast.InfixExpr */) { if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__and)) { v__checker__ComptimeBranchSkipState l = v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__InfixExpr).left, (*cond._v__ast__InfixExpr).pos); @@ -57731,19 +57819,19 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime return _t8; } 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 == 293 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 293 /* v.ast.TypeNode */) { + if (((*cond._v__ast__InfixExpr).left)._typ == 294 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 294 /* 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); } v__checker__ComptimeBranchSkipState _t9 = v__checker__ComptimeBranchSkipState__unknown; return _t9; - } 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 */ ; + } else if (((*cond._v__ast__InfixExpr).left)._typ == 294 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 261 /* 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, 294) /*expected idx: 294, name: v.ast.TypeNode */ ; v__ast__Type checked_type = v__checker__Checker_unwrap_generic(c, left.typ); v__checker__ComptimeBranchSkipState _t10 = (v__ast__Table_is_comptime_type(c->table, checked_type, (*(*cond._v__ast__InfixExpr).right._v__ast__ComptimeType)) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); return _t10; - } else if (((*cond._v__ast__InfixExpr).left)._typ == 287 /* v.ast.SelectorExpr */ || ((*cond._v__ast__InfixExpr).left)._typ == 293 /* v.ast.TypeNode */) { + } else if (((*cond._v__ast__InfixExpr).left)._typ == 288 /* v.ast.SelectorExpr */ || ((*cond._v__ast__InfixExpr).left)._typ == 294 /* v.ast.TypeNode */) { v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).left); v__checker__ComptimeBranchSkipState _t11 = v__checker__ComptimeBranchSkipState__unknown; return _t11; @@ -57752,11 +57840,11 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime } } 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 == 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 */) { + if (((*cond._v__ast__InfixExpr).left)._typ == 288 /* v.ast.SelectorExpr */ && ((*cond._v__ast__InfixExpr).right)._typ == 273 /* v.ast.IntegerLiteral */) { + } else if (((*cond._v__ast__InfixExpr).left)._typ == 268 /* 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 _t12 = v__checker__Checker_find_definition(c, (*(*cond._v__ast__InfixExpr).left._v__ast__Ident)); + _option_v__ast__Expr _t12 = v__checker__Checker_find_definition(c, (*(*cond._v__ast__InfixExpr).left._v__ast__Ident)); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), (*(*cond._v__ast__InfixExpr).left._v__ast__Ident).pos); @@ -57781,7 +57869,7 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__InfixExpr).pos); }; } - else if (cond._typ == 267 /* v.ast.Ident */) { + else if (cond._typ == 268 /* 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_equal = true; @@ -57899,14 +57987,14 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime return _t40; } v__ast__Type typ = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, cond)); - 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 (((*cond._v__ast__Ident).obj)._typ != 326 /* v.ast.Var */ && ((*cond._v__ast__Ident).obj)._typ != 324 /* v.ast.ConstField */ && ((*cond._v__ast__Ident).obj)._typ != 325 /* v.ast.GlobalField */) { if (!c->inside_ct_attr) { 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); } v__checker__ComptimeBranchSkipState _t41 = v__checker__ComptimeBranchSkipState__unknown; return _t41; } - Option_v__ast__Expr _t42 = v__checker__Checker_find_obj_definition(c, (*cond._v__ast__Ident).obj); + _option_v__ast__Expr _t42 = v__checker__Checker_find_obj_definition(c, (*cond._v__ast__Ident).obj); if (_t42.state != 0) { /*or block*/ IError err = _t42.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), (*cond._v__ast__Ident).pos); @@ -57919,13 +58007,13 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime 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 `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("` used as $if condition"), 0, { .d_c = 0 }}})), (*cond._v__ast__Ident).pos); } - v__checker__ComptimeBranchSkipState _t44 = ((/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)._v__ast__BoolLiteral,(expr)._typ, 251) /*expected idx: 251, name: v.ast.BoolLiteral */ ).val ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); + v__checker__ComptimeBranchSkipState _t44 = ((/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)._v__ast__BoolLiteral,(expr)._typ, 252) /*expected idx: 252, name: v.ast.BoolLiteral */ ).val ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); return _t44; } } - else if (cond._typ == 258 /* v.ast.ComptimeCall */) { + else if (cond._typ == 259 /* v.ast.ComptimeCall */) { if ((*cond._v__ast__ComptimeCall).is_pkgconfig) { - Option_v__pkgconfig__Main_ptr _t45 = v__pkgconfig__main(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){string_clone((*cond._v__ast__ComptimeCall).args_var)}))); + _option_v__pkgconfig__Main_ptr _t45 = v__pkgconfig__main(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){string_clone((*cond._v__ast__ComptimeCall).args_var)}))); if (_t45.state != 0) { /*or block*/ IError err = _t45.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), (*cond._v__ast__ComptimeCall).pos); @@ -57934,7 +58022,7 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime } v__pkgconfig__Main* m = (*(v__pkgconfig__Main**)_t45.data); - Option_string _t47 = v__pkgconfig__Main_run(m); + _option_string _t47 = v__pkgconfig__Main_run(m); if (_t47.state != 0) { /*or block*/ IError err = _t47.err; v__checker__ComptimeBranchSkipState _t48 = v__checker__ComptimeBranchSkipState__skip; @@ -57961,7 +58049,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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, 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); @@ -57983,7 +58071,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra v__ast__Expr default_expr = node->default_expr; v__ast__Type default_typ = v__checker__Checker_check_expr_opt_call(c, default_expr, v__checker__Checker_expr(c, default_expr)); node->default_type = default_typ; - Option_void _t1 = v__checker__Checker_check_expected(c, default_typ, node->elem_type); + _option_void _t1 = v__checker__Checker_check_expected(c, default_typ, node->elem_type); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), v__ast__Expr_pos(default_expr)); @@ -58001,7 +58089,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra } v__checker__Checker_ensure_sumtype_array_has_default_value(c, *node); } - Option_void _t2 = v__checker__Checker_ensure_type_exists(c, node->elem_type, node->elem_type_pos); + _option_void _t2 = v__checker__Checker_ensure_type_exists(c, node->elem_type, node->elem_type_pos); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -58015,7 +58103,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra } if (node->is_fixed) { v__checker__Checker_ensure_sumtype_array_has_default_value(c, *node); - Option_void _t4 = v__checker__Checker_ensure_type_exists(c, node->elem_type, node->elem_type_pos); + _option_void _t4 = v__checker__Checker_ensure_type_exists(c, node->elem_type, node->elem_type_pos); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; } @@ -58094,13 +58182,13 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra c->expected_type = elem_type; continue; } - if ((expr)->_typ != 293 /* v.ast.TypeNode */) { + if ((expr)->_typ != 294 /* 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; } } - Option_void _t8 = v__checker__Checker_check_expected(c, typ, elem_type); + _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: "), /*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)); @@ -58130,15 +58218,15 @@ 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 == 272 /* v.ast.IntegerLiteral */) { + if (init_expr._typ == 273 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*init_expr._v__ast__IntegerLiteral).val); } - 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; + else if (init_expr._typ == 268 /* v.ast.Ident */) { + if (((*init_expr._v__ast__Ident).obj)._typ == 324 /* 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; - Option_i64 _t10 = v__ast__ComptTimeConstValue_i64(comptime_value); + _option_i64 _t10 = v__ast__ComptTimeConstValue_i64(comptime_value); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; *(i64*) _t10.data = fixed_size; @@ -58150,11 +58238,11 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra 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 == 271 /* v.ast.InfixExpr */) { - Option_v__ast__ComptTimeConstValue _t11; + else if (init_expr._typ == 272 /* 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; - Option_i64 _t12 = v__ast__ComptTimeConstValue_i64(comptime_value); + _option_i64 _t12 = v__ast__ComptTimeConstValue_i64(comptime_value); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; *(i64*) _t12.data = fixed_size; @@ -58224,7 +58312,7 @@ 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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, 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 `"), /*115 &string*/0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); @@ -58234,13 +58322,13 @@ v__ast__Type v__checker__Checker_map_init(v__checker__Checker* c, v__ast__MapIni } } } - Option_void _t3 = v__checker__Checker_ensure_type_exists(c, info.key_type, node->pos); + _option_void _t3 = v__checker__Checker_ensure_type_exists(c, info.key_type, node->pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; } ; - Option_void _t4 = v__checker__Checker_ensure_type_exists(c, info.value_type, node->pos); + _option_void _t4 = v__checker__Checker_ensure_type_exists(c, info.value_type, node->pos); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; } @@ -58373,7 +58461,7 @@ v__ast__Scope* prev_fn_scope; c->main_fn_decl_node = *node; } if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type)) { - Option_int _t3; + _option_int _t3; 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); @@ -58381,14 +58469,14 @@ v__ast__Scope* prev_fn_scope; } if (node->generic_names.len > 0) { v__ast__TypeSymbol* gs = v__ast__Table_sym(c->table, node->return_type); - if ((gs->info)._typ == 417 /* v.ast.Struct */) { + if ((gs->info)._typ == 418 /* 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 == 443 /* v.ast.MultiReturn */) { + if ((return_sym->info)._typ == 444 /* 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); @@ -58439,14 +58527,14 @@ 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 == 435 /* v.ast.Interface */) { + if ((sym->info)._typ == 436 /* 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 `"), /*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 == 417 /* v.ast.Struct */) { - Option_v__ast__StructField _t6; + if ((sym->info)._typ == 418 /* 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); @@ -58476,7 +58564,7 @@ v__ast__Scope* prev_fn_scope; if (node->language == v__ast__Language__v) { for (int _t7 = 0; _t7 < node->params.len; ++_t7) { v__ast__Param* param = ((v__ast__Param*)node->params.data) + _t7; - Option_void _t8 = v__checker__Checker_ensure_type_exists(c, param->typ, param->type_pos); + _option_void _t8 = v__checker__Checker_ensure_type_exists(c, param->typ, param->type_pos); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { IError err = _t8.err; // Defer begin @@ -58504,9 +58592,9 @@ 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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, name: v.ast.Struct */ ; if (info.is_heap) { - Option_v__ast__Var_ptr _t9 = v__ast__Scope_find_var(node->scope, param->name); + _option_v__ast__Var_ptr _t9 = v__ast__Scope_find_var(node->scope, param->name); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; continue; @@ -58519,12 +58607,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, 435) /*expected idx: 435, 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, 436) /*expected idx: 436, 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, 436) /*expected idx: 436, 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, 437) /*expected idx: 437, 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); } @@ -58544,7 +58632,7 @@ v__ast__Scope* prev_fn_scope; } } if (!v__ast__Type_alias_eq(node->return_type, ((v__ast__Type)(0)))) { - Option_void _t10 = v__checker__Checker_ensure_type_exists(c, node->return_type, node->return_type_pos); + _option_void _t10 = v__checker__Checker_ensure_type_exists(c, node->return_type, node->return_type_pos); if (_t10.state != 0 && _t10.err._typ != _IError_None___index) { IError err = _t10.err; // Defer begin @@ -58601,7 +58689,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 == 298 /* v.ast.AssertStmt */) { + if ((st)._typ == 299 /* 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; } @@ -58616,13 +58704,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 != 318 /* 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 != 319 /* 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 */)) { + 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 != 319 /* 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)),})))) })); @@ -58683,7 +58771,7 @@ bool keep_inside_anon; c->inside_anon_fn = true; for (int _t2 = 0; _t2 < node->inherited_vars.len; ++_t2) { v__ast__Param* var = ((v__ast__Param*)node->inherited_vars.data) + _t2; - Option_v__ast__Var_ptr _t3 = v__ast__Scope_find_var(node->decl.scope->parent, var->name); + _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 `"), /*115 &string*/0xfe10, {.d_s = var->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); @@ -58726,12 +58814,12 @@ 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 == 267 /* v.ast.Ident */ || (arg.expr)._typ == 291 /* v.ast.StringLiteral */ || (arg.expr)._typ == 287 /* v.ast.SelectorExpr */) { + if ((arg.expr)._typ == 268 /* v.ast.Ident */ || (arg.expr)._typ == 292 /* v.ast.StringLiteral */ || (arg.expr)._typ == 288 /* 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 == 267 /* v.ast.Ident */ || (node->left)._typ == 291 /* v.ast.StringLiteral */ || (node->left)._typ == 287 /* v.ast.SelectorExpr */)) { + if (v__ast__Type_alias_eq(node->receiver_type, _const_v__ast__string_type) && !((node->left)._typ == 268 /* v.ast.Ident */ || (node->left)._typ == 292 /* v.ast.StringLiteral */ || (node->left)._typ == 288 /* v.ast.SelectorExpr */)) { node->free_receiver = true; } } @@ -58795,7 +58883,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp return _t5; } c->table->cur_fn->has_await = true; - if (tsym->info._typ == 417 /* v.ast.Struct */) { + if (tsym->info._typ == 418 /* 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; @@ -58811,8 +58899,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp ; _v_panic(_SLIT("unreachable")); VUNREACHABLE(); - } - if (string__eq(fn_name, _SLIT("json.encode"))) { + } else if (string__eq(fn_name, _SLIT("json.encode"))) { } else if (string__eq(fn_name, _SLIT("json.decode")) && node->args.len > 0) { if (node->args.len != 2) { v__checker__Checker_error(c, _SLIT("json.decode expects 2 arguments, a type and a string (e.g `json.decode(T, '')`)"), node->pos); @@ -58820,9 +58907,17 @@ 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 == 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)) { + if ((expr)._typ == 294 /* v.ast.TypeNode */) { + v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, (*expr._v__ast__TypeNode).typ)); + if (v__ast__Table_known_type(c->table, sym->name) && sym->kind != v__ast__Kind__placeholder) { + v__ast__Kind kind = sym->kind; + if ((sym->info)._typ == 433 /* v.ast.Alias */) { + kind = v__ast__Table_sym(c->table, (*sym->info._v__ast__Alias).parent_type)->kind; + } + if (!(kind == v__ast__Kind__struct_ || kind == v__ast__Kind__sum_type || kind == v__ast__Kind__map || kind == v__ast__Kind__array)) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: expected sum type, struct, map or array, found "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(kind)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__TypeNode).pos); + } + } else { 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 { @@ -58836,7 +58931,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, 293) /*expected idx: 293, name: v.ast.TypeNode */ ; + v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast((expr)._v__ast__TypeNode,(expr)._typ, 294) /*expected idx: 294, 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; @@ -58845,18 +58940,18 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__Fn func = ((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}); bool found = false; bool found_in_args = false; - if ((node->left)._typ == 245 /* v.ast.AnonFn */) { + if ((node->left)._typ == 246 /* 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, 444) /*expected idx: 444, name: v.ast.FnType */ ).func; + func = (/* as */ *(v__ast__FnType*)__as_cast((anon_fn_sym->info)._v__ast__FnType,(anon_fn_sym->info)._typ, 445) /*expected idx: 445, 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, /*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; + _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; node->name = name_prefixed; @@ -58865,14 +58960,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){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,} })).usages++; } } - if (!found && (node->left)._typ == 270 /* v.ast.IndexExpr */) { + if (!found && (node->left)._typ == 271 /* 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, 270) /*expected idx: 270, name: v.ast.IndexExpr */ ; + v__ast__IndexExpr expr = /* as */ *(v__ast__IndexExpr*)__as_cast((node->left)._v__ast__IndexExpr,(node->left)._typ, 271) /*expected idx: 271, 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, info.elem_type); - if ((elem_sym->info)._typ == 444 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 445 /* 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; @@ -58880,9 +58975,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, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 414) /*expected idx: 414, name: v.ast.Map */ ; v__ast__TypeSymbol* value_sym = v__ast__Table_sym(c->table, info.value_type); - if ((value_sym->info)._typ == 444 /* v.ast.FnType */) { + if ((value_sym->info)._typ == 445 /* 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; @@ -58890,9 +58985,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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, info.elem_type); - if ((elem_sym->info)._typ == 444 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 445 /* 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; @@ -58904,19 +58999,19 @@ 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 == 253 /* v.ast.CallExpr */) { + if (!found && (node->left)._typ == 254 /* 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, 253) /*expected idx: 253, name: v.ast.CallExpr */ ; + v__ast__CallExpr expr = /* as */ *(v__ast__CallExpr*)__as_cast((node->left)._v__ast__CallExpr,(node->left)._typ, 254) /*expected idx: 254, 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, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 445) /*expected idx: 445, name: v.ast.FnType */ ; node->return_type = info.func.return_type; found = true; func = info.func; } } if (!found) { - Option_v__ast__Fn _t16; + _option_v__ast__Fn _t16; if (_t16 = v__ast__Table_find_fn(c->table, fn_name), _t16.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t16.data; found = true; @@ -58935,7 +59030,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."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); - Option_v__ast__Fn _t17; + _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; if (f.generic_names.len == node->concrete_types.len) { @@ -58954,15 +59049,15 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } if (!found) { int typ = 0; - Option_v__ast__ScopeObject _t19; + _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 == 324 /* v.ast.GlobalField */) { + if (obj._typ == 325 /* v.ast.GlobalField */) { typ = (*obj._v__ast__GlobalField).typ; node->is_fn_var = true; node->fn_var_type = typ; } - else if (obj._typ == 325 /* v.ast.Var */) { + else if (obj._typ == 326 /* 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)); @@ -58981,14 +59076,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, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((generic_vts->info)._v__ast__FnType,(generic_vts->info)._typ, 445) /*expected idx: 445, 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, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((vts->info)._v__ast__FnType,(vts->info)._typ, 445) /*expected idx: 445, name: v.ast.FnType */ ; func = info.func; found = true; found_in_args = true; @@ -58997,21 +59092,21 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } } if (!found) { - Option_v__ast__ScopeObject _t21; + _option_v__ast__ScopeObject _t21; if (_t21 = v__ast__Scope_find(c->file->global_scope, fn_name), _t21.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t21.data; if ((*(obj.typ)) != 0) { 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, 444) /*expected idx: 444, name: v.ast.FnType */ ).func; + func = (/* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 445) /*expected idx: 445, name: v.ast.FnType */ ).func; } } } } if (!found) { *continue_check = false; - Option_int _t22; + _option_int _t22; if (_t22 = string_index(fn_name, _SLIT(".")), _t22.state == 0) { int dot_index = *(int*)_t22.data; if (!u8_is_capital(string_at(fn_name, 0))) { @@ -59070,7 +59165,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } for (int _t30 = 0; _t30 < node->concrete_types.len; ++_t30) { v__ast__Type concrete_type = ((v__ast__Type*)node->concrete_types.data)[_t30]; - Option_void _t31 = v__checker__Checker_ensure_type_exists(c, concrete_type, node->concrete_list_pos); + _option_void _t31 = v__checker__Checker_ensure_type_exists(c, concrete_type, node->concrete_list_pos); if (_t31.state != 0 && _t31.err._typ != _IError_None___index) { IError err = _t31.err; } @@ -59086,7 +59181,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp node->should_be_skipped = v__checker__Checker_evaluate_once_comptime_if_attribute(c, (voidptr)&/*qq*/(*(v__ast__Attr*)/*ee elem_sym */array_get(func.attrs, func.ctdefine_idx))); } if (node->language != v__ast__Language__js) { - Option_void _t33 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/func); + _option_void _t33 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/func); if (_t33.state != 0 && _t33.err._typ != _IError_None___index) { IError err = _t33.err; v__ast__Type _t34 = func.return_type; @@ -59134,25 +59229,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 == 246 /* v.ast.ArrayDecompose */) { + if (func.is_variadic && (call_arg->expr)._typ == 247 /* 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 `"), /*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 == 276 /* v.ast.MapInit */ && e_sym->kind == v__ast__Kind__struct_) { + if ((call_arg->expr)._typ == 277 /* 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 == 292 /* v.ast.StructInit */ && e_sym->kind == v__ast__Kind__map) { + } else if ((call_arg->expr)._typ == 293 /* 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 == 267 /* v.ast.Ident */) { - if (((*call_arg->expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((call_arg->expr)._typ == 268 /* v.ast.Ident */) { + if (((*call_arg->expr._v__ast__Ident).obj)._typ == 326 /* 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; } } @@ -59167,9 +59262,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("function with `shared` arguments cannot be called inside `lock`/`rlock` block"), call_arg->pos); } if (call_arg->is_mut) { - multi_return_string_v__token__Pos mr_29125 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); - string to_lock = mr_29125.arg0; - v__token__Pos pos = mr_29125.arg1; + multi_return_string_v__token__Pos mr_29424 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); + string to_lock = mr_29424.arg0; + v__token__Pos pos = mr_29424.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)); } @@ -59194,8 +59289,8 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } 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 == 412 /* v.ast.Array */) { - final_param_typ = v__ast__TypeSymbol_array_info(param_typ_sym).elem_type; + if (func.is_variadic && (param_typ_sym->info)._typ == 413 /* v.ast.Array */) { + final_param_typ = (*param_typ_sym->info._v__ast__Array).elem_type; final_param_sym = v__ast__Table_sym(c->table, final_param_typ); } if (!v__ast__Type_alias_eq(call_arg->typ, param.typ) && (v__ast__Type_alias_eq(param.typ, _const_v__ast__voidptr_type) || final_param_sym->idx == _const_v__ast__voidptr_type_idx) && !v__ast__Type_is_any_kind_of_pointer(call_arg->typ) && func.language == v__ast__Language__v && !v__ast__Expr_is_lvalue(call_arg->expr) && !string__eq(func.name, _SLIT("json.encode")) && !c->pref->translated && !c->file->is_translated) { @@ -59209,7 +59304,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } continue; } - Option_void _t38 = v__checker__Checker_check_expected_call_arg(c, arg_typ, v__checker__Checker_unwrap_generic(c, param.typ), node->language, *call_arg); + _option_void _t38 = v__checker__Checker_check_expected_call_arg(c, arg_typ, v__checker__Checker_unwrap_generic(c, param.typ), node->language, *call_arg); if (_t38.state != 0 && _t38.err._typ != _IError_None___index) { IError err = _t38.err; if (arg_typ_sym->kind == v__ast__Kind__void && param_typ_sym->kind == v__ast__Kind__string) { @@ -59219,9 +59314,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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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; @@ -59251,7 +59346,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp if (param.typ == _const_v__ast__voidptr_type_idx || arg_typ == _const_v__ast__voidptr_type_idx) { continue; } - if ((arg_typ_sym->kind == v__ast__Kind__array_fixed && (param_is_number || v__ast__Type_is_any_kind_of_pointer(param.typ))) || (param_typ_sym->kind == v__ast__Kind__array_fixed && (typ_is_number || v__ast__Type_is_any_kind_of_pointer(arg_typ)))) { + if (((arg_typ_sym->kind == v__ast__Kind__array_fixed || arg_typ_sym->kind == v__ast__Kind__array) && (param_is_number || v__ast__Type_is_any_kind_of_pointer(param.typ))) || ((param_typ_sym->kind == v__ast__Kind__array_fixed || param_typ_sym->kind == v__ast__Kind__array) && (typ_is_number || v__ast__Type_is_any_kind_of_pointer(arg_typ)))) { continue; } if (v__ast__Type_is_any_kind_of_pointer(param.typ) && typ_is_number) { @@ -59281,7 +59376,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp c->expected_type = param.typ; v__ast__Type typ = v__checker__Checker_check_expr_opt_call(c, call_arg->expr, v__checker__Checker_expr(c, call_arg->expr)); if (v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__generic) && func.generic_names.len == node->concrete_types.len) { - Option_v__ast__Type _t39; + _option_v__ast__Type _t39; if (_t39 = v__ast__Table_resolve_generic_to_concrete(c->table, param.typ, func.generic_names, concrete_types), _t39.state == 0) { v__ast__Type unwrap_typ = *(v__ast__Type*)_t39.data; v__ast__Type utyp = v__checker__Checker_unwrap_generic(c, typ); @@ -59294,7 +59389,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } continue; } - Option_void _t40 = v__checker__Checker_check_expected_call_arg(c, utyp, unwrap_typ, node->language, *call_arg); + _option_void _t40 = v__checker__Checker_check_expected_call_arg(c, utyp, unwrap_typ, node->language, *call_arg); if (_t40.state != 0 && _t40.err._typ != _IError_None___index) { IError err = _t40.err; if (c->comptime_fields_type.len > 0) { @@ -59315,7 +59410,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp node->return_type = func.return_type; } if (node->concrete_types.len > 0 && func.return_type != 0 && c->table->cur_fn->generic_names.len == 0) { - Option_v__ast__Type _t41; + _option_v__ast__Type _t41; if (_t41 = v__ast__Table_resolve_generic_to_concrete(c->table, func.return_type, func.generic_names, concrete_types), _t41.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t41.data; node->return_type = typ; @@ -59327,9 +59422,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("a non generic function called like a generic one"), node->concrete_list_pos); } if (func.generic_names.len > 0) { - Option_v__ast__Type _t43; + _option_v__ast__Type _t43; if (has_generic) { - Option_v__ast__Type _t44; + _option_v__ast__Type _t44; if (_t44 = v__ast__Table_resolve_generic_to_concrete(c->table, func.return_type, func.generic_names, node->concrete_types), _t44.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t44.data; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { @@ -59364,7 +59459,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__TypeSymbol* final_left_sym = v__ast__Table_final_sym(c->table, unwrapped_left_type); string method_name = node->name; string _t1; /* if prepend */ - Option_v__ast__StructField _t2; + _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 `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` did you mean to access the field with the same name instead?"), 0, { .d_c = 0 }}})); @@ -59395,12 +59490,12 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (left_sym->kind == v__ast__Kind__array && Array_string_contains(_const_v__checker__array_builtin_methods, method_name)) { v__ast__Type _t7 = v__checker__Checker_array_builtin_method_call(c, node, left_type, *v__ast__Table_sym(c->table, left_type)); return _t7; - } else if ((left_sym->kind == v__ast__Kind__map || final_left_sym->kind == v__ast__Kind__map) && (string__eq(method_name, _SLIT("clone")) || string__eq(method_name, _SLIT("keys")) || string__eq(method_name, _SLIT("move")) || string__eq(method_name, _SLIT("delete")))) { + } else if ((left_sym->kind == v__ast__Kind__map || final_left_sym->kind == v__ast__Kind__map) && (string__eq(method_name, _SLIT("clone")) || string__eq(method_name, _SLIT("keys")) || string__eq(method_name, _SLIT("values")) || string__eq(method_name, _SLIT("move")) || string__eq(method_name, _SLIT("delete")))) { if (left_sym->kind == v__ast__Kind__map) { v__ast__Type _t8 = v__checker__Checker_map_builtin_method_call(c, node, left_type, *left_sym); return _t8; } else { - 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 parent_type = (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type; v__ast__Type _t9 = v__checker__Checker_map_builtin_method_call(c, node, parent_type, *final_left_sym); return _t9; } @@ -59425,7 +59520,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal return _t12; } } - 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__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 413) /*expected idx: 413, 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); @@ -59433,13 +59528,13 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal 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 == 412 /* v.ast.Array */) { + if ((final_left_sym->info)._typ == 413 /* v.ast.Array */) { node->return_type = (*final_left_sym->info._v__ast__Array).elem_type; v__ast__Type _t13 = node->return_type; return _t13; } } 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 418) /*expected idx: 418, 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); } @@ -59449,7 +59544,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Type _t14 = node->return_type; return _t14; } 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, 442) /*expected idx: 442, name: v.ast.Thread */ ; + v__ast__Thread info = /* as */ *(v__ast__Thread*)__as_cast((left_sym->info)._v__ast__Thread,(left_sym->info)._typ, 443) /*expected idx: 443, 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); } @@ -59464,7 +59559,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Fn method = ((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}); bool has_method = false; bool is_method_from_embed = false; - Option_v__ast__Fn _t17; + _option_v__ast__Fn _t17; if (_t17 = v__ast__Table_find_method(c->table, left_sym, method_name), _t17.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t17.data; method = m; @@ -59473,16 +59568,16 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal IError err = _t17.err; if (left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_) { v__ast__Type parent_type = _const_v__ast__void_type; - if ((left_sym->info)._typ == 417 /* v.ast.Struct */) { + if ((left_sym->info)._typ == 418 /* v.ast.Struct */) { parent_type = (*left_sym->info._v__ast__Struct).parent_type; - } else if ((left_sym->info)._typ == 436 /* v.ast.SumType */) { + } else if ((left_sym->info)._typ == 437 /* v.ast.SumType */) { parent_type = (*left_sym->info._v__ast__SumType).parent_type; - } else if ((left_sym->info)._typ == 435 /* v.ast.Interface */) { + } else if ((left_sym->info)._typ == 436 /* v.ast.Interface */) { parent_type = (*left_sym->info._v__ast__Interface).parent_type; } if (parent_type != 0) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, parent_type); - Option_v__ast__Fn _t18; + _option_v__ast__Fn _t18; if (_t18 = v__ast__Table_find_method(c->table, type_sym, method_name), _t18.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t18.data; method = m; @@ -59494,7 +59589,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (!has_method) { has_method = true; Array_v__ast__Type embed_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t19 = v__ast__Table_find_method_from_embeds(c->table, left_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t19 = v__ast__Table_find_method_from_embeds(c->table, left_sym, method_name); if (_t19.state != 0) { /*or block*/ IError err = _t19.err; if ((IError_name_table[err._typ]._method_msg(err._object)).len != 0) { @@ -59504,9 +59599,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*) _t19.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_42435 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t19.data); - method = mr_42435.arg0; - embed_types = mr_42435.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_42802 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t19.data); + method = mr_42802.arg0; + embed_types = mr_42802.arg1; if (embed_types.len != 0) { is_method_from_embed = true; node->from_embed_types = embed_types; @@ -59519,8 +59614,10 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (has_method) { v__ast__TypeSymbol* rec_sym = v__ast__Table_sym(c->table, node->left_type); bool rec_is_generic = v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic); - if ((rec_sym->info)._typ == 417 /* v.ast.Struct */) { - if (rec_is_generic && node->concrete_types.len == 0) { + Array_v__ast__Type rec_concrete_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); + if ((rec_sym->info)._typ == 418 /* v.ast.Struct */) { + rec_concrete_types = array_clone_to_depth(&(*rec_sym->info._v__ast__Struct).concrete_types, 0); + if (rec_is_generic && node->concrete_types.len == 0 && method.generic_names.len == (*rec_sym->info._v__ast__Struct).generic_types.len) { node->concrete_types = (*rec_sym->info._v__ast__Struct).generic_types; } else if (!rec_is_generic && (*rec_sym->info._v__ast__Struct).concrete_types.len > 0 && node->concrete_types.len > 0 && (*rec_sym->info._v__ast__Struct).concrete_types.len + node->concrete_types.len == method.generic_names.len) { Array_v__ast__Type t_concrete_types = array_clone_to_depth(&node->concrete_types, 0); @@ -59552,9 +59649,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__checker__Checker_error(c, _SLIT("method with `shared` receiver cannot be called inside `lock`/`rlock` block"), node->pos); } if ((*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).is_mut) { - multi_return_string_v__token__Pos mr_44578 = v__checker__Checker_fail_if_immutable(c, node->left); - string to_lock = mr_44578.arg0; - v__token__Pos pos = mr_44578.arg1; + multi_return_string_v__token__Pos mr_45112 = v__checker__Checker_fail_if_immutable(c, node->left); + string to_lock = mr_45112.arg0; + v__token__Pos pos = mr_45112.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)); } @@ -59573,7 +59670,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } for (int _t24 = 0; _t24 < node->concrete_types.len; ++_t24) { v__ast__Type concrete_type = ((v__ast__Type*)node->concrete_types.data)[_t24]; - Option_void _t25 = v__checker__Checker_ensure_type_exists(c, concrete_type, node->concrete_list_pos); + _option_void _t25 = v__checker__Checker_ensure_type_exists(c, concrete_type, node->concrete_list_pos); if (_t25.state != 0 && _t25.err._typ != _IError_None___index) { IError err = _t25.err; } @@ -59583,7 +59680,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (v__ast__Type_alias_eq(method.return_type, _const_v__ast__void_type) && method.is_conditional && method.ctdefine_idx != _const_v__ast__invalid_type_idx) { node->should_be_skipped = v__checker__Checker_evaluate_once_comptime_if_attribute(c, (voidptr)&/*qq*/(*(v__ast__Attr*)/*ee elem_sym */array_get(method.attrs, method.ctdefine_idx))); } - Option_void _t26 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/method); + _option_void _t26 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/method); if (_t26.state != 0 && _t26.err._typ != _IError_None___index) { IError err = _t26.err; v__ast__Type _t27 = method.return_type; @@ -59595,7 +59692,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, 441) /*expected idx: 441, 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, 442) /*expected idx: 442, 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"))) { @@ -59625,13 +59722,14 @@ 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 == 412 /* v.ast.Array */) { + if (method.is_variadic && (exp_arg_sym->info)._typ == 413 /* 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); } if (v__ast__Type_has_flag(exp_arg_typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t28; - if (_t28 = v__ast__Table_resolve_generic_to_concrete(c->table, exp_arg_typ, method.generic_names, concrete_types), _t28.state == 0) { + Array_v__ast__Type method_concrete_types = (method.generic_names.len == rec_concrete_types.len ? (rec_concrete_types) : (concrete_types)); + _option_v__ast__Type _t28; + if (_t28 = v__ast__Table_resolve_generic_to_concrete(c->table, exp_arg_typ, method.generic_names, method_concrete_types), _t28.state == 0) { v__ast__Type exp_utyp = *(v__ast__Type*)_t28.data; exp_arg_typ = exp_utyp; } else { @@ -59639,8 +59737,8 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal continue; } if (v__ast__Type_has_flag(got_arg_typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t29; - if (_t29 = v__ast__Table_resolve_generic_to_concrete(c->table, got_arg_typ, method.generic_names, concrete_types), _t29.state == 0) { + _option_v__ast__Type _t29; + if (_t29 = v__ast__Table_resolve_generic_to_concrete(c->table, got_arg_typ, method.generic_names, method_concrete_types), _t29.state == 0) { v__ast__Type got_utyp = *(v__ast__Type*)_t29.data; got_arg_typ = got_utyp; } else { @@ -59656,9 +59754,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__checker__Checker_error(c, _SLIT("method with `shared` arguments cannot be called inside `lock`/`rlock` block"), arg->pos); } if (arg->is_mut) { - multi_return_string_v__token__Pos mr_48547 = v__checker__Checker_fail_if_immutable(c, arg->expr); - string to_lock = mr_48547.arg0; - v__token__Pos pos = mr_48547.arg1; + multi_return_string_v__token__Pos mr_49074 = v__checker__Checker_fail_if_immutable(c, arg->expr); + string to_lock = mr_49074.arg0; + v__token__Pos pos = mr_49074.arg1; if (!param_is_mut) { string tok = v__ast__ShareType_str(arg->share); v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` is not `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("`, `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("` is not needed`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); @@ -59679,11 +59777,11 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } } 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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, 444) /*expected idx: 444, 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, 445) /*expected idx: 445, 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); @@ -59709,15 +59807,15 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } continue; } - Option_void _t30 = v__checker__Checker_check_expected_call_arg(c, got_arg_typ, exp_arg_typ, node->language, *arg); + _option_void _t30 = v__checker__Checker_check_expected_call_arg(c, got_arg_typ, exp_arg_typ, node->language, *arg); if (_t30.state != 0 && _t30.err._typ != _IError_None___index) { IError err = _t30.err; 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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; @@ -59763,7 +59861,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal node->return_type = method.return_type; } if (node->concrete_types.len > 0 && method.return_type != 0 && c->table->cur_fn->generic_names.len == 0) { - Option_v__ast__Type _t32; + _option_v__ast__Type _t32; if (_t32 = v__ast__Table_resolve_generic_to_concrete(c->table, method.return_type, method.generic_names, concrete_types), _t32.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t32.data; node->return_type = typ; @@ -59776,7 +59874,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 == 417 /* v.ast.Struct */) { + if ((left_sym->info)._typ == 418 /* 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; } @@ -59805,15 +59903,15 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Type _t37 = _const_v__ast__void_type; return _t37; } - Option_v__ast__StructField _t38; + _option_v__ast__StructField _t38; if (_t38 = v__ast__Table_find_field_with_embeds(c->table, left_sym, method_name), _t38.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t38.data; v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, field.typ)); 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, 444) /*expected idx: 444, name: v.ast.FnType */ ; - Option_void _t39 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/info.func); + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 445) /*expected idx: 445, name: v.ast.FnType */ ; + _option_void _t39 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/info.func); if (_t39.state != 0 && _t39.err._typ != _IError_None___index) { IError err = _t39.err; v__ast__Type _t40 = info.func.return_type; @@ -59830,7 +59928,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal array_push((array*)&earg_types, _MOV((v__ast__Type[]){ targ })); if (i < info.func.params.len) { v__ast__Type exp_arg_typ = (*(v__ast__Param*)/*ee elem_sym */array_get(info.func.params, i)).typ; - Option_void _t42 = v__checker__Checker_check_expected_call_arg(c, targ, v__checker__Checker_unwrap_generic(c, exp_arg_typ), node->language, *arg); + _option_void _t42 = v__checker__Checker_check_expected_call_arg(c, targ, v__checker__Checker_unwrap_generic(c, exp_arg_typ), node->language, *arg); if (_t42.state != 0 && _t42.err._typ != _IError_None___index) { IError err = _t42.err; if (!v__ast__Type_alias_eq(targ, _const_v__ast__void_type)) { @@ -59844,15 +59942,15 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } node->expected_arg_types = earg_types; node->is_method = true; - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t43 = v__ast__Table_find_field_from_embeds(c->table, left_sym, method_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t43 = v__ast__Table_find_field_from_embeds(c->table, left_sym, method_name); if (_t43.state != 0) { /*or block*/ IError err = _t43.err; v__ast__Type _t44 = info.func.return_type; return _t44; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_56012 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t43.data); - node->from_embed_types = mr_56012.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_56539 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t43.data); + node->from_embed_types = mr_56539.arg1; v__ast__Type _t45 = info.func.return_type; return _t45; } @@ -59909,7 +60007,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_deprecate_fnmethod(v__checker__Checker* deprecation_message = attr.arg; } if (string__eq(attr.name, _SLIT("deprecated_after")) && (attr.arg).len != 0) { - Option_time__Time _t2 = time__parse_iso8601(attr.arg); + _option_time__Time _t2 = time__parse_iso8601(attr.arg); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; v__checker__Checker_error(c, _SLIT("invalid time format"), attr.pos); @@ -59980,7 +60078,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_post_process_generic_fns(v__checker__Ch } } -Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Fn* f) { +_option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Fn* f) { int nr_args = node->args.len; int nr_params = (node->is_method && f->params.len > 0 ? (f->params.len - 1) : (f->params.len)); int min_required_params = f->params.len; @@ -59997,7 +60095,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 == 417 /* v.ast.Struct */) { + if ((last_sym->info)._typ == 418 /* 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; @@ -60012,18 +60110,18 @@ Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, bool is_params =_t1.len > 0; if (is_params) { array_push((array*)&node->args, _MOV((v__ast__CallArg[]){ ((v__ast__CallArg){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.expr = v__ast__StructInit_to_sumtype_v__ast__Expr(ADDR(v__ast__StructInit, (((v__ast__StructInit){.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.update_expr_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.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)),.typ_str = (string){.str=(byteptr)"", .is_lit=1},.update_expr = {0},.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,},.typ = last_typ,.update_expr_type = 0,.is_short = 0,.is_short_syntax = 0,.unresolved = 0,.is_update_embed = 0,.has_update_expr = 0,})))),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ = 0,.share = 0,.is_mut = 0,.is_tmp_autofree = 0,}) })); - return (Option_void){0}; + return (_option_void){0}; } } } 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} }; + 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 "), /*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){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } 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) { @@ -60033,7 +60131,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke } 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 == 245 /* v.ast.AnonFn */) { + if (arg_expr._typ == 246 /* 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))) { @@ -60042,9 +60140,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke 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 == 267 /* v.ast.Ident */) { + else if (arg_expr._typ == 268 /* 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); + _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, /*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); @@ -60060,9 +60158,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke 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 == 325 /* v.ast.Var */) { + if (((*arg_expr._v__ast__Ident).obj)._typ == 326 /* v.ast.Var */) { v__ast__Expr expr = (*(*arg_expr._v__ast__Ident).obj._v__ast__Var).expr; - if ((expr)._typ == 245 /* v.ast.AnonFn */) { + if ((expr)._typ == 246 /* 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))) { @@ -60078,7 +60176,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke } } } - else if (arg_expr._typ == 253 /* v.ast.CallExpr */) { + else if (arg_expr._typ == 254 /* 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, `"), /*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)) { @@ -60088,12 +60186,12 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke 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); } } - else if (arg_expr._typ == 291 /* v.ast.StringLiteral */) { + else if (arg_expr._typ == 292 /* v.ast.StringLiteral */) { if (!is_map) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use e.g. `"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("(it > 2)`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__StringLiteral).pos); } } - else if (arg_expr._typ == 290 /* v.ast.StringInterLiteral */) { + else if (arg_expr._typ == 291 /* v.ast.StringInterLiteral */) { if (!is_map) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use e.g. `"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("(it > 2)`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__StringInterLiteral).pos); } @@ -60122,12 +60220,12 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__chec } ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__shared_f); } - else if (string__eq(method_name, _SLIT("keys"))) { + else if (string__eq(method_name, _SLIT("keys")) || string__eq(method_name, _SLIT("values"))) { 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__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); } - 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); + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 414) /*expected idx: 414, name: v.ast.Map */ ; + int typ = (string__eq(method_name, _SLIT("keys")) ? (v__ast__Table_find_or_register_array(c->table, info.key_type)) : (v__ast__Table_find_or_register_array(c->table, info.value_type))); ret_type = ((typ)); } else if (string__eq(method_name, _SLIT("delete"))) { @@ -60135,9 +60233,9 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__chec if (node->args.len != 1) { 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, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 414) /*expected idx: 414, 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))); + _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, /*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); @@ -60160,12 +60258,12 @@ 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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 == 253 /* v.ast.CallExpr */) { + if ((node->left)._typ == 254 /* 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); @@ -60173,7 +60271,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch if (node->args.len > 1) { 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 == 271 /* v.ast.InfixExpr */) { + if (((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr)._typ == 272 /* 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); } @@ -60184,7 +60282,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch } 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 != 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 */)) { + if ((((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 268 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 288 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 271 /* v.ast.IndexExpr */) || (((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 268 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 288 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 271 /* 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 { @@ -60216,7 +60314,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 == 444 /* v.ast.FnType */) ? ((*arg_sym->info._v__ast__FnType).func.return_type) : (arg_type)); + v__ast__Type ret_type = ((arg_sym->info._typ == 445 /* 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)); @@ -60253,7 +60351,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch 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))); + _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, /*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); @@ -60268,7 +60366,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch 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))); + _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, /*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); @@ -60311,10 +60409,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 == 299 /* v.ast.AssignStmt */) { + if ((node.inc)._typ == 300 /* 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 == 253 /* v.ast.CallExpr */) { + if ((right)._typ == 254 /* 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); } @@ -60368,7 +60466,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_in_stmt(v__checker__Checker* c, v__ } else { v__ast__TypeSymbol* sym = v__ast__Table_final_sym(c->table, typ); if (sym->kind == v__ast__Kind__struct_) { - Option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(sym, _SLIT("next")); + _option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(sym, _SLIT("next")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__checker__Checker_error(c, _SLIT("a struct must have a `next()` method to be an iterator"), v__ast__Expr_pos(node->cond)); @@ -60416,29 +60514,29 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_in_stmt(v__checker__Checker* c, v__ } if (node->val_is_mut) { value_type = v__ast__Type_ref(value_type); - if (node->cond._typ == 267 /* v.ast.Ident */) { - if (((*node->cond._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if (node->cond._typ == 268 /* v.ast.Ident */) { + if (((*node->cond._v__ast__Ident).obj)._typ == 326 /* 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("`"), /*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 == 247 /* v.ast.ArrayInit */) { + else if (node->cond._typ == 248 /* 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 == 276 /* v.ast.MapInit */) { + else if (node->cond._typ == 277 /* 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 == 287 /* v.ast.SelectorExpr */) { - Option_v__ast__Ident _t2 = v__ast__SelectorExpr_root_ident(&(*node->cond._v__ast__SelectorExpr)); + else if (node->cond._typ == 288 /* 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, 267) /*expected idx: 267, 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, 268) /*expected idx: 268, 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, 325) /*expected idx: 325, name: v.ast.Var */ ).is_mut) { + if (!(/* as */ *(v__ast__Var*)__as_cast((root_ident.obj)._v__ast__Var,(root_ident.obj)._typ, 326) /*expected idx: 326, 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); } } @@ -60468,9 +60566,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 == 271 /* v.ast.InfixExpr */) { + if ((node->cond)._typ == 272 /* v.ast.InfixExpr */) { if ((*node->cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - 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 (((*node->cond._v__ast__InfixExpr).right)._typ == 294 /* v.ast.TypeNode */ && (((*node->cond._v__ast__InfixExpr).left)._typ == 268 /* v.ast.Ident */ || ((*node->cond._v__ast__InfixExpr).left)._typ == 288 /* 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); } @@ -60492,7 +60590,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 == 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)) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 308 /* 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, 308) /*expected idx: 308, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { node_is_expr = true; } } @@ -60513,7 +60611,7 @@ 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 == 282 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { + if ((branch.cond)._typ == 283 /* 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) { @@ -60530,9 +60628,9 @@ bool v__checker__Checker_if_expr_defer_0 = false; } if (node->is_comptime) { string comptime_field_name = _SLIT(""); - if ((branch.cond)._typ == 271 /* v.ast.InfixExpr */) { + if ((branch.cond)._typ == 272 /* v.ast.InfixExpr */) { if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - if (((*branch.cond._v__ast__InfixExpr).right)._typ != 293 /* v.ast.TypeNode */ && ((*branch.cond._v__ast__InfixExpr).right)._typ != 260 /* v.ast.ComptimeType */) { + if (((*branch.cond._v__ast__InfixExpr).right)._typ != 294 /* v.ast.TypeNode */ && ((*branch.cond._v__ast__InfixExpr).right)._typ != 261 /* 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 @@ -60543,25 +60641,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 == 260 /* v.ast.ComptimeType */ && (left)._typ == 293 /* v.ast.TypeNode */) { + if (((*branch.cond._v__ast__InfixExpr).right)._typ == 261 /* v.ast.ComptimeType */ && (left)._typ == 294 /* 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); - skip_state = (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 */ ) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); + skip_state = (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, 261) /*expected idx: 261, name: v.ast.ComptimeType */ ) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); } 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, 293) /*expected idx: 293, 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, 294) /*expected idx: 294, 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 `"), /*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 == 287 /* v.ast.SelectorExpr */) { + if ((left)._typ == 288 /* 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 == 293 /* v.ast.TypeNode */ && (left)._typ == 293 /* v.ast.TypeNode */ && sym->kind == v__ast__Kind__interface_) { + } else if (((*branch.cond._v__ast__InfixExpr).right)._typ == 294 /* v.ast.TypeNode */ && (left)._typ == 294 /* 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); skip_state = (v__ast__Table_does_type_implement_interface(c->table, checked_type, got_type) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); - } else if ((left)._typ == 293 /* v.ast.TypeNode */) { + } else if ((left)._typ == 294 /* 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); skip_state = (v__ast__Type_alias_eq(left_type, got_type) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); @@ -60591,7 +60689,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 == 267 /* v.ast.Ident */) { + if ((branch.cond)._typ == 268 /* v.ast.Ident */) { if (string__eq((*branch.cond._v__ast__Ident).name, _SLIT("freestanding"))) { is_freestanding_block = true; } @@ -60626,8 +60724,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 == 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 */ ; + if (branch.stmts.len > 0 && ((*(v__ast__Stmt*)array_last(branch.stmts)))._typ == 308 /* 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, 308) /*expected idx: 308, 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)) { @@ -60692,7 +60790,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; } 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); + _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 "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); @@ -60702,10 +60800,10 @@ bool v__checker__Checker_if_expr_defer_0 = false; ; } } - if ((branch.cond)._typ == 269 /* v.ast.IfGuardExpr */) { + if ((branch.cond)._typ == 270 /* 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, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 444) /*expected idx: 444, 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 "), /*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 { @@ -60716,7 +60814,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; } } } - Option_bool _t5; + _option_bool _t5; if (_t5 = v__checker__Checker_has_return(c, branch.stmts), _t5.state == 0) { bool has_return = *(bool*)_t5.data; if (has_return) { @@ -60756,17 +60854,17 @@ 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 == 271 /* v.ast.InfixExpr */) { + if ((node)._typ == 272 /* 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 == 293 /* v.ast.TypeNode */) { + if (right_expr._typ == 294 /* v.ast.TypeNode */) { _t1 = (*right_expr._v__ast__TypeNode).typ; } - else if (right_expr._typ == 279 /* v.ast.None */) { + else if (right_expr._typ == 280 /* v.ast.None */) { _t1 = _const_v__ast__none_type_idx; } @@ -60780,7 +60878,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, 430) /*expected idx: 430, name: v.ast.Aggregate */ ).sum_type; + expr_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 431) /*expected idx: 431, name: v.ast.Aggregate */ ).sum_type; } if (left_sym->kind == v__ast__Kind__interface_) { if (right_sym->kind != v__ast__Kind__interface_) { @@ -60793,10 +60891,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* 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 `"), /*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 == 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 ((((*node._v__ast__InfixExpr).left)._typ == 268 /* v.ast.Ident */ || ((*node._v__ast__InfixExpr).left)._typ == 288 /* v.ast.SelectorExpr */) && ((*node._v__ast__InfixExpr).right)._typ == 294 /* v.ast.TypeNode */) { + bool is_variable = (((*node._v__ast__InfixExpr).left)._typ == 268 /* 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 == 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)) { + if ((((*node._v__ast__InfixExpr).left)._typ == 268 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__Ident,((*node._v__ast__InfixExpr).left)._typ, 268) /*expected idx: 268, name: v.ast.Ident */ ).is_mut) || (((*node._v__ast__InfixExpr).left)._typ == 288 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__SelectorExpr,((*node._v__ast__InfixExpr).left)._typ, 288) /*expected idx: 288, 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) { @@ -60806,7 +60904,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* } } } - } else if ((node)._typ == 274 /* v.ast.Likely */) { + } else if ((node)._typ == 275 /* v.ast.Likely */) { v__checker__Checker_smartcast_if_conds(c, (*node._v__ast__Likely).expr, scope); } } @@ -60815,7 +60913,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 == 435 /* v.ast.Interface */) { + if ((decl_sym->info)._typ == 436 /* 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; @@ -60842,7 +60940,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac 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, 435) /*expected idx: 435, name: v.ast.Interface */ ; + v__ast__Interface isym_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 436) /*expected idx: 436, 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 }))) { @@ -60865,7 +60963,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac } } v__ast__InterfaceDecl* _t9 = (v__ast__InterfaceDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, c->table->interfaces), &(int[]){embed.typ})); - Option_v__ast__InterfaceDecl _t8 = {0}; + _option_v__ast__InterfaceDecl _t8 = {0}; if (_t9) { *((v__ast__InterfaceDecl*)&_t8.data) = *((v__ast__InterfaceDecl*)_t9); } else { @@ -60878,7 +60976,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__ast__StructField f = ((v__ast__StructField*)embed_decl.fields.data)[_t10]; if (_IN_MAP(ADDR(string, f.name), ADDR(map, efnames))) { v__ast__StructField ifield = (*(v__ast__StructField*)/*ee elem_sym */array_get(node->fields, (*(int*)map_get(ADDR(map, efnames), &(string[]){f.name}, &(int[]){ 0 })))); - Option_v__ast__StructField _t11; + _option_v__ast__StructField _t11; if (_t11 = v__ast__Table_find_field_with_embeds(c->table, isym, f.name), _t11.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t11.data; if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { @@ -60896,10 +60994,10 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__ast__FnDecl m = ((v__ast__FnDecl*)embed_decl.methods.data)[_t13]; if (_IN_MAP(ADDR(string, m.name), ADDR(map, emnames))) { v__ast__FnDecl imethod = (*(v__ast__FnDecl*)/*ee elem_sym */array_get(node->methods, (*(int*)map_get(ADDR(map, emnames), &(string[]){m.name}, &(int[]){ 0 })))); - Option_v__ast__Fn _t14; + _option_v__ast__Fn _t14; if (_t14 = v__ast__TypeSymbol_find_method(decl_sym, imethod.name), _t14.state == 0) { v__ast__Fn em_fn = *(v__ast__Fn*)_t14.data; - Option_v__ast__Fn _t15; + _option_v__ast__Fn _t15; if (_t15 = v__ast__TypeSymbol_find_method(isym, m.name), _t15.state == 0) { v__ast__Fn m_fn = *(v__ast__Fn*)_t15.data; string msg = v__ast__Table_is_same_method(c->table, (voidptr)&/*qq*/m_fn, (voidptr)&/*qq*/em_fn); @@ -60925,7 +61023,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (node->language == v__ast__Language__v) { v__checker__Checker_check_valid_snake_case(c, method.name, _SLIT("method name"), method.pos); } - Option_void _t17 = v__checker__Checker_ensure_type_exists(c, method.return_type, method.return_type_pos); + _option_void _t17 = v__checker__Checker_ensure_type_exists(c, method.return_type, method.return_type_pos); if (_t17.state != 0 && _t17.err._typ != _IError_None___index) { IError err = _t17.err; return; @@ -60943,7 +61041,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (j == 0 && is_js) { continue; } - Option_void _t18 = v__checker__Checker_ensure_type_exists(c, param.typ, param.pos); + _option_void _t18 = v__checker__Checker_ensure_type_exists(c, param.typ, param.pos); if (_t18.state != 0 && _t18.err._typ != _IError_None___index) { IError err = _t18.err; return; @@ -60978,7 +61076,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (node->language == v__ast__Language__v) { v__checker__Checker_check_valid_snake_case(c, field.name, _SLIT("field name"), field.pos); } - Option_void _t20 = v__checker__Checker_ensure_type_exists(c, field.typ, field.pos); + _option_void _t20 = v__checker__Checker_ensure_type_exists(c, field.typ, field.pos); if (_t20.state != 0 && _t20.err._typ != _IError_None___index) { IError err = _t20.err; return; @@ -61007,7 +61105,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 == 435 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 436 /* 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}; @@ -61027,7 +61125,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch for (int _t4 = 0; _t4 < (*inter_sym->info._v__ast__Interface).fields.len; ++_t4) { v__ast__StructField ifield = ((v__ast__StructField*)(*inter_sym->info._v__ast__Interface).fields.data)[_t4]; if (v__ast__Type_has_flag(ifield.typ, v__ast__TypeFlag__generic) && string__eq(v__ast__Table_get_type_name(c->table, ifield.typ), gt_name)) { - Option_v__ast__StructField _t5; + _option_v__ast__StructField _t5; if (_t5 = v__ast__Table_find_field_with_embeds(c->table, typ_sym, ifield.name), _t5.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t5.data; inferred_type = field.typ; @@ -61036,10 +61134,10 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch } for (int _t6 = 0; _t6 < (*inter_sym->info._v__ast__Interface).methods.len; ++_t6) { v__ast__Fn imethod = ((v__ast__Fn*)(*inter_sym->info._v__ast__Interface).methods.data)[_t6]; - Option_v__ast__Fn _t7 = v__ast__TypeSymbol_find_method(typ_sym, imethod.name); + _option_v__ast__Fn _t7 = v__ast__TypeSymbol_find_method(typ_sym, imethod.name); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; - Option_v__ast__Fn _t8 = v__ast__TypeSymbol_find_method_with_generic_parent(typ_sym, imethod.name); + _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 `"), /*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); @@ -61064,7 +61162,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch v__ast__Type _t11 = 0; return _t11; } - if ((imret_sym->info)._typ == 443 /* v.ast.MultiReturn */ && (mret_sym->info)._typ == 443 /* v.ast.MultiReturn */) { + if ((imret_sym->info)._typ == 444 /* v.ast.MultiReturn */ && (mret_sym->info)._typ == 444 /* 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)) { @@ -61082,7 +61180,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch for (int i = 0; i < imethod.params.len; ++i) { v__ast__Param iparam = ((v__ast__Param*)imethod.params.data)[i]; v__ast__Param* _t13 = (v__ast__Param*)/*ee elem_ptr_typ */(array_get_with_check(method.params, i)); - Option_v__ast__Param _t12 = {0}; + _option_v__ast__Param _t12 = {0}; if (_t13) { *((v__ast__Param*)&_t12.data) = *((v__ast__Param*)_t13); } else { @@ -61127,7 +61225,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 == 282 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { + if ((node->cond)._typ == 283 /* 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) { @@ -61136,10 +61234,10 @@ 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 == 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)) { + if (((node->cond)._typ == 268 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->cond)._v__ast__Ident,(node->cond)._typ, 268) /*expected idx: 268, name: v.ast.Ident */ ).is_mut) || ((node->cond)._typ == 288 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast((node->cond)._v__ast__SelectorExpr,(node->cond)._typ, 288) /*expected idx: 288, 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); + _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->cond_type, node->pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__ast__Type _t2 = _const_v__ast__void_type; @@ -61175,7 +61273,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; Array_v__ast__Stmt _t4 = array_slice(branch.stmts, 0, branch.stmts.len - 1); for (int _t5 = 0; _t5 < _t4.len; ++_t5) { v__ast__Stmt st = ((v__ast__Stmt*)_t4.data)[_t5]; - Option_void _t6 = v__ast__Stmt_check_c_expr(st); + _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 "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); @@ -61190,7 +61288,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 == 307 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 308 /* v.ast.ExprStmt */) { if (node->is_expr) { c->expected_type = node->expected_type; } @@ -61236,7 +61334,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; } } first_iteration = false; - Option_bool _t9; + _option_bool _t9; if (_t9 = v__checker__Checker_has_return(c, branch.stmts), _t9.state == 0) { bool has_return = *(bool*)_t9.data; if (has_return) { @@ -61260,7 +61358,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; bool cond_is_auto_heap = false; for (int _t10 = 0; _t10 < node->branches.len; ++_t10) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)node->branches.data)[_t10]; - Option_v__ast__Var_ptr _t11; + _option_v__ast__Var_ptr _t11; if (_t11 = v__ast__Scope_find_var(branch.scope, cond_var), _t11.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t11.data; if (v->is_auto_heap) { @@ -61272,7 +61370,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; if (cond_is_auto_heap) { for (int _t12 = 0; _t12 < node->branches.len; ++_t12) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)node->branches.data)[_t12]; - Option_v__ast__Var_ptr _t13 = v__ast__Scope_find_var(branch.scope, cond_var); + _option_v__ast__Var_ptr _t13 = v__ast__Scope_find_var(branch.scope, cond_var); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; continue; @@ -61300,15 +61398,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 == 285 /* v.ast.RangeExpr */) { + if ((expr)._typ == 286 /* 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 == 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 */)) { + if ((low_expr)._typ == 273 /* v.ast.IntegerLiteral */) { + if ((high_expr)._typ == 273 /* v.ast.IntegerLiteral */ && (v__ast__TypeSymbol_is_int(final_cond_sym) || (final_cond_sym->info)._typ == 447 /* v.ast.Enum */)) { low = string_i64((*low_expr._v__ast__IntegerLiteral).val); high = string_i64((*high_expr._v__ast__IntegerLiteral).val); if (low > high) { @@ -61317,8 +61415,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 == 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)) { + } else if ((low_expr)._typ == 257 /* v.ast.CharLiteral */) { + if ((high_expr)._typ == 257 /* 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) { @@ -61345,11 +61443,11 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } continue; } - if (expr._typ == 293 /* v.ast.TypeNode */) { + if (expr._typ == 294 /* 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 == 264 /* v.ast.EnumVal */) { + else if (expr._typ == 265 /* v.ast.EnumVal */) { key = (*expr._v__ast__EnumVal).val; } @@ -61376,7 +61474,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } } - } else if ((cond_type_sym.info)._typ == 436 /* v.ast.SumType */) { + } else if ((cond_type_sym.info)._typ == 437 /* 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); @@ -61394,7 +61492,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ 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("`"), /*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 == 432 /* v.ast.Alias */ && (expr_type_sym->info)._typ == 417 /* v.ast.Struct */) { + } else if ((cond_type_sym.info)._typ == 433 /* v.ast.Alias */ && (expr_type_sym->info)._typ == 418 /* 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 `"), /*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)); @@ -61460,7 +61558,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } } else { - if (cond_type_sym.info._typ == 436 /* v.ast.SumType */) { + if (cond_type_sym.info._typ == 437 /* 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); @@ -61470,7 +61568,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } } - else if (cond_type_sym.info._typ == 446 /* v.ast.Enum */) { + else if (cond_type_sym.info._typ == 447 /* 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))) { @@ -61530,7 +61628,7 @@ bool v__checker__Checker_sql_expr_defer_0 = false; c->inside_sql = true; v__checker__Checker_sql_expr_defer_0 = true; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->table_expr.typ); - Option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); + _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__ast__Type _t2 = _const_v__ast__void_type; @@ -61544,7 +61642,7 @@ bool v__checker__Checker_sql_expr_defer_0 = false; ; c->cur_orm_ts = *sym; - if ((sym->info)._typ != 417 /* v.ast.Struct */) { + if ((sym->info)._typ != 418 /* 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 @@ -61554,7 +61652,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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, 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}; @@ -61661,7 +61759,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_stmt_line(v__checker__Check bool v__checker__Checker_sql_stmt_line_defer_0 = false; c->inside_sql = true; v__checker__Checker_sql_stmt_line_defer_0 = true; - Option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); + _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__ast__Type _t2 = _const_v__ast__void_type; @@ -61676,7 +61774,7 @@ 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 != 417 /* v.ast.Struct */) { + if ((table_sym->info)._typ != 418 /* 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 @@ -61686,7 +61784,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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((table_sym->info)._v__ast__Struct,(table_sym->info)._typ, 418) /*expected idx: 418, 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}; @@ -61743,7 +61841,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; v__checker__Checker_expr(c, expr); } } - if ((node->where_expr)._typ != 263 /* v.ast.EmptyExpr */) { + if ((node->where_expr)._typ != 264 /* v.ast.EmptyExpr */) { v__checker__Checker_expr(c, node->where_expr); } v__ast__Type _t11 = _const_v__ast__void_type; @@ -61797,8 +61895,9 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod return; } bool exp_is_optional = v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional); + bool exp_is_result = v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__result); 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 == 443 /* v.ast.MultiReturn */) { + if ((expected_type_sym->info)._typ == 444 /* 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}; @@ -61830,8 +61929,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 == 267 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((expr)._typ == 268 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 326 /* 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))); } @@ -61859,7 +61958,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 == 267 /* v.ast.Ident */) { + if ((expr)._typ == 268 /* 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); } @@ -61868,9 +61967,10 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } } #endif - int option_type_idx = (*(int*)map_get(ADDR(map, c->table->type_idxs), &(string[]){_SLIT("Option")}, &(int[]){ 0 })); + int option_type_idx = (*(int*)map_get(ADDR(map, c->table->type_idxs), &(string[]){_SLIT("_option")}, &(int[]){ 0 })); + int result_type_idx = (*(int*)map_get(ADDR(map, c->table->type_idxs), &(string[]){_SLIT("_result")}, &(int[]){ 0 })); int got_types_0_idx = v__ast__Type_idx((*(v__ast__Type*)/*ee elem_sym */array_get(got_types, 0))); - if (exp_is_optional && (got_types_0_idx == _const_v__ast__none_type_idx || got_types_0_idx == _const_v__ast__error_type_idx || got_types_0_idx == option_type_idx)) { + if ((exp_is_optional && (got_types_0_idx == _const_v__ast__none_type_idx || got_types_0_idx == _const_v__ast__error_type_idx || got_types_0_idx == option_type_idx)) || (exp_is_result && (got_types_0_idx == _const_v__ast__error_type_idx || got_types_0_idx == result_type_idx))) { if (got_types_0_idx == _const_v__ast__none_type_idx && v__ast__Type_alias_eq(expected_type, _const_v__ast__ovoid_type)) { v__checker__Checker_error(c, _SLIT("returning `none` in functions, that have a `?` result type is not allowed anymore, either `return error(message)` or just `return` instead"), node->pos); } @@ -61918,11 +62018,11 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } 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 == 267 /* v.ast.Ident */) { - if (((*r_expr->_v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((r_expr)->_typ == 268 /* v.ast.Ident */) { + if (((*r_expr->_v__ast__Ident).obj)._typ == 326 /* 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); + _option_v__ast__Var_ptr _t11 = v__ast__Scope_find_var(c->fn_scope, (*(*r_expr->_v__ast__Ident).obj._v__ast__Var).name); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; *(v__ast__Var**) _t11.data = obj; @@ -61943,7 +62043,7 @@ 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 == 253 /* v.ast.CallExpr */) { + if ((expr0)._typ == 254 /* 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); } @@ -61955,8 +62055,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 == 307 /* v.ast.ExprStmt */) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 253 /* v.ast.CallExpr */) { + if ((stmt)._typ == 308 /* v.ast.ExprStmt */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 254 /* 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; @@ -61972,18 +62072,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 == 318 /* v.ast.Return */) { + if (stmt._typ == 319 /* v.ast.Return */) { bool _t2 = true; return _t2; } - else if (stmt._typ == 300 /* v.ast.Block */) { + else if (stmt._typ == 301 /* v.ast.Block */) { if (v__checker__has_top_return((*stmt._v__ast__Block).stmts)) { bool _t3 = true; return _t3; } } - else if (stmt._typ == 307 /* v.ast.ExprStmt */) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 253 /* v.ast.CallExpr */) { + else if (stmt._typ == 308 /* v.ast.ExprStmt */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 254 /* v.ast.CallExpr */) { if ((*(*stmt._v__ast__ExprStmt).expr._v__ast__CallExpr).is_noreturn) { bool _t4 = true; return _t4; @@ -62015,8 +62115,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 == 307 /* v.ast.ExprStmt */) { - if (((*last_stmt._v__ast__ExprStmt).expr)._typ == 253 /* v.ast.CallExpr */) { + if (last_stmt._typ == 308 /* v.ast.ExprStmt */) { + if (((*last_stmt._v__ast__ExprStmt).expr)._typ == 254 /* 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; @@ -62026,7 +62126,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_noreturn_fn_decl(v__checker__Chec } } } - else if (last_stmt._typ == 310 /* v.ast.ForStmt */) { + else if (last_stmt._typ == 311 /* 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; } @@ -62049,24 +62149,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 == 318 /* v.ast.Return */) { + if (stmt._typ == 319 /* v.ast.Return */) { bool _t3 = true; return _t3; } - else if (stmt._typ == 300 /* v.ast.Block */) { + else if (stmt._typ == 301 /* v.ast.Block */) { if (v__checker__uses_return_stmt((*stmt._v__ast__Block).stmts)) { bool _t4 = true; return _t4; } } - else if (stmt._typ == 307 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).expr._typ == 253 /* v.ast.CallExpr */) { + else if (stmt._typ == 308 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 254 /* 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 == 277 /* v.ast.MatchExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 278 /* 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)) { @@ -62075,7 +62175,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 286 /* v.ast.SelectExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 287 /* 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)) { @@ -62084,7 +62184,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 268 /* v.ast.IfExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 269 /* 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)) { @@ -62098,19 +62198,19 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } ; } - else if (stmt._typ == 310 /* v.ast.ForStmt */) { + else if (stmt._typ == 311 /* v.ast.ForStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForStmt).stmts)) { bool _t12 = true; return _t12; } } - else if (stmt._typ == 308 /* v.ast.ForCStmt */) { + else if (stmt._typ == 309 /* v.ast.ForCStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForCStmt).stmts)) { bool _t13 = true; return _t13; } } - else if (stmt._typ == 309 /* v.ast.ForInStmt */) { + else if (stmt._typ == 310 /* v.ast.ForInStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForInStmt).stmts)) { bool _t14 = true; return _t14; @@ -62126,7 +62226,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 == 253 /* v.ast.CallExpr */) { + if ((expr)._typ == 254 /* v.ast.CallExpr */) { bool _t1 = (*expr._v__ast__CallExpr).is_noreturn; return _t1; } @@ -62153,7 +62253,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, 432) /*expected idx: 432, name: v.ast.Alias */ ; + v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 433) /*expected idx: 433, 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'; @@ -62235,7 +62335,7 @@ v__ast__Type v__checker__Checker_string_lit(v__checker__Checker* c, v__ast__Stri v__token__Pos start_pos = ((v__token__Pos){node->pos.len,node->pos.line_nr,node->pos.pos,.col = node->pos.col + 1 + idx,node->pos.last_line,}); int start_idx = idx; idx++; - Option_u8 _t2 = string_at_with_check(node->val, idx); + _option_u8 _t2 = string_at_with_check(node->val, idx); ; if (_t2.state != 0) { /*or block*/ IError err = _t2.err; @@ -62246,7 +62346,7 @@ v__ast__Type v__checker__Checker_string_lit(v__checker__Checker* c, v__ast__Stri u8 next_ch = *(byte*)&_t2.data; if (next_ch == 'u') { idx++; - Option_u8 _t4 = string_at_with_check(node->val, idx); + _option_u8 _t4 = string_at_with_check(node->val, idx); ; if (_t4.state != 0) { /*or block*/ IError err = _t4.err; @@ -62276,7 +62376,7 @@ v__ast__Type v__checker__Checker_string_lit(v__checker__Checker* c, v__ast__Stri v__checker__Checker_error(c, _const_v__checker__unicode_lit_overflow_message, end_pos); }; idx++; - Option_u8 _t6 = string_at_with_check(node->val, idx); + _option_u8 _t6 = string_at_with_check(node->val, idx); ; if (_t6.state != 0) { /*or block*/ IError err = _t6.err; @@ -62329,7 +62429,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 == 417 /* v.ast.Struct */) { + if ((struct_sym->info)._typ == 418 /* 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)) { @@ -62339,7 +62439,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* if (embed_sym->kind != v__ast__Kind__struct_) { 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ; if (info.is_heap && !v__ast__Type_is_ptr(embed.typ)) { (*struct_sym->info._v__ast__Struct).is_heap = true; } @@ -62360,7 +62460,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* if (v__ast__Type_alias_eq(field.typ, _const_v__ast__any_type)) { v__checker__Checker_error(c, _SLIT("struct field cannot be the `any` type, use generics instead"), field.type_pos); } - Option_void _t3 = v__checker__Checker_ensure_type_exists(c, field.typ, field.type_pos); + _option_void _t3 = v__checker__Checker_ensure_type_exists(c, field.typ, field.type_pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; return; @@ -62387,8 +62487,8 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* } 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, 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); + v__ast__FnType fn_info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 445) /*expected idx: 445, 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; return; @@ -62397,7 +62497,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* ; for (int _t5 = 0; _t5 < fn_info.func.params.len; ++_t5) { v__ast__Param param = ((v__ast__Param*)fn_info.func.params.data)[_t5]; - Option_void _t6 = v__checker__Checker_ensure_type_exists(c, param.typ, param.type_pos); + _option_void _t6 = v__checker__Checker_ensure_type_exists(c, param.typ, param.type_pos); if (_t6.state != 0 && _t6.err._typ != _IError_None___index) { IError err = _t6.err; return; @@ -62408,7 +62508,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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ; if (info.is_heap && !v__ast__Type_is_ptr(field.typ)) { (*struct_sym->info._v__ast__Struct).is_heap = true; } @@ -62420,7 +62520,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* v__checker__Checker_check_expr_opt_call(c, field.default_expr, field_expr_type); } (*(v__ast__StructField*)/*ee elem_sym */array_get((*struct_sym->info._v__ast__Struct).fields, i)).default_expr_typ = field_expr_type; - Option_void _t7 = v__checker__Checker_check_expected(c, field_expr_type, field.typ); + _option_void _t7 = v__checker__Checker_check_expected(c, field_expr_type, field.typ); if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { IError err = _t7.err; if (sym->kind == v__ast__Kind__interface_ && v__checker__Checker_type_implements(c, field_expr_type, field.typ, field.pos)) { @@ -62440,15 +62540,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 == 272 /* v.ast.IntegerLiteral */) { + if ((field.default_expr)._typ == 273 /* 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 == 291 /* v.ast.StringLiteral */) { + } else if ((field.default_expr)._typ == 292 /* 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 == 251 /* v.ast.BoolLiteral */) { + } else if ((field.default_expr)._typ == 252 /* 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); } @@ -62480,18 +62580,18 @@ VV_LOCAL_SYMBOL int v__checker__minify_sort_fn(v__ast__StructField* a, v__ast__S v__ast__Table* t = global_table; v__ast__TypeSymbol* a_sym = v__ast__Table_sym(t, a->typ); v__ast__TypeSymbol* b_sym = v__ast__Table_sym(t, b->typ); - if ((a_sym->info)._typ == 446 /* v.ast.Enum */) { + if ((a_sym->info)._typ == 447 /* v.ast.Enum */) { if (!(*a_sym->info._v__ast__Enum).is_flag && !(*a_sym->info._v__ast__Enum).uses_exprs) { if (b_sym->kind == v__ast__Kind__enum_) { int a_nr_vals = ((*a_sym->info._v__ast__Enum)).vals.len; - int b_nr_vals = (/* as */ *(v__ast__Enum*)__as_cast((b_sym->info)._v__ast__Enum,(b_sym->info)._typ, 446) /*expected idx: 446, name: v.ast.Enum */ ).vals.len; + int b_nr_vals = (/* as */ *(v__ast__Enum*)__as_cast((b_sym->info)._v__ast__Enum,(b_sym->info)._typ, 447) /*expected idx: 447, name: v.ast.Enum */ ).vals.len; int _t5 = (a_nr_vals > b_nr_vals ? (-1) : a_nr_vals < b_nr_vals ? (1) : (0)); return _t5; } int _t6 = 1; return _t6; } - } else if ((b_sym->info)._typ == 446 /* v.ast.Enum */) { + } else if ((b_sym->info)._typ == 447 /* v.ast.Enum */) { if (!(*b_sym->info._v__ast__Enum).is_flag && !(*b_sym->info._v__ast__Enum).uses_exprs) { int _t7 = -1; return _t7; @@ -62522,7 +62622,7 @@ 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 == 417 /* v.ast.Struct */) { + if ((struct_sym->info)._typ == 418 /* 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); @@ -62552,7 +62652,7 @@ 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 == 432 /* v.ast.Alias */) { + } else if ((struct_sym->info)._typ == 433 /* 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); @@ -62565,7 +62665,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str if (c->table->cur_fn->generic_names.len > 0) { v__ast__Table_unwrap_generic_type(c->table, node->typ, c->table->cur_fn->generic_names, c->table->cur_concrete_types); } - Option_void _t5 = v__checker__Checker_ensure_type_exists(c, node->typ, node->pos); + _option_void _t5 = v__checker__Checker_ensure_type_exists(c, node->typ, node->pos); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { IError err = _t5.err; } @@ -62576,7 +62676,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str v__checker__Checker_note(c, _SLIT("direct sum type init (`x := SumType{}`) will be removed soon"), node->pos); } if (!c->is_builtin_mod && !c->inside_unsafe && type_sym->language == v__ast__Language__v && c->table->cur_concrete_types.len == 0) { - Option_int _t6 = string_last_index(type_sym->name, _SLIT(".")); + _option_int _t6 = string_last_index(type_sym->name, _SLIT(".")); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; *(int*) _t6.data = -1; @@ -62595,7 +62695,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str 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 `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } - if ((type_sym->info)._typ == 432 /* v.ast.Alias */) { + if ((type_sym->info)._typ == 433 /* 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 `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t7 = _const_v__ast__void_type; @@ -62606,7 +62706,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 418) /*expected idx: 418, 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 `"), /*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); } @@ -62625,7 +62725,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str 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)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.concrete_types = __new_array(0, 0, sizeof(v__ast__Type)),.parent_type = 0,.is_typedef = 0,.is_union = 0,.is_heap = 0,.is_minify = 0,.is_generic = 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, 432) /*expected idx: 432, 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, 433) /*expected idx: 433, 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: "), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); @@ -62633,12 +62733,12 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str return _t10; } if (sym->kind == v__ast__Kind__struct_) { - info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 417) /*expected idx: 417, name: v.ast.Struct */ ; + info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ; } else { 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ; } if (node->is_short) { int exp_len = info.fields.len; @@ -62668,7 +62768,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } else { field_name = field->name; bool exists = true; - Option_v__ast__StructField _t11 = v__ast__Table_find_field_with_embeds(c->table, type_sym, field_name); + _option_v__ast__StructField _t11 = v__ast__Table_find_field_with_embeds(c->table, type_sym, field_name); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; exists = false; @@ -62703,7 +62803,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } } } else if (!v__ast__Type_alias_eq(expr_type, _const_v__ast__void_type) && expr_type_sym->kind != v__ast__Kind__placeholder) { - 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)); + _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 `"), /*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); @@ -62723,7 +62823,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 == 245 /* v.ast.AnonFn */) { + if ((field->expr)._typ == 246 /* 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); } @@ -62735,11 +62835,11 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str 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 == 267 /* v.ast.Ident */) { - if (((*field->expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((field->expr)._typ == 268 /* v.ast.Ident */) { + if (((*field->expr._v__ast__Ident).obj)._typ == 326 /* 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); + _option_v__ast__Var_ptr _t14 = v__ast__Scope_find_var(c->fn_scope, obj->name); if (_t14.state != 0) { /*or block*/ IError err = _t14.err; *(v__ast__Var**) _t14.data = obj; @@ -62765,13 +62865,13 @@ 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 == 292 /* v.ast.StructInit */) { + if ((field.default_expr)._typ == 293 /* 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; + _option_v__ast__ConstField_ptr _t15; 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; @@ -62821,8 +62921,8 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } 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, 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 */ ; + v__ast__Struct from_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 418) /*expected idx: 418, 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, 418) /*expected idx: 418, 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 `"), /*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)); } @@ -62847,7 +62947,7 @@ VV_LOCAL_SYMBOL bool v__transformer__IndexState_safe_access(v__transformer__Inde return _t2; } int* _t4 = (int*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, i->max_index), &(string[]){key})); - Option_int _t3 = {0}; + _option_int _t3 = {0}; if (_t4) { *((int*)&_t3.data) = *((int*)_t4); } else { @@ -62891,7 +62991,7 @@ VV_LOCAL_SYMBOL int v__transformer__IndexState_safe_offset(v__transformer__Index return _t2; } int* _t5 = (int*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, i->max_index), &(string[]){key})); - Option_int _t4 = {0}; + _option_int _t4 = {0}; if (_t5) { *((int*)&_t4.data) = *((int*)_t5); } else { @@ -62994,9 +63094,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 == 247 /* v.ast.ArrayInit */) { + if ((right)._typ == 248 /* v.ast.ArrayInit */) { v__ast__Expr left = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left)._typ == 267 /* v.ast.Ident */) { + if ((left)._typ == 268 /* v.ast.Ident */) { if ((*left._v__ast__Ident).is_mut) { v__transformer__IndexState_safe_access(t->index, (*left._v__ast__Ident).name, -2); return; @@ -63007,7 +63107,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 == 272 /* v.ast.IntegerLiteral */) { + if ((value)._typ == 273 /* 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); @@ -63020,19 +63120,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 == 270 /* v.ast.IndexExpr */) { + if ((right)._typ == 271 /* v.ast.IndexExpr */) { v__ast__Expr left = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left)._typ == 267 /* v.ast.Ident */) { + if ((left)._typ == 268 /* 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 == 285 /* v.ast.RangeExpr */) { + if ((index)._typ == 286 /* v.ast.RangeExpr */) { v__ast__Expr range_low = (*index._v__ast__RangeExpr).low; - if ((range_low)._typ == 272 /* v.ast.IntegerLiteral */) { + if ((range_low)._typ == 273 /* v.ast.IntegerLiteral */) { v__ast__Expr sub_left = (*right._v__ast__IndexExpr).left; - if ((sub_left)._typ == 267 /* v.ast.Ident */) { + if ((sub_left)._typ == 268 /* 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) { @@ -63060,40 +63160,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 == 272 /* v.ast.IntegerLiteral */) { + if (index._typ == 273 /* 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 == 285 /* v.ast.RangeExpr */) { + else if (index._typ == 286 /* v.ast.RangeExpr */) { if ((*index._v__ast__RangeExpr).has_high) { v__ast__Expr high = (*index._v__ast__RangeExpr).high; - if ((high)._typ == 272 /* v.ast.IntegerLiteral */) { + if ((high)._typ == 273 /* 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 == 272 /* v.ast.IntegerLiteral */) { + if ((low)._typ == 273 /* 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 == 254 /* v.ast.CastExpr */) { + else if (index._typ == 255 /* 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 == 272 /* v.ast.IntegerLiteral */) { + if ((index_expr)._typ == 273 /* 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 == 264 /* v.ast.EnumVal */) { + else if (index._typ == 265 /* v.ast.EnumVal */) { ; } - else if (index._typ == 267 /* v.ast.Ident */) { + else if (index._typ == 268 /* v.ast.Ident */) { } else { @@ -63102,17 +63202,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 == 305 /* v.ast.EmptyStmt */) { + if (node->_typ == 306 /* v.ast.EmptyStmt */) { } - else if (node->_typ == 278 /* v.ast.NodeError */) { + else if (node->_typ == 279 /* v.ast.NodeError */) { } - else if (node->_typ == 297 /* v.ast.AsmStmt */) { + else if (node->_typ == 298 /* v.ast.AsmStmt */) { } - else if (node->_typ == 298 /* v.ast.AssertStmt */) { + else if (node->_typ == 299 /* 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 == 299 /* v.ast.AssignStmt */) { + else if (node->_typ == 300 /* 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)); @@ -63125,7 +63225,7 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ *left = v__transformer__Transformer_expr(t, left); } } - else if (node->_typ == 300 /* v.ast.Block */) { + else if (node->_typ == 301 /* 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; @@ -63133,35 +63233,35 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 301 /* v.ast.BranchStmt */) { + else if (node->_typ == 302 /* v.ast.BranchStmt */) { t->index->disabled = true; } - else if (node->_typ == 302 /* v.ast.ComptimeFor */) { + else if (node->_typ == 303 /* 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 == 303 /* v.ast.ConstDecl */) { + else if (node->_typ == 304 /* 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 == 304 /* v.ast.DeferStmt */) { + else if (node->_typ == 305 /* 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 == 306 /* v.ast.EnumDecl */) { + else if (node->_typ == 307 /* v.ast.EnumDecl */) { } - else if (node->_typ == 307 /* v.ast.ExprStmt */) { + else if (node->_typ == 308 /* v.ast.ExprStmt */) { v__ast__Expr _t8 = {0}; - if ((*node->_v__ast__ExprStmt).expr._typ == 268 /* v.ast.IfExpr */) { + if ((*node->_v__ast__ExprStmt).expr._typ == 269 /* 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 == 277 /* v.ast.MatchExpr */) { + else if ((*node->_v__ast__ExprStmt).expr._typ == 278 /* v.ast.MatchExpr */) { _t8 = v__transformer__Transformer_expr_stmt_match_expr(t, (voidptr)&/*qq*/(*(*node->_v__ast__ExprStmt).expr._v__ast__MatchExpr)); } @@ -63170,7 +63270,7 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } (*node->_v__ast__ExprStmt).expr = _t8; } - else if (node->_typ == 184 /* v.ast.FnDecl */) { + else if (node->_typ == 185 /* 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; @@ -63178,11 +63278,11 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 308 /* v.ast.ForCStmt */) { + else if (node->_typ == 309 /* 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 == 309 /* v.ast.ForInStmt */) { + else if (node->_typ == 310 /* 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; @@ -63190,50 +63290,50 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 310 /* v.ast.ForStmt */) { + else if (node->_typ == 311 /* 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 == 311 /* v.ast.GlobalDecl */) { + else if (node->_typ == 312 /* 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 == 312 /* v.ast.GotoLabel */) { + else if (node->_typ == 313 /* v.ast.GotoLabel */) { } - else if (node->_typ == 313 /* v.ast.GotoStmt */) { + else if (node->_typ == 314 /* v.ast.GotoStmt */) { t->index->disabled = true; } - else if (node->_typ == 314 /* v.ast.HashStmt */) { + else if (node->_typ == 315 /* 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 == 315 /* v.ast.Import */) { + else if (node->_typ == 316 /* v.ast.Import */) { } - else if (node->_typ == 316 /* v.ast.InterfaceDecl */) { + else if (node->_typ == 317 /* 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 == 317 /* v.ast.Module */) { + else if (node->_typ == 318 /* v.ast.Module */) { } - else if (node->_typ == 318 /* v.ast.Return */) { + else if (node->_typ == 319 /* 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 == 319 /* v.ast.SqlStmt */) { + else if (node->_typ == 320 /* v.ast.SqlStmt */) { } - else if (node->_typ == 320 /* v.ast.StructDecl */) { + else if (node->_typ == 321 /* 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 == 244 /* v.ast.TypeDecl */) { + else if (node->_typ == 245 /* v.ast.TypeDecl */) { } ; v__ast__Stmt _t18 = *node; @@ -63247,11 +63347,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 == 271 /* v.ast.InfixExpr */) { + if ((node->expr)._typ == 272 /* v.ast.InfixExpr */) { v__ast__Expr right = (*node->expr._v__ast__InfixExpr).right; - if (right._typ == 272 /* v.ast.IntegerLiteral */) { + if (right._typ == 273 /* v.ast.IntegerLiteral */) { v__ast__Expr left = (*node->expr._v__ast__InfixExpr).left; - if ((left)._typ == 287 /* v.ast.SelectorExpr */) { + if ((left)._typ == 288 /* v.ast.SelectorExpr */) { int len = string_int((*right._v__ast__IntegerLiteral).val); if (string__eq((*left._v__ast__SelectorExpr).field_name, _SLIT("len"))) { @@ -63269,9 +63369,9 @@ v__ast__Stmt v__transformer__Transformer_assert_stmt(v__transformer__Transformer } } } - else if (right._typ == 287 /* v.ast.SelectorExpr */) { + else if (right._typ == 288 /* v.ast.SelectorExpr */) { v__ast__Expr left = (*node->expr._v__ast__InfixExpr).left; - if ((left)._typ == 272 /* v.ast.IntegerLiteral */) { + if ((left)._typ == 273 /* v.ast.IntegerLiteral */) { int len = string_int((*left._v__ast__IntegerLiteral).val); if (string__eq((*right._v__ast__SelectorExpr).field_name, _SLIT("len"))) { @@ -63310,7 +63410,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 == 251 /* v.ast.BoolLiteral */) { + if ((cond)._typ == 252 /* v.ast.BoolLiteral */) { if ((*cond._v__ast__BoolLiteral).val) { stop_index = i; break; @@ -63369,36 +63469,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 == 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) { + if (cond._typ == 252 /* v.ast.BoolLiteral */) { + if ((expr)->_typ == 252 /* v.ast.BoolLiteral */) { + if ((*cond._v__ast__BoolLiteral).val == (/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)->_v__ast__BoolLiteral,(expr)->_typ, 252) /*expected idx: 252, 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 == 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)) { + else if (cond._typ == 273 /* v.ast.IntegerLiteral */) { + if ((expr)->_typ == 273 /* 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, 273) /*expected idx: 273, 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 == 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)) { + else if (cond._typ == 266 /* v.ast.FloatLiteral */) { + if ((expr)->_typ == 266 /* 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, 266) /*expected idx: 266, 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 == 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)) { + else if (cond._typ == 292 /* v.ast.StringLiteral */) { + if ((expr)->_typ == 292 /* v.ast.StringLiteral */) { + if (string__eq((*cond._v__ast__StringLiteral).val, (/* as */ *(v__ast__StringLiteral*)__as_cast((expr)->_v__ast__StringLiteral,(expr)->_typ, 292) /*expected idx: 292, 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; @@ -63446,8 +63546,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 == 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) { + if (node->cond._typ == 252 /* v.ast.BoolLiteral */) { + if (!(/* as */ *(v__ast__BoolLiteral*)__as_cast((node->cond)._v__ast__BoolLiteral,(node->cond)._typ, 252) /*expected idx: 252, 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; } @@ -63482,13 +63582,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 == 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 */ ; + if (node->_typ == 246 /* 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, 185) /*expected idx: 185, name: v.ast.FnDecl */ ; } - else if (node->_typ == 246 /* v.ast.ArrayDecompose */) { + else if (node->_typ == 247 /* v.ast.ArrayDecompose */) { (*node->_v__ast__ArrayDecompose).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ArrayDecompose).expr); } - else if (node->_typ == 247 /* v.ast.ArrayInit */) { + else if (node->_typ == 248 /* 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); @@ -63497,73 +63597,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 == 248 /* v.ast.AsCast */) { + else if (node->_typ == 249 /* v.ast.AsCast */) { (*node->_v__ast__AsCast).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__AsCast).expr); } - else if (node->_typ == 252 /* v.ast.CTempVar */) { + else if (node->_typ == 253 /* v.ast.CTempVar */) { (*node->_v__ast__CTempVar).orig = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CTempVar).orig); } - else if (node->_typ == 253 /* v.ast.CallExpr */) { + else if (node->_typ == 254 /* 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, 281) /*expected idx: 281, 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, 282) /*expected idx: 282, name: v.ast.OrExpr */ ; } - else if (node->_typ == 254 /* v.ast.CastExpr */) { + else if (node->_typ == 255 /* 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 == 255 /* v.ast.ChanInit */) { + else if (node->_typ == 256 /* 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 == 258 /* v.ast.ComptimeCall */) { + else if (node->_typ == 259 /* 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 == 259 /* v.ast.ComptimeSelector */) { + else if (node->_typ == 260 /* 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 == 261 /* v.ast.ConcatExpr */) { + else if (node->_typ == 262 /* 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 == 262 /* v.ast.DumpExpr */) { + else if (node->_typ == 263 /* v.ast.DumpExpr */) { (*node->_v__ast__DumpExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__DumpExpr).expr); } - 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.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, 254) /*expected idx: 254, name: v.ast.CallExpr */ ; } - else if (node->_typ == 268 /* v.ast.IfExpr */) { + else if (node->_typ == 269 /* 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 == 269 /* v.ast.IfGuardExpr */) { + else if (node->_typ == 270 /* v.ast.IfGuardExpr */) { (*node->_v__ast__IfGuardExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IfGuardExpr).expr); } - else if (node->_typ == 270 /* v.ast.IndexExpr */) { + else if (node->_typ == 271 /* 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, 281) /*expected idx: 281, 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, 282) /*expected idx: 282, name: v.ast.OrExpr */ ; } - else if (node->_typ == 271 /* v.ast.InfixExpr */) { + else if (node->_typ == 272 /* 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 == 273 /* v.ast.IsRefType */) { + else if (node->_typ == 274 /* v.ast.IsRefType */) { (*node->_v__ast__IsRefType).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IsRefType).expr); } - else if (node->_typ == 274 /* v.ast.Likely */) { + else if (node->_typ == 275 /* v.ast.Likely */) { (*node->_v__ast__Likely).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__Likely).expr); } - else if (node->_typ == 275 /* v.ast.LockExpr */) { + else if (node->_typ == 276 /* 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); @@ -63573,7 +63673,7 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ *locked = v__transformer__Transformer_expr(t, locked); } } - else if (node->_typ == 276 /* v.ast.MapInit */) { + else if (node->_typ == 277 /* 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); @@ -63583,31 +63683,31 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ *val = v__transformer__Transformer_expr(t, val); } } - else if (node->_typ == 277 /* v.ast.MatchExpr */) { + else if (node->_typ == 278 /* 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 == 281 /* v.ast.OrExpr */) { + else if (node->_typ == 282 /* 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 == 282 /* v.ast.ParExpr */) { + else if (node->_typ == 283 /* v.ast.ParExpr */) { (*node->_v__ast__ParExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ParExpr).expr); } - else if (node->_typ == 283 /* v.ast.PostfixExpr */) { + else if (node->_typ == 284 /* v.ast.PostfixExpr */) { (*node->_v__ast__PostfixExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__PostfixExpr).expr); } - else if (node->_typ == 284 /* v.ast.PrefixExpr */) { + else if (node->_typ == 285 /* 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, 281) /*expected idx: 281, 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, 282) /*expected idx: 282, name: v.ast.OrExpr */ ; } - else if (node->_typ == 285 /* v.ast.RangeExpr */) { + else if (node->_typ == 286 /* 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 == 286 /* v.ast.SelectExpr */) { + else if (node->_typ == 287 /* 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); @@ -63617,27 +63717,27 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ } } } - else if (node->_typ == 287 /* v.ast.SelectorExpr */) { + else if (node->_typ == 288 /* 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 == 291 /* v.ast.StringLiteral */ && string__eq((*node->_v__ast__SelectorExpr).field_name, _SLIT("len"))) { + if (((*node->_v__ast__SelectorExpr).expr)._typ == 292 /* 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 == 288 /* v.ast.SizeOf */) { + else if (node->_typ == 289 /* v.ast.SizeOf */) { (*node->_v__ast__SizeOf).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__SizeOf).expr); } - else if (node->_typ == 289 /* v.ast.SqlExpr */) { + else if (node->_typ == 290 /* 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 == 290 /* v.ast.StringInterLiteral */) { + else if (node->_typ == 291 /* 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 == 292 /* v.ast.StructInit */) { + else if (node->_typ == 293 /* 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; @@ -63648,7 +63748,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 == 295 /* v.ast.UnsafeExpr */) { + else if (node->_typ == 296 /* v.ast.UnsafeExpr */) { (*node->_v__ast__UnsafeExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__UnsafeExpr).expr); } @@ -63678,8 +63778,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 == 251 /* v.ast.BoolLiteral */) { - if (node->right._typ == 251 /* v.ast.BoolLiteral */) { + if (node->left._typ == 252 /* v.ast.BoolLiteral */) { + if (node->right._typ == 252 /* 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,},})))); @@ -63705,8 +63805,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 291 /* v.ast.StringLiteral */) { - if (node->right._typ == 291 /* v.ast.StringLiteral */) { + else if (node->left._typ == 292 /* v.ast.StringLiteral */) { + if (node->right._typ == 292 /* 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,},})))); @@ -63728,8 +63828,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 272 /* v.ast.IntegerLiteral */) { - if (node->right._typ == 272 /* v.ast.IntegerLiteral */) { + else if (node->left._typ == 273 /* v.ast.IntegerLiteral */) { + if (node->right._typ == 273 /* 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) { @@ -63949,8 +64049,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 265 /* v.ast.FloatLiteral */) { - if (node->right._typ == 265 /* v.ast.FloatLiteral */) { + else if (node->left._typ == 266 /* v.ast.FloatLiteral */) { + if (node->right._typ == 266 /* 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) { @@ -64150,16 +64250,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 == 307 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 308 /* v.ast.ExprStmt */) { v__ast__Expr expr = (*stmt->_v__ast__ExprStmt).expr; - if (expr._typ == 268 /* v.ast.IfExpr */) { + if (expr._typ == 269 /* 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 == 277 /* v.ast.MatchExpr */) { + else if (expr._typ == 278 /* 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); @@ -64193,16 +64293,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 == 307 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 308 /* v.ast.ExprStmt */) { v__ast__Expr expr = (*stmt->_v__ast__ExprStmt).expr; - if (expr._typ == 268 /* v.ast.IfExpr */) { + if (expr._typ == 269 /* 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 == 277 /* v.ast.MatchExpr */) { + else if (expr._typ == 278 /* 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); @@ -64251,7 +64351,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, 289) /*expected idx: 289, 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, 290) /*expected idx: 290, name: v.ast.SqlExpr */ ; } v__ast__Expr _t6 = v__ast__SqlExpr_to_sumtype_v__ast__Expr(node); return _t6; @@ -64265,20 +64365,20 @@ bool v__markused__mark_used_defer_0 = false; Map_string_v__ast__GlobalField all_globals = mr_434.arg2; v__util__timing_start(_SLIT("mark_used")); v__markused__mark_used_defer_0 = true; - Array_string all_fn_root_names = new_array_from_c_array(99, 99, sizeof(string), _MOV((string[99]){ + Array_string all_fn_root_names = new_array_from_c_array(100, 100, sizeof(string), _MOV((string[100]){ _SLIT("main.main"), _SLIT("__new_array"), _SLIT("str_intp"), _SLIT("format_sb"), _SLIT("__new_array_with_default"), _SLIT("__new_array_with_array_default"), _SLIT("v_realloc"), _SLIT("malloc"), _SLIT("malloc_noscan"), _SLIT("vcalloc"), _SLIT("vcalloc_noscan"), _SLIT("new_array_from_c_array"), _SLIT("v_fixed_index"), _SLIT("memdup"), _SLIT("vstrlen"), _SLIT("__as_cast"), _SLIT("tos"), - _SLIT("tos2"), _SLIT("tos3"), _SLIT("isnil"), _SLIT("opt_ok"), _SLIT("error"), _SLIT("utf8_str_visible_length"), _SLIT("compare_ints"), _SLIT("compare_u64s"), - _SLIT("compare_strings"), _SLIT("compare_ints_reverse"), _SLIT("compare_u64s_reverse"), _SLIT("compare_strings_reverse"), _SLIT("builtin_init"), _SLIT("3.vstring"), _SLIT("3.vstring_with_len"), _SLIT("3.vstring_literal"), - _SLIT("4.vstring"), _SLIT("4.vstring_with_len"), _SLIT("4.vstring_literal"), _SLIT("10.str_escaped"), _SLIT("20.add"), _SLIT("20.trim_space"), _SLIT("20.repeat"), _SLIT("20.replace"), - _SLIT("20.clone"), _SLIT("20.clone_static"), _SLIT("20.trim"), _SLIT("20.substr"), _SLIT("20.substr_ni"), _SLIT("20.at"), _SLIT("20.at_with_check"), _SLIT("20.index_kmp"), - _SLIT("20.eq"), _SLIT("20.ne"), _SLIT("20.lt"), _SLIT("20.gt"), _SLIT("20.le"), _SLIT("20.ge"), _SLIT("fast_string_eq"), _SLIT("22.get"), - _SLIT("22.set"), _SLIT("22.get_unsafe"), _SLIT("22.set_unsafe"), _SLIT("22.get_with_check"), _SLIT("22.clone_static_to_depth"), _SLIT("22.clone_to_depth"), _SLIT("22.first"), _SLIT("22.last"), - _SLIT("22.pointers"), _SLIT("22.reverse"), _SLIT("22.repeat_to_depth"), _SLIT("22.slice"), _SLIT("22.slice_ni"), _SLIT("22.slice2"), _SLIT("61.get"), _SLIT("61.set"), - _SLIT("65558.last"), _SLIT("65558.pop"), _SLIT("65558.push"), _SLIT("65558.insert_many"), _SLIT("65558.prepend_many"), _SLIT("65558.reverse"), _SLIT("65558.set"), _SLIT("65558.set_unsafe"), - _SLIT("json.decode_string"), _SLIT("json.decode_int"), _SLIT("json.decode_bool"), _SLIT("json.decode_u64"), _SLIT("json.encode_int"), _SLIT("json.encode_string"), _SLIT("json.encode_bool"), _SLIT("json.encode_u64"), - _SLIT("json.json_print"), _SLIT("json.json_parse"), _SLIT("main.nasserts"), _SLIT("main.vtest_init"), _SLIT("main.vtest_new_metainfo"), _SLIT("main.vtest_new_filemetainfo"), _SLIT("os.getwd"), _SLIT("os.init_os_args"), - _SLIT("os.init_os_args_wide"), _SLIT("v.embed_file.find_index_entry_by_path")})); + _SLIT("tos2"), _SLIT("tos3"), _SLIT("isnil"), _SLIT("opt_ok"), _SLIT("opt_ok2"), _SLIT("error"), _SLIT("utf8_str_visible_length"), _SLIT("compare_ints"), + _SLIT("compare_u64s"), _SLIT("compare_strings"), _SLIT("compare_ints_reverse"), _SLIT("compare_u64s_reverse"), _SLIT("compare_strings_reverse"), _SLIT("builtin_init"), _SLIT("3.vstring"), _SLIT("3.vstring_with_len"), + _SLIT("3.vstring_literal"), _SLIT("4.vstring"), _SLIT("4.vstring_with_len"), _SLIT("4.vstring_literal"), _SLIT("10.str_escaped"), _SLIT("20.add"), _SLIT("20.trim_space"), _SLIT("20.repeat"), + _SLIT("20.replace"), _SLIT("20.clone"), _SLIT("20.clone_static"), _SLIT("20.trim"), _SLIT("20.substr"), _SLIT("20.substr_ni"), _SLIT("20.at"), _SLIT("20.at_with_check"), + _SLIT("20.index_kmp"), _SLIT("20.eq"), _SLIT("20.ne"), _SLIT("20.lt"), _SLIT("20.gt"), _SLIT("20.le"), _SLIT("20.ge"), _SLIT("fast_string_eq"), + _SLIT("22.get"), _SLIT("22.set"), _SLIT("22.get_unsafe"), _SLIT("22.set_unsafe"), _SLIT("22.get_with_check"), _SLIT("22.clone_static_to_depth"), _SLIT("22.clone_to_depth"), _SLIT("22.first"), + _SLIT("22.last"), _SLIT("22.pointers"), _SLIT("22.reverse"), _SLIT("22.repeat_to_depth"), _SLIT("22.slice"), _SLIT("22.slice_ni"), _SLIT("22.slice2"), _SLIT("61.get"), + _SLIT("61.set"), _SLIT("65558.last"), _SLIT("65558.pop"), _SLIT("65558.push"), _SLIT("65558.insert_many"), _SLIT("65558.prepend_many"), _SLIT("65558.reverse"), _SLIT("65558.set"), + _SLIT("65558.set_unsafe"), _SLIT("json.decode_string"), _SLIT("json.decode_int"), _SLIT("json.decode_bool"), _SLIT("json.decode_u64"), _SLIT("json.encode_int"), _SLIT("json.encode_string"), _SLIT("json.encode_bool"), + _SLIT("json.encode_u64"), _SLIT("json.json_print"), _SLIT("json.json_parse"), _SLIT("main.nasserts"), _SLIT("main.vtest_init"), _SLIT("main.vtest_new_metainfo"), _SLIT("main.vtest_new_filemetainfo"), _SLIT("os.getwd"), + _SLIT("os.init_os_args"), _SLIT("os.init_os_args_wide"), _SLIT("v.embed_file.find_index_entry_by_path")})); if (pref->is_bare) { _PUSH_MANY(&all_fn_root_names, (new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("strlen"), _SLIT("memcmp"), _SLIT("memcpy"), _SLIT("realloc"), _SLIT("vsnprintf"), _SLIT("vsprintf")}))), _t1, Array_string); } @@ -64378,7 +64478,7 @@ bool v__markused__mark_used_defer_0 = false; if (pref->is_test) { array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(_SLIT("main.cb_assertion_ok")) })); array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(_SLIT("main.cb_assertion_failed")) })); - Option_v__ast__TypeSymbol_ptr _t25; + _option_v__ast__TypeSymbol_ptr _t25; 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; @@ -64393,10 +64493,10 @@ bool v__markused__mark_used_defer_0 = false; if (isym->kind != v__ast__Kind__interface_) { continue; } - if ((isym->info)._typ != 435 /* v.ast.Interface */) { + if ((isym->info)._typ != 436 /* v.ast.Interface */) { continue; } - 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 */ ; + v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 436) /*expected idx: 436, name: v.ast.Interface */ ; if (interface_info.methods.len == 0) { continue; } @@ -64438,7 +64538,7 @@ bool v__markused__mark_used_defer_0 = false; } } Array_v__ast__Type* _t41 = (Array_v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, table->iface_types), &(string[]){_SLIT("orm.Connection")})); - Option_Array_v__ast__Type _t40 = {0}; + _option_Array_v__ast__Type _t40 = {0}; if (_t41) { *((Array_v__ast__Type*)&_t40.data) = *((Array_v__ast__Type*)_t41); } else { @@ -64621,18 +64721,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 == 184 /* v.ast.FnDecl */) { + if (node._typ == 185 /* 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){.receiver = (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,},.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.params = __new_array(0, 0, sizeof(v__ast__Param)),.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.defer_stmts = __new_array(0, 0, sizeof(v__ast__DeferStmt)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.next_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.label_names = __new_array(0, 0, sizeof(string)),.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.source_file = 0,.scope = 0,.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.ctdefine_idx = -1,.idx = 0,.return_type = 0,.ninstances = 0,.is_deprecated = 0,.is_pub = 0,.is_variadic = 0,.is_anon = 0,.is_noreturn = 0,.is_manualfree = 0,.is_main = 0,.is_test = 0,.is_conditional = 0,.is_exported = 0,.is_keep_alive = 0,.is_unsafe = 0,.is_markused = 0,.is_method = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.is_direct_arr = 0,.has_return = 0,.should_be_skipped = 0,.has_await = 0,} })) = (*node._v__ast__FnDecl); } - else if (node._typ == 303 /* v.ast.ConstDecl */) { + else if (node._typ == 304 /* 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 == 311 /* v.ast.GlobalDecl */) { + else if (node._typ == 312 /* 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; @@ -64674,7 +64774,7 @@ void v__markused__Walker_mark_const_as_used(v__markused__Walker* w, string ckey) } map_set(&w->used_consts, &(string[]){ckey}, &(bool[]) { true }); v__ast__ConstField* _t2 = (v__ast__ConstField*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, w->all_consts), &(string[]){ckey})); - Option_v__ast__ConstField _t1 = {0}; + _option_v__ast__ConstField _t1 = {0}; if (_t2) { *((v__ast__ConstField*)&_t1.data) = *((v__ast__ConstField*)_t2); } else { @@ -64701,7 +64801,7 @@ void v__markused__Walker_mark_global_as_used(v__markused__Walker* w, string ckey } map_set(&w->used_globals, &(string[]){ckey}, &(bool[]) { true }); v__ast__GlobalField* _t2 = (v__ast__GlobalField*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, w->all_globals), &(string[]){ckey})); - Option_v__ast__GlobalField _t1 = {0}; + _option_v__ast__GlobalField _t1 = {0}; if (_t2) { *((v__ast__GlobalField*)&_t1.data) = *((v__ast__GlobalField*)_t2); } else { @@ -64809,43 +64909,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 == 305 /* v.ast.EmptyStmt */) { + if (node._typ == 306 /* v.ast.EmptyStmt */) { } - else if (node._typ == 297 /* v.ast.AsmStmt */) { + else if (node._typ == 298 /* 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 == 298 /* v.ast.AssertStmt */) { + else if (node._typ == 299 /* 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 == 299 /* v.ast.AssignStmt */) { + else if (node._typ == 300 /* 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 == 300 /* v.ast.Block */) { + else if (node._typ == 301 /* v.ast.Block */) { v__markused__Walker_stmts(w, (*node._v__ast__Block).stmts); } - else if (node._typ == 302 /* v.ast.ComptimeFor */) { + else if (node._typ == 303 /* v.ast.ComptimeFor */) { v__markused__Walker_stmts(w, (*node._v__ast__ComptimeFor).stmts); } - else if (node._typ == 303 /* v.ast.ConstDecl */) { + else if (node._typ == 304 /* v.ast.ConstDecl */) { v__markused__Walker_const_fields(w, (*node._v__ast__ConstDecl).fields); } - else if (node._typ == 307 /* v.ast.ExprStmt */) { + else if (node._typ == 308 /* v.ast.ExprStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ExprStmt).expr); } - else if (node._typ == 184 /* v.ast.FnDecl */) { + else if (node._typ == 185 /* v.ast.FnDecl */) { v__markused__Walker_fn_decl(w, (voidptr)&/*qq*/(*node._v__ast__FnDecl)); } - else if (node._typ == 308 /* v.ast.ForCStmt */) { + else if (node._typ == 309 /* 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 == 309 /* v.ast.ForInStmt */) { + else if (node._typ == 310 /* 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); @@ -64857,21 +64957,21 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { return; } v__ast__TypeSymbol* cond_type_sym = v__ast__Table_sym(w->table, (*node._v__ast__ForInStmt).cond_type); - Option_v__ast__Fn _t1; + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method(cond_type_sym, _SLIT("next")), _t1.state == 0) { v__ast__Fn next_fn = *(v__ast__Fn*)_t1.data; v__markused__Walker_fn_decl(w, ((v__ast__FnDecl*)(next_fn.source_fn))); } } } - else if (node._typ == 310 /* v.ast.ForStmt */) { + else if (node._typ == 311 /* 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 == 318 /* v.ast.Return */) { + else if (node._typ == 319 /* v.ast.Return */) { v__markused__Walker_exprs(w, (*node._v__ast__Return).exprs); } - else if (node._typ == 319 /* v.ast.SqlStmt */) { + else if (node._typ == 320 /* 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]; @@ -64879,13 +64979,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 == 320 /* v.ast.StructDecl */) { + else if (node._typ == 321 /* v.ast.StructDecl */) { v__markused__Walker_struct_fields(w, (*node._v__ast__StructDecl).fields); } - else if (node._typ == 304 /* v.ast.DeferStmt */) { + else if (node._typ == 305 /* v.ast.DeferStmt */) { v__markused__Walker_stmts(w, (*node._v__ast__DeferStmt).stmts); } - else if (node._typ == 311 /* v.ast.GlobalDecl */) { + else if (node._typ == 312 /* 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) { @@ -64893,25 +64993,25 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { } } } - else if (node._typ == 301 /* v.ast.BranchStmt */) { + else if (node._typ == 302 /* v.ast.BranchStmt */) { } - else if (node._typ == 306 /* v.ast.EnumDecl */) { + else if (node._typ == 307 /* v.ast.EnumDecl */) { } - else if (node._typ == 312 /* v.ast.GotoLabel */) { + else if (node._typ == 313 /* v.ast.GotoLabel */) { } - else if (node._typ == 313 /* v.ast.GotoStmt */) { + else if (node._typ == 314 /* v.ast.GotoStmt */) { } - else if (node._typ == 314 /* v.ast.HashStmt */) { + else if (node._typ == 315 /* v.ast.HashStmt */) { } - else if (node._typ == 315 /* v.ast.Import */) { + else if (node._typ == 316 /* v.ast.Import */) { } - else if (node._typ == 316 /* v.ast.InterfaceDecl */) { + else if (node._typ == 317 /* v.ast.InterfaceDecl */) { } - else if (node._typ == 317 /* v.ast.Module */) { + else if (node._typ == 318 /* v.ast.Module */) { } - else if (node._typ == 244 /* v.ast.TypeDecl */) { + else if (node._typ == 245 /* v.ast.TypeDecl */) { } - else if (node._typ == 278 /* v.ast.NodeError */) { + else if (node._typ == 279 /* v.ast.NodeError */) { } ; } @@ -64946,54 +65046,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 == 263 /* v.ast.EmptyExpr */) { + if (node._typ == 264 /* v.ast.EmptyExpr */) { } - else if (node._typ == 260 /* v.ast.ComptimeType */) { + else if (node._typ == 261 /* v.ast.ComptimeType */) { } - else if (node._typ == 245 /* v.ast.AnonFn */) { + else if (node._typ == 246 /* v.ast.AnonFn */) { v__markused__Walker_fn_decl(w, (voidptr)&/*qq*/(*node._v__ast__AnonFn).decl); } - else if (node._typ == 247 /* v.ast.ArrayInit */) { + else if (node._typ == 248 /* 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 == 249 /* v.ast.Assoc */) { + else if (node._typ == 250 /* v.ast.Assoc */) { v__markused__Walker_exprs(w, (*node._v__ast__Assoc).exprs); } - else if (node._typ == 246 /* v.ast.ArrayDecompose */) { + else if (node._typ == 247 /* v.ast.ArrayDecompose */) { v__markused__Walker_expr(w, (*node._v__ast__ArrayDecompose).expr); } - else if (node._typ == 253 /* v.ast.CallExpr */) { + else if (node._typ == 254 /* v.ast.CallExpr */) { v__markused__Walker_call_expr(w, (voidptr)&/*qq*/(*node._v__ast__CallExpr)); } - else if (node._typ == 254 /* v.ast.CastExpr */) { + else if (node._typ == 255 /* 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 == 255 /* v.ast.ChanInit */) { + else if (node._typ == 256 /* v.ast.ChanInit */) { v__markused__Walker_expr(w, (*node._v__ast__ChanInit).cap_expr); } - else if (node._typ == 261 /* v.ast.ConcatExpr */) { + else if (node._typ == 262 /* v.ast.ConcatExpr */) { v__markused__Walker_exprs(w, (*node._v__ast__ConcatExpr).vals); } - else if (node._typ == 259 /* v.ast.ComptimeSelector */) { + else if (node._typ == 260 /* 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 == 258 /* v.ast.ComptimeCall */) { + else if (node._typ == 259 /* 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 == 262 /* v.ast.DumpExpr */) { + else if (node._typ == 263 /* 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 == 266 /* v.ast.GoExpr */) { + else if (node._typ == 267 /* 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")); @@ -65003,7 +65103,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 == 270 /* v.ast.IndexExpr */) { + else if (node._typ == 271 /* 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); @@ -65015,7 +65115,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex w->table->used_maps++; } } - else if (node._typ == 271 /* v.ast.InfixExpr */) { + else if (node._typ == 272 /* 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); @@ -65024,7 +65124,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex } v__ast__TypeSymbol* sym = v__ast__Table_sym(w->table, (*node._v__ast__InfixExpr).left_type); if (sym->kind == v__ast__Kind__struct_) { - Option_v__ast__Fn _t1; + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method(sym, v__token__Kind_str((*node._v__ast__InfixExpr).op)), _t1.state == 0) { v__ast__Fn opmethod = *(v__ast__Fn*)_t1.data; v__markused__Walker_fn_decl(w, ((v__ast__FnDecl*)(opmethod.source_fn))); @@ -65038,10 +65138,10 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex w->table->used_maps++; } } - else if (node._typ == 269 /* v.ast.IfGuardExpr */) { + else if (node._typ == 270 /* v.ast.IfGuardExpr */) { v__markused__Walker_expr(w, (*node._v__ast__IfGuardExpr).expr); } - else if (node._typ == 268 /* v.ast.IfExpr */) { + else if (node._typ == 269 /* 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]; @@ -65049,7 +65149,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 == 267 /* v.ast.Ident */) { + else if (node._typ == 268 /* 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); @@ -65063,15 +65163,15 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex else { }; } - else if (node._typ == 274 /* v.ast.Likely */) { + else if (node._typ == 275 /* v.ast.Likely */) { v__markused__Walker_expr(w, (*node._v__ast__Likely).expr); } - else if (node._typ == 276 /* v.ast.MapInit */) { + else if (node._typ == 277 /* 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 == 277 /* v.ast.MatchExpr */) { + else if (node._typ == 278 /* 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]; @@ -65079,18 +65179,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 == 279 /* v.ast.None */) { + else if (node._typ == 280 /* v.ast.None */) { } - else if (node._typ == 282 /* v.ast.ParExpr */) { + else if (node._typ == 283 /* v.ast.ParExpr */) { v__markused__Walker_expr(w, (*node._v__ast__ParExpr).expr); } - else if (node._typ == 284 /* v.ast.PrefixExpr */) { + else if (node._typ == 285 /* v.ast.PrefixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__PrefixExpr).right); } - else if (node._typ == 283 /* v.ast.PostfixExpr */) { + else if (node._typ == 284 /* v.ast.PostfixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__PostfixExpr).expr); } - else if (node._typ == 285 /* v.ast.RangeExpr */) { + else if (node._typ == 286 /* v.ast.RangeExpr */) { if ((*node._v__ast__RangeExpr).has_low) { v__markused__Walker_expr(w, (*node._v__ast__RangeExpr).low); } @@ -65098,32 +65198,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 == 288 /* v.ast.SizeOf */) { + else if (node._typ == 289 /* v.ast.SizeOf */) { v__markused__Walker_expr(w, (*node._v__ast__SizeOf).expr); } - else if (node._typ == 273 /* v.ast.IsRefType */) { + else if (node._typ == 274 /* v.ast.IsRefType */) { v__markused__Walker_expr(w, (*node._v__ast__IsRefType).expr); } - else if (node._typ == 290 /* v.ast.StringInterLiteral */) { + else if (node._typ == 291 /* v.ast.StringInterLiteral */) { v__markused__Walker_exprs(w, (*node._v__ast__StringInterLiteral).exprs); } - else if (node._typ == 287 /* v.ast.SelectorExpr */) { + else if (node._typ == 288 /* v.ast.SelectorExpr */) { v__markused__Walker_expr(w, (*node._v__ast__SelectorExpr).expr); } - else if (node._typ == 289 /* v.ast.SqlExpr */) { + else if (node._typ == 290 /* 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 == 292 /* v.ast.StructInit */) { + else if (node._typ == 293 /* 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, 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) { @@ -65149,52 +65249,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 == 294 /* v.ast.TypeOf */) { + else if (node._typ == 295 /* v.ast.TypeOf */) { v__markused__Walker_expr(w, (*node._v__ast__TypeOf).expr); } - else if (node._typ == 248 /* v.ast.AsCast */) { + else if (node._typ == 249 /* v.ast.AsCast */) { v__markused__Walker_expr(w, (*node._v__ast__AsCast).expr); } - else if (node._typ == 250 /* v.ast.AtExpr */) { + else if (node._typ == 251 /* v.ast.AtExpr */) { } - else if (node._typ == 251 /* v.ast.BoolLiteral */) { + else if (node._typ == 252 /* v.ast.BoolLiteral */) { } - else if (node._typ == 265 /* v.ast.FloatLiteral */) { + else if (node._typ == 266 /* v.ast.FloatLiteral */) { } - else if (node._typ == 256 /* v.ast.CharLiteral */) { + else if (node._typ == 257 /* v.ast.CharLiteral */) { } - else if (node._typ == 272 /* v.ast.IntegerLiteral */) { + else if (node._typ == 273 /* v.ast.IntegerLiteral */) { } - else if (node._typ == 291 /* v.ast.StringLiteral */) { + else if (node._typ == 292 /* v.ast.StringLiteral */) { } - else if (node._typ == 252 /* v.ast.CTempVar */) { + else if (node._typ == 253 /* v.ast.CTempVar */) { v__markused__Walker_expr(w, (*node._v__ast__CTempVar).orig); } - else if (node._typ == 257 /* v.ast.Comment */) { + else if (node._typ == 258 /* v.ast.Comment */) { } - else if (node._typ == 264 /* v.ast.EnumVal */) { + else if (node._typ == 265 /* v.ast.EnumVal */) { } - else if (node._typ == 275 /* v.ast.LockExpr */) { + else if (node._typ == 276 /* v.ast.LockExpr */) { v__markused__Walker_stmts(w, (*node._v__ast__LockExpr).stmts); } - else if (node._typ == 280 /* v.ast.OffsetOf */) { + else if (node._typ == 281 /* v.ast.OffsetOf */) { } - else if (node._typ == 281 /* v.ast.OrExpr */) { + else if (node._typ == 282 /* v.ast.OrExpr */) { v__markused__Walker_or_block(w, (*node._v__ast__OrExpr)); } - else if (node._typ == 286 /* v.ast.SelectExpr */) { + else if (node._typ == 287 /* 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 == 293 /* v.ast.TypeNode */) { + else if (node._typ == 294 /* v.ast.TypeNode */) { } - else if (node._typ == 295 /* v.ast.UnsafeExpr */) { + else if (node._typ == 296 /* v.ast.UnsafeExpr */) { v__markused__Walker_expr(w, (*node._v__ast__UnsafeExpr).expr); } - else if (node._typ == 278 /* v.ast.NodeError */) { + else if (node._typ == 279 /* v.ast.NodeError */) { } ; } @@ -65231,7 +65331,7 @@ void v__markused__Walker_call_expr(v__markused__Walker* w, v__ast__CallExpr* nod } v__markused__Walker_mark_fn_as_used(w, fn_name); v__ast__FnDecl* _t3 = (v__ast__FnDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, w->all_fns), &(string[]){fn_name})); - Option_v__ast__FnDecl _t2 = {0}; + _option_v__ast__FnDecl _t2 = {0}; if (_t3) { *((v__ast__FnDecl*)&_t2.data) = *((v__ast__FnDecl*)_t3); } else { @@ -65256,7 +65356,7 @@ void v__markused__Walker_fn_by_name(v__markused__Walker* w, string fn_name) { return; } v__ast__FnDecl* _t2 = (v__ast__FnDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, w->all_fns), &(string[]){fn_name})); - Option_v__ast__FnDecl _t1 = {0}; + _option_v__ast__FnDecl _t1 = {0}; if (_t2) { *((v__ast__FnDecl*)&_t1.data) = *((v__ast__FnDecl*)_t2); } else { @@ -65333,7 +65433,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 != 291 /* v.ast.StringLiteral */ && (expr)._typ != 290 /* 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 != 292 /* v.ast.StringLiteral */ && (expr)._typ != 291 /* 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(")")); @@ -65390,7 +65490,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, 440) /*expected idx: 440, 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, 441) /*expected idx: 441, 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")); @@ -65448,7 +65548,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, 440) /*expected idx: 440, 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, 441) /*expected idx: 441, 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); @@ -65613,9 +65713,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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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")); @@ -65646,12 +65746,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal 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 == 245 /* v.ast.AnonFn */) { + if (expr._typ == 246 /* 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, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 267 /* v.ast.Ident */) { + else if (expr._typ == 268 /* 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); @@ -65667,7 +65767,7 @@ 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 == 253 /* v.ast.CallExpr */) { + else if (expr._typ == 254 /* 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); @@ -65713,7 +65813,7 @@ 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((rec_sym->info)._v__ast__Array,(rec_sym->info)._typ, 413) /*expected idx: 413, 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_"), /*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); @@ -65732,7 +65832,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, 271) /*expected idx: 271, 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, 272) /*expected idx: 272, 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) { @@ -65753,19 +65853,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 == 267 /* v.ast.Ident */) { + if ((infix_expr.left)._typ == 268 /* v.ast.Ident */) { left_expr = string__plus(_SLIT("*"), left_expr); } - if ((infix_expr.right)._typ == 267 /* v.ast.Ident */) { + if ((infix_expr.right)._typ == 268 /* 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 == 267 /* v.ast.Ident */) { + if ((infix_expr.left)._typ == 268 /* v.ast.Ident */) { right_expr = string__plus(_SLIT("*"), right_expr); } - if ((infix_expr.right)._typ == 267 /* v.ast.Ident */) { + if ((infix_expr.right)._typ == 268 /* v.ast.Ident */) { left_expr = string__plus(_SLIT("*"), left_expr); } } @@ -65806,7 +65906,7 @@ 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 413) /*expected idx: 413, 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; @@ -65834,12 +65934,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ 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 == 245 /* v.ast.AnonFn */) { + if (expr._typ == 246 /* 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, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 267 /* v.ast.Ident */) { + else if (expr._typ == 268 /* 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); @@ -65855,7 +65955,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 == 253 /* v.ast.CallExpr */) { + else if (expr._typ == 254 /* 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); @@ -65891,7 +65991,7 @@ 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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); @@ -65925,7 +66025,7 @@ 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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); @@ -65969,7 +66069,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains_methods(v__gen__c__Gen* g string left_type_str = v__gen__c__Gen_typ(g, t); string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT("_contains"), 0, { .d_c = 0 }}})); if (left_final_sym->kind == v__ast__Kind__array) { - v__ast__Type elem_type = (/* 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 */ ).elem_type; + v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((left_final_sym->info)._v__ast__Array,(left_final_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ).elem_type; string elem_type_str = v__gen__c__Gen_typ(g, elem_type); v__ast__Kind elem_kind = v__ast__Table_sym(g->table, elem_type)->kind; bool elem_is_not_ptr = v__ast__Type_nr_muls(elem_type) == 0; @@ -66006,7 +66106,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains_methods(v__gen__c__Gen* g 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 }}}))); } } else if (left_final_sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed left_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((left_final_sym->info)._v__ast__ArrayFixed,(left_final_sym->info)._typ, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed left_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((left_final_sym->info)._v__ast__ArrayFixed,(left_final_sym->info)._typ, 441) /*expected idx: 441, name: v.ast.ArrayFixed */ ; int size = left_info.size; v__ast__Type elem_type = left_info.elem_type; string elem_type_str = v__gen__c__Gen_typ(g, elem_type); @@ -66091,7 +66191,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_index_methods(v__gen__c__Gen* g) { 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, /*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 */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((final_left_sym->info)._v__ast__Array,(final_left_sym->info)._typ, 413) /*expected idx: 413, 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) { @@ -66170,7 +66270,7 @@ 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 413) /*expected idx: 413, 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 "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); @@ -66191,12 +66291,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal 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 == 245 /* v.ast.AnonFn */) { + if (expr._typ == 246 /* 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, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 267 /* v.ast.Ident */) { + else if (expr._typ == 268 /* 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); @@ -66212,7 +66312,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 == 253 /* v.ast.CallExpr */) { + else if (expr._typ == 254 /* 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); @@ -66253,7 +66353,7 @@ 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 413) /*expected idx: 413, 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 "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); @@ -66275,12 +66375,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__Cal 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 == 245 /* v.ast.AnonFn */) { + if (expr._typ == 246 /* 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, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 267 /* v.ast.Ident */) { + else if (expr._typ == 268 /* 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); @@ -66296,7 +66396,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 == 253 /* v.ast.CallExpr */) { + else if (expr._typ == 254 /* 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); @@ -66337,13 +66437,13 @@ 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 == 271 /* v.ast.InfixExpr */) { - Option_v__ast__Expr _t1; + if ((node.expr)._typ == 272 /* 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; (*node.expr._v__ast__InfixExpr).left = subst_expr; } - Option_v__ast__Expr _t2; + _option_v__ast__Expr _t2; if (_t2 = v__gen__c__Gen_assert_subexpression_to_ctemp(g, (*node.expr._v__ast__InfixExpr).right, (*node.expr._v__ast__InfixExpr).right_type), _t2.state == 0) { v__ast__Expr subst_expr = *(v__ast__Expr*)_t2.data; (*node.expr._v__ast__InfixExpr).right = subst_expr; @@ -66380,29 +66480,29 @@ 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 == 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)); +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 == 254 /* v.ast.CallExpr */) { + _option_v__ast__Expr _t1; + opt_ok2(&(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 == 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)); + else if (expr._typ == 283 /* v.ast.ParExpr */) { + if (((*expr._v__ast__ParExpr).expr)._typ == 254 /* v.ast.CallExpr */) { + _option_v__ast__Expr _t2; + opt_ok2(&(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 == 287 /* v.ast.SelectorExpr */) { - if (((*expr._v__ast__SelectorExpr).expr)._typ == 253 /* v.ast.CallExpr */) { + else if (expr._typ == 288 /* v.ast.SelectorExpr */) { + if (((*expr._v__ast__SelectorExpr).expr)._typ == 254 /* 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, 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} }; + if ((/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, 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} }; } } - Option_v__ast__Expr _t4; - 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__SelectorExpr_to_sumtype_v__ast__Expr(&(*expr._v__ast__SelectorExpr)), expr_type)))) }, (Option*)(&_t4), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t4; + opt_ok2(&(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__SelectorExpr_to_sumtype_v__ast__Expr(&(*expr._v__ast__SelectorExpr)), expr_type)))) }, (_option*)(&_t4), sizeof(v__ast__Expr)); return _t4; } } @@ -66410,7 +66510,7 @@ VV_LOCAL_SYMBOL Option_v__ast__Expr v__gen__c__Gen_assert_subexpression_to_ctemp else { } ; - return (Option_v__ast__Expr){ .state=2, .err=_const_v__gen__c__unsupported_ctemp_assert_transform, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Expr){ .state=2, .err=_const_v__gen__c__unsupported_ctemp_assert_transform, .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_postfailure_mode(v__gen__c__Gen* g, v__ast__AssertStmt node) { @@ -66438,7 +66538,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ 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"), /*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 */) { + if (node.expr._typ == 272 /* 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))); @@ -66452,7 +66552,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ 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 == 253 /* v.ast.CallExpr */) { + else if (node.expr._typ == 254 /* 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 }}}))); } @@ -66465,37 +66565,37 @@ 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 == 254 /* v.ast.CastExpr */) { + if (expr._typ == 255 /* v.ast.CastExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 268 /* v.ast.IfExpr */) { + else if (expr._typ == 269 /* v.ast.IfExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 270 /* v.ast.IndexExpr */) { + else if (expr._typ == 271 /* v.ast.IndexExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 277 /* v.ast.MatchExpr */) { + else if (expr._typ == 278 /* v.ast.MatchExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 284 /* v.ast.PrefixExpr */) { - if (((*expr._v__ast__PrefixExpr).right)._typ == 254 /* v.ast.CastExpr */) { + else if (expr._typ == 285 /* v.ast.PrefixExpr */) { + if (((*expr._v__ast__PrefixExpr).right)._typ == 255 /* 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 == 293 /* v.ast.TypeNode */) { + else if (expr._typ == 294 /* 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, /*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 == 291 /* v.ast.StringLiteral */) { + if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type) && (expr)._typ == 292 /* v.ast.StringLiteral */) { should_clone = false; } - if ((expr)._typ == 252 /* v.ast.CTempVar */) { - if (((*expr._v__ast__CTempVar).orig)._typ == 253 /* v.ast.CallExpr */) { + if ((expr)._typ == 253 /* v.ast.CTempVar */) { + if (((*expr._v__ast__CTempVar).orig)._typ == 254 /* v.ast.CallExpr */) { should_clone = false; if ((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option) { should_clone = true; @@ -66534,23 +66634,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 == 253 /* v.ast.CallExpr */) { + if (right_expr._typ == 254 /* v.ast.CallExpr */) { return_type = (*right_expr._v__ast__CallExpr).return_type; } - else if (right_expr._typ == 275 /* v.ast.LockExpr */) { + else if (right_expr._typ == 276 /* v.ast.LockExpr */) { return_type = (*right_expr._v__ast__LockExpr).typ; } - else if (right_expr._typ == 277 /* v.ast.MatchExpr */) { + else if (right_expr._typ == 278 /* v.ast.MatchExpr */) { return_type = (*right_expr._v__ast__MatchExpr).return_type; } - else if (right_expr._typ == 268 /* v.ast.IfExpr */) { + else if (right_expr._typ == 269 /* 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 == 267 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 287 /* 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 == 268 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 288 /* v.ast.SelectorExpr */); sref_name = _SLIT(""); type_to_free = _SLIT(""); if (af) { @@ -66560,7 +66660,7 @@ 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 == 267 /* v.ast.Ident */) { + if ((left0)._typ == 268 /* v.ast.Ident */) { if (string__eq((*left0._v__ast__Ident).name, _SLIT("_"))) { ok = false; } @@ -66615,11 +66715,11 @@ string sref_name; bool blank_assign = false; v__ast__Ident ident = ((v__ast__Ident){.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.info = {0},.scope = 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,},.tok_kind = 0,.language = 0,.kind = 0,.comptime = 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 == 267 /* v.ast.Ident */) { + if ((left)->_typ == 268 /* 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 == 377 /* v.ast.IdentVar */) { + if ((left_info)._typ == 378 /* 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); @@ -66628,13 +66728,13 @@ string sref_name; var_type = v__ast__Type_set_flag(var_type, v__ast__TypeFlag__atomic_f); } } - 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 */) { + if (((*left->_v__ast__Ident).obj)._typ == 326 /* v.ast.Var */) { + if ((val)._typ == 260 /* v.ast.ComptimeSelector */) { + if (((*val._v__ast__ComptimeSelector).field_expr)._typ == 288 /* v.ast.SelectorExpr */) { + if (((*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 268 /* 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}; + _option_v__ast__Type _t1 = {0}; if (_t2) { *((v__ast__Type*)&_t1.data) = *((v__ast__Type*)_t2); } else { @@ -66650,10 +66750,10 @@ string sref_name; (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = var_type; } } - } else if ((val)._typ == 258 /* v.ast.ComptimeCall */) { + } else if ((val)._typ == 259 /* 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}; + _option_v__ast__Type _t3 = {0}; if (_t4) { *((v__ast__Type*)&_t3.data) = *((v__ast__Type*)_t4); } else { @@ -66674,19 +66774,19 @@ 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 == 247 /* v.ast.ArrayInit */) { + if (val._typ == 248 /* 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 == 253 /* v.ast.CallExpr */) { + else if (val._typ == 254 /* v.ast.CallExpr */) { is_call = true; return_type = (*val._v__ast__CallExpr).return_type; } - else if (val._typ == 245 /* v.ast.AnonFn */) { + else if (val._typ == 246 /* v.ast.AnonFn */) { if (blank_assign) { v__gen__c__Gen_write(g, _SLIT("{")); } - if ((is_decl || blank_assign) && (left)->_typ == 267 /* v.ast.Ident */) { + if ((is_decl || blank_assign) && (left)->_typ == 268 /* 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, /*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; @@ -66699,7 +66799,7 @@ string sref_name; v__gen__c__Gen_expr(g, *left); g->is_assign_lhs = false; g->is_arraymap_set = false; - if ((left)->_typ == 270 /* v.ast.IndexExpr */) { + if ((left)->_typ == 271 /* 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); @@ -66723,14 +66823,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 != 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; + bool is_fixed_array_var = unaliased_right_sym->kind == v__ast__Kind__array_fixed && (val)._typ != 248 /* v.ast.ArrayInit */ && (((val)._typ == 268 /* v.ast.Ident */ || (val)._typ == 271 /* v.ast.IndexExpr */ || (val)._typ == 254 /* v.ast.CallExpr */ || (val)._typ == 288 /* v.ast.SelectorExpr */) || ((val)._typ == 255 /* v.ast.CastExpr */ && ((/* as */ *(v__ast__CastExpr*)__as_cast((val)._v__ast__CastExpr,(val)._typ, 255) /*expected idx: 255, name: v.ast.CastExpr */ ).expr)._typ != 248 /* 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 == 270 /* v.ast.IndexExpr */) { + if ((val)._typ == 271 /* v.ast.IndexExpr */) { g->assign_op = v__token__Kind__decl_assign; } g->is_assign_lhs = false; @@ -66746,17 +66846,17 @@ string sref_name; 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 == 267 /* 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 == 268 /* 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, 247) /*expected idx: 247, name: v.ast.ArrayInit */ ; + v__ast__ArrayInit right = /* as */ *(v__ast__ArrayInit*)__as_cast((val)._v__ast__ArrayInit,(val)._typ, 248) /*expected idx: 248, 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, /*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, 267) /*expected idx: 267, name: v.ast.Ident */ ; + v__ast__Ident right = /* as */ *(v__ast__Ident*)__as_cast((val)._v__ast__Ident,(val)._typ, 268) /*expected idx: 268, name: v.ast.Ident */ ; v_var = right.name; } int pos = g->out.len; @@ -66793,7 +66893,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 == 270 /* v.ast.IndexExpr */) { + if ((left)->_typ == 271 /* v.ast.IndexExpr */) { v__gen__c__Gen_expr(g, *left); v__gen__c__Gen_write(g, _SLIT("string__plus(")); } else { @@ -66825,8 +66925,8 @@ 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, 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; + if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 418) /*expected idx: 418, 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, 418) /*expected idx: 418, 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(" = "), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); @@ -66844,7 +66944,7 @@ string sref_name; return; } else { 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); + _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 `"), /*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); @@ -66862,7 +66962,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, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((right_sym->info)._v__ast__FnType,(right_sym->info)._typ, 445) /*expected idx: 445, 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(""); @@ -66893,14 +66993,14 @@ 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 == 417 /* v.ast.Struct */) { + if ((val_sym->info)._typ == 418 /* v.ast.Struct */) { if ((*val_sym->info._v__ast__Struct).generic_types.len > 0) { - if ((val)._typ == 292 /* v.ast.StructInit */) { + if ((val)._typ == 293 /* 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, /*115 &string*/0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); is_used_var_styp = true; - } 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 */) { + } else if ((val)._typ == 285 /* v.ast.PrefixExpr */) { + if ((*val._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*val._v__ast__PrefixExpr).right)._typ == 293 /* 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, /*115 &string*/0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); is_used_var_styp = true; @@ -66916,7 +67016,7 @@ string sref_name; } } } - if ((left)->_typ == 267 /* v.ast.Ident */ || (left)->_typ == 287 /* v.ast.SelectorExpr */) { + if ((left)->_typ == 268 /* v.ast.Ident */ || (left)->_typ == 288 /* v.ast.SelectorExpr */) { g->prevent_sum_type_unwrapping_once = true; } if (!is_fixed_array_var || is_decl) { @@ -66966,7 +67066,7 @@ string sref_name; 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 == 247 /* v.ast.ArrayInit */) { + if ((val)._typ == 248 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*val._v__ast__ArrayInit), ident.name); } else { v__gen__c__Gen_write(g, _SLIT("{0}")); @@ -66978,7 +67078,7 @@ string sref_name; if (v__ast__Expr_is_auto_deref_var(val)) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((val)._typ == 247 /* v.ast.ArrayInit */) { + if ((val)._typ == 248 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*val._v__ast__ArrayInit), ident.name); } else { v__gen__c__Gen_expr(g, val); @@ -67034,12 +67134,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_multi_return_assign(v__gen__c__Gen* g, v v__ast__Expr lx = ((v__ast__Expr*)node->left.data)[i]; bool is_auto_heap = false; v__ast__Ident ident = ((v__ast__Ident){.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.info = {0},.scope = 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,},.tok_kind = 0,.language = 0,.kind = 0,.comptime = 0,.is_mut = 0,}); - if ((lx)._typ == 267 /* v.ast.Ident */) { + if ((lx)._typ == 268 /* 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 == 325 /* v.ast.Var */) { + if (((*lx._v__ast__Ident).obj)._typ == 326 /* v.ast.Var */) { is_auto_heap = (*(*lx._v__ast__Ident).obj._v__ast__Var).is_auto_heap; } } @@ -67098,26 +67198,26 @@ 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 == 267 /* v.ast.Ident */) { + if (left._typ == 268 /* 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, 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_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, 445) /*expected idx: 445, 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, /*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 == 270 /* v.ast.IndexExpr */) { + else if (left._typ == 271 /* 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 413) /*expected idx: 413, 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, 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_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, 445) /*expected idx: 445, 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); @@ -67138,7 +67238,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, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 414) /*expected idx: 414, 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); @@ -67146,7 +67246,7 @@ 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, 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_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, 445) /*expected idx: 445, 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, /*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 }}}))); @@ -67168,7 +67268,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a } } } - else if (left._typ == 287 /* v.ast.SelectorExpr */) { + else if (left._typ == 288 /* 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, /*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); @@ -67191,11 +67291,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 == 267 /* v.ast.Ident */) { + if (val._typ == 268 /* 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 == 267 /* v.ast.Ident */) { + if ((lx)._typ == 268 /* 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)); @@ -67208,7 +67308,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.IndexExpr */) { + else if (val._typ == 271 /* 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]; @@ -67223,9 +67323,9 @@ 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 == 271 /* v.ast.InfixExpr */) { + else if (val._typ == 272 /* v.ast.InfixExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*val._v__ast__InfixExpr).left_type); - Option_v__ast__Fn _t3; + _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) { string left_styp = v__gen__c__Gen_typ(g, v__ast__Type_set_nr_muls((*val._v__ast__InfixExpr).left_type, 0)); v__gen__c__Gen_write(g, left_styp); @@ -67243,15 +67343,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 == 284 /* v.ast.PrefixExpr */) { + else if (val._typ == 285 /* 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 == 283 /* v.ast.PostfixExpr */) { + else if (val._typ == 284 /* 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 == 287 /* v.ast.SelectorExpr */) { + else if (val._typ == 288 /* 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]; @@ -67458,7 +67558,7 @@ 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, 432) /*expected idx: 432, name: v.ast.Alias */ ; + v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((left.sym->info)._v__ast__Alias,(left.sym->info)._typ, 433) /*expected idx: 433, 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 "), /*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 }}}))); @@ -67624,7 +67724,7 @@ 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, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((value.sym->info)._v__ast__FnType,(value.sym->info)._typ, 445) /*expected idx: 445, 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"), /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*v) ("), 0, { .d_c = 0 }}}))); int arg_len = func.func.params.len; @@ -67759,7 +67859,7 @@ strings__Builder fn_builder; 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_"), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("(a._typ);"), 0, { .d_c = 0 }}}))); - if ((info)._typ == 435 /* v.ast.Interface */) { + if ((info)._typ == 436 /* 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 == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); @@ -67815,7 +67915,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 == 432 /* v.ast.Alias */) { + if ((sym->info)._typ == 433 /* 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); } @@ -67856,7 +67956,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 == 432 /* v.ast.Alias */) { + if ((sym->info)._typ == 433 /* 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); } @@ -67865,13 +67965,13 @@ 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 == 417 /* v.ast.Struct */) { + if (sym->info._typ == 418 /* 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 == 412 /* v.ast.Array */) { + else if (sym->info._typ == 413 /* 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 == 413 /* v.ast.Map */) { + else if (sym->info._typ == 414 /* v.ast.Map */) { v__gen__c__Gen_gen_free_for_map(g, (*sym->info._v__ast__Map), styp, fn_name); } @@ -68268,13 +68368,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 == 432 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { + if ((sym->info)._typ == 433 /* 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 == 417 /* v.ast.Struct */) { + if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && (sym->info)._typ == 418 /* 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,}) })); @@ -68306,44 +68406,44 @@ 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_result(g, typ.typ, styp, str_fn_name); return; } - if (sym->info._typ == 432 /* v.ast.Alias */) { + if (sym->info._typ == 433 /* 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 == 412 /* v.ast.Array */) { + else if (sym->info._typ == 413 /* 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 == 440 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 441 /* 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 == 446 /* v.ast.Enum */) { + else if (sym->info._typ == 447 /* 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 == 444 /* v.ast.FnType */) { + else if (sym->info._typ == 445 /* 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 == 417 /* v.ast.Struct */) { + else if (sym->info._typ == 418 /* 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 == 413 /* v.ast.Map */) { + else if (sym->info._typ == 414 /* 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 == 443 /* v.ast.MultiReturn */) { + else if (sym->info._typ == 444 /* 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 == 436 /* v.ast.SumType */) { + else if (sym->info._typ == 437 /* 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 == 435 /* v.ast.Interface */) { + else if (sym->info._typ == 436 /* 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 == 441 /* v.ast.Chan */) { + else if (sym->info._typ == 442 /* 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 == 442 /* v.ast.Thread */) { + else if (sym->info._typ == 443 /* v.ast.Thread */) { v__gen__c__Gen_gen_str_for_thread(g, (*sym->info._v__ast__Thread), styp, str_fn_name); } @@ -68744,7 +68844,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array(v__gen__c__Gen* g, v__ast_ #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 == 432 /* v.ast.Alias */) { + if ((sym->info)._typ == 433 /* v.ast.Alias */) { typ = (*sym->info._v__ast__Alias).parent_type; sym = v__ast__Table_sym(g->table, typ); } @@ -68824,7 +68924,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_array_fixed(v__gen__c__Gen* g, v #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 == 432 /* v.ast.Alias */) { + if ((sym->info)._typ == 433 /* v.ast.Alias */) { typ = (*sym->info._v__ast__Alias).parent_type; sym = v__ast__Table_sym(g->table, typ); } @@ -68892,7 +68992,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_str_for_map(v__gen__c__Gen* g, v__ast__M #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 == 432 /* v.ast.Alias */) { + if ((key_sym->info)._typ == 433 /* v.ast.Alias */) { key_typ = (*key_sym->info._v__ast__Alias).parent_type; key_sym = v__ast__Table_sym(g->table, key_typ); } @@ -68903,7 +69003,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 == 432 /* v.ast.Alias */) { + if ((val_sym->info)._typ == 433 /* v.ast.Alias */) { val_typ = (*val_sym->info._v__ast__Alias).parent_type; val_sym = v__ast__Table_sym(g->table, val_typ); } @@ -69081,7 +69181,7 @@ strings__Builder fn_body; string _t2; /* if prepend */ if (sym_has_str_method) { 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 */) { + if ((sym->info)._typ == 418 /* 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; @@ -69403,7 +69503,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre for (int _t4 = 0; _t4 < _t3.len; ++_t4) { v__gen__c__Gen* g = ((v__gen__c__Gen**)_t3.data)[_t4]; _PUSH_MANY(&global_g.embedded_files, (g->embedded_files), _t5, Array_v__ast__EmbeddedFile); - Option_int _t6 = strings__Builder_write(&global_g.out, g->out); + _option_int _t6 = strings__Builder_write(&global_g.out, g->out); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; _v_panic(IError_str(err)); @@ -69412,7 +69512,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t6.data); - Option_int _t7 = strings__Builder_write(&global_g.cheaders, g->cheaders); + _option_int _t7 = strings__Builder_write(&global_g.cheaders, g->cheaders); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; _v_panic(IError_str(err)); @@ -69421,7 +69521,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t7.data); - Option_int _t8 = strings__Builder_write(&global_g.includes, g->includes); + _option_int _t8 = strings__Builder_write(&global_g.includes, g->includes); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; _v_panic(IError_str(err)); @@ -69430,7 +69530,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t8.data); - Option_int _t9 = strings__Builder_write(&global_g.typedefs, g->typedefs); + _option_int _t9 = strings__Builder_write(&global_g.typedefs, g->typedefs); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; _v_panic(IError_str(err)); @@ -69439,7 +69539,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t9.data); - Option_int _t10 = strings__Builder_write(&global_g.type_definitions, g->type_definitions); + _option_int _t10 = strings__Builder_write(&global_g.type_definitions, g->type_definitions); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; _v_panic(IError_str(err)); @@ -69448,7 +69548,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t10.data); - Option_int _t11 = strings__Builder_write(&global_g.alias_definitions, g->alias_definitions); + _option_int _t11 = strings__Builder_write(&global_g.alias_definitions, g->alias_definitions); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; _v_panic(IError_str(err)); @@ -69457,7 +69557,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t11.data); - Option_int _t12 = strings__Builder_write(&global_g.definitions, g->definitions); + _option_int _t12 = strings__Builder_write(&global_g.definitions, g->definitions); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; _v_panic(IError_str(err)); @@ -69466,7 +69566,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t12.data); - Option_int _t13 = strings__Builder_write(&global_g.gowrappers, g->gowrappers); + _option_int _t13 = strings__Builder_write(&global_g.gowrappers, g->gowrappers); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; _v_panic(IError_str(err)); @@ -69475,7 +69575,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t13.data); - Option_int _t14 = strings__Builder_write(&global_g.stringliterals, g->stringliterals); + _option_int _t14 = strings__Builder_write(&global_g.stringliterals, g->stringliterals); if (_t14.state != 0) { /*or block*/ IError err = _t14.err; _v_panic(IError_str(err)); @@ -69484,7 +69584,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t14.data); - Option_int _t15 = strings__Builder_write(&global_g.auto_str_funcs, g->auto_str_funcs); + _option_int _t15 = strings__Builder_write(&global_g.auto_str_funcs, g->auto_str_funcs); if (_t15.state != 0) { /*or block*/ IError err = _t15.err; _v_panic(IError_str(err)); @@ -69493,7 +69593,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t15.data); - Option_int _t16 = strings__Builder_write(&global_g.dump_funcs, g->auto_str_funcs); + _option_int _t16 = strings__Builder_write(&global_g.dump_funcs, g->auto_str_funcs); if (_t16.state != 0) { /*or block*/ IError err = _t16.err; _v_panic(IError_str(err)); @@ -69502,7 +69602,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t16.data); - Option_int _t17 = strings__Builder_write(&global_g.comptime_definitions, g->comptime_definitions); + _option_int _t17 = strings__Builder_write(&global_g.comptime_definitions, g->comptime_definitions); if (_t17.state != 0) { /*or block*/ IError err = _t17.err; _v_panic(IError_str(err)); @@ -69511,7 +69611,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t17.data); - Option_int _t18 = strings__Builder_write(&global_g.pcs_declarations, g->pcs_declarations); + _option_int _t18 = strings__Builder_write(&global_g.pcs_declarations, g->pcs_declarations); if (_t18.state != 0) { /*or block*/ IError err = _t18.err; _v_panic(IError_str(err)); @@ -69520,7 +69620,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t18.data); - Option_int _t19 = strings__Builder_write(&global_g.hotcode_definitions, g->hotcode_definitions); + _option_int _t19 = strings__Builder_write(&global_g.hotcode_definitions, g->hotcode_definitions); if (_t19.state != 0) { /*or block*/ IError err = _t19.err; _v_panic(IError_str(err)); @@ -69529,7 +69629,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t19.data); - Option_int _t20 = strings__Builder_write(&global_g.embedded_data, g->embedded_data); + _option_int _t20 = strings__Builder_write(&global_g.embedded_data, g->embedded_data); if (_t20.state != 0) { /*or block*/ IError err = _t20.err; _v_panic(IError_str(err)); @@ -69538,7 +69638,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t20.data); - Option_int _t21 = strings__Builder_write(&global_g.shared_types, g->shared_types); + _option_int _t21 = strings__Builder_write(&global_g.shared_types, g->shared_types); if (_t21.state != 0) { /*or block*/ IError err = _t21.err; _v_panic(IError_str(err)); @@ -69547,7 +69647,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t21.data); - Option_int _t22 = strings__Builder_write(&global_g.shared_functions, g->channel_definitions); + _option_int _t22 = strings__Builder_write(&global_g.shared_functions, g->channel_definitions); if (_t22.state != 0) { /*or block*/ IError err = _t22.err; _v_panic(IError_str(err)); @@ -69660,7 +69760,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre bool v = (*(bool*)DenseArray_value(&_t47.key_values, _t48)); map_set(&global_g.sumtype_definitions, &(int[]){k}, &(bool[]) { v }); } - Option_int _t51 = strings__Builder_write(&global_g.json_forward_decls, g->json_forward_decls); + _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)); @@ -69669,7 +69769,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(&global_g.enum_typedefs, g->enum_typedefs); + _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)); @@ -69678,7 +69778,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(&global_g.channel_definitions, g->channel_definitions); + _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)); @@ -69687,7 +69787,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t53.data); - Option_int _t54 = strings__Builder_write(&global_g.sql_buf, g->sql_buf); + _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)); @@ -69696,7 +69796,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(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); + _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)); @@ -69705,7 +69805,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(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); + _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)); @@ -69714,7 +69814,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(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); + _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)); @@ -70349,7 +70449,7 @@ 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, 436) /*expected idx: 436, name: v.ast.SumType */ ; + v__ast__SumType sum_info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 437) /*expected idx: 437, name: v.ast.SumType */ ; if (sum_info.is_generic) { continue; } @@ -70398,10 +70498,10 @@ void v__gen__c__Gen_write_typeof_functions(v__gen__c__Gen* g) { } v__gen__c__Gen_writeln(g, _SLIT("}")); } else if (sym->kind == v__ast__Kind__interface_) { - if ((sym->info)._typ != 435 /* v.ast.Interface */) { + if ((sym->info)._typ != 436 /* v.ast.Interface */) { continue; } - 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 */ ; + v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((sym->info)._v__ast__Interface,(sym->info)._typ, 436) /*expected idx: 436, name: v.ast.Interface */ ; if (inter_info.is_generic) { continue; } @@ -70516,7 +70616,7 @@ 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_"), /*115 &string*/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")); } @@ -70547,18 +70647,18 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_result_type_text(v__gen__c__Gen* g, string } VV_LOCAL_SYMBOL string v__gen__c__Gen_register_optional(v__gen__c__Gen* g, v__ast__Type t) { - 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; + multi_return_string_string mr_37846 = v__gen__c__Gen_optional_type_name(g, t); + string styp = mr_37846.arg0; + string base = mr_37846.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; + multi_return_string_string mr_37979 = v__gen__c__Gen_result_type_name(g, t); + string styp = mr_37979.arg0; + string base = mr_37979.arg1; map_set(&g->results, &(string[]){base}, &(string[]) { styp }); string _t1 = styp; return _t1; @@ -70762,14 +70862,14 @@ 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_"), /*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 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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 ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_void){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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 == 417 /* v.ast.Struct */) { + if (sym->info._typ == 418 /* 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) { @@ -70780,7 +70880,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type ty styp = /*f*/string__plus(styp, sgtyps); } } - else if (sym->info._typ == 435 /* v.ast.Interface */) { + else if (sym->info._typ == 436 /* 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) { @@ -70791,7 +70891,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type ty styp = /*f*/string__plus(styp, sgtyps); } } - else if (sym->info._typ == 436 /* v.ast.SumType */) { + else if (sym->info._typ == 437 /* 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) { @@ -70809,7 +70909,7 @@ 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ; if (!info.is_typedef) { styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT0, 0, { .d_c = 0 }}})); } @@ -70838,20 +70938,20 @@ 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 413) /*expected idx: 413, 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 "), /*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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, 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 == 444 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 445 /* 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); @@ -70913,7 +71013,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 == 417 /* v.ast.Struct */) { + if ((parent->info)._typ == 418 /* v.ast.Struct */) { is_typedef = (*parent->info._v__ast__Struct).is_typedef; } string parent_styp = parent->cname; @@ -70924,10 +71024,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 == 432 /* v.ast.Alias */) { + if ((sym.info)._typ == 433 /* 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 == 440 /* v.ast.ArrayFixed */) { + if ((parent_sym->info)._typ == 441 /* 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; @@ -70951,10 +71051,10 @@ void v__gen__c__Gen_write_interface_typedef(v__gen__c__Gen* g, v__ast__TypeSymbo } void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v__ast__TypeSymbol sym) { - if ((sym.info)._typ != 435 /* v.ast.Interface */) { + if ((sym.info)._typ != 436 /* v.ast.Interface */) { return; } - 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 */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((sym.info)._v__ast__Interface,(sym.info)._typ, 436) /*expected idx: 436, name: v.ast.Interface */ ; if (info.is_generic) { return; } @@ -70983,7 +71083,7 @@ void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v_ } 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, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym.info)._v__ast__FnType,(sym.info)._typ, 445) /*expected idx: 445, name: v.ast.FnType */ ; v__ast__Fn func = info.func; bool is_fn_sig = (func.name).len == 0; bool not_anon = !info.is_anon; @@ -71130,7 +71230,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 == 253 /* v.ast.CallExpr */) { + if ((expr)._typ == 254 /* v.ast.CallExpr */) { bool _t1 = (*expr._v__ast__CallExpr).is_noreturn; return _t1; } @@ -71149,8 +71249,8 @@ 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 == 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 */) { + if ((stmt)._typ == 308 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).typ == _const_v__ast__error_type_idx || ((*stmt._v__ast__ExprStmt).expr)._typ == 280 /* 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); @@ -71166,16 +71266,16 @@ 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(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok2(&("), /*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*)(&"), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" }, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("*)(&"), /*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 == 307 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 308 /* v.ast.ExprStmt */) { is_noreturn = v__gen__c__is_noreturn_callexpr((*stmt._v__ast__ExprStmt).expr); } if (!is_noreturn) { @@ -71188,7 +71288,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 == 307 /* v.ast.ExprStmt */) { + if ((g->inside_if_optional || g->inside_match_optional) && (stmt)._typ == 308 /* v.ast.ExprStmt */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } @@ -71204,13 +71304,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 != 184 /* v.ast.FnDecl */ && g->inside_ternary == 0) { + if ((stmt)._typ != 185 /* v.ast.FnDecl */ && g->inside_ternary == 0) { v__token__Pos stmt_pos = (*(stmt.pos)); if (stmt_pos.pos == 0) { - if ((stmt)._typ == 317 /* v.ast.Module */) { + if ((stmt)._typ == 318 /* v.ast.Module */) { return; } - if ((stmt)._typ == 307 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 308 /* v.ast.ExprStmt */) { stmt_pos = v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr); } if (stmt_pos.pos == 0) { @@ -71245,21 +71345,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 == 305 /* v.ast.EmptyStmt */) { + if (node._typ == 306 /* v.ast.EmptyStmt */) { } - else if (node._typ == 297 /* v.ast.AsmStmt */) { + else if (node._typ == 298 /* 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 == 298 /* v.ast.AssertStmt */) { + else if (node._typ == 299 /* 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 == 299 /* v.ast.AssignStmt */) { + else if (node._typ == 300 /* 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 == 300 /* v.ast.Block */) { + else if (node._typ == 301 /* 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")); @@ -71269,11 +71369,11 @@ 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 == 301 /* v.ast.BranchStmt */) { + else if (node._typ == 302 /* 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})); - Option_v__ast__Stmt_ptr _t1 = {0}; + _option_v__ast__Stmt_ptr _t1 = {0}; if (_t2) { *((v__ast__Stmt**)&_t1.data) = *((v__ast__Stmt**)_t2); } else { @@ -71288,17 +71388,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } v__ast__Stmt* x = *(v__ast__Stmt**)_t1.data; - if (x->_typ == 308 /* v.ast.ForCStmt */) { + if (x->_typ == 309 /* 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 == 309 /* v.ast.ForInStmt */) { + else if (x->_typ == 310 /* 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 == 310 /* v.ast.ForStmt */) { + else if (x->_typ == 311 /* 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); } @@ -71314,17 +71414,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } } else { v__ast__Stmt* inner_loop = g->inner_loop; - if (inner_loop->_typ == 308 /* v.ast.ForCStmt */) { + if (inner_loop->_typ == 309 /* 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 == 309 /* v.ast.ForInStmt */) { + else if (inner_loop->_typ == 310 /* 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 == 310 /* v.ast.ForStmt */) { + else if (inner_loop->_typ == 311 /* 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); } @@ -71340,64 +71440,40 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { 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 == 303 /* v.ast.ConstDecl */) { + else if (node._typ == 304 /* 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 == 302 /* v.ast.ComptimeFor */) { + else if (node._typ == 303 /* v.ast.ComptimeFor */) { v__gen__c__Gen_comptime_for(g, (*node._v__ast__ComptimeFor)); } - else if (node._typ == 304 /* v.ast.DeferStmt */) { + else if (node._typ == 305 /* 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, /*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 == 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 {")); - string cur_enum_expr = _SLIT(""); - 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"), /*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); - strings__Builder_write_string(&g->enum_typedefs, expr_str); - cur_enum_expr = expr_str; - 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 << "), /*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, /*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("} "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + else if (node._typ == 307 /* v.ast.EnumDecl */) { + v__gen__c__Gen_enum_decl(g, (*node._v__ast__EnumDecl)); } - else if (node._typ == 307 /* v.ast.ExprStmt */) { + else if (node._typ == 308 /* 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 != 277 /* 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 != 278 /* 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 != 268 /* 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 != 269 /* v.ast.IfExpr */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } - else if (node._typ == 184 /* v.ast.FnDecl */) { + else if (node._typ == 185 /* v.ast.FnDecl */) { v__gen__c__Gen_fn_decl(g, (*node._v__ast__FnDecl)); } - else if (node._typ == 308 /* v.ast.ForCStmt */) { + else if (node._typ == 309 /* 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; @@ -71411,7 +71487,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 == 309 /* v.ast.ForInStmt */) { + else if (node._typ == 310 /* 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; @@ -71425,7 +71501,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 == 310 /* v.ast.ForStmt */) { + else if (node._typ == 311 /* 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; @@ -71439,17 +71515,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 == 311 /* v.ast.GlobalDecl */) { + else if (node._typ == 312 /* v.ast.GlobalDecl */) { v__gen__c__Gen_global_decl(g, (*node._v__ast__GlobalDecl)); } - else if (node._typ == 312 /* v.ast.GotoLabel */) { + else if (node._typ == 313 /* 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 == 313 /* v.ast.GotoStmt */) { + else if (node._typ == 314 /* 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 "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoStmt).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 314 /* v.ast.HashStmt */) { + else if (node._typ == 315 /* 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) { @@ -71517,11 +71593,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } } } - else if (node._typ == 315 /* v.ast.Import */) { + else if (node._typ == 316 /* v.ast.Import */) { } - else if (node._typ == 316 /* v.ast.InterfaceDecl */) { + else if (node._typ == 317 /* 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, 435) /*expected idx: 435, name: v.ast.Interface */ ).is_generic) { + if (!(/* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 436) /*expected idx: 436, 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)) { @@ -71533,19 +71609,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } } } - else if (node._typ == 317 /* v.ast.Module */) { + else if (node._typ == 318 /* 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 == 278 /* v.ast.NodeError */) { + else if (node._typ == 279 /* v.ast.NodeError */) { } - else if (node._typ == 318 /* v.ast.Return */) { + else if (node._typ == 319 /* v.ast.Return */) { v__gen__c__Gen_return_stmt(g, (*node._v__ast__Return)); } - else if (node._typ == 319 /* v.ast.SqlStmt */) { + else if (node._typ == 320 /* v.ast.SqlStmt */) { v__gen__c__Gen_sql_stmt(g, (*node._v__ast__SqlStmt)); } - else if (node._typ == 320 /* v.ast.StructDecl */) { + else if (node._typ == 321 /* 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; @@ -71556,7 +71632,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { 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 == 244 /* v.ast.TypeDecl */) { + else if (node._typ == 245 /* v.ast.TypeDecl */) { if (!g->pref->skip_unused) { v__gen__c__Gen_writeln(g, _SLIT("// TypeDecl")); } @@ -71566,7 +71642,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 != 184 /* v.ast.FnDecl */) { + if ((node)._typ != 185 /* v.ast.FnDecl */) { } } } @@ -71639,18 +71715,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, 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 ("), /*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]; + for (int _t3 = 0; _t3 < (/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 437) /*expected idx: 437, 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, 437) /*expected idx: 437, 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); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t4 = v__ast__Table_find_field_from_embeds(g->table, got_sym, field.name); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t4.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - 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; + multi_return_v__ast__StructField_Array_v__ast__Type mr_66722 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data); + Array_v__ast__Type embed_types = mr_66722.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, /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT("_ptr"), 0, { .d_c = 0 }}})); @@ -71675,7 +71751,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_cfn_for_casting_expr(v__gen__c__Gen* g, } 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 == 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))) { + if (!v__ast__Expr_is_lvalue(expr) || ((expr)._typ == 268 /* v.ast.Ident */ && v__ast__ScopeObject_is_simple_define_const((/* as */ *(v__ast__Ident*)__as_cast((expr)._v__ast__Ident,(expr)._typ, 268) /*expected idx: 268, 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, /*115 &string*/0xfe10, {.d_s = promotion_macro_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); rparen_n += 2; @@ -71703,8 +71779,8 @@ 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 == 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)) { + if ((exp_sym->info)._typ == 436 /* 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 == 293 /* 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; @@ -71744,16 +71820,16 @@ 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 == 267 /* v.ast.Ident */) { - Option_v__ast__Var_ptr _t1; + if ((expr)._typ == 268 /* 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; if (v->smartcasts.len > 0) { is_already_sum_type = true; } } - } else if ((expr)._typ == 287 /* v.ast.SelectorExpr */) { - Option_v__ast__ScopeStructField _t2; + } else if ((expr)._typ == 288 /* 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; } @@ -71762,7 +71838,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 == 430 /* v.ast.Aggregate */) { + if ((unwrapped_got_sym->info)._typ == 431 /* 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); } @@ -71800,20 +71876,20 @@ 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 != 271 /* v.ast.InfixExpr */) { + if (got_is_ptr && !expected_is_ptr && neither_void && exp_sym->kind != v__ast__Kind__placeholder && (expr)._typ != 272 /* 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)); bool got_is_opt = v__ast__Type_has_flag(got_type, v__ast__TypeFlag__optional); - if (deref_will_match || got_is_opt || v__ast__Expr_is_auto_deref_var(expr)) { + if (deref_will_match || got_is_opt || v__ast__Expr_is_auto_deref_var(expr) || v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__generic)) { v__gen__c__Gen_write(g, _SLIT("*")); } } - if (v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional) && (expr)._typ == 279 /* v.ast.None */) { + if (v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional) && (expr)._typ == 280 /* v.ast.None */) { v__gen__c__Gen_gen_optional_error(g, expected_type, expr); return; } - if ((expr)._typ == 272 /* v.ast.IntegerLiteral */) { + if ((expr)._typ == 273 /* 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")); @@ -71897,7 +71973,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 == 322 /* 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 == 323 /* v.ast.AsmRegister */) { v__gen__c__Gen_write(g, _SLIT("*")); } v__gen__c__Gen_asm_arg(g, arg, stmt); @@ -71949,7 +72025,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 == 398 /* v.ast.AsmAlias */) { + if (arg._typ == 399 /* 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}; @@ -71984,29 +72060,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar 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 == 256 /* v.ast.CharLiteral */) { + else if (arg._typ == 257 /* 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 == 272 /* v.ast.IntegerLiteral */) { + else if (arg._typ == 273 /* 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 == 265 /* v.ast.FloatLiteral */) { + else if (arg._typ == 266 /* v.ast.FloatLiteral */) { if (g->pref->nofloat) { 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("$"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__FloatLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } - else if (arg._typ == 251 /* v.ast.BoolLiteral */) { + else if (arg._typ == 252 /* 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 == 322 /* v.ast.AsmRegister */) { + else if (arg._typ == 323 /* 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("%"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__AsmRegister).name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (arg._typ == 397 /* v.ast.AsmAddressing */) { + else if (arg._typ == 398 /* v.ast.AsmAddressing */) { if (((*arg._v__ast__AsmAddressing).segment).len != 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 }}}))); } @@ -72037,10 +72113,10 @@ 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 == 399 /* v.ast.AsmDisp */) { + if ((displacement)._typ == 400 /* v.ast.AsmDisp */) { v__gen__c__Gen_asm_arg(g, displacement, stmt); v__gen__c__Gen_write(g, _SLIT("(, ")); - } else if ((displacement)._typ == 322 /* v.ast.AsmRegister */) { + } else if ((displacement)._typ == 323 /* 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(",")); @@ -72089,7 +72165,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar } ; } - else if (arg._typ == 399 /* v.ast.AsmDisp */) { + else if (arg._typ == 400 /* v.ast.AsmDisp */) { v__gen__c__Gen_write(g, (*arg._v__ast__AsmDisp).val); } else if (arg._typ == 20 /* string */) { @@ -72159,7 +72235,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 != 267 /* v.ast.Ident */ && (val)._typ != 287 /* v.ast.SelectorExpr */) { + if ((val)._typ != 268 /* v.ast.Ident */ && (val)._typ != 288 /* v.ast.SelectorExpr */) { bool _t1 = false; return _t1; } @@ -72178,7 +72254,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_gen_clone_assignment(v__gen__c__Gen* g, v__a 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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(", "), /*100 &int*/0xfe07, {.d_i32 = array_depth}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { @@ -72228,7 +72304,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 == 325 /* v.ast.Var */) { + if (obj._typ == 326 /* v.ast.Var */) { ; if (string__eq((*obj._v__ast__Var).name, g->returned_var_name)) { ; @@ -72284,7 +72360,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 == 291 /* v.ast.StringLiteral */) { + if (v.expr._typ == 292 /* v.ast.StringLiteral */) { ; } @@ -72452,36 +72528,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 == 260 /* v.ast.ComptimeType */) { + if (node._typ == 261 /* v.ast.ComptimeType */) { v__gen__c__Gen_error(g, _SLIT("g.expr(): Unhandled ComptimeType"), (*node._v__ast__ComptimeType).pos); VUNREACHABLE(); } - else if (node._typ == 263 /* v.ast.EmptyExpr */) { + else if (node._typ == 264 /* 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 == 245 /* v.ast.AnonFn */) { + else if (node._typ == 246 /* v.ast.AnonFn */) { v__gen__c__Gen_gen_anon_fn(g, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); } - else if (node._typ == 246 /* v.ast.ArrayDecompose */) { + else if (node._typ == 247 /* v.ast.ArrayDecompose */) { v__gen__c__Gen_expr(g, (*node._v__ast__ArrayDecompose).expr); } - else if (node._typ == 247 /* v.ast.ArrayInit */) { + else if (node._typ == 248 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*node._v__ast__ArrayInit), _SLIT("")); } - else if (node._typ == 248 /* v.ast.AsCast */) { + else if (node._typ == 249 /* v.ast.AsCast */) { v__gen__c__Gen_as_cast(g, (*node._v__ast__AsCast)); } - else if (node._typ == 249 /* v.ast.Assoc */) { + else if (node._typ == 250 /* v.ast.Assoc */) { v__gen__c__Gen_assoc(g, (*node._v__ast__Assoc)); } - else if (node._typ == 250 /* v.ast.AtExpr */) { + else if (node._typ == 251 /* v.ast.AtExpr */) { v__gen__c__Gen_comptime_at(g, (*node._v__ast__AtExpr)); } - else if (node._typ == 251 /* v.ast.BoolLiteral */) { + else if (node._typ == 252 /* v.ast.BoolLiteral */) { v__gen__c__Gen_write(g, bool_str((*node._v__ast__BoolLiteral).val)); } - else if (node._typ == 253 /* v.ast.CallExpr */) { + else if (node._typ == 254 /* 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)) { @@ -72509,10 +72585,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) 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 == 254 /* v.ast.CastExpr */) { + else if (node._typ == 255 /* v.ast.CastExpr */) { v__gen__c__Gen_cast_expr(g, (*node._v__ast__CastExpr)); } - else if (node._typ == 255 /* v.ast.ChanInit */) { + else if (node._typ == 256 /* 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"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); @@ -72525,52 +72601,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 == 256 /* v.ast.CharLiteral */) { + else if (node._typ == 257 /* v.ast.CharLiteral */) { v__gen__c__Gen_char_literal(g, (*node._v__ast__CharLiteral)); } - else if (node._typ == 257 /* v.ast.Comment */) { + else if (node._typ == 258 /* v.ast.Comment */) { } - else if (node._typ == 258 /* v.ast.ComptimeCall */) { + else if (node._typ == 259 /* v.ast.ComptimeCall */) { v__gen__c__Gen_comptime_call(g, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); } - else if (node._typ == 259 /* v.ast.ComptimeSelector */) { + else if (node._typ == 260 /* v.ast.ComptimeSelector */) { v__gen__c__Gen_comptime_selector(g, (*node._v__ast__ComptimeSelector)); } - else if (node._typ == 261 /* v.ast.ConcatExpr */) { + else if (node._typ == 262 /* v.ast.ConcatExpr */) { v__gen__c__Gen_concat_expr(g, (*node._v__ast__ConcatExpr)); } - else if (node._typ == 252 /* v.ast.CTempVar */) { + else if (node._typ == 253 /* v.ast.CTempVar */) { v__gen__c__Gen_write(g, (*node._v__ast__CTempVar).name); } - else if (node._typ == 262 /* v.ast.DumpExpr */) { + else if (node._typ == 263 /* v.ast.DumpExpr */) { v__gen__c__Gen_dump_expr(g, (*node._v__ast__DumpExpr)); } - else if (node._typ == 264 /* v.ast.EnumVal */) { + else if (node._typ == 265 /* v.ast.EnumVal */) { v__gen__c__Gen_enum_val(g, (*node._v__ast__EnumVal)); } - else if (node._typ == 265 /* v.ast.FloatLiteral */) { + else if (node._typ == 266 /* 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 == 266 /* v.ast.GoExpr */) { + else if (node._typ == 267 /* v.ast.GoExpr */) { v__gen__c__Gen_go_expr(g, (*node._v__ast__GoExpr)); } - else if (node._typ == 267 /* v.ast.Ident */) { + else if (node._typ == 268 /* v.ast.Ident */) { v__gen__c__Gen_ident(g, (*node._v__ast__Ident)); } - else if (node._typ == 268 /* v.ast.IfExpr */) { + else if (node._typ == 269 /* v.ast.IfExpr */) { v__gen__c__Gen_if_expr(g, (*node._v__ast__IfExpr)); } - else if (node._typ == 269 /* v.ast.IfGuardExpr */) { + else if (node._typ == 270 /* v.ast.IfGuardExpr */) { v__gen__c__Gen_write(g, _SLIT("/* guard */")); } - else if (node._typ == 270 /* v.ast.IndexExpr */) { + else if (node._typ == 271 /* v.ast.IndexExpr */) { v__gen__c__Gen_index_expr(g, (*node._v__ast__IndexExpr)); } - else if (node._typ == 271 /* v.ast.InfixExpr */) { + else if (node._typ == 272 /* 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)); @@ -72579,7 +72655,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 == 272 /* v.ast.IntegerLiteral */) { + else if (node._typ == 273 /* 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)); @@ -72590,7 +72666,7 @@ 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 == 273 /* v.ast.IsRefType */) { + else if (node._typ == 274 /* 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); @@ -72601,7 +72677,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) 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*/ "), /*115 &bool*/0xfe10, {.d_s = is_ref_type ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (node._typ == 274 /* v.ast.Likely */) { + else if (node._typ == 275 /* v.ast.Likely */) { if ((*node._v__ast__Likely).is_likely) { v__gen__c__Gen_write(g, _SLIT("_likely_")); } else { @@ -72611,32 +72687,32 @@ 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 == 275 /* v.ast.LockExpr */) { + else if (node._typ == 276 /* v.ast.LockExpr */) { v__gen__c__Gen_lock_expr(g, (*node._v__ast__LockExpr)); } - else if (node._typ == 276 /* v.ast.MapInit */) { + else if (node._typ == 277 /* v.ast.MapInit */) { v__gen__c__Gen_map_init(g, (*node._v__ast__MapInit)); } - else if (node._typ == 277 /* v.ast.MatchExpr */) { + else if (node._typ == 278 /* v.ast.MatchExpr */) { v__gen__c__Gen_match_expr(g, (*node._v__ast__MatchExpr)); } - else if (node._typ == 278 /* v.ast.NodeError */) { + else if (node._typ == 279 /* v.ast.NodeError */) { } - else if (node._typ == 279 /* v.ast.None */) { + else if (node._typ == 280 /* v.ast.None */) { v__gen__c__Gen_write(g, _SLIT("_const_none__")); } - else if (node._typ == 280 /* v.ast.OffsetOf */) { + else if (node._typ == 281 /* 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("), /*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 == 281 /* v.ast.OrExpr */) { + else if (node._typ == 282 /* v.ast.OrExpr */) { } - else if (node._typ == 282 /* v.ast.ParExpr */) { + else if (node._typ == 283 /* 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 == 283 /* v.ast.PostfixExpr */) { + else if (node._typ == 284 /* 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(&"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); } @@ -72655,7 +72731,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) 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 == 284 /* v.ast.PrefixExpr */) { + else if (node._typ == 285 /* 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; @@ -72663,7 +72739,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, 441) /*expected idx: 441, 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, 442) /*expected idx: 442, 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 */ @@ -72702,27 +72778,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 == 285 /* v.ast.RangeExpr */) { + else if (node._typ == 286 /* v.ast.RangeExpr */) { } - else if (node._typ == 286 /* v.ast.SelectExpr */) { + else if (node._typ == 287 /* v.ast.SelectExpr */) { v__gen__c__Gen_select_expr(g, (*node._v__ast__SelectExpr)); } - else if (node._typ == 287 /* v.ast.SelectorExpr */) { + else if (node._typ == 288 /* v.ast.SelectorExpr */) { v__gen__c__Gen_selector_expr(g, (*node._v__ast__SelectorExpr)); } - else if (node._typ == 288 /* v.ast.SizeOf */) { + else if (node._typ == 289 /* v.ast.SizeOf */) { v__gen__c__Gen_size_of(g, (*node._v__ast__SizeOf)); } - else if (node._typ == 289 /* v.ast.SqlExpr */) { + else if (node._typ == 290 /* v.ast.SqlExpr */) { v__gen__c__Gen_sql_select_expr(g, (*node._v__ast__SqlExpr)); } - else if (node._typ == 291 /* v.ast.StringLiteral */) { + else if (node._typ == 292 /* v.ast.StringLiteral */) { v__gen__c__Gen_string_literal(g, (*node._v__ast__StringLiteral)); } - else if (node._typ == 290 /* v.ast.StringInterLiteral */) { + else if (node._typ == 291 /* v.ast.StringInterLiteral */) { v__gen__c__Gen_string_inter_literal(g, (*node._v__ast__StringInterLiteral)); } - else if (node._typ == 292 /* v.ast.StructInit */) { + else if (node._typ == 293 /* 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 { @@ -72731,16 +72807,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 == 293 /* v.ast.TypeNode */) { + else if (node._typ == 294 /* 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, /*115 &string*/0xfe10, {.d_s = sidx}}, {_SLIT(" /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 294 /* v.ast.TypeOf */) { + else if (node._typ == 295 /* v.ast.TypeOf */) { v__gen__c__Gen_typeof_expr(g, (*node._v__ast__TypeOf)); } - else if (node._typ == 295 /* v.ast.UnsafeExpr */) { + else if (node._typ == 296 /* v.ast.UnsafeExpr */) { v__gen__c__Gen_expr(g, (*node._v__ast__UnsafeExpr).expr); } ; @@ -72775,9 +72851,9 @@ 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, 444) /*expected idx: 444, 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, 445) /*expected idx: 445, 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, 444) /*expected idx: 444, 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, 445) /*expected idx: 445, name: v.ast.FnType */ ); } } else { s = v__ast__Table_type_to_str(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); @@ -72793,11 +72869,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_typeof_expr(v__gen__c__Gen* g, v__ast__TypeO 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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed fixed_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, 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(\"["), /*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, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 445) /*expected idx: 445, 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)); @@ -72825,13 +72901,13 @@ 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 == 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 */) { + if ((node.expr)._typ == 295 /* v.ast.TypeOf */) { + if (((*node.expr._v__ast__TypeOf).expr)._typ == 260 /* v.ast.ComptimeSelector */) { + if (((*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr)._typ == 288 /* v.ast.SelectorExpr */) { + if (((*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 268 /* 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}; + _option_v__ast__Type _t1 = {0}; if (_t2) { *((v__ast__Type*)&_t1.data) = *((v__ast__Type*)_t2); } else { @@ -72862,7 +72938,7 @@ 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 == 267 /* v.ast.Ident */ && v__ast__Type_has_flag(node.expr_type, v__ast__TypeFlag__optional); + bool is_optional = (node.expr)._typ == 268 /* 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("(*("), /*115 &string*/0xfe10, {.d_s = opt_base_typ}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); @@ -72875,7 +72951,7 @@ 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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, 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")))) { @@ -72886,14 +72962,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel } string sum_type_deref_field = _SLIT(""); string sum_type_dot = _SLIT("."); - Option_v__ast__StructField _t3; + _option_v__ast__StructField _t3; if (_t3 = v__ast__Table_find_field(g->table, sym, node.field_name), _t3.state == 0) { v__ast__StructField f = *(v__ast__StructField*)_t3.data; v__ast__TypeSymbol* field_sym = v__ast__Table_sym(g->table, f.typ); if (field_sym->kind == v__ast__Kind__sum_type || field_sym->kind == v__ast__Kind__interface_) { if (!prevent_sum_type_unwrapping_once) { v__ast__Scope* scope = v__ast__Scope_innermost(g->file->scope, node.pos.pos); - Option_v__ast__ScopeStructField _t4; + _option_v__ast__ScopeStructField _t4; if (_t4 = v__ast__Scope_find_struct_field(scope, v__ast__Expr_str(node.expr), node.expr_type, node.field_name), _t4.state == 0) { v__ast__ScopeStructField field = *(v__ast__ScopeStructField*)_t4.data; if (v__ast__Type_is_ptr(field.orig_type)) { @@ -72910,7 +72986,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel 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(")"), /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - if ((cast_sym->info)._typ == 430 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 431 /* 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("_"), /*115 &string*/0xfe10, {.d_s = agg_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { @@ -72933,7 +73009,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 == 417 /* v.ast.Struct */ || (sym->info)._typ == 430 /* v.ast.Aggregate */) { + if ((sym->info)._typ == 418 /* v.ast.Struct */ || (sym->info)._typ == 431 /* 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); @@ -72969,8 +73045,36 @@ 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_decl(v__gen__c__Gen* g, v__ast__EnumDecl node) { + string enum_name = v__util__no_dots(node.name); + bool is_flag = node.is_flag; + strings__Builder_writeln(&g->enum_typedefs, _SLIT("typedef enum {")); + string cur_enum_expr = _SLIT(""); + int cur_enum_offset = 0; + for (int i = 0; i < node.fields.len; ++i) { + v__ast__EnumField field = ((v__ast__EnumField*)node.fields.data)[i]; + 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); + strings__Builder_write_string(&g->enum_typedefs, expr_str); + cur_enum_expr = expr_str; + 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 << "), /*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, /*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("} "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); +} + VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_expr(v__gen__c__Gen* g, v__ast__Expr node) { - if (node._typ == 264 /* v.ast.EnumVal */) { + if (node._typ == 265 /* v.ast.EnumVal */) { v__gen__c__Gen_write(g, (*node._v__ast__EnumVal).val); } @@ -73095,11 +73199,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_106768 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); - string hash_fn = mr_106768.arg0; - string key_eq_fn = mr_106768.arg1; - string clone_fn = mr_106768.arg2; - string free_fn = mr_106768.arg3; + multi_return_string_string_string_string mr_106889 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); + string hash_fn = mr_106889.arg0; + string key_eq_fn = mr_106889.arg1; + string clone_fn = mr_106889.arg2; + string free_fn = mr_106889.arg3; int size = node.vals.len; string shared_styp = _SLIT(""); string styp = _SLIT(""); @@ -73194,12 +73298,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, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ).expr; + timeout_expr = (/* as */ *(v__ast__ExprStmt*)__as_cast((branch.stmt)._v__ast__ExprStmt,(branch.stmt)._typ, 308) /*expected idx: 308, name: v.ast.ExprStmt */ ).expr; } else { - 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 */ ; + if (branch.stmt._typ == 308 /* 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, 272) /*expected idx: 272, name: v.ast.InfixExpr */ ; array_push((array*)&channels, _MOV((v__ast__Expr[]){ expr.left })); - 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 */) { + if ((expr.right)._typ == 268 /* v.ast.Ident */ || (expr.right)._typ == 271 /* v.ast.IndexExpr */ || (expr.right)._typ == 288 /* v.ast.SelectorExpr */ || (expr.right)._typ == 293 /* 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("")) })); @@ -73212,8 +73316,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } array_push((array*)&is_push, _MOV((bool[]){ true })); } - 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 */ ; + else if (branch.stmt._typ == 300 /* 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, 285) /*expected idx: 285, 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)))) { @@ -73338,7 +73442,7 @@ 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 == 377 /* v.ast.IdentVar */) { + if ((node_info)._typ == 378 /* 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); @@ -73350,7 +73454,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) return; } v__ast__ScopeObject v = node.obj; - if ((v)._typ == 325 /* v.ast.Var */) { + if ((v)._typ == 326 /* 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("(*(")); @@ -73375,7 +73479,7 @@ 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 == 430 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 431 /* 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, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { @@ -73393,9 +73497,9 @@ 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 == 376 /* v.ast.IdentFn */) { + } else if ((node_info)._typ == 377 /* v.ast.IdentFn */) { if (g->pref->translated || g->file->is_translated) { - Option_v__ast__Fn _t2; + _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t2.data; if (Array_v__ast__Attr_contains(f.attrs, _SLIT("c"))) { @@ -73407,7 +73511,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) string key = node.name; v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf identfn: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t4 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); - Option_string _t3 = {0}; + _option_string _t3 = {0}; if (_t4) { *((string*)&_t3.data) = *((string*)_t4); } else { @@ -73434,7 +73538,7 @@ 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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, 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("*(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" *)(&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); @@ -73451,10 +73555,10 @@ 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, 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))) { + 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, 433) /*expected idx: 433, 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, 433) /*expected idx: 433, 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 == 279 /* v.ast.None */) { + if (v__ast__Type_has_flag(node.typ, v__ast__TypeFlag__optional) && (node.expr)._typ == 280 /* 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("("), /*115 &string*/0xfe10, {.d_s = cast_label}}, {_SLIT("("), 0, { .d_c = 0 }}}))); @@ -73465,7 +73569,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 == 272 /* v.ast.IntegerLiteral */) { + if ((node.expr)._typ == 273 /* 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")); @@ -73504,7 +73608,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 == 253 /* v.ast.CallExpr */) { + if ((expr)._typ == 254 /* 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; } @@ -73532,7 +73636,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 == 258 /* v.ast.ComptimeCall */) { + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 259 /* 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 @@ -73571,9 +73675,9 @@ 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 == 279 /* v.ast.None */; + bool optional_none = ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 280 /* 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")); + 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); @@ -73646,7 +73750,7 @@ 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 == 268 /* v.ast.IfExpr */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 277 /* v.ast.MatchExpr */)) { + if (node.exprs.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 269 /* v.ast.IfExpr */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 278 /* 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(";")); @@ -73660,12 +73764,12 @@ 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, 443) /*expected idx: 443, 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, 444) /*expected idx: 444, name: v.ast.MultiReturn */ ; string styp = _SLIT(""); 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(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("/*X*/[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok2(&("), /*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, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); @@ -73680,7 +73784,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; 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, 253) /*expected idx: 253, name: v.ast.CallExpr */ ; + v__ast__CallExpr c = /* as */ *(v__ast__CallExpr*)__as_cast((expr)._v__ast__CallExpr,(expr)._typ, 254) /*expected idx: 254, 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)) { @@ -73726,7 +73830,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } v__gen__c__Gen_write(g, _SLIT("}")); 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_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" }, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_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_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); } @@ -73748,7 +73852,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; 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 == 253 /* v.ast.CallExpr */) { + if (expr0._typ == 254 /* 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; } @@ -73756,12 +73860,12 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; _t1 = v__ast__Type_has_flag((*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)), v__ast__TypeFlag__optional); } bool expr_type_is_opt = _t1; - if (fn_return_is_optional && !expr_type_is_opt && !string__eq(return_sym->name, _SLIT("Option"))) { + if (fn_return_is_optional && !expr_type_is_opt && !string__eq(return_sym->name, _const_v__gen__c__option_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(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok2(&("), /*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)) { + if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 268 /* v.ast.Ident */ && !g->is_amp)) { v__gen__c__Gen_write(g, _SLIT("*")); } } @@ -73772,7 +73876,7 @@ 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*)(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" }, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_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 }}}))); @@ -73784,7 +73888,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; return; } bool _t2 = 0; - if (expr0._typ == 253 /* v.ast.CallExpr */) { + if (expr0._typ == 254 /* 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; } @@ -73797,7 +73901,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; 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)) { + if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 268 /* v.ast.Ident */ && !g->is_amp)) { v__gen__c__Gen_write(g, _SLIT("*")); } } @@ -73821,13 +73925,13 @@ 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 == 267 /* v.ast.Ident */) { + if ((expr)._typ == 268 /* 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 != 267 /* v.ast.Ident */ || use_tmp_var) { + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ != 268 /* 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; @@ -73897,7 +74001,7 @@ 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 == 247 /* v.ast.ArrayInit */) { + if (field.expr._typ == 248 /* 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) { @@ -73910,14 +74014,14 @@ bool v__gen__c__Gen_const_decl_defer_0 = false; v__gen__c__Gen_const_decl_init_later(g, field.mod, name, field.expr, field.typ, false); } } - else if (field.expr._typ == 291 /* v.ast.StringLiteral */) { + else if (field.expr._typ == 292 /* 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"), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (field.expr._typ == 253 /* v.ast.CallExpr */) { + else if (field.expr._typ == 254 /* 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; @@ -73931,7 +74035,7 @@ bool v__gen__c__Gen_const_decl_defer_0 = false; else { bool use_cache_mode = g->pref->build_mode == v__pref__BuildMode__build_module || g->pref->use_cache; if (!use_cache_mode) { - Option_v__ast__ComptTimeConstValue _t2; + _option_v__ast__ComptTimeConstValue _t2; if (_t2 = v__ast__ConstField_comptime_expr_value(&field), _t2.state == 0) { v__ast__ComptTimeConstValue ct_value = *(v__ast__ComptTimeConstValue*)_t2.data; if (v__gen__c__Gen_const_decl_precomputed(g, field.mod, name, ct_value, field.typ)) { @@ -74026,7 +74130,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_const_decl_precomputed(v__gen__c__Gen* g, st 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 == 263 /* v.ast.EmptyExpr */) { + else if (ct_value._typ == 264 /* v.ast.EmptyExpr */) { bool _t4 = false; return _t4; } @@ -74048,8 +74152,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_simple_define(v__gen__c__Gen* g, } else { x = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}})); } - strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define "), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + if (g->pref->translated) { + strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("const int "), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + } else { + strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define "), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + } strings__Builder_writeln(&g->definitions, val); + if (g->pref->translated) { + strings__Builder_write_string(&g->definitions, _SLIT(";")); + } } 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) { @@ -74111,7 +74222,7 @@ 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 == 245 /* v.ast.AnonFn */) { + if (field.has_expr && (anon_fn_expr)._typ == 246 /* 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, /*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 }}}))); @@ -74154,7 +74265,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_assoc(v__gen__c__Gen* g, v__ast__Assoc node) 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, 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); @@ -74229,7 +74340,7 @@ bool v__gen__c__Gen_write_init_function_defer_0 = false; 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, /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(".init"), 0, { .d_c = 0 }}})); - Option_v__ast__Fn _t2; + _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) { @@ -74330,7 +74441,7 @@ 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 == 417 /* v.ast.Struct */) { + if (sym->info._typ == 418 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { continue; } @@ -74361,9 +74472,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ for (int _t3 = 0; _t3 < (*sym->info._v__ast__Struct).fields.len; ++_t3) { v__ast__StructField field = ((v__ast__StructField*)(*sym->info._v__ast__Struct).fields.data)[_t3]; if (v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__optional)) { - multi_return_string_string mr_146502 = v__gen__c__Gen_optional_type_name(g, field.typ); - string styp = mr_146502.arg0; - string base = mr_146502.arg1; + multi_return_string_string mr_146797 = v__gen__c__Gen_optional_type_name(g, field.typ); + string styp = mr_146797.arg0; + string base = mr_146797.arg1; sync__RwMutex_lock(&g->done_optionals->mtx); /*lock*/ { if (!Array_string_contains(g->done_optionals->val, base)) { @@ -74386,7 +74497,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ size_suffix = _SLIT(" : 1"); } else { v__ast__TypeSymbol* field_sym = v__ast__Table_sym(g->table, field.typ); - if ((field_sym->info)._typ == 446 /* v.ast.Enum */) { + if ((field_sym->info)._typ == 447 /* v.ast.Enum */) { if (!(*field_sym->info._v__ast__Enum).is_flag && !(*field_sym->info._v__ast__Enum).uses_exprs) { int bits_needed = 0; int l = (*field_sym->info._v__ast__Enum).vals.len; @@ -74409,9 +74520,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ 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 == 432 /* v.ast.Alias */) { + else if (sym->info._typ == 433 /* v.ast.Alias */) { } - else if (sym->info._typ == 442 /* v.ast.Thread */) { + else if (sym->info._typ == 443 /* 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 "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); @@ -74427,7 +74538,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ } } } - else if (sym->info._typ == 436 /* v.ast.SumType */) { + else if (sym->info._typ == 437 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { continue; } @@ -74457,7 +74568,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ strings__Builder_writeln(&g->type_definitions, _SLIT("};")); strings__Builder_writeln(&g->type_definitions, _SLIT("")); } - else if (sym->info._typ == 440 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 441 /* 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; @@ -74469,7 +74580,7 @@ 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 == 444 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 445 /* 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); @@ -74505,13 +74616,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 == 440 /* v.ast.ArrayFixed */) { + if (sym->info._typ == 441 /* 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 == 417 /* v.ast.Struct */) { + else if (sym->info._typ == 418 /* 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; @@ -74531,7 +74642,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 == 432 /* v.ast.Alias */) { + if ((fsym->info)._typ == 433 /* 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; @@ -74628,21 +74739,19 @@ bool v__gen__c__Gen_or_block_defer_0 = false; 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 == 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)) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 308 /* 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, 308) /*expected idx: 308, 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, 307) /*expected idx: 307, name: v.ast.ExprStmt */ ; + v__ast__ExprStmt expr_stmt = /* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 308) /*expected idx: 308, 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("*("), /*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)); g->inside_opt_data = old_inside_opt_data; - if (g->inside_ternary == 0) { - v__gen__c__Gen_writeln(g, _SLIT(";")); - } + v__gen__c__Gen_writeln(g, _SLIT(";")); array_delete_last(&g->stmt_path_pos); } else { v__gen__c__Gen_stmt(g, stmt); @@ -74651,7 +74760,7 @@ 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 == 307 /* v.ast.ExprStmt */) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 308 /* v.ast.ExprStmt */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } @@ -74660,11 +74769,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false; if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) { string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { - multi_return_int_string_string_string mr_156325 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_156325.arg0; - string pafile = mr_156325.arg1; - string pamod = mr_156325.arg2; - string pafn = mr_156325.arg3; + multi_return_int_string_string_string mr_156580 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_156580.arg0; + string pafile = mr_156580.arg1; + string pamod = mr_156580.arg2; + string pafn = mr_156580.arg3; v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_optional_not_set( "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); @@ -74687,11 +74796,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false; if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) { string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { - multi_return_int_string_string_string mr_157592 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_157592.arg0; - string pafile = mr_157592.arg1; - string pamod = mr_157592.arg2; - string pafn = mr_157592.arg3; + multi_return_int_string_string_string mr_157847 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_157847.arg0; + string pafile = mr_157847.arg1; + string pamod = mr_157847.arg2; + string pafn = mr_157847.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 }}}))); @@ -74764,7 +74873,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, 432) /*expected idx: 432, 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, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type); return _t6; break; } @@ -74801,11 +74910,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_160202 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); - string hash_fn = mr_160202.arg0; - string key_eq_fn = mr_160202.arg1; - string clone_fn = mr_160202.arg2; - string free_fn = mr_160202.arg3; + multi_return_string_string_string_string mr_160457 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); + string hash_fn = mr_160457.arg0; + string key_eq_fn = mr_160457.arg1; + string clone_fn = mr_160457.arg2; + string free_fn = mr_160457.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(""))); @@ -74832,7 +74941,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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, 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) { @@ -74851,7 +74960,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty } 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 == 417 /* v.ast.Struct */ && field_sym->language == v__ast__Language__v) { + if ((field_sym->info)._typ == 418 /* 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}"); } @@ -74990,7 +75099,7 @@ 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 == 436 /* v.ast.SumType */) { + if ((expr_type_sym->info)._typ == 437 /* 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 */ *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)__as_cast("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("(")); @@ -75020,7 +75129,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_as_cast(v__gen__c__Gen* g, v__ast__AsCast no } 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, 435) /*expected idx: 435, 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, 436) /*expected idx: 436, 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)) })); @@ -75091,10 +75200,10 @@ 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 != 435 /* v.ast.Interface */) { + if ((isym->info)._typ != 436 /* v.ast.Interface */) { continue; } - 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 */ ; + v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 436) /*expected idx: 436, name: v.ast.Interface */ ; if (inter_info.is_generic) { continue; } @@ -75157,7 +75266,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { 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; + _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."), /*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 { @@ -75169,7 +75278,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { for (int _t5 = 0; _t5 < v__ast__TypeSymbol_struct_info(st_sym).embeds.len; ++_t5) { v__ast__Type embed_type = ((v__ast__Type*)v__ast__TypeSymbol_struct_info(st_sym).embeds.data)[_t5]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, embed_type); - Option_v__ast__StructField _t6; + _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, "), /*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; @@ -75228,13 +75337,13 @@ 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 == 417 /* v.ast.Struct */) { + if (st_sym->info._typ == 418 /* 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) { v__ast__Fn method = ((v__ast__Fn*)parent_sym->methods.data)[_t12]; if (_IN_MAP(ADDR(string, method.name), ADDR(map, methodidx))) { - Option_v__ast__Fn _t14 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); + _option_v__ast__Fn _t14 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); if (_t14.state != 0) { /*or block*/ IError err = _t14.err; continue; @@ -75245,13 +75354,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } } } - else if (st_sym->info._typ == 435 /* v.ast.Interface */) { + else if (st_sym->info._typ == 436 /* 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) { v__ast__Fn method = ((v__ast__Fn*)parent_sym->methods.data)[_t15]; if (_IN_MAP(ADDR(string, method.name), ADDR(map, methodidx))) { - Option_v__ast__Fn _t17 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); + _option_v__ast__Fn _t17 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); if (_t17.state != 0) { /*or block*/ IError err = _t17.err; continue; @@ -75262,13 +75371,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } } } - else if (st_sym->info._typ == 436 /* v.ast.SumType */) { + else if (st_sym->info._typ == 437 /* 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) { v__ast__Fn method = ((v__ast__Fn*)parent_sym->methods.data)[_t18]; if (_IN_MAP(ADDR(string, method.name), ADDR(map, methodidx))) { - Option_v__ast__Fn _t20 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); + _option_v__ast__Fn _t20 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); if (_t20.state != 0) { /*or block*/ IError err = _t20.err; continue; @@ -75305,13 +75414,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 == 417 /* v.ast.Struct */) { + if (parent_sym->info._typ == 418 /* 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 == 435 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 436 /* 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 == 436 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 437 /* v.ast.SumType */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__SumType).concrete_types, method.name, false); } @@ -75322,7 +75431,7 @@ 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 == 417 /* v.ast.Struct */) { + if ((st_sym->info)._typ == 418 /* 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); } @@ -75336,8 +75445,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { int params_start_pos = g->out.len; Array_v__ast__Param params = array_clone_to_depth(&method.params, 0); array_set(¶ms, 0, &(v__ast__Param[]) { ((v__ast__Param){(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).name,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).type_pos,.typ = v__ast__Type_set_nr_muls(st, 1),(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_mut,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_auto_rec,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_hidden,}) }); - multi_return_Array_string_Array_string_Array_bool mr_174684 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); - Array_string fargs = mr_174684.arg0; + multi_return_Array_string_Array_string_Array_bool mr_174939 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); + Array_string fargs = mr_174939.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__")); @@ -75348,14 +75457,14 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { if (!v__ast__Type_alias_eq(method.return_type, _const_v__ast__void_type)) { strings__Builder_write_string(&methods_wrapper, _SLIT("return ")); } - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t26 = v__ast__Table_find_method_from_embeds(g->table, st_sym, method.name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t26 = v__ast__Table_find_method_from_embeds(g->table, st_sym, method.name); if (_t26.state != 0) { /*or block*/ IError err = _t26.err; *(multi_return_v__ast__Fn_Array_v__ast__Type*) _t26.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_175148 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); - Array_v__ast__Type embed_types = mr_175148.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_175403 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); + Array_v__ast__Type embed_types = mr_175403.arg1; if (embed_types.len > 0 && !Array_string_contains(method_names, method.name)) { v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types))); string method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = embed_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); @@ -75493,7 +75602,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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ; int _t1 = 1 + v__gen__c__Gen_get_array_depth(g, info.elem_type); return _t1; } else { @@ -75540,14 +75649,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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, 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)) { @@ -75568,7 +75677,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, 430) /*expected idx: 430, name: v.ast.Aggregate */ ; + v__ast__Aggregate info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 431) /*expected idx: 431, 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)) { @@ -75582,7 +75691,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, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 444) /*expected idx: 444, 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)) { @@ -75898,12 +76007,12 @@ 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 == 287 /* v.ast.SelectorExpr */) { - if (((*node.field_expr._v__ast__SelectorExpr).expr)._typ == 267 /* v.ast.Ident */) { + if ((node.field_expr)._typ == 288 /* v.ast.SelectorExpr */) { + if (((*node.field_expr._v__ast__SelectorExpr).expr)._typ == 268 /* 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"))) { string field_name = g->comptime_for_field_value.name; v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.left_type)); - Option_v__ast__StructField _t1 = v__ast__Table_find_field_with_embeds(g->table, left_sym, field_name); + _option_v__ast__StructField _t1 = v__ast__Table_find_field_with_embeds(g->table, left_sym, field_name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node.left)}}, {_SLIT("` has no field named `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node.left)); @@ -75938,7 +76047,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 == 184 /* v.ast.FnDecl */) { + if ((stmt)._typ == 185 /* v.ast.FnDecl */) { if (string_starts_with((*stmt._v__ast__FnDecl).name, _SLIT("main.vweb_tmpl"))) { if (is_html) { g->inside_vweb_tmpl = true; @@ -75950,7 +76059,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 != 318 /* v.ast.Return */) { + if ((it)._typ != 319 /* v.ast.Return */) { array_push((array*)&_t2, &it); } } @@ -75975,7 +76084,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node->left_type)); ; if (string__eq(node->method_name, _SLIT("method"))) { - Option_v__ast__Fn _t4 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method); + _option_v__ast__Fn _t4 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; return; @@ -75986,7 +76095,7 @@ 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 == 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")); + _t5 = (arg.expr)._typ == 268 /* 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; } @@ -76001,8 +76110,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com return; } 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 ((node->left)._typ == 268 /* v.ast.Ident */) { + if (((*node->left._v__ast__Ident).obj)._typ == 326 /* 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("&")); } @@ -76013,7 +76122,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 == 267 /* v.ast.Ident */) { + if ((node->left)._typ == 268 /* 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; } @@ -76097,8 +76206,8 @@ 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 == 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 (((*(v__ast__IfBranch*)/*ee elem_sym */array_get(node.branches, 0)).cond)._typ == 268 /* 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; *(v__pref__OS*) _t1.data = v__pref__OS___auto; @@ -76143,7 +76252,7 @@ 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, 307) /*expected idx: 307, 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, 308) /*expected idx: 308, 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); @@ -76179,25 +76288,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 == 251 /* v.ast.BoolLiteral */) { + if (cond._typ == 252 /* v.ast.BoolLiteral */) { v__gen__c__Gen_expr(g, cond); bool _t1 = true; return _t1; } - else if (cond._typ == 282 /* v.ast.ParExpr */) { + else if (cond._typ == 283 /* 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 == 284 /* v.ast.PrefixExpr */) { + else if (cond._typ == 285 /* 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 == 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); + else if (cond._typ == 284 /* 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, 268) /*expected idx: 268, 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)); @@ -76211,7 +76320,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ bool _t6 = true; return _t6; } - else if (cond._typ == 271 /* v.ast.InfixExpr */) { + else if (cond._typ == 272 /* 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); @@ -76223,7 +76332,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 == 293 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 260 /* v.ast.ComptimeType */) { + if ((left)._typ == 294 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 261 /* 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) { @@ -76245,10 +76354,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, 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__Type got_type = (/* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).right)._typ, 294) /*expected idx: 294, name: v.ast.TypeNode */ ).typ; + if ((left)._typ == 294 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 294 /* 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 == 435 /* v.ast.Interface */) { + if ((interface_sym->info)._typ == 436 /* 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) { @@ -76269,14 +76378,14 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ return _t11; } } - } else if ((left)._typ == 287 /* v.ast.SelectorExpr */) { + } else if ((left)._typ == 288 /* 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, /*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 == 293 /* v.ast.TypeNode */) { + } else if ((left)._typ == 294 /* 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) { @@ -76299,8 +76408,8 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ return _t15; }; } - 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); + else if (cond._typ == 268 /* 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; *(string*) _t16.data = _SLIT("true"); @@ -76311,7 +76420,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ bool _t17 = true; return _t17; } - else if (cond._typ == 258 /* v.ast.ComptimeCall */) { + else if (cond._typ == 259 /* 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; @@ -76434,7 +76543,7 @@ 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ; if (sym_info.fields.len > 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 }}}))); } @@ -76467,7 +76576,7 @@ 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 == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* 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 "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); } @@ -76487,237 +76596,237 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp v__gen__c__Gen_writeln(g, _SLIT("}// $for")); } -VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen* g, string name, bool is_comptime_optional) { +VV_LOCAL_SYMBOL _option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen* g, string name, bool is_comptime_optional) { if (string__eq(name, _SLIT("windows"))) { - Option_string _t1; - opt_ok(&(string[]) { _SLIT("_WIN32") }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { _SLIT("_WIN32") }, (_option*)(&_t1), sizeof(string)); return _t1; } else if (string__eq(name, _SLIT("ios"))) { - Option_string _t2; - opt_ok(&(string[]) { _SLIT("__TARGET_IOS__") }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { _SLIT("__TARGET_IOS__") }, (_option*)(&_t2), sizeof(string)); return _t2; } else if (string__eq(name, _SLIT("macos"))) { - Option_string _t3; - opt_ok(&(string[]) { _SLIT("__APPLE__") }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { _SLIT("__APPLE__") }, (_option*)(&_t3), sizeof(string)); return _t3; } else if (string__eq(name, _SLIT("mach"))) { - Option_string _t4; - opt_ok(&(string[]) { _SLIT("__MACH__") }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { _SLIT("__MACH__") }, (_option*)(&_t4), sizeof(string)); return _t4; } else if (string__eq(name, _SLIT("darwin"))) { - Option_string _t5; - opt_ok(&(string[]) { _SLIT("__DARWIN__") }, (Option*)(&_t5), sizeof(string)); + _option_string _t5; + opt_ok2(&(string[]) { _SLIT("__DARWIN__") }, (_option*)(&_t5), sizeof(string)); return _t5; } else if (string__eq(name, _SLIT("hpux"))) { - Option_string _t6; - opt_ok(&(string[]) { _SLIT("__HPUX__") }, (Option*)(&_t6), sizeof(string)); + _option_string _t6; + opt_ok2(&(string[]) { _SLIT("__HPUX__") }, (_option*)(&_t6), sizeof(string)); return _t6; } else if (string__eq(name, _SLIT("gnu"))) { - Option_string _t7; - opt_ok(&(string[]) { _SLIT("__GNU__") }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { _SLIT("__GNU__") }, (_option*)(&_t7), sizeof(string)); return _t7; } else if (string__eq(name, _SLIT("qnx"))) { - Option_string _t8; - opt_ok(&(string[]) { _SLIT("__QNX__") }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(string[]) { _SLIT("__QNX__") }, (_option*)(&_t8), sizeof(string)); return _t8; } else if (string__eq(name, _SLIT("linux"))) { - Option_string _t9; - opt_ok(&(string[]) { _SLIT("__linux__") }, (Option*)(&_t9), sizeof(string)); + _option_string _t9; + opt_ok2(&(string[]) { _SLIT("__linux__") }, (_option*)(&_t9), sizeof(string)); return _t9; } else if (string__eq(name, _SLIT("serenity"))) { - Option_string _t10; - opt_ok(&(string[]) { _SLIT("__serenity__") }, (Option*)(&_t10), sizeof(string)); + _option_string _t10; + opt_ok2(&(string[]) { _SLIT("__serenity__") }, (_option*)(&_t10), sizeof(string)); return _t10; } else if (string__eq(name, _SLIT("vinix"))) { - Option_string _t11; - opt_ok(&(string[]) { _SLIT("__vinix__") }, (Option*)(&_t11), sizeof(string)); + _option_string _t11; + opt_ok2(&(string[]) { _SLIT("__vinix__") }, (_option*)(&_t11), sizeof(string)); return _t11; } else if (string__eq(name, _SLIT("freebsd"))) { - Option_string _t12; - opt_ok(&(string[]) { _SLIT("__FreeBSD__") }, (Option*)(&_t12), sizeof(string)); + _option_string _t12; + opt_ok2(&(string[]) { _SLIT("__FreeBSD__") }, (_option*)(&_t12), sizeof(string)); return _t12; } else if (string__eq(name, _SLIT("openbsd"))) { - Option_string _t13; - opt_ok(&(string[]) { _SLIT("__OpenBSD__") }, (Option*)(&_t13), sizeof(string)); + _option_string _t13; + opt_ok2(&(string[]) { _SLIT("__OpenBSD__") }, (_option*)(&_t13), sizeof(string)); return _t13; } else if (string__eq(name, _SLIT("netbsd"))) { - Option_string _t14; - opt_ok(&(string[]) { _SLIT("__NetBSD__") }, (Option*)(&_t14), sizeof(string)); + _option_string _t14; + opt_ok2(&(string[]) { _SLIT("__NetBSD__") }, (_option*)(&_t14), sizeof(string)); return _t14; } else if (string__eq(name, _SLIT("bsd"))) { - Option_string _t15; - opt_ok(&(string[]) { _SLIT("__BSD__") }, (Option*)(&_t15), sizeof(string)); + _option_string _t15; + opt_ok2(&(string[]) { _SLIT("__BSD__") }, (_option*)(&_t15), sizeof(string)); return _t15; } else if (string__eq(name, _SLIT("dragonfly"))) { - Option_string _t16; - opt_ok(&(string[]) { _SLIT("__DragonFly__") }, (Option*)(&_t16), sizeof(string)); + _option_string _t16; + opt_ok2(&(string[]) { _SLIT("__DragonFly__") }, (_option*)(&_t16), sizeof(string)); return _t16; } else if (string__eq(name, _SLIT("android"))) { - Option_string _t17; - opt_ok(&(string[]) { _SLIT("__ANDROID__") }, (Option*)(&_t17), sizeof(string)); + _option_string _t17; + opt_ok2(&(string[]) { _SLIT("__ANDROID__") }, (_option*)(&_t17), sizeof(string)); return _t17; } else if (string__eq(name, _SLIT("solaris"))) { - Option_string _t18; - opt_ok(&(string[]) { _SLIT("__sun") }, (Option*)(&_t18), sizeof(string)); + _option_string _t18; + opt_ok2(&(string[]) { _SLIT("__sun") }, (_option*)(&_t18), sizeof(string)); return _t18; } else if (string__eq(name, _SLIT("haiku"))) { - Option_string _t19; - opt_ok(&(string[]) { _SLIT("__HAIKU__") }, (Option*)(&_t19), sizeof(string)); + _option_string _t19; + opt_ok2(&(string[]) { _SLIT("__HAIKU__") }, (_option*)(&_t19), sizeof(string)); return _t19; } else if (string__eq(name, _SLIT("js"))) { - Option_string _t20; - opt_ok(&(string[]) { _SLIT("_VJS") }, (Option*)(&_t20), sizeof(string)); + _option_string _t20; + opt_ok2(&(string[]) { _SLIT("_VJS") }, (_option*)(&_t20), sizeof(string)); return _t20; } else if (string__eq(name, _SLIT("gcc"))) { - Option_string _t21; - opt_ok(&(string[]) { _SLIT("__V_GCC__") }, (Option*)(&_t21), sizeof(string)); + _option_string _t21; + opt_ok2(&(string[]) { _SLIT("__V_GCC__") }, (_option*)(&_t21), sizeof(string)); return _t21; } else if (string__eq(name, _SLIT("tinyc"))) { - Option_string _t22; - opt_ok(&(string[]) { _SLIT("__TINYC__") }, (Option*)(&_t22), sizeof(string)); + _option_string _t22; + opt_ok2(&(string[]) { _SLIT("__TINYC__") }, (_option*)(&_t22), sizeof(string)); return _t22; } else if (string__eq(name, _SLIT("clang"))) { - Option_string _t23; - opt_ok(&(string[]) { _SLIT("__clang__") }, (Option*)(&_t23), sizeof(string)); + _option_string _t23; + opt_ok2(&(string[]) { _SLIT("__clang__") }, (_option*)(&_t23), sizeof(string)); return _t23; } else if (string__eq(name, _SLIT("mingw"))) { - Option_string _t24; - opt_ok(&(string[]) { _SLIT("__MINGW32__") }, (Option*)(&_t24), sizeof(string)); + _option_string _t24; + opt_ok2(&(string[]) { _SLIT("__MINGW32__") }, (_option*)(&_t24), sizeof(string)); return _t24; } else if (string__eq(name, _SLIT("msvc"))) { - Option_string _t25; - opt_ok(&(string[]) { _SLIT("_MSC_VER") }, (Option*)(&_t25), sizeof(string)); + _option_string _t25; + opt_ok2(&(string[]) { _SLIT("_MSC_VER") }, (_option*)(&_t25), sizeof(string)); return _t25; } else if (string__eq(name, _SLIT("cplusplus"))) { - Option_string _t26; - opt_ok(&(string[]) { _SLIT("__cplusplus") }, (Option*)(&_t26), sizeof(string)); + _option_string _t26; + opt_ok2(&(string[]) { _SLIT("__cplusplus") }, (_option*)(&_t26), sizeof(string)); return _t26; } else if (string__eq(name, _SLIT("threads"))) { - Option_string _t27; - opt_ok(&(string[]) { _SLIT("__VTHREADS__") }, (Option*)(&_t27), sizeof(string)); + _option_string _t27; + opt_ok2(&(string[]) { _SLIT("__VTHREADS__") }, (_option*)(&_t27), sizeof(string)); return _t27; } else if (string__eq(name, _SLIT("gcboehm"))) { - Option_string _t28; - opt_ok(&(string[]) { _SLIT("_VGCBOEHM") }, (Option*)(&_t28), sizeof(string)); + _option_string _t28; + opt_ok2(&(string[]) { _SLIT("_VGCBOEHM") }, (_option*)(&_t28), sizeof(string)); return _t28; } else if (string__eq(name, _SLIT("debug"))) { - Option_string _t29; - opt_ok(&(string[]) { _SLIT("_VDEBUG") }, (Option*)(&_t29), sizeof(string)); + _option_string _t29; + opt_ok2(&(string[]) { _SLIT("_VDEBUG") }, (_option*)(&_t29), sizeof(string)); return _t29; } else if (string__eq(name, _SLIT("prod"))) { - Option_string _t30; - opt_ok(&(string[]) { _SLIT("_VPROD") }, (Option*)(&_t30), sizeof(string)); + _option_string _t30; + opt_ok2(&(string[]) { _SLIT("_VPROD") }, (_option*)(&_t30), sizeof(string)); return _t30; } else if (string__eq(name, _SLIT("profile"))) { - Option_string _t31; - opt_ok(&(string[]) { _SLIT("_VPROFILE") }, (Option*)(&_t31), sizeof(string)); + _option_string _t31; + opt_ok2(&(string[]) { _SLIT("_VPROFILE") }, (_option*)(&_t31), sizeof(string)); return _t31; } else if (string__eq(name, _SLIT("test"))) { - Option_string _t32; - opt_ok(&(string[]) { _SLIT("_VTEST") }, (Option*)(&_t32), sizeof(string)); + _option_string _t32; + opt_ok2(&(string[]) { _SLIT("_VTEST") }, (_option*)(&_t32), sizeof(string)); return _t32; } else if (string__eq(name, _SLIT("glibc"))) { - Option_string _t33; - opt_ok(&(string[]) { _SLIT("__GLIBC__") }, (Option*)(&_t33), sizeof(string)); + _option_string _t33; + opt_ok2(&(string[]) { _SLIT("__GLIBC__") }, (_option*)(&_t33), sizeof(string)); return _t33; } else if (string__eq(name, _SLIT("prealloc"))) { - Option_string _t34; - opt_ok(&(string[]) { _SLIT("_VPREALLOC") }, (Option*)(&_t34), sizeof(string)); + _option_string _t34; + opt_ok2(&(string[]) { _SLIT("_VPREALLOC") }, (_option*)(&_t34), sizeof(string)); return _t34; } else if (string__eq(name, _SLIT("no_bounds_checking"))) { - Option_string _t35; - opt_ok(&(string[]) { _SLIT("CUSTOM_DEFINE_no_bounds_checking") }, (Option*)(&_t35), sizeof(string)); + _option_string _t35; + opt_ok2(&(string[]) { _SLIT("CUSTOM_DEFINE_no_bounds_checking") }, (_option*)(&_t35), sizeof(string)); return _t35; } else if (string__eq(name, _SLIT("freestanding"))) { - Option_string _t36; - opt_ok(&(string[]) { _SLIT("_VFREESTANDING") }, (Option*)(&_t36), sizeof(string)); + _option_string _t36; + opt_ok2(&(string[]) { _SLIT("_VFREESTANDING") }, (_option*)(&_t36), sizeof(string)); return _t36; } else if (string__eq(name, _SLIT("amd64"))) { - Option_string _t37; - opt_ok(&(string[]) { _SLIT("__V_amd64") }, (Option*)(&_t37), sizeof(string)); + _option_string _t37; + opt_ok2(&(string[]) { _SLIT("__V_amd64") }, (_option*)(&_t37), sizeof(string)); return _t37; } else if (string__eq(name, _SLIT("aarch64")) || string__eq(name, _SLIT("arm64"))) { - Option_string _t38; - opt_ok(&(string[]) { _SLIT("__V_arm64") }, (Option*)(&_t38), sizeof(string)); + _option_string _t38; + opt_ok2(&(string[]) { _SLIT("__V_arm64") }, (_option*)(&_t38), sizeof(string)); return _t38; } else if (string__eq(name, _SLIT("arm32"))) { - Option_string _t39; - opt_ok(&(string[]) { _SLIT("__V_arm32") }, (Option*)(&_t39), sizeof(string)); + _option_string _t39; + opt_ok2(&(string[]) { _SLIT("__V_arm32") }, (_option*)(&_t39), sizeof(string)); return _t39; } else if (string__eq(name, _SLIT("i386"))) { - Option_string _t40; - opt_ok(&(string[]) { _SLIT("__V_x86") }, (Option*)(&_t40), sizeof(string)); + _option_string _t40; + opt_ok2(&(string[]) { _SLIT("__V_x86") }, (_option*)(&_t40), sizeof(string)); return _t40; } else if (string__eq(name, _SLIT("x64"))) { - Option_string _t41; - opt_ok(&(string[]) { _SLIT("TARGET_IS_64BIT") }, (Option*)(&_t41), sizeof(string)); + _option_string _t41; + opt_ok2(&(string[]) { _SLIT("TARGET_IS_64BIT") }, (_option*)(&_t41), sizeof(string)); return _t41; } else if (string__eq(name, _SLIT("x32"))) { - Option_string _t42; - opt_ok(&(string[]) { _SLIT("TARGET_IS_32BIT") }, (Option*)(&_t42), sizeof(string)); + _option_string _t42; + opt_ok2(&(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)); + _option_string _t43; + opt_ok2(&(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)); + _option_string _t44; + opt_ok2(&(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 _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)); + _option_string _t45; + opt_ok2(&(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 \""), /*115 &string*/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} }; + return (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL v__ast__CTempVar v__gen__c__Gen_new_ctemp_var(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type expr_type) { @@ -76779,7 +76888,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_dump_expr_definitions(v__gen__c__Gen* g) { string ptr_asterisk = (is_ptr ? (_SLIT("*")) : (_SLIT(""))); 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, 444) /*expected idx: 444, name: v.ast.FnType */ ; + v__ast__FnType fninfo = /* as */ *(v__ast__FnType*)__as_cast((dump_sym->info)._v__ast__FnType,(dump_sym->info)._typ, 445) /*expected idx: 445, 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); @@ -76863,7 +76972,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as } #endif if (v__gen__c__Gen_embed_file_is_prod_mode(g)) { - Option_Array_u8 _t1 = os__read_bytes(node->embed_file.apath); + _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: \""), /*115 &string*/0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); @@ -76878,7 +76987,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as string cache_dir = os__join_path(os__vmodules_dir(), new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("cache"), _SLIT("embed_file")}))); string cache_key = rand__ulid(); if (!os__exists(cache_dir)) { - Option_void _t2 = os__mkdir_all(cache_dir); + _option_void _t2 = os__mkdir_all(cache_dir); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -76901,7 +77010,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as 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); + _option_Array_u8 _t3 = os__read_bytes(cache_path); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; eprintln(_SLIT("unable to read compressed file")); @@ -76911,7 +77020,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as } Array_u8 compressed_bytes = (*(Array_u8*)_t3.data); - Option_void _t4 = os__rm(cache_path); + _option_void _t4 = os__rm(cache_path); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; } @@ -77217,7 +77326,7 @@ int ctmp; if (is_livefn && !is_livemode) { 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); + _option_string _t6 = v__gen__c__Gen_c_fn_name(g, node); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; // Defer begin @@ -77253,7 +77362,7 @@ int ctmp; } 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}; + _option_string _t7 = {0}; if (_t8) { *((string*)&_t7.data) = *((string*)_t8); } else { @@ -77370,14 +77479,14 @@ int ctmp; if (!Array_string_contains(g->defer_vars, var.name)) { array_push((array*)&g->defer_vars, _MOV((string[]){ string_clone(var.name) })); string deref = _SLIT(""); - Option_v__ast__Var_ptr _t13; + _option_v__ast__Var_ptr _t13; if (_t13 = v__ast__Scope_find_var(var.scope, var.name), _t13.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t13.data; if (v->is_auto_heap) { deref = _SLIT("*"); } } - 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 */ ; + v__ast__Var info = /* as */ *(v__ast__Var*)__as_cast((var.obj)._v__ast__Var,(var.obj)._typ, 326) /*expected idx: 326, 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, /*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 }}}))); } @@ -77428,7 +77537,7 @@ 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 != 318 /* 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 != 319 /* 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 ("), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); @@ -77496,7 +77605,7 @@ if (v__gen__c__Gen_gen_fn_decl_defer_0) { // Defer end } -VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast__FnDecl* node) { +VV_LOCAL_SYMBOL _option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast__FnDecl* node) { string name = node->name; if (string__eq(name, _SLIT("+")) || string__eq(name, _SLIT("-")) || string__eq(name, _SLIT("*")) || string__eq(name, _SLIT("/")) || string__eq(name, _SLIT("%")) || string__eq(name, _SLIT("<")) || string__eq(name, _SLIT("=="))) { name = v__util__replace_op(name); @@ -77504,7 +77613,7 @@ VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast if (node->is_method) { v__ast__TypeSymbol* unwrapped_rec_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node->receiver.typ)); if (unwrapped_rec_sym->kind == v__ast__Kind__placeholder) { - return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } name = string__plus(string__plus(v__gen__c__Gen_cc_type(g, node->receiver.typ, false), _SLIT("_")), name); } @@ -77519,8 +77628,8 @@ VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast if ((g->pref->translated || g->file->is_translated) && Array_v__ast__Attr_contains(node->attrs, _SLIT("c"))) { name = (*(v__ast__Attr*)/*ee elem_sym */array_get(node->attrs, 0)).arg; } - Option_string _t2; - opt_ok(&(string[]) { name }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { name }, (_option*)(&_t2), sizeof(string)); return _t2; } @@ -77664,7 +77773,7 @@ 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, 444) /*expected idx: 444, 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, 445) /*expected idx: 445, name: v.ast.FnType */ ; v__ast__Fn func = info.func; 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 }}}))); @@ -77677,7 +77786,7 @@ VV_LOCAL_SYMBOL multi_return_Array_string_Array_string_Array_bool v__gen__c__Gen bool heap_prom = false; if (scope != ((voidptr)(0))) { if (!string__eq(arg.name, _SLIT("_"))) { - Option_v__ast__Var_ptr _t3; + _option_v__ast__Var_ptr _t3; if (_t3 = v__ast__Scope_find_var(scope, arg.name), _t3.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t3.data; if (!v->is_stack_obj && v->is_auto_heap) { @@ -77730,13 +77839,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 == 245 /* v.ast.AnonFn */) { + if ((node.left)._typ == 246 /* v.ast.AnonFn */) { v__gen__c__Gen_expr(g, node.left); - } else if ((node.left)._typ == 270 /* v.ast.IndexExpr */ && (node.name).len == 0) { + } else if ((node.left)._typ == 271 /* 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 == 253 /* v.ast.CallExpr */ && (node.name).len == 0) { + } else if ((node.left)._typ == 254 /* v.ast.CallExpr */ && (node.name).len == 0) { v__gen__c__Gen_expr(g, node.left); } if (node.should_be_skipped) { @@ -77766,7 +77875,7 @@ bool v__gen__c__Gen_call_expr_defer_0 = false; 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 == 290 /* 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 == 291 /* 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); @@ -77835,7 +77944,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 == 417 /* v.ast.Struct */) { + if (sym->info._typ == 418 /* 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; @@ -77848,13 +77957,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } Array_string generic_names =_t1; v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t3; + _option_v__ast__Type _t3; if (_t3 = v__ast__Table_resolve_generic_to_concrete(muttable, node.receiver_type, generic_names, (*sym->info._v__ast__Struct).concrete_types), _t3.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t3.data; unwrapped_rec_type = utyp; } } - else if (sym->info._typ == 435 /* v.ast.Interface */) { + else if (sym->info._typ == 436 /* 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; @@ -77867,13 +77976,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } Array_string generic_names =_t4; v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t6; + _option_v__ast__Type _t6; if (_t6 = v__ast__Table_resolve_generic_to_concrete(muttable, node.receiver_type, generic_names, (*sym->info._v__ast__Interface).concrete_types), _t6.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t6.data; unwrapped_rec_type = utyp; } } - else if (sym->info._typ == 436 /* v.ast.SumType */) { + else if (sym->info._typ == 437 /* 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; @@ -77886,7 +77995,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } Array_string generic_names =_t7; v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t9; + _option_v__ast__Type _t9; if (_t9 = v__ast__Table_resolve_generic_to_concrete(muttable, node.receiver_type, generic_names, (*sym->info._v__ast__SumType).concrete_types), _t9.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t9.data; unwrapped_rec_type = utyp; @@ -77899,12 +78008,12 @@ 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, 432) /*expected idx: 432, 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, 433) /*expected idx: 433, 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, 435) /*expected idx: 435, 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, 436) /*expected idx: 436, 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: "), /*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 }}}))); @@ -77989,7 +78098,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, 413) /*expected idx: 413, 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, 414) /*expected idx: 414, 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)) { @@ -78042,12 +78151,12 @@ 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 == 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 */) { + if ((node.left)._typ == 260 /* v.ast.ComptimeSelector */) { + if (((*node.left._v__ast__ComptimeSelector).field_expr)._typ == 288 /* v.ast.SelectorExpr */) { + if (((*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 268 /* 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}; + _option_v__ast__Type _t10 = {0}; if (_t11) { *((v__ast__Type*)&_t10.data) = *((v__ast__Type*)_t11); } else { @@ -78064,10 +78173,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE return; } } - } else if ((node.left)._typ == 258 /* v.ast.ComptimeCall */) { + } else if ((node.left)._typ == 259 /* 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; + _option_v__ast__Fn _t12; if (_t12 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method), _t12.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t12.data; rec_type = m.return_type; @@ -78075,8 +78184,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 == 267 /* v.ast.Ident */) { - if (((*node.left._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + } else if ((node.left)._typ == 268 /* v.ast.Ident */) { + if (((*node.left._v__ast__Ident).obj)._typ == 326 /* 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); @@ -78084,7 +78193,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 == 430 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 431 /* 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); @@ -78105,7 +78214,7 @@ 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 == 432 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) { + if (!((left_sym->info)._typ == 433 /* 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"))) { @@ -78120,12 +78229,12 @@ 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__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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 413) /*expected idx: 413, name: v.ast.Array */ ; noscan = v__gen__c__Gen_check_noscan(g, info.elem_type); } } else if (left_sym->kind == v__ast__Kind__chan) { @@ -78135,6 +78244,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } else if (final_left_sym->kind == v__ast__Kind__map) { if (string__eq(node.name, _SLIT("keys"))) { name = _SLIT("map_keys"); + } else if (string__eq(node.name, _SLIT("values"))) { + name = _SLIT("map_values"); } } if (g->pref->obfuscate && string__eq(g->cur_mod.name, _SLIT("main")) && string_starts_with(name, _SLIT("main__")) && !string__eq(node.name, _SLIT("str"))) { @@ -78142,7 +78253,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE 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: "), /*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}; + _option_string _t13 = {0}; if (_t14) { *((string*)&_t13.data) = *((string*)_t14); } else { @@ -78160,9 +78271,9 @@ 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 == 270 /* v.ast.IndexExpr */) { + if ((node.left)._typ == 271 /* v.ast.IndexExpr */) { v__ast__Expr idx = (*node.left._v__ast__IndexExpr).index; - if ((idx)._typ == 285 /* v.ast.RangeExpr */) { + if ((idx)._typ == 286 /* 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; } @@ -78213,7 +78324,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__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 == 276 /* v.ast.MapInit */) { + if ((node.left)._typ == 277 /* 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]")); @@ -78282,8 +78393,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 == 267 /* v.ast.Ident */) { - if (((*call_arg->expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((call_arg->expr)._typ == 268 /* v.ast.Ident */) { + if (((*call_arg->expr._v__ast__Ident).obj)._typ == 326 /* 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; } } @@ -78322,7 +78433,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr 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, 293) /*expected idx: 293, 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, 294) /*expected idx: 294, 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); @@ -78333,7 +78444,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr 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_"), /*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 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT("); // del"), 0, { .d_c = 0 }}}))); @@ -78348,7 +78459,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr name = v__gen__c__c_name(name); } if (g->pref->translated || g->file->is_translated) { - Option_v__ast__Fn _t2; + _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t2.data; if (Array_v__ast__Attr_contains(f.attrs, _SLIT("c"))) { @@ -78360,7 +78471,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr string key = node.name; v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf call: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t4 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); - Option_string _t3 = {0}; + _option_string _t3 = {0}; if (_t4) { *((string*)&_t3.data) = *((string*)_t4); } else { @@ -78377,7 +78488,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr name = *(string*)_t3.data; } if (!is_selector_call) { - Option_v__ast__Fn _t5; + _option_v__ast__Fn _t5; if (_t5 = v__ast__Table_find_fn(g->table, node.name), _t5.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t5.data; if (func.generic_names.len > 0) { @@ -78398,7 +78509,7 @@ 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, 435) /*expected idx: 435, name: v.ast.Interface */ )), _SLIT("str"))) { + 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, 436) /*expected idx: 436, 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); @@ -78417,12 +78528,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr 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, /*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 */) { + if ((expr)._typ == 260 /* v.ast.ComptimeSelector */) { + if (((*expr._v__ast__ComptimeSelector).field_expr)._typ == 288 /* v.ast.SelectorExpr */) { + if (((*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 268 /* 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}; + _option_v__ast__Type _t6 = {0}; if (_t7) { *((v__ast__Type*)&_t6.data) = *((v__ast__Type*)_t7); } else { @@ -78437,22 +78548,22 @@ 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 == 258 /* v.ast.ComptimeCall */) { + } else if ((expr)._typ == 259 /* 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; + _option_v__ast__Fn _t8; if (_t8 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method), _t8.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t8.data; typ = m.return_type; } } - } else if ((expr)._typ == 267 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + } else if ((expr)._typ == 268 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 326 /* 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 == 430 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 431 /* v.ast.Aggregate */) { typ = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } } @@ -78466,20 +78577,20 @@ 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_41773 = v__gen__c__Gen_panic_debug_info(g, node.pos); - int paline = mr_41773.arg0; - string pafile = mr_41773.arg1; - string pamod = mr_41773.arg2; - string pafn = mr_41773.arg3; + multi_return_int_string_string_string mr_41840 = v__gen__c__Gen_panic_debug_info(g, node.pos); + int paline = mr_41840.arg0; + string pafile = mr_41840.arg1; + string pamod = mr_41840.arg2; + string pafn = mr_41840.arg3; v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_call_args(g, node); v__gen__c__Gen_write(g, _SLIT(")")); } else { bool is_fn_var = false; - Option_v__ast__ScopeObject _t9; + _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 == 325 /* v.ast.Var */) { + if (obj._typ == 326 /* 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("(*")); @@ -78495,7 +78606,7 @@ 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 == 430 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 431 /* 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, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { @@ -78567,7 +78678,7 @@ 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 == 253 /* v.ast.CallExpr */) { + if ((arg.expr)._typ == 254 /* v.ast.CallExpr */) { v__gen__c__Gen_autofree_call_pregen(g, (*arg.expr._v__ast__CallExpr)); } free_tmp_arg_vars = true; @@ -78576,10 +78687,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_call_pregen(v__gen__c__Gen* g, v__a bool used = false; 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; + _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 == 325 /* v.ast.Var */) { + if (x._typ == 326 /* v.ast.Var */) { (*x._v__ast__Var).is_used = false; } @@ -78614,7 +78725,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 == 325 /* v.ast.Var */) { + if (obj->_typ == 326 /* v.ast.Var */) { bool is_optional = v__ast__Type_has_flag((*obj->_v__ast__Var).typ, v__ast__TypeFlag__optional); if (is_optional) { continue; @@ -78665,13 +78776,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } if ( _t3 &&_t4) { if (node.is_method) { - Option_v__ast__Fn _t6; + _option_v__ast__Fn _t6; if (_t6 = v__ast__Table_find_method(g->table, v__ast__Table_sym(g->table, node.left_type), node.name), _t6.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t6.data; if (func.generic_names.len > 0) { for (int i = 0; i < expected_types.len; ++i) { v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t7; + _option_v__ast__Type _t7; if (_t7 = v__ast__Table_resolve_generic_to_concrete(muttable, (*(v__ast__Type*)/*ee elem_sym */array_get(node.expected_arg_types, i)), func.generic_names, node.concrete_types), _t7.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t7.data; array_set(&expected_types, i, &(v__ast__Type[]) { utyp }); @@ -78680,13 +78791,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } } } else { - Option_v__ast__Fn _t8; + _option_v__ast__Fn _t8; if (_t8 = v__ast__Table_find_fn(g->table, node.name), _t8.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t8.data; if (func.generic_names.len > 0) { for (int i = 0; i < expected_types.len; ++i) { v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t9; + _option_v__ast__Type _t9; if (_t9 = v__ast__Table_resolve_generic_to_concrete(muttable, (*(v__ast__Type*)/*ee elem_sym */array_get(node.expected_arg_types, i)), func.generic_names, node.concrete_types), _t9.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t9.data; array_set(&expected_types, i, &(v__ast__Type[]) { utyp }); @@ -78731,13 +78842,13 @@ 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, name: v.ast.Array */ ; if (v__ast__Type_has_flag(varg_type, v__ast__TypeFlag__generic)) { - Option_v__ast__Fn _t10; + _option_v__ast__Fn _t10; if (_t10 = v__ast__Table_find_fn(g->table, node.name), _t10.state == 0) { v__ast__Fn fn_def = *(v__ast__Fn*)_t10.data; v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t11; + _option_v__ast__Type _t11; if (_t11 = v__ast__Table_resolve_generic_to_concrete(muttable, arr_info.elem_type, fn_def.generic_names, node.concrete_types), _t11.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t11.data; arr_info.elem_type = utyp; @@ -78751,7 +78862,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp 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 == 246 /* v.ast.ArrayDecompose */) { + } else if (args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(args, args.len - 1)).expr)._typ == 247 /* 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) { @@ -78789,7 +78900,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 == 245 /* v.ast.AnonFn */) { + } else if ((expr.left)._typ == 246 /* 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) { @@ -78804,7 +78915,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } 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}; + _option_string _t1 = {0}; if (_t2) { *((string*)&_t1.data) = *((string*)_t2); } else { @@ -78846,7 +78957,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)) { gohandle_name = (is_opt ? (_SLIT("__v_thread_Option_void")) : (_SLIT("__v_thread"))); } else { - string opt = (is_opt ? (_SLIT("Option_")) : (_SLIT(""))); + string opt = (is_opt ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); 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) { @@ -78968,7 +79079,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__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, 435) /*expected idx: 435, 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, 436) /*expected idx: 436, 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(receiver_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); @@ -79084,7 +79195,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 == 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 */) { + if (((arg.expr)._typ == 268 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((arg.expr)._v__ast__Ident,(arg.expr)._typ, 268) /*expected idx: 268, name: v.ast.Ident */ ).kind == v__ast__IdentKind__variable) || (arg.expr)._typ == 288 /* v.ast.SelectorExpr */) { v__gen__c__Gen_write(g, _SLIT("&/*arr*/")); v__gen__c__Gen_expr(g, arg.expr); } else { @@ -79093,11 +79204,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 == 267 /* v.ast.Ident */ || (arg.expr)._typ == 287 /* v.ast.SelectorExpr */)) { + } else if (arg_sym->kind == v__ast__Kind__sum_type && exp_sym->kind == v__ast__Kind__sum_type && ((arg.expr)._typ == 268 /* v.ast.Ident */ || (arg.expr)._typ == 288 /* 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 == 267 /* v.ast.Ident */ || (arg.expr)._typ == 287 /* v.ast.SelectorExpr */)) { + } else if (arg_sym->kind == v__ast__Kind__interface_ && exp_sym->kind == v__ast__Kind__interface_ && ((arg.expr)._typ == 268 /* v.ast.Ident */ || (arg.expr)._typ == 288 /* v.ast.SelectorExpr */)) { v__gen__c__Gen_write(g, _SLIT("&/*iface*/")); v__gen__c__Gen_expr(g, arg.expr); return; @@ -79134,7 +79245,7 @@ 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 == 247 /* v.ast.ArrayInit */) { + } else if ((arg.expr)._typ == 248 /* 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("("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*arg.expr._v__ast__ArrayInit).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); @@ -79376,7 +79487,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn 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 == 267 /* v.ast.Ident */ || (node.cond)._typ == 287 /* v.ast.SelectorExpr */) { + if ((node.cond)._typ == 268 /* v.ast.Ident */ || (node.cond)._typ == 288 /* 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); @@ -79394,7 +79505,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn 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, 444) /*expected idx: 444, 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, 445) /*expected idx: 445, 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("(("), /*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 }}})); @@ -79408,7 +79519,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } 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 == 247 /* v.ast.ArrayInit */; + bool cond_is_literal = (node.cond)._typ == 248 /* 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)); @@ -79430,14 +79541,14 @@ 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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((cond_sym->info)._v__ast__ArrayFixed,(cond_sym->info)._typ, 441) /*expected idx: 441, 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, 444) /*expected idx: 444, 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, 445) /*expected idx: 445, 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"), /*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 }}}))); @@ -79461,7 +79572,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } } else if (node.kind == v__ast__Kind__map) { string cond_var = _SLIT(""); - if ((node.cond)._typ == 267 /* v.ast.Ident */) { + if ((node.cond)._typ == 268 /* 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); @@ -79499,7 +79610,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn 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, 444) /*expected idx: 444, 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, 445) /*expected idx: 445, 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(&"), /*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) { @@ -79522,7 +79633,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } g->indent--; } else if (node.kind == v__ast__Kind__string) { - 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)); + v__ast__Expr cond = ((node.cond)._typ == 292 /* v.ast.StringLiteral */ || (node.cond)._typ == 291 /* 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 "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); @@ -79535,7 +79646,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } } else if (node.kind == v__ast__Kind__struct_) { v__ast__TypeSymbol* cond_type_sym = v__ast__Table_sym(g->table, node.cond_type); - Option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(cond_type_sym, _SLIT("next")); + _option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(cond_type_sym, _SLIT("next")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__gen__c__verror(_SLIT("`next` method not found")); @@ -79559,7 +79670,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn 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 == 417 /* v.ast.Struct */) { + if ((receiver_sym->info)._typ == 418 /* 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); } @@ -79603,22 +79714,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 == 269 /* v.ast.IfGuardExpr */ || branch.stmts.len > 1) { + if ((branch.cond)._typ == 270 /* 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 == 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__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 308 /* 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, 308) /*expected idx: 308, name: v.ast.ExprStmt */ ; if (v__gen__c__is_noreturn_callexpr(stmt.expr)) { bool _t4 = true; return _t4; } - if ((stmt.expr)._typ == 277 /* v.ast.MatchExpr */) { + if ((stmt.expr)._typ == 278 /* v.ast.MatchExpr */) { bool _t5 = true; return _t5; } - if ((stmt.expr)._typ == 253 /* v.ast.CallExpr */) { + if ((stmt.expr)._typ == 254 /* 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) { @@ -79690,13 +79801,13 @@ 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 == 269 /* v.ast.IfGuardExpr */) { + if ((cond)._typ == 270 /* 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 != 270 /* v.ast.IndexExpr */ && ((*cond._v__ast__IfGuardExpr).expr)._typ != 284 /* v.ast.PrefixExpr */) { + if (((*cond._v__ast__IfGuardExpr).expr)._typ != 271 /* v.ast.IndexExpr */ && ((*cond._v__ast__IfGuardExpr).expr)._typ != 285 /* 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, /*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 }}}))); @@ -79716,7 +79827,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no 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 = "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); } - } else if ((branch.cond)._typ == 269 /* v.ast.IfGuardExpr */) { + } else if ((branch.cond)._typ == 270 /* v.ast.IfGuardExpr */) { string var_name = (*(string*)/*ee elem_sym */array_get(guard_vars, i)); bool short_opt = false; if ((var_name).len == 0) { @@ -79741,7 +79852,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no bool is_auto_heap = false; if (branch.stmts.len > 0) { v__ast__Scope* scope = v__ast__Scope_innermost(g->file->scope, v__ast__Node_pos(v__ast__Stmt_to_sumtype_v__ast__Node(ADDR(v__ast__Stmt, ((*(v__ast__Stmt*)array_last(branch.stmts)))))).pos); - Option_v__ast__Var_ptr _t1; + _option_v__ast__Var_ptr _t1; if (_t1 = v__ast__Scope_find_var(scope, (*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name), _t1.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t1.data; is_auto_heap = v->is_auto_heap; @@ -79760,7 +79871,7 @@ 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, 443) /*expected idx: 443, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 444) /*expected idx: 444, 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) { @@ -79776,8 +79887,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 == 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 */) { + if ((branch.cond)._typ == 272 /* v.ast.InfixExpr */) { + if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_in && ((*branch.cond._v__ast__InfixExpr).left)._typ != 272 /* v.ast.InfixExpr */ && ((*branch.cond._v__ast__InfixExpr).right)._typ == 248 /* v.ast.ArrayInit */) { no_needs_par = true; } } @@ -79824,7 +79935,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 == 285 /* v.ast.RangeExpr */) { + if ((node.index)._typ == 286 /* 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); @@ -79921,7 +80032,7 @@ 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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, 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(")); @@ -79949,7 +80060,7 @@ 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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 441) /*expected idx: 441, 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)) { @@ -79975,14 +80086,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE 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, 412) /*expected idx: 412, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 413) /*expected idx: 413, 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 == 287 /* v.ast.SelectorExpr */; + bool is_selector = (node.left)._typ == 288 /* 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); @@ -80053,7 +80164,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In v__gen__c__Gen_write(g, _SLIT("/*2*/string_clone(")); } if (g->is_fn_index_call) { - if ((elem_sym->info)._typ == 444 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 445 /* 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(")(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); @@ -80117,10 +80228,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In } 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, 440) /*expected idx: 440, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym.info)._v__ast__ArrayFixed,(sym.info)._typ, 441) /*expected idx: 441, 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 == 444 /* v.ast.FnType */; + bool is_fn_index_call = g->is_fn_index_call && (elem_sym->info)._typ == 445 /* v.ast.FnType */; if (is_fn_index_call) { v__gen__c__Gen_write(g, _SLIT("(*")); } @@ -80133,7 +80244,7 @@ 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 == 272 /* v.ast.IntegerLiteral */) || g->pref->translated) { + if ((direct || (node.index)._typ == 273 /* 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(")); @@ -80149,7 +80260,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, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 414) /*expected idx: 414, 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); @@ -80172,7 +80283,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde 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 == 270 /* v.ast.IndexExpr */) { + if ((node.left)._typ == 271 /* v.ast.IndexExpr */) { g->inside_map_index = true; v__gen__c__Gen_expr(g, node.left); g->inside_map_index = false; @@ -80232,7 +80343,7 @@ 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, 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 == 444 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 445 /* 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(")); @@ -80457,13 +80568,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr(v__gen__c__Gen* g, v__ast__InfixE 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, 441) /*expected idx: 441, 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, 442) /*expected idx: 442, 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 "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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("__"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); } @@ -80484,10 +80595,10 @@ 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 == 432 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(left.sym, _SLIT("==")); + bool has_alias_eq_op_overload = (left.sym->info)._typ == 433 /* 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 == 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) { + } 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 == 292 /* v.ast.StringLiteral */ && ((/* as */ *(v__ast__StringLiteral*)__as_cast((node.right)._v__ast__StringLiteral,(node.right)._typ, 292) /*expected idx: 292, 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(")")); @@ -80565,7 +80676,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((node.left)._typ == 247 /* v.ast.ArrayInit */) { + if ((node.left)._typ == 248 /* 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("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); @@ -80573,7 +80684,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); - if ((node.right)._typ == 247 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 248 /* 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("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); @@ -80717,11 +80828,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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, 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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, 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); @@ -80798,7 +80909,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 == 247 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 248 /* 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) { @@ -80811,7 +80922,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } } } - if ((node.right)._typ == 247 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 248 /* 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)); @@ -80819,7 +80930,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 == 412 /* v.ast.Array */) { + if ((right.sym->info)._typ == 413 /* 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) { @@ -80855,7 +80966,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 == 247 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 248 /* 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) { @@ -80868,7 +80979,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } } } - if ((node.right)._typ == 247 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 248 /* 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)); @@ -80876,7 +80987,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 == 440 /* v.ast.ArrayFixed */) { + if ((right.sym->info)._typ == 441 /* v.ast.ArrayFixed */) { v__ast__Type elem_type = (*right.sym->info._v__ast__ArrayFixed).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) { @@ -80941,7 +81052,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, 430) /*expected idx: 430, 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, 431) /*expected idx: 431, 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); @@ -80965,10 +81076,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ if (left_sym->kind == v__ast__Kind__interface_) { 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 == 293 /* v.ast.TypeNode */) { + if (node.right._typ == 294 /* v.ast.TypeNode */) { _t1 = v__gen__c__Gen_unwrap_generic(g, (*node.right._v__ast__TypeNode).typ); } - else if (node.right._typ == 279 /* v.ast.None */) { + else if (node.right._typ == 280 /* v.ast.None */) { _t1 = (*(int*)map_get(ADDR(map, g->table->type_idxs), &(string[]){_SLIT("None__")}, &(int[]){ 0 })); } @@ -80988,9 +81099,9 @@ 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, 435) /*expected idx: 435, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((left_sym->info)._v__ast__Interface,(left_sym->info)._typ, 436) /*expected idx: 436, 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}; + _option_Array_v__ast__Type _t1 = {0}; if (_t2) { *((Array_v__ast__Type*)&_t1.data) = *((Array_v__ast__Type*)_t2); } else { @@ -81034,8 +81145,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, 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; + if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 418) /*expected idx: 418, 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, 418) /*expected idx: 418, 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); @@ -81045,7 +81156,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_arithmetic_op(v__gen__c__Gen* g, v__gen__c__Gen_expr(g, node.right); v__gen__c__Gen_write(g, _SLIT(")")); } else { - Option_v__ast__Fn _t1 = v__ast__Table_find_method(g->table, left.sym, v__token__Kind_str(node.op)); + _option_v__ast__Fn _t1 = v__ast__Table_find_method(g->table, left.sym, v__token__Kind_str(node.op)); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__gen__c__Gen_gen_plain_infix_expr(g, node); @@ -81070,7 +81181,7 @@ 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, 412) /*expected idx: 412, 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, 413) /*expected idx: 413, 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"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); @@ -81098,7 +81209,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, } 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 == 267 /* v.ast.Ident */; + bool elem_is_array_var = (elem_sym->kind == v__ast__Kind__array || elem_sym->kind == v__ast__Kind__array_fixed) && (node.right)._typ == 268 /* 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("&")); @@ -81135,37 +81246,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 == 253 /* v.ast.CallExpr */) { + if (node._typ == 254 /* 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 == 270 /* v.ast.IndexExpr */) { + else if (node._typ == 271 /* 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 == 271 /* v.ast.InfixExpr */) { + else if (node._typ == 272 /* 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 == 282 /* v.ast.ParExpr */) { + else if (node._typ == 283 /* 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 == 283 /* v.ast.PostfixExpr */) { + else if (node._typ == 284 /* 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 == 284 /* v.ast.PrefixExpr */) { + else if (node._typ == 285 /* 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 == 285 /* v.ast.RangeExpr */) { + else if (node._typ == 286 /* 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 == 287 /* v.ast.SelectorExpr */) { + else if (node._typ == 288 /* v.ast.SelectorExpr */) { bool _t8 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__SelectorExpr).expr); return _t8; } @@ -81178,7 +81289,7 @@ 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 == 268 /* v.ast.IfExpr */) { + if ((node.right)._typ == 269 /* 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))) { @@ -81284,11 +81395,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_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dec_fn_name}}, {_SLIT("(cJSON* root)"), 0, { .d_c = 0 }}})); + string dec_fn_dec = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, 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) { @@ -81303,7 +81414,7 @@ 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){.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.update_expr_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.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)),.typ_str = styp,.update_expr = {0},.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,},.typ = utyp,.update_expr_type = 0,.is_short = 0,.is_short_syntax = 0,.unresolved = 0,.is_update_embed = 0,.has_update_expr = 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(&dec, str_intp(5, _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 ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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* "), /*115 &string*/0xfe10, {.d_s = enc_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val)"), 0, { .d_c = 0 }}})); @@ -81315,13 +81426,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { 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, 413) /*expected idx: 413, name: v.ast.Map */ ; + v__ast__Map m = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 414) /*expected idx: 414, 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, 432) /*expected idx: 432, name: v.ast.Alias */ ; + v__ast__Alias a = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 433) /*expected idx: 433, 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))) { @@ -81329,7 +81440,7 @@ 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 == 417 /* v.ast.Struct */) { + if ((psym->info)._typ == 418 /* 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: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" aliased sumtypes does not work at the moment"), 0, { .d_c = 0 }}}))); @@ -81340,21 +81451,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { } } else if (sym->kind == v__ast__Kind__sum_type) { strings__Builder_writeln(&enc, _SLIT("\to = cJSON_CreateObject();")); - if ((sym->info)._typ != 436 /* v.ast.SumType */) { + if ((sym->info)._typ != 437 /* 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 != 417 /* v.ast.Struct */) { + if ((sym->info)._typ != 418 /* 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_"), /*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, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ret;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\topt_ok2(&res, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("*)&ret, sizeof(res));"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&dec, _SLIT("\treturn ret;\n}")); strings__Builder_writeln(&enc, _SLIT("\treturn o;\n}")); strings__Builder_writeln(&g->definitions, strings__Builder_str(&dec)); @@ -81364,7 +81475,7 @@ 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, 436) /*expected idx: 436, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym.info)._v__ast__SumType,(sym.info)._typ, 437) /*expected idx: 437, 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) @@ -81447,9 +81558,9 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g 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(\""), /*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(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\treturn ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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 = "), /*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}")); @@ -81504,9 +81615,9 @@ 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); 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) && "), /*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(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\treturn ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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 = "), /*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}")); @@ -81534,7 +81645,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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_info)._v__ast__Struct,(type_info)._typ, 418) /*expected idx: 418, 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; @@ -81586,7 +81697,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_struct_enc_dec(v__gen__c__Gen* g, v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); 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, 432) /*expected idx: 432, name: v.ast.Alias */ ; + v__ast__Alias alias = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 433) /*expected idx: 433, 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)) { @@ -81611,7 +81722,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_struct_enc_dec(v__gen__c__Gen* g, } 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, 432) /*expected idx: 432, name: v.ast.Alias */ ; + v__ast__Alias ainfo = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 433) /*expected idx: 433, name: v.ast.Alias */ ; enc_name = v__gen__c__js_enc_name(v__gen__c__Gen_typ(g, ainfo.parent_type)); } } @@ -81631,16 +81742,16 @@ VV_LOCAL_SYMBOL void v__gen__c__gen_js_get(string styp, string tmp, string name, 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_"), /*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, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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_"), /*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(6, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\treturn ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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}")); } @@ -81669,10 +81780,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_decode_array(v__gen__c__Gen* g, v__ast__Ty if (v__gen__c__is_js_prim(styp)) { 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_"), /*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 }}})); + s = str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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 *("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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_"), /*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 }}})); + string _t1 = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n if(root && !cJSON_IsArray(root) && !cJSON_IsNull(root)) {\n return ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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; } @@ -81687,19 +81798,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_decode_map(v__gen__c__Gen* g, v__ast__Type string styp = v__gen__c__Gen_typ(g, key_type); string styp_v = v__gen__c__Gen_typ(g, value_type); v__ast__TypeSymbol* key_type_symbol = v__ast__Table_sym(g->table, key_type); - multi_return_string_string_string_string mr_18875 = v__gen__c__Gen_map_fn_ptrs(g, *key_type_symbol); - string hash_fn = mr_18875.arg0; - string key_eq_fn = mr_18875.arg1; - string clone_fn = mr_18875.arg2; - string free_fn = mr_18875.arg3; + multi_return_string_string_string_string mr_18986 = v__gen__c__Gen_map_fn_ptrs(g, *key_type_symbol); + string hash_fn = mr_18986.arg0; + string key_eq_fn = mr_18986.arg1; + string clone_fn = mr_18986.arg2; + string free_fn = mr_18986.arg3; 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, /*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_"), /*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 }}})); + s = str_intp(9, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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 *("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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_"), /*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 }}})); + string _t1 = str_intp(11, _MOV((StrIntpData[]){{_SLIT("\n if(!cJSON_IsObject(root) && !cJSON_IsNull(root)) {\n return ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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; } @@ -81825,9 +81936,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 == 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)) { + if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 308 /* 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, 308) /*expected idx: 308, name: v.ast.ExprStmt */ ; + if (((stmt.expr)._typ == 254 /* v.ast.CallExpr */ || (stmt.expr)._typ == 269 /* v.ast.IfExpr */ || (stmt.expr)._typ == 278 /* v.ast.MatchExpr */) || ((stmt.expr)._typ == 271 /* v.ast.IndexExpr */ && (/* as */ *(v__ast__IndexExpr*)__as_cast((stmt.expr)._v__ast__IndexExpr,(stmt.expr)._typ, 271) /*expected idx: 271, name: v.ast.IndexExpr */ ).or_expr.kind != v__ast__OrKind__absent)) { bool _t7 = true; return _t7; } @@ -81859,7 +81970,7 @@ bool old; v__gen__c__Gen_match_expr_defer_0 = true; g->inside_match_optional = true; } - 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 */) { + if ((node.cond)._typ == 268 /* v.ast.Ident */ || (node.cond)._typ == 288 /* v.ast.SelectorExpr */ || (node.cond)._typ == 273 /* v.ast.IntegerLiteral */ || (node.cond)._typ == 292 /* v.ast.StringLiteral */ || (node.cond)._typ == 266 /* v.ast.FloatLiteral */) { cond_var = v__gen__c__Gen_expr_string(g, node.cond); } else { string _t1; /* if prepend */ @@ -81950,11 +82061,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_sumtype(v__gen__c__Gen* g, v__ast 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 == 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 */ ; + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 294 /* 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, 294) /*expected idx: 294, 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, /*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) { + } else if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 280 /* 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 }}}))); } } @@ -81984,7 +82095,7 @@ 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, /*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_string covered_enum = __new_array_with_default(0, (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 447) /*expected idx: 447, 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; @@ -81993,8 +82104,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ 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, 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]; + for (int _t2 = 0; _t2 < (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 447) /*expected idx: 447, 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, 447) /*expected idx: 447, 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 "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } @@ -82011,9 +82122,9 @@ 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 == 285 /* v.ast.RangeExpr */) { + if ((expr)._typ == 286 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 272 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 273 /* 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; } @@ -82046,7 +82157,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 == 285 /* v.ast.RangeExpr */) { + if ((it)._typ == 286 /* v.ast.RangeExpr */) { _t4 = true; break; } @@ -82057,7 +82168,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 == 264 /* v.ast.EnumVal */) { + if ((expr)._typ == 265 /* 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); @@ -82087,9 +82198,9 @@ 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 == 285 /* v.ast.RangeExpr */) { + if ((expr)._typ == 286 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 272 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 273 /* 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; } @@ -82190,9 +82301,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_classic(v__gen__c__Gen* g, v__ast v__gen__c__Gen_write(g, _SLIT(")")); } else { - if ((expr)._typ == 285 /* v.ast.RangeExpr */) { + if ((expr)._typ == 286 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 272 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 273 /* 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; } @@ -82355,11 +82466,11 @@ 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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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) { @@ -82368,10 +82479,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt_line(v__gen__c__Gen* g, v__ast__Sql 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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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) { @@ -82487,7 +82598,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_insert(v__gen__c__Gen* g, v__ast__SqlStm v__gen__c__Gen_sql_stmt_line(g, sub, expr); 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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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) { @@ -82610,23 +82721,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_delete(v__gen__c__Gen* g, v__ast__SqlStm } 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 == 271 /* v.ast.InfixExpr */) { + if (expr._typ == 272 /* 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 == 291 /* v.ast.StringLiteral */) { + else if (expr._typ == 292 /* v.ast.StringLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__string_type, expr); } - else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 273 /* v.ast.IntegerLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__int_type, expr); } - else if (expr._typ == 251 /* v.ast.BoolLiteral */) { + else if (expr._typ == 252 /* v.ast.BoolLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__bool_type, expr); } - 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 */ ; + else if (expr._typ == 268 /* 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, 378) /*expected idx: 378, name: v.ast.IdentVar */ ; v__gen__c__Gen_sql_write_orm_primitive(g, info.typ, expr); } - else if (expr._typ == 287 /* v.ast.SelectorExpr */) { + else if (expr._typ == 288 /* v.ast.SelectorExpr */) { v__gen__c__Gen_sql_write_orm_primitive(g, (*expr._v__ast__SelectorExpr).typ, expr); } @@ -82653,7 +82764,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_write_orm_primitive(v__gen__c__Gen* g, v typ = _SLIT("infix"); } 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 */) { + if ((expr)._typ == 272 /* 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(\""), /*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(""))); @@ -82668,7 +82779,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 == 271 /* v.ast.InfixExpr */) { + if (expr._typ == 272 /* 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}; @@ -82828,29 +82939,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 != 271 /* v.ast.InfixExpr */ && ((*expr._v__ast__InfixExpr).right)._typ != 271 /* v.ast.InfixExpr */) { + if (((*expr._v__ast__InfixExpr).left)._typ != 272 /* v.ast.InfixExpr */ && ((*expr._v__ast__InfixExpr).right)._typ != 272 /* 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 == 267 /* v.ast.Ident */) { + else if (expr._typ == 268 /* 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 == 291 /* v.ast.StringLiteral */) { + else if (expr._typ == 292 /* v.ast.StringLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 273 /* v.ast.IntegerLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 287 /* v.ast.SelectorExpr */) { + else if (expr._typ == 288 /* v.ast.SelectorExpr */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 251 /* v.ast.BoolLiteral */) { + else if (expr._typ == 252 /* v.ast.BoolLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } @@ -82965,7 +83076,7 @@ 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"), /*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, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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(\""), /*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 }}}))); @@ -83106,12 +83217,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp 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, 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 */ ; + v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 272) /*expected idx: 272, name: v.ast.InfixExpr */ ; + v__ast__Ident ident = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 268) /*expected idx: 268, 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 == 377 /* v.ast.IdentVar */) { + if ((ident.info)._typ == 378 /* v.ast.IdentVar */) { (*ident.info._v__ast__IdentVar).typ = s; } } @@ -83134,9 +83245,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, 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 */ ; + v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 272) /*expected idx: 272, name: v.ast.InfixExpr */ ; + v__ast__Ident l = /* as */ *(v__ast__Ident*)__as_cast((where_expr.left)._v__ast__Ident,(where_expr.left)._typ, 268) /*expected idx: 268, name: v.ast.Ident */ ; + v__ast__Ident r = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 268) /*expected idx: 268, name: v.ast.Ident */ ; l.name = fkey; r.name = tmp; where_expr.left = v__ast__Ident_to_sumtype_v__ast__Expr(&l); @@ -83147,7 +83258,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp .scope = 0, .pos = r.pos, .mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}, - .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, + .expr_type = (/* as */ *(v__ast__IdentVar*)__as_cast((r.info)._v__ast__IdentVar,(r.info)._typ, 378) /*expected idx: 378, name: v.ast.IdentVar */ ).typ, .typ = _const_v__ast__int_type, .name_type = 0, .next_token = 0, @@ -83195,13 +83306,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 == 267 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).info)._typ == 377 /* v.ast.IdentVar */) { + if (expr._typ == 268 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).info)._typ == 378 /* 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 == 287 /* v.ast.SelectorExpr */) { + else if (expr._typ == 288 /* 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; } @@ -83294,7 +83405,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_string_literal(v__gen__c__Gen* g, v__ast__St } 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, 290) /*expected idx: 290, 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, 291) /*expected idx: 291, 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) { @@ -83335,7 +83446,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 == 432 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { + if ((sym->info)._typ == 433 /* 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; @@ -83361,7 +83472,7 @@ 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 != 264 /* v.ast.EnumVal */) { + if ((expr)._typ != 265 /* 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, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_enum_expr(g, expr); @@ -83384,7 +83495,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast } else if ((!str_method_expects_ptr && is_ptr && !is_shared) || is_var_mut) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((expr)._typ == 247 /* v.ast.ArrayInit */) { + if ((expr)._typ == 248 /* 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) { @@ -83419,7 +83530,7 @@ 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, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; + typ = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type; } bool remove_tail_zeros = false; u8 fspec = (*(u8*)/*ee elem_sym */array_get(node.fmts, i)); @@ -83540,7 +83651,7 @@ 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, 435) /*expected idx: 435, 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, 436) /*expected idx: 436, 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, /*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); @@ -83551,14 +83662,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_str_val(v__gen__c__Gen* g, v__ast__StringInt 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 == 267 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((expr)._typ == 268 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 326 /* 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 == 430 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 431 /* v.ast.Aggregate */) { exp_typ = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } } @@ -83600,8 +83711,8 @@ 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 == 267 /* v.ast.Ident */) { - if (((*expr->_v__ast__Ident).obj)._typ == 325 /* v.ast.Var */) { + if ((expr)->_typ == 268 /* v.ast.Ident */) { + if (((*expr->_v__ast__Ident).obj)._typ == 326 /* v.ast.Var */) { (*(v__ast__Type*)/*ee elem_sym */array_get(node_.expr_types, i)) = (*(*expr->_v__ast__Ident).obj._v__ast__Var).typ; } } @@ -83723,7 +83834,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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, 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")); @@ -83760,7 +83871,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, 417) /*expected idx: 417, 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, 418) /*expected idx: 418, name: v.ast.Struct */ ; Array_string _t6 = {0}; Array_v__ast__StructField _t6_orig = embed_info.fields; int _t6_len = _t6_orig.len; @@ -83816,7 +83927,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 == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* 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; @@ -83845,8 +83956,8 @@ 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 == 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 */ ; + if (field_type_sym->kind == v__ast__Kind__array_fixed && (sfield.expr)._typ == 268 /* 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, 441) /*expected idx: 441, 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); @@ -83892,7 +84003,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; } if (node.is_update_embed) { v__ast__TypeSymbol* update_sym = v__ast__Table_sym(g->table, node.update_expr_type); - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t15 = v__ast__Table_find_field_from_embeds(g->table, update_sym, field->name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t15 = v__ast__Table_find_field_from_embeds(g->table, update_sym, field->name); if (_t15.state != 0) { /*or block*/ IError err = _t15.err; *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t15.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; @@ -83955,7 +84066,7 @@ 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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 418) /*expected idx: 418, name: v.ast.Struct */ ; if (info.fields.len == 0) { bool _t1 = false; return _t1; @@ -83979,7 +84090,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 == 417 /* v.ast.Struct */) { + if (sym->info._typ == 418 /* 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; @@ -83999,7 +84110,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_is_empty_struct(v__gen__c__Gen* g, v__gen__c VV_LOCAL_SYMBOL v__ast__Type v__gen__c__Gen_unwrap_generic(v__gen__c__Gen* g, v__ast__Type typ) { if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t1; + _option_v__ast__Type _t1; if (_t1 = v__ast__Table_resolve_generic_to_concrete(muttable, typ, (g->cur_fn != 0 ? (g->cur_fn->generic_names) : (__new_array_with_default(0, 0, sizeof(string), 0))), g->cur_concrete_types), _t1.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t1.data; v__ast__Type _t2 = t_typ; @@ -84021,14 +84132,14 @@ VV_LOCAL_SYMBOL v__gen__c__Type v__gen__c__Gen_unwrap(v__gen__c__Gen* g, v__ast_ return _t2; } -Option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref) { +_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, /*115 &string*/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); + _option_string _t2 = v__util__read_file(file_path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_v__scanner__Scanner_ptr){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__scanner__Scanner_ptr){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } string raw_text = (*(string*)_t2.data); @@ -84067,9 +84178,9 @@ Option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v_ .is_inside_toplvl_statement = 0, .should_abort = 0, }, sizeof(v__scanner__Scanner))); - v__scanner__Scanner_init_scanner(s); - Option_v__scanner__Scanner_ptr _t4; - opt_ok(&(v__scanner__Scanner*[]) { s }, (Option*)(&_t4), sizeof(v__scanner__Scanner*)); + v__scanner__Scanner_scan_all_tokens_in_buffer(s); + _option_v__scanner__Scanner_ptr _t4; + opt_ok2(&(v__scanner__Scanner*[]) { s }, (_option*)(&_t4), sizeof(v__scanner__Scanner*)); return _t4; } @@ -84109,15 +84220,11 @@ v__scanner__Scanner* v__scanner__new_scanner(string text, v__scanner__CommentsMo .is_inside_toplvl_statement = 0, .should_abort = 0, }, sizeof(v__scanner__Scanner))); - v__scanner__Scanner_init_scanner(s); + v__scanner__Scanner_scan_all_tokens_in_buffer(s); v__scanner__Scanner* _t1 = s; return _t1; } -VV_LOCAL_SYMBOL void v__scanner__Scanner_init_scanner(v__scanner__Scanner* s) { - v__scanner__Scanner_scan_all_tokens_in_buffer(s, s->comments_mode); -} - // Attr: [unsafe] void v__scanner__Scanner_free(v__scanner__Scanner* s) { array_free(&s->all_tokens); @@ -84531,18 +84638,15 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_end_of_file(v__scanner__Scan return _t1; } -void v__scanner__Scanner_scan_all_tokens_in_buffer(v__scanner__Scanner* s, v__scanner__CommentsMode mode) { +void v__scanner__Scanner_scan_all_tokens_in_buffer(v__scanner__Scanner* s) { bool v__scanner__Scanner_scan_all_tokens_in_buffer_defer_0 = false; v__util__Timers* timers; timers = v__util__get_timers(); v__util__Timers_measure_pause(timers, _SLIT("PARSE")); v__util__timing_start(_SLIT("SCAN")); v__scanner__Scanner_scan_all_tokens_in_buffer_defer_0 = true; - v__scanner__CommentsMode oldmode = s->comments_mode; - s->comments_mode = mode; s->all_tokens = __new_array_with_default(0, s->text.len / 3, sizeof(v__token__Token), 0); v__scanner__Scanner_scan_remaining_text(s); - s->comments_mode = oldmode; s->tidx = 0; #if defined(CUSTOM_DEFINE_debugscanner) { @@ -84573,13 +84677,8 @@ void v__scanner__Scanner_scan_remaining_text(v__scanner__Scanner* s) { } } -v__token__Token v__scanner__Scanner_scan(v__scanner__Scanner* s) { - v__token__Token _t1 = v__scanner__Scanner_buffer_scan(s); - return _t1; -} - // Attr: [direct_array_access] -v__token__Token v__scanner__Scanner_buffer_scan(v__scanner__Scanner* s) { +v__token__Token v__scanner__Scanner_scan(v__scanner__Scanner* s) { for (;;) { int cidx = s->tidx; s->tidx++; @@ -85306,7 +85405,7 @@ VV_LOCAL_SYMBOL string v__scanner__decode_h_escapes(string s, int start, Array_i int pos = ((int*)escapes_pos.data)[i]; int idx = pos - start; int end_idx = idx + 4; - Option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 2, end_idx), 16, 8); + _option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 2, end_idx), 16, 8); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(u64*) _t4.data = 0U; @@ -85334,7 +85433,7 @@ VV_LOCAL_SYMBOL string v__scanner__decode_o_escapes(string s, int start, Array_i int pos = ((int*)escapes_pos.data)[i]; int idx = pos - start; int end_idx = idx + 4; - Option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 1, end_idx), 8, 8); + _option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 1, end_idx), 8, 8); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(u64*) _t4.data = 0U; @@ -85362,7 +85461,7 @@ VV_LOCAL_SYMBOL string v__scanner__decode_u_escapes(string s, int start, Array_i int pos = ((int*)escapes_pos.data)[i]; int idx = pos - start; int end_idx = idx + 6; - Option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 2, end_idx), 16, 32); + _option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 2, end_idx), 16, 32); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(u64*) _t4.data = 0U; @@ -85600,11 +85699,11 @@ VV_LOCAL_SYMBOL void v__scanner__Scanner_trace(v__scanner__Scanner* s, string fb } // TypeDecl -Option_void v__ast__walker__Inspector_visit(v__ast__walker__Inspector* i, v__ast__Node* node) { +_option_void v__ast__walker__Inspector_visit(v__ast__walker__Inspector* i, v__ast__Node* node) { if (i->inspector_callback(node, i->data)) { - return (Option_void){0}; + return (_option_void){0}; } - return (Option_void){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; } void v__ast__walker__inspect(v__ast__Node* node, voidptr data, bool (*inspector_callback)(v__ast__Node* node, voidptr data)) { @@ -85613,7 +85712,7 @@ void v__ast__walker__inspect(v__ast__Node* node, voidptr data, bool (*inspector_ } void v__ast__walker__walk(v__ast__walker__Visitor* visitor, v__ast__Node* node) { - Option_void _t1 = v__ast__walker__Visitor_name_table[visitor->_typ]._method_visit(visitor->_object, node); + _option_void _t1 = v__ast__walker__Visitor_name_table[visitor->_typ]._method_visit(visitor->_object, node); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; return; @@ -85641,12 +85740,12 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_assign_stmt(v__parser__Parser* p) return _t2; } -VV_LOCAL_SYMBOL Option_void v__parser__Parser_check_undefined_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val) { +VV_LOCAL_SYMBOL _option_void v__parser__Parser_check_undefined_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val) { 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 > "), /*100 &int literal*/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--; @@ -85654,13 +85753,13 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; // Defer end return _t1; } - if (val._typ == 267 /* v.ast.Ident */) { + if (val._typ == 268 /* v.ast.Ident */) { for (int _t2 = 0; _t2 < exprs.len; ++_t2) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t2]; - if ((expr)._typ == 267 /* v.ast.Ident */) { + if ((expr)._typ == 268 /* 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: `"), /*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} }; + _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--; @@ -85671,16 +85770,16 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 247 /* v.ast.ArrayInit */) { + else if (val._typ == 248 /* 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); + _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) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t5; + _option_void _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } @@ -85688,14 +85787,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } if ((*val._v__ast__ArrayInit).has_len) { - Option_void _t6 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).len_expr); + _option_void _t6 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).len_expr); if (_t6.state != 0 && _t6.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t7; + _option_void _t7; memcpy(&_t7, &_t6, sizeof(Option)); return _t7; } @@ -85703,14 +85802,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } if ((*val._v__ast__ArrayInit).has_default) { - Option_void _t8 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).default_expr); + _option_void _t8 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).default_expr); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t9; + _option_void _t9; memcpy(&_t9, &_t8, sizeof(Option)); return _t9; } @@ -85719,14 +85818,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } for (int _t10 = 0; _t10 < (*val._v__ast__ArrayInit).exprs.len; ++_t10) { v__ast__Expr expr = ((v__ast__Expr*)(*val._v__ast__ArrayInit).exprs.data)[_t10]; - Option_void _t11 = v__parser__Parser_check_undefined_variables(p, exprs, expr); + _option_void _t11 = v__parser__Parser_check_undefined_variables(p, exprs, expr); if (_t11.state != 0 && _t11.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t12; + _option_void _t12; memcpy(&_t12, &_t11, sizeof(Option)); return _t12; } @@ -85734,15 +85833,15 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 253 /* v.ast.CallExpr */) { - Option_void _t13 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__CallExpr).left); + else if (val._typ == 254 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t14; + _option_void _t14; memcpy(&_t14, &_t13, sizeof(Option)); return _t14; } @@ -85750,14 +85849,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; for (int _t15 = 0; _t15 < (*val._v__ast__CallExpr).args.len; ++_t15) { v__ast__CallArg arg = ((v__ast__CallArg*)(*val._v__ast__CallExpr).args.data)[_t15]; - Option_void _t16 = v__parser__Parser_check_undefined_variables(p, exprs, arg.expr); + _option_void _t16 = v__parser__Parser_check_undefined_variables(p, exprs, arg.expr); if (_t16.state != 0 && _t16.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t17; + _option_void _t17; memcpy(&_t17, &_t16, sizeof(Option)); return _t17; } @@ -85765,43 +85864,43 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 271 /* v.ast.InfixExpr */) { - Option_void _t18 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__InfixExpr).left); + else if (val._typ == 272 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t19; + _option_void _t19; memcpy(&_t19, &_t18, sizeof(Option)); return _t19; } ; - Option_void _t20 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__InfixExpr).right); + _option_void _t20 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__InfixExpr).right); if (_t20.state != 0 && _t20.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t21; + _option_void _t21; memcpy(&_t21, &_t20, sizeof(Option)); return _t21; } ; } - else if (val._typ == 268 /* v.ast.IfExpr */) { - Option_void _t22 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__IfExpr).left); + else if (val._typ == 269 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t23; + _option_void _t23; memcpy(&_t23, &_t22, sizeof(Option)); return _t23; } @@ -85809,14 +85908,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; for (int _t24 = 0; _t24 < (*val._v__ast__IfExpr).branches.len; ++_t24) { v__ast__IfBranch branch = ((v__ast__IfBranch*)(*val._v__ast__IfExpr).branches.data)[_t24]; - Option_void _t25 = v__parser__Parser_check_undefined_variables(p, exprs, branch.cond); + _option_void _t25 = v__parser__Parser_check_undefined_variables(p, exprs, branch.cond); if (_t25.state != 0 && _t25.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t26; + _option_void _t26; memcpy(&_t26, &_t25, sizeof(Option)); return _t26; } @@ -85824,15 +85923,15 @@ 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 == 307 /* v.ast.ExprStmt */) { - Option_void _t28 = v__parser__Parser_check_undefined_variables(p, exprs, (*stmt._v__ast__ExprStmt).expr); + if ((stmt)._typ == 308 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t29; + _option_void _t29; memcpy(&_t29, &_t28, sizeof(Option)); return _t29; } @@ -85842,17 +85941,17 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 276 /* v.ast.MapInit */) { + else if (val._typ == 277 /* 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); + _option_void _t31 = v__parser__Parser_check_undefined_variables(p, exprs, key); if (_t31.state != 0 && _t31.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t32; + _option_void _t32; memcpy(&_t32, &_t31, sizeof(Option)); return _t32; } @@ -85861,14 +85960,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } for (int _t33 = 0; _t33 < (*val._v__ast__MapInit).vals.len; ++_t33) { v__ast__Expr value = ((v__ast__Expr*)(*val._v__ast__MapInit).vals.data)[_t33]; - Option_void _t34 = v__parser__Parser_check_undefined_variables(p, exprs, value); + _option_void _t34 = v__parser__Parser_check_undefined_variables(p, exprs, value); if (_t34.state != 0 && _t34.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t35; + _option_void _t35; memcpy(&_t35, &_t34, sizeof(Option)); return _t35; } @@ -85876,15 +85975,15 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 277 /* v.ast.MatchExpr */) { - Option_void _t36 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__MatchExpr).cond); + else if (val._typ == 278 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t37; + _option_void _t37; memcpy(&_t37, &_t36, sizeof(Option)); return _t37; } @@ -85894,14 +85993,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; v__ast__MatchBranch branch = ((v__ast__MatchBranch*)(*val._v__ast__MatchExpr).branches.data)[_t38]; for (int _t39 = 0; _t39 < branch.exprs.len; ++_t39) { v__ast__Expr expr = ((v__ast__Expr*)branch.exprs.data)[_t39]; - Option_void _t40 = v__parser__Parser_check_undefined_variables(p, exprs, expr); + _option_void _t40 = v__parser__Parser_check_undefined_variables(p, exprs, expr); if (_t40.state != 0 && _t40.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t41; + _option_void _t41; memcpy(&_t41, &_t40, sizeof(Option)); return _t41; } @@ -85910,15 +86009,15 @@ 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 == 307 /* v.ast.ExprStmt */) { - Option_void _t43 = v__parser__Parser_check_undefined_variables(p, exprs, (*stmt._v__ast__ExprStmt).expr); + if ((stmt)._typ == 308 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t44; + _option_void _t44; memcpy(&_t44, &_t43, sizeof(Option)); return _t44; } @@ -85928,62 +86027,62 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 282 /* v.ast.ParExpr */) { - Option_void _t45 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ParExpr).expr); + else if (val._typ == 283 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t46; + _option_void _t46; memcpy(&_t46, &_t45, sizeof(Option)); return _t46; } ; } - else if (val._typ == 283 /* v.ast.PostfixExpr */) { - Option_void _t47 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__PostfixExpr).expr); + else if (val._typ == 284 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t48; + _option_void _t48; memcpy(&_t48, &_t47, sizeof(Option)); return _t48; } ; } - else if (val._typ == 284 /* v.ast.PrefixExpr */) { - Option_void _t49 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__PrefixExpr).right); + else if (val._typ == 285 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t50; + _option_void _t50; memcpy(&_t50, &_t49, sizeof(Option)); return _t50; } ; } - else if (val._typ == 290 /* v.ast.StringInterLiteral */) { + else if (val._typ == 291 /* 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_); + _option_void _t52 = v__parser__Parser_check_undefined_variables(p, exprs, expr_); if (_t52.state != 0 && _t52.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t53; + _option_void _t53; memcpy(&_t53, &_t52, sizeof(Option)); return _t53; } @@ -85991,17 +86090,17 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 292 /* v.ast.StructInit */) { + else if (val._typ == 293 /* 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); + _option_void _t55 = v__parser__Parser_check_undefined_variables(p, exprs, field.expr); if (_t55.state != 0 && _t55.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t56; + _option_void _t56; memcpy(&_t56, &_t55, sizeof(Option)); return _t56; } @@ -86018,15 +86117,15 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; p->expr_level--; } // Defer end - return (Option_void){0}; + return (_option_void){0}; } 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 == 267 /* v.ast.Ident */) { + if (val._typ == 268 /* v.ast.Ident */) { for (int _t1 = 0; _t1 < exprs.len; ++_t1) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t1]; - if ((expr)._typ == 267 /* v.ast.Ident */) { + if ((expr)._typ == 268 /* v.ast.Ident */) { if (string__eq((*expr._v__ast__Ident).name, (*val._v__ast__Ident).name)) { bool _t2 = true; return _t2; @@ -86034,7 +86133,7 @@ VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* } } } - else if (val._typ == 270 /* v.ast.IndexExpr */) { + else if (val._typ == 271 /* 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)) { @@ -86043,19 +86142,19 @@ VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* } } } - else if (val._typ == 271 /* v.ast.InfixExpr */) { + else if (val._typ == 272 /* 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 == 284 /* v.ast.PrefixExpr */) { + else if (val._typ == 285 /* v.ast.PrefixExpr */) { bool _t6 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__PrefixExpr).right); return _t6; } - else if (val._typ == 283 /* v.ast.PostfixExpr */) { + else if (val._typ == 284 /* v.ast.PostfixExpr */) { bool _t7 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__PostfixExpr).expr); return _t7; } - else if (val._typ == 287 /* v.ast.SelectorExpr */) { + else if (val._typ == 288 /* 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)) { @@ -86093,14 +86192,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 == 267 /* v.ast.Ident */) { + if (lx._typ == 268 /* 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 `"), /*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 == 377 /* v.ast.IdentVar */) { + if (((*lx._v__ast__Ident).info)._typ == 378 /* 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) { @@ -86135,7 +86234,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 == 253 /* v.ast.CallExpr */) { + if ((r0)._typ == 254 /* 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; } @@ -86146,18 +86245,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 == 270 /* v.ast.IndexExpr */) { + else if (lx._typ == 271 /* 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 `"), /*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 == 282 /* v.ast.ParExpr */) { + else if (lx._typ == 283 /* v.ast.ParExpr */) { } - else if (lx._typ == 284 /* v.ast.PrefixExpr */) { + else if (lx._typ == 285 /* v.ast.PrefixExpr */) { } - else if (lx._typ == 287 /* v.ast.SelectorExpr */) { + else if (lx._typ == 288 /* 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; @@ -86171,7 +86270,7 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa if (op == v__token__Kind__decl_assign) { for (int _t8 = 0; _t8 < right.len; ++_t8) { v__ast__Expr r = ((v__ast__Expr*)right.data)[_t8]; - Option_void _t9 = v__parser__Parser_check_undefined_variables(p, left, r); + _option_void _t9 = v__parser__Parser_check_undefined_variables(p, left, r); if (_t9.state != 0 && _t9.err._typ != _IError_None___index) { IError err = _t9.err; v__ast__Stmt _t10 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, IError_name_table[err._typ]._method_msg(err._object), pos)))); @@ -86663,7 +86762,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser v__parser__Parser_scope_register_it_as_index(p); default_expr = v__parser__Parser_expr(p, 0); bool _t5; /* if prepend */ - Option_v__ast__Var_ptr _t6; + _option_v__ast__Var_ptr _t6; if (_t6 = v__ast__Scope_find_var(p->scope, _SLIT("it")), _t6.state == 0) { v__ast__Var* var = *(v__ast__Var**)_t6.data; v__ast__Var* variable = var; @@ -86726,7 +86825,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser v__parser__Parser_scope_register_it_as_index(p); default_expr = v__parser__Parser_expr(p, 0); bool _t7; /* if prepend */ - Option_v__ast__Var_ptr _t8; + _option_v__ast__Var_ptr _t8; if (_t8 = v__ast__Scope_find_var(p->scope, _SLIT("it")), _t8.state == 0) { v__ast__Var* var = *(v__ast__Var**)_t8.data; v__ast__Var* variable = var; @@ -86803,7 +86902,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_scope_register_it_as_index(v__parser__Par } 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); + _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 "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); @@ -86813,7 +86912,7 @@ v__ast__Expr v__parser__Parser_expr(v__parser__Parser* p, int precedence) { return _t1; } -Option_v__ast__Expr v__parser__Parser_check_expr(v__parser__Parser* p, int precedence) { +_option_v__ast__Expr v__parser__Parser_check_expr(v__parser__Parser* p, int precedence) { bool v__parser__Parser_check_expr_defer_0 = false; bool inside_array_lit; ; @@ -86882,8 +86981,8 @@ bool inside_array_lit; case v__token__Kind__comment: { node = v__ast__Comment_to_sumtype_v__ast__Expr(ADDR(v__ast__Comment, (v__parser__Parser_comment(p)))); - Option_v__ast__Expr _t5; - opt_ok(&(v__ast__Expr[]) { node }, (Option*)(&_t5), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t5; + opt_ok2(&(v__ast__Expr[]) { node }, (_option*)(&_t5), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -86914,8 +87013,8 @@ bool inside_array_lit; p->is_stmt_ident = is_stmt_ident; } else if (p->peek_tok.kind == (v__token__Kind__key_if)) { - Option_v__ast__Expr _t6; - opt_ok(&(v__ast__Expr[]) { v__ast__IfExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__IfExpr, (v__parser__Parser_if_expr(p, true)))) }, (Option*)(&_t6), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t6; + opt_ok2(&(v__ast__Expr[]) { v__ast__IfExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__IfExpr, (v__parser__Parser_if_expr(p, true)))) }, (_option*)(&_t6), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -86924,8 +87023,8 @@ bool inside_array_lit; return _t6; } else { - Option_v__ast__Expr _t7; - opt_ok(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("unexpected `$`"), v__token__Token_pos(&p->peek_tok))))) }, (Option*)(&_t7), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t7; + opt_ok2(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("unexpected `$`"), v__token__Token_pos(&p->peek_tok))))) }, (_option*)(&_t7), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -87007,8 +87106,8 @@ bool inside_array_lit; v__token__Pos pos = v__token__Token_pos(&p->tok); v__parser__Parser_next(p); if (p->inside_unsafe) { - Option_v__ast__Expr _t8; - opt_ok(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("already inside `unsafe` block"), pos)))) }, (Option*)(&_t8), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t8; + opt_ok2(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("already inside `unsafe` block"), pos)))) }, (_option*)(&_t8), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -87119,8 +87218,8 @@ bool inside_array_lit; v__ast__Type st = v__parser__Parser_parse_type(p); 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 `"), /*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)); + _option_v__ast__Expr _t9; + opt_ok2(&(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; @@ -87157,8 +87256,8 @@ bool inside_array_lit; { if (p->expecting_type) { v__token__Pos start_pos = v__token__Token_pos(&p->tok); - Option_v__ast__Expr _t10; - opt_ok(&(v__ast__Expr[]) { v__ast__TypeNode_to_sumtype_v__ast__Expr(ADDR(v__ast__TypeNode, (((v__ast__TypeNode){.typ = v__parser__Parser_parse_type(p),.pos = v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok)),})))) }, (Option*)(&_t10), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t10; + opt_ok2(&(v__ast__Expr[]) { v__ast__TypeNode_to_sumtype_v__ast__Expr(ADDR(v__ast__TypeNode, (((v__ast__TypeNode){.typ = v__parser__Parser_parse_type(p),.pos = v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok)),})))) }, (_option*)(&_t10), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -87174,8 +87273,8 @@ bool inside_array_lit; v__parser__Parser_check(p, v__token__Kind__rpar); node = v__ast__CallExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__CallExpr, (((v__ast__CallExpr){.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,},},.args = args,.expected_arg_types = __new_array(0, 0, sizeof(v__ast__Type)),.concrete_types = __new_array(0, 0, sizeof(v__ast__Type)),.raw_concrete_types = __new_array(0, 0, sizeof(v__ast__Type)),.from_embed_types = __new_array(0, 0, sizeof(v__ast__Type)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.mod = (string){.str=(byteptr)"", .is_lit=1},.name = _SLIT("anon"),.left = node,.scope = p->scope,.pos = pos,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.concrete_list_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.left_type = 0,.receiver_type = 0,.return_type = 0,.fn_var_type = 0,.language = 0,.is_method = 0,.is_field = 0,.is_fn_var = 0,.is_keep_alive = 0,.is_noreturn = 0,.is_ctor_new = 0,.should_be_skipped = 0,.free_receiver = 0,})))); } - Option_v__ast__Expr _t11; - opt_ok(&(v__ast__Expr[]) { node }, (Option*)(&_t11), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t11; + opt_ok2(&(v__ast__Expr[]) { node }, (_option*)(&_t11), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -87262,7 +87361,7 @@ bool inside_array_lit; default: { if (p->tok.kind != v__token__Kind__eof && !(p->tok.kind == v__token__Kind__rsbr && p->inside_asm)) { - Option_v__ast__Expr _t12 = (Option_v__ast__Expr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_v__ast__Expr _t12 = (_option_v__ast__Expr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -87276,8 +87375,8 @@ bool inside_array_lit; ; if (inside_array_lit) { if ((p->tok.kind == v__token__Kind__minus || p->tok.kind == v__token__Kind__mul || p->tok.kind == v__token__Kind__amp || p->tok.kind == v__token__Kind__arrow) && p->tok.pos + 1 == p->peek_tok.pos && p->prev_tok.pos + p->prev_tok.len + 1 != p->peek_tok.pos) { - Option_v__ast__Expr _t13; - opt_ok(&(v__ast__Expr[]) { node }, (Option*)(&_t13), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t13; + opt_ok2(&(v__ast__Expr[]) { node }, (_option*)(&_t13), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -87289,8 +87388,8 @@ bool inside_array_lit; if (p->inside_if_cond) { _PUSH_MANY(&p->if_cond_comments, (v__parser__Parser_eat_comments(p, ((v__parser__EatCommentsConfig){.same_line = 0,.follow_up = 0,}))), _t14, Array_v__ast__Comment); } - Option_v__ast__Expr _t15; - opt_ok(&(v__ast__Expr[]) { v__parser__Parser_expr_with_left(p, node, precedence, is_stmt_ident) }, (Option*)(&_t15), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t15; + opt_ok2(&(v__ast__Expr[]) { v__parser__Parser_expr_with_left(p, node, precedence, is_stmt_ident) }, (_option*)(&_t15), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -87321,7 +87420,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 == 270 /* v.ast.IndexExpr */) { + if (p->tok.kind == v__token__Kind__lpar && p->tok.line_nr == p->prev_tok.line_nr && (node)._typ == 271 /* 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); @@ -87345,7 +87444,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 == 270 /* v.ast.IndexExpr */) { + if ((node)._typ == 271 /* 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){.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,},},.left = node,.right = right,.auto_locked = (string){.str=(byteptr)"", .is_lit=1},.ct_left_value = v__ast__empty_comptime_const_expr(),.ct_right_value = v__ast__empty_comptime_const_expr(),.pos = pos,.left_type = 0,.right_type = 0,.op = tok.kind,.is_stmt = true,.ct_left_value_evaled = 0,.ct_right_value_evaled = 0,})))); @@ -87371,7 +87470,7 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr 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, /*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 == 270 /* v.ast.IndexExpr */) { + if ((node)._typ == 271 /* 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},})))); @@ -87411,7 +87510,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 == 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) { + if (p->pref->is_vet && (op == v__token__Kind__key_in || op == v__token__Kind__not_in) && (right)._typ == 248 /* v.ast.ArrayInit */ && (/* as */ *(v__ast__ArrayInit*)__as_cast((right)._v__ast__ArrayInit,(right)._typ, 248) /*expected idx: 248, 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); @@ -87474,27 +87573,27 @@ 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 == 254 /* v.ast.CastExpr */) { + if ((right)._typ == 255 /* 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 == 287 /* v.ast.SelectorExpr */) { - if (((*right._v__ast__SelectorExpr).expr)._typ == 254 /* v.ast.CastExpr */) { + if ((right)._typ == 288 /* v.ast.SelectorExpr */) { + if (((*right._v__ast__SelectorExpr).expr)._typ == 255 /* 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 == 270 /* v.ast.IndexExpr */) { - if (((*right._v__ast__IndexExpr).left)._typ == 254 /* v.ast.CastExpr */) { + if ((right)._typ == 271 /* v.ast.IndexExpr */) { + if (((*right._v__ast__IndexExpr).left)._typ == 255 /* 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 == 282 /* v.ast.ParExpr */) { - if (((*right._v__ast__ParExpr).expr)._typ == 292 /* v.ast.StructInit */) { + if ((right)._typ == 283 /* v.ast.ParExpr */) { + if (((*right._v__ast__ParExpr).expr)._typ == 293 /* 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; } @@ -87657,7 +87756,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 == 292 /* v.ast.StructInit */) { + if ((expr)._typ == 293 /* 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); } @@ -87730,7 +87829,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { v__parser__Parser_note_with_pos(p, _SLIT("the tag [windows_stdcall] has been deprecated, it will be an error after 2022-06-01, use `[callconv: stdcall]` instead"), v__token__Token_pos(&p->tok)); } else if (string__eq(fna.name, _SLIT("_fastcall"))) { - v__parser__Parser_note_with_pos(p, _SLIT("teh tag [_fastcall] has been deprecated, it will be an error after 2022-06-01, use `[callconv: fastcall]` instead"), v__token__Token_pos(&p->tok)); + v__parser__Parser_note_with_pos(p, _SLIT("the tag [_fastcall] has been deprecated, it will be an error after 2022-06-01, use `[callconv: fastcall]` instead"), v__token__Token_pos(&p->tok)); } else if (string__eq(fna.name, _SLIT("callconv"))) { if (!fna.has_arg) { @@ -87743,7 +87842,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { else { }; } - Option_int _t2 = Array_v__ast__Attr_find_comptime_define(p->attrs); + _option_int _t2 = Array_v__ast__Attr_find_comptime_define(p->attrs); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(int*) _t2.data = -1; @@ -87788,7 +87887,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { Array_v__ast__Param params = __new_array_with_default(0, 0, sizeof(v__ast__Param), 0); if (p->tok.kind == v__token__Kind__lpar) { is_method = true; - Option_void _t5 = v__parser__Parser_fn_receiver(p, &/*arr*/params, (voidptr)&/*qq*/rec); + _option_void _t5 = v__parser__Parser_fn_receiver(p, &/*arr*/params, (voidptr)&/*qq*/rec); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { IError err = _t5.err; v__ast__FnDecl _t6 = ((v__ast__FnDecl){.receiver = (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,},.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.params = __new_array(0, 0, sizeof(v__ast__Param)),.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.defer_stmts = __new_array(0, 0, sizeof(v__ast__DeferStmt)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.next_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.label_names = __new_array(0, 0, sizeof(string)),.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.source_file = 0,.scope = 0,.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.ctdefine_idx = -1,.idx = 0,.return_type = 0,.ninstances = 0,.language = 0,.file_mode = 0,.rec_share = 0,.is_deprecated = 0,.is_pub = 0,.is_variadic = 0,.is_anon = 0,.is_noreturn = 0,.is_manualfree = 0,.is_main = 0,.is_test = 0,.is_conditional = 0,.is_exported = 0,.is_keep_alive = 0,.is_unsafe = 0,.is_markused = 0,.is_method = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.is_direct_arr = 0,.has_return = 0,.should_be_skipped = 0,.has_await = 0,}); @@ -87812,7 +87911,7 @@ 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 == 435 /* v.ast.Interface */) { + if ((type_sym->info)._typ == 436 /* v.ast.Interface */) { is_duplicate = !v__ast__Interface_has_method(&(*type_sym->info._v__ast__Interface), name); } } @@ -87846,7 +87945,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* 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 == 417 /* v.ast.Struct */) { + if ((sym->info)._typ == 418 /* v.ast.Struct */) { Array_string fn_generic_names = array_clone_to_depth(&generic_names, 0); Array_string _t11 = {0}; Array_v__ast__Type _t11_orig = (*sym->info._v__ast__Struct).generic_types; @@ -87974,7 +88073,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { } if (!p->pref->translated && language == v__ast__Language__v) { v__ast__Fn* _t20 = (v__ast__Fn*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, p->table->fns), &(string[]){name})); - Option_v__ast__Fn _t19 = {0}; + _option_v__ast__Fn _t19 = {0}; if (_t20) { *((v__ast__Fn*)&_t19.data) = *((v__ast__Fn*)_t20); } else { @@ -88104,7 +88203,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { return _t23; } -VV_LOCAL_SYMBOL Option_void v__parser__Parser_fn_receiver(v__parser__Parser* p, Array_v__ast__Param* params, v__parser__ReceiverParsingInfo* rec) { +VV_LOCAL_SYMBOL _option_void v__parser__Parser_fn_receiver(v__parser__Parser* p, Array_v__ast__Param* params, v__parser__ReceiverParsingInfo* rec) { bool v__parser__Parser_fn_receiver_defer_0 = false; p->inside_receiver_param = true; v__parser__Parser_fn_receiver_defer_0 = true; @@ -88137,7 +88236,7 @@ bool v__parser__Parser_fn_receiver_defer_0 = false; rec->type_pos = v__token__Token_pos(&p->tok); rec->typ = v__parser__Parser_parse_type_with_mut(p, rec->is_mut); if (v__ast__Type_idx(rec->typ) == 0) { - Option_void _t1 = (Option_void){ .state=2, .err=_v_error(_SLIT("void receiver type")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t1 = (_option_void){ .state=2, .err=_v_error(_SLIT("void receiver type")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_fn_receiver_defer_0) { p->inside_receiver_param = false; @@ -88148,7 +88247,7 @@ bool v__parser__Parser_fn_receiver_defer_0 = false; rec->type_pos = v__token__Pos_extend(rec->type_pos, v__token__Token_pos(&p->prev_tok)); if (is_amp && rec->is_mut) { v__parser__Parser_error_with_pos(p, _SLIT("use `(mut f Foo)` or `(f &Foo)` instead of `(mut f &Foo)`"), v__token__Pos_extend(lpar_pos, v__token__Token_pos(&p->tok))); - Option_void _t2 = (Option_void){ .state=2, .err=_v_error(_SLIT("invalid `mut f &Foo`")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t2 = (_option_void){ .state=2, .err=_v_error(_SLIT("invalid `mut f &Foo`")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_fn_receiver_defer_0) { p->inside_receiver_param = false; @@ -88165,7 +88264,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, 417) /*expected idx: 417, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 418) /*expected idx: 418, 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; @@ -88193,7 +88292,7 @@ bool v__parser__Parser_fn_receiver_defer_0 = false; p->inside_receiver_param = false; } // Defer end - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL v__ast__AnonFn v__parser__Parser_anon_fn(v__parser__Parser* p) { @@ -88513,7 +88612,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 == 253 /* v.ast.CallExpr */) { + if ((expr)._typ == 254 /* 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)); @@ -88540,7 +88639,7 @@ VV_LOCAL_SYMBOL Array_v__ast__Param v__parser__Parser_closure_vars(v__parser__Pa v__token__Pos var_pos = v__token__Token_pos(&p->tok); v__parser__Parser_check(p, v__token__Kind__name); string var_name = p->prev_tok.lit; - Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(p->scope->parent, var_name); + _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: `"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); @@ -88573,7 +88672,7 @@ 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, 432) /*expected idx: 432, name: v.ast.Alias */ ).parent_type; + v__ast__Type atyp = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 433) /*expected idx: 433, name: v.ast.Alias */ ).parent_type; v__parser__Parser_check_fn_mutable_arguments(p, atyp, pos); return; } @@ -88600,7 +88699,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_atomic_arguments(v__parser__Pars 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 == 184 /* v.ast.FnDecl */) { + if ((stmt)._typ == 185 /* v.ast.FnDecl */) { if (string__eq((*stmt._v__ast__FnDecl).name, _SLIT("main.main"))) { bool _t2 = true; return _t2; @@ -88896,7 +88995,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 == 253 /* v.ast.CallExpr */ || (expr)._typ == 270 /* v.ast.IndexExpr */ || (expr)._typ == 284 /* v.ast.PrefixExpr */)) { + if (!((expr)._typ == 254 /* v.ast.CallExpr */ || (expr)._typ == 271 /* v.ast.IndexExpr */ || (expr)._typ == 285 /* 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,})))); @@ -89170,14 +89269,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 == 307 /* v.ast.ExprStmt */) { + if (stmt._typ == 308 /* 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 == 271 /* v.ast.InfixExpr */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 272 /* v.ast.InfixExpr */) { if ((*(*stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).op != v__token__Kind__arrow) { check_timeout = true; } else if (is_gt) { @@ -89205,9 +89304,9 @@ VV_LOCAL_SYMBOL v__ast__SelectExpr v__parser__Parser_select_expr(v__parser__Pars has_timeout = true; } } - else if (stmt._typ == 299 /* v.ast.AssignStmt */) { + else if (stmt._typ == 300 /* v.ast.AssignStmt */) { v__ast__Expr expr = (*(v__ast__Expr*)/*ee elem_sym */array_get((*stmt._v__ast__AssignStmt).right, 0)); - if (expr._typ == 284 /* v.ast.PrefixExpr */) { + if (expr._typ == 285 /* 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,}); @@ -89319,7 +89418,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 == 257 /* v.ast.Comment */) { + if ((expr)._typ == 258 /* 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 })); @@ -89442,21 +89541,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 == 272 /* v.ast.IntegerLiteral */) { + if (size_expr._typ == 273 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*size_expr._v__ast__IntegerLiteral).val); } - else if (size_expr._typ == 267 /* v.ast.Ident */) { + else if (size_expr._typ == 268 /* v.ast.Ident */) { bool show_non_const_error = false; - Option_v__ast__ConstField_ptr _t1; + _option_v__ast__ConstField_ptr _t1; 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 == 272 /* v.ast.IntegerLiteral */) { + if ((const_field->expr)._typ == 273 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*const_field->expr._v__ast__IntegerLiteral).val); } else { - if ((const_field->expr)._typ == 271 /* v.ast.InfixExpr */) { + if ((const_field->expr)._typ == 272 /* 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 == 272 /* v.ast.IntegerLiteral */) { + if ((folded_expr)._typ == 273 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*folded_expr._v__ast__IntegerLiteral).val); } else { show_non_const_error = true; @@ -89898,7 +89997,7 @@ 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 == 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) { + if (is_optional && (sym->info)._typ == 437 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 437) /*expected idx: 437, 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))); } } @@ -90155,21 +90254,21 @@ 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 == 417 /* v.ast.Struct */) { + if (parent_sym->info._typ == 418 /* 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 `"), /*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 `"), /*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.Interface */) { + else if (parent_sym->info._typ == 436 /* 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 `"), /*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 `"), /*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 == 436 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 437 /* 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 `"), /*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) { @@ -90427,7 +90526,7 @@ void v__parser__Parser_set_path(v__parser__Parser* p, string path) { p->file_backend_mode = v__ast__Language__js; } else { - Option_v__pref__Arch _t1 = v__pref__arch_from_string(actual_language); + _option_v__pref__Arch _t1 = v__pref__arch_from_string(actual_language); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(v__pref__Arch*) _t1.data = v__pref__Arch___auto; @@ -90447,7 +90546,7 @@ v__ast__File* v__parser__parse_file(string path, v__ast__Table* table, v__scanne 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); + _option_v__scanner__Scanner_ptr _t1 = v__scanner__new_scanner_file(path, comments_mode, pref); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -90546,7 +90645,7 @@ multi_return_ref_v__ast__File_Array_v__vet__Error v__parser__parse_vet_file(stri } #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))); - Option_v__scanner__Scanner_ptr _t1 = v__scanner__new_scanner_file(path, v__scanner__CommentsMode__parse_comments, pref); + _option_v__scanner__Scanner_ptr _t1 = v__scanner__new_scanner_file(path, v__scanner__CommentsMode__parse_comments, pref); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -90633,7 +90732,7 @@ multi_return_ref_v__ast__File_Array_v__vet__Error v__parser__parse_vet_file(stri }); v__parser__Parser_set_path(&p, path); if (string_contains_any_substr(p.scanner->text, new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("\n "), _SLIT(" \n")})))) { - Option_Array_string _t2 = os__read_lines(path); + _option_Array_string _t2 = os__read_lines(path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(Array_string*) _t2.data = __new_array_with_default(0, 0, sizeof(string), 0); @@ -90690,7 +90789,7 @@ bool v__parser__Parser_parse_defer_0 = false; break; } v__ast__Stmt stmt = v__parser__Parser_top_stmt(p); - 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 */)) { + if (!((stmt)._typ == 308 /* v.ast.ExprStmt */ && ((/* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 308) /*expected idx: 308, name: v.ast.ExprStmt */ ).expr)._typ == 258 /* 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 })); @@ -91197,17 +91296,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 == 310 /* v.ast.ForStmt */) { + if (stmt._typ == 311 /* 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 == 309 /* v.ast.ForInStmt */) { + else if (stmt._typ == 310 /* 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 == 308 /* v.ast.ForCStmt */) { + else if (stmt._typ == 309 /* 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; @@ -91469,7 +91568,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; v__ast__Scope* backup_scope = p->scope; v__token__Pos pos = v__token__Token_pos(&p->tok); v__parser__Parser_check(p, v__token__Kind__key_asm); - Option_v__pref__Arch _t1 = v__pref__arch_from_string(p->tok.lit); + _option_v__pref__Arch _t1 = v__pref__arch_from_string(p->tok.lit); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(v__pref__Arch*) _t1.data = v__pref__Arch___auto; @@ -91479,7 +91578,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; bool is_volatile = false; bool is_goto = false; if (p->tok.kind == v__token__Kind__key_volatile) { - Option_v__pref__Arch _t2 = v__pref__arch_from_string(p->peek_tok.lit); + _option_v__pref__Arch _t2 = v__pref__arch_from_string(p->peek_tok.lit); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(v__pref__Arch*) _t2.data = v__pref__Arch___auto; @@ -91489,7 +91588,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; is_volatile = true; v__parser__Parser_next(p); } else if (p->tok.kind == v__token__Kind__key_goto) { - Option_v__pref__Arch _t3 = v__pref__arch_from_string(p->peek_tok.lit); + _option_v__pref__Arch _t3 = v__pref__arch_from_string(p->peek_tok.lit); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; *(v__pref__Arch*) _t3.data = v__pref__Arch___auto; @@ -91573,10 +91672,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 == 265 /* v.ast.FloatLiteral */) { + if (number_lit._typ == 266 /* 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 == 272 /* v.ast.IntegerLiteral */) { + else if (number_lit._typ == 273 /* 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 { @@ -91631,7 +91730,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, 398) /*expected idx: 398, 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, 399) /*expected idx: 399, name: v.ast.AsmAlias */ ).name) })); } } array_push((array*)&templates, _MOV((v__ast__AsmTemplate[]){ ((v__ast__AsmTemplate){ @@ -91733,7 +91832,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 == 322 /* v.ast.AsmRegister */) { + if ((x)._typ == 323 /* 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 { @@ -91907,7 +92006,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 == 282 /* v.ast.ParExpr */) { + if ((expr)._typ == 283 /* v.ast.ParExpr */) { expr = (*expr._v__ast__ParExpr).expr; } else { v__parser__Parser_error(p, _SLIT("asm in/output must be enclosed in brackets")); @@ -91917,7 +92016,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 == 267 /* v.ast.Ident */) { + } else if ((expr)._typ == 268 /* 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); @@ -91940,7 +92039,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 == 257 /* v.ast.Comment */) { + if ((expr)._typ == 258 /* 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 })); @@ -92038,7 +92137,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 == 283 /* v.ast.PostfixExpr */) { + if ((comptime_cond)._typ == 284 /* v.ast.PostfixExpr */) { comptime_cond_opt = true; } name = v__ast__Expr_str(comptime_cond); @@ -92270,8 +92369,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 != 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_top_level || p->tok.kind != v__token__Kind__rcbr) && (node)._typ != 254 /* v.ast.CallExpr */ && (node)._typ != 284 /* v.ast.PostfixExpr */ && (node)._typ != 259 /* v.ast.ComptimeCall */ && (node)._typ != 288 /* v.ast.SelectorExpr */ && (node)._typ != 263 /* v.ast.DumpExpr */) { + bool is_complex_infix_expr = (node)._typ == 272 /* v.ast.InfixExpr */ && ((/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 272) /*expected idx: 272, name: v.ast.InfixExpr */ ).op == v__token__Kind__left_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 272) /*expected idx: 272, name: v.ast.InfixExpr */ ).op == v__token__Kind__right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 272) /*expected idx: 272, name: v.ast.InfixExpr */ ).op == v__token__Kind__unsigned_right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 272) /*expected idx: 272, 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; @@ -92682,7 +92781,7 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { enum_name = string__plus(string__plus(mod, _SLIT(".")), enum_name); } else { string* _t23 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, p->imported_symbols), &(string[]){enum_name})); - Option_string _t22 = {0}; + _option_string _t22 = {0}; if (_t23) { *((string*)&_t22.data) = *((string*)_t23); } else { @@ -92972,11 +93071,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 == 267 /* v.ast.Ident */) { + if (left._typ == 268 /* v.ast.Ident */) { is_mut = (*left._v__ast__Ident).is_mut; mut_pos = (*left._v__ast__Ident).mut_pos; } - else if (left._typ == 287 /* v.ast.SelectorExpr */) { + else if (left._typ == 288 /* v.ast.SelectorExpr */) { is_mut = (*left._v__ast__SelectorExpr).is_mut; mut_pos = (*left._v__ast__SelectorExpr).mut_pos; } @@ -93593,40 +93692,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 == 254 /* v.ast.CastExpr */) { + if (expr._typ == 255 /* v.ast.CastExpr */) { typ = (*expr._v__ast__CastExpr).typ; } - else if (expr._typ == 292 /* v.ast.StructInit */) { + else if (expr._typ == 293 /* v.ast.StructInit */) { typ = (*expr._v__ast__StructInit).typ; } - else if (expr._typ == 247 /* v.ast.ArrayInit */) { + else if (expr._typ == 248 /* v.ast.ArrayInit */) { typ = (*expr._v__ast__ArrayInit).typ; } - else if (expr._typ == 255 /* v.ast.ChanInit */) { + else if (expr._typ == 256 /* v.ast.ChanInit */) { typ = (*expr._v__ast__ChanInit).typ; } - else if (expr._typ == 251 /* v.ast.BoolLiteral */) { + else if (expr._typ == 252 /* v.ast.BoolLiteral */) { typ = _const_v__ast__bool_type; } - else if (expr._typ == 273 /* v.ast.IsRefType */) { + else if (expr._typ == 274 /* v.ast.IsRefType */) { typ = _const_v__ast__bool_type; } - else if (expr._typ == 256 /* v.ast.CharLiteral */) { + else if (expr._typ == 257 /* v.ast.CharLiteral */) { typ = _const_v__ast__char_type; } - else if (expr._typ == 265 /* v.ast.FloatLiteral */) { + else if (expr._typ == 266 /* v.ast.FloatLiteral */) { typ = _const_v__ast__f64_type; } - else if (expr._typ == 272 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 273 /* v.ast.IntegerLiteral */) { typ = _const_v__ast__int_type; } - else if (expr._typ == 288 /* v.ast.SizeOf */) { + else if (expr._typ == 289 /* v.ast.SizeOf */) { typ = _const_v__ast__int_type; } - else if (expr._typ == 291 /* v.ast.StringLiteral */) { + else if (expr._typ == 292 /* v.ast.StringLiteral */) { typ = _const_v__ast__string_type; } - else if (expr._typ == 290 /* v.ast.StringInterLiteral */) { + else if (expr._typ == 291 /* v.ast.StringInterLiteral */) { typ = _const_v__ast__string_type; } @@ -93923,7 +94022,7 @@ VV_LOCAL_SYMBOL v__ast__TypeDecl v__parser__Parser_type_decl(v__parser__Parser* VV_LOCAL_SYMBOL v__ast__Assoc v__parser__Parser_assoc(v__parser__Parser* p) { string var_name = v__parser__Parser_check_name(p); v__token__Pos pos = v__token__Token_pos(&p->tok); - Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(p->scope, var_name); + _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 `"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); @@ -94006,15 +94105,15 @@ VV_LOCAL_SYMBOL void v__parser__Parser_rewind_scanner_to_current_token_in_new_mo } bool v__parser__Parser_mark_var_as_used(v__parser__Parser* p, string varname) { - Option_v__ast__ScopeObject _t1; + _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 == 325 /* v.ast.Var */) { + if (obj._typ == 326 /* v.ast.Var */) { (*obj._v__ast__Var).is_used = true; bool _t2 = true; return _t2; } - else if (obj._typ == 324 /* v.ast.GlobalField */) { + else if (obj._typ == 325 /* v.ast.GlobalField */) { bool _t3 = true; return _t3; } @@ -94051,7 +94150,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 == 307 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 308 /* 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); @@ -94094,7 +94193,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_trace(v__parser__Parser* p, string fbase, VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_sql_expr(v__parser__Parser* p) { v__token__Pos pos = v__token__Token_pos(&p->tok); v__parser__Parser_check_name(p); - Option_v__ast__Expr _t1 = v__parser__Parser_check_expr(p, 0); + _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 "), /*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))))); @@ -94118,15 +94217,15 @@ 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 == 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 (!is_count && (where_expr)._typ == 272 /* v.ast.InfixExpr */) { + if ((*where_expr._v__ast__InfixExpr).op == v__token__Kind__eq && ((*where_expr._v__ast__InfixExpr).left)._typ == 268 /* 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 == 267 /* v.ast.Ident */) { + if (((*where_expr._v__ast__InfixExpr).right)._typ == 268 /* 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); + _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) { IError err = _t2.err; v__ast__Expr _t3 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, IError_name_table[err._typ]._method_msg(err._object), (*(*where_expr._v__ast__InfixExpr).right._v__ast__Ident).pos)))); @@ -94208,7 +94307,7 @@ bool v__parser__Parser_sql_stmt_defer_0 = false; p->inside_match = true; v__parser__Parser_sql_stmt_defer_0 = true; v__parser__Parser_check_name(p); - Option_v__ast__Expr _t1 = v__parser__Parser_check_expr(p, 0); + _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 "), /*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))))); @@ -94272,7 +94371,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 == 267 /* v.ast.Ident */) { + if ((expr)._typ == 268 /* v.ast.Ident */) { inserted_var_name = (*expr._v__ast__Ident).name; } else { v__parser__Parser_error(p, _SLIT("can only insert variables")); @@ -94316,7 +94415,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par table_pos = v__token__Token_pos(&p->tok); table_type = v__parser__Parser_parse_type(p); } else if (kind == v__ast__SqlStmtKind__update) { - Option_bool _t11 = v__parser__Parser_check_sql_keyword(p, _SLIT("where")); + _option_bool _t11 = v__parser__Parser_check_sql_keyword(p, _SLIT("where")); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; v__ast__SqlStmtLine _t12 = ((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),}); @@ -94328,7 +94427,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par } else if (kind == v__ast__SqlStmtKind__delete) { table_pos = v__token__Token_pos(&p->tok); table_type = v__parser__Parser_parse_type(p); - Option_bool _t13 = v__parser__Parser_check_sql_keyword(p, _SLIT("where")); + _option_bool _t13 = v__parser__Parser_check_sql_keyword(p, _SLIT("where")); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; v__ast__SqlStmtLine _t14 = ((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),}); @@ -94352,13 +94451,13 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par return _t15; } -VV_LOCAL_SYMBOL Option_bool v__parser__Parser_check_sql_keyword(v__parser__Parser* p, string name) { +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 `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); - return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_bool _t2; - opt_ok(&(bool[]) { true }, (Option*)(&_t2), sizeof(bool)); + _option_bool _t2; + opt_ok2(&(bool[]) { true }, (_option*)(&_t2), sizeof(bool)); return _t2; } @@ -94661,7 +94760,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 == 264 /* v.ast.EnumVal */) { + if (default_expr._typ == 265 /* v.ast.EnumVal */) { (*default_expr._v__ast__EnumVal).typ = typ; } @@ -94935,7 +95034,7 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser } 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, 435) /*expected idx: 435, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 436) /*expected idx: 436, 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); @@ -95244,7 +95343,7 @@ VV_LOCAL_SYMBOL string v__parser__insert_template_code(string fn_name, string tm } string v__parser__Parser_compile_template_file(v__parser__Parser* p, string template_file, string fn_name) { - Option_Array_string _t1 = os__read_lines(template_file); + _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 "), /*115 &string*/0xfe10, {.d_s = template_file}}, {_SLIT(" failed"), 0, { .d_c = 0 }}}))); @@ -95282,7 +95381,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } #endif if (string_contains(line, _SLIT("@header"))) { - Option_int _t3 = string_index(line, _SLIT("@header")); + _option_int _t3 = string_index(line, _SLIT("@header")); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; *(int*) _t3.data = 0; @@ -95293,7 +95392,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp continue; } if (string_contains(line, _SLIT("@footer"))) { - Option_int _t4 = string_index(line, _SLIT("@footer")); + _option_int _t4 = string_index(line, _SLIT("@footer")); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(int*) _t4.data = 0; @@ -95321,10 +95420,10 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp 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); + _option_string _t5 = os__read_file(file_path); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - Option_int _t6 = string_index(line, _SLIT("@include ")); + _option_int _t6 = string_index(line, _SLIT("@include ")); if (_t6.state != 0) { /*or block*/ err = _t6.err; *(int*) _t6.data = 0; @@ -95347,7 +95446,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } if (string_contains(line, _SLIT("@if "))) { strings__Builder_writeln(&source, _const_v__parser__tmpl_str_end); - Option_int _t8 = string_index(line, _SLIT("@if")); + _option_int _t8 = string_index(line, _SLIT("@if")); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; continue; @@ -95374,7 +95473,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } if (string_contains(line, _SLIT("@for"))) { strings__Builder_writeln(&source, _const_v__parser__tmpl_str_end); - Option_int _t9 = string_index(line, _SLIT("@for")); + _option_int _t9 = string_index(line, _SLIT("@for")); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; continue; @@ -95391,7 +95490,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } if (state != v__parser__State__simple) { if (string_contains(line, _SLIT("@js "))) { - Option_int _t10 = string_index(line, _SLIT("@js")); + _option_int _t10 = string_index(line, _SLIT("@js")); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; continue; @@ -95404,7 +95503,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp continue; } if (string_contains(line, _SLIT("@css "))) { - Option_int _t11 = string_index(line, _SLIT("@css")); + _option_int _t11 = string_index(line, _SLIT("@css")); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; continue; @@ -95517,13 +95616,13 @@ VV_LOCAL_SYMBOL string v__callgraph__Mapper_dot_fn_name(v__callgraph__Mapper* m, return _t2; } -VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node) { +VV_LOCAL_SYMBOL _option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node) { m->node = node; - if (node->_typ == 175 /* v.ast.File */) { + if (node->_typ == 176 /* v.ast.File */) { m->file = &(*node->_v__ast__File); } - else if (node->_typ == 321 /* v.ast.Stmt */) { - if ((*node->_v__ast__Stmt)._typ == 184 /* v.ast.FnDecl */) { + else if (node->_typ == 322 /* v.ast.Stmt */) { + if ((*node->_v__ast__Stmt)._typ == 185 /* 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 })); @@ -95540,8 +95639,8 @@ VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, } ; } - else if (node->_typ == 296 /* v.ast.Expr */) { - if ((*node->_v__ast__Expr)._typ == 253 /* v.ast.CallExpr */) { + else if (node->_typ == 297 /* v.ast.Expr */) { + if ((*node->_v__ast__Expr)._typ == 254 /* 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,})); @@ -95556,7 +95655,7 @@ VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, else { } ; - return (Option_void){0}; + return (_option_void){0}; } v__builder__Builder v__builder__new_builder(v__pref__Preferences* pref) { @@ -95571,7 +95670,7 @@ v__builder__Builder v__builder__new_builder(v__pref__Preferences* pref) { v__util__EManager_set_support_color(_const_v__util__emanager, false); } table->pointer_size = (pref->m64 ? (8) : (4)); - Option_v__builder__MsvcResult _t1 = v__builder__find_msvc(pref->m64); + _option_v__builder__MsvcResult _t1 = v__builder__find_msvc(pref->m64); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (string__eq(pref->ccompiler, _SLIT("msvc"))) { @@ -95609,7 +95708,7 @@ v__builder__Builder v__builder__new_builder(v__pref__Preferences* pref) { return _t2; } -Option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_string v_files) { +_option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_string v_files) { v__util__Timers* timers = v__util__get_timers(); v__util__timing_start(_SLIT("PARSE")); v__util__timing_start(_SLIT("Builder.front_stages.parse_files")); @@ -95620,12 +95719,12 @@ Option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_strin v__util__Timers_show(timers, _SLIT("PARSE")); v__util__Timers_show_if_exists(timers, _SLIT("PARSE stmt")); if (b->pref->only_check_syntax) { - return (Option_void){ .state=2, .err=error_with_code(_SLIT("stop_after_parser"), 9999), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(_SLIT("stop_after_parser"), 9999), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } -Option_void v__builder__Builder_middle_stages(v__builder__Builder* b) { +_option_void v__builder__Builder_middle_stages(v__builder__Builder* b) { v__util__timing_start(_SLIT("CHECK")); v__util__timing_start(_SLIT("Checker.generic_insts_to_concrete")); v__ast__Table_generic_insts_to_concrete(b->table); @@ -95634,10 +95733,10 @@ Option_void v__builder__Builder_middle_stages(v__builder__Builder* b) { v__util__timing_measure(_SLIT("CHECK")); v__builder__Builder_print_warnings_and_errors(b); if (b->checker->should_abort) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("too many errors/warnings/notices")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("too many errors/warnings/notices")), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (b->pref->check_only) { - return (Option_void){ .state=2, .err=error_with_code(_SLIT("stop_after_checker"), 9999), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(_SLIT("stop_after_checker"), 9999), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__util__timing_start(_SLIT("TRANSFORM")); v__transformer__Transformer_transform_files(b->transformer, b->parsed_files); @@ -95649,27 +95748,27 @@ Option_void v__builder__Builder_middle_stages(v__builder__Builder* b) { if (b->pref->show_callgraph) { v__callgraph__show(b->table, b->pref, b->parsed_files); } - return (Option_void){0}; + return (_option_void){0}; } -Option_void v__builder__Builder_front_and_middle_stages(v__builder__Builder* b, Array_string v_files) { - Option_void _t1 = v__builder__Builder_front_stages(b, v_files); +_option_void v__builder__Builder_front_and_middle_stages(v__builder__Builder* b, Array_string v_files) { + _option_void _t1 = v__builder__Builder_front_stages(b, v_files); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } ; - Option_void _t3 = v__builder__Builder_middle_stages(b); + _option_void _t3 = v__builder__Builder_middle_stages(b); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } ; - return (Option_void){0}; + return (_option_void){0}; } void v__builder__Builder_parse_imports(v__builder__Builder* b) { @@ -95705,7 +95804,7 @@ bool v__builder__Builder_parse_imports_defer_0 = false; if (Array_string_contains(done_imports, mod)) { continue; } - Option_string _t11 = v__builder__Builder_find_module_path(b, mod, ast_file->path); + _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 \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); @@ -95845,7 +95944,7 @@ Array_string v__builder__Builder_v_files_from_dir(v__builder__Builder* b, string 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); + _option_Array_string _t1 = os__ls(dir); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -95879,7 +95978,7 @@ inline string v__builder__module_path(string mod) { return _t1; } -Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, string mod, string fpath) { +_option_string v__builder__Builder_find_module_path(v__builder__Builder* b, string mod, string fpath) { v__vmod__ModFileCacher* mcache = v__vmod__get_cache(); v__vmod__ModFileAndFolder vmod_file_location = v__vmod__ModFileCacher_get_by_file(mcache, fpath); string mod_path = v__builder__module_path(mod); @@ -95908,8 +96007,8 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin if (b->pref->is_verbose) { 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)); + _option_string _t6; + opt_ok2(&(string[]) { try_path }, (_option*)(&_t6), sizeof(string)); return _t6; } } @@ -95921,13 +96020,13 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin 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; - opt_ok(&(string[]) { try_path }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { try_path }, (_option*)(&_t7), sizeof(string)); return _t7; } } 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 \""), /*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} }; + 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) { @@ -96079,7 +96178,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 == 184 /* v.ast.FnDecl */) { + if ((stmt)._typ == 185 /* 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),}) })); @@ -96128,10 +96227,10 @@ VNORETURN void v__builder__verror(string s) { while(1); } -Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { +_option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { #if !defined(_WIN32) { - return (Option_void){0}; + return (_option_void){0}; } #endif 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 }}}))); @@ -96139,7 +96238,7 @@ Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { if (v->pref->is_verbose) { 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); + _option_v__builder__MsvcResult _t1 = v__builder__find_msvc(v->pref->m64); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (v->pref->is_verbose) { @@ -96152,20 +96251,20 @@ Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { if (v->pref->is_verbose) { println(_SLIT("tcc not found")); } - return (Option_void){ .state=2, .err=_v_error(_SLIT("tcc not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("tcc not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; } v->pref->ccompiler = thirdparty_tcc; v->pref->ccompiler_type = v__pref__CompilerType__tinyc; - return (Option_void){0}; + return (_option_void){0}; } (*(v__builder__MsvcResult*)_t1.data); v->pref->ccompiler = _SLIT("msvc"); v->pref->ccompiler_type = v__pref__CompilerType__msvc; - return (Option_void){0}; + return (_option_void){0}; } v->pref->ccompiler_type = v__pref__cc_from_string(v->pref->ccompiler); - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL void v__builder__Builder_show_c_compiler_output(v__builder__Builder* v, os__Result res) { @@ -96185,7 +96284,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__build if (v->pref->is_verbose) { 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); + _option_void _t2 = os__rm(tmpfile); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -96454,15 +96553,25 @@ VV_LOCAL_SYMBOL Array_string v__builder__Builder_all_args(v__builder__Builder* v } _PUSH_MANY(&all, (ccoptions.args), _t3, Array_string); _PUSH_MANY(&all, (ccoptions.o_args), _t4, Array_string); - _PUSH_MANY(&all, (ccoptions.pre_args), _t5, Array_string); - _PUSH_MANY(&all, (ccoptions.source_args), _t6, Array_string); - _PUSH_MANY(&all, (ccoptions.post_args), _t7, Array_string); + #if defined(_WIN32) + { + if (!ccoptions.is_cc_msvc) { + array_push((array*)&all, _MOV((string[]){ string_clone(_SLIT("-Wl,-stack=16777216")) })); + if (!v->pref->is_cstrict) { + array_push((array*)&all, _MOV((string[]){ string_clone(_SLIT("-Werror=implicit-function-declaration")) })); + } + } + } + #endif + _PUSH_MANY(&all, (ccoptions.pre_args), _t7, Array_string); + _PUSH_MANY(&all, (ccoptions.source_args), _t8, Array_string); + _PUSH_MANY(&all, (ccoptions.post_args), _t9, Array_string); if (v->pref->build_mode != v__pref__BuildMode__build_module) { - _PUSH_MANY(&all, (ccoptions.linker_flags), _t8, Array_string); + _PUSH_MANY(&all, (ccoptions.linker_flags), _t10, Array_string); } array_push((array*)&all, _MOV((string[]){ string_clone(ccoptions.env_ldflags) })); - Array_string _t10 = all; - return _t10; + Array_string _t12 = all; + return _t12; } VV_LOCAL_SYMBOL Array_string v__builder__Builder_thirdparty_object_args(v__builder__Builder* v, v__builder__CcompilerOptions ccoptions, Array_string middle) { @@ -96490,7 +96599,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_output_name(v__builder__Builder* if (v->pref->is_verbose) { 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, /*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 }}}))); + _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)); @@ -96524,7 +96633,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_dump_c_options(v__builder__Builder* v, if (string__eq(v->pref->dump_c_flags, _SLIT("-"))) { print(non_empty_args); } else { - Option_void _t3 = os__write_file(v->pref->dump_c_flags, non_empty_args); + _option_void _t3 = os__write_file(v->pref->dump_c_flags, non_empty_args); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; _v_panic(IError_str(err)); @@ -96557,7 +96666,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { return; } if (v__pref__Preferences_should_output_to_stdout(v->pref)) { - Option_string _t1 = os__read_file(v->out_name_c); + _option_string _t1 = os__read_file(v->out_name_c); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -96567,7 +96676,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { string content = (*(string*)_t1.data); println(content); - Option_void _t2 = os__rm(v->out_name_c); + _option_void _t2 = os__rm(v->out_name_c); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -96581,7 +96690,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { v->pref->skip_running = true; 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); + _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) { IError err = _t3.err; _v_panic(IError_str(err)); @@ -96669,7 +96778,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { response_file_content = string_replace(str_args, _SLIT("\\"), _SLIT("\\\\")); 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); + _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 \""), /*115 &string*/0xfe10, {.d_s = response_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); @@ -96693,7 +96802,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { } } #endif - Option_void _t12 = os__chdir(vdir); + _option_void _t12 = os__chdir(vdir); if (_t12.state != 0 && _t12.err._typ != _IError_None___index) { IError err = _t12.err; } @@ -96708,7 +96817,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { if (v->pref->show_c_output) { v__builder__Builder_show_c_compiler_output(v, res); } - Option_void _t14 = os__chdir(original_pwd); + _option_void _t14 = os__chdir(original_pwd); if (_t14.state != 0 && _t14.err._typ != _IError_None___index) { IError err = _t14.err; } @@ -96790,7 +96899,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_ensure_linuxroot_exists(v__builder__Bui string crossrepo_url = _SLIT("https://github.com/spytheman/vlinuxroot"); string sysroot_git_config_path = os__join_path(sysroot, new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT(".git"), _SLIT("config")}))); if (os__is_dir(sysroot) && !os__exists(sysroot_git_config_path)) { - Option_void _t1 = os__rmdir_all(sysroot); + _option_void _t1 = os__rmdir_all(sysroot); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; } @@ -96804,7 +96913,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_ensure_linuxroot_exists(v__builder__Bui 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); + _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); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -96822,7 +96931,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) v__builder__Builder_setup_output_name(b); string parent_dir = os__vmodules_dir(); if (!os__exists(parent_dir)) { - Option_bool _t1 = os__mkdir(parent_dir); + _option_bool _t1 = os__mkdir(parent_dir); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -96836,10 +96945,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) v__builder__Builder_ensure_linuxroot_exists(b, sysroot); string obj_file = string__plus(b->out_name_c, _SLIT(".o")); Array_v__cflag__CFlag cflags = v__builder__Builder_get_os_cflags(b); - multi_return_Array_string_Array_string_Array_string mr_22693 = Array_v__cflag__CFlag_defines_others_libs(cflags); - Array_string defines = mr_22693.arg0; - Array_string others = mr_22693.arg1; - Array_string libs = mr_22693.arg2; + multi_return_Array_string_Array_string_Array_string mr_23274 = Array_v__cflag__CFlag_defines_others_libs(cflags); + Array_string defines = mr_23274.arg0; + Array_string others = mr_23274.arg1; + Array_string libs = mr_23274.arg2; Array_string cc_args = __new_array_with_default(0, 0, sizeof(string), 0); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-w")) })); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-fPIC")) })); @@ -96997,7 +97106,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B } } if (os__exists(obj_path)) { - Option_void _t1 = os__cp(obj_path, opath); + _option_void _t1 = os__cp(obj_path, opath); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; _v_panic(IError_str(err)); @@ -97012,7 +97121,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B println(rebuild_reason_message); } string current_folder = os__getwd(); - Option_void _t2 = os__chdir(os__dir(v__pref__vexe_path())); + _option_void _t2 = os__chdir(os__dir(v__pref__vexe_path())); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -97031,7 +97140,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B } #endif os__Result res = os__execute(cmd); - Option_void _t7 = os__chdir(current_folder); + _option_void _t7 = os__chdir(current_folder); if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { IError err = _t7.err; } @@ -97043,7 +97152,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B VUNREACHABLE(); return; } - 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 }}}))); + _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)); @@ -97114,7 +97223,7 @@ VV_LOCAL_SYMBOL Array_v__cflag__CFlag v__builder__Builder_get_os_cflags(v__build array_push((array*)&flags, _MOV((v__cflag__CFlag[]){ *flag })); continue; } - Option_v__pref__OS _t4 = v__pref__os_from_string(flag->os); + _option_v__pref__OS _t4 = v__pref__os_from_string(flag->os); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(v__pref__OS*) _t4.data = v__pref__OS__all; @@ -97157,7 +97266,7 @@ void v__builder__compile(string command, v__pref__Preferences* pref, void (*back if (odir.len == pref->out_name.len) { output_folder = os__getwd(); } - Option_bool _t1 = os__is_writable_folder(output_folder); + _option_bool _t1 = os__is_writable_folder(output_folder); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__builder__verror(IError_name_table[err._typ]._method_msg(err._object)); @@ -97268,7 +97377,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_run_compiled_executable_and_exit(v__bui string node_basename = _SLIT("node"); #endif ; -Option_string _t2 = os__find_abs_path_of_executable(node_basename); +_option_string _t2 = os__find_abs_path_of_executable(node_basename); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; _v_panic(_SLIT("Could not find `node` in system path. Do you have Node.js installed?")); @@ -97291,7 +97400,7 @@ Option_string _t2 = os__find_abs_path_of_executable(node_basename); if (b->pref->is_verbose) { 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); + _option_os__SignalHandler _t5 = os__signal_opt(os__Signal__int, (voidptr)v__builder__eshcb); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; v__builder__serror(_SLIT("set .int"), err); @@ -97303,7 +97412,7 @@ Option_string _t2 = os__find_abs_path_of_executable(node_basename); void (*prev_quit_handler) (os__Signal ) = ((os__SignalHandler)(v__builder__eshcb)); #if !defined(_WIN32) { - Option_os__SignalHandler _t6 = os__signal_opt(os__Signal__quit, (voidptr)v__builder__eshcb); + _option_os__SignalHandler _t6 = os__signal_opt(os__Signal__quit, (voidptr)v__builder__eshcb); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; v__builder__serror(_SLIT("set .quit"), err); @@ -97315,7 +97424,7 @@ Option_string _t2 = os__find_abs_path_of_executable(node_basename); } #endif os__Process_wait(run_process); - Option_os__SignalHandler _t7 = os__signal_opt(os__Signal__int, (voidptr)prev_int_handler); + _option_os__SignalHandler _t7 = os__signal_opt(os__Signal__int, (voidptr)prev_int_handler); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; v__builder__serror(_SLIT("restore .int"), err); @@ -97326,7 +97435,7 @@ Option_string _t2 = os__find_abs_path_of_executable(node_basename); (*(os__SignalHandler*)_t7.data); #if !defined(_WIN32) { - Option_os__SignalHandler _t8 = os__signal_opt(os__Signal__quit, (voidptr)prev_quit_handler); + _option_os__SignalHandler _t8 = os__signal_opt(os__Signal__quit, (voidptr)prev_quit_handler); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; v__builder__serror(_SLIT("restore .quit"), err); @@ -97364,7 +97473,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cleanup_run_executable_after_exit(v__bu return; } 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); + _option_void _t1 = os__rm(exefile); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; } @@ -97477,7 +97586,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { bool is_test = v->pref->is_test; bool is_internal_module_test = false; if (is_test) { - Option_string _t10 = v__util__read_file(dir); + _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, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}}))); @@ -97548,7 +97657,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { } // TypeDecl -VV_LOCAL_SYMBOL Option_string v__builder__find_windows_kit_internal(v__builder__RegKey key, Array_string versions) { +VV_LOCAL_SYMBOL _option_string v__builder__find_windows_kit_internal(v__builder__RegKey key, Array_string versions) { #if defined(_WIN32) { { // Unsafe block @@ -97574,79 +97683,79 @@ VV_LOCAL_SYMBOL Option_string v__builder__find_windows_kit_internal(v__builder__ value[length] = ((u16)(0U)); } string res = string_from_wide(value); - Option_string _t2; - opt_ok(&(string[]) { res }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { res }, (_option*)(&_t2), sizeof(string)); return _t2; } } } #endif - return (Option_string){ .state=2, .err=_v_error(_SLIT("windows kit not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("windows kit not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; } -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root(string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root(string target_arch) { #if defined(_WIN32) { - Option_v__builder__WindowsKit _t1 = v__builder__find_windows_kit_root_by_reg(target_arch); + _option_v__builder__WindowsKit _t1 = v__builder__find_windows_kit_root_by_reg(target_arch); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - Option_v__builder__WindowsKit _t2; + _option_v__builder__WindowsKit _t2; if (_t2 = v__builder__find_windows_kit_root_by_env(target_arch), _t2.state == 0) { v__builder__WindowsKit wkroot = *(v__builder__WindowsKit*)_t2.data; - Option_v__builder__WindowsKit _t3; - opt_ok(&(v__builder__WindowsKit[]) { wkroot }, (Option*)(&_t3), sizeof(v__builder__WindowsKit)); + _option_v__builder__WindowsKit _t3; + opt_ok2(&(v__builder__WindowsKit[]) { wkroot }, (_option*)(&_t3), sizeof(v__builder__WindowsKit)); return _t3; } - return (Option_v__builder__WindowsKit){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__builder__WindowsKit wkroot = (*(v__builder__WindowsKit*)_t1.data); - Option_v__builder__WindowsKit _t5; - opt_ok(&(v__builder__WindowsKit[]) { wkroot }, (Option*)(&_t5), sizeof(v__builder__WindowsKit)); + _option_v__builder__WindowsKit _t5; + opt_ok2(&(v__builder__WindowsKit[]) { wkroot }, (_option*)(&_t5), sizeof(v__builder__WindowsKit)); return _t5; } #else { - return (Option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Host OS does not support finding a windows kit")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Host OS does not support finding a windows kit")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #endif - return (Option_v__builder__WindowsKit){0}; + return (_option_v__builder__WindowsKit){0}; } -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_reg(string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_reg(string target_arch) { #if defined(_WIN32) { v__builder__RegKey root_key = ((v__builder__RegKey)(0)); string path = _SLIT("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots"); voidptr rc = RegOpenKeyEx(_const_v__builder__hkey_local_machine, string_to_wide(path), 0U, ((_const_v__builder__key_query_value | _const_v__builder__key_wow64_32key) | _const_v__builder__key_enumerate_sub_keys), &root_key); if (rc != 0) { - return (Option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Unable to open root key")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Unable to open root key")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t2 = v__builder__find_windows_kit_internal(root_key, new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("KitsRoot10"), _SLIT("KitsRoot81")}))); + _option_string _t2 = v__builder__find_windows_kit_internal(root_key, new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("KitsRoot10"), _SLIT("KitsRoot81")}))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; RegCloseKey(root_key); - return (Option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Unable to find a windows kit")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Unable to find a windows kit")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string kit_root = (*(string*)_t2.data); RegCloseKey(root_key); - Option_v__builder__WindowsKit _t4 = v__builder__new_windows_kit(kit_root, target_arch); + _option_v__builder__WindowsKit _t4 = v__builder__new_windows_kit(kit_root, target_arch); return _t4; } #else { - return (Option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Host OS does not support finding a windows kit")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Host OS does not support finding a windows kit")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #endif - return (Option_v__builder__WindowsKit){0}; + return (_option_v__builder__WindowsKit){0}; } -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__new_windows_kit(string kit_root, string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__new_windows_kit(string kit_root, string target_arch) { string kit_lib = string__plus(kit_root, _SLIT("Lib")); - Option_Array_string _t1 = os__ls(kit_lib); + _option_Array_string _t1 = os__ls(kit_lib); if (_t1.state != 0) { /*or block*/ - Option_v__builder__WindowsKit _t2; + _option_v__builder__WindowsKit _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -97665,61 +97774,61 @@ VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__new_windows_kit(string } 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\\"), /*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)); + _option_v__builder__WindowsKit _t4; + opt_ok2(&(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; } -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_env(string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_env(string target_arch) { string kit_root = os__getenv(_SLIT("WindowsSdkDir")); if ((kit_root).len == 0) { - return (Option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("empty WindowsSdkDir")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("empty WindowsSdkDir")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__builder__WindowsKit _t2 = v__builder__new_windows_kit(kit_root, target_arch); + _option_v__builder__WindowsKit _t2 = v__builder__new_windows_kit(kit_root, target_arch); return _t2; } -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs(string vswhere_dir, string host_arch, string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs(string vswhere_dir, string host_arch, string target_arch) { #if defined(_WIN32) { - Option_v__builder__VsInstallation _t1 = v__builder__find_vs_by_reg(vswhere_dir, host_arch, target_arch); + _option_v__builder__VsInstallation _t1 = v__builder__find_vs_by_reg(vswhere_dir, host_arch, target_arch); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - Option_v__builder__VsInstallation _t2; + _option_v__builder__VsInstallation _t2; if (_t2 = v__builder__find_vs_by_env(host_arch, target_arch), _t2.state == 0) { v__builder__VsInstallation vsinst = *(v__builder__VsInstallation*)_t2.data; - Option_v__builder__VsInstallation _t3; - opt_ok(&(v__builder__VsInstallation[]) { vsinst }, (Option*)(&_t3), sizeof(v__builder__VsInstallation)); + _option_v__builder__VsInstallation _t3; + opt_ok2(&(v__builder__VsInstallation[]) { vsinst }, (_option*)(&_t3), sizeof(v__builder__VsInstallation)); return _t3; } - return (Option_v__builder__VsInstallation){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__builder__VsInstallation vsinst = (*(v__builder__VsInstallation*)_t1.data); - Option_v__builder__VsInstallation _t5; - opt_ok(&(v__builder__VsInstallation[]) { vsinst }, (Option*)(&_t5), sizeof(v__builder__VsInstallation)); + _option_v__builder__VsInstallation _t5; + opt_ok2(&(v__builder__VsInstallation[]) { vsinst }, (_option*)(&_t5), sizeof(v__builder__VsInstallation)); return _t5; } #else { - return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Host OS does not support finding a Visual Studio installation")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Host OS does not support finding a Visual Studio installation")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #endif - return (Option_v__builder__VsInstallation){0}; + return (_option_v__builder__VsInstallation){0}; } -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(string vswhere_dir, string host_arch, string target_arch) { +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("\""), /*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} }; + 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, /*115 &string*/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} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Unable to find vs installation")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string version = (*(string*)_t2.data); @@ -97728,61 +97837,61 @@ VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(str 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)); + _option_v__builder__VsInstallation _t4; + opt_ok2(&(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 \""), /*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} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Unable to find vs exe folder")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #else { - return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Host OS does not support finding a Visual Studio installation")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Host OS does not support finding a Visual Studio installation")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #endif - return (Option_v__builder__VsInstallation){0}; + return (_option_v__builder__VsInstallation){0}; } -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_env(string host_arch, string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs_by_env(string host_arch, string target_arch) { string vs_dir = os__getenv(_SLIT("VSINSTALLDIR")); if ((vs_dir).len == 0) { - return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("empty VSINSTALLDIR")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("empty VSINSTALLDIR")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string vc_tools_dir = os__getenv(_SLIT("VCToolsInstallDir")); if ((vc_tools_dir).len == 0) { - return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("empty VCToolsInstallDir")), .data={EMPTY_STRUCT_INITIALIZATION} }; + 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, /*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)); + _option_v__builder__VsInstallation _t3; + opt_ok2(&(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; } -VV_LOCAL_SYMBOL Option_v__builder__MsvcResult v__builder__find_msvc(bool m64_target) { +VV_LOCAL_SYMBOL _option_v__builder__MsvcResult v__builder__find_msvc(bool m64_target) { #if defined(_WIN32) { string processor_architecture = os__getenv(_SLIT("PROCESSOR_ARCHITECTURE")); string vswhere_dir = (string__eq(processor_architecture, _SLIT("x86")) ? (_SLIT("%ProgramFiles%")) : (_SLIT("%ProgramFiles(x86)%"))); string host_arch = (string__eq(processor_architecture, _SLIT("x86")) ? (_SLIT("X86")) : (_SLIT("X64"))); string target_arch = (!m64_target ? (_SLIT("X86")) : (_SLIT("X64"))); - Option_v__builder__WindowsKit _t1 = v__builder__find_windows_kit_root(target_arch); + _option_v__builder__WindowsKit _t1 = v__builder__find_windows_kit_root(target_arch); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_v__builder__MsvcResult){ .state=2, .err=_v_error(_SLIT("Unable to find windows sdk")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__MsvcResult){ .state=2, .err=_v_error(_SLIT("Unable to find windows sdk")), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__builder__WindowsKit wk = (*(v__builder__WindowsKit*)_t1.data); - Option_v__builder__VsInstallation _t3 = v__builder__find_vs(vswhere_dir, host_arch, target_arch); + _option_v__builder__VsInstallation _t3 = v__builder__find_vs(vswhere_dir, host_arch, target_arch); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_v__builder__MsvcResult){ .state=2, .err=_v_error(_SLIT("Unable to find visual studio")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__MsvcResult){ .state=2, .err=_v_error(_SLIT("Unable to find visual studio")), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__builder__VsInstallation vs = (*(v__builder__VsInstallation*)_t3.data); - Option_v__builder__MsvcResult _t5; - opt_ok(&(v__builder__MsvcResult[]) { ((v__builder__MsvcResult){ + _option_v__builder__MsvcResult _t5; + opt_ok2(&(v__builder__MsvcResult[]) { ((v__builder__MsvcResult){ .full_cl_exe_path = os__real_path(string__plus(string__plus(vs.exe_path, _const_os__path_separator), _SLIT("cl.exe"))), .exe_path = vs.exe_path, .um_lib_path = wk.um_lib_path, @@ -97793,17 +97902,17 @@ VV_LOCAL_SYMBOL Option_v__builder__MsvcResult v__builder__find_msvc(bool m64_tar .vs_include_path = vs.include_path, .shared_include_path = wk.shared_include_path, .valid = true, - }) }, (Option*)(&_t5), sizeof(v__builder__MsvcResult)); + }) }, (_option*)(&_t5), sizeof(v__builder__MsvcResult)); return _t5; } #else { - Option_v__builder__MsvcResult _t6; - opt_ok(&(v__builder__MsvcResult[]) { ((v__builder__MsvcResult){.full_cl_exe_path = _SLIT("/usr/bin/true"),.exe_path = (string){.str=(byteptr)"", .is_lit=1},.um_lib_path = (string){.str=(byteptr)"", .is_lit=1},.ucrt_lib_path = (string){.str=(byteptr)"", .is_lit=1},.vs_lib_path = (string){.str=(byteptr)"", .is_lit=1},.um_include_path = (string){.str=(byteptr)"", .is_lit=1},.ucrt_include_path = (string){.str=(byteptr)"", .is_lit=1},.vs_include_path = (string){.str=(byteptr)"", .is_lit=1},.shared_include_path = (string){.str=(byteptr)"", .is_lit=1},.valid = true,}) }, (Option*)(&_t6), sizeof(v__builder__MsvcResult)); + _option_v__builder__MsvcResult _t6; + opt_ok2(&(v__builder__MsvcResult[]) { ((v__builder__MsvcResult){.full_cl_exe_path = _SLIT("/usr/bin/true"),.exe_path = (string){.str=(byteptr)"", .is_lit=1},.um_lib_path = (string){.str=(byteptr)"", .is_lit=1},.ucrt_lib_path = (string){.str=(byteptr)"", .is_lit=1},.vs_lib_path = (string){.str=(byteptr)"", .is_lit=1},.um_include_path = (string){.str=(byteptr)"", .is_lit=1},.ucrt_include_path = (string){.str=(byteptr)"", .is_lit=1},.vs_include_path = (string){.str=(byteptr)"", .is_lit=1},.shared_include_path = (string){.str=(byteptr)"", .is_lit=1},.valid = true,}) }, (_option*)(&_t6), sizeof(v__builder__MsvcResult)); return _t6; } #endif - return (Option_v__builder__MsvcResult){0}; + return (_option_v__builder__MsvcResult){0}; } void v__builder__Builder_cc_msvc(v__builder__Builder* v) { @@ -97885,7 +97994,7 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { array_push((array*)&a, _MOV((string[]){ string_clone(env_ldflags) })); } string args = Array_string_join(a, _SLIT(" ")); - Option_void _t33 = os__write_file(out_name_cmd_line, args); + _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 \""), /*115 &string*/0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); @@ -97913,7 +98022,7 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { } else { v__builder__Builder_post_process_c_compiler_output(v, res); } - Option_void _t34 = os__rm(out_name_obj); + _option_void _t34 = os__rm(out_name_obj); if (_t34.state != 0 && _t34.err._typ != _IError_None___index) { IError err = _t34.err; } @@ -98032,7 +98141,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { } Array_string all_files =_t1; v__vcache__CacheManager cm = v__vcache__new_cache_manager(all_files); - Option_string _t3 = v__vcache__CacheManager_load(&cm, _SLIT(".hashes"), _SLIT("all_files")); + _option_string _t3 = v__vcache__CacheManager_load(&cm, _SLIT(".hashes"), _SLIT("all_files")); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; *(string*) _t3.data = _SLIT(" "); @@ -98053,7 +98162,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { for (int _t5 = 0; _t5 < b->parsed_files.len; ++_t5) { v__ast__File* p = ((v__ast__File**)b->parsed_files.data)[_t5]; string cpath = p->path; - Option_string _t6 = v__util__read_file(cpath); + _option_string _t6 = v__util__read_file(cpath); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; *(string*) _t6.data = _SLIT(""); @@ -98068,7 +98177,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { strings__Builder_write_u8(&sb_new_hashes, '\n'); } string snew_hashes = strings__Builder_str(&sb_new_hashes); - Option_string _t7 = v__vcache__CacheManager_save(&cm, _SLIT(".hashes"), _SLIT("all_files"), snew_hashes); + _option_string _t7 = v__vcache__CacheManager_save(&cm, _SLIT(".hashes"), _SLIT("all_files"), snew_hashes); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; } @@ -98254,7 +98363,7 @@ string pwd; pwd = os__getwd(); v__builder__Builder_v_build_module_defer_0 = true; string vroot = os__dir(vexe); - Option_void _t1 = os__chdir(vroot); + _option_void _t1 = os__chdir(vroot); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; } @@ -98271,7 +98380,7 @@ string pwd; os__system(rebuild_cmd); // Defer begin if (v__builder__Builder_v_build_module_defer_0) { - Option_void _t2 = os__chdir(pwd); + _option_void _t2 = os__chdir(pwd); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -98282,14 +98391,14 @@ if (v__builder__Builder_v_build_module_defer_0) { } VV_LOCAL_SYMBOL string v__builder__Builder_rebuild_cached_module(v__builder__Builder* b, string vexe, string imp_path) { - Option_string _t1 = v__vcache__CacheManager_exists(&b->pref->cache_manager, _SLIT(".o"), imp_path); + _option_string _t1 = v__vcache__CacheManager_exists(&b->pref->cache_manager, _SLIT(".o"), imp_path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (b->pref->is_verbose) { 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); + _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 "), /*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 }}}))); @@ -98318,7 +98427,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_handle_usecache(v__builder__Builder* b, for (int _t2 = 0; _t2 < b->parsed_files.len; ++_t2) { v__ast__File* ast_file = ((v__ast__File**)b->parsed_files.data)[_t2]; if (b->pref->is_test && !string__eq(ast_file->mod.name, _SLIT("main"))) { - Option_string _t3 = v__builder__Builder_find_module_path(b, ast_file->mod.name, ast_file->path); + _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 \""), /*115 &string*/0xfe10, {.d_s = ast_file->mod.name}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); @@ -98346,7 +98455,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_handle_usecache(v__builder__Builder* b, if (string__eq(imp, _SLIT("help"))) { continue; } - Option_string _t7 = v__builder__Builder_find_module_path(b, imp, ast_file->path); + _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 \""), /*115 &string*/0xfe10, {.d_s = imp}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); @@ -98377,7 +98486,7 @@ void v__builder__cbuilder__compile_c(v__builder__Builder* b) { } #if defined(_WIN32) { - Option_void _t1 = v__builder__Builder_find_win_cc(b); + _option_void _t1 = v__builder__Builder_find_win_cc(b); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__builder__verror(_const_v__builder__no_compiler_error); @@ -98404,7 +98513,7 @@ void v__builder__cbuilder__compile_c(v__builder__Builder* b) { } string v__builder__cbuilder__gen_c(v__builder__Builder* b, Array_string v_files) { - Option_void _t1 = v__builder__Builder_front_and_middle_stages(b, v_files); + _option_void _t1 = v__builder__Builder_front_and_middle_stages(b, v_files); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; if (IError_name_table[err._typ]._method_code(err._object) != 9999) { @@ -98428,7 +98537,7 @@ void v__builder__cbuilder__build_c(v__builder__Builder* b, Array_string v_files, b->pref->out_name_c = os__real_path(out_file); 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); + _option_void _t1 = os__write_file(out_file, output2); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; _v_panic(IError_str(err)); @@ -98621,106 +98730,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 = 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 = 431, .tname = _SLIT("v.ast.Aggregate")} + , (VCastTypeIndexName){.tindex = 433, .tname = _SLIT("v.ast.Alias")} + , (VCastTypeIndexName){.tindex = 413, .tname = _SLIT("v.ast.Array")} + , (VCastTypeIndexName){.tindex = 441, .tname = _SLIT("v.ast.ArrayFixed")} + , (VCastTypeIndexName){.tindex = 442, .tname = _SLIT("v.ast.Chan")} + , (VCastTypeIndexName){.tindex = 447, .tname = _SLIT("v.ast.Enum")} + , (VCastTypeIndexName){.tindex = 445, .tname = _SLIT("v.ast.FnType")} + , (VCastTypeIndexName){.tindex = 446, .tname = _SLIT("v.ast.GenericInst")} + , (VCastTypeIndexName){.tindex = 436, .tname = _SLIT("v.ast.Interface")} + , (VCastTypeIndexName){.tindex = 414, .tname = _SLIT("v.ast.Map")} + , (VCastTypeIndexName){.tindex = 444, .tname = _SLIT("v.ast.MultiReturn")} + , (VCastTypeIndexName){.tindex = 418, .tname = _SLIT("v.ast.Struct")} + , (VCastTypeIndexName){.tindex = 437, .tname = _SLIT("v.ast.SumType")} + , (VCastTypeIndexName){.tindex = 443, .tname = _SLIT("v.ast.Thread")} + , (VCastTypeIndexName){.tindex = 377, .tname = _SLIT("v.ast.IdentFn")} + , (VCastTypeIndexName){.tindex = 378, .tname = _SLIT("v.ast.IdentVar")} + , (VCastTypeIndexName){.tindex = 246, .tname = _SLIT("v.ast.AnonFn")} + , (VCastTypeIndexName){.tindex = 247, .tname = _SLIT("v.ast.ArrayDecompose")} + , (VCastTypeIndexName){.tindex = 248, .tname = _SLIT("v.ast.ArrayInit")} + , (VCastTypeIndexName){.tindex = 249, .tname = _SLIT("v.ast.AsCast")} + , (VCastTypeIndexName){.tindex = 250, .tname = _SLIT("v.ast.Assoc")} + , (VCastTypeIndexName){.tindex = 251, .tname = _SLIT("v.ast.AtExpr")} + , (VCastTypeIndexName){.tindex = 252, .tname = _SLIT("v.ast.BoolLiteral")} + , (VCastTypeIndexName){.tindex = 253, .tname = _SLIT("v.ast.CTempVar")} + , (VCastTypeIndexName){.tindex = 254, .tname = _SLIT("v.ast.CallExpr")} + , (VCastTypeIndexName){.tindex = 255, .tname = _SLIT("v.ast.CastExpr")} + , (VCastTypeIndexName){.tindex = 256, .tname = _SLIT("v.ast.ChanInit")} + , (VCastTypeIndexName){.tindex = 257, .tname = _SLIT("v.ast.CharLiteral")} + , (VCastTypeIndexName){.tindex = 258, .tname = _SLIT("v.ast.Comment")} + , (VCastTypeIndexName){.tindex = 259, .tname = _SLIT("v.ast.ComptimeCall")} + , (VCastTypeIndexName){.tindex = 260, .tname = _SLIT("v.ast.ComptimeSelector")} + , (VCastTypeIndexName){.tindex = 261, .tname = _SLIT("v.ast.ComptimeType")} + , (VCastTypeIndexName){.tindex = 262, .tname = _SLIT("v.ast.ConcatExpr")} + , (VCastTypeIndexName){.tindex = 263, .tname = _SLIT("v.ast.DumpExpr")} + , (VCastTypeIndexName){.tindex = 264, .tname = _SLIT("v.ast.EmptyExpr")} + , (VCastTypeIndexName){.tindex = 265, .tname = _SLIT("v.ast.EnumVal")} + , (VCastTypeIndexName){.tindex = 266, .tname = _SLIT("v.ast.FloatLiteral")} + , (VCastTypeIndexName){.tindex = 267, .tname = _SLIT("v.ast.GoExpr")} + , (VCastTypeIndexName){.tindex = 268, .tname = _SLIT("v.ast.Ident")} + , (VCastTypeIndexName){.tindex = 269, .tname = _SLIT("v.ast.IfExpr")} + , (VCastTypeIndexName){.tindex = 270, .tname = _SLIT("v.ast.IfGuardExpr")} + , (VCastTypeIndexName){.tindex = 271, .tname = _SLIT("v.ast.IndexExpr")} + , (VCastTypeIndexName){.tindex = 272, .tname = _SLIT("v.ast.InfixExpr")} + , (VCastTypeIndexName){.tindex = 273, .tname = _SLIT("v.ast.IntegerLiteral")} + , (VCastTypeIndexName){.tindex = 274, .tname = _SLIT("v.ast.IsRefType")} + , (VCastTypeIndexName){.tindex = 275, .tname = _SLIT("v.ast.Likely")} + , (VCastTypeIndexName){.tindex = 276, .tname = _SLIT("v.ast.LockExpr")} + , (VCastTypeIndexName){.tindex = 277, .tname = _SLIT("v.ast.MapInit")} + , (VCastTypeIndexName){.tindex = 278, .tname = _SLIT("v.ast.MatchExpr")} + , (VCastTypeIndexName){.tindex = 279, .tname = _SLIT("v.ast.NodeError")} + , (VCastTypeIndexName){.tindex = 280, .tname = _SLIT("v.ast.None")} + , (VCastTypeIndexName){.tindex = 281, .tname = _SLIT("v.ast.OffsetOf")} + , (VCastTypeIndexName){.tindex = 282, .tname = _SLIT("v.ast.OrExpr")} + , (VCastTypeIndexName){.tindex = 283, .tname = _SLIT("v.ast.ParExpr")} + , (VCastTypeIndexName){.tindex = 284, .tname = _SLIT("v.ast.PostfixExpr")} + , (VCastTypeIndexName){.tindex = 285, .tname = _SLIT("v.ast.PrefixExpr")} + , (VCastTypeIndexName){.tindex = 286, .tname = _SLIT("v.ast.RangeExpr")} + , (VCastTypeIndexName){.tindex = 287, .tname = _SLIT("v.ast.SelectExpr")} + , (VCastTypeIndexName){.tindex = 288, .tname = _SLIT("v.ast.SelectorExpr")} + , (VCastTypeIndexName){.tindex = 289, .tname = _SLIT("v.ast.SizeOf")} + , (VCastTypeIndexName){.tindex = 290, .tname = _SLIT("v.ast.SqlExpr")} + , (VCastTypeIndexName){.tindex = 291, .tname = _SLIT("v.ast.StringInterLiteral")} + , (VCastTypeIndexName){.tindex = 292, .tname = _SLIT("v.ast.StringLiteral")} + , (VCastTypeIndexName){.tindex = 293, .tname = _SLIT("v.ast.StructInit")} + , (VCastTypeIndexName){.tindex = 294, .tname = _SLIT("v.ast.TypeNode")} + , (VCastTypeIndexName){.tindex = 295, .tname = _SLIT("v.ast.TypeOf")} + , (VCastTypeIndexName){.tindex = 296, .tname = _SLIT("v.ast.UnsafeExpr")} + , (VCastTypeIndexName){.tindex = 323, .tname = _SLIT("v.ast.AsmRegister")} + , (VCastTypeIndexName){.tindex = 324, .tname = _SLIT("v.ast.ConstField")} + , (VCastTypeIndexName){.tindex = 325, .tname = _SLIT("v.ast.GlobalField")} + , (VCastTypeIndexName){.tindex = 326, .tname = _SLIT("v.ast.Var")} + , (VCastTypeIndexName){.tindex = 298, .tname = _SLIT("v.ast.AsmStmt")} + , (VCastTypeIndexName){.tindex = 299, .tname = _SLIT("v.ast.AssertStmt")} + , (VCastTypeIndexName){.tindex = 300, .tname = _SLIT("v.ast.AssignStmt")} + , (VCastTypeIndexName){.tindex = 301, .tname = _SLIT("v.ast.Block")} + , (VCastTypeIndexName){.tindex = 302, .tname = _SLIT("v.ast.BranchStmt")} + , (VCastTypeIndexName){.tindex = 303, .tname = _SLIT("v.ast.ComptimeFor")} + , (VCastTypeIndexName){.tindex = 304, .tname = _SLIT("v.ast.ConstDecl")} + , (VCastTypeIndexName){.tindex = 305, .tname = _SLIT("v.ast.DeferStmt")} + , (VCastTypeIndexName){.tindex = 306, .tname = _SLIT("v.ast.EmptyStmt")} + , (VCastTypeIndexName){.tindex = 307, .tname = _SLIT("v.ast.EnumDecl")} + , (VCastTypeIndexName){.tindex = 308, .tname = _SLIT("v.ast.ExprStmt")} + , (VCastTypeIndexName){.tindex = 185, .tname = _SLIT("v.ast.FnDecl")} + , (VCastTypeIndexName){.tindex = 309, .tname = _SLIT("v.ast.ForCStmt")} + , (VCastTypeIndexName){.tindex = 310, .tname = _SLIT("v.ast.ForInStmt")} + , (VCastTypeIndexName){.tindex = 311, .tname = _SLIT("v.ast.ForStmt")} + , (VCastTypeIndexName){.tindex = 312, .tname = _SLIT("v.ast.GlobalDecl")} + , (VCastTypeIndexName){.tindex = 313, .tname = _SLIT("v.ast.GotoLabel")} + , (VCastTypeIndexName){.tindex = 314, .tname = _SLIT("v.ast.GotoStmt")} + , (VCastTypeIndexName){.tindex = 315, .tname = _SLIT("v.ast.HashStmt")} + , (VCastTypeIndexName){.tindex = 316, .tname = _SLIT("v.ast.Import")} + , (VCastTypeIndexName){.tindex = 317, .tname = _SLIT("v.ast.InterfaceDecl")} + , (VCastTypeIndexName){.tindex = 318, .tname = _SLIT("v.ast.Module")} + , (VCastTypeIndexName){.tindex = 319, .tname = _SLIT("v.ast.Return")} + , (VCastTypeIndexName){.tindex = 320, .tname = _SLIT("v.ast.SqlStmt")} + , (VCastTypeIndexName){.tindex = 321, .tname = _SLIT("v.ast.StructDecl")} + , (VCastTypeIndexName){.tindex = 245, .tname = _SLIT("v.ast.TypeDecl")} + , (VCastTypeIndexName){.tindex = 398, .tname = _SLIT("v.ast.AsmAddressing")} + , (VCastTypeIndexName){.tindex = 399, .tname = _SLIT("v.ast.AsmAlias")} + , (VCastTypeIndexName){.tindex = 400, .tname = _SLIT("v.ast.AsmDisp")} , (VCastTypeIndexName){.tindex = 20, .tname = _SLIT("string")} })); @@ -99291,9 +99400,9 @@ void _vinit(int ___argc, voidptr ___argv) { _const_v__util__builtin_module_parts = new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("math.bits"), _SLIT("strconv"), _SLIT("dlmalloc"), _SLIT("strconv.ftoa"), _SLIT("strings"), _SLIT("builtin")})); _const_v__util__bundle_modules = new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){_SLIT("clipboard"), _SLIT("fontstash"), _SLIT("gg"), _SLIT("gx"), _SLIT("sokol"), _SLIT("szip"), _SLIT("ui")})); _const_v__util__external_module_dependencies_for_tool = new_map_init(&map_hash_string, &map_eq_string, &map_clone_string, &map_free_string, 1, sizeof(string), sizeof(Array_string), _MOV((string[1]){_SLIT("vdoc"), }), _MOV((Array_string[1]){new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("markdown")})), })); - _const_v__util__const_tabs = new_array_from_c_array(10, 10, sizeof(string), _MOV((string[10]){ + _const_v__util__const_tabs = new_array_from_c_array(11, 11, sizeof(string), _MOV((string[11]){ _SLIT(""), _SLIT("\t"), _SLIT("\t\t"), _SLIT("\t\t\t"), _SLIT("\t\t\t\t"), _SLIT("\t\t\t\t\t"), _SLIT("\t\t\t\t\t\t"), _SLIT("\t\t\t\t\t\t\t"), _SLIT("\t\t\t\t\t\t\t\t"), - _SLIT("\t\t\t\t\t\t\t\t\t")})); + _SLIT("\t\t\t\t\t\t\t\t\t"), _SLIT("\t\t\t\t\t\t\t\t\t\t")})); _const_v__util__builtin_module_names = new_array_from_c_array(5, 5, sizeof(string), _MOV((string[5]){_SLIT("builtin"), _SLIT("strconv"), _SLIT("strings"), _SLIT("dlmalloc"), _SLIT("math")})); lines_cache = ((v__util__LinesCache*)memdup(&(v__util__LinesCache){.lines = new_map(sizeof(string), sizeof(Array_string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}, sizeof(v__util__LinesCache))); // 3global g_timers = v__util__new_timers(((v__util__TimerParams){.should_print = false,.label = _SLIT("g_timers"),})); // 3global @@ -99424,7 +99533,7 @@ 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(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__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"), string_clone(_const_v__gen__c__option_name), 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 #if defined(__MINGW32__) || defined(__MINGW64__)\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 #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 #if defined(__MINGW32__) || defined(__MINGW64__)\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")})); diff --git a/v_win.c b/v_win.c index f6bdf9e..f67a4ce 100644 --- a/v_win.c +++ b/v_win.c @@ -1,11 +1,11 @@ -#define V_COMMIT_HASH "3afb88c4e" +#define V_COMMIT_HASH "0bd8d872d" #ifndef V_COMMIT_HASH - #define V_COMMIT_HASH "c405c1916" + #define V_COMMIT_HASH "3afb88c4e" #endif #ifndef V_CURRENT_COMMIT_HASH - #define V_CURRENT_COMMIT_HASH "3afb88c" + #define V_CURRENT_COMMIT_HASH "0bd8d87" #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 _option _option; typedef struct _result _result; typedef struct VMemoryBlock VMemoryBlock; typedef struct SortedMap SortedMap; @@ -352,71 +353,71 @@ typedef struct v__builder__MsvcResult v__builder__MsvcResult; typedef struct v__builder__WindowsKit v__builder__WindowsKit; typedef struct v__builder__VsInstallation v__builder__VsInstallation; typedef struct v__builder__MsvcStringFlags v__builder__MsvcStringFlags; -typedef struct Option_int Option_int; -typedef struct Option_f64 Option_f64; -typedef struct Option_u64 Option_u64; -typedef struct Option_i64 Option_i64; -typedef struct Option_rune Option_rune; -typedef struct Option_string Option_string; -typedef struct Option_u8 Option_u8; -typedef struct Option_voidptr Option_voidptr; -typedef struct Option_v__token__Kind Option_v__token__Kind; -typedef struct Option_bool Option_bool; -typedef struct Option_void Option_void; -typedef struct Option_flag__Flag Option_flag__Flag; -typedef struct Option_Array_string Option_Array_string; -typedef struct Option_semver__Range Option_semver__Range; -typedef struct Option_semver__Version Option_semver__Version; -typedef struct Option_semver__ComparatorSet Option_semver__ComparatorSet; -typedef struct Option_semver__Comparator Option_semver__Comparator; -typedef struct Option_os__File Option_os__File; -typedef struct Option_FILE_ptr Option_FILE_ptr; -typedef struct Option_Array_u8 Option_Array_u8; -typedef struct Option_os__SignalHandler Option_os__SignalHandler; -typedef struct Option_term__Coord Option_term__Coord; -typedef struct Option_time__Time Option_time__Time; -typedef struct Option_multi_return_int_int_int Option_multi_return_int_int_int; -typedef struct Option_multi_return_int_int_int_int_i64_bool Option_multi_return_int_int_int_int_i64_bool; -typedef struct Option_v__vmod__Manifest Option_v__vmod__Manifest; -typedef struct Option_multi_return_Array_string_int Option_multi_return_Array_string_int; -typedef struct Option_v__pkgconfig__PkgConfig_ptr Option_v__pkgconfig__PkgConfig_ptr; -typedef struct Option_v__pkgconfig__Main_ptr Option_v__pkgconfig__Main_ptr; -typedef struct Option_u32 Option_u32; -typedef struct Option_f32 Option_f32; -typedef struct Option_v__pref__OS Option_v__pref__OS; -typedef struct Option_v__pref__Arch Option_v__pref__Arch; -typedef struct Option_v__pref__Backend Option_v__pref__Backend; -typedef struct Option_time__StopWatch Option_time__StopWatch; -typedef struct Option_v__ast__Ident Option_v__ast__Ident; -typedef struct Option_i8 Option_i8; -typedef struct Option_i16 Option_i16; -typedef struct Option_u16 Option_u16; -typedef struct Option_v__ast__ComptTimeConstValue Option_v__ast__ComptTimeConstValue; -typedef struct Option_v__ast__ScopeObject Option_v__ast__ScopeObject; -typedef struct Option_v__ast__ScopeStructField Option_v__ast__ScopeStructField; -typedef struct Option_v__ast__Var_ptr Option_v__ast__Var_ptr; -typedef struct Option_v__ast__GlobalField_ptr Option_v__ast__GlobalField_ptr; -typedef struct Option_v__ast__ConstField_ptr Option_v__ast__ConstField_ptr; -typedef struct Option_v__ast__Fn Option_v__ast__Fn; -typedef struct Option_multi_return_v__ast__Fn_Array_v__ast__Type Option_multi_return_v__ast__Fn_Array_v__ast__Type; -typedef struct Option_v__ast__StructField Option_v__ast__StructField; -typedef struct Option_multi_return_v__ast__StructField_Array_v__ast__Type Option_multi_return_v__ast__StructField_Array_v__ast__Type; -typedef struct Option_v__ast__TypeSymbol_ptr Option_v__ast__TypeSymbol_ptr; -typedef struct Option_Array_Array_v__ast__Type Option_Array_Array_v__ast__Type; -typedef struct Option_v__ast__Type Option_v__ast__Type; -typedef struct Option_v__ast__InterfaceDecl Option_v__ast__InterfaceDecl; -typedef struct Option_v__ast__EnumDecl Option_v__ast__EnumDecl; -typedef struct Option_v__ast__Expr Option_v__ast__Expr; -typedef struct Option_v__ast__Param Option_v__ast__Param; -typedef struct Option_Array_v__ast__Type Option_Array_v__ast__Type; -typedef struct Option_v__ast__ConstField Option_v__ast__ConstField; -typedef struct Option_v__ast__GlobalField Option_v__ast__GlobalField; -typedef struct Option_v__ast__FnDecl Option_v__ast__FnDecl; -typedef struct Option_v__ast__Stmt_ptr Option_v__ast__Stmt_ptr; -typedef struct Option_v__scanner__Scanner_ptr Option_v__scanner__Scanner_ptr; -typedef struct Option_v__builder__MsvcResult Option_v__builder__MsvcResult; -typedef struct Option_v__builder__WindowsKit Option_v__builder__WindowsKit; -typedef struct Option_v__builder__VsInstallation Option_v__builder__VsInstallation; +typedef struct _option_int _option_int; +typedef struct _option_f64 _option_f64; +typedef struct _option_u64 _option_u64; +typedef struct _option_i64 _option_i64; +typedef struct _option_rune _option_rune; +typedef struct _option_string _option_string; +typedef struct _option_u8 _option_u8; +typedef struct _option_voidptr _option_voidptr; +typedef struct _option_v__token__Kind _option_v__token__Kind; +typedef struct _option_bool _option_bool; +typedef struct _option_void _option_void; +typedef struct _option_flag__Flag _option_flag__Flag; +typedef struct _option_Array_string _option_Array_string; +typedef struct _option_semver__Range _option_semver__Range; +typedef struct _option_semver__Version _option_semver__Version; +typedef struct _option_semver__ComparatorSet _option_semver__ComparatorSet; +typedef struct _option_semver__Comparator _option_semver__Comparator; +typedef struct _option_os__File _option_os__File; +typedef struct _option_FILE_ptr _option_FILE_ptr; +typedef struct _option_Array_u8 _option_Array_u8; +typedef struct _option_os__SignalHandler _option_os__SignalHandler; +typedef struct _option_term__Coord _option_term__Coord; +typedef struct _option_time__Time _option_time__Time; +typedef struct _option_multi_return_int_int_int _option_multi_return_int_int_int; +typedef struct _option_multi_return_int_int_int_int_i64_bool _option_multi_return_int_int_int_int_i64_bool; +typedef struct _option_v__vmod__Manifest _option_v__vmod__Manifest; +typedef struct _option_multi_return_Array_string_int _option_multi_return_Array_string_int; +typedef struct _option_v__pkgconfig__PkgConfig_ptr _option_v__pkgconfig__PkgConfig_ptr; +typedef struct _option_v__pkgconfig__Main_ptr _option_v__pkgconfig__Main_ptr; +typedef struct _option_u32 _option_u32; +typedef struct _option_f32 _option_f32; +typedef struct _option_v__pref__OS _option_v__pref__OS; +typedef struct _option_v__pref__Arch _option_v__pref__Arch; +typedef struct _option_v__pref__Backend _option_v__pref__Backend; +typedef struct _option_time__StopWatch _option_time__StopWatch; +typedef struct _option_v__ast__Ident _option_v__ast__Ident; +typedef struct _option_i8 _option_i8; +typedef struct _option_i16 _option_i16; +typedef struct _option_u16 _option_u16; +typedef struct _option_v__ast__ComptTimeConstValue _option_v__ast__ComptTimeConstValue; +typedef struct _option_v__ast__ScopeObject _option_v__ast__ScopeObject; +typedef struct _option_v__ast__ScopeStructField _option_v__ast__ScopeStructField; +typedef struct _option_v__ast__Var_ptr _option_v__ast__Var_ptr; +typedef struct _option_v__ast__GlobalField_ptr _option_v__ast__GlobalField_ptr; +typedef struct _option_v__ast__ConstField_ptr _option_v__ast__ConstField_ptr; +typedef struct _option_v__ast__Fn _option_v__ast__Fn; +typedef struct _option_multi_return_v__ast__Fn_Array_v__ast__Type _option_multi_return_v__ast__Fn_Array_v__ast__Type; +typedef struct _option_v__ast__StructField _option_v__ast__StructField; +typedef struct _option_multi_return_v__ast__StructField_Array_v__ast__Type _option_multi_return_v__ast__StructField_Array_v__ast__Type; +typedef struct _option_v__ast__TypeSymbol_ptr _option_v__ast__TypeSymbol_ptr; +typedef struct _option_Array_Array_v__ast__Type _option_Array_Array_v__ast__Type; +typedef struct _option_v__ast__Type _option_v__ast__Type; +typedef struct _option_v__ast__InterfaceDecl _option_v__ast__InterfaceDecl; +typedef struct _option_v__ast__EnumDecl _option_v__ast__EnumDecl; +typedef struct _option_v__ast__Expr _option_v__ast__Expr; +typedef struct _option_v__ast__Param _option_v__ast__Param; +typedef struct _option_Array_v__ast__Type _option_Array_v__ast__Type; +typedef struct _option_v__ast__ConstField _option_v__ast__ConstField; +typedef struct _option_v__ast__GlobalField _option_v__ast__GlobalField; +typedef struct _option_v__ast__FnDecl _option_v__ast__FnDecl; +typedef struct _option_v__ast__Stmt_ptr _option_v__ast__Stmt_ptr; +typedef struct _option_v__scanner__Scanner_ptr _option_v__scanner__Scanner_ptr; +typedef struct _option_v__builder__MsvcResult _option_v__builder__MsvcResult; +typedef struct _option_v__builder__WindowsKit _option_v__builder__WindowsKit; +typedef struct _option_v__builder__VsInstallation _option_v__builder__VsInstallation; typedef struct __shared__Array_string __shared__Array_string; typedef struct __shared__Map_string_bool __shared__Map_string_bool; @@ -2275,8 +2276,8 @@ struct DenseArray { int len; u32 deletes; u8* all_deleted; - u8* values; u8* keys; + u8* values; }; @@ -2306,7 +2307,7 @@ struct Error { -struct Option { +struct _option { u8 state; IError err; }; @@ -2643,9 +2644,9 @@ struct v__vmod__ModFileAndFolder { // Union sum type v__ast__TypeDecl = -// | 280 = v__ast__AliasTypeDecl -// | 281 = v__ast__FnTypeDecl -// | 282 = v__ast__SumTypeDecl +// | 281 = v__ast__AliasTypeDecl +// | 282 = v__ast__FnTypeDecl +// | 283 = v__ast__SumTypeDecl struct v__ast__TypeDecl { union { v__ast__AliasTypeDecl* _v__ast__AliasTypeDecl; @@ -2661,57 +2662,57 @@ struct v__ast__TypeDecl { // Union sum type v__ast__Expr = -// | 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 +// | 285 = v__ast__AnonFn +// | 286 = v__ast__ArrayDecompose +// | 287 = v__ast__ArrayInit +// | 288 = v__ast__AsCast +// | 289 = v__ast__Assoc +// | 290 = v__ast__AtExpr +// | 291 = v__ast__BoolLiteral +// | 292 = v__ast__CTempVar +// | 293 = v__ast__CallExpr +// | 294 = v__ast__CastExpr +// | 295 = v__ast__ChanInit +// | 296 = v__ast__CharLiteral +// | 297 = v__ast__Comment +// | 298 = v__ast__ComptimeCall +// | 299 = v__ast__ComptimeSelector +// | 300 = v__ast__ComptimeType +// | 301 = v__ast__ConcatExpr +// | 302 = v__ast__DumpExpr +// | 303 = v__ast__EmptyExpr +// | 304 = v__ast__EnumVal +// | 305 = v__ast__FloatLiteral +// | 306 = v__ast__GoExpr +// | 307 = v__ast__Ident +// | 308 = v__ast__IfExpr +// | 309 = v__ast__IfGuardExpr +// | 310 = v__ast__IndexExpr +// | 311 = v__ast__InfixExpr +// | 312 = v__ast__IntegerLiteral +// | 313 = v__ast__IsRefType +// | 314 = v__ast__Likely +// | 315 = v__ast__LockExpr +// | 316 = v__ast__MapInit +// | 317 = v__ast__MatchExpr +// | 318 = v__ast__NodeError +// | 319 = v__ast__None +// | 320 = v__ast__OffsetOf +// | 321 = v__ast__OrExpr +// | 322 = v__ast__ParExpr +// | 323 = v__ast__PostfixExpr +// | 324 = v__ast__PrefixExpr +// | 325 = v__ast__RangeExpr +// | 326 = v__ast__SelectExpr +// | 327 = v__ast__SelectorExpr +// | 328 = v__ast__SizeOf +// | 329 = v__ast__SqlExpr +// | 330 = v__ast__StringInterLiteral +// | 331 = v__ast__StringLiteral +// | 332 = v__ast__StructInit +// | 333 = v__ast__TypeNode +// | 334 = v__ast__TypeOf +// | 335 = v__ast__UnsafeExpr struct v__ast__Expr { union { v__ast__AnonFn* _v__ast__AnonFn; @@ -2771,33 +2772,33 @@ struct v__ast__Expr { // Union sum type v__ast__Stmt = -// | 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 +// | 337 = v__ast__AsmStmt +// | 338 = v__ast__AssertStmt +// | 339 = v__ast__AssignStmt +// | 340 = v__ast__Block +// | 341 = v__ast__BranchStmt +// | 342 = v__ast__ComptimeFor +// | 343 = v__ast__ConstDecl +// | 344 = v__ast__DeferStmt +// | 345 = v__ast__EmptyStmt +// | 346 = v__ast__EnumDecl +// | 347 = v__ast__ExprStmt +// | 220 = v__ast__FnDecl +// | 348 = v__ast__ForCStmt +// | 349 = v__ast__ForInStmt +// | 350 = v__ast__ForStmt +// | 351 = v__ast__GlobalDecl +// | 352 = v__ast__GotoLabel +// | 353 = v__ast__GotoStmt +// | 354 = v__ast__HashStmt +// | 355 = v__ast__Import +// | 356 = v__ast__InterfaceDecl +// | 357 = v__ast__Module +// | 318 = v__ast__NodeError +// | 358 = v__ast__Return +// | 359 = v__ast__SqlStmt +// | 360 = v__ast__StructDecl +// | 284 = v__ast__TypeDecl struct v__ast__Stmt { union { v__ast__AsmStmt* _v__ast__AsmStmt; @@ -2834,10 +2835,10 @@ struct v__ast__Stmt { // Union sum type v__ast__ScopeObject = -// | 361 = v__ast__AsmRegister -// | 362 = v__ast__ConstField -// | 363 = v__ast__GlobalField -// | 364 = v__ast__Var +// | 362 = v__ast__AsmRegister +// | 363 = v__ast__ConstField +// | 364 = v__ast__GlobalField +// | 365 = v__ast__Var struct v__ast__ScopeObject { union { v__ast__AsmRegister* _v__ast__AsmRegister; @@ -2852,22 +2853,22 @@ struct v__ast__ScopeObject { // Union sum type v__ast__Node = -// | 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 +// | 367 = v__ast__CallArg +// | 363 = v__ast__ConstField +// | 368 = v__ast__EmptyNode +// | 369 = v__ast__EnumField +// | 336 = v__ast__Expr +// | 211 = v__ast__File +// | 364 = v__ast__GlobalField +// | 370 = v__ast__IfBranch +// | 371 = v__ast__MatchBranch +// | 318 = v__ast__NodeError +// | 372 = v__ast__Param +// | 366 = v__ast__ScopeObject +// | 373 = v__ast__SelectBranch +// | 361 = v__ast__Stmt +// | 374 = v__ast__StructField +// | 375 = v__ast__StructInitField struct v__ast__Node { union { v__ast__CallArg* _v__ast__CallArg; @@ -2892,7 +2893,7 @@ struct v__ast__Node { // Union sum type v__ast__ComptTimeConstValue = -// | 302 = v__ast__EmptyExpr +// | 303 = v__ast__EmptyExpr // | 15 = f32 // | 16 = f64 // | 6 = i16 @@ -2926,8 +2927,8 @@ struct v__ast__ComptTimeConstValue { // Union sum type v__ast__IdentInfo = -// | 415 = v__ast__IdentFn -// | 416 = v__ast__IdentVar +// | 416 = v__ast__IdentFn +// | 417 = v__ast__IdentVar struct v__ast__IdentInfo { union { v__ast__IdentFn* _v__ast__IdentFn; @@ -2938,14 +2939,14 @@ struct v__ast__IdentInfo { // Union sum type v__ast__AsmArg = -// | 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 +// | 437 = v__ast__AsmAddressing +// | 438 = v__ast__AsmAlias +// | 439 = v__ast__AsmDisp +// | 362 = v__ast__AsmRegister +// | 291 = v__ast__BoolLiteral +// | 296 = v__ast__CharLiteral +// | 305 = v__ast__FloatLiteral +// | 312 = v__ast__IntegerLiteral // | 20 = string struct v__ast__AsmArg { union { @@ -2964,20 +2965,20 @@ struct v__ast__AsmArg { // Union sum type v__ast__TypeInfo = -// | 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 +// | 470 = v__ast__Aggregate +// | 472 = v__ast__Alias +// | 452 = v__ast__Array +// | 480 = v__ast__ArrayFixed +// | 481 = v__ast__Chan +// | 486 = v__ast__Enum +// | 484 = v__ast__FnType +// | 485 = v__ast__GenericInst +// | 475 = v__ast__Interface +// | 453 = v__ast__Map +// | 483 = v__ast__MultiReturn +// | 457 = v__ast__Struct +// | 476 = v__ast__SumType +// | 482 = v__ast__Thread struct v__ast__TypeInfo { union { v__ast__Aggregate* _v__ast__Aggregate; @@ -3140,6 +3141,13 @@ struct MessageError { +struct Option { + u8 state; + IError err; +}; + + + struct VMemoryBlock { int id; isize cap; @@ -6455,391 +6463,391 @@ struct __shared__Map_string_bool { }; // V Option_xxx definitions: -struct Option_int { +struct _option_int { byte state; IError err; byte data[sizeof(int) > 0 ? sizeof(int) : 1]; }; -struct Option_f64 { +struct _option_f64 { byte state; IError err; byte data[sizeof(f64) > 0 ? sizeof(f64) : 1]; }; -struct Option_u64 { +struct _option_u64 { byte state; IError err; byte data[sizeof(u64) > 0 ? sizeof(u64) : 1]; }; -struct Option_i64 { +struct _option_i64 { byte state; IError err; byte data[sizeof(i64) > 0 ? sizeof(i64) : 1]; }; -struct Option_rune { +struct _option_rune { byte state; IError err; byte data[sizeof(rune) > 0 ? sizeof(rune) : 1]; }; -struct Option_string { +struct _option_string { byte state; IError err; byte data[sizeof(string) > 0 ? sizeof(string) : 1]; }; -struct Option_u8 { +struct _option_u8 { byte state; IError err; byte data[sizeof(u8) > 0 ? sizeof(u8) : 1]; }; -struct Option_voidptr { +struct _option_voidptr { byte state; IError err; byte data[sizeof(voidptr) > 0 ? sizeof(voidptr) : 1]; }; -struct Option_v__token__Kind { +struct _option_v__token__Kind { byte state; IError err; byte data[sizeof(v__token__Kind) > 0 ? sizeof(v__token__Kind) : 1]; }; -struct Option_bool { +struct _option_bool { byte state; IError err; byte data[sizeof(bool) > 0 ? sizeof(bool) : 1]; }; -struct Option_void { +struct _option_void { byte state; IError err; byte data[sizeof(u8) > 0 ? sizeof(u8) : 1]; }; -struct Option_flag__Flag { +struct _option_flag__Flag { byte state; IError err; byte data[sizeof(flag__Flag) > 0 ? sizeof(flag__Flag) : 1]; }; -struct Option_Array_string { +struct _option_Array_string { byte state; IError err; byte data[sizeof(Array_string) > 0 ? sizeof(Array_string) : 1]; }; -struct Option_semver__Range { +struct _option_semver__Range { byte state; IError err; byte data[sizeof(semver__Range) > 0 ? sizeof(semver__Range) : 1]; }; -struct Option_semver__Version { +struct _option_semver__Version { byte state; IError err; byte data[sizeof(semver__Version) > 0 ? sizeof(semver__Version) : 1]; }; -struct Option_semver__ComparatorSet { +struct _option_semver__ComparatorSet { byte state; IError err; byte data[sizeof(semver__ComparatorSet) > 0 ? sizeof(semver__ComparatorSet) : 1]; }; -struct Option_semver__Comparator { +struct _option_semver__Comparator { byte state; IError err; byte data[sizeof(semver__Comparator) > 0 ? sizeof(semver__Comparator) : 1]; }; -struct Option_os__File { +struct _option_os__File { byte state; IError err; byte data[sizeof(os__File) > 0 ? sizeof(os__File) : 1]; }; -struct Option_FILE_ptr { +struct _option_FILE_ptr { byte state; IError err; byte data[sizeof(FILE*) > 0 ? sizeof(FILE*) : 1]; }; -struct Option_Array_u8 { +struct _option_Array_u8 { byte state; IError err; byte data[sizeof(Array_u8) > 0 ? sizeof(Array_u8) : 1]; }; -struct Option_os__SignalHandler { +struct _option_os__SignalHandler { byte state; IError err; byte data[sizeof(os__SignalHandler) > 0 ? sizeof(os__SignalHandler) : 1]; }; -struct Option_term__Coord { +struct _option_term__Coord { byte state; IError err; byte data[sizeof(term__Coord) > 0 ? sizeof(term__Coord) : 1]; }; -struct Option_time__Time { +struct _option_time__Time { byte state; IError err; byte data[sizeof(time__Time) > 0 ? sizeof(time__Time) : 1]; }; -struct Option_multi_return_int_int_int { +struct _option_multi_return_int_int_int { byte state; IError err; byte data[sizeof(multi_return_int_int_int) > 0 ? sizeof(multi_return_int_int_int) : 1]; }; -struct Option_multi_return_int_int_int_int_i64_bool { +struct _option_multi_return_int_int_int_int_i64_bool { byte state; IError err; byte data[sizeof(multi_return_int_int_int_int_i64_bool) > 0 ? sizeof(multi_return_int_int_int_int_i64_bool) : 1]; }; -struct Option_v__vmod__Manifest { +struct _option_v__vmod__Manifest { byte state; IError err; byte data[sizeof(v__vmod__Manifest) > 0 ? sizeof(v__vmod__Manifest) : 1]; }; -struct Option_multi_return_Array_string_int { +struct _option_multi_return_Array_string_int { byte state; IError err; byte data[sizeof(multi_return_Array_string_int) > 0 ? sizeof(multi_return_Array_string_int) : 1]; }; -struct Option_v__pkgconfig__PkgConfig_ptr { +struct _option_v__pkgconfig__PkgConfig_ptr { byte state; IError err; byte data[sizeof(v__pkgconfig__PkgConfig*) > 0 ? sizeof(v__pkgconfig__PkgConfig*) : 1]; }; -struct Option_v__pkgconfig__Main_ptr { +struct _option_v__pkgconfig__Main_ptr { byte state; IError err; byte data[sizeof(v__pkgconfig__Main*) > 0 ? sizeof(v__pkgconfig__Main*) : 1]; }; -struct Option_u32 { +struct _option_u32 { byte state; IError err; byte data[sizeof(u32) > 0 ? sizeof(u32) : 1]; }; -struct Option_f32 { +struct _option_f32 { byte state; IError err; byte data[sizeof(f32) > 0 ? sizeof(f32) : 1]; }; -struct Option_v__pref__OS { +struct _option_v__pref__OS { byte state; IError err; byte data[sizeof(v__pref__OS) > 0 ? sizeof(v__pref__OS) : 1]; }; -struct Option_v__pref__Arch { +struct _option_v__pref__Arch { byte state; IError err; byte data[sizeof(v__pref__Arch) > 0 ? sizeof(v__pref__Arch) : 1]; }; -struct Option_v__pref__Backend { +struct _option_v__pref__Backend { byte state; IError err; byte data[sizeof(v__pref__Backend) > 0 ? sizeof(v__pref__Backend) : 1]; }; -struct Option_time__StopWatch { +struct _option_time__StopWatch { byte state; IError err; byte data[sizeof(time__StopWatch) > 0 ? sizeof(time__StopWatch) : 1]; }; -struct Option_v__ast__Ident { +struct _option_v__ast__Ident { byte state; IError err; byte data[sizeof(v__ast__Ident) > 0 ? sizeof(v__ast__Ident) : 1]; }; -struct Option_i8 { +struct _option_i8 { byte state; IError err; byte data[sizeof(i8) > 0 ? sizeof(i8) : 1]; }; -struct Option_i16 { +struct _option_i16 { byte state; IError err; byte data[sizeof(i16) > 0 ? sizeof(i16) : 1]; }; -struct Option_u16 { +struct _option_u16 { byte state; IError err; byte data[sizeof(u16) > 0 ? sizeof(u16) : 1]; }; -struct Option_v__ast__ComptTimeConstValue { +struct _option_v__ast__ComptTimeConstValue { byte state; IError err; byte data[sizeof(v__ast__ComptTimeConstValue) > 0 ? sizeof(v__ast__ComptTimeConstValue) : 1]; }; -struct Option_v__ast__ScopeObject { +struct _option_v__ast__ScopeObject { byte state; IError err; byte data[sizeof(v__ast__ScopeObject) > 0 ? sizeof(v__ast__ScopeObject) : 1]; }; -struct Option_v__ast__ScopeStructField { +struct _option_v__ast__ScopeStructField { byte state; IError err; byte data[sizeof(v__ast__ScopeStructField) > 0 ? sizeof(v__ast__ScopeStructField) : 1]; }; -struct Option_v__ast__Var_ptr { +struct _option_v__ast__Var_ptr { byte state; IError err; byte data[sizeof(v__ast__Var*) > 0 ? sizeof(v__ast__Var*) : 1]; }; -struct Option_v__ast__GlobalField_ptr { +struct _option_v__ast__GlobalField_ptr { byte state; IError err; byte data[sizeof(v__ast__GlobalField*) > 0 ? sizeof(v__ast__GlobalField*) : 1]; }; -struct Option_v__ast__ConstField_ptr { +struct _option_v__ast__ConstField_ptr { byte state; IError err; byte data[sizeof(v__ast__ConstField*) > 0 ? sizeof(v__ast__ConstField*) : 1]; }; -struct Option_v__ast__Fn { +struct _option_v__ast__Fn { byte state; IError err; byte data[sizeof(v__ast__Fn) > 0 ? sizeof(v__ast__Fn) : 1]; }; -struct Option_multi_return_v__ast__Fn_Array_v__ast__Type { +struct _option_multi_return_v__ast__Fn_Array_v__ast__Type { byte state; IError err; byte data[sizeof(multi_return_v__ast__Fn_Array_v__ast__Type) > 0 ? sizeof(multi_return_v__ast__Fn_Array_v__ast__Type) : 1]; }; -struct Option_v__ast__StructField { +struct _option_v__ast__StructField { byte state; IError err; byte data[sizeof(v__ast__StructField) > 0 ? sizeof(v__ast__StructField) : 1]; }; -struct Option_multi_return_v__ast__StructField_Array_v__ast__Type { +struct _option_multi_return_v__ast__StructField_Array_v__ast__Type { byte state; IError err; byte data[sizeof(multi_return_v__ast__StructField_Array_v__ast__Type) > 0 ? sizeof(multi_return_v__ast__StructField_Array_v__ast__Type) : 1]; }; -struct Option_v__ast__TypeSymbol_ptr { +struct _option_v__ast__TypeSymbol_ptr { byte state; IError err; byte data[sizeof(v__ast__TypeSymbol*) > 0 ? sizeof(v__ast__TypeSymbol*) : 1]; }; -struct Option_Array_Array_v__ast__Type { +struct _option_Array_Array_v__ast__Type { byte state; IError err; byte data[sizeof(Array_Array_v__ast__Type) > 0 ? sizeof(Array_Array_v__ast__Type) : 1]; }; -struct Option_v__ast__Type { +struct _option_v__ast__Type { byte state; IError err; byte data[sizeof(v__ast__Type) > 0 ? sizeof(v__ast__Type) : 1]; }; -struct Option_v__ast__InterfaceDecl { +struct _option_v__ast__InterfaceDecl { byte state; IError err; byte data[sizeof(v__ast__InterfaceDecl) > 0 ? sizeof(v__ast__InterfaceDecl) : 1]; }; -struct Option_v__ast__EnumDecl { +struct _option_v__ast__EnumDecl { byte state; IError err; byte data[sizeof(v__ast__EnumDecl) > 0 ? sizeof(v__ast__EnumDecl) : 1]; }; -struct Option_v__ast__Expr { +struct _option_v__ast__Expr { byte state; IError err; byte data[sizeof(v__ast__Expr) > 0 ? sizeof(v__ast__Expr) : 1]; }; -struct Option_v__ast__Param { +struct _option_v__ast__Param { byte state; IError err; byte data[sizeof(v__ast__Param) > 0 ? sizeof(v__ast__Param) : 1]; }; -struct Option_Array_v__ast__Type { +struct _option_Array_v__ast__Type { byte state; IError err; byte data[sizeof(Array_v__ast__Type) > 0 ? sizeof(Array_v__ast__Type) : 1]; }; -struct Option_v__ast__ConstField { +struct _option_v__ast__ConstField { byte state; IError err; byte data[sizeof(v__ast__ConstField) > 0 ? sizeof(v__ast__ConstField) : 1]; }; -struct Option_v__ast__GlobalField { +struct _option_v__ast__GlobalField { byte state; IError err; byte data[sizeof(v__ast__GlobalField) > 0 ? sizeof(v__ast__GlobalField) : 1]; }; -struct Option_v__ast__FnDecl { +struct _option_v__ast__FnDecl { byte state; IError err; byte data[sizeof(v__ast__FnDecl) > 0 ? sizeof(v__ast__FnDecl) : 1]; }; -struct Option_v__ast__Stmt_ptr { +struct _option_v__ast__Stmt_ptr { byte state; IError err; byte data[sizeof(v__ast__Stmt*) > 0 ? sizeof(v__ast__Stmt*) : 1]; }; -struct Option_v__scanner__Scanner_ptr { +struct _option_v__scanner__Scanner_ptr { byte state; IError err; byte data[sizeof(v__scanner__Scanner*) > 0 ? sizeof(v__scanner__Scanner*) : 1]; }; -struct Option_v__builder__MsvcResult { +struct _option_v__builder__MsvcResult { byte state; IError err; byte data[sizeof(v__builder__MsvcResult) > 0 ? sizeof(v__builder__MsvcResult) : 1]; }; -struct Option_v__builder__WindowsKit { +struct _option_v__builder__WindowsKit { byte state; IError err; byte data[sizeof(v__builder__WindowsKit) > 0 ? sizeof(v__builder__WindowsKit) : 1]; }; -struct Option_v__builder__VsInstallation { +struct _option_v__builder__VsInstallation { byte state; IError err; byte data[sizeof(v__builder__VsInstallation) > 0 ? sizeof(v__builder__VsInstallation) : 1]; @@ -6862,10 +6870,10 @@ strings__Builder strings__new_builder(int initial_size); void strings__Builder_write_ptr(strings__Builder* b, u8* ptr, int len); void strings__Builder_write_rune(strings__Builder* b, rune r); void strings__Builder_write_runes(strings__Builder* b, Array_rune runes); -void strings__Builder_write_b(strings__Builder* b, u8 data); +void strings__Builder_clear(strings__Builder* b); void strings__Builder_write_u8(strings__Builder* b, u8 data); void strings__Builder_write_byte(strings__Builder* b, byte data); -Option_int strings__Builder_write(strings__Builder* b, Array_u8 data); +_option_int strings__Builder_write(strings__Builder* b, Array_u8 data); void strings__Builder_drain_builder(strings__Builder* b, strings__Builder* other, int other_new_cap); u8 strings__Builder_byte_at(strings__Builder* b, int n); void strings__Builder_write_string(strings__Builder* b, string s); @@ -6969,19 +6977,19 @@ VV_LOCAL_SYMBOL bool strconv__is_space(u8 x); VV_LOCAL_SYMBOL bool strconv__is_exp(u8 x); VV_LOCAL_SYMBOL multi_return_strconv__ParserState_strconv__PrepNumber strconv__parser(string s); VV_LOCAL_SYMBOL u64 strconv__converter(strconv__PrepNumber* pn); -Option_f64 strconv__atof64(string s); +_option_f64 strconv__atof64(string s); f64 strconv__atof_quick(string s); Array_u64 _const_strconv__pos_exp; // inited later Array_u64 _const_strconv__neg_exp; // inited later #define _const_strconv__int_size 32 u64 _const_strconv__max_u64 = 18446744073709551615U; // precomputed u8 strconv__byte_to_lower(u8 c); -Option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit); +_option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit); multi_return_u64_int strconv__common_parse_uint2(string s, int _base, int _bit_size); -Option_u64 strconv__parse_uint(string s, int _base, int _bit_size); -Option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit); -Option_i64 strconv__parse_int(string _s, int base, int _bit_size); -Option_int strconv__atoi(string s); +_option_u64 strconv__parse_uint(string s, int _base, int _bit_size); +_option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit); +_option_i64 strconv__parse_int(string _s, int base, int _bit_size); +_option_int strconv__atoi(string s); VV_LOCAL_SYMBOL bool strconv__underscore_ok(string s); Array_u32 _const_strconv__ten_pow_table_32; // inited later u32 _const_strconv__mantbits32 = 23; // precomputed @@ -7254,7 +7262,7 @@ string u8_str_escaped(u8 b); bool u8_is_capital(u8 c); Array_u8 Array_u8_clone(Array_u8 b); string Array_u8_bytestr(Array_u8 b); -Option_rune Array_u8_byterune(Array_u8 b); +_option_rune Array_u8_byterune(Array_u8 b); string u8_repeat(u8 b, int count); VV_LOCAL_SYMBOL string _Atomic__int_str(int x); VV_LOCAL_SYMBOL bool fast_string_eq(string a, string b); @@ -7308,6 +7316,7 @@ VV_LOCAL_SYMBOL bool map_exists(map* m, voidptr key); VV_LOCAL_SYMBOL void DenseArray_delete(DenseArray* d, int i); void map_delete(map* m, voidptr key); array map_keys(map* m); +array map_values(map* m); VV_LOCAL_SYMBOL DenseArray DenseArray_clone(DenseArray* d); map map_clone(map* m); void map_free(map* m); @@ -7323,6 +7332,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 opt_ok2(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 @@ -7402,8 +7412,8 @@ u8 string_u8(string s); u16 string_u16(string s); u32 string_u32(string s); u64 string_u64(string s); -Option_u64 string_parse_uint(string s, int _base, int _bit_size); -Option_i64 string_parse_int(string s, int _base, int _bit_size); +_option_u64 string_parse_uint(string s, int _base, int _bit_size); +_option_i64 string_parse_int(string s, int _base, int _bit_size); VV_LOCAL_SYMBOL bool string__eq(string s, string a); int string_compare(string s, string a); VV_LOCAL_SYMBOL bool string__lt(string s, string a); @@ -7414,14 +7424,14 @@ Array_string string_split_nth(string s, string delim, int nth); Array_string string_split_into_lines(string s); VV_LOCAL_SYMBOL string string_substr2(string s, int start, int _end, bool end_max); string string_substr(string s, int start, int end); -Option_string string_substr_with_check(string s, int start, int end); +_option_string string_substr_with_check(string s, int start, int end); string string_substr_ni(string s, int _start, int _end); VV_LOCAL_SYMBOL int string_index_(string s, string p); -Option_int string_index(string s, string p); +_option_int string_index(string s, string p); VV_LOCAL_SYMBOL int string_index_kmp(string s, string p); int string_index_any(string s, string chars); VV_LOCAL_SYMBOL int string_last_index_(string s, string p); -Option_int string_last_index(string s, string p); +_option_int string_last_index(string s, string p); int string_index_after(string s, string p, int start); int string_index_u8(string s, u8 c); int string_last_index_u8(string s, u8 c); @@ -7456,7 +7466,7 @@ void Array_string_sort_ignore_case(Array_string* s); void Array_string_sort_by_len(Array_string* s); string string_str(string s); VV_LOCAL_SYMBOL byte string_at(string s, int idx); -VV_LOCAL_SYMBOL Option_u8 string_at_with_check(string s, int idx); +VV_LOCAL_SYMBOL _option_u8 string_at_with_check(string s, int idx); bool u8_is_space(u8 c); bool u8_is_digit(u8 c); bool u8_is_hex_digit(u8 c); @@ -7519,7 +7529,7 @@ string utf32_to_str_no_malloc(u32 code, u8* buf); int utf32_decode_to_buffer(u32 code, u8* buf); int utf8_str_len(string s); int string_utf32_code(string _rune); -Option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes); +_option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes); VV_LOCAL_SYMBOL int utf8_len(u8 c); int utf8_str_visible_length(string s); bool ArrayFlags_is_empty(ArrayFlags* e); @@ -7532,8 +7542,8 @@ void ArrayFlags_toggle(ArrayFlags* e, ArrayFlags flag); string _const_dl__dl_ext; // inited later string dl__get_shared_library_extension(void); string dl__get_libname(string libname); -Option_voidptr dl__open_opt(string filename, int flags); -Option_voidptr dl__sym_opt(voidptr shared_object_handle, string symbol); +_option_voidptr dl__open_opt(string filename, int flags); +_option_voidptr dl__sym_opt(voidptr shared_object_handle, string symbol); #define _const_dl__rtld_now 0 #define _const_dl__rtld_lazy 0 voidptr dl__open(string filename, int flags); @@ -7601,7 +7611,7 @@ bool v__token__Kind_is_prefix(v__token__Kind kind); bool v__token__Kind_is_infix(v__token__Kind kind); bool v__token__Kind_is_postfix(v__token__Kind kind); string v__token__kind_to_string(v__token__Kind k); -Option_v__token__Kind v__token__kind_from_string(string s); +_option_v__token__Kind v__token__kind_from_string(string s); int v__mathutil__min_T_int(int a, int b); int v__mathutil__max_T_int(int a, int b); void v__dotgraph__start_digraph(void); @@ -7714,26 +7724,26 @@ void flag__FlagParser_skip_executable(flag__FlagParser* fs); void flag__FlagParser_allow_unknown_args(flag__FlagParser* fs); VV_LOCAL_SYMBOL void flag__FlagParser_add_flag(flag__FlagParser* fs, string name, u8 abbr, string usage, string desc); VV_LOCAL_SYMBOL Array_string flag__FlagParser_parse_value(flag__FlagParser* fs, string longhand, u8 shorthand); -VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser* fs, string longhand, u8 shorthand); -Option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); +VV_LOCAL_SYMBOL _option_string flag__FlagParser_parse_bool_value(flag__FlagParser* fs, string longhand, u8 shorthand); +_option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); bool flag__FlagParser_bool(flag__FlagParser* fs, string name, u8 abbr, bool bdefault, string usage); Array_int flag__FlagParser_int_multi(flag__FlagParser* fs, string name, u8 abbr, string usage); -Option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); +_option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); int flag__FlagParser_int(flag__FlagParser* fs, string name, u8 abbr, int idefault, string usage); Array_f64 flag__FlagParser_float_multi(flag__FlagParser* fs, string name, u8 abbr, string usage); -Option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); +_option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); f64 flag__FlagParser_float(flag__FlagParser* fs, string name, u8 abbr, f64 fdefault, string usage); Array_string flag__FlagParser_string_multi(flag__FlagParser* fs, string name, u8 abbr, string usage); -Option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); +_option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 abbr, string usage); string flag__FlagParser_string(flag__FlagParser* fs, string name, u8 abbr, string sdefault, string usage); -Option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, int n); -Option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, int n); -Option_void flag__FlagParser_limit_free_args(flag__FlagParser* fs, int min, int max); +_option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, int n); +_option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, int n); +_option_void flag__FlagParser_limit_free_args(flag__FlagParser* fs, int min, int max); void flag__FlagParser_arguments_description(flag__FlagParser* fs, string description); string flag__FlagParser_usage(flag__FlagParser* fs); -VV_LOCAL_SYMBOL Option_flag__Flag flag__FlagParser_find_existing_flag(flag__FlagParser* fs, string fname); +VV_LOCAL_SYMBOL _option_flag__Flag flag__FlagParser_find_existing_flag(flag__FlagParser* fs, string fname); VV_LOCAL_SYMBOL void flag__FlagParser_handle_builtin_options(flag__FlagParser* fs); -Option_Array_string flag__FlagParser_finalize(flag__FlagParser* fs); +_option_Array_string flag__FlagParser_finalize(flag__FlagParser* fs); Array_string flag__FlagParser_remaining_parameters(flag__FlagParser* fs); VV_LOCAL_SYMBOL bool semver__version_satisfies(semver__Version ver, string input); VV_LOCAL_SYMBOL bool semver__compare_eq(semver__Version v1, semver__Version v2); @@ -7748,9 +7758,9 @@ Array_int _const_semver__versions; // inited later VV_LOCAL_SYMBOL semver__RawVersion semver__parse(string input); VV_LOCAL_SYMBOL bool semver__RawVersion_is_valid(semver__RawVersion ver); VV_LOCAL_SYMBOL bool semver__RawVersion_is_missing(semver__RawVersion ver, int typ); -VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_coerce(semver__RawVersion raw_ver); +VV_LOCAL_SYMBOL _option_semver__Version semver__RawVersion_coerce(semver__RawVersion raw_ver); VV_LOCAL_SYMBOL semver__RawVersion semver__RawVersion_complete(semver__RawVersion raw_ver); -VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_validate(semver__RawVersion raw_ver); +VV_LOCAL_SYMBOL _option_semver__Version semver__RawVersion_validate(semver__RawVersion raw_ver); VV_LOCAL_SYMBOL semver__Version semver__RawVersion_to_version(semver__RawVersion raw_ver); string _const_semver__comparator_sep; // a string literal, inited later string _const_semver__comparator_set_sep; // a string literal, inited later @@ -7759,21 +7769,21 @@ string _const_semver__x_range_symbols; // a string literal, inited later VV_LOCAL_SYMBOL bool semver__Range_satisfies(semver__Range r, semver__Version ver); VV_LOCAL_SYMBOL bool semver__ComparatorSet_satisfies(semver__ComparatorSet set, semver__Version ver); VV_LOCAL_SYMBOL bool semver__Comparator_satisfies(semver__Comparator c, semver__Version ver); -VV_LOCAL_SYMBOL Option_semver__Range semver__parse_range(string input); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__parse_comparator_set(string input); -VV_LOCAL_SYMBOL Option_semver__Comparator semver__parse_comparator(string input); -VV_LOCAL_SYMBOL Option_semver__Version semver__parse_xrange(string input); +VV_LOCAL_SYMBOL _option_semver__Range semver__parse_range(string input); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__parse_comparator_set(string input); +VV_LOCAL_SYMBOL _option_semver__Comparator semver__parse_comparator(string input); +VV_LOCAL_SYMBOL _option_semver__Version semver__parse_xrange(string input); VV_LOCAL_SYMBOL bool semver__can_expand(string input); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_comparator_set(string input); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_tilda(string raw_version); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_caret(string raw_version); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_hyphen(string raw_range); -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_xrange(string raw_range); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_comparator_set(string input); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_tilda(string raw_version); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_caret(string raw_version); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_hyphen(string raw_range); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_xrange(string raw_range); VV_LOCAL_SYMBOL semver__ComparatorSet semver__make_comparator_set_ge_lt(semver__Version min, semver__Version max); VV_LOCAL_SYMBOL semver__ComparatorSet semver__make_comparator_set_ge_le(semver__Version min, semver__Version max); string semver__EmptyInputError_msg(semver__EmptyInputError err); string semver__InvalidVersionFormatError_msg(semver__InvalidVersionFormatError err); -Option_semver__Version semver__from(string input); +_option_semver__Version semver__from(string input); semver__Version semver__build(int major, int minor, int patch); semver__Version semver__Version_increment(semver__Version ver, semver__Increment typ); bool semver__Version_satisfies(semver__Version ver, string input); @@ -7783,10 +7793,10 @@ bool semver__Version_lt(semver__Version v1, semver__Version v2); bool semver__Version_ge(semver__Version v1, semver__Version v2); bool semver__Version_le(semver__Version v1, semver__Version v2); string semver__Version_str(semver__Version ver); -Option_semver__Version semver__coerce(string input); +_option_semver__Version semver__coerce(string input); bool semver__is_valid(string input); VV_LOCAL_SYMBOL bool semver__is_version_valid(string input); -VV_LOCAL_SYMBOL Option_semver__Version semver__coerce_version(string input); +VV_LOCAL_SYMBOL _option_semver__Version semver__coerce_version(string input); VV_LOCAL_SYMBOL semver__Version semver__increment_version(semver__Version ver, semver__Increment typ); VV_LOCAL_SYMBOL bool semver__is_valid_string(string input); VV_LOCAL_SYMBOL bool semver__is_valid_number(string input); @@ -7911,7 +7921,7 @@ voidptr _const_os__hwnd_broadcast; // inited later #define _const_os__wm_settingchange 26 #define _const_os__smto_abortifhung 2 string os__getenv(string key); -Option_string os__getenv_opt(string key); +_option_string os__getenv_opt(string key); int os__setenv(string name, string value, bool overwrite); int os__unsetenv(string name); VV_LOCAL_SYMBOL char** os__unix_environ(void); @@ -7920,47 +7930,47 @@ int os__fd_close(int fd); void os__fd_write(int fd, string s); Array_string os__fd_slurp(int fd); multi_return_string_int os__fd_read(int fd, int maxbytes); -Option_os__File os__open_file(string path, string mode, Array_int options); -Option_os__File os__open(string path); -Option_os__File os__create(string path); +_option_os__File os__open_file(string path, string mode, Array_int options); +_option_os__File os__open(string path); +_option_os__File os__create(string path); os__File os__stdin(void); os__File os__stdout(void); os__File os__stderr(void); -Option_int os__File_read(os__File* f, Array_u8* buf); -Option_int os__File_write(os__File* f, Array_u8 buf); -Option_int os__File_writeln(os__File* f, string s); -Option_int os__File_write_string(os__File* f, string s); -Option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf); +_option_int os__File_read(os__File* f, Array_u8* buf); +_option_int os__File_write(os__File* f, Array_u8 buf); +_option_int os__File_writeln(os__File* f, string s); +_option_int os__File_write_string(os__File* f, string s); +_option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf); int os__File_write_ptr(os__File* f, voidptr data, int size); -Option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer_len); +_option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer_len); int os__File_write_ptr_at(os__File* f, voidptr data, int size, u64 pos); -VV_LOCAL_SYMBOL Option_int os__fread(voidptr ptr, int item_size, int items, FILE* stream); +VV_LOCAL_SYMBOL _option_int os__fread(voidptr ptr, int item_size, int items, FILE* stream); Array_u8 os__File_read_bytes(os__File* f, int size); Array_u8 os__File_read_bytes_at(os__File* f, int size, u64 pos); -Option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf); -Option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf); -Option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf); -Option_int os__File_read_into_ptr(os__File* f, u8* ptr, int max_size); +_option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf); +_option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf); +_option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf); +_option_int os__File_read_into_ptr(os__File* f, u8* ptr, int max_size); void os__File_flush(os__File* f); string os__FileNotOpenedError_msg(os__FileNotOpenedError err); string os__SizeOfTypeIs0Error_msg(os__SizeOfTypeIs0Error err); VV_LOCAL_SYMBOL IError os__error_file_not_opened(void); VV_LOCAL_SYMBOL IError os__error_size_of_type_0(void); -Option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode); -Option_i64 os__File_tell(os__File* f); +_option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode); +_option_i64 os__File_tell(os__File* f); u32 os__FilePermission_bitmask(os__FilePermission p); u32 os__FileMode_bitmask(os__FileMode m); os__FileMode os__inode(string path); -Option_void os__open_uri(string uri); +_option_void os__open_uri(string uri); Array_string _const_os__args; // inited later -Option_Array_u8 os__read_bytes(string path); -Option_string os__read_file(string path); -Option_void os__truncate(string path, u64 len); +_option_Array_u8 os__read_bytes(string path); +_option_string os__read_file(string path); +_option_void os__truncate(string path, u64 len); VV_LOCAL_SYMBOL void os__eprintln_unknown_file_size(void); u64 os__file_size(string path); -Option_void os__mv(string src, string dst); -Option_void os__cp(string src, string dst); -Option_FILE_ptr os__vfopen(string path, string mode); +_option_void os__mv(string src, string dst); +_option_void os__cp(string src, string dst); +_option_FILE_ptr os__vfopen(string path, string mode); int os__fileno(voidptr cfile); VV_LOCAL_SYMBOL voidptr os__vpopen(string path); VV_LOCAL_SYMBOL multi_return_int_bool os__posix_wait4_to_exit_status(int waitret); @@ -7971,15 +7981,15 @@ bool os__exists(string path); bool os__is_executable(string path); bool os__is_writable(string path); bool os__is_readable(string path); -Option_void os__rm(string path); -Option_void os__rmdir(string path); +_option_void os__rm(string path); +_option_void os__rmdir(string path); VV_LOCAL_SYMBOL void os__print_c_errno(void); string os__get_raw_line(void); Array_u8 os__get_raw_stdin(void); string os__executable(void); bool os__is_dir(string path); bool os__is_link(string path); -Option_void os__chdir(string path); +_option_void os__chdir(string path); VV_LOCAL_SYMBOL int os__max_path_bufffer_size(void); string os__getwd(void); string os__real_path(string fpath); @@ -7988,14 +7998,14 @@ int os__fork(void); int os__wait(void); i64 os__file_last_mod_unix(string path); void os__flush(void); -Option_void os__chmod(string path, int mode); -Option_void os__chown(string path, int owner, int group); -Option_os__File os__open_append(string path); -Option_void os__execvp(string cmdpath, Array_string cmdargs); -Option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs); +_option_void os__chmod(string path, int mode); +_option_void os__chown(string path, int owner, int group); +_option_os__File os__open_append(string path); +_option_void os__execvp(string cmdpath, Array_string cmdargs); +_option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs); int os__is_atty(int fd); -Option_void os__write_file_array(string path, array buffer); -Option_Array_string os__glob(Array_string patterns); +_option_void os__write_file_array(string path, array buffer); +_option_Array_string os__glob(Array_string patterns); VV_LOCAL_SYMBOL int compare_3677745349018262865_string(string* a, string* b) { if (string__lt(*a, *b)) return -1; else return 1; @@ -8009,17 +8019,17 @@ string _const_os__wd_at_startup; // inited later #define _const_os__w_ok 2 #define _const_os__r_ok 4 void os__Result_free(os__Result* result); -Option_void os__cp_all(string src, string dst, bool overwrite); -Option_void os__mv_by_cp(string source, string target); -Option_Array_string os__read_lines(string path); +_option_void os__cp_all(string src, string dst, bool overwrite); +_option_void os__mv_by_cp(string source, string target); +_option_Array_string os__read_lines(string path); string os__sigint_to_signal_name(int si); -Option_void os__rmdir_all(string path); +_option_void os__rmdir_all(string path); bool os__is_dir_empty(string path); string os__file_ext(string path); string os__dir(string opath); string os__base(string opath); string os__file_name(string opath); -Option_string os__input_opt(string prompt); +_option_string os__input_opt(string prompt); string os__input(string prompt); string os__get_line(void); Array_string os__get_lines(void); @@ -8028,11 +8038,11 @@ string os__get_raw_lines_joined(void); string os__user_os(void); string os__home_dir(void); string os__expand_tilde_to_home(string path); -Option_void os__write_file(string path, string text); +_option_void os__write_file(string path, string text); VV_LOCAL_SYMBOL string os__executable_fallback(void); string os__ExecutableNotFoundError_msg(os__ExecutableNotFoundError err); VV_LOCAL_SYMBOL IError os__error_failed_to_find_executable(void); -Option_string os__find_abs_path_of_executable(string exepath); +_option_string os__find_abs_path_of_executable(string exepath); bool os__exists_in_system_path(string prog); bool os__is_file(string path); bool os__is_abs_path(string path); @@ -8043,7 +8053,7 @@ VV_LOCAL_SYMBOL void os__impl_walk_ext(string path, string ext, Array_string* ou void os__walk(string path, void (*f)(string )); void os__walk_with_context(string path, voidptr context, void (*fcb)(voidptr , string )); void os__log(string s); -Option_void os__mkdir_all(string opath); +_option_void os__mkdir_all(string opath); string os__cache_dir(void); string os__temp_dir(void); VV_LOCAL_SYMBOL string os__default_vmodules_path(void); @@ -8053,16 +8063,16 @@ string os__resource_abs_path(string path); os__Result os__execute_or_panic(string cmd); os__Result os__execute_or_exit(string cmd); string os__quoted_path(string path); -Option_string os__config_dir(void); +_option_string os__config_dir(void); string _const_os__path_separator; // a string literal, inited later string _const_os__path_delimiter; // a string literal, inited later VV_LOCAL_SYMBOL Array_string os__init_os_args_wide(int argc, u8** argv); -VV_LOCAL_SYMBOL Option_void os__native_glob_pattern(string pattern, Array_string* matches); -Option_void os__utime(string path, int actime, int modtime); -Option_Array_string os__ls(string path); -Option_bool os__mkdir(string path); +VV_LOCAL_SYMBOL _option_void os__native_glob_pattern(string pattern, Array_string* matches); +_option_void os__utime(string path, int actime, int modtime); +_option_Array_string os__ls(string path); +_option_bool os__mkdir(string path); os__HANDLE os__get_file_handle(string path); -Option_string os__get_module_filename(os__HANDLE handle); +_option_string os__get_module_filename(os__HANDLE handle); #define _const_os__format_message_allocate_buffer 256 #define _const_os__format_message_argument_array 8192 #define _const_os__format_message_from_hmodule 2048 @@ -8076,15 +8086,15 @@ Option_string os__get_module_filename(os__HANDLE handle); VV_LOCAL_SYMBOL voidptr os__ptr_win_get_error_msg(u32 code); string os__get_error_msg(int code); os__Result os__execute(string cmd); -Option_bool os__symlink(string origin, string target); -Option_bool os__link(string origin, string target); +_option_bool os__symlink(string origin, string target); +_option_bool os__link(string origin, string target); void os__File_close(os__File* f); void os__add_vectored_exception_handler(bool first, int (*handler)(ExceptionPointers* )); bool os__debugger_present(void); os__Uname os__uname(void); string os__hostname(void); string os__loginname(void); -Option_bool os__is_writable_folder(string folder); +_option_bool os__is_writable_folder(string folder); int os__getpid(void); int os__getppid(void); int os__getuid(void); @@ -8092,9 +8102,9 @@ int os__geteuid(void); int os__getgid(void); int os__getegid(void); void os__posix_set_permission_bit(string path_s, u32 mode, bool enable); -Option_void os__Command_start(os__Command* c); +_option_void os__Command_start(os__Command* c); string os__Command_read_line(os__Command* c); -Option_void os__Command_close(os__Command* c); +_option_void os__Command_close(os__Command* c); void os__Process_signal_kill(os__Process* p); void os__Process_signal_pgkill(os__Process* p); void os__Process_signal_stop(os__Process* p); @@ -8141,7 +8151,7 @@ VV_LOCAL_SYMBOL void os__Process_unix_kill_process(os__Process* p); VV_LOCAL_SYMBOL void os__Process_unix_kill_pgroup(os__Process* p); VV_LOCAL_SYMBOL void os__Process_unix_wait(os__Process* p); VV_LOCAL_SYMBOL bool os__Process_unix_is_alive(os__Process* p); -Option_os__SignalHandler os__signal_opt(os__Signal signum, void (*handler)(os__Signal )); +_option_os__SignalHandler os__signal_opt(os__Signal signum, void (*handler)(os__Signal )); v__depgraph__OrderedDepMap v__depgraph__new_ordered_dependency_map(void); void v__depgraph__OrderedDepMap_set(v__depgraph__OrderedDepMap* o, string name, Array_string deps); void v__depgraph__OrderedDepMap_add(v__depgraph__OrderedDepMap* o, string name, Array_string deps); @@ -8496,7 +8506,7 @@ string term__header(string text, string divider); VV_LOCAL_SYMBOL int term__imax(int x, int y); VV_LOCAL_SYMBOL bool term__supports_escape_sequences(int fd); multi_return_int_int term__get_terminal_size(void); -Option_term__Coord term__get_cursor_position(void); +_option_term__Coord term__get_cursor_position(void); bool term__set_terminal_title(string title); void term__clear(void); string _const_v__util__version__v_version; // a string literal, inited later @@ -8508,9 +8518,9 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts); void v__vcache__CacheManager_set_temporary_options(v__vcache__CacheManager* cm, Array_string new_opts); string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key); string v__vcache__CacheManager_postfix_with_key2cpath(v__vcache__CacheManager* cm, string postfix, string key); -Option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key); -Option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content); -Option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key); +_option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key); +_option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content); +_option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key); VV_LOCAL_SYMBOL int v__vcache__mypid(void); i64 time__portable_timegm(struct tm* t); int time__days_from_civil(int oy, int m, int d); @@ -8538,12 +8548,12 @@ string time__Time_utc_string(time__Time t); bool time__Time__eq(time__Time t1, time__Time t2); bool time__Time__lt(time__Time t1, time__Time t2); time__Duration time__Time__minus(time__Time lhs, time__Time rhs); -Option_time__Time time__parse_rfc3339(string s); -Option_time__Time time__parse(string s); -Option_time__Time time__parse_iso8601(string s); -Option_time__Time time__parse_rfc2822(string s); -VV_LOCAL_SYMBOL Option_multi_return_int_int_int time__parse_iso8601_date(string s); -VV_LOCAL_SYMBOL Option_multi_return_int_int_int_int_i64_bool time__parse_iso8601_time(string s); +_option_time__Time time__parse_rfc3339(string s); +_option_time__Time time__parse(string s); +_option_time__Time time__parse_iso8601(string s); +_option_time__Time time__parse_rfc2822(string s); +VV_LOCAL_SYMBOL _option_multi_return_int_int_int time__parse_iso8601_date(string s); +VV_LOCAL_SYMBOL _option_multi_return_int_int_int_int_i64_bool time__parse_iso8601_time(string s); string time__TimeParseError_msg(time__TimeParseError err); VV_LOCAL_SYMBOL IError time__error_invalid_time(int code); time__StopWatch time__new_stopwatch(time__StopWatchOptions opts); @@ -8587,7 +8597,7 @@ int time__Time_day_of_week(time__Time* t); string time__Time_weekday_str(time__Time* t); string time__Time_long_weekday_str(time__Time* t); bool time__is_leap_year(int year); -Option_int time__days_in_month(int month, int year); +_option_int time__days_in_month(int month, int year); string time__Time_debug(time__Time* t); time__Duration _const_time__nanosecond; // inited later time__Duration _const_time__microsecond; // inited later @@ -8630,8 +8640,8 @@ time__Time time__unix2(i64 abs, int microsecond); VV_LOCAL_SYMBOL multi_return_int_int_int time__calculate_date_from_offset(i64 day_offset_); VV_LOCAL_SYMBOL multi_return_int_int_int time__calculate_time_from_offset(i64 second_offset_); string _const_v__vmod__err_label; // a string literal, inited later -Option_v__vmod__Manifest v__vmod__from_file(string vmod_path); -Option_v__vmod__Manifest v__vmod__decode(string contents); +_option_v__vmod__Manifest v__vmod__from_file(string vmod_path); +_option_v__vmod__Manifest v__vmod__decode(string contents); VV_LOCAL_SYMBOL void v__vmod__Scanner_tokenize(v__vmod__Scanner* s, v__vmod__TokenKind t_type, string val); VV_LOCAL_SYMBOL void v__vmod__Scanner_skip_whitespace(v__vmod__Scanner* s); VV_LOCAL_SYMBOL bool v__vmod__is_name_alpha(u8 chr); @@ -8639,8 +8649,8 @@ VV_LOCAL_SYMBOL string v__vmod__Scanner_create_string(v__vmod__Scanner* s, u8 q) VV_LOCAL_SYMBOL string v__vmod__Scanner_create_ident(v__vmod__Scanner* s); VV_LOCAL_SYMBOL bool v__vmod__Scanner_peek_char(v__vmod__Scanner s, u8 c); VV_LOCAL_SYMBOL void v__vmod__Scanner_scan_all(v__vmod__Scanner* s); -VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content(Array_v__vmod__Token tokens, int st_idx); -VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* p); +VV_LOCAL_SYMBOL _option_multi_return_Array_string_int v__vmod__get_array_content(Array_v__vmod__Token tokens, int st_idx); +VV_LOCAL_SYMBOL _option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* p); v__vmod__ModFileCacher* v__vmod__new_mod_file_cacher(void); void v__vmod__ModFileCacher_debug(v__vmod__ModFileCacher* mcache); v__vmod__ModFileAndFolder v__vmod__ModFileCacher_get_by_file(v__vmod__ModFileCacher* mcache, string vfile); @@ -8667,14 +8677,14 @@ Array_string Array_v__cflag__CFlag_c_options_after_target(Array_v__cflag__CFlag Array_string Array_v__cflag__CFlag_c_options_without_object_files(Array_v__cflag__CFlag cflags); Array_string Array_v__cflag__CFlag_c_options_only_object_files(Array_v__cflag__CFlag cflags); multi_return_Array_string_Array_string_Array_string Array_v__cflag__CFlag_defines_others_libs(Array_v__cflag__CFlag cflags); -VV_LOCAL_SYMBOL Option_string v__pkgconfig__desc(string mod); -Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args); +VV_LOCAL_SYMBOL _option_string v__pkgconfig__desc(string mod); +_option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args); VV_LOCAL_SYMBOL int compare_10129308118656229290_string(string* a, string* b) { if (string__lt(*a, *b)) return -1; else return 1; } -Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m); +_option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m); VV_LOCAL_SYMBOL string v__pkgconfig__filter(Array_string libs, string prefix, string prefix2); VV_LOCAL_SYMBOL v__pkgconfig__MainOptions* v__pkgconfig__parse_options(flag__FlagParser* fp); Array_string _const_v__pkgconfig__default_paths; // inited later @@ -8684,15 +8694,15 @@ VV_LOCAL_SYMBOL Array_string v__pkgconfig__PkgConfig_parse_list(v__pkgconfig__Pk VV_LOCAL_SYMBOL string v__pkgconfig__PkgConfig_parse_line(v__pkgconfig__PkgConfig* pc, string s); VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_setvar(v__pkgconfig__PkgConfig* pc, string line); VV_LOCAL_SYMBOL bool v__pkgconfig__PkgConfig_parse(v__pkgconfig__PkgConfig* pc, string file); -VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgConfig* pc, string pkgname); +VV_LOCAL_SYMBOL _option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgConfig* pc, string pkgname); bool v__pkgconfig__atleast(string v); bool v__pkgconfig__PkgConfig_atleast(v__pkgconfig__PkgConfig* pc, string v); -Option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkgconfig__PkgConfig* pcdep); -VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__PkgConfig* pc); -VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__PkgConfig* pc, string dep); +_option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkgconfig__PkgConfig* pcdep); +VV_LOCAL_SYMBOL _option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__PkgConfig* pc); +VV_LOCAL_SYMBOL _option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__PkgConfig* pc, string dep); VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_add_path(v__pkgconfig__PkgConfig* pc, string path); VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_load_paths(v__pkgconfig__PkgConfig* pc); -Option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconfig__Options options); +_option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconfig__Options options); Array_string v__pkgconfig__list(void); int runtime__nr_jobs(void); bool runtime__is_32bit(void); @@ -8700,7 +8710,7 @@ bool runtime__is_64bit(void); bool runtime__is_little_endian(void); bool runtime__is_big_endian(void); int runtime__nr_cpus(void); -Option_string v__util__diff__find_working_diff_command(void); +_option_string v__util__diff__find_working_diff_command(void); VV_LOCAL_SYMBOL bool v__util__diff__opendiff_exists(void); string v__util__diff__color_compare_files(string diff_cmd, string file1, string file2); string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefix, string expected, string found); @@ -8729,28 +8739,28 @@ VV_LOCAL_SYMBOL void rand__init(void); VV_LOCAL_SYMBOL void rand__read_32(rand__PRNG* rng, Array_u8* buf); VV_LOCAL_SYMBOL void rand__read_64(rand__PRNG* rng, Array_u8* buf); VV_LOCAL_SYMBOL void rand__read_internal(rand__PRNG* rng, Array_u8* buf); -Option_Array_u8 rand__PRNG_bytes(rand__PRNG* rng, int bytes_needed); +_option_Array_u8 rand__PRNG_bytes(rand__PRNG* rng, int bytes_needed); void rand__PRNG_read(rand__PRNG* rng, Array_u8* buf); -Option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max); -Option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max); -Option_u32 rand__PRNG_u32_in_range(rand__PRNG* rng, u32 min, u32 max); -Option_u64 rand__PRNG_u64_in_range(rand__PRNG* rng, u64 min, u64 max); +_option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max); +_option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max); +_option_u32 rand__PRNG_u32_in_range(rand__PRNG* rng, u32 min, u32 max); +_option_u64 rand__PRNG_u64_in_range(rand__PRNG* rng, u64 min, u64 max); i8 rand__PRNG_i8(rand__PRNG* rng); i16 rand__PRNG_i16(rand__PRNG* rng); int rand__PRNG_int(rand__PRNG* rng); i64 rand__PRNG_i64(rand__PRNG* rng); int rand__PRNG_int31(rand__PRNG* rng); i64 rand__PRNG_int63(rand__PRNG* rng); -Option_int rand__PRNG_intn(rand__PRNG* rng, int max); -Option_i64 rand__PRNG_i64n(rand__PRNG* rng, i64 max); -Option_int rand__PRNG_int_in_range(rand__PRNG* rng, int min, int max); -Option_i64 rand__PRNG_i64_in_range(rand__PRNG* rng, i64 min, i64 max); +_option_int rand__PRNG_intn(rand__PRNG* rng, int max); +_option_i64 rand__PRNG_i64n(rand__PRNG* rng, i64 max); +_option_int rand__PRNG_int_in_range(rand__PRNG* rng, int min, int max); +_option_i64 rand__PRNG_i64_in_range(rand__PRNG* rng, i64 min, i64 max); f32 rand__PRNG_f32(rand__PRNG* rng); f64 rand__PRNG_f64(rand__PRNG* rng); -Option_f32 rand__PRNG_f32n(rand__PRNG* rng, f32 max); -Option_f64 rand__PRNG_f64n(rand__PRNG* rng, f64 max); -Option_f32 rand__PRNG_f32_in_range(rand__PRNG* rng, f32 min, f32 max); -Option_f64 rand__PRNG_f64_in_range(rand__PRNG* rng, f64 min, f64 max); +_option_f32 rand__PRNG_f32n(rand__PRNG* rng, f32 max); +_option_f64 rand__PRNG_f64n(rand__PRNG* rng, f64 max); +_option_f32 rand__PRNG_f32_in_range(rand__PRNG* rng, f32 min, f32 max); +_option_f64 rand__PRNG_f64_in_range(rand__PRNG* rng, f64 min, f64 max); string rand__PRNG_ulid(rand__PRNG* rng); string rand__PRNG_ulid_at_millisecond(rand__PRNG* rng, u64 unix_time_milli); string rand__PRNG_string_from_set(rand__PRNG* rng, string charset, int len); @@ -8764,27 +8774,27 @@ void rand__set_rng(rand__PRNG* rng); void rand__seed(Array_u32 seed); u32 rand__u32(void); u64 rand__u64(void); -Option_u32 rand__u32n(u32 max); -Option_u64 rand__u64n(u64 max); -Option_u32 rand__u32_in_range(u32 min, u32 max); -Option_u64 rand__u64_in_range(u64 min, u64 max); +_option_u32 rand__u32n(u32 max); +_option_u64 rand__u64n(u64 max); +_option_u32 rand__u32_in_range(u32 min, u32 max); +_option_u64 rand__u64_in_range(u64 min, u64 max); i16 rand__i16(void); int rand__int(void); -Option_int rand__intn(int max); +_option_int rand__intn(int max); u8 rand__u8(void); -Option_int rand__int_in_range(int min, int max); +_option_int rand__int_in_range(int min, int max); int rand__int31(void); i64 rand__i64(void); -Option_i64 rand__i64n(i64 max); -Option_i64 rand__i64_in_range(i64 min, i64 max); +_option_i64 rand__i64n(i64 max); +_option_i64 rand__i64_in_range(i64 min, i64 max); i64 rand__int63(void); f32 rand__f32(void); f64 rand__f64(void); -Option_f32 rand__f32n(f32 max); -Option_f64 rand__f64n(f64 max); -Option_f32 rand__f32_in_range(f32 min, f32 max); -Option_f64 rand__f64_in_range(f64 min, f64 max); -Option_Array_u8 rand__bytes(int bytes_needed); +_option_f32 rand__f32n(f32 max); +_option_f64 rand__f64n(f64 max); +_option_f32 rand__f32_in_range(f32 min, f32 max); +_option_f64 rand__f64_in_range(f64 min, f64 max); +_option_Array_u8 rand__bytes(int bytes_needed); void rand__read(Array_u8* buf); string _const_rand__english_letters; // a string literal, inited later string _const_rand__hex_chars; // a string literal, inited later @@ -8805,7 +8815,7 @@ string v__pref__default_tcc_compiler(void); void v__pref__Preferences_default_c_compiler(v__pref__Preferences* p); string v__pref__vexe_path(void); string v__pref__Preferences_vcross_compiler_name(v__pref__Preferences* p); -Option_v__pref__OS v__pref__os_from_string(string os_str); +_option_v__pref__OS v__pref__os_from_string(string os_str); string v__pref__OS_str(v__pref__OS o); v__pref__OS v__pref__get_host_os(void); bool v__pref__Backend_is_js(v__pref__Backend b); @@ -8815,10 +8825,10 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors void v__pref__eprintln_cond(bool condition, string s); void v__pref__Preferences_vrun_elog(v__pref__Preferences* pref, string s); bool v__pref__Preferences_should_output_to_stdout(v__pref__Preferences* pref); -Option_v__pref__Arch v__pref__arch_from_string(string arch_str); +_option_v__pref__Arch v__pref__arch_from_string(string arch_str); VV_LOCAL_SYMBOL void v__pref__must_exist(string path); VV_LOCAL_SYMBOL bool v__pref__is_source_file(string path); -Option_v__pref__Backend v__pref__backend_from_string(string s); +_option_v__pref__Backend v__pref__backend_from_string(string s); v__pref__CompilerType v__pref__cc_from_string(string cc_str); v__pref__Arch v__pref__get_host_arch(void); VV_LOCAL_SYMBOL void v__pref__Preferences_parse_define(v__pref__Preferences* prefs, string define); @@ -8890,7 +8900,7 @@ VV_LOCAL_SYMBOL int compare_1468091262560489642_string(string* a, string* b) { else return 1; } -Option_string v__util__find_working_diff_command(void); +_option_string v__util__find_working_diff_command(void); string v__util__color_compare_files(string diff_cmd, string file1, string file2); string v__util__color_compare_strings(string diff_cmd, string unique_prefix, string expected, string found); #define _const_v__util__error_context_before 2 @@ -8910,7 +8920,7 @@ void v__util__verror(string kind, string s); string v__util__vlines_escape_path(string path, string ccompiler); string v__util__qualify_import(v__pref__Preferences* pref, string mod, string file_path); string v__util__qualify_module(v__pref__Preferences* pref, string mod, string file_path); -VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preferences* pref, string mod, string path); +VV_LOCAL_SYMBOL _option_string v__util__mod_path_to_full_name(v__pref__Preferences* pref, string mod, string path); Array_u8 _const_v__util__invalid_escapes; // inited later #define _const_v__util__backslash 92 #define _const_v__util__backslash_r 13 @@ -8974,19 +8984,19 @@ Array_string _const_v__util__builtin_module_names; // inited later bool v__util__module_is_builtin(string mod); string v__util__tabs(int n); void v__util__set_vroot_folder(string vroot_path); -Option_string v__util__resolve_vmodroot(string str, string dir); -Option_string v__util__resolve_env_value(string str, bool check_for_presence); +_option_string v__util__resolve_vmodroot(string str, string dir); +_option_string v__util__resolve_env_value(string str, bool check_for_presence); void v__util__launch_tool(bool is_verbose, string tool_name, Array_string args); bool v__util__should_recompile_tool(string vexe, string tool_source, string tool_name, string tool_exe); VV_LOCAL_SYMBOL multi_return_string_string v__util__tool_source2name_and_exe(string tool_source); string v__util__quote_path(string s); string v__util__args_quote_paths(Array_string args); string v__util__path_of_executable(string path); -Option_string v__util__cached_read_source_file(string path); +_option_string v__util__cached_read_source_file(string path); string v__util__replace_op(string s); Array_string v__util__join_env_vflags_and_os_args(void); 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); +_option_bool v__util__check_module_is_installed(string modulename, bool is_verbose); void v__util__ensure_modules_for_all_tools_are_installed(bool is_verbose); string v__util__strip_mod_name(string name); string v__util__strip_main_name(string name); @@ -8997,9 +9007,9 @@ void v__util__prepare_tool_when_needed(string source_name); void v__util__recompile_file(string vexe, string file); string v__util__get_vtmp_folder(void); bool v__util__should_bundle_module(string mod); -Option_Array_string v__util__find_all_v_files(Array_string roots); +_option_Array_string v__util__find_all_v_files(Array_string roots); void v__util__free_caches(void); -Option_string v__util__read_file(string file_path); +_option_string v__util__read_file(string file_path); voidptr _const_sync__pool__no_result; // inited later sync__pool__PoolProcessor* sync__pool__new_pool_processor(sync__pool__PoolProcessorConfig context); void sync__pool__PoolProcessor_set_max_jobs(sync__pool__PoolProcessor* pool, int njobs); @@ -9016,7 +9026,7 @@ string v__ast__ComptimeType_str(v__ast__ComptimeType cty); v__ast__Expr v__ast__empty_expr(void); v__ast__Stmt v__ast__empty_stmt(void); v__ast__Node v__ast__empty_node(void); -Option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e); +_option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e); bool v__ast__StructField_equals(v__ast__StructField* f, v__ast__StructField* o); void v__ast__File_free(v__ast__File* f); bool v__ast__Ident_is_mut(v__ast__Ident* i); @@ -9034,7 +9044,7 @@ bool v__ast__Expr_is_expr(v__ast__Expr expr); bool v__ast__Expr_is_lit(v__ast__Expr expr); bool v__ast__Expr_is_auto_deref_var(v__ast__Expr expr); bool v__ast__Expr_is_lockable(v__ast__Expr* e); -Option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt); +_option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt); v__token__Pos v__ast__Node_pos(v__ast__Node node); 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); @@ -9047,22 +9057,22 @@ VV_LOCAL_SYMBOL v__token__KeywordsMatcher v__ast__build_builtin_type_names_match string v__ast__Attr_debug(v__ast__Attr* a); string v__ast__Attr_str(v__ast__Attr* a); bool Array_v__ast__Attr_contains(Array_v__ast__Attr attrs, string str); -Option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs); +_option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs); VV_LOCAL_SYMBOL bool v__ast__Table_has_cflag(v__ast__Table* t, v__cflag__CFlag flag); -Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines); +_option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines); v__ast__ComptTimeConstValue v__ast__empty_comptime_const_expr(void); -Option_i8 v__ast__ComptTimeConstValue_i8(v__ast__ComptTimeConstValue val); -Option_i16 v__ast__ComptTimeConstValue_i16(v__ast__ComptTimeConstValue val); -Option_int v__ast__ComptTimeConstValue_int(v__ast__ComptTimeConstValue val); -Option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val); -Option_u8 v__ast__ComptTimeConstValue_u8(v__ast__ComptTimeConstValue val); -Option_u16 v__ast__ComptTimeConstValue_u16(v__ast__ComptTimeConstValue val); -Option_u32 v__ast__ComptTimeConstValue_u32(v__ast__ComptTimeConstValue val); -Option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val); -Option_f32 v__ast__ComptTimeConstValue_f32(v__ast__ComptTimeConstValue val); -Option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val); -Option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val); -Option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast__ConstField* obj); +_option_i8 v__ast__ComptTimeConstValue_i8(v__ast__ComptTimeConstValue val); +_option_i16 v__ast__ComptTimeConstValue_i16(v__ast__ComptTimeConstValue val); +_option_int v__ast__ComptTimeConstValue_int(v__ast__ComptTimeConstValue val); +_option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val); +_option_u8 v__ast__ComptTimeConstValue_u8(v__ast__ComptTimeConstValue val); +_option_u16 v__ast__ComptTimeConstValue_u16(v__ast__ComptTimeConstValue val); +_option_u32 v__ast__ComptTimeConstValue_u32(v__ast__ComptTimeConstValue val); +_option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val); +_option_f32 v__ast__ComptTimeConstValue_f32(v__ast__ComptTimeConstValue val); +_option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val); +_option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val); +_option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast__ConstField* obj); bool v__ast__ConstField_is_simple_define_const(v__ast__ConstField* obj); bool v__ast__ScopeObject_is_simple_define_const(v__ast__ScopeObject obj); u64 v__ast__EmbeddedFile_hash(v__ast__EmbeddedFile e); @@ -9070,11 +9080,11 @@ v__ast__Expr v__ast__resolve_init(v__ast__StructInit node, v__ast__Type typ, v__ Array_string _const_v__ast__native_builtins; // inited later void v__ast__Scope_free(v__ast__Scope* s); VV_LOCAL_SYMBOL bool v__ast__Scope_dont_lookup_parent(v__ast__Scope* s); -Option_v__ast__ScopeObject v__ast__Scope_find(v__ast__Scope* s, string name); -Option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s, string name, v__ast__Type struct_type, string field_name); -Option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name); -Option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, string name); -Option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string name); +_option_v__ast__ScopeObject v__ast__Scope_find(v__ast__Scope* s, string name); +_option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s, string name, v__ast__Type struct_type, string field_name); +_option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name); +_option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, string name); +_option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string name); bool v__ast__Scope_known_var(v__ast__Scope* s, string name); 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); @@ -9115,29 +9125,29 @@ void v__ast__set_global_table(v__ast__Table* t); string v__ast__Table_fn_type_signature(v__ast__Table* t, v__ast__Fn* f); 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); -Option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name); +_option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name); bool v__ast__Table_known_fn(v__ast__Table* t, string name); void v__ast__Table_mark_module_as_deprecated(v__ast__Table* t, string mname, string message); void v__ast__Table_mark_module_as_deprecated_after(v__ast__Table* t, string mname, string after_date); void v__ast__Table_register_fn(v__ast__Table* t, v__ast__Fn new_fn); void v__ast__Table_register_interface(v__ast__Table* t, v__ast__InterfaceDecl idecl); 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); +_option_v__ast__Fn v__ast__Table_register_aggregate_method(v__ast__Table* t, v__ast__TypeSymbol* sym, string name); bool v__ast__Table_has_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name); -Option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name); +_option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name); Array_Array_v__ast__Type v__ast__Table_get_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, v__ast__GetEmbedsOptions options); -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); -Option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name); +_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); +_option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name); Array_v__ast__Fn v__ast__Table_get_embed_methods(v__ast__Table* t, v__ast__TypeSymbol* sym); -VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Table_register_aggregate_field(v__ast__Table* t, v__ast__TypeSymbol* sym, string name); +VV_LOCAL_SYMBOL _option_v__ast__StructField v__ast__Table_register_aggregate_field(v__ast__Table* t, v__ast__TypeSymbol* sym, string name); bool v__ast__Table_struct_has_field(v__ast__Table* t, v__ast__TypeSymbol* struct_, string name); Array_v__ast__StructField v__ast__Table_struct_fields(v__ast__Table* t, v__ast__TypeSymbol* sym); -Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__TypeSymbol* s, string name); -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); -Option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name); +_option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__TypeSymbol* s, string name); +_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); +_option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name); void v__ast__Table_resolve_common_sumtype_fields(v__ast__Table* t, v__ast__TypeSymbol* sym_); int v__ast__Table_find_type_idx(v__ast__Table* t, string name); -Option_v__ast__TypeSymbol_ptr v__ast__Table_find_sym(v__ast__Table* t, string name); +_option_v__ast__TypeSymbol_ptr v__ast__Table_find_sym(v__ast__Table* t, string name); multi_return_ref_v__ast__TypeSymbol_int v__ast__Table_find_sym_and_type_idx(v__ast__Table* t, string name); v__ast__TypeSymbol* _const_v__ast__invalid_type_symbol; // inited later v__ast__TypeSymbol* v__ast__Table_sym_by_idx(v__ast__Table* t, int idx); @@ -9188,7 +9198,7 @@ bool v__ast__Table_has_deep_child_no_ref(v__ast__Table* t, v__ast__TypeSymbol* t void v__ast__Table_complete_interface_check(v__ast__Table* t); v__ast__Type v__ast__Table_bitsize_to_type(v__ast__Table* t, int bit_size); bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type typ, v__ast__Type inter_typ); -Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, v__ast__Type generic_type, Array_string generic_names, Array_v__ast__Type concrete_types); +_option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, v__ast__Type generic_type, Array_string generic_names, Array_v__ast__Type concrete_types); v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type typ, Array_string generic_names, Array_v__ast__Type concrete_types); void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Array_v__ast__Type generic_types); void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t); @@ -9348,29 +9358,29 @@ string v__ast__TypeSymbol_symbol_name_except_generic(v__ast__TypeSymbol* t); string v__ast__TypeSymbol_embed_name(v__ast__TypeSymbol* t); bool v__ast__TypeSymbol_has_method(v__ast__TypeSymbol* t, string name); bool v__ast__TypeSymbol_has_method_with_generic_parent(v__ast__TypeSymbol* t, string name); -Option_v__ast__Fn v__ast__TypeSymbol_find_method(v__ast__TypeSymbol* t, string name); -Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__TypeSymbol* t, string name); +_option_v__ast__Fn v__ast__TypeSymbol_find_method(v__ast__TypeSymbol* t, string name); +_option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__TypeSymbol* t, string name); bool v__ast__TypeSymbol_is_js_compatible(v__ast__TypeSymbol* t); multi_return_bool_bool_int v__ast__TypeSymbol_str_method_info(v__ast__TypeSymbol* t); -Option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name); -VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Aggregate_find_field(v__ast__Aggregate* a, string name); -Option_v__ast__StructField v__ast__Interface_find_field(v__ast__Interface* i, string name); -Option_v__ast__Fn v__ast__Interface_find_method(v__ast__Interface* i, string name); +_option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name); +VV_LOCAL_SYMBOL _option_v__ast__StructField v__ast__Aggregate_find_field(v__ast__Aggregate* a, string name); +_option_v__ast__StructField v__ast__Interface_find_field(v__ast__Interface* i, string name); +_option_v__ast__Fn v__ast__Interface_find_method(v__ast__Interface* i, string name); bool v__ast__Interface_has_method(v__ast__Interface* i, string name); -Option_v__ast__StructField v__ast__Struct_find_field(v__ast__Struct* s, string name); +_option_v__ast__StructField v__ast__Struct_find_field(v__ast__Struct* s, string name); v__ast__StructField v__ast__Struct_get_field(v__ast__Struct* s, string name); -Option_v__ast__StructField v__ast__SumType_find_field(v__ast__SumType* s, string name); +_option_v__ast__StructField v__ast__SumType_find_field(v__ast__SumType* s, string name); bool v__ast__Interface_defines_method(v__ast__Interface* i, string name); void v__checker__Checker_assign_stmt(v__checker__Checker* c, v__ast__AssignStmt* node); bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); -Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg); +_option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg); VV_LOCAL_SYMBOL bool v__checker__Checker_check_same_module(v__checker__Checker _v_toheap_c, v__ast__Type got, v__ast__Type expected); bool v__checker__Checker_check_basic(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); bool v__checker__Checker_check_matching_function_symbols(v__checker__Checker* c, v__ast__TypeSymbol* got_type_sym, v__ast__TypeSymbol* exp_type_sym); 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); v__ast__Type v__checker__Checker_promote(v__checker__Checker* c, v__ast__Type left_type, v__ast__Type right_type); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_promote_num(v__checker__Checker* c, v__ast__Type left_type, v__ast__Type right_type); -Option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); +_option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); VV_LOCAL_SYMBOL string v__checker__Checker_expected_msg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected); bool v__checker__Checker_symmetric_check(v__checker__Checker* c, v__ast__Type left, v__ast__Type right); void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__Fn func, v__ast__CallExpr* node); @@ -9439,9 +9449,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast(v__checker__Checker* c, v__as v__ast__Type v__checker__Checker_select_expr(v__checker__Checker* c, v__ast__SelectExpr* node); v__ast__Type v__checker__Checker_lock_expr(v__checker__Checker* c, v__ast__LockExpr* node); v__ast__Type v__checker__Checker_unsafe_expr(v__checker__Checker* c, v__ast__UnsafeExpr* node); -VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_definition(v__checker__Checker* c, v__ast__Ident ident); -VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_obj_definition(v__checker__Checker* c, v__ast__ScopeObject obj); -VV_LOCAL_SYMBOL Option_bool v__checker__Checker_has_return(v__checker__Checker* c, Array_v__ast__Stmt stmts); +VV_LOCAL_SYMBOL _option_v__ast__Expr v__checker__Checker_find_definition(v__checker__Checker* c, v__ast__Ident ident); +VV_LOCAL_SYMBOL _option_v__ast__Expr v__checker__Checker_find_obj_definition(v__checker__Checker* c, v__ast__ScopeObject obj); +VV_LOCAL_SYMBOL _option_bool v__checker__Checker_has_return(v__checker__Checker* c, Array_v__ast__Stmt stmts); v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__PostfixExpr* node); void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr* node, bool as_interface); string v__checker__Checker_get_base_name(v__checker__Checker* c, v__ast__Expr* node); @@ -9461,12 +9471,12 @@ VV_LOCAL_SYMBOL void v__checker__Checker_warn_or_error(v__checker__Checker* c, s VV_LOCAL_SYMBOL bool v__checker__Checker_fileis(v__checker__Checker* c, string s); VV_LOCAL_SYMBOL string v__checker__Checker_fetch_field_name(v__checker__Checker* c, v__ast__StructField field); VV_LOCAL_SYMBOL void v__checker__Checker_trace(v__checker__Checker* c, string fbase, string message); -VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__Checker* c, v__ast__Type typ, v__token__Pos pos); +VV_LOCAL_SYMBOL _option_void v__checker__Checker_ensure_type_exists(v__checker__Checker* c, v__ast__Type typ, v__token__Pos pos); void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr expr, v__ast__Type typ, string what); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Checker* c, v__ast__ComptimeCall* node); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_selector(v__checker__Checker* c, v__ast__ComptimeSelector* node); VV_LOCAL_SYMBOL void v__checker__Checker_comptime_for(v__checker__Checker* c, v__ast__ComptimeFor node); -VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comptime_const_expr(v__checker__Checker* c, v__ast__Expr expr, int nlevel); +VV_LOCAL_SYMBOL _option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comptime_const_expr(v__checker__Checker* c, v__ast__Expr expr, int nlevel); VV_LOCAL_SYMBOL multi_return_bool_int_int v__checker__Checker_verify_vweb_params_for_method(v__checker__Checker* c, v__ast__Fn node); VV_LOCAL_SYMBOL void v__checker__Checker_verify_all_vweb_routes(v__checker__Checker* c); VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__checker__Checker* c, v__ast__Attr* node); @@ -9486,7 +9496,7 @@ 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); VV_LOCAL_SYMBOL string v__checker__semicolonize(string main, string details); VV_LOCAL_SYMBOL void v__checker__Checker_post_process_generic_fns(v__checker__Checker* c); -Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Fn* f); +_option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Fn* f); 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); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Type left_type, v__ast__TypeSymbol left_sym); VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Type left_type, v__ast__TypeSymbol left_sym); @@ -9591,7 +9601,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__CallExpr node); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_stmt(v__gen__c__Gen* g, v__ast__AssertStmt original_assert_statement); IError _const_v__gen__c__unsupported_ctemp_assert_transform; // inited later -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); +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); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_postfailure_mode(v__gen__c__Gen* g, v__ast__AssertStmt node); VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ast__AssertStmt node); 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); @@ -9647,6 +9657,7 @@ 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 +string _const_v__gen__c__option_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); @@ -9728,6 +9739,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_char_literal(v__gen__c__Gen* g, v__ast__Char VV_LOCAL_SYMBOL void v__gen__c__Gen_type_name(v__gen__c__Gen* g, v__ast__Type raw_type); VV_LOCAL_SYMBOL void v__gen__c__Gen_typeof_expr(v__gen__c__Gen* g, v__ast__TypeOf node); VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__SelectorExpr node); +VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_decl(v__gen__c__Gen* g, v__ast__EnumDecl node); VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_expr(v__gen__c__Gen* g, v__ast__Expr node); VV_LOCAL_SYMBOL void v__gen__c__Gen_lock_expr(v__gen__c__Gen* g, v__ast__LockExpr node); VV_LOCAL_SYMBOL void v__gen__c__Gen_unlock_locks(v__gen__c__Gen* g); @@ -9807,7 +9819,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_at(v__gen__c__Gen* g, v__ast__AtExp VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_if(v__gen__c__Gen* g, v__ast__IfExpr node); VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__Expr cond, bool pkg_exist); VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__ComptimeFor node); -VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen* g, string name, bool is_comptime_optional); +VV_LOCAL_SYMBOL _option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen* g, string name, bool is_comptime_optional); VV_LOCAL_SYMBOL v__ast__CTempVar v__gen__c__Gen_new_ctemp_var(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type expr_type); VV_LOCAL_SYMBOL v__ast__CTempVar v__gen__c__Gen_new_ctemp_var_then_gen(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type expr_type); VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_ctemp_var(v__gen__c__Gen* g, v__ast__CTempVar tvar); @@ -9821,7 +9833,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embedded_data(v__gen__c__Gen* g); VV_LOCAL_SYMBOL bool v__gen__c__Gen_is_used_by_main(v__gen__c__Gen* g, v__ast__FnDecl node); VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_decl(v__gen__c__Gen* g, v__ast__FnDecl node); 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); +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 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); @@ -9931,9 +9943,8 @@ rune _const_v__scanner__num_sep = '_'; // precomputed #define _const_v__scanner__b_lf 10 #define _const_v__scanner__b_cr 13 #define _const_v__scanner__backslash '\\' -Option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref); +_option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref); v__scanner__Scanner* v__scanner__new_scanner(string text, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref); -VV_LOCAL_SYMBOL void v__scanner__Scanner_init_scanner(v__scanner__Scanner* s); void v__scanner__Scanner_free(v__scanner__Scanner* s); VV_LOCAL_SYMBOL bool v__scanner__Scanner_should_parse_comment(v__scanner__Scanner* s); void v__scanner__Scanner_set_is_inside_toplevel_statement(v__scanner__Scanner* s, bool newstate); @@ -9950,10 +9961,9 @@ VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_dec_number(v__scanner__Scanner* VV_LOCAL_SYMBOL string v__scanner__Scanner_ident_number(v__scanner__Scanner* s); VV_LOCAL_SYMBOL void v__scanner__Scanner_skip_whitespace(v__scanner__Scanner* s); VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_end_of_file(v__scanner__Scanner* s); -void v__scanner__Scanner_scan_all_tokens_in_buffer(v__scanner__Scanner* s, v__scanner__CommentsMode mode); +void v__scanner__Scanner_scan_all_tokens_in_buffer(v__scanner__Scanner* s); void v__scanner__Scanner_scan_remaining_text(v__scanner__Scanner* s); v__token__Token v__scanner__Scanner_scan(v__scanner__Scanner* s); -v__token__Token v__scanner__Scanner_buffer_scan(v__scanner__Scanner* s); v__token__Token v__scanner__Scanner_peek_token(v__scanner__Scanner* s, int n); VV_LOCAL_SYMBOL u8 v__scanner__Scanner_look_ahead(v__scanner__Scanner* s, int n); VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_text_scan(v__scanner__Scanner* s); @@ -9978,12 +9988,12 @@ void v__scanner__Scanner_warn(v__scanner__Scanner* s, string msg); void v__scanner__Scanner_error(v__scanner__Scanner* s, string msg); VV_LOCAL_SYMBOL void v__scanner__Scanner_vet_error(v__scanner__Scanner* s, string msg, v__vet__FixKind fix); VV_LOCAL_SYMBOL void v__scanner__Scanner_trace(v__scanner__Scanner* s, string fbase, string message); -Option_void v__ast__walker__Inspector_visit(v__ast__walker__Inspector* i, v__ast__Node* node); +_option_void v__ast__walker__Inspector_visit(v__ast__walker__Inspector* i, v__ast__Node* node); void v__ast__walker__inspect(v__ast__Node* node, voidptr data, bool (*inspector_callback)(v__ast__Node* node, voidptr data)); void v__ast__walker__walk(v__ast__walker__Visitor* visitor, v__ast__Node* node); VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_assign_stmt(v__parser__Parser* p); #define _const_v__parser__max_expr_level 100 -VV_LOCAL_SYMBOL Option_void v__parser__Parser_check_undefined_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val); +VV_LOCAL_SYMBOL _option_void v__parser__Parser_check_undefined_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val); VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val); VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Parser* p, Array_v__ast__Expr left, Array_v__ast__Comment left_comments); Array_string _const_v__parser__supported_comptime_calls; // inited later @@ -9998,7 +10008,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser VV_LOCAL_SYMBOL v__ast__MapInit v__parser__Parser_map_init(v__parser__Parser* p); VV_LOCAL_SYMBOL void v__parser__Parser_scope_register_it_as_index(v__parser__Parser* p); v__ast__Expr v__parser__Parser_expr(v__parser__Parser* p, int precedence); -Option_v__ast__Expr v__parser__Parser_check_expr(v__parser__Parser* p, int precedence); +_option_v__ast__Expr v__parser__Parser_check_expr(v__parser__Parser* p, int precedence); v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr left, int precedence, bool is_stmt_ident); VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_infix_expr(v__parser__Parser* p, v__ast__Expr left); VV_LOCAL_SYMBOL bool v__parser__Parser_fileis(v__parser__Parser* p, string s); @@ -10007,7 +10017,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_recast_as_pointer(v__parser__Parser* p, v v__ast__CallExpr v__parser__Parser_call_expr(v__parser__Parser* p, v__ast__Language language, string mod); Array_v__ast__CallArg v__parser__Parser_call_args(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p); -VV_LOCAL_SYMBOL Option_void v__parser__Parser_fn_receiver(v__parser__Parser* p, Array_v__ast__Param* params, v__parser__ReceiverParsingInfo* rec); +VV_LOCAL_SYMBOL _option_void v__parser__Parser_fn_receiver(v__parser__Parser* p, Array_v__ast__Param* params, v__parser__ReceiverParsingInfo* rec); VV_LOCAL_SYMBOL v__ast__AnonFn v__parser__Parser_anon_fn(v__parser__Parser* p); VV_LOCAL_SYMBOL multi_return_Array_v__ast__Param_bool_bool v__parser__Parser_fn_args(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__GoExpr v__parser__Parser_go_expr(v__parser__Parser* p); @@ -10139,7 +10149,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_trace(v__parser__Parser* p, string fbase, VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_sql_expr(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__SqlStmt v__parser__Parser_sql_stmt(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__parser__Parser* p); -VV_LOCAL_SYMBOL Option_bool v__parser__Parser_check_sql_keyword(v__parser__Parser* p, string name); +VV_LOCAL_SYMBOL _option_bool v__parser__Parser_check_sql_keyword(v__parser__Parser* p, string name); VV_LOCAL_SYMBOL v__ast__StructDecl v__parser__Parser_struct_decl(v__parser__Parser* p); VV_LOCAL_SYMBOL v__ast__StructInit v__parser__Parser_struct_init(v__parser__Parser* p, string typ_str, bool short_syntax); VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser__Parser* p); @@ -10152,11 +10162,11 @@ void v__callgraph__show(v__ast__Table* table, v__pref__Preferences* pref, Array_ VV_LOCAL_SYMBOL string v__callgraph__Mapper_dot_normalise_node_name(v__callgraph__Mapper* m, string name); VV_LOCAL_SYMBOL string v__callgraph__Mapper_fn_name(v__callgraph__Mapper* m, string fname, v__ast__Type receiver_type, bool is_method); VV_LOCAL_SYMBOL string v__callgraph__Mapper_dot_fn_name(v__callgraph__Mapper* m, string fname, v__ast__Type recv_type, bool is_method); -VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node); +VV_LOCAL_SYMBOL _option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node); v__builder__Builder v__builder__new_builder(v__pref__Preferences* pref); -Option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_string v_files); -Option_void v__builder__Builder_middle_stages(v__builder__Builder* b); -Option_void v__builder__Builder_front_and_middle_stages(v__builder__Builder* b, Array_string v_files); +_option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_string v_files); +_option_void v__builder__Builder_middle_stages(v__builder__Builder* b); +_option_void v__builder__Builder_front_and_middle_stages(v__builder__Builder* b, Array_string v_files); void v__builder__Builder_parse_imports(v__builder__Builder* b); void v__builder__Builder_resolve_deps(v__builder__Builder* b); v__depgraph__DepGraph* v__builder__Builder_import_graph(v__builder__Builder* b); @@ -10164,7 +10174,7 @@ Array_string v__builder__Builder_v_files_from_dir(v__builder__Builder* b, string void v__builder__Builder_log(v__builder__Builder* b, string s); void v__builder__Builder_info(v__builder__Builder* b, string s); string v__builder__module_path(string mod); -Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, string mod, string fpath); +_option_string v__builder__Builder_find_module_path(v__builder__Builder* b, string mod, string fpath); void v__builder__Builder_show_total_warns_and_errors_stats(v__builder__Builder* b); void v__builder__Builder_print_warnings_and_errors(v__builder__Builder* b); v__errors__Error v__builder__Builder_error_with_pos(v__builder__Builder* b, string s, string fpath, v__token__Pos pos); @@ -10172,7 +10182,7 @@ void v__builder__verror(string s); string _const_v__builder__c_verror_message_marker; // a string literal, inited later string _const_v__builder__c_error_info; // a string literal, inited later string _const_v__builder__no_compiler_error; // a string literal, inited later -Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v); +_option_void v__builder__Builder_find_win_cc(v__builder__Builder* v); VV_LOCAL_SYMBOL void v__builder__Builder_show_c_compiler_output(v__builder__Builder* v, os__Result res); VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__builder__Builder* v, os__Result res); VV_LOCAL_SYMBOL void v__builder__Builder_show_cc(v__builder__Builder* v, string cmd, string response_file, string response_file_content); @@ -10206,15 +10216,15 @@ v__builder__RegKey _const_v__builder__hkey_local_machine; // inited later #define _const_v__builder__key_query_value 1 #define _const_v__builder__key_wow64_32key 512 #define _const_v__builder__key_enumerate_sub_keys 8 -VV_LOCAL_SYMBOL Option_string v__builder__find_windows_kit_internal(v__builder__RegKey key, Array_string versions); -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root(string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_reg(string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__new_windows_kit(string kit_root, string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_env(string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs(string vswhere_dir, string host_arch, string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(string vswhere_dir, string host_arch, string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_env(string host_arch, string target_arch); -VV_LOCAL_SYMBOL Option_v__builder__MsvcResult v__builder__find_msvc(bool m64_target); +VV_LOCAL_SYMBOL _option_string v__builder__find_windows_kit_internal(v__builder__RegKey key, Array_string versions); +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root(string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_reg(string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__new_windows_kit(string kit_root, string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_env(string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs(string vswhere_dir, string host_arch, string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs_by_reg(string vswhere_dir, string host_arch, string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs_by_env(string host_arch, string target_arch); +VV_LOCAL_SYMBOL _option_v__builder__MsvcResult v__builder__find_msvc(bool m64_target); void v__builder__Builder_cc_msvc(v__builder__Builder* v); VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file_with_msvc(v__builder__Builder* v, string path, Array_v__cflag__CFlag moduleflags); v__builder__MsvcStringFlags v__builder__msvc_string_flags(Array_v__cflag__CFlag cflags); @@ -10713,7 +10723,7 @@ const int _v__ast__walker__Visitor_v__callgraph__Mapper_index = 1; // Methods wrapper for interface "v__ast__walker__Visitor" struct _v__ast__walker__Visitor_interface_methods { - Option_void (*_method_visit)(void* _, v__ast__Node* node); + _option_void (*_method_visit)(void* _, v__ast__Node* node); }; struct _v__ast__walker__Visitor_interface_methods v__ast__walker__Visitor_name_table[2] = { @@ -10835,6 +10845,7 @@ void vinit_string_literals(void){ _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__option_name = _SLIT("_option"); _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"); @@ -11270,59 +11281,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 469: return str_intp(2, _MOV((StrIntpData[]){ + case 470: 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 471: return str_intp(2, _MOV((StrIntpData[]){ + case 472: 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 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__Array_str(*(v__ast__Array*)x._v__ast__Array, 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__ArrayFixed_str(*(v__ast__ArrayFixed*)x._v__ast__ArrayFixed, 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__Chan_str(*(v__ast__Chan*)x._v__ast__Chan, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 485: return str_intp(2, _MOV((StrIntpData[]){ + case 486: 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 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__FnType_str(*(v__ast__FnType*)x._v__ast__FnType, 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__GenericInst_str(*(v__ast__GenericInst*)x._v__ast__GenericInst, 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__Interface_str(*(v__ast__Interface*)x._v__ast__Interface, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 452: return str_intp(2, _MOV((StrIntpData[]){ + case 453: 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 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__MultiReturn_str(*(v__ast__MultiReturn*)x._v__ast__MultiReturn, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); - case 456: return str_intp(2, _MOV((StrIntpData[]){ + case 457: 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 475: return str_intp(2, _MOV((StrIntpData[]){ + case 476: 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 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__Thread_str(*(v__ast__Thread*)x._v__ast__Thread, indent_count)}}, {_SLIT(")"), 0, {.d_c = 0 }} })); @@ -11783,212 +11794,212 @@ static string indent_v__ast__StructField_str(v__ast__StructField it, int indent_ 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 = 302}; + return (v__ast__Expr){ ._v__ast__EmptyExpr = ptr, ._typ = 303}; } 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 = 344, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EmptyStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__EmptyStmt = ptr, ._typ = 345, .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 = 367}; + return (v__ast__Node){ ._v__ast__EmptyNode = ptr, ._typ = 368}; } 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 = 335}; + return (v__ast__Node){ ._v__ast__Expr = ptr, ._typ = 336}; } 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 = 360}; + return (v__ast__Node){ ._v__ast__Stmt = ptr, ._typ = 361}; } 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 = 374}; + return (v__ast__Node){ ._v__ast__StructInitField = ptr, ._typ = 375}; } 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 = 219, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__FnDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__FnDecl = ptr, ._typ = 220, .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 = 366}; + return (v__ast__Node){ ._v__ast__CallArg = ptr, ._typ = 367}; } 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 = 320}; + return (v__ast__Expr){ ._v__ast__OrExpr = ptr, ._typ = 321}; } 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 = 369}; + return (v__ast__Node){ ._v__ast__IfBranch = ptr, ._typ = 370}; } 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 = 370}; + return (v__ast__Node){ ._v__ast__MatchBranch = ptr, ._typ = 371}; } 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 = 372}; + return (v__ast__Node){ ._v__ast__SelectBranch = ptr, ._typ = 373}; } 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 = 373}; + return (v__ast__Node){ ._v__ast__StructField = ptr, ._typ = 374}; } 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 = 363}; + return (v__ast__Node){ ._v__ast__GlobalField = ptr, ._typ = 364}; } 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 = 362}; + return (v__ast__Node){ ._v__ast__ConstField = ptr, ._typ = 363}; } 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 = 368}; + return (v__ast__Node){ ._v__ast__EnumField = ptr, ._typ = 369}; } 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 = 371}; + return (v__ast__Node){ ._v__ast__Param = ptr, ._typ = 372}; } 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 = 332}; + return (v__ast__Expr){ ._v__ast__TypeNode = ptr, ._typ = 333}; } 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 = 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))}; + return (v__ast__ScopeObject){ ._v__ast__AsmRegister = ptr, ._typ = 362, .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 = 302}; + return (v__ast__ComptTimeConstValue){ ._v__ast__EmptyExpr = ptr, ._typ = 303}; } 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 = 286}; + return (v__ast__Expr){ ._v__ast__ArrayInit = ptr, ._typ = 287}; } 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 = 330}; + return (v__ast__Expr){ ._v__ast__StringLiteral = ptr, ._typ = 331}; } 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 = 315}; + return (v__ast__Expr){ ._v__ast__MapInit = ptr, ._typ = 316}; } 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 = 331}; + return (v__ast__Expr){ ._v__ast__StructInit = ptr, ._typ = 332}; } 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 = 475}; + return (v__ast__TypeInfo){ ._v__ast__SumType = ptr, ._typ = 476}; } 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 = 480}; + return (v__ast__TypeInfo){ ._v__ast__Chan = ptr, ._typ = 481}; } 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 = 452}; + return (v__ast__TypeInfo){ ._v__ast__Map = ptr, ._typ = 453}; } 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 = 481}; + return (v__ast__TypeInfo){ ._v__ast__Thread = ptr, ._typ = 482}; } 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 = 456}; + return (v__ast__TypeInfo){ ._v__ast__Struct = ptr, ._typ = 457}; } 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 = 451}; + return (v__ast__TypeInfo){ ._v__ast__Array = ptr, ._typ = 452}; } 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 = 479}; + return (v__ast__TypeInfo){ ._v__ast__ArrayFixed = ptr, ._typ = 480}; } 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 = 482}; + return (v__ast__TypeInfo){ ._v__ast__MultiReturn = ptr, ._typ = 483}; } 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 = 483}; + return (v__ast__TypeInfo){ ._v__ast__FnType = ptr, ._typ = 484}; } 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 = 318}; + return (v__ast__Expr){ ._v__ast__None = ptr, ._typ = 319}; } 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 = 474}; + return (v__ast__TypeInfo){ ._v__ast__Interface = ptr, ._typ = 475}; } 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 = 416}; + return (v__ast__IdentInfo){ ._v__ast__IdentVar = ptr, ._typ = 417}; } 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 = 310}; + return (v__ast__Expr){ ._v__ast__InfixExpr = ptr, ._typ = 311}; } 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 = 293}; + return (v__ast__Expr){ ._v__ast__CastExpr = ptr, ._typ = 294}; } 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 = 361}; + return (v__ast__AsmArg){ ._v__ast__AsmRegister = ptr, ._typ = 362}; } 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 = 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))}; + return (v__ast__ScopeObject){ ._v__ast__Var = ptr, ._typ = 365, .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 = 415}; + return (v__ast__IdentInfo){ ._v__ast__IdentFn = ptr, ._typ = 416}; } 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 = 309}; + return (v__ast__Expr){ ._v__ast__IndexExpr = ptr, ._typ = 310}; } static inline v__ast__ComptTimeConstValue int_to_sumtype_v__ast__ComptTimeConstValue(int* x) { @@ -12053,402 +12064,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 = 357, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Return, pos))}; + return (v__ast__Stmt){ ._v__ast__Return = ptr, ._typ = 358, .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 = 469}; + return (v__ast__TypeInfo){ ._v__ast__Aggregate = ptr, ._typ = 470}; } 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 = 306}; + return (v__ast__Expr){ ._v__ast__Ident = ptr, ._typ = 307}; } 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 = 337, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssertStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AssertStmt = ptr, ._typ = 338, .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 = 307}; + return (v__ast__Expr){ ._v__ast__IfExpr = ptr, ._typ = 308}; } 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 = 290}; + return (v__ast__Expr){ ._v__ast__BoolLiteral = ptr, ._typ = 291}; } 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 = 316}; + return (v__ast__Expr){ ._v__ast__MatchExpr = ptr, ._typ = 317}; } 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 = 347, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForCStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForCStmt = ptr, ._typ = 348, .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 = 349, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForStmt = ptr, ._typ = 350, .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 = 355, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__InterfaceDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__InterfaceDecl = ptr, ._typ = 356, .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 = 292}; + return (v__ast__Expr){ ._v__ast__CallExpr = ptr, ._typ = 293}; } 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 = 311}; + return (v__ast__Expr){ ._v__ast__IntegerLiteral = ptr, ._typ = 312}; } 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 = 304}; + return (v__ast__Expr){ ._v__ast__FloatLiteral = ptr, ._typ = 305}; } 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 = 328}; + return (v__ast__Expr){ ._v__ast__SqlExpr = ptr, ._typ = 329}; } 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 = 291}; + return (v__ast__Expr){ ._v__ast__CTempVar = ptr, ._typ = 292}; } 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 = 326}; + return (v__ast__Expr){ ._v__ast__SelectorExpr = ptr, ._typ = 327}; } 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 = 348, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ForInStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ForInStmt = ptr, ._typ = 349, .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 = 346, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ExprStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__ExprStmt = ptr, ._typ = 347, .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 = 317, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__NodeError, pos))}; + return (v__ast__Stmt){ ._v__ast__NodeError = ptr, ._typ = 318, .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 = 338, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AssignStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AssignStmt = ptr, ._typ = 339, .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 = 297}; + return (v__ast__Expr){ ._v__ast__ComptimeCall = ptr, ._typ = 298}; } 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 = 298}; + return (v__ast__Expr){ ._v__ast__ComptimeSelector = ptr, ._typ = 299}; } 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 = 317}; + return (v__ast__Expr){ ._v__ast__NodeError = ptr, ._typ = 318}; } 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 = 296}; + return (v__ast__Expr){ ._v__ast__Comment = ptr, ._typ = 297}; } 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 = 303}; + return (v__ast__Expr){ ._v__ast__EnumVal = ptr, ._typ = 304}; } 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 = 289}; + return (v__ast__Expr){ ._v__ast__AtExpr = ptr, ._typ = 290}; } 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 = 299}; + return (v__ast__Expr){ ._v__ast__ComptimeType = ptr, ._typ = 300}; } 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 = 295}; + return (v__ast__Expr){ ._v__ast__CharLiteral = ptr, ._typ = 296}; } 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 = 305}; + return (v__ast__Expr){ ._v__ast__GoExpr = ptr, ._typ = 306}; } 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 = 325}; + return (v__ast__Expr){ ._v__ast__SelectExpr = ptr, ._typ = 326}; } 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 = 321}; + return (v__ast__Expr){ ._v__ast__ParExpr = ptr, ._typ = 322}; } 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 = 334}; + return (v__ast__Expr){ ._v__ast__UnsafeExpr = ptr, ._typ = 335}; } 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 = 314}; + return (v__ast__Expr){ ._v__ast__LockExpr = ptr, ._typ = 315}; } 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 = 312}; + return (v__ast__Expr){ ._v__ast__IsRefType = ptr, ._typ = 313}; } 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 = 327}; + return (v__ast__Expr){ ._v__ast__SizeOf = ptr, ._typ = 328}; } 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 = 333}; + return (v__ast__Expr){ ._v__ast__TypeOf = ptr, ._typ = 334}; } 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 = 301}; + return (v__ast__Expr){ ._v__ast__DumpExpr = ptr, ._typ = 302}; } 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 = 319}; + return (v__ast__Expr){ ._v__ast__OffsetOf = ptr, ._typ = 320}; } 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 = 313}; + return (v__ast__Expr){ ._v__ast__Likely = ptr, ._typ = 314}; } 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 = 284}; + return (v__ast__Expr){ ._v__ast__AnonFn = ptr, ._typ = 285}; } 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 = 287}; + return (v__ast__Expr){ ._v__ast__AsCast = ptr, ._typ = 288}; } 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 = 322}; + return (v__ast__Expr){ ._v__ast__PostfixExpr = ptr, ._typ = 323}; } 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 = 323}; + return (v__ast__Expr){ ._v__ast__PrefixExpr = ptr, ._typ = 324}; } 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 = 285}; + return (v__ast__Expr){ ._v__ast__ArrayDecompose = ptr, ._typ = 286}; } 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 = 308}; + return (v__ast__Expr){ ._v__ast__IfGuardExpr = ptr, ._typ = 309}; } 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 = 324}; + return (v__ast__Expr){ ._v__ast__RangeExpr = ptr, ._typ = 325}; } 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 = 484}; + return (v__ast__TypeInfo){ ._v__ast__GenericInst = ptr, ._typ = 485}; } 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 = 356, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Module, pos))}; + return (v__ast__Stmt){ ._v__ast__Module = ptr, ._typ = 357, .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 = 354, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Import, pos))}; + return (v__ast__Stmt){ ._v__ast__Import = ptr, ._typ = 355, .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 = 342, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ConstDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__ConstDecl = ptr, ._typ = 343, .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 = 359, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__StructDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__StructDecl = ptr, ._typ = 360, .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 = 345, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__EnumDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__EnumDecl = ptr, ._typ = 346, .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 = 283, .pos = ptr->pos}; + return (v__ast__Stmt){ ._v__ast__TypeDecl = ptr, ._typ = 284, .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 = 336, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__AsmStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__AsmStmt = ptr, ._typ = 337, .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 = 350, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GlobalDecl, pos))}; + return (v__ast__Stmt){ ._v__ast__GlobalDecl = ptr, ._typ = 351, .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 = 353, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__HashStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__HashStmt = ptr, ._typ = 354, .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 = 339, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__Block, pos))}; + return (v__ast__Stmt){ ._v__ast__Block = ptr, ._typ = 340, .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 = 358, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__SqlStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__SqlStmt = ptr, ._typ = 359, .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 = 351, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoLabel, pos))}; + return (v__ast__Stmt){ ._v__ast__GotoLabel = ptr, ._typ = 352, .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 = 341, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__ComptimeFor, pos))}; + return (v__ast__Stmt){ ._v__ast__ComptimeFor = ptr, ._typ = 342, .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 = 340, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__BranchStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__BranchStmt = ptr, ._typ = 341, .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 = 343, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__DeferStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__DeferStmt = ptr, ._typ = 344, .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 = 352, .pos = (v__token__Pos*)((char*)ptr + __offsetof_ptr(ptr, v__ast__GotoStmt, pos))}; + return (v__ast__Stmt){ ._v__ast__GotoStmt = ptr, ._typ = 353, .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 = 304}; + return (v__ast__AsmArg){ ._v__ast__FloatLiteral = ptr, ._typ = 305}; } 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 = 438}; + return (v__ast__AsmArg){ ._v__ast__AsmDisp = ptr, ._typ = 439}; } 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 = 311}; + return (v__ast__AsmArg){ ._v__ast__IntegerLiteral = ptr, ._typ = 312}; } 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 = 295}; + return (v__ast__AsmArg){ ._v__ast__CharLiteral = ptr, ._typ = 296}; } 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 = 436}; + return (v__ast__AsmArg){ ._v__ast__AsmAddressing = ptr, ._typ = 437}; } 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 = 437}; + return (v__ast__AsmArg){ ._v__ast__AsmAlias = ptr, ._typ = 438}; } 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 = 300}; + return (v__ast__Expr){ ._v__ast__ConcatExpr = ptr, ._typ = 301}; } 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 = 294}; + return (v__ast__Expr){ ._v__ast__ChanInit = ptr, ._typ = 295}; } 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 = 329}; + return (v__ast__Expr){ ._v__ast__StringInterLiteral = ptr, ._typ = 330}; } 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 = 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))}; + return (v__ast__ScopeObject){ ._v__ast__ConstField = ptr, ._typ = 363, .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 = 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))}; + return (v__ast__ScopeObject){ ._v__ast__GlobalField = ptr, ._typ = 364, .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 = 485}; + return (v__ast__TypeInfo){ ._v__ast__Enum = ptr, ._typ = 486}; } 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 = 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))}; + return (v__ast__TypeDecl){ ._v__ast__FnTypeDecl = ptr, ._typ = 282, .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 = 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))}; + return (v__ast__TypeDecl){ ._v__ast__AliasTypeDecl = ptr, ._typ = 281, .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 = 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))}; + return (v__ast__TypeDecl){ ._v__ast__SumTypeDecl = ptr, ._typ = 283, .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 = 471}; + return (v__ast__TypeInfo){ ._v__ast__Alias = ptr, ._typ = 472}; } 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 = 210}; + return (v__ast__Node){ ._v__ast__File = ptr, ._typ = 211}; } static bool Array_string_contains(Array_string a, string v) { @@ -12732,16 +12743,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 66135; - if (sidx == _IError_flag__ArgsCountError_index) return 66136; - if (sidx == _IError_semver__InvalidComparatorFormatError_index) return 66146; - if (sidx == _IError_semver__EmptyInputError_index) return 66148; - if (sidx == _IError_semver__InvalidVersionFormatError_index) return 66149; - 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 539; + if (sidx == _IError_flag__UnkownFlagError_index) return 66136; + if (sidx == _IError_flag__ArgsCountError_index) return 66137; + if (sidx == _IError_semver__InvalidComparatorFormatError_index) return 66147; + if (sidx == _IError_semver__EmptyInputError_index) return 66149; + if (sidx == _IError_semver__InvalidVersionFormatError_index) return 66150; + if (sidx == _IError_os__FileNotOpenedError_index) return 65659; + if (sidx == _IError_os__SizeOfTypeIs0Error_index) return 65660; + if (sidx == _IError_os__ExecutableNotFoundError_index) return 65674; + if (sidx == _IError_time__TimeParseError_index) return 257; + if (sidx == _IError_v__gen__c__UnsupportedAssertCtempTransform_index) return 540; return 29; } static char * v_typeof_interface_rand__PRNG(int sidx) { /* rand.PRNG */ @@ -12750,90 +12761,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 65772; - return 232; + if (sidx == _rand__PRNG_rand__wyrand__WyRandRNG_index) return 65773; + return 233; } static char * v_typeof_sumtype_v__ast__TypeDecl(int sidx) { /* v.ast.TypeDecl */ switch(sidx) { - case 283: return "v.ast.TypeDecl"; - case 280: return "v.ast.AliasTypeDecl"; - case 281: return "v.ast.FnTypeDecl"; - case 282: return "v.ast.SumTypeDecl"; + case 284: return "v.ast.TypeDecl"; + case 281: return "v.ast.AliasTypeDecl"; + case 282: return "v.ast.FnTypeDecl"; + case 283: 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 283: return 283; - case 280: return 280; + case 284: return 284; case 281: return 281; case 282: return 282; - default: return 283; + case 283: return 283; + default: return 284; } } static char * v_typeof_sumtype_v__ast__Expr(int sidx) { /* v.ast.Expr */ switch(sidx) { - 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"; + case 336: return "v.ast.Expr"; + case 285: return "v.ast.AnonFn"; + case 286: return "v.ast.ArrayDecompose"; + case 287: return "v.ast.ArrayInit"; + case 288: return "v.ast.AsCast"; + case 289: return "v.ast.Assoc"; + case 290: return "v.ast.AtExpr"; + case 291: return "v.ast.BoolLiteral"; + case 292: return "v.ast.CTempVar"; + case 293: return "v.ast.CallExpr"; + case 294: return "v.ast.CastExpr"; + case 295: return "v.ast.ChanInit"; + case 296: return "v.ast.CharLiteral"; + case 297: return "v.ast.Comment"; + case 298: return "v.ast.ComptimeCall"; + case 299: return "v.ast.ComptimeSelector"; + case 300: return "v.ast.ComptimeType"; + case 301: return "v.ast.ConcatExpr"; + case 302: return "v.ast.DumpExpr"; + case 303: return "v.ast.EmptyExpr"; + case 304: return "v.ast.EnumVal"; + case 305: return "v.ast.FloatLiteral"; + case 306: return "v.ast.GoExpr"; + case 307: return "v.ast.Ident"; + case 308: return "v.ast.IfExpr"; + case 309: return "v.ast.IfGuardExpr"; + case 310: return "v.ast.IndexExpr"; + case 311: return "v.ast.InfixExpr"; + case 312: return "v.ast.IntegerLiteral"; + case 313: return "v.ast.IsRefType"; + case 314: return "v.ast.Likely"; + case 315: return "v.ast.LockExpr"; + case 316: return "v.ast.MapInit"; + case 317: return "v.ast.MatchExpr"; + case 318: return "v.ast.NodeError"; + case 319: return "v.ast.None"; + case 320: return "v.ast.OffsetOf"; + case 321: return "v.ast.OrExpr"; + case 322: return "v.ast.ParExpr"; + case 323: return "v.ast.PostfixExpr"; + case 324: return "v.ast.PrefixExpr"; + case 325: return "v.ast.RangeExpr"; + case 326: return "v.ast.SelectExpr"; + case 327: return "v.ast.SelectorExpr"; + case 328: return "v.ast.SizeOf"; + case 329: return "v.ast.SqlExpr"; + case 330: return "v.ast.StringInterLiteral"; + case 331: return "v.ast.StringLiteral"; + case 332: return "v.ast.StructInit"; + case 333: return "v.ast.TypeNode"; + case 334: return "v.ast.TypeOf"; + case 335: 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 335: return 335; - case 284: return 284; + case 336: return 336; case 285: return 285; case 286: return 286; case 287: return 287; @@ -12884,47 +12894,47 @@ static int v_typeof_sumtype_idx_v__ast__Expr(int sidx) { /* v.ast.Expr */ case 332: return 332; case 333: return 333; case 334: return 334; - default: return 335; + case 335: return 335; + default: return 336; } } static char * v_typeof_sumtype_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ switch(sidx) { - 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"; + case 361: return "v.ast.Stmt"; + case 337: return "v.ast.AsmStmt"; + case 338: return "v.ast.AssertStmt"; + case 339: return "v.ast.AssignStmt"; + case 340: return "v.ast.Block"; + case 341: return "v.ast.BranchStmt"; + case 342: return "v.ast.ComptimeFor"; + case 343: return "v.ast.ConstDecl"; + case 344: return "v.ast.DeferStmt"; + case 345: return "v.ast.EmptyStmt"; + case 346: return "v.ast.EnumDecl"; + case 347: return "v.ast.ExprStmt"; + case 220: return "v.ast.FnDecl"; + case 348: return "v.ast.ForCStmt"; + case 349: return "v.ast.ForInStmt"; + case 350: return "v.ast.ForStmt"; + case 351: return "v.ast.GlobalDecl"; + case 352: return "v.ast.GotoLabel"; + case 353: return "v.ast.GotoStmt"; + case 354: return "v.ast.HashStmt"; + case 355: return "v.ast.Import"; + case 356: return "v.ast.InterfaceDecl"; + case 357: return "v.ast.Module"; + case 318: return "v.ast.NodeError"; + case 358: return "v.ast.Return"; + case 359: return "v.ast.SqlStmt"; + case 360: return "v.ast.StructDecl"; + case 284: 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 360: return 360; - case 336: return 336; + case 361: return 361; case 337: return 337; case 338: return 338; case 339: return 339; @@ -12935,8 +12945,8 @@ static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ case 344: return 344; case 345: return 345; case 346: return 346; - case 219: return 219; case 347: return 347; + case 220: return 220; case 348: return 348; case 349: return 349; case 350: return 350; @@ -12946,84 +12956,85 @@ static int v_typeof_sumtype_idx_v__ast__Stmt(int sidx) { /* v.ast.Stmt */ case 354: return 354; case 355: return 355; case 356: return 356; - case 317: return 317; case 357: return 357; + case 318: return 318; case 358: return 358; case 359: return 359; - case 283: return 283; - default: return 360; + case 360: return 360; + case 284: return 284; + default: return 361; } } static char * v_typeof_sumtype_v__ast__ScopeObject(int sidx) { /* v.ast.ScopeObject */ switch(sidx) { - 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"; + case 366: return "v.ast.ScopeObject"; + case 362: return "v.ast.AsmRegister"; + case 363: return "v.ast.ConstField"; + case 364: return "v.ast.GlobalField"; + case 365: 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 365: return 365; - case 361: return 361; + case 366: return 366; case 362: return 362; case 363: return 363; case 364: return 364; - default: return 365; + case 365: return 365; + default: return 366; } } static char * v_typeof_sumtype_v__ast__Node(int sidx) { /* v.ast.Node */ switch(sidx) { - 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"; + case 376: return "v.ast.Node"; + case 367: return "v.ast.CallArg"; + case 363: return "v.ast.ConstField"; + case 368: return "v.ast.EmptyNode"; + case 369: return "v.ast.EnumField"; + case 336: return "v.ast.Expr"; + case 211: return "v.ast.File"; + case 364: return "v.ast.GlobalField"; + case 370: return "v.ast.IfBranch"; + case 371: return "v.ast.MatchBranch"; + case 318: return "v.ast.NodeError"; + case 372: return "v.ast.Param"; + case 366: return "v.ast.ScopeObject"; + case 373: return "v.ast.SelectBranch"; + case 361: return "v.ast.Stmt"; + case 374: return "v.ast.StructField"; + case 375: 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 375: return 375; - case 366: return 366; - case 362: return 362; + case 376: return 376; case 367: return 367; - case 368: return 368; - case 335: return 335; - case 210: return 210; case 363: return 363; + case 368: return 368; case 369: return 369; + case 336: return 336; + case 211: return 211; + case 364: return 364; case 370: return 370; - case 317: return 317; case 371: return 371; - case 365: return 365; + case 318: return 318; case 372: return 372; - case 360: return 360; + case 366: return 366; case 373: return 373; + case 361: return 361; case 374: return 374; - default: return 375; + case 375: return 375; + default: return 376; } } static char * v_typeof_sumtype_v__ast__ComptTimeConstValue(int sidx) { /* v.ast.ComptTimeConstValue */ switch(sidx) { - case 389: return "v.ast.ComptTimeConstValue"; - case 302: return "v.ast.EmptyExpr"; + case 390: return "v.ast.ComptTimeConstValue"; + case 303: return "v.ast.EmptyExpr"; case 15: return "f32"; case 16: return "f64"; case 6: return "i16"; @@ -13042,8 +13053,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 389: return 389; - case 302: return 302; + case 390: return 390; + case 303: return 303; case 15: return 15; case 16: return 16; case 6: return 6; @@ -13056,37 +13067,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 389; + default: return 390; } } static char * v_typeof_sumtype_v__ast__IdentInfo(int sidx) { /* v.ast.IdentInfo */ switch(sidx) { - case 417: return "v.ast.IdentInfo"; - case 415: return "v.ast.IdentFn"; - case 416: return "v.ast.IdentVar"; + case 418: return "v.ast.IdentInfo"; + case 416: return "v.ast.IdentFn"; + case 417: 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 417: return 417; - case 415: return 415; + case 418: return 418; case 416: return 416; - default: return 417; + case 417: return 417; + default: return 418; } } static char * v_typeof_sumtype_v__ast__AsmArg(int sidx) { /* v.ast.AsmArg */ switch(sidx) { - 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 435: return "v.ast.AsmArg"; + case 437: return "v.ast.AsmAddressing"; + case 438: return "v.ast.AsmAlias"; + case 439: return "v.ast.AsmDisp"; + case 362: return "v.ast.AsmRegister"; + case 291: return "v.ast.BoolLiteral"; + case 296: return "v.ast.CharLiteral"; + case 305: return "v.ast.FloatLiteral"; + case 312: return "v.ast.IntegerLiteral"; case 20: return "string"; default: return "unknown v.ast.AsmArg"; } @@ -13094,58 +13105,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 434: return 434; - case 436: return 436; + case 435: return 435; case 437: return 437; 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 439: return 439; + case 362: return 362; + case 291: return 291; + case 296: return 296; + case 305: return 305; + case 312: return 312; case 20: return 20; - default: return 434; + default: return 435; } } static char * v_typeof_sumtype_v__ast__TypeInfo(int sidx) { /* v.ast.TypeInfo */ switch(sidx) { - 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"; + case 487: return "v.ast.TypeInfo"; + case 470: return "v.ast.Aggregate"; + case 472: return "v.ast.Alias"; + case 452: return "v.ast.Array"; + case 480: return "v.ast.ArrayFixed"; + case 481: return "v.ast.Chan"; + case 486: return "v.ast.Enum"; + case 484: return "v.ast.FnType"; + case 485: return "v.ast.GenericInst"; + case 475: return "v.ast.Interface"; + case 453: return "v.ast.Map"; + case 483: return "v.ast.MultiReturn"; + case 457: return "v.ast.Struct"; + case 476: return "v.ast.SumType"; + case 482: 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 486: return 486; - case 469: return 469; - case 471: return 471; - case 451: return 451; - case 479: return 479; - case 480: return 480; - case 485: return 485; - case 483: return 483; - case 484: return 484; - case 474: return 474; + case 487: return 487; + case 470: return 470; + case 472: return 472; case 452: return 452; - case 482: return 482; - case 456: return 456; - case 475: return 475; + case 480: return 480; case 481: return 481; - default: return 486; + case 486: return 486; + case 484: return 484; + case 485: return 485; + case 475: return 475; + case 453: return 453; + case 483: return 483; + case 457: return 457; + case 476: return 476; + case 482: return 482; + default: return 487; } } static char * v_typeof_interface_hash__Hasher(int sidx) { /* hash.Hasher */ @@ -13153,21 +13164,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 534; + return 535; } 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 535; + return 536; } 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 536; + return 537; } 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"; @@ -13176,9 +13187,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 574; - if (sidx == _v__ast__walker__Visitor_v__callgraph__Mapper_index) return 66063; - return 572; + if (sidx == _v__ast__walker__Visitor_v__ast__walker__Inspector_index) return 575; + if (sidx == _v__ast__walker__Visitor_v__callgraph__Mapper_index) return 66064; + return 573; } // << typeof() support for sum types @@ -13188,7 +13199,9 @@ static int v_typeof_interface_idx_v__ast__walker__Visitor(int sidx) { /* v.ast.w // TypeDecl strings__Builder strings__new_builder(int initial_size) { strings__Builder res = ((__new_array_with_default(0, initial_size, sizeof(u8), 0))); - ArrayFlags_set(&res.flags, ArrayFlags__noslices); + { // Unsafe block + res.flags = ArrayFlags__noslices; + } return res; } @@ -13222,10 +13235,8 @@ void strings__Builder_write_runes(strings__Builder* b, Array_rune runes) { } } -// Attr: [deprecated] -// Attr: [deprecated_after] -void strings__Builder_write_b(strings__Builder* b, u8 data) { - array_push((array*)b, _MOV((u8[]){ data })); +void strings__Builder_clear(strings__Builder* b) { + *b = __new_array_with_default(0, b->cap, sizeof(u8), 0); } void strings__Builder_write_u8(strings__Builder* b, u8 data) { @@ -13236,21 +13247,21 @@ void strings__Builder_write_byte(strings__Builder* b, byte data) { array_push((array*)b, _MOV((u8[]){ data })); } -Option_int strings__Builder_write(strings__Builder* b, Array_u8 data) { +_option_int strings__Builder_write(strings__Builder* b, Array_u8 data) { if (data.len == 0) { - Option_int _t1; - opt_ok(&(int[]) { 0 }, (Option*)(&_t1), sizeof(int)); + _option_int _t1; + opt_ok2(&(int[]) { 0 }, (_option*)(&_t1), sizeof(int)); return _t1; } _PUSH_MANY(b, (data), _t2, strings__Builder); - Option_int _t3; - opt_ok(&(int[]) { data.len }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { data.len }, (_option*)(&_t3), sizeof(int)); return _t3; } // Attr: [manualfree] void strings__Builder_drain_builder(strings__Builder* b, strings__Builder* other, int other_new_cap) { - Option_int _t1 = strings__Builder_write(b, *other); + _option_int _t1 = strings__Builder_write(b, *other); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -13265,7 +13276,7 @@ void strings__Builder_drain_builder(strings__Builder* b, strings__Builder* other // Attr: [inline] inline u8 strings__Builder_byte_at(strings__Builder* b, int n) { - return (*(u8*)/*ee elem_sym */array_get(*(((Array_u8*)(b))), n)); + return ((u8*)(b->data))[n]; } // Attr: [inline] @@ -13311,10 +13322,15 @@ void strings__Builder_go_back_to(strings__Builder* b, int pos) { // Attr: [inline] inline void strings__Builder_writeln(strings__Builder* b, string s) { - if (s.len > 0) { - array_push_many(b, s.str, s.len); + int new_len = b->len + s.len + 1; + strings__Builder_ensure_cap(b, new_len); + { // Unsafe block + ((u8*)(b->data))[new_len - 1] = ((u8)('\n')); + if (s.len > 0) { + vmemcpy(((u8*)(b->data)) + b->len, s.str, s.len); + } + b->len = new_len; } - array_push((array*)b, _MOV((u8[]){ ((u8)('\n')) })); } string strings__Builder_last_n(strings__Builder* b, int n) { @@ -13343,12 +13359,10 @@ void strings__Builder_ensure_cap(strings__Builder* b, int n) { if (n <= b->cap) { return; } - u8* new_data = vcalloc(n * b->element_size); - if (b->data != ((voidptr)(0))) { - vmemcpy(new_data, b->data, b->len * b->element_size); - if (ArrayFlags_has(&b->flags, ArrayFlags__noslices)) { - _v_free(b->data); - } + u8* new_data = _v_malloc(((u64)(n)) * ((u64)(b->element_size))); + if (b->data != 0) { + vmemcpy(new_data, b->data, b->len); + _v_free(b->data); } { // Unsafe block b->data = new_data; @@ -14181,9 +14195,9 @@ VV_LOCAL_SYMBOL u64 strconv__converter(strconv__PrepNumber* pn) { return result; } -Option_f64 strconv__atof64(string s) { +_option_f64 strconv__atof64(string s) { if (s.len == 0) { - return (Option_f64){ .state=2, .err=_v_error(_SLIT("expected a number found an empty string")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_v_error(_SLIT("expected a number found an empty string")), .data={EMPTY_STRUCT_INITIALIZATION} }; } strconv__Float64u res = ((strconv__Float64u){0}); multi_return_strconv__ParserState_strconv__PrepNumber mr_9209 = strconv__parser(s); @@ -14217,13 +14231,13 @@ Option_f64 strconv__atof64(string s) { } case strconv__ParserState__invalid_number: { - return (Option_f64){ .state=2, .err=_v_error(_SLIT("not a number")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_v_error(_SLIT("not a number")), .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } ; - Option_f64 _t3; - opt_ok(&(f64[]) { res.f }, (Option*)(&_t3), sizeof(f64)); + _option_f64 _t3; + opt_ok2(&(f64[]) { res.f }, (_option*)(&_t3), sizeof(f64)); return _t3; } @@ -14336,27 +14350,27 @@ u8 strconv__byte_to_lower(u8 c) { return (c | ('x' - 'X')); } -Option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit) { +_option_u64 strconv__common_parse_uint(string s, int _base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit) { multi_return_u64_int mr_820 = strconv__common_parse_uint2(s, _base, _bit_size); u64 result = mr_820.arg0; int err = mr_820.arg1; 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 "), /*100 &int*/0xfe07, {.d_i32 = _base}}, {_SLIT(" for "), /*115 &string*/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 "), /*100 &int*/0xfe07, {.d_i32 = _bit_size}}, {_SLIT(" for "), /*115 &string*/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 "), /*115 &string*/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 "), /*115 &string*/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; - opt_ok(&(u64[]) { result }, (Option*)(&_t5), sizeof(u64)); + _option_u64 _t5; + opt_ok2(&(u64[]) { result }, (_option*)(&_t5), sizeof(u64)); return _t5; } @@ -14429,16 +14443,16 @@ multi_return_u64_int strconv__common_parse_uint2(string s, int _base, int _bit_s return (multi_return_u64_int){.arg0=n, .arg1=0}; } -Option_u64 strconv__parse_uint(string s, int _base, int _bit_size) { +_option_u64 strconv__parse_uint(string s, int _base, int _bit_size) { return strconv__common_parse_uint(s, _base, _bit_size, true, true); } -Option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit) { +_option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool error_on_non_digit, bool error_on_high_digit) { string s = _s; int bit_size = _bit_size; if (s.len < 1) { - Option_i64 _t1; - opt_ok(&(i64[]) { ((i64)(0)) }, (Option*)(&_t1), sizeof(i64)); + _option_i64 _t1; + opt_ok2(&(i64[]) { ((i64)(0)) }, (_option*)(&_t1), sizeof(i64)); return _t1; } bool neg = false; @@ -14448,17 +14462,17 @@ Option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool er neg = true; s = string_substr(s, 1, (s).len); } - Option_u64 _t2 = strconv__common_parse_uint(s, base, bit_size, error_on_non_digit, error_on_high_digit); + _option_u64 _t2 = strconv__common_parse_uint(s, base, bit_size, error_on_non_digit, error_on_high_digit); if (_t2.state != 0) { /*or block*/ - Option_i64 _t3; + _option_i64 _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } u64 un = (*(u64*)_t2.data); if (un == 0U) { - Option_i64 _t4; - opt_ok(&(i64[]) { ((i64)(0)) }, (Option*)(&_t4), sizeof(i64)); + _option_i64 _t4; + opt_ok2(&(i64[]) { ((i64)(0)) }, (_option*)(&_t4), sizeof(i64)); return _t4; } if (bit_size == 0) { @@ -14466,66 +14480,66 @@ Option_i64 strconv__common_parse_int(string _s, int base, int _bit_size, bool er } u64 cutoff = ((u64)(1U)) << ((u64)(bit_size - 1)); if (!neg && un >= cutoff) { - Option_i64 _t5; - opt_ok(&(i64[]) { ((i64)(cutoff - ((u64)(1U)))) }, (Option*)(&_t5), sizeof(i64)); + _option_i64 _t5; + opt_ok2(&(i64[]) { ((i64)(cutoff - ((u64)(1U)))) }, (_option*)(&_t5), sizeof(i64)); return _t5; } if (neg && un > cutoff) { - Option_i64 _t6; - opt_ok(&(i64[]) { -((i64)(cutoff)) }, (Option*)(&_t6), sizeof(i64)); + _option_i64 _t6; + opt_ok2(&(i64[]) { -((i64)(cutoff)) }, (_option*)(&_t6), sizeof(i64)); return _t6; } - Option_i64 _t8; /* if prepend */ + _option_i64 _t8; /* if prepend */ if (neg) { - opt_ok(&(i64[]) { -((i64)(un)) }, (Option*)(&_t8), sizeof(i64)); + opt_ok2(&(i64[]) { -((i64)(un)) }, (_option*)(&_t8), sizeof(i64)); } else { - opt_ok(&(i64[]) { ((i64)(un)) }, (Option*)(&_t8), sizeof(i64)); + opt_ok2(&(i64[]) { ((i64)(un)) }, (_option*)(&_t8), sizeof(i64)); } return _t8; } -Option_i64 strconv__parse_int(string _s, int base, int _bit_size) { +_option_i64 strconv__parse_int(string _s, int base, int _bit_size) { return strconv__common_parse_int(_s, base, _bit_size, true, true); } -Option_int strconv__atoi(string s) { +_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 \""), /*115 &string*/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 \""), /*115 &string*/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 \""), /*115 &string*/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)); } - Option_int _t5; /* if prepend */ + _option_int _t5; /* if prepend */ if (string_at(s, 0) == '-') { - opt_ok(&(int[]) { -n }, (Option*)(&_t5), sizeof(int)); + opt_ok2(&(int[]) { -n }, (_option*)(&_t5), sizeof(int)); } else { - opt_ok(&(int[]) { n }, (Option*)(&_t5), sizeof(int)); + opt_ok2(&(int[]) { n }, (_option*)(&_t5), sizeof(int)); } return _t5; } - Option_i64 _t6 = strconv__parse_int(s, 10, 0); + _option_i64 _t6 = strconv__parse_int(s, 10, 0); if (_t6.state != 0) { /*or block*/ - Option_int _t7; + _option_int _t7; memcpy(&_t7, &_t6, sizeof(Option)); return _t7; } i64 int64 = (*(i64*)_t6.data); - Option_int _t8; - opt_ok(&(int[]) { ((int)(int64)) }, (Option*)(&_t8), sizeof(int)); + _option_int _t8; + opt_ok2(&(int[]) { ((int)(int64)) }, (_option*)(&_t8), sizeof(int)); return _t8; } @@ -17214,7 +17228,7 @@ array array_clone_to_depth(array* a, int depth) { } return arr; } else { - if (!isnil(a->data)) { + if (a->data != 0) { vmemcpy(((u8*)(arr.data)), a->data, ((u64)(a->cap)) * ((u64)(a->element_size))); } return arr; @@ -17251,12 +17265,12 @@ VV_LOCAL_SYMBOL void array_push(array* a, voidptr val) { // Attr: [unsafe] void array_push_many(array* a3, voidptr val, int size) { array_ensure_cap(a3, a3->len + size); - if (a3->data == val && !isnil(a3->data)) { + if (a3->data == val && a3->data != 0) { array copy = array_clone(a3); - vmemcpy(array_get_unsafe(/*rec*/*a3, a3->len), copy.data, ((u64)(a3->element_size)) * ((u64)(size))); + vmemcpy(((u8*)(a3->data)) + ((u64)(a3->element_size)) * ((u64)(a3->len)), copy.data, ((u64)(a3->element_size)) * ((u64)(size))); } else { - if (!isnil(a3->data) && !isnil(val)) { - vmemcpy(array_get_unsafe(/*rec*/*a3, a3->len), val, ((u64)(a3->element_size)) * ((u64)(size))); + if (a3->data != 0 && val != 0) { + vmemcpy(((u8*)(a3->data)) + ((u64)(a3->element_size)) * ((u64)(a3->len)), val, ((u64)(a3->element_size)) * ((u64)(size))); } } a3->len += size; @@ -18866,17 +18880,17 @@ string Array_u8_bytestr(Array_u8 b) { return (string){.str=(byteptr)"", .is_lit=1}; } -Option_rune Array_u8_byterune(Array_u8 b) { - Option_rune _t1 = Array_u8_utf8_to_utf32(b); +_option_rune Array_u8_byterune(Array_u8 b) { + _option_rune _t1 = Array_u8_utf8_to_utf32(b); if (_t1.state != 0) { /*or block*/ - Option_rune _t2; + _option_rune _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } rune r = (*(rune*)_t1.data); - Option_rune _t3; - opt_ok(&(rune[]) { ((rune)(r)) }, (Option*)(&_t3), sizeof(rune)); + _option_rune _t3; + opt_ok2(&(rune[]) { ((rune)(r)) }, (_option*)(&_t3), sizeof(rune)); return _t3; } @@ -18982,8 +18996,8 @@ inline VV_LOCAL_SYMBOL DenseArray new_dense_array(int key_bytes, int value_bytes .len = 0, .deletes = 0U, .all_deleted = 0, - .values = _v_malloc(cap * value_bytes), .keys = _v_malloc(cap * key_bytes), + .values = _v_malloc(cap * value_bytes), }); } @@ -19005,8 +19019,8 @@ inline VV_LOCAL_SYMBOL bool DenseArray_has_index(DenseArray* d, int i) { // Attr: [inline] inline VV_LOCAL_SYMBOL int DenseArray_expand(DenseArray* d) { int old_cap = d->cap; - int old_value_size = d->value_bytes * old_cap; int old_key_size = d->key_bytes * old_cap; + int old_value_size = d->value_bytes * old_cap; if (d->cap == d->len) { d->cap += d->cap >> 3; { // Unsafe block @@ -19461,6 +19475,26 @@ array map_keys(map* m) { return keys; } +array map_values(map* m) { + array values = __new_array(m->len, 0, m->value_bytes); + u8* item = ((u8*)(values.data)); + if (m->key_values.deletes == 0U) { + vmemcpy(item, m->key_values.values, m->value_bytes * m->key_values.len); + return values; + } + for (int i = 0; i < m->key_values.len; i++) { + if (!DenseArray_has_index(&m->key_values, i)) { + continue; + } + { // Unsafe block + voidptr pvalue = DenseArray_value(&m->key_values, i); + vmemcpy(item, pvalue, m->value_bytes); + item = item + m->value_bytes; + } + } + return values; +} + // Attr: [unsafe] VV_LOCAL_SYMBOL DenseArray DenseArray_clone(DenseArray* d) { DenseArray res = ((DenseArray){ @@ -19470,8 +19504,8 @@ VV_LOCAL_SYMBOL DenseArray DenseArray_clone(DenseArray* d) { .len = d->len, .deletes = d->deletes, .all_deleted = 0, - .values = 0, .keys = 0, + .values = 0, }); { // Unsafe block if (d->deletes != 0U) { @@ -19613,6 +19647,13 @@ VV_LOCAL_SYMBOL void opt_ok(voidptr data, Option* option, int size) { } } +VV_LOCAL_SYMBOL void opt_ok2(voidptr data, _option* option, int size) { + { // Unsafe block + *option = ((_option){.state = 0,.err = _const_none__,}); + vmemcpy(((u8*)(&option->err)) + sizeof(IError), data, size); + } +} + VV_LOCAL_SYMBOL void _result_ok(voidptr data, _result* res, int size) { { // Unsafe block *res = ((_result){.is_error = 0,.err = _const_none__,}); @@ -20418,7 +20459,7 @@ bool string_bool(string s) { } int string_int(string s) { - Option_i64 _t2 = strconv__common_parse_int(s, 0, 32, false, false); + _option_i64 _t2 = strconv__common_parse_int(s, 0, 32, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(i64*) _t2.data = 0; @@ -20428,7 +20469,7 @@ int string_int(string s) { } i64 string_i64(string s) { - Option_i64 _t2 = strconv__common_parse_int(s, 0, 64, false, false); + _option_i64 _t2 = strconv__common_parse_int(s, 0, 64, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(i64*) _t2.data = 0; @@ -20438,7 +20479,7 @@ i64 string_i64(string s) { } i8 string_i8(string s) { - Option_i64 _t2 = strconv__common_parse_int(s, 0, 8, false, false); + _option_i64 _t2 = strconv__common_parse_int(s, 0, 8, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(i64*) _t2.data = 0; @@ -20448,7 +20489,7 @@ i8 string_i8(string s) { } i16 string_i16(string s) { - Option_i64 _t2 = strconv__common_parse_int(s, 0, 16, false, false); + _option_i64 _t2 = strconv__common_parse_int(s, 0, 16, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(i64*) _t2.data = 0; @@ -20458,7 +20499,7 @@ i16 string_i16(string s) { } f32 string_f32(string s) { - Option_f64 _t2 = strconv__atof64(s); + _option_f64 _t2 = strconv__atof64(s); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(f64*) _t2.data = 0; @@ -20468,7 +20509,7 @@ f32 string_f32(string s) { } f64 string_f64(string s) { - Option_f64 _t2 = strconv__atof64(s); + _option_f64 _t2 = strconv__atof64(s); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(f64*) _t2.data = 0; @@ -20478,7 +20519,7 @@ f64 string_f64(string s) { } u8 string_u8(string s) { - Option_u64 _t2 = strconv__common_parse_uint(s, 0, 8, false, false); + _option_u64 _t2 = strconv__common_parse_uint(s, 0, 8, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(u64*) _t2.data = 0U; @@ -20488,7 +20529,7 @@ u8 string_u8(string s) { } u16 string_u16(string s) { - Option_u64 _t2 = strconv__common_parse_uint(s, 0, 16, false, false); + _option_u64 _t2 = strconv__common_parse_uint(s, 0, 16, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(u64*) _t2.data = 0U; @@ -20498,7 +20539,7 @@ u16 string_u16(string s) { } u32 string_u32(string s) { - Option_u64 _t2 = strconv__common_parse_uint(s, 0, 32, false, false); + _option_u64 _t2 = strconv__common_parse_uint(s, 0, 32, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(u64*) _t2.data = 0U; @@ -20508,7 +20549,7 @@ u32 string_u32(string s) { } u64 string_u64(string s) { - Option_u64 _t2 = strconv__common_parse_uint(s, 0, 64, false, false); + _option_u64 _t2 = strconv__common_parse_uint(s, 0, 64, false, false); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(u64*) _t2.data = 0U; @@ -20517,11 +20558,11 @@ u64 string_u64(string s) { return (*(u64*)_t2.data); } -Option_u64 string_parse_uint(string s, int _base, int _bit_size) { +_option_u64 string_parse_uint(string s, int _base, int _bit_size) { return strconv__parse_uint(s, _base, _bit_size); } -Option_i64 string_parse_int(string s, int _base, int _bit_size) { +_option_i64 string_parse_int(string s, int _base, int _bit_size) { return strconv__parse_int(s, _base, _bit_size); } @@ -20751,14 +20792,14 @@ 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) { +_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("), /*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} }; + 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) { - Option_string _t2; - opt_ok(&(string[]) { string_clone(s) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { string_clone(s) }, (_option*)(&_t2), sizeof(string)); return _t2; } string res = ((string){.str = malloc_noscan(len + 1), .len = len}); @@ -20770,8 +20811,8 @@ Option_string string_substr_with_check(string s, int start, int end) { { // Unsafe block res.str[len] = 0; } - Option_string _t3; - opt_ok(&(string[]) { res }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { res }, (_option*)(&_t3), sizeof(string)); return _t3; } @@ -20838,13 +20879,13 @@ VV_LOCAL_SYMBOL int string_index_(string s, string p) { return -1; } -Option_int string_index(string s, string p) { +_option_int string_index(string s, string p) { int idx = string_index_(s, p); if (idx == -1) { - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t2; - opt_ok(&(int[]) { idx }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { idx }, (_option*)(&_t2), sizeof(int)); return _t2; } @@ -20931,13 +20972,13 @@ VV_LOCAL_SYMBOL int string_last_index_(string s, string p) { return -1; } -Option_int string_last_index(string s, string p) { +_option_int string_last_index(string s, string p) { int idx = string_last_index_(s, p); if (idx == -1) { - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t2; - opt_ok(&(int[]) { idx }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { idx }, (_option*)(&_t2), sizeof(int)); return _t2; } @@ -21374,16 +21415,16 @@ VV_LOCAL_SYMBOL byte string_at(string s, int idx) { return 0; } -VV_LOCAL_SYMBOL Option_u8 string_at_with_check(string s, int idx) { +VV_LOCAL_SYMBOL _option_u8 string_at_with_check(string s, int idx) { if (idx < 0 || idx >= s.len) { - return (Option_u8){ .state=2, .err=_v_error(_SLIT("string index out of range")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u8){ .state=2, .err=_v_error(_SLIT("string index out of range")), .data={EMPTY_STRUCT_INITIALIZATION} }; } { // Unsafe block - Option_u8 _t2; - opt_ok(&(u8[]) { s.str[idx] }, (Option*)(&_t2), sizeof(u8)); + _option_u8 _t2; + opt_ok2(&(u8[]) { s.str[idx] }, (_option*)(&_t2), sizeof(u8)); return _t2; } - return (Option_u8){0}; + return (_option_u8){0}; } // Attr: [inline] @@ -22483,7 +22524,7 @@ inline string str_intp_g64(string in_str) { // Attr: [manualfree] string str_intp_sub(string base_str, string in_str) { - Option_int _t1 = string_index(base_str, _SLIT("%%")); + _option_int _t1 = string_index(base_str, _SLIT("%%")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; eprintln(_SLIT("No strin interpolation %% parameteres")); @@ -22666,7 +22707,7 @@ int utf8_str_len(string s) { } int string_utf32_code(string _rune) { - Option_rune _t2 = Array_u8_utf8_to_utf32(string_bytes(_rune)); + _option_rune _t2 = Array_u8_utf8_to_utf32(string_bytes(_rune)); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(rune*) _t2.data = ((rune)(0)); @@ -22675,19 +22716,19 @@ int string_utf32_code(string _rune) { return ((int)( (*(rune*)_t2.data))); } -Option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes) { +_option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes) { if (_bytes.len == 0) { - Option_rune _t1; - opt_ok(&(rune[]) { 0 }, (Option*)(&_t1), sizeof(rune)); + _option_rune _t1; + opt_ok2(&(rune[]) { 0 }, (_option*)(&_t1), sizeof(rune)); return _t1; } if (_bytes.len == 1) { - Option_rune _t2; - opt_ok(&(rune[]) { ((rune)((*(u8*)/*ee elem_sym */array_get(_bytes, 0)))) }, (Option*)(&_t2), sizeof(rune)); + _option_rune _t2; + opt_ok2(&(rune[]) { ((rune)((*(u8*)/*ee elem_sym */array_get(_bytes, 0)))) }, (_option*)(&_t2), sizeof(rune)); return _t2; } if (_bytes.len > 4) { - return (Option_rune){ .state=2, .err=_v_error(_SLIT("attempted to decode too many bytes, utf-8 is limited to four bytes maximum")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_rune){ .state=2, .err=_v_error(_SLIT("attempted to decode too many bytes, utf-8 is limited to four bytes maximum")), .data={EMPTY_STRUCT_INITIALIZATION} }; } u8 b = ((u8)(((int)((*(u8*)/*ee elem_sym */array_get(_bytes, 0)))))); b = b << _bytes.len; @@ -22699,8 +22740,8 @@ Option_rune Array_u8_utf8_to_utf32(Array_u8 _bytes) { res |= (c & 63); shift = 6; } - Option_rune _t4; - opt_ok(&(rune[]) { res }, (Option*)(&_t4), sizeof(rune)); + _option_rune _t4; + opt_ok2(&(rune[]) { res }, (_option*)(&_t4), sizeof(rune)); return _t4; } @@ -22816,25 +22857,25 @@ inline string dl__get_libname(string libname) { return _t1; } -Option_voidptr dl__open_opt(string filename, int flags) { +_option_voidptr dl__open_opt(string filename, int flags) { voidptr shared_object_handle = dl__open(filename, flags); if (shared_object_handle == 0) { string e = dl__dlerror(); - return (Option_voidptr){ .state=2, .err=_v_error(e), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_voidptr){ .state=2, .err=_v_error(e), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_voidptr _t2; - opt_ok(&(voidptr[]) { shared_object_handle }, (Option*)(&_t2), sizeof(voidptr)); + _option_voidptr _t2; + opt_ok2(&(voidptr[]) { shared_object_handle }, (_option*)(&_t2), sizeof(voidptr)); return _t2; } -Option_voidptr dl__sym_opt(voidptr shared_object_handle, string symbol) { +_option_voidptr dl__sym_opt(voidptr shared_object_handle, string symbol) { voidptr sym_handle = dl__sym(shared_object_handle, symbol); if (sym_handle == 0) { string e = dl__dlerror(); - return (Option_voidptr){ .state=2, .err=_v_error(e), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_voidptr){ .state=2, .err=_v_error(e), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_voidptr _t2; - opt_ok(&(voidptr[]) { sym_handle }, (Option*)(&_t2), sizeof(voidptr)); + _option_voidptr _t2; + opt_ok2(&(voidptr[]) { sym_handle }, (_option*)(&_t2), sizeof(voidptr)); return _t2; } @@ -24065,358 +24106,358 @@ string v__token__kind_to_string(v__token__Kind k) { return _t1; } -Option_v__token__Kind v__token__kind_from_string(string s) { - Option_v__token__Kind _t2 = {0}; +_option_v__token__Kind v__token__kind_from_string(string s) { + _option_v__token__Kind _t2 = {0}; if (string__eq(s, _SLIT("unknown"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__unknown }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__unknown }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("eof"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__eof }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__eof }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("name"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__name }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__name }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("number"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__number }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__number }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("string"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__string }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__string }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("str_inter"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__str_inter }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__str_inter }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("chartoken"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__chartoken }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__chartoken }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("plus"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__plus }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__plus }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("minus"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__minus }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__minus }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("mul"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__mul }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__mul }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("div"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__div }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__div }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("mod"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__mod }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__mod }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("xor"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__xor }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__xor }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("pipe"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__pipe }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__pipe }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("inc"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__inc }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__inc }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("dec"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__dec }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__dec }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("and"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__and }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__and }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("logical_or"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__logical_or }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__logical_or }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("not"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__not }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__not }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("bit_not"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__bit_not }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__bit_not }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("question"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__question }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__question }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("comma"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__comma }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__comma }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("semicolon"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__semicolon }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__semicolon }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("colon"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__colon }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__colon }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("arrow"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__arrow }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__arrow }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("amp"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__amp }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__amp }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("hash"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__hash }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__hash }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("dollar"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__dollar }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__dollar }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("at"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__at }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__at }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("str_dollar"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__str_dollar }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__str_dollar }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("left_shift"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__left_shift }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__left_shift }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("right_shift"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__right_shift }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__right_shift }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("unsigned_right_shift"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__unsigned_right_shift }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__unsigned_right_shift }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("not_in"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__not_in }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__not_in }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("not_is"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__not_is }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__not_is }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("decl_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__decl_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__decl_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("plus_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__plus_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__plus_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("minus_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__minus_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__minus_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("div_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__div_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__div_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("mult_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__mult_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__mult_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("xor_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__xor_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__xor_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("mod_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__mod_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__mod_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("or_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__or_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__or_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("and_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__and_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__and_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("right_shift_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__right_shift_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__right_shift_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("left_shift_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__left_shift_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__left_shift_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("unsigned_right_shift_assign"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__unsigned_right_shift_assign }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__unsigned_right_shift_assign }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("lcbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__lcbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__lcbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("rcbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__rcbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__rcbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("lpar"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__lpar }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__lpar }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("rpar"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__rpar }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__rpar }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("lsbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__lsbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__lsbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("nilsbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__nilsbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__nilsbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("rsbr"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__rsbr }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__rsbr }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("eq"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__eq }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__eq }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("ne"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__ne }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__ne }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("gt"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__gt }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__gt }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("lt"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__lt }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__lt }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("ge"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__ge }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__ge }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("le"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__le }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__le }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("comment"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__comment }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__comment }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("nl"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__nl }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__nl }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("dot"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__dot }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__dot }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("dotdot"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__dotdot }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__dotdot }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("ellipsis"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__ellipsis }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__ellipsis }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("keyword_beg"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__keyword_beg }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__keyword_beg }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_as"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_as }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_as }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_asm"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_asm }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_asm }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_assert"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_assert }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_assert }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_atomic"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_atomic }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_atomic }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_break"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_break }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_break }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_const"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_const }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_const }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_continue"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_continue }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_continue }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_defer"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_defer }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_defer }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_else"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_else }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_else }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_enum"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_enum }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_enum }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_false"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_false }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_false }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_for"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_for }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_for }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_fn"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_fn }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_fn }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_global"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_global }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_global }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_go"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_go }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_go }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_goto"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_goto }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_goto }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_if"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_if }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_if }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_import"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_import }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_import }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_in"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_in }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_in }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_interface"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_interface }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_interface }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_is"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_is }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_is }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_match"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_match }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_match }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_module"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_module }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_module }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_mut"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_mut }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_mut }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_shared"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_shared }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_shared }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_lock"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_lock }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_lock }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_rlock"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_rlock }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_rlock }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_none"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_none }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_none }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_return"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_return }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_return }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_select"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_select }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_select }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_sizeof"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_sizeof }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_sizeof }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_isreftype"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_isreftype }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_isreftype }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_likely"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_likely }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_likely }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_unlikely"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_unlikely }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_unlikely }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_offsetof"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_offsetof }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_offsetof }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_struct"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_struct }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_struct }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_true"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_true }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_true }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_type"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_type }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_type }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_typeof"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_typeof }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_typeof }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_dump"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_dump }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_dump }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_orelse"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_orelse }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_orelse }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_union"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_union }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_union }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_pub"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_pub }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_pub }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_static"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_static }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_static }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_volatile"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_volatile }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_volatile }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("key_unsafe"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__key_unsafe }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__key_unsafe }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("keyword_end"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind__keyword_end }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind__keyword_end }, (_option*)(&_t2), sizeof(v__token__Kind)); } else if (string__eq(s, _SLIT("_end_"))) { - opt_ok(&(v__token__Kind[]) { v__token__Kind___end_ }, (Option*)(&_t2), sizeof(v__token__Kind)); + opt_ok2(&(v__token__Kind[]) { v__token__Kind___end_ }, (_option*)(&_t2), sizeof(v__token__Kind)); } else { _t2.state = 2; _t2.err = _v_error(_SLIT("unknown")); - }Option_v__token__Kind _t1 = _t2; + }_option_v__token__Kind _t1 = _t2; return _t1; } @@ -24832,7 +24873,7 @@ Array_int to_delete; return _t8; } -VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser* fs, string longhand, u8 shorthand) { +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("--"), /*115 &string*/0xfe10, {.d_s = longhand}}, {_SLIT0, 0, { .d_c = 0 }}})); for (int i = 0; i < fs->args.len; ++i) { @@ -24848,53 +24889,53 @@ VV_LOCAL_SYMBOL Option_string flag__FlagParser_parse_bool_value(flag__FlagParser string val = (*(string*)/*ee elem_sym */array_get(fs->args, i + 1)); array_delete(&fs->args, i + 1); array_delete(&fs->args, i); - Option_string _t1; - opt_ok(&(string[]) { val }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { val }, (_option*)(&_t1), sizeof(string)); return _t1; } else { array_delete(&fs->args, i); - Option_string _t2; - opt_ok(&(string[]) { _SLIT("true") }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { _SLIT("true") }, (_option*)(&_t2), sizeof(string)); return _t2; } } 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; - opt_ok(&(string[]) { val }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { val }, (_option*)(&_t3), sizeof(string)); return _t3; } if (arg.len > 1 && string_at(arg, 0) == '-' && string_at(arg, 1) != '-' && string_index_u8(arg, shorthand) != -1) { - Option_string _t4; - opt_ok(&(string[]) { _SLIT("true") }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { _SLIT("true") }, (_option*)(&_t4), sizeof(string)); return _t4; } } } - 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} }; + 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) { +_option_bool flag__FlagParser_bool_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { bool res = false; { flag__FlagParser_add_flag(fs, name, abbr, usage, _SLIT("")); - Option_string _t1 = flag__FlagParser_parse_bool_value(fs, name, 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 '"), /*115 &string*/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); res = string__eq(parsed, _SLIT("true")); } - Option_bool _t3; - opt_ok(&(bool[]) { res }, (Option*)(&_t3), sizeof(bool)); + _option_bool _t3; + opt_ok2(&(bool[]) { res }, (_option*)(&_t3), sizeof(bool)); return _t3; } bool flag__FlagParser_bool(flag__FlagParser* fs, string name, u8 abbr, bool bdefault, string usage) { - Option_bool _t1 = flag__FlagParser_bool_opt(fs, name, abbr, usage); + _option_bool _t1 = flag__FlagParser_bool_opt(fs, name, abbr, usage); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = bdefault; @@ -24918,24 +24959,24 @@ Array_int flag__FlagParser_int_multi(flag__FlagParser* fs, string name, u8 abbr, return _t3; } -Option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { +_option_int flag__FlagParser_int_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { int res = 0; { 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 '"), /*115 &string*/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); } - Option_int _t2; - opt_ok(&(int[]) { res }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { res }, (_option*)(&_t2), sizeof(int)); return _t2; } int flag__FlagParser_int(flag__FlagParser* fs, string name, u8 abbr, int idefault, string usage) { - Option_int _t1 = flag__FlagParser_int_opt(fs, name, abbr, usage); + _option_int _t1 = flag__FlagParser_int_opt(fs, name, abbr, usage); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; int _t2 = idefault; @@ -24959,23 +25000,23 @@ Array_f64 flag__FlagParser_float_multi(flag__FlagParser* fs, string name, u8 abb return _t3; } -Option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { +_option_f64 flag__FlagParser_float_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { f64 res = 0.0; { 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 '"), /*115 &string*/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))); } - Option_f64 _t2; - opt_ok(&(f64[]) { res }, (Option*)(&_t2), sizeof(f64)); + _option_f64 _t2; + opt_ok2(&(f64[]) { res }, (_option*)(&_t2), sizeof(f64)); return _t2; } f64 flag__FlagParser_float(flag__FlagParser* fs, string name, u8 abbr, f64 fdefault, string usage) { - Option_f64 _t1 = flag__FlagParser_float_opt(fs, name, abbr, usage); + _option_f64 _t1 = flag__FlagParser_float_opt(fs, name, abbr, usage); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; f64 _t2 = fdefault; @@ -24993,23 +25034,23 @@ Array_string flag__FlagParser_string_multi(flag__FlagParser* fs, string name, u8 return _t1; } -Option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { +_option_string flag__FlagParser_string_opt(flag__FlagParser* fs, string name, u8 abbr, string usage) { string res = _SLIT(""); { 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 '"), /*115 &string*/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)); } - Option_string _t2; - opt_ok(&(string[]) { res }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { res }, (_option*)(&_t2), sizeof(string)); return _t2; } string flag__FlagParser_string(flag__FlagParser* fs, string name, u8 abbr, string sdefault, string usage) { - Option_string _t1 = flag__FlagParser_string_opt(fs, name, abbr, usage); + _option_string _t1 = flag__FlagParser_string_opt(fs, name, abbr, usage); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; string _t2 = sdefault; @@ -25021,36 +25062,36 @@ string flag__FlagParser_string(flag__FlagParser* fs, string name, u8 abbr, strin return _t3; } -Option_void flag__FlagParser_limit_free_args_to_at_least(flag__FlagParser* fs, int n) { +_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 "), /*100 &int literal*/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} }; + 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} }; } fs->min_free_args = n; - return (Option_void){0}; + return (_option_void){0}; } -Option_void flag__FlagParser_limit_free_args_to_exactly(flag__FlagParser* fs, int n) { +_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 "), /*100 &int literal*/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} }; + 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} }; } fs->min_free_args = n; fs->max_free_args = n; - return (Option_void){0}; + return (_option_void){0}; } -Option_void flag__FlagParser_limit_free_args(flag__FlagParser* fs, int min, int max) { +_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 "), /*100 &int*/0xfe07, {.d_i32 = min}}, {_SLIT(" >= "), /*100 &int*/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; - return (Option_void){0}; + return (_option_void){0}; } void flag__FlagParser_arguments_description(flag__FlagParser* fs, string description) { @@ -25141,29 +25182,29 @@ string flag__FlagParser_usage(flag__FlagParser* fs) { return _t23; } -VV_LOCAL_SYMBOL Option_flag__Flag flag__FlagParser_find_existing_flag(flag__FlagParser* fs, string fname) { +VV_LOCAL_SYMBOL _option_flag__Flag flag__FlagParser_find_existing_flag(flag__FlagParser* fs, string fname) { for (int _t1 = 0; _t1 < fs->flags.len; ++_t1) { flag__Flag f = ((flag__Flag*)fs->flags.data)[_t1]; if (string__eq(f.name, fname)) { - Option_flag__Flag _t2; - opt_ok(&(flag__Flag[]) { f }, (Option*)(&_t2), sizeof(flag__Flag)); + _option_flag__Flag _t2; + opt_ok2(&(flag__Flag[]) { f }, (_option*)(&_t2), sizeof(flag__Flag)); return _t2; } } - return (Option_flag__Flag){ .state=2, .err=_v_error(_SLIT("no such flag")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_flag__Flag){ .state=2, .err=_v_error(_SLIT("no such flag")), .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL void flag__FlagParser_handle_builtin_options(flag__FlagParser* fs) { bool show_version = false; bool show_help = false; - Option_flag__Flag _t1 = flag__FlagParser_find_existing_flag(fs, _SLIT("help")); + _option_flag__Flag _t1 = flag__FlagParser_find_existing_flag(fs, _SLIT("help")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; show_help = flag__FlagParser_bool(fs, _SLIT("help"), 'h', false, fs->default_help_label); } (*(flag__Flag*)_t1.data); - Option_flag__Flag _t2 = flag__FlagParser_find_existing_flag(fs, _SLIT("version")); + _option_flag__Flag _t2 = flag__FlagParser_find_existing_flag(fs, _SLIT("version")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; show_version = flag__FlagParser_bool(fs, _SLIT("version"), 0, false, fs->default_version_label); @@ -25182,34 +25223,34 @@ VV_LOCAL_SYMBOL void flag__FlagParser_handle_builtin_options(flag__FlagParser* f } } -Option_Array_string flag__FlagParser_finalize(flag__FlagParser* fs) { +_option_Array_string flag__FlagParser_finalize(flag__FlagParser* fs) { flag__FlagParser_handle_builtin_options(fs); Array_string remaining = array_clone_to_depth(&fs->args, 0); if (!fs->allow_unknown_args) { for (int _t1 = 0; _t1 < remaining.len; ++_t1) { string a = ((string*)remaining.data)[_t1]; if ((a.len >= 2 && string__eq(string_substr(a, 0, 2), _SLIT("--"))) || (a.len == 2 && string_at(a, 0) == '-')) { - return (Option_Array_string){ .state=2, .err=/*&IError*/I_flag__UnkownFlagError_to_Interface_IError(((flag__UnkownFlagError*)memdup(&(flag__UnkownFlagError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.flag = a,}, sizeof(flag__UnkownFlagError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=/*&IError*/I_flag__UnkownFlagError_to_Interface_IError(((flag__UnkownFlagError*)memdup(&(flag__UnkownFlagError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.flag = a,}, sizeof(flag__UnkownFlagError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } } } if (remaining.len < fs->min_free_args && fs->min_free_args > 0) { - return (Option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = fs->min_free_args,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = fs->min_free_args,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (remaining.len > fs->max_free_args && fs->max_free_args > 0) { - return (Option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = fs->max_free_args,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = fs->max_free_args,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (remaining.len > 0 && fs->max_free_args == 0 && fs->min_free_args == 0) { - return (Option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = 0,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=/*&IError*/I_flag__ArgsCountError_to_Interface_IError(((flag__ArgsCountError*)memdup(&(flag__ArgsCountError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.got = remaining.len,.want = 0,}, sizeof(flag__ArgsCountError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } _PUSH_MANY(&remaining, (fs->all_after_dashdash), _t6, Array_string); - Option_Array_string _t7; - opt_ok(&(Array_string[]) { remaining }, (Option*)(&_t7), sizeof(Array_string)); + _option_Array_string _t7; + opt_ok2(&(Array_string[]) { remaining }, (_option*)(&_t7), sizeof(Array_string)); return _t7; } Array_string flag__FlagParser_remaining_parameters(flag__FlagParser* fs) { - Option_Array_string _t2 = flag__FlagParser_finalize(fs); + _option_Array_string _t2 = flag__FlagParser_finalize(fs); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; eprintln(IError_name_table[err._typ]._method_msg(err._object)); @@ -25225,7 +25266,7 @@ Array_string flag__FlagParser_remaining_parameters(flag__FlagParser* fs) { // Attr: [inline] inline VV_LOCAL_SYMBOL bool semver__version_satisfies(semver__Version ver, string input) { - Option_semver__Range _t1 = semver__parse_range(input); + _option_semver__Range _t1 = semver__parse_range(input); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -25306,7 +25347,7 @@ VV_LOCAL_SYMBOL semver__RawVersion semver__parse(string input) { string raw_version = input; string prerelease = _SLIT(""); string metadata = _SLIT(""); - Option_int _t1 = string_last_index(raw_version, _SLIT("+")); + _option_int _t1 = string_last_index(raw_version, _SLIT("+")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(int*) _t1.data = -1; @@ -25317,7 +25358,7 @@ VV_LOCAL_SYMBOL semver__RawVersion semver__parse(string input) { metadata = string_substr(raw_version, (plus_idx + 1), (raw_version).len); raw_version = string_substr(raw_version, 0, plus_idx); } - Option_int _t2 = string_index(raw_version, _SLIT("-")); + _option_int _t2 = string_index(raw_version, _SLIT("-")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(int*) _t2.data = -1; @@ -25347,13 +25388,13 @@ VV_LOCAL_SYMBOL bool semver__RawVersion_is_missing(semver__RawVersion ver, int t return _t1; } -VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_coerce(semver__RawVersion raw_ver) { +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: "), /*115 &[]string*/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)); + _option_semver__Version _t2; + opt_ok2(&(semver__Version[]) { semver__RawVersion_to_version(ver) }, (_option*)(&_t2), sizeof(semver__Version)); return _t2; } @@ -25367,12 +25408,12 @@ VV_LOCAL_SYMBOL semver__RawVersion semver__RawVersion_complete(semver__RawVersio return _t2; } -VV_LOCAL_SYMBOL Option_semver__Version semver__RawVersion_validate(semver__RawVersion raw_ver) { +VV_LOCAL_SYMBOL _option_semver__Version semver__RawVersion_validate(semver__RawVersion raw_ver) { if (!semver__RawVersion_is_valid(raw_ver)) { - return (Option_semver__Version){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Version){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_semver__Version _t2; - opt_ok(&(semver__Version[]) { semver__RawVersion_to_version(raw_ver) }, (Option*)(&_t2), sizeof(semver__Version)); + _option_semver__Version _t2; + opt_ok2(&(semver__Version[]) { semver__RawVersion_to_version(raw_ver) }, (_option*)(&_t2), sizeof(semver__Version)); return _t2; } @@ -25428,59 +25469,59 @@ VV_LOCAL_SYMBOL bool semver__Comparator_satisfies(semver__Comparator c, semver__ return _t6; } -VV_LOCAL_SYMBOL Option_semver__Range semver__parse_range(string input) { +VV_LOCAL_SYMBOL _option_semver__Range semver__parse_range(string input) { Array_string raw_comparator_sets = string_split(input, _const_semver__comparator_set_sep); Array_semver__ComparatorSet comparator_sets = __new_array_with_default(0, 0, sizeof(semver__ComparatorSet), 0); for (int _t1 = 0; _t1 < raw_comparator_sets.len; ++_t1) { string raw_comp_set = ((string*)raw_comparator_sets.data)[_t1]; if (semver__can_expand(raw_comp_set)) { - Option_semver__ComparatorSet _t2 = semver__expand_comparator_set(raw_comp_set); + _option_semver__ComparatorSet _t2 = semver__expand_comparator_set(raw_comp_set); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_semver__Range){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Range){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__ComparatorSet s = (*(semver__ComparatorSet*)_t2.data); array_push((array*)&comparator_sets, _MOV((semver__ComparatorSet[]){ s })); } else { - Option_semver__ComparatorSet _t5 = semver__parse_comparator_set(raw_comp_set); + _option_semver__ComparatorSet _t5 = semver__parse_comparator_set(raw_comp_set); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - return (Option_semver__Range){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Range){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__ComparatorSet s = (*(semver__ComparatorSet*)_t5.data); array_push((array*)&comparator_sets, _MOV((semver__ComparatorSet[]){ s })); } } - Option_semver__Range _t8; - opt_ok(&(semver__Range[]) { ((semver__Range){.comparator_sets = comparator_sets,}) }, (Option*)(&_t8), sizeof(semver__Range)); + _option_semver__Range _t8; + opt_ok2(&(semver__Range[]) { ((semver__Range){.comparator_sets = comparator_sets,}) }, (_option*)(&_t8), sizeof(semver__Range)); return _t8; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__parse_comparator_set(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 \""), /*115 &string*/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) { string raw_comp = ((string*)raw_comparators.data)[_t2]; - Option_semver__Comparator _t3 = semver__parse_comparator(raw_comp); + _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 \""), /*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} }; + 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); array_push((array*)&comparators, _MOV((semver__Comparator[]){ c })); } - Option_semver__ComparatorSet _t6; - opt_ok(&(semver__ComparatorSet[]) { ((semver__ComparatorSet){.comparators = comparators,}) }, (Option*)(&_t6), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t6; + opt_ok2(&(semver__ComparatorSet[]) { ((semver__ComparatorSet){.comparators = comparators,}) }, (_option*)(&_t6), sizeof(semver__ComparatorSet)); return _t6; } -VV_LOCAL_SYMBOL Option_semver__Comparator semver__parse_comparator(string input) { +VV_LOCAL_SYMBOL _option_semver__Comparator semver__parse_comparator(string input) { semver__Operator op = semver__Operator__eq; string raw_version = _SLIT(""); if (string_starts_with(input, _SLIT(">="))) { @@ -25500,19 +25541,19 @@ VV_LOCAL_SYMBOL Option_semver__Comparator semver__parse_comparator(string input) } else { raw_version = input; } - Option_semver__Version _t1 = semver__coerce_version(raw_version); + _option_semver__Version _t1 = semver__coerce_version(raw_version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__Comparator){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Comparator){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version version = (*(semver__Version*)_t1.data); - Option_semver__Comparator _t3; - opt_ok(&(semver__Comparator[]) { ((semver__Comparator){.ver = version,.op = op,}) }, (Option*)(&_t3), sizeof(semver__Comparator)); + _option_semver__Comparator _t3; + opt_ok2(&(semver__Comparator[]) { ((semver__Comparator){.ver = version,.op = op,}) }, (_option*)(&_t3), sizeof(semver__Comparator)); return _t3; } -VV_LOCAL_SYMBOL Option_semver__Version semver__parse_xrange(string input) { +VV_LOCAL_SYMBOL _option_semver__Version semver__parse_xrange(string input) { semver__RawVersion raw_ver = semver__RawVersion_complete(semver__parse(input)); for (int _t1 = 0; _t1 < _const_semver__versions.len; ++_t1) { int typ = ((int*)_const_semver__versions.data)[_t1]; @@ -25536,10 +25577,10 @@ VV_LOCAL_SYMBOL Option_semver__Version semver__parse_xrange(string input) { }; } if (!semver__RawVersion_is_valid(raw_ver)) { - return (Option_semver__Version){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Version){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_semver__Version _t3; - opt_ok(&(semver__Version[]) { semver__RawVersion_to_version(raw_ver) }, (Option*)(&_t3), sizeof(semver__Version)); + _option_semver__Version _t3; + opt_ok2(&(semver__Version[]) { semver__RawVersion_to_version(raw_ver) }, (_option*)(&_t3), sizeof(semver__Version)); return _t3; } @@ -25548,32 +25589,32 @@ VV_LOCAL_SYMBOL bool semver__can_expand(string input) { return _t1; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_comparator_set(string input) { +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_comparator_set(string input) { u8 _t1 = string_at(input, 0); if (_t1 == ('~')) { - Option_semver__ComparatorSet _t2 = semver__expand_tilda(string_substr(input, 1, (input).len)); + _option_semver__ComparatorSet _t2 = semver__expand_tilda(string_substr(input, 1, (input).len)); return _t2; } else if (_t1 == ('^')) { - Option_semver__ComparatorSet _t3 = semver__expand_caret(string_substr(input, 1, (input).len)); + _option_semver__ComparatorSet _t3 = semver__expand_caret(string_substr(input, 1, (input).len)); return _t3; } else { }; if (string_contains(input, _const_semver__hyphen_range_sep)) { - Option_semver__ComparatorSet _t4 = semver__expand_hyphen(input); + _option_semver__ComparatorSet _t4 = semver__expand_hyphen(input); return _t4; } - Option_semver__ComparatorSet _t5 = semver__expand_xrange(input); + _option_semver__ComparatorSet _t5 = semver__expand_xrange(input); return _t5; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_tilda(string raw_version) { - Option_semver__Version _t1 = semver__coerce_version(raw_version); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_tilda(string raw_version) { + _option_semver__Version _t1 = semver__coerce_version(raw_version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version min_ver = (*(semver__Version*)_t1.data); @@ -25583,16 +25624,16 @@ VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_tilda(string raw_ver } else { max_ver = semver__Version_increment(min_ver, semver__Increment__minor); } - Option_semver__ComparatorSet _t3; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (Option*)(&_t3), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t3; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (_option*)(&_t3), sizeof(semver__ComparatorSet)); return _t3; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_caret(string raw_version) { - Option_semver__Version _t1 = semver__coerce_version(raw_version); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_caret(string raw_version) { + _option_semver__Version _t1 = semver__coerce_version(raw_version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version min_ver = (*(semver__Version*)_t1.data); @@ -25602,57 +25643,57 @@ VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_caret(string raw_ver } else { max_ver = semver__Version_increment(min_ver, semver__Increment__major); } - Option_semver__ComparatorSet _t3; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (Option*)(&_t3), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t3; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (_option*)(&_t3), sizeof(semver__ComparatorSet)); return _t3; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_hyphen(string raw_range) { +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_hyphen(string raw_range) { Array_string raw_versions = string_split(raw_range, _const_semver__hyphen_range_sep); if (raw_versions.len != 2) { - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_semver__Version _t2 = semver__coerce_version((*(string*)/*ee elem_sym */array_get(raw_versions, 0))); + _option_semver__Version _t2 = semver__coerce_version((*(string*)/*ee elem_sym */array_get(raw_versions, 0))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version min_ver = (*(semver__Version*)_t2.data); semver__RawVersion raw_max_ver = semver__parse((*(string*)/*ee elem_sym */array_get(raw_versions, 1))); if (semver__RawVersion_is_missing(raw_max_ver, _const_semver__ver_major)) { - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_semver__Version _t5 = semver__RawVersion_coerce(raw_max_ver); + _option_semver__Version _t5 = semver__RawVersion_coerce(raw_max_ver); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version max_ver = (*(semver__Version*)_t5.data); if (semver__RawVersion_is_missing(raw_max_ver, _const_semver__ver_minor)) { max_ver = semver__Version_increment(max_ver, semver__Increment__minor); - Option_semver__ComparatorSet _t7; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (Option*)(&_t7), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t7; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (_option*)(&_t7), sizeof(semver__ComparatorSet)); return _t7; } - Option_semver__ComparatorSet _t8; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_le(min_ver, max_ver) }, (Option*)(&_t8), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t8; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_le(min_ver, max_ver) }, (_option*)(&_t8), sizeof(semver__ComparatorSet)); return _t8; } -VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_xrange(string raw_range) { - Option_semver__Version _t1 = semver__parse_xrange(raw_range); +VV_LOCAL_SYMBOL _option_semver__ComparatorSet semver__expand_xrange(string raw_range) { + _option_semver__Version _t1 = semver__parse_xrange(raw_range); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__ComparatorSet){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version min_ver = (*(semver__Version*)_t1.data); if (min_ver.major == 0) { Array_semver__Comparator comparators = new_array_from_c_array(1, 1, sizeof(semver__Comparator), _MOV((semver__Comparator[1]){((semver__Comparator){.ver = min_ver,.op = semver__Operator__ge,})})); - Option_semver__ComparatorSet _t3; - opt_ok(&(semver__ComparatorSet[]) { ((semver__ComparatorSet){.comparators = comparators,}) }, (Option*)(&_t3), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t3; + opt_ok2(&(semver__ComparatorSet[]) { ((semver__ComparatorSet){.comparators = comparators,}) }, (_option*)(&_t3), sizeof(semver__ComparatorSet)); return _t3; } semver__Version max_ver = min_ver; @@ -25661,8 +25702,8 @@ VV_LOCAL_SYMBOL Option_semver__ComparatorSet semver__expand_xrange(string raw_ra } else { max_ver = semver__Version_increment(min_ver, semver__Increment__minor); } - Option_semver__ComparatorSet _t4; - opt_ok(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (Option*)(&_t4), sizeof(semver__ComparatorSet)); + _option_semver__ComparatorSet _t4; + opt_ok2(&(semver__ComparatorSet[]) { semver__make_comparator_set_ge_lt(min_ver, max_ver) }, (_option*)(&_t4), sizeof(semver__ComparatorSet)); return _t4; } @@ -25688,20 +25729,20 @@ string semver__InvalidVersionFormatError_msg(semver__InvalidVersionFormatError e return _t1; } -Option_semver__Version semver__from(string input) { +_option_semver__Version semver__from(string input) { if (input.len == 0) { - return (Option_semver__Version){ .state=2, .err=/*&IError*/I_semver__EmptyInputError_to_Interface_IError(((semver__EmptyInputError*)memdup(&(semver__EmptyInputError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),}, sizeof(semver__EmptyInputError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Version){ .state=2, .err=/*&IError*/I_semver__EmptyInputError_to_Interface_IError(((semver__EmptyInputError*)memdup(&(semver__EmptyInputError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),}, sizeof(semver__EmptyInputError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__RawVersion raw_version = semver__parse(input); - Option_semver__Version _t2 = semver__RawVersion_validate(raw_version); + _option_semver__Version _t2 = semver__RawVersion_validate(raw_version); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_semver__Version){ .state=2, .err=/*&IError*/I_semver__InvalidVersionFormatError_to_Interface_IError(((semver__InvalidVersionFormatError*)memdup(&(semver__InvalidVersionFormatError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.input = input,}, sizeof(semver__InvalidVersionFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_semver__Version){ .state=2, .err=/*&IError*/I_semver__InvalidVersionFormatError_to_Interface_IError(((semver__InvalidVersionFormatError*)memdup(&(semver__InvalidVersionFormatError){.Error = ((Error){EMPTY_STRUCT_INITIALIZATION}),.input = input,}, sizeof(semver__InvalidVersionFormatError)))), .data={EMPTY_STRUCT_INITIALIZATION} }; } semver__Version version = (*(semver__Version*)_t2.data); - Option_semver__Version _t4; - opt_ok(&(semver__Version[]) { version }, (Option*)(&_t4), sizeof(semver__Version)); + _option_semver__Version _t4; + opt_ok2(&(semver__Version[]) { version }, (_option*)(&_t4), sizeof(semver__Version)); return _t4; } @@ -25753,8 +25794,8 @@ string semver__Version_str(semver__Version ver) { return _t1; } -Option_semver__Version semver__coerce(string input) { - Option_semver__Version _t1 = semver__coerce_version(input); +_option_semver__Version semver__coerce(string input) { + _option_semver__Version _t1 = semver__coerce_version(input); return _t1; } @@ -25771,17 +25812,17 @@ inline VV_LOCAL_SYMBOL bool semver__is_version_valid(string input) { } // Attr: [inline] -inline VV_LOCAL_SYMBOL Option_semver__Version semver__coerce_version(string input) { +inline VV_LOCAL_SYMBOL _option_semver__Version semver__coerce_version(string input) { semver__RawVersion raw_ver = semver__parse(input); - Option_semver__Version _t1 = semver__RawVersion_coerce(raw_ver); + _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 \""), /*115 &string*/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); - Option_semver__Version _t3; - opt_ok(&(semver__Version[]) { ver }, (Option*)(&_t3), sizeof(semver__Version)); + _option_semver__Version _t3; + opt_ok2(&(semver__Version[]) { ver }, (_option*)(&_t3), sizeof(semver__Version)); return _t3; } @@ -25930,7 +25971,7 @@ Array_string os__args_before(string cut_word) { } string os__getenv(string key) { - Option_string _t2 = os__getenv_opt(key); + _option_string _t2 = os__getenv_opt(key); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(string*) _t2.data = _SLIT(""); @@ -25941,7 +25982,7 @@ string os__getenv(string key) { } // Attr: [manualfree] -Option_string os__getenv_opt(string key) { +_option_string os__getenv_opt(string key) { bool os__getenv_opt_defer_0 = false; u16* kw; { // Unsafe block @@ -25951,7 +25992,7 @@ u16* kw; os__getenv_opt_defer_0 = true; voidptr s = _wgetenv(kw); if (s == 0) { - Option_string _t1 = (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_string _t1 = (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__getenv_opt_defer_0) { #if defined(_WIN32) @@ -25962,8 +26003,8 @@ u16* kw; // Defer end return _t1; } - Option_string _t2; - opt_ok(&(string[]) { string_from_wide(s) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { string_from_wide(s) }, (_option*)(&_t2), sizeof(string)); // Defer begin if (os__getenv_opt_defer_0) { #if defined(_WIN32) @@ -25979,7 +26020,7 @@ u16* kw; } #endif } - return (Option_string){0}; + return (_option_string){0}; } int os__setenv(string name, string value, bool overwrite) { @@ -26116,7 +26157,7 @@ multi_return_string_int os__fd_read(int fd, int maxbytes) { return (multi_return_string_int){0}; } -Option_os__File os__open_file(string path, string mode, Array_int options) { +_option_os__File os__open_file(string path, string mode, Array_int options) { int flags = 0; for (int _t1 = 0; _t1 < mode.len; ++_t1) { u8 m = mode.str[_t1]; @@ -26170,44 +26211,44 @@ Option_os__File os__open_file(string path, string mode, Array_int options) { p = string_replace(path, _SLIT("/"), _SLIT("\\")); int fd = open(((char*)(p.str)), flags, permission); if (fd == -1) { - return (Option_os__File){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_os__File){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } 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 \""), /*115 &string*/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)); + _option_os__File _t4; + opt_ok2(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (_option*)(&_t4), sizeof(os__File)); return _t4; } -Option_os__File os__open(string path) { - Option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); +_option_os__File os__open(string path) { + _option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); if (_t1.state != 0) { /*or block*/ - Option_os__File _t2; + _option_os__File _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } FILE* cfile = (*(FILE**)_t1.data); int fd = os__fileno(cfile); - Option_os__File _t3; - opt_ok(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (Option*)(&_t3), sizeof(os__File)); + _option_os__File _t3; + opt_ok2(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (_option*)(&_t3), sizeof(os__File)); return _t3; } -Option_os__File os__create(string path) { - Option_FILE_ptr _t1 = os__vfopen(path, _SLIT("wb")); +_option_os__File os__create(string path) { + _option_FILE_ptr _t1 = os__vfopen(path, _SLIT("wb")); if (_t1.state != 0) { /*or block*/ - Option_os__File _t2; + _option_os__File _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } FILE* cfile = (*(FILE**)_t1.data); int fd = os__fileno(cfile); - Option_os__File _t3; - opt_ok(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (Option*)(&_t3), sizeof(os__File)); + _option_os__File _t3; + opt_ok2(&(os__File[]) { ((os__File){.cfile = cfile,.fd = fd,.is_opened = true,}) }, (_option*)(&_t3), sizeof(os__File)); return _t3; } @@ -26226,72 +26267,72 @@ os__File os__stderr(void) { return _t1; } -Option_int os__File_read(os__File* f, Array_u8* buf) { +_option_int os__File_read(os__File* f, Array_u8* buf) { if (buf->len == 0) { - Option_int _t1; - opt_ok(&(int[]) { 0 }, (Option*)(&_t1), sizeof(int)); + _option_int _t1; + opt_ok2(&(int[]) { 0 }, (_option*)(&_t1), sizeof(int)); return _t1; } - Option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t2.state != 0) { /*or block*/ - Option_int _t3; + _option_int _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } int nbytes = (*(int*)_t2.data); - Option_int _t4; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t4), sizeof(int)); return _t4; } -Option_int os__File_write(os__File* f, Array_u8 buf) { +_option_int os__File_write(os__File* f, Array_u8 buf) { if (!f->is_opened) { - return (Option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } int written = ((int)(fwrite(buf.data, 1, buf.len, f->cfile))); if (written == 0 && buf.len != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t3; - opt_ok(&(int[]) { written }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { written }, (_option*)(&_t3), sizeof(int)); return _t3; } -Option_int os__File_writeln(os__File* f, string s) { +_option_int os__File_writeln(os__File* f, string s) { if (!f->is_opened) { - return (Option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } int written = ((int)(fwrite(s.str, 1, s.len, f->cfile))); if (written == 0 && s.len != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; } int x = fputs("\n", f->cfile); if (x < 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("could not add newline")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("could not add newline")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t4; - opt_ok(&(int[]) { written + 1 }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { written + 1 }, (_option*)(&_t4), sizeof(int)); return _t4; } -Option_int os__File_write_string(os__File* f, string s) { - Option_void _t1 = os__File_write_full_buffer(f, s.str, ((usize)(s.len))); +_option_int os__File_write_string(os__File* f, string s) { + _option_void _t1 = os__File_write_full_buffer(f, s.str, ((usize)(s.len))); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_int _t2; + _option_int _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } ; - Option_int _t3; - opt_ok(&(int[]) { s.len }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { s.len }, (_option*)(&_t3), sizeof(int)); return _t3; } -Option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf) { +_option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf) { if (!f->is_opened) { - return (Option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } #if defined(TARGET_IS_64BIT) { @@ -26300,11 +26341,11 @@ Option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf) { _fseeki64(f->cfile, pos, SEEK_SET); int res = ((int)(fwrite(buf.data, 1, buf.len, f->cfile))); if (res == 0 && buf.len != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; } _fseeki64(f->cfile, 0U, SEEK_END); - Option_int _t3; - opt_ok(&(int[]) { res }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { res }, (_option*)(&_t3), sizeof(int)); return _t3; } #else @@ -26318,15 +26359,15 @@ Option_int os__File_write_to(os__File* f, u64 pos, Array_u8 buf) { fseek(f->cfile, pos, SEEK_SET); int res = ((int)(fwrite(buf.data, 1, buf.len, f->cfile))); if (res == 0 && buf.len != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("0 bytes written")), .data={EMPTY_STRUCT_INITIALIZATION} }; } fseek(f->cfile, 0, SEEK_END); - Option_int _t5; - opt_ok(&(int[]) { res }, (Option*)(&_t5), sizeof(int)); + _option_int _t5; + opt_ok2(&(int[]) { res }, (_option*)(&_t5), sizeof(int)); return _t5; } #endif - return (Option_int){ .state=2, .err=_v_error(_SLIT("Could not write to file")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("Could not write to file")), .data={EMPTY_STRUCT_INITIALIZATION} }; } // Attr: [unsafe] @@ -26336,12 +26377,12 @@ int os__File_write_ptr(os__File* f, voidptr data, int size) { } // Attr: [unsafe] -Option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer_len) { +_option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer_len) { if (buffer_len <= ((usize)(0))) { - return (Option_void){0}; + return (_option_void){0}; } if (!f->is_opened) { - return (Option_void){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } u8* ptr = ((u8*)(buffer)); i64 remaining_bytes = ((i64)(buffer_len)); @@ -26352,11 +26393,11 @@ Option_void os__File_write_full_buffer(os__File* f, voidptr buffer, usize buffer ptr += x; remaining_bytes -= x; if (x <= 0) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("C.fwrite returned 0")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("C.fwrite returned 0")), .data={EMPTY_STRUCT_INITIALIZATION} }; } } } - return (Option_void){0}; + return (_option_void){0}; } // Attr: [unsafe] @@ -26390,18 +26431,18 @@ int os__File_write_ptr_at(os__File* f, voidptr data, int size, u64 pos) { return _t3; } -VV_LOCAL_SYMBOL Option_int os__fread(voidptr ptr, int item_size, int items, FILE* stream) { +VV_LOCAL_SYMBOL _option_int os__fread(voidptr ptr, int item_size, int items, FILE* stream) { int nbytes = ((int)(fread(ptr, item_size, items, stream))); if (nbytes <= 0) { if (feof(stream) != 0) { - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } if (ferror(stream) != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("file read error")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("file read error")), .data={EMPTY_STRUCT_INITIALIZATION} }; } } - Option_int _t3; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t3), sizeof(int)); return _t3; } @@ -26412,7 +26453,7 @@ Array_u8 os__File_read_bytes(os__File* f, int size) { Array_u8 os__File_read_bytes_at(os__File* f, int size, u64 pos) { Array_u8 arr = __new_array_with_default(size, 0, sizeof(u8), 0); - Option_int _t1 = os__File_read_bytes_into(f, pos, &/*arr*/arr); + _option_int _t1 = os__File_read_bytes_into(f, pos, &/*arr*/arr); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; Array_u8 _t2 = __new_array_with_default(0, 0, sizeof(u8), 0); @@ -26424,9 +26465,9 @@ Array_u8 os__File_read_bytes_at(os__File* f, int size, u64 pos) { return _t3; } -Option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf) { +_option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf) { if (buf->len == 0) { - return (Option_int){ .state=2, .err=_v_error(string__plus(_SLIT("read_bytes_into_newline"), _SLIT(": `buf.len` == 0"))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(string__plus(_SLIT("read_bytes_into_newline"), _SLIT(": `buf.len` == 0"))), .data={EMPTY_STRUCT_INITIALIZATION} }; } int newline = 10; int c = 0; @@ -26439,19 +26480,19 @@ Option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf) { if (c == (EOF)) { if (feof(stream) != 0) { - Option_int _t2; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t2), sizeof(int)); return _t2; } if (ferror(stream) != 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("file read error")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("file read error")), .data={EMPTY_STRUCT_INITIALIZATION} }; } } else if (c == (newline)) { array_set(buf, buf_ptr, &(u8[]) { ((u8)(c)) }); nbytes++; - Option_int _t4; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t4), sizeof(int)); return _t4; } else { @@ -26460,30 +26501,30 @@ Option_int os__File_read_bytes_into_newline(os__File* f, Array_u8* buf) { nbytes++; }; } - Option_int _t5; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t5), sizeof(int)); + _option_int _t5; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t5), sizeof(int)); return _t5; } -Option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf) { +_option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf) { if (buf->len == 0) { - return (Option_int){ .state=2, .err=_v_error(string__plus(_SLIT("read_bytes_into"), _SLIT(": `buf.len` == 0"))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(string__plus(_SLIT("read_bytes_into"), _SLIT(": `buf.len` == 0"))), .data={EMPTY_STRUCT_INITIALIZATION} }; } #if defined(TARGET_IS_64BIT) { #if defined(_WIN32) { _fseeki64(f->cfile, pos, SEEK_SET); - Option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t2.state != 0) { /*or block*/ - Option_int _t3; + _option_int _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } int nbytes = (*(int*)_t2.data); - Option_int _t4; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t4), sizeof(int)); return _t4; } #else @@ -26495,26 +26536,26 @@ Option_int os__File_read_bytes_into(os__File* f, u64 pos, Array_u8* buf) { #if defined(TARGET_IS_32BIT) { fseek(f->cfile, pos, SEEK_SET); - Option_int _t5 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t5 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t5.state != 0) { /*or block*/ - Option_int _t6; + _option_int _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } int nbytes = (*(int*)_t5.data); - Option_int _t7; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t7), sizeof(int)); + _option_int _t7; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t7), sizeof(int)); return _t7; } #endif - return (Option_int){ .state=2, .err=_v_error(_SLIT("Could not read file")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("Could not read file")), .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf) { +_option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf) { if (buf->len == 0) { - Option_int _t1; - opt_ok(&(int[]) { 0 }, (Option*)(&_t1), sizeof(int)); + _option_int _t1; + opt_ok2(&(int[]) { 0 }, (_option*)(&_t1), sizeof(int)); return _t1; } #if defined(TARGET_IS_64BIT) @@ -26527,40 +26568,40 @@ Option_int os__File_read_from(os__File* f, u64 pos, Array_u8* buf) { { } #endif - Option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t2 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t2.state != 0) { /*or block*/ - Option_int _t3; + _option_int _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } int nbytes = (*(int*)_t2.data); - Option_int _t4; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t4), sizeof(int)); + _option_int _t4; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t4), sizeof(int)); return _t4; } #endif #if defined(TARGET_IS_32BIT) { fseek(f->cfile, pos, SEEK_SET); - Option_int _t5 = os__fread(buf->data, 1, buf->len, f->cfile); + _option_int _t5 = os__fread(buf->data, 1, buf->len, f->cfile); if (_t5.state != 0) { /*or block*/ - Option_int _t6; + _option_int _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } int nbytes = (*(int*)_t5.data); - Option_int _t7; - opt_ok(&(int[]) { nbytes }, (Option*)(&_t7), sizeof(int)); + _option_int _t7; + opt_ok2(&(int[]) { nbytes }, (_option*)(&_t7), sizeof(int)); return _t7; } #endif - return (Option_int){ .state=2, .err=_v_error(_SLIT("Could not read file")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("Could not read file")), .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_int os__File_read_into_ptr(os__File* f, u8* ptr, int max_size) { - Option_int _t1 = os__fread(ptr, 1, max_size, f->cfile); +_option_int os__File_read_into_ptr(os__File* f, u8* ptr, int max_size) { + _option_int _t1 = os__fread(ptr, 1, max_size, f->cfile); return _t1; } @@ -26591,9 +26632,9 @@ VV_LOCAL_SYMBOL IError os__error_size_of_type_0(void) { return _t1; } -Option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode) { +_option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode) { if (!f->is_opened) { - return (Option_void){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } int whence = ((int)(mode)); int res = 0; @@ -26615,21 +26656,21 @@ Option_void os__File_seek(os__File* f, i64 pos, os__SeekMode mode) { } #endif if (res == -1) { - return (Option_void){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } -Option_i64 os__File_tell(os__File* f) { +_option_i64 os__File_tell(os__File* f) { if (!f->is_opened) { - return (Option_i64){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=os__error_file_not_opened(), .data={EMPTY_STRUCT_INITIALIZATION} }; } i64 pos = ftell(f->cfile); if (pos == -1) { - return (Option_i64){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=_v_error(os__posix_get_error_msg(errno)), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_i64 _t3; - opt_ok(&(i64[]) { pos }, (Option*)(&_t3), sizeof(i64)); + _option_i64 _t3; + opt_ok2(&(i64[]) { pos }, (_option*)(&_t3), sizeof(i64)); return _t3; } @@ -26673,26 +26714,26 @@ os__FileMode os__inode(string path) { } // TypeDecl -Option_void os__open_uri(string uri) { +_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, /*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: "), /*115 &string*/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}; + return (_option_void){0}; } - Option_voidptr _t2 = dl__open_opt(_SLIT("shell32"), _const_dl__rtld_now); + _option_voidptr _t2 = dl__open_opt(_SLIT("shell32"), _const_dl__rtld_now); if (_t2.state != 0) { /*or block*/ - Option_void _t3; + _option_void _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } voidptr handle = (*(voidptr*)_t2.data); - Option_voidptr _t4 = dl__sym_opt(handle, _SLIT("ShellExecuteW")); + _option_voidptr _t4 = dl__sym_opt(handle, _SLIT("ShellExecuteW")); if (_t4.state != 0) { /*or block*/ - Option_void _t5; + _option_void _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } @@ -26700,16 +26741,16 @@ Option_void os__open_uri(string uri) { void (*func) (voidptr , u16* , u16* , u16* , u16* , int ) = ((os__ShellExecuteWin)( (*(voidptr*)_t4.data))); func(NULL, string_to_wide(_SLIT("open")), string_to_wide(uri), NULL, NULL, SW_SHOWNORMAL); dl__close(handle); - return (Option_void){0}; + return (_option_void){0}; } // Attr: [manualfree] -Option_Array_u8 os__read_bytes(string path) { +_option_Array_u8 os__read_bytes(string path) { bool os__read_bytes_defer_0 = false; FILE* fp; - Option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); + _option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); if (_t1.state != 0) { /*or block*/ - Option_Array_u8 _t2; + _option_Array_u8 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -26718,7 +26759,7 @@ FILE* fp; os__read_bytes_defer_0 = true; int cseek = fseek(fp, 0, SEEK_END); if (cseek != 0) { - Option_Array_u8 _t3 = (Option_Array_u8){ .state=2, .err=_v_error(_SLIT("fseek failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_Array_u8 _t3 = (_option_Array_u8){ .state=2, .err=_v_error(_SLIT("fseek failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -26728,7 +26769,7 @@ FILE* fp; } i64 fsize = ftell(fp); if (fsize < 0) { - Option_Array_u8 _t4 = (Option_Array_u8){ .state=2, .err=_v_error(_SLIT("ftell failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_Array_u8 _t4 = (_option_Array_u8){ .state=2, .err=_v_error(_SLIT("ftell failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -26738,7 +26779,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, /*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} }; + _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); @@ -26750,7 +26791,7 @@ FILE* fp; Array_u8 res = __new_array_with_default(len, 0, sizeof(u8), 0); int nr_read_elements = ((int)(fread(res.data, len, 1, fp))); if (nr_read_elements == 0 && fsize > 0) { - Option_Array_u8 _t6 = (Option_Array_u8){ .state=2, .err=_v_error(_SLIT("fread failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_Array_u8 _t6 = (_option_Array_u8){ .state=2, .err=_v_error(_SLIT("fread failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -26759,8 +26800,8 @@ FILE* fp; return _t6; } array_trim(&res, nr_read_elements * len); - Option_Array_u8 _t7; - opt_ok(&(Array_u8[]) { res }, (Option*)(&_t7), sizeof(Array_u8)); + _option_Array_u8 _t7; + opt_ok2(&(Array_u8[]) { res }, (_option*)(&_t7), sizeof(Array_u8)); // Defer begin if (os__read_bytes_defer_0) { fclose(fp); @@ -26769,13 +26810,13 @@ FILE* fp; return _t7; } -Option_string os__read_file(string path) { +_option_string os__read_file(string path) { bool os__read_file_defer_0 = false; FILE* fp; string mode = _SLIT("rb"); - Option_FILE_ptr _t1 = os__vfopen(path, mode); + _option_FILE_ptr _t1 = os__vfopen(path, mode); if (_t1.state != 0) { /*or block*/ - Option_string _t2; + _option_string _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -26784,7 +26825,7 @@ FILE* fp; os__read_file_defer_0 = true; int cseek = fseek(fp, 0, SEEK_END); if (cseek != 0) { - Option_string _t3 = (Option_string){ .state=2, .err=_v_error(_SLIT("fseek failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_string _t3 = (_option_string){ .state=2, .err=_v_error(_SLIT("fseek failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -26794,7 +26835,7 @@ FILE* fp; } i64 fsize = ftell(fp); if (fsize < 0) { - Option_string _t4 = (Option_string){ .state=2, .err=_v_error(_SLIT("ftell failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_string _t4 = (_option_string){ .state=2, .err=_v_error(_SLIT("ftell failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -26805,7 +26846,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, /*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} }; + _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); @@ -26820,7 +26861,7 @@ FILE* fp; int is_error = ((int)(ferror(fp))); if (is_eof == 0 && is_error != 0) { _v_free(str); - Option_string _t6 = (Option_string){ .state=2, .err=_v_error(_SLIT("fread failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_string _t6 = (_option_string){ .state=2, .err=_v_error(_SLIT("fread failed")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -26830,8 +26871,8 @@ FILE* fp; } str[nelements] = 0; if (nelements == 0) { - Option_string _t7; - opt_ok(&(string[]) { u8_vstring(str) }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { u8_vstring(str) }, (_option*)(&_t7), sizeof(string)); // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -26839,8 +26880,8 @@ FILE* fp; // Defer end return _t7; } - Option_string _t8; - opt_ok(&(string[]) { u8_vstring_with_len(str, nelements) }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(string[]) { u8_vstring_with_len(str, nelements) }, (_option*)(&_t8), sizeof(string)); // Defer begin if (os__read_file_defer_0) { fclose(fp); @@ -26848,16 +26889,16 @@ FILE* fp; // Defer end return _t8; } - return (Option_string){0}; + return (_option_string){0}; } -Option_void os__truncate(string path, u64 len) { +_option_void os__truncate(string path, u64 len) { bool os__truncate_defer_0 = false; int fp; fp = open(((char*)(path.str)), (_const_os__o_wronly | _const_os__o_trunc), 0); os__truncate_defer_0 = true; if (fp < 0) { - Option_void _t1 = (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t1 = (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__truncate_defer_0) { close(fp); @@ -26868,7 +26909,7 @@ int fp; #if defined(_WIN32) { if (_chsize_s(fp, len) != 0) { - Option_void _t2 = (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t2 = (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__truncate_defer_0) { close(fp); @@ -26886,7 +26927,7 @@ int fp; close(fp); } // Defer end - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL void os__eprintln_unknown_file_size(void) { @@ -26938,7 +26979,7 @@ u64 os__file_size(string path) { return _t5; } -Option_void os__mv(string src, string dst) { +_option_void os__mv(string src, string dst) { string rdst = dst; if (os__is_dir(rdst)) { rdst = os__join_path_single(string_trim_right(rdst, _const_os__path_separator), os__file_name(string_trim_right(src, _const_os__path_separator))); @@ -26949,36 +26990,36 @@ 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 "), /*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} }; + 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 { } #endif - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__cp(string src, string dst) { +_option_void os__cp(string src, string dst) { #if defined(_WIN32) { string w_src = string_replace(src, _SLIT("/"), _SLIT("\\")); 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 "), /*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} }; + 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 { } #endif - return (Option_void){0}; + return (_option_void){0}; } -Option_FILE_ptr os__vfopen(string path, string mode) { +_option_FILE_ptr os__vfopen(string path, string mode) { if (path.len == 0) { - return (Option_FILE_ptr){ .state=2, .err=_v_error(_SLIT("vfopen called with \"\"")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_FILE_ptr){ .state=2, .err=_v_error(_SLIT("vfopen called with \"\"")), .data={EMPTY_STRUCT_INITIALIZATION} }; } voidptr fp = ((voidptr)(0)); #if defined(_WIN32) @@ -26990,13 +27031,13 @@ 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 \""), /*115 &string*/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*)); + _option_FILE_ptr _t3; + opt_ok2(&(FILE*[]) { fp }, (_option*)(&_t3), sizeof(FILE*)); return _t3; } - return (Option_FILE_ptr){0}; + return (_option_FILE_ptr){0}; } int os__fileno(voidptr cfile) { @@ -27142,7 +27183,7 @@ bool os__is_readable(string path) { return 0; } -Option_void os__rm(string path) { +_option_void os__rm(string path) { int rc = 0; #if defined(_WIN32) { @@ -27153,24 +27194,24 @@ 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 \""), /*115 &string*/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}; + return (_option_void){0}; } -Option_void os__rmdir(string path) { +_option_void os__rmdir(string path) { #if defined(_WIN32) { 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 \""), /*115 &string*/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 { } #endif - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL void os__print_c_errno(void) { @@ -27397,16 +27438,16 @@ bool os__is_link(string path) { return 0; } -Option_void os__chdir(string path) { +_option_void os__chdir(string path) { #if defined(_WIN32) int ret = _wchdir(string_to_wide(path)); #else #endif ; if (ret == -1) { - return (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL int os__max_path_bufffer_size(void) { @@ -27605,26 +27646,26 @@ void os__flush(void) { fflush(stdout); } -Option_void os__chmod(string path, int mode) { +_option_void os__chmod(string path, int mode) { if (chmod(((char*)(path.str)), mode) != 0) { - return (Option_void){ .state=2, .err=error_with_code(string__plus(_SLIT("chmod failed: "), os__posix_get_error_msg(errno)), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(string__plus(_SLIT("chmod failed: "), os__posix_get_error_msg(errno)), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__chown(string path, int owner, int group) { +_option_void os__chown(string path, int owner, int group) { #if defined(_WIN32) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("os.chown() not implemented for Windows")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("os.chown() not implemented for Windows")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #else { } #endif - return (Option_void){0}; + return (_option_void){0}; } -Option_os__File os__open_append(string path) { +_option_os__File os__open_append(string path) { os__File file = ((os__File){.cfile = 0,.fd = 0,.is_opened = 0,}); #if defined(_WIN32) { @@ -27637,15 +27678,15 @@ 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 \""), /*115 &string*/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; - opt_ok(&(os__File[]) { file }, (Option*)(&_t2), sizeof(os__File)); + _option_os__File _t2; + opt_ok2(&(os__File[]) { file }, (_option*)(&_t2), sizeof(os__File)); return _t2; } -Option_void os__execvp(string cmdpath, Array_string cmdargs) { +_option_void os__execvp(string cmdpath, Array_string cmdargs) { Array_char_ptr cargs = __new_array_with_default(0, 0, sizeof(char*), 0); array_push((array*)&cargs, _MOV((char*[]){ ((char*)(cmdpath.str)) })); for (int i = 0; i < cmdargs.len; ++i) { @@ -27662,14 +27703,14 @@ Option_void os__execvp(string cmdpath, Array_string cmdargs) { } #endif if (res == -1) { - return (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } _v_exit(res); VUNREACHABLE(); - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs) { +_option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs) { Array_char_ptr cargv = __new_array_with_default(0, 0, sizeof(char*), 0); Array_char_ptr cenvs = __new_array_with_default(0, 0, sizeof(char*), 0); array_push((array*)&cargv, _MOV((char*[]){ ((char*)(cmdpath.str)) })); @@ -27691,9 +27732,9 @@ Option_void os__execve(string cmdpath, Array_string cmdargs, Array_string envs) } #endif if (res == -1) { - return (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } int os__is_atty(int fd) { @@ -27712,34 +27753,34 @@ int os__is_atty(int fd) { return 0; } -Option_void os__write_file_array(string path, array buffer) { - Option_os__File _t1 = os__create(path); +_option_void os__write_file_array(string path, array buffer) { + _option_os__File _t1 = os__create(path); if (_t1.state != 0) { /*or block*/ - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } os__File f = (*(os__File*)_t1.data); - Option_void _t3 = os__File_write_full_buffer(&f, buffer.data, ((usize)(buffer.len * buffer.element_size))); + _option_void _t3 = os__File_write_full_buffer(&f, buffer.data, ((usize)(buffer.len * buffer.element_size))); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } ; os__File_close(&f); - return (Option_void){0}; + return (_option_void){0}; } -Option_Array_string os__glob(Array_string patterns) { +_option_Array_string os__glob(Array_string patterns) { Array_string matches = __new_array_with_default(0, 0, sizeof(string), 0); for (int _t1 = 0; _t1 < patterns.len; ++_t1) { string pattern = ((string*)patterns.data)[_t1]; - Option_void _t2 = os__native_glob_pattern(pattern, &/*arr*/matches); + _option_void _t2 = os__native_glob_pattern(pattern, &/*arr*/matches); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { - Option_Array_string _t3; + _option_Array_string _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } @@ -27747,8 +27788,8 @@ Option_Array_string os__glob(Array_string patterns) { ; } qsort(matches.data, matches.len, matches.element_size, (int (*)(const void *, const void *))&compare_3677745349018262865_string); - Option_Array_string _t4; - opt_ok(&(Array_string[]) { matches }, (Option*)(&_t4), sizeof(Array_string)); + _option_Array_string _t4; + opt_ok2(&(Array_string[]) { matches }, (_option*)(&_t4), sizeof(Array_string)); return _t4; } @@ -27772,43 +27813,43 @@ void os__Result_free(os__Result* result) { string_free(&result->output); } -Option_void os__cp_all(string src, string dst, bool overwrite) { +_option_void os__cp_all(string src, string dst, bool overwrite) { string source_path = os__real_path(src); string dest_path = os__real_path(dst); if (!os__exists(source_path)) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("Source path doesn't exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("Source path doesn't exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__is_dir(source_path)) { string fname = os__file_name(source_path); string adjusted_path = (os__is_dir(dest_path) ? (os__join_path_single(dest_path, fname)) : (dest_path)); if (os__exists(adjusted_path)) { if (overwrite) { - Option_void _t2 = os__rm(adjusted_path); + _option_void _t2 = os__rm(adjusted_path); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { - Option_void _t3; + _option_void _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } ; } else { - return (Option_void){ .state=2, .err=_v_error(_SLIT("Destination file path already exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("Destination file path already exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; } } - Option_void _t5 = os__cp(source_path, adjusted_path); + _option_void _t5 = os__cp(source_path, adjusted_path); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { - Option_void _t6; + _option_void _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } ; - return (Option_void){0}; + return (_option_void){0}; } if (!os__exists(dest_path)) { - Option_bool _t7 = os__mkdir(dest_path); + _option_bool _t7 = os__mkdir(dest_path); if (_t7.state != 0) { /*or block*/ - Option_void _t8; + _option_void _t8; memcpy(&_t8, &_t7, sizeof(Option)); return _t8; } @@ -27816,11 +27857,11 @@ Option_void os__cp_all(string src, string dst, bool overwrite) { (*(bool*)_t7.data); } if (!os__is_dir(dest_path)) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("Destination path is not a valid directory")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("Destination path is not a valid directory")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_Array_string _t10 = os__ls(source_path); + _option_Array_string _t10 = os__ls(source_path); if (_t10.state != 0) { /*or block*/ - Option_void _t11; + _option_void _t11; memcpy(&_t11, &_t10, sizeof(Option)); return _t11; } @@ -27832,9 +27873,9 @@ Option_void os__cp_all(string src, string dst, bool overwrite) { string dp = os__join_path_single(dest_path, file); if (os__is_dir(sp)) { if (!os__exists(dp)) { - Option_bool _t13 = os__mkdir(dp); + _option_bool _t13 = os__mkdir(dp); if (_t13.state != 0) { /*or block*/ - Option_void _t14; + _option_void _t14; memcpy(&_t14, &_t13, sizeof(Option)); return _t14; } @@ -27842,49 +27883,49 @@ Option_void os__cp_all(string src, string dst, bool overwrite) { (*(bool*)_t13.data); } } - Option_void _t15 = os__cp_all(sp, dp, overwrite); + _option_void _t15 = os__cp_all(sp, dp, overwrite); if (_t15.state != 0 && _t15.err._typ != _IError_None___index) { IError err = _t15.err; - Option_void _t16 = os__rmdir(dp); + _option_void _t16 = os__rmdir(dp); if (_t16.state != 0 && _t16.err._typ != _IError_None___index) { err = _t16.err; - return (Option_void){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } ; - return (Option_void){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } ; } - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__mv_by_cp(string source, string target) { - Option_void _t1 = os__cp(source, target); +_option_void os__mv_by_cp(string source, string target) { + _option_void _t1 = os__cp(source, target); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } ; - Option_void _t3 = os__rm(source); + _option_void _t3 = os__rm(source); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } ; - return (Option_void){0}; + return (_option_void){0}; } // Attr: [manualfree] -Option_Array_string os__read_lines(string path) { - Option_string _t1 = os__read_file(path); +_option_Array_string os__read_lines(string path) { + _option_string _t1 = os__read_file(path); if (_t1.state != 0) { /*or block*/ - Option_Array_string _t2; + _option_Array_string _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -27892,8 +27933,8 @@ Option_Array_string os__read_lines(string path) { string buf = (*(string*)_t1.data); Array_string res = string_split_into_lines(buf); string_free(&buf); - Option_Array_string _t3; - opt_ok(&(Array_string[]) { res }, (Option*)(&_t3), sizeof(Array_string)); + _option_Array_string _t3; + opt_ok2(&(Array_string[]) { res }, (_option*)(&_t3), sizeof(Array_string)); return _t3; } @@ -27949,11 +27990,11 @@ string os__sigint_to_signal_name(int si) { return _t12; } -Option_void os__rmdir_all(string path) { +_option_void os__rmdir_all(string path) { string ret_err = _SLIT(""); - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -27963,7 +28004,7 @@ Option_void os__rmdir_all(string path) { string item = ((string*)items.data)[_t3]; string fullpath = os__join_path_single(path, item); if (os__is_dir(fullpath) && !os__is_link(fullpath)) { - Option_void _t4 = os__rmdir_all(fullpath); + _option_void _t4 = os__rmdir_all(fullpath); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; ret_err = IError_name_table[err._typ]._method_msg(err._object); @@ -27971,7 +28012,7 @@ Option_void os__rmdir_all(string path) { ; } else { - Option_void _t5 = os__rm(fullpath); + _option_void _t5 = os__rm(fullpath); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { IError err = _t5.err; ret_err = IError_name_table[err._typ]._method_msg(err._object); @@ -27980,7 +28021,7 @@ Option_void os__rmdir_all(string path) { ; } } - Option_void _t6 = os__rmdir(path); + _option_void _t6 = os__rmdir(path); if (_t6.state != 0 && _t6.err._typ != _IError_None___index) { IError err = _t6.err; ret_err = IError_name_table[err._typ]._method_msg(err._object); @@ -27988,14 +28029,14 @@ Option_void os__rmdir_all(string path) { ; if (ret_err.len > 0) { - return (Option_void){ .state=2, .err=_v_error(ret_err), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(ret_err), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } // Attr: [manualfree] bool os__is_dir_empty(string path) { - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = true; @@ -28010,7 +28051,7 @@ bool os__is_dir_empty(string path) { } string os__file_ext(string path) { - Option_int _t1 = string_last_index(path, _SLIT(".")); + _option_int _t1 = string_last_index(path, _SLIT(".")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; string _t2 = _SLIT(""); @@ -28028,7 +28069,7 @@ string os__dir(string opath) { return _t1; } string path = string_replace_each(opath, new_array_from_c_array(4, 4, sizeof(string), _MOV((string[4]){_SLIT("/"), string_clone(_const_os__path_separator), _SLIT("\\"), string_clone(_const_os__path_separator)}))); - Option_int _t2 = string_last_index(path, _const_os__path_separator); + _option_int _t2 = string_last_index(path, _const_os__path_separator); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; string _t3 = _SLIT("."); @@ -28056,7 +28097,7 @@ string os__base(string opath) { } if (string_ends_with(path, _const_os__path_separator)) { string path2 = string_substr(path, 0, path.len - 1); - Option_int _t3 = string_last_index(path2, _const_os__path_separator); + _option_int _t3 = string_last_index(path2, _const_os__path_separator); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; string _t4 = string_clone(path2); @@ -28067,7 +28108,7 @@ string os__base(string opath) { string _t5 = string_substr(path2, pos + 1, (path2).len); return _t5; } - Option_int _t6 = string_last_index(path, _const_os__path_separator); + _option_int _t6 = string_last_index(path, _const_os__path_separator); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; string _t7 = string_clone(path); @@ -28085,20 +28126,20 @@ string os__file_name(string opath) { return _t1; } -Option_string os__input_opt(string prompt) { +_option_string os__input_opt(string prompt) { print(prompt); os__flush(); string res = os__get_raw_line(); if (res.len > 0) { - Option_string _t1; - opt_ok(&(string[]) { string_trim_right(res, _SLIT("\r\n")) }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { string_trim_right(res, _SLIT("\r\n")) }, (_option*)(&_t1), sizeof(string)); return _t1; } - return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } string os__input(string prompt) { - Option_string _t1 = os__input_opt(prompt); + _option_string _t1 = os__input_opt(prompt); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; string _t2 = _SLIT(""); @@ -28196,25 +28237,25 @@ string os__expand_tilde_to_home(string path) { return _t3; } -Option_void os__write_file(string path, string text) { - Option_os__File _t1 = os__create(path); +_option_void os__write_file(string path, string text) { + _option_os__File _t1 = os__create(path); if (_t1.state != 0) { /*or block*/ - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } os__File f = (*(os__File*)_t1.data); - Option_void _t3 = os__File_write_full_buffer(&f, text.str, ((usize)(text.len))); + _option_void _t3 = os__File_write_full_buffer(&f, text.str, ((usize)(text.len))); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } ; os__File_close(&f); - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL string os__executable_fallback(void) { @@ -28231,7 +28272,7 @@ VV_LOCAL_SYMBOL string os__executable_fallback(void) { if (string_contains(rexepath, _const_os__path_separator)) { exepath = os__join_path_single(_const_os__wd_at_startup, exepath); } else { - Option_string _t2 = os__find_abs_path_of_executable(exepath); + _option_string _t2 = os__find_abs_path_of_executable(exepath); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(string*) _t2.data = _SLIT(""); @@ -28258,13 +28299,13 @@ VV_LOCAL_SYMBOL IError os__error_failed_to_find_executable(void) { return _t1; } -Option_string os__find_abs_path_of_executable(string exepath) { +_option_string os__find_abs_path_of_executable(string exepath) { if ((exepath).len == 0) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("expected non empty `exepath`")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("expected non empty `exepath`")), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (os__is_abs_path(exepath)) { - Option_string _t2; - opt_ok(&(string[]) { os__real_path(exepath) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { os__real_path(exepath) }, (_option*)(&_t2), sizeof(string)); return _t2; } string res = _SLIT(""); @@ -28279,15 +28320,15 @@ Option_string os__find_abs_path_of_executable(string exepath) { } } if (res.len > 0) { - Option_string _t4; - opt_ok(&(string[]) { os__real_path(res) }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { os__real_path(res) }, (_option*)(&_t4), sizeof(string)); return _t4; } - return (Option_string){ .state=2, .err=os__error_failed_to_find_executable(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=os__error_failed_to_find_executable(), .data={EMPTY_STRUCT_INITIALIZATION} }; } bool os__exists_in_system_path(string prog) { - Option_string _t1 = os__find_abs_path_of_executable(prog); + _option_string _t1 = os__find_abs_path_of_executable(prog); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -28383,7 +28424,7 @@ VV_LOCAL_SYMBOL void os__impl_walk_ext(string path, string ext, Array_string* ou if (!os__is_dir(path)) { return; } - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; return; @@ -28412,7 +28453,7 @@ void os__walk(string path, void (*f)(string )) { if (!os__is_dir(path)) { return; } - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; return; @@ -28443,7 +28484,7 @@ void os__walk_with_context(string path, voidptr context, void (*fcb)(voidptr , s if (!os__is_dir(path)) { return; } - Option_Array_string _t1 = os__ls(path); + _option_Array_string _t1 = os__ls(path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; return; @@ -28470,7 +28511,7 @@ void os__log(string s) { println(string__plus(_SLIT("os.log: "), s)); } -Option_void os__mkdir_all(string opath) { +_option_void os__mkdir_all(string opath) { string path = string_replace(opath, _SLIT("/"), _const_os__path_separator); string p = (string_starts_with(path, _const_os__path_separator) ? (_const_os__path_separator) : (_SLIT(""))); Array_string path_parts = string_split(string_trim_left(path, _const_os__path_separator), _const_os__path_separator); @@ -28480,15 +28521,15 @@ Option_void os__mkdir_all(string opath) { if (os__exists(p) && os__is_dir(p)) { continue; } - Option_bool _t2 = os__mkdir(p); + _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: "), /*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} }; + 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); } - return (Option_void){0}; + return (_option_void){0}; } string os__cache_dir(void) { @@ -28499,7 +28540,7 @@ string os__cache_dir(void) { } string cdir = os__join_path_single(os__home_dir(), _SLIT(".cache")); if (!os__is_dir(cdir) && !os__is_link(cdir)) { - Option_bool _t2 = os__mkdir(cdir); + _option_bool _t2 = os__mkdir(cdir); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; _v_panic(IError_str(err)); @@ -28637,13 +28678,13 @@ string os__quoted_path(string path) { return (string){.str=(byteptr)"", .is_lit=1}; } -Option_string os__config_dir(void) { +_option_string os__config_dir(void) { #if defined(_WIN32) { string app_data = os__getenv(_SLIT("AppData")); if ((app_data).len != 0) { - Option_string _t1; - opt_ok(&(string[]) { app_data }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { app_data }, (_option*)(&_t1), sizeof(string)); return _t1; } } @@ -28654,7 +28695,7 @@ Option_string os__config_dir(void) { { } #endif - return (Option_string){ .state=2, .err=_v_error(_SLIT("Cannot find config directory")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("Cannot find config directory")), .data={EMPTY_STRUCT_INITIALIZATION} }; } // TypeDecl @@ -28668,7 +28709,7 @@ VV_LOCAL_SYMBOL Array_string os__init_os_args_wide(int argc, u8** argv) { return _t1; } -VV_LOCAL_SYMBOL Option_void os__native_glob_pattern(string pattern, Array_string* matches) { +VV_LOCAL_SYMBOL _option_void os__native_glob_pattern(string pattern, Array_string* matches) { bool os__native_glob_pattern_defer_0 = false; voidptr h_find_files; 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,}); @@ -28676,7 +28717,7 @@ voidptr h_find_files; h_find_files = FindFirstFile(wpattern, ((voidptr)(&find_file_data))); os__native_glob_pattern_defer_0 = true; if (h_find_files == INVALID_HANDLE_VALUE) { - Option_void _t1 = (Option_void){ .state=2, .err=_v_error(string__plus(_SLIT("os.glob(): Could not get a file handle: "), os__get_error_msg(((int)(GetLastError()))))), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t1 = (_option_void){ .state=2, .err=_v_error(string__plus(_SLIT("os.glob(): Could not get a file handle: "), os__get_error_msg(((int)(GetLastError()))))), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (os__native_glob_pattern_defer_0) { FindClose(h_find_files); @@ -28708,25 +28749,25 @@ voidptr h_find_files; FindClose(h_find_files); } // Defer end - return (Option_void){0}; + return (_option_void){0}; } -Option_void os__utime(string path, int actime, int modtime) { +_option_void os__utime(string path, int actime, int modtime) { struct _utimbuf u = ((struct _utimbuf){.actime = actime,.modtime = modtime,}); if (_utime(((char*)(path.str)), ((voidptr)(&u))) != 0) { - return (Option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(os__posix_get_error_msg(errno), errno), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } -Option_Array_string os__ls(string path) { +_option_Array_string os__ls(string path) { if (path.len == 0) { - return (Option_Array_string){ .state=2, .err=_v_error(_SLIT("ls() expects a folder, not an empty string")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_string){ .state=2, .err=_v_error(_SLIT("ls() expects a folder, not an empty string")), .data={EMPTY_STRUCT_INITIALIZATION} }; } 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 \""), /*115 &string*/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, /*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))); @@ -28742,28 +28783,28 @@ Option_Array_string os__ls(string path) { } } FindClose(h_find_files); - Option_Array_string _t5; - opt_ok(&(Array_string[]) { dir_files }, (Option*)(&_t5), sizeof(Array_string)); + _option_Array_string _t5; + opt_ok2(&(Array_string[]) { dir_files }, (_option*)(&_t5), sizeof(Array_string)); return _t5; } -Option_bool os__mkdir(string path) { +_option_bool os__mkdir(string path) { if (string__eq(path, _SLIT("."))) { - Option_bool _t1; - opt_ok(&(bool[]) { true }, (Option*)(&_t1), sizeof(bool)); + _option_bool _t1; + opt_ok2(&(bool[]) { true }, (_option*)(&_t1), sizeof(bool)); return _t1; } 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 \""), /*115 &string*/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)); + _option_bool _t3; + opt_ok2(&(bool[]) { true }, (_option*)(&_t3), sizeof(bool)); return _t3; } os__HANDLE os__get_file_handle(string path) { - Option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); + _option_FILE_ptr _t1 = os__vfopen(path, _SLIT("rb")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; os__HANDLE _t2 = ((_const_os__invalid_handle_value)); @@ -28776,7 +28817,7 @@ os__HANDLE os__get_file_handle(string path) { return _t3; } -Option_string os__get_module_filename(os__HANDLE handle) { +_option_string os__get_module_filename(os__HANDLE handle) { { // Unsafe block int sz = 4096; u16* buf = ((u16*)(malloc_noscan(4096))); @@ -28784,18 +28825,18 @@ Option_string os__get_module_filename(os__HANDLE handle) { int status = ((int)(GetModuleFileNameW(handle, ((voidptr)(&buf)), sz))); if (status == (_const_os__success)) { - Option_string _t1; - opt_ok(&(string[]) { string_from_wide2(buf, sz) }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { string_from_wide2(buf, sz) }, (_option*)(&_t1), sizeof(string)); return _t1; } else { - return (Option_string){ .state=2, .err=_v_error(_SLIT("Cannot get file name from handle")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("Cannot get file name from handle")), .data={EMPTY_STRUCT_INITIALIZATION} }; }; } } _v_panic(_SLIT("this should be unreachable")); VUNREACHABLE(); - return (Option_string){0}; + return (_option_string){0}; } VV_LOCAL_SYMBOL voidptr os__ptr_win_get_error_msg(u32 code) { @@ -28904,7 +28945,7 @@ os__Result os__execute(string cmd) { return _t5; } -Option_bool os__symlink(string origin, string target) { +_option_bool os__symlink(string origin, string target) { #if defined(TARGET_IS_64BIT) || defined(TARGET_IS_32BIT) { int flags = 0; @@ -28914,31 +28955,31 @@ Option_bool os__symlink(string origin, string target) { flags ^= 2; int res = CreateSymbolicLinkW(string_to_wide(target), string_to_wide(origin), flags); if (res != 1) { - return (Option_bool){ .state=2, .err=_v_error(os__get_error_msg(((int)(GetLastError())))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_v_error(os__get_error_msg(((int)(GetLastError())))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__exists(target)) { - return (Option_bool){ .state=2, .err=_v_error(_SLIT("C.CreateSymbolicLinkW reported success, but symlink still does not exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_v_error(_SLIT("C.CreateSymbolicLinkW reported success, but symlink still does not exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_bool _t3; - opt_ok(&(bool[]) { true }, (Option*)(&_t3), sizeof(bool)); + _option_bool _t3; + opt_ok2(&(bool[]) { true }, (_option*)(&_t3), sizeof(bool)); return _t3; } #endif - Option_bool _t4; - opt_ok(&(bool[]) { false }, (Option*)(&_t4), sizeof(bool)); + _option_bool _t4; + opt_ok2(&(bool[]) { false }, (_option*)(&_t4), sizeof(bool)); return _t4; } -Option_bool os__link(string origin, string target) { +_option_bool os__link(string origin, string target) { int res = CreateHardLinkW(string_to_wide(target), string_to_wide(origin), NULL); if (res != 1) { - return (Option_bool){ .state=2, .err=_v_error(os__get_error_msg(((int)(GetLastError())))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_v_error(os__get_error_msg(((int)(GetLastError())))), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (!os__exists(target)) { - return (Option_bool){ .state=2, .err=_v_error(_SLIT("C.CreateHardLinkW reported success, but link still does not exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_v_error(_SLIT("C.CreateHardLinkW reported success, but link still does not exist")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_bool _t3; - opt_ok(&(bool[]) { true }, (Option*)(&_t3), sizeof(bool)); + _option_bool _t3; + opt_ok2(&(bool[]) { true }, (_option*)(&_t3), sizeof(bool)); return _t3; } @@ -28993,32 +29034,32 @@ string os__loginname(void) { return _t2; } -Option_bool os__is_writable_folder(string folder) { +_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("`"), /*115 &string*/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} }; + return (_option_bool){ .state=2, .err=_v_error(_SLIT("`folder` is not a folder")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string tmp_folder_name = string__plus(_SLIT("tmp_perm_check_pid_"), int_str(os__getpid())); string tmp_perm_check = os__join_path_single(folder, tmp_folder_name); - Option_void _t3 = os__write_file(tmp_perm_check, _SLIT("test")); + _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 \""), /*115 &string*/0xfe10, {.d_s = folder}}, {_SLIT("\": "), /*115 &IError*/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} }; } ; - Option_void _t5 = os__rm(tmp_perm_check); + _option_void _t5 = os__rm(tmp_perm_check); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { - Option_bool _t6; + _option_bool _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } ; - Option_bool _t7; - opt_ok(&(bool[]) { true }, (Option*)(&_t7), sizeof(bool)); + _option_bool _t7; + opt_ok2(&(bool[]) { true }, (_option*)(&_t7), sizeof(bool)); return _t7; } @@ -29061,10 +29102,10 @@ inline int os__getegid(void) { void os__posix_set_permission_bit(string path_s, u32 mode, bool enable) { } -Option_void os__Command_start(os__Command* c) { +_option_void os__Command_start(os__Command* c) { _v_panic(_SLIT("not implemented")); VUNREACHABLE(); - return (Option_void){0}; + return (_option_void){0}; } string os__Command_read_line(os__Command* c) { @@ -29073,10 +29114,10 @@ string os__Command_read_line(os__Command* c) { return (string){.str=(byteptr)"", .is_lit=1}; } -Option_void os__Command_close(os__Command* c) { +_option_void os__Command_close(os__Command* c) { _v_panic(_SLIT("not implemented")); VUNREACHABLE(); - return (Option_void){0}; + return (_option_void){0}; } void os__Process_signal_kill(os__Process* p) { @@ -29616,14 +29657,14 @@ VV_LOCAL_SYMBOL bool os__Process_unix_is_alive(os__Process* p) { return _t1; } -Option_os__SignalHandler os__signal_opt(os__Signal signum, void (*handler)(os__Signal )) { +_option_os__SignalHandler os__signal_opt(os__Signal signum, void (*handler)(os__Signal )) { errno = 0; voidptr prev_handler = signal(((int)(signum)), (voidptr)handler); if (prev_handler == SIG_ERR) { - return (Option_os__SignalHandler){ .state=2, .err=error_with_code(os__posix_get_error_msg(EINVAL), EINVAL), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_os__SignalHandler){ .state=2, .err=error_with_code(os__posix_get_error_msg(EINVAL), EINVAL), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_os__SignalHandler _t2; - opt_ok(&(os__SignalHandler[]) { (voidptr)((os__SignalHandler)(prev_handler)) }, (Option*)(&_t2), sizeof(os__SignalHandler)); + _option_os__SignalHandler _t2; + opt_ok2(&(os__SignalHandler[]) { (voidptr)((os__SignalHandler)(prev_handler)) }, (_option*)(&_t2), sizeof(os__SignalHandler)); return _t2; } @@ -29657,7 +29698,7 @@ void v__depgraph__OrderedDepMap_add(v__depgraph__OrderedDepMap* o, string name, Array_string v__depgraph__OrderedDepMap_get(v__depgraph__OrderedDepMap* o, string name) { Array_string* _t2 = (Array_string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, o->data), &(string[]){name})); - Option_Array_string _t1 = {0}; + _option_Array_string _t1 = {0}; if (_t2) { *((Array_string*)&_t1.data) = *((Array_string*)_t2); } else { @@ -32462,7 +32503,7 @@ multi_return_int_int term__get_terminal_size(void) { return (multi_return_int_int){.arg0=_const_term__default_columns_size, .arg1=_const_term__default_rows_size}; } -Option_term__Coord term__get_cursor_position(void) { +_option_term__Coord term__get_cursor_position(void) { term__Coord res = ((term__Coord){.x = 0,.y = 0,}); if (os__is_atty(1) > 0 && !string__eq(os__getenv(_SLIT("TERM")), _SLIT("dumb"))) { CONSOLE_SCREEN_BUFFER_INFO info = ((CONSOLE_SCREEN_BUFFER_INFO){.dwSize = {0},.dwCursorPosition = {0},.wAttributes = 0,.srWindow = {0},.dwMaximumWindowSize = {0},}); @@ -32470,11 +32511,11 @@ Option_term__Coord term__get_cursor_position(void) { res.x = info.dwCursorPosition.X; res.y = info.dwCursorPosition.Y; } else { - return (Option_term__Coord){ .state=2, .err=os__last_error(), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_term__Coord){ .state=2, .err=os__last_error(), .data={EMPTY_STRUCT_INITIALIZATION} }; } } - Option_term__Coord _t2; - opt_ok(&(term__Coord[]) { res }, (Option*)(&_t2), sizeof(term__Coord)); + _option_term__Coord _t2; + opt_ok2(&(term__Coord[]) { res }, (_option*)(&_t2), sizeof(term__Coord)); return _t2; } @@ -32549,7 +32590,7 @@ string v__util__version__githash(bool should_get_from_filesystem) { if (!os__exists(git_head_file)) { break; } - Option_string _t1 = os__read_file(git_head_file); + _option_string _t1 = os__read_file(git_head_file); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; break; @@ -32563,7 +32604,7 @@ string v__util__version__githash(bool should_get_from_filesystem) { if (!os__exists(gcbranch_file)) { break; } - Option_string _t2 = os__read_file(gcbranch_file); + _option_string _t2 = os__read_file(gcbranch_file); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; break; @@ -32598,7 +32639,7 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts) { } ; if (!os__is_dir(vcache_basepath)) { - Option_void _t1 = os__mkdir_all(vcache_basepath); + _option_void _t1 = os__mkdir_all(vcache_basepath); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; _v_panic(IError_str(err)); @@ -32612,7 +32653,7 @@ v__vcache__CacheManager v__vcache__new_cache_manager(Array_string opts) { string readme_file = os__join_path(vcache_basepath, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("README.md")}))); if (!os__is_file(readme_file)) { string readme_content = string_strip_margin(_SLIT("This folder contains cached build artifacts from the V build system.\n\011\011|You can safely delete it, if it is getting too large.\n\011\011|It will be recreated the next time you compile something with V.\n\011\011|You can change its location with the VCACHE environment variable.\n\011\011")); - Option_void _t2 = os__write_file(readme_file, readme_content); + _option_void _t2 = os__write_file(readme_file, readme_content); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -32635,7 +32676,7 @@ void v__vcache__CacheManager_set_temporary_options(v__vcache__CacheManager* cm, string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key) { string* _t2 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, cm->k2cpath), &(string[]){key})); - Option_string _t1 = {0}; + _option_string _t1 = {0}; if (_t2) { *((string*)&_t1.data) = *((string*)_t2); } else { @@ -32657,7 +32698,7 @@ string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key string cprefix_folder = os__join_path(cm->basepath, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){prefix}))); cpath = os__join_path(cprefix_folder, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){khash}))); if (!os__is_dir(cprefix_folder)) { - Option_void _t3 = os__mkdir_all(cprefix_folder); + _option_void _t3 = os__mkdir_all(cprefix_folder); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; _v_panic(IError_str(err)); @@ -32666,7 +32707,7 @@ string v__vcache__CacheManager_key2cpath(v__vcache__CacheManager* cm, string key } ; - Option_void _t4 = os__chmod(cprefix_folder, 0777); + _option_void _t4 = os__chmod(cprefix_folder, 0777); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; _v_panic(IError_str(err)); @@ -32694,53 +32735,53 @@ string v__vcache__CacheManager_postfix_with_key2cpath(v__vcache__CacheManager* c return _t1; } -Option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key) { +_option_string v__vcache__CacheManager_exists(v__vcache__CacheManager* cm, string postfix, string key) { string fpath = v__vcache__CacheManager_postfix_with_key2cpath(cm, postfix, key); ; if (!os__exists(fpath)) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("does not exist yet")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("does not exist yet")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t2; - opt_ok(&(string[]) { fpath }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { fpath }, (_option*)(&_t2), sizeof(string)); return _t2; } -Option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content) { +_option_string v__vcache__CacheManager_save(v__vcache__CacheManager* cm, string postfix, string key, string content) { string fpath = v__vcache__CacheManager_postfix_with_key2cpath(cm, postfix, key); - Option_void _t1 = os__write_file(fpath, content); + _option_void _t1 = os__write_file(fpath, content); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_string _t2; + _option_string _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } ; ; - Option_string _t3; - opt_ok(&(string[]) { fpath }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { fpath }, (_option*)(&_t3), sizeof(string)); return _t3; } -Option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key) { - Option_string _t1 = v__vcache__CacheManager_exists(cm, postfix, key); +_option_string v__vcache__CacheManager_load(v__vcache__CacheManager* cm, string postfix, string key) { + _option_string _t1 = v__vcache__CacheManager_exists(cm, postfix, key); if (_t1.state != 0) { /*or block*/ - Option_string _t2; + _option_string _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } string fpath = (*(string*)_t1.data); - Option_string _t3 = os__read_file(fpath); + _option_string _t3 = os__read_file(fpath); if (_t3.state != 0) { /*or block*/ - Option_string _t4; + _option_string _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } string content = (*(string*)_t3.data); ; - Option_string _t5; - opt_ok(&(string[]) { content }, (Option*)(&_t5), sizeof(string)); + _option_string _t5; + opt_ok2(&(string[]) { content }, (_option*)(&_t5), sizeof(string)); return _t5; } @@ -33234,12 +33275,12 @@ inline time__Duration time__Time__minus(time__Time lhs, time__Time rhs) { return _t1; } -Option_time__Time time__parse_rfc3339(string s) { +_option_time__Time time__parse_rfc3339(string s) { if ((s).len == 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; } string sn = string_replace_each(s, new_array_from_c_array(4, 4, sizeof(string), _MOV((string[4]){_SLIT("t"), _SLIT("T"), _SLIT("z"), _SLIT("Z")}))); - Option_time__Time _t2 = time__parse_iso8601(sn); + _option_time__Time _t2 = time__parse_iso8601(sn); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(time__Time*) _t2.data = ((time__Time){.year = 0,.month = 0,.day = 0,.hour = 0,.minute = 0,.second = 0,.microsecond = 0,._v_unix = 0,.is_local = 0,}); @@ -33247,11 +33288,11 @@ Option_time__Time time__parse_rfc3339(string s) { time__Time t = (*(time__Time*)_t2.data); if (!time__Time__eq(t, ((time__Time){.year = 0,.month = 0,.day = 0,.hour = 0,.minute = 0,.second = 0,.microsecond = 0,._v_unix = 0,.is_local = 0,}))) { - Option_time__Time _t3; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t3), sizeof(time__Time)); + _option_time__Time _t3; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t3), sizeof(time__Time)); return _t3; } - Option_int _t4 = string_index(sn, _SLIT("T")); + _option_int _t4 = string_index(sn, _SLIT("T")); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(int*) _t4.data = -1; @@ -33260,9 +33301,9 @@ Option_time__Time time__parse_rfc3339(string s) { int t_i = (*(int*)_t4.data); Array_string parts = (t_i != -1 ? (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){string_clone(string_substr(sn, 0, t_i)), string_clone(string_substr(sn, t_i + 1, (sn).len))}))) : (string_split(sn, _SLIT(" ")))); if (!string_contains_any((*(string*)/*ee elem_sym */array_get(parts, 0)), _SLIT(" Z")) && string_contains((*(string*)/*ee elem_sym */array_get(parts, 0)), _SLIT("-"))) { - Option_multi_return_int_int_int _t5 = time__parse_iso8601_date(sn); + _option_multi_return_int_int_int _t5 = time__parse_iso8601_date(sn); if (_t5.state != 0) { /*or block*/ - Option_time__Time _t6; + _option_time__Time _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } @@ -33272,8 +33313,8 @@ Option_time__Time time__parse_rfc3339(string s) { int month = mr_1001.arg1; int day = mr_1001.arg2; t = time__new_time(((time__Time){.year = year,.month = month,.day = day,.hour = 0,.minute = 0,.second = 0,.microsecond = 0,._v_unix = 0,.is_local = 0,})); - Option_time__Time _t7; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t7), sizeof(time__Time)); + _option_time__Time _t7; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t7), sizeof(time__Time)); return _t7; } if (!string_contains((*(string*)/*ee elem_sym */array_get(parts, 0)), _SLIT("-")) && string_contains((*(string*)/*ee elem_sym */array_get(parts, 0)), _SLIT(":"))) { @@ -33283,9 +33324,9 @@ Option_time__Time time__parse_rfc3339(string s) { int microsecond_ = 0; i64 unix_offset = ((i64)(0)); bool is_local_time = true; - Option_multi_return_int_int_int_int_i64_bool _t8 = time__parse_iso8601_time((*(string*)/*ee elem_sym */array_get(parts, 0))); + _option_multi_return_int_int_int_int_i64_bool _t8 = time__parse_iso8601_time((*(string*)/*ee elem_sym */array_get(parts, 0))); if (_t8.state != 0) { /*or block*/ - Option_time__Time _t9; + _option_time__Time _t9; memcpy(&_t9, &_t8, sizeof(Option)); return _t9; } @@ -33299,8 +33340,8 @@ Option_time__Time time__parse_rfc3339(string s) { is_local_time = mr_1384.arg5; t = time__new_time(((time__Time){.year = 0,.month = 0,.day = 0,.hour = hour_,.minute = minute_,.second = second_,.microsecond = microsecond_,._v_unix = 0,.is_local = 0,})); if (is_local_time) { - Option_time__Time _t10; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t10), sizeof(time__Time)); + _option_time__Time _t10; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t10), sizeof(time__Time)); return _t10; } i64 unix_time = t._v_unix; @@ -33310,28 +33351,28 @@ Option_time__Time time__parse_rfc3339(string s) { unix_time += unix_offset; } t = time__unix2(((i64)(unix_time)), t.microsecond); - Option_time__Time _t11; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t11), sizeof(time__Time)); + _option_time__Time _t11; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t11), sizeof(time__Time)); return _t11; } - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(9), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(9), .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_time__Time time__parse(string s) { +_option_time__Time time__parse(string s) { if ((s).len == 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t2 = string_index(s, _SLIT(" ")); + _option_int _t2 = string_index(s, _SLIT(" ")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(1), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(1), .data={EMPTY_STRUCT_INITIALIZATION} }; } int pos = (*(int*)_t2.data); string symd = string_substr(s, 0, pos); Array_string ymd = string_split(symd, _SLIT("-")); if (ymd.len != 3) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(2), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(2), .data={EMPTY_STRUCT_INITIALIZATION} }; } string shms = string_substr(s, pos, (s).len); Array_string hms = string_split(shms, _SLIT(":")); @@ -33345,22 +33386,22 @@ Option_time__Time time__parse(string s) { int iminute = string_int(minute_); int isecond = string_int(second_); if (iyear > 9999 || iyear < -9999) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(3), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(3), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (imonth > 12 || imonth < 1) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(4), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(4), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (iday > 31 || iday < 1) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(5), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(5), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (ihour > 23 || ihour < 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(6), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(6), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (iminute > 59 || iminute < 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(7), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(7), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (isecond > 59 || isecond < 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(8), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(8), .data={EMPTY_STRUCT_INITIALIZATION} }; } time__Time res = time__new_time(((time__Time){ .year = iyear, @@ -33373,16 +33414,16 @@ Option_time__Time time__parse(string s) { ._v_unix = 0, .is_local = 0, })); - Option_time__Time _t11; - opt_ok(&(time__Time[]) { res }, (Option*)(&_t11), sizeof(time__Time)); + _option_time__Time _t11; + opt_ok2(&(time__Time[]) { res }, (_option*)(&_t11), sizeof(time__Time)); return _t11; } -Option_time__Time time__parse_iso8601(string s) { +_option_time__Time time__parse_iso8601(string s) { if ((s).len == 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t2 = string_index(s, _SLIT("T")); + _option_int _t2 = string_index(s, _SLIT("T")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(int*) _t2.data = -1; @@ -33391,11 +33432,11 @@ Option_time__Time time__parse_iso8601(string s) { int t_i = (*(int*)_t2.data); Array_string parts = (t_i != -1 ? (new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){string_clone(string_substr(s, 0, t_i)), string_clone(string_substr(s, t_i + 1, (s).len))}))) : (string_split(s, _SLIT(" ")))); if (!(parts.len == 1 || parts.len == 2)) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(12), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(12), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_multi_return_int_int_int _t4 = time__parse_iso8601_date((*(string*)/*ee elem_sym */array_get(parts, 0))); + _option_multi_return_int_int_int _t4 = time__parse_iso8601_date((*(string*)/*ee elem_sym */array_get(parts, 0))); if (_t4.state != 0) { /*or block*/ - Option_time__Time _t5; + _option_time__Time _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } @@ -33411,9 +33452,9 @@ Option_time__Time time__parse_iso8601(string s) { i64 unix_offset = ((i64)(0)); bool is_local_time = true; if (parts.len == 2) { - Option_multi_return_int_int_int_int_i64_bool _t6 = time__parse_iso8601_time((*(string*)/*ee elem_sym */array_get(parts, 1))); + _option_multi_return_int_int_int_int_i64_bool _t6 = time__parse_iso8601_time((*(string*)/*ee elem_sym */array_get(parts, 1))); if (_t6.state != 0) { /*or block*/ - Option_time__Time _t7; + _option_time__Time _t7; memcpy(&_t7, &_t6, sizeof(Option)); return _t7; } @@ -33438,8 +33479,8 @@ Option_time__Time time__parse_iso8601(string s) { .is_local = 0, })); if (is_local_time) { - Option_time__Time _t8; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t8), sizeof(time__Time)); + _option_time__Time _t8; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t8), sizeof(time__Time)); return _t8; } i64 unix_time = t._v_unix; @@ -33449,23 +33490,23 @@ Option_time__Time time__parse_iso8601(string s) { unix_time += unix_offset; } t = time__unix2(((i64)(unix_time)), t.microsecond); - Option_time__Time _t9; - opt_ok(&(time__Time[]) { t }, (Option*)(&_t9), sizeof(time__Time)); + _option_time__Time _t9; + opt_ok2(&(time__Time[]) { t }, (_option*)(&_t9), sizeof(time__Time)); return _t9; } -Option_time__Time time__parse_rfc2822(string s) { +_option_time__Time time__parse_rfc2822(string s) { if ((s).len == 0) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(0), .data={EMPTY_STRUCT_INITIALIZATION} }; } Array_string fields = string_split(s, _SLIT(" ")); if (fields.len < 5) { - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(1), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(1), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t3 = string_index(_const_time__months_string, (*(string*)/*ee elem_sym */array_get(fields, 2))); + _option_int _t3 = string_index(_const_time__months_string, (*(string*)/*ee elem_sym */array_get(fields, 2))); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_time__Time){ .state=2, .err=time__error_invalid_time(2), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_time__Time){ .state=2, .err=time__error_invalid_time(2), .data={EMPTY_STRUCT_INITIALIZATION} }; } int pos = (*(int*)_t3.data); @@ -33473,58 +33514,79 @@ Option_time__Time time__parse_rfc2822(string s) { { // Unsafe block u8* tmstr = malloc_noscan(s.len * 2); int count = snprintf(((char*)(tmstr)), (s.len * 2), "%s-%02d-%s %s", (*(string*)/*ee elem_sym */array_get(fields, 3)).str, mm, (*(string*)/*ee elem_sym */array_get(fields, 1)).str, (*(string*)/*ee elem_sym */array_get(fields, 4)).str); - Option_time__Time _t5 = time__parse(tos(tmstr, count)); + _option_time__Time _t5 = time__parse(tos(tmstr, count)); return _t5; } - return (Option_time__Time){0}; + return (_option_time__Time){0}; } -VV_LOCAL_SYMBOL Option_multi_return_int_int_int time__parse_iso8601_date(string s) { +VV_LOCAL_SYMBOL _option_multi_return_int_int_int time__parse_iso8601_date(string s) { int year = 0; int month = 0; int day = 0; u8 dummy = ((u8)(0)); int count = sscanf(((char*)(s.str)), "%4d-%2d-%2d%c", &year, &month, &day, &dummy); if (count != 3) { - return (Option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(10), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(10), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (year > 9999) { - return (Option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(13), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(13), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (month > 12) { - return (Option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(14), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(14), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (day > 31) { - return (Option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(15), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int){ .state=2, .err=time__error_invalid_time(15), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_multi_return_int_int_int _t5; - opt_ok(&(multi_return_int_int_int/*X*/[]) { (multi_return_int_int_int){.arg0=year, .arg1=month, .arg2=day} }, (Option*)(&_t5), sizeof(multi_return_int_int_int)); + _option_multi_return_int_int_int _t5; + opt_ok2(&(multi_return_int_int_int/*X*/[]) { (multi_return_int_int_int){.arg0=year, .arg1=month, .arg2=day} }, (_option*)(&_t5), sizeof(multi_return_int_int_int)); return _t5; } -VV_LOCAL_SYMBOL Option_multi_return_int_int_int_int_i64_bool time__parse_iso8601_time(string s) { +VV_LOCAL_SYMBOL _option_multi_return_int_int_int_int_i64_bool time__parse_iso8601_time(string s) { int hour_ = 0; int minute_ = 0; int second_ = 0; int microsecond_ = 0; + int nanosecond_ = 0; rune plus_min_z = 'a'; int offset_hour = 0; int offset_minute = 0; - int count = sscanf(((char*)(s.str)), "%2d:%2d:%2d.%6d%c%2d:%2d", &hour_, &minute_, &second_, µsecond_, ((char*)(&plus_min_z)), &offset_hour, &offset_minute); - if (count < 4) { - count = sscanf(((char*)(s.str)), "%2d:%2d:%2d%c%2d:%2d", &hour_, &minute_, &second_, ((char*)(&plus_min_z)), &offset_hour, &offset_minute); - count++; - } - if (count < 4) { - return (Option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(10), .data={EMPTY_STRUCT_INITIALIZATION} }; + int count = 0; + count = sscanf(((char*)(s.str)), "%2d:%2d:%2d.%9d%c", &hour_, &minute_, &second_, &nanosecond_, ((char*)(&plus_min_z))); + if (count == 5 && plus_min_z == 'Z') { + int ndigits = 0; + _option_int _t1; + if (_t1 = string_index(s, _SLIT(".")), _t1.state == 0) { + int pos = *(int*)_t1.data; + pos++; + for (; pos < s.len && u8_is_digit(string_at(s, pos)); pos++) { + ndigits++; + } + } + for (;;) { + if (!(ndigits < 9)) break; + nanosecond_ *= 10; + ndigits++; + } + microsecond_ = nanosecond_ / 1000; + } else { + count = sscanf(((char*)(s.str)), "%2d:%2d:%2d.%6d%c%2d:%2d", &hour_, &minute_, &second_, µsecond_, ((char*)(&plus_min_z)), &offset_hour, &offset_minute); + if (count < 4) { + count = sscanf(((char*)(s.str)), "%2d:%2d:%2d%c%2d:%2d", &hour_, &minute_, &second_, ((char*)(&plus_min_z)), &offset_hour, &offset_minute); + count++; + } + if (count < 4) { + return (_option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(10), .data={EMPTY_STRUCT_INITIALIZATION} }; + } } bool is_local_time = plus_min_z == 'a' && count == 4; bool is_utc = plus_min_z == 'Z' && count == 5; if (!(count == 7 || is_local_time || is_utc)) { - return (Option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(11), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(11), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (plus_min_z != '+' && plus_min_z != '-' && !is_utc && !is_local_time) { - return (Option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(12), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_int_int_int_int_i64_bool){ .state=2, .err=time__error_invalid_time(12), .data={EMPTY_STRUCT_INITIALIZATION} }; } int unix_offset = 0; if (offset_hour > 0) { @@ -33536,9 +33598,9 @@ VV_LOCAL_SYMBOL Option_multi_return_int_int_int_int_i64_bool time__parse_iso8601 if (plus_min_z == '+') { unix_offset *= -1; } - Option_multi_return_int_int_int_int_i64_bool _t4; - opt_ok(&(multi_return_int_int_int_int_i64_bool/*X*/[]) { (multi_return_int_int_int_int_i64_bool){.arg0=hour_, .arg1=minute_, .arg2=second_, .arg3=microsecond_, .arg4=unix_offset, .arg5=is_local_time} }, (Option*)(&_t4), sizeof(multi_return_int_int_int_int_i64_bool)); - return _t4; + _option_multi_return_int_int_int_int_i64_bool _t5; + opt_ok2(&(multi_return_int_int_int_int_i64_bool/*X*/[]) { (multi_return_int_int_int_int_i64_bool){.arg0=hour_, .arg1=minute_, .arg2=second_, .arg3=microsecond_, .arg4=unix_offset, .arg5=is_local_time} }, (_option*)(&_t5), sizeof(multi_return_int_int_int_int_i64_bool)); + return _t5; } string time__TimeParseError_msg(time__TimeParseError err) { @@ -33875,14 +33937,14 @@ bool time__is_leap_year(int year) { return _t1; } -Option_int time__days_in_month(int month, 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: "), /*100 &int*/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; - Option_int _t2; - opt_ok(&(int[]) { res }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { res }, (_option*)(&_t2), sizeof(int)); return _t2; } @@ -34276,24 +34338,24 @@ VV_LOCAL_SYMBOL multi_return_int_int_int time__calculate_time_from_offset(i64 se return (multi_return_int_int_int){.arg0=((int)(hour_)), .arg1=((int)(min)), .arg2=((int)(second_offset))}; } -Option_v__vmod__Manifest v__vmod__from_file(string vmod_path) { +_option_v__vmod__Manifest v__vmod__from_file(string vmod_path) { if (!os__exists(vmod_path)) { - return (Option_v__vmod__Manifest){ .state=2, .err=_v_error(_SLIT("v.mod: v.mod file not found.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__vmod__Manifest){ .state=2, .err=_v_error(_SLIT("v.mod: v.mod file not found.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t2 = os__read_file(vmod_path); + _option_string _t2 = os__read_file(vmod_path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(string*) _t2.data = _SLIT(""); } string contents = (*(string*)_t2.data); - Option_v__vmod__Manifest _t3 = v__vmod__decode(contents); + _option_v__vmod__Manifest _t3 = v__vmod__decode(contents); return _t3; } -Option_v__vmod__Manifest v__vmod__decode(string contents) { +_option_v__vmod__Manifest v__vmod__decode(string contents) { v__vmod__Parser parser = ((v__vmod__Parser){.file_path = (string){.str=(byteptr)"", .is_lit=1},.scanner = ((v__vmod__Scanner){.pos = 0,.line = 1,.text = contents,.inside_text = 0,.tokens = __new_array(0, 0, sizeof(v__vmod__Token)),}),}); - Option_v__vmod__Manifest _t1 = v__vmod__Parser_parse(&parser); + _option_v__vmod__Manifest _t1 = v__vmod__Parser_parse(&parser); return _t1; } @@ -34406,11 +34468,11 @@ VV_LOCAL_SYMBOL void v__vmod__Scanner_scan_all(v__vmod__Scanner* s) { v__vmod__Scanner_tokenize(s, v__vmod__TokenKind__eof, _SLIT("eof")); } -VV_LOCAL_SYMBOL Option_multi_return_Array_string_int v__vmod__get_array_content(Array_v__vmod__Token tokens, int st_idx) { +VV_LOCAL_SYMBOL _option_multi_return_Array_string_int v__vmod__get_array_content(Array_v__vmod__Token tokens, int st_idx) { 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, /*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} }; + 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 (;;) { @@ -34419,7 +34481,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, /*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} }; + 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)); } @@ -34428,23 +34490,23 @@ 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, /*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} }; + 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; - opt_ok(&(multi_return_Array_string_int/*X*/[]) { (multi_return_Array_string_int){.arg0=vals, .arg1=idx} }, (Option*)(&_t5), sizeof(multi_return_Array_string_int)); + _option_multi_return_Array_string_int _t5; + opt_ok2(&(multi_return_Array_string_int/*X*/[]) { (multi_return_Array_string_int){.arg0=vals, .arg1=idx} }, (_option*)(&_t5), sizeof(multi_return_Array_string_int)); return _t5; } -VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* p) { +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, /*115 &string*/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, /*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} }; + 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 (;;) { @@ -34453,7 +34515,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, /*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} }; + 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; @@ -34464,7 +34526,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, /*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} }; + 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; @@ -34487,9 +34549,9 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* mn.author = field_value; } else if (string__eq(field_name, _SLIT("dependencies"))) { - Option_multi_return_Array_string_int _t5 = v__vmod__get_array_content(tokens, i + 1); + _option_multi_return_Array_string_int _t5 = v__vmod__get_array_content(tokens, i + 1); if (_t5.state != 0) { /*or block*/ - Option_v__vmod__Manifest _t6; + _option_v__vmod__Manifest _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } @@ -34503,9 +34565,9 @@ VV_LOCAL_SYMBOL Option_v__vmod__Manifest v__vmod__Parser_parse(v__vmod__Parser* } else { if ((*(v__vmod__Token*)/*ee elem_sym */array_get(tokens, i + 1)).typ == v__vmod__TokenKind__labr) { - Option_multi_return_Array_string_int _t7 = v__vmod__get_array_content(tokens, i + 1); + _option_multi_return_Array_string_int _t7 = v__vmod__get_array_content(tokens, i + 1); if (_t7.state != 0) { /*or block*/ - Option_v__vmod__Manifest _t8; + _option_v__vmod__Manifest _t8; memcpy(&_t8, &_t7, sizeof(Option)); return _t8; } @@ -34524,17 +34586,17 @@ 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, /*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} }; + 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, /*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} }; + 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; - opt_ok(&(v__vmod__Manifest[]) { mn }, (Option*)(&_t11), sizeof(v__vmod__Manifest)); + _option_v__vmod__Manifest _t11; + opt_ok2(&(v__vmod__Manifest[]) { mn }, (_option*)(&_t11), sizeof(v__vmod__Manifest)); return _t11; } @@ -34641,7 +34703,7 @@ VV_LOCAL_SYMBOL Array_string v__vmod__ModFileCacher_get_files(v__vmod__ModFileCa } Array_string files = __new_array_with_default(0, 0, sizeof(string), 0); if (os__exists(cfolder) && os__is_dir(cfolder)) { - Option_Array_string _t2; + _option_Array_string _t2; if (_t2 = os__ls(cfolder), _t2.state == 0) { Array_string listing = *(Array_string*)_t2.data; files = array_clone_to_depth(&listing, 0); @@ -34812,21 +34874,21 @@ multi_return_Array_string_Array_string_Array_string Array_v__cflag__CFlag_define return (multi_return_Array_string_Array_string_Array_string){.arg0=defines, .arg1=others, .arg2=libs}; } -VV_LOCAL_SYMBOL Option_string v__pkgconfig__desc(string mod) { +VV_LOCAL_SYMBOL _option_string v__pkgconfig__desc(string mod) { v__pkgconfig__Options options = ((v__pkgconfig__Options){.path = (string){.str=(byteptr)"", .is_lit=1},.debug = 0,.norecurse = 0,.only_description = true,.use_default_paths = true,}); - Option_v__pkgconfig__PkgConfig_ptr _t1 = v__pkgconfig__load(mod, options); + _option_v__pkgconfig__PkgConfig_ptr _t1 = v__pkgconfig__load(mod, options); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_string){ .state=2, .err=_v_error(_SLIT("cannot parse")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("cannot parse")), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__pkgconfig__PkgConfig* pc = (*(v__pkgconfig__PkgConfig**)_t1.data); - Option_string _t3; - opt_ok(&(string[]) { pc->description }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { pc->description }, (_option*)(&_t3), sizeof(string)); return _t3; } -Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { +_option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { flag__FlagParser* fp = flag__new_flag_parser(args); flag__FlagParser_application(fp, _SLIT("pkgconfig")); flag__FlagParser_version(fp, _const_v__pkgconfig__version); @@ -34842,7 +34904,7 @@ Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { if (opt->description) { for (int _t1 = 0; _t1 < modules.len; ++_t1) { string mod = ((string*)modules.data)[_t1]; - Option_string _t2 = v__pkgconfig__desc(mod); + _option_string _t2 = v__pkgconfig__desc(mod); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; continue; @@ -34856,25 +34918,25 @@ Option_v__pkgconfig__Main_ptr v__pkgconfig__main(Array_string args) { m->res = Array_string_join(modules, _SLIT("\n")); } } else if (opt->args.len == 0) { - return (Option_v__pkgconfig__Main_ptr){ .state=2, .err=_v_error(_SLIT("No packages given")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__pkgconfig__Main_ptr){ .state=2, .err=_v_error(_SLIT("No packages given")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__pkgconfig__Main_ptr _t4; - opt_ok(&(v__pkgconfig__Main*[]) { m }, (Option*)(&_t4), sizeof(v__pkgconfig__Main*)); + _option_v__pkgconfig__Main_ptr _t4; + opt_ok2(&(v__pkgconfig__Main*[]) { m }, (_option*)(&_t4), sizeof(v__pkgconfig__Main*)); return _t4; } -Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { +_option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { v__pkgconfig__Options options = ((v__pkgconfig__Options){.path = (string){.str=(byteptr)"", .is_lit=1},.debug = m->opt->debug,.norecurse = 0,.only_description = 0,.use_default_paths = true,}); v__pkgconfig__MainOptions* opt = m->opt; v__pkgconfig__PkgConfig* pc = ((v__pkgconfig__PkgConfig*)(0)); string res = m->res; for (int _t1 = 0; _t1 < opt->args.len; ++_t1) { string arg = ((string*)opt->args.data)[_t1]; - Option_v__pkgconfig__PkgConfig_ptr _t2 = v__pkgconfig__load(arg, options); + _option_v__pkgconfig__PkgConfig_ptr _t2 = v__pkgconfig__load(arg, options); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; if (!opt->exists) { - return (Option_string){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } continue; } @@ -34887,9 +34949,9 @@ Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { res = /*f*/string__plus(res, pcdep->description); } if (pc != 0) { - Option_string _t4 = v__pkgconfig__PkgConfig_extend(pc, pcdep); + _option_string _t4 = v__pkgconfig__PkgConfig_extend(pc, pcdep); if (_t4.state != 0) { /*or block*/ - Option_string _t5; + _option_string _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } @@ -34900,32 +34962,32 @@ Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { } } if (opt->exists) { - Option_string _t6; - opt_ok(&(string[]) { res }, (Option*)(&_t6), sizeof(string)); + _option_string _t6; + opt_ok2(&(string[]) { res }, (_option*)(&_t6), sizeof(string)); return _t6; } if ((opt->exactversion).len != 0) { if (!string__eq(pc->version, opt->exactversion)) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t8; - opt_ok(&(string[]) { res }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(string[]) { res }, (_option*)(&_t8), sizeof(string)); return _t8; } if ((opt->atleast).len != 0) { if (v__pkgconfig__PkgConfig_atleast(pc, opt->atleast)) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t10; - opt_ok(&(string[]) { res }, (Option*)(&_t10), sizeof(string)); + _option_string _t10; + opt_ok2(&(string[]) { res }, (_option*)(&_t10), sizeof(string)); return _t10; } if ((opt->atleastpc).len != 0) { if (v__pkgconfig__atleast(opt->atleastpc)) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("version mismatch")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t12; - opt_ok(&(string[]) { res }, (Option*)(&_t12), sizeof(string)); + _option_string _t12; + opt_ok2(&(string[]) { res }, (_option*)(&_t12), sizeof(string)); return _t12; } if (opt->variables) { @@ -34963,8 +35025,8 @@ Option_string v__pkgconfig__Main_run(v__pkgconfig__Main* m) { if (opt->modversion) { array_push((array*)&r, _MOV((string[]){ string_clone(pc->version) })); } - Option_string _t22; - opt_ok(&(string[]) { string__plus(res, Array_string_join(r, _SLIT(" "))) }, (Option*)(&_t22), sizeof(string)); + _option_string _t22; + opt_ok2(&(string[]) { string__plus(res, Array_string_join(r, _SLIT(" "))) }, (_option*)(&_t22), sizeof(string)); return _t22; } @@ -35044,14 +35106,14 @@ VV_LOCAL_SYMBOL string v__pkgconfig__PkgConfig_parse_line(v__pkgconfig__PkgConfi string r = string_trim_space(s); for (;;) { if (!(string_contains(r, _SLIT("${")))) break; - Option_int _t1 = string_index(r, _SLIT("${")); + _option_int _t1 = string_index(r, _SLIT("${")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; break; } int tok0 = (*(int*)_t1.data); - Option_int _t2 = string_index(string_substr(r, tok0, (r).len), _SLIT("}")); + _option_int _t2 = string_index(string_substr(r, tok0, (r).len), _SLIT("}")); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; break; @@ -35076,7 +35138,7 @@ VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_setvar(v__pkgconfig__PkgConfig* pc, } VV_LOCAL_SYMBOL bool v__pkgconfig__PkgConfig_parse(v__pkgconfig__PkgConfig* pc, string file) { - Option_string _t1 = os__read_file(file); + _option_string _t1 = os__read_file(file); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -35132,11 +35194,11 @@ VV_LOCAL_SYMBOL bool v__pkgconfig__PkgConfig_parse(v__pkgconfig__PkgConfig* pc, return _t5; } -VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgConfig* pc, string pkgname) { +VV_LOCAL_SYMBOL _option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgConfig* pc, string pkgname) { if (string_ends_with(pkgname, _SLIT(".pc"))) { if (os__exists(pkgname)) { - Option_string _t1; - opt_ok(&(string[]) { pkgname }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { pkgname }, (_option*)(&_t1), sizeof(string)); return _t1; } } else { @@ -35147,17 +35209,17 @@ VV_LOCAL_SYMBOL Option_string v__pkgconfig__PkgConfig_resolve(v__pkgconfig__PkgC string path = ((string*)pc->paths.data)[_t3]; 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)); + _option_string _t4; + opt_ok2(&(string[]) { file }, (_option*)(&_t4), sizeof(string)); return _t4; } } } - 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} }; + 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) { - Option_semver__Version _t1 = semver__from(_const_v__pkgconfig__version); + _option_semver__Version _t1 = semver__from(_const_v__pkgconfig__version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -35165,7 +35227,7 @@ bool v__pkgconfig__atleast(string v) { } semver__Version v0 = (*(semver__Version*)_t1.data); - Option_semver__Version _t3 = semver__from(v); + _option_semver__Version _t3 = semver__from(v); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; bool _t4 = false; @@ -35178,7 +35240,7 @@ bool v__pkgconfig__atleast(string v) { } bool v__pkgconfig__PkgConfig_atleast(v__pkgconfig__PkgConfig* pc, string v) { - Option_semver__Version _t1 = semver__from(pc->version); + _option_semver__Version _t1 = semver__from(pc->version); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -35186,7 +35248,7 @@ bool v__pkgconfig__PkgConfig_atleast(v__pkgconfig__PkgConfig* pc, string v) { } semver__Version v0 = (*(semver__Version*)_t1.data); - Option_semver__Version _t3 = semver__from(v); + _option_semver__Version _t3 = semver__from(v); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; bool _t4 = false; @@ -35198,7 +35260,7 @@ bool v__pkgconfig__PkgConfig_atleast(v__pkgconfig__PkgConfig* pc, string v) { return _t5; } -Option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkgconfig__PkgConfig* pcdep) { +_option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkgconfig__PkgConfig* pcdep) { for (int _t1 = 0; _t1 < pcdep->cflags.len; ++_t1) { string flag = ((string*)pcdep->cflags.data)[_t1]; if (Array_string_index(pc->cflags, flag) == -1) { @@ -35217,15 +35279,15 @@ Option_string v__pkgconfig__PkgConfig_extend(v__pkgconfig__PkgConfig* pc, v__pkg array_push((array*)&pc->libs_private, _MOV((string[]){ string_clone(lib) })); } } - return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__PkgConfig* pc) { +VV_LOCAL_SYMBOL _option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__PkgConfig* pc) { for (int _t1 = 0; _t1 < pc->requires.len; ++_t1) { string dep = ((string*)pc->requires.data)[_t1]; - Option_void _t2 = v__pkgconfig__PkgConfig_load_require(pc, dep); + _option_void _t2 = v__pkgconfig__PkgConfig_load_require(pc, dep); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { - Option_void _t3; + _option_void _t3; memcpy(&_t3, &_t2, sizeof(Option)); return _t3; } @@ -35234,50 +35296,50 @@ VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_requires(v__pkgconfig__ } for (int _t4 = 0; _t4 < pc->requires_private.len; ++_t4) { string dep = ((string*)pc->requires_private.data)[_t4]; - Option_void _t5 = v__pkgconfig__PkgConfig_load_require(pc, dep); + _option_void _t5 = v__pkgconfig__PkgConfig_load_require(pc, dep); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { - Option_void _t6; + _option_void _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } ; } - return (Option_void){0}; + return (_option_void){0}; } -VV_LOCAL_SYMBOL Option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__PkgConfig* pc, string dep) { +VV_LOCAL_SYMBOL _option_void v__pkgconfig__PkgConfig_load_require(v__pkgconfig__PkgConfig* pc, string dep) { v__pkgconfig__PkgConfig pcdep = ((v__pkgconfig__PkgConfig){.options = (v__pkgconfig__Options){.path = (string){.str=(byteptr)"", .is_lit=1},.debug = 0,.norecurse = 0,.only_description = 0,.use_default_paths = true,},.name = (string){.str=(byteptr)"", .is_lit=1},.modname = (string){.str=(byteptr)"", .is_lit=1},.url = (string){.str=(byteptr)"", .is_lit=1},.version = (string){.str=(byteptr)"", .is_lit=1},.description = (string){.str=(byteptr)"", .is_lit=1},.libs = __new_array(0, 0, sizeof(string)),.libs_private = __new_array(0, 0, sizeof(string)),.cflags = __new_array(0, 0, sizeof(string)),.paths = pc->paths,.vars = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.requires = __new_array(0, 0, sizeof(string)),.requires_private = __new_array(0, 0, sizeof(string)),.conflicts = __new_array(0, 0, sizeof(string)),}); - Option_string _t1 = v__pkgconfig__PkgConfig_resolve(&pcdep, dep); + _option_string _t1 = v__pkgconfig__PkgConfig_resolve(&pcdep, dep); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (pc->options.debug) { 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 "), /*115 &string*/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 \""), /*115 &string*/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); + _option_void _t4 = v__pkgconfig__PkgConfig_load_requires(&pcdep); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { - Option_void _t5; + _option_void _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } ; - Option_string _t6 = v__pkgconfig__PkgConfig_extend(pc, (voidptr)&/*qq*/pcdep); + _option_string _t6 = v__pkgconfig__PkgConfig_extend(pc, (voidptr)&/*qq*/pcdep); if (_t6.state != 0) { /*or block*/ - Option_void _t7; + _option_void _t7; memcpy(&_t7, &_t6, sizeof(Option)); return _t7; } (*(string*)_t6.data); - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_add_path(v__pkgconfig__PkgConfig* pc, string path) { @@ -35312,31 +35374,31 @@ VV_LOCAL_SYMBOL void v__pkgconfig__PkgConfig_load_paths(v__pkgconfig__PkgConfig* } } -Option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconfig__Options options) { +_option_v__pkgconfig__PkgConfig_ptr v__pkgconfig__load(string pkgname, v__pkgconfig__Options options) { v__pkgconfig__PkgConfig* pc = ((v__pkgconfig__PkgConfig*)memdup(&(v__pkgconfig__PkgConfig){.options = options,.name = (string){.str=(byteptr)"", .is_lit=1},.modname = pkgname,.url = (string){.str=(byteptr)"", .is_lit=1},.version = (string){.str=(byteptr)"", .is_lit=1},.description = (string){.str=(byteptr)"", .is_lit=1},.libs = __new_array(0, 0, sizeof(string)),.libs_private = __new_array(0, 0, sizeof(string)),.cflags = __new_array(0, 0, sizeof(string)),.paths = __new_array(0, 0, sizeof(string)),.vars = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),.requires = __new_array(0, 0, sizeof(string)),.requires_private = __new_array(0, 0, sizeof(string)),.conflicts = __new_array(0, 0, sizeof(string)),}, sizeof(v__pkgconfig__PkgConfig))); v__pkgconfig__PkgConfig_load_paths(pc); - Option_string _t1 = v__pkgconfig__PkgConfig_resolve(pc, pkgname); + _option_string _t1 = v__pkgconfig__PkgConfig_resolve(pc, pkgname); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_v__pkgconfig__PkgConfig_ptr){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__pkgconfig__PkgConfig_ptr){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } 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 \""), /*115 &string*/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); + _option_void _t4 = v__pkgconfig__PkgConfig_load_requires(pc); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { - Option_v__pkgconfig__PkgConfig_ptr _t5; + _option_v__pkgconfig__PkgConfig_ptr _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } ; } - Option_v__pkgconfig__PkgConfig_ptr _t6; - opt_ok(&(v__pkgconfig__PkgConfig*[]) { pc }, (Option*)(&_t6), sizeof(v__pkgconfig__PkgConfig*)); + _option_v__pkgconfig__PkgConfig_ptr _t6; + opt_ok2(&(v__pkgconfig__PkgConfig*[]) { pc }, (_option*)(&_t6), sizeof(v__pkgconfig__PkgConfig*)); return _t6; } @@ -35346,7 +35408,7 @@ Array_string v__pkgconfig__list(void) { Array_string modules = __new_array_with_default(0, 0, sizeof(string), 0); for (int _t1 = 0; _t1 < pc->paths.len; ++_t1) { string path = ((string*)pc->paths.data)[_t1]; - Option_Array_string _t2 = os__ls(path); + _option_Array_string _t2 = os__ls(path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; continue; @@ -35436,12 +35498,12 @@ int runtime__nr_cpus(void) { return _t1; } -Option_string v__util__diff__find_working_diff_command(void) { +_option_string v__util__diff__find_working_diff_command(void) { string env_difftool = os__getenv(_SLIT("VDIFF_TOOL")); 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, /*115 &string*/0xfe10, {.d_s = env_difftool}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(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); @@ -35453,8 +35515,8 @@ Option_string v__util__diff__find_working_diff_command(void) { string diffcmd = ((string*)known_diff_tools.data)[_t4]; if (string__eq(diffcmd, _SLIT("opendiff"))) { if (v__util__diff__opendiff_exists()) { - Option_string _t5; - opt_ok(&(string[]) { diffcmd }, (Option*)(&_t5), sizeof(string)); + _option_string _t5; + opt_ok2(&(string[]) { diffcmd }, (_option*)(&_t5), sizeof(string)); return _t5; } continue; @@ -35464,20 +35526,20 @@ Option_string v__util__diff__find_working_diff_command(void) { 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 "), /*115 &string*/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, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT(" -d"), 0, { .d_c = 0 }}})) }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(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, /*115 &string*/0xfe10, {.d_s = diffcmd}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = env_diffopts}}, {_SLIT0, 0, { .d_c = 0 }}})) }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(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; } } - return (Option_string){ .state=2, .err=_v_error(_SLIT("No working \"diff\" command found")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("No working \"diff\" command found")), .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL bool v__util__diff__opendiff_exists(void) { @@ -35513,7 +35575,7 @@ string v__util__diff__color_compare_files(string diff_cmd, string file1, string string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefix, string expected, string found) { string cdir = os__join_path_single(os__cache_dir(), unique_prefix); - Option_bool _t1 = os__mkdir(cdir); + _option_bool _t1 = os__mkdir(cdir); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; } @@ -35522,7 +35584,7 @@ string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefi u64 ctime = time__sys_mono_now(); 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); + _option_void _t2 = os__write_file(e_file, expected); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -35531,7 +35593,7 @@ string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefi } ; - Option_void _t3 = os__write_file(f_file, found); + _option_void _t3 = os__write_file(f_file, found); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; _v_panic(IError_str(err)); @@ -35541,7 +35603,7 @@ string v__util__diff__color_compare_strings(string diff_cmd, string unique_prefi ; string res = v__util__diff__color_compare_files(diff_cmd, e_file, f_file); - Option_void _t4 = os__rmdir_all(cdir); + _option_void _t4 = os__rmdir_all(cdir); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; } @@ -35765,7 +35827,7 @@ VV_LOCAL_SYMBOL string rand__internal_string_from_set(rand__PRNG* rng, string ch u8* buf = malloc_noscan(len + 1); for (int i = 0; i < len; ++i) { { // Unsafe block - Option_int _t2 = rand__intn(charset.len); + _option_int _t2 = rand__intn(charset.len); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(int*) _t2.data = 0; @@ -35836,14 +35898,14 @@ VV_LOCAL_SYMBOL void rand__read_internal(rand__PRNG* rng, Array_u8* buf) { } // Attr: [inline] -inline Option_Array_u8 rand__PRNG_bytes(rand__PRNG* rng, int bytes_needed) { +inline _option_Array_u8 rand__PRNG_bytes(rand__PRNG* rng, int bytes_needed) { if (bytes_needed < 0) { - return (Option_Array_u8){ .state=2, .err=_v_error(_SLIT("can not read < 0 random bytes")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_Array_u8){ .state=2, .err=_v_error(_SLIT("can not read < 0 random bytes")), .data={EMPTY_STRUCT_INITIALIZATION} }; } Array_u8 buffer = __new_array_with_default(bytes_needed, 0, sizeof(u8), 0); rand__read_internal(rng, &/*arr*/buffer); - Option_Array_u8 _t2; - opt_ok(&(Array_u8[]) { buffer }, (Option*)(&_t2), sizeof(Array_u8)); + _option_Array_u8 _t2; + opt_ok2(&(Array_u8[]) { buffer }, (_option*)(&_t2), sizeof(Array_u8)); return _t2; } @@ -35852,17 +35914,17 @@ void rand__PRNG_read(rand__PRNG* rng, Array_u8* buf) { } // Attr: [inline] -inline Option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max) { +inline _option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max) { if (max == 0U) { - return (Option_u32){ .state=2, .err=_v_error(_SLIT("max must be positive integer")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u32){ .state=2, .err=_v_error(_SLIT("max must be positive integer")), .data={EMPTY_STRUCT_INITIALIZATION} }; } int bit_len = math__bits__len_32(max); if (bit_len == 32) { for (;;) { u32 value = rand__PRNG_name_table[rng->_typ]._method_u32(rng->_object); if (value < max) { - Option_u32 _t2; - opt_ok(&(u32[]) { value }, (Option*)(&_t2), sizeof(u32)); + _option_u32 _t2; + opt_ok2(&(u32[]) { value }, (_option*)(&_t2), sizeof(u32)); return _t2; } } @@ -35871,29 +35933,29 @@ inline Option_u32 rand__PRNG_u32n(rand__PRNG* rng, u32 max) { for (;;) { u32 value = (rand__PRNG_name_table[rng->_typ]._method_u32(rng->_object) & mask); if (value < max) { - Option_u32 _t3; - opt_ok(&(u32[]) { value }, (Option*)(&_t3), sizeof(u32)); + _option_u32 _t3; + opt_ok2(&(u32[]) { value }, (_option*)(&_t3), sizeof(u32)); return _t3; } } } - Option_u32 _t4; - opt_ok(&(u32[]) { ((u32)(0U)) }, (Option*)(&_t4), sizeof(u32)); + _option_u32 _t4; + opt_ok2(&(u32[]) { ((u32)(0U)) }, (_option*)(&_t4), sizeof(u32)); return _t4; } // Attr: [inline] -inline Option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max) { +inline _option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max) { if (max == 0U) { - return (Option_u64){ .state=2, .err=_v_error(_SLIT("max must be positive integer")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u64){ .state=2, .err=_v_error(_SLIT("max must be positive integer")), .data={EMPTY_STRUCT_INITIALIZATION} }; } int bit_len = math__bits__len_64(max); if (bit_len == 64) { for (;;) { u64 value = rand__PRNG_name_table[rng->_typ]._method_u64(rng->_object); if (value < max) { - Option_u64 _t2; - opt_ok(&(u64[]) { value }, (Option*)(&_t2), sizeof(u64)); + _option_u64 _t2; + opt_ok2(&(u64[]) { value }, (_option*)(&_t2), sizeof(u64)); return _t2; } } @@ -35902,48 +35964,48 @@ inline Option_u64 rand__PRNG_u64n(rand__PRNG* rng, u64 max) { for (;;) { u64 value = (rand__PRNG_name_table[rng->_typ]._method_u64(rng->_object) & mask); if (value < max) { - Option_u64 _t3; - opt_ok(&(u64[]) { value }, (Option*)(&_t3), sizeof(u64)); + _option_u64 _t3; + opt_ok2(&(u64[]) { value }, (_option*)(&_t3), sizeof(u64)); return _t3; } } } - Option_u64 _t4; - opt_ok(&(u64[]) { ((u64)(0U)) }, (Option*)(&_t4), sizeof(u64)); + _option_u64 _t4; + opt_ok2(&(u64[]) { ((u64)(0U)) }, (_option*)(&_t4), sizeof(u64)); return _t4; } // Attr: [inline] -inline Option_u32 rand__PRNG_u32_in_range(rand__PRNG* rng, u32 min, u32 max) { +inline _option_u32 rand__PRNG_u32_in_range(rand__PRNG* rng, u32 min, u32 max) { if (max <= min) { - return (Option_u32){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u32){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_u32 _t3 = rand__PRNG_u32n(rng, max - min); + _option_u32 _t3 = rand__PRNG_u32n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_u32 _t4; + _option_u32 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_u32 _t2; - opt_ok(&(u32[]) { min + (*(u32*)_t3.data) }, (Option*)(&_t2), sizeof(u32)); + _option_u32 _t2; + opt_ok2(&(u32[]) { min + (*(u32*)_t3.data) }, (_option*)(&_t2), sizeof(u32)); return _t2; } // Attr: [inline] -inline Option_u64 rand__PRNG_u64_in_range(rand__PRNG* rng, u64 min, u64 max) { +inline _option_u64 rand__PRNG_u64_in_range(rand__PRNG* rng, u64 min, u64 max) { if (max <= min) { - return (Option_u64){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u64){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_u64 _t3 = rand__PRNG_u64n(rng, max - min); + _option_u64 _t3 = rand__PRNG_u64n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_u64 _t4; + _option_u64 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_u64 _t2; - opt_ok(&(u64[]) { min + (*(u64*)_t3.data) }, (Option*)(&_t2), sizeof(u64)); + _option_u64 _t2; + opt_ok2(&(u64[]) { min + (*(u64*)_t3.data) }, (_option*)(&_t2), sizeof(u64)); return _t2; } @@ -35984,70 +36046,70 @@ inline i64 rand__PRNG_int63(rand__PRNG* rng) { } // Attr: [inline] -inline Option_int rand__PRNG_intn(rand__PRNG* rng, int max) { +inline _option_int rand__PRNG_intn(rand__PRNG* rng, int max) { if (max <= 0) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("max has to be positive.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("max has to be positive.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_u32 _t3 = rand__PRNG_u32n(rng, ((u32)(max))); + _option_u32 _t3 = rand__PRNG_u32n(rng, ((u32)(max))); if (_t3.state != 0) { /*or block*/ - Option_int _t4; + _option_int _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_int _t2; - opt_ok(&(int[]) { ((int)( (*(u32*)_t3.data))) }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { ((int)( (*(u32*)_t3.data))) }, (_option*)(&_t2), sizeof(int)); return _t2; } // Attr: [inline] -inline Option_i64 rand__PRNG_i64n(rand__PRNG* rng, i64 max) { +inline _option_i64 rand__PRNG_i64n(rand__PRNG* rng, i64 max) { if (max <= 0) { - return (Option_i64){ .state=2, .err=_v_error(_SLIT("max has to be positive.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=_v_error(_SLIT("max has to be positive.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_u64 _t3 = rand__PRNG_u64n(rng, ((u64)(max))); + _option_u64 _t3 = rand__PRNG_u64n(rng, ((u64)(max))); if (_t3.state != 0) { /*or block*/ - Option_i64 _t4; + _option_i64 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_i64 _t2; - opt_ok(&(i64[]) { ((i64)( (*(u64*)_t3.data))) }, (Option*)(&_t2), sizeof(i64)); + _option_i64 _t2; + opt_ok2(&(i64[]) { ((i64)( (*(u64*)_t3.data))) }, (_option*)(&_t2), sizeof(i64)); return _t2; } // Attr: [inline] -inline Option_int rand__PRNG_int_in_range(rand__PRNG* rng, int min, int max) { +inline _option_int rand__PRNG_int_in_range(rand__PRNG* rng, int min, int max) { if (max <= min) { - return (Option_int){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_int _t3 = rand__PRNG_intn(rng, max - min); + _option_int _t3 = rand__PRNG_intn(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_int _t4; + _option_int _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_int _t2; - opt_ok(&(int[]) { min + (*(int*)_t3.data) }, (Option*)(&_t2), sizeof(int)); + _option_int _t2; + opt_ok2(&(int[]) { min + (*(int*)_t3.data) }, (_option*)(&_t2), sizeof(int)); return _t2; } // Attr: [inline] -inline Option_i64 rand__PRNG_i64_in_range(rand__PRNG* rng, i64 min, i64 max) { +inline _option_i64 rand__PRNG_i64_in_range(rand__PRNG* rng, i64 min, i64 max) { if (max <= min) { - return (Option_i64){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=_v_error(_SLIT("max must be greater than min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_i64 _t3 = rand__PRNG_i64n(rng, max - min); + _option_i64 _t3 = rand__PRNG_i64n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_i64 _t4; + _option_i64 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_i64 _t2; - opt_ok(&(i64[]) { min + (*(i64*)_t3.data) }, (Option*)(&_t2), sizeof(i64)); + _option_i64 _t2; + opt_ok2(&(i64[]) { min + (*(i64*)_t3.data) }, (_option*)(&_t2), sizeof(i64)); return _t2; } @@ -36064,56 +36126,56 @@ inline f64 rand__PRNG_f64(rand__PRNG* rng) { } // Attr: [inline] -inline Option_f32 rand__PRNG_f32n(rand__PRNG* rng, f32 max) { +inline _option_f32 rand__PRNG_f32n(rand__PRNG* rng, f32 max) { if (max < 0) { - return (Option_f32){ .state=2, .err=_v_error(_SLIT("max has to be non-negative.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f32){ .state=2, .err=_v_error(_SLIT("max has to be non-negative.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_f32 _t2; - opt_ok(&(f32[]) { rand__PRNG_f32(rng) * max }, (Option*)(&_t2), sizeof(f32)); + _option_f32 _t2; + opt_ok2(&(f32[]) { rand__PRNG_f32(rng) * max }, (_option*)(&_t2), sizeof(f32)); return _t2; } // Attr: [inline] -inline Option_f64 rand__PRNG_f64n(rand__PRNG* rng, f64 max) { +inline _option_f64 rand__PRNG_f64n(rand__PRNG* rng, f64 max) { if (max < 0) { - return (Option_f64){ .state=2, .err=_v_error(_SLIT("max has to be non-negative.")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_v_error(_SLIT("max has to be non-negative.")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_f64 _t2; - opt_ok(&(f64[]) { rand__PRNG_f64(rng) * max }, (Option*)(&_t2), sizeof(f64)); + _option_f64 _t2; + opt_ok2(&(f64[]) { rand__PRNG_f64(rng) * max }, (_option*)(&_t2), sizeof(f64)); return _t2; } // Attr: [inline] -inline Option_f32 rand__PRNG_f32_in_range(rand__PRNG* rng, f32 min, f32 max) { +inline _option_f32 rand__PRNG_f32_in_range(rand__PRNG* rng, f32 min, f32 max) { if (max < min) { - return (Option_f32){ .state=2, .err=_v_error(_SLIT("max must be greater than or equal to min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f32){ .state=2, .err=_v_error(_SLIT("max must be greater than or equal to min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_f32 _t3 = rand__PRNG_f32n(rng, max - min); + _option_f32 _t3 = rand__PRNG_f32n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_f32 _t4; + _option_f32 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_f32 _t2; - opt_ok(&(f32[]) { min + (*(f32*)_t3.data) }, (Option*)(&_t2), sizeof(f32)); + _option_f32 _t2; + opt_ok2(&(f32[]) { min + (*(f32*)_t3.data) }, (_option*)(&_t2), sizeof(f32)); return _t2; } // Attr: [inline] -inline Option_f64 rand__PRNG_f64_in_range(rand__PRNG* rng, f64 min, f64 max) { +inline _option_f64 rand__PRNG_f64_in_range(rand__PRNG* rng, f64 min, f64 max) { if (max < min) { - return (Option_f64){ .state=2, .err=_v_error(_SLIT("max must be greater than or equal to min")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_v_error(_SLIT("max must be greater than or equal to min")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_f64 _t3 = rand__PRNG_f64n(rng, max - min); + _option_f64 _t3 = rand__PRNG_f64n(rng, max - min); if (_t3.state != 0) { /*or block*/ - Option_f64 _t4; + _option_f64 _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } - Option_f64 _t2; - opt_ok(&(f64[]) { min + (*(f64*)_t3.data) }, (Option*)(&_t2), sizeof(f64)); + _option_f64 _t2; + opt_ok2(&(f64[]) { min + (*(f64*)_t3.data) }, (_option*)(&_t2), sizeof(f64)); return _t2; } @@ -36179,23 +36241,23 @@ u64 rand__u64(void) { return _t1; } -Option_u32 rand__u32n(u32 max) { - Option_u32 _t1 = rand__PRNG_u32n(default_rng, max); +_option_u32 rand__u32n(u32 max) { + _option_u32 _t1 = rand__PRNG_u32n(default_rng, max); return _t1; } -Option_u64 rand__u64n(u64 max) { - Option_u64 _t1 = rand__PRNG_u64n(default_rng, max); +_option_u64 rand__u64n(u64 max) { + _option_u64 _t1 = rand__PRNG_u64n(default_rng, max); return _t1; } -Option_u32 rand__u32_in_range(u32 min, u32 max) { - Option_u32 _t1 = rand__PRNG_u32_in_range(default_rng, min, max); +_option_u32 rand__u32_in_range(u32 min, u32 max) { + _option_u32 _t1 = rand__PRNG_u32_in_range(default_rng, min, max); return _t1; } -Option_u64 rand__u64_in_range(u64 min, u64 max) { - Option_u64 _t1 = rand__PRNG_u64_in_range(default_rng, min, max); +_option_u64 rand__u64_in_range(u64 min, u64 max) { + _option_u64 _t1 = rand__PRNG_u64_in_range(default_rng, min, max); return _t1; } @@ -36209,8 +36271,8 @@ int rand__int(void) { return _t1; } -Option_int rand__intn(int max) { - Option_int _t1 = rand__PRNG_intn(default_rng, max); +_option_int rand__intn(int max) { + _option_int _t1 = rand__PRNG_intn(default_rng, max); return _t1; } @@ -36219,8 +36281,8 @@ u8 rand__u8(void) { return _t1; } -Option_int rand__int_in_range(int min, int max) { - Option_int _t1 = rand__PRNG_int_in_range(default_rng, min, max); +_option_int rand__int_in_range(int min, int max) { + _option_int _t1 = rand__PRNG_int_in_range(default_rng, min, max); return _t1; } @@ -36234,13 +36296,13 @@ i64 rand__i64(void) { return _t1; } -Option_i64 rand__i64n(i64 max) { - Option_i64 _t1 = rand__PRNG_i64n(default_rng, max); +_option_i64 rand__i64n(i64 max) { + _option_i64 _t1 = rand__PRNG_i64n(default_rng, max); return _t1; } -Option_i64 rand__i64_in_range(i64 min, i64 max) { - Option_i64 _t1 = rand__PRNG_i64_in_range(default_rng, min, max); +_option_i64 rand__i64_in_range(i64 min, i64 max) { + _option_i64 _t1 = rand__PRNG_i64_in_range(default_rng, min, max); return _t1; } @@ -36259,28 +36321,28 @@ f64 rand__f64(void) { return _t1; } -Option_f32 rand__f32n(f32 max) { - Option_f32 _t1 = rand__PRNG_f32n(default_rng, max); +_option_f32 rand__f32n(f32 max) { + _option_f32 _t1 = rand__PRNG_f32n(default_rng, max); return _t1; } -Option_f64 rand__f64n(f64 max) { - Option_f64 _t1 = rand__PRNG_f64n(default_rng, max); +_option_f64 rand__f64n(f64 max) { + _option_f64 _t1 = rand__PRNG_f64n(default_rng, max); return _t1; } -Option_f32 rand__f32_in_range(f32 min, f32 max) { - Option_f32 _t1 = rand__PRNG_f32_in_range(default_rng, min, max); +_option_f32 rand__f32_in_range(f32 min, f32 max) { + _option_f32 _t1 = rand__PRNG_f32_in_range(default_rng, min, max); return _t1; } -Option_f64 rand__f64_in_range(f64 min, f64 max) { - Option_f64 _t1 = rand__PRNG_f64_in_range(default_rng, min, max); +_option_f64 rand__f64_in_range(f64 min, f64 max) { + _option_f64 _t1 = rand__PRNG_f64_in_range(default_rng, min, max); return _t1; } -Option_Array_u8 rand__bytes(int bytes_needed) { - Option_Array_u8 _t1 = rand__PRNG_bytes(default_rng, bytes_needed); +_option_Array_u8 rand__bytes(int bytes_needed) { + _option_Array_u8 _t1 = rand__PRNG_bytes(default_rng, bytes_needed); return _t1; } @@ -36387,7 +36449,7 @@ void v__pref__Preferences_fill_with_defaults(v__pref__Preferences* p) { if ((p->third_party_option).len == 0) { p->third_party_option = p->cflags; } - string vhash = _SLIT("c405c1916"); + string vhash = _SLIT("3afb88c4e"); 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; @@ -36505,137 +36567,137 @@ string v__pref__Preferences_vcross_compiler_name(v__pref__Preferences* p) { return _t5; } -Option_v__pref__OS v__pref__os_from_string(string os_str) { +_option_v__pref__OS v__pref__os_from_string(string os_str) { if (string__eq(os_str, _SLIT("linux"))) { - Option_v__pref__OS _t1; - opt_ok(&(v__pref__OS[]) { v__pref__OS__linux }, (Option*)(&_t1), sizeof(v__pref__OS)); + _option_v__pref__OS _t1; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__linux }, (_option*)(&_t1), sizeof(v__pref__OS)); return _t1; } else if (string__eq(os_str, _SLIT("windows"))) { - Option_v__pref__OS _t2; - opt_ok(&(v__pref__OS[]) { v__pref__OS__windows }, (Option*)(&_t2), sizeof(v__pref__OS)); + _option_v__pref__OS _t2; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__windows }, (_option*)(&_t2), sizeof(v__pref__OS)); return _t2; } else if (string__eq(os_str, _SLIT("ios"))) { - Option_v__pref__OS _t3; - opt_ok(&(v__pref__OS[]) { v__pref__OS__ios }, (Option*)(&_t3), sizeof(v__pref__OS)); + _option_v__pref__OS _t3; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__ios }, (_option*)(&_t3), sizeof(v__pref__OS)); return _t3; } else if (string__eq(os_str, _SLIT("macos"))) { - Option_v__pref__OS _t4; - opt_ok(&(v__pref__OS[]) { v__pref__OS__macos }, (Option*)(&_t4), sizeof(v__pref__OS)); + _option_v__pref__OS _t4; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__macos }, (_option*)(&_t4), sizeof(v__pref__OS)); return _t4; } else if (string__eq(os_str, _SLIT("darwin"))) { - Option_v__pref__OS _t5; - opt_ok(&(v__pref__OS[]) { v__pref__OS__macos }, (Option*)(&_t5), sizeof(v__pref__OS)); + _option_v__pref__OS _t5; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__macos }, (_option*)(&_t5), sizeof(v__pref__OS)); return _t5; } else if (string__eq(os_str, _SLIT("freebsd"))) { - Option_v__pref__OS _t6; - opt_ok(&(v__pref__OS[]) { v__pref__OS__freebsd }, (Option*)(&_t6), sizeof(v__pref__OS)); + _option_v__pref__OS _t6; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__freebsd }, (_option*)(&_t6), sizeof(v__pref__OS)); return _t6; } else if (string__eq(os_str, _SLIT("openbsd"))) { - Option_v__pref__OS _t7; - opt_ok(&(v__pref__OS[]) { v__pref__OS__openbsd }, (Option*)(&_t7), sizeof(v__pref__OS)); + _option_v__pref__OS _t7; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__openbsd }, (_option*)(&_t7), sizeof(v__pref__OS)); return _t7; } else if (string__eq(os_str, _SLIT("netbsd"))) { - Option_v__pref__OS _t8; - opt_ok(&(v__pref__OS[]) { v__pref__OS__netbsd }, (Option*)(&_t8), sizeof(v__pref__OS)); + _option_v__pref__OS _t8; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__netbsd }, (_option*)(&_t8), sizeof(v__pref__OS)); return _t8; } else if (string__eq(os_str, _SLIT("dragonfly"))) { - Option_v__pref__OS _t9; - opt_ok(&(v__pref__OS[]) { v__pref__OS__dragonfly }, (Option*)(&_t9), sizeof(v__pref__OS)); + _option_v__pref__OS _t9; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__dragonfly }, (_option*)(&_t9), sizeof(v__pref__OS)); return _t9; } else if (string__eq(os_str, _SLIT("js")) || string__eq(os_str, _SLIT("js_node"))) { - Option_v__pref__OS _t10; - opt_ok(&(v__pref__OS[]) { v__pref__OS__js_node }, (Option*)(&_t10), sizeof(v__pref__OS)); + _option_v__pref__OS _t10; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__js_node }, (_option*)(&_t10), sizeof(v__pref__OS)); return _t10; } else if (string__eq(os_str, _SLIT("js_freestanding"))) { - Option_v__pref__OS _t11; - opt_ok(&(v__pref__OS[]) { v__pref__OS__js_freestanding }, (Option*)(&_t11), sizeof(v__pref__OS)); + _option_v__pref__OS _t11; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__js_freestanding }, (_option*)(&_t11), sizeof(v__pref__OS)); return _t11; } else if (string__eq(os_str, _SLIT("js_browser"))) { - Option_v__pref__OS _t12; - opt_ok(&(v__pref__OS[]) { v__pref__OS__js_browser }, (Option*)(&_t12), sizeof(v__pref__OS)); + _option_v__pref__OS _t12; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__js_browser }, (_option*)(&_t12), sizeof(v__pref__OS)); return _t12; } else if (string__eq(os_str, _SLIT("solaris"))) { - Option_v__pref__OS _t13; - opt_ok(&(v__pref__OS[]) { v__pref__OS__solaris }, (Option*)(&_t13), sizeof(v__pref__OS)); + _option_v__pref__OS _t13; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__solaris }, (_option*)(&_t13), sizeof(v__pref__OS)); return _t13; } else if (string__eq(os_str, _SLIT("serenity"))) { - Option_v__pref__OS _t14; - opt_ok(&(v__pref__OS[]) { v__pref__OS__serenity }, (Option*)(&_t14), sizeof(v__pref__OS)); + _option_v__pref__OS _t14; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__serenity }, (_option*)(&_t14), sizeof(v__pref__OS)); return _t14; } else if (string__eq(os_str, _SLIT("vinix"))) { - Option_v__pref__OS _t15; - opt_ok(&(v__pref__OS[]) { v__pref__OS__vinix }, (Option*)(&_t15), sizeof(v__pref__OS)); + _option_v__pref__OS _t15; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__vinix }, (_option*)(&_t15), sizeof(v__pref__OS)); return _t15; } else if (string__eq(os_str, _SLIT("android"))) { - Option_v__pref__OS _t16; - opt_ok(&(v__pref__OS[]) { v__pref__OS__android }, (Option*)(&_t16), sizeof(v__pref__OS)); + _option_v__pref__OS _t16; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__android }, (_option*)(&_t16), sizeof(v__pref__OS)); return _t16; } else if (string__eq(os_str, _SLIT("haiku"))) { - Option_v__pref__OS _t17; - opt_ok(&(v__pref__OS[]) { v__pref__OS__haiku }, (Option*)(&_t17), sizeof(v__pref__OS)); + _option_v__pref__OS _t17; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__haiku }, (_option*)(&_t17), sizeof(v__pref__OS)); return _t17; } else if (string__eq(os_str, _SLIT("raw"))) { - Option_v__pref__OS _t18; - opt_ok(&(v__pref__OS[]) { v__pref__OS__raw }, (Option*)(&_t18), sizeof(v__pref__OS)); + _option_v__pref__OS _t18; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__raw }, (_option*)(&_t18), sizeof(v__pref__OS)); return _t18; } else if (string__eq(os_str, _SLIT("nix"))) { - Option_v__pref__OS _t19; - opt_ok(&(v__pref__OS[]) { v__pref__OS__linux }, (Option*)(&_t19), sizeof(v__pref__OS)); + _option_v__pref__OS _t19; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__linux }, (_option*)(&_t19), sizeof(v__pref__OS)); return _t19; } else if (string__eq(os_str, _SLIT("wasm32"))) { - Option_v__pref__OS _t20; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32 }, (Option*)(&_t20), sizeof(v__pref__OS)); + _option_v__pref__OS _t20; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32 }, (_option*)(&_t20), sizeof(v__pref__OS)); return _t20; } else if (string__eq(os_str, _SLIT("wasm32-wasi"))) { - Option_v__pref__OS _t21; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32_wasi }, (Option*)(&_t21), sizeof(v__pref__OS)); + _option_v__pref__OS _t21; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32_wasi }, (_option*)(&_t21), sizeof(v__pref__OS)); return _t21; } else if (string__eq(os_str, _SLIT("wasm32-emscripten"))) { - Option_v__pref__OS _t22; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32_emscripten }, (Option*)(&_t22), sizeof(v__pref__OS)); + _option_v__pref__OS _t22; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32_emscripten }, (_option*)(&_t22), sizeof(v__pref__OS)); return _t22; } else if (string__eq(os_str, _SLIT("wasm32_wasi"))) { - Option_v__pref__OS _t23; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32_wasi }, (Option*)(&_t23), sizeof(v__pref__OS)); + _option_v__pref__OS _t23; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32_wasi }, (_option*)(&_t23), sizeof(v__pref__OS)); return _t23; } else if (string__eq(os_str, _SLIT("wasm32_emscripten"))) { - Option_v__pref__OS _t24; - opt_ok(&(v__pref__OS[]) { v__pref__OS__wasm32_emscripten }, (Option*)(&_t24), sizeof(v__pref__OS)); + _option_v__pref__OS _t24; + opt_ok2(&(v__pref__OS[]) { v__pref__OS__wasm32_emscripten }, (_option*)(&_t24), sizeof(v__pref__OS)); return _t24; } else if (string__eq(os_str, _SLIT(""))) { - Option_v__pref__OS _t25; - opt_ok(&(v__pref__OS[]) { v__pref__OS___auto }, (Option*)(&_t25), sizeof(v__pref__OS)); + _option_v__pref__OS _t25; + opt_ok2(&(v__pref__OS[]) { v__pref__OS___auto }, (_option*)(&_t25), sizeof(v__pref__OS)); return _t25; } else { - 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){ .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}; + return (_option_v__pref__OS){0}; } string v__pref__OS_str(v__pref__OS o) { @@ -36837,7 +36899,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors else if (string__eq(arg, _SLIT("-arch"))) { string target_arch = os__cmdline__option(current_args, _SLIT("-arch"), _SLIT("")); i++; - Option_v__pref__Arch _t3 = v__pref__arch_from_string(target_arch); + _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 `"), /*115 &string*/0xfe10, {.d_s = target_arch}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); @@ -37163,7 +37225,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors else if (string__eq(arg, _SLIT("-os"))) { string target_os = os__cmdline__option(current_args, _SLIT("-os"), _SLIT("")); i++; - Option_v__pref__OS _t22 = v__pref__os_from_string(target_os); + _option_v__pref__OS _t22 = v__pref__os_from_string(target_os); if (_t22.state != 0) { /*or block*/ IError err = _t22.err; if (string__eq(target_os, _SLIT("cross"))) { @@ -37236,7 +37298,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, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = sbackend}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - Option_v__pref__Backend _t28 = v__pref__backend_from_string(sbackend); + _option_v__pref__Backend _t28 = v__pref__backend_from_string(sbackend); if (_t28.state != 0) { /*or block*/ IError err = _t28.err; continue; @@ -37267,7 +37329,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors 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, /*115 &string*/0xfe10, {.d_s = arg}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = path}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); - Option_string _t32 = os__read_file(path); + _option_string _t32 = os__read_file(path); if (_t32.state != 0) { /*or block*/ IError err = _t32.err; 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 }}}))); @@ -37351,7 +37413,7 @@ multi_return_ref_v__pref__Preferences_string v__pref__parse_args_and_show_errors } 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 _t34 = os__write_file(tmp_v_file_path, contents); + _option_void _t34 = os__write_file(tmp_v_file_path, contents); if (_t34.state != 0 && _t34.err._typ != _IError_None___index) { IError err = _t34.err; _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 }}}))); @@ -37370,7 +37432,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("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: "), /*115 &string*/0xfe10, {.d_s = tmp_exe_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); - Option_void _t36 = os__rm(tmp_exe_file_path); + _option_void _t36 = os__rm(tmp_exe_file_path); if (_t36.state != 0 && _t36.err._typ != _IError_None___index) { IError err = _t36.err; } @@ -37378,7 +37440,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: "), /*115 &string*/0xfe10, {.d_s = tmp_v_file_path}}, {_SLIT0, 0, { .d_c = 0 }}}))); - Option_void _t37 = os__rm(tmp_v_file_path); + _option_void _t37 = os__rm(tmp_v_file_path); if (_t37.state != 0 && _t37.err._typ != _IError_None___index) { IError err = _t37.err; } @@ -37456,62 +37518,62 @@ bool v__pref__Preferences_should_output_to_stdout(v__pref__Preferences* pref) { return _t1; } -Option_v__pref__Arch v__pref__arch_from_string(string arch_str) { +_option_v__pref__Arch v__pref__arch_from_string(string arch_str) { if (string__eq(arch_str, _SLIT("amd64")) || string__eq(arch_str, _SLIT("x86_64")) || string__eq(arch_str, _SLIT("x64")) || string__eq(arch_str, _SLIT("x86"))) { - Option_v__pref__Arch _t1; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__amd64 }, (Option*)(&_t1), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t1; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__amd64 }, (_option*)(&_t1), sizeof(v__pref__Arch)); return _t1; } else if (string__eq(arch_str, _SLIT("aarch64")) || string__eq(arch_str, _SLIT("arm64"))) { - Option_v__pref__Arch _t2; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__arm64 }, (Option*)(&_t2), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t2; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__arm64 }, (_option*)(&_t2), sizeof(v__pref__Arch)); return _t2; } else if (string__eq(arch_str, _SLIT("aarch32")) || string__eq(arch_str, _SLIT("arm32")) || string__eq(arch_str, _SLIT("arm"))) { - Option_v__pref__Arch _t3; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__arm32 }, (Option*)(&_t3), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t3; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__arm32 }, (_option*)(&_t3), sizeof(v__pref__Arch)); return _t3; } else if (string__eq(arch_str, _SLIT("rv64")) || string__eq(arch_str, _SLIT("riscv64")) || string__eq(arch_str, _SLIT("risc-v64")) || string__eq(arch_str, _SLIT("riscv")) || string__eq(arch_str, _SLIT("risc-v"))) { - Option_v__pref__Arch _t4; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__rv64 }, (Option*)(&_t4), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t4; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__rv64 }, (_option*)(&_t4), sizeof(v__pref__Arch)); return _t4; } else if (string__eq(arch_str, _SLIT("rv32")) || string__eq(arch_str, _SLIT("riscv32"))) { - Option_v__pref__Arch _t5; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__rv32 }, (Option*)(&_t5), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t5; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__rv32 }, (_option*)(&_t5), sizeof(v__pref__Arch)); return _t5; } else if (string__eq(arch_str, _SLIT("x86_32")) || string__eq(arch_str, _SLIT("x32")) || string__eq(arch_str, _SLIT("i386")) || string__eq(arch_str, _SLIT("IA-32")) || string__eq(arch_str, _SLIT("ia-32")) || string__eq(arch_str, _SLIT("ia32"))) { - Option_v__pref__Arch _t6; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__i386 }, (Option*)(&_t6), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t6; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__i386 }, (_option*)(&_t6), sizeof(v__pref__Arch)); return _t6; } else if (string__eq(arch_str, _SLIT("js")) || string__eq(arch_str, _SLIT("js_node"))) { - Option_v__pref__Arch _t7; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__js_node }, (Option*)(&_t7), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t7; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__js_node }, (_option*)(&_t7), sizeof(v__pref__Arch)); return _t7; } else if (string__eq(arch_str, _SLIT("js_browser"))) { - Option_v__pref__Arch _t8; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__js_browser }, (Option*)(&_t8), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t8; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__js_browser }, (_option*)(&_t8), sizeof(v__pref__Arch)); return _t8; } else if (string__eq(arch_str, _SLIT("js_freestanding"))) { - Option_v__pref__Arch _t9; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch__js_freestanding }, (Option*)(&_t9), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t9; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch__js_freestanding }, (_option*)(&_t9), sizeof(v__pref__Arch)); return _t9; } else if (string__eq(arch_str, _SLIT(""))) { - Option_v__pref__Arch _t10; - opt_ok(&(v__pref__Arch[]) { v__pref__Arch___auto }, (Option*)(&_t10), sizeof(v__pref__Arch)); + _option_v__pref__Arch _t10; + opt_ok2(&(v__pref__Arch[]) { v__pref__Arch___auto }, (_option*)(&_t10), sizeof(v__pref__Arch)); return _t10; } else { - 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){ .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}; + return (_option_v__pref__Arch){0}; } VV_LOCAL_SYMBOL void v__pref__must_exist(string path) { @@ -37528,47 +37590,47 @@ inline VV_LOCAL_SYMBOL bool v__pref__is_source_file(string path) { return _t1; } -Option_v__pref__Backend v__pref__backend_from_string(string s) { +_option_v__pref__Backend v__pref__backend_from_string(string s) { if (string__eq(s, _SLIT("c"))) { - Option_v__pref__Backend _t1; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__c }, (Option*)(&_t1), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t1; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__c }, (_option*)(&_t1), sizeof(v__pref__Backend)); return _t1; } else if (string__eq(s, _SLIT("js"))) { - Option_v__pref__Backend _t2; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__js_node }, (Option*)(&_t2), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t2; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__js_node }, (_option*)(&_t2), sizeof(v__pref__Backend)); return _t2; } else if (string__eq(s, _SLIT("js_node"))) { - Option_v__pref__Backend _t3; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__js_node }, (Option*)(&_t3), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t3; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__js_node }, (_option*)(&_t3), sizeof(v__pref__Backend)); return _t3; } else if (string__eq(s, _SLIT("js_browser"))) { - Option_v__pref__Backend _t4; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__js_browser }, (Option*)(&_t4), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t4; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__js_browser }, (_option*)(&_t4), sizeof(v__pref__Backend)); return _t4; } else if (string__eq(s, _SLIT("js_freestanding"))) { - Option_v__pref__Backend _t5; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__js_freestanding }, (Option*)(&_t5), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t5; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__js_freestanding }, (_option*)(&_t5), sizeof(v__pref__Backend)); return _t5; } else if (string__eq(s, _SLIT("native"))) { - Option_v__pref__Backend _t6; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__native }, (Option*)(&_t6), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t6; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__native }, (_option*)(&_t6), sizeof(v__pref__Backend)); return _t6; } else if (string__eq(s, _SLIT("interpret"))) { - Option_v__pref__Backend _t7; - opt_ok(&(v__pref__Backend[]) { v__pref__Backend__interpret }, (Option*)(&_t7), sizeof(v__pref__Backend)); + _option_v__pref__Backend _t7; + opt_ok2(&(v__pref__Backend[]) { v__pref__Backend__interpret }, (_option*)(&_t7), sizeof(v__pref__Backend)); return _t7; } else { - 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){ .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}; + return (_option_v__pref__Backend){0}; } v__pref__CompilerType v__pref__cc_from_string(string cc_str) { @@ -37850,7 +37912,7 @@ bool v__pref__Preferences_should_compile_asm(v__pref__Preferences* prefs, string return _t1; } string file = string_all_before_last(path, _SLIT(".v")); - Option_v__pref__Arch _t2 = v__pref__arch_from_string(string_all_after_last(file, _SLIT("."))); + _option_v__pref__Arch _t2 = v__pref__arch_from_string(string_all_after_last(file, _SLIT("."))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(v__pref__Arch*) _t2.data = v__pref__Arch___auto; @@ -37861,7 +37923,7 @@ bool v__pref__Preferences_should_compile_asm(v__pref__Preferences* prefs, string bool _t3 = false; return _t3; } - Option_v__pref__OS _t4 = v__pref__os_from_string(string_all_before(string_all_after_last(file, _SLIT("_")), _SLIT("."))); + _option_v__pref__OS _t4 = v__pref__os_from_string(string_all_before(string_all_after_last(file, _SLIT("_")), _SLIT("."))); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(v__pref__OS*) _t4.data = v__pref__OS___auto; @@ -38406,7 +38468,7 @@ int sync__channel_select(Array_sync__Channel_ptr* channels, Array_sync__Directio int event_idx = -1; outer: for (;;) { - Option_int _t1 = rand__intn(channels->len); + _option_int _t1 = rand__intn(channels->len); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(int*) _t1.data = 0; @@ -38808,7 +38870,7 @@ void help__print_and_exit(string topic) { 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, /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(".txt"), 0, { .d_c = 0 }}}))}))); - Option_string _t2 = os__read_file(target_topic); + _option_string _t2 = os__read_file(target_topic); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; eprintln(_const_help__unknown_topic); @@ -38827,7 +38889,7 @@ void help__print_and_exit(string topic) { VV_LOCAL_SYMBOL string help__known_topics(string topicdir) { Array_string res = __new_array_with_default(0, 0, sizeof(string), 0); array_push((array*)&res, _MOV((string[]){ string_clone(_SLIT("Known help topics: ")) })); - Option_Array_string _t2 = os__glob(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){os__join_path(topicdir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("*.txt")})))}))); + _option_Array_string _t2 = os__glob(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){os__join_path(topicdir, new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("*.txt")})))}))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(Array_string*) _t2.data = __new_array_with_default(0, 0, sizeof(string), 0); @@ -38852,8 +38914,8 @@ VV_LOCAL_SYMBOL string help__known_topics(string topicdir) { return _t7; } -Option_string v__util__find_working_diff_command(void) { - Option_string _t1 = v__util__diff__find_working_diff_command(); +_option_string v__util__find_working_diff_command(void) { + _option_string _t1 = v__util__diff__find_working_diff_command(); return _t1; } @@ -38929,7 +38991,7 @@ string v__util__formatted_error(string kind, string omsg, string filepath, v__to Array_string v__util__cached_file2sourcelines(string path) { Array_string* _t2 = (Array_string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, lines_cache->lines), &(string[]){path})); - Option_Array_string _t1 = {0}; + _option_Array_string _t1 = {0}; if (_t2) { *((Array_string*)&_t1.data) = *((Array_string*)_t2); } else { @@ -38941,7 +39003,7 @@ Array_string v__util__cached_file2sourcelines(string path) { Array_string _t3 = res; return _t3; } - Option_string _t4 = v__util__read_file(path); + _option_string _t4 = v__util__read_file(path); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(string*) _t4.data = _SLIT(""); @@ -39026,7 +39088,7 @@ string v__util__qualify_import(v__pref__Preferences* pref, string mod, string fi string search_path = ((string*)mod_paths.data)[_t2]; string try_path = os__join_path_single(search_path, mod_path); if (os__is_dir(try_path)) { - Option_string _t3; + _option_string _t3; if (_t3 = v__util__mod_path_to_full_name(pref, mod, try_path), _t3.state == 0) { string m1 = *(string*)_t3.data; ; @@ -39035,7 +39097,7 @@ string v__util__qualify_import(v__pref__Preferences* pref, string mod, string fi } } } - Option_string _t5; + _option_string _t5; if (_t5 = v__util__mod_path_to_full_name(pref, mod, file_path), _t5.state == 0) { string m1 = *(string*)_t5.data; ; @@ -39059,7 +39121,7 @@ string v__util__qualify_module(v__pref__Preferences* pref, string mod, string fi string _t2 = mod; return _t2; } - Option_string _t3; + _option_string _t3; if (_t3 = v__util__mod_path_to_full_name(pref, mod, clean_file_path), _t3.state == 0) { string m1 = *(string*)_t3.data; ; @@ -39071,7 +39133,7 @@ string v__util__qualify_module(v__pref__Preferences* pref, string mod, string fi return _t5; } -VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preferences* pref, string mod, string path) { +VV_LOCAL_SYMBOL _option_string v__util__mod_path_to_full_name(v__pref__Preferences* pref, string mod, string path) { Array_string vmod_folders = new_array_from_c_array(3, 3, sizeof(string), _MOV((string[3]){_SLIT("vlib"), _SLIT(".vmodules"), _SLIT("modules")})); Array_string _t1 = {0}; Array_string _t1_orig = pref->lookup_path; @@ -39109,8 +39171,8 @@ VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preference if (Array_string_contains(vmod_folders, path_part)) { Array_string _t6; string mod_full_name = Array_string_join((_t6 = string_split(try_path, _const_os__path_separator), array_slice(_t6, j + 1, _t6.len)), _SLIT(".")); - Option_string _t7; - opt_ok(&(string[]) { mod_full_name }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { mod_full_name }, (_option*)(&_t7), sizeof(string)); return _t7; } } @@ -39119,7 +39181,7 @@ VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preference int last_v_mod = -1; for (int j = try_path_parts.len; j > 0; j--) { string parent = Array_string_join(array_slice(try_path_parts, 0, j), _const_os__path_separator); - Option_Array_string _t8; + _option_Array_string _t8; if (_t8 = os__ls(parent), _t8.state == 0) { Array_string ls = *(Array_string*)_t8.data; if (Array_string_contains(ls, _SLIT("v.mod")) && (try_path_parts.len > i && !string__eq((*(string*)/*ee elem_sym */array_get(try_path_parts, i)), _SLIT("v")) && !Array_string_contains(ls, _SLIT("vlib")))) { @@ -39132,8 +39194,8 @@ VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preference if (last_v_mod > -1) { Array_string _t9; string mod_full_name = Array_string_join((_t9 = try_path_parts, array_slice(_t9, last_v_mod, _t9.len)), _SLIT(".")); - Option_string _t10; - opt_ok(&(string[]) { mod_full_name }, (Option*)(&_t10), sizeof(string)); + _option_string _t10; + opt_ok2(&(string[]) { mod_full_name }, (_option*)(&_t10), sizeof(string)); return _t10; } } @@ -39143,12 +39205,12 @@ VV_LOCAL_SYMBOL Option_string v__util__mod_path_to_full_name(v__pref__Preference string rel_mod_path = string_replace(path, string__plus(string_all_before_last(pref->path, _const_os__path_separator), _const_os__path_separator), _SLIT("")); if (!string__eq(rel_mod_path, path)) { string full_mod_name = string_replace(rel_mod_path, _const_os__path_separator, _SLIT(".")); - Option_string _t11; - opt_ok(&(string[]) { full_mod_name }, (Option*)(&_t11), sizeof(string)); + _option_string _t11; + opt_ok2(&(string[]) { full_mod_name }, (_option*)(&_t11), sizeof(string)); return _t11; } } - return (Option_string){ .state=2, .err=_v_error(_SLIT("module not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("module not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; } // Attr: [direct_array_access] @@ -39539,7 +39601,7 @@ void v__util__timing_set_should_print(bool should_print) { void v__util__Timers_start(v__util__Timers* t, string name) { time__StopWatch* _t2 = (time__StopWatch*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, t->swatches), &(string[]){name})); - Option_time__StopWatch _t1 = {0}; + _option_time__StopWatch _t1 = {0}; if (_t2) { *((time__StopWatch*)&_t1.data) = *((time__StopWatch*)_t2); } else { @@ -39695,24 +39757,24 @@ void v__util__set_vroot_folder(string vroot_path) { os__setenv(_SLIT("VCHILD"), _SLIT("true"), true); } -Option_string v__util__resolve_vmodroot(string str, string dir) { +_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 "), /*115 &string*/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; - opt_ok(&(string[]) { string_replace(str, _SLIT("@VMODROOT"), os__real_path(vmod_path)) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { string_replace(str, _SLIT("@VMODROOT"), os__real_path(vmod_path)) }, (_option*)(&_t2), sizeof(string)); return _t2; } -Option_string v__util__resolve_env_value(string str, bool check_for_presence) { +_option_string v__util__resolve_env_value(string str, bool check_for_presence) { string env_ident = _SLIT("$env('"); - Option_int _t1 = string_index(str, env_ident); + _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 \""), /*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} }; + 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); @@ -39725,19 +39787,19 @@ Option_string v__util__resolve_env_value(string str, bool check_for_presence) { } else { if (!(ch == '\'' || ch == ')')) { 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(_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 \""), /*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} }; + 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} }; } } } if ((env_lit).len == 0) { - return (Option_string){ .state=2, .err=_v_error(_SLIT("supply an env variable name like HOME, PATH or USER")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("supply an env variable name like HOME, PATH or USER")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string env_value = _SLIT(""); if (check_for_presence) { string* _t7 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, os__environ()), &(string[]){env_lit})); - Option_string _t6 = {0}; + _option_string _t6 = {0}; if (_t7) { *((string*)&_t6.data) = *((string*)_t7); } else { @@ -39746,23 +39808,23 @@ 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 \""), /*115 &string*/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 \""), /*115 &string*/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); } string rep = string_replace_once(str, string__plus(string__plus(string__plus(env_ident, env_lit), _SLIT("'")), _SLIT(")")), env_value); if (string_contains(rep, env_ident)) { - Option_string _t10 = v__util__resolve_env_value(rep, check_for_presence); + _option_string _t10 = v__util__resolve_env_value(rep, check_for_presence); return _t10; } - Option_string _t11; - opt_ok(&(string[]) { rep }, (Option*)(&_t11), sizeof(string)); + _option_string _t11; + opt_ok2(&(string[]) { rep }, (_option*)(&_t11), sizeof(string)); return _t11; } @@ -39800,7 +39862,7 @@ VNORETURN void v__util__launch_tool(bool is_verbose, string tool_name, Array_str 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)) })); for (int _t1 = 0; _t1 < emodules.len; ++_t1) { string emodule = ((string*)emodules.data)[_t1]; - Option_bool _t2 = v__util__check_module_is_installed(emodule, is_verbose); + _option_bool _t2 = v__util__check_module_is_installed(emodule, is_verbose); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; _v_panic(IError_str(err)); @@ -39916,7 +39978,7 @@ string v__util__path_of_executable(string path) { } // Attr: [unsafe] -Option_string v__util__cached_read_source_file(string path) { +_option_string v__util__cached_read_source_file(string path) { static v__util__SourceCache* cache = ((v__util__SourceCache*)(0)); if (isnil(cache)) { cache = ((v__util__SourceCache*)memdup(&(v__util__SourceCache){.sources = new_map(sizeof(string), sizeof(string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}, sizeof(v__util__SourceCache))); @@ -39925,10 +39987,10 @@ Option_string v__util__cached_read_source_file(string path) { map_free(&cache->sources); _v_free(cache); cache = ((v__util__SourceCache*)(0)); - return (Option_string){ .state=2, .err=_v_error(_SLIT("memory source file cache cleared")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("memory source file cache cleared")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string* _t3 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, cache->sources), &(string[]){path})); - Option_string _t2 = {0}; + _option_string _t2 = {0}; if (_t3) { *((string*)&_t2.data) = *((string*)_t3); } else { @@ -39937,21 +39999,21 @@ Option_string v__util__cached_read_source_file(string path) { if (_t2.state == 0) { string res = *(string*)_t2.data; - Option_string _t4; - opt_ok(&(string[]) { res }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { res }, (_option*)(&_t4), sizeof(string)); return _t4; } - Option_string _t5 = os__read_file(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 "), /*115 &string*/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); string res = v__util__skip_bom(raw_text); map_set(&cache->sources, &(string[]){path}, &(string[]) { res }); - Option_string _t7; - opt_ok(&(string[]) { res }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { res }, (_option*)(&_t7), sizeof(string)); return _t7; } @@ -39998,7 +40060,7 @@ VV_LOCAL_SYMBOL Array_string v__util__non_empty(Array_string arg) { return _t1; } -Option_bool v__util__check_module_is_installed(string modulename, bool is_verbose) { +_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/"), /*115 &string*/0xfe10, {.d_s = modulename}}, {_SLIT0, 0, { .d_c = 0 }}})); @@ -40015,7 +40077,7 @@ Option_bool v__util__check_module_is_installed(string modulename, bool is_verbos } 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 "), /*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} }; + 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: `"), /*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 }}}))); @@ -40025,8 +40087,8 @@ Option_bool v__util__check_module_is_installed(string modulename, bool is_verbos } eprintln(string_repeat(_SLIT("-"), 50)); } - Option_bool _t2; - opt_ok(&(bool[]) { true }, (Option*)(&_t2), sizeof(bool)); + _option_bool _t2; + opt_ok2(&(bool[]) { true }, (_option*)(&_t2), sizeof(bool)); return _t2; } if (is_verbose) { @@ -40034,19 +40096,19 @@ Option_bool v__util__check_module_is_installed(string modulename, bool is_verbos } 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: "), /*115 &string*/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: "), /*115 &string*/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, "), /*115 &string*/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")); } - Option_bool _t6; - opt_ok(&(bool[]) { true }, (Option*)(&_t6), sizeof(bool)); + _option_bool _t6; + opt_ok2(&(bool[]) { true }, (_option*)(&_t6), sizeof(bool)); return _t6; } @@ -40068,7 +40130,7 @@ void v__util__ensure_modules_for_all_tools_are_installed(bool is_verbose) { } for (int _t4 = 0; _t4 < tool_modules.len; ++_t4) { string emodule = ((string*)tool_modules.data)[_t4]; - Option_bool _t5 = v__util__check_module_is_installed(emodule, is_verbose); + _option_bool _t5 = v__util__check_module_is_installed(emodule, is_verbose); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; _v_panic(IError_str(err)); @@ -40119,9 +40181,9 @@ void v__util__prepare_tool_when_needed(string source_name) { string vexe = os__getenv(_SLIT("VEXE")); string vroot = os__dir(vexe); string stool = os__join_path(vroot, new_array_from_c_array(3, 3, sizeof(string), _MOV((string[3]){_SLIT("cmd"), _SLIT("tools"), source_name}))); - multi_return_string_string mr_14629 = v__util__tool_source2name_and_exe(stool); - string tool_name = mr_14629.arg0; - string tool_exe = mr_14629.arg1; + multi_return_string_string mr_14964 = v__util__tool_source2name_and_exe(stool); + string tool_name = mr_14964.arg0; + string tool_exe = mr_14964.arg1; if (v__util__should_recompile_tool(vexe, stool, tool_name, tool_exe)) { time__sleep(1001 * _const_time__millisecond); v__util__recompile_file(vexe, stool); @@ -40147,7 +40209,7 @@ string v__util__get_vtmp_folder(void) { int uid = os__getuid(); 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); + _option_void _t2 = os__mkdir_all(vtmp); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -40167,7 +40229,7 @@ bool v__util__should_bundle_module(string mod) { return _t1; } -Option_Array_string v__util__find_all_v_files(Array_string roots) { +_option_Array_string v__util__find_all_v_files(Array_string roots) { Array_string files = __new_array_with_default(0, 0, sizeof(string), 0); for (int _t1 = 0; _t1 < roots.len; ++_t1) { string file = ((string*)roots.data)[_t1]; @@ -40177,22 +40239,22 @@ 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: \""), /*115 &string*/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("\""), /*115 &string*/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) })); } - Option_Array_string _t7; - opt_ok(&(Array_string[]) { files }, (Option*)(&_t7), sizeof(Array_string)); + _option_Array_string _t7; + opt_ok2(&(Array_string[]) { files }, (_option*)(&_t7), sizeof(Array_string)); return _t7; } void v__util__free_caches(void) { { // Unsafe block v__util__cached_file2sourcelines(_SLIT("")); - Option_string _t1 = v__util__cached_read_source_file(_SLIT("")); + _option_string _t1 = v__util__cached_read_source_file(_SLIT("")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(string*) _t1.data = _SLIT(""); @@ -40202,8 +40264,8 @@ void v__util__free_caches(void) { } } -Option_string v__util__read_file(string file_path) { - Option_string _t1 = v__util__cached_read_source_file(file_path); +_option_string v__util__read_file(string file_path) { + _option_string _t1 = v__util__cached_read_source_file(file_path); return _t1; } @@ -40378,18 +40440,18 @@ v__ast__Node v__ast__empty_node(void) { return _t1; } -Option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e) { +_option_v__ast__Ident v__ast__SelectorExpr_root_ident(v__ast__SelectorExpr* e) { v__ast__Expr root = e->expr; for (;;) { - if (!((root)._typ == 326 /* v.ast.SelectorExpr */)) break; + if (!((root)._typ == 327 /* v.ast.SelectorExpr */)) break; root = (*root._v__ast__SelectorExpr).expr; } - 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)); + if ((root)._typ == 307 /* v.ast.Ident */) { + _option_v__ast__Ident _t1; + opt_ok2(&(v__ast__Ident[]) { (*root._v__ast__Ident) }, (_option*)(&_t1), sizeof(v__ast__Ident)); return _t1; } - return (Option_v__ast__Ident){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Ident){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__StructField_equals(v__ast__StructField* f, v__ast__StructField* o) { @@ -40417,19 +40479,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 == 364 /* v.ast.Var */) { + if (i->obj._typ == 365 /* v.ast.Var */) { bool _t1 = (*i->obj._v__ast__Var).is_mut; return _t1; } - else if (i->obj._typ == 362 /* v.ast.ConstField */) { + else if (i->obj._typ == 363 /* v.ast.ConstField */) { bool _t2 = false; return _t2; } - else if (i->obj._typ == 361 /* v.ast.AsmRegister */) { + else if (i->obj._typ == 362 /* v.ast.AsmRegister */) { bool _t3 = true; return _t3; } - else if (i->obj._typ == 363 /* v.ast.GlobalField */) { + else if (i->obj._typ == 364 /* v.ast.GlobalField */) { bool _t4 = true; return _t4; } @@ -40438,7 +40500,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 == 416 /* v.ast.IdentVar */) { + if (i->info._typ == 417 /* v.ast.IdentVar */) { v__ast__IdentVar _t1 = (*i->info._v__ast__IdentVar); return _t1; } @@ -40454,7 +40516,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 == 306 /* v.ast.Ident */) { + if ((expr)._typ == 307 /* v.ast.Ident */) { bool _t1 = (*expr._v__ast__Ident).kind == v__ast__IdentKind__blank_ident; return _t1; } @@ -40463,199 +40525,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 == 284 /* v.ast.AnonFn */) { + if (expr._typ == 285 /* v.ast.AnonFn */) { v__token__Pos _t1 = (*expr._v__ast__AnonFn).decl.pos; return _t1; } - else if (expr._typ == 291 /* v.ast.CTempVar */) { + else if (expr._typ == 292 /* 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 == 302 /* v.ast.EmptyExpr */) { + else if (expr._typ == 303 /* 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 == 317 /* v.ast.NodeError */) { + else if (expr._typ == 318 /* v.ast.NodeError */) { v__token__Pos _t4 = (*expr._v__ast__NodeError).pos; return _t4; } - else if (expr._typ == 285 /* v.ast.ArrayDecompose */) { + else if (expr._typ == 286 /* v.ast.ArrayDecompose */) { v__token__Pos _t5 = (*expr._v__ast__ArrayDecompose).pos; return _t5; } - else if (expr._typ == 286 /* v.ast.ArrayInit */) { + else if (expr._typ == 287 /* v.ast.ArrayInit */) { v__token__Pos _t6 = (*expr._v__ast__ArrayInit).pos; return _t6; } - else if (expr._typ == 287 /* v.ast.AsCast */) { + else if (expr._typ == 288 /* v.ast.AsCast */) { v__token__Pos _t7 = (*expr._v__ast__AsCast).pos; return _t7; } - else if (expr._typ == 288 /* v.ast.Assoc */) { + else if (expr._typ == 289 /* v.ast.Assoc */) { v__token__Pos _t8 = (*expr._v__ast__Assoc).pos; return _t8; } - else if (expr._typ == 289 /* v.ast.AtExpr */) { + else if (expr._typ == 290 /* v.ast.AtExpr */) { v__token__Pos _t9 = (*expr._v__ast__AtExpr).pos; return _t9; } - else if (expr._typ == 290 /* v.ast.BoolLiteral */) { + else if (expr._typ == 291 /* v.ast.BoolLiteral */) { v__token__Pos _t10 = (*expr._v__ast__BoolLiteral).pos; return _t10; } - else if (expr._typ == 292 /* v.ast.CallExpr */) { + else if (expr._typ == 293 /* v.ast.CallExpr */) { v__token__Pos _t11 = (*expr._v__ast__CallExpr).pos; return _t11; } - else if (expr._typ == 293 /* v.ast.CastExpr */) { + else if (expr._typ == 294 /* v.ast.CastExpr */) { v__token__Pos _t12 = (*expr._v__ast__CastExpr).pos; return _t12; } - else if (expr._typ == 294 /* v.ast.ChanInit */) { + else if (expr._typ == 295 /* v.ast.ChanInit */) { v__token__Pos _t13 = (*expr._v__ast__ChanInit).pos; return _t13; } - else if (expr._typ == 295 /* v.ast.CharLiteral */) { + else if (expr._typ == 296 /* v.ast.CharLiteral */) { v__token__Pos _t14 = (*expr._v__ast__CharLiteral).pos; return _t14; } - else if (expr._typ == 300 /* v.ast.ConcatExpr */) { + else if (expr._typ == 301 /* v.ast.ConcatExpr */) { v__token__Pos _t15 = (*expr._v__ast__ConcatExpr).pos; return _t15; } - else if (expr._typ == 296 /* v.ast.Comment */) { + else if (expr._typ == 297 /* v.ast.Comment */) { v__token__Pos _t16 = (*expr._v__ast__Comment).pos; return _t16; } - else if (expr._typ == 297 /* v.ast.ComptimeCall */) { + else if (expr._typ == 298 /* v.ast.ComptimeCall */) { v__token__Pos _t17 = (*expr._v__ast__ComptimeCall).pos; return _t17; } - else if (expr._typ == 298 /* v.ast.ComptimeSelector */) { + else if (expr._typ == 299 /* v.ast.ComptimeSelector */) { v__token__Pos _t18 = (*expr._v__ast__ComptimeSelector).pos; return _t18; } - else if (expr._typ == 303 /* v.ast.EnumVal */) { + else if (expr._typ == 304 /* v.ast.EnumVal */) { v__token__Pos _t19 = (*expr._v__ast__EnumVal).pos; return _t19; } - else if (expr._typ == 301 /* v.ast.DumpExpr */) { + else if (expr._typ == 302 /* v.ast.DumpExpr */) { v__token__Pos _t20 = (*expr._v__ast__DumpExpr).pos; return _t20; } - else if (expr._typ == 304 /* v.ast.FloatLiteral */) { + else if (expr._typ == 305 /* v.ast.FloatLiteral */) { v__token__Pos _t21 = (*expr._v__ast__FloatLiteral).pos; return _t21; } - else if (expr._typ == 305 /* v.ast.GoExpr */) { + else if (expr._typ == 306 /* v.ast.GoExpr */) { v__token__Pos _t22 = (*expr._v__ast__GoExpr).pos; return _t22; } - else if (expr._typ == 306 /* v.ast.Ident */) { + else if (expr._typ == 307 /* v.ast.Ident */) { v__token__Pos _t23 = (*expr._v__ast__Ident).pos; return _t23; } - else if (expr._typ == 307 /* v.ast.IfExpr */) { + else if (expr._typ == 308 /* v.ast.IfExpr */) { v__token__Pos _t24 = (*expr._v__ast__IfExpr).pos; return _t24; } - else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 312 /* v.ast.IntegerLiteral */) { v__token__Pos _t25 = (*expr._v__ast__IntegerLiteral).pos; return _t25; } - else if (expr._typ == 312 /* v.ast.IsRefType */) { + else if (expr._typ == 313 /* v.ast.IsRefType */) { v__token__Pos _t26 = (*expr._v__ast__IsRefType).pos; return _t26; } - else if (expr._typ == 313 /* v.ast.Likely */) { + else if (expr._typ == 314 /* v.ast.Likely */) { v__token__Pos _t27 = (*expr._v__ast__Likely).pos; return _t27; } - else if (expr._typ == 314 /* v.ast.LockExpr */) { + else if (expr._typ == 315 /* v.ast.LockExpr */) { v__token__Pos _t28 = (*expr._v__ast__LockExpr).pos; return _t28; } - else if (expr._typ == 315 /* v.ast.MapInit */) { + else if (expr._typ == 316 /* v.ast.MapInit */) { v__token__Pos _t29 = (*expr._v__ast__MapInit).pos; return _t29; } - else if (expr._typ == 316 /* v.ast.MatchExpr */) { + else if (expr._typ == 317 /* v.ast.MatchExpr */) { v__token__Pos _t30 = (*expr._v__ast__MatchExpr).pos; return _t30; } - else if (expr._typ == 318 /* v.ast.None */) { + else if (expr._typ == 319 /* v.ast.None */) { v__token__Pos _t31 = (*expr._v__ast__None).pos; return _t31; } - else if (expr._typ == 319 /* v.ast.OffsetOf */) { + else if (expr._typ == 320 /* v.ast.OffsetOf */) { v__token__Pos _t32 = (*expr._v__ast__OffsetOf).pos; return _t32; } - else if (expr._typ == 320 /* v.ast.OrExpr */) { + else if (expr._typ == 321 /* v.ast.OrExpr */) { v__token__Pos _t33 = (*expr._v__ast__OrExpr).pos; return _t33; } - else if (expr._typ == 321 /* v.ast.ParExpr */) { + else if (expr._typ == 322 /* v.ast.ParExpr */) { v__token__Pos _t34 = (*expr._v__ast__ParExpr).pos; return _t34; } - else if (expr._typ == 322 /* v.ast.PostfixExpr */) { + else if (expr._typ == 323 /* v.ast.PostfixExpr */) { v__token__Pos _t35 = (*expr._v__ast__PostfixExpr).pos; return _t35; } - else if (expr._typ == 323 /* v.ast.PrefixExpr */) { + else if (expr._typ == 324 /* v.ast.PrefixExpr */) { v__token__Pos _t36 = (*expr._v__ast__PrefixExpr).pos; return _t36; } - else if (expr._typ == 324 /* v.ast.RangeExpr */) { + else if (expr._typ == 325 /* v.ast.RangeExpr */) { v__token__Pos _t37 = (*expr._v__ast__RangeExpr).pos; return _t37; } - else if (expr._typ == 325 /* v.ast.SelectExpr */) { + else if (expr._typ == 326 /* v.ast.SelectExpr */) { v__token__Pos _t38 = (*expr._v__ast__SelectExpr).pos; return _t38; } - else if (expr._typ == 326 /* v.ast.SelectorExpr */) { + else if (expr._typ == 327 /* v.ast.SelectorExpr */) { v__token__Pos _t39 = (*expr._v__ast__SelectorExpr).pos; return _t39; } - else if (expr._typ == 327 /* v.ast.SizeOf */) { + else if (expr._typ == 328 /* v.ast.SizeOf */) { v__token__Pos _t40 = (*expr._v__ast__SizeOf).pos; return _t40; } - else if (expr._typ == 328 /* v.ast.SqlExpr */) { + else if (expr._typ == 329 /* v.ast.SqlExpr */) { v__token__Pos _t41 = (*expr._v__ast__SqlExpr).pos; return _t41; } - else if (expr._typ == 329 /* v.ast.StringInterLiteral */) { + else if (expr._typ == 330 /* v.ast.StringInterLiteral */) { v__token__Pos _t42 = (*expr._v__ast__StringInterLiteral).pos; return _t42; } - else if (expr._typ == 330 /* v.ast.StringLiteral */) { + else if (expr._typ == 331 /* v.ast.StringLiteral */) { v__token__Pos _t43 = (*expr._v__ast__StringLiteral).pos; return _t43; } - else if (expr._typ == 331 /* v.ast.StructInit */) { + else if (expr._typ == 332 /* v.ast.StructInit */) { v__token__Pos _t44 = (*expr._v__ast__StructInit).pos; return _t44; } - else if (expr._typ == 332 /* v.ast.TypeNode */) { + else if (expr._typ == 333 /* v.ast.TypeNode */) { v__token__Pos _t45 = (*expr._v__ast__TypeNode).pos; return _t45; } - else if (expr._typ == 333 /* v.ast.TypeOf */) { + else if (expr._typ == 334 /* v.ast.TypeOf */) { v__token__Pos _t46 = (*expr._v__ast__TypeOf).pos; return _t46; } - else if (expr._typ == 334 /* v.ast.UnsafeExpr */) { + else if (expr._typ == 335 /* v.ast.UnsafeExpr */) { v__token__Pos _t47 = (*expr._v__ast__UnsafeExpr).pos; return _t47; } - else if (expr._typ == 299 /* v.ast.ComptimeType */) { + else if (expr._typ == 300 /* v.ast.ComptimeType */) { v__token__Pos _t48 = (*expr._v__ast__ComptimeType).pos; return _t48; } - else if (expr._typ == 309 /* v.ast.IndexExpr */) { + else if (expr._typ == 310 /* 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; @@ -40663,11 +40725,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 == 308 /* v.ast.IfGuardExpr */) { + else if (expr._typ == 309 /* v.ast.IfGuardExpr */) { v__token__Pos _t51 = v__ast__Expr_pos((*expr._v__ast__IfGuardExpr).expr); return _t51; } - else if (expr._typ == 310 /* v.ast.InfixExpr */) { + else if (expr._typ == 311 /* 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,}); @@ -40678,27 +40740,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 == 306 /* v.ast.Ident */) { + if (expr._typ == 307 /* v.ast.Ident */) { bool _t1 = true; return _t1; } - else if (expr._typ == 291 /* v.ast.CTempVar */) { + else if (expr._typ == 292 /* v.ast.CTempVar */) { bool _t2 = true; return _t2; } - else if (expr._typ == 309 /* v.ast.IndexExpr */) { + else if (expr._typ == 310 /* v.ast.IndexExpr */) { bool _t3 = v__ast__Expr_is_lvalue((*expr._v__ast__IndexExpr).left); return _t3; } - else if (expr._typ == 326 /* v.ast.SelectorExpr */) { + else if (expr._typ == 327 /* v.ast.SelectorExpr */) { bool _t4 = v__ast__Expr_is_lvalue((*expr._v__ast__SelectorExpr).expr); return _t4; } - else if (expr._typ == 321 /* v.ast.ParExpr */) { + else if (expr._typ == 322 /* v.ast.ParExpr */) { bool _t5 = v__ast__Expr_is_lvalue((*expr._v__ast__ParExpr).expr); return _t5; } - else if (expr._typ == 323 /* v.ast.PrefixExpr */) { + else if (expr._typ == 324 /* v.ast.PrefixExpr */) { bool _t6 = v__ast__Expr_is_lvalue((*expr._v__ast__PrefixExpr).right); return _t6; } @@ -40711,19 +40773,19 @@ bool v__ast__Expr_is_lvalue(v__ast__Expr expr) { } bool v__ast__Expr_is_expr(v__ast__Expr expr) { - if (expr._typ == 307 /* v.ast.IfExpr */) { + if (expr._typ == 308 /* v.ast.IfExpr */) { bool _t1 = (*expr._v__ast__IfExpr).is_expr; return _t1; } - else if (expr._typ == 314 /* v.ast.LockExpr */) { + else if (expr._typ == 315 /* v.ast.LockExpr */) { bool _t2 = (*expr._v__ast__LockExpr).is_expr; return _t2; } - else if (expr._typ == 316 /* v.ast.MatchExpr */) { + else if (expr._typ == 317 /* v.ast.MatchExpr */) { bool _t3 = (*expr._v__ast__MatchExpr).is_expr; return _t3; } - else if (expr._typ == 325 /* v.ast.SelectExpr */) { + else if (expr._typ == 326 /* v.ast.SelectExpr */) { bool _t4 = (*expr._v__ast__SelectExpr).is_expr; return _t4; } @@ -40736,20 +40798,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 == 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)); + bool _t1 = ((expr._typ == 291 /* v.ast.BoolLiteral */) ? (true) : (expr._typ == 296 /* v.ast.CharLiteral */) ? (true) : (expr._typ == 331 /* v.ast.StringLiteral */) ? (true) : (expr._typ == 312 /* v.ast.IntegerLiteral */) ? (true) : (false)); return _t1; } bool v__ast__Expr_is_auto_deref_var(v__ast__Expr expr) { - if (expr._typ == 306 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if (expr._typ == 307 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 365 /* v.ast.Var */) { if ((*(*expr._v__ast__Ident).obj._v__ast__Var).is_auto_deref) { bool _t1 = true; return _t1; } } } - else if (expr._typ == 323 /* v.ast.PrefixExpr */) { + else if (expr._typ == 324 /* 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; @@ -40764,11 +40826,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 == 306 /* v.ast.Ident */) { + if (e->_typ == 307 /* v.ast.Ident */) { bool _t1 = true; return _t1; } - else if (e->_typ == 326 /* v.ast.SelectorExpr */) { + else if (e->_typ == 327 /* v.ast.SelectorExpr */) { bool _t2 = v__ast__Expr_is_lockable(&(*e->_v__ast__SelectorExpr).expr); return _t2; } @@ -40781,56 +40843,56 @@ bool v__ast__Expr_is_lockable(v__ast__Expr* e) { return 0; } -Option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt) { - if (stmt._typ == 338 /* v.ast.AssignStmt */) { - return (Option_void){0}; +_option_void v__ast__Stmt_check_c_expr(v__ast__Stmt stmt) { + if (stmt._typ == 339 /* v.ast.AssignStmt */) { + return (_option_void){0}; } - else if (stmt._typ == 347 /* v.ast.ForCStmt */) { - return (Option_void){0}; + else if (stmt._typ == 348 /* v.ast.ForCStmt */) { + return (_option_void){0}; } - else if (stmt._typ == 348 /* v.ast.ForInStmt */) { - return (Option_void){0}; + else if (stmt._typ == 349 /* v.ast.ForInStmt */) { + return (_option_void){0}; } - else if (stmt._typ == 349 /* v.ast.ForStmt */) { - return (Option_void){0}; + else if (stmt._typ == 350 /* v.ast.ForStmt */) { + return (_option_void){0}; } - else if (stmt._typ == 346 /* v.ast.ExprStmt */) { + else if (stmt._typ == 347 /* v.ast.ExprStmt */) { if (v__ast__Expr_is_expr((*stmt._v__ast__ExprStmt).expr)) { - return (Option_void){0}; + return (_option_void){0}; } - 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} }; + 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 (`"), /*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} }; + 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 == 317 /* v.ast.NodeError */) { + if (node._typ == 318 /* 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 == 367 /* v.ast.EmptyNode */) { + else if (node._typ == 368 /* 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 == 360 /* v.ast.Stmt */) { + else if (node._typ == 361 /* v.ast.Stmt */) { v__token__Pos pos = (*((*node._v__ast__Stmt).pos)); - if (((*node._v__ast__Stmt))._typ == 354 /* v.ast.Import */) { + if (((*node._v__ast__Stmt))._typ == 355 /* 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 == 283 /* v.ast.TypeDecl */) { - if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 281 /* v.ast.FnTypeDecl */) { + } else if (((*node._v__ast__Stmt))._typ == 284 /* v.ast.TypeDecl */) { + if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 282 /* 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 == 280 /* v.ast.AliasTypeDecl */) { + else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 281 /* 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 == 282 /* v.ast.SumTypeDecl */) { + else if ((*(*node._v__ast__Stmt)._v__ast__TypeDecl)._typ == 283 /* 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); @@ -40838,81 +40900,81 @@ v__token__Pos v__ast__Node_pos(v__ast__Node node) { } ; } - if (((*node._v__ast__Stmt))._typ == 338 /* v.ast.AssignStmt */) { + if (((*node._v__ast__Stmt))._typ == 339 /* 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 == 337 /* v.ast.AssertStmt */) { + if (((*node._v__ast__Stmt))._typ == 338 /* 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 == 335 /* v.ast.Expr */) { + else if (node._typ == 336 /* v.ast.Expr */) { v__token__Pos _t8 = v__ast__Expr_pos((*node._v__ast__Expr)); return _t8; } - else if (node._typ == 373 /* v.ast.StructField */) { + else if (node._typ == 374 /* 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 == 370 /* v.ast.MatchBranch */) { + else if (node._typ == 371 /* v.ast.MatchBranch */) { v__token__Pos _t10 = (*node._v__ast__MatchBranch).pos; return _t10; } - else if (node._typ == 372 /* v.ast.SelectBranch */) { + else if (node._typ == 373 /* v.ast.SelectBranch */) { v__token__Pos _t11 = (*node._v__ast__SelectBranch).pos; return _t11; } - else if (node._typ == 368 /* v.ast.EnumField */) { + else if (node._typ == 369 /* v.ast.EnumField */) { v__token__Pos _t12 = (*node._v__ast__EnumField).pos; return _t12; } - else if (node._typ == 362 /* v.ast.ConstField */) { + else if (node._typ == 363 /* v.ast.ConstField */) { v__token__Pos _t13 = (*node._v__ast__ConstField).pos; return _t13; } - else if (node._typ == 374 /* v.ast.StructInitField */) { + else if (node._typ == 375 /* v.ast.StructInitField */) { v__token__Pos _t14 = (*node._v__ast__StructInitField).pos; return _t14; } - else if (node._typ == 363 /* v.ast.GlobalField */) { + else if (node._typ == 364 /* v.ast.GlobalField */) { v__token__Pos _t15 = (*node._v__ast__GlobalField).pos; return _t15; } - else if (node._typ == 366 /* v.ast.CallArg */) { + else if (node._typ == 367 /* v.ast.CallArg */) { v__token__Pos _t16 = (*node._v__ast__CallArg).pos; return _t16; } - else if (node._typ == 371 /* v.ast.Param */) { + else if (node._typ == 372 /* 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 == 369 /* v.ast.IfBranch */) { + else if (node._typ == 370 /* 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 == 365 /* v.ast.ScopeObject */) { - if ((*node._v__ast__ScopeObject)._typ == 362 /* v.ast.ConstField */) { + else if (node._typ == 366 /* v.ast.ScopeObject */) { + if ((*node._v__ast__ScopeObject)._typ == 363 /* v.ast.ConstField */) { v__token__Pos _t19 = (*(*node._v__ast__ScopeObject)._v__ast__ConstField).pos; return _t19; } - else if ((*node._v__ast__ScopeObject)._typ == 363 /* v.ast.GlobalField */) { + else if ((*node._v__ast__ScopeObject)._typ == 364 /* v.ast.GlobalField */) { v__token__Pos _t20 = (*(*node._v__ast__ScopeObject)._v__ast__GlobalField).pos; return _t20; } - else if ((*node._v__ast__ScopeObject)._typ == 364 /* v.ast.Var */) { + else if ((*node._v__ast__ScopeObject)._typ == 365 /* v.ast.Var */) { v__token__Pos _t21 = (*(*node._v__ast__ScopeObject)._v__ast__Var).pos; return _t21; } - else if ((*node._v__ast__ScopeObject)._typ == 361 /* v.ast.AsmRegister */) { + else if ((*node._v__ast__ScopeObject)._typ == 362 /* 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 == 210 /* v.ast.File */) { + else if (node._typ == 211 /* 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)); @@ -40928,8 +40990,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 == 335 /* v.ast.Expr */) { - if ((*node._v__ast__Expr)._typ == 329 /* v.ast.StringInterLiteral */) { + if ((node)._typ == 336 /* v.ast.Expr */) { + if ((*node._v__ast__Expr)._typ == 330 /* 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; @@ -40943,7 +41005,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 == 288 /* v.ast.Assoc */) { + else if ((*node._v__ast__Expr)._typ == 289 /* 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; @@ -40957,7 +41019,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 == 286 /* v.ast.ArrayInit */) { + else if ((*node._v__ast__Expr)._typ == 287 /* 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; @@ -40971,37 +41033,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 == 326 /* v.ast.SelectorExpr */) { + else if ((*node._v__ast__Expr)._typ == 327 /* 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 == 322 /* v.ast.PostfixExpr */) { + else if ((*node._v__ast__Expr)._typ == 323 /* 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 == 334 /* v.ast.UnsafeExpr */) { + else if ((*node._v__ast__Expr)._typ == 335 /* 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 == 287 /* v.ast.AsCast */) { + else if ((*node._v__ast__Expr)._typ == 288 /* 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 == 321 /* v.ast.ParExpr */) { + else if ((*node._v__ast__Expr)._typ == 322 /* 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 == 308 /* v.ast.IfGuardExpr */) { + else if ((*node._v__ast__Expr)._typ == 309 /* 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 == 327 /* v.ast.SizeOf */) { + else if ((*node._v__ast__Expr)._typ == 328 /* 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 == 313 /* v.ast.Likely */) { + else if ((*node._v__ast__Expr)._typ == 314 /* 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 == 333 /* v.ast.TypeOf */) { + else if ((*node._v__ast__Expr)._typ == 334 /* 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 == 285 /* v.ast.ArrayDecompose */) { + else if ((*node._v__ast__Expr)._typ == 286 /* 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 == 314 /* v.ast.LockExpr */) { + else if ((*node._v__ast__Expr)._typ == 315 /* 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; @@ -41015,7 +41077,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 == 320 /* v.ast.OrExpr */) { + else if ((*node._v__ast__Expr)._typ == 321 /* 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; @@ -41029,7 +41091,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 == 331 /* v.ast.StructInit */) { + else if ((*node._v__ast__Expr)._typ == 332 /* 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; @@ -41043,10 +41105,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 == 284 /* v.ast.AnonFn */) { + else if ((*node._v__ast__Expr)._typ == 285 /* 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 == 292 /* v.ast.CallExpr */) { + else if ((*node._v__ast__Expr)._typ == 293 /* 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; @@ -41061,18 +41123,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 == 310 /* v.ast.InfixExpr */) { + else if ((*node._v__ast__Expr)._typ == 311 /* 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 == 323 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__Expr)._typ == 324 /* 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 == 309 /* v.ast.IndexExpr */) { + else if ((*node._v__ast__Expr)._typ == 310 /* 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 == 307 /* v.ast.IfExpr */) { + else if ((*node._v__ast__Expr)._typ == 308 /* 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; @@ -41086,7 +41148,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 == 316 /* v.ast.MatchExpr */) { + else if ((*node._v__ast__Expr)._typ == 317 /* 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; @@ -41100,7 +41162,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 == 325 /* v.ast.SelectExpr */) { + else if ((*node._v__ast__Expr)._typ == 326 /* 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; @@ -41114,10 +41176,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 == 294 /* v.ast.ChanInit */) { + else if ((*node._v__ast__Expr)._typ == 295 /* 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 == 315 /* v.ast.MapInit */) { + else if ((*node._v__ast__Expr)._typ == 316 /* 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; @@ -41141,15 +41203,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 == 324 /* v.ast.RangeExpr */) { + else if ((*node._v__ast__Expr)._typ == 325 /* 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 == 293 /* v.ast.CastExpr */) { + else if ((*node._v__ast__Expr)._typ == 294 /* 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 == 300 /* v.ast.ConcatExpr */) { + else if ((*node._v__ast__Expr)._typ == 301 /* 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; @@ -41163,18 +41225,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 == 297 /* v.ast.ComptimeCall */) { + else if ((*node._v__ast__Expr)._typ == 298 /* 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 == 298 /* v.ast.ComptimeSelector */) { + else if ((*node._v__ast__Expr)._typ == 299 /* 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 == 360 /* v.ast.Stmt */) { - if ((*node._v__ast__Stmt)._typ == 339 /* v.ast.Block */) { + } else if ((node)._typ == 361 /* v.ast.Stmt */) { + if ((*node._v__ast__Stmt)._typ == 340 /* 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; @@ -41188,7 +41250,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 == 343 /* v.ast.DeferStmt */) { + else if ((*node._v__ast__Stmt)._typ == 344 /* 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; @@ -41202,7 +41264,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 == 347 /* v.ast.ForCStmt */) { + else if ((*node._v__ast__Stmt)._typ == 348 /* 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; @@ -41216,7 +41278,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 == 348 /* v.ast.ForInStmt */) { + else if ((*node._v__ast__Stmt)._typ == 349 /* 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; @@ -41230,7 +41292,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 == 349 /* v.ast.ForStmt */) { + else if ((*node._v__ast__Stmt)._typ == 350 /* 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; @@ -41244,7 +41306,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 == 341 /* v.ast.ComptimeFor */) { + else if ((*node._v__ast__Stmt)._typ == 342 /* 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; @@ -41258,13 +41320,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 == 346 /* v.ast.ExprStmt */) { + else if ((*node._v__ast__Stmt)._typ == 347 /* 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 == 337 /* v.ast.AssertStmt */) { + else if ((*node._v__ast__Stmt)._typ == 338 /* 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 == 355 /* v.ast.InterfaceDecl */) { + else if ((*node._v__ast__Stmt)._typ == 356 /* 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; @@ -41288,7 +41350,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 == 338 /* v.ast.AssignStmt */) { + else if ((*node._v__ast__Stmt)._typ == 339 /* 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; @@ -41312,7 +41374,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 == 357 /* v.ast.Return */) { + else if ((*node._v__ast__Stmt)._typ == 358 /* 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; @@ -41326,7 +41388,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 == 359 /* v.ast.StructDecl */) { + else if ((*node._v__ast__Stmt)._typ == 360 /* 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; @@ -41340,7 +41402,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 == 350 /* v.ast.GlobalDecl */) { + else if ((*node._v__ast__Stmt)._typ == 351 /* 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; @@ -41354,7 +41416,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 == 342 /* v.ast.ConstDecl */) { + else if ((*node._v__ast__Stmt)._typ == 343 /* 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; @@ -41368,7 +41430,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 == 345 /* v.ast.EnumDecl */) { + else if ((*node._v__ast__Stmt)._typ == 346 /* 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; @@ -41382,7 +41444,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 == 219 /* v.ast.FnDecl */) { + else if ((*node._v__ast__Stmt)._typ == 220 /* 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) })); } @@ -41409,8 +41471,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 == 283 /* v.ast.TypeDecl */) { - if (((*(*node._v__ast__Stmt)._v__ast__TypeDecl))._typ == 282 /* v.ast.SumTypeDecl */) { + else if ((*node._v__ast__Stmt)._typ == 284 /* v.ast.TypeDecl */) { + if (((*(*node._v__ast__Stmt)._v__ast__TypeDecl))._typ == 283 /* 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; @@ -41428,36 +41490,36 @@ Array_v__ast__Node v__ast__Node_children(v__ast__Node node) { else { } ; - } else if ((node)._typ == 365 /* v.ast.ScopeObject */) { - if ((*node._v__ast__ScopeObject)._typ == 363 /* v.ast.GlobalField */) { + } else if ((node)._typ == 366 /* v.ast.ScopeObject */) { + if ((*node._v__ast__ScopeObject)._typ == 364 /* 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 == 362 /* v.ast.ConstField */) { + else if ((*node._v__ast__ScopeObject)._typ == 363 /* 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 == 364 /* v.ast.Var */) { + else if ((*node._v__ast__ScopeObject)._typ == 365 /* 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 == 361 /* v.ast.AsmRegister */) { + else if ((*node._v__ast__ScopeObject)._typ == 362 /* v.ast.AsmRegister */) { } ; } else { - if (node._typ == 363 /* v.ast.GlobalField */) { + if (node._typ == 364 /* 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 == 362 /* v.ast.ConstField */) { + else if (node._typ == 363 /* 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 == 368 /* v.ast.EnumField */) { + else if (node._typ == 369 /* 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 == 374 /* v.ast.StructInitField */) { + else if (node._typ == 375 /* 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 == 366 /* v.ast.CallArg */) { + else if (node._typ == 367 /* 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 == 372 /* v.ast.SelectBranch */) { + else if (node._typ == 373 /* 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; @@ -41471,7 +41533,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 == 369 /* v.ast.IfBranch */) { + else if (node._typ == 370 /* 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; @@ -41485,7 +41547,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 == 210 /* v.ast.File */) { + else if (node._typ == 211 /* 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; @@ -41499,7 +41561,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 == 370 /* v.ast.MatchBranch */) { + else if (node._typ == 371 /* 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; @@ -41534,7 +41596,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 == 309 /* v.ast.IndexExpr */) { + if ((lx->left)._typ == 310 /* v.ast.IndexExpr */) { if ((*lx->left._v__ast__IndexExpr).is_map) { v__ast__IndexExpr_recursive_mapset_is_setter(&(*lx->left._v__ast__IndexExpr), val); } @@ -41543,10 +41605,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 == 309 /* v.ast.IndexExpr */) { + if ((lx->left)._typ == 310 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*lx->left._v__ast__IndexExpr)); - } else if ((lx->left)._typ == 326 /* v.ast.SelectorExpr */) { - if (((*lx->left._v__ast__SelectorExpr).expr)._typ == 309 /* v.ast.IndexExpr */) { + } else if ((lx->left)._typ == 327 /* v.ast.SelectorExpr */) { + if (((*lx->left._v__ast__SelectorExpr).expr)._typ == 310 /* v.ast.IndexExpr */) { v__ast__IndexExpr_recursive_arraymap_set_is_setter(&(*(*lx->left._v__ast__SelectorExpr).expr._v__ast__IndexExpr)); } } @@ -41598,7 +41660,7 @@ Map_string_v__ast__ScopeObject v__ast__all_registers(v__ast__Table* t, v__pref__ name = string_clone(name); int max_num = (*(int*)DenseArray_value(&_v_array.key_values, _t8)); for (int i = 0; i < max_num; ++i) { - Option_int _t11 = string_index(name, _SLIT("#")); + _option_int _t11 = string_index(name, _SLIT("#")); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; _v_panic(_SLIT("all_registers: no hashtag found")); @@ -41726,7 +41788,7 @@ VV_LOCAL_SYMBOL Map_string_v__ast__ScopeObject v__ast__gen_all_registers(v__ast_ name = string_clone(name); int max_num = (*(int*)DenseArray_value(&with_numbers.key_values, _t2)); for (int i = 0; i < max_num; ++i) { - Option_int _t5 = string_index(name, _SLIT("#")); + _option_int _t5 = string_index(name, _SLIT("#")); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; _v_panic(_SLIT("all_registers: no hashtag found")); @@ -41744,43 +41806,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 == 290 /* v.ast.BoolLiteral */) { + if (expr._typ == 291 /* v.ast.BoolLiteral */) { bool _t1 = true; return _t1; } - else if (expr._typ == 295 /* v.ast.CharLiteral */) { + else if (expr._typ == 296 /* v.ast.CharLiteral */) { bool _t2 = true; return _t2; } - else if (expr._typ == 304 /* v.ast.FloatLiteral */) { + else if (expr._typ == 305 /* v.ast.FloatLiteral */) { bool _t3 = true; return _t3; } - else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 312 /* v.ast.IntegerLiteral */) { bool _t4 = true; return _t4; } - else if (expr._typ == 323 /* v.ast.PrefixExpr */) { + else if (expr._typ == 324 /* v.ast.PrefixExpr */) { bool _t5 = v__ast__Expr_is_literal((*expr._v__ast__PrefixExpr).right); return _t5; } - else if (expr._typ == 310 /* v.ast.InfixExpr */) { + else if (expr._typ == 311 /* 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 == 321 /* v.ast.ParExpr */) { + else if (expr._typ == 322 /* v.ast.ParExpr */) { bool _t7 = v__ast__Expr_is_literal((*expr._v__ast__ParExpr).expr); return _t7; } - else if (expr._typ == 293 /* v.ast.CastExpr */) { + else if (expr._typ == 294 /* 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 == 327 /* v.ast.SizeOf */) { + else if (expr._typ == 328 /* 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 == 312 /* v.ast.IsRefType */) { + else if (expr._typ == 313 /* v.ast.IsRefType */) { bool _t10 = (*expr._v__ast__IsRefType).is_type || v__ast__Expr_is_literal((*expr._v__ast__IsRefType).expr); return _t10; } @@ -41854,15 +41916,15 @@ bool Array_v__ast__Attr_contains(Array_v__ast__Attr attrs, string str) { return _t1; } -Option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs) { +_option_int Array_v__ast__Attr_find_comptime_define(Array_v__ast__Attr attrs) { for (int idx = 0; idx < attrs.len; ++idx) { if ((*(v__ast__Attr*)/*ee elem_sym */array_get(attrs, idx)).kind == v__ast__AttrKind__comptime_define) { - Option_int _t1; - opt_ok(&(int[]) { idx }, (Option*)(&_t1), sizeof(int)); + _option_int _t1; + opt_ok2(&(int[]) { idx }, (_option*)(&_t1), sizeof(int)); return _t1; } } - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL bool v__ast__Table_has_cflag(v__ast__Table* t, v__cflag__CFlag flag) { @@ -41877,13 +41939,13 @@ VV_LOCAL_SYMBOL bool v__ast__Table_has_cflag(v__ast__Table* t, v__cflag__CFlag f return _t3; } -Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines) { +_option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, Array_string ctimedefines) { Array_string allowed_flags = new_array_from_c_array(9, 9, sizeof(string), _MOV((string[9]){ _SLIT("framework"), _SLIT("library"), _SLIT("Wa"), _SLIT("Wl"), _SLIT("Wp"), _SLIT("I"), _SLIT("l"), _SLIT("L"), _SLIT("D")})); string flag_orig = string_trim_space(cflg); string flag = flag_orig; if ((flag).len == 0) { - return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } string fos = _SLIT(""); Array_string allowed_os_overrides = new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){_SLIT("linux"), _SLIT("darwin"), _SLIT("freebsd"), _SLIT("openbsd"), _SLIT("windows"), _SLIT("mingw"), _SLIT("solaris")})); @@ -41893,10 +41955,10 @@ Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, if (!string_starts_with(flag, os_override)) { continue; } - Option_int _t4 = string_index(flag, _SLIT(" ")); + _option_int _t4 = string_index(flag, _SLIT(" ")); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; - return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } int pos = (*(int*)_t4.data); @@ -41917,7 +41979,7 @@ Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, } } } - Option_int _t7 = string_index(flag, _SLIT(" -")); + _option_int _t7 = string_index(flag, _SLIT(" -")); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; *(int*) _t7.data = -1; @@ -41947,7 +42009,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 `"), /*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} }; + 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)) { @@ -41957,8 +42019,8 @@ Option_bool v__ast__Table_parse_cflag(v__ast__Table* t, string cflg, string mod, break; } } - Option_bool _t11; - opt_ok(&(bool[]) { true }, (Option*)(&_t11), sizeof(bool)); + _option_bool _t11; + opt_ok2(&(bool[]) { true }, (_option*)(&_t11), sizeof(bool)); return _t11; } @@ -41968,418 +42030,418 @@ v__ast__ComptTimeConstValue v__ast__empty_comptime_const_expr(void) { return _t1; } -Option_i8 v__ast__ComptTimeConstValue_i8(v__ast__ComptTimeConstValue val) { - Option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); +_option_i8 v__ast__ComptTimeConstValue_i8(v__ast__ComptTimeConstValue val) { + _option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); if (_t1.state != 0) { /*or block*/ - Option_i8 _t2; + _option_i8 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } i64 x = (*(i64*)_t1.data); if (x > -129 && x < 128) { - Option_i8 _t3; - opt_ok(&(i8[]) { ((i8)(x)) }, (Option*)(&_t3), sizeof(i8)); + _option_i8 _t3; + opt_ok2(&(i8[]) { ((i8)(x)) }, (_option*)(&_t3), sizeof(i8)); return _t3; } - return (Option_i8){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i8){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_i16 v__ast__ComptTimeConstValue_i16(v__ast__ComptTimeConstValue val) { - Option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); +_option_i16 v__ast__ComptTimeConstValue_i16(v__ast__ComptTimeConstValue val) { + _option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); if (_t1.state != 0) { /*or block*/ - Option_i16 _t2; + _option_i16 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } i64 x = (*(i64*)_t1.data); if (x > -32769 && x < 32768) { - Option_i16 _t3; - opt_ok(&(i16[]) { ((i16)(x)) }, (Option*)(&_t3), sizeof(i16)); + _option_i16 _t3; + opt_ok2(&(i16[]) { ((i16)(x)) }, (_option*)(&_t3), sizeof(i16)); return _t3; } - return (Option_i16){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i16){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_int v__ast__ComptTimeConstValue_int(v__ast__ComptTimeConstValue val) { - Option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); +_option_int v__ast__ComptTimeConstValue_int(v__ast__ComptTimeConstValue val) { + _option_i64 _t1 = v__ast__ComptTimeConstValue_i64(val); if (_t1.state != 0) { /*or block*/ - Option_int _t2; + _option_int _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } i64 x = (*(i64*)_t1.data); if (x > -2147483649 && x < 2147483648) { - Option_int _t3; - opt_ok(&(int[]) { ((int)(x)) }, (Option*)(&_t3), sizeof(int)); + _option_int _t3; + opt_ok2(&(int[]) { ((int)(x)) }, (_option*)(&_t3), sizeof(int)); return _t3; } - return (Option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_int){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val) { +_option_i64 v__ast__ComptTimeConstValue_i64(v__ast__ComptTimeConstValue val) { if (val._typ == 5 /* i8 */) { - Option_i64 _t1; - opt_ok(&(i64[]) { ((i64)((*val._i8))) }, (Option*)(&_t1), sizeof(i64)); + _option_i64 _t1; + opt_ok2(&(i64[]) { ((i64)((*val._i8))) }, (_option*)(&_t1), sizeof(i64)); return _t1; } else if (val._typ == 6 /* i16 */) { - Option_i64 _t2; - opt_ok(&(i64[]) { ((i64)((*val._i16))) }, (Option*)(&_t2), sizeof(i64)); + _option_i64 _t2; + opt_ok2(&(i64[]) { ((i64)((*val._i16))) }, (_option*)(&_t2), sizeof(i64)); return _t2; } else if (val._typ == 7 /* int */) { - Option_i64 _t3; - opt_ok(&(i64[]) { ((i64)((*val._int))) }, (Option*)(&_t3), sizeof(i64)); + _option_i64 _t3; + opt_ok2(&(i64[]) { ((i64)((*val._int))) }, (_option*)(&_t3), sizeof(i64)); return _t3; } else if (val._typ == 8 /* i64 */) { - Option_i64 _t4; - opt_ok(&(i64[]) { ((i64)((*val._i64))) }, (Option*)(&_t4), sizeof(i64)); + _option_i64 _t4; + opt_ok2(&(i64[]) { ((i64)((*val._i64))) }, (_option*)(&_t4), sizeof(i64)); return _t4; } else if (val._typ == 10 /* u8 */) { - Option_i64 _t5; - opt_ok(&(i64[]) { ((i64)((*val._u8))) }, (Option*)(&_t5), sizeof(i64)); + _option_i64 _t5; + opt_ok2(&(i64[]) { ((i64)((*val._u8))) }, (_option*)(&_t5), sizeof(i64)); return _t5; } else if (val._typ == 11 /* u16 */) { - Option_i64 _t6; - opt_ok(&(i64[]) { ((i64)((*val._u16))) }, (Option*)(&_t6), sizeof(i64)); + _option_i64 _t6; + opt_ok2(&(i64[]) { ((i64)((*val._u16))) }, (_option*)(&_t6), sizeof(i64)); return _t6; } else if (val._typ == 12 /* u32 */) { - Option_i64 _t7; - opt_ok(&(i64[]) { ((i64)((*val._u32))) }, (Option*)(&_t7), sizeof(i64)); + _option_i64 _t7; + opt_ok2(&(i64[]) { ((i64)((*val._u32))) }, (_option*)(&_t7), sizeof(i64)); return _t7; } else if (val._typ == 13 /* u64 */) { if ((*val._u64) <= 9223372036854775807U) { - Option_i64 _t8; - opt_ok(&(i64[]) { ((i64)((*val._u64))) }, (Option*)(&_t8), sizeof(i64)); + _option_i64 _t8; + opt_ok2(&(i64[]) { ((i64)((*val._u64))) }, (_option*)(&_t8), sizeof(i64)); return _t8; } } else if (val._typ == 15 /* f32 */) { if (-9223372036854775808.0 <= (*val._f32) && (*val._f32) <= 9223372036854775807.0) { - Option_i64 _t9; - opt_ok(&(i64[]) { ((i64)((*val._f32))) }, (Option*)(&_t9), sizeof(i64)); + _option_i64 _t9; + opt_ok2(&(i64[]) { ((i64)((*val._f32))) }, (_option*)(&_t9), sizeof(i64)); return _t9; } } else if (val._typ == 16 /* f64 */) { if (-9223372036854775808.0 <= (*val._f64) && (*val._f64) <= 9223372036854775807.0) { - Option_i64 _t10; - opt_ok(&(i64[]) { ((i64)((*val._f64))) }, (Option*)(&_t10), sizeof(i64)); + _option_i64 _t10; + opt_ok2(&(i64[]) { ((i64)((*val._f64))) }, (_option*)(&_t10), sizeof(i64)); return _t10; } } else if (val._typ == 20 /* string */) { - Option_i64 _t11; - opt_ok(&(i64[]) { string_i64((*val._string)) }, (Option*)(&_t11), sizeof(i64)); + _option_i64 _t11; + opt_ok2(&(i64[]) { string_i64((*val._string)) }, (_option*)(&_t11), sizeof(i64)); return _t11; } else if (val._typ == 21 /* rune */) { - Option_i64 _t12; - opt_ok(&(i64[]) { ((int)((*val._rune))) }, (Option*)(&_t12), sizeof(i64)); + _option_i64 _t12; + opt_ok2(&(i64[]) { ((int)((*val._rune))) }, (_option*)(&_t12), sizeof(i64)); return _t12; } - else if (val._typ == 302 /* v.ast.EmptyExpr */) { + else if (val._typ == 303 /* v.ast.EmptyExpr */) { } ; - return (Option_i64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_i64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_u8 v__ast__ComptTimeConstValue_u8(v__ast__ComptTimeConstValue val) { - Option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); +_option_u8 v__ast__ComptTimeConstValue_u8(v__ast__ComptTimeConstValue val) { + _option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); if (_t1.state != 0) { /*or block*/ - Option_u8 _t2; + _option_u8 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } u64 x = (*(u64*)_t1.data); if (x < 256U) { - Option_u8 _t3; - opt_ok(&(u8[]) { ((u8)(x)) }, (Option*)(&_t3), sizeof(u8)); + _option_u8 _t3; + opt_ok2(&(u8[]) { ((u8)(x)) }, (_option*)(&_t3), sizeof(u8)); return _t3; } - return (Option_u8){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u8){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_u16 v__ast__ComptTimeConstValue_u16(v__ast__ComptTimeConstValue val) { - Option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); +_option_u16 v__ast__ComptTimeConstValue_u16(v__ast__ComptTimeConstValue val) { + _option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); if (_t1.state != 0) { /*or block*/ - Option_u16 _t2; + _option_u16 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } u64 x = (*(u64*)_t1.data); if (x < 65536U) { - Option_u16 _t3; - opt_ok(&(u16[]) { ((u16)(x)) }, (Option*)(&_t3), sizeof(u16)); + _option_u16 _t3; + opt_ok2(&(u16[]) { ((u16)(x)) }, (_option*)(&_t3), sizeof(u16)); return _t3; } - return (Option_u16){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u16){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_u32 v__ast__ComptTimeConstValue_u32(v__ast__ComptTimeConstValue val) { - Option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); +_option_u32 v__ast__ComptTimeConstValue_u32(v__ast__ComptTimeConstValue val) { + _option_u64 _t1 = v__ast__ComptTimeConstValue_u64(val); if (_t1.state != 0) { /*or block*/ - Option_u32 _t2; + _option_u32 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } u64 x = (*(u64*)_t1.data); if (x < 4294967296U) { - Option_u32 _t3; - opt_ok(&(u32[]) { ((u32)(x)) }, (Option*)(&_t3), sizeof(u32)); + _option_u32 _t3; + opt_ok2(&(u32[]) { ((u32)(x)) }, (_option*)(&_t3), sizeof(u32)); return _t3; } - return (Option_u32){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u32){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val) { +_option_u64 v__ast__ComptTimeConstValue_u64(v__ast__ComptTimeConstValue val) { if (val._typ == 5 /* i8 */) { if ((*val._i8) >= 0) { - Option_u64 _t1; - opt_ok(&(u64[]) { ((u64)((*val._i8))) }, (Option*)(&_t1), sizeof(u64)); + _option_u64 _t1; + opt_ok2(&(u64[]) { ((u64)((*val._i8))) }, (_option*)(&_t1), sizeof(u64)); return _t1; } } else if (val._typ == 6 /* i16 */) { if ((*val._i16) >= 0) { - Option_u64 _t2; - opt_ok(&(u64[]) { ((u64)((*val._i16))) }, (Option*)(&_t2), sizeof(u64)); + _option_u64 _t2; + opt_ok2(&(u64[]) { ((u64)((*val._i16))) }, (_option*)(&_t2), sizeof(u64)); return _t2; } } else if (val._typ == 7 /* int */) { if ((*val._int) >= 0) { - Option_u64 _t3; - opt_ok(&(u64[]) { ((u64)((*val._int))) }, (Option*)(&_t3), sizeof(u64)); + _option_u64 _t3; + opt_ok2(&(u64[]) { ((u64)((*val._int))) }, (_option*)(&_t3), sizeof(u64)); return _t3; } } else if (val._typ == 8 /* i64 */) { if ((*val._i64) >= 0) { - Option_u64 _t4; - opt_ok(&(u64[]) { ((u64)((*val._i64))) }, (Option*)(&_t4), sizeof(u64)); + _option_u64 _t4; + opt_ok2(&(u64[]) { ((u64)((*val._i64))) }, (_option*)(&_t4), sizeof(u64)); return _t4; } } else if (val._typ == 10 /* u8 */) { - Option_u64 _t5; - opt_ok(&(u64[]) { ((u64)((*val._u8))) }, (Option*)(&_t5), sizeof(u64)); + _option_u64 _t5; + opt_ok2(&(u64[]) { ((u64)((*val._u8))) }, (_option*)(&_t5), sizeof(u64)); return _t5; } else if (val._typ == 11 /* u16 */) { - Option_u64 _t6; - opt_ok(&(u64[]) { ((u64)((*val._u16))) }, (Option*)(&_t6), sizeof(u64)); + _option_u64 _t6; + opt_ok2(&(u64[]) { ((u64)((*val._u16))) }, (_option*)(&_t6), sizeof(u64)); return _t6; } else if (val._typ == 12 /* u32 */) { - Option_u64 _t7; - opt_ok(&(u64[]) { ((u64)((*val._u32))) }, (Option*)(&_t7), sizeof(u64)); + _option_u64 _t7; + opt_ok2(&(u64[]) { ((u64)((*val._u32))) }, (_option*)(&_t7), sizeof(u64)); return _t7; } else if (val._typ == 13 /* u64 */) { - Option_u64 _t8; - opt_ok(&(u64[]) { (*val._u64) }, (Option*)(&_t8), sizeof(u64)); + _option_u64 _t8; + opt_ok2(&(u64[]) { (*val._u64) }, (_option*)(&_t8), sizeof(u64)); return _t8; } else if (val._typ == 15 /* f32 */) { if ((*val._f32) <= 18446744073709551615.0) { - Option_u64 _t9; - opt_ok(&(u64[]) { ((u64)((*val._f32))) }, (Option*)(&_t9), sizeof(u64)); + _option_u64 _t9; + opt_ok2(&(u64[]) { ((u64)((*val._f32))) }, (_option*)(&_t9), sizeof(u64)); return _t9; } } else if (val._typ == 16 /* f64 */) { if ((*val._f64) <= 18446744073709551615.0) { - Option_u64 _t10; - opt_ok(&(u64[]) { ((u64)((*val._f64))) }, (Option*)(&_t10), sizeof(u64)); + _option_u64 _t10; + opt_ok2(&(u64[]) { ((u64)((*val._f64))) }, (_option*)(&_t10), sizeof(u64)); return _t10; } } else if (val._typ == 20 /* string */) { - Option_u64 _t11; - opt_ok(&(u64[]) { string_u64((*val._string)) }, (Option*)(&_t11), sizeof(u64)); + _option_u64 _t11; + opt_ok2(&(u64[]) { string_u64((*val._string)) }, (_option*)(&_t11), sizeof(u64)); return _t11; } else if (val._typ == 21 /* rune */) { } - else if (val._typ == 302 /* v.ast.EmptyExpr */) { + else if (val._typ == 303 /* v.ast.EmptyExpr */) { } ; - return (Option_u64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_u64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_f32 v__ast__ComptTimeConstValue_f32(v__ast__ComptTimeConstValue val) { - Option_f64 _t1 = v__ast__ComptTimeConstValue_f64(val); +_option_f32 v__ast__ComptTimeConstValue_f32(v__ast__ComptTimeConstValue val) { + _option_f64 _t1 = v__ast__ComptTimeConstValue_f64(val); if (_t1.state != 0) { /*or block*/ - Option_f32 _t2; + _option_f32 _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } f64 x = (*(f64*)_t1.data); - Option_f32 _t3; - opt_ok(&(f32[]) { ((f32)(x)) }, (Option*)(&_t3), sizeof(f32)); + _option_f32 _t3; + opt_ok2(&(f32[]) { ((f32)(x)) }, (_option*)(&_t3), sizeof(f32)); return _t3; } -Option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val) { +_option_f64 v__ast__ComptTimeConstValue_f64(v__ast__ComptTimeConstValue val) { if (val._typ == 5 /* i8 */) { - Option_f64 _t1; - opt_ok(&(f64[]) { ((f64)((*val._i8))) }, (Option*)(&_t1), sizeof(f64)); + _option_f64 _t1; + opt_ok2(&(f64[]) { ((f64)((*val._i8))) }, (_option*)(&_t1), sizeof(f64)); return _t1; } else if (val._typ == 6 /* i16 */) { - Option_f64 _t2; - opt_ok(&(f64[]) { ((f64)((*val._i16))) }, (Option*)(&_t2), sizeof(f64)); + _option_f64 _t2; + opt_ok2(&(f64[]) { ((f64)((*val._i16))) }, (_option*)(&_t2), sizeof(f64)); return _t2; } else if (val._typ == 7 /* int */) { - Option_f64 _t3; - opt_ok(&(f64[]) { ((f64)((*val._int))) }, (Option*)(&_t3), sizeof(f64)); + _option_f64 _t3; + opt_ok2(&(f64[]) { ((f64)((*val._int))) }, (_option*)(&_t3), sizeof(f64)); return _t3; } else if (val._typ == 8 /* i64 */) { - Option_f64 _t4; - opt_ok(&(f64[]) { ((f64)((*val._i64))) }, (Option*)(&_t4), sizeof(f64)); + _option_f64 _t4; + opt_ok2(&(f64[]) { ((f64)((*val._i64))) }, (_option*)(&_t4), sizeof(f64)); return _t4; } else if (val._typ == 10 /* u8 */) { - Option_f64 _t5; - opt_ok(&(f64[]) { ((f64)((*val._u8))) }, (Option*)(&_t5), sizeof(f64)); + _option_f64 _t5; + opt_ok2(&(f64[]) { ((f64)((*val._u8))) }, (_option*)(&_t5), sizeof(f64)); return _t5; } else if (val._typ == 11 /* u16 */) { - Option_f64 _t6; - opt_ok(&(f64[]) { ((f64)((*val._u16))) }, (Option*)(&_t6), sizeof(f64)); + _option_f64 _t6; + opt_ok2(&(f64[]) { ((f64)((*val._u16))) }, (_option*)(&_t6), sizeof(f64)); return _t6; } else if (val._typ == 12 /* u32 */) { - Option_f64 _t7; - opt_ok(&(f64[]) { ((f64)((*val._u32))) }, (Option*)(&_t7), sizeof(f64)); + _option_f64 _t7; + opt_ok2(&(f64[]) { ((f64)((*val._u32))) }, (_option*)(&_t7), sizeof(f64)); return _t7; } else if (val._typ == 13 /* u64 */) { - Option_f64 _t8; - opt_ok(&(f64[]) { ((f64)((*val._u64))) }, (Option*)(&_t8), sizeof(f64)); + _option_f64 _t8; + opt_ok2(&(f64[]) { ((f64)((*val._u64))) }, (_option*)(&_t8), sizeof(f64)); return _t8; } else if (val._typ == 15 /* f32 */) { - Option_f64 _t9; - opt_ok(&(f64[]) { ((f64)((*val._f32))) }, (Option*)(&_t9), sizeof(f64)); + _option_f64 _t9; + opt_ok2(&(f64[]) { ((f64)((*val._f32))) }, (_option*)(&_t9), sizeof(f64)); return _t9; } else if (val._typ == 16 /* f64 */) { - Option_f64 _t10; - opt_ok(&(f64[]) { (*val._f64) }, (Option*)(&_t10), sizeof(f64)); + _option_f64 _t10; + opt_ok2(&(f64[]) { (*val._f64) }, (_option*)(&_t10), sizeof(f64)); return _t10; } else if (val._typ == 20 /* string */) { - Option_f64 _t11; - opt_ok(&(f64[]) { string_f64((*val._string)) }, (Option*)(&_t11), sizeof(f64)); + _option_f64 _t11; + opt_ok2(&(f64[]) { string_f64((*val._string)) }, (_option*)(&_t11), sizeof(f64)); return _t11; } else if (val._typ == 21 /* rune */) { } - else if (val._typ == 302 /* v.ast.EmptyExpr */) { + else if (val._typ == 303 /* v.ast.EmptyExpr */) { } ; - return (Option_f64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_f64){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val) { +_option_string v__ast__ComptTimeConstValue_string(v__ast__ComptTimeConstValue val) { if (val._typ == 5 /* i8 */) { - Option_string _t1; - opt_ok(&(string[]) { i8_str((*val._i8)) }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { i8_str((*val._i8)) }, (_option*)(&_t1), sizeof(string)); return _t1; } else if (val._typ == 6 /* i16 */) { - Option_string _t2; - opt_ok(&(string[]) { i16_str((*val._i16)) }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { i16_str((*val._i16)) }, (_option*)(&_t2), sizeof(string)); return _t2; } else if (val._typ == 7 /* int */) { - Option_string _t3; - opt_ok(&(string[]) { int_str((*val._int)) }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { int_str((*val._int)) }, (_option*)(&_t3), sizeof(string)); return _t3; } else if (val._typ == 8 /* i64 */) { - Option_string _t4; - opt_ok(&(string[]) { i64_str((*val._i64)) }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { i64_str((*val._i64)) }, (_option*)(&_t4), sizeof(string)); return _t4; } else if (val._typ == 10 /* u8 */) { - Option_string _t5; - opt_ok(&(string[]) { u8_str((*val._u8)) }, (Option*)(&_t5), sizeof(string)); + _option_string _t5; + opt_ok2(&(string[]) { u8_str((*val._u8)) }, (_option*)(&_t5), sizeof(string)); return _t5; } else if (val._typ == 11 /* u16 */) { - Option_string _t6; - opt_ok(&(string[]) { u16_str((*val._u16)) }, (Option*)(&_t6), sizeof(string)); + _option_string _t6; + opt_ok2(&(string[]) { u16_str((*val._u16)) }, (_option*)(&_t6), sizeof(string)); return _t6; } else if (val._typ == 12 /* u32 */) { - Option_string _t7; - opt_ok(&(string[]) { u32_str((*val._u32)) }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { u32_str((*val._u32)) }, (_option*)(&_t7), sizeof(string)); return _t7; } else if (val._typ == 13 /* u64 */) { - Option_string _t8; - opt_ok(&(string[]) { u64_str((*val._u64)) }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(string[]) { u64_str((*val._u64)) }, (_option*)(&_t8), sizeof(string)); return _t8; } else if (val._typ == 15 /* f32 */) { - Option_string _t9; - opt_ok(&(string[]) { f32_str((*val._f32)) }, (Option*)(&_t9), sizeof(string)); + _option_string _t9; + opt_ok2(&(string[]) { f32_str((*val._f32)) }, (_option*)(&_t9), sizeof(string)); return _t9; } else if (val._typ == 16 /* f64 */) { - Option_string _t10; - opt_ok(&(string[]) { f64_str((*val._f64)) }, (Option*)(&_t10), sizeof(string)); + _option_string _t10; + opt_ok2(&(string[]) { f64_str((*val._f64)) }, (_option*)(&_t10), sizeof(string)); return _t10; } else if (val._typ == 21 /* rune */) { - Option_string _t11; - opt_ok(&(string[]) { rune_str((*val._rune)) }, (Option*)(&_t11), sizeof(string)); + _option_string _t11; + opt_ok2(&(string[]) { rune_str((*val._rune)) }, (_option*)(&_t11), sizeof(string)); return _t11; } else if (val._typ == 20 /* string */) { - Option_string _t12; - opt_ok(&(string[]) { (*val._string) }, (Option*)(&_t12), sizeof(string)); + _option_string _t12; + opt_ok2(&(string[]) { (*val._string) }, (_option*)(&_t12), sizeof(string)); return _t12; } - else if (val._typ == 302 /* v.ast.EmptyExpr */) { + else if (val._typ == 303 /* v.ast.EmptyExpr */) { } ; - return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + 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 != 302 /* v.ast.EmptyExpr */) { - Option_v__ast__ComptTimeConstValue _t1; - opt_ok(&(v__ast__ComptTimeConstValue[]) { obj->comptime_expr_value }, (Option*)(&_t1), sizeof(v__ast__ComptTimeConstValue)); +_option_v__ast__ComptTimeConstValue v__ast__ConstField_comptime_expr_value(v__ast__ConstField* obj) { + if ((obj->comptime_expr_value)._typ != 303 /* v.ast.EmptyExpr */) { + _option_v__ast__ComptTimeConstValue _t1; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { obj->comptime_expr_value }, (_option*)(&_t1), sizeof(v__ast__ComptTimeConstValue)); return _t1; } - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__ConstField_is_simple_define_const(v__ast__ConstField* obj) { - 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)); + bool _t1 = ((obj->expr._typ == 296 /* v.ast.CharLiteral */) ? (true) : (obj->expr._typ == 305 /* v.ast.FloatLiteral */) ? (true) : (obj->expr._typ == 312 /* v.ast.IntegerLiteral */) ? (true) : (false)); return _t1; } bool v__ast__ScopeObject_is_simple_define_const(v__ast__ScopeObject obj) { - if ((obj)._typ == 362 /* v.ast.ConstField */) { + if ((obj)._typ == 363 /* v.ast.ConstField */) { bool _t1 = v__ast__ConstField_is_simple_define_const(&(*obj._v__ast__ConstField)); return _t1; } @@ -42395,7 +42457,7 @@ u64 v__ast__EmbeddedFile_hash(v__ast__EmbeddedFile e) { 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, name: v.ast.Array */ ; bool has_len = false; bool has_cap = false; bool has_default = false; @@ -42445,7 +42507,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, 452) /*expected idx: 452, 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, 453) /*expected idx: 453, 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) { @@ -42478,24 +42540,24 @@ VV_LOCAL_SYMBOL bool v__ast__Scope_dont_lookup_parent(v__ast__Scope* s) { return _t1; } -Option_v__ast__ScopeObject v__ast__Scope_find(v__ast__Scope* s, string name) { +_option_v__ast__ScopeObject v__ast__Scope_find(v__ast__Scope* s, string name) { for (v__ast__Scope* sc = s; true; sc = sc->parent) { if (_IN_MAP(ADDR(string, name), ADDR(map, sc->objects))) { - Option_v__ast__ScopeObject _t1; - opt_ok(&(v__ast__ScopeObject[]) { (*(v__ast__ScopeObject*)map_get(ADDR(map, sc->objects), &(string[]){name}, &(v__ast__ScopeObject[]){ {0} })) }, (Option*)(&_t1), sizeof(v__ast__ScopeObject)); + _option_v__ast__ScopeObject _t1; + opt_ok2(&(v__ast__ScopeObject[]) { (*(v__ast__ScopeObject*)map_get(ADDR(map, sc->objects), &(string[]){name}, &(v__ast__ScopeObject[]){ {0} })) }, (_option*)(&_t1), sizeof(v__ast__ScopeObject)); return _t1; } if (v__ast__Scope_dont_lookup_parent(sc)) { break; } } - return (Option_v__ast__ScopeObject){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ScopeObject){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s, string name, v__ast__Type struct_type, string field_name) { +_option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s, string name, v__ast__Type struct_type, string field_name) { for (v__ast__Scope* sc = s; true; sc = sc->parent) { v__ast__ScopeStructField* _t2 = (v__ast__ScopeStructField*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, sc->struct_fields), &(string[]){name})); - Option_v__ast__ScopeStructField _t1 = {0}; + _option_v__ast__ScopeStructField _t1 = {0}; if (_t2) { *((v__ast__ScopeStructField*)&_t1.data) = *((v__ast__ScopeStructField*)_t2); } else { @@ -42505,8 +42567,8 @@ Option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s if (_t1.state == 0) { v__ast__ScopeStructField field = *(v__ast__ScopeStructField*)_t1.data; if (v__ast__Type_alias_eq(field.struct_type, struct_type) && string__eq(field.name, field_name)) { - Option_v__ast__ScopeStructField _t3; - opt_ok(&(v__ast__ScopeStructField[]) { field }, (Option*)(&_t3), sizeof(v__ast__ScopeStructField)); + _option_v__ast__ScopeStructField _t3; + opt_ok2(&(v__ast__ScopeStructField[]) { field }, (_option*)(&_t3), sizeof(v__ast__ScopeStructField)); return _t3; } } @@ -42514,16 +42576,16 @@ Option_v__ast__ScopeStructField v__ast__Scope_find_struct_field(v__ast__Scope* s break; } } - return (Option_v__ast__ScopeStructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ScopeStructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name) { - Option_v__ast__ScopeObject _t1; +_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 == 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*)); + if ((*(obj))._typ == 365 /* v.ast.Var */) { + _option_v__ast__Var_ptr _t2; + opt_ok2(&(v__ast__Var*[]) { &(*((obj->_v__ast__Var))) }, (_option*)(&_t2), sizeof(v__ast__Var*)); return _t2; } @@ -42531,16 +42593,16 @@ Option_v__ast__Var_ptr v__ast__Scope_find_var(v__ast__Scope* s, string name) { } ; } - return (Option_v__ast__Var_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Var_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, string name) { - Option_v__ast__ScopeObject _t1; +_option_v__ast__GlobalField_ptr v__ast__Scope_find_global(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.GlobalField */) { - Option_v__ast__GlobalField_ptr _t2; - opt_ok(&(v__ast__GlobalField*[]) { &(*((obj->_v__ast__GlobalField))) }, (Option*)(&_t2), sizeof(v__ast__GlobalField*)); + if ((*(obj))._typ == 364 /* v.ast.GlobalField */) { + _option_v__ast__GlobalField_ptr _t2; + opt_ok2(&(v__ast__GlobalField*[]) { &(*((obj->_v__ast__GlobalField))) }, (_option*)(&_t2), sizeof(v__ast__GlobalField*)); return _t2; } @@ -42548,16 +42610,16 @@ Option_v__ast__GlobalField_ptr v__ast__Scope_find_global(v__ast__Scope* s, strin } ; } - return (Option_v__ast__GlobalField_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__GlobalField_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string name) { - Option_v__ast__ScopeObject _t1; +_option_v__ast__ConstField_ptr v__ast__Scope_find_const(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 == 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*)); + if ((*(obj))._typ == 363 /* v.ast.ConstField */) { + _option_v__ast__ConstField_ptr _t2; + opt_ok2(&(v__ast__ConstField*[]) { &(*((obj->_v__ast__ConstField))) }, (_option*)(&_t2), sizeof(v__ast__ConstField*)); return _t2; } @@ -42565,11 +42627,11 @@ Option_v__ast__ConstField_ptr v__ast__Scope_find_const(v__ast__Scope* s, string } ; } - return (Option_v__ast__ConstField_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ConstField_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__Scope_known_var(v__ast__Scope* s, string name) { - Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(s, name); + _option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(s, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -42582,7 +42644,7 @@ bool v__ast__Scope_known_var(v__ast__Scope* s, string name) { } bool v__ast__Scope_known_const(v__ast__Scope* s, string name) { - Option_v__ast__ConstField_ptr _t1 = v__ast__Scope_find_const(s, name); + _option_v__ast__ConstField_ptr _t1 = v__ast__Scope_find_const(s, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -42596,7 +42658,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 == 364 /* v.ast.Var */) { + if ((obj)._typ == 365 /* v.ast.Var */) { if (!v__ast__Type_alias_eq((*obj._v__ast__Var).typ, typ)) { (*obj._v__ast__Var).typ = typ; } @@ -42605,7 +42667,7 @@ void v__ast__Scope_update_var_type(v__ast__Scope* s, string name, v__ast__Type t void v__ast__Scope_register_struct_field(v__ast__Scope* s, string name, v__ast__ScopeStructField field) { v__ast__ScopeStructField* _t2 = (v__ast__ScopeStructField*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, s->struct_fields), &(string[]){name})); - Option_v__ast__ScopeStructField _t1 = {0}; + _option_v__ast__ScopeStructField _t1 = {0}; if (_t2) { *((v__ast__ScopeStructField*)&_t1.data) = *((v__ast__ScopeStructField*)_t2); } else { @@ -42674,7 +42736,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 == 364 /* v.ast.Var */) { + if ((obj)._typ == 365 /* v.ast.Var */) { if ((*obj._v__ast__Var).is_inherited) { bool _t5 = true; return _t5; @@ -42704,10 +42766,10 @@ 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 == 362 /* v.ast.ConstField */) { + if (obj._typ == 363 /* 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 == 364 /* v.ast.Var */) { + else if (obj._typ == 365 /* 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 }}}))); } @@ -42840,7 +42902,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 == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* 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; @@ -42961,24 +43023,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 == 306 /* v.ast.Ident */) { + if (sub_expr._typ == 307 /* v.ast.Ident */) { if (string_at((*sub_expr._v__ast__Ident).name, 0) == '@') { needs_braces = true; } break; } - else if (sub_expr._typ == 292 /* v.ast.CallExpr */) { + else if (sub_expr._typ == 293 /* 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 == 292 /* v.ast.CallExpr */) { + } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 293 /* v.ast.CallExpr */) { sub_expr = (*sub_expr._v__ast__CallExpr).left; continue; - } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 293 /* v.ast.CastExpr */ || ((*sub_expr._v__ast__CallExpr).left)._typ == 309 /* v.ast.IndexExpr */) { + } else if (((*sub_expr._v__ast__CallExpr).left)._typ == 294 /* v.ast.CastExpr */ || ((*sub_expr._v__ast__CallExpr).left)._typ == 310 /* v.ast.IndexExpr */) { needs_braces = true; } break; } - else if (sub_expr._typ == 326 /* v.ast.SelectorExpr */) { + else if (sub_expr._typ == 327 /* v.ast.SelectorExpr */) { if (string_at((*sub_expr._v__ast__SelectorExpr).field_name, 0) == '@') { needs_braces = true; break; @@ -43016,19 +43078,19 @@ multi_return_string_bool v__ast__StringInterLiteral_get_fspec_braces(v__ast__Str } string v__ast__Expr_str(v__ast__Expr x) { - if (x._typ == 284 /* v.ast.AnonFn */) { + if (x._typ == 285 /* v.ast.AnonFn */) { string _t1 = _SLIT("anon_fn"); return _t1; } - else if (x._typ == 299 /* v.ast.ComptimeType */) { + else if (x._typ == 300 /* v.ast.ComptimeType */) { string _t2 = v__ast__ComptimeType_str((*x._v__ast__ComptimeType)); return _t2; } - else if (x._typ == 301 /* v.ast.DumpExpr */) { + else if (x._typ == 302 /* 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 == 286 /* v.ast.ArrayInit */) { + else if (x._typ == 287 /* 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: "), /*115 &string*/0xfe10, {.d_s = v__ast__Expr_str((*x._v__ast__ArrayInit).len_expr)}}, {_SLIT0, 0, { .d_c = 0 }}}))) })); @@ -43047,27 +43109,27 @@ string v__ast__Expr_str(v__ast__Expr x) { return _t8; } } - else if (x._typ == 287 /* v.ast.AsCast */) { + else if (x._typ == 288 /* 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 == 289 /* v.ast.AtExpr */) { + else if (x._typ == 290 /* 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 == 291 /* v.ast.CTempVar */) { + else if (x._typ == 292 /* v.ast.CTempVar */) { string _t11 = v__ast__Expr_str((*x._v__ast__CTempVar).orig); return _t11; } - else if (x._typ == 290 /* v.ast.BoolLiteral */) { + else if (x._typ == 291 /* v.ast.BoolLiteral */) { string _t12 = bool_str((*x._v__ast__BoolLiteral).val); return _t12; } - else if (x._typ == 293 /* v.ast.CastExpr */) { + else if (x._typ == 294 /* 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 == 292 /* v.ast.CallExpr */) { + else if (x._typ == 293 /* 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_option ? (_SLIT(" ?")) : (_SLIT(""))); if ((*x._v__ast__CallExpr).is_method) { @@ -43089,11 +43151,11 @@ string v__ast__Expr_str(v__ast__Expr x) { 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 == 295 /* v.ast.CharLiteral */) { + else if (x._typ == 296 /* 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 == 296 /* v.ast.Comment */) { + else if (x._typ == 297 /* 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("/* "), /*100 &int*/0xfe07, {.d_i32 = lines.len}}, {_SLIT(" lines comment */"), 0, { .d_c = 0 }}})); @@ -43104,11 +43166,11 @@ string v__ast__Expr_str(v__ast__Expr x) { return _t21; } } - else if (x._typ == 298 /* v.ast.ComptimeSelector */) { + else if (x._typ == 299 /* 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 == 300 /* v.ast.ConcatExpr */) { + else if (x._typ == 301 /* v.ast.ConcatExpr */) { Array_string _t24 = {0}; Array_v__ast__Expr _t24_orig = (*x._v__ast__ConcatExpr).vals; int _t24_len = _t24_orig.len; @@ -43122,27 +43184,27 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t23 = Array_string_join(_t24, _SLIT(",")); return _t23; } - else if (x._typ == 303 /* v.ast.EnumVal */) { + else if (x._typ == 304 /* 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 == 304 /* v.ast.FloatLiteral */) { + else if (x._typ == 305 /* v.ast.FloatLiteral */) { string _t27 = (*x._v__ast__FloatLiteral).val; return _t27; } - else if (x._typ == 311 /* v.ast.IntegerLiteral */) { + else if (x._typ == 312 /* v.ast.IntegerLiteral */) { string _t28 = (*x._v__ast__IntegerLiteral).val; return _t28; } - else if (x._typ == 305 /* v.ast.GoExpr */) { + else if (x._typ == 306 /* 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 == 306 /* v.ast.Ident */) { + else if (x._typ == 307 /* v.ast.Ident */) { string _t30 = (*x._v__ast__Ident).name; return _t30; } - else if (x._typ == 307 /* v.ast.IfExpr */) { + else if (x._typ == 308 /* 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) { @@ -43162,15 +43224,15 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t36 = Array_string_join(parts, _SLIT("")); return _t36; } - else if (x._typ == 309 /* v.ast.IndexExpr */) { + else if (x._typ == 310 /* 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 == 310 /* v.ast.InfixExpr */) { + else if (x._typ == 311 /* 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 == 315 /* v.ast.MapInit */) { + else if (x._typ == 316 /* 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]; @@ -43180,11 +43242,11 @@ string v__ast__Expr_str(v__ast__Expr x) { 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 == 321 /* v.ast.ParExpr */) { + else if (x._typ == 322 /* 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 == 322 /* v.ast.PostfixExpr */) { + else if (x._typ == 323 /* v.ast.PostfixExpr */) { if ((*x._v__ast__PostfixExpr).op == v__token__Kind__question) { 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; @@ -43192,11 +43254,11 @@ string v__ast__Expr_str(v__ast__Expr x) { 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 == 323 /* v.ast.PrefixExpr */) { + else if (x._typ == 324 /* 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 == 324 /* v.ast.RangeExpr */) { + else if (x._typ == 325 /* v.ast.RangeExpr */) { string s = _SLIT(".."); if ((*x._v__ast__RangeExpr).has_low) { 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); @@ -43207,15 +43269,15 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t45 = s; return _t45; } - else if (x._typ == 325 /* v.ast.SelectExpr */) { + else if (x._typ == 326 /* v.ast.SelectExpr */) { string _t46 = _SLIT("ast.SelectExpr"); return _t46; } - else if (x._typ == 326 /* v.ast.SelectorExpr */) { + else if (x._typ == 327 /* 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 == 327 /* v.ast.SizeOf */) { + else if (x._typ == 328 /* v.ast.SizeOf */) { if ((*x._v__ast__SizeOf).is_type) { 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; @@ -43223,11 +43285,11 @@ string v__ast__Expr_str(v__ast__Expr x) { 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 == 319 /* v.ast.OffsetOf */) { + else if (x._typ == 320 /* 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 == 329 /* v.ast.StringInterLiteral */) { + else if (x._typ == 330 /* 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) { @@ -43253,35 +43315,35 @@ string v__ast__Expr_str(v__ast__Expr x) { string _t51 = strings__Builder_str(&res); return _t51; } - else if (x._typ == 330 /* v.ast.StringLiteral */) { + else if (x._typ == 331 /* 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 == 332 /* v.ast.TypeNode */) { + else if (x._typ == 333 /* 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 == 333 /* v.ast.TypeOf */) { + else if (x._typ == 334 /* 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 == 313 /* v.ast.Likely */) { + else if (x._typ == 314 /* 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 == 334 /* v.ast.UnsafeExpr */) { + else if (x._typ == 335 /* 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 == 318 /* v.ast.None */) { + else if (x._typ == 319 /* v.ast.None */) { string _t57 = _SLIT("none"); return _t57; } - else if (x._typ == 312 /* v.ast.IsRefType */) { + else if (x._typ == 313 /* 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 == 308 /* v.ast.IfGuardExpr */) { + else if (x._typ == 309 /* 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]; @@ -43293,48 +43355,48 @@ 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 == 331 /* v.ast.StructInit */) { + else if (x._typ == 332 /* 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, /*115 &string*/0xfe10, {.d_s = sname}}, {_SLIT("{....}"), 0, { .d_c = 0 }}})); return _t60; } - else if (x._typ == 285 /* v.ast.ArrayDecompose */) { + else if (x._typ == 286 /* v.ast.ArrayDecompose */) { string _t61 = _SLIT("ast.ArrayDecompose"); return _t61; } - else if (x._typ == 288 /* v.ast.Assoc */) { + else if (x._typ == 289 /* v.ast.Assoc */) { string _t62 = _SLIT("ast.Assoc"); return _t62; } - else if (x._typ == 294 /* v.ast.ChanInit */) { + else if (x._typ == 295 /* v.ast.ChanInit */) { string _t63 = _SLIT("ast.ChanInit"); return _t63; } - else if (x._typ == 297 /* v.ast.ComptimeCall */) { + else if (x._typ == 298 /* v.ast.ComptimeCall */) { string _t64 = _SLIT("ast.ComptimeCall"); return _t64; } - else if (x._typ == 302 /* v.ast.EmptyExpr */) { + else if (x._typ == 303 /* v.ast.EmptyExpr */) { string _t65 = _SLIT("ast.EmptyExpr"); return _t65; } - else if (x._typ == 314 /* v.ast.LockExpr */) { + else if (x._typ == 315 /* v.ast.LockExpr */) { string _t66 = _SLIT("ast.LockExpr"); return _t66; } - else if (x._typ == 316 /* v.ast.MatchExpr */) { + else if (x._typ == 317 /* v.ast.MatchExpr */) { string _t67 = _SLIT("ast.MatchExpr"); return _t67; } - else if (x._typ == 317 /* v.ast.NodeError */) { + else if (x._typ == 318 /* v.ast.NodeError */) { string _t68 = _SLIT("ast.NodeError"); return _t68; } - else if (x._typ == 320 /* v.ast.OrExpr */) { + else if (x._typ == 321 /* v.ast.OrExpr */) { string _t69 = _SLIT("ast.OrExpr"); return _t69; } - else if (x._typ == 328 /* v.ast.SqlExpr */) { + else if (x._typ == 329 /* v.ast.SqlExpr */) { string _t70 = _SLIT("ast.SqlExpr"); return _t70; } @@ -43372,15 +43434,15 @@ string v__ast__BranchStmt_str(v__ast__BranchStmt* node) { } string v__ast__Stmt_str(v__ast__Stmt node) { - if (node._typ == 337 /* v.ast.AssertStmt */) { + if (node._typ == 338 /* 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 == 338 /* v.ast.AssignStmt */) { + else if (node._typ == 339 /* 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 == 306 /* v.ast.Ident */) { + if ((left)._typ == 307 /* 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 ")); @@ -43402,11 +43464,11 @@ string v__ast__Stmt_str(v__ast__Stmt node) { string _t2 = out; return _t2; } - else if (node._typ == 340 /* v.ast.BranchStmt */) { + else if (node._typ == 341 /* v.ast.BranchStmt */) { string _t3 = v__ast__BranchStmt_str(&(*node._v__ast__BranchStmt)); return _t3; } - else if (node._typ == 342 /* v.ast.ConstDecl */) { + else if (node._typ == 343 /* v.ast.ConstDecl */) { Array_string _t4 = {0}; Array_v__ast__ConstField _t4_orig = (*node._v__ast__ConstDecl).fields; int _t4_len = _t4_orig.len; @@ -43421,23 +43483,23 @@ string v__ast__Stmt_str(v__ast__Stmt node) { 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 == 346 /* v.ast.ExprStmt */) { + else if (node._typ == 347 /* v.ast.ExprStmt */) { string _t7 = v__ast__Expr_str((*node._v__ast__ExprStmt).expr); return _t7; } - else if (node._typ == 219 /* v.ast.FnDecl */) { + else if (node._typ == 220 /* 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 == 345 /* v.ast.EnumDecl */) { + else if (node._typ == 346 /* 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 == 356 /* v.ast.Module */) { + else if (node._typ == 357 /* 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 == 354 /* v.ast.Import */) { + else if (node._typ == 355 /* 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 "), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__Import).alias}}, {_SLIT0, 0, { .d_c = 0 }}}))); @@ -43445,7 +43507,7 @@ string v__ast__Stmt_str(v__ast__Stmt node) { string _t11 = out; return _t11; } - else if (node._typ == 359 /* v.ast.StructDecl */) { + else if (node._typ == 360 /* 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; } @@ -43690,9 +43752,9 @@ string v__ast__Table_is_same_method(v__ast__Table* t, v__ast__Fn* f, v__ast__Fn* return _t6; } -Option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name) { +_option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name) { v__ast__Fn* _t2 = (v__ast__Fn*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, t->fns), &(string[]){name})); - Option_v__ast__Fn _t1 = {0}; + _option_v__ast__Fn _t1 = {0}; if (_t2) { *((v__ast__Fn*)&_t1.data) = *((v__ast__Fn*)_t2); } else { @@ -43701,15 +43763,15 @@ Option_v__ast__Fn v__ast__Table_find_fn(v__ast__Table* t, string name) { if (_t1.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t1.data; - Option_v__ast__Fn _t3; - opt_ok(&(v__ast__Fn[]) { f }, (Option*)(&_t3), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t3; + opt_ok2(&(v__ast__Fn[]) { f }, (_option*)(&_t3), sizeof(v__ast__Fn)); return _t3; } - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__Table_known_fn(v__ast__Table* t, string name) { - Option_v__ast__Fn _t1 = v__ast__Table_find_fn(t, name); + _option_v__ast__Fn _t1 = v__ast__Table_find_fn(t, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -43727,7 +43789,7 @@ void v__ast__Table_mark_module_as_deprecated(v__ast__Table* t, string mname, str } void v__ast__Table_mark_module_as_deprecated_after(v__ast__Table* t, string mname, string after_date) { - Option_time__Time _t1 = time__parse_iso8601(after_date); + _option_time__Time _t1 = time__parse_iso8601(after_date); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(time__Time*) _t1.data = time__now(); @@ -43753,38 +43815,38 @@ int v__ast__TypeSymbol_register_method(v__ast__TypeSymbol* t, v__ast__Fn new_fn) return _t2; } -Option_v__ast__Fn v__ast__Table_register_aggregate_method(v__ast__Table* t, v__ast__TypeSymbol* sym, string name) { +_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: "), /*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, 469) /*expected idx: 469, name: v.ast.Aggregate */ ; + v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Aggregate */ ; bool found_once = false; v__ast__Fn new_fn = ((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}); for (int _t1 = 0; _t1 < agg_info.types.len; ++_t1) { v__ast__Type typ = ((v__ast__Type*)agg_info.types.data)[_t1]; v__ast__TypeSymbol* ts = v__ast__Table_sym(t, typ); - Option_v__ast__Fn _t2; + _option_v__ast__Fn _t2; if (_t2 = v__ast__TypeSymbol_find_method(ts, name), _t2.state == 0) { v__ast__Fn type_method = *(v__ast__Fn*)_t2.data; if (!found_once) { 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 `"), /*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} }; + 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: `"), /*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} }; + 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); - Option_v__ast__Fn _t5; - opt_ok(&(v__ast__Fn[]) { new_fn }, (Option*)(&_t5), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t5; + opt_ok2(&(v__ast__Fn[]) { new_fn }, (_option*)(&_t5), sizeof(v__ast__Fn)); return _t5; } bool v__ast__Table_has_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { - Option_v__ast__Fn _t1 = v__ast__Table_find_method(t, s, name); + _option_v__ast__Fn _t1 = v__ast__Table_find_method(t, s, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -43796,18 +43858,18 @@ bool v__ast__Table_has_method(v__ast__Table* t, v__ast__TypeSymbol* s, string na return _t3; } -Option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { +_option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { v__ast__TypeSymbol* ts = s; for (;;) { - Option_v__ast__Fn _t1; + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method(ts, name), _t1.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t1.data; - Option_v__ast__Fn _t2; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t2), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t2; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t2), sizeof(v__ast__Fn)); return _t2; } if (ts->kind == v__ast__Kind__aggregate) { - Option_v__ast__Fn _t3 = v__ast__Table_register_aggregate_method(t, ts, name); + _option_v__ast__Fn _t3 = v__ast__Table_register_aggregate_method(t, ts, name); return _t3; } if (ts->parent_idx == 0) { @@ -43815,13 +43877,13 @@ Option_v__ast__Fn v__ast__Table_find_method(v__ast__Table* t, v__ast__TypeSymbol } ts = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, ts->parent_idx)); } - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } 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 == 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 */) { + v__ast__TypeSymbol* unalias_sym = ((sym->info)._typ == 472 /* v.ast.Alias */ ? (v__ast__Table_sym(t, (*sym->info._v__ast__Alias).parent_type)) : (sym)); + if ((unalias_sym->info)._typ == 457 /* 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); @@ -43837,21 +43899,21 @@ Array_Array_v__ast__Type v__ast__Table_get_embeds(v__ast__Table* t, v__ast__Type return _t5; } -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 == 456 /* v.ast.Struct */) { +_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 == 457 /* 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) { 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); - Option_v__ast__Fn _t2; + _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_method(t, embed_sym, method_name), _t2.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t2.data; array_push((array*)&found_methods, _MOV((v__ast__Fn[]){ m })); array_push((array*)&embed_of_found_methods, _MOV((v__ast__Type[]){ embed })); } else { IError err = _t2.err; - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t5 = v__ast__Table_find_method_from_embeds(t, embed_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t5 = v__ast__Table_find_method_from_embeds(t, embed_sym, method_name); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; continue; @@ -43866,26 +43928,26 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from } } if (found_methods.len == 1) { - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t9; - 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)); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t9; + opt_ok2(&(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 `"), /*115 &string*/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 == 474 /* v.ast.Interface */) { + } else if ((sym->info)._typ == 475 /* 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) { v__ast__Type embed = ((v__ast__Type*)(*sym->info._v__ast__Interface).embeds.data)[_t11]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(t, embed); - Option_v__ast__Fn _t12; + _option_v__ast__Fn _t12; if (_t12 = v__ast__Table_find_method(t, embed_sym, method_name), _t12.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t12.data; array_push((array*)&found_methods, _MOV((v__ast__Fn[]){ m })); array_push((array*)&embed_of_found_methods, _MOV((v__ast__Type[]){ embed })); } else { IError err = _t12.err; - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t15 = v__ast__Table_find_method_from_embeds(t, embed_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t15 = v__ast__Table_find_method_from_embeds(t, embed_sym, method_name); if (_t15.state != 0) { /*or block*/ IError err = _t15.err; continue; @@ -43900,17 +43962,17 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from } } if (found_methods.len == 1) { - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t19; - 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)); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t19; + opt_ok2(&(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 `"), /*115 &string*/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 == 469 /* v.ast.Aggregate */) { + } else if ((sym->info)._typ == 470 /* 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); - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t22 = v__ast__Table_find_method_from_embeds(t, agg_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t22 = v__ast__Table_find_method_from_embeds(t, agg_sym, method_name); if (_t22.state != 0) { /*or block*/ IError err = _t22.err; continue; @@ -43920,43 +43982,43 @@ Option_multi_return_v__ast__Fn_Array_v__ast__Type v__ast__Table_find_method_from v__ast__Fn method = mr_13582.arg0; Array_v__ast__Type embed_types = mr_13582.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)); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t23; + opt_ok2(&(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)); return _t23; } } } - return (Option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_v__ast__Fn_Array_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name) { - Option_v__ast__Fn _t1; +_option_v__ast__Fn v__ast__Table_find_method_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string method_name) { + _option_v__ast__Fn _t1; if (_t1 = v__ast__Table_find_method(t, sym, method_name), _t1.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t1.data; - Option_v__ast__Fn _t2; - opt_ok(&(v__ast__Fn[]) { func }, (Option*)(&_t2), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t2; + opt_ok2(&(v__ast__Fn[]) { func }, (_option*)(&_t2), sizeof(v__ast__Fn)); return _t2; } else { IError err = _t1.err; IError first_err = err; - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t3 = v__ast__Table_find_method_from_embeds(t, sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t3 = v__ast__Table_find_method_from_embeds(t, sym, method_name); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_v__ast__Fn){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; } multi_return_v__ast__Fn_Array_v__ast__Type mr_14043 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t3.data); v__ast__Fn func = mr_14043.arg0; - Option_v__ast__Fn _t5; - opt_ok(&(v__ast__Fn[]) { func }, (Option*)(&_t5), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t5; + opt_ok2(&(v__ast__Fn[]) { func }, (_option*)(&_t5), sizeof(v__ast__Fn)); return _t5; } - return (Option_v__ast__Fn){0}; + return (_option_v__ast__Fn){0}; } 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 == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* 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); @@ -43968,39 +44030,39 @@ Array_v__ast__Fn v__ast__Table_get_embed_methods(v__ast__Table* t, v__ast__TypeS return _t4; } -VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Table_register_aggregate_field(v__ast__Table* t, v__ast__TypeSymbol* sym, string name) { +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: "), /*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, 469) /*expected idx: 469, name: v.ast.Aggregate */ ; + v__ast__Aggregate agg_info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Aggregate */ ; bool found_once = false; v__ast__StructField new_field = ((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}); for (int _t1 = 0; _t1 < agg_info.types.len; ++_t1) { v__ast__Type typ = ((v__ast__Type*)agg_info.types.data)[_t1]; v__ast__TypeSymbol* ts = v__ast__Table_sym(t, typ); - Option_v__ast__StructField _t2; + _option_v__ast__StructField _t2; if (_t2 = v__ast__Table_find_field(t, ts, name), _t2.state == 0) { v__ast__StructField type_field = *(v__ast__StructField*)_t2.data; if (!found_once) { 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 `"), /*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} }; + 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.comments,new_field.attrs,new_field.default_val,new_field.default_expr,new_field.name,new_field.pos,new_field.type_pos,new_field.i,new_field.default_expr_typ,new_field.typ,new_field.has_default_expr,.is_pub = new_field.is_pub && type_field.is_pub,.is_mut = new_field.is_mut && type_field.is_mut,new_field.is_global,new_field.is_volatile,}); } else { IError err = _t2.err; - 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} }; + 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 })); - Option_v__ast__StructField _t6; - opt_ok(&(v__ast__StructField[]) { new_field }, (Option*)(&_t6), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t6; + opt_ok2(&(v__ast__StructField[]) { new_field }, (_option*)(&_t6), sizeof(v__ast__StructField)); return _t6; } bool v__ast__Table_struct_has_field(v__ast__Table* t, v__ast__TypeSymbol* struct_, string name) { - Option_v__ast__StructField _t1 = v__ast__Table_find_field(t, struct_, name); + _option_v__ast__StructField _t1 = v__ast__Table_find_field(t, struct_, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -44014,7 +44076,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 == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* 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]; @@ -44026,56 +44088,56 @@ Array_v__ast__StructField v__ast__Table_struct_fields(v__ast__Table* t, v__ast__ return _t4; } -Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__TypeSymbol* s, string name) { +_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 == 456 /* v.ast.Struct */) { - Option_v__ast__StructField _t1; + if (ts->info._typ == 457 /* 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; - Option_v__ast__StructField _t2; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t2), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t2; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t2), sizeof(v__ast__StructField)); return _t2; } } - else if (ts->info._typ == 469 /* v.ast.Aggregate */) { - Option_v__ast__StructField _t3; + else if (ts->info._typ == 470 /* 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; - Option_v__ast__StructField _t4; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t4), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t4; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t4), sizeof(v__ast__StructField)); return _t4; } - Option_v__ast__StructField _t5 = v__ast__Table_register_aggregate_field(t, ts, name); + _option_v__ast__StructField _t5 = v__ast__Table_register_aggregate_field(t, ts, name); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - return (Option_v__ast__StructField){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__StructField field = (*(v__ast__StructField*)_t5.data); - Option_v__ast__StructField _t7; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t7), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t7; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t7), sizeof(v__ast__StructField)); return _t7; } - else if (ts->info._typ == 474 /* v.ast.Interface */) { - Option_v__ast__StructField _t8; + else if (ts->info._typ == 475 /* 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; - Option_v__ast__StructField _t9; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t9), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t9; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t9), sizeof(v__ast__StructField)); return _t9; } } - else if (ts->info._typ == 475 /* v.ast.SumType */) { + else if (ts->info._typ == 476 /* v.ast.SumType */) { v__ast__Table_resolve_common_sumtype_fields(t, ts); - Option_v__ast__StructField _t10; + _option_v__ast__StructField _t10; if (_t10 = v__ast__SumType_find_field(&(*ts->info._v__ast__SumType), name), _t10.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t10.data; - Option_v__ast__StructField _t11; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t11), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t11; + opt_ok2(&(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 `"), /*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} }; + 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 { @@ -44086,24 +44148,24 @@ Option_v__ast__StructField v__ast__Table_find_field(v__ast__Table* t, v__ast__Ty } ts = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, ts->parent_idx)); } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -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 == 456 /* v.ast.Struct */) { +_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 == 457 /* 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) { 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); - Option_v__ast__StructField _t2; + _option_v__ast__StructField _t2; if (_t2 = v__ast__Table_find_field(t, embed_sym, field_name), _t2.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t2.data; array_push((array*)&found_fields, _MOV((v__ast__StructField[]){ field })); array_push((array*)&embeds_of_found_fields, _MOV((v__ast__Type[]){ embed })); } else { IError err = _t2.err; - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t5 = v__ast__Table_find_field_from_embeds(t, embed_sym, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t5 = v__ast__Table_find_field_from_embeds(t, embed_sym, field_name); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; continue; @@ -44118,17 +44180,17 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi } } if (found_fields.len == 1) { - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t9; - 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)); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t9; + opt_ok2(&(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 `"), /*115 &string*/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 == 469 /* v.ast.Aggregate */) { + } else if ((sym->info)._typ == 470 /* 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); - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t12 = v__ast__Table_find_field_from_embeds(t, agg_sym, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t12 = v__ast__Table_find_field_from_embeds(t, agg_sym, field_name); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; continue; @@ -44138,47 +44200,47 @@ Option_multi_return_v__ast__StructField_Array_v__ast__Type v__ast__Table_find_fi v__ast__StructField field = mr_17743.arg0; Array_v__ast__Type embed_types = mr_17743.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)); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t13; + opt_ok2(&(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 == 471 /* v.ast.Alias */) { + } else if ((sym->info)._typ == 472 /* 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); + _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; } - return (Option_multi_return_v__ast__StructField_Array_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_multi_return_v__ast__StructField_Array_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name) { - Option_v__ast__StructField _t1; +_option_v__ast__StructField v__ast__Table_find_field_with_embeds(v__ast__Table* t, v__ast__TypeSymbol* sym, string field_name) { + _option_v__ast__StructField _t1; if (_t1 = v__ast__Table_find_field(t, sym, field_name), _t1.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t1.data; - Option_v__ast__StructField _t2; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t2), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t2; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t2), sizeof(v__ast__StructField)); return _t2; } else { IError err = _t1.err; IError first_err = err; - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t3 = v__ast__Table_find_field_from_embeds(t, sym, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t3 = v__ast__Table_find_field_from_embeds(t, sym, field_name); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_v__ast__StructField){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=first_err, .data={EMPTY_STRUCT_INITIALIZATION} }; } multi_return_v__ast__StructField_Array_v__ast__Type mr_18341 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t3.data); v__ast__StructField field = mr_18341.arg0; - Option_v__ast__StructField _t5; - opt_ok(&(v__ast__StructField[]) { field }, (Option*)(&_t5), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t5; + opt_ok2(&(v__ast__StructField[]) { field }, (_option*)(&_t5), sizeof(v__ast__StructField)); return _t5; } - return (Option_v__ast__StructField){0}; + return (_option_v__ast__StructField){0}; } 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, 475) /*expected idx: 475, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 476) /*expected idx: 476, name: v.ast.SumType */ ; if (info.found_fields) { return; } @@ -44188,10 +44250,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 == 456 /* v.ast.Struct */) { + if (v_sym->info._typ == 457 /* v.ast.Struct */) { _t2 = v__ast__Table_struct_fields(t, v_sym); } - else if (v_sym->info._typ == 475 /* v.ast.SumType */) { + else if (v_sym->info._typ == 476 /* v.ast.SumType */) { v__ast__Table_resolve_common_sumtype_fields(t, v_sym); _t2 = (*v_sym->info._v__ast__SumType).fields; } @@ -44237,14 +44299,14 @@ inline int v__ast__Table_find_type_idx(v__ast__Table* t, string name) { } // Attr: [inline] -inline Option_v__ast__TypeSymbol_ptr v__ast__Table_find_sym(v__ast__Table* t, string name) { +inline _option_v__ast__TypeSymbol_ptr v__ast__Table_find_sym(v__ast__Table* t, string name) { int idx = (*(int*)map_get(ADDR(map, t->type_idxs), &(string[]){name}, &(int[]){ 0 })); if (idx > 0) { - Option_v__ast__TypeSymbol_ptr _t1; - opt_ok(&(v__ast__TypeSymbol*[]) { (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)) }, (Option*)(&_t1), sizeof(v__ast__TypeSymbol*)); + _option_v__ast__TypeSymbol_ptr _t1; + opt_ok2(&(v__ast__TypeSymbol*[]) { (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)) }, (_option*)(&_t1), sizeof(v__ast__TypeSymbol*)); return _t1; } - return (Option_v__ast__TypeSymbol_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__TypeSymbol_ptr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } // Attr: [inline] @@ -44279,7 +44341,7 @@ 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, 471) /*expected idx: 471, 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, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type); } v__ast__TypeSymbol* _t1 = (*(v__ast__TypeSymbol**)/*ee elem_sym */array_get(t->type_symbols, idx)); return _t1; @@ -44300,7 +44362,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, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; + v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 472) /*expected idx: 472, 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; @@ -44314,7 +44376,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, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; + v__ast__Type pt = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type; v__ast__Type _t1 = pt; return _t1; } @@ -44403,15 +44465,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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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, 479) /*expected idx: 479, 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, 480) /*expected idx: 480, 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, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 453) /*expected idx: 453, 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; } @@ -44451,7 +44513,7 @@ 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 == 302 /* v.ast.EmptyExpr */ || size != 987654321 ? (int_str(size)) : (v__ast__Expr_str(size_expr))); + string size_str = ((size_expr)._typ == 303 /* 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; } @@ -44546,7 +44608,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 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_"), /*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; } @@ -44662,9 +44724,9 @@ 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_31399 = (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_31399.arg0; - string cref = mr_31399.arg1; + multi_return_string_string mr_31400 = (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_31400.arg0; + string cref = mr_31400.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) { @@ -44709,22 +44771,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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array array_info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 452) /*expected idx: 452, 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 452) /*expected idx: 452, 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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, 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, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 453) /*expected idx: 453, name: v.ast.Map */ ; v__ast__Type _t4 = info.value_type; return _t4; } @@ -44750,7 +44812,7 @@ void v__ast__Table_register_fn_generic_types(v__ast__Table* t, string fn_name) { bool v__ast__Table_register_fn_concrete_types(v__ast__Table* t, string fn_name, Array_v__ast__Type types) { Array_Array_v__ast__Type* _t2 = (Array_Array_v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, t->fn_generic_types), &(string[]){fn_name})); - Option_Array_Array_v__ast__Type _t1 = {0}; + _option_Array_Array_v__ast__Type _t1 = {0}; if (_t2) { *((Array_Array_v__ast__Type*)&_t1.data) = *((Array_Array_v__ast__Type*)_t2); } else { @@ -44777,7 +44839,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, 475) /*expected idx: 475, 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, 476) /*expected idx: 476, name: v.ast.SumType */ ; v__ast__TypeSymbol* var_sym = v__ast__Table_sym(t, variant); if (var_sym->kind == (v__ast__Kind__aggregate)) { @@ -44810,7 +44872,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, 469) /*expected idx: 469, 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, 470) /*expected idx: 470, 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)) { @@ -44823,9 +44885,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, 475) /*expected idx: 475, 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, 476) /*expected idx: 476, 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, 471) /*expected idx: 471, 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, 472) /*expected idx: 472, 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; } @@ -44868,7 +44930,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 == 456 /* v.ast.Struct */) { + if ((ts->info)._typ == 457 /* 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); @@ -44962,7 +45024,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 == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { bool _t4 = false; return _t4; @@ -44973,7 +45035,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 == 474 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 475 /* 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){.field_names = __new_array(0, 0, sizeof(string)),.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)),.name = (string){.str=(byteptr)"", .is_lit=1},.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ = 0,.mut_pos = 0,.is_pub = 0,.are_embeds_expanded = 0,} })).attrs; for (int _t6 = 0; _t6 < attrs.len; ++_t6) { v__ast__Attr attr = ((v__ast__Attr*)attrs.data)[_t6]; @@ -44991,7 +45053,7 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type } for (int _t10 = 0; _t10 < (*inter_sym->info._v__ast__Interface).methods.len; ++_t10) { v__ast__Fn imethod = ((v__ast__Fn*)(*inter_sym->info._v__ast__Interface).methods.data)[_t10]; - Option_v__ast__Fn _t11; + _option_v__ast__Fn _t11; if (_t11 = v__ast__Table_find_method_with_embeds(t, sym, imethod.name), _t11.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t11.data; string msg = v__ast__Table_is_same_method(t, (voidptr)&/*qq*/imethod, (voidptr)&/*qq*/method); @@ -45014,7 +45076,7 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type return _t15; } } - Option_v__ast__StructField _t16; + _option_v__ast__StructField _t16; if (_t16 = v__ast__Table_find_field_with_embeds(t, sym, ifield.name), _t16.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t16.data; if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { @@ -45040,91 +45102,94 @@ bool v__ast__Table_does_type_implement_interface(v__ast__Table* t, v__ast__Type return _t23; } -Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, v__ast__Type generic_type, Array_string generic_names, Array_v__ast__Type concrete_types) { +_option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, v__ast__Type generic_type, Array_string generic_names, Array_v__ast__Type concrete_types) { + if (generic_names.len != concrete_types.len) { + return (_option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + } v__ast__TypeSymbol* sym = v__ast__Table_sym(t, generic_type); if (Array_string_contains(generic_names, sym->name)) { int index = Array_string_index(generic_names, sym->name); if (index >= concrete_types.len) { - return (Option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__Type typ = (*(v__ast__Type*)/*ee elem_sym */array_get(concrete_types, index)); if (typ == 0) { - return (Option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t3; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(typ, generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t3), sizeof(v__ast__Type)); - return _t3; - } else { - Option_v__ast__Type _t4; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(typ, generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t4), sizeof(v__ast__Type)); + _option_v__ast__Type _t4; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(typ, generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t4), sizeof(v__ast__Type)); return _t4; + } else { + _option_v__ast__Type _t5; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(typ, generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t5), sizeof(v__ast__Type)); + return _t5; } } - if (sym->info._typ == 451 /* v.ast.Array */) { + if (sym->info._typ == 452 /* 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 == 451 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 452 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; } - Option_v__ast__Type _t5; - if (_t5 = v__ast__Table_resolve_generic_to_concrete(t, elem_type, generic_names, concrete_types), _t5.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t5.data; + _option_v__ast__Type _t6; + if (_t6 = v__ast__Table_resolve_generic_to_concrete(t, elem_type, generic_names, concrete_types), _t6.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t6.data; int idx = v__ast__Table_find_or_register_array_with_dims(t, typ, dims); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t6; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t6), sizeof(v__ast__Type)); - return _t6; - } else { - Option_v__ast__Type _t7; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t7), sizeof(v__ast__Type)); + _option_v__ast__Type _t7; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t7), sizeof(v__ast__Type)); return _t7; + } else { + _option_v__ast__Type _t8; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t8), sizeof(v__ast__Type)); + return _t8; } } } - 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; + else if (sym->info._typ == 480 /* v.ast.ArrayFixed */) { + _option_v__ast__Type _t9; + if (_t9 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__ArrayFixed).elem_type, generic_names, concrete_types), _t9.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t9.data; int idx = v__ast__Table_find_or_register_array_fixed(t, typ, (*sym->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,},}))))); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t9; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t9), sizeof(v__ast__Type)); - return _t9; - } else { - Option_v__ast__Type _t10; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t10), sizeof(v__ast__Type)); + _option_v__ast__Type _t10; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t10), sizeof(v__ast__Type)); return _t10; + } else { + _option_v__ast__Type _t11; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t11), sizeof(v__ast__Type)); + return _t11; } } } - 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; + else if (sym->info._typ == 481 /* v.ast.Chan */) { + _option_v__ast__Type _t12; + if (_t12 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Chan).elem_type, generic_names, concrete_types), _t12.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t12.data; int idx = v__ast__Table_find_or_register_chan(t, typ, v__ast__Type_nr_muls(typ) > 0); if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t12; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t12), sizeof(v__ast__Type)); - return _t12; - } else { - Option_v__ast__Type _t13; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t13), sizeof(v__ast__Type)); + _option_v__ast__Type _t13; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t13), sizeof(v__ast__Type)); return _t13; + } else { + _option_v__ast__Type _t14; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t14), sizeof(v__ast__Type)); + return _t14; } } } - else if (sym->info._typ == 483 /* v.ast.FnType */) { + else if (sym->info._typ == 484 /* 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)) { - Option_v__ast__Type _t14; - if (_t14 = v__ast__Table_resolve_generic_to_concrete(t, func.return_type, generic_names, concrete_types), _t14.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t14.data; + _option_v__ast__Type _t15; + if (_t15 = v__ast__Table_resolve_generic_to_concrete(t, func.return_type, generic_names, concrete_types), _t15.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t15.data; func.return_type = typ; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { has_generic = true; @@ -45132,12 +45197,12 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, } } func.params = array_clone_to_depth(&func.params, 0); - for (int _t15 = 0; _t15 < func.params.len; ++_t15) { - v__ast__Param* param = ((v__ast__Param*)func.params.data) + _t15; + for (int _t16 = 0; _t16 < func.params.len; ++_t16) { + v__ast__Param* param = ((v__ast__Param*)func.params.data) + _t16; if (v__ast__Type_has_flag(param->typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t16; - if (_t16 = v__ast__Table_resolve_generic_to_concrete(t, param->typ, generic_names, concrete_types), _t16.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t16.data; + _option_v__ast__Type _t17; + if (_t17 = v__ast__Table_resolve_generic_to_concrete(t, param->typ, generic_names, concrete_types), _t17.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t17.data; param->typ = typ; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { has_generic = true; @@ -45148,89 +45213,89 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, func.name = _SLIT(""); int idx = v__ast__Table_find_or_register_fn_type(t, _SLIT(""), func, true, false); if (has_generic) { - Option_v__ast__Type _t17; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t17), sizeof(v__ast__Type)); - return _t17; - } else { - Option_v__ast__Type _t18; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t18), sizeof(v__ast__Type)); + _option_v__ast__Type _t18; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t18), sizeof(v__ast__Type)); return _t18; + } else { + _option_v__ast__Type _t19; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t19), sizeof(v__ast__Type)); + return _t19; } } - else if (sym->info._typ == 482 /* v.ast.MultiReturn */) { + else if (sym->info._typ == 483 /* 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) { - v__ast__Type ret_type = ((v__ast__Type*)(*sym->info._v__ast__MultiReturn).types.data)[_t19]; - Option_v__ast__Type _t20; - if (_t20 = v__ast__Table_resolve_generic_to_concrete(t, ret_type, generic_names, concrete_types), _t20.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t20.data; + for (int _t20 = 0; _t20 < (*sym->info._v__ast__MultiReturn).types.len; ++_t20) { + v__ast__Type ret_type = ((v__ast__Type*)(*sym->info._v__ast__MultiReturn).types.data)[_t20]; + _option_v__ast__Type _t21; + if (_t21 = v__ast__Table_resolve_generic_to_concrete(t, ret_type, generic_names, concrete_types), _t21.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t21.data; array_push((array*)&types, _MOV((v__ast__Type[]){ typ })); type_changed = true; } else { - IError err = _t20.err; + IError err = _t21.err; array_push((array*)&types, _MOV((v__ast__Type[]){ ret_type })); } } if (type_changed) { int idx = v__ast__Table_find_or_register_multi_return(t, types); - bool _t23 = false; - Array_v__ast__Type _t23_orig = types; - int _t23_len = _t23_orig.len; - for (int _t24 = 0; _t24 < _t23_len; ++_t24) { - v__ast__Type it = ((v__ast__Type*) _t23_orig.data)[_t24]; + bool _t24 = false; + Array_v__ast__Type _t24_orig = types; + int _t24_len = _t24_orig.len; + for (int _t25 = 0; _t25 < _t24_len; ++_t25) { + v__ast__Type it = ((v__ast__Type*) _t24_orig.data)[_t25]; if (v__ast__Type_has_flag(it, v__ast__TypeFlag__generic)) { - _t23 = true; + _t24 = true; break; } } - if (_t23) { - Option_v__ast__Type _t25; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t25), sizeof(v__ast__Type)); - return _t25; - } else { - Option_v__ast__Type _t26; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t26), sizeof(v__ast__Type)); + if (_t24) { + _option_v__ast__Type _t26; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t26), sizeof(v__ast__Type)); return _t26; + } else { + _option_v__ast__Type _t27; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t27), sizeof(v__ast__Type)); + return _t27; } } } - else if (sym->info._typ == 452 /* v.ast.Map */) { + else if (sym->info._typ == 453 /* 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; - Option_v__ast__Type _t27; - if (_t27 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Map).key_type, generic_names, concrete_types), _t27.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t27.data; + _option_v__ast__Type _t28; + if (_t28 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Map).key_type, generic_names, concrete_types), _t28.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t28.data; unwrapped_key_type = typ; type_changed = true; } - Option_v__ast__Type _t28; - if (_t28 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Map).value_type, generic_names, concrete_types), _t28.state == 0) { - v__ast__Type typ = *(v__ast__Type*)_t28.data; + _option_v__ast__Type _t29; + if (_t29 = v__ast__Table_resolve_generic_to_concrete(t, (*sym->info._v__ast__Map).value_type, generic_names, concrete_types), _t29.state == 0) { + v__ast__Type typ = *(v__ast__Type*)_t29.data; unwrapped_value_type = typ; type_changed = true; } if (type_changed) { int idx = v__ast__Table_find_or_register_map(t, unwrapped_key_type, unwrapped_value_type); if (v__ast__Type_has_flag(unwrapped_key_type, v__ast__TypeFlag__generic) || v__ast__Type_has_flag(unwrapped_value_type, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t29; - opt_ok(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t29), sizeof(v__ast__Type)); - return _t29; - } else { - Option_v__ast__Type _t30; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t30), sizeof(v__ast__Type)); + _option_v__ast__Type _t30; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_set_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t30), sizeof(v__ast__Type)); return _t30; + } else { + _option_v__ast__Type _t31; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t31), sizeof(v__ast__Type)); + return _t31; } } } - else if (sym->info._typ == 456 /* v.ast.Struct */) { + else if (sym->info._typ == 457 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { 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) { - v__ast__Type ct = *(v__ast__Type*)_t31.data; + _option_v__ast__Type _t32; + if (_t32 = 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), _t32.state == 0) { + v__ast__Type ct = *(v__ast__Type*)_t32.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); nrt = /*f*/string__plus(nrt, gts->name); if (i != (*sym->info._v__ast__Struct).generic_types.len - 1) { @@ -45243,18 +45308,18 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, if (idx == 0) { idx = v__ast__Table_add_placeholder_type(t, nrt, v__ast__Language__v); } - Option_v__ast__Type _t32; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t32), sizeof(v__ast__Type)); - return _t32; + _option_v__ast__Type _t33; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t33), sizeof(v__ast__Type)); + return _t33; } } - else if (sym->info._typ == 474 /* v.ast.Interface */) { + else if (sym->info._typ == 475 /* v.ast.Interface */) { if ((*sym->info._v__ast__Interface).is_generic) { 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) { - v__ast__Type ct = *(v__ast__Type*)_t33.data; + _option_v__ast__Type _t34; + if (_t34 = 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), _t34.state == 0) { + v__ast__Type ct = *(v__ast__Type*)_t34.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); nrt = /*f*/string__plus(nrt, gts->name); if (i != (*sym->info._v__ast__Interface).generic_types.len - 1) { @@ -45267,18 +45332,18 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, if (idx == 0) { idx = v__ast__Table_add_placeholder_type(t, nrt, v__ast__Language__v); } - Option_v__ast__Type _t34; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t34), sizeof(v__ast__Type)); - return _t34; + _option_v__ast__Type _t35; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t35), sizeof(v__ast__Type)); + return _t35; } } - else if (sym->info._typ == 475 /* v.ast.SumType */) { + else if (sym->info._typ == 476 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { 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) { - v__ast__Type ct = *(v__ast__Type*)_t35.data; + _option_v__ast__Type _t36; + if (_t36 = 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), _t36.state == 0) { + v__ast__Type ct = *(v__ast__Type*)_t36.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); nrt = /*f*/string__plus(nrt, gts->name); if (i != (*sym->info._v__ast__SumType).generic_types.len - 1) { @@ -45291,16 +45356,16 @@ Option_v__ast__Type v__ast__Table_resolve_generic_to_concrete(v__ast__Table* t, if (idx == 0) { idx = v__ast__Table_add_placeholder_type(t, nrt, v__ast__Language__v); } - Option_v__ast__Type _t36; - opt_ok(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (Option*)(&_t36), sizeof(v__ast__Type)); - return _t36; + _option_v__ast__Type _t37; + opt_ok2(&(v__ast__Type[]) { v__ast__Type_clear_flag(v__ast__Type_derive_add_muls(v__ast__new_type(idx), generic_type), v__ast__TypeFlag__generic) }, (_option*)(&_t37), sizeof(v__ast__Type)); + return _t37; } } else { } ; - return (Option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Type){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type typ, Array_string generic_names, Array_v__ast__Type concrete_types) { @@ -45310,12 +45375,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 == 451 /* v.ast.Array */) { + if (ts->info._typ == 452 /* 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 == 451 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 452 /* v.ast.Array */)) break; elem_type = (*elem_sym->info._v__ast__Array).elem_type; elem_sym = v__ast__Table_sym(t, elem_type); dims++; @@ -45325,26 +45390,26 @@ 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 == 479 /* v.ast.ArrayFixed */) { + else if (ts->info._typ == 480 /* 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 == 480 /* v.ast.Chan */) { + else if (ts->info._typ == 481 /* 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 == 452 /* v.ast.Map */) { + else if (ts->info._typ == 453 /* 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 == 456 /* v.ast.Struct */) { + else if (ts->info._typ == 457 /* v.ast.Struct */) { if (!(*ts->info._v__ast__Struct).is_generic) { v__ast__Type _t5 = typ; return _t5; @@ -45352,7 +45417,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty 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; + _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) { v__ast__Type ct = *(v__ast__Type*)_t6.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); @@ -45377,7 +45442,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ) != v__ast__Type_idx(typ)) { (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = v__ast__Table_unwrap_generic_type(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types); } else { - Option_v__ast__Type _t8; + _option_v__ast__Type _t8; if (_t8 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types), _t8.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t8.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -45386,7 +45451,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } for (int i = 0; i < (*ts->info._v__ast__Struct).generic_types.len; ++i) { - Option_v__ast__Type _t9; + _option_v__ast__Type _t9; if (_t9 = 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), _t9.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t9.data; array_push((array*)&final_concrete_types, _MOV((v__ast__Type[]){ t_typ })); @@ -45412,7 +45477,7 @@ 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.Interface */) { + else if (ts->info._typ == 475 /* v.ast.Interface */) { if (!(*ts->info._v__ast__Interface).is_generic) { v__ast__Type _t14 = typ; return _t14; @@ -45420,7 +45485,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty 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; + _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) { v__ast__Type ct = *(v__ast__Type*)_t15.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); @@ -45445,7 +45510,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ) != v__ast__Type_idx(typ)) { (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = v__ast__Table_unwrap_generic_type(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types); } else { - Option_v__ast__Type _t17; + _option_v__ast__Type _t17; if (_t17 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types), _t17.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t17.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -45454,7 +45519,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } for (int i = 0; i < (*ts->info._v__ast__Interface).generic_types.len; ++i) { - Option_v__ast__Type _t18; + _option_v__ast__Type _t18; if (_t18 = 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), _t18.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t18.data; array_push((array*)&final_concrete_types, _MOV((v__ast__Type[]){ t_typ })); @@ -45480,7 +45545,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } } - else if (ts->info._typ == 475 /* v.ast.SumType */) { + else if (ts->info._typ == 476 /* v.ast.SumType */) { if (!(*ts->info._v__ast__SumType).is_generic) { v__ast__Type _t23 = typ; return _t23; @@ -45488,7 +45553,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty 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; + _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) { v__ast__Type ct = *(v__ast__Type*)_t24.data; v__ast__TypeSymbol* gts = v__ast__Table_sym(t, ct); @@ -45513,7 +45578,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ) != v__ast__Type_idx(typ)) { (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = v__ast__Table_unwrap_generic_type(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types); } else { - Option_v__ast__Type _t26; + _option_v__ast__Type _t26; if (_t26 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, concrete_types), _t26.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t26.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -45522,7 +45587,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty } } for (int i = 0; i < (*ts->info._v__ast__SumType).generic_types.len; ++i) { - Option_v__ast__Type _t27; + _option_v__ast__Type _t27; if (_t27 = 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), _t27.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t27.data; array_push((array*)&final_concrete_types, _MOV((v__ast__Type[]){ t_typ })); @@ -45552,7 +45617,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty else { } ; - if (ts->info._typ == 456 /* v.ast.Struct */) { + if (ts->info._typ == 457 /* v.ast.Struct */) { v__ast__Struct info = (*ts->info._v__ast__Struct); info.is_generic = false; info.concrete_types = final_concrete_types; @@ -45566,7 +45631,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 == 475 /* v.ast.SumType */) { + else if (ts->info._typ == 476 /* 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)) { @@ -45574,7 +45639,7 @@ v__ast__Type v__ast__Table_unwrap_generic_type(v__ast__Table* t, v__ast__Type ty if (sym->kind == v__ast__Kind__struct_ || sym->kind == v__ast__Kind__sum_type || sym->kind == v__ast__Kind__interface_) { array_set(&variants, i, &(v__ast__Type[]) { v__ast__Table_unwrap_generic_type(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, concrete_types) }); } else { - Option_v__ast__Type _t34; + _option_v__ast__Type _t34; if (_t34 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, concrete_types), _t34.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t34.data; array_set(&variants, i, &(v__ast__Type[]) { t_typ }); @@ -45596,18 +45661,18 @@ 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 == 474 /* v.ast.Interface */) { + else if (ts->info._typ == 475 /* 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; - Option_v__ast__Type _t38; + _option_v__ast__Type _t38; if (_t38 = v__ast__Table_resolve_generic_to_concrete(t, method->return_type, generic_names, concrete_types), _t38.state == 0) { v__ast__Type unwrap_typ = *(v__ast__Type*)_t38.data; method->return_type = unwrap_typ; } for (int _t39 = 0; _t39 < method->params.len; ++_t39) { v__ast__Param* param = ((v__ast__Param*)method->params.data) + _t39; - Option_v__ast__Type _t40; + _option_v__ast__Type _t40; if (_t40 = v__ast__Table_resolve_generic_to_concrete(t, param->typ, generic_names, concrete_types), _t40.state == 0) { v__ast__Type unwrap_typ = *(v__ast__Type*)_t40.data; param->typ = unwrap_typ; @@ -45649,29 +45714,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 == 451 /* v.ast.Array */) { + if (ts->info._typ == 452 /* 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 == 451 /* v.ast.Array */)) break; + if (!((elem_sym->info)._typ == 452 /* 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 == 479 /* v.ast.ArrayFixed */) { + else if (ts->info._typ == 480 /* v.ast.ArrayFixed */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__ArrayFixed).elem_type, generic_types); } - else if (ts->info._typ == 480 /* v.ast.Chan */) { + else if (ts->info._typ == 481 /* v.ast.Chan */) { v__ast__Table_replace_generic_type(t, (*ts->info._v__ast__Chan).elem_type, generic_types); } - else if (ts->info._typ == 452 /* v.ast.Map */) { + else if (ts->info._typ == 453 /* 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 == 456 /* v.ast.Struct */) { + else if (ts->info._typ == 457 /* 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; @@ -45685,7 +45750,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra Array_string generic_names =_t1; for (int i = 0; i < (*ts->info._v__ast__Struct).fields.len; ++i) { if (v__ast__Type_has_flag((*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Struct).fields, i)).typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t3; + _option_v__ast__Type _t3; if (_t3 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Struct).fields, i)).typ, generic_names, generic_types), _t3.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t3.data; (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Struct).fields, i)).typ = t_typ; @@ -45694,7 +45759,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 == 474 /* v.ast.Interface */) { + else if (ts->info._typ == 475 /* 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; @@ -45708,7 +45773,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra Array_string generic_names =_t4; for (int i = 0; i < (*ts->info._v__ast__Interface).fields.len; ++i) { if (v__ast__Type_has_flag((*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Interface).fields, i)).typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t6; + _option_v__ast__Type _t6; if (_t6 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Interface).fields, i)).typ, generic_names, generic_types), _t6.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t6.data; (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__Interface).fields, i)).typ = t_typ; @@ -45717,7 +45782,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 == 475 /* v.ast.SumType */) { + else if (ts->info._typ == 476 /* 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; @@ -45731,7 +45796,7 @@ void v__ast__Table_replace_generic_type(v__ast__Table* t, v__ast__Type typ, Arra Array_string generic_names =_t7; for (int i = 0; i < (*ts->info._v__ast__SumType).fields.len; ++i) { if (v__ast__Type_has_flag((*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__SumType).fields, i)).typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t9; + _option_v__ast__Type _t9; if (_t9 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__SumType).fields, i)).typ, generic_names, generic_types), _t9.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t9.data; (*(v__ast__StructField*)/*ee elem_sym */array_get((*ts->info._v__ast__SumType).fields, i)).typ = t_typ; @@ -45750,13 +45815,13 @@ 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, 484) /*expected idx: 484, name: v.ast.GenericInst */ ; + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast(((*typ)->info)._v__ast__GenericInst,((*typ)->info)._typ, 485) /*expected idx: 485, 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 == 456 /* v.ast.Struct */) { + if (parent->info._typ == 457 /* 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 `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic struct, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); @@ -45781,7 +45846,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { if (v__ast__Type_idx((*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ) != info.parent_idx) { (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = v__ast__Table_unwrap_generic_type(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, info.concrete_types); } - Option_v__ast__Type _t4; + _option_v__ast__Type _t4; if (_t4 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, info.concrete_types), _t4.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t4.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -45807,7 +45872,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { VUNREACHABLE(); } } - else if (parent->info._typ == 474 /* v.ast.Interface */) { + else if (parent->info._typ == 475 /* 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 `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic interface, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); @@ -45828,7 +45893,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } Array_string generic_names =_t6; for (int i = 0; i < fields.len; ++i) { - Option_v__ast__Type _t8; + _option_v__ast__Type _t8; if (_t8 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, info.concrete_types), _t8.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t8.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -45838,7 +45903,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { for (int _t9 = 0; _t9 < imethods.len; ++_t9) { v__ast__Fn* method = ((v__ast__Fn*)imethods.data) + _t9; array_clear(&method->generic_names); - Option_v__ast__Type _t10; + _option_v__ast__Type _t10; if (_t10 = v__ast__Table_resolve_generic_to_concrete(t, method->return_type, generic_names, info.concrete_types), _t10.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t10.data; method->return_type = pt; @@ -45846,7 +45911,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { method->params = array_clone_to_depth(&method->params, 0); for (int _t11 = 0; _t11 < method->params.len; ++_t11) { v__ast__Param* param = ((v__ast__Param*)method->params.data) + _t11; - Option_v__ast__Type _t12; + _option_v__ast__Type _t12; if (_t12 = v__ast__Table_resolve_generic_to_concrete(t, param->typ, generic_names, info.concrete_types), _t12.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t12.data; param->typ = pt; @@ -45873,7 +45938,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { VUNREACHABLE(); } } - else if (parent->info._typ == 475 /* v.ast.SumType */) { + else if (parent->info._typ == 476 /* 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 `"), /*115 &string*/0xfe10, {.d_s = parent->name}}, {_SLIT("` is not a generic sumtype, cannot instantiate to the concrete types"), 0, { .d_c = 0 }}}))); @@ -45895,7 +45960,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { } Array_string generic_names =_t15; for (int i = 0; i < fields.len; ++i) { - Option_v__ast__Type _t17; + _option_v__ast__Type _t17; if (_t17 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ, generic_names, info.concrete_types), _t17.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t17.data; (*(v__ast__StructField*)/*ee elem_sym */array_get(fields, i)).typ = t_typ; @@ -45907,7 +45972,7 @@ void v__ast__Table_generic_insts_to_concrete(v__ast__Table* t) { if (sym->kind == v__ast__Kind__struct_ && v__ast__Type_idx((*(v__ast__Type*)/*ee elem_sym */array_get(variants, i))) != info.parent_idx) { array_set(&variants, i, &(v__ast__Type[]) { v__ast__Table_unwrap_generic_type(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, info.concrete_types) }); } else { - Option_v__ast__Type _t18; + _option_v__ast__Type _t18; if (_t18 = v__ast__Table_resolve_generic_to_concrete(t, (*(v__ast__Type*)/*ee elem_sym */array_get(variants, i)), generic_names, info.concrete_types), _t18.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t18.data; array_set(&variants, i, &(v__ast__Type[]) { t_typ }); @@ -46419,13 +46484,13 @@ VNORETURN VV_LOCAL_SYMBOL void v__ast__TypeSymbol_no_info_panic(v__ast__TypeSymb // Attr: [inline] inline v__ast__Enum v__ast__TypeSymbol_enum_info(v__ast__TypeSymbol* t) { - if ((t->info)._typ == 485 /* v.ast.Enum */) { + if ((t->info)._typ == 486 /* v.ast.Enum */) { v__ast__Enum _t1 = (*t->info._v__ast__Enum); return _t1; } - if ((t->info)._typ == 471 /* v.ast.Alias */) { + if ((t->info)._typ == 472 /* 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 == 485 /* v.ast.Enum */) { + if ((fsym->info)._typ == 486 /* v.ast.Enum */) { v__ast__Enum _t2 = (*fsym->info._v__ast__Enum); return _t2; } @@ -46437,13 +46502,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 == 482 /* v.ast.MultiReturn */) { + if ((t->info)._typ == 483 /* v.ast.MultiReturn */) { v__ast__MultiReturn _t1 = (*t->info._v__ast__MultiReturn); return _t1; } - if ((t->info)._typ == 471 /* v.ast.Alias */) { + if ((t->info)._typ == 472 /* 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 == 482 /* v.ast.MultiReturn */) { + if ((fsym->info)._typ == 483 /* v.ast.MultiReturn */) { v__ast__MultiReturn _t2 = (*fsym->info._v__ast__MultiReturn); return _t2; } @@ -46455,13 +46520,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 == 451 /* v.ast.Array */) { + if ((t->info)._typ == 452 /* v.ast.Array */) { v__ast__Array _t1 = (*t->info._v__ast__Array); return _t1; } - if ((t->info)._typ == 471 /* v.ast.Alias */) { + if ((t->info)._typ == 472 /* 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.Array */) { + if ((fsym->info)._typ == 452 /* v.ast.Array */) { v__ast__Array _t2 = (*fsym->info._v__ast__Array); return _t2; } @@ -46473,13 +46538,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 == 479 /* v.ast.ArrayFixed */) { + if ((t->info)._typ == 480 /* v.ast.ArrayFixed */) { v__ast__ArrayFixed _t1 = (*t->info._v__ast__ArrayFixed); return _t1; } - if ((t->info)._typ == 471 /* v.ast.Alias */) { + if ((t->info)._typ == 472 /* 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.ArrayFixed */) { + if ((fsym->info)._typ == 480 /* v.ast.ArrayFixed */) { v__ast__ArrayFixed _t2 = (*fsym->info._v__ast__ArrayFixed); return _t2; } @@ -46491,13 +46556,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 == 480 /* v.ast.Chan */) { + if ((t->info)._typ == 481 /* v.ast.Chan */) { v__ast__Chan _t1 = (*t->info._v__ast__Chan); return _t1; } - if ((t->info)._typ == 471 /* v.ast.Alias */) { + if ((t->info)._typ == 472 /* 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.Chan */) { + if ((fsym->info)._typ == 481 /* v.ast.Chan */) { v__ast__Chan _t2 = (*fsym->info._v__ast__Chan); return _t2; } @@ -46509,13 +46574,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 == 481 /* v.ast.Thread */) { + if ((t->info)._typ == 482 /* v.ast.Thread */) { v__ast__Thread _t1 = (*t->info._v__ast__Thread); return _t1; } - if ((t->info)._typ == 471 /* v.ast.Alias */) { + if ((t->info)._typ == 472 /* 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.Thread */) { + if ((fsym->info)._typ == 482 /* v.ast.Thread */) { v__ast__Thread _t2 = (*fsym->info._v__ast__Thread); return _t2; } @@ -46527,13 +46592,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 == 452 /* v.ast.Map */) { + if ((t->info)._typ == 453 /* v.ast.Map */) { v__ast__Map _t1 = (*t->info._v__ast__Map); return _t1; } - if ((t->info)._typ == 471 /* v.ast.Alias */) { + if ((t->info)._typ == 472 /* 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 == 452 /* v.ast.Map */) { + if ((fsym->info)._typ == 453 /* v.ast.Map */) { v__ast__Map _t2 = (*fsym->info._v__ast__Map); return _t2; } @@ -46545,13 +46610,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 == 456 /* v.ast.Struct */) { + if ((t->info)._typ == 457 /* v.ast.Struct */) { v__ast__Struct _t1 = (*t->info._v__ast__Struct); return _t1; } - if ((t->info)._typ == 471 /* v.ast.Alias */) { + if ((t->info)._typ == 472 /* 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 == 456 /* v.ast.Struct */) { + if ((fsym->info)._typ == 457 /* v.ast.Struct */) { v__ast__Struct _t2 = (*fsym->info._v__ast__Struct); return _t2; } @@ -46563,13 +46628,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 == 475 /* v.ast.SumType */) { + if ((t->info)._typ == 476 /* v.ast.SumType */) { v__ast__SumType _t1 = (*t->info._v__ast__SumType); return _t1; } - if ((t->info)._typ == 475 /* v.ast.SumType */) { + if ((t->info)._typ == 476 /* 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 == 475 /* v.ast.SumType */) { + if ((fsym->info)._typ == 476 /* v.ast.SumType */) { v__ast__SumType _t2 = (*fsym->info._v__ast__SumType); return _t2; } @@ -46581,7 +46646,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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((t->info)._v__ast__Struct,(t->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ; bool _t1 = info.is_heap; return _t1; } else { @@ -46635,7 +46700,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, 471) /*expected idx: 471, 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, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type); return _t1; } bool _t2 = res; @@ -46745,7 +46810,7 @@ multi_return_int_int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) } case v__ast__Kind__alias: { - multi_return_int_int mr_21155 = 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); + multi_return_int_int mr_21155 = v__ast__Table_type_size(t, (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type); size = mr_21155.arg0; align = mr_21155.arg1; break; @@ -46757,7 +46822,7 @@ multi_return_int_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 _t4; /* if prepend */ - if ((sym->info)._typ == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* v.ast.Struct */) { Array_v__ast__Type _t5 = {0}; Array_v__ast__StructField _t5_orig = (*sym->info._v__ast__Struct).fields; int _t5_len = _t5_orig.len; @@ -46770,7 +46835,7 @@ multi_return_int_int v__ast__Table_type_size(v__ast__Table* t, v__ast__Type typ) } _t4 =_t5; } else { - _t4 = (/* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ).types; + _t4 = (/* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 483) /*expected idx: 483, name: v.ast.MultiReturn */ ).types; } Array_v__ast__Type types = _t4; for (int _t7 = 0; _t7 < types.len; ++_t7) { @@ -46791,15 +46856,15 @@ multi_return_int_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 == 475 /* v.ast.SumType */) { + if (sym->info._typ == 476 /* v.ast.SumType */) { size = ((*sym->info._v__ast__SumType).fields.len + 2) * t->pointer_size; align = t->pointer_size; } - else if (sym->info._typ == 469 /* v.ast.Aggregate */) { + else if (sym->info._typ == 470 /* v.ast.Aggregate */) { size = ((*sym->info._v__ast__Aggregate).fields.len + 2) * t->pointer_size; align = t->pointer_size; } - else if (sym->info._typ == 474 /* v.ast.Interface */) { + else if (sym->info._typ == 475 /* v.ast.Interface */) { size = ((*sym->info._v__ast__Interface).fields.len + 2) * t->pointer_size; align = t->pointer_size; for (int _t8 = 0; _t8 < (*sym->info._v__ast__Interface).embeds.len; ++_t8) { @@ -46817,7 +46882,7 @@ multi_return_int_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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ; multi_return_int_int mr_22224 = v__ast__Table_type_size(t, info.elem_type); int elem_size = mr_22224.arg0; int elem_align = mr_22224.arg1; @@ -47132,7 +47197,7 @@ 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 == 451 /* v.ast.Array */) { + if ((sym->info)._typ == 452 /* 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("[]"), /*115 &string*/0xfe10, {.d_s = elem_str}}, {_SLIT0, 0, { .d_c = 0 }}})); } else { @@ -47143,9 +47208,9 @@ 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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, 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 == 302 /* v.ast.EmptyExpr */) { + if ((info.size_expr)._typ == 303 /* 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("["), /*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 }}})); @@ -47155,7 +47220,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty 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, 480) /*expected idx: 480, name: v.ast.Chan */ ; + v__ast__Chan info = /* as */ *(v__ast__Chan*)__as_cast((sym->info)._v__ast__Chan,(sym->info)._typ, 481) /*expected idx: 481, name: v.ast.Chan */ ; v__ast__Type elem_type = info.elem_type; string mut_str = _SLIT(""); if (info.is_mut) { @@ -47169,7 +47234,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty } case v__ast__Kind__function: { - 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__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 484) /*expected idx: 484, 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 { @@ -47198,7 +47263,7 @@ 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, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 453) /*expected idx: 453, 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["), /*115 &string*/0xfe10, {.d_s = key_str}}, {_SLIT("]"), /*115 &string*/0xfe10, {.d_s = val_str}}, {_SLIT0, 0, { .d_c = 0 }}})); @@ -47207,7 +47272,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty 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, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 483) /*expected idx: 483, 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) { @@ -47223,7 +47288,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 == 456 /* v.ast.Struct */) { + if (sym->info._typ == 457 /* 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]; @@ -47234,7 +47299,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.Interface */) { + else if (sym->info._typ == 475 /* 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]; @@ -47245,7 +47310,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 == 475 /* v.ast.SumType */) { + else if (sym->info._typ == 476 /* 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]; @@ -47260,7 +47325,7 @@ string v__ast__Table_type_to_str_using_aliases(v__ast__Table* t, v__ast__Type ty else { } ; - } 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) { + } else if ((sym->info)._typ == 476 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 476) /*expected idx: 476, 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; @@ -47280,7 +47345,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, 484) /*expected idx: 484, name: v.ast.GenericInst */ ; + v__ast__GenericInst info = /* as */ *(v__ast__GenericInst*)__as_cast((sym->info)._v__ast__GenericInst,(sym->info)._typ, 485) /*expected idx: 485, 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) { @@ -47359,7 +47424,7 @@ VV_LOCAL_SYMBOL string v__ast__Table_shorten_user_defined_typenames(v__ast__Tabl res = (*(string*)map_get(ADDR(map, import_aliases), &(string[]){res}, &(string[]){ (string){.str=(byteptr)"", .is_lit=1} })); } else { if (string_contains(res, _SLIT("[]"))) { - Option_int _t1 = string_index(res, _SLIT(".")); + _option_int _t1 = string_index(res, _SLIT(".")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(int*) _t1.data = -1; @@ -47468,7 +47533,7 @@ bool v__ast__TypeSymbol_has_method(v__ast__TypeSymbol* t, string name) { } bool v__ast__TypeSymbol_has_method_with_generic_parent(v__ast__TypeSymbol* t, string name) { - Option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(t, name); + _option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(t, name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; bool _t2 = false; @@ -47480,35 +47545,35 @@ bool v__ast__TypeSymbol_has_method_with_generic_parent(v__ast__TypeSymbol* t, st return _t3; } -Option_v__ast__Fn v__ast__TypeSymbol_find_method(v__ast__TypeSymbol* t, string name) { +_option_v__ast__Fn v__ast__TypeSymbol_find_method(v__ast__TypeSymbol* t, string name) { Array_v__ast__Fn _t1 = t->methods; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__Fn* method = ((v__ast__Fn*)_t1.data) + _t2; if (string__eq(method->name, name)) { - Option_v__ast__Fn _t3; - opt_ok(&(v__ast__Fn[]) { *method }, (Option*)(&_t3), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t3; + opt_ok2(&(v__ast__Fn[]) { *method }, (_option*)(&_t3), sizeof(v__ast__Fn)); return _t3; } } - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__TypeSymbol* t, string name) { - Option_v__ast__Fn _t1; +_option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__TypeSymbol* t, string name) { + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method(t, name), _t1.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t1.data; - Option_v__ast__Fn _t2; - opt_ok(&(v__ast__Fn[]) { m }, (Option*)(&_t2), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t2; + opt_ok2(&(v__ast__Fn[]) { m }, (_option*)(&_t2), sizeof(v__ast__Fn)); return _t2; } v__ast__Table* table = global_table; - if (t->info._typ == 456 /* v.ast.Struct */) { + if (t->info._typ == 457 /* 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; + _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 == 456 /* v.ast.Struct */) { + if (parent_sym->info._typ == 457 /* 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; @@ -47525,7 +47590,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types); } else { - Option_v__ast__Type _t6; + _option_v__ast__Type _t6; if (_t6 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types), _t6.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t6.data; method.return_type = rt; @@ -47534,18 +47599,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t7 = 0; _t7 < method.params.len; ++_t7) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t7; - Option_v__ast__Type _t8; + _option_v__ast__Type _t8; if (_t8 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Struct).concrete_types), _t8.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t8.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t9; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t9), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t9; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t9), sizeof(v__ast__Fn)); return _t9; } - else if (parent_sym->info._typ == 474 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 475 /* 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; @@ -47562,7 +47627,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types); } else { - Option_v__ast__Type _t12; + _option_v__ast__Type _t12; if (_t12 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types), _t12.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t12.data; method.return_type = rt; @@ -47571,18 +47636,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t13 = 0; _t13 < method.params.len; ++_t13) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t13; - Option_v__ast__Type _t14; + _option_v__ast__Type _t14; if (_t14 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Interface).concrete_types), _t14.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t14.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t15; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t15), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t15; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t15), sizeof(v__ast__Fn)); return _t15; } - else if (parent_sym->info._typ == 475 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 476 /* 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; @@ -47599,7 +47664,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types); } else { - Option_v__ast__Type _t18; + _option_v__ast__Type _t18; if (_t18 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types), _t18.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t18.data; method.return_type = rt; @@ -47608,15 +47673,15 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t19 = 0; _t19 < method.params.len; ++_t19) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t19; - Option_v__ast__Type _t20; + _option_v__ast__Type _t20; if (_t20 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__SumType).concrete_types), _t20.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t20.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t21; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t21), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t21; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t21), sizeof(v__ast__Fn)); return _t21; } @@ -47626,13 +47691,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ } } } - else if (t->info._typ == 474 /* v.ast.Interface */) { + else if (t->info._typ == 475 /* 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; + _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 == 456 /* v.ast.Struct */) { + if (parent_sym->info._typ == 457 /* 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; @@ -47649,7 +47714,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types); } else { - Option_v__ast__Type _t25; + _option_v__ast__Type _t25; if (_t25 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types), _t25.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t25.data; method.return_type = rt; @@ -47658,18 +47723,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t26 = 0; _t26 < method.params.len; ++_t26) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t26; - Option_v__ast__Type _t27; + _option_v__ast__Type _t27; if (_t27 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Struct).concrete_types), _t27.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t27.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t28; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t28), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t28; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t28), sizeof(v__ast__Fn)); return _t28; } - else if (parent_sym->info._typ == 474 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 475 /* 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; @@ -47686,7 +47751,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types); } else { - Option_v__ast__Type _t31; + _option_v__ast__Type _t31; if (_t31 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types), _t31.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t31.data; method.return_type = rt; @@ -47695,18 +47760,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t32 = 0; _t32 < method.params.len; ++_t32) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t32; - Option_v__ast__Type _t33; + _option_v__ast__Type _t33; if (_t33 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Interface).concrete_types), _t33.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t33.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t34; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t34), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t34; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t34), sizeof(v__ast__Fn)); return _t34; } - else if (parent_sym->info._typ == 475 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 476 /* 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; @@ -47723,7 +47788,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types); } else { - Option_v__ast__Type _t37; + _option_v__ast__Type _t37; if (_t37 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types), _t37.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t37.data; method.return_type = rt; @@ -47732,15 +47797,15 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t38 = 0; _t38 < method.params.len; ++_t38) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t38; - Option_v__ast__Type _t39; + _option_v__ast__Type _t39; if (_t39 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__SumType).concrete_types), _t39.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t39.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t40; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t40), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t40; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t40), sizeof(v__ast__Fn)); return _t40; } @@ -47750,13 +47815,13 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ } } } - else if (t->info._typ == 475 /* v.ast.SumType */) { + else if (t->info._typ == 476 /* 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; + _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 == 456 /* v.ast.Struct */) { + if (parent_sym->info._typ == 457 /* 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; @@ -47773,7 +47838,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types); } else { - Option_v__ast__Type _t44; + _option_v__ast__Type _t44; if (_t44 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Struct).concrete_types), _t44.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t44.data; method.return_type = rt; @@ -47782,18 +47847,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t45 = 0; _t45 < method.params.len; ++_t45) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t45; - Option_v__ast__Type _t46; + _option_v__ast__Type _t46; if (_t46 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Struct).concrete_types), _t46.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t46.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t47; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t47), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t47; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t47), sizeof(v__ast__Fn)); return _t47; } - else if (parent_sym->info._typ == 474 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 475 /* 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; @@ -47810,7 +47875,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types); } else { - Option_v__ast__Type _t50; + _option_v__ast__Type _t50; if (_t50 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__Interface).concrete_types), _t50.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t50.data; method.return_type = rt; @@ -47819,18 +47884,18 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t51 = 0; _t51 < method.params.len; ++_t51) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t51; - Option_v__ast__Type _t52; + _option_v__ast__Type _t52; if (_t52 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__Interface).concrete_types), _t52.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t52.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t53; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t53), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t53; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t53), sizeof(v__ast__Fn)); return _t53; } - else if (parent_sym->info._typ == 475 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 476 /* 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; @@ -47847,7 +47912,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ if (return_sym->kind == v__ast__Kind__struct_ || return_sym->kind == v__ast__Kind__interface_ || return_sym->kind == v__ast__Kind__sum_type) { method.return_type = v__ast__Table_unwrap_generic_type(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types); } else { - Option_v__ast__Type _t56; + _option_v__ast__Type _t56; if (_t56 = v__ast__Table_resolve_generic_to_concrete(table, method.return_type, generic_names, (*t->info._v__ast__SumType).concrete_types), _t56.state == 0) { v__ast__Type rt = *(v__ast__Type*)_t56.data; method.return_type = rt; @@ -47856,15 +47921,15 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ method.params = array_clone_to_depth(&method.params, 0); for (int _t57 = 0; _t57 < method.params.len; ++_t57) { v__ast__Param* param = ((v__ast__Param*)method.params.data) + _t57; - Option_v__ast__Type _t58; + _option_v__ast__Type _t58; if (_t58 = v__ast__Table_resolve_generic_to_concrete(table, param->typ, generic_names, (*t->info._v__ast__SumType).concrete_types), _t58.state == 0) { v__ast__Type pt = *(v__ast__Type*)_t58.data; param->typ = pt; } } array_clear(&method.generic_names); - Option_v__ast__Fn _t59; - opt_ok(&(v__ast__Fn[]) { method }, (Option*)(&_t59), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t59; + opt_ok2(&(v__ast__Fn[]) { method }, (_option*)(&_t59), sizeof(v__ast__Fn)); return _t59; } @@ -47878,7 +47943,7 @@ Option_v__ast__Fn v__ast__TypeSymbol_find_method_with_generic_parent(v__ast__Typ else { } ; - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__TypeSymbol_is_js_compatible(v__ast__TypeSymbol* t) { @@ -47895,7 +47960,7 @@ bool v__ast__TypeSymbol_is_js_compatible(v__ast__TypeSymbol* t) { bool _t3 = true; return _t3; } - if (t->info._typ == 475 /* v.ast.SumType */) { + if (t->info._typ == 476 /* 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); @@ -47920,7 +47985,7 @@ multi_return_bool_bool_int v__ast__TypeSymbol_str_method_info(v__ast__TypeSymbol bool has_str_method = false; bool expects_ptr = false; int nr_args = 0; - Option_v__ast__Fn _t1; + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method_with_generic_parent(t, _SLIT("str")), _t1.state == 0) { v__ast__Fn sym_str_method = *(v__ast__Fn*)_t1.data; has_str_method = true; @@ -47932,68 +47997,68 @@ multi_return_bool_bool_int v__ast__TypeSymbol_str_method_info(v__ast__TypeSymbol return (multi_return_bool_bool_int){.arg0=has_str_method, .arg1=expects_ptr, .arg2=nr_args}; } -Option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name) { - if (t->info._typ == 469 /* v.ast.Aggregate */) { - Option_v__ast__StructField _t1 = v__ast__Aggregate_find_field(&(*t->info._v__ast__Aggregate), name); +_option_v__ast__StructField v__ast__TypeSymbol_find_field(v__ast__TypeSymbol* t, string name) { + if (t->info._typ == 470 /* 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 == 456 /* v.ast.Struct */) { - Option_v__ast__StructField _t2 = v__ast__Struct_find_field(&(*t->info._v__ast__Struct), name); + else if (t->info._typ == 457 /* 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 == 474 /* v.ast.Interface */) { - Option_v__ast__StructField _t3 = v__ast__Interface_find_field(&(*t->info._v__ast__Interface), name); + else if (t->info._typ == 475 /* 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 == 475 /* v.ast.SumType */) { - Option_v__ast__StructField _t4 = v__ast__SumType_find_field(&(*t->info._v__ast__SumType), name); + else if (t->info._typ == 476 /* v.ast.SumType */) { + _option_v__ast__StructField _t4 = v__ast__SumType_find_field(&(*t->info._v__ast__SumType), name); return _t4; } else { - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } ; - return (Option_v__ast__StructField){0}; + return (_option_v__ast__StructField){0}; } -VV_LOCAL_SYMBOL Option_v__ast__StructField v__ast__Aggregate_find_field(v__ast__Aggregate* a, string name) { +VV_LOCAL_SYMBOL _option_v__ast__StructField v__ast__Aggregate_find_field(v__ast__Aggregate* a, string name) { Array_v__ast__StructField _t1 = a->fields; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__StructField* field = ((v__ast__StructField*)_t1.data) + _t2; if (string__eq(field->name, name)) { - Option_v__ast__StructField _t3; - opt_ok(&(v__ast__StructField[]) { *field }, (Option*)(&_t3), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t3; + opt_ok2(&(v__ast__StructField[]) { *field }, (_option*)(&_t3), sizeof(v__ast__StructField)); return _t3; } } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__StructField v__ast__Interface_find_field(v__ast__Interface* i, string name) { +_option_v__ast__StructField v__ast__Interface_find_field(v__ast__Interface* i, string name) { Array_v__ast__StructField _t1 = i->fields; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__StructField* field = ((v__ast__StructField*)_t1.data) + _t2; if (string__eq(field->name, name)) { - Option_v__ast__StructField _t3; - opt_ok(&(v__ast__StructField[]) { *field }, (Option*)(&_t3), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t3; + opt_ok2(&(v__ast__StructField[]) { *field }, (_option*)(&_t3), sizeof(v__ast__StructField)); return _t3; } } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } -Option_v__ast__Fn v__ast__Interface_find_method(v__ast__Interface* i, string name) { +_option_v__ast__Fn v__ast__Interface_find_method(v__ast__Interface* i, string name) { Array_v__ast__Fn _t1 = i->methods; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__Fn* method = ((v__ast__Fn*)_t1.data) + _t2; if (string__eq(method->name, name)) { - Option_v__ast__Fn _t3; - opt_ok(&(v__ast__Fn[]) { *method }, (Option*)(&_t3), sizeof(v__ast__Fn)); + _option_v__ast__Fn _t3; + opt_ok2(&(v__ast__Fn[]) { *method }, (_option*)(&_t3), sizeof(v__ast__Fn)); return _t3; } } - return (Option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Fn){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__Interface_has_method(v__ast__Interface* i, string name) { @@ -48009,21 +48074,21 @@ bool v__ast__Interface_has_method(v__ast__Interface* i, string name) { return _t4; } -Option_v__ast__StructField v__ast__Struct_find_field(v__ast__Struct* s, string name) { +_option_v__ast__StructField v__ast__Struct_find_field(v__ast__Struct* s, string name) { Array_v__ast__StructField _t1 = s->fields; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__StructField* field = ((v__ast__StructField*)_t1.data) + _t2; if (string__eq(field->name, name)) { - Option_v__ast__StructField _t3; - opt_ok(&(v__ast__StructField[]) { *field }, (Option*)(&_t3), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t3; + opt_ok2(&(v__ast__StructField[]) { *field }, (_option*)(&_t3), sizeof(v__ast__StructField)); return _t3; } } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__StructField v__ast__Struct_get_field(v__ast__Struct* s, string name) { - Option_v__ast__StructField _t1; + _option_v__ast__StructField _t1; if (_t1 = v__ast__Struct_find_field(s, name), _t1.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t1.data; v__ast__StructField _t2 = field; @@ -48034,17 +48099,17 @@ v__ast__StructField v__ast__Struct_get_field(v__ast__Struct* s, string name) { return (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}; } -Option_v__ast__StructField v__ast__SumType_find_field(v__ast__SumType* s, string name) { +_option_v__ast__StructField v__ast__SumType_find_field(v__ast__SumType* s, string name) { Array_v__ast__StructField _t1 = s->fields; for (int _t2 = 0; _t2 < _t1.len; ++_t2) { v__ast__StructField* field = ((v__ast__StructField*)_t1.data) + _t2; if (string__eq(field->name, name)) { - Option_v__ast__StructField _t3; - opt_ok(&(v__ast__StructField[]) { *field }, (Option*)(&_t3), sizeof(v__ast__StructField)); + _option_v__ast__StructField _t3; + opt_ok2(&(v__ast__StructField[]) { *field }, (_option*)(&_t3), sizeof(v__ast__StructField)); return _t3; } } - return (Option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__StructField){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } bool v__ast__Interface_defines_method(v__ast__Interface* i, string name) { @@ -48071,8 +48136,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 == 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)))) { + if ((right)->_typ == 293 /* v.ast.CallExpr */ || (right)->_typ == 308 /* v.ast.IfExpr */ || (right)->_typ == 315 /* v.ast.LockExpr */ || (right)->_typ == 317 /* v.ast.MatchExpr */) { + if (((right)->_typ == 308 /* v.ast.IfExpr */ || (right)->_typ == 317 /* v.ast.MatchExpr */) && node->left.len == node->right.len && !is_decl && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 307 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node->left, i)))._typ == 327 /* 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); @@ -48092,22 +48157,22 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; right_len = 0; } } - if ((right)->_typ == 310 /* v.ast.InfixExpr */) { + if ((right)->_typ == 311 /* 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 == 306 /* v.ast.Ident */) { + if ((right)->_typ == 307 /* 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 == 318 /* v.ast.None */) { + if ((right)->_typ == 319 /* 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 == 292 /* v.ast.CallExpr */) { + if ((right_first)._typ == 293 /* 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) { @@ -48129,21 +48194,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 == 292 /* v.ast.CallExpr */) { + if ((left)->_typ == 293 /* 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) { + } else if ((left)->_typ == 324 /* v.ast.PrefixExpr */) { + if (((*left->_v__ast__PrefixExpr).right)._typ == 293 /* 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 == 309 /* v.ast.IndexExpr */) { - if (((*left->_v__ast__IndexExpr).index)._typ == 324 /* v.ast.RangeExpr */) { + } else if ((left)->_typ == 310 /* v.ast.IndexExpr */) { + if (((*left->_v__ast__IndexExpr).index)._typ == 325 /* 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 == 306 /* v.ast.Ident */ || (left)->_typ == 326 /* v.ast.SelectorExpr */) { + if ((left)->_typ == 307 /* v.ast.Ident */ || (left)->_typ == 327 /* v.ast.SelectorExpr */) { c->prevent_sum_type_unwrapping_once = true; } left_type = v__checker__Checker_expr(c, *left); @@ -48151,8 +48216,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 == 306 /* v.ast.Ident */) { - if (((*left->_v__ast__Ident).info)._typ == 416 /* v.ast.IdentVar */) { + if ((left)->_typ == 307 /* v.ast.Ident */) { + if (((*left->_v__ast__Ident).info)._typ == 417 /* 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; } } @@ -48166,28 +48231,28 @@ 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 == 306 /* v.ast.Ident */) { + if ((right)._typ == 307 /* v.ast.Ident */) { v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); - if ((right_sym->info)._typ == 456 /* v.ast.Struct */) { + if ((right_sym->info)._typ == 457 /* v.ast.Struct */) { if ((*right_sym->info._v__ast__Struct).generic_types.len > 0) { - Option_v__ast__ScopeObject _t2; + _option_v__ast__ScopeObject _t2; if (_t2 = v__ast__Scope_find((*right._v__ast__Ident).scope, (*right._v__ast__Ident).name), _t2.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t2.data; right_type = (*(obj.typ)); } } } - } else if ((right)._typ == 298 /* v.ast.ComptimeSelector */) { + } else if ((right)._typ == 299 /* v.ast.ComptimeSelector */) { right_type = c->comptime_fields_default_type; } if (is_decl) { - if ((right)._typ == 331 /* v.ast.StructInit */) { + if ((right)._typ == 332 /* 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 == 323 /* v.ast.PrefixExpr */) { - if ((*right._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*right._v__ast__PrefixExpr).right)._typ == 331 /* v.ast.StructInit */) { + } else if ((right)._typ == 324 /* v.ast.PrefixExpr */) { + if ((*right._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*right._v__ast__PrefixExpr).right)._typ == 332 /* v.ast.StructInit */) { right_type = v__checker__Checker_expr(c, right); } } @@ -48197,7 +48262,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 == 311 /* v.ast.IntegerLiteral */) { + if ((right)._typ == 312 /* 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); @@ -48212,11 +48277,11 @@ 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 == 306 /* v.ast.Ident */) { - if (((*right._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((right)._typ == 307 /* v.ast.Ident */) { + if (((*right._v__ast__Ident).obj)._typ == 365 /* 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); + _option_v__ast__Var_ptr _t3 = v__ast__Scope_find_var(c->fn_scope, (*(*right._v__ast__Ident).obj._v__ast__Var).name); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; *(v__ast__Var**) _t3.data = obj; @@ -48234,21 +48299,21 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } } - 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)) { + if (!is_decl && (left)->_typ == 307 /* 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="), /*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 == 306 /* v.ast.Ident */) { + if (left->_typ == 307 /* 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 != 416 /* v.ast.IdentVar */) { + } else if (((*left->_v__ast__Ident).info)._typ != 417 /* 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) { @@ -48257,7 +48322,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; 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, 416) /*expected idx: 416, 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, 417) /*expected idx: 417, 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) { @@ -48276,7 +48341,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 == 364 /* v.ast.Var */) { + if ((*left->_v__ast__Ident).obj._typ == 365 /* 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; @@ -48287,14 +48352,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 == 311 /* v.ast.IntegerLiteral */) { + if ((right)._typ == 312 /* 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 == 363 /* v.ast.GlobalField */) { + else if ((*left->_v__ast__Ident).obj._typ == 364 /* v.ast.GlobalField */) { (*(*left->_v__ast__Ident).obj._v__ast__GlobalField).typ = left_type; } @@ -48304,22 +48369,22 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } if (is_decl) { 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; + _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 == 362 /* v.ast.ConstField */) { + if ((obj)._typ == 363 /* 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 == 323 /* v.ast.PrefixExpr */) { + else if (left->_typ == 324 /* 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 == 306 /* v.ast.Ident */) { - if (((*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + } else if (((*left->_v__ast__PrefixExpr).right)._typ == 307 /* v.ast.Ident */) { + if (((*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj)._typ == 365 /* v.ast.Var */) { (*(*(*left->_v__ast__PrefixExpr).right._v__ast__Ident).obj._v__ast__Var).is_used = true; } } @@ -48328,8 +48393,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 == 326 /* v.ast.SelectorExpr */) { - if (((*left->_v__ast__SelectorExpr).expr)._typ == 309 /* v.ast.IndexExpr */) { + else if (left->_typ == 327 /* v.ast.SelectorExpr */) { + if (((*left->_v__ast__SelectorExpr).expr)._typ == 310 /* 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; } @@ -48337,7 +48402,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } else { - if ((left)->_typ == 309 /* v.ast.IndexExpr */) { + if ((left)->_typ == 310 /* 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); } @@ -48360,26 +48425,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 == 306 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 306 /* v.ast.Ident */) { + 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 == 307 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 307 /* 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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 == 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 (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 == 307 /* v.ast.Ident */ && !v__ast__Expr_is_blank_ident(/*rec*/*left) && (right)._typ == 307 /* v.ast.Ident */) { + if ((right_sym->info)._typ == 480 /* 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 == 306 /* 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 == 307 /* 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); @@ -48391,7 +48456,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; 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 `"), /*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 == 331 /* 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 == 332 /* 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)) { @@ -48506,10 +48571,10 @@ 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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, name: v.ast.Struct */ ).generic_types.len > 0) { continue; } - Option_v__ast__Fn _t8; + _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)) { @@ -48528,7 +48593,7 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } if (!is_blank_ident && !v__ast__Expr_is_auto_deref_var(/*rec*/*left) && !v__ast__Expr_is_auto_deref_var(right) && right_sym->kind != v__ast__Kind__placeholder && left_sym->kind != v__ast__Kind__interface_ && !v__ast__Type_has_flag(right_type, v__ast__TypeFlag__generic) && !v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic)) { - Option_void _t9 = v__checker__Checker_check_expected(c, right_type_unwrapped, left_type_unwrapped); + _option_void _t9 = v__checker__Checker_check_expected(c, right_type_unwrapped, left_type_unwrapped); if (_t9.state != 0 && _t9.err._typ != _IError_None___index) { IError err = _t9.err; if (v__ast__Type_is_ptr(left_type_unwrapped) && v__ast__Type_is_int(right_type_unwrapped) && (node->op == v__token__Kind__plus_assign || node->op == v__token__Kind__minus_assign)) { @@ -48551,13 +48616,13 @@ bool v__checker__Checker_assign_stmt_defer_0 = false; } } } - if ((right_first)._typ == 323 /* v.ast.PrefixExpr */) { + if ((right_first)._typ == 324 /* 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 == 306 /* v.ast.Ident */) { + if ((left_first)._typ == 307 /* 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 == 416 /* v.ast.IdentVar */) { + if (((*left_first._v__ast__Ident).info)._typ == 417 /* 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; @@ -48565,8 +48630,8 @@ 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 == 306 /* v.ast.Ident */) { - if (((*right_node.right._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((right_node.right)._typ == 307 /* v.ast.Ident */) { + if (((*right_node.right._v__ast__Ident).obj)._typ == 365 /* v.ast.Var */) { v__ast__Var v = (*(*right_node.right._v__ast__Ident).obj._v__ast__Var); right_type0 = v.typ; } @@ -48618,7 +48683,7 @@ bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v bool _t4 = true; return _t4; } - if (v__ast__Type_alias_eq(expected, _const_v__ast__bool_type) && (v__ast__Type_is_any_kind_of_pointer(got) || v__ast__Type_is_int(got))) { + if ((v__ast__Type_alias_eq(expected, _const_v__ast__bool_type) && (v__ast__Type_is_any_kind_of_pointer(got) || v__ast__Type_is_int(got))) || ((v__ast__Type_is_any_kind_of_pointer(expected) || v__ast__Type_is_int(expected)) && v__ast__Type_alias_eq(got, _const_v__ast__bool_type))) { bool _t5 = true; return _t5; } @@ -48642,126 +48707,133 @@ bool v__checker__Checker_check_types(v__checker__Checker* c, v__ast__Type got, v return _t8; } } else if (got_sym->kind == v__ast__Kind__array_fixed) { - if (v__ast__TypeSymbol_is_number(expected_sym)) { + if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) { bool _t9 = true; return _t9; - } else if (v__ast__Type_is_any_kind_of_pointer(expected)) { - bool _t10 = true; - return _t10; } } else if (expected_sym->kind == v__ast__Kind__array_fixed) { if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) { - bool _t11 = true; - return _t11; + bool _t10 = true; + return _t10; } else if (got_sym->kind == v__ast__Kind__array) { - v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; - v__ast__Array info2 = /* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((expected_sym->info)._v__ast__ArrayFixed,(expected_sym->info)._typ, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ; + v__ast__Array info2 = /* as */ *(v__ast__Array*)__as_cast((got_sym->info)._v__ast__Array,(got_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ; if (v__checker__Checker_check_types(c, info.elem_type, info2.elem_type)) { - bool _t12 = true; - return _t12; + bool _t11 = true; + return _t11; } } + } else if (got_sym->kind == v__ast__Kind__array) { + if (v__ast__TypeSymbol_is_number(expected_sym) || v__ast__Type_is_any_kind_of_pointer(expected)) { + bool _t12 = true; + return _t12; + } + } else if (expected_sym->kind == v__ast__Kind__array) { + if (v__ast__TypeSymbol_is_number(got_sym) && v__ast__Type_is_any_kind_of_pointer(got)) { + bool _t13 = true; + return _t13; + } } if (expected_sym->kind == v__ast__Kind__enum_ && v__ast__TypeSymbol_is_number(got_sym)) { - bool _t13 = true; - return _t13; + bool _t14 = true; + return _t14; } if (got_is_ptr && exp_is_ptr) { if (v__ast__TypeSymbol_is_number(expected_sym) && v__ast__TypeSymbol_is_number(got_sym)) { - bool _t14 = true; - return _t14; + bool _t15 = true; + return _t15; } } } if (got_is_ptr && exp_is_ptr) { if (v__ast__Type_nr_muls(got) != v__ast__Type_nr_muls(expected)) { - bool _t15 = false; - return _t15; + bool _t16 = false; + return _t16; } } int exp_idx = v__ast__Type_idx(expected); int got_idx = v__ast__Type_idx(got); if (exp_idx == got_idx) { - bool _t16 = true; - return _t16; + bool _t17 = true; + return _t17; } if (exp_idx == _const_v__ast__voidptr_type_idx || exp_idx == _const_v__ast__byteptr_type_idx || (v__ast__Type_is_ptr(expected) && v__ast__Type_idx(v__ast__Type_deref(expected)) == _const_v__ast__byte_type_idx)) { if (v__ast__Type_is_ptr(got) || v__ast__Type_is_pointer(got)) { - bool _t17 = true; - return _t17; - } - } - if (v__ast__Type_is_real_pointer(expected)) { - if (v__ast__Type_alias_eq(got, _const_v__ast__int_literal_type)) { bool _t18 = true; return _t18; } } - if (got_idx == _const_v__ast__voidptr_type_idx || got_idx == _const_v__ast__byteptr_type_idx || (got_idx == _const_v__ast__byte_type_idx && v__ast__Type_is_ptr(got))) { - if (v__ast__Type_is_ptr(expected) || v__ast__Type_is_pointer(expected)) { + if (v__ast__Type_is_real_pointer(expected)) { + if (v__ast__Type_alias_eq(got, _const_v__ast__int_literal_type)) { bool _t19 = true; return _t19; } } + if (got_idx == _const_v__ast__voidptr_type_idx || got_idx == _const_v__ast__byteptr_type_idx || (got_idx == _const_v__ast__byte_type_idx && v__ast__Type_is_ptr(got))) { + if (v__ast__Type_is_ptr(expected) || v__ast__Type_is_pointer(expected)) { + bool _t20 = true; + return _t20; + } + } if (v__ast__Type_alias_eq(expected, _const_v__ast__charptr_type) && v__ast__Type_alias_eq(got, v__ast__Type_ref(_const_v__ast__char_type))) { - bool _t20 = true; - return _t20; + bool _t21 = true; + return _t21; } 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))) && 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 _t21 = true; - return _t21; - } 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 _t22 = false; + bool _t22 = true; return _t22; + } 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 _t23 = false; + return _t23; } } if (!v__checker__Checker_check_basic(c, got, expected)) { - bool _t23 = false; - return _t23; + bool _t24 = false; + return _t24; } if (v__ast__Type_is_number(got) && v__ast__Type_is_number(expected)) { if (v__ast__Type_alias_eq(got, _const_v__ast__rune_type) && v__ast__Type_alias_eq(expected, _const_v__ast__byte_type)) { - bool _t24 = true; - return _t24; - } else if (v__ast__Type_alias_eq(expected, _const_v__ast__rune_type) && v__ast__Type_alias_eq(got, _const_v__ast__byte_type)) { bool _t25 = true; return _t25; + } else if (v__ast__Type_alias_eq(expected, _const_v__ast__rune_type) && v__ast__Type_alias_eq(got, _const_v__ast__byte_type)) { + bool _t26 = true; + return _t26; } if (!v__ast__Type_alias_eq(v__checker__Checker_promote_num(c, expected, got), expected)) { - bool _t26 = false; - return _t26; + bool _t27 = false; + return _t27; } } if (v__ast__Type_has_flag(expected, v__ast__TypeFlag__generic)) { - bool _t27 = false; - return _t27; + bool _t28 = false; + return _t28; } - bool _t28 = true; - return _t28; + bool _t29 = true; + return _t29; } -Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg) { +_option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected_, v__ast__Language language, v__ast__CallArg arg) { if (got == 0) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("unexpected 0 type")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("unexpected 0 type")), .data={EMPTY_STRUCT_INITIALIZATION} }; } 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, name: v.ast.Array */ ; expected = exp_info.elem_type; } if (language == v__ast__Language__c) { if (v__ast__Type_is_number(got) && v__ast__Type_is_number(expected)) { - return (Option_void){0}; + return (_option_void){0}; } if ((v__ast__Type_idx(got) == _const_v__ast__bool_type_idx && (v__ast__Type_idx(expected) == _const_v__ast__int_type_idx || v__ast__Type_idx(expected) == _const_v__ast__int_literal_type_idx)) || (v__ast__Type_idx(expected) == _const_v__ast__bool_type_idx && (v__ast__Type_idx(got) == _const_v__ast__int_type_idx || v__ast__Type_idx(got) == _const_v__ast__int_literal_type_idx))) { - return (Option_void){0}; + return (_option_void){0}; } v__ast__TypeSymbol* exp_sym = v__ast__Table_sym(c->table, expected); if (v__ast__Type_is_ptr(expected) && exp_sym->language == v__ast__Language__c && (exp_sym->kind == v__ast__Kind__placeholder || exp_sym->kind == v__ast__Kind__struct_) && got == _const_v__ast__int_type_idx) { - return (Option_void){0}; + return (_option_void){0}; } } int idx_got = v__ast__Type_idx(got); @@ -48770,24 +48842,24 @@ Option_void v__checker__Checker_check_expected_call_arg(v__checker__Checker* c, int igot = ((int)(got)); int iexpected = ((int)(expected)); if ((igot == _const_v__ast__byteptr_type_idx && iexpected == 65545) || (iexpected == _const_v__ast__byteptr_type_idx && igot == 65545)) { - return (Option_void){0}; + return (_option_void){0}; } if ((igot == _const_v__ast__charptr_type_idx && iexpected == 65551) || (iexpected == _const_v__ast__charptr_type_idx && igot == 65551)) { - return (Option_void){0}; + return (_option_void){0}; } int muls_got = v__ast__Type_nr_muls(got); int muls_expected = v__ast__Type_nr_muls(expected); if (idx_got == _const_v__ast__byteptr_type_idx && idx_expected == _const_v__ast__byte_type_idx && muls_got + 1 == muls_expected) { - return (Option_void){0}; + return (_option_void){0}; } if (idx_expected == _const_v__ast__byteptr_type_idx && idx_got == _const_v__ast__byte_type_idx && muls_expected + 1 == muls_got) { - return (Option_void){0}; + return (_option_void){0}; } if (idx_got == _const_v__ast__charptr_type_idx && idx_expected == _const_v__ast__char_type_idx && muls_got + 1 == muls_expected) { - return (Option_void){0}; + return (_option_void){0}; } if (idx_expected == _const_v__ast__charptr_type_idx && idx_got == _const_v__ast__char_type_idx && muls_expected + 1 == muls_got) { - return (Option_void){0}; + return (_option_void){0}; } } v__ast__TypeSymbol* got_typ_sym = v__ast__Table_sym(c->table, got); @@ -48796,24 +48868,24 @@ 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 (v__checker__Checker_check_types(c, got, expected)) { if (language != v__ast__Language__v || v__ast__Type_is_ptr(expected) == v__ast__Type_is_ptr(got) || arg.is_mut || v__ast__Expr_is_auto_deref_var(arg.expr) || v__ast__Type_has_flag(got, v__ast__TypeFlag__shared_f) || !(v__ast__Table_sym(c->table, expected_)->kind == v__ast__Kind__array || v__ast__Table_sym(c->table, expected_)->kind == v__ast__Kind__map)) { - return (Option_void){0}; + return (_option_void){0}; } } else { 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 `"), /*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){ .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}; + 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(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(arg.expr)}}, {_SLIT("` (no value) used as value"), 0, { .d_c = 0 }}}))), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error( str_intp(2, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(arg.expr)}}, {_SLIT("` (no value) used as value"), 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){ .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} }; } 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 `"), /*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){ .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}; + return (_option_void){0}; } VV_LOCAL_SYMBOL bool v__checker__Checker_check_same_module(v__checker__Checker _v_toheap_c, v__ast__Type got, v__ast__Type expected) { @@ -48918,8 +48990,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, 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__FnType got_info = /* as */ *(v__ast__FnType*)__as_cast((got_type_sym->info)._v__ast__FnType,(got_type_sym->info)._typ, 484) /*expected idx: 484, 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, 484) /*expected idx: 484, 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) { @@ -48960,7 +49032,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, 471) /*expected idx: 471, 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, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type)) { v__ast__Type _t1 = left_type; return _t1; } @@ -48980,7 +49052,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker return _t4; } if (!node->ct_left_value_evaled) { - Option_v__ast__ComptTimeConstValue _t5; + _option_v__ast__ComptTimeConstValue _t5; if (_t5 = v__checker__Checker_eval_comptime_const_expr(c, node->left, 0), _t5.state == 0) { v__ast__ComptTimeConstValue lval = *(v__ast__ComptTimeConstValue*)_t5.data; node->ct_left_value_evaled = true; @@ -48988,7 +49060,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker } } if (!node->ct_right_value_evaled) { - Option_v__ast__ComptTimeConstValue _t6; + _option_v__ast__ComptTimeConstValue _t6; if (_t6 = v__checker__Checker_eval_comptime_const_expr(c, node->right, 0), _t6.state == 0) { v__ast__ComptTimeConstValue rval = *(v__ast__ComptTimeConstValue*)_t6.data; node->ct_right_value_evaled = true; @@ -49003,8 +49075,8 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker 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 != 302 /* v.ast.EmptyExpr */) { - Option_i64 _t7 = v__ast__ComptTimeConstValue_i64(node->ct_right_value); + if ((node->ct_right_value)._typ != 303 /* v.ast.EmptyExpr */) { + _option_i64 _t7 = v__ast__ComptTimeConstValue_i64(node->ct_right_value); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; *(i64*) _t7.data = -999; @@ -49023,7 +49095,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_check_shift(v__checker__Checker return _t9; } if (node->ct_left_value_evaled) { - Option_i64 _t10; + _option_i64 _t10; if (_t10 = v__ast__ComptTimeConstValue_i64(node->ct_left_value), _t10.state == 0) { i64 lval = *(i64*)_t10.data; if (lval < 0) { @@ -49087,10 +49159,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_17770 = type_hi; - v__ast__Type _var_17779 = type_lo; - type_hi = _var_17779; - type_lo = _var_17770; + v__ast__Type _var_18084 = type_hi; + v__ast__Type _var_18093 = type_lo; + type_hi = _var_18093; + type_lo = _var_18084; } int idx_hi = v__ast__Type_idx(type_hi); int idx_lo = v__ast__Type_idx(type_lo); @@ -49137,11 +49209,11 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_promote_num(v__checker__Checker return 0; } -Option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected) { +_option_void v__checker__Checker_check_expected(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected) { if (!v__checker__Checker_check_types(c, got, expected)) { - return (Option_void){ .state=2, .err=_v_error(v__checker__Checker_expected_msg(c, got, expected)), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(v__checker__Checker_expected_msg(c, got, expected)), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL string v__checker__Checker_expected_msg(v__checker__Checker* c, v__ast__Type got, v__ast__Type expected) { @@ -49182,7 +49254,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 == 456 /* v.ast.Struct */) { + if (sym->info._typ == 457 /* 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); @@ -49206,7 +49278,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } - else if (sym->info._typ == 474 /* v.ast.Interface */) { + else if (sym->info._typ == 475 /* 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); @@ -49230,7 +49302,7 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ } } } - else if (sym->info._typ == 475 /* v.ast.SumType */) { + else if (sym->info._typ == 476 /* 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); @@ -49269,7 +49341,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 == 483 /* v.ast.FnType */) { + if ((sym->info)._typ == 484 /* 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); @@ -49289,15 +49361,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, 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__Array arg_elem_info = /* as */ *(v__ast__Array*)__as_cast((arg_sym->info)._v__ast__Array,(arg_sym->info)._typ, 452) /*expected idx: 452, 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, 452) /*expected idx: 452, 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, name: v.ast.Array */ ; param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); } else { if (string__eq(param_elem_sym->name, gt_name)) { @@ -49307,15 +49379,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, 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__ArrayFixed arg_elem_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((arg_sym->info)._v__ast__ArrayFixed,(arg_sym->info)._typ, 480) /*expected idx: 480, 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, 480) /*expected idx: 480, 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, 479) /*expected idx: 479, 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, 480) /*expected idx: 480, 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, 479) /*expected idx: 479, 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, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ; param_elem_sym = v__ast__Table_sym(c->table, param_elem_info.elem_type); } else { if (string__eq(param_elem_sym->name, gt_name)) { @@ -49325,8 +49397,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, 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 */ ; + v__ast__Map arg_map_info = /* as */ *(v__ast__Map*)__as_cast((arg_sym->info)._v__ast__Map,(arg_sym->info)._typ, 453) /*expected idx: 453, 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, 453) /*expected idx: 453, 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; } @@ -49334,8 +49406,8 @@ void v__checker__Checker_infer_fn_generic_types(v__checker__Checker* c, v__ast__ typ = arg_map_info.value_type; } } else if (arg_sym->kind == v__ast__Kind__function && param_type_sym->kind == v__ast__Kind__function) { - v__ast__Fn arg_type_func = (/* as */ *(v__ast__FnType*)__as_cast((arg_sym->info)._v__ast__FnType,(arg_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ).func; - v__ast__Fn param_type_func = (/* as */ *(v__ast__FnType*)__as_cast((param_type_sym->info)._v__ast__FnType,(param_type_sym->info)._typ, 483) /*expected idx: 483, name: v.ast.FnType */ ).func; + v__ast__Fn arg_type_func = (/* as */ *(v__ast__FnType*)__as_cast((arg_sym->info)._v__ast__FnType,(arg_sym->info)._typ, 484) /*expected idx: 484, name: v.ast.FnType */ ).func; + v__ast__Fn param_type_func = (/* as */ *(v__ast__FnType*)__as_cast((param_type_sym->info)._v__ast__FnType,(param_type_sym->info)._typ, 484) /*expected idx: 484, name: v.ast.FnType */ ).func; if (param_type_func.params.len == arg_type_func.params.len) { for (int n = 0; n < param_type_func.params.len; ++n) { v__ast__Param fn_param = ((v__ast__Param*)param_type_func.params.data)[n]; @@ -49350,15 +49422,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 == 456 /* v.ast.Struct */) { + if (arg_sym->info._typ == 457 /* 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 == 474 /* v.ast.Interface */) { + else if (arg_sym->info._typ == 475 /* 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 == 475 /* v.ast.SumType */) { + else if (arg_sym->info._typ == 476 /* v.ast.SumType */) { generic_types = (*arg_sym->info._v__ast__SumType).generic_types; concrete_types = (*arg_sym->info._v__ast__SumType).concrete_types; } @@ -49485,7 +49557,7 @@ void v__checker__Checker_check(v__checker__Checker* c, v__ast__File* ast_file_) 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 == 342 /* v.ast.ConstDecl */ || (stmt)->_typ == 346 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 343 /* v.ast.ConstDecl */ || (stmt)->_typ == 347 /* v.ast.ExprStmt */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -49496,7 +49568,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 == 350 /* v.ast.GlobalDecl */) { + if ((stmt)->_typ == 351 /* v.ast.GlobalDecl */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -49507,7 +49579,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 != 342 /* v.ast.ConstDecl */ && (stmt)->_typ != 350 /* v.ast.GlobalDecl */ && (stmt)->_typ != 346 /* v.ast.ExprStmt */) { + if ((stmt)->_typ != 343 /* v.ast.ConstDecl */ && (stmt)->_typ != 351 /* v.ast.GlobalDecl */ && (stmt)->_typ != 347 /* v.ast.ExprStmt */) { c->expr_level = 0; v__checker__Checker_stmt(c, *stmt); } @@ -49531,7 +49603,7 @@ 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 == 364 /* v.ast.Var */) { + if (obj._typ == 365 /* 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: `"), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__Var).name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*obj._v__ast__Var).pos); } @@ -49708,7 +49780,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 == 219 /* v.ast.FnDecl */) { + if ((stmt)._typ == 220 /* 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); @@ -49745,7 +49817,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_valid_snake_case(v__checker__Chec } VV_LOCAL_SYMBOL string v__checker__stripped_name(string name) { - Option_int _t1 = string_last_index(name, _SLIT(".")); + _option_int _t1 = string_last_index(name, _SLIT(".")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(int*) _t1.data = -1; @@ -49764,13 +49836,13 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_valid_pascal_case(v__checker__Che } void v__checker__Checker_type_decl(v__checker__Checker* c, v__ast__TypeDecl node) { - if (node._typ == 280 /* v.ast.AliasTypeDecl */) { + if (node._typ == 281 /* v.ast.AliasTypeDecl */) { v__checker__Checker_alias_type_decl(c, (*node._v__ast__AliasTypeDecl)); } - else if (node._typ == 281 /* v.ast.FnTypeDecl */) { + else if (node._typ == 282 /* v.ast.FnTypeDecl */) { v__checker__Checker_fn_type_decl(c, (*node._v__ast__FnTypeDecl)); } - else if (node._typ == 282 /* v.ast.SumTypeDecl */) { + else if (node._typ == 283 /* v.ast.SumTypeDecl */) { v__checker__Checker_sum_type_decl(c, (*node._v__ast__SumTypeDecl)); } ; @@ -49780,7 +49852,7 @@ void v__checker__Checker_alias_type_decl(v__checker__Checker* c, v__ast__AliasTy if (!string__eq(c->file->mod.name, _SLIT("builtin"))) { v__checker__Checker_check_valid_pascal_case(c, node.name, _SLIT("type alias"), node.pos); } - Option_void _t1 = v__checker__Checker_ensure_type_exists(c, node.parent_type, node.type_pos); + _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node.parent_type, node.type_pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; return; @@ -49791,7 +49863,7 @@ void v__checker__Checker_alias_type_decl(v__checker__Checker* c, v__ast__AliasTy 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 `"), /*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, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type); + 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, 472) /*expected idx: 472, 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); @@ -49801,9 +49873,9 @@ 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, 483) /*expected idx: 483, 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, 484) /*expected idx: 484, 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); + _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) { IError err = _t1.err; } @@ -49815,7 +49887,7 @@ void v__checker__Checker_fn_type_decl(v__checker__Checker* c, v__ast__FnTypeDecl } for (int _t2 = 0; _t2 < fn_info.params.len; ++_t2) { v__ast__Param arg = ((v__ast__Param*)fn_info.params.data)[_t2]; - Option_void _t3 = v__checker__Checker_ensure_type_exists(c, arg.typ, arg.type_pos); + _option_void _t3 = v__checker__Checker_ensure_type_exists(c, arg.typ, arg.type_pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; return; @@ -49837,7 +49909,7 @@ void v__checker__Checker_sum_type_decl(v__checker__Checker* c, v__ast__SumTypeDe if (v__ast__Type_is_ptr(variant.typ)) { v__checker__Checker_error(c, _SLIT("sum type cannot hold a reference type"), variant.pos); } - Option_void _t2 = v__checker__Checker_ensure_type_exists(c, variant.typ, variant.pos); + _option_void _t2 = v__checker__Checker_ensure_type_exists(c, variant.typ, variant.pos); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -49875,7 +49947,7 @@ Array_v__ast__InterfaceEmbedding v__checker__Checker_expand_iface_embeds(v__chec for (int _t3 = 0; _t3 < iface_embeds.len; ++_t3) { v__ast__InterfaceEmbedding ie = ((v__ast__InterfaceEmbedding*)iface_embeds.data)[_t3]; v__ast__InterfaceDecl* _t5 = (v__ast__InterfaceDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, c->table->interfaces), &(int[]){ie.typ})); - Option_v__ast__InterfaceDecl _t4 = {0}; + _option_v__ast__InterfaceDecl _t4 = {0}; if (_t5) { *((v__ast__InterfaceDecl*)&_t4.data) = *((v__ast__InterfaceDecl*)_t5); } else { @@ -49914,19 +49986,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 == 304 /* v.ast.FloatLiteral */) { + if (expr._typ == 305 /* 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, /*115 &string*/0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__FloatLiteral).pos); } } - else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 312 /* 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, /*115 &string*/0xfe10, {.d_s = oper}}, {_SLIT(" by zero"), 0, { .d_c = 0 }}})), (*expr._v__ast__IntegerLiteral).pos); } } - else if (expr._typ == 293 /* v.ast.CastExpr */) { + else if (expr._typ == 294 /* v.ast.CastExpr */) { v__checker__Checker_check_div_mod_by_zero(c, (*expr._v__ast__CastExpr).expr, op_kind); } @@ -49974,12 +50046,12 @@ v__ast__Type former_expected_type; } v__ast__Type return_type = left_type; if (node->op != v__token__Kind__key_is) { - if (node->left._typ == 306 /* v.ast.Ident */) { + if (node->left._typ == 307 /* 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 == 326 /* v.ast.SelectorExpr */) { + else if (node->left._typ == 327 /* 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); } @@ -49989,12 +50061,12 @@ v__ast__Type former_expected_type; } ; } - if (node->right._typ == 306 /* v.ast.Ident */) { + if (node->right._typ == 307 /* 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 == 326 /* v.ast.SelectorExpr */) { + else if (node->right._typ == 327 /* 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); } @@ -50014,12 +50086,12 @@ v__ast__Type former_expected_type; } 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 == 311 /* v.ast.IntegerLiteral */) { + if (!is_left_type_signed && (node->right)._typ == 312 /* 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("`"), /*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 == 311 /* v.ast.IntegerLiteral */) { + } else if (!is_right_type_signed && (node->left)._typ == 312 /* 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 `"), /*115 &string*/0xfe10, {.d_s = rt}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node->left._v__ast__IntegerLiteral).pos); @@ -50045,7 +50117,7 @@ v__ast__Type former_expected_type; if (right_final->kind == (v__ast__Kind__array)) { if (!(left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_)) { v__ast__Type elem_type = v__ast__TypeSymbol_array_info(right_final).elem_type; - Option_void _t1 = v__checker__Checker_check_expected(c, left_type, elem_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 `"), /*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); @@ -50057,7 +50129,7 @@ v__ast__Type former_expected_type; } else if (right_final->kind == (v__ast__Kind__map)) { v__ast__Map map_info = v__ast__TypeSymbol_map_info(right_final); - Option_void _t2 = v__checker__Checker_check_expected(c, left_type, map_info.key_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 `"), /*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); @@ -50070,7 +50142,7 @@ v__ast__Type former_expected_type; else if (right_final->kind == (v__ast__Kind__array_fixed)) { if (!(left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_)) { v__ast__Type elem_type = v__ast__TypeSymbol_array_fixed_info(right_final).elem_type; - Option_void _t3 = v__checker__Checker_check_expected(c, left_type, elem_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 `"), /*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); @@ -50101,17 +50173,17 @@ v__ast__Type former_expected_type; case v__token__Kind__amp: case v__token__Kind__pipe: { - 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 ((right_sym->info)._typ == 472 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((right_sym->info)._v__ast__Alias,(right_sym->info)._typ, 472) /*expected idx: 472, 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, 472) /*expected idx: 472, 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, 472) /*expected idx: 472, 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 ((left_sym->info)._typ == 472 /* v.ast.Alias */ && (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 472) /*expected idx: 472, 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, 472) /*expected idx: 472, 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, 472) /*expected idx: 472, 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 == 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)))) { + } else if (!c->pref->translated && left_sym->kind == v__ast__Kind__alias && (left_sym->info)._typ == 472 /* 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, 472) /*expected idx: 472, 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; + _option_v__ast__Fn _t5; if (_t5 = v__ast__TypeSymbol_find_method(left_sym, v__token__Kind_str(node->op)), _t5.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t5.data; return_type = method.return_type; @@ -50128,9 +50200,9 @@ v__ast__Type former_expected_type; 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 == 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)))) { + } else if (!c->pref->translated && right_sym->kind == v__ast__Kind__alias && (right_sym->info)._typ == 472 /* 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, 472) /*expected idx: 472, 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; + _option_v__ast__Fn _t6; if (_t6 = v__ast__TypeSymbol_find_method(right_sym, v__token__Kind_str(node->op)), _t6.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t6.data; return_type = method.return_type; @@ -50150,7 +50222,7 @@ v__ast__Type former_expected_type; } if (!c->pref->translated && (left_sym->kind == v__ast__Kind__array || left_sym->kind == v__ast__Kind__array_fixed || left_sym->kind == v__ast__Kind__map || left_sym->kind == v__ast__Kind__struct_)) { if (v__ast__TypeSymbol_has_method_with_generic_parent(left_sym, v__token__Kind_str(node->op))) { - Option_v__ast__Fn _t7; + _option_v__ast__Fn _t7; if (_t7 = v__ast__TypeSymbol_find_method_with_generic_parent(left_sym, v__token__Kind_str(node->op)), _t7.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t7.data; return_type = method.return_type; @@ -50169,7 +50241,7 @@ v__ast__Type former_expected_type; } } 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_)) { if (v__ast__TypeSymbol_has_method_with_generic_parent(right_sym, v__token__Kind_str(node->op))) { - Option_v__ast__Fn _t8; + _option_v__ast__Fn _t8; if (_t8 = v__ast__TypeSymbol_find_method_with_generic_parent(right_sym, v__token__Kind_str(node->op)), _t8.state == 0) { v__ast__Fn method = *(v__ast__Fn*)_t8.data; return_type = method.return_type; @@ -50235,7 +50307,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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, 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) { @@ -50276,13 +50348,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 == 311 /* v.ast.IntegerLiteral */) { + if ((node->right)._typ == 312 /* 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 == 311 /* v.ast.IntegerLiteral */) { + if ((node->left)._typ == 312 /* 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); } @@ -50443,10 +50515,10 @@ v__ast__Type former_expected_type; { v__ast__Expr right_expr = node->right; v__ast__Type _t20 = 0; - if (right_expr._typ == 332 /* v.ast.TypeNode */) { + if (right_expr._typ == 333 /* v.ast.TypeNode */) { _t20 = (*right_expr._v__ast__TypeNode).typ; } - else if (right_expr._typ == 318 /* v.ast.None */) { + else if (right_expr._typ == 319 /* v.ast.None */) { _t20 = _const_v__ast__none_type_idx; } @@ -50462,12 +50534,12 @@ v__ast__Type former_expected_type; 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, 469) /*expected idx: 469, 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, 470) /*expected idx: 470, 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("`"), /*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 */) { + } else if ((left_sym->info)._typ == 476 /* 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("`"), /*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); } @@ -50520,7 +50592,7 @@ v__ast__Type former_expected_type; 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 == 310 /* v.ast.InfixExpr */) { + if ((node->left)._typ == 311 /* 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); } @@ -50629,8 +50701,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, 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 */ ; + v__ast__Enum left_enum = /* as */ *(v__ast__Enum*)__as_cast((left_sym->info)._v__ast__Enum,(left_sym->info)._typ, 486) /*expected idx: 486, 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, 486) /*expected idx: 486, 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); @@ -50684,14 +50756,14 @@ 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 == 293 /* v.ast.CastExpr */) { + if (expr._typ == 294 /* v.ast.CastExpr */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 298 /* v.ast.ComptimeSelector */) { + else if (expr._typ == 299 /* v.ast.ComptimeSelector */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 306 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + else if (expr._typ == 307 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 365 /* 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("`"), /*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); } @@ -50709,25 +50781,25 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im pos = (*expr._v__ast__Ident).pos; } } - } else if (((*expr._v__ast__Ident).obj)._typ == 362 /* v.ast.ConstField */ && Array_string_contains(c->const_names, (*expr._v__ast__Ident).name)) { + } else if (((*expr._v__ast__Ident).obj)._typ == 363 /* v.ast.ConstField */ && Array_string_contains(c->const_names, (*expr._v__ast__Ident).name)) { if (!c->inside_unsafe && !c->pref->translated) { 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 == 309 /* v.ast.IndexExpr */) { + else if (expr._typ == 310 /* 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 == 451 /* v.ast.Array */) { + if (left_sym->info._typ == 452 /* v.ast.Array */) { elem_type = (*left_sym->info._v__ast__Array).elem_type; kind = _SLIT("array"); } - else if (left_sym->info._typ == 479 /* v.ast.ArrayFixed */) { + else if (left_sym->info._typ == 480 /* v.ast.ArrayFixed */) { elem_type = (*left_sym->info._v__ast__ArrayFixed).elem_type; kind = _SLIT("fixed array"); } - else if (left_sym->info._typ == 452 /* v.ast.Map */) { + else if (left_sym->info._typ == 453 /* v.ast.Map */) { elem_type = (*left_sym->info._v__ast__Map).value_type; kind = _SLIT("map"); } @@ -50742,21 +50814,21 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im to_lock = mr_44503.arg0; pos = mr_44503.arg1; } - else if (expr._typ == 321 /* v.ast.ParExpr */) { + else if (expr._typ == 322 /* v.ast.ParExpr */) { multi_return_string_v__token__Pos mr_44572 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__ParExpr).expr); to_lock = mr_44572.arg0; pos = mr_44572.arg1; } - else if (expr._typ == 323 /* v.ast.PrefixExpr */) { + else if (expr._typ == 324 /* v.ast.PrefixExpr */) { multi_return_string_v__token__Pos mr_44644 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__PrefixExpr).right); to_lock = mr_44644.arg0; pos = mr_44644.arg1; } - else if (expr._typ == 326 /* v.ast.SelectorExpr */) { + else if (expr._typ == 327 /* v.ast.SelectorExpr */) { if ((*expr._v__ast__SelectorExpr).expr_type == 0) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - Option_void _t4 = v__checker__Checker_ensure_type_exists(c, (*expr._v__ast__SelectorExpr).expr_type, (*expr._v__ast__SelectorExpr).pos); + _option_void _t4 = v__checker__Checker_ensure_type_exists(c, (*expr._v__ast__SelectorExpr).expr_type, (*expr._v__ast__SelectorExpr).pos); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; @@ -50768,7 +50840,7 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im case v__ast__Kind__struct_: { bool has_field = true; - Option_v__ast__StructField _t6 = v__ast__Table_find_field_with_embeds(c->table, typ_sym, (*expr._v__ast__SelectorExpr).field_name); + _option_v__ast__StructField _t6 = v__ast__Table_find_field_with_embeds(c->table, typ_sym, (*expr._v__ast__SelectorExpr).field_name); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; has_field = false; @@ -50811,8 +50883,8 @@ 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, 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); + v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((typ_sym->info)._v__ast__Interface,(typ_sym->info)._typ, 475) /*expected idx: 475, 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); @@ -50831,8 +50903,8 @@ 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, 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); + v__ast__SumType sumtype_info = /* as */ *(v__ast__SumType*)__as_cast((typ_sym->info)._v__ast__SumType,(typ_sym->info)._typ, 476) /*expected idx: 476, 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); @@ -50906,7 +50978,7 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } ; } - else if (expr._typ == 292 /* v.ast.CallExpr */) { + else if (expr._typ == 293 /* v.ast.CallExpr */) { if (string__eq((*expr._v__ast__CallExpr).name, _SLIT("slice"))) { multi_return_string_v__token__Pos mr_47931 = v__checker__Checker_fail_if_immutable(c, (*expr._v__ast__CallExpr).left); to_lock = mr_47931.arg0; @@ -50916,14 +50988,14 @@ VV_LOCAL_SYMBOL multi_return_string_v__token__Pos v__checker__Checker_fail_if_im } } } - else if (expr._typ == 286 /* v.ast.ArrayInit */) { + else if (expr._typ == 287 /* 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 == 331 /* v.ast.StructInit */) { + else if (expr._typ == 332 /* v.ast.StructInit */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } - else if (expr._typ == 310 /* v.ast.InfixExpr */) { + else if (expr._typ == 311 /* v.ast.InfixExpr */) { return (multi_return_string_v__token__Pos){.arg0=_SLIT(""), .arg1=pos}; } @@ -50953,12 +51025,12 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, bool _t2 = true; return _t2; } - if ((inter_sym->info)._typ == 474 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 475 /* 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 == 474 /* v.ast.Interface */) { + if ((parent_sym->info)._typ == 475 /* v.ast.Interface */) { generic_type = (*inter_sym->info._v__ast__Interface).parent_type; generic_info = (*parent_sym->info._v__ast__Interface); } @@ -50980,7 +51052,7 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, return _t5; } } - if ((inter_sym->info)._typ == 474 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 475 /* 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)) { @@ -51001,18 +51073,18 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, 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 `"), /*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, 474) /*expected idx: 474, 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, 475) /*expected idx: 475, 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]; - Option_v__ast__Fn _t11 = v__ast__Table_find_method_with_embeds(c->table, typ_sym, imethod.name); + _option_v__ast__Fn _t11 = v__ast__Table_find_method_with_embeds(c->table, typ_sym, imethod.name); 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("`"), /*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); + _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("`"), /*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); @@ -51035,10 +51107,10 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_type_implements(v__checker__Checker* c, } } } - if ((inter_sym->info)._typ == 474 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 475 /* 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; + _option_v__ast__StructField _t15; if (_t15 = v__ast__Table_find_field_with_embeds(c->table, typ_sym, ifield.name), _t15.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t15.data; if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { @@ -51068,7 +51140,7 @@ 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 == 292 /* v.ast.CallExpr */) { + if ((expr)._typ == 293 /* 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("!"))); @@ -51088,7 +51160,7 @@ v__ast__Type v__checker__Checker_check_expr_opt_call(v__checker__Checker* c, v__ } 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 == 309 /* v.ast.IndexExpr */) { + } else if ((expr)._typ == 310 /* 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, v__ast__Type_set_flag(ret_type, v__ast__TypeFlag__optional)); } @@ -51129,7 +51201,7 @@ void v__checker__Checker_check_or_expr(v__checker__Checker* c, v__ast__OrExpr no 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 == 346 /* v.ast.ExprStmt */) { + if (stmt._typ == 347 /* 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); @@ -51141,13 +51213,13 @@ 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 == 307 /* v.ast.IfExpr */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 308 /* 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 == 316 /* v.ast.MatchExpr */) { + } else if (((*stmt._v__ast__ExprStmt).expr)._typ == 317 /* 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); @@ -51160,13 +51232,13 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* 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 == 340 /* v.ast.BranchStmt */) { + else if (stmt._typ == 341 /* 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 == 357 /* v.ast.Return */) { + else if (stmt._typ == 358 /* v.ast.Return */) { } else { @@ -51174,14 +51246,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_or_last_stmt(v__checker__Checker* 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 == 346 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).expr._typ == 307 /* v.ast.IfExpr */) { + } else if ((stmt)._typ == 347 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 308 /* 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 == 316 /* v.ast.MatchExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 317 /* 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); @@ -51214,14 +51286,14 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S c->using_new_err_struct = true; } int name_type = 0; - if (node->expr._typ == 306 /* v.ast.Ident */) { + if (node->expr._typ == 307 /* 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 == 333 /* v.ast.TypeOf */) { + else if (node->expr._typ == 334 /* v.ast.TypeOf */) { name_type = v__checker__Checker_expr(c, (*node->expr._v__ast__TypeOf).expr); } @@ -51256,8 +51328,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 == 306 /* v.ast.Ident */) { - if (((*node->expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((node->expr)._typ == 307 /* v.ast.Ident */) { + if (((*node->expr._v__ast__Ident).obj)._typ == 365 /* v.ast.Var */) { typ = (*(*node->expr._v__ast__Ident).obj._v__ast__Var).typ; } } @@ -51269,7 +51341,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 == 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)) { + if (v__ast__Type_has_flag(node->expr_type, v__ast__TypeFlag__optional) && !((node->expr)._typ == 307 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->expr)._v__ast__Ident,(node->expr)._typ, 307) /*expected idx: 307, 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; @@ -51293,7 +51365,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S 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){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}); - 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) { + if (field_name.len > 0 && u8_is_capital(string_at(field_name, 0)) && (sym->info)._typ == 457 /* 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); @@ -51304,7 +51376,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S } } } else { - Option_v__ast__StructField _t12; + _option_v__ast__StructField _t12; if (_t12 = v__ast__Table_find_field(c->table, sym, field_name), _t12.state == 0) { v__ast__StructField f = *(v__ast__StructField*)_t12.data; has_field = true; @@ -51313,7 +51385,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S IError err = _t12.err; has_field = true; Array_v__ast__Type embed_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t13 = v__ast__Table_find_field_from_embeds(c->table, sym, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t13 = v__ast__Table_find_field_from_embeds(c->table, sym, field_name); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; if ((IError_name_table[err._typ]._method_msg(err._object)).len != 0) { @@ -51332,7 +51404,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S } } if (!c->inside_unsafe) { - if ((sym->info)._typ == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* 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); } @@ -51340,7 +51412,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S } if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic) && !has_field) { v__ast__TypeSymbol* gs = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, typ)); - Option_v__ast__StructField _t14; + _option_v__ast__StructField _t14; if (_t14 = v__ast__Table_find_field(c->table, gs, field_name), _t14.state == 0) { v__ast__StructField f = *(v__ast__StructField*)_t14.data; has_field = true; @@ -51349,7 +51421,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S IError err = _t14.err; has_field = true; Array_v__ast__Type embed_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t15 = v__ast__Table_find_field_from_embeds(c->table, gs, field_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t15 = v__ast__Table_find_field_from_embeds(c->table, gs, field_name); if (_t15.state != 0) { /*or block*/ IError err = _t15.err; if ((IError_name_table[err._typ]._method_msg(err._object)).len != 0) { @@ -51367,7 +51439,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S } } if (sym->idx == _const_v__ast__error_type_idx && !c->is_just_builtin_mod && (string__eq(field_name, _SLIT("msg")) || string__eq(field_name, _SLIT("code")))) { - Option_v__ast__Fn _t16 = v__ast__Table_find_method(c->table, sym, field_name); + _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: "), /*115 &IError*/0xfe10, {.d_s = IError_str(err)}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); @@ -51388,7 +51460,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S 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_) { if (!prevent_sum_type_unwrapping_once) { - Option_v__ast__ScopeStructField _t19; + _option_v__ast__ScopeStructField _t19; if (_t19 = v__ast__Scope_find_struct_field(node->scope, v__ast__Expr_str(node->expr), typ, field_name), _t19.state == 0) { v__ast__ScopeStructField scope_field = *(v__ast__ScopeStructField*)_t19.data; v__ast__Type _t20 = (*(v__ast__Type*)array_last(scope_field.smartcasts)); @@ -51411,7 +51483,7 @@ v__ast__Type v__checker__Checker_selector_expr(v__checker__Checker* c, v__ast__S 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 == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* 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); } @@ -51459,7 +51531,7 @@ void v__checker__Checker_const_decl(v__checker__Checker* c, v__ast__ConstDecl* n c->const_decl = field->name; array_push((array*)&c->const_deps, _MOV((string[]){ string_clone(field->name) })); v__ast__Type typ = v__checker__Checker_check_expr_opt_call(c, field->expr, v__checker__Checker_expr(c, field->expr)); - Option_v__ast__ComptTimeConstValue _t4; + _option_v__ast__ComptTimeConstValue _t4; if (_t4 = v__checker__Checker_eval_comptime_const_expr(c, field->expr, 0), _t4.state == 0) { v__ast__ComptTimeConstValue ct_value = *(v__ast__ComptTimeConstValue*)_t4.data; field->comptime_expr_value = ct_value; @@ -51489,7 +51561,7 @@ void v__checker__Checker_enum_decl(v__checker__Checker* c, v__ast__EnumDecl* nod } } if (field->has_expr) { - if (field->expr._typ == 311 /* v.ast.IntegerLiteral */) { + if (field->expr._typ == 312 /* 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 `"), /*100 &i64*/0xfe09, {.d_i64 = val}}, {_SLIT("` overflows int"), 0, { .d_c = 0 }}})), (*field->expr._v__ast__IntegerLiteral).pos); @@ -51498,14 +51570,14 @@ void v__checker__Checker_enum_decl(v__checker__Checker* c, v__ast__EnumDecl* nod } array_push((array*)&seen, _MOV((i64[]){ ((i64)(val)) })); } - else if (field->expr._typ == 323 /* v.ast.PrefixExpr */) { + else if (field->expr._typ == 324 /* v.ast.PrefixExpr */) { } - else if (field->expr._typ == 310 /* v.ast.InfixExpr */) { + else if (field->expr._typ == 311 /* v.ast.InfixExpr */) { v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*field->expr._v__ast__InfixExpr)); } else { - if ((field->expr)._typ == 306 /* v.ast.Ident */) { + if ((field->expr)._typ == 307 /* v.ast.Ident */) { if ((*field->expr._v__ast__Ident).language == v__ast__Language__c) { continue; } @@ -51548,38 +51620,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 == 344 /* v.ast.EmptyStmt */) { + if (node._typ == 345 /* v.ast.EmptyStmt */) { if (c->pref->is_verbose) { eprintln(_SLIT("Checker.stmt() EmptyStmt")); print_backtrace(); } } - else if (node._typ == 317 /* v.ast.NodeError */) { + else if (node._typ == 318 /* v.ast.NodeError */) { } - else if (node._typ == 336 /* v.ast.AsmStmt */) { + else if (node._typ == 337 /* v.ast.AsmStmt */) { v__checker__Checker_asm_stmt(c, (voidptr)&/*qq*/(*node._v__ast__AsmStmt)); } - else if (node._typ == 337 /* v.ast.AssertStmt */) { + else if (node._typ == 338 /* v.ast.AssertStmt */) { v__checker__Checker_assert_stmt(c, (*node._v__ast__AssertStmt)); } - else if (node._typ == 338 /* v.ast.AssignStmt */) { + else if (node._typ == 339 /* v.ast.AssignStmt */) { v__checker__Checker_assign_stmt(c, (voidptr)&/*qq*/(*node._v__ast__AssignStmt)); } - else if (node._typ == 339 /* v.ast.Block */) { + else if (node._typ == 340 /* v.ast.Block */) { v__checker__Checker_block(c, (*node._v__ast__Block)); } - else if (node._typ == 340 /* v.ast.BranchStmt */) { + else if (node._typ == 341 /* v.ast.BranchStmt */) { v__checker__Checker_branch_stmt(c, (*node._v__ast__BranchStmt)); } - else if (node._typ == 341 /* v.ast.ComptimeFor */) { + else if (node._typ == 342 /* v.ast.ComptimeFor */) { v__checker__Checker_comptime_for(c, (*node._v__ast__ComptimeFor)); } - else if (node._typ == 342 /* v.ast.ConstDecl */) { + else if (node._typ == 343 /* 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 == 343 /* v.ast.DeferStmt */) { + else if (node._typ == 344 /* 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) })); @@ -51590,7 +51662,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 == 416 /* v.ast.IdentVar */) { + if ((id.info)._typ == 417 /* 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){.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = _SLIT(""),.info = {0},.scope = 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,},.tok_kind = 0,.language = 0,.kind = 0,.comptime = 0,.is_mut = 0,}); continue; @@ -51607,20 +51679,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 == 345 /* v.ast.EnumDecl */) { + else if (node._typ == 346 /* v.ast.EnumDecl */) { v__checker__Checker_enum_decl(c, (voidptr)&/*qq*/(*node._v__ast__EnumDecl)); } - else if (node._typ == 346 /* v.ast.ExprStmt */) { + else if (node._typ == 347 /* 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 == 309 /* v.ast.IndexExpr */) { + if ((*node._v__ast__ExprStmt).expr._typ == 310 /* 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 == 323 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__ExprStmt).expr._typ == 324 /* 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; @@ -51631,7 +51703,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 == 310 /* v.ast.InfixExpr */) { + if (((*node._v__ast__ExprStmt).expr)._typ == 311 /* 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) { @@ -51642,24 +51714,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 == 219 /* v.ast.FnDecl */) { + else if (node._typ == 220 /* v.ast.FnDecl */) { v__checker__Checker_fn_decl(c, (voidptr)&/*qq*/(*node._v__ast__FnDecl)); } - else if (node._typ == 347 /* v.ast.ForCStmt */) { + else if (node._typ == 348 /* v.ast.ForCStmt */) { v__checker__Checker_for_c_stmt(c, (*node._v__ast__ForCStmt)); } - else if (node._typ == 348 /* v.ast.ForInStmt */) { + else if (node._typ == 349 /* v.ast.ForInStmt */) { v__checker__Checker_for_in_stmt(c, (voidptr)&/*qq*/(*node._v__ast__ForInStmt)); } - else if (node._typ == 349 /* v.ast.ForStmt */) { + else if (node._typ == 350 /* v.ast.ForStmt */) { v__checker__Checker_for_stmt(c, (voidptr)&/*qq*/(*node._v__ast__ForStmt)); } - else if (node._typ == 350 /* v.ast.GlobalDecl */) { + else if (node._typ == 351 /* v.ast.GlobalDecl */) { v__checker__Checker_global_decl(c, (voidptr)&/*qq*/(*node._v__ast__GlobalDecl)); } - else if (node._typ == 351 /* v.ast.GotoLabel */) { + else if (node._typ == 352 /* v.ast.GotoLabel */) { } - else if (node._typ == 352 /* v.ast.GotoStmt */) { + else if (node._typ == 353 /* 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); } @@ -51670,32 +51742,32 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmt(v__checker__Checker* c, v__ast__St 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 == 353 /* v.ast.HashStmt */) { + else if (node._typ == 354 /* v.ast.HashStmt */) { v__checker__Checker_hash_stmt(c, (voidptr)&/*qq*/(*node._v__ast__HashStmt)); } - else if (node._typ == 354 /* v.ast.Import */) { + else if (node._typ == 355 /* v.ast.Import */) { v__checker__Checker_import_stmt(c, (*node._v__ast__Import)); } - else if (node._typ == 355 /* v.ast.InterfaceDecl */) { + else if (node._typ == 356 /* v.ast.InterfaceDecl */) { v__checker__Checker_interface_decl(c, (voidptr)&/*qq*/(*node._v__ast__InterfaceDecl)); } - else if (node._typ == 356 /* v.ast.Module */) { + else if (node._typ == 357 /* 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 == 357 /* v.ast.Return */) { + else if (node._typ == 358 /* v.ast.Return */) { v__checker__Checker_return_stmt(c, (voidptr)&/*qq*/(*node._v__ast__Return)); c->scope_returns = true; } - else if (node._typ == 358 /* v.ast.SqlStmt */) { + else if (node._typ == 359 /* v.ast.SqlStmt */) { v__checker__Checker_sql_stmt(c, (voidptr)&/*qq*/(*node._v__ast__SqlStmt)); } - else if (node._typ == 359 /* v.ast.StructDecl */) { + else if (node._typ == 360 /* v.ast.StructDecl */) { v__checker__Checker_struct_decl(c, (voidptr)&/*qq*/(*node._v__ast__StructDecl)); } - else if (node._typ == 283 /* v.ast.TypeDecl */) { + else if (node._typ == 284 /* v.ast.TypeDecl */) { v__checker__Checker_type_decl(c, (*node._v__ast__TypeDecl)); } ; @@ -51748,11 +51820,11 @@ VV_LOCAL_SYMBOL void v__checker__Checker_global_decl(v__checker__Checker* c, v__ 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 == 284 /* v.ast.AnonFn */ && string__eq(field->name, _SLIT("main"))) { + if ((field->expr)._typ == 285 /* 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); - Option_v__ast__GlobalField_ptr _t2 = v__ast__Scope_find_global(c->file->global_scope, field->name); + _option_v__ast__GlobalField_ptr _t2 = v__ast__Scope_find_global(c->file->global_scope, field->name); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; _v_panic(_SLIT("internal compiler error - could not find global in scope")); @@ -51799,9 +51871,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 == 437 /* v.ast.AsmAlias */) { + if (arg._typ == 438 /* v.ast.AsmAlias */) { } - else if (arg._typ == 436 /* v.ast.AsmAddressing */) { + else if (arg._typ == 437 /* 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); } @@ -51809,17 +51881,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 == 290 /* v.ast.BoolLiteral */) { + else if (arg._typ == 291 /* v.ast.BoolLiteral */) { } - else if (arg._typ == 304 /* v.ast.FloatLiteral */) { + else if (arg._typ == 305 /* v.ast.FloatLiteral */) { } - else if (arg._typ == 295 /* v.ast.CharLiteral */) { + else if (arg._typ == 296 /* v.ast.CharLiteral */) { } - else if (arg._typ == 311 /* v.ast.IntegerLiteral */) { + else if (arg._typ == 312 /* v.ast.IntegerLiteral */) { } - else if (arg._typ == 361 /* v.ast.AsmRegister */) { + else if (arg._typ == 362 /* v.ast.AsmRegister */) { } - else if (arg._typ == 438 /* v.ast.AsmDisp */) { + else if (arg._typ == 439 /* v.ast.AsmDisp */) { } else if (arg._typ == 20 /* string */) { } @@ -51885,7 +51957,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as string original_flag = node->main; string flag = node->main; if (string_contains(flag, _SLIT("@VROOT"))) { - Option_string _t1 = v__util__resolve_vmodroot(string_replace(flag, _SLIT("@VROOT"), _SLIT("@VMODROOT")), c->file->path); + _option_string _t1 = v__util__resolve_vmodroot(string_replace(flag, _SLIT("@VROOT"), _SLIT("@VMODROOT")), c->file->path); 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->pos); @@ -51904,7 +51976,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as flag = vroot; } if (string_contains(flag, _SLIT("@VMODROOT"))) { - Option_string _t2 = v__util__resolve_vmodroot(flag, c->file->path); + _option_string _t2 = v__util__resolve_vmodroot(flag, c->file->path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -51917,7 +51989,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as flag = vroot; } if (string_contains(flag, _SLIT("$env("))) { - Option_string _t3 = v__util__resolve_env_value(flag, true); + _option_string _t3 = v__util__resolve_env_value(flag, true); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -51938,7 +52010,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as v__checker__Checker_error(c, _SLIT("inserting .c or .h files, should use `\"header_file.h\"` quoting"), node->pos); } node->main = string_trim(node->main, _SLIT("\"")); - Option_string _t4; + _option_string _t4; if (_t4 = os__read_file(node->main), _t4.state == 0) { string fcontent = *(string*)_t4.data; node->val = fcontent; @@ -51959,7 +52031,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } 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 "), /*115 &string*/0xfe10, {.d_s = node->main}}, {_SLIT0, 0, { .d_c = 0 }}})), _SLIT(" ")))); - Option_v__pkgconfig__Main_ptr _t5 = v__pkgconfig__main(args); + _option_v__pkgconfig__Main_ptr _t5 = v__pkgconfig__main(args); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -51967,7 +52039,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } v__pkgconfig__Main* m = (*(v__pkgconfig__Main**)_t5.data); - Option_string _t6 = v__pkgconfig__Main_run(m); + _option_string _t6 = v__pkgconfig__Main_run(m); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -51975,7 +52047,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } string cflags = (*(string*)_t6.data); - Option_bool _t7 = v__ast__Table_parse_cflag(c->table, cflags, c->mod, c->pref->compile_defines_all); + _option_bool _t7 = v__ast__Table_parse_cflag(c->table, cflags, c->mod, c->pref->compile_defines_all); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -51987,7 +52059,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as else if (string__eq(node->kind, _SLIT("flag"))) { string flag = node->main; if (string_contains(flag, _SLIT("@VROOT"))) { - Option_string _t8 = v__util__resolve_vmodroot(string_replace(flag, _SLIT("@VROOT"), _SLIT("@VMODROOT")), c->file->path); + _option_string _t8 = v__util__resolve_vmodroot(string_replace(flag, _SLIT("@VROOT"), _SLIT("@VMODROOT")), c->file->path); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -52000,7 +52072,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as flag = string_replace(flag, _SLIT("@VEXEROOT"), os__dir(v__pref__vexe_path())); } if (string_contains(flag, _SLIT("@VMODROOT"))) { - Option_string _t9 = v__util__resolve_vmodroot(flag, c->file->path); + _option_string _t9 = v__util__resolve_vmodroot(flag, c->file->path); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -52010,7 +52082,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as flag = (*(string*)_t9.data); } if (string_contains(flag, _SLIT("$env("))) { - Option_string _t10 = v__util__resolve_env_value(flag, true); + _option_string _t10 = v__util__resolve_env_value(flag, true); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -52028,7 +52100,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_hash_stmt(v__checker__Checker* c, v__as } } } - Option_bool _t13 = v__ast__Table_parse_cflag(c->table, flag, c->mod, c->pref->compile_defines_all); + _option_bool _t13 = v__ast__Table_parse_cflag(c->table, flag, c->mod, c->pref->compile_defines_all); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), node->pos); @@ -52050,7 +52122,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ v__ast__ImportSymbol sym = ((v__ast__ImportSymbol*)node.syms.data)[_t1]; 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; + _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) { @@ -52063,7 +52135,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ 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; + _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) { @@ -52071,14 +52143,14 @@ VV_LOCAL_SYMBOL void v__checker__Checker_import_stmt(v__checker__Checker* c, v__ } continue; } - Option_v__ast__ConstField_ptr _t4; + _option_v__ast__ConstField_ptr _t4; 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 `"), /*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}; + _option_time__Time _t5 = {0}; if (_t6) { *((time__Time*)&_t5.data) = *((time__Time*)_t6); } else { @@ -52121,7 +52193,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmts_ending_with_expression(v__checker } } v__checker__Checker_stmt(c, stmt); - if ((stmt)._typ == 351 /* v.ast.GotoLabel */) { + if ((stmt)._typ == 352 /* v.ast.GotoLabel */) { unreachable = ((v__token__Pos){.len = 0,.line_nr = -1,.pos = 0,.col = 0,.last_line = 0,}); c->scope_returns = false; } @@ -52139,7 +52211,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_stmts_ending_with_expression(v__checker v__ast__Type v__checker__Checker_unwrap_generic(v__checker__Checker* c, v__ast__Type typ) { if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t1; + _option_v__ast__Type _t1; if (_t1 = v__ast__Table_resolve_generic_to_concrete(c->table, typ, c->table->cur_fn->generic_names, c->table->cur_concrete_types), _t1.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t1.data; v__ast__Type _t2 = t_typ; @@ -52165,15 +52237,15 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t1; } - if (node._typ == 317 /* v.ast.NodeError */) { + if (node._typ == 318 /* v.ast.NodeError */) { } - else if (node._typ == 299 /* v.ast.ComptimeType */) { + else if (node._typ == 300 /* v.ast.ComptimeType */) { v__checker__Checker_error(c, _SLIT("incorrect use of compile-time type"), (*node._v__ast__ComptimeType).pos); } - else if (node._typ == 302 /* v.ast.EmptyExpr */) { + else if (node._typ == 303 /* 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 == 291 /* v.ast.CTempVar */) { + else if (node._typ == 292 /* v.ast.CTempVar */) { v__ast__Type _t2 = (*node._v__ast__CTempVar).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52182,7 +52254,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t2; } - else if (node._typ == 284 /* v.ast.AnonFn */) { + else if (node._typ == 285 /* 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) { @@ -52191,7 +52263,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t3; } - else if (node._typ == 285 /* v.ast.ArrayDecompose */) { + else if (node._typ == 286 /* 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) { @@ -52204,7 +52276,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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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; @@ -52216,7 +52288,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t5; } - else if (node._typ == 286 /* v.ast.ArrayInit */) { + else if (node._typ == 287 /* 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) { @@ -52225,12 +52297,12 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t6; } - else if (node._typ == 287 /* v.ast.AsCast */) { + else if (node._typ == 288 /* v.ast.AsCast */) { (*node._v__ast__AsCast).expr_type = v__checker__Checker_expr(c, (*node._v__ast__AsCast).expr); v__ast__TypeSymbol* expr_type_sym = v__ast__Table_sym(c->table, (*node._v__ast__AsCast).expr_type); v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, (*node._v__ast__AsCast).typ); if (expr_type_sym->kind == v__ast__Kind__sum_type) { - Option_void _t7 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); + _option_void _t7 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { IError err = _t7.err; } @@ -52241,7 +52313,7 @@ bool v__checker__Checker_expr_defer_0 = false; v__checker__Checker_error(c, str_intp(4, _MOV((StrIntpData[]){{_SLIT("cannot cast `"), /*115 &string*/0xfe10, {.d_s = expr_type_sym->name}}, {_SLIT("` to `"), /*115 &string*/0xfe10, {.d_s = addr}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), (*node._v__ast__AsCast).pos); } } else if (expr_type_sym->kind == v__ast__Kind__interface_ && type_sym->kind == v__ast__Kind__interface_) { - Option_void _t8 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); + _option_void _t8 = v__checker__Checker_ensure_type_exists(c, (*node._v__ast__AsCast).typ, (*node._v__ast__AsCast).pos); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { IError err = _t8.err; } @@ -52262,8 +52334,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t9; } - 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); + else if (node._typ == 289 /* 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; _v_panic(IError_str(err)); @@ -52284,7 +52356,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t11; } - else if (node._typ == 290 /* v.ast.BoolLiteral */) { + else if (node._typ == 291 /* v.ast.BoolLiteral */) { v__ast__Type _t12 = _const_v__ast__bool_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52293,7 +52365,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t12; } - else if (node._typ == 293 /* v.ast.CastExpr */) { + else if (node._typ == 294 /* 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) { @@ -52302,7 +52374,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t13; } - else if (node._typ == 292 /* v.ast.CallExpr */) { + else if (node._typ == 293 /* v.ast.CallExpr */) { v__ast__Type ret_type = v__checker__Checker_call_expr(c, (voidptr)&/*qq*/(*node._v__ast__CallExpr)); if (!v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__optional) && !v__ast__Type_has_flag(ret_type, v__ast__TypeFlag__result)) { if ((*node._v__ast__CallExpr).or_block.kind == v__ast__OrKind__block) { @@ -52327,7 +52399,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t14; } - else if (node._typ == 294 /* v.ast.ChanInit */) { + else if (node._typ == 295 /* 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) { @@ -52336,7 +52408,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t15; } - else if (node._typ == 295 /* v.ast.CharLiteral */) { + else if (node._typ == 296 /* v.ast.CharLiteral */) { v__ast__Type _t16 = _const_v__ast__rune_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52345,7 +52417,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t16; } - else if (node._typ == 296 /* v.ast.Comment */) { + else if (node._typ == 297 /* v.ast.Comment */) { v__ast__Type _t17 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52354,7 +52426,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t17; } - else if (node._typ == 289 /* v.ast.AtExpr */) { + else if (node._typ == 290 /* 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) { @@ -52363,7 +52435,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t18; } - else if (node._typ == 297 /* v.ast.ComptimeCall */) { + else if (node._typ == 298 /* 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) { @@ -52372,7 +52444,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t19; } - else if (node._typ == 298 /* v.ast.ComptimeSelector */) { + else if (node._typ == 299 /* v.ast.ComptimeSelector */) { v__ast__Type _t20 = v__checker__Checker_comptime_selector(c, (voidptr)&/*qq*/(*node._v__ast__ComptimeSelector)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52381,7 +52453,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t20; } - else if (node._typ == 300 /* v.ast.ConcatExpr */) { + else if (node._typ == 301 /* v.ast.ConcatExpr */) { v__ast__Type _t21 = v__checker__Checker_concat_expr(c, (voidptr)&/*qq*/(*node._v__ast__ConcatExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52390,8 +52462,9 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t21; } - else if (node._typ == 301 /* v.ast.DumpExpr */) { + else if (node._typ == 302 /* v.ast.DumpExpr */) { (*node._v__ast__DumpExpr).expr_type = v__checker__Checker_expr(c, (*node._v__ast__DumpExpr).expr); + v__checker__Checker_check_expr_opt_call(c, (*node._v__ast__DumpExpr).expr, (*node._v__ast__DumpExpr).expr_type); int etidx = v__ast__Type_idx((*node._v__ast__DumpExpr).expr_type); if (etidx == _const_v__ast__void_type_idx) { v__checker__Checker_error(c, _SLIT("dump expression can not be void"), v__ast__Expr_pos((*node._v__ast__DumpExpr).expr)); @@ -52423,7 +52496,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t24; } - else if (node._typ == 303 /* v.ast.EnumVal */) { + else if (node._typ == 304 /* v.ast.EnumVal */) { v__ast__Type _t25 = v__checker__Checker_enum_val(c, (voidptr)&/*qq*/(*node._v__ast__EnumVal)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52432,7 +52505,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t25; } - else if (node._typ == 304 /* v.ast.FloatLiteral */) { + else if (node._typ == 305 /* v.ast.FloatLiteral */) { v__ast__Type _t26 = _const_v__ast__float_literal_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52441,7 +52514,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t26; } - else if (node._typ == 305 /* v.ast.GoExpr */) { + else if (node._typ == 306 /* v.ast.GoExpr */) { v__ast__Type _t27 = v__checker__Checker_go_expr(c, (voidptr)&/*qq*/(*node._v__ast__GoExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52450,7 +52523,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t27; } - else if (node._typ == 306 /* v.ast.Ident */) { + else if (node._typ == 307 /* v.ast.Ident */) { v__ast__Type res = v__checker__Checker_ident(c, (voidptr)&/*qq*/(*node._v__ast__Ident)); v__ast__Type _t28 = res; // Defer begin @@ -52460,7 +52533,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t28; } - else if (node._typ == 307 /* v.ast.IfExpr */) { + else if (node._typ == 308 /* v.ast.IfExpr */) { v__ast__Type _t29 = v__checker__Checker_if_expr(c, (voidptr)&/*qq*/(*node._v__ast__IfExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52469,19 +52542,19 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t29; } - else if (node._typ == 308 /* v.ast.IfGuardExpr */) { + else if (node._typ == 309 /* 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 == 309 /* v.ast.IndexExpr */) { + if ((*node._v__ast__IfGuardExpr).expr._typ == 310 /* 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 == 323 /* v.ast.PrefixExpr */) { + else if ((*node._v__ast__IfGuardExpr).expr._typ == 324 /* 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); @@ -52504,7 +52577,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t30; } - else if (node._typ == 309 /* v.ast.IndexExpr */) { + else if (node._typ == 310 /* v.ast.IndexExpr */) { v__ast__Type _t31 = v__checker__Checker_index_expr(c, (voidptr)&/*qq*/(*node._v__ast__IndexExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52513,7 +52586,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t31; } - else if (node._typ == 310 /* v.ast.InfixExpr */) { + else if (node._typ == 311 /* v.ast.InfixExpr */) { v__ast__Type _t32 = v__checker__Checker_infix_expr(c, (voidptr)&/*qq*/(*node._v__ast__InfixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52522,7 +52595,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t32; } - else if (node._typ == 311 /* v.ast.IntegerLiteral */) { + else if (node._typ == 312 /* v.ast.IntegerLiteral */) { v__ast__Type _t33 = v__checker__Checker_int_lit(c, (voidptr)&/*qq*/(*node._v__ast__IntegerLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52531,7 +52604,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t33; } - else if (node._typ == 314 /* v.ast.LockExpr */) { + else if (node._typ == 315 /* v.ast.LockExpr */) { v__ast__Type _t34 = v__checker__Checker_lock_expr(c, (voidptr)&/*qq*/(*node._v__ast__LockExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52540,7 +52613,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t34; } - else if (node._typ == 315 /* v.ast.MapInit */) { + else if (node._typ == 316 /* v.ast.MapInit */) { v__ast__Type _t35 = v__checker__Checker_map_init(c, (voidptr)&/*qq*/(*node._v__ast__MapInit)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52549,7 +52622,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t35; } - else if (node._typ == 316 /* v.ast.MatchExpr */) { + else if (node._typ == 317 /* v.ast.MatchExpr */) { v__ast__Type _t36 = v__checker__Checker_match_expr(c, (voidptr)&/*qq*/(*node._v__ast__MatchExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52558,7 +52631,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t36; } - else if (node._typ == 322 /* v.ast.PostfixExpr */) { + else if (node._typ == 323 /* v.ast.PostfixExpr */) { v__ast__Type _t37 = v__checker__Checker_postfix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PostfixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52567,7 +52640,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t37; } - else if (node._typ == 323 /* v.ast.PrefixExpr */) { + else if (node._typ == 324 /* v.ast.PrefixExpr */) { v__ast__Type _t38 = v__checker__Checker_prefix_expr(c, (voidptr)&/*qq*/(*node._v__ast__PrefixExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52576,7 +52649,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t38; } - else if (node._typ == 318 /* v.ast.None */) { + else if (node._typ == 319 /* v.ast.None */) { v__ast__Type _t39 = _const_v__ast__none_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52585,7 +52658,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t39; } - else if (node._typ == 320 /* v.ast.OrExpr */) { + else if (node._typ == 321 /* v.ast.OrExpr */) { v__ast__Type _t40 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52594,8 +52667,8 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t40; } - else if (node._typ == 321 /* v.ast.ParExpr */) { - if (((*node._v__ast__ParExpr).expr)._typ == 321 /* v.ast.ParExpr */) { + else if (node._typ == 322 /* v.ast.ParExpr */) { + if (((*node._v__ast__ParExpr).expr)._typ == 322 /* v.ast.ParExpr */) { v__checker__Checker_warn(c, _SLIT("redundant parentheses are used"), (*node._v__ast__ParExpr).pos); } v__ast__Type _t41 = v__checker__Checker_expr(c, (*node._v__ast__ParExpr).expr); @@ -52606,7 +52679,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t41; } - else if (node._typ == 324 /* v.ast.RangeExpr */) { + else if (node._typ == 325 /* v.ast.RangeExpr */) { v__ast__Type _t42 = _const_v__ast__void_type; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52615,7 +52688,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t42; } - else if (node._typ == 325 /* v.ast.SelectExpr */) { + else if (node._typ == 326 /* v.ast.SelectExpr */) { v__ast__Type _t43 = v__checker__Checker_select_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52624,7 +52697,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t43; } - else if (node._typ == 326 /* v.ast.SelectorExpr */) { + else if (node._typ == 327 /* v.ast.SelectorExpr */) { v__ast__Type _t44 = v__checker__Checker_selector_expr(c, (voidptr)&/*qq*/(*node._v__ast__SelectorExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52633,7 +52706,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t44; } - else if (node._typ == 327 /* v.ast.SizeOf */) { + else if (node._typ == 328 /* 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); } @@ -52645,7 +52718,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t45; } - else if (node._typ == 312 /* v.ast.IsRefType */) { + else if (node._typ == 313 /* 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); } @@ -52657,7 +52730,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t46; } - else if (node._typ == 319 /* v.ast.OffsetOf */) { + else if (node._typ == 320 /* v.ast.OffsetOf */) { v__ast__Type _t47 = v__checker__Checker_offset_of(c, (*node._v__ast__OffsetOf)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52666,7 +52739,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t47; } - else if (node._typ == 328 /* v.ast.SqlExpr */) { + else if (node._typ == 329 /* v.ast.SqlExpr */) { v__ast__Type _t48 = v__checker__Checker_sql_expr(c, (voidptr)&/*qq*/(*node._v__ast__SqlExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52675,7 +52748,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t48; } - else if (node._typ == 330 /* v.ast.StringLiteral */) { + else if (node._typ == 331 /* v.ast.StringLiteral */) { if ((*node._v__ast__StringLiteral).language == v__ast__Language__c) { v__ast__Type _t49 = v__ast__Type_set_nr_muls(_const_v__ast__byte_type, 1); // Defer begin @@ -52693,7 +52766,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t50; } - else if (node._typ == 329 /* v.ast.StringInterLiteral */) { + else if (node._typ == 330 /* v.ast.StringInterLiteral */) { v__ast__Type _t51 = v__checker__Checker_string_inter_lit(c, (voidptr)&/*qq*/(*node._v__ast__StringInterLiteral)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52702,7 +52775,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t51; } - else if (node._typ == 331 /* v.ast.StructInit */) { + else if (node._typ == 332 /* v.ast.StructInit */) { if ((*node._v__ast__StructInit).unresolved) { v__ast__Type _t52 = v__checker__Checker_expr(c, v__ast__resolve_init((*node._v__ast__StructInit), v__checker__Checker_unwrap_generic(c, (*node._v__ast__StructInit).typ), c->table)); // Defer begin @@ -52720,7 +52793,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t53; } - else if (node._typ == 332 /* v.ast.TypeNode */) { + else if (node._typ == 333 /* v.ast.TypeNode */) { v__ast__Type _t54 = (*node._v__ast__TypeNode).typ; // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52729,7 +52802,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t54; } - else if (node._typ == 333 /* v.ast.TypeOf */) { + else if (node._typ == 334 /* v.ast.TypeOf */) { (*node._v__ast__TypeOf).expr_type = v__checker__Checker_expr(c, (*node._v__ast__TypeOf).expr); v__ast__Type _t55 = _const_v__ast__string_type; // Defer begin @@ -52739,7 +52812,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t55; } - else if (node._typ == 334 /* v.ast.UnsafeExpr */) { + else if (node._typ == 335 /* v.ast.UnsafeExpr */) { v__ast__Type _t56 = v__checker__Checker_unsafe_expr(c, (voidptr)&/*qq*/(*node._v__ast__UnsafeExpr)); // Defer begin if (v__checker__Checker_expr_defer_0) { @@ -52748,7 +52821,7 @@ bool v__checker__Checker_expr_defer_0 = false; // Defer end return _t56; } - else if (node._typ == 313 /* v.ast.Likely */) { + else if (node._typ == 314 /* 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); @@ -52786,7 +52859,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE return _t1; } if (to_sym->language != v__ast__Language__c) { - Option_void _t2 = v__checker__Checker_ensure_type_exists(c, to_type, node->pos); + _option_void _t2 = v__checker__Checker_ensure_type_exists(c, to_type, node->pos); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -52810,17 +52883,17 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE 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 `"), /*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 == 471 /* v.ast.Alias */ && !(final_to_sym->kind == v__ast__Kind__struct_ && v__ast__Type_is_ptr(to_type))) { + } else if ((to_sym->info)._typ == 472 /* 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 `"), /*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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, 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, 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 */ ; + v__ast__Struct from_type_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 457) /*expected idx: 457, 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, 457) /*expected idx: 457, 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 `"), /*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); } @@ -52833,7 +52906,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE 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, 474) /*expected idx: 474, name: v.ast.Interface */ ).is_generic) { + if ((/* as */ *(v__ast__Interface*)__as_cast((to_sym->info)._v__ast__Interface,(to_sym->info)._typ, 475) /*expected idx: 475, 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; @@ -52910,7 +52983,7 @@ v__ast__Type v__checker__Checker_cast_expr(v__checker__Checker* c, v__ast__CastE 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 `"), /*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)._typ == 331 /* 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 `"), /*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 }}}))); } @@ -52922,11 +52995,11 @@ 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 == 311 /* v.ast.IntegerLiteral */) { + if ((node->expr)._typ == 312 /* 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})); - Option_v__ast__EnumDecl _t3 = {0}; + _option_v__ast__EnumDecl _t3 = {0}; if (_t4) { *((v__ast__EnumDecl*)&_t3.data) = *((v__ast__EnumDecl*)_t4); } else { @@ -52943,7 +53016,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 == 311 /* v.ast.IntegerLiteral */) { + if ((enum_field.expr)._typ == 312 /* v.ast.IntegerLiteral */) { enum_val = string_int((*enum_field.expr._v__ast__IntegerLiteral).val); } if (node_val == enum_val) { @@ -53028,7 +53101,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_at_expr(v__checker__Checker* c, if (vmod_file_location.vmod_file.len == 0) { v__checker__Checker_error(c, _SLIT("@VMOD_FILE can be used only in projects, that have v.mod file"), node->pos); } - Option_string _t1 = os__read_file(vmod_file_location.vmod_file); + _option_string _t1 = os__read_file(vmod_file_location.vmod_file); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(string*) _t1.data = _SLIT(""); @@ -53089,28 +53162,28 @@ 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, 416) /*expected idx: 416, name: v.ast.IdentVar */ ; + v__ast__IdentVar info = /* as */ *(v__ast__IdentVar*)__as_cast((node->info)._v__ast__IdentVar,(node->info)._typ, 417) /*expected idx: 417, 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, 415) /*expected idx: 415, name: v.ast.IdentFn */ ; + v__ast__IdentFn info = /* as */ *(v__ast__IdentFn*)__as_cast((node->info)._v__ast__IdentFn,(node->info)._typ, 416) /*expected idx: 416, name: v.ast.IdentFn */ ; v__ast__Type _t5 = info.typ; return _t5; } else if (node->kind == v__ast__IdentKind__unresolved) { if (node->tok_kind == v__token__Kind__assign && node->is_mut) { v__checker__Checker_error(c, _SLIT("`mut` not allowed with `=` (use `:=` to declare a variable)"), node->pos); } - Option_v__ast__ScopeObject _t6; + _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 == 363 /* v.ast.GlobalField */) { + if (obj._typ == 364 /* 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,.share = 0,.is_mut = 0,.is_static = 0,.is_volatile = 0,.is_optional = 0,})))); node->obj = obj; v__ast__Type _t7 = (*obj._v__ast__GlobalField).typ; return _t7; } - else if (obj._typ == 364 /* v.ast.Var */) { + else if (obj._typ == 365 /* 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 `"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` (used before declaration)"), 0, { .d_c = 0 }}})), node->pos); @@ -53125,17 +53198,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 == 306 /* v.ast.Ident */) { + if (((*obj._v__ast__Var).expr)._typ == 307 /* 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: `"), /*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 == 308 /* v.ast.IfGuardExpr */) { + if (((*obj._v__ast__Var).expr)._typ == 309 /* 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, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 483) /*expected idx: 483, 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]; @@ -53176,10 +53249,10 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no } else if (!string_contains(name, _SLIT(".")) && !string__eq(node->mod, _SLIT("builtin"))) { 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; + _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 == 362 /* v.ast.ConstField */) { + if (obj._typ == 363 /* 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 `"), /*115 &string*/0xfe10, {.d_s = (*obj._v__ast__ConstField).name}}, {_SLIT("` is private"), 0, { .d_c = 0 }}})), node->pos); } @@ -53191,7 +53264,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 == 292 /* v.ast.CallExpr */) { + if (((*obj._v__ast__ConstField).expr)._typ == 293 /* 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); } @@ -53210,7 +53283,7 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no } ; } - Option_v__ast__Fn _t14; + _option_v__ast__Fn _t14; if (_t14 = v__ast__Table_find_fn(c->table, name), _t14.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t14.data; v__ast__Type fn_type = v__ast__new_type(v__ast__Table_find_or_register_fn_type(c->table, node->mod, func, false, true)); @@ -53230,7 +53303,7 @@ v__ast__Type v__checker__Checker_ident(v__checker__Checker* c, v__ast__Ident* no return _t17; } if (c->inside_sql) { - Option_v__ast__StructField _t18; + _option_v__ast__StructField _t18; if (_t18 = v__ast__Table_find_field(c->table, (voidptr)&/*qq*/c->cur_orm_ts, node->name), _t18.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t18.data; v__ast__Type _t19 = field.typ; @@ -53291,19 +53364,19 @@ 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 == 326 /* v.ast.SelectorExpr */) { + if (expr._typ == 327 /* 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); int orig_type = 0; - Option_v__ast__StructField _t1; + _option_v__ast__StructField _t1; if (_t1 = v__ast__Table_find_field(c->table, expr_sym, (*expr._v__ast__SelectorExpr).field_name), _t1.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t1.data; if (field.is_mut) { - Option_v__ast__Ident _t2; + _option_v__ast__Ident _t2; if (_t2 = v__ast__SelectorExpr_root_ident(&(*expr._v__ast__SelectorExpr)), _t2.state == 0) { v__ast__Ident root_ident = *(v__ast__Ident*)_t2.data; - Option_v__ast__Var_ptr _t3; + _option_v__ast__Var_ptr _t3; if (_t3 = v__ast__Scope_find_var(scope, root_ident.name), _t3.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t3.data; is_mut = v->is_mut; @@ -53314,7 +53387,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast(v__checker__Checker* c, v__as orig_type = field.typ; } } - Option_v__ast__ScopeStructField _t4; + _option_v__ast__ScopeStructField _t4; if (_t4 = 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), _t4.state == 0) { v__ast__ScopeStructField field = *(v__ast__ScopeStructField*)_t4.data; _PUSH_MANY(&smartcasts, (field.smartcasts), _t5, Array_v__ast__Type); @@ -53333,12 +53406,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 == 306 /* v.ast.Ident */) { + else if (expr._typ == 307 /* 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 == 364 /* v.ast.Var */) { + if (((*expr._v__ast__Ident).obj)._typ == 365 /* 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; @@ -53385,15 +53458,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 == 346 /* v.ast.ExprStmt */) { + if (branch.stmt._typ == 347 /* 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 `"), /*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 == 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 */) { + if (((*branch.stmt._v__ast__ExprStmt).expr)._typ == 311 /* v.ast.InfixExpr */) { + if (((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 307 /* v.ast.Ident */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 327 /* v.ast.SelectorExpr */ && ((*(*branch.stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).left)._typ != 310 /* 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 { @@ -53401,10 +53474,10 @@ v__ast__Type v__checker__Checker_select_expr(v__checker__Checker* c, v__ast__Sel } } } - else if (branch.stmt._typ == 338 /* v.ast.AssignStmt */) { + else if (branch.stmt._typ == 339 /* 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 == 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 */) { + if (expr._typ == 324 /* v.ast.PrefixExpr */) { + if (((*expr._v__ast__PrefixExpr).right)._typ != 307 /* v.ast.Ident */ && ((*expr._v__ast__PrefixExpr).right)._typ != 327 /* v.ast.SelectorExpr */ && ((*expr._v__ast__PrefixExpr).right)._typ != 310 /* 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) { @@ -53439,7 +53512,7 @@ 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 == 306 /* v.ast.Ident */ ? (_SLIT("variable")) : (_SLIT("struct element"))); + string obj_type = (((*(v__ast__Expr*)/*ee elem_sym */array_get(node->lockeds, i)))._typ == 307 /* 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)) { @@ -53459,7 +53532,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 == 346 /* v.ast.ExprStmt */) { + if ((last_stmt)._typ == 347 /* v.ast.ExprStmt */) { ret_type = (*last_stmt._v__ast__ExprStmt).typ; } } @@ -53479,79 +53552,79 @@ v__ast__Type v__checker__Checker_unsafe_expr(v__checker__Checker* c, v__ast__Uns return _t1; } -VV_LOCAL_SYMBOL Option_v__ast__Expr v__checker__Checker_find_definition(v__checker__Checker* c, v__ast__Ident ident) { +VV_LOCAL_SYMBOL _option_v__ast__Expr v__checker__Checker_find_definition(v__checker__Checker* c, v__ast__Ident ident) { if (ident.kind == (v__ast__IdentKind__unresolved) || ident.kind == (v__ast__IdentKind__blank_ident)) { - return (Option_v__ast__Expr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Expr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } else if (ident.kind == (v__ast__IdentKind__variable) || ident.kind == (v__ast__IdentKind__constant)) { - Option_v__ast__Expr _t2 = v__checker__Checker_find_obj_definition(c, ident.obj); + _option_v__ast__Expr _t2 = v__checker__Checker_find_obj_definition(c, ident.obj); 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, /*115 &string*/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, /*115 &string*/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}; + 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) { +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 == 364 /* v.ast.Var */) { + if (obj._typ == 365 /* v.ast.Var */) { name = (*obj._v__ast__Var).name; } - else if (obj._typ == 362 /* v.ast.ConstField */) { + else if (obj._typ == 363 /* v.ast.ConstField */) { name = (*obj._v__ast__ConstField).name; } - else if (obj._typ == 363 /* v.ast.GlobalField */) { + else if (obj._typ == 364 /* v.ast.GlobalField */) { name = (*obj._v__ast__GlobalField).name; } - else if (obj._typ == 361 /* v.ast.AsmRegister */) { + else if (obj._typ == 362 /* v.ast.AsmRegister */) { name = (*obj._v__ast__AsmRegister).name; } ; v__ast__Expr expr = v__ast__empty_expr(); - if ((obj)._typ == 364 /* v.ast.Var */) { + if ((obj)._typ == 365 /* 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("`"), /*115 &string*/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 == 362 /* v.ast.ConstField */) { + } else if ((obj)._typ == 363 /* 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("`"), /*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} }; + 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 == 306 /* v.ast.Ident */) { - Option_v__ast__Expr _t3 = v__checker__Checker_find_definition(c, (*expr._v__ast__Ident)); + if ((expr)._typ == 307 /* 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 `"), /*115 &string*/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)); + _option_v__ast__Expr _t5; + opt_ok2(&(v__ast__Expr[]) { expr }, (_option*)(&_t5), sizeof(v__ast__Expr)); return _t5; } -VV_LOCAL_SYMBOL Option_bool v__checker__Checker_has_return(v__checker__Checker* c, Array_v__ast__Stmt stmts) { +VV_LOCAL_SYMBOL _option_bool v__checker__Checker_has_return(v__checker__Checker* c, Array_v__ast__Stmt stmts) { 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 == 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 */) { + if ((s)._typ == 347 /* v.ast.ExprStmt */) { + if (((*s._v__ast__ExprStmt).expr)._typ == 308 /* v.ast.IfExpr */ || ((*s._v__ast__ExprStmt).expr)._typ == 317 /* v.ast.MatchExpr */) { has_complexity = true; break; } } } if (!has_complexity || !c->returns) { - Option_bool _t2; - opt_ok(&(bool[]) { v__checker__has_top_return(stmts) }, (Option*)(&_t2), sizeof(bool)); + _option_bool _t2; + opt_ok2(&(bool[]) { v__checker__has_top_return(stmts) }, (_option*)(&_t2), sizeof(bool)); return _t2; } - return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__PostfixExpr* node) { @@ -53565,19 +53638,19 @@ v__ast__Type v__checker__Checker_postfix_expr(v__checker__Checker* c, v__ast__Po string typ_str = v__ast__Table_type_to_str(c->table, typ); v__checker__Checker_error(c, str_intp(3, _MOV((StrIntpData[]){{_SLIT("invalid operation: "), /*115 &string*/0xfe10, {.d_s = v__token__Kind_str(node->op)}}, {_SLIT(" (non-numeric type `"), /*115 &string*/0xfe10, {.d_s = typ_str}}, {_SLIT("`)"), 0, { .d_c = 0 }}})), node->pos); } else { - multi_return_string_v__token__Pos mr_116421 = v__checker__Checker_fail_if_immutable(c, node->expr); - node->auto_locked = mr_116421.arg0; + multi_return_string_v__token__Pos mr_116473 = v__checker__Checker_fail_if_immutable(c, node->expr); + node->auto_locked = mr_116473.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 == 306 /* v.ast.Ident */) { - if (((*node->_v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if (node->_typ == 307 /* v.ast.Ident */) { + if (((*node->_v__ast__Ident).obj)._typ == 365 /* 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); + _option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(c->fn_scope, (*(*node->_v__ast__Ident).obj._v__ast__Var).name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(v__ast__Var**) _t1.data = obj; @@ -53598,7 +53671,7 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ; if (!info.is_heap) { (*(*node->_v__ast__Ident).obj._v__ast__Var).is_auto_heap = true; } @@ -53609,12 +53682,12 @@ void v__checker__Checker_mark_as_referenced(v__checker__Checker* c, v__ast__Expr } } } - else if (node->_typ == 326 /* v.ast.SelectorExpr */) { + else if (node->_typ == 327 /* 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 == 309 /* v.ast.IndexExpr */) { + else if (node->_typ == 310 /* v.ast.IndexExpr */) { v__checker__Checker_mark_as_referenced(c, &(*node->_v__ast__IndexExpr).left, as_interface); } @@ -53624,15 +53697,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 == 306 /* v.ast.Ident */) { + if (node->_typ == 307 /* v.ast.Ident */) { string _t1 = (*node->_v__ast__Ident).name; return _t1; } - else if (node->_typ == 326 /* v.ast.SelectorExpr */) { + else if (node->_typ == 327 /* v.ast.SelectorExpr */) { string _t2 = v__checker__Checker_get_base_name(c, &(*node->_v__ast__SelectorExpr).expr); return _t2; } - else if (node->_typ == 309 /* v.ast.IndexExpr */) { + else if (node->_typ == 310 /* v.ast.IndexExpr */) { string _t3 = v__checker__Checker_get_base_name(c, &(*node->_v__ast__IndexExpr).left); return _t3; } @@ -53652,14 +53725,14 @@ 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 == 323 /* v.ast.PrefixExpr */) { + if ((node->right)._typ == 324 /* 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); } - } else if ((node->right)._typ == 326 /* v.ast.SelectorExpr */) { + } else if ((node->right)._typ == 327 /* v.ast.SelectorExpr */) { v__ast__TypeSymbol* right_sym = v__ast__Table_sym(c->table, right_type); v__ast__TypeSymbol* expr_sym = v__ast__Table_sym(c->table, (*node->right._v__ast__SelectorExpr).expr_type); - if (expr_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((expr_sym->info)._v__ast__Struct,(expr_sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ).is_minify && ((*node->right._v__ast__SelectorExpr).typ == _const_v__ast__bool_type_idx || (right_sym->kind == v__ast__Kind__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 */ ).is_flag && !(/* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 485) /*expected idx: 485, name: v.ast.Enum */ ).uses_exprs))) { + if (expr_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((expr_sym->info)._v__ast__Struct,(expr_sym->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ).is_minify && ((*node->right._v__ast__SelectorExpr).typ == _const_v__ast__bool_type_idx || (right_sym->kind == v__ast__Kind__enum_ && !(/* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 486) /*expected idx: 486, name: v.ast.Enum */ ).is_flag && !(/* as */ *(v__ast__Enum*)__as_cast((right_sym->info)._v__ast__Enum,(right_sym->info)._typ, 486) /*expected idx: 486, name: v.ast.Enum */ ).uses_exprs))) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("cannot take address of field in struct `"), /*115 &string*/0xfe10, {.d_s = v__ast__Table_type_to_str(c->table, (*node->right._v__ast__SelectorExpr).expr_type)}}, {_SLIT("`, which is tagged as `[minify]`"), 0, { .d_c = 0 }}})), v__token__Pos_extend(node->pos, (*node->right._v__ast__SelectorExpr).pos)); } } @@ -53667,19 +53740,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 == 321 /* v.ast.ParExpr */)) break; + if (!((expr)._typ == 322 /* v.ast.ParExpr */)) break; expr = (*expr._v__ast__ParExpr).expr; } - 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 */) { + if ((expr)._typ == 291 /* v.ast.BoolLiteral */ || (expr)._typ == 293 /* v.ast.CallExpr */ || (expr)._typ == 296 /* v.ast.CharLiteral */ || (expr)._typ == 305 /* v.ast.FloatLiteral */ || (expr)._typ == 312 /* v.ast.IntegerLiteral */ || (expr)._typ == 311 /* v.ast.InfixExpr */ || (expr)._typ == 331 /* v.ast.StringLiteral */ || (expr)._typ == 330 /* 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 == 309 /* v.ast.IndexExpr */) { + if ((node->right)._typ == 310 /* 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 == 306 /* v.ast.Ident */) { + if (((*node->right._v__ast__IndexExpr).left)._typ == 307 /* 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 == 364 /* v.ast.Var */) { + if ((ident_obj)._typ == 365 /* v.ast.Var */) { is_mut = (*ident_obj._v__ast__Var).is_mut; } } @@ -53697,7 +53770,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 != 293 /* v.ast.CastExpr */) { + } else if (node->op == v__token__Kind__amp && (node->right)._typ != 294 /* v.ast.CastExpr */) { if (!c->inside_fn_arg && !c->inside_unsafe) { v__checker__Checker_mark_as_referenced(c, &node->right, false); } @@ -53744,16 +53817,16 @@ 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, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type)) || (c->pref->translated && v__ast__Type_is_any_kind_of_pointer(index_type)))) { + 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, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type)) || (c->pref->translated && v__ast__Type_is_any_kind_of_pointer(index_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 == 311 /* v.ast.IntegerLiteral */ && !is_gated) { + if ((index)._typ == 312 /* 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 `"), /*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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((typ_sym->info)._v__ast__ArrayFixed,(typ_sym->info)._typ, 480) /*expected idx: 480, 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: "), /*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); } @@ -53778,7 +53851,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 == 324 /* v.ast.RangeExpr */) { + if (node->or_expr.kind != v__ast__OrKind__absent && (node->index)._typ == 325 /* 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; @@ -53813,19 +53886,19 @@ v__ast__Type v__checker__Checker_index_expr(v__checker__Checker* c, v__ast__Inde } 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 == 306 /* v.ast.Ident */) { - if (((*node->left._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((node->left)._typ == 307 /* v.ast.Ident */) { + if (((*node->left._v__ast__Ident).obj)._typ == 365 /* 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 == 324 /* v.ast.RangeExpr */) { + if (!is_ok && (node->index)._typ == 325 /* 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 `"), /*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 == 324 /* v.ast.RangeExpr */) { + if ((node->index)._typ == 325 /* 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); @@ -53843,7 +53916,7 @@ 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, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((typ_sym->info)._v__ast__Map,(typ_sym->info)._typ, 453) /*expected idx: 453, 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)) { @@ -53902,7 +53975,7 @@ 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, name: v.ast.Array */ ; typ = array_info.elem_type; typ_sym = v__ast__Table_sym(c->table, typ); } @@ -53912,7 +53985,7 @@ v__ast__Type v__checker__Checker_enum_val(v__checker__Checker* c, v__ast__EnumVa v__ast__Type _t5 = _const_v__ast__void_type; return _t5; } - if ((fsym->info)._typ != 485 /* v.ast.Enum */) { + if ((fsym->info)._typ != 486 /* 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; @@ -53963,19 +54036,19 @@ 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 == 330 /* v.ast.StringLiteral */) { + if ((key_i)._typ == 331 /* 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 == 330 /* v.ast.StringLiteral */) { + if ((key_j)._typ == 331 /* 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 \""), /*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 == 311 /* v.ast.IntegerLiteral */) { + } else if ((key_i)._typ == 312 /* 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 == 311 /* v.ast.IntegerLiteral */) { + if ((key_j)._typ == 312 /* 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 \""), /*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); } @@ -54128,10 +54201,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_trace(v__checker__Checker* c, string fb } } -VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__Checker* c, v__ast__Type typ, v__token__Pos pos) { +VV_LOCAL_SYMBOL _option_void v__checker__Checker_ensure_type_exists(v__checker__Checker* c, v__ast__Type typ, v__token__Pos pos) { if (typ == 0) { v__checker__Checker_error(c, _SLIT("unknown type"), pos); - return (Option_void){0}; + return (_option_void){0}; } v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, typ); switch (sym->kind) { @@ -54139,7 +54212,7 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C { 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 `"), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))), pos); - return (Option_void){0}; + return (_option_void){0}; } break; } @@ -54149,15 +54222,15 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C if (!c->is_builtin_mod) { 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}; + return (_option_void){0}; } break; } 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, name: v.ast.Array */ ).elem_type, pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -54167,9 +54240,9 @@ 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, 479) /*expected idx: 479, 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, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ).elem_type, pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } @@ -54179,18 +54252,18 @@ 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, 452) /*expected idx: 452, name: v.ast.Map */ ; - Option_void _t5 = v__checker__Checker_ensure_type_exists(c, info.key_type, pos); + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 453) /*expected idx: 453, 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; + _option_void _t6; memcpy(&_t6, &_t5, sizeof(Option)); return _t6; } ; - Option_void _t7 = v__checker__Checker_ensure_type_exists(c, info.value_type, pos); + _option_void _t7 = v__checker__Checker_ensure_type_exists(c, info.value_type, pos); if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { - Option_void _t8; + _option_void _t8; memcpy(&_t8, &_t7, sizeof(Option)); return _t8; } @@ -54200,12 +54273,12 @@ 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, 475) /*expected idx: 475, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 476) /*expected idx: 476, 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); + _option_void _t10 = v__checker__Checker_ensure_type_exists(c, concrete_typ, pos); if (_t10.state != 0 && _t10.err._typ != _IError_None___index) { - Option_void _t11; + _option_void _t11; memcpy(&_t11, &_t10, sizeof(Option)); return _t11; } @@ -54252,12 +54325,12 @@ VV_LOCAL_SYMBOL Option_void v__checker__Checker_ensure_type_exists(v__checker__C } } ; - return (Option_void){0}; + return (_option_void){0}; } 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 == 306 /* v.ast.Ident */) { + if (expr._typ == 307 /* 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"))); @@ -54266,7 +54339,7 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr } return; } - else if (expr._typ == 326 /* v.ast.SelectorExpr */) { + else if (expr._typ == 327 /* 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, /*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 }}})); @@ -54279,21 +54352,21 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr v__checker__Checker_fail_if_unreadable(c, (*expr._v__ast__SelectorExpr).expr, (*expr._v__ast__SelectorExpr).expr_type, what); } } - else if (expr._typ == 292 /* v.ast.CallExpr */) { + else if (expr._typ == 293 /* 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 == 314 /* v.ast.LockExpr */) { + else if (expr._typ == 315 /* v.ast.LockExpr */) { return; } - else if (expr._typ == 309 /* v.ast.IndexExpr */) { + else if (expr._typ == 310 /* 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 == 310 /* v.ast.InfixExpr */) { + else if (expr._typ == 311 /* 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); @@ -54311,7 +54384,7 @@ void v__checker__Checker_fail_if_unreadable(v__checker__Checker* c, v__ast__Expr VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Checker* c, v__ast__ComptimeCall* node) { node->left_type = v__checker__Checker_expr(c, node->left); if (node->is_env) { - 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); + _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); @@ -54375,7 +54448,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check v__ast__Type _t12 = _const_v__ast__string_type; return _t12; } - Option_v__ast__Var_ptr _t13 = v__ast__Scope_find_var(node->scope, node->method_name); + _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 `"), /*115 &string*/0xfe10, {.d_s = node->method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); @@ -54391,13 +54464,13 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_call(v__checker__Check return _t15; } string method_name = _SLIT(""); - if ((v->expr)._typ == 330 /* v.ast.StringLiteral */) { + if ((v->expr)._typ == 331 /* 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); } v__ast__TypeSymbol* left_sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, node->left_type)); - Option_v__ast__Fn _t16 = v__ast__TypeSymbol_find_method(left_sym, method_name); + _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 `"), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->method_pos); @@ -54418,7 +54491,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_comptime_selector(v__checker__C 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 `"), /*115 &string*/0xfe10, {.d_s = expr_sym->name}}, {_SLIT("` (e.g. `field.name`)"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node->field_expr)); } - if ((node->field_expr)._typ == 326 /* v.ast.SelectorExpr */) { + if ((node->field_expr)._typ == 327 /* v.ast.SelectorExpr */) { v__token__Pos left_pos = v__ast__Expr_pos((*node->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); @@ -54444,7 +54517,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_comptime_for(v__checker__Checker* c, v_ } 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, 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]; @@ -54459,189 +54532,189 @@ VV_LOCAL_SYMBOL void v__checker__Checker_comptime_for(v__checker__Checker* c, v_ } } -VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comptime_const_expr(v__checker__Checker* c, v__ast__Expr expr, int nlevel) { +VV_LOCAL_SYMBOL _option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comptime_const_expr(v__checker__Checker* c, v__ast__Expr expr, int nlevel) { if (nlevel > 100) { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - 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); + if (expr._typ == 322 /* 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 == 327 /* v.ast.SizeOf */) { + else if (expr._typ == 328 /* v.ast.SizeOf */) { multi_return_int_int mr_4612 = v__ast__Table_type_size(c->table, (*expr._v__ast__SizeOf).typ); int s = mr_4612.arg0; - Option_v__ast__ComptTimeConstValue _t3; - opt_ok(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(&s) }, (Option*)(&_t3), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t3; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(&s) }, (_option*)(&_t3), sizeof(v__ast__ComptTimeConstValue)); return _t3; } - else if (expr._typ == 304 /* v.ast.FloatLiteral */) { + else if (expr._typ == 305 /* 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)); + _option_v__ast__ComptTimeConstValue _t4; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { f64_to_sumtype_v__ast__ComptTimeConstValue(&x) }, (_option*)(&_t4), sizeof(v__ast__ComptTimeConstValue)); return _t4; } - else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 312 /* v.ast.IntegerLiteral */) { u64 x = string_u64((*expr._v__ast__IntegerLiteral).val); if (x > 9223372036854775807U) { - Option_v__ast__ComptTimeConstValue _t5; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(&x) }, (Option*)(&_t5), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t5; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(&x) }, (_option*)(&_t5), sizeof(v__ast__ComptTimeConstValue)); return _t5; } - Option_v__ast__ComptTimeConstValue _t6; - 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)); + _option_v__ast__ComptTimeConstValue _t6; + opt_ok2(&(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 == 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)); + else if (expr._typ == 331 /* v.ast.StringLiteral */) { + _option_v__ast__ComptTimeConstValue _t7; + opt_ok2(&(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 == 295 /* v.ast.CharLiteral */) { + else if (expr._typ == 296 /* v.ast.CharLiteral */) { Array_rune runes = string_runes((*expr._v__ast__CharLiteral).val); if (runes.len > 0) { - Option_v__ast__ComptTimeConstValue _t8; - opt_ok(&(v__ast__ComptTimeConstValue[]) { rune_to_sumtype_v__ast__ComptTimeConstValue(&(*(rune*)/*ee elem_sym */array_get(runes, 0))) }, (Option*)(&_t8), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t8; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { rune_to_sumtype_v__ast__ComptTimeConstValue(&(*(rune*)/*ee elem_sym */array_get(runes, 0))) }, (_option*)(&_t8), sizeof(v__ast__ComptTimeConstValue)); return _t8; } - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - 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); + else if (expr._typ == 307 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 363 /* 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 == 293 /* v.ast.CastExpr */) { - Option_v__ast__ComptTimeConstValue _t11 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__CastExpr).expr, nlevel + 1); + else if (expr._typ == 294 /* 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; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__ast__ComptTimeConstValue cast_expr_value = (*(v__ast__ComptTimeConstValue*)_t11.data); if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i8_type)) { - Option_i8 _t14 = v__ast__ComptTimeConstValue_i8(cast_expr_value); + _option_i8 _t14 = v__ast__ComptTimeConstValue_i8(cast_expr_value); if (_t14.state != 0) { /*or block*/ IError err = _t14.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t13; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i8, ( (*(i8*)_t14.data)))) }, (Option*)(&_t13), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t13; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i8, ( (*(i8*)_t14.data)))) }, (_option*)(&_t13), sizeof(v__ast__ComptTimeConstValue)); return _t13; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i16_type)) { - Option_i16 _t17 = v__ast__ComptTimeConstValue_i16(cast_expr_value); + _option_i16 _t17 = v__ast__ComptTimeConstValue_i16(cast_expr_value); if (_t17.state != 0) { /*or block*/ IError err = _t17.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t16; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i16_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i16, ( (*(i16*)_t17.data)))) }, (Option*)(&_t16), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t16; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i16_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i16, ( (*(i16*)_t17.data)))) }, (_option*)(&_t16), sizeof(v__ast__ComptTimeConstValue)); return _t16; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__int_type)) { - Option_int _t20 = v__ast__ComptTimeConstValue_int(cast_expr_value); + _option_int _t20 = v__ast__ComptTimeConstValue_int(cast_expr_value); if (_t20.state != 0) { /*or block*/ IError err = _t20.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t19; - opt_ok(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(ADDR(int, ( (*(int*)_t20.data)))) }, (Option*)(&_t19), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t19; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { int_to_sumtype_v__ast__ComptTimeConstValue(ADDR(int, ( (*(int*)_t20.data)))) }, (_option*)(&_t19), sizeof(v__ast__ComptTimeConstValue)); return _t19; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__i64_type)) { - Option_i64 _t23 = v__ast__ComptTimeConstValue_i64(cast_expr_value); + _option_i64 _t23 = v__ast__ComptTimeConstValue_i64(cast_expr_value); if (_t23.state != 0) { /*or block*/ IError err = _t23.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t22; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ( (*(i64*)_t23.data)))) }, (Option*)(&_t22), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t22; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ( (*(i64*)_t23.data)))) }, (_option*)(&_t22), sizeof(v__ast__ComptTimeConstValue)); return _t22; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__byte_type)) { - Option_u8 _t26 = v__ast__ComptTimeConstValue_u8(cast_expr_value); + _option_u8 _t26 = v__ast__ComptTimeConstValue_u8(cast_expr_value); if (_t26.state != 0) { /*or block*/ IError err = _t26.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t25; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ( (*(u8*)_t26.data)))) }, (Option*)(&_t25), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t25; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ( (*(u8*)_t26.data)))) }, (_option*)(&_t25), sizeof(v__ast__ComptTimeConstValue)); return _t25; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u16_type)) { - Option_u16 _t29 = v__ast__ComptTimeConstValue_u16(cast_expr_value); + _option_u16 _t29 = v__ast__ComptTimeConstValue_u16(cast_expr_value); if (_t29.state != 0) { /*or block*/ IError err = _t29.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t28; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u16_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u16, ( (*(u16*)_t29.data)))) }, (Option*)(&_t28), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t28; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u16_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u16, ( (*(u16*)_t29.data)))) }, (_option*)(&_t28), sizeof(v__ast__ComptTimeConstValue)); return _t28; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u32_type)) { - Option_u32 _t32 = v__ast__ComptTimeConstValue_u32(cast_expr_value); + _option_u32 _t32 = v__ast__ComptTimeConstValue_u32(cast_expr_value); if (_t32.state != 0) { /*or block*/ IError err = _t32.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t31; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u32_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u32, ( (*(u32*)_t32.data)))) }, (Option*)(&_t31), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t31; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u32_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u32, ( (*(u32*)_t32.data)))) }, (_option*)(&_t31), sizeof(v__ast__ComptTimeConstValue)); return _t31; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__u64_type)) { - Option_u64 _t35 = v__ast__ComptTimeConstValue_u64(cast_expr_value); + _option_u64 _t35 = v__ast__ComptTimeConstValue_u64(cast_expr_value); if (_t35.state != 0) { /*or block*/ IError err = _t35.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t34; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ( (*(u64*)_t35.data)))) }, (Option*)(&_t34), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t34; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ( (*(u64*)_t35.data)))) }, (_option*)(&_t34), sizeof(v__ast__ComptTimeConstValue)); return _t34; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__f32_type)) { - Option_f32 _t38 = v__ast__ComptTimeConstValue_f32(cast_expr_value); + _option_f32 _t38 = v__ast__ComptTimeConstValue_f32(cast_expr_value); if (_t38.state != 0) { /*or block*/ IError err = _t38.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t37; - opt_ok(&(v__ast__ComptTimeConstValue[]) { f32_to_sumtype_v__ast__ComptTimeConstValue(ADDR(f32, ( (*(f32*)_t38.data)))) }, (Option*)(&_t37), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t37; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { f32_to_sumtype_v__ast__ComptTimeConstValue(ADDR(f32, ( (*(f32*)_t38.data)))) }, (_option*)(&_t37), sizeof(v__ast__ComptTimeConstValue)); return _t37; } if (v__ast__Type_alias_eq((*expr._v__ast__CastExpr).typ, _const_v__ast__f64_type)) { - Option_f64 _t41 = v__ast__ComptTimeConstValue_f64(cast_expr_value); + _option_f64 _t41 = v__ast__ComptTimeConstValue_f64(cast_expr_value); if (_t41.state != 0) { /*or block*/ IError err = _t41.err; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__ast__ComptTimeConstValue _t40; - opt_ok(&(v__ast__ComptTimeConstValue[]) { f64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(f64, ( (*(f64*)_t41.data)))) }, (Option*)(&_t40), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t40; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { f64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(f64, ( (*(f64*)_t41.data)))) }, (_option*)(&_t40), sizeof(v__ast__ComptTimeConstValue)); return _t40; } } - 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); + else if (expr._typ == 311 /* 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; + _option_v__ast__ComptTimeConstValue _t44; memcpy(&_t44, &_t43, sizeof(Option)); return _t44; } v__ast__ComptTimeConstValue left = (*(v__ast__ComptTimeConstValue*)_t43.data); - Option_v__ast__ComptTimeConstValue _t45 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__InfixExpr).right, nlevel + 1); + _option_v__ast__ComptTimeConstValue _t45 = v__checker__Checker_eval_comptime_const_expr(c, (*expr._v__ast__InfixExpr).right, nlevel + 1); if (_t45.state != 0) { /*or block*/ - Option_v__ast__ComptTimeConstValue _t46; + _option_v__ast__ComptTimeConstValue _t46; memcpy(&_t46, &_t45, sizeof(Option)); return _t46; } @@ -54650,89 +54723,89 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp if ((left)._typ == 20 /* string */ && (right)._typ == 20 /* string */) { if ((*expr._v__ast__InfixExpr).op == (v__token__Kind__plus)) { - Option_v__ast__ComptTimeConstValue _t47; - opt_ok(&(v__ast__ComptTimeConstValue[]) { string_to_sumtype_v__ast__ComptTimeConstValue(ADDR(string, (string__plus((*left._string), (*right._string))))) }, (Option*)(&_t47), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t47; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { string_to_sumtype_v__ast__ComptTimeConstValue(ADDR(string, (string__plus((*left._string), (*right._string))))) }, (_option*)(&_t47), sizeof(v__ast__ComptTimeConstValue)); return _t47; } else { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; }; } else if ((left)._typ == 13 /* u64 */ && (right)._typ == 8 /* i64 */) { switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t49; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) + ((i64)((*right._i64)))))) }, (Option*)(&_t49), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t49; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) + ((i64)((*right._i64)))))) }, (_option*)(&_t49), sizeof(v__ast__ComptTimeConstValue)); return _t49; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t50; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) - ((i64)((*right._i64)))))) }, (Option*)(&_t50), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t50; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) - ((i64)((*right._i64)))))) }, (_option*)(&_t50), sizeof(v__ast__ComptTimeConstValue)); return _t50; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t51; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) * ((i64)((*right._i64)))))) }, (Option*)(&_t51), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t51; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) * ((i64)((*right._i64)))))) }, (_option*)(&_t51), sizeof(v__ast__ComptTimeConstValue)); return _t51; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t52; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) / ((i64)((*right._i64)))))) }, (Option*)(&_t52), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t52; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) / ((i64)((*right._i64)))))) }, (_option*)(&_t52), sizeof(v__ast__ComptTimeConstValue)); return _t52; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t53; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) % ((i64)((*right._i64)))))) }, (Option*)(&_t53), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t53; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._u64))) % ((i64)((*right._i64)))))) }, (_option*)(&_t53), sizeof(v__ast__ComptTimeConstValue)); return _t53; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t54; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) ^ ((i64)((*right._i64))))))) }, (Option*)(&_t54), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t54; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) ^ ((i64)((*right._i64))))))) }, (_option*)(&_t54), sizeof(v__ast__ComptTimeConstValue)); return _t54; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t55; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) | ((i64)((*right._i64))))))) }, (Option*)(&_t55), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t55; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) | ((i64)((*right._i64))))))) }, (_option*)(&_t55), sizeof(v__ast__ComptTimeConstValue)); return _t55; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t56; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) & ((i64)((*right._i64))))))) }, (Option*)(&_t56), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t56; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._u64))) & ((i64)((*right._i64))))))) }, (_option*)(&_t56), sizeof(v__ast__ComptTimeConstValue)); return _t56; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t57; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._u64))) << ((i64)((*right._i64)))))))) }, (Option*)(&_t57), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t57; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._u64))) << ((i64)((*right._i64)))))))) }, (_option*)(&_t57), sizeof(v__ast__ComptTimeConstValue)); return _t57; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t58; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._u64))) >> ((i64)((*right._i64)))))))) }, (Option*)(&_t58), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t58; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._u64))) >> ((i64)((*right._i64)))))))) }, (_option*)(&_t58), sizeof(v__ast__ComptTimeConstValue)); return _t58; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t59; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._u64))))) >> ((i64)((*right._i64)))))))) }, (Option*)(&_t59), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t59; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._u64))))) >> ((i64)((*right._i64)))))))) }, (_option*)(&_t59), sizeof(v__ast__ComptTimeConstValue)); return _t59; break; } @@ -54842,7 +54915,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -54851,78 +54924,78 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t61; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) + ((i64)((*right._u64)))))) }, (Option*)(&_t61), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t61; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) + ((i64)((*right._u64)))))) }, (_option*)(&_t61), sizeof(v__ast__ComptTimeConstValue)); return _t61; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t62; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) - ((i64)((*right._u64)))))) }, (Option*)(&_t62), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t62; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) - ((i64)((*right._u64)))))) }, (_option*)(&_t62), sizeof(v__ast__ComptTimeConstValue)); return _t62; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t63; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) * ((i64)((*right._u64)))))) }, (Option*)(&_t63), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t63; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) * ((i64)((*right._u64)))))) }, (_option*)(&_t63), sizeof(v__ast__ComptTimeConstValue)); return _t63; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t64; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) / ((i64)((*right._u64)))))) }, (Option*)(&_t64), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t64; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) / ((i64)((*right._u64)))))) }, (_option*)(&_t64), sizeof(v__ast__ComptTimeConstValue)); return _t64; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t65; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) % ((i64)((*right._u64)))))) }, (Option*)(&_t65), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t65; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)((*left._i64))) % ((i64)((*right._u64)))))) }, (_option*)(&_t65), sizeof(v__ast__ComptTimeConstValue)); return _t65; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t66; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) ^ ((i64)((*right._u64))))))) }, (Option*)(&_t66), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t66; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) ^ ((i64)((*right._u64))))))) }, (_option*)(&_t66), sizeof(v__ast__ComptTimeConstValue)); return _t66; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t67; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) | ((i64)((*right._u64))))))) }, (Option*)(&_t67), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t67; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) | ((i64)((*right._u64))))))) }, (_option*)(&_t67), sizeof(v__ast__ComptTimeConstValue)); return _t67; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t68; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) & ((i64)((*right._u64))))))) }, (Option*)(&_t68), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t68; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((((i64)((*left._i64))) & ((i64)((*right._u64))))))) }, (_option*)(&_t68), sizeof(v__ast__ComptTimeConstValue)); return _t68; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t69; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) << ((i64)((*right._u64)))))))) }, (Option*)(&_t69), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t69; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) << ((i64)((*right._u64)))))))) }, (_option*)(&_t69), sizeof(v__ast__ComptTimeConstValue)); return _t69; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t70; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) >> ((i64)((*right._u64)))))))) }, (Option*)(&_t70), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t70; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) >> ((i64)((*right._u64)))))))) }, (_option*)(&_t70), sizeof(v__ast__ComptTimeConstValue)); return _t70; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t71; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._i64))))) >> ((i64)((*right._u64)))))))) }, (Option*)(&_t71), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t71; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._i64))))) >> ((i64)((*right._u64)))))))) }, (_option*)(&_t71), sizeof(v__ast__ComptTimeConstValue)); return _t71; break; } @@ -55032,7 +55105,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -55041,78 +55114,78 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t73; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) + (*right._u64)))) }, (Option*)(&_t73), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t73; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) + (*right._u64)))) }, (_option*)(&_t73), sizeof(v__ast__ComptTimeConstValue)); return _t73; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t74; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) - (*right._u64)))) }, (Option*)(&_t74), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t74; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) - (*right._u64)))) }, (_option*)(&_t74), sizeof(v__ast__ComptTimeConstValue)); return _t74; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t75; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) * (*right._u64)))) }, (Option*)(&_t75), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t75; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) * (*right._u64)))) }, (_option*)(&_t75), sizeof(v__ast__ComptTimeConstValue)); return _t75; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t76; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) / (*right._u64)))) }, (Option*)(&_t76), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t76; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) / (*right._u64)))) }, (_option*)(&_t76), sizeof(v__ast__ComptTimeConstValue)); return _t76; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t77; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) % (*right._u64)))) }, (Option*)(&_t77), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t77; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) % (*right._u64)))) }, (_option*)(&_t77), sizeof(v__ast__ComptTimeConstValue)); return _t77; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t78; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) ^ (*right._u64))))) }, (Option*)(&_t78), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t78; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) ^ (*right._u64))))) }, (_option*)(&_t78), sizeof(v__ast__ComptTimeConstValue)); return _t78; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t79; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) | (*right._u64))))) }, (Option*)(&_t79), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t79; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) | (*right._u64))))) }, (_option*)(&_t79), sizeof(v__ast__ComptTimeConstValue)); return _t79; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t80; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) & (*right._u64))))) }, (Option*)(&_t80), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t80; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((*left._u64) & (*right._u64))))) }, (_option*)(&_t80), sizeof(v__ast__ComptTimeConstValue)); return _t80; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t81; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) << (*right._u64)))) }, (Option*)(&_t81), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t81; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) << (*right._u64)))) }, (_option*)(&_t81), sizeof(v__ast__ComptTimeConstValue)); return _t81; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t82; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) >> (*right._u64)))) }, (Option*)(&_t82), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t82; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, ((*left._u64) >> (*right._u64)))) }, (_option*)(&_t82), sizeof(v__ast__ComptTimeConstValue)); return _t82; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t83; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((u64)((*left._u64))) >> (*right._u64)))) }, (Option*)(&_t83), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t83; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u64, (((u64)((*left._u64))) >> (*right._u64)))) }, (_option*)(&_t83), sizeof(v__ast__ComptTimeConstValue)); return _t83; break; } @@ -55222,7 +55295,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -55231,78 +55304,78 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t85; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) + (*right._i64)))) }, (Option*)(&_t85), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t85; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) + (*right._i64)))) }, (_option*)(&_t85), sizeof(v__ast__ComptTimeConstValue)); return _t85; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t86; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) - (*right._i64)))) }, (Option*)(&_t86), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t86; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) - (*right._i64)))) }, (_option*)(&_t86), sizeof(v__ast__ComptTimeConstValue)); return _t86; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t87; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) * (*right._i64)))) }, (Option*)(&_t87), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t87; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) * (*right._i64)))) }, (_option*)(&_t87), sizeof(v__ast__ComptTimeConstValue)); return _t87; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t88; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) / (*right._i64)))) }, (Option*)(&_t88), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t88; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) / (*right._i64)))) }, (_option*)(&_t88), sizeof(v__ast__ComptTimeConstValue)); return _t88; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t89; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) % (*right._i64)))) }, (Option*)(&_t89), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t89; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, ((*left._i64) % (*right._i64)))) }, (_option*)(&_t89), sizeof(v__ast__ComptTimeConstValue)); return _t89; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t90; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) ^ (*right._i64))))) }, (Option*)(&_t90), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t90; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) ^ (*right._i64))))) }, (_option*)(&_t90), sizeof(v__ast__ComptTimeConstValue)); return _t90; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t91; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) | (*right._i64))))) }, (Option*)(&_t91), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t91; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) | (*right._i64))))) }, (_option*)(&_t91), sizeof(v__ast__ComptTimeConstValue)); return _t91; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t92; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) & (*right._i64))))) }, (Option*)(&_t92), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t92; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((*left._i64) & (*right._i64))))) }, (_option*)(&_t92), sizeof(v__ast__ComptTimeConstValue)); return _t92; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t93; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) << (*right._i64)))))) }, (Option*)(&_t93), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t93; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) << (*right._i64)))))) }, (_option*)(&_t93), sizeof(v__ast__ComptTimeConstValue)); return _t93; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t94; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) >> (*right._i64)))))) }, (Option*)(&_t94), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t94; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)((*left._i64))) >> (*right._i64)))))) }, (_option*)(&_t94), sizeof(v__ast__ComptTimeConstValue)); return _t94; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t95; - opt_ok(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._i64))))) >> (*right._i64)))))) }, (Option*)(&_t95), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t95; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { i64_to_sumtype_v__ast__ComptTimeConstValue(ADDR(i64, (((i64)(((u64)(((u64)((*left._i64))))) >> (*right._i64)))))) }, (_option*)(&_t95), sizeof(v__ast__ComptTimeConstValue)); return _t95; break; } @@ -55412,7 +55485,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -55421,78 +55494,78 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp switch ((*expr._v__ast__InfixExpr).op) { case v__token__Kind__plus: { - Option_v__ast__ComptTimeConstValue _t97; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) + (*right._u8)))) }, (Option*)(&_t97), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t97; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) + (*right._u8)))) }, (_option*)(&_t97), sizeof(v__ast__ComptTimeConstValue)); return _t97; break; } case v__token__Kind__minus: { - Option_v__ast__ComptTimeConstValue _t98; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) - (*right._u8)))) }, (Option*)(&_t98), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t98; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) - (*right._u8)))) }, (_option*)(&_t98), sizeof(v__ast__ComptTimeConstValue)); return _t98; break; } case v__token__Kind__mul: { - Option_v__ast__ComptTimeConstValue _t99; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) * (*right._u8)))) }, (Option*)(&_t99), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t99; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) * (*right._u8)))) }, (_option*)(&_t99), sizeof(v__ast__ComptTimeConstValue)); return _t99; break; } case v__token__Kind__div: { - Option_v__ast__ComptTimeConstValue _t100; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) / (*right._u8)))) }, (Option*)(&_t100), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t100; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) / (*right._u8)))) }, (_option*)(&_t100), sizeof(v__ast__ComptTimeConstValue)); return _t100; break; } case v__token__Kind__mod: { - Option_v__ast__ComptTimeConstValue _t101; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) % (*right._u8)))) }, (Option*)(&_t101), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t101; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) % (*right._u8)))) }, (_option*)(&_t101), sizeof(v__ast__ComptTimeConstValue)); return _t101; break; } case v__token__Kind__xor: { - Option_v__ast__ComptTimeConstValue _t102; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) ^ (*right._u8))))) }, (Option*)(&_t102), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t102; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) ^ (*right._u8))))) }, (_option*)(&_t102), sizeof(v__ast__ComptTimeConstValue)); return _t102; break; } case v__token__Kind__pipe: { - Option_v__ast__ComptTimeConstValue _t103; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) | (*right._u8))))) }, (Option*)(&_t103), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t103; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) | (*right._u8))))) }, (_option*)(&_t103), sizeof(v__ast__ComptTimeConstValue)); return _t103; break; } case v__token__Kind__amp: { - Option_v__ast__ComptTimeConstValue _t104; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) & (*right._u8))))) }, (Option*)(&_t104), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t104; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((*left._u8) & (*right._u8))))) }, (_option*)(&_t104), sizeof(v__ast__ComptTimeConstValue)); return _t104; break; } case v__token__Kind__left_shift: { - Option_v__ast__ComptTimeConstValue _t105; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) << (*right._u8)))) }, (Option*)(&_t105), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t105; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) << (*right._u8)))) }, (_option*)(&_t105), sizeof(v__ast__ComptTimeConstValue)); return _t105; break; } case v__token__Kind__right_shift: { - Option_v__ast__ComptTimeConstValue _t106; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) >> (*right._u8)))) }, (Option*)(&_t106), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t106; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, ((*left._u8) >> (*right._u8)))) }, (_option*)(&_t106), sizeof(v__ast__ComptTimeConstValue)); return _t106; break; } case v__token__Kind__unsigned_right_shift: { - Option_v__ast__ComptTimeConstValue _t107; - opt_ok(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((u8)((*left._u8))) >> (*right._u8)))) }, (Option*)(&_t107), sizeof(v__ast__ComptTimeConstValue)); + _option_v__ast__ComptTimeConstValue _t107; + opt_ok2(&(v__ast__ComptTimeConstValue[]) { u8_to_sumtype_v__ast__ComptTimeConstValue(ADDR(u8, (((u8)((*left._u8))) >> (*right._u8)))) }, (_option*)(&_t107), sizeof(v__ast__ComptTimeConstValue)); return _t107; break; } @@ -55602,7 +55675,7 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp case v__token__Kind___end_: default: { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; break; } } @@ -55611,10 +55684,10 @@ VV_LOCAL_SYMBOL Option_v__ast__ComptTimeConstValue v__checker__Checker_eval_comp } else { - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } ; - return (Option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__ComptTimeConstValue){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL multi_return_bool_int_int v__checker__Checker_verify_vweb_params_for_method(v__checker__Checker* c, v__ast__Fn node) { @@ -55681,7 +55754,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 == 306 /* v.ast.Ident */) { + if ((node->ct_expr)._typ == 307 /* 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); @@ -55718,15 +55791,15 @@ VV_LOCAL_SYMBOL bool v__checker__Checker_evaluate_once_comptime_if_attribute(v__ } VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime_if_branch(v__checker__Checker* c, v__ast__Expr cond, v__token__Pos pos) { - if (cond._typ == 290 /* v.ast.BoolLiteral */) { + if (cond._typ == 291 /* v.ast.BoolLiteral */) { v__checker__ComptimeBranchSkipState _t1 = ((*cond._v__ast__BoolLiteral).val ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); return _t1; } - else if (cond._typ == 321 /* v.ast.ParExpr */) { + else if (cond._typ == 322 /* v.ast.ParExpr */) { v__checker__ComptimeBranchSkipState _t2 = v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__ParExpr).expr, pos); return _t2; } - else if (cond._typ == 323 /* v.ast.PrefixExpr */) { + else if (cond._typ == 324 /* 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); } @@ -55734,17 +55807,17 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime v__checker__ComptimeBranchSkipState _t3 = (reversed == v__checker__ComptimeBranchSkipState__eval ? (v__checker__ComptimeBranchSkipState__skip) : reversed == v__checker__ComptimeBranchSkipState__skip ? (v__checker__ComptimeBranchSkipState__eval) : (reversed)); return _t3; } - else if (cond._typ == 322 /* v.ast.PostfixExpr */) { + else if (cond._typ == 323 /* 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 == 306 /* v.ast.Ident */) { + } else if (((*cond._v__ast__PostfixExpr).expr)._typ == 307 /* v.ast.Ident */) { v__checker__ComptimeBranchSkipState _t4 = (Array_string_contains(c->pref->compile_defines_all, (*(*cond._v__ast__PostfixExpr).expr._v__ast__Ident).name) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); return _t4; } else { v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__PostfixExpr).pos); } } - else if (cond._typ == 310 /* v.ast.InfixExpr */) { + else if (cond._typ == 311 /* v.ast.InfixExpr */) { if ((*cond._v__ast__InfixExpr).op == (v__token__Kind__and)) { v__checker__ComptimeBranchSkipState l = v__checker__Checker_comptime_if_branch(c, (*cond._v__ast__InfixExpr).left, (*cond._v__ast__InfixExpr).pos); @@ -55767,19 +55840,19 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime return _t8; } 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 == 332 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 332 /* v.ast.TypeNode */) { + if (((*cond._v__ast__InfixExpr).left)._typ == 333 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 333 /* 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); } v__checker__ComptimeBranchSkipState _t9 = v__checker__ComptimeBranchSkipState__unknown; return _t9; - } 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 */ ; + } else if (((*cond._v__ast__InfixExpr).left)._typ == 333 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 300 /* 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, 333) /*expected idx: 333, name: v.ast.TypeNode */ ; v__ast__Type checked_type = v__checker__Checker_unwrap_generic(c, left.typ); v__checker__ComptimeBranchSkipState _t10 = (v__ast__Table_is_comptime_type(c->table, checked_type, (*(*cond._v__ast__InfixExpr).right._v__ast__ComptimeType)) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); return _t10; - } else if (((*cond._v__ast__InfixExpr).left)._typ == 326 /* v.ast.SelectorExpr */ || ((*cond._v__ast__InfixExpr).left)._typ == 332 /* v.ast.TypeNode */) { + } else if (((*cond._v__ast__InfixExpr).left)._typ == 327 /* v.ast.SelectorExpr */ || ((*cond._v__ast__InfixExpr).left)._typ == 333 /* v.ast.TypeNode */) { v__checker__Checker_expr(c, (*cond._v__ast__InfixExpr).left); v__checker__ComptimeBranchSkipState _t11 = v__checker__ComptimeBranchSkipState__unknown; return _t11; @@ -55788,11 +55861,11 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime } } 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 == 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 */) { + if (((*cond._v__ast__InfixExpr).left)._typ == 327 /* v.ast.SelectorExpr */ && ((*cond._v__ast__InfixExpr).right)._typ == 312 /* v.ast.IntegerLiteral */) { + } else if (((*cond._v__ast__InfixExpr).left)._typ == 307 /* 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 _t12 = v__checker__Checker_find_definition(c, (*(*cond._v__ast__InfixExpr).left._v__ast__Ident)); + _option_v__ast__Expr _t12 = v__checker__Checker_find_definition(c, (*(*cond._v__ast__InfixExpr).left._v__ast__Ident)); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), (*(*cond._v__ast__InfixExpr).left._v__ast__Ident).pos); @@ -55817,7 +55890,7 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime v__checker__Checker_error(c, _SLIT("invalid `$if` condition"), (*cond._v__ast__InfixExpr).pos); }; } - else if (cond._typ == 306 /* v.ast.Ident */) { + else if (cond._typ == 307 /* 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_equal = true; @@ -55935,14 +56008,14 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime return _t40; } v__ast__Type typ = v__checker__Checker_unwrap_generic(c, v__checker__Checker_expr(c, cond)); - 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 (((*cond._v__ast__Ident).obj)._typ != 365 /* v.ast.Var */ && ((*cond._v__ast__Ident).obj)._typ != 363 /* v.ast.ConstField */ && ((*cond._v__ast__Ident).obj)._typ != 364 /* v.ast.GlobalField */) { if (!c->inside_ct_attr) { 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); } v__checker__ComptimeBranchSkipState _t41 = v__checker__ComptimeBranchSkipState__unknown; return _t41; } - Option_v__ast__Expr _t42 = v__checker__Checker_find_obj_definition(c, (*cond._v__ast__Ident).obj); + _option_v__ast__Expr _t42 = v__checker__Checker_find_obj_definition(c, (*cond._v__ast__Ident).obj); if (_t42.state != 0) { /*or block*/ IError err = _t42.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), (*cond._v__ast__Ident).pos); @@ -55955,13 +56028,13 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime 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 `"), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT("` used as $if condition"), 0, { .d_c = 0 }}})), (*cond._v__ast__Ident).pos); } - v__checker__ComptimeBranchSkipState _t44 = ((/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)._v__ast__BoolLiteral,(expr)._typ, 290) /*expected idx: 290, name: v.ast.BoolLiteral */ ).val ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); + v__checker__ComptimeBranchSkipState _t44 = ((/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)._v__ast__BoolLiteral,(expr)._typ, 291) /*expected idx: 291, name: v.ast.BoolLiteral */ ).val ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); return _t44; } } - else if (cond._typ == 297 /* v.ast.ComptimeCall */) { + else if (cond._typ == 298 /* v.ast.ComptimeCall */) { if ((*cond._v__ast__ComptimeCall).is_pkgconfig) { - Option_v__pkgconfig__Main_ptr _t45 = v__pkgconfig__main(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){string_clone((*cond._v__ast__ComptimeCall).args_var)}))); + _option_v__pkgconfig__Main_ptr _t45 = v__pkgconfig__main(new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){string_clone((*cond._v__ast__ComptimeCall).args_var)}))); if (_t45.state != 0) { /*or block*/ IError err = _t45.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), (*cond._v__ast__ComptimeCall).pos); @@ -55970,7 +56043,7 @@ VV_LOCAL_SYMBOL v__checker__ComptimeBranchSkipState v__checker__Checker_comptime } v__pkgconfig__Main* m = (*(v__pkgconfig__Main**)_t45.data); - Option_string _t47 = v__pkgconfig__Main_run(m); + _option_string _t47 = v__pkgconfig__Main_run(m); if (_t47.state != 0) { /*or block*/ IError err = _t47.err; v__checker__ComptimeBranchSkipState _t48 = v__checker__ComptimeBranchSkipState__skip; @@ -55997,7 +56070,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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, 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); @@ -56019,7 +56092,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra v__ast__Expr default_expr = node->default_expr; v__ast__Type default_typ = v__checker__Checker_check_expr_opt_call(c, default_expr, v__checker__Checker_expr(c, default_expr)); node->default_type = default_typ; - Option_void _t1 = v__checker__Checker_check_expected(c, default_typ, node->elem_type); + _option_void _t1 = v__checker__Checker_check_expected(c, default_typ, node->elem_type); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__checker__Checker_error(c, IError_name_table[err._typ]._method_msg(err._object), v__ast__Expr_pos(default_expr)); @@ -56037,7 +56110,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra } v__checker__Checker_ensure_sumtype_array_has_default_value(c, *node); } - Option_void _t2 = v__checker__Checker_ensure_type_exists(c, node->elem_type, node->elem_type_pos); + _option_void _t2 = v__checker__Checker_ensure_type_exists(c, node->elem_type, node->elem_type_pos); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -56051,7 +56124,7 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra } if (node->is_fixed) { v__checker__Checker_ensure_sumtype_array_has_default_value(c, *node); - Option_void _t4 = v__checker__Checker_ensure_type_exists(c, node->elem_type, node->elem_type_pos); + _option_void _t4 = v__checker__Checker_ensure_type_exists(c, node->elem_type, node->elem_type_pos); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; } @@ -56130,13 +56203,13 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra c->expected_type = elem_type; continue; } - if ((expr)->_typ != 332 /* v.ast.TypeNode */) { + if ((expr)->_typ != 333 /* 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; } } - Option_void _t8 = v__checker__Checker_check_expected(c, typ, elem_type); + _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: "), /*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)); @@ -56166,15 +56239,15 @@ 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 == 311 /* v.ast.IntegerLiteral */) { + if (init_expr._typ == 312 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*init_expr._v__ast__IntegerLiteral).val); } - 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; + else if (init_expr._typ == 307 /* v.ast.Ident */) { + if (((*init_expr._v__ast__Ident).obj)._typ == 363 /* 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; - Option_i64 _t10 = v__ast__ComptTimeConstValue_i64(comptime_value); + _option_i64 _t10 = v__ast__ComptTimeConstValue_i64(comptime_value); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; *(i64*) _t10.data = fixed_size; @@ -56186,11 +56259,11 @@ v__ast__Type v__checker__Checker_array_init(v__checker__Checker* c, v__ast__Arra 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 == 310 /* v.ast.InfixExpr */) { - Option_v__ast__ComptTimeConstValue _t11; + else if (init_expr._typ == 311 /* 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; - Option_i64 _t12 = v__ast__ComptTimeConstValue_i64(comptime_value); + _option_i64 _t12 = v__ast__ComptTimeConstValue_i64(comptime_value); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; *(i64*) _t12.data = fixed_size; @@ -56260,7 +56333,7 @@ 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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, 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 `"), /*115 &string*/0xfe10, {.d_s = val_sym->name}}, {_SLIT("` must specify type parameter, e.g. Foo"), 0, { .d_c = 0 }}})), node->pos); @@ -56270,13 +56343,13 @@ v__ast__Type v__checker__Checker_map_init(v__checker__Checker* c, v__ast__MapIni } } } - Option_void _t3 = v__checker__Checker_ensure_type_exists(c, info.key_type, node->pos); + _option_void _t3 = v__checker__Checker_ensure_type_exists(c, info.key_type, node->pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; } ; - Option_void _t4 = v__checker__Checker_ensure_type_exists(c, info.value_type, node->pos); + _option_void _t4 = v__checker__Checker_ensure_type_exists(c, info.value_type, node->pos); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; } @@ -56402,7 +56475,7 @@ v__ast__Scope* prev_fn_scope; c->main_fn_decl_node = *node; } if (!v__ast__Type_alias_eq(node->return_type, _const_v__ast__void_type)) { - Option_int _t3; + _option_int _t3; 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); @@ -56410,14 +56483,14 @@ v__ast__Scope* prev_fn_scope; } if (node->generic_names.len > 0) { v__ast__TypeSymbol* gs = v__ast__Table_sym(c->table, node->return_type); - if ((gs->info)._typ == 456 /* v.ast.Struct */) { + if ((gs->info)._typ == 457 /* 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 == 482 /* v.ast.MultiReturn */) { + if ((return_sym->info)._typ == 483 /* 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); @@ -56468,14 +56541,14 @@ 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 == 474 /* v.ast.Interface */) { + if ((sym->info)._typ == 475 /* 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 `"), /*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 == 456 /* v.ast.Struct */) { - Option_v__ast__StructField _t6; + if ((sym->info)._typ == 457 /* 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); @@ -56505,7 +56578,7 @@ v__ast__Scope* prev_fn_scope; if (node->language == v__ast__Language__v) { for (int _t7 = 0; _t7 < node->params.len; ++_t7) { v__ast__Param* param = ((v__ast__Param*)node->params.data) + _t7; - Option_void _t8 = v__checker__Checker_ensure_type_exists(c, param->typ, param->type_pos); + _option_void _t8 = v__checker__Checker_ensure_type_exists(c, param->typ, param->type_pos); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { IError err = _t8.err; // Defer begin @@ -56533,9 +56606,9 @@ 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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, name: v.ast.Struct */ ; if (info.is_heap) { - Option_v__ast__Var_ptr _t9 = v__ast__Scope_find_var(node->scope, param->name); + _option_v__ast__Var_ptr _t9 = v__ast__Scope_find_var(node->scope, param->name); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; continue; @@ -56548,12 +56621,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, 474) /*expected idx: 474, 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, 475) /*expected idx: 475, 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, 475) /*expected idx: 475, 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, 476) /*expected idx: 476, 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); } @@ -56573,7 +56646,7 @@ v__ast__Scope* prev_fn_scope; } } if (!v__ast__Type_alias_eq(node->return_type, ((v__ast__Type)(0)))) { - Option_void _t10 = v__checker__Checker_ensure_type_exists(c, node->return_type, node->return_type_pos); + _option_void _t10 = v__checker__Checker_ensure_type_exists(c, node->return_type, node->return_type_pos); if (_t10.state != 0 && _t10.err._typ != _IError_None___index) { IError err = _t10.err; // Defer begin @@ -56630,7 +56703,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 == 337 /* v.ast.AssertStmt */) { + if ((st)._typ == 338 /* 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; } @@ -56645,13 +56718,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 != 357 /* 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 != 358 /* 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 */)) { + 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 != 358 /* 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)),})))) })); @@ -56712,7 +56785,7 @@ bool keep_inside_anon; c->inside_anon_fn = true; for (int _t2 = 0; _t2 < node->inherited_vars.len; ++_t2) { v__ast__Param* var = ((v__ast__Param*)node->inherited_vars.data) + _t2; - Option_v__ast__Var_ptr _t3 = v__ast__Scope_find_var(node->decl.scope->parent, var->name); + _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 `"), /*115 &string*/0xfe10, {.d_s = var->name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); @@ -56755,12 +56828,12 @@ 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 == 306 /* v.ast.Ident */ || (arg.expr)._typ == 330 /* v.ast.StringLiteral */ || (arg.expr)._typ == 326 /* v.ast.SelectorExpr */) { + if ((arg.expr)._typ == 307 /* v.ast.Ident */ || (arg.expr)._typ == 331 /* v.ast.StringLiteral */ || (arg.expr)._typ == 327 /* 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 == 306 /* v.ast.Ident */ || (node->left)._typ == 330 /* v.ast.StringLiteral */ || (node->left)._typ == 326 /* v.ast.SelectorExpr */)) { + if (v__ast__Type_alias_eq(node->receiver_type, _const_v__ast__string_type) && !((node->left)._typ == 307 /* v.ast.Ident */ || (node->left)._typ == 331 /* v.ast.StringLiteral */ || (node->left)._typ == 327 /* v.ast.SelectorExpr */)) { node->free_receiver = true; } } @@ -56824,7 +56897,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp return _t5; } c->table->cur_fn->has_await = true; - if (tsym->info._typ == 456 /* v.ast.Struct */) { + if (tsym->info._typ == 457 /* 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; @@ -56840,8 +56913,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp ; _v_panic(_SLIT("unreachable")); VUNREACHABLE(); - } - if (string__eq(fn_name, _SLIT("json.encode"))) { + } else if (string__eq(fn_name, _SLIT("json.encode"))) { } else if (string__eq(fn_name, _SLIT("json.decode")) && node->args.len > 0) { if (node->args.len != 2) { v__checker__Checker_error(c, _SLIT("json.decode expects 2 arguments, a type and a string (e.g `json.decode(T, '')`)"), node->pos); @@ -56849,9 +56921,17 @@ 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 == 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)) { + if ((expr)._typ == 333 /* v.ast.TypeNode */) { + v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, (*expr._v__ast__TypeNode).typ)); + if (v__ast__Table_known_type(c->table, sym->name) && sym->kind != v__ast__Kind__placeholder) { + v__ast__Kind kind = sym->kind; + if ((sym->info)._typ == 472 /* v.ast.Alias */) { + kind = v__ast__Table_sym(c->table, (*sym->info._v__ast__Alias).parent_type)->kind; + } + if (!(kind == v__ast__Kind__struct_ || kind == v__ast__Kind__sum_type || kind == v__ast__Kind__map || kind == v__ast__Kind__array)) { + v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("json.decode: expected sum type, struct, map or array, found "), /*115 &v.ast.Kind*/0xfe10, {.d_s = v__ast__Kind_str(kind)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*expr._v__ast__TypeNode).pos); + } + } else { 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 { @@ -56865,7 +56945,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, 332) /*expected idx: 332, name: v.ast.TypeNode */ ; + v__ast__TypeNode typ = /* as */ *(v__ast__TypeNode*)__as_cast((expr)._v__ast__TypeNode,(expr)._typ, 333) /*expected idx: 333, 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; @@ -56874,18 +56954,18 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__ast__Fn func = ((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}); bool found = false; bool found_in_args = false; - if ((node->left)._typ == 284 /* v.ast.AnonFn */) { + if ((node->left)._typ == 285 /* 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, 483) /*expected idx: 483, name: v.ast.FnType */ ).func; + func = (/* as */ *(v__ast__FnType*)__as_cast((anon_fn_sym->info)._v__ast__FnType,(anon_fn_sym->info)._typ, 484) /*expected idx: 484, 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, /*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; + _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; node->name = name_prefixed; @@ -56894,14 +56974,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){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,} })).usages++; } } - if (!found && (node->left)._typ == 309 /* v.ast.IndexExpr */) { + if (!found && (node->left)._typ == 310 /* 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, 309) /*expected idx: 309, name: v.ast.IndexExpr */ ; + v__ast__IndexExpr expr = /* as */ *(v__ast__IndexExpr*)__as_cast((node->left)._v__ast__IndexExpr,(node->left)._typ, 310) /*expected idx: 310, 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, info.elem_type); - if ((elem_sym->info)._typ == 483 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 484 /* 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; @@ -56909,9 +56989,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, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 453) /*expected idx: 453, name: v.ast.Map */ ; v__ast__TypeSymbol* value_sym = v__ast__Table_sym(c->table, info.value_type); - if ((value_sym->info)._typ == 483 /* v.ast.FnType */) { + if ((value_sym->info)._typ == 484 /* 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; @@ -56919,9 +56999,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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ; v__ast__TypeSymbol* elem_sym = v__ast__Table_sym(c->table, info.elem_type); - if ((elem_sym->info)._typ == 483 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 484 /* 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; @@ -56933,19 +57013,19 @@ 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 == 292 /* v.ast.CallExpr */) { + if (!found && (node->left)._typ == 293 /* 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, 292) /*expected idx: 292, name: v.ast.CallExpr */ ; + v__ast__CallExpr expr = /* as */ *(v__ast__CallExpr*)__as_cast((node->left)._v__ast__CallExpr,(node->left)._typ, 293) /*expected idx: 293, 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, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 484) /*expected idx: 484, name: v.ast.FnType */ ; node->return_type = info.func.return_type; found = true; func = info.func; } } if (!found) { - Option_v__ast__Fn _t16; + _option_v__ast__Fn _t16; if (_t16 = v__ast__Table_find_fn(c->table, fn_name), _t16.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t16.data; found = true; @@ -56964,7 +57044,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."), /*115 &string*/0xfe10, {.d_s = fn_name}}, {_SLIT0, 0, { .d_c = 0 }}})); - Option_v__ast__Fn _t17; + _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; if (f.generic_names.len == node->concrete_types.len) { @@ -56983,15 +57063,15 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } if (!found) { int typ = 0; - Option_v__ast__ScopeObject _t19; + _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 == 363 /* v.ast.GlobalField */) { + if (obj._typ == 364 /* v.ast.GlobalField */) { typ = (*obj._v__ast__GlobalField).typ; node->is_fn_var = true; node->fn_var_type = typ; } - else if (obj._typ == 364 /* v.ast.Var */) { + else if (obj._typ == 365 /* 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)); @@ -57010,14 +57090,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, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((generic_vts->info)._v__ast__FnType,(generic_vts->info)._typ, 484) /*expected idx: 484, 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, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((vts->info)._v__ast__FnType,(vts->info)._typ, 484) /*expected idx: 484, name: v.ast.FnType */ ; func = info.func; found = true; found_in_args = true; @@ -57026,21 +57106,21 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } } if (!found) { - Option_v__ast__ScopeObject _t21; + _option_v__ast__ScopeObject _t21; if (_t21 = v__ast__Scope_find(c->file->global_scope, fn_name), _t21.state == 0) { v__ast__ScopeObject obj = *(v__ast__ScopeObject*)_t21.data; if ((*(obj.typ)) != 0) { 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, 483) /*expected idx: 483, name: v.ast.FnType */ ).func; + func = (/* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 484) /*expected idx: 484, name: v.ast.FnType */ ).func; } } } } if (!found) { *continue_check = false; - Option_int _t22; + _option_int _t22; if (_t22 = string_index(fn_name, _SLIT(".")), _t22.state == 0) { int dot_index = *(int*)_t22.data; if (!u8_is_capital(string_at(fn_name, 0))) { @@ -57099,7 +57179,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } for (int _t30 = 0; _t30 < node->concrete_types.len; ++_t30) { v__ast__Type concrete_type = ((v__ast__Type*)node->concrete_types.data)[_t30]; - Option_void _t31 = v__checker__Checker_ensure_type_exists(c, concrete_type, node->concrete_list_pos); + _option_void _t31 = v__checker__Checker_ensure_type_exists(c, concrete_type, node->concrete_list_pos); if (_t31.state != 0 && _t31.err._typ != _IError_None___index) { IError err = _t31.err; } @@ -57115,7 +57195,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp node->should_be_skipped = v__checker__Checker_evaluate_once_comptime_if_attribute(c, (voidptr)&/*qq*/(*(v__ast__Attr*)/*ee elem_sym */array_get(func.attrs, func.ctdefine_idx))); } if (node->language != v__ast__Language__js) { - Option_void _t33 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/func); + _option_void _t33 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/func); if (_t33.state != 0 && _t33.err._typ != _IError_None___index) { IError err = _t33.err; v__ast__Type _t34 = func.return_type; @@ -57163,25 +57243,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 == 285 /* v.ast.ArrayDecompose */) { + if (func.is_variadic && (call_arg->expr)._typ == 286 /* 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 `"), /*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 == 315 /* v.ast.MapInit */ && e_sym->kind == v__ast__Kind__struct_) { + if ((call_arg->expr)._typ == 316 /* 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 == 331 /* v.ast.StructInit */ && e_sym->kind == v__ast__Kind__map) { + } else if ((call_arg->expr)._typ == 332 /* 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 == 306 /* v.ast.Ident */) { - if (((*call_arg->expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((call_arg->expr)._typ == 307 /* v.ast.Ident */) { + if (((*call_arg->expr._v__ast__Ident).obj)._typ == 365 /* 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; } } @@ -57196,9 +57276,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("function with `shared` arguments cannot be called inside `lock`/`rlock` block"), call_arg->pos); } if (call_arg->is_mut) { - multi_return_string_v__token__Pos mr_29125 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); - string to_lock = mr_29125.arg0; - v__token__Pos pos = mr_29125.arg1; + multi_return_string_v__token__Pos mr_29424 = v__checker__Checker_fail_if_immutable(c, call_arg->expr); + string to_lock = mr_29424.arg0; + v__token__Pos pos = mr_29424.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)); } @@ -57223,8 +57303,8 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } 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 == 451 /* v.ast.Array */) { - final_param_typ = v__ast__TypeSymbol_array_info(param_typ_sym).elem_type; + if (func.is_variadic && (param_typ_sym->info)._typ == 452 /* v.ast.Array */) { + final_param_typ = (*param_typ_sym->info._v__ast__Array).elem_type; final_param_sym = v__ast__Table_sym(c->table, final_param_typ); } if (!v__ast__Type_alias_eq(call_arg->typ, param.typ) && (v__ast__Type_alias_eq(param.typ, _const_v__ast__voidptr_type) || final_param_sym->idx == _const_v__ast__voidptr_type_idx) && !v__ast__Type_is_any_kind_of_pointer(call_arg->typ) && func.language == v__ast__Language__v && !v__ast__Expr_is_lvalue(call_arg->expr) && !string__eq(func.name, _SLIT("json.encode")) && !c->pref->translated && !c->file->is_translated) { @@ -57238,7 +57318,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } continue; } - Option_void _t38 = v__checker__Checker_check_expected_call_arg(c, arg_typ, v__checker__Checker_unwrap_generic(c, param.typ), node->language, *call_arg); + _option_void _t38 = v__checker__Checker_check_expected_call_arg(c, arg_typ, v__checker__Checker_unwrap_generic(c, param.typ), node->language, *call_arg); if (_t38.state != 0 && _t38.err._typ != _IError_None___index) { IError err = _t38.err; if (arg_typ_sym->kind == v__ast__Kind__void && param_typ_sym->kind == v__ast__Kind__string) { @@ -57248,9 +57328,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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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; @@ -57280,7 +57360,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp if (param.typ == _const_v__ast__voidptr_type_idx || arg_typ == _const_v__ast__voidptr_type_idx) { continue; } - if ((arg_typ_sym->kind == v__ast__Kind__array_fixed && (param_is_number || v__ast__Type_is_any_kind_of_pointer(param.typ))) || (param_typ_sym->kind == v__ast__Kind__array_fixed && (typ_is_number || v__ast__Type_is_any_kind_of_pointer(arg_typ)))) { + if (((arg_typ_sym->kind == v__ast__Kind__array_fixed || arg_typ_sym->kind == v__ast__Kind__array) && (param_is_number || v__ast__Type_is_any_kind_of_pointer(param.typ))) || ((param_typ_sym->kind == v__ast__Kind__array_fixed || param_typ_sym->kind == v__ast__Kind__array) && (typ_is_number || v__ast__Type_is_any_kind_of_pointer(arg_typ)))) { continue; } if (v__ast__Type_is_any_kind_of_pointer(param.typ) && typ_is_number) { @@ -57310,7 +57390,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp c->expected_type = param.typ; v__ast__Type typ = v__checker__Checker_check_expr_opt_call(c, call_arg->expr, v__checker__Checker_expr(c, call_arg->expr)); if (v__ast__Type_has_flag(param.typ, v__ast__TypeFlag__generic) && func.generic_names.len == node->concrete_types.len) { - Option_v__ast__Type _t39; + _option_v__ast__Type _t39; if (_t39 = v__ast__Table_resolve_generic_to_concrete(c->table, param.typ, func.generic_names, concrete_types), _t39.state == 0) { v__ast__Type unwrap_typ = *(v__ast__Type*)_t39.data; v__ast__Type utyp = v__checker__Checker_unwrap_generic(c, typ); @@ -57323,7 +57403,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp } continue; } - Option_void _t40 = v__checker__Checker_check_expected_call_arg(c, utyp, unwrap_typ, node->language, *call_arg); + _option_void _t40 = v__checker__Checker_check_expected_call_arg(c, utyp, unwrap_typ, node->language, *call_arg); if (_t40.state != 0 && _t40.err._typ != _IError_None___index) { IError err = _t40.err; if (c->comptime_fields_type.len > 0) { @@ -57344,7 +57424,7 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp node->return_type = func.return_type; } if (node->concrete_types.len > 0 && func.return_type != 0 && c->table->cur_fn->generic_names.len == 0) { - Option_v__ast__Type _t41; + _option_v__ast__Type _t41; if (_t41 = v__ast__Table_resolve_generic_to_concrete(c->table, func.return_type, func.generic_names, concrete_types), _t41.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t41.data; node->return_type = typ; @@ -57356,9 +57436,9 @@ v__ast__Type v__checker__Checker_fn_call(v__checker__Checker* c, v__ast__CallExp v__checker__Checker_error(c, _SLIT("a non generic function called like a generic one"), node->concrete_list_pos); } if (func.generic_names.len > 0) { - Option_v__ast__Type _t43; + _option_v__ast__Type _t43; if (has_generic) { - Option_v__ast__Type _t44; + _option_v__ast__Type _t44; if (_t44 = v__ast__Table_resolve_generic_to_concrete(c->table, func.return_type, func.generic_names, node->concrete_types), _t44.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t44.data; if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { @@ -57393,7 +57473,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__TypeSymbol* final_left_sym = v__ast__Table_final_sym(c->table, unwrapped_left_type); string method_name = node->name; string _t1; /* if prepend */ - Option_v__ast__StructField _t2; + _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 `"), /*115 &string*/0xfe10, {.d_s = field.name}}, {_SLIT("` did you mean to access the field with the same name instead?"), 0, { .d_c = 0 }}})); @@ -57424,12 +57504,12 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (left_sym->kind == v__ast__Kind__array && Array_string_contains(_const_v__checker__array_builtin_methods, method_name)) { v__ast__Type _t7 = v__checker__Checker_array_builtin_method_call(c, node, left_type, *v__ast__Table_sym(c->table, left_type)); return _t7; - } else if ((left_sym->kind == v__ast__Kind__map || final_left_sym->kind == v__ast__Kind__map) && (string__eq(method_name, _SLIT("clone")) || string__eq(method_name, _SLIT("keys")) || string__eq(method_name, _SLIT("move")) || string__eq(method_name, _SLIT("delete")))) { + } else if ((left_sym->kind == v__ast__Kind__map || final_left_sym->kind == v__ast__Kind__map) && (string__eq(method_name, _SLIT("clone")) || string__eq(method_name, _SLIT("keys")) || string__eq(method_name, _SLIT("values")) || string__eq(method_name, _SLIT("move")) || string__eq(method_name, _SLIT("delete")))) { if (left_sym->kind == v__ast__Kind__map) { v__ast__Type _t8 = v__checker__Checker_map_builtin_method_call(c, node, left_type, *left_sym); return _t8; } else { - 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 parent_type = (/* as */ *(v__ast__Alias*)__as_cast((left_sym->info)._v__ast__Alias,(left_sym->info)._typ, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type; v__ast__Type _t9 = v__checker__Checker_map_builtin_method_call(c, node, parent_type, *final_left_sym); return _t9; } @@ -57454,7 +57534,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal return _t12; } } - 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__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 452) /*expected idx: 452, 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); @@ -57462,13 +57542,13 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal 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 == 451 /* v.ast.Array */) { + if ((final_left_sym->info)._typ == 452 /* v.ast.Array */) { node->return_type = (*final_left_sym->info._v__ast__Array).elem_type; v__ast__Type _t13 = node->return_type; return _t13; } } 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 457) /*expected idx: 457, 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); } @@ -57478,7 +57558,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Type _t14 = node->return_type; return _t14; } 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, 481) /*expected idx: 481, name: v.ast.Thread */ ; + v__ast__Thread info = /* as */ *(v__ast__Thread*)__as_cast((left_sym->info)._v__ast__Thread,(left_sym->info)._typ, 482) /*expected idx: 482, 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); } @@ -57493,7 +57573,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Fn method = ((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}); bool has_method = false; bool is_method_from_embed = false; - Option_v__ast__Fn _t17; + _option_v__ast__Fn _t17; if (_t17 = v__ast__Table_find_method(c->table, left_sym, method_name), _t17.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t17.data; method = m; @@ -57502,16 +57582,16 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal IError err = _t17.err; if (left_sym->kind == v__ast__Kind__struct_ || left_sym->kind == v__ast__Kind__sum_type || left_sym->kind == v__ast__Kind__interface_) { v__ast__Type parent_type = _const_v__ast__void_type; - if ((left_sym->info)._typ == 456 /* v.ast.Struct */) { + if ((left_sym->info)._typ == 457 /* v.ast.Struct */) { parent_type = (*left_sym->info._v__ast__Struct).parent_type; - } else if ((left_sym->info)._typ == 475 /* v.ast.SumType */) { + } else if ((left_sym->info)._typ == 476 /* v.ast.SumType */) { parent_type = (*left_sym->info._v__ast__SumType).parent_type; - } else if ((left_sym->info)._typ == 474 /* v.ast.Interface */) { + } else if ((left_sym->info)._typ == 475 /* v.ast.Interface */) { parent_type = (*left_sym->info._v__ast__Interface).parent_type; } if (parent_type != 0) { v__ast__TypeSymbol* type_sym = v__ast__Table_sym(c->table, parent_type); - Option_v__ast__Fn _t18; + _option_v__ast__Fn _t18; if (_t18 = v__ast__Table_find_method(c->table, type_sym, method_name), _t18.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t18.data; method = m; @@ -57523,7 +57603,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (!has_method) { has_method = true; Array_v__ast__Type embed_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t19 = v__ast__Table_find_method_from_embeds(c->table, left_sym, method_name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t19 = v__ast__Table_find_method_from_embeds(c->table, left_sym, method_name); if (_t19.state != 0) { /*or block*/ IError err = _t19.err; if ((IError_name_table[err._typ]._method_msg(err._object)).len != 0) { @@ -57533,9 +57613,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*) _t19.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_42435 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t19.data); - method = mr_42435.arg0; - embed_types = mr_42435.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_42802 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t19.data); + method = mr_42802.arg0; + embed_types = mr_42802.arg1; if (embed_types.len != 0) { is_method_from_embed = true; node->from_embed_types = embed_types; @@ -57548,8 +57628,10 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (has_method) { v__ast__TypeSymbol* rec_sym = v__ast__Table_sym(c->table, node->left_type); bool rec_is_generic = v__ast__Type_has_flag(left_type, v__ast__TypeFlag__generic); - if ((rec_sym->info)._typ == 456 /* v.ast.Struct */) { - if (rec_is_generic && node->concrete_types.len == 0) { + Array_v__ast__Type rec_concrete_types = __new_array_with_default(0, 0, sizeof(v__ast__Type), 0); + if ((rec_sym->info)._typ == 457 /* v.ast.Struct */) { + rec_concrete_types = array_clone_to_depth(&(*rec_sym->info._v__ast__Struct).concrete_types, 0); + if (rec_is_generic && node->concrete_types.len == 0 && method.generic_names.len == (*rec_sym->info._v__ast__Struct).generic_types.len) { node->concrete_types = (*rec_sym->info._v__ast__Struct).generic_types; } else if (!rec_is_generic && (*rec_sym->info._v__ast__Struct).concrete_types.len > 0 && node->concrete_types.len > 0 && (*rec_sym->info._v__ast__Struct).concrete_types.len + node->concrete_types.len == method.generic_names.len) { Array_v__ast__Type t_concrete_types = array_clone_to_depth(&node->concrete_types, 0); @@ -57581,9 +57663,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__checker__Checker_error(c, _SLIT("method with `shared` receiver cannot be called inside `lock`/`rlock` block"), node->pos); } if ((*(v__ast__Param*)/*ee elem_sym */array_get(method.params, 0)).is_mut) { - multi_return_string_v__token__Pos mr_44578 = v__checker__Checker_fail_if_immutable(c, node->left); - string to_lock = mr_44578.arg0; - v__token__Pos pos = mr_44578.arg1; + multi_return_string_v__token__Pos mr_45112 = v__checker__Checker_fail_if_immutable(c, node->left); + string to_lock = mr_45112.arg0; + v__token__Pos pos = mr_45112.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)); } @@ -57602,7 +57684,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } for (int _t24 = 0; _t24 < node->concrete_types.len; ++_t24) { v__ast__Type concrete_type = ((v__ast__Type*)node->concrete_types.data)[_t24]; - Option_void _t25 = v__checker__Checker_ensure_type_exists(c, concrete_type, node->concrete_list_pos); + _option_void _t25 = v__checker__Checker_ensure_type_exists(c, concrete_type, node->concrete_list_pos); if (_t25.state != 0 && _t25.err._typ != _IError_None___index) { IError err = _t25.err; } @@ -57612,7 +57694,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal if (v__ast__Type_alias_eq(method.return_type, _const_v__ast__void_type) && method.is_conditional && method.ctdefine_idx != _const_v__ast__invalid_type_idx) { node->should_be_skipped = v__checker__Checker_evaluate_once_comptime_if_attribute(c, (voidptr)&/*qq*/(*(v__ast__Attr*)/*ee elem_sym */array_get(method.attrs, method.ctdefine_idx))); } - Option_void _t26 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/method); + _option_void _t26 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/method); if (_t26.state != 0 && _t26.err._typ != _IError_None___index) { IError err = _t26.err; v__ast__Type _t27 = method.return_type; @@ -57624,7 +57706,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, 480) /*expected idx: 480, 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, 481) /*expected idx: 481, 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"))) { @@ -57654,13 +57736,14 @@ 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 == 451 /* v.ast.Array */) { + if (method.is_variadic && (exp_arg_sym->info)._typ == 452 /* 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); } if (v__ast__Type_has_flag(exp_arg_typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t28; - if (_t28 = v__ast__Table_resolve_generic_to_concrete(c->table, exp_arg_typ, method.generic_names, concrete_types), _t28.state == 0) { + Array_v__ast__Type method_concrete_types = (method.generic_names.len == rec_concrete_types.len ? (rec_concrete_types) : (concrete_types)); + _option_v__ast__Type _t28; + if (_t28 = v__ast__Table_resolve_generic_to_concrete(c->table, exp_arg_typ, method.generic_names, method_concrete_types), _t28.state == 0) { v__ast__Type exp_utyp = *(v__ast__Type*)_t28.data; exp_arg_typ = exp_utyp; } else { @@ -57668,8 +57751,8 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal continue; } if (v__ast__Type_has_flag(got_arg_typ, v__ast__TypeFlag__generic)) { - Option_v__ast__Type _t29; - if (_t29 = v__ast__Table_resolve_generic_to_concrete(c->table, got_arg_typ, method.generic_names, concrete_types), _t29.state == 0) { + _option_v__ast__Type _t29; + if (_t29 = v__ast__Table_resolve_generic_to_concrete(c->table, got_arg_typ, method.generic_names, method_concrete_types), _t29.state == 0) { v__ast__Type got_utyp = *(v__ast__Type*)_t29.data; got_arg_typ = got_utyp; } else { @@ -57685,9 +57768,9 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__checker__Checker_error(c, _SLIT("method with `shared` arguments cannot be called inside `lock`/`rlock` block"), arg->pos); } if (arg->is_mut) { - multi_return_string_v__token__Pos mr_48547 = v__checker__Checker_fail_if_immutable(c, arg->expr); - string to_lock = mr_48547.arg0; - v__token__Pos pos = mr_48547.arg1; + multi_return_string_v__token__Pos mr_49074 = v__checker__Checker_fail_if_immutable(c, arg->expr); + string to_lock = mr_49074.arg0; + v__token__Pos pos = mr_49074.arg1; if (!param_is_mut) { string tok = v__ast__ShareType_str(arg->share); v__checker__Checker_error(c, str_intp(5, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &string*/0xfe10, {.d_s = node->name}}, {_SLIT("` parameter `"), /*115 &string*/0xfe10, {.d_s = param.name}}, {_SLIT("` is not `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("`, `"), /*115 &string*/0xfe10, {.d_s = tok}}, {_SLIT("` is not needed`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(arg->expr)); @@ -57708,11 +57791,11 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } } 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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, 483) /*expected idx: 483, 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, 484) /*expected idx: 484, 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); @@ -57738,15 +57821,15 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } continue; } - Option_void _t30 = v__checker__Checker_check_expected_call_arg(c, got_arg_typ, exp_arg_typ, node->language, *arg); + _option_void _t30 = v__checker__Checker_check_expected_call_arg(c, got_arg_typ, exp_arg_typ, node->language, *arg); if (_t30.state != 0 && _t30.err._typ != _IError_None___index) { IError err = _t30.err; 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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; @@ -57792,7 +57875,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal node->return_type = method.return_type; } if (node->concrete_types.len > 0 && method.return_type != 0 && c->table->cur_fn->generic_names.len == 0) { - Option_v__ast__Type _t32; + _option_v__ast__Type _t32; if (_t32 = v__ast__Table_resolve_generic_to_concrete(c->table, method.return_type, method.generic_names, concrete_types), _t32.state == 0) { v__ast__Type typ = *(v__ast__Type*)_t32.data; node->return_type = typ; @@ -57805,7 +57888,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 == 456 /* v.ast.Struct */) { + if ((left_sym->info)._typ == 457 /* 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; } @@ -57834,15 +57917,15 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal v__ast__Type _t37 = _const_v__ast__void_type; return _t37; } - Option_v__ast__StructField _t38; + _option_v__ast__StructField _t38; if (_t38 = v__ast__Table_find_field_with_embeds(c->table, left_sym, method_name), _t38.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t38.data; v__ast__TypeSymbol* field_sym = v__ast__Table_sym(c->table, v__checker__Checker_unwrap_generic(c, field.typ)); 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, 483) /*expected idx: 483, name: v.ast.FnType */ ; - Option_void _t39 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/info.func); + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 484) /*expected idx: 484, name: v.ast.FnType */ ; + _option_void _t39 = v__checker__Checker_check_expected_arg_count(c, node, (voidptr)&/*qq*/info.func); if (_t39.state != 0 && _t39.err._typ != _IError_None___index) { IError err = _t39.err; v__ast__Type _t40 = info.func.return_type; @@ -57859,7 +57942,7 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal array_push((array*)&earg_types, _MOV((v__ast__Type[]){ targ })); if (i < info.func.params.len) { v__ast__Type exp_arg_typ = (*(v__ast__Param*)/*ee elem_sym */array_get(info.func.params, i)).typ; - Option_void _t42 = v__checker__Checker_check_expected_call_arg(c, targ, v__checker__Checker_unwrap_generic(c, exp_arg_typ), node->language, *arg); + _option_void _t42 = v__checker__Checker_check_expected_call_arg(c, targ, v__checker__Checker_unwrap_generic(c, exp_arg_typ), node->language, *arg); if (_t42.state != 0 && _t42.err._typ != _IError_None___index) { IError err = _t42.err; if (!v__ast__Type_alias_eq(targ, _const_v__ast__void_type)) { @@ -57873,15 +57956,15 @@ v__ast__Type v__checker__Checker_method_call(v__checker__Checker* c, v__ast__Cal } node->expected_arg_types = earg_types; node->is_method = true; - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t43 = v__ast__Table_find_field_from_embeds(c->table, left_sym, method_name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t43 = v__ast__Table_find_field_from_embeds(c->table, left_sym, method_name); if (_t43.state != 0) { /*or block*/ IError err = _t43.err; v__ast__Type _t44 = info.func.return_type; return _t44; } - multi_return_v__ast__StructField_Array_v__ast__Type mr_56012 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t43.data); - node->from_embed_types = mr_56012.arg1; + multi_return_v__ast__StructField_Array_v__ast__Type mr_56539 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t43.data); + node->from_embed_types = mr_56539.arg1; v__ast__Type _t45 = info.func.return_type; return _t45; } @@ -57938,7 +58021,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_deprecate_fnmethod(v__checker__Checker* deprecation_message = attr.arg; } if (string__eq(attr.name, _SLIT("deprecated_after")) && (attr.arg).len != 0) { - Option_time__Time _t2 = time__parse_iso8601(attr.arg); + _option_time__Time _t2 = time__parse_iso8601(attr.arg); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; v__checker__Checker_error(c, _SLIT("invalid time format"), attr.pos); @@ -57997,7 +58080,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_post_process_generic_fns(v__checker__Ch } } -Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Fn* f) { +_option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, v__ast__CallExpr* node, v__ast__Fn* f) { int nr_args = node->args.len; int nr_params = (node->is_method && f->params.len > 0 ? (f->params.len - 1) : (f->params.len)); int min_required_params = f->params.len; @@ -58014,7 +58097,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 == 456 /* v.ast.Struct */) { + if ((last_sym->info)._typ == 457 /* 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; @@ -58029,18 +58112,18 @@ Option_void v__checker__Checker_check_expected_arg_count(v__checker__Checker* c, bool is_params =_t1.len > 0; if (is_params) { array_push((array*)&node->args, _MOV((v__ast__CallArg[]){ ((v__ast__CallArg){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.expr = v__ast__StructInit_to_sumtype_v__ast__Expr(ADDR(v__ast__StructInit, (((v__ast__StructInit){.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.update_expr_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.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)),.typ_str = (string){.str=(byteptr)"", .is_lit=1},.update_expr = {0},.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,},.typ = last_typ,.update_expr_type = 0,.is_short = 0,.is_short_syntax = 0,.unresolved = 0,.is_update_embed = 0,.has_update_expr = 0,})))),.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.typ = 0,.share = 0,.is_mut = 0,.is_tmp_autofree = 0,}) })); - return (Option_void){0}; + return (_option_void){0}; } } } 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} }; + 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 "), /*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){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } 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) { @@ -58050,7 +58133,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke } 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 == 284 /* v.ast.AnonFn */) { + if (arg_expr._typ == 285 /* 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))) { @@ -58059,9 +58142,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke 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 == 306 /* v.ast.Ident */) { + else if (arg_expr._typ == 307 /* 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); + _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, /*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); @@ -58077,9 +58160,9 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke 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 == 364 /* v.ast.Var */) { + if (((*arg_expr._v__ast__Ident).obj)._typ == 365 /* v.ast.Var */) { v__ast__Expr expr = (*(*arg_expr._v__ast__Ident).obj._v__ast__Var).expr; - if ((expr)._typ == 284 /* v.ast.AnonFn */) { + if ((expr)._typ == 285 /* 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))) { @@ -58095,7 +58178,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke } } } - else if (arg_expr._typ == 292 /* v.ast.CallExpr */) { + else if (arg_expr._typ == 293 /* 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, `"), /*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)) { @@ -58105,12 +58188,12 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_map_and_filter(v__checker__Checke 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); } } - else if (arg_expr._typ == 330 /* v.ast.StringLiteral */) { + else if (arg_expr._typ == 331 /* v.ast.StringLiteral */) { if (!is_map) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use e.g. `"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("(it > 2)`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__StringLiteral).pos); } } - else if (arg_expr._typ == 329 /* v.ast.StringInterLiteral */) { + else if (arg_expr._typ == 330 /* v.ast.StringInterLiteral */) { if (!is_map) { v__checker__Checker_error(c, str_intp(2, _MOV((StrIntpData[]){{_SLIT("type mismatch, should use e.g. `"), /*115 &string*/0xfe10, {.d_s = node.name}}, {_SLIT("(it > 2)`"), 0, { .d_c = 0 }}})), (*arg_expr._v__ast__StringInterLiteral).pos); } @@ -58139,12 +58222,12 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__chec } ret_type = v__ast__Type_clear_flag(ret_type, v__ast__TypeFlag__shared_f); } - else if (string__eq(method_name, _SLIT("keys"))) { + else if (string__eq(method_name, _SLIT("keys")) || string__eq(method_name, _SLIT("values"))) { 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__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); } - 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); + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 453) /*expected idx: 453, name: v.ast.Map */ ; + int typ = (string__eq(method_name, _SLIT("keys")) ? (v__ast__Table_find_or_register_array(c->table, info.key_type)) : (v__ast__Table_find_or_register_array(c->table, info.value_type))); ret_type = ((typ)); } else if (string__eq(method_name, _SLIT("delete"))) { @@ -58152,9 +58235,9 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_map_builtin_method_call(v__chec if (node->args.len != 1) { 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, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((left_sym.info)._v__ast__Map,(left_sym.info)._typ, 453) /*expected idx: 453, 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))); + _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, /*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); @@ -58177,12 +58260,12 @@ 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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 == 292 /* v.ast.CallExpr */) { + if ((node->left)._typ == 293 /* 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); @@ -58190,7 +58273,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch if (node->args.len > 1) { 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 == 310 /* v.ast.InfixExpr */) { + if (((*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr)._typ == 311 /* 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); } @@ -58201,7 +58284,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch } 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 != 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 */)) { + if ((((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 307 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 327 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).left)._typ != 310 /* v.ast.IndexExpr */) || (((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 307 /* v.ast.Ident */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 327 /* v.ast.SelectorExpr */ && ((*(*(v__ast__CallArg*)/*ee elem_sym */array_get(node->args, 0)).expr._v__ast__InfixExpr).right)._typ != 310 /* 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 { @@ -58233,7 +58316,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 == 483 /* v.ast.FnType */) ? ((*arg_sym->info._v__ast__FnType).func.return_type) : (arg_type)); + v__ast__Type ret_type = ((arg_sym->info._typ == 484 /* 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)); @@ -58270,7 +58353,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch 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))); + _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, /*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); @@ -58285,7 +58368,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_array_builtin_method_call(v__ch 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))); + _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, /*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); @@ -58328,10 +58411,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 == 338 /* v.ast.AssignStmt */) { + if ((node.inc)._typ == 339 /* 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 == 292 /* v.ast.CallExpr */) { + if ((right)._typ == 293 /* 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); } @@ -58385,7 +58468,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_in_stmt(v__checker__Checker* c, v__ } else { v__ast__TypeSymbol* sym = v__ast__Table_final_sym(c->table, typ); if (sym->kind == v__ast__Kind__struct_) { - Option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(sym, _SLIT("next")); + _option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(sym, _SLIT("next")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__checker__Checker_error(c, _SLIT("a struct must have a `next()` method to be an iterator"), v__ast__Expr_pos(node->cond)); @@ -58433,29 +58516,29 @@ VV_LOCAL_SYMBOL void v__checker__Checker_for_in_stmt(v__checker__Checker* c, v__ } if (node->val_is_mut) { value_type = v__ast__Type_ref(value_type); - if (node->cond._typ == 306 /* v.ast.Ident */) { - if (((*node->cond._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if (node->cond._typ == 307 /* v.ast.Ident */) { + if (((*node->cond._v__ast__Ident).obj)._typ == 365 /* 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("`"), /*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 == 286 /* v.ast.ArrayInit */) { + else if (node->cond._typ == 287 /* 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 == 315 /* v.ast.MapInit */) { + else if (node->cond._typ == 316 /* 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 == 326 /* v.ast.SelectorExpr */) { - Option_v__ast__Ident _t2 = v__ast__SelectorExpr_root_ident(&(*node->cond._v__ast__SelectorExpr)); + else if (node->cond._typ == 327 /* 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, 306) /*expected idx: 306, 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, 307) /*expected idx: 307, 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, 364) /*expected idx: 364, name: v.ast.Var */ ).is_mut) { + if (!(/* as */ *(v__ast__Var*)__as_cast((root_ident.obj)._v__ast__Var,(root_ident.obj)._typ, 365) /*expected idx: 365, 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); } } @@ -58485,9 +58568,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 == 310 /* v.ast.InfixExpr */) { + if ((node->cond)._typ == 311 /* v.ast.InfixExpr */) { if ((*node->cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - 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 (((*node->cond._v__ast__InfixExpr).right)._typ == 333 /* v.ast.TypeNode */ && (((*node->cond._v__ast__InfixExpr).left)._typ == 307 /* v.ast.Ident */ || ((*node->cond._v__ast__InfixExpr).left)._typ == 327 /* 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); } @@ -58509,7 +58592,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 == 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)) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 347 /* 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, 347) /*expected idx: 347, name: v.ast.ExprStmt */ ).typ, _const_v__ast__void_type)) { node_is_expr = true; } } @@ -58530,7 +58613,7 @@ 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 == 321 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { + if ((branch.cond)._typ == 322 /* 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) { @@ -58547,9 +58630,9 @@ bool v__checker__Checker_if_expr_defer_0 = false; } if (node->is_comptime) { string comptime_field_name = _SLIT(""); - if ((branch.cond)._typ == 310 /* v.ast.InfixExpr */) { + if ((branch.cond)._typ == 311 /* v.ast.InfixExpr */) { if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_is) { - if (((*branch.cond._v__ast__InfixExpr).right)._typ != 332 /* v.ast.TypeNode */ && ((*branch.cond._v__ast__InfixExpr).right)._typ != 299 /* v.ast.ComptimeType */) { + if (((*branch.cond._v__ast__InfixExpr).right)._typ != 333 /* v.ast.TypeNode */ && ((*branch.cond._v__ast__InfixExpr).right)._typ != 300 /* 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 @@ -58560,25 +58643,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 == 299 /* v.ast.ComptimeType */ && (left)._typ == 332 /* v.ast.TypeNode */) { + if (((*branch.cond._v__ast__InfixExpr).right)._typ == 300 /* v.ast.ComptimeType */ && (left)._typ == 333 /* 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); - skip_state = (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 */ ) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); + skip_state = (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, 300) /*expected idx: 300, name: v.ast.ComptimeType */ ) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); } 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, 332) /*expected idx: 332, 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, 333) /*expected idx: 333, 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 `"), /*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 == 326 /* v.ast.SelectorExpr */) { + if ((left)._typ == 327 /* 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 == 332 /* v.ast.TypeNode */ && (left)._typ == 332 /* v.ast.TypeNode */ && sym->kind == v__ast__Kind__interface_) { + } else if (((*branch.cond._v__ast__InfixExpr).right)._typ == 333 /* v.ast.TypeNode */ && (left)._typ == 333 /* 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); skip_state = (v__ast__Table_does_type_implement_interface(c->table, checked_type, got_type) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); - } else if ((left)._typ == 332 /* v.ast.TypeNode */) { + } else if ((left)._typ == 333 /* 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); skip_state = (v__ast__Type_alias_eq(left_type, got_type) ? (v__checker__ComptimeBranchSkipState__eval) : (v__checker__ComptimeBranchSkipState__skip)); @@ -58608,7 +58691,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 == 306 /* v.ast.Ident */) { + if ((branch.cond)._typ == 307 /* v.ast.Ident */) { if (string__eq((*branch.cond._v__ast__Ident).name, _SLIT("freestanding"))) { is_freestanding_block = true; } @@ -58643,8 +58726,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 == 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 */ ; + if (branch.stmts.len > 0 && ((*(v__ast__Stmt*)array_last(branch.stmts)))._typ == 347 /* 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, 347) /*expected idx: 347, 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)) { @@ -58709,7 +58792,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; } 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); + _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 "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); @@ -58719,10 +58802,10 @@ bool v__checker__Checker_if_expr_defer_0 = false; ; } } - if ((branch.cond)._typ == 308 /* v.ast.IfGuardExpr */) { + if ((branch.cond)._typ == 309 /* 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, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 483) /*expected idx: 483, 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 "), /*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 { @@ -58733,7 +58816,7 @@ bool v__checker__Checker_if_expr_defer_0 = false; } } } - Option_bool _t5; + _option_bool _t5; if (_t5 = v__checker__Checker_has_return(c, branch.stmts), _t5.state == 0) { bool has_return = *(bool*)_t5.data; if (has_return) { @@ -58773,17 +58856,17 @@ 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 == 310 /* v.ast.InfixExpr */) { + if ((node)._typ == 311 /* 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 == 332 /* v.ast.TypeNode */) { + if (right_expr._typ == 333 /* v.ast.TypeNode */) { _t1 = (*right_expr._v__ast__TypeNode).typ; } - else if (right_expr._typ == 318 /* v.ast.None */) { + else if (right_expr._typ == 319 /* v.ast.None */) { _t1 = _const_v__ast__none_type_idx; } @@ -58797,7 +58880,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, 469) /*expected idx: 469, name: v.ast.Aggregate */ ).sum_type; + expr_type = (/* as */ *(v__ast__Aggregate*)__as_cast((left_sym->info)._v__ast__Aggregate,(left_sym->info)._typ, 470) /*expected idx: 470, name: v.ast.Aggregate */ ).sum_type; } if (left_sym->kind == v__ast__Kind__interface_) { if (right_sym->kind != v__ast__Kind__interface_) { @@ -58810,10 +58893,10 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* 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 `"), /*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 == 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 ((((*node._v__ast__InfixExpr).left)._typ == 307 /* v.ast.Ident */ || ((*node._v__ast__InfixExpr).left)._typ == 327 /* v.ast.SelectorExpr */) && ((*node._v__ast__InfixExpr).right)._typ == 333 /* v.ast.TypeNode */) { + bool is_variable = (((*node._v__ast__InfixExpr).left)._typ == 307 /* 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 == 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)) { + if ((((*node._v__ast__InfixExpr).left)._typ == 307 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__Ident,((*node._v__ast__InfixExpr).left)._typ, 307) /*expected idx: 307, name: v.ast.Ident */ ).is_mut) || (((*node._v__ast__InfixExpr).left)._typ == 327 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast(((*node._v__ast__InfixExpr).left)._v__ast__SelectorExpr,((*node._v__ast__InfixExpr).left)._typ, 327) /*expected idx: 327, 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) { @@ -58823,7 +58906,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_smartcast_if_conds(v__checker__Checker* } } } - } else if ((node)._typ == 313 /* v.ast.Likely */) { + } else if ((node)._typ == 314 /* v.ast.Likely */) { v__checker__Checker_smartcast_if_conds(c, (*node._v__ast__Likely).expr, scope); } } @@ -58832,7 +58915,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 == 474 /* v.ast.Interface */) { + if ((decl_sym->info)._typ == 475 /* 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; @@ -58859,7 +58942,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac 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, 474) /*expected idx: 474, name: v.ast.Interface */ ; + v__ast__Interface isym_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 475) /*expected idx: 475, 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 }))) { @@ -58882,7 +58965,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac } } v__ast__InterfaceDecl* _t9 = (v__ast__InterfaceDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, c->table->interfaces), &(int[]){embed.typ})); - Option_v__ast__InterfaceDecl _t8 = {0}; + _option_v__ast__InterfaceDecl _t8 = {0}; if (_t9) { *((v__ast__InterfaceDecl*)&_t8.data) = *((v__ast__InterfaceDecl*)_t9); } else { @@ -58895,7 +58978,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__ast__StructField f = ((v__ast__StructField*)embed_decl.fields.data)[_t10]; if (_IN_MAP(ADDR(string, f.name), ADDR(map, efnames))) { v__ast__StructField ifield = (*(v__ast__StructField*)/*ee elem_sym */array_get(node->fields, (*(int*)map_get(ADDR(map, efnames), &(string[]){f.name}, &(int[]){ 0 })))); - Option_v__ast__StructField _t11; + _option_v__ast__StructField _t11; if (_t11 = v__ast__Table_find_field_with_embeds(c->table, isym, f.name), _t11.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t11.data; if (!v__ast__Type_alias_eq(ifield.typ, field.typ)) { @@ -58913,10 +58996,10 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac v__ast__FnDecl m = ((v__ast__FnDecl*)embed_decl.methods.data)[_t13]; if (_IN_MAP(ADDR(string, m.name), ADDR(map, emnames))) { v__ast__FnDecl imethod = (*(v__ast__FnDecl*)/*ee elem_sym */array_get(node->methods, (*(int*)map_get(ADDR(map, emnames), &(string[]){m.name}, &(int[]){ 0 })))); - Option_v__ast__Fn _t14; + _option_v__ast__Fn _t14; if (_t14 = v__ast__TypeSymbol_find_method(decl_sym, imethod.name), _t14.state == 0) { v__ast__Fn em_fn = *(v__ast__Fn*)_t14.data; - Option_v__ast__Fn _t15; + _option_v__ast__Fn _t15; if (_t15 = v__ast__TypeSymbol_find_method(isym, m.name), _t15.state == 0) { v__ast__Fn m_fn = *(v__ast__Fn*)_t15.data; string msg = v__ast__Table_is_same_method(c->table, (voidptr)&/*qq*/m_fn, (voidptr)&/*qq*/em_fn); @@ -58942,7 +59025,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (node->language == v__ast__Language__v) { v__checker__Checker_check_valid_snake_case(c, method.name, _SLIT("method name"), method.pos); } - Option_void _t17 = v__checker__Checker_ensure_type_exists(c, method.return_type, method.return_type_pos); + _option_void _t17 = v__checker__Checker_ensure_type_exists(c, method.return_type, method.return_type_pos); if (_t17.state != 0 && _t17.err._typ != _IError_None___index) { IError err = _t17.err; return; @@ -58960,7 +59043,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (j == 0 && is_js) { continue; } - Option_void _t18 = v__checker__Checker_ensure_type_exists(c, param.typ, param.pos); + _option_void _t18 = v__checker__Checker_ensure_type_exists(c, param.typ, param.pos); if (_t18.state != 0 && _t18.err._typ != _IError_None___index) { IError err = _t18.err; return; @@ -58995,7 +59078,7 @@ void v__checker__Checker_interface_decl(v__checker__Checker* c, v__ast__Interfac if (node->language == v__ast__Language__v) { v__checker__Checker_check_valid_snake_case(c, field.name, _SLIT("field name"), field.pos); } - Option_void _t20 = v__checker__Checker_ensure_type_exists(c, field.typ, field.pos); + _option_void _t20 = v__checker__Checker_ensure_type_exists(c, field.typ, field.pos); if (_t20.state != 0 && _t20.err._typ != _IError_None___index) { IError err = _t20.err; return; @@ -59024,7 +59107,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 == 474 /* v.ast.Interface */) { + if ((inter_sym->info)._typ == 475 /* 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}; @@ -59044,7 +59127,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch for (int _t4 = 0; _t4 < (*inter_sym->info._v__ast__Interface).fields.len; ++_t4) { v__ast__StructField ifield = ((v__ast__StructField*)(*inter_sym->info._v__ast__Interface).fields.data)[_t4]; if (v__ast__Type_has_flag(ifield.typ, v__ast__TypeFlag__generic) && string__eq(v__ast__Table_get_type_name(c->table, ifield.typ), gt_name)) { - Option_v__ast__StructField _t5; + _option_v__ast__StructField _t5; if (_t5 = v__ast__Table_find_field_with_embeds(c->table, typ_sym, ifield.name), _t5.state == 0) { v__ast__StructField field = *(v__ast__StructField*)_t5.data; inferred_type = field.typ; @@ -59053,10 +59136,10 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch } for (int _t6 = 0; _t6 < (*inter_sym->info._v__ast__Interface).methods.len; ++_t6) { v__ast__Fn imethod = ((v__ast__Fn*)(*inter_sym->info._v__ast__Interface).methods.data)[_t6]; - Option_v__ast__Fn _t7 = v__ast__TypeSymbol_find_method(typ_sym, imethod.name); + _option_v__ast__Fn _t7 = v__ast__TypeSymbol_find_method(typ_sym, imethod.name); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; - Option_v__ast__Fn _t8 = v__ast__TypeSymbol_find_method_with_generic_parent(typ_sym, imethod.name); + _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 `"), /*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); @@ -59081,7 +59164,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch v__ast__Type _t11 = 0; return _t11; } - if ((imret_sym->info)._typ == 482 /* v.ast.MultiReturn */ && (mret_sym->info)._typ == 482 /* v.ast.MultiReturn */) { + if ((imret_sym->info)._typ == 483 /* v.ast.MultiReturn */ && (mret_sym->info)._typ == 483 /* 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)) { @@ -59099,7 +59182,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_resolve_generic_interface(v__ch for (int i = 0; i < imethod.params.len; ++i) { v__ast__Param iparam = ((v__ast__Param*)imethod.params.data)[i]; v__ast__Param* _t13 = (v__ast__Param*)/*ee elem_ptr_typ */(array_get_with_check(method.params, i)); - Option_v__ast__Param _t12 = {0}; + _option_v__ast__Param _t12 = {0}; if (_t13) { *((v__ast__Param*)&_t12.data) = *((v__ast__Param*)_t13); } else { @@ -59144,7 +59227,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 == 321 /* v.ast.ParExpr */ && !c->pref->translated && !c->file->is_translated) { + if ((node->cond)._typ == 322 /* 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) { @@ -59153,10 +59236,10 @@ 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 == 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)) { + if (((node->cond)._typ == 307 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((node->cond)._v__ast__Ident,(node->cond)._typ, 307) /*expected idx: 307, name: v.ast.Ident */ ).is_mut) || ((node->cond)._typ == 327 /* v.ast.SelectorExpr */ && (/* as */ *(v__ast__SelectorExpr*)__as_cast((node->cond)._v__ast__SelectorExpr,(node->cond)._typ, 327) /*expected idx: 327, 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); + _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->cond_type, node->pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__ast__Type _t2 = _const_v__ast__void_type; @@ -59192,7 +59275,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; Array_v__ast__Stmt _t4 = array_slice(branch.stmts, 0, branch.stmts.len - 1); for (int _t5 = 0; _t5 < _t4.len; ++_t5) { v__ast__Stmt st = ((v__ast__Stmt*)_t4.data)[_t5]; - Option_void _t6 = v__ast__Stmt_check_c_expr(st); + _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 "), /*115 &string*/0xfe10, {.d_s = IError_name_table[err._typ]._method_msg(err._object)}}, {_SLIT0, 0, { .d_c = 0 }}})), (*(st.pos))); @@ -59207,7 +59290,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 == 346 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 347 /* v.ast.ExprStmt */) { if (node->is_expr) { c->expected_type = node->expected_type; } @@ -59253,7 +59336,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; } } first_iteration = false; - Option_bool _t9; + _option_bool _t9; if (_t9 = v__checker__Checker_has_return(c, branch.stmts), _t9.state == 0) { bool has_return = *(bool*)_t9.data; if (has_return) { @@ -59277,7 +59360,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; bool cond_is_auto_heap = false; for (int _t10 = 0; _t10 < node->branches.len; ++_t10) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)node->branches.data)[_t10]; - Option_v__ast__Var_ptr _t11; + _option_v__ast__Var_ptr _t11; if (_t11 = v__ast__Scope_find_var(branch.scope, cond_var), _t11.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t11.data; if (v->is_auto_heap) { @@ -59289,7 +59372,7 @@ bool v__checker__Checker_match_expr_defer_0 = false; if (cond_is_auto_heap) { for (int _t12 = 0; _t12 < node->branches.len; ++_t12) { v__ast__MatchBranch branch = ((v__ast__MatchBranch*)node->branches.data)[_t12]; - Option_v__ast__Var_ptr _t13 = v__ast__Scope_find_var(branch.scope, cond_var); + _option_v__ast__Var_ptr _t13 = v__ast__Scope_find_var(branch.scope, cond_var); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; continue; @@ -59317,15 +59400,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 == 324 /* v.ast.RangeExpr */) { + if ((expr)._typ == 325 /* 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 == 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 */)) { + if ((low_expr)._typ == 312 /* v.ast.IntegerLiteral */) { + if ((high_expr)._typ == 312 /* v.ast.IntegerLiteral */ && (v__ast__TypeSymbol_is_int(final_cond_sym) || (final_cond_sym->info)._typ == 486 /* v.ast.Enum */)) { low = string_i64((*low_expr._v__ast__IntegerLiteral).val); high = string_i64((*high_expr._v__ast__IntegerLiteral).val); if (low > high) { @@ -59334,8 +59417,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 == 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)) { + } else if ((low_expr)._typ == 296 /* v.ast.CharLiteral */) { + if ((high_expr)._typ == 296 /* 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) { @@ -59362,11 +59445,11 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } continue; } - if (expr._typ == 332 /* v.ast.TypeNode */) { + if (expr._typ == 333 /* 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 == 303 /* v.ast.EnumVal */) { + else if (expr._typ == 304 /* v.ast.EnumVal */) { key = (*expr._v__ast__EnumVal).val; } @@ -59393,7 +59476,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } } - } else if ((cond_type_sym.info)._typ == 475 /* v.ast.SumType */) { + } else if ((cond_type_sym.info)._typ == 476 /* 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); @@ -59411,7 +59494,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ 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("`"), /*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 == 471 /* v.ast.Alias */ && (expr_type_sym->info)._typ == 456 /* v.ast.Struct */) { + } else if ((cond_type_sym.info)._typ == 472 /* v.ast.Alias */ && (expr_type_sym->info)._typ == 457 /* 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 `"), /*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)); @@ -59477,7 +59560,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } } else { - if (cond_type_sym.info._typ == 475 /* v.ast.SumType */) { + if (cond_type_sym.info._typ == 476 /* 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); @@ -59487,7 +59570,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_match_exprs(v__checker__Checker* c, v__ } } } - else if (cond_type_sym.info._typ == 485 /* v.ast.Enum */) { + else if (cond_type_sym.info._typ == 486 /* 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))) { @@ -59547,7 +59630,7 @@ bool v__checker__Checker_sql_expr_defer_0 = false; c->inside_sql = true; v__checker__Checker_sql_expr_defer_0 = true; v__ast__TypeSymbol* sym = v__ast__Table_sym(c->table, node->table_expr.typ); - Option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); + _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__ast__Type _t2 = _const_v__ast__void_type; @@ -59561,7 +59644,7 @@ bool v__checker__Checker_sql_expr_defer_0 = false; ; c->cur_orm_ts = *sym; - if ((sym->info)._typ != 456 /* v.ast.Struct */) { + if ((sym->info)._typ != 457 /* 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 @@ -59571,7 +59654,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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, 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}; @@ -59678,7 +59761,7 @@ VV_LOCAL_SYMBOL v__ast__Type v__checker__Checker_sql_stmt_line(v__checker__Check bool v__checker__Checker_sql_stmt_line_defer_0 = false; c->inside_sql = true; v__checker__Checker_sql_stmt_line_defer_0 = true; - Option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); + _option_void _t1 = v__checker__Checker_ensure_type_exists(c, node->table_expr.typ, node->pos); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__ast__Type _t2 = _const_v__ast__void_type; @@ -59693,7 +59776,7 @@ 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 != 456 /* v.ast.Struct */) { + if ((table_sym->info)._typ != 457 /* 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 @@ -59703,7 +59786,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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((table_sym->info)._v__ast__Struct,(table_sym->info)._typ, 457) /*expected idx: 457, 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}; @@ -59760,7 +59843,7 @@ bool v__checker__Checker_sql_stmt_line_defer_0 = false; v__checker__Checker_expr(c, expr); } } - if ((node->where_expr)._typ != 302 /* v.ast.EmptyExpr */) { + if ((node->where_expr)._typ != 303 /* v.ast.EmptyExpr */) { v__checker__Checker_expr(c, node->where_expr); } v__ast__Type _t11 = _const_v__ast__void_type; @@ -59814,8 +59897,9 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod return; } bool exp_is_optional = v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional); + bool exp_is_result = v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__result); 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 == 482 /* v.ast.MultiReturn */) { + if ((expected_type_sym->info)._typ == 483 /* 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}; @@ -59847,8 +59931,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 == 306 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((expr)._typ == 307 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 365 /* 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))); } @@ -59859,9 +59943,10 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } } node->types = got_types; - int option_type_idx = (*(int*)map_get(ADDR(map, c->table->type_idxs), &(string[]){_SLIT("Option")}, &(int[]){ 0 })); + int option_type_idx = (*(int*)map_get(ADDR(map, c->table->type_idxs), &(string[]){_SLIT("_option")}, &(int[]){ 0 })); + int result_type_idx = (*(int*)map_get(ADDR(map, c->table->type_idxs), &(string[]){_SLIT("_result")}, &(int[]){ 0 })); int got_types_0_idx = v__ast__Type_idx((*(v__ast__Type*)/*ee elem_sym */array_get(got_types, 0))); - if (exp_is_optional && (got_types_0_idx == _const_v__ast__none_type_idx || got_types_0_idx == _const_v__ast__error_type_idx || got_types_0_idx == option_type_idx)) { + if ((exp_is_optional && (got_types_0_idx == _const_v__ast__none_type_idx || got_types_0_idx == _const_v__ast__error_type_idx || got_types_0_idx == option_type_idx)) || (exp_is_result && (got_types_0_idx == _const_v__ast__error_type_idx || got_types_0_idx == result_type_idx))) { if (got_types_0_idx == _const_v__ast__none_type_idx && v__ast__Type_alias_eq(expected_type, _const_v__ast__ovoid_type)) { v__checker__Checker_error(c, _SLIT("returning `none` in functions, that have a `?` result type is not allowed anymore, either `return error(message)` or just `return` instead"), node->pos); } @@ -59909,11 +59994,11 @@ void v__checker__Checker_return_stmt(v__checker__Checker* c, v__ast__Return* nod } 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 == 306 /* v.ast.Ident */) { - if (((*r_expr->_v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((r_expr)->_typ == 307 /* v.ast.Ident */) { + if (((*r_expr->_v__ast__Ident).obj)._typ == 365 /* 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); + _option_v__ast__Var_ptr _t8 = v__ast__Scope_find_var(c->fn_scope, (*(*r_expr->_v__ast__Ident).obj._v__ast__Var).name); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; *(v__ast__Var**) _t8.data = obj; @@ -59934,7 +60019,7 @@ 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 == 292 /* v.ast.CallExpr */) { + if ((expr0)._typ == 293 /* 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); } @@ -59946,8 +60031,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 == 346 /* v.ast.ExprStmt */) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 292 /* v.ast.CallExpr */) { + if ((stmt)._typ == 347 /* v.ast.ExprStmt */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 293 /* 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; @@ -59963,18 +60048,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 == 357 /* v.ast.Return */) { + if (stmt._typ == 358 /* v.ast.Return */) { bool _t2 = true; return _t2; } - else if (stmt._typ == 339 /* v.ast.Block */) { + else if (stmt._typ == 340 /* v.ast.Block */) { if (v__checker__has_top_return((*stmt._v__ast__Block).stmts)) { bool _t3 = true; return _t3; } } - else if (stmt._typ == 346 /* v.ast.ExprStmt */) { - if (((*stmt._v__ast__ExprStmt).expr)._typ == 292 /* v.ast.CallExpr */) { + else if (stmt._typ == 347 /* v.ast.ExprStmt */) { + if (((*stmt._v__ast__ExprStmt).expr)._typ == 293 /* v.ast.CallExpr */) { if ((*(*stmt._v__ast__ExprStmt).expr._v__ast__CallExpr).is_noreturn) { bool _t4 = true; return _t4; @@ -60006,8 +60091,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 == 346 /* v.ast.ExprStmt */) { - if (((*last_stmt._v__ast__ExprStmt).expr)._typ == 292 /* v.ast.CallExpr */) { + if (last_stmt._typ == 347 /* v.ast.ExprStmt */) { + if (((*last_stmt._v__ast__ExprStmt).expr)._typ == 293 /* 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; @@ -60017,7 +60102,7 @@ VV_LOCAL_SYMBOL void v__checker__Checker_check_noreturn_fn_decl(v__checker__Chec } } } - else if (last_stmt._typ == 349 /* v.ast.ForStmt */) { + else if (last_stmt._typ == 350 /* 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; } @@ -60040,24 +60125,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 == 357 /* v.ast.Return */) { + if (stmt._typ == 358 /* v.ast.Return */) { bool _t3 = true; return _t3; } - else if (stmt._typ == 339 /* v.ast.Block */) { + else if (stmt._typ == 340 /* v.ast.Block */) { if (v__checker__uses_return_stmt((*stmt._v__ast__Block).stmts)) { bool _t4 = true; return _t4; } } - else if (stmt._typ == 346 /* v.ast.ExprStmt */) { - if ((*stmt._v__ast__ExprStmt).expr._typ == 292 /* v.ast.CallExpr */) { + else if (stmt._typ == 347 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 293 /* 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 == 316 /* v.ast.MatchExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 317 /* 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)) { @@ -60066,7 +60151,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 325 /* v.ast.SelectExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 326 /* 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)) { @@ -60075,7 +60160,7 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } } } - else if ((*stmt._v__ast__ExprStmt).expr._typ == 307 /* v.ast.IfExpr */) { + else if ((*stmt._v__ast__ExprStmt).expr._typ == 308 /* 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)) { @@ -60089,19 +60174,19 @@ VV_LOCAL_SYMBOL bool v__checker__uses_return_stmt(Array_v__ast__Stmt stmts) { } ; } - else if (stmt._typ == 349 /* v.ast.ForStmt */) { + else if (stmt._typ == 350 /* v.ast.ForStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForStmt).stmts)) { bool _t12 = true; return _t12; } } - else if (stmt._typ == 347 /* v.ast.ForCStmt */) { + else if (stmt._typ == 348 /* v.ast.ForCStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForCStmt).stmts)) { bool _t13 = true; return _t13; } } - else if (stmt._typ == 348 /* v.ast.ForInStmt */) { + else if (stmt._typ == 349 /* v.ast.ForInStmt */) { if (v__checker__uses_return_stmt((*stmt._v__ast__ForInStmt).stmts)) { bool _t14 = true; return _t14; @@ -60117,7 +60202,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 == 292 /* v.ast.CallExpr */) { + if ((expr)._typ == 293 /* v.ast.CallExpr */) { bool _t1 = (*expr._v__ast__CallExpr).is_noreturn; return _t1; } @@ -60144,7 +60229,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, 471) /*expected idx: 471, name: v.ast.Alias */ ; + v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 472) /*expected idx: 472, 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'; @@ -60226,7 +60311,7 @@ v__ast__Type v__checker__Checker_string_lit(v__checker__Checker* c, v__ast__Stri v__token__Pos start_pos = ((v__token__Pos){node->pos.len,node->pos.line_nr,node->pos.pos,.col = node->pos.col + 1 + idx,node->pos.last_line,}); int start_idx = idx; idx++; - Option_u8 _t2 = string_at_with_check(node->val, idx); + _option_u8 _t2 = string_at_with_check(node->val, idx); ; if (_t2.state != 0) { /*or block*/ IError err = _t2.err; @@ -60237,7 +60322,7 @@ v__ast__Type v__checker__Checker_string_lit(v__checker__Checker* c, v__ast__Stri u8 next_ch = *(byte*)&_t2.data; if (next_ch == 'u') { idx++; - Option_u8 _t4 = string_at_with_check(node->val, idx); + _option_u8 _t4 = string_at_with_check(node->val, idx); ; if (_t4.state != 0) { /*or block*/ IError err = _t4.err; @@ -60267,7 +60352,7 @@ v__ast__Type v__checker__Checker_string_lit(v__checker__Checker* c, v__ast__Stri v__checker__Checker_error(c, _const_v__checker__unicode_lit_overflow_message, end_pos); }; idx++; - Option_u8 _t6 = string_at_with_check(node->val, idx); + _option_u8 _t6 = string_at_with_check(node->val, idx); ; if (_t6.state != 0) { /*or block*/ IError err = _t6.err; @@ -60320,7 +60405,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 == 456 /* v.ast.Struct */) { + if ((struct_sym->info)._typ == 457 /* 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)) { @@ -60330,7 +60415,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* if (embed_sym->kind != v__ast__Kind__struct_) { 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((embed_sym->info)._v__ast__Struct,(embed_sym->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ; if (info.is_heap && !v__ast__Type_is_ptr(embed.typ)) { (*struct_sym->info._v__ast__Struct).is_heap = true; } @@ -60351,7 +60436,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* if (v__ast__Type_alias_eq(field.typ, _const_v__ast__any_type)) { v__checker__Checker_error(c, _SLIT("struct field cannot be the `any` type, use generics instead"), field.type_pos); } - Option_void _t3 = v__checker__Checker_ensure_type_exists(c, field.typ, field.type_pos); + _option_void _t3 = v__checker__Checker_ensure_type_exists(c, field.typ, field.type_pos); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; return; @@ -60378,8 +60463,8 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* } 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, 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); + v__ast__FnType fn_info = /* as */ *(v__ast__FnType*)__as_cast((field_sym->info)._v__ast__FnType,(field_sym->info)._typ, 484) /*expected idx: 484, 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; return; @@ -60388,7 +60473,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* ; for (int _t5 = 0; _t5 < fn_info.func.params.len; ++_t5) { v__ast__Param param = ((v__ast__Param*)fn_info.func.params.data)[_t5]; - Option_void _t6 = v__checker__Checker_ensure_type_exists(c, param.typ, param.type_pos); + _option_void _t6 = v__checker__Checker_ensure_type_exists(c, param.typ, param.type_pos); if (_t6.state != 0 && _t6.err._typ != _IError_None___index) { IError err = _t6.err; return; @@ -60399,7 +60484,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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ; if (info.is_heap && !v__ast__Type_is_ptr(field.typ)) { (*struct_sym->info._v__ast__Struct).is_heap = true; } @@ -60411,7 +60496,7 @@ void v__checker__Checker_struct_decl(v__checker__Checker* c, v__ast__StructDecl* v__checker__Checker_check_expr_opt_call(c, field.default_expr, field_expr_type); } (*(v__ast__StructField*)/*ee elem_sym */array_get((*struct_sym->info._v__ast__Struct).fields, i)).default_expr_typ = field_expr_type; - Option_void _t7 = v__checker__Checker_check_expected(c, field_expr_type, field.typ); + _option_void _t7 = v__checker__Checker_check_expected(c, field_expr_type, field.typ); if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { IError err = _t7.err; if (sym->kind == v__ast__Kind__interface_ && v__checker__Checker_type_implements(c, field_expr_type, field.typ, field.pos)) { @@ -60431,15 +60516,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 == 311 /* v.ast.IntegerLiteral */) { + if ((field.default_expr)._typ == 312 /* 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 == 330 /* v.ast.StringLiteral */) { + } else if ((field.default_expr)._typ == 331 /* 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 == 290 /* v.ast.BoolLiteral */) { + } else if ((field.default_expr)._typ == 291 /* 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); } @@ -60471,18 +60556,18 @@ VV_LOCAL_SYMBOL int v__checker__minify_sort_fn(v__ast__StructField* a, v__ast__S v__ast__Table* t = global_table; v__ast__TypeSymbol* a_sym = v__ast__Table_sym(t, a->typ); v__ast__TypeSymbol* b_sym = v__ast__Table_sym(t, b->typ); - if ((a_sym->info)._typ == 485 /* v.ast.Enum */) { + if ((a_sym->info)._typ == 486 /* v.ast.Enum */) { if (!(*a_sym->info._v__ast__Enum).is_flag && !(*a_sym->info._v__ast__Enum).uses_exprs) { if (b_sym->kind == v__ast__Kind__enum_) { int a_nr_vals = ((*a_sym->info._v__ast__Enum)).vals.len; - int b_nr_vals = (/* as */ *(v__ast__Enum*)__as_cast((b_sym->info)._v__ast__Enum,(b_sym->info)._typ, 485) /*expected idx: 485, name: v.ast.Enum */ ).vals.len; + int b_nr_vals = (/* as */ *(v__ast__Enum*)__as_cast((b_sym->info)._v__ast__Enum,(b_sym->info)._typ, 486) /*expected idx: 486, name: v.ast.Enum */ ).vals.len; int _t5 = (a_nr_vals > b_nr_vals ? (-1) : a_nr_vals < b_nr_vals ? (1) : (0)); return _t5; } int _t6 = 1; return _t6; } - } else if ((b_sym->info)._typ == 485 /* v.ast.Enum */) { + } else if ((b_sym->info)._typ == 486 /* v.ast.Enum */) { if (!(*b_sym->info._v__ast__Enum).is_flag && !(*b_sym->info._v__ast__Enum).uses_exprs) { int _t7 = -1; return _t7; @@ -60513,7 +60598,7 @@ 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 == 456 /* v.ast.Struct */) { + if ((struct_sym->info)._typ == 457 /* 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); @@ -60543,7 +60628,7 @@ 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 == 471 /* v.ast.Alias */) { + } else if ((struct_sym->info)._typ == 472 /* 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); @@ -60556,7 +60641,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str if (c->table->cur_fn->generic_names.len > 0) { v__ast__Table_unwrap_generic_type(c->table, node->typ, c->table->cur_fn->generic_names, c->table->cur_concrete_types); } - Option_void _t5 = v__checker__Checker_ensure_type_exists(c, node->typ, node->pos); + _option_void _t5 = v__checker__Checker_ensure_type_exists(c, node->typ, node->pos); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { IError err = _t5.err; } @@ -60567,7 +60652,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str v__checker__Checker_note(c, _SLIT("direct sum type init (`x := SumType{}`) will be removed soon"), node->pos); } if (!c->is_builtin_mod && !c->inside_unsafe && type_sym->language == v__ast__Language__v && c->table->cur_concrete_types.len == 0) { - Option_int _t6 = string_last_index(type_sym->name, _SLIT(".")); + _option_int _t6 = string_last_index(type_sym->name, _SLIT(".")); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; *(int*) _t6.data = -1; @@ -60586,7 +60671,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str 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 `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); } - if ((type_sym->info)._typ == 471 /* v.ast.Alias */) { + if ((type_sym->info)._typ == 472 /* 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 `"), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), node->pos); v__ast__Type _t7 = _const_v__ast__void_type; @@ -60597,7 +60682,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 457) /*expected idx: 457, 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 `"), /*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); } @@ -60616,7 +60701,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str 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)),.generic_types = __new_array(0, 0, sizeof(v__ast__Type)),.concrete_types = __new_array(0, 0, sizeof(v__ast__Type)),.parent_type = 0,.is_typedef = 0,.is_union = 0,.is_heap = 0,.is_minify = 0,.is_generic = 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, 471) /*expected idx: 471, 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, 472) /*expected idx: 472, 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: "), /*115 &string*/0xfe10, {.d_s = type_sym->name}}, {_SLIT0, 0, { .d_c = 0 }}})), node->pos); @@ -60624,12 +60709,12 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str return _t10; } if (sym->kind == v__ast__Kind__struct_) { - info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 456) /*expected idx: 456, name: v.ast.Struct */ ; + info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ; } else { 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ; } if (node->is_short) { int exp_len = info.fields.len; @@ -60659,7 +60744,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } else { field_name = field->name; bool exists = true; - Option_v__ast__StructField _t11 = v__ast__Table_find_field_with_embeds(c->table, type_sym, field_name); + _option_v__ast__StructField _t11 = v__ast__Table_find_field_with_embeds(c->table, type_sym, field_name); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; exists = false; @@ -60694,7 +60779,7 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } } } else if (!v__ast__Type_alias_eq(expr_type, _const_v__ast__void_type) && expr_type_sym->kind != v__ast__Kind__placeholder) { - 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)); + _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 `"), /*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); @@ -60714,7 +60799,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 == 284 /* v.ast.AnonFn */) { + if ((field->expr)._typ == 285 /* 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); } @@ -60726,11 +60811,11 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str 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 == 306 /* v.ast.Ident */) { - if (((*field->expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((field->expr)._typ == 307 /* v.ast.Ident */) { + if (((*field->expr._v__ast__Ident).obj)._typ == 365 /* 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); + _option_v__ast__Var_ptr _t14 = v__ast__Scope_find_var(c->fn_scope, obj->name); if (_t14.state != 0) { /*or block*/ IError err = _t14.err; *(v__ast__Var**) _t14.data = obj; @@ -60756,13 +60841,13 @@ 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 == 331 /* v.ast.StructInit */) { + if ((field.default_expr)._typ == 332 /* 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; + _option_v__ast__ConstField_ptr _t15; 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; @@ -60812,8 +60897,8 @@ v__ast__Type v__checker__Checker_struct_init(v__checker__Checker* c, v__ast__Str } 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, 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 */ ; + v__ast__Struct from_info = /* as */ *(v__ast__Struct*)__as_cast((from_sym->info)._v__ast__Struct,(from_sym->info)._typ, 457) /*expected idx: 457, 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, 457) /*expected idx: 457, 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 `"), /*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)); } @@ -60832,7 +60917,7 @@ VV_LOCAL_SYMBOL bool v__transformer__IndexState_safe_access(v__transformer__Inde return _t1; } int* _t3 = (int*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, i->max_index), &(string[]){key})); - Option_int _t2 = {0}; + _option_int _t2 = {0}; if (_t3) { *((int*)&_t2.data) = *((int*)_t3); } else { @@ -60870,7 +60955,7 @@ VV_LOCAL_SYMBOL int v__transformer__IndexState_safe_offset(v__transformer__Index return _t1; } int* _t4 = (int*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, i->max_index), &(string[]){key})); - Option_int _t3 = {0}; + _option_int _t3 = {0}; if (_t4) { *((int*)&_t3.data) = *((int*)_t4); } else { @@ -60973,9 +61058,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 == 286 /* v.ast.ArrayInit */) { + if ((right)._typ == 287 /* v.ast.ArrayInit */) { v__ast__Expr left = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left)._typ == 306 /* v.ast.Ident */) { + if ((left)._typ == 307 /* v.ast.Ident */) { if ((*left._v__ast__Ident).is_mut) { v__transformer__IndexState_safe_access(t->index, (*left._v__ast__Ident).name, -2); return; @@ -60986,7 +61071,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 == 311 /* v.ast.IntegerLiteral */) { + if ((value)._typ == 312 /* 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); @@ -60999,19 +61084,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 == 309 /* v.ast.IndexExpr */) { + if ((right)._typ == 310 /* v.ast.IndexExpr */) { v__ast__Expr left = (*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)); - if ((left)._typ == 306 /* v.ast.Ident */) { + if ((left)._typ == 307 /* 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 == 324 /* v.ast.RangeExpr */) { + if ((index)._typ == 325 /* v.ast.RangeExpr */) { v__ast__Expr range_low = (*index._v__ast__RangeExpr).low; - if ((range_low)._typ == 311 /* v.ast.IntegerLiteral */) { + if ((range_low)._typ == 312 /* v.ast.IntegerLiteral */) { v__ast__Expr sub_left = (*right._v__ast__IndexExpr).left; - if ((sub_left)._typ == 306 /* v.ast.Ident */) { + if ((sub_left)._typ == 307 /* 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) { @@ -61039,40 +61124,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 == 311 /* v.ast.IntegerLiteral */) { + if (index._typ == 312 /* 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 == 324 /* v.ast.RangeExpr */) { + else if (index._typ == 325 /* v.ast.RangeExpr */) { if ((*index._v__ast__RangeExpr).has_high) { v__ast__Expr high = (*index._v__ast__RangeExpr).high; - if ((high)._typ == 311 /* v.ast.IntegerLiteral */) { + if ((high)._typ == 312 /* 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 == 311 /* v.ast.IntegerLiteral */) { + if ((low)._typ == 312 /* 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 == 293 /* v.ast.CastExpr */) { + else if (index._typ == 294 /* 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 == 311 /* v.ast.IntegerLiteral */) { + if ((index_expr)._typ == 312 /* 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 == 303 /* v.ast.EnumVal */) { + else if (index._typ == 304 /* v.ast.EnumVal */) { ; } - else if (index._typ == 306 /* v.ast.Ident */) { + else if (index._typ == 307 /* v.ast.Ident */) { } else { @@ -61081,17 +61166,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 == 344 /* v.ast.EmptyStmt */) { + if (node->_typ == 345 /* v.ast.EmptyStmt */) { } - else if (node->_typ == 317 /* v.ast.NodeError */) { + else if (node->_typ == 318 /* v.ast.NodeError */) { } - else if (node->_typ == 336 /* v.ast.AsmStmt */) { + else if (node->_typ == 337 /* v.ast.AsmStmt */) { } - else if (node->_typ == 337 /* v.ast.AssertStmt */) { + else if (node->_typ == 338 /* 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 == 338 /* v.ast.AssignStmt */) { + else if (node->_typ == 339 /* 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)); @@ -61104,7 +61189,7 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ *left = v__transformer__Transformer_expr(t, left); } } - else if (node->_typ == 339 /* v.ast.Block */) { + else if (node->_typ == 340 /* 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; @@ -61112,35 +61197,35 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 340 /* v.ast.BranchStmt */) { + else if (node->_typ == 341 /* v.ast.BranchStmt */) { t->index->disabled = true; } - else if (node->_typ == 341 /* v.ast.ComptimeFor */) { + else if (node->_typ == 342 /* 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 == 342 /* v.ast.ConstDecl */) { + else if (node->_typ == 343 /* 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 == 343 /* v.ast.DeferStmt */) { + else if (node->_typ == 344 /* 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 == 345 /* v.ast.EnumDecl */) { + else if (node->_typ == 346 /* v.ast.EnumDecl */) { } - else if (node->_typ == 346 /* v.ast.ExprStmt */) { + else if (node->_typ == 347 /* v.ast.ExprStmt */) { v__ast__Expr _t8 = {0}; - if ((*node->_v__ast__ExprStmt).expr._typ == 307 /* v.ast.IfExpr */) { + if ((*node->_v__ast__ExprStmt).expr._typ == 308 /* 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 == 316 /* v.ast.MatchExpr */) { + else if ((*node->_v__ast__ExprStmt).expr._typ == 317 /* v.ast.MatchExpr */) { _t8 = v__transformer__Transformer_expr_stmt_match_expr(t, (voidptr)&/*qq*/(*(*node->_v__ast__ExprStmt).expr._v__ast__MatchExpr)); } @@ -61149,7 +61234,7 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } (*node->_v__ast__ExprStmt).expr = _t8; } - else if (node->_typ == 219 /* v.ast.FnDecl */) { + else if (node->_typ == 220 /* 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; @@ -61157,11 +61242,11 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 347 /* v.ast.ForCStmt */) { + else if (node->_typ == 348 /* 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 == 348 /* v.ast.ForInStmt */) { + else if (node->_typ == 349 /* 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; @@ -61169,50 +61254,50 @@ v__ast__Stmt v__transformer__Transformer_stmt(v__transformer__Transformer* t, v_ } v__transformer__IndexState_unindent(t->index); } - else if (node->_typ == 349 /* v.ast.ForStmt */) { + else if (node->_typ == 350 /* 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 == 350 /* v.ast.GlobalDecl */) { + else if (node->_typ == 351 /* 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 == 351 /* v.ast.GotoLabel */) { + else if (node->_typ == 352 /* v.ast.GotoLabel */) { } - else if (node->_typ == 352 /* v.ast.GotoStmt */) { + else if (node->_typ == 353 /* v.ast.GotoStmt */) { t->index->disabled = true; } - else if (node->_typ == 353 /* v.ast.HashStmt */) { + else if (node->_typ == 354 /* 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 == 354 /* v.ast.Import */) { + else if (node->_typ == 355 /* v.ast.Import */) { } - else if (node->_typ == 355 /* v.ast.InterfaceDecl */) { + else if (node->_typ == 356 /* 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 == 356 /* v.ast.Module */) { + else if (node->_typ == 357 /* v.ast.Module */) { } - else if (node->_typ == 357 /* v.ast.Return */) { + else if (node->_typ == 358 /* 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 == 358 /* v.ast.SqlStmt */) { + else if (node->_typ == 359 /* v.ast.SqlStmt */) { } - else if (node->_typ == 359 /* v.ast.StructDecl */) { + else if (node->_typ == 360 /* 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 == 283 /* v.ast.TypeDecl */) { + else if (node->_typ == 284 /* v.ast.TypeDecl */) { } ; v__ast__Stmt _t18 = *node; @@ -61226,11 +61311,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 == 310 /* v.ast.InfixExpr */) { + if ((node->expr)._typ == 311 /* v.ast.InfixExpr */) { v__ast__Expr right = (*node->expr._v__ast__InfixExpr).right; - if (right._typ == 311 /* v.ast.IntegerLiteral */) { + if (right._typ == 312 /* v.ast.IntegerLiteral */) { v__ast__Expr left = (*node->expr._v__ast__InfixExpr).left; - if ((left)._typ == 326 /* v.ast.SelectorExpr */) { + if ((left)._typ == 327 /* v.ast.SelectorExpr */) { int len = string_int((*right._v__ast__IntegerLiteral).val); if (string__eq((*left._v__ast__SelectorExpr).field_name, _SLIT("len"))) { @@ -61248,9 +61333,9 @@ v__ast__Stmt v__transformer__Transformer_assert_stmt(v__transformer__Transformer } } } - else if (right._typ == 326 /* v.ast.SelectorExpr */) { + else if (right._typ == 327 /* v.ast.SelectorExpr */) { v__ast__Expr left = (*node->expr._v__ast__InfixExpr).left; - if ((left)._typ == 311 /* v.ast.IntegerLiteral */) { + if ((left)._typ == 312 /* v.ast.IntegerLiteral */) { int len = string_int((*left._v__ast__IntegerLiteral).val); if (string__eq((*right._v__ast__SelectorExpr).field_name, _SLIT("len"))) { @@ -61289,7 +61374,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 == 290 /* v.ast.BoolLiteral */) { + if ((cond)._typ == 291 /* v.ast.BoolLiteral */) { if ((*cond._v__ast__BoolLiteral).val) { stop_index = i; break; @@ -61348,36 +61433,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 == 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) { + if (cond._typ == 291 /* v.ast.BoolLiteral */) { + if ((expr)->_typ == 291 /* v.ast.BoolLiteral */) { + if ((*cond._v__ast__BoolLiteral).val == (/* as */ *(v__ast__BoolLiteral*)__as_cast((expr)->_v__ast__BoolLiteral,(expr)->_typ, 291) /*expected idx: 291, 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 == 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)) { + else if (cond._typ == 312 /* v.ast.IntegerLiteral */) { + if ((expr)->_typ == 312 /* 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, 312) /*expected idx: 312, 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 == 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)) { + else if (cond._typ == 305 /* v.ast.FloatLiteral */) { + if ((expr)->_typ == 305 /* 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, 305) /*expected idx: 305, 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 == 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)) { + else if (cond._typ == 331 /* v.ast.StringLiteral */) { + if ((expr)->_typ == 331 /* v.ast.StringLiteral */) { + if (string__eq((*cond._v__ast__StringLiteral).val, (/* as */ *(v__ast__StringLiteral*)__as_cast((expr)->_v__ast__StringLiteral,(expr)->_typ, 331) /*expected idx: 331, 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; @@ -61425,8 +61510,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 == 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) { + if (node->cond._typ == 291 /* v.ast.BoolLiteral */) { + if (!(/* as */ *(v__ast__BoolLiteral*)__as_cast((node->cond)._v__ast__BoolLiteral,(node->cond)._typ, 291) /*expected idx: 291, 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; } @@ -61461,13 +61546,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 == 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 */ ; + if (node->_typ == 285 /* 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, 220) /*expected idx: 220, name: v.ast.FnDecl */ ; } - else if (node->_typ == 285 /* v.ast.ArrayDecompose */) { + else if (node->_typ == 286 /* v.ast.ArrayDecompose */) { (*node->_v__ast__ArrayDecompose).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ArrayDecompose).expr); } - else if (node->_typ == 286 /* v.ast.ArrayInit */) { + else if (node->_typ == 287 /* 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); @@ -61476,73 +61561,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 == 287 /* v.ast.AsCast */) { + else if (node->_typ == 288 /* v.ast.AsCast */) { (*node->_v__ast__AsCast).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__AsCast).expr); } - else if (node->_typ == 291 /* v.ast.CTempVar */) { + else if (node->_typ == 292 /* v.ast.CTempVar */) { (*node->_v__ast__CTempVar).orig = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__CTempVar).orig); } - else if (node->_typ == 292 /* v.ast.CallExpr */) { + else if (node->_typ == 293 /* 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, 320) /*expected idx: 320, 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, 321) /*expected idx: 321, name: v.ast.OrExpr */ ; } - else if (node->_typ == 293 /* v.ast.CastExpr */) { + else if (node->_typ == 294 /* 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 == 294 /* v.ast.ChanInit */) { + else if (node->_typ == 295 /* 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 == 297 /* v.ast.ComptimeCall */) { + else if (node->_typ == 298 /* 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 == 298 /* v.ast.ComptimeSelector */) { + else if (node->_typ == 299 /* 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 == 300 /* v.ast.ConcatExpr */) { + else if (node->_typ == 301 /* 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 == 301 /* v.ast.DumpExpr */) { + else if (node->_typ == 302 /* v.ast.DumpExpr */) { (*node->_v__ast__DumpExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__DumpExpr).expr); } - 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.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, 293) /*expected idx: 293, name: v.ast.CallExpr */ ; } - else if (node->_typ == 307 /* v.ast.IfExpr */) { + else if (node->_typ == 308 /* 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 == 308 /* v.ast.IfGuardExpr */) { + else if (node->_typ == 309 /* v.ast.IfGuardExpr */) { (*node->_v__ast__IfGuardExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IfGuardExpr).expr); } - else if (node->_typ == 309 /* v.ast.IndexExpr */) { + else if (node->_typ == 310 /* 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, 320) /*expected idx: 320, 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, 321) /*expected idx: 321, name: v.ast.OrExpr */ ; } - else if (node->_typ == 310 /* v.ast.InfixExpr */) { + else if (node->_typ == 311 /* 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 == 312 /* v.ast.IsRefType */) { + else if (node->_typ == 313 /* v.ast.IsRefType */) { (*node->_v__ast__IsRefType).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__IsRefType).expr); } - else if (node->_typ == 313 /* v.ast.Likely */) { + else if (node->_typ == 314 /* v.ast.Likely */) { (*node->_v__ast__Likely).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__Likely).expr); } - else if (node->_typ == 314 /* v.ast.LockExpr */) { + else if (node->_typ == 315 /* 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); @@ -61552,7 +61637,7 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ *locked = v__transformer__Transformer_expr(t, locked); } } - else if (node->_typ == 315 /* v.ast.MapInit */) { + else if (node->_typ == 316 /* 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); @@ -61562,31 +61647,31 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ *val = v__transformer__Transformer_expr(t, val); } } - else if (node->_typ == 316 /* v.ast.MatchExpr */) { + else if (node->_typ == 317 /* 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 == 320 /* v.ast.OrExpr */) { + else if (node->_typ == 321 /* 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 == 321 /* v.ast.ParExpr */) { + else if (node->_typ == 322 /* v.ast.ParExpr */) { (*node->_v__ast__ParExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__ParExpr).expr); } - else if (node->_typ == 322 /* v.ast.PostfixExpr */) { + else if (node->_typ == 323 /* v.ast.PostfixExpr */) { (*node->_v__ast__PostfixExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__PostfixExpr).expr); } - else if (node->_typ == 323 /* v.ast.PrefixExpr */) { + else if (node->_typ == 324 /* 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, 320) /*expected idx: 320, 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, 321) /*expected idx: 321, name: v.ast.OrExpr */ ; } - else if (node->_typ == 324 /* v.ast.RangeExpr */) { + else if (node->_typ == 325 /* 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 == 325 /* v.ast.SelectExpr */) { + else if (node->_typ == 326 /* 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); @@ -61596,27 +61681,27 @@ v__ast__Expr v__transformer__Transformer_expr(v__transformer__Transformer* t, v_ } } } - else if (node->_typ == 326 /* v.ast.SelectorExpr */) { + else if (node->_typ == 327 /* 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 == 330 /* v.ast.StringLiteral */ && string__eq((*node->_v__ast__SelectorExpr).field_name, _SLIT("len"))) { + if (((*node->_v__ast__SelectorExpr).expr)._typ == 331 /* 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 == 327 /* v.ast.SizeOf */) { + else if (node->_typ == 328 /* v.ast.SizeOf */) { (*node->_v__ast__SizeOf).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__SizeOf).expr); } - else if (node->_typ == 328 /* v.ast.SqlExpr */) { + else if (node->_typ == 329 /* 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 == 329 /* v.ast.StringInterLiteral */) { + else if (node->_typ == 330 /* 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 == 331 /* v.ast.StructInit */) { + else if (node->_typ == 332 /* 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; @@ -61627,7 +61712,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 == 334 /* v.ast.UnsafeExpr */) { + else if (node->_typ == 335 /* v.ast.UnsafeExpr */) { (*node->_v__ast__UnsafeExpr).expr = v__transformer__Transformer_expr(t, &/*sum*/(*node->_v__ast__UnsafeExpr).expr); } @@ -61657,8 +61742,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 == 290 /* v.ast.BoolLiteral */) { - if (node->right._typ == 290 /* v.ast.BoolLiteral */) { + if (node->left._typ == 291 /* v.ast.BoolLiteral */) { + if (node->right._typ == 291 /* 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,},})))); @@ -61684,8 +61769,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 330 /* v.ast.StringLiteral */) { - if (node->right._typ == 330 /* v.ast.StringLiteral */) { + else if (node->left._typ == 331 /* v.ast.StringLiteral */) { + if (node->right._typ == 331 /* 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,},})))); @@ -61707,8 +61792,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 311 /* v.ast.IntegerLiteral */) { - if (node->right._typ == 311 /* v.ast.IntegerLiteral */) { + else if (node->left._typ == 312 /* v.ast.IntegerLiteral */) { + if (node->right._typ == 312 /* 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) { @@ -61928,8 +62013,8 @@ v__ast__Expr v__transformer__Transformer_infix_expr(v__transformer__Transformer* } ; } - else if (node->left._typ == 304 /* v.ast.FloatLiteral */) { - if (node->right._typ == 304 /* v.ast.FloatLiteral */) { + else if (node->left._typ == 305 /* v.ast.FloatLiteral */) { + if (node->right._typ == 305 /* 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) { @@ -62129,16 +62214,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 == 346 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 347 /* v.ast.ExprStmt */) { v__ast__Expr expr = (*stmt->_v__ast__ExprStmt).expr; - if (expr._typ == 307 /* v.ast.IfExpr */) { + if (expr._typ == 308 /* 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 == 316 /* v.ast.MatchExpr */) { + else if (expr._typ == 317 /* 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); @@ -62172,16 +62257,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 == 346 /* v.ast.ExprStmt */) { + if ((stmt)->_typ == 347 /* v.ast.ExprStmt */) { v__ast__Expr expr = (*stmt->_v__ast__ExprStmt).expr; - if (expr._typ == 307 /* v.ast.IfExpr */) { + if (expr._typ == 308 /* 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 == 316 /* v.ast.MatchExpr */) { + else if (expr._typ == 317 /* 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); @@ -62230,7 +62315,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, 328) /*expected idx: 328, 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, 329) /*expected idx: 329, name: v.ast.SqlExpr */ ; } v__ast__Expr _t6 = v__ast__SqlExpr_to_sumtype_v__ast__Expr(node); return _t6; @@ -62244,20 +62329,20 @@ bool v__markused__mark_used_defer_0 = false; Map_string_v__ast__GlobalField all_globals = mr_434.arg2; v__util__timing_start(_SLIT("mark_used")); v__markused__mark_used_defer_0 = true; - Array_string all_fn_root_names = new_array_from_c_array(99, 99, sizeof(string), _MOV((string[99]){ + Array_string all_fn_root_names = new_array_from_c_array(100, 100, sizeof(string), _MOV((string[100]){ _SLIT("main.main"), _SLIT("__new_array"), _SLIT("str_intp"), _SLIT("format_sb"), _SLIT("__new_array_with_default"), _SLIT("__new_array_with_array_default"), _SLIT("v_realloc"), _SLIT("malloc"), _SLIT("malloc_noscan"), _SLIT("vcalloc"), _SLIT("vcalloc_noscan"), _SLIT("new_array_from_c_array"), _SLIT("v_fixed_index"), _SLIT("memdup"), _SLIT("vstrlen"), _SLIT("__as_cast"), _SLIT("tos"), - _SLIT("tos2"), _SLIT("tos3"), _SLIT("isnil"), _SLIT("opt_ok"), _SLIT("error"), _SLIT("utf8_str_visible_length"), _SLIT("compare_ints"), _SLIT("compare_u64s"), - _SLIT("compare_strings"), _SLIT("compare_ints_reverse"), _SLIT("compare_u64s_reverse"), _SLIT("compare_strings_reverse"), _SLIT("builtin_init"), _SLIT("3.vstring"), _SLIT("3.vstring_with_len"), _SLIT("3.vstring_literal"), - _SLIT("4.vstring"), _SLIT("4.vstring_with_len"), _SLIT("4.vstring_literal"), _SLIT("10.str_escaped"), _SLIT("20.add"), _SLIT("20.trim_space"), _SLIT("20.repeat"), _SLIT("20.replace"), - _SLIT("20.clone"), _SLIT("20.clone_static"), _SLIT("20.trim"), _SLIT("20.substr"), _SLIT("20.substr_ni"), _SLIT("20.at"), _SLIT("20.at_with_check"), _SLIT("20.index_kmp"), - _SLIT("20.eq"), _SLIT("20.ne"), _SLIT("20.lt"), _SLIT("20.gt"), _SLIT("20.le"), _SLIT("20.ge"), _SLIT("fast_string_eq"), _SLIT("22.get"), - _SLIT("22.set"), _SLIT("22.get_unsafe"), _SLIT("22.set_unsafe"), _SLIT("22.get_with_check"), _SLIT("22.clone_static_to_depth"), _SLIT("22.clone_to_depth"), _SLIT("22.first"), _SLIT("22.last"), - _SLIT("22.pointers"), _SLIT("22.reverse"), _SLIT("22.repeat_to_depth"), _SLIT("22.slice"), _SLIT("22.slice_ni"), _SLIT("22.slice2"), _SLIT("61.get"), _SLIT("61.set"), - _SLIT("65558.last"), _SLIT("65558.pop"), _SLIT("65558.push"), _SLIT("65558.insert_many"), _SLIT("65558.prepend_many"), _SLIT("65558.reverse"), _SLIT("65558.set"), _SLIT("65558.set_unsafe"), - _SLIT("json.decode_string"), _SLIT("json.decode_int"), _SLIT("json.decode_bool"), _SLIT("json.decode_u64"), _SLIT("json.encode_int"), _SLIT("json.encode_string"), _SLIT("json.encode_bool"), _SLIT("json.encode_u64"), - _SLIT("json.json_print"), _SLIT("json.json_parse"), _SLIT("main.nasserts"), _SLIT("main.vtest_init"), _SLIT("main.vtest_new_metainfo"), _SLIT("main.vtest_new_filemetainfo"), _SLIT("os.getwd"), _SLIT("os.init_os_args"), - _SLIT("os.init_os_args_wide"), _SLIT("v.embed_file.find_index_entry_by_path")})); + _SLIT("tos2"), _SLIT("tos3"), _SLIT("isnil"), _SLIT("opt_ok"), _SLIT("opt_ok2"), _SLIT("error"), _SLIT("utf8_str_visible_length"), _SLIT("compare_ints"), + _SLIT("compare_u64s"), _SLIT("compare_strings"), _SLIT("compare_ints_reverse"), _SLIT("compare_u64s_reverse"), _SLIT("compare_strings_reverse"), _SLIT("builtin_init"), _SLIT("3.vstring"), _SLIT("3.vstring_with_len"), + _SLIT("3.vstring_literal"), _SLIT("4.vstring"), _SLIT("4.vstring_with_len"), _SLIT("4.vstring_literal"), _SLIT("10.str_escaped"), _SLIT("20.add"), _SLIT("20.trim_space"), _SLIT("20.repeat"), + _SLIT("20.replace"), _SLIT("20.clone"), _SLIT("20.clone_static"), _SLIT("20.trim"), _SLIT("20.substr"), _SLIT("20.substr_ni"), _SLIT("20.at"), _SLIT("20.at_with_check"), + _SLIT("20.index_kmp"), _SLIT("20.eq"), _SLIT("20.ne"), _SLIT("20.lt"), _SLIT("20.gt"), _SLIT("20.le"), _SLIT("20.ge"), _SLIT("fast_string_eq"), + _SLIT("22.get"), _SLIT("22.set"), _SLIT("22.get_unsafe"), _SLIT("22.set_unsafe"), _SLIT("22.get_with_check"), _SLIT("22.clone_static_to_depth"), _SLIT("22.clone_to_depth"), _SLIT("22.first"), + _SLIT("22.last"), _SLIT("22.pointers"), _SLIT("22.reverse"), _SLIT("22.repeat_to_depth"), _SLIT("22.slice"), _SLIT("22.slice_ni"), _SLIT("22.slice2"), _SLIT("61.get"), + _SLIT("61.set"), _SLIT("65558.last"), _SLIT("65558.pop"), _SLIT("65558.push"), _SLIT("65558.insert_many"), _SLIT("65558.prepend_many"), _SLIT("65558.reverse"), _SLIT("65558.set"), + _SLIT("65558.set_unsafe"), _SLIT("json.decode_string"), _SLIT("json.decode_int"), _SLIT("json.decode_bool"), _SLIT("json.decode_u64"), _SLIT("json.encode_int"), _SLIT("json.encode_string"), _SLIT("json.encode_bool"), + _SLIT("json.encode_u64"), _SLIT("json.json_print"), _SLIT("json.json_parse"), _SLIT("main.nasserts"), _SLIT("main.vtest_init"), _SLIT("main.vtest_new_metainfo"), _SLIT("main.vtest_new_filemetainfo"), _SLIT("os.getwd"), + _SLIT("os.init_os_args"), _SLIT("os.init_os_args_wide"), _SLIT("v.embed_file.find_index_entry_by_path")})); if (pref->is_bare) { _PUSH_MANY(&all_fn_root_names, (new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("strlen"), _SLIT("memcmp"), _SLIT("memcpy"), _SLIT("realloc"), _SLIT("vsnprintf"), _SLIT("vsprintf")}))), _t1, Array_string); } @@ -62352,7 +62437,7 @@ bool v__markused__mark_used_defer_0 = false; if (pref->is_test) { array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(_SLIT("main.cb_assertion_ok")) })); array_push((array*)&all_fn_root_names, _MOV((string[]){ string_clone(_SLIT("main.cb_assertion_failed")) })); - Option_v__ast__TypeSymbol_ptr _t25; + _option_v__ast__TypeSymbol_ptr _t25; 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; @@ -62367,10 +62452,10 @@ bool v__markused__mark_used_defer_0 = false; if (isym->kind != v__ast__Kind__interface_) { continue; } - if ((isym->info)._typ != 474 /* v.ast.Interface */) { + if ((isym->info)._typ != 475 /* v.ast.Interface */) { continue; } - 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 */ ; + v__ast__Interface interface_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 475) /*expected idx: 475, name: v.ast.Interface */ ; if (interface_info.methods.len == 0) { continue; } @@ -62407,7 +62492,7 @@ bool v__markused__mark_used_defer_0 = false; } } Array_v__ast__Type* _t41 = (Array_v__ast__Type*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, table->iface_types), &(string[]){_SLIT("orm.Connection")})); - Option_Array_v__ast__Type _t40 = {0}; + _option_Array_v__ast__Type _t40 = {0}; if (_t41) { *((Array_v__ast__Type*)&_t40.data) = *((Array_v__ast__Type*)_t41); } else { @@ -62564,18 +62649,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 == 219 /* v.ast.FnDecl */) { + if (node._typ == 220 /* 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){.receiver = (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,},.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.params = __new_array(0, 0, sizeof(v__ast__Param)),.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.defer_stmts = __new_array(0, 0, sizeof(v__ast__DeferStmt)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.next_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.label_names = __new_array(0, 0, sizeof(string)),.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.source_file = 0,.scope = 0,.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.ctdefine_idx = -1,.idx = 0,.return_type = 0,.ninstances = 0,.is_deprecated = 0,.is_pub = 0,.is_variadic = 0,.is_anon = 0,.is_noreturn = 0,.is_manualfree = 0,.is_main = 0,.is_test = 0,.is_conditional = 0,.is_exported = 0,.is_keep_alive = 0,.is_unsafe = 0,.is_markused = 0,.is_method = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.is_direct_arr = 0,.has_return = 0,.should_be_skipped = 0,.has_await = 0,} })) = (*node._v__ast__FnDecl); } - else if (node._typ == 342 /* v.ast.ConstDecl */) { + else if (node._typ == 343 /* 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 == 350 /* v.ast.GlobalDecl */) { + else if (node._typ == 351 /* 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; @@ -62607,7 +62692,7 @@ void v__markused__Walker_mark_const_as_used(v__markused__Walker* w, string ckey) } map_set(&w->used_consts, &(string[]){ckey}, &(bool[]) { true }); v__ast__ConstField* _t2 = (v__ast__ConstField*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, w->all_consts), &(string[]){ckey})); - Option_v__ast__ConstField _t1 = {0}; + _option_v__ast__ConstField _t1 = {0}; if (_t2) { *((v__ast__ConstField*)&_t1.data) = *((v__ast__ConstField*)_t2); } else { @@ -62629,7 +62714,7 @@ void v__markused__Walker_mark_global_as_used(v__markused__Walker* w, string ckey } map_set(&w->used_globals, &(string[]){ckey}, &(bool[]) { true }); v__ast__GlobalField* _t2 = (v__ast__GlobalField*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, w->all_globals), &(string[]){ckey})); - Option_v__ast__GlobalField _t1 = {0}; + _option_v__ast__GlobalField _t1 = {0}; if (_t2) { *((v__ast__GlobalField*)&_t1.data) = *((v__ast__GlobalField*)_t2); } else { @@ -62732,43 +62817,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 == 344 /* v.ast.EmptyStmt */) { + if (node._typ == 345 /* v.ast.EmptyStmt */) { } - else if (node._typ == 336 /* v.ast.AsmStmt */) { + else if (node._typ == 337 /* 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 == 337 /* v.ast.AssertStmt */) { + else if (node._typ == 338 /* 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 == 338 /* v.ast.AssignStmt */) { + else if (node._typ == 339 /* 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 == 339 /* v.ast.Block */) { + else if (node._typ == 340 /* v.ast.Block */) { v__markused__Walker_stmts(w, (*node._v__ast__Block).stmts); } - else if (node._typ == 341 /* v.ast.ComptimeFor */) { + else if (node._typ == 342 /* v.ast.ComptimeFor */) { v__markused__Walker_stmts(w, (*node._v__ast__ComptimeFor).stmts); } - else if (node._typ == 342 /* v.ast.ConstDecl */) { + else if (node._typ == 343 /* v.ast.ConstDecl */) { v__markused__Walker_const_fields(w, (*node._v__ast__ConstDecl).fields); } - else if (node._typ == 346 /* v.ast.ExprStmt */) { + else if (node._typ == 347 /* v.ast.ExprStmt */) { v__markused__Walker_expr(w, (*node._v__ast__ExprStmt).expr); } - else if (node._typ == 219 /* v.ast.FnDecl */) { + else if (node._typ == 220 /* v.ast.FnDecl */) { v__markused__Walker_fn_decl(w, (voidptr)&/*qq*/(*node._v__ast__FnDecl)); } - else if (node._typ == 347 /* v.ast.ForCStmt */) { + else if (node._typ == 348 /* 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 == 348 /* v.ast.ForInStmt */) { + else if (node._typ == 349 /* 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); @@ -62780,21 +62865,21 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { return; } v__ast__TypeSymbol* cond_type_sym = v__ast__Table_sym(w->table, (*node._v__ast__ForInStmt).cond_type); - Option_v__ast__Fn _t1; + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method(cond_type_sym, _SLIT("next")), _t1.state == 0) { v__ast__Fn next_fn = *(v__ast__Fn*)_t1.data; v__markused__Walker_fn_decl(w, ((v__ast__FnDecl*)(next_fn.source_fn))); } } } - else if (node._typ == 349 /* v.ast.ForStmt */) { + else if (node._typ == 350 /* 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 == 357 /* v.ast.Return */) { + else if (node._typ == 358 /* v.ast.Return */) { v__markused__Walker_exprs(w, (*node._v__ast__Return).exprs); } - else if (node._typ == 358 /* v.ast.SqlStmt */) { + else if (node._typ == 359 /* 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]; @@ -62802,13 +62887,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 == 359 /* v.ast.StructDecl */) { + else if (node._typ == 360 /* v.ast.StructDecl */) { v__markused__Walker_struct_fields(w, (*node._v__ast__StructDecl).fields); } - else if (node._typ == 343 /* v.ast.DeferStmt */) { + else if (node._typ == 344 /* v.ast.DeferStmt */) { v__markused__Walker_stmts(w, (*node._v__ast__DeferStmt).stmts); } - else if (node._typ == 350 /* v.ast.GlobalDecl */) { + else if (node._typ == 351 /* 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) { @@ -62816,25 +62901,25 @@ void v__markused__Walker_stmt(v__markused__Walker* w, v__ast__Stmt node_) { } } } - else if (node._typ == 340 /* v.ast.BranchStmt */) { + else if (node._typ == 341 /* v.ast.BranchStmt */) { } - else if (node._typ == 345 /* v.ast.EnumDecl */) { + else if (node._typ == 346 /* v.ast.EnumDecl */) { } - else if (node._typ == 351 /* v.ast.GotoLabel */) { + else if (node._typ == 352 /* v.ast.GotoLabel */) { } - else if (node._typ == 352 /* v.ast.GotoStmt */) { + else if (node._typ == 353 /* v.ast.GotoStmt */) { } - else if (node._typ == 353 /* v.ast.HashStmt */) { + else if (node._typ == 354 /* v.ast.HashStmt */) { } - else if (node._typ == 354 /* v.ast.Import */) { + else if (node._typ == 355 /* v.ast.Import */) { } - else if (node._typ == 355 /* v.ast.InterfaceDecl */) { + else if (node._typ == 356 /* v.ast.InterfaceDecl */) { } - else if (node._typ == 356 /* v.ast.Module */) { + else if (node._typ == 357 /* v.ast.Module */) { } - else if (node._typ == 283 /* v.ast.TypeDecl */) { + else if (node._typ == 284 /* v.ast.TypeDecl */) { } - else if (node._typ == 317 /* v.ast.NodeError */) { + else if (node._typ == 318 /* v.ast.NodeError */) { } ; } @@ -62869,54 +62954,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 == 302 /* v.ast.EmptyExpr */) { + if (node._typ == 303 /* v.ast.EmptyExpr */) { } - else if (node._typ == 299 /* v.ast.ComptimeType */) { + else if (node._typ == 300 /* v.ast.ComptimeType */) { } - else if (node._typ == 284 /* v.ast.AnonFn */) { + else if (node._typ == 285 /* v.ast.AnonFn */) { v__markused__Walker_fn_decl(w, (voidptr)&/*qq*/(*node._v__ast__AnonFn).decl); } - else if (node._typ == 286 /* v.ast.ArrayInit */) { + else if (node._typ == 287 /* 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 == 288 /* v.ast.Assoc */) { + else if (node._typ == 289 /* v.ast.Assoc */) { v__markused__Walker_exprs(w, (*node._v__ast__Assoc).exprs); } - else if (node._typ == 285 /* v.ast.ArrayDecompose */) { + else if (node._typ == 286 /* v.ast.ArrayDecompose */) { v__markused__Walker_expr(w, (*node._v__ast__ArrayDecompose).expr); } - else if (node._typ == 292 /* v.ast.CallExpr */) { + else if (node._typ == 293 /* v.ast.CallExpr */) { v__markused__Walker_call_expr(w, (voidptr)&/*qq*/(*node._v__ast__CallExpr)); } - else if (node._typ == 293 /* v.ast.CastExpr */) { + else if (node._typ == 294 /* 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 == 294 /* v.ast.ChanInit */) { + else if (node._typ == 295 /* v.ast.ChanInit */) { v__markused__Walker_expr(w, (*node._v__ast__ChanInit).cap_expr); } - else if (node._typ == 300 /* v.ast.ConcatExpr */) { + else if (node._typ == 301 /* v.ast.ConcatExpr */) { v__markused__Walker_exprs(w, (*node._v__ast__ConcatExpr).vals); } - else if (node._typ == 298 /* v.ast.ComptimeSelector */) { + else if (node._typ == 299 /* 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 == 297 /* v.ast.ComptimeCall */) { + else if (node._typ == 298 /* 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 == 301 /* v.ast.DumpExpr */) { + else if (node._typ == 302 /* 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 == 305 /* v.ast.GoExpr */) { + else if (node._typ == 306 /* 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")); @@ -62926,7 +63011,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 == 309 /* v.ast.IndexExpr */) { + else if (node._typ == 310 /* 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); @@ -62938,7 +63023,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex w->table->used_maps++; } } - else if (node._typ == 310 /* v.ast.InfixExpr */) { + else if (node._typ == 311 /* 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); @@ -62947,7 +63032,7 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex } v__ast__TypeSymbol* sym = v__ast__Table_sym(w->table, (*node._v__ast__InfixExpr).left_type); if (sym->kind == v__ast__Kind__struct_) { - Option_v__ast__Fn _t1; + _option_v__ast__Fn _t1; if (_t1 = v__ast__TypeSymbol_find_method(sym, v__token__Kind_str((*node._v__ast__InfixExpr).op)), _t1.state == 0) { v__ast__Fn opmethod = *(v__ast__Fn*)_t1.data; v__markused__Walker_fn_decl(w, ((v__ast__FnDecl*)(opmethod.source_fn))); @@ -62961,10 +63046,10 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex w->table->used_maps++; } } - else if (node._typ == 308 /* v.ast.IfGuardExpr */) { + else if (node._typ == 309 /* v.ast.IfGuardExpr */) { v__markused__Walker_expr(w, (*node._v__ast__IfGuardExpr).expr); } - else if (node._typ == 307 /* v.ast.IfExpr */) { + else if (node._typ == 308 /* 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]; @@ -62972,7 +63057,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 == 306 /* v.ast.Ident */) { + else if (node._typ == 307 /* 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); @@ -62986,15 +63071,15 @@ VV_LOCAL_SYMBOL void v__markused__Walker_expr(v__markused__Walker* w, v__ast__Ex else { }; } - else if (node._typ == 313 /* v.ast.Likely */) { + else if (node._typ == 314 /* v.ast.Likely */) { v__markused__Walker_expr(w, (*node._v__ast__Likely).expr); } - else if (node._typ == 315 /* v.ast.MapInit */) { + else if (node._typ == 316 /* 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 == 316 /* v.ast.MatchExpr */) { + else if (node._typ == 317 /* 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]; @@ -63002,18 +63087,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 == 318 /* v.ast.None */) { + else if (node._typ == 319 /* v.ast.None */) { } - else if (node._typ == 321 /* v.ast.ParExpr */) { + else if (node._typ == 322 /* v.ast.ParExpr */) { v__markused__Walker_expr(w, (*node._v__ast__ParExpr).expr); } - else if (node._typ == 323 /* v.ast.PrefixExpr */) { + else if (node._typ == 324 /* v.ast.PrefixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__PrefixExpr).right); } - else if (node._typ == 322 /* v.ast.PostfixExpr */) { + else if (node._typ == 323 /* v.ast.PostfixExpr */) { v__markused__Walker_expr(w, (*node._v__ast__PostfixExpr).expr); } - else if (node._typ == 324 /* v.ast.RangeExpr */) { + else if (node._typ == 325 /* v.ast.RangeExpr */) { if ((*node._v__ast__RangeExpr).has_low) { v__markused__Walker_expr(w, (*node._v__ast__RangeExpr).low); } @@ -63021,32 +63106,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 == 327 /* v.ast.SizeOf */) { + else if (node._typ == 328 /* v.ast.SizeOf */) { v__markused__Walker_expr(w, (*node._v__ast__SizeOf).expr); } - else if (node._typ == 312 /* v.ast.IsRefType */) { + else if (node._typ == 313 /* v.ast.IsRefType */) { v__markused__Walker_expr(w, (*node._v__ast__IsRefType).expr); } - else if (node._typ == 329 /* v.ast.StringInterLiteral */) { + else if (node._typ == 330 /* v.ast.StringInterLiteral */) { v__markused__Walker_exprs(w, (*node._v__ast__StringInterLiteral).exprs); } - else if (node._typ == 326 /* v.ast.SelectorExpr */) { + else if (node._typ == 327 /* v.ast.SelectorExpr */) { v__markused__Walker_expr(w, (*node._v__ast__SelectorExpr).expr); } - else if (node._typ == 328 /* v.ast.SqlExpr */) { + else if (node._typ == 329 /* 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 == 331 /* v.ast.StructInit */) { + else if (node._typ == 332 /* 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, 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) { @@ -63072,52 +63157,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 == 333 /* v.ast.TypeOf */) { + else if (node._typ == 334 /* v.ast.TypeOf */) { v__markused__Walker_expr(w, (*node._v__ast__TypeOf).expr); } - else if (node._typ == 287 /* v.ast.AsCast */) { + else if (node._typ == 288 /* v.ast.AsCast */) { v__markused__Walker_expr(w, (*node._v__ast__AsCast).expr); } - else if (node._typ == 289 /* v.ast.AtExpr */) { + else if (node._typ == 290 /* v.ast.AtExpr */) { } - else if (node._typ == 290 /* v.ast.BoolLiteral */) { + else if (node._typ == 291 /* v.ast.BoolLiteral */) { } - else if (node._typ == 304 /* v.ast.FloatLiteral */) { + else if (node._typ == 305 /* v.ast.FloatLiteral */) { } - else if (node._typ == 295 /* v.ast.CharLiteral */) { + else if (node._typ == 296 /* v.ast.CharLiteral */) { } - else if (node._typ == 311 /* v.ast.IntegerLiteral */) { + else if (node._typ == 312 /* v.ast.IntegerLiteral */) { } - else if (node._typ == 330 /* v.ast.StringLiteral */) { + else if (node._typ == 331 /* v.ast.StringLiteral */) { } - else if (node._typ == 291 /* v.ast.CTempVar */) { + else if (node._typ == 292 /* v.ast.CTempVar */) { v__markused__Walker_expr(w, (*node._v__ast__CTempVar).orig); } - else if (node._typ == 296 /* v.ast.Comment */) { + else if (node._typ == 297 /* v.ast.Comment */) { } - else if (node._typ == 303 /* v.ast.EnumVal */) { + else if (node._typ == 304 /* v.ast.EnumVal */) { } - else if (node._typ == 314 /* v.ast.LockExpr */) { + else if (node._typ == 315 /* v.ast.LockExpr */) { v__markused__Walker_stmts(w, (*node._v__ast__LockExpr).stmts); } - else if (node._typ == 319 /* v.ast.OffsetOf */) { + else if (node._typ == 320 /* v.ast.OffsetOf */) { } - else if (node._typ == 320 /* v.ast.OrExpr */) { + else if (node._typ == 321 /* v.ast.OrExpr */) { v__markused__Walker_or_block(w, (*node._v__ast__OrExpr)); } - else if (node._typ == 325 /* v.ast.SelectExpr */) { + else if (node._typ == 326 /* 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 == 332 /* v.ast.TypeNode */) { + else if (node._typ == 333 /* v.ast.TypeNode */) { } - else if (node._typ == 334 /* v.ast.UnsafeExpr */) { + else if (node._typ == 335 /* v.ast.UnsafeExpr */) { v__markused__Walker_expr(w, (*node._v__ast__UnsafeExpr).expr); } - else if (node._typ == 317 /* v.ast.NodeError */) { + else if (node._typ == 318 /* v.ast.NodeError */) { } ; } @@ -63154,7 +63239,7 @@ void v__markused__Walker_call_expr(v__markused__Walker* w, v__ast__CallExpr* nod } v__markused__Walker_mark_fn_as_used(w, fn_name); v__ast__FnDecl* _t3 = (v__ast__FnDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, w->all_fns), &(string[]){fn_name})); - Option_v__ast__FnDecl _t2 = {0}; + _option_v__ast__FnDecl _t2 = {0}; if (_t3) { *((v__ast__FnDecl*)&_t2.data) = *((v__ast__FnDecl*)_t3); } else { @@ -63179,7 +63264,7 @@ void v__markused__Walker_fn_by_name(v__markused__Walker* w, string fn_name) { return; } v__ast__FnDecl* _t2 = (v__ast__FnDecl*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, w->all_fns), &(string[]){fn_name})); - Option_v__ast__FnDecl _t1 = {0}; + _option_v__ast__FnDecl _t1 = {0}; if (_t2) { *((v__ast__FnDecl*)&_t1.data) = *((v__ast__FnDecl*)_t2); } else { @@ -63256,7 +63341,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 != 330 /* v.ast.StringLiteral */ && (expr)._typ != 329 /* 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 != 331 /* v.ast.StringLiteral */ && (expr)._typ != 330 /* 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(")")); @@ -63313,7 +63398,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, 479) /*expected idx: 479, 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, 480) /*expected idx: 480, 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")); @@ -63371,7 +63456,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, 479) /*expected idx: 479, 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, 480) /*expected idx: 480, 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); @@ -63536,9 +63621,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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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")); @@ -63569,12 +63654,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_map(v__gen__c__Gen* g, v__ast__Cal 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 == 284 /* v.ast.AnonFn */) { + if (expr._typ == 285 /* 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, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 306 /* v.ast.Ident */) { + else if (expr._typ == 307 /* 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); @@ -63590,7 +63675,7 @@ 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 == 292 /* v.ast.CallExpr */) { + else if (expr._typ == 293 /* 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); @@ -63636,7 +63721,7 @@ 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((rec_sym->info)._v__ast__Array,(rec_sym->info)._typ, 452) /*expected idx: 452, 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_"), /*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); @@ -63655,7 +63740,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, 310) /*expected idx: 310, 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, 311) /*expected idx: 311, 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) { @@ -63676,19 +63761,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 == 306 /* v.ast.Ident */) { + if ((infix_expr.left)._typ == 307 /* v.ast.Ident */) { left_expr = string__plus(_SLIT("*"), left_expr); } - if ((infix_expr.right)._typ == 306 /* v.ast.Ident */) { + if ((infix_expr.right)._typ == 307 /* 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 == 306 /* v.ast.Ident */) { + if ((infix_expr.left)._typ == 307 /* v.ast.Ident */) { right_expr = string__plus(_SLIT("*"), right_expr); } - if ((infix_expr.right)._typ == 306 /* v.ast.Ident */) { + if ((infix_expr.right)._typ == 307 /* v.ast.Ident */) { left_expr = string__plus(_SLIT("*"), left_expr); } } @@ -63729,7 +63814,7 @@ 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 452) /*expected idx: 452, 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; @@ -63757,12 +63842,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_filter(v__gen__c__Gen* g, v__ast__ 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 == 284 /* v.ast.AnonFn */) { + if (expr._typ == 285 /* 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, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 306 /* v.ast.Ident */) { + else if (expr._typ == 307 /* 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); @@ -63778,7 +63863,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 == 292 /* v.ast.CallExpr */) { + else if (expr._typ == 293 /* 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); @@ -63814,7 +63899,7 @@ 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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); @@ -63848,7 +63933,7 @@ 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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); @@ -63892,7 +63977,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains_methods(v__gen__c__Gen* g string left_type_str = v__gen__c__Gen_typ(g, t); string fn_name = str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = left_type_str}}, {_SLIT("_contains"), 0, { .d_c = 0 }}})); if (left_final_sym->kind == v__ast__Kind__array) { - v__ast__Type elem_type = (/* 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 */ ).elem_type; + v__ast__Type elem_type = (/* as */ *(v__ast__Array*)__as_cast((left_final_sym->info)._v__ast__Array,(left_final_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ).elem_type; string elem_type_str = v__gen__c__Gen_typ(g, elem_type); v__ast__Kind elem_kind = v__ast__Table_sym(g->table, elem_type)->kind; bool elem_is_not_ptr = v__ast__Type_nr_muls(elem_type) == 0; @@ -63929,7 +64014,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_contains_methods(v__gen__c__Gen* g 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 }}}))); } } else if (left_final_sym->kind == v__ast__Kind__array_fixed) { - v__ast__ArrayFixed left_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((left_final_sym->info)._v__ast__ArrayFixed,(left_final_sym->info)._typ, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed left_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((left_final_sym->info)._v__ast__ArrayFixed,(left_final_sym->info)._typ, 480) /*expected idx: 480, name: v.ast.ArrayFixed */ ; int size = left_info.size; v__ast__Type elem_type = left_info.elem_type; string elem_type_str = v__gen__c__Gen_typ(g, elem_type); @@ -64014,7 +64099,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_index_methods(v__gen__c__Gen* g) { 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, /*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 */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((final_left_sym->info)._v__ast__Array,(final_left_sym->info)._typ, 452) /*expected idx: 452, 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) { @@ -64093,7 +64178,7 @@ 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 452) /*expected idx: 452, 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 "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = false;"), 0, { .d_c = 0 }}}))); @@ -64114,12 +64199,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_any(v__gen__c__Gen* g, v__ast__Cal 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 == 284 /* v.ast.AnonFn */) { + if (expr._typ == 285 /* 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, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 306 /* v.ast.Ident */) { + else if (expr._typ == 307 /* 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); @@ -64135,7 +64220,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 == 292 /* v.ast.CallExpr */) { + else if (expr._typ == 293 /* 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); @@ -64176,7 +64261,7 @@ 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 452) /*expected idx: 452, 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 "), /*115 &string*/0xfe10, {.d_s = tmp}}, {_SLIT(" = true;"), 0, { .d_c = 0 }}}))); @@ -64198,12 +64283,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_array_all(v__gen__c__Gen* g, v__ast__Cal 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 == 284 /* v.ast.AnonFn */) { + if (expr._typ == 285 /* 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, /*115 &string*/0xfe10, {.d_s = (*expr._v__ast__AnonFn).decl.name}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); } - else if (expr._typ == 306 /* v.ast.Ident */) { + else if (expr._typ == 307 /* 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*expr._v__ast__Ident).name)}}, {_SLIT("(it)"), 0, { .d_c = 0 }}}))); @@ -64219,7 +64304,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 == 292 /* v.ast.CallExpr */) { + else if (expr._typ == 293 /* 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); @@ -64260,13 +64345,13 @@ 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 == 310 /* v.ast.InfixExpr */) { - Option_v__ast__Expr _t1; + if ((node.expr)._typ == 311 /* 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; (*node.expr._v__ast__InfixExpr).left = subst_expr; } - Option_v__ast__Expr _t2; + _option_v__ast__Expr _t2; if (_t2 = v__gen__c__Gen_assert_subexpression_to_ctemp(g, (*node.expr._v__ast__InfixExpr).right, (*node.expr._v__ast__InfixExpr).right_type), _t2.state == 0) { v__ast__Expr subst_expr = *(v__ast__Expr*)_t2.data; (*node.expr._v__ast__InfixExpr).right = subst_expr; @@ -64303,29 +64388,29 @@ 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 == 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)); +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 == 293 /* v.ast.CallExpr */) { + _option_v__ast__Expr _t1; + opt_ok2(&(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 == 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)); + else if (expr._typ == 322 /* v.ast.ParExpr */) { + if (((*expr._v__ast__ParExpr).expr)._typ == 293 /* v.ast.CallExpr */) { + _option_v__ast__Expr _t2; + opt_ok2(&(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 == 326 /* v.ast.SelectorExpr */) { - if (((*expr._v__ast__SelectorExpr).expr)._typ == 292 /* v.ast.CallExpr */) { + else if (expr._typ == 327 /* v.ast.SelectorExpr */) { + if (((*expr._v__ast__SelectorExpr).expr)._typ == 293 /* 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, 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} }; + if ((/* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, 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} }; } } - Option_v__ast__Expr _t4; - 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__SelectorExpr_to_sumtype_v__ast__Expr(&(*expr._v__ast__SelectorExpr)), expr_type)))) }, (Option*)(&_t4), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t4; + opt_ok2(&(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__SelectorExpr_to_sumtype_v__ast__Expr(&(*expr._v__ast__SelectorExpr)), expr_type)))) }, (_option*)(&_t4), sizeof(v__ast__Expr)); return _t4; } } @@ -64333,7 +64418,7 @@ VV_LOCAL_SYMBOL Option_v__ast__Expr v__gen__c__Gen_assert_subexpression_to_ctemp else { } ; - return (Option_v__ast__Expr){ .state=2, .err=_const_v__gen__c__unsupported_ctemp_assert_transform, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__ast__Expr){ .state=2, .err=_const_v__gen__c__unsupported_ctemp_assert_transform, .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_assert_postfailure_mode(v__gen__c__Gen* g, v__ast__AssertStmt node) { @@ -64361,7 +64446,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ 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"), /*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 */) { + if (node.expr._typ == 311 /* 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))); @@ -64375,7 +64460,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_gen_assert_metainfo(v__gen__c__Gen* g, v__ 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 == 292 /* v.ast.CallExpr */) { + else if (node.expr._typ == 293 /* 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 }}}))); } @@ -64388,37 +64473,37 @@ 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 == 293 /* v.ast.CastExpr */) { + if (expr._typ == 294 /* v.ast.CastExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 307 /* v.ast.IfExpr */) { + else if (expr._typ == 308 /* v.ast.IfExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 309 /* v.ast.IndexExpr */) { + else if (expr._typ == 310 /* v.ast.IndexExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 316 /* v.ast.MatchExpr */) { + else if (expr._typ == 317 /* v.ast.MatchExpr */) { v__gen__c__Gen_write(g, v__gen__c__ctoslit(unknown_value)); } - else if (expr._typ == 323 /* v.ast.PrefixExpr */) { - if (((*expr._v__ast__PrefixExpr).right)._typ == 293 /* v.ast.CastExpr */) { + else if (expr._typ == 324 /* v.ast.PrefixExpr */) { + if (((*expr._v__ast__PrefixExpr).right)._typ == 294 /* 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 == 332 /* v.ast.TypeNode */) { + else if (expr._typ == 333 /* 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, /*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 == 330 /* v.ast.StringLiteral */) { + if (v__ast__Type_alias_eq(typ, _const_v__ast__string_type) && (expr)._typ == 331 /* v.ast.StringLiteral */) { should_clone = false; } - if ((expr)._typ == 291 /* v.ast.CTempVar */) { - if (((*expr._v__ast__CTempVar).orig)._typ == 292 /* v.ast.CallExpr */) { + if ((expr)._typ == 292 /* v.ast.CTempVar */) { + if (((*expr._v__ast__CTempVar).orig)._typ == 293 /* v.ast.CallExpr */) { should_clone = false; if ((*(*expr._v__ast__CTempVar).orig._v__ast__CallExpr).or_block.kind == v__ast__OrKind__propagate_option) { should_clone = true; @@ -64457,23 +64542,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 == 292 /* v.ast.CallExpr */) { + if (right_expr._typ == 293 /* v.ast.CallExpr */) { return_type = (*right_expr._v__ast__CallExpr).return_type; } - else if (right_expr._typ == 314 /* v.ast.LockExpr */) { + else if (right_expr._typ == 315 /* v.ast.LockExpr */) { return_type = (*right_expr._v__ast__LockExpr).typ; } - else if (right_expr._typ == 316 /* v.ast.MatchExpr */) { + else if (right_expr._typ == 317 /* v.ast.MatchExpr */) { return_type = (*right_expr._v__ast__MatchExpr).return_type; } - else if (right_expr._typ == 307 /* v.ast.IfExpr */) { + else if (right_expr._typ == 308 /* 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 == 306 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 326 /* 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 == 307 /* v.ast.Ident */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.left, 0)))._typ == 327 /* v.ast.SelectorExpr */); sref_name = _SLIT(""); type_to_free = _SLIT(""); if (af) { @@ -64483,7 +64568,7 @@ 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 == 306 /* v.ast.Ident */) { + if ((left0)._typ == 307 /* v.ast.Ident */) { if (string__eq((*left0._v__ast__Ident).name, _SLIT("_"))) { ok = false; } @@ -64538,11 +64623,11 @@ string sref_name; bool blank_assign = false; v__ast__Ident ident = ((v__ast__Ident){.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.info = {0},.scope = 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,},.tok_kind = 0,.language = 0,.kind = 0,.comptime = 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 == 306 /* v.ast.Ident */) { + if ((left)->_typ == 307 /* 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 == 416 /* v.ast.IdentVar */) { + if ((left_info)._typ == 417 /* 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); @@ -64551,13 +64636,13 @@ string sref_name; var_type = v__ast__Type_set_flag(var_type, v__ast__TypeFlag__atomic_f); } } - 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 */) { + if (((*left->_v__ast__Ident).obj)._typ == 365 /* v.ast.Var */) { + if ((val)._typ == 299 /* v.ast.ComptimeSelector */) { + if (((*val._v__ast__ComptimeSelector).field_expr)._typ == 327 /* v.ast.SelectorExpr */) { + if (((*(*val._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 307 /* 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}; + _option_v__ast__Type _t1 = {0}; if (_t2) { *((v__ast__Type*)&_t1.data) = *((v__ast__Type*)_t2); } else { @@ -64573,10 +64658,10 @@ string sref_name; (*(*left->_v__ast__Ident).obj._v__ast__Var).typ = var_type; } } - } else if ((val)._typ == 297 /* v.ast.ComptimeCall */) { + } else if ((val)._typ == 298 /* 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}; + _option_v__ast__Type _t3 = {0}; if (_t4) { *((v__ast__Type*)&_t3.data) = *((v__ast__Type*)_t4); } else { @@ -64597,19 +64682,19 @@ 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 == 286 /* v.ast.ArrayInit */) { + if (val._typ == 287 /* 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 == 292 /* v.ast.CallExpr */) { + else if (val._typ == 293 /* v.ast.CallExpr */) { is_call = true; return_type = (*val._v__ast__CallExpr).return_type; } - else if (val._typ == 284 /* v.ast.AnonFn */) { + else if (val._typ == 285 /* v.ast.AnonFn */) { if (blank_assign) { v__gen__c__Gen_write(g, _SLIT("{")); } - if ((is_decl || blank_assign) && (left)->_typ == 306 /* v.ast.Ident */) { + if ((is_decl || blank_assign) && (left)->_typ == 307 /* 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, /*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; @@ -64622,7 +64707,7 @@ string sref_name; v__gen__c__Gen_expr(g, *left); g->is_assign_lhs = false; g->is_arraymap_set = false; - if ((left)->_typ == 309 /* v.ast.IndexExpr */) { + if ((left)->_typ == 310 /* 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); @@ -64646,14 +64731,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 != 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; + bool is_fixed_array_var = unaliased_right_sym->kind == v__ast__Kind__array_fixed && (val)._typ != 287 /* v.ast.ArrayInit */ && (((val)._typ == 307 /* v.ast.Ident */ || (val)._typ == 310 /* v.ast.IndexExpr */ || (val)._typ == 293 /* v.ast.CallExpr */ || (val)._typ == 327 /* v.ast.SelectorExpr */) || ((val)._typ == 294 /* v.ast.CastExpr */ && ((/* as */ *(v__ast__CastExpr*)__as_cast((val)._v__ast__CastExpr,(val)._typ, 294) /*expected idx: 294, name: v.ast.CastExpr */ ).expr)._typ != 287 /* 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 == 309 /* v.ast.IndexExpr */) { + if ((val)._typ == 310 /* v.ast.IndexExpr */) { g->assign_op = v__token__Kind__decl_assign; } g->is_assign_lhs = false; @@ -64669,17 +64754,17 @@ string sref_name; 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 == 306 /* 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 == 307 /* 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, 286) /*expected idx: 286, name: v.ast.ArrayInit */ ; + v__ast__ArrayInit right = /* as */ *(v__ast__ArrayInit*)__as_cast((val)._v__ast__ArrayInit,(val)._typ, 287) /*expected idx: 287, 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, /*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, 306) /*expected idx: 306, name: v.ast.Ident */ ; + v__ast__Ident right = /* as */ *(v__ast__Ident*)__as_cast((val)._v__ast__Ident,(val)._typ, 307) /*expected idx: 307, name: v.ast.Ident */ ; v_var = right.name; } int pos = g->out.len; @@ -64716,7 +64801,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 == 309 /* v.ast.IndexExpr */) { + if ((left)->_typ == 310 /* v.ast.IndexExpr */) { v__gen__c__Gen_expr(g, *left); v__gen__c__Gen_write(g, _SLIT("string__plus(")); } else { @@ -64748,8 +64833,8 @@ 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, 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; + if (left_sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left_sym->info)._v__ast__Struct,(left_sym->info)._typ, 457) /*expected idx: 457, 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, 457) /*expected idx: 457, 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(" = "), /*115 &string*/0xfe10, {.d_s = method_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); @@ -64767,7 +64852,7 @@ string sref_name; return; } else { 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); + _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 `"), /*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); @@ -64785,7 +64870,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, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((right_sym->info)._v__ast__FnType,(right_sym->info)._typ, 484) /*expected idx: 484, 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(""); @@ -64816,14 +64901,14 @@ 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 == 456 /* v.ast.Struct */) { + if ((val_sym->info)._typ == 457 /* v.ast.Struct */) { if ((*val_sym->info._v__ast__Struct).generic_types.len > 0) { - if ((val)._typ == 331 /* v.ast.StructInit */) { + if ((val)._typ == 332 /* 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, /*115 &string*/0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); is_used_var_styp = true; - } 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 */) { + } else if ((val)._typ == 324 /* v.ast.PrefixExpr */) { + if ((*val._v__ast__PrefixExpr).op == v__token__Kind__amp && ((*val._v__ast__PrefixExpr).right)._typ == 332 /* 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, /*115 &string*/0xfe10, {.d_s = var_styp}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); is_used_var_styp = true; @@ -64839,7 +64924,7 @@ string sref_name; } } } - if ((left)->_typ == 306 /* v.ast.Ident */ || (left)->_typ == 326 /* v.ast.SelectorExpr */) { + if ((left)->_typ == 307 /* v.ast.Ident */ || (left)->_typ == 327 /* v.ast.SelectorExpr */) { g->prevent_sum_type_unwrapping_once = true; } if (!is_fixed_array_var || is_decl) { @@ -64889,7 +64974,7 @@ string sref_name; 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 == 286 /* v.ast.ArrayInit */) { + if ((val)._typ == 287 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*val._v__ast__ArrayInit), ident.name); } else { v__gen__c__Gen_write(g, _SLIT("{0}")); @@ -64901,7 +64986,7 @@ string sref_name; if (v__ast__Expr_is_auto_deref_var(val)) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((val)._typ == 286 /* v.ast.ArrayInit */) { + if ((val)._typ == 287 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*val._v__ast__ArrayInit), ident.name); } else { v__gen__c__Gen_expr(g, val); @@ -64957,12 +65042,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_multi_return_assign(v__gen__c__Gen* g, v v__ast__Expr lx = ((v__ast__Expr*)node->left.data)[i]; bool is_auto_heap = false; v__ast__Ident ident = ((v__ast__Ident){.obj = {0},.mod = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.info = {0},.scope = 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,},.tok_kind = 0,.language = 0,.kind = 0,.comptime = 0,.is_mut = 0,}); - if ((lx)._typ == 306 /* v.ast.Ident */) { + if ((lx)._typ == 307 /* 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 == 364 /* v.ast.Var */) { + if (((*lx._v__ast__Ident).obj)._typ == 365 /* v.ast.Var */) { is_auto_heap = (*(*lx._v__ast__Ident).obj._v__ast__Var).is_auto_heap; } } @@ -65021,26 +65106,26 @@ 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 == 306 /* v.ast.Ident */) { + if (left._typ == 307 /* 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, 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_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, 484) /*expected idx: 484, 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, /*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 == 309 /* v.ast.IndexExpr */) { + else if (left._typ == 310 /* 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 452) /*expected idx: 452, 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, 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_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, 484) /*expected idx: 484, 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); @@ -65061,7 +65146,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, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 453) /*expected idx: 453, 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); @@ -65069,7 +65154,7 @@ 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, 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_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, 484) /*expected idx: 484, 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, /*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 }}}))); @@ -65091,7 +65176,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_cross_var_assign(v__gen__c__Gen* g, v__a } } } - else if (left._typ == 326 /* v.ast.SelectorExpr */) { + else if (left._typ == 327 /* 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, /*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); @@ -65114,11 +65199,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 == 306 /* v.ast.Ident */) { + if (val._typ == 307 /* 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 == 306 /* v.ast.Ident */) { + if ((lx)._typ == 307 /* 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)); @@ -65131,7 +65216,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.IndexExpr */) { + else if (val._typ == 310 /* 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]; @@ -65146,9 +65231,9 @@ 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 == 310 /* v.ast.InfixExpr */) { + else if (val._typ == 311 /* v.ast.InfixExpr */) { v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, (*val._v__ast__InfixExpr).left_type); - Option_v__ast__Fn _t3; + _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) { string left_styp = v__gen__c__Gen_typ(g, v__ast__Type_set_nr_muls((*val._v__ast__InfixExpr).left_type, 0)); v__gen__c__Gen_write(g, left_styp); @@ -65166,15 +65251,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 == 323 /* v.ast.PrefixExpr */) { + else if (val._typ == 324 /* 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 == 322 /* v.ast.PostfixExpr */) { + else if (val._typ == 323 /* 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 == 326 /* v.ast.SelectorExpr */) { + else if (val._typ == 327 /* 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]; @@ -65381,7 +65466,7 @@ 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, 471) /*expected idx: 471, name: v.ast.Alias */ ; + v__ast__Alias info = /* as */ *(v__ast__Alias*)__as_cast((left.sym->info)._v__ast__Alias,(left.sym->info)._typ, 472) /*expected idx: 472, 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 "), /*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 }}}))); @@ -65547,7 +65632,7 @@ 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, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__ast__FnType func = /* as */ *(v__ast__FnType*)__as_cast((value.sym->info)._v__ast__FnType,(value.sym->info)._typ, 484) /*expected idx: 484, 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"), /*115 &string*/0xfe10, {.d_s = ret_styp}}, {_SLIT(" (*v) ("), 0, { .d_c = 0 }}}))); int arg_len = func.func.params.len; @@ -65682,7 +65767,7 @@ strings__Builder fn_builder; 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_"), /*115 &string*/0xfe10, {.d_s = ptr_styp}}, {_SLIT("(a._typ);"), 0, { .d_c = 0 }}}))); - if ((info)._typ == 474 /* v.ast.Interface */) { + if ((info)._typ == 475 /* 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 == "), /*100 &int*/0xfe07, {.d_i32 = v__ast__Type_idx(typ)}}, {_SLIT(") {"), 0, { .d_c = 0 }}}))); @@ -65738,7 +65823,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 == 471 /* v.ast.Alias */) { + if ((sym->info)._typ == 472 /* 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); } @@ -65779,7 +65864,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 == 471 /* v.ast.Alias */) { + if ((sym->info)._typ == 472 /* 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); } @@ -65788,13 +65873,13 @@ 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 == 456 /* v.ast.Struct */) { + if (sym->info._typ == 457 /* 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 == 451 /* v.ast.Array */) { + else if (sym->info._typ == 452 /* 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 == 452 /* v.ast.Map */) { + else if (sym->info._typ == 453 /* v.ast.Map */) { v__gen__c__Gen_gen_free_for_map(g, (*sym->info._v__ast__Map), styp, fn_name); } @@ -66181,13 +66266,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 == 471 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { + if ((sym->info)._typ == 472 /* 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 == 456 /* v.ast.Struct */) { + if (v__ast__TypeSymbol_has_method_with_generic_parent(sym, _SLIT("str")) && (sym->info)._typ == 457 /* 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,}) })); @@ -66214,44 +66299,44 @@ 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_result(g, typ.typ, styp, str_fn_name); return; } - if (sym->info._typ == 471 /* v.ast.Alias */) { + if (sym->info._typ == 472 /* 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 == 451 /* v.ast.Array */) { + else if (sym->info._typ == 452 /* 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 == 479 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 480 /* 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 == 485 /* v.ast.Enum */) { + else if (sym->info._typ == 486 /* 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 == 483 /* v.ast.FnType */) { + else if (sym->info._typ == 484 /* 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 == 456 /* v.ast.Struct */) { + else if (sym->info._typ == 457 /* 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 == 452 /* v.ast.Map */) { + else if (sym->info._typ == 453 /* 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 == 482 /* v.ast.MultiReturn */) { + else if (sym->info._typ == 483 /* 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 == 475 /* v.ast.SumType */) { + else if (sym->info._typ == 476 /* 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 == 474 /* v.ast.Interface */) { + else if (sym->info._typ == 475 /* 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 == 480 /* v.ast.Chan */) { + else if (sym->info._typ == 481 /* 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 == 481 /* v.ast.Thread */) { + else if (sym->info._typ == 482 /* v.ast.Thread */) { v__gen__c__Gen_gen_str_for_thread(g, (*sym->info._v__ast__Thread), styp, str_fn_name); } @@ -66597,7 +66682,7 @@ 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 == 471 /* v.ast.Alias */) { + if ((sym->info)._typ == 472 /* v.ast.Alias */) { typ = (*sym->info._v__ast__Alias).parent_type; sym = v__ast__Table_sym(g->table, typ); } @@ -66672,7 +66757,7 @@ 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 == 471 /* v.ast.Alias */) { + if ((sym->info)._typ == 472 /* v.ast.Alias */) { typ = (*sym->info._v__ast__Alias).parent_type; sym = v__ast__Table_sym(g->table, typ); } @@ -66735,7 +66820,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 == 471 /* v.ast.Alias */) { + if ((key_sym->info)._typ == 472 /* v.ast.Alias */) { key_typ = (*key_sym->info._v__ast__Alias).parent_type; key_sym = v__ast__Table_sym(g->table, key_typ); } @@ -66746,7 +66831,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 == 471 /* v.ast.Alias */) { + if ((val_sym->info)._typ == 472 /* v.ast.Alias */) { val_typ = (*val_sym->info._v__ast__Alias).parent_type; val_sym = v__ast__Table_sym(g->table, val_typ); } @@ -66919,7 +67004,7 @@ strings__Builder fn_body; string _t2; /* if prepend */ if (sym_has_str_method) { 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 */) { + if ((sym->info)._typ == 457 /* 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; @@ -67231,7 +67316,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre for (int _t4 = 0; _t4 < _t3.len; ++_t4) { v__gen__c__Gen* g = ((v__gen__c__Gen**)_t3.data)[_t4]; _PUSH_MANY(&global_g.embedded_files, (g->embedded_files), _t5, Array_v__ast__EmbeddedFile); - Option_int _t6 = strings__Builder_write(&global_g.out, g->out); + _option_int _t6 = strings__Builder_write(&global_g.out, g->out); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; _v_panic(IError_str(err)); @@ -67240,7 +67325,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t6.data); - Option_int _t7 = strings__Builder_write(&global_g.cheaders, g->cheaders); + _option_int _t7 = strings__Builder_write(&global_g.cheaders, g->cheaders); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; _v_panic(IError_str(err)); @@ -67249,7 +67334,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t7.data); - Option_int _t8 = strings__Builder_write(&global_g.includes, g->includes); + _option_int _t8 = strings__Builder_write(&global_g.includes, g->includes); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; _v_panic(IError_str(err)); @@ -67258,7 +67343,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t8.data); - Option_int _t9 = strings__Builder_write(&global_g.typedefs, g->typedefs); + _option_int _t9 = strings__Builder_write(&global_g.typedefs, g->typedefs); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; _v_panic(IError_str(err)); @@ -67267,7 +67352,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t9.data); - Option_int _t10 = strings__Builder_write(&global_g.type_definitions, g->type_definitions); + _option_int _t10 = strings__Builder_write(&global_g.type_definitions, g->type_definitions); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; _v_panic(IError_str(err)); @@ -67276,7 +67361,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t10.data); - Option_int _t11 = strings__Builder_write(&global_g.alias_definitions, g->alias_definitions); + _option_int _t11 = strings__Builder_write(&global_g.alias_definitions, g->alias_definitions); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; _v_panic(IError_str(err)); @@ -67285,7 +67370,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t11.data); - Option_int _t12 = strings__Builder_write(&global_g.definitions, g->definitions); + _option_int _t12 = strings__Builder_write(&global_g.definitions, g->definitions); if (_t12.state != 0) { /*or block*/ IError err = _t12.err; _v_panic(IError_str(err)); @@ -67294,7 +67379,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t12.data); - Option_int _t13 = strings__Builder_write(&global_g.gowrappers, g->gowrappers); + _option_int _t13 = strings__Builder_write(&global_g.gowrappers, g->gowrappers); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; _v_panic(IError_str(err)); @@ -67303,7 +67388,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t13.data); - Option_int _t14 = strings__Builder_write(&global_g.stringliterals, g->stringliterals); + _option_int _t14 = strings__Builder_write(&global_g.stringliterals, g->stringliterals); if (_t14.state != 0) { /*or block*/ IError err = _t14.err; _v_panic(IError_str(err)); @@ -67312,7 +67397,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t14.data); - Option_int _t15 = strings__Builder_write(&global_g.auto_str_funcs, g->auto_str_funcs); + _option_int _t15 = strings__Builder_write(&global_g.auto_str_funcs, g->auto_str_funcs); if (_t15.state != 0) { /*or block*/ IError err = _t15.err; _v_panic(IError_str(err)); @@ -67321,7 +67406,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t15.data); - Option_int _t16 = strings__Builder_write(&global_g.dump_funcs, g->auto_str_funcs); + _option_int _t16 = strings__Builder_write(&global_g.dump_funcs, g->auto_str_funcs); if (_t16.state != 0) { /*or block*/ IError err = _t16.err; _v_panic(IError_str(err)); @@ -67330,7 +67415,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t16.data); - Option_int _t17 = strings__Builder_write(&global_g.comptime_definitions, g->comptime_definitions); + _option_int _t17 = strings__Builder_write(&global_g.comptime_definitions, g->comptime_definitions); if (_t17.state != 0) { /*or block*/ IError err = _t17.err; _v_panic(IError_str(err)); @@ -67339,7 +67424,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t17.data); - Option_int _t18 = strings__Builder_write(&global_g.pcs_declarations, g->pcs_declarations); + _option_int _t18 = strings__Builder_write(&global_g.pcs_declarations, g->pcs_declarations); if (_t18.state != 0) { /*or block*/ IError err = _t18.err; _v_panic(IError_str(err)); @@ -67348,7 +67433,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t18.data); - Option_int _t19 = strings__Builder_write(&global_g.hotcode_definitions, g->hotcode_definitions); + _option_int _t19 = strings__Builder_write(&global_g.hotcode_definitions, g->hotcode_definitions); if (_t19.state != 0) { /*or block*/ IError err = _t19.err; _v_panic(IError_str(err)); @@ -67357,7 +67442,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t19.data); - Option_int _t20 = strings__Builder_write(&global_g.embedded_data, g->embedded_data); + _option_int _t20 = strings__Builder_write(&global_g.embedded_data, g->embedded_data); if (_t20.state != 0) { /*or block*/ IError err = _t20.err; _v_panic(IError_str(err)); @@ -67366,7 +67451,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t20.data); - Option_int _t21 = strings__Builder_write(&global_g.shared_types, g->shared_types); + _option_int _t21 = strings__Builder_write(&global_g.shared_types, g->shared_types); if (_t21.state != 0) { /*or block*/ IError err = _t21.err; _v_panic(IError_str(err)); @@ -67375,7 +67460,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t21.data); - Option_int _t22 = strings__Builder_write(&global_g.shared_functions, g->channel_definitions); + _option_int _t22 = strings__Builder_write(&global_g.shared_functions, g->channel_definitions); if (_t22.state != 0) { /*or block*/ IError err = _t22.err; _v_panic(IError_str(err)); @@ -67488,7 +67573,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre bool v = (*(bool*)DenseArray_value(&_t47.key_values, _t48)); map_set(&global_g.sumtype_definitions, &(int[]){k}, &(bool[]) { v }); } - Option_int _t51 = strings__Builder_write(&global_g.json_forward_decls, g->json_forward_decls); + _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)); @@ -67497,7 +67582,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(&global_g.enum_typedefs, g->enum_typedefs); + _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)); @@ -67506,7 +67591,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(&global_g.channel_definitions, g->channel_definitions); + _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)); @@ -67515,7 +67600,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(int*)_t53.data); - Option_int _t54 = strings__Builder_write(&global_g.sql_buf, g->sql_buf); + _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)); @@ -67524,7 +67609,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(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); + _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)); @@ -67533,7 +67618,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(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); + _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)); @@ -67542,7 +67627,7 @@ string v__gen__c__gen(Array_v__ast__File_ptr files, v__ast__Table* table, v__pre } (*(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); + _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)); @@ -68168,7 +68253,7 @@ 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, 475) /*expected idx: 475, name: v.ast.SumType */ ; + v__ast__SumType sum_info = /* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 476) /*expected idx: 476, name: v.ast.SumType */ ; if (sum_info.is_generic) { continue; } @@ -68217,10 +68302,10 @@ void v__gen__c__Gen_write_typeof_functions(v__gen__c__Gen* g) { } v__gen__c__Gen_writeln(g, _SLIT("}")); } else if (sym->kind == v__ast__Kind__interface_) { - if ((sym->info)._typ != 474 /* v.ast.Interface */) { + if ((sym->info)._typ != 475 /* v.ast.Interface */) { continue; } - 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 */ ; + v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((sym->info)._v__ast__Interface,(sym->info)._typ, 475) /*expected idx: 475, name: v.ast.Interface */ ; if (inter_info.is_generic) { continue; } @@ -68335,7 +68420,7 @@ 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_"), /*115 &string*/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")); } @@ -68366,18 +68451,18 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_result_type_text(v__gen__c__Gen* g, string } VV_LOCAL_SYMBOL string v__gen__c__Gen_register_optional(v__gen__c__Gen* g, v__ast__Type t) { - 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; + multi_return_string_string mr_37846 = v__gen__c__Gen_optional_type_name(g, t); + string styp = mr_37846.arg0; + string base = mr_37846.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; + multi_return_string_string mr_37979 = v__gen__c__Gen_result_type_name(g, t); + string styp = mr_37979.arg0; + string base = mr_37979.arg1; map_set(&g->results, &(string[]){base}, &(string[]) { styp }); string _t1 = styp; return _t1; @@ -68581,14 +68666,14 @@ 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_"), /*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 }}}))); + strings__Builder_writeln(&g->channel_definitions, str_intp(7, _MOV((StrIntpData[]){{_SLIT("\nstatic inline "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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 ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_void){ .state = 2, .err = _v_error(_SLIT(\"channel closed\")), .data = {EMPTY_STRUCT_INITIALIZATION} };\n }\n return ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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 == 456 /* v.ast.Struct */) { + if (sym->info._typ == 457 /* 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) { @@ -68599,7 +68684,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type ty styp = /*f*/string__plus(styp, sgtyps); } } - else if (sym->info._typ == 474 /* v.ast.Interface */) { + else if (sym->info._typ == 475 /* 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) { @@ -68610,7 +68695,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_cc_type(v__gen__c__Gen* g, v__ast__Type ty styp = /*f*/string__plus(styp, sgtyps); } } - else if (sym->info._typ == 475 /* v.ast.SumType */) { + else if (sym->info._typ == 476 /* 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) { @@ -68628,7 +68713,7 @@ 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ; if (!info.is_typedef) { styp = str_intp(2, _MOV((StrIntpData[]){{_SLIT("struct "), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT0, 0, { .d_c = 0 }}})); } @@ -68657,20 +68742,20 @@ 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 452) /*expected idx: 452, 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 "), /*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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, 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 == 483 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 484 /* 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); @@ -68732,7 +68817,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 == 456 /* v.ast.Struct */) { + if ((parent->info)._typ == 457 /* v.ast.Struct */) { is_typedef = (*parent->info._v__ast__Struct).is_typedef; } string parent_styp = parent->cname; @@ -68743,10 +68828,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 == 471 /* v.ast.Alias */) { + if ((sym.info)._typ == 472 /* 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 == 479 /* v.ast.ArrayFixed */) { + if ((parent_sym->info)._typ == 480 /* 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; @@ -68770,10 +68855,10 @@ void v__gen__c__Gen_write_interface_typedef(v__gen__c__Gen* g, v__ast__TypeSymbo } void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v__ast__TypeSymbol sym) { - if ((sym.info)._typ != 474 /* v.ast.Interface */) { + if ((sym.info)._typ != 475 /* v.ast.Interface */) { return; } - 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 */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((sym.info)._v__ast__Interface,(sym.info)._typ, 475) /*expected idx: 475, name: v.ast.Interface */ ; if (info.is_generic) { return; } @@ -68802,7 +68887,7 @@ void v__gen__c__Gen_write_interface_typesymbol_declaration(v__gen__c__Gen* g, v_ } 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, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym.info)._v__ast__FnType,(sym.info)._typ, 484) /*expected idx: 484, name: v.ast.FnType */ ; v__ast__Fn func = info.func; bool is_fn_sig = (func.name).len == 0; bool not_anon = !info.is_anon; @@ -68939,7 +69024,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 == 292 /* v.ast.CallExpr */) { + if ((expr)._typ == 293 /* v.ast.CallExpr */) { bool _t1 = (*expr._v__ast__CallExpr).is_noreturn; return _t1; } @@ -68958,8 +69043,8 @@ 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 == 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 */) { + if ((stmt)._typ == 347 /* v.ast.ExprStmt */) { + if ((*stmt._v__ast__ExprStmt).typ == _const_v__ast__error_type_idx || ((*stmt._v__ast__ExprStmt).expr)._typ == 319 /* 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); @@ -68975,16 +69060,16 @@ 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(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok2(&("), /*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*)(&"), /*115 &string*/0xfe10, {.d_s = tmp_var}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" }, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("*)(&"), /*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 == 346 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 347 /* v.ast.ExprStmt */) { is_noreturn = v__gen__c__is_noreturn_callexpr((*stmt._v__ast__ExprStmt).expr); } if (!is_noreturn) { @@ -68997,7 +69082,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 == 346 /* v.ast.ExprStmt */) { + if ((g->inside_if_optional || g->inside_match_optional) && (stmt)._typ == 347 /* v.ast.ExprStmt */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } @@ -69013,13 +69098,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 != 219 /* v.ast.FnDecl */ && g->inside_ternary == 0) { + if ((stmt)._typ != 220 /* v.ast.FnDecl */ && g->inside_ternary == 0) { v__token__Pos stmt_pos = (*(stmt.pos)); if (stmt_pos.pos == 0) { - if ((stmt)._typ == 356 /* v.ast.Module */) { + if ((stmt)._typ == 357 /* v.ast.Module */) { return; } - if ((stmt)._typ == 346 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 347 /* v.ast.ExprStmt */) { stmt_pos = v__ast__Expr_pos((*stmt._v__ast__ExprStmt).expr); } if (stmt_pos.pos == 0) { @@ -69044,21 +69129,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 == 344 /* v.ast.EmptyStmt */) { + if (node._typ == 345 /* v.ast.EmptyStmt */) { } - else if (node._typ == 336 /* v.ast.AsmStmt */) { + else if (node._typ == 337 /* 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 == 337 /* v.ast.AssertStmt */) { + else if (node._typ == 338 /* 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 == 338 /* v.ast.AssignStmt */) { + else if (node._typ == 339 /* 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 == 339 /* v.ast.Block */) { + else if (node._typ == 340 /* 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")); @@ -69068,11 +69153,11 @@ 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 == 340 /* v.ast.BranchStmt */) { + else if (node._typ == 341 /* 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})); - Option_v__ast__Stmt_ptr _t1 = {0}; + _option_v__ast__Stmt_ptr _t1 = {0}; if (_t2) { *((v__ast__Stmt**)&_t1.data) = *((v__ast__Stmt**)_t2); } else { @@ -69087,17 +69172,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } v__ast__Stmt* x = *(v__ast__Stmt**)_t1.data; - if (x->_typ == 347 /* v.ast.ForCStmt */) { + if (x->_typ == 348 /* 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 == 348 /* v.ast.ForInStmt */) { + else if (x->_typ == 349 /* 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 == 349 /* v.ast.ForStmt */) { + else if (x->_typ == 350 /* 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); } @@ -69113,17 +69198,17 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } } else { v__ast__Stmt* inner_loop = g->inner_loop; - if (inner_loop->_typ == 347 /* v.ast.ForCStmt */) { + if (inner_loop->_typ == 348 /* 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 == 348 /* v.ast.ForInStmt */) { + else if (inner_loop->_typ == 349 /* 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 == 349 /* v.ast.ForStmt */) { + else if (inner_loop->_typ == 350 /* 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); } @@ -69139,64 +69224,40 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { 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 == 342 /* v.ast.ConstDecl */) { + else if (node._typ == 343 /* 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 == 341 /* v.ast.ComptimeFor */) { + else if (node._typ == 342 /* v.ast.ComptimeFor */) { v__gen__c__Gen_comptime_for(g, (*node._v__ast__ComptimeFor)); } - else if (node._typ == 343 /* v.ast.DeferStmt */) { + else if (node._typ == 344 /* 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, /*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 == 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 {")); - string cur_enum_expr = _SLIT(""); - 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"), /*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); - strings__Builder_write_string(&g->enum_typedefs, expr_str); - cur_enum_expr = expr_str; - 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 << "), /*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, /*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("} "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); + else if (node._typ == 346 /* v.ast.EnumDecl */) { + v__gen__c__Gen_enum_decl(g, (*node._v__ast__EnumDecl)); } - else if (node._typ == 346 /* v.ast.ExprStmt */) { + else if (node._typ == 347 /* 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 != 316 /* 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 != 317 /* 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 != 307 /* 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 != 308 /* v.ast.IfExpr */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } - else if (node._typ == 219 /* v.ast.FnDecl */) { + else if (node._typ == 220 /* v.ast.FnDecl */) { v__gen__c__Gen_fn_decl(g, (*node._v__ast__FnDecl)); } - else if (node._typ == 347 /* v.ast.ForCStmt */) { + else if (node._typ == 348 /* 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; @@ -69210,7 +69271,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 == 348 /* v.ast.ForInStmt */) { + else if (node._typ == 349 /* 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; @@ -69224,7 +69285,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 == 349 /* v.ast.ForStmt */) { + else if (node._typ == 350 /* 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; @@ -69238,17 +69299,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 == 350 /* v.ast.GlobalDecl */) { + else if (node._typ == 351 /* v.ast.GlobalDecl */) { v__gen__c__Gen_global_decl(g, (*node._v__ast__GlobalDecl)); } - else if (node._typ == 351 /* v.ast.GotoLabel */) { + else if (node._typ == 352 /* 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 == 352 /* v.ast.GotoStmt */) { + else if (node._typ == 353 /* 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 "), /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name((*node._v__ast__GotoStmt).name)}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 353 /* v.ast.HashStmt */) { + else if (node._typ == 354 /* 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) { @@ -69316,11 +69377,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } } } - else if (node._typ == 354 /* v.ast.Import */) { + else if (node._typ == 355 /* v.ast.Import */) { } - else if (node._typ == 355 /* v.ast.InterfaceDecl */) { + else if (node._typ == 356 /* 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, 474) /*expected idx: 474, name: v.ast.Interface */ ).is_generic) { + if (!(/* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 475) /*expected idx: 475, 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)) { @@ -69332,19 +69393,19 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { } } } - else if (node._typ == 356 /* v.ast.Module */) { + else if (node._typ == 357 /* 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 == 317 /* v.ast.NodeError */) { + else if (node._typ == 318 /* v.ast.NodeError */) { } - else if (node._typ == 357 /* v.ast.Return */) { + else if (node._typ == 358 /* v.ast.Return */) { v__gen__c__Gen_return_stmt(g, (*node._v__ast__Return)); } - else if (node._typ == 358 /* v.ast.SqlStmt */) { + else if (node._typ == 359 /* v.ast.SqlStmt */) { v__gen__c__Gen_sql_stmt(g, (*node._v__ast__SqlStmt)); } - else if (node._typ == 359 /* v.ast.StructDecl */) { + else if (node._typ == 360 /* 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; @@ -69355,7 +69416,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_stmt(v__gen__c__Gen* g, v__ast__Stmt node) { 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 == 283 /* v.ast.TypeDecl */) { + else if (node._typ == 284 /* v.ast.TypeDecl */) { if (!g->pref->skip_unused) { v__gen__c__Gen_writeln(g, _SLIT("// TypeDecl")); } @@ -69365,7 +69426,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 != 219 /* v.ast.FnDecl */) { + if ((node)._typ != 220 /* v.ast.FnDecl */) { } } } @@ -69438,18 +69499,18 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_sumtype_casting_fn(v__gen__c__Gen* g, 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 ("), /*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]; + for (int _t3 = 0; _t3 < (/* as */ *(v__ast__SumType*)__as_cast((exp_sym->info)._v__ast__SumType,(exp_sym->info)._typ, 476) /*expected idx: 476, 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, 476) /*expected idx: 476, 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); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t4 = v__ast__Table_find_field_from_embeds(g->table, got_sym, field.name); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t4.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - 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; + multi_return_v__ast__StructField_Array_v__ast__Type mr_66722 = (*(multi_return_v__ast__StructField_Array_v__ast__Type*)_t4.data); + Array_v__ast__Type embed_types = mr_66722.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, /*115 &string*/0xfe10, {.d_s = v__ast__TypeSymbol_embed_name(embed_sym)}}, {_SLIT("_ptr"), 0, { .d_c = 0 }}})); @@ -69474,7 +69535,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_cfn_for_casting_expr(v__gen__c__Gen* g, } 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 == 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))) { + if (!v__ast__Expr_is_lvalue(expr) || ((expr)._typ == 307 /* v.ast.Ident */ && v__ast__ScopeObject_is_simple_define_const((/* as */ *(v__ast__Ident*)__as_cast((expr)._v__ast__Ident,(expr)._typ, 307) /*expected idx: 307, 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, /*115 &string*/0xfe10, {.d_s = promotion_macro_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = got_styp}}, {_SLIT(", ("), 0, { .d_c = 0 }}}))); rparen_n += 2; @@ -69502,8 +69563,8 @@ 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 == 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)) { + if ((exp_sym->info)._typ == 475 /* 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 == 332 /* 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; @@ -69543,16 +69604,16 @@ 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 == 306 /* v.ast.Ident */) { - Option_v__ast__Var_ptr _t1; + if ((expr)._typ == 307 /* 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; if (v->smartcasts.len > 0) { is_already_sum_type = true; } } - } else if ((expr)._typ == 326 /* v.ast.SelectorExpr */) { - Option_v__ast__ScopeStructField _t2; + } else if ((expr)._typ == 327 /* 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; } @@ -69561,7 +69622,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 == 469 /* v.ast.Aggregate */) { + if ((unwrapped_got_sym->info)._typ == 470 /* 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); } @@ -69599,20 +69660,20 @@ 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 != 310 /* v.ast.InfixExpr */) { + if (got_is_ptr && !expected_is_ptr && neither_void && exp_sym->kind != v__ast__Kind__placeholder && (expr)._typ != 311 /* 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)); bool got_is_opt = v__ast__Type_has_flag(got_type, v__ast__TypeFlag__optional); - if (deref_will_match || got_is_opt || v__ast__Expr_is_auto_deref_var(expr)) { + if (deref_will_match || got_is_opt || v__ast__Expr_is_auto_deref_var(expr) || v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__generic)) { v__gen__c__Gen_write(g, _SLIT("*")); } } - if (v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional) && (expr)._typ == 318 /* v.ast.None */) { + if (v__ast__Type_has_flag(expected_type, v__ast__TypeFlag__optional) && (expr)._typ == 319 /* v.ast.None */) { v__gen__c__Gen_gen_optional_error(g, expected_type, expr); return; } - if ((expr)._typ == 311 /* v.ast.IntegerLiteral */) { + if ((expr)._typ == 312 /* 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")); @@ -69696,7 +69757,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 == 361 /* 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 == 362 /* v.ast.AsmRegister */) { v__gen__c__Gen_write(g, _SLIT("*")); } v__gen__c__Gen_asm_arg(g, arg, stmt); @@ -69748,7 +69809,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 == 437 /* v.ast.AsmAlias */) { + if (arg._typ == 438 /* 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}; @@ -69783,29 +69844,29 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar 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 == 295 /* v.ast.CharLiteral */) { + else if (arg._typ == 296 /* 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 == 311 /* v.ast.IntegerLiteral */) { + else if (arg._typ == 312 /* 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 == 304 /* v.ast.FloatLiteral */) { + else if (arg._typ == 305 /* v.ast.FloatLiteral */) { if (g->pref->nofloat) { 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("$"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__FloatLiteral).val}}, {_SLIT0, 0, { .d_c = 0 }}}))); } } - else if (arg._typ == 290 /* v.ast.BoolLiteral */) { + else if (arg._typ == 291 /* 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 == 361 /* v.ast.AsmRegister */) { + else if (arg._typ == 362 /* 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("%"), /*115 &string*/0xfe10, {.d_s = (*arg._v__ast__AsmRegister).name}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (arg._typ == 436 /* v.ast.AsmAddressing */) { + else if (arg._typ == 437 /* v.ast.AsmAddressing */) { if (((*arg._v__ast__AsmAddressing).segment).len != 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 }}}))); } @@ -69836,10 +69897,10 @@ 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 == 438 /* v.ast.AsmDisp */) { + if ((displacement)._typ == 439 /* v.ast.AsmDisp */) { v__gen__c__Gen_asm_arg(g, displacement, stmt); v__gen__c__Gen_write(g, _SLIT("(, ")); - } else if ((displacement)._typ == 361 /* v.ast.AsmRegister */) { + } else if ((displacement)._typ == 362 /* 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(",")); @@ -69888,7 +69949,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_asm_arg(v__gen__c__Gen* g, v__ast__AsmArg ar } ; } - else if (arg._typ == 438 /* v.ast.AsmDisp */) { + else if (arg._typ == 439 /* v.ast.AsmDisp */) { v__gen__c__Gen_write(g, (*arg._v__ast__AsmDisp).val); } else if (arg._typ == 20 /* string */) { @@ -69958,7 +70019,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 != 306 /* v.ast.Ident */ && (val)._typ != 326 /* v.ast.SelectorExpr */) { + if ((val)._typ != 307 /* v.ast.Ident */ && (val)._typ != 327 /* v.ast.SelectorExpr */) { bool _t1 = false; return _t1; } @@ -69977,7 +70038,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_gen_clone_assignment(v__gen__c__Gen* g, v__a 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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(", "), /*100 &int*/0xfe07, {.d_i32 = array_depth}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); if (v__ast__Type_share(typ) == v__ast__ShareType__shared_t) { @@ -70027,7 +70088,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 == 364 /* v.ast.Var */) { + if (obj._typ == 365 /* v.ast.Var */) { ; if (string__eq((*obj._v__ast__Var).name, g->returned_var_name)) { ; @@ -70083,7 +70144,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 == 330 /* v.ast.StringLiteral */) { + if (v.expr._typ == 331 /* v.ast.StringLiteral */) { ; } @@ -70251,36 +70312,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 == 299 /* v.ast.ComptimeType */) { + if (node._typ == 300 /* v.ast.ComptimeType */) { v__gen__c__Gen_error(g, _SLIT("g.expr(): Unhandled ComptimeType"), (*node._v__ast__ComptimeType).pos); VUNREACHABLE(); } - else if (node._typ == 302 /* v.ast.EmptyExpr */) { + else if (node._typ == 303 /* 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 == 284 /* v.ast.AnonFn */) { + else if (node._typ == 285 /* v.ast.AnonFn */) { v__gen__c__Gen_gen_anon_fn(g, (voidptr)&/*qq*/(*node._v__ast__AnonFn)); } - else if (node._typ == 285 /* v.ast.ArrayDecompose */) { + else if (node._typ == 286 /* v.ast.ArrayDecompose */) { v__gen__c__Gen_expr(g, (*node._v__ast__ArrayDecompose).expr); } - else if (node._typ == 286 /* v.ast.ArrayInit */) { + else if (node._typ == 287 /* v.ast.ArrayInit */) { v__gen__c__Gen_array_init(g, (*node._v__ast__ArrayInit), _SLIT("")); } - else if (node._typ == 287 /* v.ast.AsCast */) { + else if (node._typ == 288 /* v.ast.AsCast */) { v__gen__c__Gen_as_cast(g, (*node._v__ast__AsCast)); } - else if (node._typ == 288 /* v.ast.Assoc */) { + else if (node._typ == 289 /* v.ast.Assoc */) { v__gen__c__Gen_assoc(g, (*node._v__ast__Assoc)); } - else if (node._typ == 289 /* v.ast.AtExpr */) { + else if (node._typ == 290 /* v.ast.AtExpr */) { v__gen__c__Gen_comptime_at(g, (*node._v__ast__AtExpr)); } - else if (node._typ == 290 /* v.ast.BoolLiteral */) { + else if (node._typ == 291 /* v.ast.BoolLiteral */) { v__gen__c__Gen_write(g, bool_str((*node._v__ast__BoolLiteral).val)); } - else if (node._typ == 292 /* v.ast.CallExpr */) { + else if (node._typ == 293 /* 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)) { @@ -70308,10 +70369,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) 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 == 293 /* v.ast.CastExpr */) { + else if (node._typ == 294 /* v.ast.CastExpr */) { v__gen__c__Gen_cast_expr(g, (*node._v__ast__CastExpr)); } - else if (node._typ == 294 /* v.ast.ChanInit */) { + else if (node._typ == 295 /* 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"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); @@ -70324,52 +70385,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 == 295 /* v.ast.CharLiteral */) { + else if (node._typ == 296 /* v.ast.CharLiteral */) { v__gen__c__Gen_char_literal(g, (*node._v__ast__CharLiteral)); } - else if (node._typ == 296 /* v.ast.Comment */) { + else if (node._typ == 297 /* v.ast.Comment */) { } - else if (node._typ == 297 /* v.ast.ComptimeCall */) { + else if (node._typ == 298 /* v.ast.ComptimeCall */) { v__gen__c__Gen_comptime_call(g, (voidptr)&/*qq*/(*node._v__ast__ComptimeCall)); } - else if (node._typ == 298 /* v.ast.ComptimeSelector */) { + else if (node._typ == 299 /* v.ast.ComptimeSelector */) { v__gen__c__Gen_comptime_selector(g, (*node._v__ast__ComptimeSelector)); } - else if (node._typ == 300 /* v.ast.ConcatExpr */) { + else if (node._typ == 301 /* v.ast.ConcatExpr */) { v__gen__c__Gen_concat_expr(g, (*node._v__ast__ConcatExpr)); } - else if (node._typ == 291 /* v.ast.CTempVar */) { + else if (node._typ == 292 /* v.ast.CTempVar */) { v__gen__c__Gen_write(g, (*node._v__ast__CTempVar).name); } - else if (node._typ == 301 /* v.ast.DumpExpr */) { + else if (node._typ == 302 /* v.ast.DumpExpr */) { v__gen__c__Gen_dump_expr(g, (*node._v__ast__DumpExpr)); } - else if (node._typ == 303 /* v.ast.EnumVal */) { + else if (node._typ == 304 /* v.ast.EnumVal */) { v__gen__c__Gen_enum_val(g, (*node._v__ast__EnumVal)); } - else if (node._typ == 304 /* v.ast.FloatLiteral */) { + else if (node._typ == 305 /* 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 == 305 /* v.ast.GoExpr */) { + else if (node._typ == 306 /* v.ast.GoExpr */) { v__gen__c__Gen_go_expr(g, (*node._v__ast__GoExpr)); } - else if (node._typ == 306 /* v.ast.Ident */) { + else if (node._typ == 307 /* v.ast.Ident */) { v__gen__c__Gen_ident(g, (*node._v__ast__Ident)); } - else if (node._typ == 307 /* v.ast.IfExpr */) { + else if (node._typ == 308 /* v.ast.IfExpr */) { v__gen__c__Gen_if_expr(g, (*node._v__ast__IfExpr)); } - else if (node._typ == 308 /* v.ast.IfGuardExpr */) { + else if (node._typ == 309 /* v.ast.IfGuardExpr */) { v__gen__c__Gen_write(g, _SLIT("/* guard */")); } - else if (node._typ == 309 /* v.ast.IndexExpr */) { + else if (node._typ == 310 /* v.ast.IndexExpr */) { v__gen__c__Gen_index_expr(g, (*node._v__ast__IndexExpr)); } - else if (node._typ == 310 /* v.ast.InfixExpr */) { + else if (node._typ == 311 /* 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)); @@ -70378,7 +70439,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 == 311 /* v.ast.IntegerLiteral */) { + else if (node._typ == 312 /* 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)); @@ -70389,7 +70450,7 @@ 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 == 312 /* v.ast.IsRefType */) { + else if (node._typ == 313 /* 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); @@ -70400,7 +70461,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) 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*/ "), /*115 &bool*/0xfe10, {.d_s = is_ref_type ? _SLIT("true") : _SLIT("false")}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - else if (node._typ == 313 /* v.ast.Likely */) { + else if (node._typ == 314 /* v.ast.Likely */) { if ((*node._v__ast__Likely).is_likely) { v__gen__c__Gen_write(g, _SLIT("_likely_")); } else { @@ -70410,32 +70471,32 @@ 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 == 314 /* v.ast.LockExpr */) { + else if (node._typ == 315 /* v.ast.LockExpr */) { v__gen__c__Gen_lock_expr(g, (*node._v__ast__LockExpr)); } - else if (node._typ == 315 /* v.ast.MapInit */) { + else if (node._typ == 316 /* v.ast.MapInit */) { v__gen__c__Gen_map_init(g, (*node._v__ast__MapInit)); } - else if (node._typ == 316 /* v.ast.MatchExpr */) { + else if (node._typ == 317 /* v.ast.MatchExpr */) { v__gen__c__Gen_match_expr(g, (*node._v__ast__MatchExpr)); } - else if (node._typ == 317 /* v.ast.NodeError */) { + else if (node._typ == 318 /* v.ast.NodeError */) { } - else if (node._typ == 318 /* v.ast.None */) { + else if (node._typ == 319 /* v.ast.None */) { v__gen__c__Gen_write(g, _SLIT("_const_none__")); } - else if (node._typ == 319 /* v.ast.OffsetOf */) { + else if (node._typ == 320 /* 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("), /*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 == 320 /* v.ast.OrExpr */) { + else if (node._typ == 321 /* v.ast.OrExpr */) { } - else if (node._typ == 321 /* v.ast.ParExpr */) { + else if (node._typ == 322 /* 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 == 322 /* v.ast.PostfixExpr */) { + else if (node._typ == 323 /* 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(&"), /*115 &string*/0xfe10, {.d_s = (*node._v__ast__PostfixExpr).auto_locked}}, {_SLIT("->mtx);"), 0, { .d_c = 0 }}}))); } @@ -70454,7 +70515,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_expr(v__gen__c__Gen* g, v__ast__Expr node_) 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 == 323 /* v.ast.PrefixExpr */) { + else if (node._typ == 324 /* 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; @@ -70462,7 +70523,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, 480) /*expected idx: 480, 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, 481) /*expected idx: 481, 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 */ @@ -70501,27 +70562,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 == 324 /* v.ast.RangeExpr */) { + else if (node._typ == 325 /* v.ast.RangeExpr */) { } - else if (node._typ == 325 /* v.ast.SelectExpr */) { + else if (node._typ == 326 /* v.ast.SelectExpr */) { v__gen__c__Gen_select_expr(g, (*node._v__ast__SelectExpr)); } - else if (node._typ == 326 /* v.ast.SelectorExpr */) { + else if (node._typ == 327 /* v.ast.SelectorExpr */) { v__gen__c__Gen_selector_expr(g, (*node._v__ast__SelectorExpr)); } - else if (node._typ == 327 /* v.ast.SizeOf */) { + else if (node._typ == 328 /* v.ast.SizeOf */) { v__gen__c__Gen_size_of(g, (*node._v__ast__SizeOf)); } - else if (node._typ == 328 /* v.ast.SqlExpr */) { + else if (node._typ == 329 /* v.ast.SqlExpr */) { v__gen__c__Gen_sql_select_expr(g, (*node._v__ast__SqlExpr)); } - else if (node._typ == 330 /* v.ast.StringLiteral */) { + else if (node._typ == 331 /* v.ast.StringLiteral */) { v__gen__c__Gen_string_literal(g, (*node._v__ast__StringLiteral)); } - else if (node._typ == 329 /* v.ast.StringInterLiteral */) { + else if (node._typ == 330 /* v.ast.StringInterLiteral */) { v__gen__c__Gen_string_inter_literal(g, (*node._v__ast__StringInterLiteral)); } - else if (node._typ == 331 /* v.ast.StructInit */) { + else if (node._typ == 332 /* 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 { @@ -70530,16 +70591,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 == 332 /* v.ast.TypeNode */) { + else if (node._typ == 333 /* 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, /*115 &string*/0xfe10, {.d_s = sidx}}, {_SLIT(" /* "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); } - else if (node._typ == 333 /* v.ast.TypeOf */) { + else if (node._typ == 334 /* v.ast.TypeOf */) { v__gen__c__Gen_typeof_expr(g, (*node._v__ast__TypeOf)); } - else if (node._typ == 334 /* v.ast.UnsafeExpr */) { + else if (node._typ == 335 /* v.ast.UnsafeExpr */) { v__gen__c__Gen_expr(g, (*node._v__ast__UnsafeExpr).expr); } ; @@ -70574,9 +70635,9 @@ 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, 483) /*expected idx: 483, 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, 484) /*expected idx: 484, 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, 483) /*expected idx: 483, 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, 484) /*expected idx: 484, name: v.ast.FnType */ ); } } else { s = v__ast__Table_type_to_str(g->table, v__gen__c__Gen_unwrap_generic(g, typ)); @@ -70592,11 +70653,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_typeof_expr(v__gen__c__Gen* g, v__ast__TypeO 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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed fixed_info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, 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(\"["), /*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, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__ast__FnType info = /* as */ *(v__ast__FnType*)__as_cast((sym->info)._v__ast__FnType,(sym->info)._typ, 484) /*expected idx: 484, 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)); @@ -70624,13 +70685,13 @@ 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 == 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 */) { + if ((node.expr)._typ == 334 /* v.ast.TypeOf */) { + if (((*node.expr._v__ast__TypeOf).expr)._typ == 299 /* v.ast.ComptimeSelector */) { + if (((*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr)._typ == 327 /* v.ast.SelectorExpr */) { + if (((*(*(*node.expr._v__ast__TypeOf).expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 307 /* 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}; + _option_v__ast__Type _t1 = {0}; if (_t2) { *((v__ast__Type*)&_t1.data) = *((v__ast__Type*)_t2); } else { @@ -70661,7 +70722,7 @@ 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 == 306 /* v.ast.Ident */ && v__ast__Type_has_flag(node.expr_type, v__ast__TypeFlag__optional); + bool is_optional = (node.expr)._typ == 307 /* 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("(*("), /*115 &string*/0xfe10, {.d_s = opt_base_typ}}, {_SLIT("*)"), 0, { .d_c = 0 }}}))); @@ -70674,7 +70735,7 @@ 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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, 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")))) { @@ -70685,14 +70746,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel } string sum_type_deref_field = _SLIT(""); string sum_type_dot = _SLIT("."); - Option_v__ast__StructField _t3; + _option_v__ast__StructField _t3; if (_t3 = v__ast__Table_find_field(g->table, sym, node.field_name), _t3.state == 0) { v__ast__StructField f = *(v__ast__StructField*)_t3.data; v__ast__TypeSymbol* field_sym = v__ast__Table_sym(g->table, f.typ); if (field_sym->kind == v__ast__Kind__sum_type || field_sym->kind == v__ast__Kind__interface_) { if (!prevent_sum_type_unwrapping_once) { v__ast__Scope* scope = v__ast__Scope_innermost(g->file->scope, node.pos.pos); - Option_v__ast__ScopeStructField _t4; + _option_v__ast__ScopeStructField _t4; if (_t4 = v__ast__Scope_find_struct_field(scope, v__ast__Expr_str(node.expr), node.expr_type, node.field_name), _t4.state == 0) { v__ast__ScopeStructField field = *(v__ast__ScopeStructField*)_t4.data; if (v__ast__Type_is_ptr(field.orig_type)) { @@ -70709,7 +70770,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_selector_expr(v__gen__c__Gen* g, v__ast__Sel 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(")"), /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT0, 0, { .d_c = 0 }}}))); } - if ((cast_sym->info)._typ == 469 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 470 /* 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("_"), /*115 &string*/0xfe10, {.d_s = agg_sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { @@ -70732,7 +70793,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 == 456 /* v.ast.Struct */ || (sym->info)._typ == 469 /* v.ast.Aggregate */) { + if ((sym->info)._typ == 457 /* v.ast.Struct */ || (sym->info)._typ == 470 /* 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); @@ -70768,8 +70829,36 @@ 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_decl(v__gen__c__Gen* g, v__ast__EnumDecl node) { + string enum_name = v__util__no_dots(node.name); + bool is_flag = node.is_flag; + strings__Builder_writeln(&g->enum_typedefs, _SLIT("typedef enum {")); + string cur_enum_expr = _SLIT(""); + int cur_enum_offset = 0; + for (int i = 0; i < node.fields.len; ++i) { + v__ast__EnumField field = ((v__ast__EnumField*)node.fields.data)[i]; + 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); + strings__Builder_write_string(&g->enum_typedefs, expr_str); + cur_enum_expr = expr_str; + 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 << "), /*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, /*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("} "), /*115 &string*/0xfe10, {.d_s = enum_name}}, {_SLIT(";\n"), 0, { .d_c = 0 }}}))); +} + VV_LOCAL_SYMBOL void v__gen__c__Gen_enum_expr(v__gen__c__Gen* g, v__ast__Expr node) { - if (node._typ == 303 /* v.ast.EnumVal */) { + if (node._typ == 304 /* v.ast.EnumVal */) { v__gen__c__Gen_write(g, (*node._v__ast__EnumVal).val); } @@ -70894,11 +70983,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_106768 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); - string hash_fn = mr_106768.arg0; - string key_eq_fn = mr_106768.arg1; - string clone_fn = mr_106768.arg2; - string free_fn = mr_106768.arg3; + multi_return_string_string_string_string mr_106889 = v__gen__c__Gen_map_fn_ptrs(g, *key_sym); + string hash_fn = mr_106889.arg0; + string key_eq_fn = mr_106889.arg1; + string clone_fn = mr_106889.arg2; + string free_fn = mr_106889.arg3; int size = node.vals.len; string shared_styp = _SLIT(""); string styp = _SLIT(""); @@ -70993,12 +71082,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, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ).expr; + timeout_expr = (/* as */ *(v__ast__ExprStmt*)__as_cast((branch.stmt)._v__ast__ExprStmt,(branch.stmt)._typ, 347) /*expected idx: 347, name: v.ast.ExprStmt */ ).expr; } else { - 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 */ ; + if (branch.stmt._typ == 347 /* 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, 311) /*expected idx: 311, name: v.ast.InfixExpr */ ; array_push((array*)&channels, _MOV((v__ast__Expr[]){ expr.left })); - 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 */) { + if ((expr.right)._typ == 307 /* v.ast.Ident */ || (expr.right)._typ == 310 /* v.ast.IndexExpr */ || (expr.right)._typ == 327 /* v.ast.SelectorExpr */ || (expr.right)._typ == 332 /* 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("")) })); @@ -71011,8 +71100,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_select_expr(v__gen__c__Gen* g, v__ast__Selec } array_push((array*)&is_push, _MOV((bool[]){ true })); } - 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 */ ; + else if (branch.stmt._typ == 339 /* 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, 324) /*expected idx: 324, 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)))) { @@ -71137,7 +71226,7 @@ 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 == 416 /* v.ast.IdentVar */) { + if ((node_info)._typ == 417 /* 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); @@ -71149,7 +71238,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) return; } v__ast__ScopeObject v = node.obj; - if ((v)._typ == 364 /* v.ast.Var */) { + if ((v)._typ == 365 /* 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("(*(")); @@ -71174,7 +71263,7 @@ 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 == 469 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 470 /* 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, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { @@ -71192,9 +71281,9 @@ 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 == 415 /* v.ast.IdentFn */) { + } else if ((node_info)._typ == 416 /* v.ast.IdentFn */) { if (g->pref->translated || g->file->is_translated) { - Option_v__ast__Fn _t2; + _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t2.data; if (Array_v__ast__Attr_contains(f.attrs, _SLIT("c"))) { @@ -71206,7 +71295,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_ident(v__gen__c__Gen* g, v__ast__Ident node) string key = node.name; v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf identfn: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t4 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); - Option_string _t3 = {0}; + _option_string _t3 = {0}; if (_t4) { *((string*)&_t3.data) = *((string*)_t4); } else { @@ -71233,7 +71322,7 @@ 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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, 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("*(("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" *)(&"), 0, { .d_c = 0 }}}))); v__gen__c__Gen_expr(g, node.expr); @@ -71250,10 +71339,10 @@ 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, 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))) { + 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, 472) /*expected idx: 472, 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, 472) /*expected idx: 472, 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 == 318 /* v.ast.None */) { + if (v__ast__Type_has_flag(node.typ, v__ast__TypeFlag__optional) && (node.expr)._typ == 319 /* 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("("), /*115 &string*/0xfe10, {.d_s = cast_label}}, {_SLIT("("), 0, { .d_c = 0 }}}))); @@ -71264,7 +71353,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 == 311 /* v.ast.IntegerLiteral */) { + if ((node.expr)._typ == 312 /* 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")); @@ -71303,7 +71392,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 == 292 /* v.ast.CallExpr */) { + if ((expr)._typ == 293 /* 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; } @@ -71331,7 +71420,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 == 297 /* v.ast.ComptimeCall */) { + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 298 /* 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 @@ -71370,9 +71459,9 @@ 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 == 318 /* v.ast.None */; + bool optional_none = ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 319 /* 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")); + 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); @@ -71445,7 +71534,7 @@ 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 == 307 /* v.ast.IfExpr */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 316 /* v.ast.MatchExpr */)) { + if (node.exprs.len == 1 && (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 308 /* v.ast.IfExpr */ || ((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 317 /* 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(";")); @@ -71459,12 +71548,12 @@ 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, 482) /*expected idx: 482, 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, 483) /*expected idx: 483, name: v.ast.MultiReturn */ ; string styp = _SLIT(""); 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(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("/*X*/[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok2(&("), /*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, /*115 &string*/0xfe10, {.d_s = ret_typ}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); @@ -71479,7 +71568,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; 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, 292) /*expected idx: 292, name: v.ast.CallExpr */ ; + v__ast__CallExpr c = /* as */ *(v__ast__CallExpr*)__as_cast((expr)._v__ast__CallExpr,(expr)._typ, 293) /*expected idx: 293, 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)) { @@ -71525,7 +71614,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; } v__gen__c__Gen_write(g, _SLIT("}")); 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_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" }, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_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_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("return "), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT0, 0, { .d_c = 0 }}}))); } @@ -71547,7 +71636,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; 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 == 292 /* v.ast.CallExpr */) { + if (expr0._typ == 293 /* 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; } @@ -71555,12 +71644,12 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; _t1 = v__ast__Type_has_flag((*(v__ast__Type*)/*ee elem_sym */array_get(node.types, 0)), v__ast__TypeFlag__optional); } bool expr_type_is_opt = _t1; - if (fn_return_is_optional && !expr_type_is_opt && !string__eq(return_sym->name, _SLIT("Option"))) { + if (fn_return_is_optional && !expr_type_is_opt && !string__eq(return_sym->name, _const_v__gen__c__option_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(2, _MOV((StrIntpData[]){{_SLIT("opt_ok(&("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("[]) { "), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("opt_ok2(&("), /*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)) { + if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 307 /* v.ast.Ident */ && !g->is_amp)) { v__gen__c__Gen_write(g, _SLIT("*")); } } @@ -71571,7 +71660,7 @@ 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*)(&"), /*115 &string*/0xfe10, {.d_s = tmpvar}}, {_SLIT("), sizeof("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("));"), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_writeln(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT(" }, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_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 }}}))); @@ -71583,7 +71672,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; return; } bool _t2 = 0; - if (expr0._typ == 292 /* v.ast.CallExpr */) { + if (expr0._typ == 293 /* 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; } @@ -71596,7 +71685,7 @@ bool v__gen__c__Gen_return_stmt_defer_0 = false; 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)) { + if (!(((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ == 307 /* v.ast.Ident */ && !g->is_amp)) { v__gen__c__Gen_write(g, _SLIT("*")); } } @@ -71620,13 +71709,13 @@ 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 == 306 /* v.ast.Ident */) { + if ((expr)._typ == 307 /* 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 != 306 /* v.ast.Ident */ || use_tmp_var) { + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(node.exprs, 0)))._typ != 307 /* 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; @@ -71691,7 +71780,7 @@ 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 == 286 /* v.ast.ArrayInit */) { + if (field.expr._typ == 287 /* 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) { @@ -71704,14 +71793,14 @@ bool v__gen__c__Gen_const_decl_defer_0 = false; v__gen__c__Gen_const_decl_init_later(g, field.mod, name, field.expr, field.typ, false); } } - else if (field.expr._typ == 330 /* v.ast.StringLiteral */) { + else if (field.expr._typ == 331 /* 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"), /*115 &string*/0xfe10, {.d_s = const_name}}, {_SLIT(" = "), /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); } } - else if (field.expr._typ == 292 /* v.ast.CallExpr */) { + else if (field.expr._typ == 293 /* 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; @@ -71725,7 +71814,7 @@ bool v__gen__c__Gen_const_decl_defer_0 = false; else { bool use_cache_mode = g->pref->build_mode == v__pref__BuildMode__build_module || g->pref->use_cache; if (!use_cache_mode) { - Option_v__ast__ComptTimeConstValue _t2; + _option_v__ast__ComptTimeConstValue _t2; if (_t2 = v__ast__ConstField_comptime_expr_value(&field), _t2.state == 0) { v__ast__ComptTimeConstValue ct_value = *(v__ast__ComptTimeConstValue*)_t2.data; if (v__gen__c__Gen_const_decl_precomputed(g, field.mod, name, ct_value, field.typ)) { @@ -71815,7 +71904,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_const_decl_precomputed(v__gen__c__Gen* g, st 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 == 302 /* v.ast.EmptyExpr */) { + else if (ct_value._typ == 303 /* v.ast.EmptyExpr */) { bool _t4 = false; return _t4; } @@ -71837,8 +71926,15 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_const_decl_simple_define(v__gen__c__Gen* g, } else { x = str_intp(2, _MOV((StrIntpData[]){{_SLIT("_const_"), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT0, 0, { .d_c = 0 }}})); } - strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define "), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + if (g->pref->translated) { + strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("const int "), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT(" = "), 0, { .d_c = 0 }}}))); + } else { + strings__Builder_write_string(&g->definitions, str_intp(2, _MOV((StrIntpData[]){{_SLIT("#define "), /*115 &string*/0xfe10, {.d_s = x}}, {_SLIT(" "), 0, { .d_c = 0 }}}))); + } strings__Builder_writeln(&g->definitions, val); + if (g->pref->translated) { + strings__Builder_write_string(&g->definitions, _SLIT(";")); + } } 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) { @@ -71895,7 +71991,7 @@ 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 == 284 /* v.ast.AnonFn */) { + if (field.has_expr && (anon_fn_expr)._typ == 285 /* 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, /*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 }}}))); @@ -71938,7 +72034,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_assoc(v__gen__c__Gen* g, v__ast__Assoc node) 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, 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); @@ -72013,7 +72109,7 @@ bool v__gen__c__Gen_write_init_function_defer_0 = false; 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, /*115 &string*/0xfe10, {.d_s = mod_name}}, {_SLIT(".init"), 0, { .d_c = 0 }}})); - Option_v__ast__Fn _t2; + _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) { @@ -72114,7 +72210,7 @@ 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 == 456 /* v.ast.Struct */) { + if (sym->info._typ == 457 /* v.ast.Struct */) { if ((*sym->info._v__ast__Struct).is_generic) { continue; } @@ -72145,9 +72241,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ for (int _t3 = 0; _t3 < (*sym->info._v__ast__Struct).fields.len; ++_t3) { v__ast__StructField field = ((v__ast__StructField*)(*sym->info._v__ast__Struct).fields.data)[_t3]; if (v__ast__Type_has_flag(field.typ, v__ast__TypeFlag__optional)) { - multi_return_string_string mr_146502 = v__gen__c__Gen_optional_type_name(g, field.typ); - string styp = mr_146502.arg0; - string base = mr_146502.arg1; + multi_return_string_string mr_146797 = v__gen__c__Gen_optional_type_name(g, field.typ); + string styp = mr_146797.arg0; + string base = mr_146797.arg1; sync__RwMutex_lock(&g->done_optionals->mtx); /*lock*/ { if (!Array_string_contains(g->done_optionals->val, base)) { @@ -72170,7 +72266,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ size_suffix = _SLIT(" : 1"); } else { v__ast__TypeSymbol* field_sym = v__ast__Table_sym(g->table, field.typ); - if ((field_sym->info)._typ == 485 /* v.ast.Enum */) { + if ((field_sym->info)._typ == 486 /* v.ast.Enum */) { if (!(*field_sym->info._v__ast__Enum).is_flag && !(*field_sym->info._v__ast__Enum).uses_exprs) { int bits_needed = 0; int l = (*field_sym->info._v__ast__Enum).vals.len; @@ -72193,9 +72289,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ 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 == 471 /* v.ast.Alias */) { + else if (sym->info._typ == 472 /* v.ast.Alias */) { } - else if (sym->info._typ == 481 /* v.ast.Thread */) { + else if (sym->info._typ == 482 /* 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 "), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); @@ -72211,7 +72307,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ } } } - else if (sym->info._typ == 475 /* v.ast.SumType */) { + else if (sym->info._typ == 476 /* v.ast.SumType */) { if ((*sym->info._v__ast__SumType).is_generic) { continue; } @@ -72241,7 +72337,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_write_types(v__gen__c__Gen* g, Array_v__ast_ strings__Builder_writeln(&g->type_definitions, _SLIT("};")); strings__Builder_writeln(&g->type_definitions, _SLIT("")); } - else if (sym->info._typ == 479 /* v.ast.ArrayFixed */) { + else if (sym->info._typ == 480 /* 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; @@ -72253,7 +72349,7 @@ 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 == 483 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 484 /* 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); @@ -72289,13 +72385,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 == 479 /* v.ast.ArrayFixed */) { + if (sym->info._typ == 480 /* 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 == 456 /* v.ast.Struct */) { + else if (sym->info._typ == 457 /* 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; @@ -72315,7 +72411,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 == 471 /* v.ast.Alias */) { + if ((fsym->info)._typ == 472 /* 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; @@ -72412,21 +72508,19 @@ bool v__gen__c__Gen_or_block_defer_0 = false; 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 == 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)) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 347 /* 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, 347) /*expected idx: 347, 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, 346) /*expected idx: 346, name: v.ast.ExprStmt */ ; + v__ast__ExprStmt expr_stmt = /* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 347) /*expected idx: 347, 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("*("), /*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)); g->inside_opt_data = old_inside_opt_data; - if (g->inside_ternary == 0) { - v__gen__c__Gen_writeln(g, _SLIT(";")); - } + v__gen__c__Gen_writeln(g, _SLIT(";")); array_delete_last(&g->stmt_path_pos); } else { v__gen__c__Gen_stmt(g, stmt); @@ -72435,7 +72529,7 @@ 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 == 346 /* v.ast.ExprStmt */) { + if (stmts.len > 0 && ((*(v__ast__Stmt*)array_last(stmts)))._typ == 347 /* v.ast.ExprStmt */) { v__gen__c__Gen_writeln(g, _SLIT(";")); } } @@ -72444,11 +72538,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false; if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) { string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { - multi_return_int_string_string_string mr_156325 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_156325.arg0; - string pafile = mr_156325.arg1; - string pamod = mr_156325.arg2; - string pafn = mr_156325.arg3; + multi_return_int_string_string_string mr_156580 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_156580.arg0; + string pafile = mr_156580.arg1; + string pamod = mr_156580.arg2; + string pafn = mr_156580.arg3; v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); } else { v__gen__c__Gen_writeln(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\tpanic_optional_not_set( "), /*115 &string*/0xfe10, {.d_s = err_msg}}, {_SLIT(" );"), 0, { .d_c = 0 }}}))); @@ -72471,11 +72565,11 @@ bool v__gen__c__Gen_or_block_defer_0 = false; if (string__eq(g->file->mod.name, _SLIT("main")) && (isnil(g->fn_decl) || g->fn_decl->is_main)) { string err_msg = str_intp(3, _MOV((StrIntpData[]){{_SLIT("IError_name_table["), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._typ]._method_msg("), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err._object)"), 0, { .d_c = 0 }}})); if (g->pref->is_debug) { - multi_return_int_string_string_string mr_157592 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); - int paline = mr_157592.arg0; - string pafile = mr_157592.arg1; - string pamod = mr_157592.arg2; - string pafn = mr_157592.arg3; + multi_return_int_string_string_string mr_157847 = v__gen__c__Gen_panic_debug_info(g, or_block.pos); + int paline = mr_157847.arg0; + string pafile = mr_157847.arg1; + string pamod = mr_157847.arg2; + string pafn = mr_157847.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 }}}))); @@ -72548,7 +72642,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, 471) /*expected idx: 471, 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, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type); return _t6; break; } @@ -72585,11 +72679,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_160202 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); - string hash_fn = mr_160202.arg0; - string key_eq_fn = mr_160202.arg1; - string clone_fn = mr_160202.arg2; - string free_fn = mr_160202.arg3; + multi_return_string_string_string_string mr_160457 = v__gen__c__Gen_map_fn_ptrs(g, *key_typ); + string hash_fn = mr_160457.arg0; + string key_eq_fn = mr_160457.arg1; + string clone_fn = mr_160457.arg2; + string free_fn = mr_160457.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(""))); @@ -72616,7 +72710,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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, 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) { @@ -72635,7 +72729,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_type_default(v__gen__c__Gen* g, v__ast__Ty } 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 == 456 /* v.ast.Struct */ && field_sym->language == v__ast__Language__v) { + if ((field_sym->info)._typ == 457 /* 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}"); } @@ -72774,7 +72868,7 @@ 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 == 475 /* v.ast.SumType */) { + if ((expr_type_sym->info)._typ == 476 /* 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 */ *("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("*)__as_cast("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_write(g, _SLIT("(")); @@ -72804,7 +72898,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_as_cast(v__gen__c__Gen* g, v__ast__AsCast no } 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, 474) /*expected idx: 474, 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, 475) /*expected idx: 475, 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)) })); @@ -72875,10 +72969,10 @@ 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 != 474 /* v.ast.Interface */) { + if ((isym->info)._typ != 475 /* v.ast.Interface */) { continue; } - 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 */ ; + v__ast__Interface inter_info = /* as */ *(v__ast__Interface*)__as_cast((isym->info)._v__ast__Interface,(isym->info)._typ, 475) /*expected idx: 475, name: v.ast.Interface */ ; if (inter_info.is_generic) { continue; } @@ -72936,7 +73030,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { 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; + _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."), /*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 { @@ -72948,7 +73042,7 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { for (int _t5 = 0; _t5 < v__ast__TypeSymbol_struct_info(st_sym).embeds.len; ++_t5) { v__ast__Type embed_type = ((v__ast__Type*)v__ast__TypeSymbol_struct_info(st_sym).embeds.data)[_t5]; v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, embed_type); - Option_v__ast__StructField _t6; + _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, "), /*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; @@ -73007,13 +73101,13 @@ 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 == 456 /* v.ast.Struct */) { + if (st_sym->info._typ == 457 /* 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) { v__ast__Fn method = ((v__ast__Fn*)parent_sym->methods.data)[_t12]; if (_IN_MAP(ADDR(string, method.name), ADDR(map, methodidx))) { - Option_v__ast__Fn _t14 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); + _option_v__ast__Fn _t14 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); if (_t14.state != 0) { /*or block*/ IError err = _t14.err; continue; @@ -73024,13 +73118,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } } } - else if (st_sym->info._typ == 474 /* v.ast.Interface */) { + else if (st_sym->info._typ == 475 /* 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) { v__ast__Fn method = ((v__ast__Fn*)parent_sym->methods.data)[_t15]; if (_IN_MAP(ADDR(string, method.name), ADDR(map, methodidx))) { - Option_v__ast__Fn _t17 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); + _option_v__ast__Fn _t17 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); if (_t17.state != 0) { /*or block*/ IError err = _t17.err; continue; @@ -73041,13 +73135,13 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { } } } - else if (st_sym->info._typ == 475 /* v.ast.SumType */) { + else if (st_sym->info._typ == 476 /* 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) { v__ast__Fn method = ((v__ast__Fn*)parent_sym->methods.data)[_t18]; if (_IN_MAP(ADDR(string, method.name), ADDR(map, methodidx))) { - Option_v__ast__Fn _t20 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); + _option_v__ast__Fn _t20 = v__ast__TypeSymbol_find_method_with_generic_parent(st_sym, method.name); if (_t20.state != 0) { /*or block*/ IError err = _t20.err; continue; @@ -73084,13 +73178,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 == 456 /* v.ast.Struct */) { + if (parent_sym->info._typ == 457 /* 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 == 474 /* v.ast.Interface */) { + else if (parent_sym->info._typ == 475 /* 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 == 475 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 476 /* v.ast.SumType */) { name = v__gen__c__Gen_generic_fn_name(g, (*parent_sym->info._v__ast__SumType).concrete_types, method.name, false); } @@ -73101,7 +73195,7 @@ 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 == 456 /* v.ast.Struct */) { + if ((st_sym->info)._typ == 457 /* 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); } @@ -73115,8 +73209,8 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { int params_start_pos = g->out.len; Array_v__ast__Param params = array_clone_to_depth(&method.params, 0); array_set(¶ms, 0, &(v__ast__Param[]) { ((v__ast__Param){(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).name,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).pos,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).type_pos,.typ = v__ast__Type_set_nr_muls(st, 1),(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_mut,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_auto_rec,(*(v__ast__Param*)/*ee elem_sym */array_get(params, 0)).is_hidden,}) }); - multi_return_Array_string_Array_string_Array_bool mr_174684 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); - Array_string fargs = mr_174684.arg0; + multi_return_Array_string_Array_string_Array_bool mr_174939 = v__gen__c__Gen_fn_decl_params(g, params, ((voidptr)(0)), false); + Array_string fargs = mr_174939.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__")); @@ -73127,14 +73221,14 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_interface_table(v__gen__c__Gen* g) { if (!v__ast__Type_alias_eq(method.return_type, _const_v__ast__void_type)) { strings__Builder_write_string(&methods_wrapper, _SLIT("return ")); } - Option_multi_return_v__ast__Fn_Array_v__ast__Type _t26 = v__ast__Table_find_method_from_embeds(g->table, st_sym, method.name); + _option_multi_return_v__ast__Fn_Array_v__ast__Type _t26 = v__ast__Table_find_method_from_embeds(g->table, st_sym, method.name); if (_t26.state != 0) { /*or block*/ IError err = _t26.err; *(multi_return_v__ast__Fn_Array_v__ast__Type*) _t26.data = (multi_return_v__ast__Fn_Array_v__ast__Type){.arg0=((v__ast__Fn){.params = __new_array(0, 0, sizeof(v__ast__Param)),.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type = 0,.receiver_type = 0,.usages = 0,.ctdefine_idx = 0,.source_fn = 0,.language = 0,.file_mode = 0,.is_variadic = 0,.is_pub = 0,.is_ctor_new = 0,.is_deprecated = 0,.is_noreturn = 0,.is_unsafe = 0,.is_placeholder = 0,.is_main = 0,.is_test = 0,.is_keep_alive = 0,.is_method = 0,.no_body = 0,.is_conditional = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; } - multi_return_v__ast__Fn_Array_v__ast__Type mr_175148 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); - Array_v__ast__Type embed_types = mr_175148.arg1; + multi_return_v__ast__Fn_Array_v__ast__Type mr_175403 = (*(multi_return_v__ast__Fn_Array_v__ast__Type*)_t26.data); + Array_v__ast__Type embed_types = mr_175403.arg1; if (embed_types.len > 0 && !Array_string_contains(method_names, method.name)) { v__ast__TypeSymbol* embed_sym = v__ast__Table_sym(g->table, (*(v__ast__Type*)array_last(embed_types))); string method_name = str_intp(3, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = embed_sym->cname}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = method.name}}, {_SLIT0, 0, { .d_c = 0 }}})); @@ -73272,7 +73366,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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym->info)._v__ast__Array,(sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ; int _t1 = 1 + v__gen__c__Gen_get_array_depth(g, info.elem_type); return _t1; } else { @@ -73319,14 +73413,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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, 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)) { @@ -73347,7 +73441,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, 469) /*expected idx: 469, name: v.ast.Aggregate */ ; + v__ast__Aggregate info = /* as */ *(v__ast__Aggregate*)__as_cast((sym->info)._v__ast__Aggregate,(sym->info)._typ, 470) /*expected idx: 470, 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)) { @@ -73361,7 +73455,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, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 483) /*expected idx: 483, 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)) { @@ -73677,12 +73771,12 @@ 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 == 326 /* v.ast.SelectorExpr */) { - if (((*node.field_expr._v__ast__SelectorExpr).expr)._typ == 306 /* v.ast.Ident */) { + if ((node.field_expr)._typ == 327 /* v.ast.SelectorExpr */) { + if (((*node.field_expr._v__ast__SelectorExpr).expr)._typ == 307 /* 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"))) { string field_name = g->comptime_for_field_value.name; v__ast__TypeSymbol* left_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node.left_type)); - Option_v__ast__StructField _t1 = v__ast__Table_find_field_with_embeds(g->table, left_sym, field_name); + _option_v__ast__StructField _t1 = v__ast__Table_find_field_with_embeds(g->table, left_sym, field_name); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__gen__c__Gen_error(g, str_intp(3, _MOV((StrIntpData[]){{_SLIT("`"), /*115 &v.ast.Expr*/0xfe10, {.d_s = v__ast__Expr_str(node.left)}}, {_SLIT("` has no field named `"), /*115 &string*/0xfe10, {.d_s = field_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__ast__Expr_pos(node.left)); @@ -73717,7 +73811,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 == 219 /* v.ast.FnDecl */) { + if ((stmt)._typ == 220 /* v.ast.FnDecl */) { if (string_starts_with((*stmt._v__ast__FnDecl).name, _SLIT("main.vweb_tmpl"))) { if (is_html) { g->inside_vweb_tmpl = true; @@ -73729,7 +73823,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 != 357 /* v.ast.Return */) { + if ((it)._typ != 358 /* v.ast.Return */) { array_push((array*)&_t2, &it); } } @@ -73754,7 +73848,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com v__ast__TypeSymbol* sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node->left_type)); ; if (string__eq(node->method_name, _SLIT("method"))) { - Option_v__ast__Fn _t4 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method); + _option_v__ast__Fn _t4 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; return; @@ -73765,7 +73859,7 @@ 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 == 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")); + _t5 = (arg.expr)._typ == 307 /* 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; } @@ -73780,8 +73874,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_call(v__gen__c__Gen* g, v__ast__Com return; } 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 ((node->left)._typ == 307 /* v.ast.Ident */) { + if (((*node->left._v__ast__Ident).obj)._typ == 365 /* 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("&")); } @@ -73792,7 +73886,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 == 306 /* v.ast.Ident */) { + if ((node->left)._typ == 307 /* 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; } @@ -73876,8 +73970,8 @@ 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 == 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 (((*(v__ast__IfBranch*)/*ee elem_sym */array_get(node.branches, 0)).cond)._typ == 307 /* 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; *(v__pref__OS*) _t1.data = v__pref__OS___auto; @@ -73922,7 +74016,7 @@ 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, 346) /*expected idx: 346, 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, 347) /*expected idx: 347, 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); @@ -73958,25 +74052,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 == 290 /* v.ast.BoolLiteral */) { + if (cond._typ == 291 /* v.ast.BoolLiteral */) { v__gen__c__Gen_expr(g, cond); bool _t1 = true; return _t1; } - else if (cond._typ == 321 /* v.ast.ParExpr */) { + else if (cond._typ == 322 /* 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 == 323 /* v.ast.PrefixExpr */) { + else if (cond._typ == 324 /* 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 == 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); + else if (cond._typ == 323 /* 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, 307) /*expected idx: 307, 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)); @@ -73990,7 +74084,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ bool _t6 = true; return _t6; } - else if (cond._typ == 310 /* v.ast.InfixExpr */) { + else if (cond._typ == 311 /* 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); @@ -74002,7 +74096,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 == 332 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 299 /* v.ast.ComptimeType */) { + if ((left)._typ == 333 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 300 /* 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) { @@ -74024,10 +74118,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, 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__Type got_type = (/* as */ *(v__ast__TypeNode*)__as_cast(((*cond._v__ast__InfixExpr).right)._v__ast__TypeNode,((*cond._v__ast__InfixExpr).right)._typ, 333) /*expected idx: 333, name: v.ast.TypeNode */ ).typ; + if ((left)._typ == 333 /* v.ast.TypeNode */ && ((*cond._v__ast__InfixExpr).right)._typ == 333 /* 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 == 474 /* v.ast.Interface */) { + if ((interface_sym->info)._typ == 475 /* 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) { @@ -74048,14 +74142,14 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ return _t11; } } - } else if ((left)._typ == 326 /* v.ast.SelectorExpr */) { + } else if ((left)._typ == 327 /* 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, /*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 == 332 /* v.ast.TypeNode */) { + } else if ((left)._typ == 333 /* 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) { @@ -74078,8 +74172,8 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ return _t15; }; } - 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); + else if (cond._typ == 307 /* 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; *(string*) _t16.data = _SLIT("true"); @@ -74090,7 +74184,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_comptime_if_cond(v__gen__c__Gen* g, v__ast__ bool _t17 = true; return _t17; } - else if (cond._typ == 297 /* v.ast.ComptimeCall */) { + else if (cond._typ == 298 /* 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; @@ -74213,7 +74307,7 @@ 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct sym_info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ; if (sym_info.fields.len > 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 }}}))); } @@ -74246,7 +74340,7 @@ 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 == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* 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 "), /*115 &string*/0xfe10, {.d_s = node.val_var}}, {_SLIT(" = {0};"), 0, { .d_c = 0 }}}))); } @@ -74266,237 +74360,237 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_comptime_for(v__gen__c__Gen* g, v__ast__Comp v__gen__c__Gen_writeln(g, _SLIT("}// $for")); } -VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen* g, string name, bool is_comptime_optional) { +VV_LOCAL_SYMBOL _option_string v__gen__c__Gen_comptime_if_to_ifdef(v__gen__c__Gen* g, string name, bool is_comptime_optional) { if (string__eq(name, _SLIT("windows"))) { - Option_string _t1; - opt_ok(&(string[]) { _SLIT("_WIN32") }, (Option*)(&_t1), sizeof(string)); + _option_string _t1; + opt_ok2(&(string[]) { _SLIT("_WIN32") }, (_option*)(&_t1), sizeof(string)); return _t1; } else if (string__eq(name, _SLIT("ios"))) { - Option_string _t2; - opt_ok(&(string[]) { _SLIT("__TARGET_IOS__") }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { _SLIT("__TARGET_IOS__") }, (_option*)(&_t2), sizeof(string)); return _t2; } else if (string__eq(name, _SLIT("macos"))) { - Option_string _t3; - opt_ok(&(string[]) { _SLIT("__APPLE__") }, (Option*)(&_t3), sizeof(string)); + _option_string _t3; + opt_ok2(&(string[]) { _SLIT("__APPLE__") }, (_option*)(&_t3), sizeof(string)); return _t3; } else if (string__eq(name, _SLIT("mach"))) { - Option_string _t4; - opt_ok(&(string[]) { _SLIT("__MACH__") }, (Option*)(&_t4), sizeof(string)); + _option_string _t4; + opt_ok2(&(string[]) { _SLIT("__MACH__") }, (_option*)(&_t4), sizeof(string)); return _t4; } else if (string__eq(name, _SLIT("darwin"))) { - Option_string _t5; - opt_ok(&(string[]) { _SLIT("__DARWIN__") }, (Option*)(&_t5), sizeof(string)); + _option_string _t5; + opt_ok2(&(string[]) { _SLIT("__DARWIN__") }, (_option*)(&_t5), sizeof(string)); return _t5; } else if (string__eq(name, _SLIT("hpux"))) { - Option_string _t6; - opt_ok(&(string[]) { _SLIT("__HPUX__") }, (Option*)(&_t6), sizeof(string)); + _option_string _t6; + opt_ok2(&(string[]) { _SLIT("__HPUX__") }, (_option*)(&_t6), sizeof(string)); return _t6; } else if (string__eq(name, _SLIT("gnu"))) { - Option_string _t7; - opt_ok(&(string[]) { _SLIT("__GNU__") }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { _SLIT("__GNU__") }, (_option*)(&_t7), sizeof(string)); return _t7; } else if (string__eq(name, _SLIT("qnx"))) { - Option_string _t8; - opt_ok(&(string[]) { _SLIT("__QNX__") }, (Option*)(&_t8), sizeof(string)); + _option_string _t8; + opt_ok2(&(string[]) { _SLIT("__QNX__") }, (_option*)(&_t8), sizeof(string)); return _t8; } else if (string__eq(name, _SLIT("linux"))) { - Option_string _t9; - opt_ok(&(string[]) { _SLIT("__linux__") }, (Option*)(&_t9), sizeof(string)); + _option_string _t9; + opt_ok2(&(string[]) { _SLIT("__linux__") }, (_option*)(&_t9), sizeof(string)); return _t9; } else if (string__eq(name, _SLIT("serenity"))) { - Option_string _t10; - opt_ok(&(string[]) { _SLIT("__serenity__") }, (Option*)(&_t10), sizeof(string)); + _option_string _t10; + opt_ok2(&(string[]) { _SLIT("__serenity__") }, (_option*)(&_t10), sizeof(string)); return _t10; } else if (string__eq(name, _SLIT("vinix"))) { - Option_string _t11; - opt_ok(&(string[]) { _SLIT("__vinix__") }, (Option*)(&_t11), sizeof(string)); + _option_string _t11; + opt_ok2(&(string[]) { _SLIT("__vinix__") }, (_option*)(&_t11), sizeof(string)); return _t11; } else if (string__eq(name, _SLIT("freebsd"))) { - Option_string _t12; - opt_ok(&(string[]) { _SLIT("__FreeBSD__") }, (Option*)(&_t12), sizeof(string)); + _option_string _t12; + opt_ok2(&(string[]) { _SLIT("__FreeBSD__") }, (_option*)(&_t12), sizeof(string)); return _t12; } else if (string__eq(name, _SLIT("openbsd"))) { - Option_string _t13; - opt_ok(&(string[]) { _SLIT("__OpenBSD__") }, (Option*)(&_t13), sizeof(string)); + _option_string _t13; + opt_ok2(&(string[]) { _SLIT("__OpenBSD__") }, (_option*)(&_t13), sizeof(string)); return _t13; } else if (string__eq(name, _SLIT("netbsd"))) { - Option_string _t14; - opt_ok(&(string[]) { _SLIT("__NetBSD__") }, (Option*)(&_t14), sizeof(string)); + _option_string _t14; + opt_ok2(&(string[]) { _SLIT("__NetBSD__") }, (_option*)(&_t14), sizeof(string)); return _t14; } else if (string__eq(name, _SLIT("bsd"))) { - Option_string _t15; - opt_ok(&(string[]) { _SLIT("__BSD__") }, (Option*)(&_t15), sizeof(string)); + _option_string _t15; + opt_ok2(&(string[]) { _SLIT("__BSD__") }, (_option*)(&_t15), sizeof(string)); return _t15; } else if (string__eq(name, _SLIT("dragonfly"))) { - Option_string _t16; - opt_ok(&(string[]) { _SLIT("__DragonFly__") }, (Option*)(&_t16), sizeof(string)); + _option_string _t16; + opt_ok2(&(string[]) { _SLIT("__DragonFly__") }, (_option*)(&_t16), sizeof(string)); return _t16; } else if (string__eq(name, _SLIT("android"))) { - Option_string _t17; - opt_ok(&(string[]) { _SLIT("__ANDROID__") }, (Option*)(&_t17), sizeof(string)); + _option_string _t17; + opt_ok2(&(string[]) { _SLIT("__ANDROID__") }, (_option*)(&_t17), sizeof(string)); return _t17; } else if (string__eq(name, _SLIT("solaris"))) { - Option_string _t18; - opt_ok(&(string[]) { _SLIT("__sun") }, (Option*)(&_t18), sizeof(string)); + _option_string _t18; + opt_ok2(&(string[]) { _SLIT("__sun") }, (_option*)(&_t18), sizeof(string)); return _t18; } else if (string__eq(name, _SLIT("haiku"))) { - Option_string _t19; - opt_ok(&(string[]) { _SLIT("__HAIKU__") }, (Option*)(&_t19), sizeof(string)); + _option_string _t19; + opt_ok2(&(string[]) { _SLIT("__HAIKU__") }, (_option*)(&_t19), sizeof(string)); return _t19; } else if (string__eq(name, _SLIT("js"))) { - Option_string _t20; - opt_ok(&(string[]) { _SLIT("_VJS") }, (Option*)(&_t20), sizeof(string)); + _option_string _t20; + opt_ok2(&(string[]) { _SLIT("_VJS") }, (_option*)(&_t20), sizeof(string)); return _t20; } else if (string__eq(name, _SLIT("gcc"))) { - Option_string _t21; - opt_ok(&(string[]) { _SLIT("__V_GCC__") }, (Option*)(&_t21), sizeof(string)); + _option_string _t21; + opt_ok2(&(string[]) { _SLIT("__V_GCC__") }, (_option*)(&_t21), sizeof(string)); return _t21; } else if (string__eq(name, _SLIT("tinyc"))) { - Option_string _t22; - opt_ok(&(string[]) { _SLIT("__TINYC__") }, (Option*)(&_t22), sizeof(string)); + _option_string _t22; + opt_ok2(&(string[]) { _SLIT("__TINYC__") }, (_option*)(&_t22), sizeof(string)); return _t22; } else if (string__eq(name, _SLIT("clang"))) { - Option_string _t23; - opt_ok(&(string[]) { _SLIT("__clang__") }, (Option*)(&_t23), sizeof(string)); + _option_string _t23; + opt_ok2(&(string[]) { _SLIT("__clang__") }, (_option*)(&_t23), sizeof(string)); return _t23; } else if (string__eq(name, _SLIT("mingw"))) { - Option_string _t24; - opt_ok(&(string[]) { _SLIT("__MINGW32__") }, (Option*)(&_t24), sizeof(string)); + _option_string _t24; + opt_ok2(&(string[]) { _SLIT("__MINGW32__") }, (_option*)(&_t24), sizeof(string)); return _t24; } else if (string__eq(name, _SLIT("msvc"))) { - Option_string _t25; - opt_ok(&(string[]) { _SLIT("_MSC_VER") }, (Option*)(&_t25), sizeof(string)); + _option_string _t25; + opt_ok2(&(string[]) { _SLIT("_MSC_VER") }, (_option*)(&_t25), sizeof(string)); return _t25; } else if (string__eq(name, _SLIT("cplusplus"))) { - Option_string _t26; - opt_ok(&(string[]) { _SLIT("__cplusplus") }, (Option*)(&_t26), sizeof(string)); + _option_string _t26; + opt_ok2(&(string[]) { _SLIT("__cplusplus") }, (_option*)(&_t26), sizeof(string)); return _t26; } else if (string__eq(name, _SLIT("threads"))) { - Option_string _t27; - opt_ok(&(string[]) { _SLIT("__VTHREADS__") }, (Option*)(&_t27), sizeof(string)); + _option_string _t27; + opt_ok2(&(string[]) { _SLIT("__VTHREADS__") }, (_option*)(&_t27), sizeof(string)); return _t27; } else if (string__eq(name, _SLIT("gcboehm"))) { - Option_string _t28; - opt_ok(&(string[]) { _SLIT("_VGCBOEHM") }, (Option*)(&_t28), sizeof(string)); + _option_string _t28; + opt_ok2(&(string[]) { _SLIT("_VGCBOEHM") }, (_option*)(&_t28), sizeof(string)); return _t28; } else if (string__eq(name, _SLIT("debug"))) { - Option_string _t29; - opt_ok(&(string[]) { _SLIT("_VDEBUG") }, (Option*)(&_t29), sizeof(string)); + _option_string _t29; + opt_ok2(&(string[]) { _SLIT("_VDEBUG") }, (_option*)(&_t29), sizeof(string)); return _t29; } else if (string__eq(name, _SLIT("prod"))) { - Option_string _t30; - opt_ok(&(string[]) { _SLIT("_VPROD") }, (Option*)(&_t30), sizeof(string)); + _option_string _t30; + opt_ok2(&(string[]) { _SLIT("_VPROD") }, (_option*)(&_t30), sizeof(string)); return _t30; } else if (string__eq(name, _SLIT("profile"))) { - Option_string _t31; - opt_ok(&(string[]) { _SLIT("_VPROFILE") }, (Option*)(&_t31), sizeof(string)); + _option_string _t31; + opt_ok2(&(string[]) { _SLIT("_VPROFILE") }, (_option*)(&_t31), sizeof(string)); return _t31; } else if (string__eq(name, _SLIT("test"))) { - Option_string _t32; - opt_ok(&(string[]) { _SLIT("_VTEST") }, (Option*)(&_t32), sizeof(string)); + _option_string _t32; + opt_ok2(&(string[]) { _SLIT("_VTEST") }, (_option*)(&_t32), sizeof(string)); return _t32; } else if (string__eq(name, _SLIT("glibc"))) { - Option_string _t33; - opt_ok(&(string[]) { _SLIT("__GLIBC__") }, (Option*)(&_t33), sizeof(string)); + _option_string _t33; + opt_ok2(&(string[]) { _SLIT("__GLIBC__") }, (_option*)(&_t33), sizeof(string)); return _t33; } else if (string__eq(name, _SLIT("prealloc"))) { - Option_string _t34; - opt_ok(&(string[]) { _SLIT("_VPREALLOC") }, (Option*)(&_t34), sizeof(string)); + _option_string _t34; + opt_ok2(&(string[]) { _SLIT("_VPREALLOC") }, (_option*)(&_t34), sizeof(string)); return _t34; } else if (string__eq(name, _SLIT("no_bounds_checking"))) { - Option_string _t35; - opt_ok(&(string[]) { _SLIT("CUSTOM_DEFINE_no_bounds_checking") }, (Option*)(&_t35), sizeof(string)); + _option_string _t35; + opt_ok2(&(string[]) { _SLIT("CUSTOM_DEFINE_no_bounds_checking") }, (_option*)(&_t35), sizeof(string)); return _t35; } else if (string__eq(name, _SLIT("freestanding"))) { - Option_string _t36; - opt_ok(&(string[]) { _SLIT("_VFREESTANDING") }, (Option*)(&_t36), sizeof(string)); + _option_string _t36; + opt_ok2(&(string[]) { _SLIT("_VFREESTANDING") }, (_option*)(&_t36), sizeof(string)); return _t36; } else if (string__eq(name, _SLIT("amd64"))) { - Option_string _t37; - opt_ok(&(string[]) { _SLIT("__V_amd64") }, (Option*)(&_t37), sizeof(string)); + _option_string _t37; + opt_ok2(&(string[]) { _SLIT("__V_amd64") }, (_option*)(&_t37), sizeof(string)); return _t37; } else if (string__eq(name, _SLIT("aarch64")) || string__eq(name, _SLIT("arm64"))) { - Option_string _t38; - opt_ok(&(string[]) { _SLIT("__V_arm64") }, (Option*)(&_t38), sizeof(string)); + _option_string _t38; + opt_ok2(&(string[]) { _SLIT("__V_arm64") }, (_option*)(&_t38), sizeof(string)); return _t38; } else if (string__eq(name, _SLIT("arm32"))) { - Option_string _t39; - opt_ok(&(string[]) { _SLIT("__V_arm32") }, (Option*)(&_t39), sizeof(string)); + _option_string _t39; + opt_ok2(&(string[]) { _SLIT("__V_arm32") }, (_option*)(&_t39), sizeof(string)); return _t39; } else if (string__eq(name, _SLIT("i386"))) { - Option_string _t40; - opt_ok(&(string[]) { _SLIT("__V_x86") }, (Option*)(&_t40), sizeof(string)); + _option_string _t40; + opt_ok2(&(string[]) { _SLIT("__V_x86") }, (_option*)(&_t40), sizeof(string)); return _t40; } else if (string__eq(name, _SLIT("x64"))) { - Option_string _t41; - opt_ok(&(string[]) { _SLIT("TARGET_IS_64BIT") }, (Option*)(&_t41), sizeof(string)); + _option_string _t41; + opt_ok2(&(string[]) { _SLIT("TARGET_IS_64BIT") }, (_option*)(&_t41), sizeof(string)); return _t41; } else if (string__eq(name, _SLIT("x32"))) { - Option_string _t42; - opt_ok(&(string[]) { _SLIT("TARGET_IS_32BIT") }, (Option*)(&_t42), sizeof(string)); + _option_string _t42; + opt_ok2(&(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)); + _option_string _t43; + opt_ok2(&(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)); + _option_string _t44; + opt_ok2(&(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 _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)); + _option_string _t45; + opt_ok2(&(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 \""), /*115 &string*/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} }; + return (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } VV_LOCAL_SYMBOL v__ast__CTempVar v__gen__c__Gen_new_ctemp_var(v__gen__c__Gen* g, v__ast__Expr expr, v__ast__Type expr_type) { @@ -74558,7 +74652,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_dump_expr_definitions(v__gen__c__Gen* g) { string ptr_asterisk = (is_ptr ? (_SLIT("*")) : (_SLIT(""))); 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, 483) /*expected idx: 483, name: v.ast.FnType */ ; + v__ast__FnType fninfo = /* as */ *(v__ast__FnType*)__as_cast((dump_sym->info)._v__ast__FnType,(dump_sym->info)._typ, 484) /*expected idx: 484, 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); @@ -74637,7 +74731,7 @@ 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 (v__gen__c__Gen_embed_file_is_prod_mode(g)) { - Option_Array_u8 _t1 = os__read_bytes(node->embed_file.apath); + _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: \""), /*115 &string*/0xfe10, {.d_s = node->embed_file.rpath}}, {_SLIT0, 0, { .d_c = 0 }}}))); @@ -74652,7 +74746,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as string cache_dir = os__join_path(os__vmodules_dir(), new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("cache"), _SLIT("embed_file")}))); string cache_key = rand__ulid(); if (!os__exists(cache_dir)) { - Option_void _t2 = os__mkdir_all(cache_dir); + _option_void _t2 = os__mkdir_all(cache_dir); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -74670,7 +74764,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as 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); + _option_Array_u8 _t3 = os__read_bytes(cache_path); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; eprintln(_SLIT("unable to read compressed file")); @@ -74680,7 +74774,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_embed_file_init(v__gen__c__Gen* g, v__as } Array_u8 compressed_bytes = (*(Array_u8*)_t3.data); - Option_void _t4 = os__rm(cache_path); + _option_void _t4 = os__rm(cache_path); if (_t4.state != 0 && _t4.err._typ != _IError_None___index) { IError err = _t4.err; } @@ -74956,7 +75050,7 @@ int ctmp; if (is_livefn && !is_livemode) { 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); + _option_string _t6 = v__gen__c__Gen_c_fn_name(g, node); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; // Defer begin @@ -74992,7 +75086,7 @@ int ctmp; } 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}; + _option_string _t7 = {0}; if (_t8) { *((string*)&_t7.data) = *((string*)_t8); } else { @@ -75109,14 +75203,14 @@ int ctmp; if (!Array_string_contains(g->defer_vars, var.name)) { array_push((array*)&g->defer_vars, _MOV((string[]){ string_clone(var.name) })); string deref = _SLIT(""); - Option_v__ast__Var_ptr _t13; + _option_v__ast__Var_ptr _t13; if (_t13 = v__ast__Scope_find_var(var.scope, var.name), _t13.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t13.data; if (v->is_auto_heap) { deref = _SLIT("*"); } } - 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 */ ; + v__ast__Var info = /* as */ *(v__ast__Var*)__as_cast((var.obj)._v__ast__Var,(var.obj)._typ, 365) /*expected idx: 365, 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, /*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 }}}))); } @@ -75167,7 +75261,7 @@ 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 != 357 /* 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 != 358 /* 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 ("), /*115 &string*/0xfe10, {.d_s = type_name}}, {_SLIT(")"), /*115 &string*/0xfe10, {.d_s = default_expr}}, {_SLIT(";"), 0, { .d_c = 0 }}}))); @@ -75235,7 +75329,7 @@ if (v__gen__c__Gen_gen_fn_decl_defer_0) { // Defer end } -VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast__FnDecl* node) { +VV_LOCAL_SYMBOL _option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast__FnDecl* node) { string name = node->name; if (string__eq(name, _SLIT("+")) || string__eq(name, _SLIT("-")) || string__eq(name, _SLIT("*")) || string__eq(name, _SLIT("/")) || string__eq(name, _SLIT("%")) || string__eq(name, _SLIT("<")) || string__eq(name, _SLIT("=="))) { name = v__util__replace_op(name); @@ -75243,7 +75337,7 @@ VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast if (node->is_method) { v__ast__TypeSymbol* unwrapped_rec_sym = v__ast__Table_sym(g->table, v__gen__c__Gen_unwrap_generic(g, node->receiver.typ)); if (unwrapped_rec_sym->kind == v__ast__Kind__placeholder) { - return (Option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } name = string__plus(string__plus(v__gen__c__Gen_cc_type(g, node->receiver.typ, false), _SLIT("_")), name); } @@ -75258,8 +75352,8 @@ VV_LOCAL_SYMBOL Option_string v__gen__c__Gen_c_fn_name(v__gen__c__Gen* g, v__ast if ((g->pref->translated || g->file->is_translated) && Array_v__ast__Attr_contains(node->attrs, _SLIT("c"))) { name = (*(v__ast__Attr*)/*ee elem_sym */array_get(node->attrs, 0)).arg; } - Option_string _t2; - opt_ok(&(string[]) { name }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { name }, (_option*)(&_t2), sizeof(string)); return _t2; } @@ -75403,7 +75497,7 @@ 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, 483) /*expected idx: 483, 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, 484) /*expected idx: 484, name: v.ast.FnType */ ; v__ast__Fn func = info.func; 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 }}}))); @@ -75416,7 +75510,7 @@ VV_LOCAL_SYMBOL multi_return_Array_string_Array_string_Array_bool v__gen__c__Gen bool heap_prom = false; if (scope != ((voidptr)(0))) { if (!string__eq(arg.name, _SLIT("_"))) { - Option_v__ast__Var_ptr _t3; + _option_v__ast__Var_ptr _t3; if (_t3 = v__ast__Scope_find_var(scope, arg.name), _t3.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t3.data; if (!v->is_stack_obj && v->is_auto_heap) { @@ -75469,13 +75563,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 == 284 /* v.ast.AnonFn */) { + if ((node.left)._typ == 285 /* v.ast.AnonFn */) { v__gen__c__Gen_expr(g, node.left); - } else if ((node.left)._typ == 309 /* v.ast.IndexExpr */ && (node.name).len == 0) { + } else if ((node.left)._typ == 310 /* 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 == 292 /* v.ast.CallExpr */ && (node.name).len == 0) { + } else if ((node.left)._typ == 293 /* v.ast.CallExpr */ && (node.name).len == 0) { v__gen__c__Gen_expr(g, node.left); } if (node.should_be_skipped) { @@ -75505,7 +75599,7 @@ bool v__gen__c__Gen_call_expr_defer_0 = false; 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 == 329 /* 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 == 330 /* 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); @@ -75573,7 +75667,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 == 456 /* v.ast.Struct */) { + if (sym->info._typ == 457 /* 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; @@ -75586,13 +75680,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } Array_string generic_names =_t1; v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t3; + _option_v__ast__Type _t3; if (_t3 = v__ast__Table_resolve_generic_to_concrete(muttable, node.receiver_type, generic_names, (*sym->info._v__ast__Struct).concrete_types), _t3.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t3.data; unwrapped_rec_type = utyp; } } - else if (sym->info._typ == 474 /* v.ast.Interface */) { + else if (sym->info._typ == 475 /* 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; @@ -75605,13 +75699,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } Array_string generic_names =_t4; v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t6; + _option_v__ast__Type _t6; if (_t6 = v__ast__Table_resolve_generic_to_concrete(muttable, node.receiver_type, generic_names, (*sym->info._v__ast__Interface).concrete_types), _t6.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t6.data; unwrapped_rec_type = utyp; } } - else if (sym->info._typ == 475 /* v.ast.SumType */) { + else if (sym->info._typ == 476 /* 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; @@ -75624,7 +75718,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } Array_string generic_names =_t7; v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t9; + _option_v__ast__Type _t9; if (_t9 = v__ast__Table_resolve_generic_to_concrete(muttable, node.receiver_type, generic_names, (*sym->info._v__ast__SumType).concrete_types), _t9.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t9.data; unwrapped_rec_type = utyp; @@ -75637,12 +75731,12 @@ 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, 471) /*expected idx: 471, 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, 472) /*expected idx: 472, 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, 474) /*expected idx: 474, 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, 475) /*expected idx: 475, 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); @@ -75722,7 +75816,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, 452) /*expected idx: 452, 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, 453) /*expected idx: 453, 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)) { @@ -75775,12 +75869,12 @@ 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 == 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 */) { + if ((node.left)._typ == 299 /* v.ast.ComptimeSelector */) { + if (((*node.left._v__ast__ComptimeSelector).field_expr)._typ == 327 /* v.ast.SelectorExpr */) { + if (((*(*node.left._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 307 /* 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}; + _option_v__ast__Type _t10 = {0}; if (_t11) { *((v__ast__Type*)&_t10.data) = *((v__ast__Type*)_t11); } else { @@ -75797,10 +75891,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE return; } } - } else if ((node.left)._typ == 297 /* v.ast.ComptimeCall */) { + } else if ((node.left)._typ == 298 /* 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; + _option_v__ast__Fn _t12; if (_t12 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method), _t12.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t12.data; rec_type = m.return_type; @@ -75808,8 +75902,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 == 306 /* v.ast.Ident */) { - if (((*node.left._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + } else if ((node.left)._typ == 307 /* v.ast.Ident */) { + if (((*node.left._v__ast__Ident).obj)._typ == 365 /* 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); @@ -75817,7 +75911,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 == 469 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 470 /* 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); @@ -75838,7 +75932,7 @@ 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 == 471 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(typ_sym, node.name))) { + if (!((left_sym->info)._typ == 472 /* 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"))) { @@ -75853,12 +75947,12 @@ 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__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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((left_sym->info)._v__ast__Array,(left_sym->info)._typ, 452) /*expected idx: 452, name: v.ast.Array */ ; noscan = v__gen__c__Gen_check_noscan(g, info.elem_type); } } else if (left_sym->kind == v__ast__Kind__chan) { @@ -75868,6 +75962,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE } else if (final_left_sym->kind == v__ast__Kind__map) { if (string__eq(node.name, _SLIT("keys"))) { name = _SLIT("map_keys"); + } else if (string__eq(node.name, _SLIT("values"))) { + name = _SLIT("map_values"); } } if (g->pref->obfuscate && string__eq(g->cur_mod.name, _SLIT("main")) && string_starts_with(name, _SLIT("main__")) && !string__eq(node.name, _SLIT("str"))) { @@ -75875,7 +75971,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_method_call(v__gen__c__Gen* g, v__ast__CallE 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: "), /*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}; + _option_string _t13 = {0}; if (_t14) { *((string*)&_t13.data) = *((string*)_t14); } else { @@ -75893,9 +75989,9 @@ 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 == 309 /* v.ast.IndexExpr */) { + if ((node.left)._typ == 310 /* v.ast.IndexExpr */) { v__ast__Expr idx = (*node.left._v__ast__IndexExpr).index; - if ((idx)._typ == 324 /* v.ast.RangeExpr */) { + if ((idx)._typ == 325 /* 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; } @@ -75946,7 +76042,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__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 == 315 /* v.ast.MapInit */) { + if ((node.left)._typ == 316 /* 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]")); @@ -76015,8 +76111,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 == 306 /* v.ast.Ident */) { - if (((*call_arg->expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((call_arg->expr)._typ == 307 /* v.ast.Ident */) { + if (((*call_arg->expr._v__ast__Ident).obj)._typ == 365 /* 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; } } @@ -76055,7 +76151,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr 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, 332) /*expected idx: 332, 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, 333) /*expected idx: 333, 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); @@ -76066,7 +76162,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr 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_"), /*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 }}}))); + v__gen__c__Gen_writeln(g, str_intp(6, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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("), /*115 &string*/0xfe10, {.d_s = json_obj}}, {_SLIT("); // del"), 0, { .d_c = 0 }}}))); @@ -76081,7 +76177,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr name = v__gen__c__c_name(name); } if (g->pref->translated || g->file->is_translated) { - Option_v__ast__Fn _t2; + _option_v__ast__Fn _t2; if (_t2 = v__ast__Table_find_fn(g->table, node.name), _t2.state == 0) { v__ast__Fn f = *(v__ast__Fn*)_t2.data; if (Array_v__ast__Attr_contains(f.attrs, _SLIT("c"))) { @@ -76093,7 +76189,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr string key = node.name; v__gen__c__Gen_write(g, str_intp(2, _MOV((StrIntpData[]){{_SLIT("/* obf call: "), /*115 &string*/0xfe10, {.d_s = key}}, {_SLIT(" */"), 0, { .d_c = 0 }}}))); string* _t4 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, g->obf_table), &(string[]){key})); - Option_string _t3 = {0}; + _option_string _t3 = {0}; if (_t4) { *((string*)&_t3.data) = *((string*)_t4); } else { @@ -76110,7 +76206,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr name = *(string*)_t3.data; } if (!is_selector_call) { - Option_v__ast__Fn _t5; + _option_v__ast__Fn _t5; if (_t5 = v__ast__Table_find_fn(g->table, node.name), _t5.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t5.data; if (func.generic_names.len > 0) { @@ -76131,7 +76227,7 @@ 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, 474) /*expected idx: 474, name: v.ast.Interface */ )), _SLIT("str"))) { + 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, 475) /*expected idx: 475, 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(rec_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); @@ -76150,12 +76246,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_fn_call(v__gen__c__Gen* g, v__ast__CallExpr 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, /*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 */) { + if ((expr)._typ == 299 /* v.ast.ComptimeSelector */) { + if (((*expr._v__ast__ComptimeSelector).field_expr)._typ == 327 /* v.ast.SelectorExpr */) { + if (((*(*expr._v__ast__ComptimeSelector).field_expr._v__ast__SelectorExpr).expr)._typ == 307 /* 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}; + _option_v__ast__Type _t6 = {0}; if (_t7) { *((v__ast__Type*)&_t6.data) = *((v__ast__Type*)_t7); } else { @@ -76170,22 +76266,22 @@ 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 == 297 /* v.ast.ComptimeCall */) { + } else if ((expr)._typ == 298 /* 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; + _option_v__ast__Fn _t8; if (_t8 = v__ast__TypeSymbol_find_method(sym, g->comptime_for_method), _t8.state == 0) { v__ast__Fn m = *(v__ast__Fn*)_t8.data; typ = m.return_type; } } - } else if ((expr)._typ == 306 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + } else if ((expr)._typ == 307 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 365 /* 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 == 469 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 470 /* v.ast.Aggregate */) { typ = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } } @@ -76199,20 +76295,20 @@ 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_41773 = v__gen__c__Gen_panic_debug_info(g, node.pos); - int paline = mr_41773.arg0; - string pafile = mr_41773.arg1; - string pamod = mr_41773.arg2; - string pafn = mr_41773.arg3; + multi_return_int_string_string_string mr_41840 = v__gen__c__Gen_panic_debug_info(g, node.pos); + int paline = mr_41840.arg0; + string pafile = mr_41840.arg1; + string pamod = mr_41840.arg2; + string pafn = mr_41840.arg3; v__gen__c__Gen_write(g, str_intp(5, _MOV((StrIntpData[]){{_SLIT("panic_debug("), /*100 &int*/0xfe07, {.d_i32 = paline}}, {_SLIT(", tos3(\""), /*115 &string*/0xfe10, {.d_s = pafile}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pamod}}, {_SLIT("\"), tos3(\""), /*115 &string*/0xfe10, {.d_s = pafn}}, {_SLIT("\"), "), 0, { .d_c = 0 }}}))); v__gen__c__Gen_call_args(g, node); v__gen__c__Gen_write(g, _SLIT(")")); } else { bool is_fn_var = false; - Option_v__ast__ScopeObject _t9; + _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 == 364 /* v.ast.Var */) { + if (obj._typ == 365 /* 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("(*")); @@ -76228,7 +76324,7 @@ 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 == 469 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 470 /* 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, /*115 &string*/0xfe10, {.d_s = dot}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = sym->cname}}, {_SLIT0, 0, { .d_c = 0 }}}))); } else { @@ -76300,7 +76396,7 @@ 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 == 292 /* v.ast.CallExpr */) { + if ((arg.expr)._typ == 293 /* v.ast.CallExpr */) { v__gen__c__Gen_autofree_call_pregen(g, (*arg.expr._v__ast__CallExpr)); } free_tmp_arg_vars = true; @@ -76309,10 +76405,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_autofree_call_pregen(v__gen__c__Gen* g, v__a bool used = false; 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; + _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 == 364 /* v.ast.Var */) { + if (x._typ == 365 /* v.ast.Var */) { (*x._v__ast__Var).is_used = false; } @@ -76347,7 +76443,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 == 364 /* v.ast.Var */) { + if (obj->_typ == 365 /* v.ast.Var */) { bool is_optional = v__ast__Type_has_flag((*obj->_v__ast__Var).typ, v__ast__TypeFlag__optional); if (is_optional) { continue; @@ -76398,13 +76494,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } if ( _t3 &&_t4) { if (node.is_method) { - Option_v__ast__Fn _t6; + _option_v__ast__Fn _t6; if (_t6 = v__ast__Table_find_method(g->table, v__ast__Table_sym(g->table, node.left_type), node.name), _t6.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t6.data; if (func.generic_names.len > 0) { for (int i = 0; i < expected_types.len; ++i) { v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t7; + _option_v__ast__Type _t7; if (_t7 = v__ast__Table_resolve_generic_to_concrete(muttable, (*(v__ast__Type*)/*ee elem_sym */array_get(node.expected_arg_types, i)), func.generic_names, node.concrete_types), _t7.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t7.data; array_set(&expected_types, i, &(v__ast__Type[]) { utyp }); @@ -76413,13 +76509,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp } } } else { - Option_v__ast__Fn _t8; + _option_v__ast__Fn _t8; if (_t8 = v__ast__Table_find_fn(g->table, node.name), _t8.state == 0) { v__ast__Fn func = *(v__ast__Fn*)_t8.data; if (func.generic_names.len > 0) { for (int i = 0; i < expected_types.len; ++i) { v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t9; + _option_v__ast__Type _t9; if (_t9 = v__ast__Table_resolve_generic_to_concrete(muttable, (*(v__ast__Type*)/*ee elem_sym */array_get(node.expected_arg_types, i)), func.generic_names, node.concrete_types), _t9.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t9.data; array_set(&expected_types, i, &(v__ast__Type[]) { utyp }); @@ -76464,13 +76560,13 @@ 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, name: v.ast.Array */ ; if (v__ast__Type_has_flag(varg_type, v__ast__TypeFlag__generic)) { - Option_v__ast__Fn _t10; + _option_v__ast__Fn _t10; if (_t10 = v__ast__Table_find_fn(g->table, node.name), _t10.state == 0) { v__ast__Fn fn_def = *(v__ast__Fn*)_t10.data; v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t11; + _option_v__ast__Type _t11; if (_t11 = v__ast__Table_resolve_generic_to_concrete(muttable, arr_info.elem_type, fn_def.generic_names, node.concrete_types), _t11.state == 0) { v__ast__Type utyp = *(v__ast__Type*)_t11.data; arr_info.elem_type = utyp; @@ -76484,7 +76580,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_call_args(v__gen__c__Gen* g, v__ast__CallExp 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 == 285 /* v.ast.ArrayDecompose */) { + } else if (args.len > 0 && ((*(v__ast__CallArg*)/*ee elem_sym */array_get(args, args.len - 1)).expr)._typ == 286 /* 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) { @@ -76522,7 +76618,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 == 284 /* v.ast.AnonFn */) { + } else if ((expr.left)._typ == 285 /* 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) { @@ -76537,7 +76633,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_go_expr(v__gen__c__Gen* g, v__ast__GoExpr no } 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}; + _option_string _t1 = {0}; if (_t2) { *((string*)&_t1.data) = *((string*)_t2); } else { @@ -76579,7 +76675,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)) { gohandle_name = (is_opt ? (_SLIT("__v_thread_Option_void")) : (_SLIT("__v_thread"))); } else { - string opt = (is_opt ? (_SLIT("Option_")) : (_SLIT(""))); + string opt = (is_opt ? ( str_intp(2, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), 0, { .d_c = 0 }}}))) : (_SLIT(""))); 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) { @@ -76701,7 +76797,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__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, 474) /*expected idx: 474, 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, 475) /*expected idx: 475, 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, /*115 &string*/0xfe10, {.d_s = v__gen__c__c_name(receiver_type_name)}}, {_SLIT("_name_table["), 0, { .d_c = 0 }}}))); @@ -76817,7 +76913,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 == 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 */) { + if (((arg.expr)._typ == 307 /* v.ast.Ident */ && (/* as */ *(v__ast__Ident*)__as_cast((arg.expr)._v__ast__Ident,(arg.expr)._typ, 307) /*expected idx: 307, name: v.ast.Ident */ ).kind == v__ast__IdentKind__variable) || (arg.expr)._typ == 327 /* v.ast.SelectorExpr */) { v__gen__c__Gen_write(g, _SLIT("&/*arr*/")); v__gen__c__Gen_expr(g, arg.expr); } else { @@ -76826,11 +76922,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 == 306 /* v.ast.Ident */ || (arg.expr)._typ == 326 /* v.ast.SelectorExpr */)) { + } else if (arg_sym->kind == v__ast__Kind__sum_type && exp_sym->kind == v__ast__Kind__sum_type && ((arg.expr)._typ == 307 /* v.ast.Ident */ || (arg.expr)._typ == 327 /* 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 == 306 /* v.ast.Ident */ || (arg.expr)._typ == 326 /* v.ast.SelectorExpr */)) { + } else if (arg_sym->kind == v__ast__Kind__interface_ && exp_sym->kind == v__ast__Kind__interface_ && ((arg.expr)._typ == 307 /* v.ast.Ident */ || (arg.expr)._typ == 327 /* v.ast.SelectorExpr */)) { v__gen__c__Gen_write(g, _SLIT("&/*iface*/")); v__gen__c__Gen_expr(g, arg.expr); return; @@ -76867,7 +76963,7 @@ 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 == 286 /* v.ast.ArrayInit */) { + } else if ((arg.expr)._typ == 287 /* 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("("), /*115 &string*/0xfe10, {.d_s = v__gen__c__Gen_typ(g, (*arg.expr._v__ast__ArrayInit).typ)}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); @@ -77109,7 +77205,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn 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 == 306 /* v.ast.Ident */ || (node.cond)._typ == 326 /* v.ast.SelectorExpr */) { + if ((node.cond)._typ == 307 /* v.ast.Ident */ || (node.cond)._typ == 327 /* 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); @@ -77127,7 +77223,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn 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, 483) /*expected idx: 483, 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, 484) /*expected idx: 484, 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("(("), /*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 }}})); @@ -77141,7 +77237,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } 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 == 286 /* v.ast.ArrayInit */; + bool cond_is_literal = (node.cond)._typ == 287 /* 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)); @@ -77163,14 +77259,14 @@ 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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((cond_sym->info)._v__ast__ArrayFixed,(cond_sym->info)._typ, 480) /*expected idx: 480, 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, 483) /*expected idx: 483, 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, 484) /*expected idx: 484, 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"), /*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 }}}))); @@ -77194,7 +77290,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } } else if (node.kind == v__ast__Kind__map) { string cond_var = _SLIT(""); - if ((node.cond)._typ == 306 /* v.ast.Ident */) { + if ((node.cond)._typ == 307 /* 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); @@ -77232,7 +77328,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn 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, 483) /*expected idx: 483, 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, 484) /*expected idx: 484, 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(&"), /*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) { @@ -77255,7 +77351,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } g->indent--; } else if (node.kind == v__ast__Kind__string) { - 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)); + v__ast__Expr cond = ((node.cond)._typ == 331 /* v.ast.StringLiteral */ || (node.cond)._typ == 330 /* 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 "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" = 0; "), /*115 &string*/0xfe10, {.d_s = i}}, {_SLIT(" < "), 0, { .d_c = 0 }}}))); @@ -77268,7 +77364,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn } } else if (node.kind == v__ast__Kind__struct_) { v__ast__TypeSymbol* cond_type_sym = v__ast__Table_sym(g->table, node.cond_type); - Option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(cond_type_sym, _SLIT("next")); + _option_v__ast__Fn _t1 = v__ast__TypeSymbol_find_method_with_generic_parent(cond_type_sym, _SLIT("next")); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__gen__c__verror(_SLIT("`next` method not found")); @@ -77292,7 +77388,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_for_in_stmt(v__gen__c__Gen* g, v__ast__ForIn 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 == 456 /* v.ast.Struct */) { + if ((receiver_sym->info)._typ == 457 /* 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); } @@ -77336,22 +77432,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 == 308 /* v.ast.IfGuardExpr */ || branch.stmts.len > 1) { + if ((branch.cond)._typ == 309 /* 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 == 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__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 347 /* 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, 347) /*expected idx: 347, name: v.ast.ExprStmt */ ; if (v__gen__c__is_noreturn_callexpr(stmt.expr)) { bool _t4 = true; return _t4; } - if ((stmt.expr)._typ == 316 /* v.ast.MatchExpr */) { + if ((stmt.expr)._typ == 317 /* v.ast.MatchExpr */) { bool _t5 = true; return _t5; } - if ((stmt.expr)._typ == 292 /* v.ast.CallExpr */) { + if ((stmt.expr)._typ == 293 /* 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) { @@ -77423,13 +77519,13 @@ 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 == 308 /* v.ast.IfGuardExpr */) { + if ((cond)._typ == 309 /* 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 != 309 /* v.ast.IndexExpr */ && ((*cond._v__ast__IfGuardExpr).expr)._typ != 323 /* v.ast.PrefixExpr */) { + if (((*cond._v__ast__IfGuardExpr).expr)._typ != 310 /* v.ast.IndexExpr */ && ((*cond._v__ast__IfGuardExpr).expr)._typ != 324 /* 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, /*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 }}}))); @@ -77449,7 +77545,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no 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 = "), /*115 &string*/0xfe10, {.d_s = cvar_name}}, {_SLIT(".err;"), 0, { .d_c = 0 }}}))); } - } else if ((branch.cond)._typ == 308 /* v.ast.IfGuardExpr */) { + } else if ((branch.cond)._typ == 309 /* v.ast.IfGuardExpr */) { string var_name = (*(string*)/*ee elem_sym */array_get(guard_vars, i)); bool short_opt = false; if ((var_name).len == 0) { @@ -77474,7 +77570,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_if_expr(v__gen__c__Gen* g, v__ast__IfExpr no bool is_auto_heap = false; if (branch.stmts.len > 0) { v__ast__Scope* scope = v__ast__Scope_innermost(g->file->scope, v__ast__Node_pos(v__ast__Stmt_to_sumtype_v__ast__Node(ADDR(v__ast__Stmt, ((*(v__ast__Stmt*)array_last(branch.stmts)))))).pos); - Option_v__ast__Var_ptr _t1; + _option_v__ast__Var_ptr _t1; if (_t1 = v__ast__Scope_find_var(scope, (*(v__ast__IfGuardVar*)/*ee elem_sym */array_get((*branch.cond._v__ast__IfGuardExpr).vars, 0)).name), _t1.state == 0) { v__ast__Var* v = *(v__ast__Var**)_t1.data; is_auto_heap = v->is_auto_heap; @@ -77493,7 +77589,7 @@ 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, 482) /*expected idx: 482, name: v.ast.MultiReturn */ ; + v__ast__MultiReturn mr_info = /* as */ *(v__ast__MultiReturn*)__as_cast((sym->info)._v__ast__MultiReturn,(sym->info)._typ, 483) /*expected idx: 483, 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) { @@ -77509,8 +77605,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 == 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 */) { + if ((branch.cond)._typ == 311 /* v.ast.InfixExpr */) { + if ((*branch.cond._v__ast__InfixExpr).op == v__token__Kind__key_in && ((*branch.cond._v__ast__InfixExpr).left)._typ != 311 /* v.ast.InfixExpr */ && ((*branch.cond._v__ast__InfixExpr).right)._typ == 287 /* v.ast.ArrayInit */) { no_needs_par = true; } } @@ -77557,7 +77653,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 == 324 /* v.ast.RangeExpr */) { + if ((node.index)._typ == 325 /* 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); @@ -77654,7 +77750,7 @@ 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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, 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(")); @@ -77682,7 +77778,7 @@ 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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym->info)._v__ast__ArrayFixed,(sym->info)._typ, 480) /*expected idx: 480, 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)) { @@ -77708,14 +77804,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_range_expr(v__gen__c__Gen* g, v__ast__IndexE 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, 451) /*expected idx: 451, name: v.ast.Array */ ; + v__ast__Array info = /* as */ *(v__ast__Array*)__as_cast((sym.info)._v__ast__Array,(sym.info)._typ, 452) /*expected idx: 452, 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 == 326 /* v.ast.SelectorExpr */; + bool is_selector = (node.left)._typ == 327 /* 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); @@ -77786,7 +77882,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In v__gen__c__Gen_write(g, _SLIT("/*2*/string_clone(")); } if (g->is_fn_index_call) { - if ((elem_sym->info)._typ == 483 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 484 /* 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(")(*("), /*115 &string*/0xfe10, {.d_s = elem_type_str}}, {_SLIT("*)/*ee elem_sym */array_get("), 0, { .d_c = 0 }}}))); @@ -77850,10 +77946,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_array(v__gen__c__Gen* g, v__ast__In } 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, 479) /*expected idx: 479, name: v.ast.ArrayFixed */ ; + v__ast__ArrayFixed info = /* as */ *(v__ast__ArrayFixed*)__as_cast((sym.info)._v__ast__ArrayFixed,(sym.info)._typ, 480) /*expected idx: 480, 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 == 483 /* v.ast.FnType */; + bool is_fn_index_call = g->is_fn_index_call && (elem_sym->info)._typ == 484 /* v.ast.FnType */; if (is_fn_index_call) { v__gen__c__Gen_write(g, _SLIT("(*")); } @@ -77866,7 +77962,7 @@ 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 == 311 /* v.ast.IntegerLiteral */) || g->pref->translated) { + if ((direct || (node.index)._typ == 312 /* 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(")); @@ -77882,7 +77978,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, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map info = /* as */ *(v__ast__Map*)__as_cast((sym.info)._v__ast__Map,(sym.info)._typ, 453) /*expected idx: 453, 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); @@ -77905,7 +78001,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_index_of_map(v__gen__c__Gen* g, v__ast__Inde 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 == 309 /* v.ast.IndexExpr */) { + if ((node.left)._typ == 310 /* v.ast.IndexExpr */) { g->inside_map_index = true; v__gen__c__Gen_expr(g, node.left); g->inside_map_index = false; @@ -77965,7 +78061,7 @@ 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, 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 == 483 /* v.ast.FnType */) { + if ((elem_sym->info)._typ == 484 /* 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(")); @@ -78190,13 +78286,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr(v__gen__c__Gen* g, v__ast__InfixE 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, 480) /*expected idx: 480, 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, 481) /*expected idx: 481, 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 "), /*115 &string*/0xfe10, {.d_s = tmp_opt}}, {_SLIT(" = __Option_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); + v__gen__c__Gen_write(g, str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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("__"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT("_pushval("), 0, { .d_c = 0 }}}))); } @@ -78217,10 +78313,10 @@ 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 == 471 /* v.ast.Alias */ && v__ast__TypeSymbol_has_method(left.sym, _SLIT("==")); + bool has_alias_eq_op_overload = (left.sym->info)._typ == 472 /* 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 == 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) { + } 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 == 331 /* v.ast.StringLiteral */ && ((/* as */ *(v__ast__StringLiteral*)__as_cast((node.right)._v__ast__StringLiteral,(node.right)._typ, 331) /*expected idx: 331, 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(")")); @@ -78298,7 +78394,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ if (v__ast__Type_is_ptr(left.typ)) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((node.left)._typ == 286 /* v.ast.ArrayInit */) { + if ((node.left)._typ == 287 /* 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("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); @@ -78306,7 +78402,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_eq_op(v__gen__c__Gen* g, v__ast__ } v__gen__c__Gen_expr(g, node.left); v__gen__c__Gen_write(g, _SLIT(", ")); - if ((node.right)._typ == 286 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 287 /* 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("("), /*115 &string*/0xfe10, {.d_s = s}}, {_SLIT(")"), 0, { .d_c = 0 }}}))); @@ -78450,11 +78546,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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, 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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, 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); @@ -78531,7 +78627,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 == 286 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 287 /* 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) { @@ -78544,7 +78640,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } } } - if ((node.right)._typ == 286 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 287 /* 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)); @@ -78552,7 +78648,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 == 451 /* v.ast.Array */) { + if ((right.sym->info)._typ == 452 /* 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) { @@ -78588,7 +78684,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 == 286 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 287 /* 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) { @@ -78601,7 +78697,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_in_op(v__gen__c__Gen* g, v__ast__ } } } - if ((node.right)._typ == 286 /* v.ast.ArrayInit */) { + if ((node.right)._typ == 287 /* 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)); @@ -78609,7 +78705,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 == 479 /* v.ast.ArrayFixed */) { + if ((right.sym->info)._typ == 480 /* v.ast.ArrayFixed */) { v__ast__Type elem_type = (*right.sym->info._v__ast__ArrayFixed).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) { @@ -78674,7 +78770,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, 469) /*expected idx: 469, 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, 470) /*expected idx: 470, 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); @@ -78698,10 +78794,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_is_op(v__gen__c__Gen* g, v__ast__ if (left_sym->kind == v__ast__Kind__interface_) { 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 == 332 /* v.ast.TypeNode */) { + if (node.right._typ == 333 /* v.ast.TypeNode */) { _t1 = v__gen__c__Gen_unwrap_generic(g, (*node.right._v__ast__TypeNode).typ); } - else if (node.right._typ == 318 /* v.ast.None */) { + else if (node.right._typ == 319 /* v.ast.None */) { _t1 = (*(int*)map_get(ADDR(map, g->table->type_idxs), &(string[]){_SLIT("None__")}, &(int[]){ 0 })); } @@ -78721,9 +78817,9 @@ 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, 474) /*expected idx: 474, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((left_sym->info)._v__ast__Interface,(left_sym->info)._typ, 475) /*expected idx: 475, 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}; + _option_Array_v__ast__Type _t1 = {0}; if (_t2) { *((Array_v__ast__Type*)&_t1.data) = *((Array_v__ast__Type*)_t2); } else { @@ -78767,8 +78863,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, 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; + if (left.sym->kind == v__ast__Kind__struct_ && (/* as */ *(v__ast__Struct*)__as_cast((left.sym->info)._v__ast__Struct,(left.sym->info)._typ, 457) /*expected idx: 457, 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, 457) /*expected idx: 457, 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); @@ -78778,7 +78874,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_arithmetic_op(v__gen__c__Gen* g, v__gen__c__Gen_expr(g, node.right); v__gen__c__Gen_write(g, _SLIT(")")); } else { - Option_v__ast__Fn _t1 = v__ast__Table_find_method(g->table, left.sym, v__token__Kind_str(node.op)); + _option_v__ast__Fn _t1 = v__ast__Table_find_method(g->table, left.sym, v__token__Kind_str(node.op)); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__gen__c__Gen_gen_plain_infix_expr(g, node); @@ -78803,7 +78899,7 @@ 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, 451) /*expected idx: 451, 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, 452) /*expected idx: 452, 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"), /*115 &string*/0xfe10, {.d_s = noscan}}, {_SLIT("("), 0, { .d_c = 0 }}}))); @@ -78831,7 +78927,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_infix_expr_left_shift_op(v__gen__c__Gen* g, } 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 == 306 /* v.ast.Ident */; + bool elem_is_array_var = (elem_sym->kind == v__ast__Kind__array || elem_sym->kind == v__ast__Kind__array_fixed) && (node.right)._typ == 307 /* 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("&")); @@ -78868,37 +78964,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 == 292 /* v.ast.CallExpr */) { + if (node._typ == 293 /* 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 == 309 /* v.ast.IndexExpr */) { + else if (node._typ == 310 /* 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 == 310 /* v.ast.InfixExpr */) { + else if (node._typ == 311 /* 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 == 321 /* v.ast.ParExpr */) { + else if (node._typ == 322 /* 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 == 322 /* v.ast.PostfixExpr */) { + else if (node._typ == 323 /* 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 == 323 /* v.ast.PrefixExpr */) { + else if (node._typ == 324 /* 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 == 324 /* v.ast.RangeExpr */) { + else if (node._typ == 325 /* 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 == 326 /* v.ast.SelectorExpr */) { + else if (node._typ == 327 /* v.ast.SelectorExpr */) { bool _t8 = v__gen__c__Gen_need_tmp_var_in_array_call(g, (*node._v__ast__SelectorExpr).expr); return _t8; } @@ -78911,7 +79007,7 @@ 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 == 307 /* v.ast.IfExpr */) { + if ((node.right)._typ == 308 /* 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))) { @@ -79017,11 +79113,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_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" "), /*115 &string*/0xfe10, {.d_s = dec_fn_name}}, {_SLIT("(cJSON* root)"), 0, { .d_c = 0 }}})); + string dec_fn_dec = str_intp(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, 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) { @@ -79036,7 +79132,7 @@ 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){.pre_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.update_expr_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.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)),.typ_str = styp,.update_expr = {0},.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,},.typ = utyp,.update_expr_type = 0,.is_short = 0,.is_short_syntax = 0,.unresolved = 0,.is_update_embed = 0,.has_update_expr = 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(&dec, str_intp(5, _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 ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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* "), /*115 &string*/0xfe10, {.d_s = enc_fn_name}}, {_SLIT("("), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" val)"), 0, { .d_c = 0 }}})); @@ -79048,13 +79144,13 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { 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, 452) /*expected idx: 452, name: v.ast.Map */ ; + v__ast__Map m = /* as */ *(v__ast__Map*)__as_cast((sym->info)._v__ast__Map,(sym->info)._typ, 453) /*expected idx: 453, 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, 471) /*expected idx: 471, name: v.ast.Alias */ ; + v__ast__Alias a = /* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 472) /*expected idx: 472, 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))) { @@ -79062,7 +79158,7 @@ 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 == 456 /* v.ast.Struct */) { + if ((psym->info)._typ == 457 /* 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: "), /*115 &string*/0xfe10, {.d_s = sym->name}}, {_SLIT(" aliased sumtypes does not work at the moment"), 0, { .d_c = 0 }}}))); @@ -79073,21 +79169,21 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_jsons(v__gen__c__Gen* g) { } } else if (sym->kind == v__ast__Kind__sum_type) { strings__Builder_writeln(&enc, _SLIT("\to = cJSON_CreateObject();")); - if ((sym->info)._typ != 475 /* v.ast.SumType */) { + if ((sym->info)._typ != 476 /* 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 != 456 /* v.ast.Struct */) { + if ((sym->info)._typ != 457 /* 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_"), /*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, str_intp(3, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*115 &string*/0xfe10, {.d_s = styp}}, {_SLIT(" ret;"), 0, { .d_c = 0 }}}))); + strings__Builder_writeln(&dec, str_intp(2, _MOV((StrIntpData[]){{_SLIT("\topt_ok2(&res, ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("*)&ret, sizeof(res));"), 0, { .d_c = 0 }}}))); strings__Builder_writeln(&dec, _SLIT("\treturn ret;\n}")); strings__Builder_writeln(&enc, _SLIT("\treturn o;\n}")); strings__Builder_writeln(&g->definitions, strings__Builder_str(&dec)); @@ -79097,7 +79193,7 @@ 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, 475) /*expected idx: 475, name: v.ast.SumType */ ; + v__ast__SumType info = /* as */ *(v__ast__SumType*)__as_cast((sym.info)._v__ast__SumType,(sym.info)._typ, 476) /*expected idx: 476, 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) @@ -79157,9 +79253,9 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_sumtype_enc_dec(v__gen__c__Gen* g 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(\""), /*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(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\t\treturn ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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 = "), /*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}")); @@ -79214,9 +79310,9 @@ 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); 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) && "), /*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(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\t\t\treturn ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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 = "), /*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}")); @@ -79244,7 +79340,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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_info)._v__ast__Struct,(type_info)._typ, 457) /*expected idx: 457, 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; @@ -79296,7 +79392,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_struct_enc_dec(v__gen__c__Gen* g, v__gen__c__gen_js_get(styp, tmp, name, dec, is_required); 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, 471) /*expected idx: 471, name: v.ast.Alias */ ; + v__ast__Alias alias = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 472) /*expected idx: 472, 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)) { @@ -79321,7 +79417,7 @@ inline VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_struct_enc_dec(v__gen__c__Gen* g, } 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, 471) /*expected idx: 471, name: v.ast.Alias */ ; + v__ast__Alias ainfo = /* as */ *(v__ast__Alias*)__as_cast((field_sym->info)._v__ast__Alias,(field_sym->info)._typ, 472) /*expected idx: 472, name: v.ast.Alias */ ; enc_name = v__gen__c__js_enc_name(v__gen__c__Gen_typ(g, ainfo.parent_type)); } } @@ -79341,16 +79437,16 @@ VV_LOCAL_SYMBOL void v__gen__c__gen_js_get(string styp, string tmp, string name, 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_"), /*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, str_intp(4, _MOV((StrIntpData[]){{_SLIT("\t\treturn ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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_"), /*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(6, _MOV((StrIntpData[]){{_SLIT("\t"), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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, str_intp(5, _MOV((StrIntpData[]){{_SLIT("\t\treturn ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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}")); } @@ -79379,10 +79475,10 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_decode_array(v__gen__c__Gen* g, v__ast__Ty if (v__gen__c__is_js_prim(styp)) { 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_"), /*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 }}})); + s = str_intp(8, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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 *("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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_"), /*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 }}})); + string _t1 = str_intp(7, _MOV((StrIntpData[]){{_SLIT("\n if(root && !cJSON_IsArray(root) && !cJSON_IsNull(root)) {\n return ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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; } @@ -79397,19 +79493,19 @@ VV_LOCAL_SYMBOL string v__gen__c__Gen_decode_map(v__gen__c__Gen* g, v__ast__Type string styp = v__gen__c__Gen_typ(g, key_type); string styp_v = v__gen__c__Gen_typ(g, value_type); v__ast__TypeSymbol* key_type_symbol = v__ast__Table_sym(g->table, key_type); - multi_return_string_string_string_string mr_18875 = v__gen__c__Gen_map_fn_ptrs(g, *key_type_symbol); - string hash_fn = mr_18875.arg0; - string key_eq_fn = mr_18875.arg1; - string clone_fn = mr_18875.arg2; - string free_fn = mr_18875.arg3; + multi_return_string_string_string_string mr_18986 = v__gen__c__Gen_map_fn_ptrs(g, *key_type_symbol); + string hash_fn = mr_18986.arg0; + string key_eq_fn = mr_18986.arg1; + string clone_fn = mr_18986.arg2; + string free_fn = mr_18986.arg3; 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, /*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_"), /*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 }}})); + s = str_intp(9, _MOV((StrIntpData[]){{_SLIT("\n "), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_"), /*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 *("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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_"), /*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 }}})); + string _t1 = str_intp(11, _MOV((StrIntpData[]){{_SLIT("\n if(!cJSON_IsObject(root) && !cJSON_IsNull(root)) {\n return ("), /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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; } @@ -79535,9 +79631,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 == 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)) { + if (((*(v__ast__Stmt*)/*ee elem_sym */array_get(branch.stmts, 0)))._typ == 347 /* 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, 347) /*expected idx: 347, name: v.ast.ExprStmt */ ; + if (((stmt.expr)._typ == 293 /* v.ast.CallExpr */ || (stmt.expr)._typ == 308 /* v.ast.IfExpr */ || (stmt.expr)._typ == 317 /* v.ast.MatchExpr */) || ((stmt.expr)._typ == 310 /* v.ast.IndexExpr */ && (/* as */ *(v__ast__IndexExpr*)__as_cast((stmt.expr)._v__ast__IndexExpr,(stmt.expr)._typ, 310) /*expected idx: 310, name: v.ast.IndexExpr */ ).or_expr.kind != v__ast__OrKind__absent)) { bool _t7 = true; return _t7; } @@ -79569,7 +79665,7 @@ bool old; v__gen__c__Gen_match_expr_defer_0 = true; g->inside_match_optional = true; } - 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 */) { + if ((node.cond)._typ == 307 /* v.ast.Ident */ || (node.cond)._typ == 327 /* v.ast.SelectorExpr */ || (node.cond)._typ == 312 /* v.ast.IntegerLiteral */ || (node.cond)._typ == 331 /* v.ast.StringLiteral */ || (node.cond)._typ == 305 /* v.ast.FloatLiteral */) { cond_var = v__gen__c__Gen_expr_string(g, node.cond); } else { string _t1; /* if prepend */ @@ -79660,11 +79756,11 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_sumtype(v__gen__c__Gen* g, v__ast 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 == 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 */ ; + if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 333 /* 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, 333) /*expected idx: 333, 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, /*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) { + } else if (((*(v__ast__Expr*)/*ee elem_sym */array_get(branch.exprs, sumtype_index)))._typ == 319 /* 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 }}}))); } } @@ -79694,7 +79790,7 @@ 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, /*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_string covered_enum = __new_array_with_default(0, (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 486) /*expected idx: 486, 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; @@ -79703,8 +79799,8 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_switch(v__gen__c__Gen* g, v__ast_ 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, 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]; + for (int _t2 = 0; _t2 < (/* as */ *(v__ast__Enum*)__as_cast((enum_typ.info)._v__ast__Enum,(enum_typ.info)._typ, 486) /*expected idx: 486, 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, 486) /*expected idx: 486, 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 "), /*115 &string*/0xfe10, {.d_s = cname}}, {_SLIT0, /*115 &string*/0xfe10, {.d_s = val}}, {_SLIT(":"), 0, { .d_c = 0 }}}))); } @@ -79721,9 +79817,9 @@ 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 == 324 /* v.ast.RangeExpr */) { + if ((expr)._typ == 325 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 311 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 312 /* 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; } @@ -79756,7 +79852,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 == 324 /* v.ast.RangeExpr */) { + if ((it)._typ == 325 /* v.ast.RangeExpr */) { _t4 = true; break; } @@ -79767,7 +79863,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 == 303 /* v.ast.EnumVal */) { + if ((expr)._typ == 304 /* 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); @@ -79797,9 +79893,9 @@ 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 == 324 /* v.ast.RangeExpr */) { + if ((expr)._typ == 325 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 311 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 312 /* 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; } @@ -79900,9 +79996,9 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_match_expr_classic(v__gen__c__Gen* g, v__ast v__gen__c__Gen_write(g, _SLIT(")")); } else { - if ((expr)._typ == 324 /* v.ast.RangeExpr */) { + if ((expr)._typ == 325 /* v.ast.RangeExpr */) { bool skip_low = false; - if (((*expr._v__ast__RangeExpr).low)._typ == 311 /* v.ast.IntegerLiteral */) { + if (((*expr._v__ast__RangeExpr).low)._typ == 312 /* 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; } @@ -80060,11 +80156,11 @@ 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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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) { @@ -80073,10 +80169,10 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_stmt_line(v__gen__c__Gen* g, v__ast__Sql 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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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) { @@ -80192,7 +80288,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_insert(v__gen__c__Gen* g, v__ast__SqlStm v__gen__c__Gen_sql_stmt_line(g, sub, expr); 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 "), /*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(4, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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) { @@ -80315,23 +80411,23 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_delete(v__gen__c__Gen* g, v__ast__SqlStm } 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 == 310 /* v.ast.InfixExpr */) { + if (expr._typ == 311 /* 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 == 330 /* v.ast.StringLiteral */) { + else if (expr._typ == 331 /* v.ast.StringLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__string_type, expr); } - else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 312 /* v.ast.IntegerLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__int_type, expr); } - else if (expr._typ == 290 /* v.ast.BoolLiteral */) { + else if (expr._typ == 291 /* v.ast.BoolLiteral */) { v__gen__c__Gen_sql_write_orm_primitive(g, _const_v__ast__bool_type, expr); } - 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 */ ; + else if (expr._typ == 307 /* 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, 417) /*expected idx: 417, name: v.ast.IdentVar */ ; v__gen__c__Gen_sql_write_orm_primitive(g, info.typ, expr); } - else if (expr._typ == 326 /* v.ast.SelectorExpr */) { + else if (expr._typ == 327 /* v.ast.SelectorExpr */) { v__gen__c__Gen_sql_write_orm_primitive(g, (*expr._v__ast__SelectorExpr).typ, expr); } @@ -80358,7 +80454,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_write_orm_primitive(v__gen__c__Gen* g, v typ = _SLIT("infix"); } 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 */) { + if ((expr)._typ == 311 /* 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(\""), /*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(""))); @@ -80373,7 +80469,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 == 310 /* v.ast.InfixExpr */) { + if (expr._typ == 311 /* 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}; @@ -80533,29 +80629,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 != 310 /* v.ast.InfixExpr */ && ((*expr._v__ast__InfixExpr).right)._typ != 310 /* v.ast.InfixExpr */) { + if (((*expr._v__ast__InfixExpr).left)._typ != 311 /* v.ast.InfixExpr */ && ((*expr._v__ast__InfixExpr).right)._typ != 311 /* 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 == 306 /* v.ast.Ident */) { + else if (expr._typ == 307 /* 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 == 330 /* v.ast.StringLiteral */) { + else if (expr._typ == 331 /* v.ast.StringLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 312 /* v.ast.IntegerLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 326 /* v.ast.SelectorExpr */) { + else if (expr._typ == 327 /* v.ast.SelectorExpr */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } - else if (expr._typ == 290 /* v.ast.BoolLiteral */) { + else if (expr._typ == 291 /* v.ast.BoolLiteral */) { array_push((array*)data, _MOV((v__ast__Expr[]){ expr })); } @@ -80670,7 +80766,7 @@ 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"), /*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, str_intp(5, _MOV((StrIntpData[]){{_SLIT0, /*115 &string*/0xfe10, {.d_s = _const_v__gen__c__option_name}}, {_SLIT("_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(\""), /*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 }}}))); @@ -80811,12 +80907,12 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp 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, 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 */ ; + v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 311) /*expected idx: 311, name: v.ast.InfixExpr */ ; + v__ast__Ident ident = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 307) /*expected idx: 307, 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 == 416 /* v.ast.IdentVar */) { + if ((ident.info)._typ == 417 /* v.ast.IdentVar */) { (*ident.info._v__ast__IdentVar).typ = s; } } @@ -80839,9 +80935,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, 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 */ ; + v__ast__InfixExpr where_expr = /* as */ *(v__ast__InfixExpr*)__as_cast((sub.where_expr)._v__ast__InfixExpr,(sub.where_expr)._typ, 311) /*expected idx: 311, name: v.ast.InfixExpr */ ; + v__ast__Ident l = /* as */ *(v__ast__Ident*)__as_cast((where_expr.left)._v__ast__Ident,(where_expr.left)._typ, 307) /*expected idx: 307, name: v.ast.Ident */ ; + v__ast__Ident r = /* as */ *(v__ast__Ident*)__as_cast((where_expr.right)._v__ast__Ident,(where_expr.right)._typ, 307) /*expected idx: 307, name: v.ast.Ident */ ; l.name = fkey; r.name = tmp; where_expr.left = v__ast__Ident_to_sumtype_v__ast__Expr(&l); @@ -80852,7 +80948,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_sql_select(v__gen__c__Gen* g, v__ast__SqlExp .scope = 0, .pos = r.pos, .mut_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,}, - .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, + .expr_type = (/* as */ *(v__ast__IdentVar*)__as_cast((r.info)._v__ast__IdentVar,(r.info)._typ, 417) /*expected idx: 417, name: v.ast.IdentVar */ ).typ, .typ = _const_v__ast__int_type, .name_type = 0, .next_token = 0, @@ -80900,13 +80996,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 == 306 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).info)._typ == 416 /* v.ast.IdentVar */) { + if (expr._typ == 307 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).info)._typ == 417 /* 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 == 326 /* v.ast.SelectorExpr */) { + else if (expr._typ == 327 /* 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; } @@ -80999,7 +81095,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_string_literal(v__gen__c__Gen* g, v__ast__St } 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, 329) /*expected idx: 329, 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, 330) /*expected idx: 330, 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) { @@ -81040,7 +81136,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 == 471 /* v.ast.Alias */ && !v__ast__TypeSymbol_has_method(sym, _SLIT("str"))) { + if ((sym->info)._typ == 472 /* 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; @@ -81066,7 +81162,7 @@ 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 != 303 /* v.ast.EnumVal */) { + if ((expr)._typ != 304 /* 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, /*115 &string*/0xfe10, {.d_s = str_fn_name}}, {_SLIT("("), 0, { .d_c = 0 }}}))); v__gen__c__Gen_enum_expr(g, expr); @@ -81089,7 +81185,7 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_gen_expr_to_string(v__gen__c__Gen* g, v__ast } else if ((!str_method_expects_ptr && is_ptr && !is_shared) || is_var_mut) { v__gen__c__Gen_write(g, _SLIT("*")); } - if ((expr)._typ == 286 /* v.ast.ArrayInit */) { + if ((expr)._typ == 287 /* 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) { @@ -81124,7 +81220,7 @@ 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, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; + typ = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type; } bool remove_tail_zeros = false; u8 fspec = (*(u8*)/*ee elem_sym */array_get(node.fmts, i)); @@ -81245,7 +81341,7 @@ 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, 474) /*expected idx: 474, 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, 475) /*expected idx: 475, 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, /*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); @@ -81256,14 +81352,14 @@ VV_LOCAL_SYMBOL void v__gen__c__Gen_str_val(v__gen__c__Gen* g, v__ast__StringInt 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 == 306 /* v.ast.Ident */) { - if (((*expr._v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((expr)._typ == 307 /* v.ast.Ident */) { + if (((*expr._v__ast__Ident).obj)._typ == 365 /* 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 == 469 /* v.ast.Aggregate */) { + if ((cast_sym->info)._typ == 470 /* v.ast.Aggregate */) { exp_typ = (*(v__ast__Type*)/*ee elem_sym */array_get((*cast_sym->info._v__ast__Aggregate).types, g->aggregate_type_idx)); } } @@ -81305,8 +81401,8 @@ 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 == 306 /* v.ast.Ident */) { - if (((*expr->_v__ast__Ident).obj)._typ == 364 /* v.ast.Var */) { + if ((expr)->_typ == 307 /* v.ast.Ident */) { + if (((*expr->_v__ast__Ident).obj)._typ == 365 /* v.ast.Var */) { (*(v__ast__Type*)/*ee elem_sym */array_get(node_.expr_types, i)) = (*(*expr->_v__ast__Ident).obj._v__ast__Var).typ; } } @@ -81428,7 +81524,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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, 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")); @@ -81465,7 +81561,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, 456) /*expected idx: 456, 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, 457) /*expected idx: 457, name: v.ast.Struct */ ; Array_string _t6 = {0}; Array_v__ast__StructField _t6_orig = embed_info.fields; int _t6_len = _t6_orig.len; @@ -81521,7 +81617,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 == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* 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; @@ -81550,8 +81646,8 @@ 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 == 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 */ ; + if (field_type_sym->kind == v__ast__Kind__array_fixed && (sfield.expr)._typ == 307 /* 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, 480) /*expected idx: 480, 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); @@ -81597,7 +81693,7 @@ bool v__gen__c__Gen_struct_init_defer_0 = false; } if (node.is_update_embed) { v__ast__TypeSymbol* update_sym = v__ast__Table_sym(g->table, node.update_expr_type); - Option_multi_return_v__ast__StructField_Array_v__ast__Type _t15 = v__ast__Table_find_field_from_embeds(g->table, update_sym, field->name); + _option_multi_return_v__ast__StructField_Array_v__ast__Type _t15 = v__ast__Table_find_field_from_embeds(g->table, update_sym, field->name); if (_t15.state != 0) { /*or block*/ IError err = _t15.err; *(multi_return_v__ast__StructField_Array_v__ast__Type*) _t15.data = (multi_return_v__ast__StructField_Array_v__ast__Type){.arg0=((v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.default_expr = {0},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,}),.arg1=__new_array_with_default(0, 0, sizeof(v__ast__Type), 0)}; @@ -81660,7 +81756,7 @@ 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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((sym->info)._v__ast__Struct,(sym->info)._typ, 457) /*expected idx: 457, name: v.ast.Struct */ ; if (info.fields.len == 0) { bool _t1 = false; return _t1; @@ -81684,7 +81780,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 == 456 /* v.ast.Struct */) { + if (sym->info._typ == 457 /* 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; @@ -81704,7 +81800,7 @@ VV_LOCAL_SYMBOL bool v__gen__c__Gen_is_empty_struct(v__gen__c__Gen* g, v__gen__c VV_LOCAL_SYMBOL v__ast__Type v__gen__c__Gen_unwrap_generic(v__gen__c__Gen* g, v__ast__Type typ) { if (v__ast__Type_has_flag(typ, v__ast__TypeFlag__generic)) { v__ast__Table* muttable = ((v__ast__Table*)(g->table)); - Option_v__ast__Type _t1; + _option_v__ast__Type _t1; if (_t1 = v__ast__Table_resolve_generic_to_concrete(muttable, typ, (g->cur_fn != 0 ? (g->cur_fn->generic_names) : (__new_array_with_default(0, 0, sizeof(string), 0))), g->cur_concrete_types), _t1.state == 0) { v__ast__Type t_typ = *(v__ast__Type*)_t1.data; v__ast__Type _t2 = t_typ; @@ -81726,14 +81822,14 @@ VV_LOCAL_SYMBOL v__gen__c__Type v__gen__c__Gen_unwrap(v__gen__c__Gen* g, v__ast_ return _t2; } -Option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v__scanner__CommentsMode comments_mode, v__pref__Preferences* pref) { +_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, /*115 &string*/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); + _option_string _t2 = v__util__read_file(file_path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; - return (Option_v__scanner__Scanner_ptr){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__scanner__Scanner_ptr){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } string raw_text = (*(string*)_t2.data); @@ -81772,9 +81868,9 @@ Option_v__scanner__Scanner_ptr v__scanner__new_scanner_file(string file_path, v_ .is_inside_toplvl_statement = 0, .should_abort = 0, }, sizeof(v__scanner__Scanner))); - v__scanner__Scanner_init_scanner(s); - Option_v__scanner__Scanner_ptr _t4; - opt_ok(&(v__scanner__Scanner*[]) { s }, (Option*)(&_t4), sizeof(v__scanner__Scanner*)); + v__scanner__Scanner_scan_all_tokens_in_buffer(s); + _option_v__scanner__Scanner_ptr _t4; + opt_ok2(&(v__scanner__Scanner*[]) { s }, (_option*)(&_t4), sizeof(v__scanner__Scanner*)); return _t4; } @@ -81814,15 +81910,11 @@ v__scanner__Scanner* v__scanner__new_scanner(string text, v__scanner__CommentsMo .is_inside_toplvl_statement = 0, .should_abort = 0, }, sizeof(v__scanner__Scanner))); - v__scanner__Scanner_init_scanner(s); + v__scanner__Scanner_scan_all_tokens_in_buffer(s); v__scanner__Scanner* _t1 = s; return _t1; } -VV_LOCAL_SYMBOL void v__scanner__Scanner_init_scanner(v__scanner__Scanner* s) { - v__scanner__Scanner_scan_all_tokens_in_buffer(s, s->comments_mode); -} - // Attr: [unsafe] void v__scanner__Scanner_free(v__scanner__Scanner* s) { array_free(&s->all_tokens); @@ -82236,18 +82328,15 @@ VV_LOCAL_SYMBOL v__token__Token v__scanner__Scanner_end_of_file(v__scanner__Scan return _t1; } -void v__scanner__Scanner_scan_all_tokens_in_buffer(v__scanner__Scanner* s, v__scanner__CommentsMode mode) { +void v__scanner__Scanner_scan_all_tokens_in_buffer(v__scanner__Scanner* s) { bool v__scanner__Scanner_scan_all_tokens_in_buffer_defer_0 = false; v__util__Timers* timers; timers = v__util__get_timers(); v__util__Timers_measure_pause(timers, _SLIT("PARSE")); v__util__timing_start(_SLIT("SCAN")); v__scanner__Scanner_scan_all_tokens_in_buffer_defer_0 = true; - v__scanner__CommentsMode oldmode = s->comments_mode; - s->comments_mode = mode; s->all_tokens = __new_array_with_default(0, s->text.len / 3, sizeof(v__token__Token), 0); v__scanner__Scanner_scan_remaining_text(s); - s->comments_mode = oldmode; s->tidx = 0; // Defer begin if (v__scanner__Scanner_scan_all_tokens_in_buffer_defer_0) { @@ -82270,13 +82359,8 @@ void v__scanner__Scanner_scan_remaining_text(v__scanner__Scanner* s) { } } -v__token__Token v__scanner__Scanner_scan(v__scanner__Scanner* s) { - v__token__Token _t1 = v__scanner__Scanner_buffer_scan(s); - return _t1; -} - // Attr: [direct_array_access] -v__token__Token v__scanner__Scanner_buffer_scan(v__scanner__Scanner* s) { +v__token__Token v__scanner__Scanner_scan(v__scanner__Scanner* s) { for (;;) { int cidx = s->tidx; s->tidx++; @@ -82999,7 +83083,7 @@ VV_LOCAL_SYMBOL string v__scanner__decode_h_escapes(string s, int start, Array_i int pos = ((int*)escapes_pos.data)[i]; int idx = pos - start; int end_idx = idx + 4; - Option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 2, end_idx), 16, 8); + _option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 2, end_idx), 16, 8); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(u64*) _t4.data = 0U; @@ -83027,7 +83111,7 @@ VV_LOCAL_SYMBOL string v__scanner__decode_o_escapes(string s, int start, Array_i int pos = ((int*)escapes_pos.data)[i]; int idx = pos - start; int end_idx = idx + 4; - Option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 1, end_idx), 8, 8); + _option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 1, end_idx), 8, 8); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(u64*) _t4.data = 0U; @@ -83055,7 +83139,7 @@ VV_LOCAL_SYMBOL string v__scanner__decode_u_escapes(string s, int start, Array_i int pos = ((int*)escapes_pos.data)[i]; int idx = pos - start; int end_idx = idx + 6; - Option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 2, end_idx), 16, 32); + _option_u64 _t4 = strconv__parse_uint(string_substr(s, idx + 2, end_idx), 16, 32); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(u64*) _t4.data = 0U; @@ -83293,11 +83377,11 @@ VV_LOCAL_SYMBOL void v__scanner__Scanner_trace(v__scanner__Scanner* s, string fb } // TypeDecl -Option_void v__ast__walker__Inspector_visit(v__ast__walker__Inspector* i, v__ast__Node* node) { +_option_void v__ast__walker__Inspector_visit(v__ast__walker__Inspector* i, v__ast__Node* node) { if (i->inspector_callback(node, i->data)) { - return (Option_void){0}; + return (_option_void){0}; } - return (Option_void){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("")), .data={EMPTY_STRUCT_INITIALIZATION} }; } void v__ast__walker__inspect(v__ast__Node* node, voidptr data, bool (*inspector_callback)(v__ast__Node* node, voidptr data)) { @@ -83306,7 +83390,7 @@ void v__ast__walker__inspect(v__ast__Node* node, voidptr data, bool (*inspector_ } void v__ast__walker__walk(v__ast__walker__Visitor* visitor, v__ast__Node* node) { - Option_void _t1 = v__ast__walker__Visitor_name_table[visitor->_typ]._method_visit(visitor->_object, node); + _option_void _t1 = v__ast__walker__Visitor_name_table[visitor->_typ]._method_visit(visitor->_object, node); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; return; @@ -83334,12 +83418,12 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_assign_stmt(v__parser__Parser* p) return _t2; } -VV_LOCAL_SYMBOL Option_void v__parser__Parser_check_undefined_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val) { +VV_LOCAL_SYMBOL _option_void v__parser__Parser_check_undefined_variables(v__parser__Parser* p, Array_v__ast__Expr exprs, v__ast__Expr val) { 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 > "), /*100 &int literal*/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--; @@ -83347,13 +83431,13 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; // Defer end return _t1; } - if (val._typ == 306 /* v.ast.Ident */) { + if (val._typ == 307 /* v.ast.Ident */) { for (int _t2 = 0; _t2 < exprs.len; ++_t2) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t2]; - if ((expr)._typ == 306 /* v.ast.Ident */) { + if ((expr)._typ == 307 /* 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: `"), /*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} }; + _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--; @@ -83364,16 +83448,16 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 286 /* v.ast.ArrayInit */) { + else if (val._typ == 287 /* 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); + _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) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t5; + _option_void _t5; memcpy(&_t5, &_t4, sizeof(Option)); return _t5; } @@ -83381,14 +83465,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } if ((*val._v__ast__ArrayInit).has_len) { - Option_void _t6 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).len_expr); + _option_void _t6 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).len_expr); if (_t6.state != 0 && _t6.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t7; + _option_void _t7; memcpy(&_t7, &_t6, sizeof(Option)); return _t7; } @@ -83396,14 +83480,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } if ((*val._v__ast__ArrayInit).has_default) { - Option_void _t8 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).default_expr); + _option_void _t8 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ArrayInit).default_expr); if (_t8.state != 0 && _t8.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t9; + _option_void _t9; memcpy(&_t9, &_t8, sizeof(Option)); return _t9; } @@ -83412,14 +83496,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } for (int _t10 = 0; _t10 < (*val._v__ast__ArrayInit).exprs.len; ++_t10) { v__ast__Expr expr = ((v__ast__Expr*)(*val._v__ast__ArrayInit).exprs.data)[_t10]; - Option_void _t11 = v__parser__Parser_check_undefined_variables(p, exprs, expr); + _option_void _t11 = v__parser__Parser_check_undefined_variables(p, exprs, expr); if (_t11.state != 0 && _t11.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t12; + _option_void _t12; memcpy(&_t12, &_t11, sizeof(Option)); return _t12; } @@ -83427,15 +83511,15 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 292 /* v.ast.CallExpr */) { - Option_void _t13 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__CallExpr).left); + else if (val._typ == 293 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t14; + _option_void _t14; memcpy(&_t14, &_t13, sizeof(Option)); return _t14; } @@ -83443,14 +83527,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; for (int _t15 = 0; _t15 < (*val._v__ast__CallExpr).args.len; ++_t15) { v__ast__CallArg arg = ((v__ast__CallArg*)(*val._v__ast__CallExpr).args.data)[_t15]; - Option_void _t16 = v__parser__Parser_check_undefined_variables(p, exprs, arg.expr); + _option_void _t16 = v__parser__Parser_check_undefined_variables(p, exprs, arg.expr); if (_t16.state != 0 && _t16.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t17; + _option_void _t17; memcpy(&_t17, &_t16, sizeof(Option)); return _t17; } @@ -83458,43 +83542,43 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 310 /* v.ast.InfixExpr */) { - Option_void _t18 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__InfixExpr).left); + else if (val._typ == 311 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t19; + _option_void _t19; memcpy(&_t19, &_t18, sizeof(Option)); return _t19; } ; - Option_void _t20 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__InfixExpr).right); + _option_void _t20 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__InfixExpr).right); if (_t20.state != 0 && _t20.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t21; + _option_void _t21; memcpy(&_t21, &_t20, sizeof(Option)); return _t21; } ; } - else if (val._typ == 307 /* v.ast.IfExpr */) { - Option_void _t22 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__IfExpr).left); + else if (val._typ == 308 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t23; + _option_void _t23; memcpy(&_t23, &_t22, sizeof(Option)); return _t23; } @@ -83502,14 +83586,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; for (int _t24 = 0; _t24 < (*val._v__ast__IfExpr).branches.len; ++_t24) { v__ast__IfBranch branch = ((v__ast__IfBranch*)(*val._v__ast__IfExpr).branches.data)[_t24]; - Option_void _t25 = v__parser__Parser_check_undefined_variables(p, exprs, branch.cond); + _option_void _t25 = v__parser__Parser_check_undefined_variables(p, exprs, branch.cond); if (_t25.state != 0 && _t25.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t26; + _option_void _t26; memcpy(&_t26, &_t25, sizeof(Option)); return _t26; } @@ -83517,15 +83601,15 @@ 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 == 346 /* v.ast.ExprStmt */) { - Option_void _t28 = v__parser__Parser_check_undefined_variables(p, exprs, (*stmt._v__ast__ExprStmt).expr); + if ((stmt)._typ == 347 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t29; + _option_void _t29; memcpy(&_t29, &_t28, sizeof(Option)); return _t29; } @@ -83535,17 +83619,17 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 315 /* v.ast.MapInit */) { + else if (val._typ == 316 /* 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); + _option_void _t31 = v__parser__Parser_check_undefined_variables(p, exprs, key); if (_t31.state != 0 && _t31.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t32; + _option_void _t32; memcpy(&_t32, &_t31, sizeof(Option)); return _t32; } @@ -83554,14 +83638,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } for (int _t33 = 0; _t33 < (*val._v__ast__MapInit).vals.len; ++_t33) { v__ast__Expr value = ((v__ast__Expr*)(*val._v__ast__MapInit).vals.data)[_t33]; - Option_void _t34 = v__parser__Parser_check_undefined_variables(p, exprs, value); + _option_void _t34 = v__parser__Parser_check_undefined_variables(p, exprs, value); if (_t34.state != 0 && _t34.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t35; + _option_void _t35; memcpy(&_t35, &_t34, sizeof(Option)); return _t35; } @@ -83569,15 +83653,15 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 316 /* v.ast.MatchExpr */) { - Option_void _t36 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__MatchExpr).cond); + else if (val._typ == 317 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t37; + _option_void _t37; memcpy(&_t37, &_t36, sizeof(Option)); return _t37; } @@ -83587,14 +83671,14 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; v__ast__MatchBranch branch = ((v__ast__MatchBranch*)(*val._v__ast__MatchExpr).branches.data)[_t38]; for (int _t39 = 0; _t39 < branch.exprs.len; ++_t39) { v__ast__Expr expr = ((v__ast__Expr*)branch.exprs.data)[_t39]; - Option_void _t40 = v__parser__Parser_check_undefined_variables(p, exprs, expr); + _option_void _t40 = v__parser__Parser_check_undefined_variables(p, exprs, expr); if (_t40.state != 0 && _t40.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t41; + _option_void _t41; memcpy(&_t41, &_t40, sizeof(Option)); return _t41; } @@ -83603,15 +83687,15 @@ 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 == 346 /* v.ast.ExprStmt */) { - Option_void _t43 = v__parser__Parser_check_undefined_variables(p, exprs, (*stmt._v__ast__ExprStmt).expr); + if ((stmt)._typ == 347 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t44; + _option_void _t44; memcpy(&_t44, &_t43, sizeof(Option)); return _t44; } @@ -83621,62 +83705,62 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; } } } - else if (val._typ == 321 /* v.ast.ParExpr */) { - Option_void _t45 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__ParExpr).expr); + else if (val._typ == 322 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t46; + _option_void _t46; memcpy(&_t46, &_t45, sizeof(Option)); return _t46; } ; } - else if (val._typ == 322 /* v.ast.PostfixExpr */) { - Option_void _t47 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__PostfixExpr).expr); + else if (val._typ == 323 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t48; + _option_void _t48; memcpy(&_t48, &_t47, sizeof(Option)); return _t48; } ; } - else if (val._typ == 323 /* v.ast.PrefixExpr */) { - Option_void _t49 = v__parser__Parser_check_undefined_variables(p, exprs, (*val._v__ast__PrefixExpr).right); + else if (val._typ == 324 /* 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 if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t50; + _option_void _t50; memcpy(&_t50, &_t49, sizeof(Option)); return _t50; } ; } - else if (val._typ == 329 /* v.ast.StringInterLiteral */) { + else if (val._typ == 330 /* 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_); + _option_void _t52 = v__parser__Parser_check_undefined_variables(p, exprs, expr_); if (_t52.state != 0 && _t52.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t53; + _option_void _t53; memcpy(&_t53, &_t52, sizeof(Option)); return _t53; } @@ -83684,17 +83768,17 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; ; } } - else if (val._typ == 331 /* v.ast.StructInit */) { + else if (val._typ == 332 /* 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); + _option_void _t55 = v__parser__Parser_check_undefined_variables(p, exprs, field.expr); if (_t55.state != 0 && _t55.err._typ != _IError_None___index) { // Defer begin if (v__parser__Parser_check_undefined_variables_defer_0) { p->expr_level--; } // Defer end - Option_void _t56; + _option_void _t56; memcpy(&_t56, &_t55, sizeof(Option)); return _t56; } @@ -83711,15 +83795,15 @@ bool v__parser__Parser_check_undefined_variables_defer_0 = false; p->expr_level--; } // Defer end - return (Option_void){0}; + return (_option_void){0}; } 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 == 306 /* v.ast.Ident */) { + if (val._typ == 307 /* v.ast.Ident */) { for (int _t1 = 0; _t1 < exprs.len; ++_t1) { v__ast__Expr expr = ((v__ast__Expr*)exprs.data)[_t1]; - if ((expr)._typ == 306 /* v.ast.Ident */) { + if ((expr)._typ == 307 /* v.ast.Ident */) { if (string__eq((*expr._v__ast__Ident).name, (*val._v__ast__Ident).name)) { bool _t2 = true; return _t2; @@ -83727,7 +83811,7 @@ VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* } } } - else if (val._typ == 309 /* v.ast.IndexExpr */) { + else if (val._typ == 310 /* 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)) { @@ -83736,19 +83820,19 @@ VV_LOCAL_SYMBOL bool v__parser__Parser_check_cross_variables(v__parser__Parser* } } } - else if (val._typ == 310 /* v.ast.InfixExpr */) { + else if (val._typ == 311 /* 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 == 323 /* v.ast.PrefixExpr */) { + else if (val._typ == 324 /* v.ast.PrefixExpr */) { bool _t6 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__PrefixExpr).right); return _t6; } - else if (val._typ == 322 /* v.ast.PostfixExpr */) { + else if (val._typ == 323 /* v.ast.PostfixExpr */) { bool _t7 = v__parser__Parser_check_cross_variables(p, exprs, (*val._v__ast__PostfixExpr).expr); return _t7; } - else if (val._typ == 326 /* v.ast.SelectorExpr */) { + else if (val._typ == 327 /* 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)) { @@ -83786,14 +83870,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 == 306 /* v.ast.Ident */) { + if (lx._typ == 307 /* 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 `"), /*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 == 416 /* v.ast.IdentVar */) { + if (((*lx._v__ast__Ident).info)._typ == 417 /* 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) { @@ -83828,7 +83912,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 == 292 /* v.ast.CallExpr */) { + if ((r0)._typ == 293 /* 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; } @@ -83839,18 +83923,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 == 309 /* v.ast.IndexExpr */) { + else if (lx._typ == 310 /* 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 `"), /*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 == 321 /* v.ast.ParExpr */) { + else if (lx._typ == 322 /* v.ast.ParExpr */) { } - else if (lx._typ == 323 /* v.ast.PrefixExpr */) { + else if (lx._typ == 324 /* v.ast.PrefixExpr */) { } - else if (lx._typ == 326 /* v.ast.SelectorExpr */) { + else if (lx._typ == 327 /* 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; @@ -83864,7 +83948,7 @@ VV_LOCAL_SYMBOL v__ast__Stmt v__parser__Parser_partial_assign_stmt(v__parser__Pa if (op == v__token__Kind__decl_assign) { for (int _t8 = 0; _t8 < right.len; ++_t8) { v__ast__Expr r = ((v__ast__Expr*)right.data)[_t8]; - Option_void _t9 = v__parser__Parser_check_undefined_variables(p, left, r); + _option_void _t9 = v__parser__Parser_check_undefined_variables(p, left, r); if (_t9.state != 0 && _t9.err._typ != _IError_None___index) { IError err = _t9.err; v__ast__Stmt _t10 = v__ast__NodeError_to_sumtype_v__ast__Stmt(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, IError_name_table[err._typ]._method_msg(err._object), pos)))); @@ -84326,7 +84410,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser v__parser__Parser_scope_register_it_as_index(p); default_expr = v__parser__Parser_expr(p, 0); bool _t5; /* if prepend */ - Option_v__ast__Var_ptr _t6; + _option_v__ast__Var_ptr _t6; if (_t6 = v__ast__Scope_find_var(p->scope, _SLIT("it")), _t6.state == 0) { v__ast__Var* var = *(v__ast__Var**)_t6.data; v__ast__Var* variable = var; @@ -84389,7 +84473,7 @@ VV_LOCAL_SYMBOL v__ast__ArrayInit v__parser__Parser_array_init(v__parser__Parser v__parser__Parser_scope_register_it_as_index(p); default_expr = v__parser__Parser_expr(p, 0); bool _t7; /* if prepend */ - Option_v__ast__Var_ptr _t8; + _option_v__ast__Var_ptr _t8; if (_t8 = v__ast__Scope_find_var(p->scope, _SLIT("it")), _t8.state == 0) { v__ast__Var* var = *(v__ast__Var**)_t8.data; v__ast__Var* variable = var; @@ -84466,7 +84550,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_scope_register_it_as_index(v__parser__Par } 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); + _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 "), /*115 &v.token.Token*/0xfe10, {.d_s = v__token__Token_str(p->tok)}}, {_SLIT0, 0, { .d_c = 0 }}})), v__token__Token_pos(&p->tok))))); @@ -84476,7 +84560,7 @@ v__ast__Expr v__parser__Parser_expr(v__parser__Parser* p, int precedence) { return _t1; } -Option_v__ast__Expr v__parser__Parser_check_expr(v__parser__Parser* p, int precedence) { +_option_v__ast__Expr v__parser__Parser_check_expr(v__parser__Parser* p, int precedence) { bool v__parser__Parser_check_expr_defer_0 = false; bool inside_array_lit; ; @@ -84545,8 +84629,8 @@ bool inside_array_lit; case v__token__Kind__comment: { node = v__ast__Comment_to_sumtype_v__ast__Expr(ADDR(v__ast__Comment, (v__parser__Parser_comment(p)))); - Option_v__ast__Expr _t5; - opt_ok(&(v__ast__Expr[]) { node }, (Option*)(&_t5), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t5; + opt_ok2(&(v__ast__Expr[]) { node }, (_option*)(&_t5), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84577,8 +84661,8 @@ bool inside_array_lit; p->is_stmt_ident = is_stmt_ident; } else if (p->peek_tok.kind == (v__token__Kind__key_if)) { - Option_v__ast__Expr _t6; - opt_ok(&(v__ast__Expr[]) { v__ast__IfExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__IfExpr, (v__parser__Parser_if_expr(p, true)))) }, (Option*)(&_t6), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t6; + opt_ok2(&(v__ast__Expr[]) { v__ast__IfExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__IfExpr, (v__parser__Parser_if_expr(p, true)))) }, (_option*)(&_t6), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84587,8 +84671,8 @@ bool inside_array_lit; return _t6; } else { - Option_v__ast__Expr _t7; - opt_ok(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("unexpected `$`"), v__token__Token_pos(&p->peek_tok))))) }, (Option*)(&_t7), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t7; + opt_ok2(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("unexpected `$`"), v__token__Token_pos(&p->peek_tok))))) }, (_option*)(&_t7), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84670,8 +84754,8 @@ bool inside_array_lit; v__token__Pos pos = v__token__Token_pos(&p->tok); v__parser__Parser_next(p); if (p->inside_unsafe) { - Option_v__ast__Expr _t8; - opt_ok(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("already inside `unsafe` block"), pos)))) }, (Option*)(&_t8), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t8; + opt_ok2(&(v__ast__Expr[]) { v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, _SLIT("already inside `unsafe` block"), pos)))) }, (_option*)(&_t8), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84782,8 +84866,8 @@ bool inside_array_lit; v__ast__Type st = v__parser__Parser_parse_type(p); 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 `"), /*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)); + _option_v__ast__Expr _t9; + opt_ok2(&(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; @@ -84820,8 +84904,8 @@ bool inside_array_lit; { if (p->expecting_type) { v__token__Pos start_pos = v__token__Token_pos(&p->tok); - Option_v__ast__Expr _t10; - opt_ok(&(v__ast__Expr[]) { v__ast__TypeNode_to_sumtype_v__ast__Expr(ADDR(v__ast__TypeNode, (((v__ast__TypeNode){.typ = v__parser__Parser_parse_type(p),.pos = v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok)),})))) }, (Option*)(&_t10), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t10; + opt_ok2(&(v__ast__Expr[]) { v__ast__TypeNode_to_sumtype_v__ast__Expr(ADDR(v__ast__TypeNode, (((v__ast__TypeNode){.typ = v__parser__Parser_parse_type(p),.pos = v__token__Pos_extend(start_pos, v__token__Token_pos(&p->prev_tok)),})))) }, (_option*)(&_t10), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84837,8 +84921,8 @@ bool inside_array_lit; v__parser__Parser_check(p, v__token__Kind__rpar); node = v__ast__CallExpr_to_sumtype_v__ast__Expr(ADDR(v__ast__CallExpr, (((v__ast__CallExpr){.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,},},.args = args,.expected_arg_types = __new_array(0, 0, sizeof(v__ast__Type)),.concrete_types = __new_array(0, 0, sizeof(v__ast__Type)),.raw_concrete_types = __new_array(0, 0, sizeof(v__ast__Type)),.from_embed_types = __new_array(0, 0, sizeof(v__ast__Type)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.mod = (string){.str=(byteptr)"", .is_lit=1},.name = _SLIT("anon"),.left = node,.scope = p->scope,.pos = pos,.name_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.concrete_list_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.left_type = 0,.receiver_type = 0,.return_type = 0,.fn_var_type = 0,.language = 0,.is_method = 0,.is_field = 0,.is_fn_var = 0,.is_keep_alive = 0,.is_noreturn = 0,.is_ctor_new = 0,.should_be_skipped = 0,.free_receiver = 0,})))); } - Option_v__ast__Expr _t11; - opt_ok(&(v__ast__Expr[]) { node }, (Option*)(&_t11), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t11; + opt_ok2(&(v__ast__Expr[]) { node }, (_option*)(&_t11), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84925,7 +85009,7 @@ bool inside_array_lit; default: { if (p->tok.kind != v__token__Kind__eof && !(p->tok.kind == v__token__Kind__rsbr && p->inside_asm)) { - Option_v__ast__Expr _t12 = (Option_v__ast__Expr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_v__ast__Expr _t12 = (_option_v__ast__Expr){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84939,8 +85023,8 @@ bool inside_array_lit; ; if (inside_array_lit) { if ((p->tok.kind == v__token__Kind__minus || p->tok.kind == v__token__Kind__mul || p->tok.kind == v__token__Kind__amp || p->tok.kind == v__token__Kind__arrow) && p->tok.pos + 1 == p->peek_tok.pos && p->prev_tok.pos + p->prev_tok.len + 1 != p->peek_tok.pos) { - Option_v__ast__Expr _t13; - opt_ok(&(v__ast__Expr[]) { node }, (Option*)(&_t13), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t13; + opt_ok2(&(v__ast__Expr[]) { node }, (_option*)(&_t13), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84952,8 +85036,8 @@ bool inside_array_lit; if (p->inside_if_cond) { _PUSH_MANY(&p->if_cond_comments, (v__parser__Parser_eat_comments(p, ((v__parser__EatCommentsConfig){.same_line = 0,.follow_up = 0,}))), _t14, Array_v__ast__Comment); } - Option_v__ast__Expr _t15; - opt_ok(&(v__ast__Expr[]) { v__parser__Parser_expr_with_left(p, node, precedence, is_stmt_ident) }, (Option*)(&_t15), sizeof(v__ast__Expr)); + _option_v__ast__Expr _t15; + opt_ok2(&(v__ast__Expr[]) { v__parser__Parser_expr_with_left(p, node, precedence, is_stmt_ident) }, (_option*)(&_t15), sizeof(v__ast__Expr)); // Defer begin if (v__parser__Parser_check_expr_defer_0) { p->inside_array_lit = inside_array_lit; @@ -84984,7 +85068,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 == 309 /* v.ast.IndexExpr */) { + if (p->tok.kind == v__token__Kind__lpar && p->tok.line_nr == p->prev_tok.line_nr && (node)._typ == 310 /* 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); @@ -85008,7 +85092,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 == 309 /* v.ast.IndexExpr */) { + if ((node)._typ == 310 /* 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){.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,},},.left = node,.right = right,.auto_locked = (string){.str=(byteptr)"", .is_lit=1},.ct_left_value = v__ast__empty_comptime_const_expr(),.ct_right_value = v__ast__empty_comptime_const_expr(),.pos = pos,.left_type = 0,.right_type = 0,.op = tok.kind,.is_stmt = true,.ct_left_value_evaled = 0,.ct_right_value_evaled = 0,})))); @@ -85034,7 +85118,7 @@ v__ast__Expr v__parser__Parser_expr_with_left(v__parser__Parser* p, v__ast__Expr 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, /*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 == 309 /* v.ast.IndexExpr */) { + if ((node)._typ == 310 /* 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},})))); @@ -85074,7 +85158,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 == 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) { + if (p->pref->is_vet && (op == v__token__Kind__key_in || op == v__token__Kind__not_in) && (right)._typ == 287 /* v.ast.ArrayInit */ && (/* as */ *(v__ast__ArrayInit*)__as_cast((right)._v__ast__ArrayInit,(right)._typ, 287) /*expected idx: 287, 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); @@ -85137,27 +85221,27 @@ 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 == 293 /* v.ast.CastExpr */) { + if ((right)._typ == 294 /* 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 == 326 /* v.ast.SelectorExpr */) { - if (((*right._v__ast__SelectorExpr).expr)._typ == 293 /* v.ast.CastExpr */) { + if ((right)._typ == 327 /* v.ast.SelectorExpr */) { + if (((*right._v__ast__SelectorExpr).expr)._typ == 294 /* 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 == 309 /* v.ast.IndexExpr */) { - if (((*right._v__ast__IndexExpr).left)._typ == 293 /* v.ast.CastExpr */) { + if ((right)._typ == 310 /* v.ast.IndexExpr */) { + if (((*right._v__ast__IndexExpr).left)._typ == 294 /* 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 == 321 /* v.ast.ParExpr */) { - if (((*right._v__ast__ParExpr).expr)._typ == 331 /* v.ast.StructInit */) { + if ((right)._typ == 322 /* v.ast.ParExpr */) { + if (((*right._v__ast__ParExpr).expr)._typ == 332 /* 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; } @@ -85320,7 +85404,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 == 331 /* v.ast.StructInit */) { + if ((expr)._typ == 332 /* 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); } @@ -85393,7 +85477,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { v__parser__Parser_note_with_pos(p, _SLIT("the tag [windows_stdcall] has been deprecated, it will be an error after 2022-06-01, use `[callconv: stdcall]` instead"), v__token__Token_pos(&p->tok)); } else if (string__eq(fna.name, _SLIT("_fastcall"))) { - v__parser__Parser_note_with_pos(p, _SLIT("teh tag [_fastcall] has been deprecated, it will be an error after 2022-06-01, use `[callconv: fastcall]` instead"), v__token__Token_pos(&p->tok)); + v__parser__Parser_note_with_pos(p, _SLIT("the tag [_fastcall] has been deprecated, it will be an error after 2022-06-01, use `[callconv: fastcall]` instead"), v__token__Token_pos(&p->tok)); } else if (string__eq(fna.name, _SLIT("callconv"))) { if (!fna.has_arg) { @@ -85406,7 +85490,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { else { }; } - Option_int _t2 = Array_v__ast__Attr_find_comptime_define(p->attrs); + _option_int _t2 = Array_v__ast__Attr_find_comptime_define(p->attrs); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(int*) _t2.data = -1; @@ -85451,7 +85535,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { Array_v__ast__Param params = __new_array_with_default(0, 0, sizeof(v__ast__Param), 0); if (p->tok.kind == v__token__Kind__lpar) { is_method = true; - Option_void _t5 = v__parser__Parser_fn_receiver(p, &/*arr*/params, (voidptr)&/*qq*/rec); + _option_void _t5 = v__parser__Parser_fn_receiver(p, &/*arr*/params, (voidptr)&/*qq*/rec); if (_t5.state != 0 && _t5.err._typ != _IError_None___index) { IError err = _t5.err; v__ast__FnDecl _t6 = ((v__ast__FnDecl){.receiver = (v__ast__StructField){.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.default_val = (string){.str=(byteptr)"", .is_lit=1},.name = (string){.str=(byteptr)"", .is_lit=1},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.i = 0,.default_expr_typ = 0,.typ = 0,.has_default_expr = 0,.is_pub = 0,.is_mut = 0,.is_global = 0,.is_volatile = 0,},.generic_names = __new_array(0, 0, sizeof(string)),.attrs = __new_array(0, 0, sizeof(v__ast__Attr)),.params = __new_array(0, 0, sizeof(v__ast__Param)),.stmts = __new_array(0, 0, sizeof(v__ast__Stmt)),.defer_stmts = __new_array(0, 0, sizeof(v__ast__DeferStmt)),.comments = __new_array(0, 0, sizeof(v__ast__Comment)),.end_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.next_comments = __new_array(0, 0, sizeof(v__ast__Comment)),.label_names = __new_array(0, 0, sizeof(string)),.name = (string){.str=(byteptr)"", .is_lit=1},.short_name = (string){.str=(byteptr)"", .is_lit=1},.mod = (string){.str=(byteptr)"", .is_lit=1},.file = (string){.str=(byteptr)"", .is_lit=1},.source_file = 0,.scope = 0,.receiver_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.body_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.return_type_pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.pos = (v__token__Pos){.len = 0,.line_nr = 0,.pos = 0,.col = 0,.last_line = 0,},.method_idx = 0,.ctdefine_idx = -1,.idx = 0,.return_type = 0,.ninstances = 0,.language = 0,.file_mode = 0,.rec_share = 0,.is_deprecated = 0,.is_pub = 0,.is_variadic = 0,.is_anon = 0,.is_noreturn = 0,.is_manualfree = 0,.is_main = 0,.is_test = 0,.is_conditional = 0,.is_exported = 0,.is_keep_alive = 0,.is_unsafe = 0,.is_markused = 0,.is_method = 0,.rec_mut = 0,.no_body = 0,.is_builtin = 0,.is_direct_arr = 0,.has_return = 0,.should_be_skipped = 0,.has_await = 0,}); @@ -85475,7 +85559,7 @@ 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 == 474 /* v.ast.Interface */) { + if ((type_sym->info)._typ == 475 /* v.ast.Interface */) { is_duplicate = !v__ast__Interface_has_method(&(*type_sym->info._v__ast__Interface), name); } } @@ -85509,7 +85593,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* 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 == 456 /* v.ast.Struct */) { + if ((sym->info)._typ == 457 /* v.ast.Struct */) { Array_string fn_generic_names = array_clone_to_depth(&generic_names, 0); Array_string _t11 = {0}; Array_v__ast__Type _t11_orig = (*sym->info._v__ast__Struct).generic_types; @@ -85637,7 +85721,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { } if (!p->pref->translated && language == v__ast__Language__v) { v__ast__Fn* _t20 = (v__ast__Fn*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, p->table->fns), &(string[]){name})); - Option_v__ast__Fn _t19 = {0}; + _option_v__ast__Fn _t19 = {0}; if (_t20) { *((v__ast__Fn*)&_t19.data) = *((v__ast__Fn*)_t20); } else { @@ -85767,7 +85851,7 @@ VV_LOCAL_SYMBOL v__ast__FnDecl v__parser__Parser_fn_decl(v__parser__Parser* p) { return _t23; } -VV_LOCAL_SYMBOL Option_void v__parser__Parser_fn_receiver(v__parser__Parser* p, Array_v__ast__Param* params, v__parser__ReceiverParsingInfo* rec) { +VV_LOCAL_SYMBOL _option_void v__parser__Parser_fn_receiver(v__parser__Parser* p, Array_v__ast__Param* params, v__parser__ReceiverParsingInfo* rec) { bool v__parser__Parser_fn_receiver_defer_0 = false; p->inside_receiver_param = true; v__parser__Parser_fn_receiver_defer_0 = true; @@ -85800,7 +85884,7 @@ bool v__parser__Parser_fn_receiver_defer_0 = false; rec->type_pos = v__token__Token_pos(&p->tok); rec->typ = v__parser__Parser_parse_type_with_mut(p, rec->is_mut); if (v__ast__Type_idx(rec->typ) == 0) { - Option_void _t1 = (Option_void){ .state=2, .err=_v_error(_SLIT("void receiver type")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t1 = (_option_void){ .state=2, .err=_v_error(_SLIT("void receiver type")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_fn_receiver_defer_0) { p->inside_receiver_param = false; @@ -85811,7 +85895,7 @@ bool v__parser__Parser_fn_receiver_defer_0 = false; rec->type_pos = v__token__Pos_extend(rec->type_pos, v__token__Token_pos(&p->prev_tok)); if (is_amp && rec->is_mut) { v__parser__Parser_error_with_pos(p, _SLIT("use `(mut f Foo)` or `(f &Foo)` instead of `(mut f &Foo)`"), v__token__Pos_extend(lpar_pos, v__token__Token_pos(&p->tok))); - Option_void _t2 = (Option_void){ .state=2, .err=_v_error(_SLIT("invalid `mut f &Foo`")), .data={EMPTY_STRUCT_INITIALIZATION} }; + _option_void _t2 = (_option_void){ .state=2, .err=_v_error(_SLIT("invalid `mut f &Foo`")), .data={EMPTY_STRUCT_INITIALIZATION} }; // Defer begin if (v__parser__Parser_fn_receiver_defer_0) { p->inside_receiver_param = false; @@ -85828,7 +85912,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, 456) /*expected idx: 456, name: v.ast.Struct */ ; + v__ast__Struct info = /* as */ *(v__ast__Struct*)__as_cast((type_sym->info)._v__ast__Struct,(type_sym->info)._typ, 457) /*expected idx: 457, 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; @@ -85856,7 +85940,7 @@ bool v__parser__Parser_fn_receiver_defer_0 = false; p->inside_receiver_param = false; } // Defer end - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL v__ast__AnonFn v__parser__Parser_anon_fn(v__parser__Parser* p) { @@ -86176,7 +86260,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 == 292 /* v.ast.CallExpr */) { + if ((expr)._typ == 293 /* 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)); @@ -86203,7 +86287,7 @@ VV_LOCAL_SYMBOL Array_v__ast__Param v__parser__Parser_closure_vars(v__parser__Pa v__token__Pos var_pos = v__token__Token_pos(&p->tok); v__parser__Parser_check(p, v__token__Kind__name); string var_name = p->prev_tok.lit; - Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(p->scope->parent, var_name); + _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: `"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}})), v__token__Token_pos(&p->prev_tok)); @@ -86236,7 +86320,7 @@ 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, 471) /*expected idx: 471, name: v.ast.Alias */ ).parent_type; + v__ast__Type atyp = (/* as */ *(v__ast__Alias*)__as_cast((sym->info)._v__ast__Alias,(sym->info)._typ, 472) /*expected idx: 472, name: v.ast.Alias */ ).parent_type; v__parser__Parser_check_fn_mutable_arguments(p, atyp, pos); return; } @@ -86263,7 +86347,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_check_fn_atomic_arguments(v__parser__Pars 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 == 219 /* v.ast.FnDecl */) { + if ((stmt)._typ == 220 /* v.ast.FnDecl */) { if (string__eq((*stmt._v__ast__FnDecl).name, _SLIT("main.main"))) { bool _t2 = true; return _t2; @@ -86559,7 +86643,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 == 292 /* v.ast.CallExpr */ || (expr)._typ == 309 /* v.ast.IndexExpr */ || (expr)._typ == 323 /* v.ast.PrefixExpr */)) { + if (!((expr)._typ == 293 /* v.ast.CallExpr */ || (expr)._typ == 310 /* v.ast.IndexExpr */ || (expr)._typ == 324 /* 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,})))); @@ -86833,14 +86917,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 == 346 /* v.ast.ExprStmt */) { + if (stmt._typ == 347 /* 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 == 310 /* v.ast.InfixExpr */) { + if ((*stmt._v__ast__ExprStmt).expr._typ == 311 /* v.ast.InfixExpr */) { if ((*(*stmt._v__ast__ExprStmt).expr._v__ast__InfixExpr).op != v__token__Kind__arrow) { check_timeout = true; } else if (is_gt) { @@ -86868,9 +86952,9 @@ VV_LOCAL_SYMBOL v__ast__SelectExpr v__parser__Parser_select_expr(v__parser__Pars has_timeout = true; } } - else if (stmt._typ == 338 /* v.ast.AssignStmt */) { + else if (stmt._typ == 339 /* v.ast.AssignStmt */) { v__ast__Expr expr = (*(v__ast__Expr*)/*ee elem_sym */array_get((*stmt._v__ast__AssignStmt).right, 0)); - if (expr._typ == 323 /* v.ast.PrefixExpr */) { + if (expr._typ == 324 /* 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,}); @@ -86982,7 +87066,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 == 296 /* v.ast.Comment */) { + if ((expr)._typ == 297 /* 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 })); @@ -87105,21 +87189,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 == 311 /* v.ast.IntegerLiteral */) { + if (size_expr._typ == 312 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*size_expr._v__ast__IntegerLiteral).val); } - else if (size_expr._typ == 306 /* v.ast.Ident */) { + else if (size_expr._typ == 307 /* v.ast.Ident */) { bool show_non_const_error = false; - Option_v__ast__ConstField_ptr _t1; + _option_v__ast__ConstField_ptr _t1; 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 == 311 /* v.ast.IntegerLiteral */) { + if ((const_field->expr)._typ == 312 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*const_field->expr._v__ast__IntegerLiteral).val); } else { - if ((const_field->expr)._typ == 310 /* v.ast.InfixExpr */) { + if ((const_field->expr)._typ == 311 /* 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 == 311 /* v.ast.IntegerLiteral */) { + if ((folded_expr)._typ == 312 /* v.ast.IntegerLiteral */) { fixed_size = string_int((*folded_expr._v__ast__IntegerLiteral).val); } else { show_non_const_error = true; @@ -87561,7 +87645,7 @@ 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 == 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) { + if (is_optional && (sym->info)._typ == 476 /* v.ast.SumType */ && (/* as */ *(v__ast__SumType*)__as_cast((sym->info)._v__ast__SumType,(sym->info)._typ, 476) /*expected idx: 476, 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))); } } @@ -87818,21 +87902,21 @@ 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 == 456 /* v.ast.Struct */) { + if (parent_sym->info._typ == 457 /* 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 `"), /*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 `"), /*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.Interface */) { + else if (parent_sym->info._typ == 475 /* 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 `"), /*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 `"), /*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 == 475 /* v.ast.SumType */) { + else if (parent_sym->info._typ == 476 /* 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 `"), /*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) { @@ -88075,7 +88159,7 @@ void v__parser__Parser_set_path(v__parser__Parser* p, string path) { p->file_backend_mode = v__ast__Language__js; } else { - Option_v__pref__Arch _t1 = v__pref__arch_from_string(actual_language); + _option_v__pref__Arch _t1 = v__pref__arch_from_string(actual_language); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(v__pref__Arch*) _t1.data = v__pref__Arch___auto; @@ -88090,7 +88174,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) { - Option_v__scanner__Scanner_ptr _t1 = v__scanner__new_scanner_file(path, comments_mode, pref); + _option_v__scanner__Scanner_ptr _t1 = v__scanner__new_scanner_file(path, comments_mode, pref); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -88184,7 +88268,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) { 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))); - Option_v__scanner__Scanner_ptr _t1 = v__scanner__new_scanner_file(path, v__scanner__CommentsMode__parse_comments, pref); + _option_v__scanner__Scanner_ptr _t1 = v__scanner__new_scanner_file(path, v__scanner__CommentsMode__parse_comments, pref); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -88271,7 +88355,7 @@ multi_return_ref_v__ast__File_Array_v__vet__Error v__parser__parse_vet_file(stri }); v__parser__Parser_set_path(&p, path); if (string_contains_any_substr(p.scanner->text, new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("\n "), _SLIT(" \n")})))) { - Option_Array_string _t2 = os__read_lines(path); + _option_Array_string _t2 = os__read_lines(path); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(Array_string*) _t2.data = __new_array_with_default(0, 0, sizeof(string), 0); @@ -88328,7 +88412,7 @@ bool v__parser__Parser_parse_defer_0 = false; break; } v__ast__Stmt stmt = v__parser__Parser_top_stmt(p); - 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 */)) { + if (!((stmt)._typ == 347 /* v.ast.ExprStmt */ && ((/* as */ *(v__ast__ExprStmt*)__as_cast((stmt)._v__ast__ExprStmt,(stmt)._typ, 347) /*expected idx: 347, name: v.ast.ExprStmt */ ).expr)._typ == 297 /* 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 })); @@ -88825,17 +88909,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 == 349 /* v.ast.ForStmt */) { + if (stmt._typ == 350 /* 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 == 348 /* v.ast.ForInStmt */) { + else if (stmt._typ == 349 /* 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 == 347 /* v.ast.ForCStmt */) { + else if (stmt._typ == 348 /* 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; @@ -89097,7 +89181,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; v__ast__Scope* backup_scope = p->scope; v__token__Pos pos = v__token__Token_pos(&p->tok); v__parser__Parser_check(p, v__token__Kind__key_asm); - Option_v__pref__Arch _t1 = v__pref__arch_from_string(p->tok.lit); + _option_v__pref__Arch _t1 = v__pref__arch_from_string(p->tok.lit); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; *(v__pref__Arch*) _t1.data = v__pref__Arch___auto; @@ -89107,7 +89191,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; bool is_volatile = false; bool is_goto = false; if (p->tok.kind == v__token__Kind__key_volatile) { - Option_v__pref__Arch _t2 = v__pref__arch_from_string(p->peek_tok.lit); + _option_v__pref__Arch _t2 = v__pref__arch_from_string(p->peek_tok.lit); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; *(v__pref__Arch*) _t2.data = v__pref__Arch___auto; @@ -89117,7 +89201,7 @@ bool v__parser__Parser_asm_stmt_defer_0 = false; is_volatile = true; v__parser__Parser_next(p); } else if (p->tok.kind == v__token__Kind__key_goto) { - Option_v__pref__Arch _t3 = v__pref__arch_from_string(p->peek_tok.lit); + _option_v__pref__Arch _t3 = v__pref__arch_from_string(p->peek_tok.lit); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; *(v__pref__Arch*) _t3.data = v__pref__Arch___auto; @@ -89201,10 +89285,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 == 304 /* v.ast.FloatLiteral */) { + if (number_lit._typ == 305 /* 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 == 311 /* v.ast.IntegerLiteral */) { + else if (number_lit._typ == 312 /* 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 { @@ -89259,7 +89343,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, 437) /*expected idx: 437, 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, 438) /*expected idx: 438, name: v.ast.AsmAlias */ ).name) })); } } array_push((array*)&templates, _MOV((v__ast__AsmTemplate[]){ ((v__ast__AsmTemplate){ @@ -89361,7 +89445,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 == 361 /* v.ast.AsmRegister */) { + if ((x)._typ == 362 /* 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 { @@ -89535,7 +89619,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 == 321 /* v.ast.ParExpr */) { + if ((expr)._typ == 322 /* v.ast.ParExpr */) { expr = (*expr._v__ast__ParExpr).expr; } else { v__parser__Parser_error(p, _SLIT("asm in/output must be enclosed in brackets")); @@ -89545,7 +89629,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 == 306 /* v.ast.Ident */) { + } else if ((expr)._typ == 307 /* 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); @@ -89568,7 +89652,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 == 296 /* v.ast.Comment */) { + if ((expr)._typ == 297 /* 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 })); @@ -89666,7 +89750,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 == 322 /* v.ast.PostfixExpr */) { + if ((comptime_cond)._typ == 323 /* v.ast.PostfixExpr */) { comptime_cond_opt = true; } name = v__ast__Expr_str(comptime_cond); @@ -89898,8 +89982,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 != 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_top_level || p->tok.kind != v__token__Kind__rcbr) && (node)._typ != 293 /* v.ast.CallExpr */ && (node)._typ != 323 /* v.ast.PostfixExpr */ && (node)._typ != 298 /* v.ast.ComptimeCall */ && (node)._typ != 327 /* v.ast.SelectorExpr */ && (node)._typ != 302 /* v.ast.DumpExpr */) { + bool is_complex_infix_expr = (node)._typ == 311 /* v.ast.InfixExpr */ && ((/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 311) /*expected idx: 311, name: v.ast.InfixExpr */ ).op == v__token__Kind__left_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 311) /*expected idx: 311, name: v.ast.InfixExpr */ ).op == v__token__Kind__right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 311) /*expected idx: 311, name: v.ast.InfixExpr */ ).op == v__token__Kind__unsigned_right_shift || (/* as */ *(v__ast__InfixExpr*)__as_cast((node)._v__ast__InfixExpr,(node)._typ, 311) /*expected idx: 311, 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; @@ -90310,7 +90394,7 @@ v__ast__Expr v__parser__Parser_name_expr(v__parser__Parser* p) { enum_name = string__plus(string__plus(mod, _SLIT(".")), enum_name); } else { string* _t23 = (string*)/*ee elem_ptr_typ */(map_get_check(ADDR(map, p->imported_symbols), &(string[]){enum_name})); - Option_string _t22 = {0}; + _option_string _t22 = {0}; if (_t23) { *((string*)&_t22.data) = *((string*)_t23); } else { @@ -90600,11 +90684,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 == 306 /* v.ast.Ident */) { + if (left._typ == 307 /* v.ast.Ident */) { is_mut = (*left._v__ast__Ident).is_mut; mut_pos = (*left._v__ast__Ident).mut_pos; } - else if (left._typ == 326 /* v.ast.SelectorExpr */) { + else if (left._typ == 327 /* v.ast.SelectorExpr */) { is_mut = (*left._v__ast__SelectorExpr).is_mut; mut_pos = (*left._v__ast__SelectorExpr).mut_pos; } @@ -91221,40 +91305,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 == 293 /* v.ast.CastExpr */) { + if (expr._typ == 294 /* v.ast.CastExpr */) { typ = (*expr._v__ast__CastExpr).typ; } - else if (expr._typ == 331 /* v.ast.StructInit */) { + else if (expr._typ == 332 /* v.ast.StructInit */) { typ = (*expr._v__ast__StructInit).typ; } - else if (expr._typ == 286 /* v.ast.ArrayInit */) { + else if (expr._typ == 287 /* v.ast.ArrayInit */) { typ = (*expr._v__ast__ArrayInit).typ; } - else if (expr._typ == 294 /* v.ast.ChanInit */) { + else if (expr._typ == 295 /* v.ast.ChanInit */) { typ = (*expr._v__ast__ChanInit).typ; } - else if (expr._typ == 290 /* v.ast.BoolLiteral */) { + else if (expr._typ == 291 /* v.ast.BoolLiteral */) { typ = _const_v__ast__bool_type; } - else if (expr._typ == 312 /* v.ast.IsRefType */) { + else if (expr._typ == 313 /* v.ast.IsRefType */) { typ = _const_v__ast__bool_type; } - else if (expr._typ == 295 /* v.ast.CharLiteral */) { + else if (expr._typ == 296 /* v.ast.CharLiteral */) { typ = _const_v__ast__char_type; } - else if (expr._typ == 304 /* v.ast.FloatLiteral */) { + else if (expr._typ == 305 /* v.ast.FloatLiteral */) { typ = _const_v__ast__f64_type; } - else if (expr._typ == 311 /* v.ast.IntegerLiteral */) { + else if (expr._typ == 312 /* v.ast.IntegerLiteral */) { typ = _const_v__ast__int_type; } - else if (expr._typ == 327 /* v.ast.SizeOf */) { + else if (expr._typ == 328 /* v.ast.SizeOf */) { typ = _const_v__ast__int_type; } - else if (expr._typ == 330 /* v.ast.StringLiteral */) { + else if (expr._typ == 331 /* v.ast.StringLiteral */) { typ = _const_v__ast__string_type; } - else if (expr._typ == 329 /* v.ast.StringInterLiteral */) { + else if (expr._typ == 330 /* v.ast.StringInterLiteral */) { typ = _const_v__ast__string_type; } @@ -91551,7 +91635,7 @@ VV_LOCAL_SYMBOL v__ast__TypeDecl v__parser__Parser_type_decl(v__parser__Parser* VV_LOCAL_SYMBOL v__ast__Assoc v__parser__Parser_assoc(v__parser__Parser* p) { string var_name = v__parser__Parser_check_name(p); v__token__Pos pos = v__token__Token_pos(&p->tok); - Option_v__ast__Var_ptr _t1 = v__ast__Scope_find_var(p->scope, var_name); + _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 `"), /*115 &string*/0xfe10, {.d_s = var_name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); @@ -91624,15 +91708,15 @@ VV_LOCAL_SYMBOL void v__parser__Parser_rewind_scanner_to_current_token_in_new_mo } bool v__parser__Parser_mark_var_as_used(v__parser__Parser* p, string varname) { - Option_v__ast__ScopeObject _t1; + _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 == 364 /* v.ast.Var */) { + if (obj._typ == 365 /* v.ast.Var */) { (*obj._v__ast__Var).is_used = true; bool _t2 = true; return _t2; } - else if (obj._typ == 363 /* v.ast.GlobalField */) { + else if (obj._typ == 364 /* v.ast.GlobalField */) { bool _t3 = true; return _t3; } @@ -91669,7 +91753,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 == 346 /* v.ast.ExprStmt */) { + if ((stmt)._typ == 347 /* 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); @@ -91712,7 +91796,7 @@ VV_LOCAL_SYMBOL void v__parser__Parser_trace(v__parser__Parser* p, string fbase, VV_LOCAL_SYMBOL v__ast__Expr v__parser__Parser_sql_expr(v__parser__Parser* p) { v__token__Pos pos = v__token__Token_pos(&p->tok); v__parser__Parser_check_name(p); - Option_v__ast__Expr _t1 = v__parser__Parser_check_expr(p, 0); + _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 "), /*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))))); @@ -91736,15 +91820,15 @@ 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 == 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 (!is_count && (where_expr)._typ == 311 /* v.ast.InfixExpr */) { + if ((*where_expr._v__ast__InfixExpr).op == v__token__Kind__eq && ((*where_expr._v__ast__InfixExpr).left)._typ == 307 /* 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 == 306 /* v.ast.Ident */) { + if (((*where_expr._v__ast__InfixExpr).right)._typ == 307 /* 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); + _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) { IError err = _t2.err; v__ast__Expr _t3 = v__ast__NodeError_to_sumtype_v__ast__Expr(ADDR(v__ast__NodeError, (v__parser__Parser_error_with_pos(p, IError_name_table[err._typ]._method_msg(err._object), (*(*where_expr._v__ast__InfixExpr).right._v__ast__Ident).pos)))); @@ -91826,7 +91910,7 @@ bool v__parser__Parser_sql_stmt_defer_0 = false; p->inside_match = true; v__parser__Parser_sql_stmt_defer_0 = true; v__parser__Parser_check_name(p); - Option_v__ast__Expr _t1 = v__parser__Parser_check_expr(p, 0); + _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 "), /*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))))); @@ -91890,7 +91974,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 == 306 /* v.ast.Ident */) { + if ((expr)._typ == 307 /* v.ast.Ident */) { inserted_var_name = (*expr._v__ast__Ident).name; } else { v__parser__Parser_error(p, _SLIT("can only insert variables")); @@ -91934,7 +92018,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par table_pos = v__token__Token_pos(&p->tok); table_type = v__parser__Parser_parse_type(p); } else if (kind == v__ast__SqlStmtKind__update) { - Option_bool _t11 = v__parser__Parser_check_sql_keyword(p, _SLIT("where")); + _option_bool _t11 = v__parser__Parser_check_sql_keyword(p, _SLIT("where")); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; v__ast__SqlStmtLine _t12 = ((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),}); @@ -91946,7 +92030,7 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par } else if (kind == v__ast__SqlStmtKind__delete) { table_pos = v__token__Token_pos(&p->tok); table_type = v__parser__Parser_parse_type(p); - Option_bool _t13 = v__parser__Parser_check_sql_keyword(p, _SLIT("where")); + _option_bool _t13 = v__parser__Parser_check_sql_keyword(p, _SLIT("where")); if (_t13.state != 0) { /*or block*/ IError err = _t13.err; v__ast__SqlStmtLine _t14 = ((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),}); @@ -91970,13 +92054,13 @@ VV_LOCAL_SYMBOL v__ast__SqlStmtLine v__parser__Parser_parse_sql_stmt_line(v__par return _t15; } -VV_LOCAL_SYMBOL Option_bool v__parser__Parser_check_sql_keyword(v__parser__Parser* p, string name) { +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 `"), /*115 &string*/0xfe10, {.d_s = name}}, {_SLIT("`"), 0, { .d_c = 0 }}}))); - return (Option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_bool){ .state=2, .err=_const_none__, .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_bool _t2; - opt_ok(&(bool[]) { true }, (Option*)(&_t2), sizeof(bool)); + _option_bool _t2; + opt_ok2(&(bool[]) { true }, (_option*)(&_t2), sizeof(bool)); return _t2; } @@ -92279,7 +92363,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 == 303 /* v.ast.EnumVal */) { + if (default_expr._typ == 304 /* v.ast.EnumVal */) { (*default_expr._v__ast__EnumVal).typ = typ; } @@ -92553,7 +92637,7 @@ VV_LOCAL_SYMBOL v__ast__InterfaceDecl v__parser__Parser_interface_decl(v__parser } 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, 474) /*expected idx: 474, name: v.ast.Interface */ ; + v__ast__Interface info = /* as */ *(v__ast__Interface*)__as_cast((ts->info)._v__ast__Interface,(ts->info)._typ, 475) /*expected idx: 475, 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); @@ -92862,7 +92946,7 @@ VV_LOCAL_SYMBOL string v__parser__insert_template_code(string fn_name, string tm } string v__parser__Parser_compile_template_file(v__parser__Parser* p, string template_file, string fn_name) { - Option_Array_string _t1 = os__read_lines(template_file); + _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 "), /*115 &string*/0xfe10, {.d_s = template_file}}, {_SLIT(" failed"), 0, { .d_c = 0 }}}))); @@ -92895,7 +92979,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp v__parser__State_update(&state, line); } if (string_contains(line, _SLIT("@header"))) { - Option_int _t3 = string_index(line, _SLIT("@header")); + _option_int _t3 = string_index(line, _SLIT("@header")); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; *(int*) _t3.data = 0; @@ -92906,7 +92990,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp continue; } if (string_contains(line, _SLIT("@footer"))) { - Option_int _t4 = string_index(line, _SLIT("@footer")); + _option_int _t4 = string_index(line, _SLIT("@footer")); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(int*) _t4.data = 0; @@ -92929,10 +93013,10 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp templates_folder = _SLIT(""); } 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); + _option_string _t5 = os__read_file(file_path); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; - Option_int _t6 = string_index(line, _SLIT("@include ")); + _option_int _t6 = string_index(line, _SLIT("@include ")); if (_t6.state != 0) { /*or block*/ err = _t6.err; *(int*) _t6.data = 0; @@ -92955,7 +93039,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } if (string_contains(line, _SLIT("@if "))) { strings__Builder_writeln(&source, _const_v__parser__tmpl_str_end); - Option_int _t8 = string_index(line, _SLIT("@if")); + _option_int _t8 = string_index(line, _SLIT("@if")); if (_t8.state != 0) { /*or block*/ IError err = _t8.err; continue; @@ -92982,7 +93066,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } if (string_contains(line, _SLIT("@for"))) { strings__Builder_writeln(&source, _const_v__parser__tmpl_str_end); - Option_int _t9 = string_index(line, _SLIT("@for")); + _option_int _t9 = string_index(line, _SLIT("@for")); if (_t9.state != 0) { /*or block*/ IError err = _t9.err; continue; @@ -92999,7 +93083,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp } if (state != v__parser__State__simple) { if (string_contains(line, _SLIT("@js "))) { - Option_int _t10 = string_index(line, _SLIT("@js")); + _option_int _t10 = string_index(line, _SLIT("@js")); if (_t10.state != 0) { /*or block*/ IError err = _t10.err; continue; @@ -93012,7 +93096,7 @@ string v__parser__Parser_compile_template_file(v__parser__Parser* p, string temp continue; } if (string_contains(line, _SLIT("@css "))) { - Option_int _t11 = string_index(line, _SLIT("@css")); + _option_int _t11 = string_index(line, _SLIT("@css")); if (_t11.state != 0) { /*or block*/ IError err = _t11.err; continue; @@ -93118,13 +93202,13 @@ VV_LOCAL_SYMBOL string v__callgraph__Mapper_dot_fn_name(v__callgraph__Mapper* m, return _t2; } -VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node) { +VV_LOCAL_SYMBOL _option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, v__ast__Node* node) { m->node = node; - if (node->_typ == 210 /* v.ast.File */) { + if (node->_typ == 211 /* v.ast.File */) { m->file = &(*node->_v__ast__File); } - else if (node->_typ == 360 /* v.ast.Stmt */) { - if ((*node->_v__ast__Stmt)._typ == 219 /* v.ast.FnDecl */) { + else if (node->_typ == 361 /* v.ast.Stmt */) { + if ((*node->_v__ast__Stmt)._typ == 220 /* 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 })); @@ -93141,8 +93225,8 @@ VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, } ; } - else if (node->_typ == 335 /* v.ast.Expr */) { - if ((*node->_v__ast__Expr)._typ == 292 /* v.ast.CallExpr */) { + else if (node->_typ == 336 /* v.ast.Expr */) { + if ((*node->_v__ast__Expr)._typ == 293 /* 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,})); @@ -93157,7 +93241,7 @@ VV_LOCAL_SYMBOL Option_void v__callgraph__Mapper_visit(v__callgraph__Mapper* m, else { } ; - return (Option_void){0}; + return (_option_void){0}; } v__builder__Builder v__builder__new_builder(v__pref__Preferences* pref) { @@ -93172,7 +93256,7 @@ v__builder__Builder v__builder__new_builder(v__pref__Preferences* pref) { v__util__EManager_set_support_color(_const_v__util__emanager, false); } table->pointer_size = (pref->m64 ? (8) : (4)); - Option_v__builder__MsvcResult _t1 = v__builder__find_msvc(pref->m64); + _option_v__builder__MsvcResult _t1 = v__builder__find_msvc(pref->m64); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (string__eq(pref->ccompiler, _SLIT("msvc"))) { @@ -93210,7 +93294,7 @@ v__builder__Builder v__builder__new_builder(v__pref__Preferences* pref) { return _t2; } -Option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_string v_files) { +_option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_string v_files) { v__util__Timers* timers = v__util__get_timers(); v__util__timing_start(_SLIT("PARSE")); v__util__timing_start(_SLIT("Builder.front_stages.parse_files")); @@ -93221,12 +93305,12 @@ Option_void v__builder__Builder_front_stages(v__builder__Builder* b, Array_strin v__util__Timers_show(timers, _SLIT("PARSE")); v__util__Timers_show_if_exists(timers, _SLIT("PARSE stmt")); if (b->pref->only_check_syntax) { - return (Option_void){ .state=2, .err=error_with_code(_SLIT("stop_after_parser"), 9999), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(_SLIT("stop_after_parser"), 9999), .data={EMPTY_STRUCT_INITIALIZATION} }; } - return (Option_void){0}; + return (_option_void){0}; } -Option_void v__builder__Builder_middle_stages(v__builder__Builder* b) { +_option_void v__builder__Builder_middle_stages(v__builder__Builder* b) { v__util__timing_start(_SLIT("CHECK")); v__util__timing_start(_SLIT("Checker.generic_insts_to_concrete")); v__ast__Table_generic_insts_to_concrete(b->table); @@ -93235,10 +93319,10 @@ Option_void v__builder__Builder_middle_stages(v__builder__Builder* b) { v__util__timing_measure(_SLIT("CHECK")); v__builder__Builder_print_warnings_and_errors(b); if (b->checker->should_abort) { - return (Option_void){ .state=2, .err=_v_error(_SLIT("too many errors/warnings/notices")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("too many errors/warnings/notices")), .data={EMPTY_STRUCT_INITIALIZATION} }; } if (b->pref->check_only) { - return (Option_void){ .state=2, .err=error_with_code(_SLIT("stop_after_checker"), 9999), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=error_with_code(_SLIT("stop_after_checker"), 9999), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__util__timing_start(_SLIT("TRANSFORM")); v__transformer__Transformer_transform_files(b->transformer, b->parsed_files); @@ -93250,27 +93334,27 @@ Option_void v__builder__Builder_middle_stages(v__builder__Builder* b) { if (b->pref->show_callgraph) { v__callgraph__show(b->table, b->pref, b->parsed_files); } - return (Option_void){0}; + return (_option_void){0}; } -Option_void v__builder__Builder_front_and_middle_stages(v__builder__Builder* b, Array_string v_files) { - Option_void _t1 = v__builder__Builder_front_stages(b, v_files); +_option_void v__builder__Builder_front_and_middle_stages(v__builder__Builder* b, Array_string v_files) { + _option_void _t1 = v__builder__Builder_front_stages(b, v_files); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { - Option_void _t2; + _option_void _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } ; - Option_void _t3 = v__builder__Builder_middle_stages(b); + _option_void _t3 = v__builder__Builder_middle_stages(b); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { - Option_void _t4; + _option_void _t4; memcpy(&_t4, &_t3, sizeof(Option)); return _t4; } ; - return (Option_void){0}; + return (_option_void){0}; } void v__builder__Builder_parse_imports(v__builder__Builder* b) { @@ -93306,7 +93390,7 @@ bool v__builder__Builder_parse_imports_defer_0 = false; if (Array_string_contains(done_imports, mod)) { continue; } - Option_string _t11 = v__builder__Builder_find_module_path(b, mod, ast_file->path); + _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 \""), /*115 &string*/0xfe10, {.d_s = mod}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}})), ast_file->path, imp.pos) })); @@ -93441,7 +93525,7 @@ Array_string v__builder__Builder_v_files_from_dir(v__builder__Builder* b, string 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); + _option_Array_string _t1 = os__ls(dir); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -93475,7 +93559,7 @@ inline string v__builder__module_path(string mod) { return _t1; } -Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, string mod, string fpath) { +_option_string v__builder__Builder_find_module_path(v__builder__Builder* b, string mod, string fpath) { v__vmod__ModFileCacher* mcache = v__vmod__get_cache(); v__vmod__ModFileAndFolder vmod_file_location = v__vmod__ModFileCacher_get_by_file(mcache, fpath); string mod_path = v__builder__module_path(mod); @@ -93504,8 +93588,8 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin if (b->pref->is_verbose) { 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)); + _option_string _t6; + opt_ok2(&(string[]) { try_path }, (_option*)(&_t6), sizeof(string)); return _t6; } } @@ -93517,13 +93601,13 @@ Option_string v__builder__Builder_find_module_path(v__builder__Builder* b, strin 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; - opt_ok(&(string[]) { try_path }, (Option*)(&_t7), sizeof(string)); + _option_string _t7; + opt_ok2(&(string[]) { try_path }, (_option*)(&_t7), sizeof(string)); return _t7; } } 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 \""), /*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} }; + 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) { @@ -93675,7 +93759,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 == 219 /* v.ast.FnDecl */) { + if ((stmt)._typ == 220 /* 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),}) })); @@ -93724,13 +93808,13 @@ VNORETURN void v__builder__verror(string s) { while(1); } -Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { +_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, /*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, /*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); + _option_v__builder__MsvcResult _t1 = v__builder__find_msvc(v->pref->m64); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (v->pref->is_verbose) { @@ -93743,20 +93827,20 @@ Option_void v__builder__Builder_find_win_cc(v__builder__Builder* v) { if (v->pref->is_verbose) { println(_SLIT("tcc not found")); } - return (Option_void){ .state=2, .err=_v_error(_SLIT("tcc not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_void){ .state=2, .err=_v_error(_SLIT("tcc not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; } v->pref->ccompiler = thirdparty_tcc; v->pref->ccompiler_type = v__pref__CompilerType__tinyc; - return (Option_void){0}; + return (_option_void){0}; } (*(v__builder__MsvcResult*)_t1.data); v->pref->ccompiler = _SLIT("msvc"); v->pref->ccompiler_type = v__pref__CompilerType__msvc; - return (Option_void){0}; + return (_option_void){0}; } v->pref->ccompiler_type = v__pref__cc_from_string(v->pref->ccompiler); - return (Option_void){0}; + return (_option_void){0}; } VV_LOCAL_SYMBOL void v__builder__Builder_show_c_compiler_output(v__builder__Builder* v, os__Result res) { @@ -93776,7 +93860,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_post_process_c_compiler_output(v__build if (v->pref->is_verbose) { 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); + _option_void _t2 = os__rm(tmpfile); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -94019,15 +94103,21 @@ VV_LOCAL_SYMBOL Array_string v__builder__Builder_all_args(v__builder__Builder* v } _PUSH_MANY(&all, (ccoptions.args), _t3, Array_string); _PUSH_MANY(&all, (ccoptions.o_args), _t4, Array_string); - _PUSH_MANY(&all, (ccoptions.pre_args), _t5, Array_string); - _PUSH_MANY(&all, (ccoptions.source_args), _t6, Array_string); - _PUSH_MANY(&all, (ccoptions.post_args), _t7, Array_string); + if (!ccoptions.is_cc_msvc) { + array_push((array*)&all, _MOV((string[]){ string_clone(_SLIT("-Wl,-stack=16777216")) })); + if (!v->pref->is_cstrict) { + array_push((array*)&all, _MOV((string[]){ string_clone(_SLIT("-Werror=implicit-function-declaration")) })); + } + } + _PUSH_MANY(&all, (ccoptions.pre_args), _t7, Array_string); + _PUSH_MANY(&all, (ccoptions.source_args), _t8, Array_string); + _PUSH_MANY(&all, (ccoptions.post_args), _t9, Array_string); if (v->pref->build_mode != v__pref__BuildMode__build_module) { - _PUSH_MANY(&all, (ccoptions.linker_flags), _t8, Array_string); + _PUSH_MANY(&all, (ccoptions.linker_flags), _t10, Array_string); } array_push((array*)&all, _MOV((string[]){ string_clone(ccoptions.env_ldflags) })); - Array_string _t10 = all; - return _t10; + Array_string _t12 = all; + return _t12; } VV_LOCAL_SYMBOL Array_string v__builder__Builder_thirdparty_object_args(v__builder__Builder* v, v__builder__CcompilerOptions ccoptions, Array_string middle) { @@ -94055,7 +94145,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_setup_output_name(v__builder__Builder* if (v->pref->is_verbose) { 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, /*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 }}}))); + _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)); @@ -94089,7 +94179,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_dump_c_options(v__builder__Builder* v, if (string__eq(v->pref->dump_c_flags, _SLIT("-"))) { print(non_empty_args); } else { - Option_void _t3 = os__write_file(v->pref->dump_c_flags, non_empty_args); + _option_void _t3 = os__write_file(v->pref->dump_c_flags, non_empty_args); if (_t3.state != 0 && _t3.err._typ != _IError_None___index) { IError err = _t3.err; _v_panic(IError_str(err)); @@ -94122,7 +94212,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { return; } if (v__pref__Preferences_should_output_to_stdout(v->pref)) { - Option_string _t1 = os__read_file(v->out_name_c); + _option_string _t1 = os__read_file(v->out_name_c); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -94132,7 +94222,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { string content = (*(string*)_t1.data); println(content); - Option_void _t2 = os__rm(v->out_name_c); + _option_void _t2 = os__rm(v->out_name_c); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -94146,7 +94236,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { v->pref->skip_running = true; 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); + _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) { IError err = _t3.err; _v_panic(IError_str(err)); @@ -94223,7 +94313,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { response_file_content = string_replace(str_args, _SLIT("\\"), _SLIT("\\\\")); 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); + _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 \""), /*115 &string*/0xfe10, {.d_s = response_file}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); @@ -94243,7 +94333,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { 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, /*115 &string*/0xfe10, {.d_s = def_name}}, {_SLIT(".def"), 0, { .d_c = 0 }}}))) })); } - Option_void _t12 = os__chdir(vdir); + _option_void _t12 = os__chdir(vdir); if (_t12.state != 0 && _t12.err._typ != _IError_None___index) { IError err = _t12.err; } @@ -94258,7 +94348,7 @@ void v__builder__Builder_cc(v__builder__Builder* v) { if (v->pref->show_c_output) { v__builder__Builder_show_c_compiler_output(v, res); } - Option_void _t14 = os__chdir(original_pwd); + _option_void _t14 = os__chdir(original_pwd); if (_t14.state != 0 && _t14.err._typ != _IError_None___index) { IError err = _t14.err; } @@ -94326,7 +94416,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_ensure_linuxroot_exists(v__builder__Bui string crossrepo_url = _SLIT("https://github.com/spytheman/vlinuxroot"); string sysroot_git_config_path = os__join_path(sysroot, new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT(".git"), _SLIT("config")}))); if (os__is_dir(sysroot) && !os__exists(sysroot_git_config_path)) { - Option_void _t1 = os__rmdir_all(sysroot); + _option_void _t1 = os__rmdir_all(sysroot); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; } @@ -94340,7 +94430,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_ensure_linuxroot_exists(v__builder__Bui 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); + _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); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; _v_panic(IError_str(err)); @@ -94358,7 +94448,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) v__builder__Builder_setup_output_name(b); string parent_dir = os__vmodules_dir(); if (!os__exists(parent_dir)) { - Option_bool _t1 = os__mkdir(parent_dir); + _option_bool _t1 = os__mkdir(parent_dir); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; _v_panic(IError_str(err)); @@ -94372,10 +94462,10 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cc_linux_cross(v__builder__Builder* b) v__builder__Builder_ensure_linuxroot_exists(b, sysroot); string obj_file = string__plus(b->out_name_c, _SLIT(".o")); Array_v__cflag__CFlag cflags = v__builder__Builder_get_os_cflags(b); - multi_return_Array_string_Array_string_Array_string mr_22693 = Array_v__cflag__CFlag_defines_others_libs(cflags); - Array_string defines = mr_22693.arg0; - Array_string others = mr_22693.arg1; - Array_string libs = mr_22693.arg2; + multi_return_Array_string_Array_string_Array_string mr_23274 = Array_v__cflag__CFlag_defines_others_libs(cflags); + Array_string defines = mr_23274.arg0; + Array_string others = mr_23274.arg1; + Array_string libs = mr_23274.arg2; Array_string cc_args = __new_array_with_default(0, 0, sizeof(string), 0); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-w")) })); array_push((array*)&cc_args, _MOV((string[]){ string_clone(_SLIT("-fPIC")) })); @@ -94523,7 +94613,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B } } if (os__exists(obj_path)) { - Option_void _t1 = os__cp(obj_path, opath); + _option_void _t1 = os__cp(obj_path, opath); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; _v_panic(IError_str(err)); @@ -94538,7 +94628,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B println(rebuild_reason_message); } string current_folder = os__getwd(); - Option_void _t2 = os__chdir(os__dir(v__pref__vexe_path())); + _option_void _t2 = os__chdir(os__dir(v__pref__vexe_path())); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -94552,7 +94642,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B 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, /*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); + _option_void _t7 = os__chdir(current_folder); if (_t7.state != 0 && _t7.err._typ != _IError_None___index) { IError err = _t7.err; } @@ -94564,7 +94654,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_build_thirdparty_obj_file(v__builder__B VUNREACHABLE(); return; } - 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 }}}))); + _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)); @@ -94619,7 +94709,7 @@ VV_LOCAL_SYMBOL Array_v__cflag__CFlag v__builder__Builder_get_os_cflags(v__build array_push((array*)&flags, _MOV((v__cflag__CFlag[]){ *flag })); continue; } - Option_v__pref__OS _t4 = v__pref__os_from_string(flag->os); + _option_v__pref__OS _t4 = v__pref__os_from_string(flag->os); if (_t4.state != 0) { /*or block*/ IError err = _t4.err; *(v__pref__OS*) _t4.data = v__pref__OS__all; @@ -94662,7 +94752,7 @@ void v__builder__compile(string command, v__pref__Preferences* pref, void (*back if (odir.len == pref->out_name.len) { output_folder = os__getwd(); } - Option_bool _t1 = os__is_writable_folder(output_folder); + _option_bool _t1 = os__is_writable_folder(output_folder); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; v__builder__verror(IError_name_table[err._typ]._method_msg(err._object)); @@ -94772,7 +94862,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_run_compiled_executable_and_exit(v__bui #else #endif ; -Option_string _t2 = os__find_abs_path_of_executable(node_basename); +_option_string _t2 = os__find_abs_path_of_executable(node_basename); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; _v_panic(_SLIT("Could not find `node` in system path. Do you have Node.js installed?")); @@ -94795,7 +94885,7 @@ Option_string _t2 = os__find_abs_path_of_executable(node_basename); if (b->pref->is_verbose) { 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); + _option_os__SignalHandler _t5 = os__signal_opt(os__Signal__int, (voidptr)v__builder__eshcb); if (_t5.state != 0) { /*or block*/ IError err = _t5.err; v__builder__serror(_SLIT("set .int"), err); @@ -94806,7 +94896,7 @@ Option_string _t2 = os__find_abs_path_of_executable(node_basename); void (*prev_int_handler) (os__Signal ) = (*(os__SignalHandler*)_t5.data); void (*prev_quit_handler) (os__Signal ) = ((os__SignalHandler)(v__builder__eshcb)); os__Process_wait(run_process); - Option_os__SignalHandler _t6 = os__signal_opt(os__Signal__int, (voidptr)prev_int_handler); + _option_os__SignalHandler _t6 = os__signal_opt(os__Signal__int, (voidptr)prev_int_handler); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; v__builder__serror(_SLIT("restore .int"), err); @@ -94842,7 +94932,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_cleanup_run_executable_after_exit(v__bu return; } 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); + _option_void _t1 = os__rm(exefile); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; } @@ -94955,7 +95045,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { bool is_test = v->pref->is_test; bool is_internal_module_test = false; if (is_test) { - Option_string _t10 = v__util__read_file(dir); + _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, /*115 &string*/0xfe10, {.d_s = dir}}, {_SLIT(" does not exist"), 0, { .d_c = 0 }}}))); @@ -95026,7 +95116,7 @@ Array_string v__builder__Builder_get_user_files(v__builder__Builder* v) { } // TypeDecl -VV_LOCAL_SYMBOL Option_string v__builder__find_windows_kit_internal(v__builder__RegKey key, Array_string versions) { +VV_LOCAL_SYMBOL _option_string v__builder__find_windows_kit_internal(v__builder__RegKey key, Array_string versions) { { // Unsafe block for (int _t1 = 0; _t1 < versions.len; ++_t1) { string version = ((string*)versions.data)[_t1]; @@ -95050,75 +95140,75 @@ VV_LOCAL_SYMBOL Option_string v__builder__find_windows_kit_internal(v__builder__ value[length] = ((u16)(0U)); } string res = string_from_wide(value); - Option_string _t2; - opt_ok(&(string[]) { res }, (Option*)(&_t2), sizeof(string)); + _option_string _t2; + opt_ok2(&(string[]) { res }, (_option*)(&_t2), sizeof(string)); return _t2; } } - return (Option_string){ .state=2, .err=_v_error(_SLIT("windows kit not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_string){ .state=2, .err=_v_error(_SLIT("windows kit not found")), .data={EMPTY_STRUCT_INITIALIZATION} }; } -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root(string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root(string target_arch) { #if defined(_WIN32) { - Option_v__builder__WindowsKit _t1 = v__builder__find_windows_kit_root_by_reg(target_arch); + _option_v__builder__WindowsKit _t1 = v__builder__find_windows_kit_root_by_reg(target_arch); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - Option_v__builder__WindowsKit _t2; + _option_v__builder__WindowsKit _t2; if (_t2 = v__builder__find_windows_kit_root_by_env(target_arch), _t2.state == 0) { v__builder__WindowsKit wkroot = *(v__builder__WindowsKit*)_t2.data; - Option_v__builder__WindowsKit _t3; - opt_ok(&(v__builder__WindowsKit[]) { wkroot }, (Option*)(&_t3), sizeof(v__builder__WindowsKit)); + _option_v__builder__WindowsKit _t3; + opt_ok2(&(v__builder__WindowsKit[]) { wkroot }, (_option*)(&_t3), sizeof(v__builder__WindowsKit)); return _t3; } - return (Option_v__builder__WindowsKit){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__builder__WindowsKit wkroot = (*(v__builder__WindowsKit*)_t1.data); - Option_v__builder__WindowsKit _t5; - opt_ok(&(v__builder__WindowsKit[]) { wkroot }, (Option*)(&_t5), sizeof(v__builder__WindowsKit)); + _option_v__builder__WindowsKit _t5; + opt_ok2(&(v__builder__WindowsKit[]) { wkroot }, (_option*)(&_t5), sizeof(v__builder__WindowsKit)); return _t5; } #else { } #endif - return (Option_v__builder__WindowsKit){0}; + return (_option_v__builder__WindowsKit){0}; } -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_reg(string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_reg(string target_arch) { #if defined(_WIN32) { v__builder__RegKey root_key = ((v__builder__RegKey)(0)); string path = _SLIT("SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots"); voidptr rc = RegOpenKeyEx(_const_v__builder__hkey_local_machine, string_to_wide(path), 0U, ((_const_v__builder__key_query_value | _const_v__builder__key_wow64_32key) | _const_v__builder__key_enumerate_sub_keys), &root_key); if (rc != 0) { - return (Option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Unable to open root key")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Unable to open root key")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_string _t2 = v__builder__find_windows_kit_internal(root_key, new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("KitsRoot10"), _SLIT("KitsRoot81")}))); + _option_string _t2 = v__builder__find_windows_kit_internal(root_key, new_array_from_c_array(2, 2, sizeof(string), _MOV((string[2]){_SLIT("KitsRoot10"), _SLIT("KitsRoot81")}))); if (_t2.state != 0) { /*or block*/ IError err = _t2.err; RegCloseKey(root_key); - return (Option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Unable to find a windows kit")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("Unable to find a windows kit")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string kit_root = (*(string*)_t2.data); RegCloseKey(root_key); - Option_v__builder__WindowsKit _t4 = v__builder__new_windows_kit(kit_root, target_arch); + _option_v__builder__WindowsKit _t4 = v__builder__new_windows_kit(kit_root, target_arch); return _t4; } #else { } #endif - return (Option_v__builder__WindowsKit){0}; + return (_option_v__builder__WindowsKit){0}; } -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__new_windows_kit(string kit_root, string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__new_windows_kit(string kit_root, string target_arch) { string kit_lib = string__plus(kit_root, _SLIT("Lib")); - Option_Array_string _t1 = os__ls(kit_lib); + _option_Array_string _t1 = os__ls(kit_lib); if (_t1.state != 0) { /*or block*/ - Option_v__builder__WindowsKit _t2; + _option_v__builder__WindowsKit _t2; memcpy(&_t2, &_t1, sizeof(Option)); return _t2; } @@ -95137,60 +95227,60 @@ VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__new_windows_kit(string } 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\\"), /*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)); + _option_v__builder__WindowsKit _t4; + opt_ok2(&(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; } -VV_LOCAL_SYMBOL Option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_env(string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__WindowsKit v__builder__find_windows_kit_root_by_env(string target_arch) { string kit_root = os__getenv(_SLIT("WindowsSdkDir")); if ((kit_root).len == 0) { - return (Option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("empty WindowsSdkDir")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__WindowsKit){ .state=2, .err=_v_error(_SLIT("empty WindowsSdkDir")), .data={EMPTY_STRUCT_INITIALIZATION} }; } - Option_v__builder__WindowsKit _t2 = v__builder__new_windows_kit(kit_root, target_arch); + _option_v__builder__WindowsKit _t2 = v__builder__new_windows_kit(kit_root, target_arch); return _t2; } -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs(string vswhere_dir, string host_arch, string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs(string vswhere_dir, string host_arch, string target_arch) { #if defined(_WIN32) { - Option_v__builder__VsInstallation _t1 = v__builder__find_vs_by_reg(vswhere_dir, host_arch, target_arch); + _option_v__builder__VsInstallation _t1 = v__builder__find_vs_by_reg(vswhere_dir, host_arch, target_arch); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - Option_v__builder__VsInstallation _t2; + _option_v__builder__VsInstallation _t2; if (_t2 = v__builder__find_vs_by_env(host_arch, target_arch), _t2.state == 0) { v__builder__VsInstallation vsinst = *(v__builder__VsInstallation*)_t2.data; - Option_v__builder__VsInstallation _t3; - opt_ok(&(v__builder__VsInstallation[]) { vsinst }, (Option*)(&_t3), sizeof(v__builder__VsInstallation)); + _option_v__builder__VsInstallation _t3; + opt_ok2(&(v__builder__VsInstallation[]) { vsinst }, (_option*)(&_t3), sizeof(v__builder__VsInstallation)); return _t3; } - return (Option_v__builder__VsInstallation){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=err, .data={EMPTY_STRUCT_INITIALIZATION} }; } v__builder__VsInstallation vsinst = (*(v__builder__VsInstallation*)_t1.data); - Option_v__builder__VsInstallation _t5; - opt_ok(&(v__builder__VsInstallation[]) { vsinst }, (Option*)(&_t5), sizeof(v__builder__VsInstallation)); + _option_v__builder__VsInstallation _t5; + opt_ok2(&(v__builder__VsInstallation[]) { vsinst }, (_option*)(&_t5), sizeof(v__builder__VsInstallation)); return _t5; } #else { } #endif - return (Option_v__builder__VsInstallation){0}; + return (_option_v__builder__VsInstallation){0}; } -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(string vswhere_dir, string host_arch, string target_arch) { +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("\""), /*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} }; + 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, /*115 &string*/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} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Unable to find vs installation")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string version = (*(string*)_t2.data); @@ -95199,60 +95289,60 @@ VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_reg(str 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)); + _option_v__builder__VsInstallation _t4; + opt_ok2(&(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 \""), /*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} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("Unable to find vs exe folder")), .data={EMPTY_STRUCT_INITIALIZATION} }; } #else { } #endif - return (Option_v__builder__VsInstallation){0}; + return (_option_v__builder__VsInstallation){0}; } -VV_LOCAL_SYMBOL Option_v__builder__VsInstallation v__builder__find_vs_by_env(string host_arch, string target_arch) { +VV_LOCAL_SYMBOL _option_v__builder__VsInstallation v__builder__find_vs_by_env(string host_arch, string target_arch) { string vs_dir = os__getenv(_SLIT("VSINSTALLDIR")); if ((vs_dir).len == 0) { - return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("empty VSINSTALLDIR")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("empty VSINSTALLDIR")), .data={EMPTY_STRUCT_INITIALIZATION} }; } string vc_tools_dir = os__getenv(_SLIT("VCToolsInstallDir")); if ((vc_tools_dir).len == 0) { - return (Option_v__builder__VsInstallation){ .state=2, .err=_v_error(_SLIT("empty VCToolsInstallDir")), .data={EMPTY_STRUCT_INITIALIZATION} }; + 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, /*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)); + _option_v__builder__VsInstallation _t3; + opt_ok2(&(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; } -VV_LOCAL_SYMBOL Option_v__builder__MsvcResult v__builder__find_msvc(bool m64_target) { +VV_LOCAL_SYMBOL _option_v__builder__MsvcResult v__builder__find_msvc(bool m64_target) { #if defined(_WIN32) { string processor_architecture = os__getenv(_SLIT("PROCESSOR_ARCHITECTURE")); string vswhere_dir = (string__eq(processor_architecture, _SLIT("x86")) ? (_SLIT("%ProgramFiles%")) : (_SLIT("%ProgramFiles(x86)%"))); string host_arch = (string__eq(processor_architecture, _SLIT("x86")) ? (_SLIT("X86")) : (_SLIT("X64"))); string target_arch = (!m64_target ? (_SLIT("X86")) : (_SLIT("X64"))); - Option_v__builder__WindowsKit _t1 = v__builder__find_windows_kit_root(target_arch); + _option_v__builder__WindowsKit _t1 = v__builder__find_windows_kit_root(target_arch); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; - return (Option_v__builder__MsvcResult){ .state=2, .err=_v_error(_SLIT("Unable to find windows sdk")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__MsvcResult){ .state=2, .err=_v_error(_SLIT("Unable to find windows sdk")), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__builder__WindowsKit wk = (*(v__builder__WindowsKit*)_t1.data); - Option_v__builder__VsInstallation _t3 = v__builder__find_vs(vswhere_dir, host_arch, target_arch); + _option_v__builder__VsInstallation _t3 = v__builder__find_vs(vswhere_dir, host_arch, target_arch); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; - return (Option_v__builder__MsvcResult){ .state=2, .err=_v_error(_SLIT("Unable to find visual studio")), .data={EMPTY_STRUCT_INITIALIZATION} }; + return (_option_v__builder__MsvcResult){ .state=2, .err=_v_error(_SLIT("Unable to find visual studio")), .data={EMPTY_STRUCT_INITIALIZATION} }; } v__builder__VsInstallation vs = (*(v__builder__VsInstallation*)_t3.data); - Option_v__builder__MsvcResult _t5; - opt_ok(&(v__builder__MsvcResult[]) { ((v__builder__MsvcResult){ + _option_v__builder__MsvcResult _t5; + opt_ok2(&(v__builder__MsvcResult[]) { ((v__builder__MsvcResult){ .full_cl_exe_path = os__real_path(string__plus(string__plus(vs.exe_path, _const_os__path_separator), _SLIT("cl.exe"))), .exe_path = vs.exe_path, .um_lib_path = wk.um_lib_path, @@ -95263,14 +95353,14 @@ VV_LOCAL_SYMBOL Option_v__builder__MsvcResult v__builder__find_msvc(bool m64_tar .vs_include_path = vs.include_path, .shared_include_path = wk.shared_include_path, .valid = true, - }) }, (Option*)(&_t5), sizeof(v__builder__MsvcResult)); + }) }, (_option*)(&_t5), sizeof(v__builder__MsvcResult)); return _t5; } #else { } #endif - return (Option_v__builder__MsvcResult){0}; + return (_option_v__builder__MsvcResult){0}; } void v__builder__Builder_cc_msvc(v__builder__Builder* v) { @@ -95352,7 +95442,7 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { array_push((array*)&a, _MOV((string[]){ string_clone(env_ldflags) })); } string args = Array_string_join(a, _SLIT(" ")); - Option_void _t33 = os__write_file(out_name_cmd_line, args); + _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 \""), /*115 &string*/0xfe10, {.d_s = out_name_cmd_line}}, {_SLIT("\""), 0, { .d_c = 0 }}}))); @@ -95380,7 +95470,7 @@ void v__builder__Builder_cc_msvc(v__builder__Builder* v) { } else { v__builder__Builder_post_process_c_compiler_output(v, res); } - Option_void _t34 = os__rm(out_name_obj); + _option_void _t34 = os__rm(out_name_obj); if (_t34.state != 0 && _t34.err._typ != _IError_None___index) { IError err = _t34.err; } @@ -95494,7 +95584,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { } Array_string all_files =_t1; v__vcache__CacheManager cm = v__vcache__new_cache_manager(all_files); - Option_string _t3 = v__vcache__CacheManager_load(&cm, _SLIT(".hashes"), _SLIT("all_files")); + _option_string _t3 = v__vcache__CacheManager_load(&cm, _SLIT(".hashes"), _SLIT("all_files")); if (_t3.state != 0) { /*or block*/ IError err = _t3.err; *(string*) _t3.data = _SLIT(" "); @@ -95515,7 +95605,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { for (int _t5 = 0; _t5 < b->parsed_files.len; ++_t5) { v__ast__File* p = ((v__ast__File**)b->parsed_files.data)[_t5]; string cpath = p->path; - Option_string _t6 = v__util__read_file(cpath); + _option_string _t6 = v__util__read_file(cpath); if (_t6.state != 0) { /*or block*/ IError err = _t6.err; *(string*) _t6.data = _SLIT(""); @@ -95530,7 +95620,7 @@ void v__builder__Builder_rebuild_modules(v__builder__Builder* b) { strings__Builder_write_u8(&sb_new_hashes, '\n'); } string snew_hashes = strings__Builder_str(&sb_new_hashes); - Option_string _t7 = v__vcache__CacheManager_save(&cm, _SLIT(".hashes"), _SLIT("all_files"), snew_hashes); + _option_string _t7 = v__vcache__CacheManager_save(&cm, _SLIT(".hashes"), _SLIT("all_files"), snew_hashes); if (_t7.state != 0) { /*or block*/ IError err = _t7.err; } @@ -95666,7 +95756,7 @@ string pwd; pwd = os__getwd(); v__builder__Builder_v_build_module_defer_0 = true; string vroot = os__dir(vexe); - Option_void _t1 = os__chdir(vroot); + _option_void _t1 = os__chdir(vroot); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; } @@ -95678,7 +95768,7 @@ string pwd; os__system(rebuild_cmd); // Defer begin if (v__builder__Builder_v_build_module_defer_0) { - Option_void _t2 = os__chdir(pwd); + _option_void _t2 = os__chdir(pwd); if (_t2.state != 0 && _t2.err._typ != _IError_None___index) { IError err = _t2.err; } @@ -95689,14 +95779,14 @@ if (v__builder__Builder_v_build_module_defer_0) { } VV_LOCAL_SYMBOL string v__builder__Builder_rebuild_cached_module(v__builder__Builder* b, string vexe, string imp_path) { - Option_string _t1 = v__vcache__CacheManager_exists(&b->pref->cache_manager, _SLIT(".o"), imp_path); + _option_string _t1 = v__vcache__CacheManager_exists(&b->pref->cache_manager, _SLIT(".o"), imp_path); if (_t1.state != 0) { /*or block*/ IError err = _t1.err; if (b->pref->is_verbose) { 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); + _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 "), /*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 }}}))); @@ -95725,7 +95815,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_handle_usecache(v__builder__Builder* b, for (int _t2 = 0; _t2 < b->parsed_files.len; ++_t2) { v__ast__File* ast_file = ((v__ast__File**)b->parsed_files.data)[_t2]; if (b->pref->is_test && !string__eq(ast_file->mod.name, _SLIT("main"))) { - Option_string _t3 = v__builder__Builder_find_module_path(b, ast_file->mod.name, ast_file->path); + _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 \""), /*115 &string*/0xfe10, {.d_s = ast_file->mod.name}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); @@ -95753,7 +95843,7 @@ VV_LOCAL_SYMBOL void v__builder__Builder_handle_usecache(v__builder__Builder* b, if (string__eq(imp, _SLIT("help"))) { continue; } - Option_string _t7 = v__builder__Builder_find_module_path(b, imp, ast_file->path); + _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 \""), /*115 &string*/0xfe10, {.d_s = imp}}, {_SLIT("\" (not found)"), 0, { .d_c = 0 }}}))); @@ -95782,7 +95872,7 @@ void v__builder__cbuilder__compile_c(v__builder__Builder* b) { if (b->pref->is_verbose) { println(_SLIT("all .v files before:")); } - Option_void _t1 = v__builder__Builder_find_win_cc(b); + _option_void _t1 = v__builder__Builder_find_win_cc(b); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; v__builder__verror(_const_v__builder__no_compiler_error); @@ -95807,7 +95897,7 @@ void v__builder__cbuilder__compile_c(v__builder__Builder* b) { } string v__builder__cbuilder__gen_c(v__builder__Builder* b, Array_string v_files) { - Option_void _t1 = v__builder__Builder_front_and_middle_stages(b, v_files); + _option_void _t1 = v__builder__Builder_front_and_middle_stages(b, v_files); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; if (IError_name_table[err._typ]._method_code(err._object) != 9999) { @@ -95831,7 +95921,7 @@ void v__builder__cbuilder__build_c(v__builder__Builder* b, Array_string v_files, b->pref->out_name_c = os__real_path(out_file); 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); + _option_void _t1 = os__write_file(out_file, output2); if (_t1.state != 0 && _t1.err._typ != _IError_None___index) { IError err = _t1.err; _v_panic(IError_str(err)); @@ -96012,106 +96102,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 = 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 = 470, .tname = _SLIT("v.ast.Aggregate")} + , (VCastTypeIndexName){.tindex = 472, .tname = _SLIT("v.ast.Alias")} + , (VCastTypeIndexName){.tindex = 452, .tname = _SLIT("v.ast.Array")} + , (VCastTypeIndexName){.tindex = 480, .tname = _SLIT("v.ast.ArrayFixed")} + , (VCastTypeIndexName){.tindex = 481, .tname = _SLIT("v.ast.Chan")} + , (VCastTypeIndexName){.tindex = 486, .tname = _SLIT("v.ast.Enum")} + , (VCastTypeIndexName){.tindex = 484, .tname = _SLIT("v.ast.FnType")} + , (VCastTypeIndexName){.tindex = 485, .tname = _SLIT("v.ast.GenericInst")} + , (VCastTypeIndexName){.tindex = 475, .tname = _SLIT("v.ast.Interface")} + , (VCastTypeIndexName){.tindex = 453, .tname = _SLIT("v.ast.Map")} + , (VCastTypeIndexName){.tindex = 483, .tname = _SLIT("v.ast.MultiReturn")} + , (VCastTypeIndexName){.tindex = 457, .tname = _SLIT("v.ast.Struct")} + , (VCastTypeIndexName){.tindex = 476, .tname = _SLIT("v.ast.SumType")} + , (VCastTypeIndexName){.tindex = 482, .tname = _SLIT("v.ast.Thread")} + , (VCastTypeIndexName){.tindex = 416, .tname = _SLIT("v.ast.IdentFn")} + , (VCastTypeIndexName){.tindex = 417, .tname = _SLIT("v.ast.IdentVar")} + , (VCastTypeIndexName){.tindex = 285, .tname = _SLIT("v.ast.AnonFn")} + , (VCastTypeIndexName){.tindex = 286, .tname = _SLIT("v.ast.ArrayDecompose")} + , (VCastTypeIndexName){.tindex = 287, .tname = _SLIT("v.ast.ArrayInit")} + , (VCastTypeIndexName){.tindex = 288, .tname = _SLIT("v.ast.AsCast")} + , (VCastTypeIndexName){.tindex = 289, .tname = _SLIT("v.ast.Assoc")} + , (VCastTypeIndexName){.tindex = 290, .tname = _SLIT("v.ast.AtExpr")} + , (VCastTypeIndexName){.tindex = 291, .tname = _SLIT("v.ast.BoolLiteral")} + , (VCastTypeIndexName){.tindex = 292, .tname = _SLIT("v.ast.CTempVar")} + , (VCastTypeIndexName){.tindex = 293, .tname = _SLIT("v.ast.CallExpr")} + , (VCastTypeIndexName){.tindex = 294, .tname = _SLIT("v.ast.CastExpr")} + , (VCastTypeIndexName){.tindex = 295, .tname = _SLIT("v.ast.ChanInit")} + , (VCastTypeIndexName){.tindex = 296, .tname = _SLIT("v.ast.CharLiteral")} + , (VCastTypeIndexName){.tindex = 297, .tname = _SLIT("v.ast.Comment")} + , (VCastTypeIndexName){.tindex = 298, .tname = _SLIT("v.ast.ComptimeCall")} + , (VCastTypeIndexName){.tindex = 299, .tname = _SLIT("v.ast.ComptimeSelector")} + , (VCastTypeIndexName){.tindex = 300, .tname = _SLIT("v.ast.ComptimeType")} + , (VCastTypeIndexName){.tindex = 301, .tname = _SLIT("v.ast.ConcatExpr")} + , (VCastTypeIndexName){.tindex = 302, .tname = _SLIT("v.ast.DumpExpr")} + , (VCastTypeIndexName){.tindex = 303, .tname = _SLIT("v.ast.EmptyExpr")} + , (VCastTypeIndexName){.tindex = 304, .tname = _SLIT("v.ast.EnumVal")} + , (VCastTypeIndexName){.tindex = 305, .tname = _SLIT("v.ast.FloatLiteral")} + , (VCastTypeIndexName){.tindex = 306, .tname = _SLIT("v.ast.GoExpr")} + , (VCastTypeIndexName){.tindex = 307, .tname = _SLIT("v.ast.Ident")} + , (VCastTypeIndexName){.tindex = 308, .tname = _SLIT("v.ast.IfExpr")} + , (VCastTypeIndexName){.tindex = 309, .tname = _SLIT("v.ast.IfGuardExpr")} + , (VCastTypeIndexName){.tindex = 310, .tname = _SLIT("v.ast.IndexExpr")} + , (VCastTypeIndexName){.tindex = 311, .tname = _SLIT("v.ast.InfixExpr")} + , (VCastTypeIndexName){.tindex = 312, .tname = _SLIT("v.ast.IntegerLiteral")} + , (VCastTypeIndexName){.tindex = 313, .tname = _SLIT("v.ast.IsRefType")} + , (VCastTypeIndexName){.tindex = 314, .tname = _SLIT("v.ast.Likely")} + , (VCastTypeIndexName){.tindex = 315, .tname = _SLIT("v.ast.LockExpr")} + , (VCastTypeIndexName){.tindex = 316, .tname = _SLIT("v.ast.MapInit")} + , (VCastTypeIndexName){.tindex = 317, .tname = _SLIT("v.ast.MatchExpr")} + , (VCastTypeIndexName){.tindex = 318, .tname = _SLIT("v.ast.NodeError")} + , (VCastTypeIndexName){.tindex = 319, .tname = _SLIT("v.ast.None")} + , (VCastTypeIndexName){.tindex = 320, .tname = _SLIT("v.ast.OffsetOf")} + , (VCastTypeIndexName){.tindex = 321, .tname = _SLIT("v.ast.OrExpr")} + , (VCastTypeIndexName){.tindex = 322, .tname = _SLIT("v.ast.ParExpr")} + , (VCastTypeIndexName){.tindex = 323, .tname = _SLIT("v.ast.PostfixExpr")} + , (VCastTypeIndexName){.tindex = 324, .tname = _SLIT("v.ast.PrefixExpr")} + , (VCastTypeIndexName){.tindex = 325, .tname = _SLIT("v.ast.RangeExpr")} + , (VCastTypeIndexName){.tindex = 326, .tname = _SLIT("v.ast.SelectExpr")} + , (VCastTypeIndexName){.tindex = 327, .tname = _SLIT("v.ast.SelectorExpr")} + , (VCastTypeIndexName){.tindex = 328, .tname = _SLIT("v.ast.SizeOf")} + , (VCastTypeIndexName){.tindex = 329, .tname = _SLIT("v.ast.SqlExpr")} + , (VCastTypeIndexName){.tindex = 330, .tname = _SLIT("v.ast.StringInterLiteral")} + , (VCastTypeIndexName){.tindex = 331, .tname = _SLIT("v.ast.StringLiteral")} + , (VCastTypeIndexName){.tindex = 332, .tname = _SLIT("v.ast.StructInit")} + , (VCastTypeIndexName){.tindex = 333, .tname = _SLIT("v.ast.TypeNode")} + , (VCastTypeIndexName){.tindex = 334, .tname = _SLIT("v.ast.TypeOf")} + , (VCastTypeIndexName){.tindex = 335, .tname = _SLIT("v.ast.UnsafeExpr")} + , (VCastTypeIndexName){.tindex = 362, .tname = _SLIT("v.ast.AsmRegister")} + , (VCastTypeIndexName){.tindex = 363, .tname = _SLIT("v.ast.ConstField")} + , (VCastTypeIndexName){.tindex = 364, .tname = _SLIT("v.ast.GlobalField")} + , (VCastTypeIndexName){.tindex = 365, .tname = _SLIT("v.ast.Var")} + , (VCastTypeIndexName){.tindex = 337, .tname = _SLIT("v.ast.AsmStmt")} + , (VCastTypeIndexName){.tindex = 338, .tname = _SLIT("v.ast.AssertStmt")} + , (VCastTypeIndexName){.tindex = 339, .tname = _SLIT("v.ast.AssignStmt")} + , (VCastTypeIndexName){.tindex = 340, .tname = _SLIT("v.ast.Block")} + , (VCastTypeIndexName){.tindex = 341, .tname = _SLIT("v.ast.BranchStmt")} + , (VCastTypeIndexName){.tindex = 342, .tname = _SLIT("v.ast.ComptimeFor")} + , (VCastTypeIndexName){.tindex = 343, .tname = _SLIT("v.ast.ConstDecl")} + , (VCastTypeIndexName){.tindex = 344, .tname = _SLIT("v.ast.DeferStmt")} + , (VCastTypeIndexName){.tindex = 345, .tname = _SLIT("v.ast.EmptyStmt")} + , (VCastTypeIndexName){.tindex = 346, .tname = _SLIT("v.ast.EnumDecl")} + , (VCastTypeIndexName){.tindex = 347, .tname = _SLIT("v.ast.ExprStmt")} + , (VCastTypeIndexName){.tindex = 220, .tname = _SLIT("v.ast.FnDecl")} + , (VCastTypeIndexName){.tindex = 348, .tname = _SLIT("v.ast.ForCStmt")} + , (VCastTypeIndexName){.tindex = 349, .tname = _SLIT("v.ast.ForInStmt")} + , (VCastTypeIndexName){.tindex = 350, .tname = _SLIT("v.ast.ForStmt")} + , (VCastTypeIndexName){.tindex = 351, .tname = _SLIT("v.ast.GlobalDecl")} + , (VCastTypeIndexName){.tindex = 352, .tname = _SLIT("v.ast.GotoLabel")} + , (VCastTypeIndexName){.tindex = 353, .tname = _SLIT("v.ast.GotoStmt")} + , (VCastTypeIndexName){.tindex = 354, .tname = _SLIT("v.ast.HashStmt")} + , (VCastTypeIndexName){.tindex = 355, .tname = _SLIT("v.ast.Import")} + , (VCastTypeIndexName){.tindex = 356, .tname = _SLIT("v.ast.InterfaceDecl")} + , (VCastTypeIndexName){.tindex = 357, .tname = _SLIT("v.ast.Module")} + , (VCastTypeIndexName){.tindex = 358, .tname = _SLIT("v.ast.Return")} + , (VCastTypeIndexName){.tindex = 359, .tname = _SLIT("v.ast.SqlStmt")} + , (VCastTypeIndexName){.tindex = 360, .tname = _SLIT("v.ast.StructDecl")} + , (VCastTypeIndexName){.tindex = 284, .tname = _SLIT("v.ast.TypeDecl")} + , (VCastTypeIndexName){.tindex = 437, .tname = _SLIT("v.ast.AsmAddressing")} + , (VCastTypeIndexName){.tindex = 438, .tname = _SLIT("v.ast.AsmAlias")} + , (VCastTypeIndexName){.tindex = 439, .tname = _SLIT("v.ast.AsmDisp")} , (VCastTypeIndexName){.tindex = 20, .tname = _SLIT("string")} })); @@ -96692,9 +96782,9 @@ void _vinit(int ___argc, voidptr ___argv) { _const_v__util__builtin_module_parts = new_array_from_c_array(6, 6, sizeof(string), _MOV((string[6]){_SLIT("math.bits"), _SLIT("strconv"), _SLIT("dlmalloc"), _SLIT("strconv.ftoa"), _SLIT("strings"), _SLIT("builtin")})); _const_v__util__bundle_modules = new_array_from_c_array(7, 7, sizeof(string), _MOV((string[7]){_SLIT("clipboard"), _SLIT("fontstash"), _SLIT("gg"), _SLIT("gx"), _SLIT("sokol"), _SLIT("szip"), _SLIT("ui")})); _const_v__util__external_module_dependencies_for_tool = new_map_init(&map_hash_string, &map_eq_string, &map_clone_string, &map_free_string, 1, sizeof(string), sizeof(Array_string), _MOV((string[1]){_SLIT("vdoc"), }), _MOV((Array_string[1]){new_array_from_c_array(1, 1, sizeof(string), _MOV((string[1]){_SLIT("markdown")})), })); - _const_v__util__const_tabs = new_array_from_c_array(10, 10, sizeof(string), _MOV((string[10]){ + _const_v__util__const_tabs = new_array_from_c_array(11, 11, sizeof(string), _MOV((string[11]){ _SLIT(""), _SLIT("\t"), _SLIT("\t\t"), _SLIT("\t\t\t"), _SLIT("\t\t\t\t"), _SLIT("\t\t\t\t\t"), _SLIT("\t\t\t\t\t\t"), _SLIT("\t\t\t\t\t\t\t"), _SLIT("\t\t\t\t\t\t\t\t"), - _SLIT("\t\t\t\t\t\t\t\t\t")})); + _SLIT("\t\t\t\t\t\t\t\t\t"), _SLIT("\t\t\t\t\t\t\t\t\t\t")})); _const_v__util__builtin_module_names = new_array_from_c_array(5, 5, sizeof(string), _MOV((string[5]){_SLIT("builtin"), _SLIT("strconv"), _SLIT("strings"), _SLIT("dlmalloc"), _SLIT("math")})); lines_cache = ((v__util__LinesCache*)memdup(&(v__util__LinesCache){.lines = new_map(sizeof(string), sizeof(Array_string), &map_hash_string, &map_eq_string, &map_clone_string, &map_free_string),}, sizeof(v__util__LinesCache))); // 3global g_timers = v__util__new_timers(((v__util__TimerParams){.should_print = false,.label = _SLIT("g_timers"),})); // 3global @@ -96825,7 +96915,7 @@ 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(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__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"), string_clone(_const_v__gen__c__option_name), 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 #if defined(__MINGW32__) || defined(__MINGW64__)\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 #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 #if defined(__MINGW32__) || defined(__MINGW64__)\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")}));