Daniel Däschle
7d6f97259f
all: refactor UnionSumType to SumType ( #6944 )
2020-11-25 13:09:40 +02:00
Daniel Däschle
a042966082
all: remove old sumtype code ( #6937 )
2020-11-24 17:55:24 +01:00
Delyan Angelov
f995aa35ea
checker: add a check for `x := math.sin<f64>(0)`
2020-11-15 11:51:12 +02:00
pancake
2994e7150f
vweb: check function and route parameter count ( #6761 )
2020-11-08 09:14:24 +01:00
Daniel Däschle
a2fc19880a
parser: fixes or block position ( #6736 )
2020-11-04 16:02:01 +02:00
Delyan Angelov
e72d9c0f88
parser: protect against infinite loops in -silent mode over invalid .v files
2020-11-01 14:02:32 +02:00
Delyan Angelov
70cbf56655
cgen: show more informative errors, instead of a `invalid type (typ=0 idx=0)` verror panic
2020-10-30 20:26:08 +02:00
Alexander Medvednikov
7da1afa140
all: switch to the new fn arg syntax everywhere; add lots of vfmt -verify tests
2020-10-15 12:32:28 +02:00
Enzo
fd88bfbac8
fmt: fix formatting of anon args ( #6545 )
2020-10-04 06:32:47 +02:00
Enzo
677b0ba2d2
gen: access fields in multi-type sumtype match ( #6541 )
2020-10-03 11:19:43 +02:00
Alexander Medvednikov
fca344d1fb
all: fn args => params
2020-09-27 03:32:56 +02:00
Alexander Medvednikov
624f22e27e
all: mutability check (part 1); enable mutable sumtype args
2020-09-22 05:28:29 +02:00
Alexander Medvednikov
b74c1805d7
cgen/autofree: fix and simplify optionals
2020-09-12 16:40:52 +02:00
Nick Treleaven
eb95a4333a
table: rename Arg to Param ( #6337 )
2020-09-09 13:21:11 +02:00
Alexander Medvednikov
3410705974
autofree: lots of fixes
2020-09-05 12:00:35 +02:00
Nick Treleaven
7dbae14e19
checker: error on `mut name =` ( #6247 )
2020-08-28 20:07:32 +03:00
Maciej Obarski
e8e0d9fa42
all: [direct_array_access] tag ( #6203 )
2020-08-24 09:04:50 +02:00
Daniel Däschle
fcc61a981d
all: TypeSymbol.source_name ( #6187 )
2020-08-22 12:29:15 +02:00
Alexander Medvednikov
c5aa2bfa51
tests: fix a match test
2020-08-11 16:26:52 +02:00
Delyan Angelov
bd32f0969f
parser: enable CamelCase named method names for JS. objects
2020-08-10 10:39:14 +03: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
Enzo
f238890fe9
compiler: move attributes to declarations ( #6026 )
2020-08-04 20:10:22 +02:00
Delyan Angelov
8c4429c875
parser: fix passing the is_mut flag of anon fn arguments
2020-07-24 11:27:56 +03:00
Nick Treleaven
a74cbf55c7
checker: warn if C.m* or C.s* functions are called outside unsafe blocks ( #5869 )
2020-07-20 20:06:41 +03:00
Enzo
8653605b0a
fmt: allow for comments in call args and if expressions branches ( #5871 )
2020-07-20 17:48:33 +03:00
Ryan Willis
1114fd28d0
all: import individual symbols feature ( #5872 )
2020-07-18 21:34:38 +02:00
Nick Treleaven
105a0e015e
checker: warn if unsafe method called outside unsafe block ( #5863 )
2020-07-17 19:14:12 +02:00
Enzo
2ee8f93d60
parser: duplicate method declaration on interface ( #5825 )
2020-07-15 10:23:21 +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
yuyi
64e9bdc213
parser: fix non-void optional fn missing return value ( fix #5736 ) ( #5741 )
2020-07-08 16:01:17 +02:00
Daniel Däschle
5ea17ad2d4
all: if smartcast part 2 ( #5754 )
2020-07-08 15:46:58 +02:00
joe-conigliaro
5fd5e558ae
parser/checker/gen: anon fn direct call with args
2020-07-08 01:10:39 +10:00
Uwe Krüger
ef02373061
all: remove `rwshared` keyword, make its semantics default for `shared` ( #5710 )
2020-07-07 01:57:31 +02:00
Uwe Krüger
3b067f5f85
all: experimental locked concurrency support, part 1 ( #5637 )
2020-07-04 12:44:25 +02:00
Alexander Medvednikov
b7175b54eb
vweb: ['/:arg1/:arg2/action'] attribute
2020-07-03 15:10:39 +02:00
Alexander Medvednikov
da99868a28
ci: run v vet vlib/v/parser
2020-07-01 18:57:14 +02:00
Delyan Angelov
78e1127d99
cgen: treat the main module like any other v module
2020-07-01 00:53:53 +02:00
joe-conigliaro
ab37dcaa9c
generic structs: initial implementation
2020-06-29 20:09:09 +02:00
yuyi
c588bdee5a
cgen: fix fn()? return
2020-06-29 11:02:40 +02:00
Delyan Angelov
1ba5996404
parser: fix interface functions with no params (ui examples)
2020-06-29 10:53:12 +03:00
Delyan Angelov
b6e6cde3e8
parser: disallow fns with type only args and a body
2020-06-29 10:21:01 +03:00
Daniel Däschle
852fca2151
all: call anon fns right away
2020-06-24 12:54:39 +02:00
yuyi
7efb3ecb34
checker: check deprecated functions
2020-06-23 16:25:24 +02:00
yuyi
73296e486a
parser: fix function return anon_fn without parentheses
2020-06-22 16:03:31 +02:00
spaceface777
a02aff9126
jsgen: fixes and improvements
2020-06-20 13:22:49 +02:00
Alexander Medvednikov
78b32892ac
cgen: use the new match syntax
2020-06-18 20:21:08 +02:00
joe-conigliaro
0cd9066f44
parser/cgen: multiple attributes & better errors ( closes #5334 )
2020-06-15 22:59:09 +10:00
Adam Stankiewicz
b3fc462a78
scanner: fix parsing multiple .amp
2020-06-13 00:01:44 +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
spaceface777
30f1c6bad5
parser: fix type_only fns starting with varargs
2020-06-08 19:02:36 +02:00
Alexander Medvednikov
4d5ac1e16d
vweb: $html
2020-06-06 21:36:34 +02:00
Delyan Angelov
8d3f680d07
vdoc: implement .toplevel_comments parsing mode
2020-06-06 19:05:26 +03:00
Alexander Medvednikov
100b3986b8
parser: handle ! after CallExpr
2020-06-06 12:28:03 +02:00
yuyi
dd7ebf7fac
parser: check function argument mutable syntax
2020-06-04 15:20:43 +02:00
joe-conigliaro
41dca3ef58
checker/cgen: fix mutable generic fn args
2020-06-04 19:32:31 +10:00
Swastik Baranwal
d286f67220
parser: update check for non mut types in fn
2020-06-03 18:47:18 +03:00
yuyi
1060de88af
parser: fix function mutable argument error
2020-06-03 12:28:16 +02:00
Alexander Medvednikov
199f4f006b
checker: fix mut int check
2020-06-03 10:36:56 +02:00
yuyi
d0ff9a7c4a
parser: correct fn arg position in error message
2020-06-03 08:42:02 +03:00
Alexander Medvednikov
3d83934caf
checker: check mutating methods; generics fixes
2020-06-01 15:44:10 +02:00
Alexander Medvednikov
96fb7901b3
live: fix reloader.v
2020-05-29 04:36:08 +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
Alexander Medvednikov
9609b3a9c8
checker: make the method warning an error
2020-05-28 15:30:54 +02:00
Alexander Medvednikov
01dbb25a37
checker: do not allow defining methods on types from other modules
2020-05-28 15:23:20 +02:00
Alexander Medvednikov
5423a15f46
generics: more fixes
2020-05-27 15:56:30 +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
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
Alexander Medvednikov
82cedbaf62
fmt: fix `map[string][]string`; parser: allow `foo<int>(10)`
2020-05-20 21:40:24 +02:00
Alexander Medvednikov
0d3f133436
parser: show location of a previously defined function
2020-05-20 17:27:37 +02:00
spaceface777
b10df252dc
all: replace `is_c`, `is_js` with `language`
2020-05-19 17:12:47 +02:00
Alexander Medvednikov
03525843a0
parser: do not allow calling private functions
2020-05-18 22:54:11 +02:00
Alexander Medvednikov
895cefe351
parser: do not allow defining methods on types from other modules
2020-05-18 20:55:22 +02:00
yuyi
7f4cf08516
parser: check `(mut f Foo)` syntax
2020-05-17 13:51:18 +02:00
spaceface777
7c9bb44784
parser: allow JS methods with more than 1 dot
2020-05-15 22:26:51 +02:00
Alexander Medvednikov
0f251e9ede
checker: handle json.decode correctly
2020-05-14 18:30:30 +02:00
Alexander Medvednikov
f49ef39708
checker: handle unexpected `or` blocks
2020-05-14 18:19:40 +02:00
Alexander Medvednikov
1c8e14c77c
vfmt: handle comments in const blocks
2020-05-12 00:09:59 +02:00
Alexander Medvednikov
ce03761375
parser: fix mut args with the new syntax; checker: fmt
2020-05-11 14:16:20 +02:00
Kris Cherven
8bc0c31f29
parser: add error for variables, that are evaluated, but not used
2020-05-11 11:13:36 +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
Delyan Angelov
673acdbd00
tcc: fix selfcompilation with tcc. Temporarily disable crashing interface test
2020-05-07 20:59:45 +03:00
Enzo Baldisserri
0f8ed84333
checker: verify interface is not used as receiver
2020-05-07 11:14:51 +03:00
yuyi
2f52106253
parser: use .next instead of .check, when a token is already known
2020-05-07 07:51:36 +03:00
Delyan Angelov
f638caef39
compiler: v -autofree can now compile itself
2020-05-06 19:03:51 +03:00
Alexander Medvednikov
99cf520bd4
parser: `mut x Type` syntax for args
2020-05-06 12:13:22 +02:00
Alexander Medvednikov
ee92060d4d
json: decode_array fix
2020-05-05 14:19:31 +02:00
Alexander Medvednikov
fd8a194df0
json: wrap up decode()
2020-05-04 16:46:39 +02:00
Delyan Angelov
cdf70c070b
tests: add panic_with_cg.vv/.out
2020-05-04 14:34:51 +03:00
joe-conigliaro
57903247e3
parser: add back struct field removed by accident
2020-05-04 21:27:54 +10:00
joe-conigliaro
d75f286230
parser: store FnDecl body position and use for scope
2020-05-04 20:31:34 +10:00
Delyan Angelov
242670a33d
compiler: add support for panic_debug with -cg
2020-05-03 22:13:59 +03:00
yuyi
de272654f1
repl: fix import xxx with no fn main error
2020-05-01 18:12:18 +02:00
Alexander Medvednikov
9971c58ca3
all: remove `var` key
2020-04-30 16:55:33 +02:00
Enzo Baldisserri
682838a0cf
checker: check array and fields mutability
2020-04-27 22:53:26 +02:00
joe-conigliaro
9f76a7b250
parser: simplify unused vars & add loop/if vars etc
2020-04-27 23:16:31 +10:00
Delyan Angelov
e67bf674e3
scanner: cleanup, only v.parser now depends on v.scanner
2020-04-27 16:08:04 +03:00
Alexander Medvednikov
41eb4453e3
parser: do not allow redefinition of fn args
2020-04-26 12:01:10 +02:00
Alexander Medvednikov
0641a31fe0
parser: allow mutable pointer args
2020-04-26 11:53:41 +02:00
Alexander Medvednikov
3c08f655af
parser: do not allow mutable simple args
2020-04-26 10:35:10 +02:00
Alexander Medvednikov
a56121c329
checker: check mutability in index exprs; parser: set is_mut for args
2020-04-26 10:25:58 +02:00
Alexander Medvednikov
3ab8dc0092
parser: array init: `[]string` => `[]string{}`
2020-04-26 09:17:17 +02:00
Alexander Medvednikov
f7153ca4fa
fmt: array_init(); parser: fn_redefinition_error()
2020-04-26 07:17:01 +02:00
Enzo Baldisserri
fb54a2635c
fmt: lots of fixes
2020-04-25 17:49:16 +02:00
Delyan Angelov
9a19531909
compiler: add support for `[if myflag]` void fn/methods
2020-04-25 16:57:11 +03:00
joe-conigliaro
fbcdffbbc8
table: move Type functions to methods
2020-04-25 17:08:53 +10:00
Delyan Angelov
8b5573a6f3
errors: use more distinct and detailed name redefinition messages
2020-04-23 13:15:01 +03:00
joe-conigliaro
de182d5809
parser: use single scope for fn args/body
2020-04-22 21:15:38 +10:00
joe-conigliaro
80a4fbf0be
parser: anon fn arg scope fix
2020-04-22 21:11:58 +10:00
Kris Cherven
155891a4e0
parser: add unused variable warning
2020-04-22 01:52:56 +02:00
joe-conigliaro
abf5942433
parser/cgen: anon fn var & calling ( #4534 )
2020-04-21 13:23:36 +10:00
Alexander Medvednikov
ee2e83fef0
go back to `mut`. decisions, decisions...
2020-04-21 05:11:50 +02:00
Alexander Medvednikov
1bf094fbca
parser: mut in receivers
2020-04-21 05:07:49 +02:00
Enzo Baldisserri
57c142b993
checker: disallow pub in main
2020-04-19 00:07:57 +02:00
Tim Basel
73073cd954
parser: anonymous functions (part 1)
2020-04-17 21:59:19 +02:00
Alexander Medvednikov
06c1b9e95e
table/checker: verify private functions/methods
2020-04-17 17:16:14 +02:00
Alexander Medvednikov
714ff50322
fmt: use the new receiver syntax
2020-04-16 15:42:40 +02:00
Alexander Medvednikov
4b5acfd960
parser: (var x X) receiver syntax
2020-04-16 15:40:21 +02:00
Delyan Angelov
8a1248b2e7
builder: restore module import cycle detection/topological reorder
2020-04-16 12:29:36 +03:00
Abdullah Atta
6a186e8f11
jsgen: implement js backend
2020-04-15 23:16:49 +02:00
Alexander Medvednikov
da28bc7026
Revert "fmt: `(var f Foo)`"
...
This reverts commit 4b110756e0
.
2020-04-15 04:15:42 +02:00
Alexander Medvednikov
4b110756e0
fmt: `(var f Foo)`
2020-04-15 03:56:16 +02:00
Alexander Medvednikov
f34352faf9
fmt: use var instead of mut
2020-04-15 01:55:51 +02:00
Alexander Medvednikov
efaec8be8e
token/parser: var keyword
2020-04-15 01:45:27 +02:00
Alexander Medvednikov
233ae3f772
fmt: use `import module` syntax
2020-04-14 19:32:23 +02:00
Alexander Medvednikov
ec10831318
parser: `[]int{cap:cap, len:len}` syntax; minor fixes
2020-04-14 18:10:16 +02:00
Alexander Medvednikov
24958df565
parser: do not allow duplicate fns; cgen: move fn code to fn.v
2020-04-13 19:59:57 +02:00
Alexander Medvednikov
449d839684
checker: make sure functions return
2020-04-11 21:50:14 +02:00
Alexander Medvednikov
9422cd1009
parser: handle mut & receivers; fix checker_error_test
2020-04-11 02:24:00 +02:00
Alexander Medvednikov
f76931c01e
cache builtin modules
2020-04-10 18:11:43 +02:00
Daniel Däschle
c815f84722
parser: fix void assign check
2020-04-10 15:53:06 +03:00
Daniel Däschle
03c307a8c0
parser: fix struct name error
2020-04-08 19:08:54 +02:00
Daniel Däschle
0024ff848d
parser: check if the last or {} block expression is valid
...
These checks allows for:
a) `x := call() or { 'abc' }`
b) `x := call() or { panic('abc') }`
c) `x := call() or { exit(123) }`
d) `x := call() or { continue }`
e) `x := call() or { break }`
f) `x := call() or { return }`
... but produce errors for:
g) `x := call() or { println('an error') }` , etc.
2020-04-07 17:36:00 +03:00
Alexander Medvednikov
33644a4f91
cmd/v: fix `run`
2020-04-07 01:09:25 +02:00
Alexander Medvednikov
b7560fe4bf
parser: do not allow duplicate methods; builder: cleaning up
2020-04-07 01:02:48 +02:00
Delyan Angelov
b0567543c9
add support for errcode in or{} optional blocks.
2020-04-04 21:47:57 +03:00
Alexander Medvednikov
46aed151ab
parser: snake_case check; array: mutable array test
2020-04-04 14:09:58 +02:00
joe-conigliaro
c9e290b36f
table: simplify/generalise type fns & remove calls
2020-04-04 16:37:11 +11:00
joe-conigliaro
bf59828897
ast: const impl & global scope & objects
2020-04-04 14:14:40 +11:00
Alexander Medvednikov
91ffeeb73b
parser: fix `(x mut &X)`
2020-04-01 23:56:55 +02:00
Alexander Medvednikov
48832200bb
parser: allow types that start with &&; cgen: allow ++/-- exprs for now
2020-04-01 13:18:58 +02:00
Alexander Medvednikov
db59c621e8
v2: minor fixes
2020-03-27 08:47:02 +01:00
Joe Conigliaro
9a8bd3f7fa
checker: variadic method fix
2020-03-24 22:39:11 +11:00
Alexander Medvednikov
e5f6a0949f
cgen: autofree: first step
2020-03-21 19:52:19 +01:00
Joe Conigliaro
54c38e3e3a
parser: remove option from err var type
2020-03-18 20:00:33 +11:00
Joe Conigliaro
126ef0f5c2
checker/gen: add unchecked exprs & small fixes
2020-03-18 19:56:19 +11:00
Joe Conigliaro
50ed4004f4
ast/table: use common struct fn decl arguments
2020-03-15 09:21:36 +11:00
Joe Conigliaro
cc338df77f
parser/checker/gen: update call args to use ast.CallArg
2020-03-14 21:11:43 +11:00