Commit Graph

633 Commits (88988817d0bdd3c50160125fffecc060cd7d6acd)

Author SHA1 Message Date
Alexander Medvednikov 87d8e70d6d checker/table: generic fixes 2020-05-21 18:15:04 +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
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
Alexander Medvednikov 03525843a0 parser: do not allow calling private functions 2020-05-18 22:54:11 +02:00
Alexander Medvednikov d325cdba0d checker: fmt 2020-05-18 15:43:52 +02:00
Alexander Medvednikov 4f307c1a78 checker: requre & in struct init; http: chunked encoding 2020-05-18 05:11:00 +02:00
Swastik Baranwal d697b2848a
checker: more checks for in and !in 2020-05-17 17:03:32 +02:00
spaceface777 0def084932
checker: fix JS name regression 2020-05-17 16:23:09 +02:00
Alexander Medvednikov 5b15b8ccc9 checker: do not allow casting strings 2020-05-16 22:52:41 +02:00
Alexander Medvednikov 6e4ae5a5e6 checker: do not allow casting strings 2020-05-16 22:48:45 +02:00
Alexander Medvednikov 0845b2cfbe builder: skip warnings; pref: move pref creation to pref.v 2020-05-16 22:45:38 +02:00
Enzo Baldisserri f44a40eee0
checker: check incorrect names 2020-05-16 16:12:23 +02:00
Swastik Baranwal 37cf46d67a
checker: add more checks for modulo 2020-05-16 15:32:46 +02:00
Tanel Liiv 44502a3fb2
parser: return multi expr 2020-05-15 23:14:53 +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
Enzo Baldisserri fd0d833e33
gen: if expressions with multiple statements 2020-05-14 17:15:25 +02:00
yuyi 6d0b791ac8
parser: warning about unused imports 2020-05-14 17:14:24 +02:00
Alexander Medvednikov ab7bc760c6 cgen: new Option part 1 2020-05-13 21:59:08 +02:00
Enzo Baldisserri 1ca04e6113
checker: prevent interface instantiation 2020-05-13 19:20:15 +02:00
Alexander Medvednikov db5036686b checker: make `type is private` warning an errror 2020-05-13 14:21:52 +02:00
Alexander Medvednikov 3e6f7d3eb6 freetype: minor fixes 2020-05-13 00:50:46 +02:00
Alexander Medvednikov 7a5a4df4c6 checker: handle `println()` 2020-05-12 19:38:46 +02:00
yuyi 99b31d8241
parser: unified way to handle struct and enum name check 2020-05-12 13:39:32 +02:00
yuyi dea2658a80
checker: minor optimization in infix_expr 2020-05-11 23:50:13 +02:00
Alexander Medvednikov e9177faf17 checker: allow `*x = y` only inside unsafe blocks 2020-05-11 16:05:59 +02:00
Alexander Medvednikov 828f9af64c checker: fmt 2020-05-11 14:38:25 +02:00
Alexander Medvednikov 8a6820d1b7 checker: revert fmt for now 2020-05-11 14:32:41 +02:00
Alexander Medvednikov ce03761375 parser: fix mut args with the new syntax; checker: fmt 2020-05-11 14:16:20 +02:00
joe-conigliaro 2a40665919
ast/checker: cast no longer needed & use auto deref 2020-05-11 20:02:28 +10:00
Kris Cherven 3a3d00ac72
checker: prevent C error on const mutation 2020-05-11 11:09:58 +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
Alexey 71c2b26103
checker: fix checking uninitialized refs 2020-05-10 22:26:47 +02:00
joe-conigliaro a73660a4c3
checker/cgen: simplify assigning fn to var 2020-05-11 00:13:30 +10:00
Ned Palacios 5f0ad0f562
compiler: add output mode for errors and warnings, support for `-silent` flag 2020-05-10 12:26:57 +03:00
yuyi 85723e3799
checker: check for_in_map using one variable error 2020-05-10 02:28:43 +02:00
Alexander Medvednikov 10da871743 checker: handle unknown fields in fail_if_immutable 2020-05-10 02:07:15 +02:00
Alexander Medvednikov 09f6cd6a75 parser/checker: [ref_only] attribute 2020-05-09 23:45:41 +02:00
Alexander Medvednikov d7c4630d33 checker: make pub field check an error 2020-05-09 18:34:07 +02:00
yuyi 3eeef6203e
checker: check for map_init key duplicate 2020-05-09 16:55:38 +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
Sandro Martini 910a8934cb
checker: fix typo on error message and related test 2020-05-08 21:21:47 +03:00
Alexander Medvednikov 2f4fc86d58 checker: fix unknown var enum crash 2020-05-08 15:00:06 +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 78efe72c4c
checker: optimize check string cast error 2020-05-07 12:34:06 +02:00
Enzo Baldisserri 0f8ed84333
checker: verify interface is not used as receiver 2020-05-07 11:14:51 +03: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
Don Alfons Nisnoni e87289f24d
Fix typo on checker 2020-05-06 13:57:40 +03:00
Alexander Medvednikov b4c93349e8 checker: fix interface name check 2020-05-06 12:32:44 +02:00
Alexander Medvednikov cc66eb1194 parser/checker: check capital letters in interface names/methods 2020-05-06 12:26:00 +02:00
yuyi 51f3f31a4e
checker: check string(1) cast error 2020-05-06 12:05:24 +02:00
Enzo Baldisserri 215657e16a
checker: check interface implementation 2020-05-06 11:29:37 +02:00
yuyi b627bb933c
message: use uniform message reference format 2020-05-06 09:10:40 +03:00
Enzo Baldisserri c1f224640f
checker: verify that there is a main module 2020-05-06 00:09:46 +02:00
Tanel Liiv b16281d6e4
cgen: pass around functions 2020-05-05 16:21:21 +02:00
Alexander Medvednikov a0ca68ce3f checker: do not allow `string(int)` 2020-05-05 15:26:42 +02:00
Alexander Medvednikov ee92060d4d json: decode_array fix 2020-05-05 14:19:31 +02:00
Steve Phillips 081338b8bf
checker.v: suggest []Type{}, not []Type 2020-05-05 00:20:32 +02:00
Alexander Medvednikov 32a7bd3a48 parser/checker: do not allow using private types from other modules 2020-05-04 21:56:41 +02:00
Alexander Medvednikov 9aa1a65489 checker: check match condition 2020-05-04 21:03:18 +02:00
joe-conigliaro b2157388d9
checker: check method args 2020-05-05 01:32:40 +10:00
Alexander Medvednikov fd8a194df0 json: wrap up decode() 2020-05-04 16:46:39 +02:00
yuyi 90fc23ccfb
checker: fix array init []type{cap: x.len} error 2020-05-04 13:22:09 +02:00
Alexander Medvednikov de749e9d3b parser/cgen: interface <<; `any` type 2020-05-03 18:08:45 +02:00
Alexander Medvednikov 2a016d03ac checker: use `[]int` instead of `array_int` in errors 2020-05-03 16:49:05 +02:00
joe-conigliaro 8df7637853
checker: dont re match/cast with position() when already cast to sum type 2020-05-03 14:22:41 +10:00
Alexander Medvednikov b0018ed594 checker: better << error 2020-05-02 16:48:52 +02:00
Tanel Liiv 68ca8ab8a4
array: nested map() 2020-05-02 15:26:58 +02:00
joe-conigliaro a9a8539e41
checker: small fix in assign_stmt 2020-05-02 20:21:28 +10:00
joe-conigliaro fd925fbd05
checker: simplify assign_stmt & add better checks 2020-05-02 19:45:08 +10: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
Alexander Medvednikov 0b8a0d1640 checker: fix _ check 2020-05-01 12:22:39 +02:00
joe-conigliaro fb1c60c53d
checker: add back check struct field fn args 2020-05-01 20:12:21 +10:00
Alexander Medvednikov c1ee14cc3e json: decode() part 1 2020-05-01 12:02:31 +02:00
joe-conigliaro a0e662bef9
checker: remove debug println from selector_expr 2020-05-01 19:54:47 +10:00
joe-conigliaro 03904085c4
checker: check fn field exprs 2020-05-01 19:50:32 +10:00
Tanel Liiv 182e7071bf
array: map() function 2020-05-01 00:29:54 +02:00
Alexander Medvednikov f1903f3c1f parser: fix imported interfaces 2020-04-30 18:06:14 +02:00
yuyi 81ed6ad2a1
checker: check duplicate consts 2020-04-30 12:17:31 +02:00
yuyi 4d415e56d6
checker: check enum field name duplicate 2020-04-30 09:34:18 +02:00
yuyi c4f672454f
checker: check import duplicates 2020-04-30 09:33:12 +02:00
Henrixounez f6d74c8a37
checker: error on ternary if type mismatch 2020-04-30 09:32:29 +02:00
Alexander Medvednikov 51d0ce0222 tests: more interface tests; checker: handle zero selectorexpr type error 2020-04-29 12:46:09 +02:00
Henrixounez c500044bae
checker: unreachable code warning 2020-04-29 12:31:18 +02:00
Alexander Medvednikov 2fc05b814c all: interface arrays 2020-04-29 12:21:15 +02:00
Delyan Angelov bf8ed1815c builder: print collected checker warnings too 2020-04-29 12:38:43 +03:00
yuyi 117649f40d
checker: check devision by zero (int and float) 2020-04-29 10:07:27 +02:00
yuyi 2b48ce21df
checker: make sure `main` has no args and doesn't return 2020-04-29 09:19:46 +02:00
yuyi a9e33e712a
checker: check struct field name duplicate 2020-04-29 09:11:36 +02:00
Henrixounez 0afaef5818
checker: ambiguous function call error
* checker: ambiguous function call error

