Commit Graph

216 Commits (ce1215f507254365e2ce51aff820884182970ee6)

Author SHA1 Message Date
joe-conigliaro 9f76a7b250
parser: simplify unused vars & add loop/if vars etc 2020-04-27 23:16:31 +10:00
Alexander Medvednikov f23948010a parser: new array init syntax 2020-04-26 17:28:48 +02:00
Enzo Baldisserri c73d91a8fe
fmt: TypeDecl; format more files 2020-04-25 20:58:00 +02:00
yuyi c26e83f58a
array: fix fixed array errors 2020-04-25 18:26:38 +02:00
Enzo Baldisserri fb54a2635c
fmt: lots of fixes 2020-04-25 17:49:16 +02:00
Delyan Angelov a20bef65ba fmt: workaround a vfmt limitation preventing formatting of vlib/v/ast/ast.v 2020-04-25 17:34:42 +03:00
Delyan Angelov 9a19531909 compiler: add support for `[if myflag]` void fn/methods 2020-04-25 16:57:11 +03:00
Delyan Angelov adb8fb1dc6 comptime: fix custom -d flags and `$if x? {}`. Fixes ftp_test.v . 2020-04-23 17:52:44 +03:00
Alexander Medvednikov d7ee4755c2 parser/cgen: interfaces (part 1) 2020-04-22 20:23:53 +02:00
Ruofan XU cdb1b0344c
checker: improve type check for arithmetic assignment op and fix error pos 2020-04-20 20:56:05 +02:00
yuyi 717e26b45e
checker: more infix checks 2020-04-20 14:49:26 +02:00
Enzo Baldisserri 57c142b993
checker: disallow pub in main 2020-04-19 00:07:57 +02:00
Enzo Baldisserri f2be3d7ffb
checker: check that right `is` type exists 2020-04-18 00:19:33 +02:00
Tim Basel 73073cd954
parser: anonymous functions (part 1) 2020-04-17 21:59:19 +02:00
Daniel Däschle 402e55d115
ast: expr.Position; struct field refactoring 2020-04-17 02:38:39 +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
Delyan Angelov e947d5e8c8 checker: fully exhaustive matches for sumtypes and enums
Also change the vlib/v/checker/tests/inout/match_expr_else.out to reflex the
new error details.
2020-04-14 16:50:43 +03:00
Daniel Däschle 12e48c6fe2
checker: check match for exhaustion 2020-04-14 01:03:31 +02:00
Daniel Däschle 79dad0bca9
parser: fix enum default value in struct
* parser: fix enum default value in struct

* Add a test for the enum default values in structs.

* Fix compilation of vfmt.

* Run vfmt over enum_default_value_in_struct_test.v

* Cleanup spurious , in vfmt output for enum declarations

Co-authored-by: Delyan Angelov <delian66@gmail.com>
2020-04-12 13:35:54 +03:00
Alexander Medvednikov 053de0b8e3 checker: check variable mutability 2020-04-11 04:09:41 +02:00
Alexander Medvednikov 8fbae86bb3 vfmt: skip skipped modules; add module test 2020-04-10 22:32:52 +02:00
Delyan Angelov 217e6f3b8e checker/parser: allow for fixed array with sizes defined with a const 2020-04-10 22:01:22 +03:00
Alexander Medvednikov f76931c01e cache builtin modules 2020-04-10 18:11:43 +02:00
Daniel Däschle 42b3b19af4
checker: fix checker enum infix error 2020-04-10 15:44:01 +03:00
Daniel Däschle 0f11d883fa
checker: fix error messages and add checker tests
* checker: fix error messages
* tests: fix command and ignore defect output
2020-04-10 11:59:07 +03:00
Delyan Angelov 7d564e9791 cgen: skip inc generation for ForCStmt, when empty in the v source 2020-04-10 10:00:14 +03:00
Daniel Däschle 32550c6d69
scanner: even better error messages 2020-04-10 00:09:34 +02:00
Daniel Däschle 320fad49c5
checker: check enum 2020-04-09 19:23:49 +02:00
Alexander Medvednikov f508955b64 vfmt: fix mod.Type; run vfmt on ast.v 2020-04-09 15:33:46 +02:00
Delyan Angelov ef19aa1de6 assert: fix line position, pretty print float literals and casts 2020-04-08 05:47:29 +03:00
Alexander Medvednikov 7ff0c3aaa9 cgen/parser: fix unions 2020-04-08 01:20:55 +02:00
Alexander Medvednikov 6bbd1943dd cgen: fix &string cast; vfmt fixes 2020-04-07 18:51:44 +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 8f9a8e1e7f vfmt: small fixes + run on checker.v and fmt.v 2020-04-07 15:15:49 +02:00
Alexander Medvednikov 35fbac8d56 parser/cgen: default struct field values 2020-04-06 14:45:48 +02:00
Alexander Medvednikov e464c4acc5 vfmt: more fixes + run on cgen.v 2020-04-05 18:03:36 +02:00
Alexander Medvednikov df45932c03 vfmt: fix same line stmt comments 2020-04-05 16:38:33 +02:00
lydiandy 35fab2bb7b
ast: pub interface field 2020-04-05 12:31:39 +02:00
Alexander Medvednikov de701ccfac fmt: struct field comments on the same line 2020-04-05 12:25:39 +02:00
Alexander Medvednikov 97db4c0e9a vfmt: comments and other fixes 2020-04-05 02:08:13 +02:00
joe-conigliaro bf59828897
ast: const impl & global scope & objects 2020-04-04 14:14:40 +11:00
Alexander Medvednikov 52f096f5d9 cgen: `go xxx()` 2020-04-03 15:18:20 +02:00
Alexander Medvednikov a25f47124d cgen: make array_set/map_set work with pointers 2020-04-03 10:41:01 +02:00
Delyan Angelov 6b9bf8cbf7 v2: fixes for most of vlib/builtin/map_test.v . 2020-04-03 00:42:08 +03:00
Delyan Angelov 07c53b1b70 v2: report ill defined consts by name/line, not only how many they are 2020-04-02 22:33:36 +03:00
hazohelet 0e6fe0a4f2
V: fix const bugs and pass const_test.v (#4206)
* fix const bug in v2

* v2: fix const decl

* small comment fix
2020-04-02 19:39:17 +02:00
Alexander Medvednikov fb4b93dfc0 ci fixes 2020-04-02 00:10:11 +02:00
Alexander Medvednikov e3713de41d fix compilation 2020-04-01 17:17:35 +02:00
Alexander Medvednikov 0de853a2ab v2: lots of minor test fixes 2020-04-01 17:14:21 +02:00