1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Commit Graph

1282 Commits

Author SHA1 Message Date
Joe Conigliaro
5d36a59dd8
checker: fix returning [] from fn which retuns optional array 2021-02-12 22:30:30 +11:00
Alexander Medvednikov
0a03856c83 parser: small c2v fixes 2021-02-12 09:12:26 +01:00
yuyi
3164e29651
all: fix fn_or_for_in mut value (part 1) (#8671) 2021-02-12 02:03:11 +02:00
Nick Treleaven
84a16d8684
map: add move method (#8660) 2021-02-12 02:02:33 +02:00
Nick Treleaven
375efb0953
checker: improve errors for return count mismatch (#8686) 2021-02-12 01:47:11 +02:00
Joe Conigliaro
317d450723
checker: add error when trying to take address of call expr 2021-02-12 10:39:02 +11:00
zakuro
4305ce1493
checker: extract long match branches in c.stmt(), into separate checker functions (#8666) 2021-02-10 18:51:41 +02:00
Delyan Angelov
4646c414d8
checker: fix -skip-unused with struct inits with default expressions 2021-02-10 18:25:57 +02:00
yuyi
f2e74bce7a
checker: fix sumtype assign error (fix #7988) (#8655) 2021-02-10 10:59:56 +01:00
Uwe Krüger
f3c5f24c17
allow lock expression to return multiple objects (#8657) 2021-02-09 17:09:10 +02:00
Nick Treleaven
d37fb5641f
parser: improve printing of unexpected tokens (#8654) 2021-02-09 17:07:30 +02:00
Lukas Neubert
5abd49d9bc
cgen: cast default struct field value to correct SumType/interface (#8619) 2021-02-08 17:33:05 +02:00
Nick Treleaven
9e751f72c4
doc, fmt: use map{key: value} syntax for map literals (#8623) 2021-02-08 16:57:42 +02:00
zakuro
8ae23cd89e
parser: make `v := f(v)' an undefined variable error (#8634) 2021-02-08 16:55:01 +02:00
zakuro
e5839effbc
checker/cgen: allow << operator for aliases (#8561) 2021-02-08 01:41:47 +01:00
Lukas Neubert
473cd1d416
fmt: single line ternary return (#8605) 2021-02-08 00:28:46 +01:00
Uwe Krüger
118ca1240e
all: allow shared element types for struct and arrays (#8631) 2021-02-08 00:28:29 +01:00
Lukas Neubert
7f4c582f1a
fmt: unwrap long infix exprs inside parenthesis if necessary (#8609) 2021-02-07 23:10:39 +01:00
Delyan Angelov
d77bb2f606
all: improve -skip-unused, track consts, walk all AST nodes, support tests 2021-02-07 02:51:45 +02:00
Nick Treleaven
f5f65f929f
parser: parse map{key_expr: val_expr} (#8608) 2021-02-06 22:13:24 +01:00
Uwe Krüger
cf230644b6
fmt: enable shared return types (#8614) 2021-02-06 21:25:06 +01:00
zakuro
fe9d062b41
gen: fix bug where unreached defer is executed (#8594) 2021-02-06 18:40:39 +02:00
Delyan Angelov
167773dd1c
checker: make -skip-unused process a list of root functions, not just main.main 2021-02-06 09:41:24 +02:00
yuyi
1b6efebac7
all: fix map = map2 assignment (#8581) 2021-02-06 03:06:34 +01:00
Delyan Angelov
a6ecc19040
ci: fix -skip-unused compiler test on windows, using -d no_backtrace 2021-02-05 18:36:57 +02:00
zakuro
6b776e686e
parser: display correct position on boolean expression error (#8563) 2021-02-05 16:52:35 +01:00
zakuro
a94228bb16
checker: make [] == ArrayAlias([]) an error (#8562) 2021-02-05 16:49:40 +01:00
Delyan Angelov
867d96a077
checker: use @METHOD for util.timing_start in Checker.mark_used/1 2021-02-05 16:41:55 +02:00
Delyan Angelov
16dffc7c1d
compiler: move timing_start/timing_measure to util.timing_start/util.timing_measure 2021-02-05 16:34:56 +02:00
Delyan Angelov
25a3873019
parser,checker: support @METHOD, replaced by 'ReceiverType.MethodName' 2021-02-05 16:32:43 +02:00
Delyan Angelov
d30f94507c
checker: enable -skip-unused for more examples 2021-02-05 11:55:40 +02:00
Delyan Angelov
40fff7b56a
v.pref: support v -skip-unused run examples/hello_world.v 2021-02-05 11:12:28 +02:00
Delyan Angelov
80697ec7f3
table: .is_used => .usages (a counter, instead of a boolean flag) 2021-02-05 10:03:17 +02:00
Delyan Angelov
e5c9fcb7e9
ci: fix building vdoc, vls, etc 2021-02-05 09:27:14 +02:00
Alexander Medvednikov
1084b43ffb all: ast walker for marking unused fns 2021-02-05 08:05:35 +01:00
Louis Schmieder
97c0ef3505
orm: struct field support (#8517) 2021-02-04 20:28:33 +01:00
pancake
27239db427
builder: show file:line when import fails (#8537) 2021-02-04 09:09:54 +02:00
Uwe Krüger
f013e65670
checker/cgen: support lock expressions x := rlock s { s.get() } (#8540) 2021-02-03 23:56:58 +01:00
Nick Treleaven
de37b52d4b
checker: check goto label exists (#8523) 2021-02-03 15:20:10 +01:00
Swastik Baranwal
7ec116d588
all: only allow defining == and < and auto generate !=, >, >= and <= (#8520) 2021-02-03 15:18:38 +01:00
Uwe Krüger
9dcf673216
all: make lock and rlock dead lock free :-) (#8534) 2021-02-03 15:16:52 +01:00
Ruofan XU
a73c20916d
checker: refactor and clean up c.check_basic() (#8508) 2021-02-03 11:57:06 +02:00
zakuro
4b99d6af95
cgen: fix bug with duplicate defer generation (#8503) 2021-02-03 11:40:21 +02:00
yuyi
b40252bd97
checker: merge array_filter_fn_err tests (#8506) 2021-02-03 11:27:11 +02:00
yuyi
9bcb57eb1f
checker: merge array_map_fn_err tests (#8507) 2021-02-03 11:26:26 +02:00
zakuro
e30e794884
checker: add check for using a private const in another module (#8501) 2021-02-03 10:17:13 +02:00
Uwe Krüger
df0520b43a
checker,cgen: make shared behave like mut inside lock - and like non-mut inside rlock (#8526) 2021-02-03 01:20:19 +02:00
Daniel Däschle
d477e525bb
checker/gen: fix generic struct init (#8322) 2021-02-03 00:42:00 +11:00
yuyi
9a2820fa7b
checker: fix pass fixed array of function as argument (#8502) 2021-02-02 03:58:54 +01:00
Ruofan XU
a0a33f7ff1
checker: fix map of function as argument and direct call of function in map (#8494) 2021-02-02 03:58:32 +01:00
Ruofan XU
51f2eb81f4
checker/cgen: fix mut array of fn as argument (#8469) 2021-02-01 20:10:24 +01:00
Nick Treleaven
79e9084f7b
checker: allow Struct{...expr} where expr is another struct type (#8495) 2021-02-01 20:08:25 +01:00
Uwe Krüger
17746561f2
cgen: put shared arrays and maps always on heap (#8496) 2021-02-01 20:07:01 +01:00
Delyan Angelov
fab7b9d9d9
checker: fix x := match enumexpr { .case2 { fn1 } .case2 { fn2} }, where fn1 and fn2 have compatible signature 2021-02-01 21:01:58 +02:00
Nick Treleaven
c537578481
checker: ensure expr is an lvalue with Struct{...expr (#8489) 2021-02-01 15:18:03 +01:00
yuyi
53a5aad855
cgen: fix fixed array of function (#8490) 2021-02-01 14:50:10 +01:00
Uwe Krüger
44ec9e3ebc
checker/cgen: put shared struct always on heap (#8492) 2021-02-01 14:39:36 +01:00
spaceface
effa3188dd
cgen: fix type casts to interfaces (#8476) 2021-01-31 19:24:33 +02:00
Larpon
d25825df57
all: support compile time $env('ENV_VAR') (#8456) 2021-01-31 19:22:42 +02:00
Nick Treleaven
f992099726
checker: check s.$method(arg) argument is []string (#8455) 2021-01-31 15:28:23 +01:00
yuyi
2963425995
cgen: fix fn_with_mut_args (fix #7139) (#8446) 2021-01-31 02:45:45 +01:00
BigBlack
c5e7956eb5
checker: fix generic_mutable_arrays in functions (#8445) 2021-01-30 18:35:03 +01:00
Nick Treleaven
64d12cdc8d
checker: check number of C function arguments for some cases (#8444) 2021-01-30 18:33:36 +01:00
Nick Treleaven
849bc6c3d8
tests: fix weird CI failure with error details (#8449) 2021-01-30 18:53:39 +02:00
Uwe Krüger
9c82eec529
checker: support nested propagation cases f(g() ?) (#8447) 2021-01-30 16:53:31 +01:00
Nick Treleaven
43c3a3b080
checker: fix compile-time call with string identifier expression (#8415) 2021-01-30 15:24:16 +01:00
div72
8c70920695
all: add offsetof (#8380) 2021-01-30 12:57:09 +01:00
Nick Treleaven
c0685eeefc
parser: add warning for s.$field.name without brackets (#8411) 2021-01-30 12:56:10 +01:00
Lukas Neubert
2774db077d
fmt: keep user choice for newlines in match branches (#8418) 2021-01-30 11:57:57 +01:00
yuyi
77b3d40f46
checker: fix map = {} (#8435) 2021-01-30 11:55:10 +01:00
Uwe Krüger
5e9b528a9d
checker/cgen: support return from nested or (#8430) 2021-01-30 12:46:36 +02:00
Delyan Angelov
760b4c37b9
all: support _test.vv files (to test _test.v errors/checks too) 2021-01-30 10:42:18 +02:00
Delyan Angelov
948f63b507
checker,builder: rename details: to Details: 2021-01-30 10:20:09 +02:00
Delyan Angelov
30e0c478d7
checker: add error for _test.v file without test_ functions 2021-01-30 10:19:29 +02:00
Swastik Baranwal
e03ece2a4b
checker: check the fn decl for anon fns too (#7529) 2021-01-29 23:11:05 +02:00
Uwe Krüger
4a955d9c54
sync: don't force Mutex and Semaphore to be reference (#8331) 2021-01-29 20:52:14 +02:00
zakuro
2a32dac40d
checker: fix panic when calling generic function with too few args (#8416) 2021-01-29 20:14:22 +02:00
yuyi
26c06a56b7
checker: fix array_insert_or_prepend_short_struct_init (#8397) 2021-01-29 14:53:14 +01:00
Nick Treleaven
d012f2713b
checker: improve errors with compile-time field access (#8373) 2021-01-29 00:45:00 +01:00
spaceface
4aee997689
checker: make implementing an interface with another interface an error (#8398) 2021-01-29 00:41:59 +01:00
yuyi
1be7cc14d3
checker: check duplicate of a const name (#8396) 2021-01-28 18:34:55 +01:00
yuyi
684d2e6dbf
checker: merge ambiguous_function_call tests (#8388) 2021-01-28 15:53:54 +02:00
Uwe Krüger
0afe36e153
checker: fix receiver pos for single letter type error message (#8393) 2021-01-28 15:20:07 +02:00
Lukas Neubert
75d85403a6
fmt: better ternary concat wrapping (#8379) 2021-01-28 11:23:48 +01:00
Alexander Medvednikov
d86cb67eda checker: add a test for the single letter receiver 2021-01-28 11:13:51 +01:00
Alexander Medvednikov
68dab101d9 checker: fix one letter receiver panic 2021-01-28 11:05:37 +01:00
Alexander Medvednikov
36e75e5208 Revert "parser: fix panic when single letter receiver parsed (#8381)"
This reverts commit 93b0d8ca64.
2021-01-28 10:59:04 +01:00
Daniel Däschle
93b0d8ca64
parser: fix panic when single letter receiver parsed (#8381) 2021-01-28 10:56:43 +01:00
Tim Basel
5fc7eadd8b
cgen: fix short struct init with mut (#8384) 2021-01-28 10:05:09 +02:00
zakuro
8162396783
checker: deny multi-value in a singe-value context (#8328) 2021-01-27 23:10:51 +02:00
yuyi
d1ab22d45f
checker: fix array append short struct init (#8362) 2021-01-27 13:55:53 +01:00
Enzo
2b30c48770
checker: fix ctdefine check in non-main modules (#8332) 2021-01-27 13:54:33 +01:00
Swastik Baranwal
17921f4171
checker: add checks for optional selector_expr (#8330) 2021-01-27 13:53:20 +01:00
Nick Treleaven
58a76344cb
checker: avoid SelectorExpr filter on Ident unless it's a generic type name (#8357) 2021-01-27 13:52:52 +01:00
yuyi
7a5722c885
parser: check assign_stmt of undefined variable (#8366) 2021-01-27 13:52:10 +01:00
Delyan Angelov
e5a84719ca
all: require calling optfn() ? / optfn() or {...} for fn optfn() ? {} 2021-01-26 16:43:17 +02:00
spaceface
5f2b2df546
checker: don't disallow defining methods on interfaces (#8335) 2021-01-26 11:56:17 +01:00
zakuro
3959ba5751
checker: make a calling no-body function a checker error (#8265) 2021-01-26 11:19:48 +01:00
Lukas Neubert
2007dbc7b5
fmt: put the opening brace on a new line again for infix (#8336) 2021-01-26 11:19:32 +01:00
Daniel Däschle
7bb9c0e7b3
checker: fix multi generic args (#8347) 2021-01-26 09:37:48 +02:00