* checker: ambiguous function call error wording

* checker: ambiguous functions tests newline
2020-04-28 16:27:49 +03:00
Enzo Baldisserri 7bf8731778
checker: check variable mutability for postfix exprs 2020-04-28 11:20:19 +02:00
yuyi f2060d431e
checker: check division by zero 2020-04-28 09:52:01 +02:00
yuyi 28f5920bb0
cgen: fix `map` `fixed-array` .str() error 2020-04-28 07:22:46 +02:00
yuyi b20777df59
checker: main function called error 2020-04-28 07:21:50 +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 50a83736ff checker: struct init: handle C types 2020-04-26 19:59:03 +02:00
Alexander Medvednikov 8223efe9df checker: check struct field types 2020-04-26 18:38:29 +02:00
Alexander Medvednikov 83552a0d58 array: replace make() with the new init syntax 2020-04-26 17:52:27 +02:00
Enzo Baldisserri 0f2f97e3e5
checker: reorganize tests to match fmt tests 2020-04-26 12:34:42 +02:00
Alexander Medvednikov 270566055f checker: make sure all FnDecl types are valid 2020-04-26 10:39:26 +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
yuyi 3a59f5727c
checker: fix check main function error (#4601) 2020-04-26 08:04:28 +02:00
Enzo Baldisserri 0b3412cdb5
checker: check that type exists in TypeDecl 2020-04-26 06:40:54 +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
Enzo Baldisserri 3e68e429b6
checker: avert if else is unnecessary 2020-04-25 21:51:44 +02:00
Ruofan XU d86539c4f5
checker: clean up infix_expr 2020-04-25 20:28:49 +02:00
Alexander Medvednikov b7e5be41f5 checker/cgen: `as` fixes 2020-04-25 18:41:12 +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 7c080c5d4a checker: prevent `x := voidfn()` 2020-04-25 18:06:34 +03:00
Larpon 6a834c0528
checker: use 'mut' instead of 'var' in error message 2020-04-25 17:51:12 +03: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
Enzo Baldisserri a924defb94
checker: check `in` left type 2020-04-25 06:14:17 +02:00
Enzo Baldisserri fa4739794f
checker: fix "unnecessary `()`" error position 2020-04-24 20:27:18 +02:00
Enzo Baldisserri 323ca2b3bb
checker: check duplicates on match with no else
Refactor match duplication test to work even if there is not else, and to include every expression.
Add tests for duplicate expressions in match.
2020-04-24 17:04:39 +03:00
Delyan Angelov aa15dec660 checker: check default struct field expression types 2020-04-24 16:46:55 +03:00
Alexander Medvednikov d7ee4755c2 parser/cgen: interfaces (part 1) 2020-04-22 20:23:53 +02:00
joe-conigliaro 3ca4f5fada
checker/parser: anon fn call & return type fix 2020-04-22 18:41:57 +10:00
joe-conigliaro c1e8612624 checker/gen: allow vargs to be forwarded. fix/enable variadic test 2020-04-22 13:28:47 +10:00
Kris Cherven 155891a4e0
parser: add unused variable warning 2020-04-22 01:52:56 +02:00
yuyi a8dc0ccbcd
checker: add more op checks 2020-04-21 13:26:02 +02:00
joe-conigliaro abf5942433
parser/cgen: anon fn var & calling (#4534) 2020-04-21 13:23:36 +10: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
yuyi 07f69fab19
checker: remove dots from error messages 2020-04-20 11:57:07 +02:00
Alexander Medvednikov c1fc768c1b fmt: run on cmd/v; cgen: fix anonymous functions 2020-04-20 07:04:31 +02:00
yuyi be3bd520f6
checker: fix for in range type mismatch 2020-04-20 00:21:16 +02:00
Ruofan XU 5edd9cdc3a
checker: add type check for bit op 2020-04-19 22:29:45 +02:00
yuyi dbb81b89fd
checker: fix type mismatch of `in` array 2020-04-19 22:26:58 +02:00
Daniel Däschle b62bb22fa6
checker: allow C values in enum 2020-04-19 22:26:04 +02:00
Ruofan XU 6c59b306c7
checker: add type check for arithmetic assignment ops 2020-04-19 22:24:12 +02:00
Kris Cherven 95ae915c0c
checker/parser: fix outdated error messages 2020-04-19 20:46:48 +02:00
Enzo Baldisserri 57c142b993
checker: disallow pub in main 2020-04-19 00:07:57 +02:00
Tim Basel 86df486988
compiler: rename is_so to is_shared 2020-04-18 17:46:23 +02:00
Enzo Baldisserri 0f9322bf36
checker: print error and pos for lacking main or pub main 2020-04-18 00:20:38 +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
Kris Cherven 84ac634c31
checker: disallow pub fn main() 2020-04-17 20:30:43 +02:00
Alexander Medvednikov 4a556f72bb checker: allow calling private functions in tests 2020-04-17 17:18:40 +02:00
Alexander Medvednikov 06c1b9e95e table/checker: verify private functions/methods 2020-04-17 17:16:14 +02:00
Daniel Däschle af30bf939e
checker: fix return underlining 2020-04-17 16:16:56 +02:00
Daniel Däschle 402e55d115
ast: expr.Position; struct field refactoring 2020-04-17 02:38:39 +02:00
Alexander Medvednikov af224b4933 parser/cgen: is keyword 2020-04-16 15:32:14 +02:00
Delyan Angelov cc9828b481 checker: fix building of shared .so libs 2020-04-16 16:30:19 +03:00
Daniel Däschle 19723c927b
checker: move more checks from parser 2020-04-16 12:17:15 +02:00
Daniel Däschle 04db2d02b8
checker: move struct name check from parser to checker 2020-04-16 11:01:18 +02:00
Delyan Angelov 92129d760d checker: fix false positives for sumtype kind of matches 2020-04-16 00:32:56 +03:00
Abdullah Atta 6a186e8f11
jsgen: implement js backend 2020-04-15 23:16:49 +02:00
Daniel Däschle 27b6f30305
checker: move capital var check from parser to checker 2020-04-15 19:09:51 +02:00
joe-conigliaro fde83aff0b
checker/cgen: fix calling struct field with fn type 2020-04-15 04:28:18 +02:00
Alexander Medvednikov efaec8be8e token/parser: var keyword 2020-04-15 01:45:27 +02:00
Enzo Baldisserri 86402204a7
checker: fail if else isn't the last branch of match 2020-04-14 20:31:51 +02:00
Daniel Däschle 50871d1a92
checker: for in index type error position 2020-04-14 19:37:56 +02:00
Alexander Medvednikov ec10831318 parser: `[]int{cap:cap, len:len}` syntax; minor fixes 2020-04-14 18:10:16 +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 75603beeea
checker: match exhaustive as stmt and with enum 2020-04-14 15:12:26 +02:00
Alexander Medvednikov 5f1b88c2c4 checker: do not use !in for now 2020-04-14 04:14:02 +02:00
Alexander Medvednikov bbc35b1179 checker: check bool and string ops 2020-04-14 04:12:28 +02:00
Daniel Däschle 12e48c6fe2
checker: check match for exhaustion 2020-04-14 01:03:31 +02:00
Alexander Medvednikov 7aacf77262 checker: remove an extra fn check 2020-04-13 20:06:20 +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
Daniel Däschle a6100be8df
parser: fix position of array init
* parser: fix position of array init
* fix checker_error_test.v tests
2020-04-13 19:08:02 +03:00
Daniel Däschle 1a4113d245
checker: store errors in []Error 2020-04-13 01:56:01 +02:00
Alexander Medvednikov 810a0725ec tests: fix fmt tests 2020-04-12 17:49:31 +02:00
Alexander Medvednikov 0db0c642c3 vfmt: add missing imports automatically 2020-04-12 17:45:04 +02:00
Alexander Medvednikov 449d839684 checker: make sure functions return 2020-04-11 21:50:14 +02:00
Alexander Medvednikov 581d836de6 !in operator 2020-04-11 21:31:54 +02:00
Delyan Angelov 15f4594e44 msvc: fix self compile, by avoiding explicit casting to the same type 2020-04-11 13:35:41 +03:00
Alexander Medvednikov 053de0b8e3 checker: check variable mutability 2020-04-11 04:09:41 +02:00
Alexander Medvednikov 9422cd1009 parser: handle mut & receivers; fix checker_error_test 2020-04-11 02:24:00 +02:00
Alexander Medvednikov 8fbae86bb3 vfmt: skip skipped modules; add module test 2020-04-10 22:32:52 +02:00
Alexander Medvednikov b95a47b5a7 checker: check fn main(); vfmt: fix for{}, module and module comments 2020-04-10 22:27:54 +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 c815f84722
parser: fix void assign check 2020-04-10 15:53:06 +03:00
Daniel Däschle 42b3b19af4
checker: fix checker enum infix error 2020-04-10 15:44:01 +03:00
Daniel Däschle adb379dd63
parser: fix string position 2020-04-10 15:40:52 +03:00
Delyan Angelov 83dfc6b9b9 checker: add more checks for multivar assignments 2020-04-10 15:38:43 +03:00
Delyan Angelov 3573030b9b checker: fix error position for assignment expression 2020-04-10 15:14:05 +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
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
Alexander Medvednikov fa6aaad6df checker: handle `x := x` 2020-04-08 19:15:19 +02:00
Alexander Medvednikov 5ef5712e91 vfmt: do not generate a space if the comment is empty 2020-04-08 14:19:13 +02:00
Alexander Medvednikov eb78396307 parser: fix prefix precedence 2020-04-08 13:53:11 +02:00
Delyan Angelov ef19aa1de6 assert: fix line position, pretty print float literals and casts 2020-04-08 05:47:29 +03:00
Delyan Angelov b9ec1479e4 checker: allow again fallthrough in or{} blocks of option calls without assignment 2020-04-08 02:56:24 +03: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
Daniel Däschle fe0942043c
checker: check if BranchStmt is in a loop 2020-04-07 12:29:11 +02:00
lutherwenxu a8c92e6dff
checker: remove hack and enforce type checking 2020-04-07 03:27:06 +02:00
Alexander Medvednikov b7560fe4bf parser: do not allow duplicate methods; builder: cleaning up 2020-04-07 01:02:48 +02:00
Alexander Medvednikov 8d150d427a merge and simplify cmd/v and v.builder 2020-04-07 00:44:31 +02:00
Alexander Medvednikov d865fc26eb http: fix method_and_url_to_response definition 2020-04-06 17:42:47 +02:00
lutherwenxu e8b26b1b8d
checker: make struct_init check more robust 2020-04-06 17:39:52 +02:00
Alexander Medvednikov be014fcdd6 checker: << check; initial #flag os support 2020-04-06 02:05:11 +02:00
Alexander Medvednikov 852ec61b34 vfmt: fix single line if 2020-04-05 23:00:21 +02:00
Alexander Medvednikov ffe8452f02 vfmt: fix imports 2020-04-05 21:53:00 +02:00
Delyan Angelov b0567543c9 add support for errcode in or{} optional blocks. 2020-04-04 21:47:57 +03:00
Alexander Medvednikov 33b03449d5 tools: remove vnames.v for now 2020-04-04 16:39:08 +02:00
krischerven 1960c6f4cb
checker: make an error message less ambiguous 2020-04-04 15:36:12 +02:00
joe-conigliaro b4e5e36d4a
checker: var opt & temp `[]` & non array init error & bug notes 2020-04-04 22:32:16 +11:00
Alexey 5313a1401f
checker: show actual field name in warn message 2020-04-04 11:57:45 +02:00
joe-conigliaro 97d8633557
checker: constant cycle & test fix 2020-04-04 17:05:26 +11: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 1d2de44e19 cgen: fix print(ptr); checker: uninitialized reference error/warning 2020-04-03 20:17:53 +02:00
Delyan Angelov 31c4b1cda6 v2: compile vfmt again; consistent colored error messages 2020-04-03 18:42:22 +03:00
Alexander Medvednikov 52f096f5d9 cgen: `go xxx()` 2020-04-03 15:18:20 +02:00
Alexander Medvednikov 87a185ea9c checker: remove newlines after errors 2020-04-03 11:09:02 +02:00
Alexander Medvednikov 0dad1a89e6 checker: much less verbose error messages 2020-04-03 11:01:09 +02:00
Alexander Medvednikov 1d52847924 checker: error on an unknown ident 2020-04-03 10:52:48 +02:00
Alexander Medvednikov a25f47124d cgen: make array_set/map_set work with pointers 2020-04-03 10:41:01 +02: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 40fd924b15 parser: match must be exhaustive; cmd/v: one verbosity level, simpler version 2020-04-02 16:51:16 +02:00
krischerven dac304195e
cgen: print: support all the same functionality as println 2020-04-02 09:19:57 +02:00
Alexander Medvednikov 88d15c6611 gl, glfw, freetype fixes 2020-04-02 01:45:22 +02:00
Alexander Medvednikov 39434155f8 short struct init syntax 2020-04-01 23:23:20 +02:00
Alexander Medvednikov 3ef6436bef fix fmt2 test 2020-04-01 17:52:50 +02:00
Alexander Medvednikov 0de853a2ab v2: lots of minor test fixes 2020-04-01 17:14:21 +02:00
Alexander Medvednikov 43f72246aa checker: fix index type check 2020-03-31 17:51:16 +02:00
Alexander Medvednikov 9d630dff30 allow slicing of fixed size arrays 2020-03-31 16:48:00 +02:00
joe-conigliaro 3b621c0ce6
checker: make var_scope mutable 2020-03-31 15:41:14 +11:00
joe-conigliaro 602bc06bee
ast: use multi return optional for find_scope_and_var 2020-03-31 15:39:14 +11:00
joe-conigliaro 71ca553190
cgen: multi return/assign optionals 2020-03-31 15:34:59 +11:00
joe-conigliaro 3440d7edd8
ast: first step merging CallExpr & MethodCallExpr 2020-03-30 21:39:20 +11:00
Delyan Angelov a9724fd38d
v2: typeof() 2020-03-28 17:37:22 +01:00
Alexander Medvednikov 831be43740 checker: check ! operator 2020-03-28 14:38:16 +01:00
joe-conigliaro 718819eb7a
map/scope/checker: update just var type & ret zero in map.get3 2020-03-29 00:00:28 +11:00
Alexander Medvednikov 473d9fef55 checker: do not allow extra () in if conditions 2020-03-27 14:57:19 +01:00
Joe Conigliaro fd8bb2c95c tests: small array/struct test notes & tmp fix 2020-03-27 20:47:24 +11:00
Joe Conigliaro 7ce7151ad2 cgen: v2 compiles itself - defer stmt / if * in opt parens. 2020-03-27 17:21:22 +11:00
Alexander Medvednikov ed3e0c43bc cgen: for c in string; short struct init syntax fixes; 2020-03-26 17:03:14 +01:00
Alexander Medvednikov c71d36356b v2: optionals fixes 2020-03-26 14:58:11 +01:00
Joe Conigliaro 1d0f3abadf cgen/checker: variadic method call fix 2020-03-26 22:40:14 +11:00
Joe Conigliaro b1d15afe61 checker: array slice type 2020-03-26 22:04:24 +11:00
Alexander Medvednikov fc86269bc9 checker: array str fixes 2020-03-26 11:32:32 +01:00
Joe Conigliaro 9c6ac7cb71 cgen: fix variadics called with 0 vargs 2020-03-26 21:09:59 +11:00