Uwe Krüger
2cb711ee15
checker/channels: check `mut`/`&` state of transmitted objects ( #6315 )
2020-09-06 21:24:41 +02:00
Alexander Medvednikov
9fbea31f47
autofree: fix exprs N levels deep
2020-09-06 13:02:32 +02:00
Uwe Krüger
047bf02985
builtin: fix `in` for various numeric types ( #6311 )
2020-09-06 12:45:02 +02:00
Alexander Medvednikov
3410705974
autofree: lots of fixes
2020-09-05 12:00:35 +02:00
Uwe Krüger
cbcba2e4cf
parser: enable module auto import (of `sync`) ( #6271 )
2020-08-31 10:44:39 +02:00
Nick Treleaven
5d3d14da53
cgen: support `typeof(expr).name` ( #6253 )
2020-08-30 08:56:18 +02:00
Uwe Krüger
fe8286c53c
checker: implement implicit conversions/promotions to `rune` ( #6249 )
2020-08-29 01:59:07 +02:00
Alexander Medvednikov
789674bd5a
tests: autofree: use -experimental flag
2020-08-28 10:22:28 +02:00
Alexander Medvednikov
0890562663
tests: autofree tmp expr test
2020-08-28 10:08:32 +02:00
spaceface777
eff319f869
comp_for: allow checking full mehod and arg types ( #5997 )
2020-08-27 15:00:44 +02:00
Alexander Medvednikov
15bdb8f7cd
autofree: tmp arg var frees fixes
2020-08-27 11:30:35 +02:00
Alexander Medvednikov
84b8e0a7e4
tests: enable live tests on macos
2020-08-26 06:50:32 +02:00
Delyan Angelov
e3f79df3ac
tests: support .vv in compiler_test.v too
2020-08-25 18:52:28 +03:00
Delyan Angelov
1619beda91
tests: fix repl_test.v
2020-08-25 15:59:07 +03:00
Delyan Angelov
ceca1547fb
valgrind: fix valgrind_test.v
2020-08-25 15:48:11 +03:00
Alexander Medvednikov
c8b3cd2957
tests: simplify valgrind tests, remove .vv
2020-08-25 13:58:21 +02:00
Alexander Medvednikov
33b4ff75d0
builder: handle bad extensions and support .vv
2020-08-25 13:32:27 +02:00
Nick Treleaven
479bfa28de
cgen: implement fixed array `.len` property ( #6212 )
2020-08-25 08:48:28 +02:00
Alexander Medvednikov
d547f74cb0
checker/cgen: interface smart casts
2020-08-24 11:10:26 +02:00
Yarila682
7dde82322a
cgen: fix dereferencing a mutable array ( #6191 )
2020-08-22 12:48:09 +02:00
Nick Treleaven
98c39a37c0
scanner: warn about interpolation for `$f(expr)` ( #6179 )
2020-08-22 05:48:06 +02:00
Nick Treleaven
217f04e311
checker: disallow casting to bool, use `some_int != 0` instead ( #6138 )
2020-08-19 14:37:55 +02:00
Nick Treleaven
e69f091bbd
parser: require `(` on same line as name token for fn call or cast ( #6160 )
2020-08-19 02:37:17 +02:00
Daniel Däschle
b5c1ea44dc
all: fix mutability after if-smartcast ( #6129 )
2020-08-17 21:11:11 +02:00
Nick Treleaven
36c98b3e5d
cgen: implement fixed array 'for in' for lvalue condition ( #6151 )
2020-08-17 21:10:47 +02:00
Delyan Angelov
191c908f3a
tests/valgrind: vfmt fn_with_return_should_free_local_vars.vv
2020-08-16 13:22:32 +03:00
Delyan Angelov
fbe02c5ae1
tests/valgrind: add skipped fn_with_return_should_free_local_vars.vv (-autofree)
2020-08-16 13:20:02 +03:00
Nick Treleaven
0f0a91fc9e
parser: support custom fixed size ArrayInit: `[3]int{init: -1}` ( #6114 )
2020-08-15 11:01:54 +02:00
Nick Treleaven
75212f9fab
cgen: error if ForInStmt is not handled ( #6131 )
2020-08-14 21:01:43 +02:00
Nick Treleaven
6016f28171
cgen: fix assigning ArrayInit to fixed array: `a = [3]int` ( #6115 )
2020-08-14 13:57:00 +02:00
Nick Treleaven
078ab47a9a
cgen: support `==`, `!=` on FixedArray ( #6119 )
2020-08-14 02:03:38 +02:00
Daniel Däschle
64e8125807
cgen: fixe calling anon fn asynchronously ( closes #6088 ) ( #6121 )
2020-08-13 20:06:56 +02:00
Alexander Medvednikov
1a9dba0005
checker: make << shifts work with custom number types
2020-08-11 01:05:34 +02:00
Alexander Medvednikov
88988817d0
parser: minor `match` simplification
2020-08-10 19:54:38 +02:00
Delyan Angelov
36eae1c175
builtin: x.vstring() instead of string(x) ( #6102 )
2020-08-10 18:05:26 +02:00
Nick Treleaven
2dd90de993
parser: error on `[unsafe_fn]` ( #6090 )
2020-08-09 12:22:11 +03:00
Nick Treleaven
6cc8815931
parser: support [unsafe] instead of [unsafe_fn] ( #6066 )
2020-08-08 16:24:05 +02:00
Alexander Medvednikov
ce4ee2b247
v0.1.29
2020-08-06 19:36:52 +02:00
Uwe Krüger
d63daa0798
sync: use `mfence` on windows-tcc ( #6079 )
2020-08-06 17:31:05 +02:00
Uwe Krüger
863cf8af60
sync: channel implementation ( #6074 )
2020-08-06 15:28:19 +02:00
Delyan Angelov
d1257f5590
tests/valgrind: add skipped fn_returning_string_param.vv (-autofree)
2020-08-05 19:35:18 +03:00
Delyan Angelov
6c27ce58ed
v.util.vtest: extract the common code for VTEST_ONLY in a single place
2020-08-05 19:34:27 +03:00
Nick Treleaven
c33dbbc216
fmt: don't add newlines for UnsafeExpr ( #6048 )
2020-08-04 00:29:10 +02:00
Alexander Medvednikov
f269cbdc94
Revert "parser: Support `unsafe(expr)` ( #5973 )"
...
This reverts commit 19c226fcf8
.
2020-07-29 21:41:47 +02:00
Delyan Angelov
9c9533dad9
checker: add error for `fn f() Struct { return &Struct{} }` ( #6019 )
2020-07-29 21:40:43 +02:00
Delyan Angelov
81f8e910e6
compiler: remove space at the end of warn/error messages to minimize diff churn
2020-07-29 20:37:55 +03:00
Ruofan XU
1d59d35129
cgen: fix sum type match ( #5978 )
2020-07-28 22:17:25 +02:00
Nick Treleaven
19c226fcf8
parser: Support `unsafe(expr)` ( #5973 )
2020-07-28 11:20:52 +03:00
Enzo
2de1437a1e
ci: vet all files from the compiler ( #5994 )
2020-07-27 12:15:29 +02:00
Delyan Angelov
88345d759a
tests: add support for skipping to valgrind_test.v
2020-07-26 16:09:58 +03:00
Ruofan XU
7027b2354b
cgen: fix array and map with fns ( #5938 )
2020-07-26 14:22:02 +02:00
Delyan Angelov
9e652c4f40
ci: fix remaining failing tests. Do mut ptr check only outside unsafe{} blocks.
2020-07-26 10:59:07 +03:00
Louis Schmieder
b58b15993c
gen: compile time for (methods and fields) ( #5957 )
2020-07-25 00:02:44 +02:00
Delyan Angelov
d204c926a8
tests: fix compilation of if_smartcast_test.v
2020-07-24 10:30:22 +03:00
Delyan Angelov
276c1de190
unsafe: tag with unsafe{} some more pointer manipulations
2020-07-22 21:42:51 +03:00
Ryan Willis
938e71b468
v: fix for `import cli { Command }`
2020-07-22 20:33:43 +03:00
Ruofan XU
a370dd2867
cgen: further fixes to and array/map of fns ( #5916 )
2020-07-22 02:30:44 +02:00
Delyan Angelov
0af415fa28
vlib: add unsafe{} wrappers to C. fn calls, to allow compiling with -prod again
2020-07-21 09:05:31 +03:00
Nick Treleaven
15ca64d81d
tests: rename pointer_arithmetic_should_be_checked.vv -> unsafe_required.vv ( #5897 )
2020-07-20 23:04:22 +03:00
Ruofan XU
88c8e194d0
cgen: fix map and array with fns ( #5894 )
2020-07-20 19:53:02 +03:00
Delyan Angelov
fb4c3ff31a
tests: split unsafe.v to vlib/v/tests/unsafe_test.v and a checker output .vv&.out test
2020-07-20 16:53:27 +03:00
Delyan Angelov
587b9dd8aa
tests: reduce iterations for the atomic and semaphore tests, to speed up test-fixed
2020-07-20 11:14:55 +03:00
Ruofan XU
9f6aacb739
cgen: fix array of fns init ( #5884 )
2020-07-19 21:44:03 +02:00
Ryan Willis
1114fd28d0
all: import individual symbols feature ( #5872 )
2020-07-18 21:34:38 +02:00
XeGrox
e5a508c0d7
checker: fix inability to access aliased struct fields ( #5861 )
2020-07-18 13:58:16 +02:00
Nick Treleaven
105a0e015e
checker: warn if unsafe method called outside unsafe block ( #5863 )
2020-07-17 19:14:12 +02:00
Nick Treleaven
39f90e25f3
all: `if` guard optional: define `err` in `else` branch ( #5853 )
2020-07-17 19:10:01 +02:00
Uwe Krüger
ea322bdd97
checker, cgen: fix call of generic function returning normal type ( #5865 )
2020-07-17 18:28:45 +02:00
Uwe Krüger
f6947d111b
parser: fix `sizeof(int)` when used as call arg for external function ( #5855 )
2020-07-17 11:31:35 +03:00
spaceface777
3583302ad4
parser: force `...` rather than `..` in matches for inclusive ranges ( #5852 )
2020-07-17 11:30:21 +03:00
spaceface777
b900577dae
compiler: handle ranges as `match` conditions ( #5847 )
2020-07-16 16:41:18 +03:00
Uwe Krüger
8df6e59678
sync: add semaphores ( #5831 )
2020-07-15 10:22:33 +02:00
Enzo
880c8e4dc9
cgen: else if guard ( #5822 )
2020-07-14 17:19:55 +02:00
Delyan Angelov
a565848dfa
tests: remove duplicate test autolock_array_1_test.v
2020-07-13 15:02:44 +03:00
Uwe Krüger
6e6010d198
checker, cgen: implement auto-lock for `a[i]++`, `a[i]--` ( #5817 )
2020-07-13 15:01:32 +03:00
Delyan Angelov
b04fff272e
tests: move autolock_array_1.v to autolock_array_1_test.v
2020-07-13 14:21:44 +03:00
Uwe Krüger
aa364ddaca
checker, cgen: checks for shared/lock, first autolock ( #5815 )
2020-07-13 12:19:28 +02:00
Nick Treleaven
53023c1ca9
all: add UnsafeExpr ( #5793 )
2020-07-12 12:58:33 +02:00
Delyan Angelov
2fb5c91f4d
scanner: remove error check for embedded \x00 chars in c'literals'
2020-07-10 21:42:03 +03:00
yuyi
bf14e666ea
cgen: add `gen_map_equality_fn` to compare maps ( #5770 )
2020-07-10 18:08:17 +02:00
Daniel Däschle
c5dc1a33b6
all: remove `it` smartcast and replace with original variable name ( #5764 )
2020-07-09 17:14:14 +02:00
Delyan Angelov
73a259496e
tests: support `VTEST_ONLY=fn_,match_ ./v test-fixed` and in compiler_test.v
2020-07-09 10:47:16 +03:00
Tomas Hellström
2790890bc2
ci: use pre built docker containers for musl ( #5759 )
2020-07-08 21:30:57 +03:00
Daniel Däschle
c0fa31e75a
cgen: if smartcast part 3 ( #5755 )
2020-07-08 19:14:47 +02:00
Nick Treleaven
f834276803
doc: struct literals ( #5726 )
2020-07-08 16:02:35 +02:00
yuyi
64e9bdc213
parser: fix non-void optional fn missing return value ( fix #5736 ) ( #5741 )
2020-07-08 16:01:17 +02:00
Delyan Angelov
69d3c3f596
cgen: sort const inits/cleanups topologically, skip calling non `fn init(){}` fns
2020-07-08 14:28:58 +03:00
Alexander Medvednikov
2425c05c42
Revert "cgen: sort const inits/cleanups topologically too"
...
This reverts commit 38000f8622
.
2020-07-08 12:56:56 +02:00
Uwe Krüger
88248b1b66
cgen: add support for shared arrays ( #5721 )
2020-07-08 11:05:43 +02:00
Delyan Angelov
38000f8622
cgen: sort const inits/cleanups topologically too
2020-07-08 11:22:30 +03:00
Ruofan XU
9c87ace153
cgen: fix cross assign for functions ( #5734 )
2020-07-08 09:17:26 +03:00
yuyi
bd16dd9fdf
cgen: fix assert `sumtype is` ( #5739 )
2020-07-08 09:05:01 +03:00
joe-conigliaro
5fd5e558ae
parser/checker/gen: anon fn direct call with args
2020-07-08 01:10:39 +10:00
Tarang11
68e01d87be
checker: fix multi assignment for multiple fns ( #5716 )
2020-07-07 14:18:51 +02:00
Uwe Krüger
ef02373061
all: remove `rwshared` keyword, make its semantics default for `shared` ( #5710 )
2020-07-07 01:57:31 +02:00
joe-conigliaro
9a4d989188
test: move sumtype int cast test into fn & test var
2020-07-06 23:39:51 +10:00
joe-conigliaro
d82e6c9cd9
checker/table: fix sumtype cast from int literal
2020-07-06 21:27:48 +10:00
Delyan Angelov
25771a1afe
compiler: remove -keepc option (it is now always on)
2020-07-06 13:42:18 +03:00
yuyi
fc7237be7b
checker: fix cast to sum type ( fix #5690 ) ( #5692 )
2020-07-06 12:32:59 +02:00
Uwe Krüger
c3614c0e38
cgen, sync: implement separate read/write locks for `rwshared` types ( #5687 )
2020-07-05 22:53:28 +02:00
KrisChambers
8d035a446a
Fix v/parser: Failure to parse structs with fields typed as anonymous functions returning having an optional void (`?`) return type. ( #5684 )
...
* Handle optional void return type in function types in struct fields.
* Add more testing for optional return types in struct fields.
* Move language parsing into it's own function
* Fix issue caused by not setting typ.
* Fix test for structs containing anon fn with optional void return types
2020-07-05 19:29:39 +02:00
yuyi
96bd4e8794
parser: fix type detection in `match` ( #5679 )
2020-07-05 16:35:45 +02:00
joe-conigliaro
9d7f1a236a
checker/gen: fix nested sumtype matching
2020-07-06 00:25:04 +10:00
Uwe Krüger
3b067f5f85
all: experimental locked concurrency support, part 1 ( #5637 )
2020-07-04 12:44:25 +02:00
Nick Treleaven
0b49e4db1c
v/checker.v: disallow pointer arithmetic for InfixExpr outside unsafe {} ( #5640 )
2020-07-03 18:10:10 +02:00
yuyi
9e949622d3
vrepl: pre-imported common modules ( #5643 )
2020-07-03 18:06:36 +02:00
Alexander Medvednikov
b7175b54eb
vweb: ['/:arg1/:arg2/action'] attribute
2020-07-03 15:10:39 +02:00
yuyi
68ac8fde26
tests: add mixed and complex types tests for cross assign ( #5622 )
2020-07-02 18:20:03 +02:00
yuyi
6cbc0e84f0
cgen: fix cross assign with mutable args ( fix #5609 #5610 #5611 ) ( #5614 )
2020-07-02 11:09:26 +02:00
Uwe Krüger
6c022db786
scanner: fix string interpolation for '$a.b().c' ( #5612 )
2020-07-02 00:02:59 +02:00
yuyi
40a393926d
cgen: fix cross assign of struct fields ( #5606 )
2020-07-01 18:43:14 +02:00
Nick Treleaven
e7339fec15
all: disallow pointer arithmetic for AssignStmt, PostfixExpr outside unsafe{} ( #5581 )
2020-07-01 14:50:17 +02:00
Delyan Angelov
78e1127d99
cgen: treat the main module like any other v module
2020-07-01 00:53:53 +02:00
Uwe Krüger
8a46911725
checker: check if mut function arg is declared as mut ( #5579 )
2020-06-30 14:19:22 +02:00
joe-conigliaro
ab37dcaa9c
generic structs: initial implementation
2020-06-29 20:09:09 +02:00
yuyi
9d845262b7
parser: fix module type cast
2020-06-29 17:15:40 +02:00
yuyi
5f36874c9b
vrepl: fix optional call
2020-06-24 12:45:48 +02:00
yuyi
514ee9d396
cgen: fix optional void return error
2020-06-24 12:45:15 +02:00
yuyi
73296e486a
parser: fix function return anon_fn without parentheses
2020-06-22 16:03:31 +02:00
yuyi
d232833573
gen: fix printing of generic arrays
2020-06-22 14:54:24 +02:00
yuyi
81c19517d1
cgen: add gen_str_for_multi_return
2020-06-21 17:53:13 +02:00
yuyi
e484fe15d3
tests: add nested array not equal tests
2020-06-20 02:34:49 +02:00
yuyi
4dc703af2d
cgen: fix nested array equality
2020-06-20 01:40:33 +02:00
Uwe Krüger
770132ff37
float: make default string representations for floats become alike
2020-06-18 22:33:41 +02:00
joe-conigliaro
812a9d646a
test: fix sumtype shadow & as test
2020-06-19 01:14:53 +10:00
joe-conigliaro
198fdcf1c6
test: change sumtype var shadow and as test
2020-06-19 01:10:16 +10:00
joe-conigliaro
3533335804
test: add match sumtype var shadow and `as` test
2020-06-19 01:06:40 +10:00
Alexander Medvednikov
7be952605b
0.1.28
2020-06-18 15:57:53 +02:00
Uwe Krüger
ddb1770af2
cgen: fix unsigned/signed integer comparisons
2020-06-17 02:54:27 +02:00
yuyi
23993d2264
cgen: fix nested array equality error
2020-06-16 18:40:32 +02:00
yuyi
730f485591
test: fix `test_array_init()`
2020-06-15 22:31:11 +02:00
joe-conigliaro
0cd9066f44
parser/cgen: multiple attributes & better errors ( closes #5334 )
2020-06-15 22:59:09 +10:00
Delyan Angelov
cadde3e9f0
vlib: fix os.exec().output usages, that may rely on trimmed lines
2020-06-15 15:38:20 +03:00
yuyi
b0138e021e
cgen: fix `in` multi_array
2020-06-15 13:21:06 +02:00
Delyan Angelov
c874a22b3b
doc: use `v new` instead of `v create`
2020-06-14 21:20:31 +03:00
yuyi
4e1a09c9f5
cgen: fix array_init temporary variable error
2020-06-14 19:09:27 +02:00
Ruofan XU
90279a7108
checker: use ++ / -- instead of += 1 / -= 1
2020-06-14 19:05:05 +02:00
yuyi
7e0197c1b8
cgen: fix `in` empty array
2020-06-14 10:54:10 +02:00
Adam Stankiewicz
471c931ada
os: do not trim space from output of exec
2020-06-14 01:41:47 +02:00
Uwe Krüger
50cd0ed785
parser: fix string array initialization with interpolation
2020-06-13 22:38:10 +02:00
Adam Stankiewicz
b3fc462a78
scanner: fix parsing multiple .amp
2020-06-13 00:01:44 +02:00
Delyan Angelov
4fc41c4bc4
v: add compiler support for _unlikely_(x) too
2020-06-09 18:11:03 +03:00
Delyan Angelov
c7d4360931
v: add full compiler support for _likely_(x)
2020-06-09 17:42:43 +03:00
spaceface777
895c7624e4
jsgen: improve handling of `blank_ident`
2020-06-09 09:45:50 +02:00
spaceface777
30f1c6bad5
parser: fix type_only fns starting with varargs
2020-06-08 19:02:36 +02:00
Enzo Baldisserri
11b7b97311
parser: fail when assigning to _ with :=
2020-06-08 00:47:04 +02:00
Alexander Medvednikov
3bbda7103f
Revert "parser: allow void return type for C functions"
...
This reverts commit d7c63922d5
.
2020-06-07 19:06:19 +02:00
Swastik Baranwal
d7c63922d5
parser: allow void return type for C functions
2020-06-07 19:45:27 +03:00
joe-conigliaro
31d03bb113
checker/cgen: small generic fixes (mut arg return)
2020-06-06 12:24:27 +10:00
Uwe Krüger
de76ac583f
parser: fix string interpolation for expressions ending `c`, `r`, `js`
2020-06-05 22:37:34 +02:00
Alexander Medvednikov
e3917d98c2
generics: another mut arg test
2020-06-05 20:57:05 +02:00
Alexander Medvednikov
13a7ce9e69
gg: GG => Context
2020-06-04 20:26:18 +02:00
joe-conigliaro
41dca3ef58
checker/cgen: fix mutable generic fn args
2020-06-04 19:32:31 +10:00
yuyi
5ae8853648
all: change `f mut Foo` to `mut f Foo`
2020-06-04 10:35:40 +02:00
yuyi
13e09c61ef
tests: add multi_dimensional array init tests
2020-06-03 14:10:29 +02:00
Alexander Medvednikov
d182059ba6
tests: fix fn_test.v
2020-06-03 10:54:47 +02:00
Delyan Angelov
6a0a2da05c
cgen: support `$if test { ... }`
2020-06-03 10:20:10 +03:00
Alexander Medvednikov
63b8cdea7a
checker: require () in a && b || c
2020-06-02 22:21:44 +02:00
yuyi
1386c5df13
parser: use `?` instead of `?void` errpr
2020-06-02 17:24:24 +02:00
Uwe Krüger
b0f66a4e05
checker: permit int -> f32, int64 -> f64 and similar promotions again
2020-06-02 17:00:14 +02:00
Alexander Medvednikov
fb3e52ca63
all: `!is` operator
2020-06-02 16:18:12 +02:00
yuyi
653a27005b
cgen: fix multi dimensional array init error
2020-06-02 15:15:52 +02:00
yuyi
63b2d4be99
cgen: make >8 indent levels work
2020-06-02 10:40:24 +02:00
Uwe Krüger
076089d3c5
checker: apply stricter type checks to function args and return types
2020-06-01 21:15:59 +02:00
Delyan Angelov
ae8f7cf569
tests: fix some tests, that failed due to the stricter immutable checks
2020-06-01 18:24:38 +03:00
Alexander Medvednikov
3d83934caf
checker: check mutating methods; generics fixes
2020-06-01 15:44:10 +02:00
Delyan Angelov
945439dab6
cgen: print actual values on a failed assert (when possible)
2020-06-01 14:43:38 +03:00
Emily Hudson
75eac291ac
all: variable sized options
2020-05-31 12:57:26 +02:00
Alexander Medvednikov
f87e872fa2
checker/cgen: interface match
2020-05-31 10:22:21 +02:00
Alexander Medvednikov
905f844b16
cgen: return interface fix
2020-05-30 20:18:03 +02:00
Alexander Medvednikov
1ca7a607d3
checker/cgen: return interfaces
2020-05-30 19:54:16 +02:00
Uwe Krüger
b74e1bb05d
checker: fix type mismatch in function argument for struct reference init
2020-05-30 15:42:12 +02:00
Delyan Angelov
f3c5f36317
parser: allow for `struct Abc { f [skip] = -1 }`
2020-05-29 12:45:54 +03:00
yuyi
3a340cbffc
checker: fix array_init cast type error
2020-05-29 06:39:46 +02:00
Alexander Medvednikov
bec3e07635
interfaces: fix `is`
2020-05-29 05:54:53 +02:00
Alexander Medvednikov
81b44dc2c9
generics: generic call inside generic call; checker: check mut args at call
2020-05-29 04:30:00 +02:00
spaceface777
60716bba29
parser: fix nested array_init syntax
2020-05-28 19:36:57 +03:00
Alexander Medvednikov
d6037cbcf2
generics: fix method calls
2020-05-28 05:58:19 +02:00
Delyan Angelov
ae8cc2f433
live: fix -live compilation && make live_test.v not swallow segfault errors
2020-05-28 03:21:49 +03:00
yuyi
9cbd9db4e7
cgen: fix swap assign of prefix and postfix expr
2020-05-28 02:22:09 +03:00
Alexander Medvednikov
4988d340b1
generics: fix method calls
2020-05-28 01:19:08 +02:00
yuyi
84edbd83da
all: fix struct names error
2020-05-27 19:12:34 +03:00
Alexander Medvednikov
5423a15f46
generics: more fixes
2020-05-27 15:56:30 +02:00
x0r19x91
72ed673566
builtin: array: fix slice cloning
2020-05-27 14:07:03 +02:00
Delyan Angelov
ebbf42dadb
tests: add a commented test_generic_fn_with_variadics, which worked with old v
2020-05-27 08:41:12 +03:00
Alexander Medvednikov
59711d9c55
generics: test `T{}`
2020-05-27 06:53:52 +02:00
Uwe Krüger
013fdb8a4b
checker: restrict numeric promotions to cases where no data is lost
2020-05-27 05:42:48 +02:00
yuyi
bb48851092
cgen: fix mutliple_assign swap
2020-05-26 18:00:51 +02:00
Delyan Angelov
b0cfd3fa67
parser: reimplement [flag] enum support. Add p.vcodegen too
2020-05-26 00:00:48 +03:00
Delyan Angelov
5825e467b8
checker: fix appending an .enum_val to a struct field of []Enum
2020-05-25 21:48:43 +03:00
Delyan Angelov
96808a0e2a
cgen: generalize _vcleanup of array/string consts + valgrind with tcc
2020-05-25 10:24:19 +03:00
Alexander Medvednikov
656bc6b6c8
tests: valgrind: strings are freed now!
2020-05-25 06:23:50 +00:00
Alexander Medvednikov
1ef8eacd6e
checker/gen: more generics fixes; ComptimeCall
2020-05-25 05:32:36 +02:00
yuyi
ec7863d174
cgen: fix array_init of struct error
2020-05-25 04:45:16 +02:00
Uwe Krüger
fd4d28b7b6
tests: update for stricter type checks
2020-05-24 21:07:32 +02:00
Delyan Angelov
1754ba19d8
live: cleanup live_test.v output, remove 1s delay
2020-05-24 18:38:43 +03:00
Delyan Angelov
d16485c29e
live: make live_test.v more robust
2020-05-24 17:45:53 +03:00
Delyan Angelov
ddcb5f7da3
gen: fix autogenerated print methods for vargs
2020-05-24 15:05:19 +03:00
Alexander Medvednikov
7963e48ca1
tests: valgrind: disable string.replace() test for now
2020-05-24 07:33:33 +00:00
Alexander Medvednikov
494f4fe986
tests: valgrind: string.replace()
2020-05-24 07:19:58 +00:00
Alexander Medvednikov
67750c91d7
generics: lots of fixes
2020-05-24 04:43:03 +02:00
Enzo Baldisserri
801bca1ef2
compiler: propagate optional
2020-05-23 08:51:15 +02:00
yuyi
dda875a9c8
all: unify const names to snake_case
2020-05-22 17:36:09 +02:00
penguindark
8bf290acf0
os: minor fixes
2020-05-22 06:21:11 +02:00
Alexander Medvednikov
1e853072dc
parser: parallel parser, part 1
2020-05-22 02:23:14 +02:00
Enzo Baldisserri
1633675c11
gen: fix nested `or`
2020-05-21 22:35:43 +02:00
Alexander Medvednikov
d3ce6fd2e7
checker: check each generic function for each type
2020-05-21 21:51:52 +02:00
Alexander Medvednikov
227f039652
vfmt: handle generic fn calls
2020-05-21 18:36:25 +02:00
Alexander Medvednikov
87d8e70d6d
checker/table: generic fixes
2020-05-21 18:15:04 +02:00
Alexander Medvednikov
45c9ccfc03
tests: simple<string> generics test
2020-05-21 04:56:36 +02:00
Alexander Medvednikov
ce1a181699
all: generic functions
2020-05-21 03:58:53 +02:00
Alexander Medvednikov
ca81442fac
parser: fix a small bug with <
2020-05-20 21:47:03 +02:00
Sandro Martini
e137fbb1ea
array: more tests of initialization
2020-05-19 19:53:47 +02:00
yuyi
b3b86ea6d7
cgen: fix array_init has len but no init error
2020-05-19 18:33:24 +02:00
yuyi
74686d0ec4
test: fix alias type errors and type_test.v
2020-05-19 15:04:51 +03:00
Uwe Krüger
2635be511f
all: re-apply C++ support
2020-05-18 21:38:06 +02:00
Tanel Liiv
2344c1a435
parser: fix to multi-expr
2020-05-18 18:33:27 +02:00
Ned Palacios
ae3df002a2
vmod: add v.mod parser
2020-05-18 14:35:28 +02:00
yuyi
7f4cf08516
parser: check `(mut f Foo)` syntax
2020-05-17 13:51:18 +02:00
yuyi
6855996cca
cgen: fix array_init_with_default
2020-05-16 19:05:26 +02:00
Enzo Baldisserri
f44a40eee0
checker: check incorrect names
2020-05-16 16:12:23 +02:00
yuyi
9b6ee8e77d
cgen: array_init_with_default
2020-05-16 15:21:37 +02:00
Tanel Liiv
44502a3fb2
parser: return multi expr
2020-05-15 23:14:53 +02:00
yuyi
8500c8885c
cgen: fix optional_void error; handle `?` return type
2020-05-15 15:55:03 +02:00
Enzo Baldisserri
d60233b618
cgen: simplify for in range
2020-05-14 22:22:32 +02:00
Enzo Baldisserri
fd0d833e33
gen: if expressions with multiple statements
2020-05-14 17:15:25 +02:00
Alexander Medvednikov
2369a5c8c6
cgen: handle `is` for interfaces
2020-05-14 16:56:45 +02:00
Sandro Martini
9895cab51c
tests: add more tests on interfaces
2020-05-13 20:30:18 +02:00
Enzo Baldisserri
172e4ff853
cgen: simplify if guard else clause
2020-05-13 18:38:00 +02:00
Tanel Liiv
af334e320c
cgen: dereference in one place and fix
2020-05-13 01:01:34 +02:00
Kris Cherven
d359a7aefb
cgen: fix a goto error
2020-05-11 23:49:08 +02:00
Alexander Medvednikov
2618b4fbd3
Revert "tests: add more tests on interfaces "
...
This reverts commit 538662d99a
.
2020-05-11 15:19:55 +02:00
Sandro Martini
538662d99a
tests: add more tests on interfaces
2020-05-11 15:13:03 +02:00
joe-conigliaro
1b3cd7abe0
cgen: fix sum type assign/push from in match branch & type mod
2020-05-11 16:59:55 +10:00
yuyi
64ba59590e
cgen: fix multiple assign error
2020-05-11 09:45:11 +03:00
yuyi
14bba54ddc
vrepl: fix array_init error
...
* optimize print conditions
2020-05-11 07:15:08 +03:00
Enzo Baldisserri
b09fd66aa2
gen: fix interface pointers
2020-05-10 21:16:22 +02:00
Alexander Medvednikov
a2d120b583
cgen: fix reassignment of optionals
2020-05-10 17:41:33 +02:00
eyelash
f396f70ae7
repl: fix newline in error messages
2020-05-10 16:26:56 +02:00
Delyan Angelov
809676a856
cgen: fix a sporadic segfault when giving -width in a string interpolation
2020-05-09 15:23:37 +03:00
Tanel Liiv
7815a5495c
checker: handle multireturn fn calls as if/match last expressions
2020-05-08 22:49:45 +02:00
Alexander Medvednikov
6ea741e26e
Revert "tests: valgrind: enable string tests"
...
This reverts commit 1ea13ac7f3
.
2020-05-08 16:18:14 +02:00
Alexander Medvednikov
1ea13ac7f3
tests: valgrind: enable string tests
2020-05-08 13:18:27 +00:00
Ned Palacios
13b11a4155
parser: fix struct attribute for array struct field
2020-05-08 13:09:40 +02:00
Delyan Angelov
fec7f0f0b9
cgen: fix auto .str() generation for []&T, and `fn (t &T) str() string{}`
2020-05-08 12:48:07 +03:00
yuyi
8866773f97
vrepl: fix import and comment error in the middle of other lines
2020-05-08 09:34:59 +03:00
Delyan Angelov
7207a4970b
solaris: fix tests
2020-05-07 16:19:21 +00:00
Tanel Liiv
d0afa748ff
cgen: optional multiple return values
2020-05-07 15:36:04 +02:00
Uwe Krüger
59aa31cee5
cgen: string interpolation: optimize away some partial strings of 0 length
2020-05-07 04:34:18 +02:00
Tanel Liiv
b5a1544bf8
parser: allow re-assigning fns to variables
2020-05-06 20:09:29 +02:00
Delyan Angelov
88ef0a75e2
ci: pass V_CI_MUSL=1 on musl CI jobs
2020-05-06 15:10:47 +03:00
Alexander Medvednikov
cc66eb1194
parser/checker: check capital letters in interface names/methods
2020-05-06 12:26:00 +02:00
Alexander Medvednikov
99cf520bd4
parser: `mut x Type` syntax for args
2020-05-06 12:13:22 +02:00
Enzo Baldisserri
215657e16a
checker: check interface implementation
2020-05-06 11:29:37 +02:00
yuyi
c653977c15
cgen: fix struct with map field str() error
2020-05-06 09:08:48 +03:00
Sandro Martini
50351eded8
tests: interface: minor fixes
2020-05-05 19:56:11 +02:00
Alexander Medvednikov
fd0f8d06f8
tests: valgrind: use correct flag
2020-05-05 17:55:11 +00:00
Sandro Martini
dd2a1455dc
tests: add another function to the Animal interface
2020-05-05 16:27:05 +02:00
Tanel Liiv
b16281d6e4
cgen: pass around functions
2020-05-05 16:21:21 +02:00
yuyi
6aca3be474
cgen: fix []map[string]string.str() error
2020-05-05 08:46:19 +03:00
Alexander Medvednikov
621cb7b914
parser: short struct init syntax
2020-05-05 02:12:51 +02:00
Uwe Krüger
a4b6c3fa5d
cgen: hex representation of signed and pointers
2020-05-05 00:24:33 +02:00
Delyan Angelov
d7e7113047
cgen: fix `for char in nums {}`
2020-05-04 18:57:33 +03:00
Enzo Baldisserri
8fd69e845f
cgen: fix using pointer as interface receiver
2020-05-04 14:21:03 +02:00
Delyan Angelov
0e241162d9
panic: distinguish between builtin and main modules
2020-05-04 14:51:30 +03:00
Delyan Angelov
cdf70c070b
tests: add panic_with_cg.vv/.out
2020-05-04 14:34:51 +03:00
yuyi
90fc23ccfb
checker: fix array init []type{cap: x.len} error
2020-05-04 13:22:09 +02:00
Uwe Krüger
f831910c5c
utf: fix string length calculation for combining characters
2020-05-04 13:21:11 +02:00
yuyi
c112b3aec5
tests: fix cleanup of compiler_test.v on windows
2020-05-04 11:33:54 +02:00
Alexander Medvednikov
eca24c5d11
tests: interface: rename Speaker to Animal
2020-05-04 10:58:42 +02:00
Delyan Angelov
acd80f052b
tests: improve diagnostic output on failure
2020-05-04 11:21:25 +03:00
Enzo Baldisserri
4b3ce79e84
interface: support arguments in methods and simplify
2020-05-04 00:14:59 +02:00
Delyan Angelov
71a92eb87b
tests: fix CI failing for builtin __as_cast
2020-05-03 22:25:38 +03:00
Uwe Krüger
4a096bd133
parser: fix string interpolation for default conversion
2020-05-03 18:12:59 +02:00
Alexander Medvednikov
de749e9d3b
parser/cgen: interface <<; `any` type
2020-05-03 18:08:45 +02:00
Alexander Medvednikov
16fe8103ba
tests: bring back valgrind test
2020-05-03 13:12:05 +02:00
Uwe Krüger
170ee4312f
cgen: string interpolation field width support for large integers and utf8 strings
2020-05-02 00:43:59 +02:00
Delyan Angelov
7038f59ca5
compiler: add back support for -live
2020-05-02 01:14:44 +03:00
yuyi
de272654f1
repl: fix import xxx with no fn main error
2020-05-01 18:12:18 +02:00
eyelash
4d04e88679
errors: show line numbers in default color and add a space
2020-05-01 14:46:12 +02:00
Alexander Medvednikov
51da324465
tests: fix eventbus_test.v
2020-05-01 10:57:19 +02:00
Alexander Medvednikov
f1903f3c1f
parser: fix imported interfaces
2020-04-30 18:06:14 +02:00
Alexander Medvednikov
20013e4b4b
table: interfaces: unique gen_types
2020-04-30 16:48:46 +02:00
Tim Basel
3e4cd12fd0
.gitignore: ignore all binary files by default
2020-04-29 16:49:13 +02:00
joe-conigliaro
98cd013908
cgen: fix interface struct sorting
2020-04-29 21:08:39 +10:00
Alexander Medvednikov
51d0ce0222
tests: more interface tests; checker: handle zero selectorexpr type error
2020-04-29 12:46:09 +02:00
Alexander Medvednikov
2fc05b814c
all: interface arrays
2020-04-29 12:21:15 +02:00
Delyan Angelov
0e765e34be
vfmt: extract v.util.find_working_diff_command, color_compare_files
2020-04-29 11:51:45 +03:00
yuyi
28f5920bb0
cgen: fix `map` `fixed-array` .str() error
2020-04-28 07:22:46 +02:00
yuyi
e9f764db4f
cgen: uniform string output format
2020-04-27 14:48:28 +02:00
yuyi
99a7b69578
cgen: optimize map_to_string format
2020-04-27 10:52:21 +02:00
yuyi
95754f211f
cgen: generate str function when using x.str()
2020-04-27 08:09:37 +02:00
yuyi
2574dce174
all: fix remaining `[]array` warnings
2020-04-26 16:25:54 +02:00
yuyi
9f4d498ff1
all: update`import ()` and `[]array`
2020-04-26 13:49:31 +02:00
Alexander Medvednikov
41eb4453e3
parser: do not allow redefinition of fn args
2020-04-26 12:01:10 +02:00
Alexander Medvednikov
153ac230ec
tests: use new array init syntax, fix mutability
2020-04-26 11:56:30 +02:00
yuyi
9cfb1e3bf7
cgen: fix struct with fixed array error
2020-04-26 06:54:14 +02:00
yuyi
541b058e90
all: use `a !in b` instead of `!(a in b)`
2020-04-26 06:39:23 +02:00
Alexander Medvednikov
2b4ac0e63a
checker: handle array of interfaces
2020-04-26 06:29:03 +02:00
Alexander Medvednikov
60a0ba5eaa
table: minor interface clean up
2020-04-26 05:34:34 +02:00