Commit Graph

271 Commits (e4f15605c07b90ff07343902c46f20a804996e89)

Author SHA1 Message Date
yuyi 3164e29651
all: fix fn_or_for_in mut value (part 1) (#8671) 2021-02-12 02:03:11 +02:00
Nick Treleaven d37fb5641f
parser: improve printing of unexpected tokens (#8654) 2021-02-09 17:07:30 +02:00
Lukas Neubert cb1f63f765
parser: replace eat_line_end_comments() with configurable eat_comments() (#8636) 2021-02-08 18:16:02 +02:00
Swastik Baranwal e2ff26a066
cgen: fix gen of .sort method for `>` operator and improve grammar of error (#8615) 2021-02-08 17:19:54 +02:00
Lukas Neubert 7f4c582f1a
fmt: unwrap long infix exprs inside parenthesis if necessary (#8609) 2021-02-07 23:10:39 +01:00
Nick Treleaven f5f65f929f
parser: parse `map{key_expr: val_expr}` (#8608) 2021-02-06 22:13:24 +01:00
Uwe Krüger 5343f1374b
all: allow functions to return `shared` object (#8606) 2021-02-06 19:41:52 +01:00
Alexander Medvednikov fdd8c86fdb parser: make sure methods have names 2021-02-04 22:15:16 +01:00
Nick Treleaven de37b52d4b
checker: check goto label exists (#8523) 2021-02-03 15:20:10 +01:00
Swastik Baranwal 7ec116d588
all: only allow defining `==` and `<` and auto generate `!=`, `>`, `>=` and `<=` (#8520) 2021-02-03 15:18:38 +01:00
Lukas Neubert ea06966fd4
fmt: hide ´[]Type{} instead of []Type´ and ´(f mut Foo)´ warnings (#8528) 2021-02-03 11:25:08 +02:00
Alexander Medvednikov 36e75e5208 Revert "parser: fix panic when single letter receiver parsed (#8381)"
This reverts commit 93b0d8ca64.
2021-01-28 10:59:04 +01:00
Daniel Däschle 93b0d8ca64
parser: fix panic when single letter receiver parsed (#8381) 2021-01-28 10:56:43 +01:00
Nick Treleaven 58a76344cb
checker: avoid SelectorExpr filter on Ident unless it's a generic type name (#8357) 2021-01-27 13:52:52 +01:00
zakuro 3959ba5751
checker: make a calling no-body function a checker error (#8265) 2021-01-26 11:19:48 +01:00
Lukas Neubert 8b61891348
fmt: smarter if condition wrapping (#8201) 2021-01-23 10:33:22 +02:00
Daniel Däschle 500ebf77e4
all: implement multiple generics (#8231) 2021-01-22 13:49:56 +01:00
Nick Treleaven 72168cd6bc
parser: support `mut:` section in the interface methods, and a mut interface fn modifier (#8092) 2021-01-22 10:02:28 +02:00
zakuro 1b09954622
parser: improve the position of mut receiver warning / error (#8240) 2021-01-22 09:38:37 +02:00
zakuro 522d875489
checker: make it an error, to use ident outside of anon fn (#8232) 2021-01-22 09:24:49 +02:00
zakuro 0c249fa040
parser: improve anon fn pos (#8210) 2021-01-21 11:01:40 +01:00
joe-conigliaro 97ebecc5f4
usecache: get all tests running with -usecache enabled by default (p.1) (#7699) 2021-01-20 06:04:59 +01:00
Tim Basel 129eee346b
fmt: keep single empty lines (#8189) 2021-01-19 14:49:40 +01:00
Lukas Neubert ac2c3847af
all: update copyright to 2019-2021 (#8029) 2021-01-18 13:20:06 +01:00
Nick Treleaven 5185a59ac7
parser: use Parser.builtin_mod instead of checking p.mod (#8137) 2021-01-17 05:31:41 +01:00
Nick Treleaven 8ee67d1c1c
parser: disallow indexing on next line at top-level (#8128) 2021-01-17 05:30:41 +01:00
Swastik Baranwal ef627c9d21
checker: improve message and positioning for operator overloading (#8133) 2021-01-17 03:37:44 +01:00
Daniel Däschle 53941c4a0a
fmt: fix if cond break readability (#8132) 2021-01-16 02:12:17 +01:00
zakuro 47536df2d0
table: remove nr_dims from Array (#8053) 2021-01-13 23:43:19 +01:00
Ruofan XU 245ed9160a
gen: fix `mut arr [3]int` as a fn argument (#8085) 2021-01-13 15:52:46 +02:00
Swastik Baranwal 1f5255c2bb
cgen: implement `>=` and `<=` (#7991) 2021-01-10 12:24:46 +02:00
Daniel Däschle a8dd13f086
parser: change array decompose syntax (#7965) 2021-01-09 22:48:23 +01:00
Lukas Neubert e79695e8fc
fmt: keep comments after call_expr in vscript (#7990) 2021-01-09 22:47:33 +01:00
Delyan Angelov 46a5c487c1
parser,fmt: implement `[manualfree] module abc` for opting out *all* fns in a given .v from autofree 2021-01-08 17:24:42 +02:00
Delyan Angelov 083dc23db8
gen: implement a `[manualfree]` tag, for functions, that want to do their own memory management 2021-01-08 16:22:27 +02:00
Nick Treleaven c0e56d10c3
parser: add errors for invalid anonymous function (#7786) 2021-01-05 01:32:24 +01:00
Swastik Baranwal 9033099676
cgen: implement overriding of `!=` and `==` (#7837) 2021-01-03 16:19:02 +01:00
zakuro 6bd35505a2
parser: fix error when using imported types in short fn signature (#7795) 2021-01-02 15:09:54 +02:00
Swastik Baranwal 24b18f05c4
cgen: implement > and < for structs (#7774) 2021-01-01 14:54:32 +01:00
yuyi c3dafad7ef
generics: implement method generics (fix #7638) (#7732) 2020-12-31 18:00:22 +01:00
Daniel Däschle 3ee3c8b3ed
parser: proper error on fn decl in script mode (#7680) 2020-12-30 21:18:36 +02:00
joe-conigliaro 02965e753e
all: re-implement variadics using arrays & implement array decomposition to varg (#7689) 2020-12-29 16:14:08 +01:00
Lukas Neubert 2360762a42
fmt: fix unexpected `comment`, expecting struct key for trailing arg syntax (#7658) 2020-12-28 20:26:24 +02:00
Lukas Neubert 06fdf34214
fmt: unwrap long single line ifs (#7608) 2020-12-27 14:20:30 +01:00
Lukas Neubert 0caf668e73
parser: error if operators are used as function names (#7532) 2020-12-24 13:38:11 +02:00
yuyi 7b9756be72
parser: check for builtin function redefinitions (fix #7499) (#7507) 2020-12-23 18:17:09 +02:00
Delyan Angelov 2c4a51a596 parser: use `v fmt -w "$p.scanner.file_path"` in warns, easing fixing 2020-12-23 14:17:20 +02:00
Lukas Neubert d1fc65c260
parser: add information about the ending line for a few elements (#7414) 2020-12-22 14:45:12 +01:00
Alexander Medvednikov 1f74f83bc6 parser: map or block; checker: require ref field init 2020-12-19 10:28:17 +01:00
joe-conigliaro 0aa9f5a007
all: optimize scope usage in checker & parser. store scope in ast nodes (#7281) 2020-12-12 19:01:12 +11:00