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
Delyan Angelov
258d0d6df7
cgen: make `dump(x)` use a single write call, fix memleaks for autogenerated .str() methods of nested structs ( #12529 )
2021-11-20 20:55:19 +02:00
Ned
82010e729d
checker: fix "unregistered" variadic interface call arguments ( #12525 )
2021-11-20 18:15:20 +02:00
Delyan Angelov
90ba856107
cgen: fix `dump(x)` with `fn (x &Type) str() string {`
2021-11-20 13:12:03 +02:00
yuyi
eec8788333
checker: fix generics fn infer nested generic fn ( #12519 )
2021-11-19 20:31:55 +02:00
Delyan Angelov
b576181a66
cgen: fix `const x := opt() or {}` side effect interference when the consts are in different files in the same module too
2021-11-19 19:02:33 +02:00
Delyan Angelov
e275220f05
cgen: fix `const x := opt() or {}` side effect interference with parallel cgen
2021-11-19 18:15:06 +02:00
yuyi
c2eb909c9b
cgen: fix multiple matches in one expr ( #12516 )
2021-11-19 13:52:28 +02:00
pancake
80a4ff9900
native: handle some more statements and dont echo warnings ( #12518 )
2021-11-19 13:50:44 +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
pancake
9eac656e55
native: support passing a directory, instead of just a .v file ( #12512 )
2021-11-19 10:30:46 +02:00
pancake
b367ed9ba3
native: support defining functions in any order ( #12511 )
2021-11-19 10:25:42 +02:00
yuyi
d498c365c2
checker: cleanup infer_fn_generic_types() ( #12515 )
2021-11-19 10:24:03 +02:00
Delyan Angelov
3caeadfa0d
cgen,vfmt: support `[weak]` tags for functions and globals
2021-11-18 18:32:39 +02:00
Alexander Medvednikov
5bf28c5287
cgen: handle c2v fn casts
2021-11-18 11:58:00 +03: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
b5e410e408
fmt: format explicit map init with parameter ( #12499 )
2021-11-18 08:34:30 +03: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
yuyi
927df948ae
cgen: fix generic struct free() ( #12487 )
2021-11-17 08:18:46 +03: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
Delyan Angelov
3fab0a5d05
cgen: fix codegen for `for k,v in map_of_pointers {`
2021-11-16 17:03:58 +02:00
Delyan Angelov
045579fd8a
parser: use the `[has_globals]` module attribute, remove the parser `global_enabled_mods whitelist` (part 2)
2021-11-16 11:44:36 +02:00
Delyan Angelov
f0f5f97e9f
parser: support a `[has_globals]` module attribute, to eliminate a parser whitelist (part 1)
2021-11-16 11:34:26 +02:00
yuyi
bede0587ad
cgen: fix string interliteral of the comptime selector ( #12475 )
2021-11-16 08:45:47 +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
Charles WANG
1d003228cb
tests: update generics_method_str_overload_test.v to return a generic type, instead of `Gen<G>`. ( #12465 )
2021-11-15 15:36:54 +02:00
playX
a8a1e9381f
strconv,js: f64_to_str works on JS backend now; Fix BigInt usage in infix expressions ( #12464 )
2021-11-15 14:13:44 +02:00
Delyan Angelov
1d2b16dde2
js: support `[if userflag?]` fn tags
2021-11-15 13:23:27 +02:00
zakuro
5e75c89b71
checker: allow noreturn in if expr ( #12462 )
2021-11-15 10:29:58 +02:00
yuyi
d8479f107f
cgen: fix typeof comptime selector ( fix #12461 ) ( #12463 )
2021-11-15 10:23:49 +02:00
playX
e3d98b1b28
js,strconv: port some functions to JS backend, improve `rune.str()` ( #12460 )
2021-11-14 21:06:58 +02:00
yuyi
460f4523aa
checker: check array pop immutable ( #12458 )
2021-11-14 21:00:22 +02:00
yuyi
fb997eb5fe
cgen: fix comptime for in field selector ( #12457 )
2021-11-14 20:58:22 +02:00
Delyan Angelov
61b99e1915
vfmt: handle comments right after interface fields
2021-11-13 13:42:17 +02:00
playX
6c32c544e1
js,parser: allow declaring methods on JS interfaces for easier FFI ( #12447 )
2021-11-13 11:08:17 +02:00
yuyi
3bb1c3f930
checker, cgen: fix for in iterator of generic struct ( #12441 )
2021-11-12 14:29:01 +02:00
yuyi
6f55439930
tests: supplement tests for different types of generic parameters ( #12432 )
2021-11-11 14:45:55 +02:00
playX
a4c57ba56e
js: support JS interfaces ( #12426 )
2021-11-11 14:36:32 +02:00
zakuro
823a3ab838
fmt: fix removal of selective imported types used as type parameter ( #12431 )
2021-11-11 07:15:30 +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
Delyan Angelov
6c244d3065
cgen: improve diagnostic for a v compiler panic in dicordv
2021-11-10 08:12:12 +02:00
yuyi
8f4180ea09
parser: check generic parameters error of generic struct declaration ( #12418 )
2021-11-09 09:25:57 +02:00
Delyan Angelov
3f841edec1
v.util: make get_vtmp_folder() return `/tmp/v_{uid}` by default (see https://github.com/vlang/v/discussions/11796 )
2021-11-09 08:25:19 +02:00
yuyi
08667c5645
pref: allow running a .vsh script with just `v build.vsh gcc`, instead of `v run build.vsh gcc` ( #12409 )
2021-11-08 15:18:11 +02:00
yuyi
758c18a906
cgen: fix for in mut val in array.index() ( #12410 )
2021-11-08 11:12:10 +02:00
yuyi
1211029926
cgen: avoid generating typedef generic array type ( #12407 )
2021-11-07 21:24:30 +02:00
yuyi
c8ff9e39b5
checker: cleanup generic struct init ( #12406 )
2021-11-07 18:47:38 +02:00
Delyan Angelov
bc98da9111
ast: speed up the frequently called methods .find_field, .find_method etc
2021-11-07 18:07:04 +02:00
yuyi
9ec1262734
ast: fix generic nested struct init ( #12405 )
2021-11-07 17:06:37 +02:00
Delyan Angelov
1c12186701
v.token,ast,scanner,parser: use a KeywordsMatcher lookup for builtin_type_names searches too
2021-11-07 16:39:40 +02:00
Delyan Angelov
80242c8041
builtin,ast: apply small performance improvements, suggested by `hotspot`
2021-11-07 13:30:44 +02:00
Alexander Medvednikov
ace9444108
checker: more c2v fixes
2021-11-04 18:43:02 +03:00
yuyi
59e21c2068
cgen: fix array of threads wait ( fix #12350 ) ( #12378 )
2021-11-04 14:24:58 +02:00
yuyi
73e25ccb3c
checker: check generic struct field fn args type mismatch ( #12379 )
2021-11-04 10:18:36 +02:00
Delyan Angelov
a27833ed0d
all: support `volatile field Type` in struct declarations
2021-11-04 09:45:50 +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
Delyan Angelov
c4e282a0c8
parser: check fn args in declarations too with `-Wimpure-v`
...
`v -Wimpure-v examples/2048/` now passes cleanly.
2021-11-03 16:20:24 +02:00
yuyi
4bafc5042b
checker: check generic struct field fn args error ( #12373 )
2021-11-03 10:20:39 +02:00
yuyi
3fdbfca202
cgen: fix `for in` with mutable structs ( #12368 )
2021-11-02 18:40:13 +03: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
crthpl
1d1793ec34
fmt: correctly format segment offsets ( #12364 )
2021-11-02 08:04:41 +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
Lucas Jenß
51f5841b6e
checker: do not deref non-pointer types in `fn_signature_using_aliases` ( #12340 )
2021-11-01 02:26:15 +03:00
Delyan Angelov
6937074e7a
strings,builder: reduce V cgen and parser memory consumption, fix strings.Builder leak ( #12342 )
2021-10-31 12:58:55 +02:00
Delyan Angelov
579d5ae649
builtin,checker: add array.flags. Allow changing it in `unsafe {}` blocks
2021-10-31 11:04:56 +02:00
Delyan Angelov
a7d4236337
sync,strings,cgen: reduce memory consumption in cgen
2021-10-29 22:29:56 +03:00
yuyi
d5642b6134
cgen: fix error of nested match expr ( #12334 )
2021-10-29 17:14:49 +03:00
Delyan Angelov
4c67c01e72
parser,util: improve libleak false positive detection rate
2021-10-29 16:42:55 +03:00
Delyan Angelov
3d800b12e8
scanner: small optimisation of the ident_name hot loop
2021-10-29 16:18:34 +03:00
Lucas Jenß
f801ef5e17
checker: disallow `mut` keyword in right-hand side of assignment ( #12318 )
2021-10-29 12:03:05 +03:00
playX
a32dae335a
js: fix interfaces behaviour & disable struct deep copy for now ( #12333 )
2021-10-29 11:23:40 +03:00
Louis Schmieder
d33f7d12f7
orm: fix time struct in sql stmt ( #12298 )
2021-10-28 22:31:41 +03:00
playX
fa02418a55
js: copy variables passed to closures ( #12328 )
2021-10-28 19:31:56 +03:00
yuyi
0e95e4d7b4
ast, cgen: fix generic method str() overload ( #12330 )
2021-10-28 19:03:17 +03:00
Delyan Angelov
99e71d0868
scanner: preallocate space for tokens to reduce the number of allocations in the hot loop
2021-10-28 16:23:24 +03:00
Delyan Angelov
8014235e0e
scanner: speed up text_scan by using a specialised keywords matcher, instead of a generic V map of keywords
2021-10-28 15:41:13 +03:00
Delyan Angelov
b1bb1d361a
ci: vfmt parser.v
2021-10-28 10:51:55 +03:00
Delyan Angelov
1b6cccaf6d
parser,checker: allow a goto label right after return
2021-10-28 10:40:31 +03:00
ChAoS_UnItY
8cd01e0eac
cgen: fix error caused by fixed size array init syntax with variable it ( #12314 )
2021-10-28 02:20:49 +03:00
playX
cfecb62299
js: DOM API. Part 1 ( #12296 )
2021-10-27 23:18:09 +03:00
Delyan Angelov
0ff23eeb74
ci: fix failing assign_expr_channel_push.out
2021-10-27 22:54:41 +03:00
Delyan Angelov
f79bc8619a
scanner: remove unused .line_ends field
2021-10-27 22:37:00 +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
159a9c3070
markused: fix `-skip-unused` on programs with generic methods ( fix #12306 )
2021-10-27 17:22:26 +03:00
yuyi
943a807d30
parser: implement generics method with auto multi generic types ( #12312 )
2021-10-27 15:41:13 +03:00
Wertzui123
ea6d2d53db
parser: disallow `for mut in range` ( fix #12234 ) ( #12277 )
2021-10-27 14:55:36 +03:00
Lucas Jenß
d7fd4a563b
parser: remove commented out debug statement ( #12316 )
2021-10-27 14:30:22 +03:00
Andreas Schoeller
f14dabc6bd
math.big: add a new greatest-common-divisor-algo for big.Integer, also add a benchmark for it ( #12261 )
2021-10-26 11:10:13 +03:00
yuyi
f62b2dcfa7
table: fix generic method with multi generic types ( #12297 )
2021-10-26 11:00:27 +03:00
yuyi
ac99007cab
table: fix generic sumtype instantiations ( #12288 )
2021-10-25 15:22:41 +03:00
Delyan Angelov
45c1c1ab41
ci: fix import_symbol_private_err.vv and its .out file (time.since is no longer private)
2021-10-24 22:06:32 +03:00
playX
2eae4cf63e
js: fix optional error propagation ( #12283 )
2021-10-24 15:56:44 +03:00
Delyan Angelov
c340906280
cgen: cleanup vinit_string_literals, _vcleanup and reload_so declarations
2021-10-24 15:29:42 +03:00
zakuro
242b99340d
vfmt: fix bug where duplicated comma is placed before comment in array init ( #12281 )
2021-10-24 12:05:34 +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
playX
864d6eae6b
js: codegen & vlib fixes, replace the Game of Life CLI example ( #12272 )
2021-10-22 22:03:19 +03:00
Delyan Angelov
eed94c727c
os: move C struct declarations in their own _default.c.v files ( #12268 )
2021-10-22 17:08:08 +03:00
ChAoS_UnItY
5b69593766
cgen,js: fix missing break in switch case, generated by match with range branches ( #12260 )
2021-10-21 22:30:05 +03:00
czkz
da7dad07a3
builder: fix sigint handling for `v run` ( #12246 )
2021-10-21 16:40:32 +03:00
yuyi
ff02c19827
table, builder, checker: cleanup unwrap_generic ( #12241 )
2021-10-21 05:48:02 +03:00
Lance Fredrickson
7c1fff3495
builder: pass `-std=gnu99` to the C backend under linux ( #12236 )
2021-10-20 14:26:25 +03:00
05st
3e52d54586
cgen: fix match expr when evaluating to sumtype ( #12237 )
2021-10-20 11:52:11 +03:00
ChAoS_UnItY
ab350d52ec
cgen: support RangeExpr while emitting enum switch case ( #12226 )
2021-10-19 17:02:22 +03:00
Delyan Angelov
f2cda1a529
parser: update p.inside_or_expr consistently (fix `v fmt -w vls/analyzer/symbol_registration.v`)
2021-10-19 13:36:10 +03:00
yuyi
6aca360507
parser: fix checking unexpected name ( #12233 )
2021-10-19 12:27:59 +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
Delyan Angelov
b23984a211
builder: only print the thirdparty object rebuilding line with '-v'
2021-10-18 13:28:09 +03:00
ChAoS_UnItY
53c2e262f1
cgen & jsgen: generate when possible a `switch` from `match x {` ( #12216 )
2021-10-18 10:59:52 +03:00
playX
a3de67de28
js: support WASM interoperability using `wasm_import`/`wasm_export` fn tags ( #12212 )
2021-10-18 10:56:21 +03:00
Delyan Angelov
5dd3864617
markused: fix `v -skip-unused cmd/tools/vpm.v` regression after 98b2bdb
2021-10-18 08:43:56 +03:00
Delyan Angelov
735c961682
autofree: add skipped string_plus_string_plus.v sample
2021-10-17 19:46:35 +03:00
czkz
3a073329ff
builder: use os.new_process() instead of os.system() in v run ( #12214 )
2021-10-17 19:01:34 +03:00
yuyi
a006090b08
ast: minor cleanup of register_type_symbol ( #12213 )
2021-10-17 15:50:42 +03:00
05st
fd3a10ab43
checker: fix mut check bypass with for in loops ( #12208 )
2021-10-17 06:41:39 +03:00
Delyan Angelov
dee4ffbc99
builder: make -usecache rebuild cached, but changed modules, and their dependants ( #12193 )
2021-10-15 12:22:59 +03:00
yuyi
c108e01917
checker: fix generic fn return types with generic struct ( #12186 )
2021-10-15 11:50:10 +03:00
yuyi
27cd21e459
cgen: fix infix ops, for cross assignments of types with overloaded operators ( #12192 )
2021-10-15 11:32:58 +03:00
playX
814b4ebb4c
term: get_terminal_size() for js_node, term.clear() for all js backends ( #12189 )
2021-10-15 10:10:40 +03:00
ChAoS_UnItY
4d1307f29b
all: index accessor in array init expression ( #12181 )
2021-10-15 03:57:49 +03:00
yuyi
c9b2f878b3
parser, checker: optimize checking generic struct type mismatch ( #12179 )
2021-10-15 00:11:31 +03:00
Delyan Angelov
4c2cb1b6df
vdoc: prevent leaking to the docs the `pure_v_but_overriden_by_` prefix
2021-10-14 11:47:50 +03:00
yuyi
05885059bd
cgen: remove the extra generated parentheses of single in_expr ( fix #12158 ) ( #12168 )
2021-10-14 11:38:16 +03:00
ChAoS_UnItY
6f629d1a6a
transformer: eliminate unreachable branches & redundant branch expressions in MatchExpr ( #12174 )
2021-10-14 02:15:52 +03:00
yuyi
97e999768a
checker: fix generic fn return array of generic struct ( #12170 )
2021-10-13 21:21:32 +03:00
playX
d373eba79b
js: implement more functions for JS backend ( #12167 )
2021-10-13 09:40:14 +03:00
pancake
ade5774313
native: fix return `a+b` infix construction ( #12161 )
2021-10-12 19:38:17 +03:00
Delyan Angelov
6c728cf389
js: add draft support for -skip-unused (hello_world.v works)
2021-10-12 19:34:37 +03:00
pancake
1d2b56d71d
native: fix example exit((1,2)->(a,b)return a+b) ( #12154 )
2021-10-12 18:51:28 +03:00
pancake
347ebe5fd3
native: append .exe, when using the native backend on windows ( #12159 )
2021-10-12 18:49:42 +03:00
pancake
a0a0ae85eb
native: add support for pe64 when -os windows is used ( #12149 )
2021-10-12 10:43:40 +03:00
playX
22962dd2d2
js: change codegen for match statement, speedup string.split_into_lines ( #12157 )
2021-10-12 09:52:16 +03:00
Alexander Medvednikov
da58ba0d5c
vweb: populate action method params with form values
2021-10-12 07:10:12 +03:00
pancake
5eba02ea94
native: fix stackframe bug on return statements ( #12153 )
2021-10-12 06:03:44 +03:00
Delyan Angelov
9fabf9f20c
checker: check for `x := Abc { f: fn () ? {} }` mismatch, when `f` is `fn ()`
2021-10-11 19:20:41 +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
ChAoS_UnItY
d0c961ebc0
transformer: eliminate unreachable branches in IfExpr and fold more expressions and statements ( #12135 )
...
* v: fix using constant as length in fixed array
* format test file
* v/trasnformer: discard unreachable if branches
* transform more expressions and statements
* replace IfExpr with EmptyExpr when all branches were eliminated
* fix typo
* fix gens
* only allows branch elimination on if expression statement
* fix native gen
* fix handling of multi branch ifs in the native backend, also allow for `if true {}`
Co-authored-by: KyleLin921021 <43753315+KyleLin921021@users.noreply.github.com>
Co-authored-by: Delyan Angelov <delian66@gmail.com>
2021-10-11 14:29:17 +03:00
05st
3e02cfd528
cgen: fix `in` op usage on array of sumtypes without cast ( #12141 )
2021-10-11 14:17:04 +03:00
yuyi
1831eccd5e
checker: check generic struct using in non-generic fn ( #12136 )
2021-10-11 02:46:44 +03:00
05st
e69df54a36
cgen: fix multi-return in if/match exprs ( #12139 )
2021-10-11 02:45:01 +03:00
yuyi
83bc9b35b1
ast: fix checking generic fn call with fntype arg mismatch ( #12132 )
2021-10-10 11:14:19 +03:00