Commit Graph

1683 Commits (e6270b05dcf0006867102e7b2a24f0a37a2b27b5)

Author SHA1 Message Date
yuyi 03864e4ab8
checker: fix cast enum to alias (#12968) 2021-12-26 11:34:20 +02:00
yuyi 8764a3a973
checker: check errors of cast to byte (#12961) 2021-12-25 11:34:15 +02:00
yuyi a83786d867
checker: minor cleanup in cast_expr() (#12954) 2021-12-24 11:38:27 +02:00
yuyi d4f28c88b3
checker: minor cleanup in the checker.v (#12945) 2021-12-23 15:02:09 +02:00
Delyan Angelov e256f1b2aa
checker,cgen: stabilise generic method handling (fix a source code ordering issue) 2021-12-22 18:03:46 +02:00
penguindark 278c08704c
all: support slices with negative indexes `#[start..end]` (gated arrays) (#12914) 2021-12-22 16:34:02 +03:00
playX 5f0160bf11
js,gg: more work on porting gg to JS backend (#12903) 2021-12-20 16:18:21 +03:00
yuyi cd0b581445
ast: rename 'table.get_type_symbol()' to 'table.sym()' and more related calls (#12898) 2021-12-19 18:25:18 +02:00
Delyan Angelov 6ff953d936
preludes,builder,cgen: add support for VTEST_RUNNER=tap and -test-runner tap (#12523) 2021-12-16 15:59:46 +02:00
Delyan Angelov caac89d6ca
checker: fix `function x is private` error in main, for `pub const abc = x()` in a (sub)module 2021-12-16 12:03:49 +02:00
yuyi d8a333058d
checker, cgen: fix generic map with generic type key (#12859) 2021-12-16 09:53:05 +02:00
spaceface 65f12f3217
checker: fix invalid cast warning for flag enums (#12848) 2021-12-15 16:58:25 +02:00
playX 11d2b8b354
js: support `-es5` flag (#12846) 2021-12-15 15:47:34 +02:00
Leo Developer 8c1c70db04
checker: fix x.$(field.name) not working outside of $if (#12802) 2021-12-12 03:18:29 +02:00
Delyan Angelov 79de408ef0
parser,checker: support `[generated] module xyz` (turns off notices). Use it for `infix.v`. 2021-12-12 00:58:38 +02:00
Alexander Medvednikov a58c539ee6 checker: minor fixes 2021-12-11 10:56:37 +03:00
Alexander Medvednikov 19a47abcca checker: split up checker.v: fn.v, if.v, interface.v, match.v, return.v 2021-12-11 10:51:01 +03:00
Alexander Medvednikov ee6c0a0691 checker: split up checker.v: fn.v, if.v, interface.v, match.v 2021-12-11 10:48:07 +03:00
Alexander Medvednikov eaf0f9b4c1 checker: split up checker.v: assign.v, orm.v, comptime.v; c2v fixes 2021-12-11 10:23:58 +03:00
yuyi 9b4329d2f6
ast, checker, cgen: fix interface method with struct embed (#12783) 2021-12-10 14:56:13 +02:00
playX b116170735
js: add support for Promise.wait() (#12781)
* builtin/js: Change Promise<T,E> to Promise<T>

* js: codegen support for Promise.wait()

* checker: checker support for Promise.wait()
2021-12-10 14:54:20 +02:00
yuyi 7fc9e614a3
ast, parser, checker: fix generic fn in builtin module (#12769) 2021-12-09 21:37:43 +02:00
Alexander Medvednikov 8f9f681e81 checker: move check_types() on top; small c2v fixes 2021-12-09 05:44:41 +03:00
yuyi d88e67a5ec
checker: fix const type with raw string literal (#12761) 2021-12-08 22:28:55 +02:00
crthpl 2fbf7fea75
all: initial interpreter code (#12605) 2021-12-08 11:09:10 +03:00
playX 1cb06a2de4
js: ast.GoExpr support using promises on JS backend (#12749) 2021-12-07 12:11:54 +03:00
yuyi 36fbd3c4fa
checker: check sumtype as mismatched type (#12743) 2021-12-07 01:31:47 +03:00
Alexander Medvednikov 325e116b7a cgen: 4 byte bool flagg for compatibility with some C software 2021-12-06 12:36:25 +03:00
Delyan Angelov 3ab82a23c5
tools: cleanup the output of V, compiled with `-d trace_parser` and `-d trace_checker` 2021-12-06 09:54:53 +02:00
playX 105d7fcf75
js: support JS.await (#12726) 2021-12-05 13:33:53 +02:00
Delyan Angelov 229d2fb667
v.util.timers: improve tracing by supporting `-d trace_timers_creation` 2021-12-05 11:55:41 +02:00
Leo Developer ace63594bf
all: support `$embed_file('embed.vv', .zlib)` (#12654) 2021-12-04 19:43:19 +02:00
yuyi 0f50ac3260
ast: cleanup struct embeds related methods (#12719) 2021-12-04 18:46:41 +02:00
yuyi 0cb4557a8d
ast, checker, cgen: fix nested struct embed method call (#12714) 2021-12-04 14:51:42 +02:00
yuyi 2d43fdb42a
ast, checker, cgen: fix nested struct embed error (fix #12659) (#12712) 2021-12-04 11:19:19 +03:00
Alexander Medvednikov eca78a2906 checker: allow infix expressions in enum declarations 2021-12-03 07:45:37 +03:00
yuyi 66a67de8c0
checker, cgen: fix match expr returning optional with error (fix #12556) (#12645) 2021-12-02 12:22:48 +02:00
yuyi 988779846f
checker: fix map init with enum keys (#12637) 2021-12-01 18:11:50 +02:00
Delyan Angelov f5d283721e
checker: add more `string(x)` checks, with more detailed replacement suggestions 2021-12-01 11:28:00 +02:00
Delyan Angelov 47aa2b1f93
all: fix casting of `string(MyString('abc'))` and `byte(MyByte(123))`; improve TypeSymbol handling (#12617) 2021-12-01 09:50:53 +02:00
Delyan Angelov 6d97b0a407
checker: improve checking of a << b, when a and b are numbers (#12589) 2021-11-29 03:48:49 +03:00
yuyi 6d6a23a1c9
checker: remove redundant code of find field with embed (#12600) 2021-11-28 21:31:19 +02:00
Leo Developer 9c88317ca6
checker: add a warning if start value is higher than end value (#12602) 2021-11-28 18:46:52 +02:00
Delyan Angelov 8315e82188
checker: improve naming for `.stmts()` and `c.stmts_ending_with_expression()`, add a better explanation for their purpose 2021-11-27 08:09:36 +02:00
Delyan Angelov deaeffc4db
checker: add a check for unused `x << y` expressions (where x != array) (#12586) 2021-11-27 07:38:35 +02:00
Joe Conigliaro 12585e88e1
checker: remove obsolete/slow const ordering code. close #12544 2021-11-27 05:36:27 +11:00
yuyi cf274f262c
checker, cgen: fix fn type call of match expr (#12579) 2021-11-26 09:52:20 +02:00
yuyi ac3910b8c2
checker: merge comptime_const_eval.v and noreturn.v into checker.v (#12573) 2021-11-25 12:41:26 +02:00
yuyi 6f46fc2170
checker, cgen: fix for_in_mut iterator val (#12563) 2021-11-24 14:43:37 +02:00
yuyi 13a2d547b4
checker: fix vtl compile error (#12550) 2021-11-23 10:55:15 +02:00
yuyi fbe2b5cb58
checker: check argument type error of the generics fn declaration (#12539) 2021-11-22 22:39:20 +02:00
yuyi f37eb6a932
checker: check invalid fn parameter name (#12540) 2021-11-22 16:51:58 +02:00
playX 243e66a106
js,jsdom: Canvas & context API; Added TypeSymbol.is_js_compatible & temporary hacks for JS ifaces (#12526) 2021-11-20 21:28:11 +02:00
Ned 82010e729d
checker: fix "unregistered" variadic interface call arguments (#12525) 2021-11-20 18:15:20 +02:00
Delyan Angelov fa995ca537
checker: add an error for `x.method({})` calls, when method expects a struct 2021-11-19 13:30:45 +02:00
playX 1edb3e559e
js,jsdom: make JS structs plain objects; add more DOM API support for jsdom (#12501) 2021-11-18 10:09:53 +02:00
zakuro 26fbf1885d
checker: report error for test functions that have parameters (#12500) 2021-11-18 08:33:28 +03:00
yuyi 3e1fb22a04
checker: format checker.v (#12490) 2021-11-17 15:57:17 +02:00
yuyi 1370516f53
checker: check struct field using 'any' type (#12489) 2021-11-17 11:42:05 +02:00
playX 2eb02ff5a7
jsdom, js: start refactoring jsdom; improve JS interfaces; add two attributes for them (#12488) 2021-11-17 11:41:33 +02:00
yuyi 5a89c0a480
ast: change CompFor to ComptimeFor (#12482) 2021-11-17 08:29:43 +02:00
Alexander Medvednikov 49a36515dc checker, cgen: c2v fixes 2021-11-16 20:56:50 +03:00
yuyi 2984751a57
checker: fix the argument mismatch of fn call (#12479) 2021-11-16 17:19:02 +02:00
yuyi 9565adf597
checker: check invalid map variable name (#12474) 2021-11-16 08:42:49 +02:00
yuyi c28041cecc
all: cleanup/rename all `comp_` names to be `comptime_` (#12467) 2021-11-15 15:47:29 +02:00
zakuro 5e75c89b71
checker: allow noreturn in if expr (#12462) 2021-11-15 10:29:58 +02:00
yuyi 460f4523aa
checker: check array pop immutable (#12458) 2021-11-14 21:00:22 +02:00
yuyi 3bb1c3f930
checker, cgen: fix for in iterator of generic struct (#12441) 2021-11-12 14:29:01 +02:00
playX a4c57ba56e
js: support JS interfaces (#12426) 2021-11-11 14:36:32 +02:00
yuyi 72a7d5a559
checker: minor cleanup in method_call (#12430) 2021-11-11 07:12:59 +02:00
yuyi d5e767f389
checker, cgen: fix alias of map keys() (#12422) 2021-11-10 13:04:59 +02:00
playX 194b3647e2
js,checker: allow casting JS primitives to V primitives and vice-versa (#12420) 2021-11-10 11:37:16 +02:00
yuyi c8ff9e39b5
checker: cleanup generic struct init (#12406) 2021-11-07 18:47:38 +02:00
Alexander Medvednikov ace9444108 checker: more c2v fixes 2021-11-04 18:43:02 +03:00
yuyi 73e25ccb3c
checker: check generic struct field fn args type mismatch (#12379) 2021-11-04 10:18:36 +02:00
playX 2b4154910c
jsdom, checker: add more methods for CanvasRenderingContext2D, fix interop check for JS methods (#12372) 2021-11-03 16:54:28 +02:00
yuyi 4bafc5042b
checker: check generic struct field fn args error (#12373) 2021-11-03 10:20:39 +02:00
yuyi 639cbfa0d1
checker: fix generics with assign nested generic fn call (#12366) 2021-11-02 10:12:26 +02:00
yuyi 0952af606c
checker: fix comptime if T is interface (#12365) 2021-11-02 09:35:01 +02:00
yuyi dcf230ca24
checker: fix nested generic method call (#12353) 2021-11-01 15:41:54 +03:00
yuyi da65680acf
checker: fix comptime if expr of sync.threads (#12356) 2021-11-01 09:41:04 +02:00
Delyan Angelov 579d5ae649
builtin,checker: add array.flags. Allow changing it in `unsafe {}` blocks 2021-10-31 11:04:56 +02:00
Lucas Jenß f801ef5e17
checker: disallow `mut` keyword in right-hand side of assignment (#12318) 2021-10-29 12:03:05 +03:00
Louis Schmieder d33f7d12f7
orm: fix time struct in sql stmt (#12298) 2021-10-28 22:31:41 +03:00
Delyan Angelov 1b6cccaf6d
parser,checker: allow a goto label right after return 2021-10-28 10:40:31 +03:00
Lucas Jenß 43fbc68f1e
checker: disallow `<-` (channel push) on right-hand side of assignment (fix #12309) (#12321) 2021-10-27 17:53:50 +03:00
Delyan Angelov 008d15dcb5
builder,pref: add support for `-no-builtin` (useful for writing Linux kernel modules) 2021-10-23 12:53:53 +03:00
yuyi ff02c19827
table, builder, checker: cleanup unwrap_generic (#12241) 2021-10-21 05:48:02 +03:00
playX c1aa782a6c
js,checker: fix some modules build for `v -b js self`, fix `or block` check in ast.CallExpr (#12231) 2021-10-19 12:11:54 +03:00
05st fd3a10ab43
checker: fix mut check bypass with for in loops (#12208) 2021-10-17 06:41:39 +03:00
yuyi c108e01917
checker: fix generic fn return types with generic struct (#12186) 2021-10-15 11:50:10 +03:00
yuyi c9b2f878b3
parser, checker: optimize checking generic struct type mismatch (#12179) 2021-10-15 00:11:31 +03:00
yuyi 97e999768a
checker: fix generic fn return array of generic struct (#12170) 2021-10-13 21:21:32 +03:00
Alexander Medvednikov da58ba0d5c vweb: populate action method params with form values 2021-10-12 07:10:12 +03:00
Alexander Ivanov 0386f2bbea
checker: add an interface check for mutability, fixes #1081, fixes #7038 (#11963) 2021-10-11 15:41:31 +03:00
yuyi 1831eccd5e
checker: check generic struct using in non-generic fn (#12136) 2021-10-11 02:46:44 +03:00
yuyi 093cab6f56
checker: check generics struct init that types mismatch (fix #12115) (#12120) 2021-10-09 15:03:37 +03:00
yuyi 0d53705776
v.checker: check fn returning void type (fix #12076) (#12078) 2021-10-06 21:04:33 +03:00
yuyi f1742a6f62
v.ast: change 'type.to_ptr()' to 'type.ref()' (#12086) 2021-10-06 20:49:39 +03:00
05st 86a5e72c74
v.checker: fix return type checking being skipped for mutable method receivers (#12043) 2021-10-02 23:26:46 +03:00