Daniel Däschle
0c183da116
checker: fix sort return type ( #6182 )
2020-08-20 17:29:40 +03:00
Delyan Angelov
8c7bcad6b1
cgen: support for `$if amd64 {}` and `$if aarch64 {}`
2020-08-20 15:28:37 +03:00
Alexander Medvednikov
51bd69cdd8
cgen: fix u64 in struct str()
2020-08-18 16:05:11 +02:00
Delyan Angelov
2f6757a56a
Revert "cgen: fix all -Wmissing-variable-declarations ( #5802 )"
...
This reverts commit ae349ca6ba
.
Fixing these warnings, unfortunately also means, that hot code
(which reloads a shared library during runtime) can not use V
constants, because the private static C variables in the shared
library will not be initialized by _vinit(), which is only called
by the main V program.
For example in examples/hot_reload/bounce.v, using `gx.blue`,
defined as:
` blue = Color { r: 0, g: 0, b: 255 }`
... will instead use a const with all 0 fields (i.e. a black color).
2020-08-18 11:55:55 +03:00
Delyan Angelov
937a3e14c5
cgen: add g.options_typedefs, g.shared_types, g.channel_definitions
2020-08-18 11:45:36 +03:00
Uwe Krüger
0d7cc8829a
cgen: implement channel `push()`/`pop()` using `<-` operator ( #6154 )
2020-08-17 23:35:36 +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
Alexander Medvednikov
f965ddae49
parser: handle several errors in types; cgen: objC includes
2020-08-16 19:16:59 +02:00
Nick Treleaven
0f0a91fc9e
parser: support custom fixed size ArrayInit: `[3]int{init: -1}` ( #6114 )
2020-08-15 11:01:54 +02:00
Uwe Krüger
9602a25a0b
all: add builtin channel type `chan elem_type` ( #6126 )
2020-08-14 21:18:42 +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
Delyan Angelov
8580a0bcd7
cgen: run vfmt to silence `./v fmt -verify`
2020-08-13 21:22:52 +03:00
Daniel Däschle
64e8125807
cgen: fixe calling anon fn asynchronously ( closes #6088 ) ( #6121 )
2020-08-13 20:06:56 +02:00
Delyan Angelov
1135dffe2d
cgen: prevent generation of duplicate interface method wrappers
2020-08-13 20:56:58 +03:00
Alexander Medvednikov
f8be2110ec
sort: fix sorting by struct fields
2020-08-12 18:43:41 +02:00
Alexander Medvednikov
e5e31f7210
sort: handle `.sort(a.field > b.field)`
2020-08-12 06:11:40 +02:00
Alexander Medvednikov
4bc0dde413
all: new `.sort(a < b)` syntax
2020-08-12 05:54:51 +02:00
Delyan Angelov
ca7a64a451
cgen: add support for -g again
2020-08-12 02:05:45 +03:00
Enzo
f238890fe9
compiler: move attributes to declarations ( #6026 )
2020-08-04 20:10:22 +02:00
Alexander Medvednikov
7a7572e478
autofree: free temp string exprs
2020-08-04 01:26:34 +02:00
Nick Treleaven
7f447bb82f
ast: use Block instead of UnsafeStmt ( #5981 )
2020-08-02 14:06:44 +03:00
Alexander Medvednikov
adafd24819
gen: auto_str_methods.v
2020-08-01 16:36:12 +02:00
Delyan Angelov
0fb8074353
cgen: add support for `$if gcc {}` too
2020-07-31 21:25:37 +03:00
joe-conigliaro
1ea511b530
builder/cgen: get -usecache working for self cimpilation
2020-07-31 20:10:19 +10:00
Ruofan XU
1d59d35129
cgen: fix sum type match ( #5978 )
2020-07-28 22:17:25 +02:00
Ruofan XU
7027b2354b
cgen: fix array and map with fns ( #5938 )
2020-07-26 14:22:02 +02:00
Delyan Angelov
3d2fd471b6
ci: prepare for enabling compilation with g++ again
2020-07-25 20:20:49 +03:00
Alexander Medvednikov
3c1427a4e8
all: fix current module in build-module mode
2020-07-25 01:37:54 +02:00
Louis Schmieder
b58b15993c
gen: compile time for (methods and fields) ( #5957 )
2020-07-25 00:02:44 +02:00
pancake
04ef2a2671
os: implement os.system for iOS and uncomment the `$if ios` blocks ( #5947 )
2020-07-24 10:17:32 +03:00
Alexander Medvednikov
632e27a4a9
all: fix a big mutability bug and update all mutable vars
2020-07-23 23:16:36 +02:00
Alexander Medvednikov
653d40bfe8
parser: do not duplicate table imports
2020-07-23 21:59:48 +02:00
pancake
36352085ae
v: add support for iOS crosscompilation ( #5943 )
2020-07-23 07:58:44 +03:00
Emily Hudson
0f98445f7f
cgen: properly handle more multi-return edge cases ( #5933 )
2020-07-23 00:39:19 +02:00
Ryan Willis
938e71b468
v: fix for `import cli { Command }`
2020-07-22 20:33:43 +03:00
Ruofan XU
0f72328d1f
cgen: minor generated C source format fix
2020-07-22 17:27:37 +03:00
Ruofan XU
a370dd2867
cgen: further fixes to and array/map of fns ( #5916 )
2020-07-22 02:30:44 +02:00
kalapalo
c3a2e9b5c4
cgen: fix sum type assignment with pointers ( #5868 )
2020-07-22 02:28:49 +02:00
Alexander Medvednikov
303b65c0b9
roadmap: io streams
2020-07-20 22:51:17 +02:00
Ruofan XU
88c8e194d0
cgen: fix map and array with fns ( #5894 )
2020-07-20 19:53:02 +03:00
Delyan Angelov
c858978348
cgen: add support for `-d trace_gen` too. Add `v tracev` command.
2020-07-20 12:36:27 +03:00
Ruofan XU
9f6aacb739
cgen: fix array of fns init ( #5884 )
2020-07-19 21:44:03 +02:00
Enzo
8a855ccae1
fmt,vet: handle `var in [single_value]` ( #5882 )
2020-07-19 19:58:34 +02:00
Alexander Medvednikov
74d70b8719
all: more cached moduels fixes
2020-07-18 13:49:03 +02:00
Alexander Medvednikov
38e5569503
all: cached modules fixes
2020-07-18 11:15:44 +02:00
Enzo
90d9040e6e
all: make comment expressions + fix vfmt array init ( #5851 )
2020-07-17 19:13:22 +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
spaceface777
3583302ad4
parser: force `...` rather than `..` in matches for inclusive ranges ( #5852 )
2020-07-17 11:30:21 +03:00
Alexander Medvednikov
e4fac6ff97
autofree: fix scope position
2020-07-16 19:40:14 +02:00
spaceface777
b900577dae
compiler: handle ranges as `match` conditions ( #5847 )
2020-07-16 16:41:18 +03:00
joe-conigliaro
612fe1b8fb
cgen: autofree scope var position fixes
2020-07-16 20:06:50 +10:00
Enzo
880c8e4dc9
cgen: else if guard ( #5822 )
2020-07-14 17:19:55 +02:00
Alexander Medvednikov
c3ec5323f0
autofree: move new scope free behind -experimental for now
2020-07-14 15:30:55 +02:00
Alexander Medvednikov
7231b467a6
autofree: fix stmts() free
2020-07-14 14:50:51 +02:00
Alexander Medvednikov
1338e7fce2
autofree: free in each scope
2020-07-14 13:56:52 +02:00
ka-weihe
df45488e09
cgen: fix warnings ( #5820 )
2020-07-14 00:16:31 +02:00
Uwe Krüger
6e6010d198
checker, cgen: implement auto-lock for `a[i]++`, `a[i]--` ( #5817 )
2020-07-13 15:01:32 +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
ka-weihe
ae349ca6ba
cgen: fix all -Wmissing-variable-declarations ( #5802 )
2020-07-11 15:37:40 +02:00
Alexander Medvednikov
d94a02ba79
strings: builder.writeln() optimization
2020-07-11 12:03:24 +02:00
Alexander Medvednikov
a1073105e1
all: re-enable -prealloc
2020-07-11 11:25:56 +02:00
yuyi
bf14e666ea
cgen: add `gen_map_equality_fn` to compare maps ( #5770 )
2020-07-10 18:08:17 +02:00
Emily Hudson
7488dd829d
all: _allow_multiple_values enum attribute ( #5772 )
2020-07-10 16:43:02 +02:00
yuyi
31ac20876c
cgen: minor formatting of `struct_init` ( #5768 )
2020-07-09 17:25:48 +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
Daniel Däschle
c0fa31e75a
cgen: if smartcast part 3 ( #5755 )
2020-07-08 19:14:47 +02:00
Daniel Däschle
5ea17ad2d4
all: if smartcast part 2 ( #5754 )
2020-07-08 15:46:58 +02:00
Daniel Däschle
b62bf59c21
all: if-is smartcast part 1 ( #5730 )
2020-07-08 15:17:28 +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
yuyi
b0ce66d141
gen: fix generated `defer` ( #5717 )
2020-07-08 08:39:11 +03:00
joe-conigliaro
5fd5e558ae
parser/checker/gen: anon fn direct call with args
2020-07-08 01:10:39 +10:00
yuyi
dc24327b1e
cgen: minor optionals fix ( #5714 )
2020-07-07 14:21:02 +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
yuyi
c94038af89
cgen: improve generated code formatting ( #5693 )
2020-07-06 12:33:57 +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
joe-conigliaro
4e66728477
checker/table: rearrange sumtype check fns
2020-07-06 00:53:56 +10:00
joe-conigliaro
9d7f1a236a
checker/gen: fix nested sumtype matching
2020-07-06 00:25:04 +10:00
yuyi
cda9240632
cgen: add unsafe block braces and comments in generated code ( #5674 )
2020-07-05 13:32:39 +02:00
yuyi
11866fb017
cgen: improve code formatting of `array_init` ( #5663 )
2020-07-04 21:49:04 +02:00
Delyan Angelov
35431d457b
checker: add check for strict .str() method signature
2020-07-04 14:14:43 +03:00
Uwe Krüger
3b067f5f85
all: experimental locked concurrency support, part 1 ( #5637 )
2020-07-04 12:44:25 +02:00
yuyi
27149ba8bc
cgen: fix `in` in mutable arrays ( #5647 )
2020-07-04 12:12:44 +02:00
Ruofan XU
765ffa37eb
cgen: fix == for mut arraay args ( #5648 )
2020-07-04 11:36:33 +02:00
yuyi
67e85fa9dd
cgen: fix indent in `for_in_string` ( #5631 )
2020-07-03 18:10:45 +02:00
yuyi
61213263cd
cgen: remove extra `\n` in map.get ( #5630 )
2020-07-03 18:10:29 +02:00
Ruofan XU
a2395ff3e8
cgen: fix mut map with relation op in fn ( #5642 )
2020-07-03 18:07:11 +02:00
Delyan Angelov
8adaf4efd4
cgen: allow `-printfn main` for _test.v files too
2020-07-03 17:53:48 +03:00
yuyi
dff385cb37
cgen: fix map_in mut ( #5638 )
2020-07-03 17:33:53 +03:00
Alexander Medvednikov
b7175b54eb
vweb: ['/:arg1/:arg2/action'] attribute
2020-07-03 15:10:39 +02:00
yuyi
1efbb83060
cgen: add space before `else` in match ( #5632 )
2020-07-03 11:23:23 +02:00
yuyi
6cbc0e84f0
cgen: fix cross assign with mutable args ( fix #5609 #5610 #5611 ) ( #5614 )
2020-07-02 11:09:26 +02:00
yuyi
c21527d3c6
cgen: fix indent in multi_return ( #5617 )
2020-07-02 11:08:27 +02:00
yuyi
e904732554
cgen: remove an extra \n in for loops ( #5618 )
2020-07-02 11:03:40 +02:00
Alexander Medvednikov
66f36f6dcc
cgen: fix gen_cross_tmp_variable, part 2
2020-07-01 19:39:41 +02:00
Alexander Medvednikov
625ed030ef
cgen: fix getn_cross_tmp_variable
2020-07-01 19:19:49 +02:00
Alexander Medvednikov
dbcb23ddc8
ci: run v vet on cgen and ast
2020-07-01 19:07:19 +02:00
yuyi
40a393926d
cgen: fix cross assign of struct fields ( #5606 )
2020-07-01 18:43:14 +02:00
yuyi
2f614ad79f
parser: optimize cross assign using expr.str() ( #5604 )
2020-07-01 16:43:13 +02:00
Alexander Medvednikov
013a4fc0f6
cgen: do not free strings in const decls
2020-07-01 16:40:04 +02:00
Alexander Medvednikov
5eb76606ae
cgen: store return vals in tmp vars with -autofree
2020-07-01 14:34:14 +02:00
yuyi
92eea7f95a
cgen: fix map cross assign ( #5603 )
2020-07-01 14:03:12 +02:00
yuyi
6c5b638202
parser: fix array cross assign ( fix #5577 ) ( #5591 )
2020-07-01 12:11:03 +02:00
Delyan Angelov
ca1f47a742
cgen: fix `for k,_ in map { x << k }`
2020-07-01 11:49:02 +03:00
Delyan Angelov
cfd71560fa
cgen: fix << for `mut a []Type` args
2020-07-01 09:21:50 +03:00
Delyan Angelov
78e1127d99
cgen: treat the main module like any other v module
2020-07-01 00:53:53 +02:00
Delyan Angelov
3fed6ca050
cgen: comment out g_str_buf for now
2020-06-30 18:32:04 +03:00
Delyan Angelov
af56b01a41
cgen: parametrize g_str_buf size by V_STRBUF_MB; free in _vcleanup()
2020-06-30 16:31:02 +03:00
yuyi
61b8c0b699
cgen: change `i++` to `++i` in `for`
2020-06-30 14:14:48 +02:00
yuyi
628f13f1c8
cgen: minor optimization of `index_expr()`
2020-06-30 14:11:59 +02:00
joe-conigliaro
a3086a2ef3
cgen: optimize generic struct name replacement (temp solution)
2020-06-30 13:45:52 +10:00
Alexander Medvednikov
77e56aa3f9
cgen: fix string frees in calls
2020-06-29 20:20:35 +02:00
joe-conigliaro
ab37dcaa9c
generic structs: initial implementation
2020-06-29 20:09:09 +02:00
Alexander Medvednikov
5b98cde811
cgen: free temp strings
2020-06-29 17:47:12 +02:00
Alexander Medvednikov
3dea698c93
checker: do not register pseudo variables in sql queries
2020-06-28 18:56:11 +02:00
yuyi
b924c6c4a9
cgen: minor opitimize `infix_expr` ( #5547 )
2020-06-28 11:35:49 +02:00
yuyi
d9409006fa
cgen: fix a[0]+='str'
2020-06-28 11:16:16 +02:00
Emily Hudson
c84bafbdae
vlib,cgen: cleanup array inits using `.repeat() instead of new init syntax
2020-06-27 21:46:04 +02:00
Emily Hudson
1848eb0973
cgen,map: fix leaks in `keys()` and `for x in y`
2020-06-27 17:00:27 +02:00
Alexander Medvednikov
d52f1da7a2
orm: handle missing rows
2020-06-26 20:38:21 +02:00
joe-conigliaro
2440ffd013
cgen: always unwrap generic type. fix `x := &T{}`
2020-06-27 00:31:36 +10:00
Alexander Medvednikov
afa5a134b7
orm: move fields fetching to a separate function to remove copy pasta
2020-06-25 14:43:25 +02:00
yuyi
f1e17f30f6
cgen: fix map_in error
2020-06-25 12:53:12 +02:00
ka-weihe
3bb6b6c8b2
map: comments and renaming
2020-06-24 23:31:19 +02:00
Alexander Medvednikov
83b300435a
vweb: escape html; table: rename parent_typ to parent_type
2020-06-24 22:12:33 +02:00
yuyi
67d9d94fb3
map: fix m[a]++ etc
2020-06-24 20:41:26 +02:00
Lukas Neubert
955c0b1576
cgen: add 'link' to c_reserved
2020-06-24 20:40:56 +02:00
Alexander Medvednikov
e918f8faf2
fmt: re-run on checker.v and cgen.v
2020-06-24 14:44:06 +02:00
Alexander Medvednikov
090e6e936a
orm: SqlStmt
2020-06-24 14:32:17 +02:00
Daniel Däschle
852fca2151
all: call anon fns right away
2020-06-24 12:54:39 +02:00
Alexander Medvednikov
cf7ac7be7f
cgen: zero_struct_field(); orm: zero un-inited fields
2020-06-24 12:53:39 +02:00
yuyi
514ee9d396
cgen: fix optional void return error
2020-06-24 12:45:15 +02:00
Alexander Medvednikov
74af88bc92
Revert "fmt: re-format parser.v and cgen.v"
...
This reverts commit 6b2808a3f9
.
2020-06-23 18:16:24 +02:00
Alexander Medvednikov
6b2808a3f9
fmt: re-format parser.v and cgen.v
2020-06-23 18:05:53 +02:00
Alexander Medvednikov
deb09d95b0
orm: fix `column == var`; limit 1; vweb: @footer
2020-06-22 16:52:16 +02:00
yuyi
81c19517d1
cgen: add gen_str_for_multi_return
2020-06-21 17:53:13 +02:00
ka-weihe
7f225f2eaa
map: rename size to len
2020-06-21 16:51:02 +02:00
Alexander Medvednikov
1d8d19c977
vweb: return $vweb.html()
2020-06-20 03:12:38 +02:00
yuyi
4dc703af2d
cgen: fix nested array equality
2020-06-20 01:40:33 +02:00
Alexander Medvednikov
3cfeb92a4e
cgen: fix tmp counter; orm: insert fixes
2020-06-19 17:05:57 +02:00
Alexander Medvednikov
cd8392e42d
orm: insert
2020-06-19 16:43:35 +02:00
Alexander Medvednikov
d04554f0b7
all: more match updates
2020-06-19 11:46:08 +02:00
Alexander Medvednikov
d9dd9679e7
cgen: fix a typo
2020-06-19 11:16:51 +02:00
Alexander Medvednikov
ef36520509
checker: check if the type in `as` exists, skip void type errors
2020-06-19 11:15:15 +02:00
Alexander Medvednikov
78b32892ac
cgen: use the new match syntax
2020-06-18 20:21:08 +02:00
Alexander Medvednikov
d4b17fb0c3
fmt: use the new match syntax
2020-06-18 20:07:48 +02:00
joe-conigliaro
45239cbd62
parser/checker/gen: match shaddow cond var & as support: p2
2020-06-19 00:41:00 +10:00
joe-conigliaro
68143b7b22
parser/checker/gen: match shaddow cond var & as support: p1
2020-06-19 00:33:16 +10:00
yuyi
947e8922f2
cgen: optimize the format of the generated code
2020-06-18 12:08:36 +02:00
yuyi
930c3d73c1
cgen: fix `arr.insert(0, [1,2,3])` and `arr.prepend([1,2,3])`
2020-06-18 12:08:11 +02:00
yuyi
3f01e2b796
cgen: fix array.insert and arr.prepend
2020-06-18 00:22:34 +02:00
Alexander Medvednikov
a602673adb
x64: pass variables to functions
2020-06-17 20:18:51 +02:00
Uwe Krüger
ddb1770af2
cgen: fix unsigned/signed integer comparisons
2020-06-17 02:54:27 +02:00
Alexander Medvednikov
ed58192e4c
v orm: select
2020-06-17 00:59:37 +02:00
yuyi
23993d2264
cgen: fix nested array equality error
2020-06-16 18:40:32 +02:00
joe-conigliaro
d478b44915
parser/checker/gen: merge AssignExpr & AssignStmt into just AssignStmt
2020-06-16 21:20:16 +10:00
Alexander Medvednikov
e8f8defc3e
ast: SqlExpr
2020-06-16 12:14:22 +02:00
Uwe Krüger
f2d9fa3815
cgen: restructure string_inter_literal()
2020-06-16 10:41:51 +02:00
Emily Hudson
49d7a151b7
cgen: edge case for multi-returns
2020-06-15 22:30:16 +02:00
joe-conigliaro
0cd9066f44
parser/cgen: multiple attributes & better errors ( closes #5334 )
2020-06-15 22:59:09 +10:00
yuyi
b0138e021e
cgen: fix `in` multi_array
2020-06-15 13:21:06 +02:00
yuyi
4e1a09c9f5
cgen: fix array_init temporary variable error
2020-06-14 19:09:27 +02:00
yuyi
7e0197c1b8
cgen: fix `in` empty array
2020-06-14 10:54:10 +02:00
Uwe Krüger
6113c4fe63
builtin: fix string interpolation for autofree
2020-06-13 18:39:17 +02:00
Adam Stankiewicz
f2a75d5223
test: run all tests even if some fail
2020-06-13 16:20:45 +02:00
Alexander Medvednikov
ca63b92d4f
cgen: fix _STR 000
2020-06-12 16:55:21 +00:00
Adam Stankiewicz
827a9e221f
cgen: do not double-reference anon fn
2020-06-12 10:48:44 +02:00
yuyi
47ffedc5de
cgen: minor array_init fix
2020-06-12 02:19:48 +02:00
yuyi
ff1437fc5a
cgen: fix multi_array index issue
2020-06-12 01:24:25 +02:00
Delyan Angelov
5ef9569098
cmd/tools: add check_os_api_parity.v - keep module APIs even
2020-06-11 21:13:36 +03:00
Emily Hudson
19c3ba2f8f
cgen: ensure struct has empty_struct_declaration to appease msvc
2020-06-11 00:52:06 +02:00
Alexander Medvednikov
684a443b08
cgen: disable _STR_TMP
2020-06-10 21:24:59 +00:00
Delyan Angelov
972f60d785
cgen: do use g.write_defer_stmts in opt()? calls
2020-06-10 18:43:23 +03:00
yuyi
b6e2495aa2
cgen: remove redundant code for array.map/filter(anon_fn)
2020-06-10 17:25:54 +02:00
Emily Hudson
bf7f84d16f
cgen: fix using C constants in enums, `none` propagation
2020-06-10 17:01:55 +02:00
yuyi
acf0b84523
cgen: fix array.filter(anon_fn)
2020-06-10 13:18:59 +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
yuyi
85c741519b
cgen: fix array.map(fn...)
2020-06-09 12:50:56 +02:00
yuyi
1396dc1c89
cgen: remove extra blank lines
2020-06-09 12:23:08 +02:00
yuyi
d472a27489
cgen: fix array.map(anon_fn)
2020-06-09 10:14:10 +02:00
wilesun
564545d20a
cgen: add defered statements before propagating option returns
2020-06-08 18:50:23 +03:00
Alexander Medvednikov
1bbfc271c5
vweb: fix unused tmpl warning; remove duplicate code
2020-06-08 13:30:42 +02:00
joe-conigliaro
1c2bf7b244
vweb: impl of comptime tmpl parsing (fix vweb_example)
2020-06-07 20:26:45 +10:00
Alexander Medvednikov
4d5ac1e16d
vweb: $html
2020-06-06 21:36:34 +02:00
Alexander Medvednikov
7815c5b108
cgen: $action (ComptimeCall); vweb: hello world works!
2020-06-06 10:05:26 +02:00
yuyi
ef46fbb96f
cgen: clean up ternary
2020-06-05 08:30:03 +02:00
Uwe Krüger
cf9498ef6b
cgen: use standard checks for float comparisons
2020-06-04 19:47:41 +02:00
joe-conigliaro
edd56bc080
table: allow type hold 8 flags at once
2020-06-04 22:38:54 +10:00
yuyi
ffafeac0f8
cgen: optimize gen c code format
2020-06-03 18:24:08 +03: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
Alexander Medvednikov
fb3e52ca63
all: `!is` operator
2020-06-02 16:18:12 +02:00
Alexander Medvednikov
78f8a8aee6
cgen: remove g_ hack
2020-06-02 15:49:43 +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
Emily Hudson
0c7bac4ba7
json: fix enums and byte, cleanup
2020-06-01 19:36:07 +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
pancake
304258162c
cgen: when building a shared library, make vinit() a constructor
2020-05-31 17:27:23 +02: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
Emily Hudson
a4de507c6d
cgen: panic on assertion failed outside tests
2020-05-30 13:19:52 +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
pancake
2943bdc1f6
cgen: add support for $if (mach|darwin|hpux|gnu|qnx|bsd)
2020-05-28 13:33:12 +02:00
Delyan Angelov
a3bd8d3e4c
cgen: add trace info about auto str generation
2020-05-28 10:36:29 +03:00
Delyan Angelov
55ef117531
cgen: fix for V structs fields (auto str and json_decode)
2020-05-28 09:55:37 +03:00
yuyi
9cbd9db4e7
cgen: fix swap assign of prefix and postfix expr
2020-05-28 02:22:09 +03:00
Emily Hudson
0b64e2190f
checker,cgen: unpack multi returns in return statements
2020-05-27 15:47:38 +03: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
Julia K
2b27072fac
compiler: new attributes, prelude customization
2020-05-26 14:12:18 +02:00
Emily Hudson
748b1d3381
cgen: use typ() for array type
2020-05-26 14:11:59 +02:00
Alexander Medvednikov
0f92800921
cgen: string buffer fix
2020-05-26 00:04:13 +02:00
Alexander Medvednikov
53a10eb312
cgen: use STR_TMP with -autofree
2020-05-25 12:46:18 +02:00
Delyan Angelov
96808a0e2a
cgen: generalize _vcleanup of array/string consts + valgrind with tcc
2020-05-25 10:24:19 +03:00
Delyan Angelov
ae03aab03e
cgen: autofree math.bits and strconv.ftoa constants
2020-05-25 09:53:30 +03:00
Delyan Angelov
6683f98eba
cgen: add support for `-printfn _vcleanup` and `-printfn _vinit`
2020-05-25 09:47:00 +03:00
Alexander Medvednikov
f41e2c0a4b
string: make replace() clone for now; parser: comptime method
2020-05-25 08:17:36 +02:00
Alexander Medvednikov
1b36d7a037
cgen: handle c++ keyword
2020-05-25 05:46:58 +02: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
Uwe Krüger
7c4f2b535b
cgen: prepare any_in, any_float on v side
2020-05-24 15:26:43 +03:00
Delyan Angelov
ddcb5f7da3
gen: fix autogenerated print methods for vargs
2020-05-24 15:05:19 +03:00
Alexander Medvednikov
67750c91d7
generics: lots of fixes
2020-05-24 04:43:03 +02:00
Delyan Angelov
70f0115e27
options: use panic_debug() for opt()? calls in main with -cg
2020-05-23 11:43:20 +03:00
Enzo Baldisserri
801bca1ef2
compiler: propagate optional
2020-05-23 08:51:15 +02:00
Delyan Angelov
aef751861d
cgen: fix `_ := []byte{init:1}`
2020-05-22 18:17:20 +03:00
Enzo Baldisserri
1633675c11
gen: fix nested `or`
2020-05-21 22:35:43 +02:00
Alexander Medvednikov
ce1a181699
all: generic functions
2020-05-21 03:58:53 +02:00
Tanel Liiv
c9f3a05ef6
checker: fix map/filter called with a plain fn argument
2020-05-20 15:28:33 +03:00
yuyi
b3b86ea6d7
cgen: fix array_init has len but no init error
2020-05-19 18:33:24 +02:00
spaceface777
b10df252dc
all: replace `is_c`, `is_js` with `language`
2020-05-19 17:12:47 +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
Alexander Medvednikov
07a78b2843
Revert "all: C++ compiler support"
...
This reverts commit 9a237c3e82
.
2020-05-18 17:05:48 +02:00
Uwe Krüger
9a237c3e82
all: C++ compiler support
2020-05-18 15:51:36 +02:00
Alexander Medvednikov
4f307c1a78
checker: requre & in struct init; http: chunked encoding
2020-05-18 05:11:00 +02:00
yuyi
6855996cca
cgen: fix array_init_with_default
2020-05-16 19:05:26 +02:00
yuyi
655d9bda94
cgen: remove extra `;` from if_expr
2020-05-16 17:09:57 +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
Alexander Medvednikov
c4ca6a9113
sokol: make examples compile
2020-05-15 18:55:29 +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
wilesun
2a9cbbe157
cgen: handle sizeof(C.struct)
2020-05-14 17:14:59 +02:00
Alexander Medvednikov
2369a5c8c6
cgen: handle `is` for interfaces
2020-05-14 16:56:45 +02:00
Alexander Medvednikov
ab7bc760c6
cgen: new Option part 1
2020-05-13 21:59:08 +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
kdmult
ea8fcb3981
cgen: fix nested conditional statements
2020-05-11 15:11:48 +02:00
Ned Palacios
38277d1dac
cgen: fix gen_str_for_struc when called on a struct with a pointer field
2020-05-11 11:08:21 +03: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
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
Sumeet Chhetri
8dc0c5a699
cgen: C++ compiler support - Part 1
2020-05-10 16:26:21 +02:00
joe-conigliaro
a73660a4c3
checker/cgen: simplify assigning fn to var
2020-05-11 00:13:30 +10:00
Alexander Medvednikov
dea9ca2491
cgen: fix a big with &Foo{} init
2020-05-09 15:23:48 +02:00
Alexander Medvednikov
c64f8b0d1f
parser/checker: pub: struct fields
2020-05-09 15:16:48 +02:00
Tanel Liiv
7815a5495c
checker: handle multireturn fn calls as if/match last expressions
2020-05-08 22:49:45 +02:00
Alexander Medvednikov
c29f76454e
cgen: clone strings in struct_init()
2020-05-08 15:07:53 +02:00
Alexander Medvednikov
2f4fc86d58
checker: fix unknown var enum crash
2020-05-08 15:00:06 +02:00
Alexander Medvednikov
847a1035a5
cgen: use tos_lit
2020-05-08 13:25:23 +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
Delyan Angelov
7207a4970b
solaris: fix tests
2020-05-07 16:19:21 +00:00
Alexander Medvednikov
8cfb2ad6c9
string: is_lit
2020-05-07 18:05:57 +02:00
Alexander Medvednikov
ef387779bf
cgen: fix -autofree
2020-05-07 17:51:30 +02:00
Alexander Medvednikov
3c6e090ae3
ci: test broken -autofree
2020-05-07 17:45:00 +02:00
Alexander Medvednikov
be063d740b
ci: test self compilation with -autofree
2020-05-07 17:37:12 +02:00
Tanel Liiv
d0afa748ff
cgen: optional multiple return values
2020-05-07 15:36:04 +02:00
Alexander Medvednikov
12221fb999
cgen: fix msvc struct init
2020-05-07 13:11:24 +02:00
Alexander Medvednikov
6ff93f270c
cgen: simplify struct_init()
2020-05-07 13:00:42 +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
wilesun
19390871e9
json: handle external types
2020-05-07 04:33:19 +02:00
Delyan Angelov
e33805b2b3
json.decode: fix expressions in the second argument, also fixes news_fetcher.v
2020-05-06 21:44:50 +03:00
Tanel Liiv
b5a1544bf8
parser: allow re-assigning fns to variables
2020-05-06 20:09:29 +02:00
Delyan Angelov
f638caef39
compiler: v -autofree can now compile itself
2020-05-06 19:03:51 +03:00
Alexander Medvednikov
8d2a4d2436
clipboard: make compile on linux
2020-05-06 12:00:52 +00:00
Alexander Medvednikov
25db5e96a3
strings.builder: fix a memory leak
2020-05-06 11:12:00 +00:00
yuyi
c653977c15
cgen: fix struct with map field str() error
2020-05-06 09:08:48 +03:00
Alexander Medvednikov
25b536d03f
cgen: str: do not free "true"/"false" literals
2020-05-05 23:25:14 +02:00
Alexander Medvednikov
473ffb5489
builtin: fix a leak in array_str
2020-05-05 18:04:43 +00:00
Delyan Angelov
9e715b8701
cgen: use c_name() while generating code for `or {}`
2020-05-05 19:28:25 +03:00