Commit Graph

313 Commits (2376b343ba214085b2a657c616515569572f0da1)

Author SHA1 Message Date
Delyan Angelov e9fa53b0c1
v.parser: let fn_decl use 1 loop, instead of multiple p.attrs.contains calls 2021-05-23 16:54:12 +03:00
Delyan Angelov bf3af40f13
v.markused: support `./v -skip-unused -freestanding run vlib/os/bare/bare_example_linux.v` too 2021-05-23 16:25:34 +03:00
Uwe Krüger d26ac5692e
all: various fixes for [heap]/auto-heap handling (#10033) 2021-05-07 15:58:48 +03:00
Delyan Angelov ea74e2bc64
v.parser: add p.unique_prefix, add run_project_folders_test.v (closes #10023) 2021-05-06 21:14:19 +03:00
yuyi ae22967d1d
parser: ensure generic function declaration specifies type names (fix #9959) (#9967) 2021-05-02 19:30:39 +03:00
yuyi d236d6a473
parser, cgen: fix generics fn typeof name (fix #7357) (#9939) 2021-04-30 13:40:36 +03:00
yuyi 25d9272c84
all: rename `table.register_fn_generic_types` to `table.register_fn_concrete_types` (#9914) 2021-04-29 09:06:50 +03:00
yuyi 212b4fa089
parser: implement infering generic type parameters from receiver types (fix #5862) (#9870) 2021-04-26 10:56:08 +03:00
spaceface 9d68f924c3
parser: don't disallow closures in the JS backend (#9884) 2021-04-26 10:00:39 +03:00
Uwe Krüger 3c0a368af3
all: automatically move (some) referenced objects to heap (#9873) 2021-04-25 21:40:38 +03:00
yuyi 8ccdae6188
all: cleanup generics call_expr (#9856) 2021-04-24 09:44:15 +03:00
Enzo af8ef12990
ast: use `AttrKind` (#9845) 2021-04-23 15:51:52 +03:00
yuyi 51258923d7
checker: fix generics call with reference arg (fix #9817 #9818) (#9830) 2021-04-21 06:40:11 +03:00
yuyi 953057ef35
parser: check generic receiver method decl has no generic names (fix parts of #9811) (#9819) 2021-04-20 21:38:17 +03:00
yuyi 466dc4540b
all: minor cleanup of generics (#9744) 2021-04-15 11:00:23 +03:00
yuyi a2a18ef92c
v: simplify handling of function generic parameters (#9673) 2021-04-11 09:02:57 +03:00
Ned Palacios a706215e52
ast, parser: add type_pos to TypeDecl nodes (#9571) 2021-04-09 14:51:25 +03:00
Uwe Krüger 84fa1ae444
boehm-gc: support a `[keep_args_alive]` tag for C functions (#9641) 2021-04-09 13:13:49 +03:00
Ned Palacios 07b1dc66dd
ast, parser: add additional pos info for FnDecl and InterfaceDecl nodes (#9603) 2021-04-05 18:14:21 +03:00
Alexander Medvednikov 7385f8e56b all: a massive merge of ast and table modules 2021-04-02 01:57:09 +03:00
Alexander Medvednikov 6f318be96c checker: do not allow nil sum types init 2021-03-31 11:13:52 +03:00
Ned Palacios 3ced970b17
ast, parser: add additional info for CallExpr, StructInit nodes (#9526) 2021-03-30 09:43:17 +02:00
Delyan Angelov 87494fad1d
parser: allow passing `mut a AliasOfPointerType` 2021-03-26 13:38:16 +02:00
yuyi cf6faaf215
parser: fix anon_fn with array arguments (#9414) 2021-03-22 03:22:29 +01:00
yuyi a6c2c5ba88
parser: minor cleanup in call_args() (#9344) 2021-03-18 15:06:48 +02:00
Delyan Angelov db46ad5481
v.parser: fix `xxx.fncall(map{x: []string{}})` treatment as `[]xxx.string{}` 2021-03-18 11:07:25 +02:00
Enzo 4b6244c9c1
gen: fix generic variadic (#9333) 2021-03-17 00:18:43 +02:00
yuyi 945769a4f6
all: implement reference receiver optimization for big structs (#9268) 2021-03-14 18:11:21 +01:00
Nick Treleaven 3be78d6777
parser: require anonymous fn to use `_` for unused parameters (#9262)
Fixes a C error with gcc.
2021-03-12 14:17:37 +02:00
Delyan Angelov 64bc2fb40a
v: fix `[if debug] fn abc(){} ... abc()` 2021-03-07 12:05:07 +02:00
Delyan Angelov 0f042124cb
tests: support `fn test_fn() ? { opt()? }` 2021-03-05 14:18:21 +02:00
Joe Conigliaro a50f2ca5e8
interfaces: error on implemention of own interface method & on duplicate normal methods 2021-03-03 15:02:10 +11:00
Nick Treleaven dc04c3196b
builder: fix detecting duplicate functions (#9033) 2021-03-01 21:38:31 +01:00
spaceface b9a381f101
all: migrate to the new Option (p. 1) (#8924) 2021-02-28 22:24:29 +03:00
Delyan Angelov bdce35fd9c
parser: support `static x := 42` in [unsafe] functions too 2021-02-28 14:32:46 +02:00
Delyan Angelov 1c0eefae38
parser/scanner: replace p.peek_tok2/3 with p.peek_token(2/3) (#8946) 2021-02-24 21:03:53 +03:00
yuyi c704a49283
parser: fix error of $tmpl in anon_fn (fix #8847) (#8849) 2021-02-20 18:51:08 +02:00
yuyi 783cee98d9
table/parser: minor optimization of anon_fn names (#8851) 2021-02-20 15:54:47 +02:00
Delyan Angelov bf6e9ff95a
Revert "parser: make duplicated functions an error (#8792)"
This reverts commit 21bf8fe14e.
2021-02-18 09:02:56 +02:00
zakuro 21bf8fe14e
parser: make duplicated functions an error (#8792) 2021-02-17 20:50:10 +01:00
zakuro 70a30374b9
parser: cleanup fn_decl (#8700) 2021-02-15 17:55:08 +02:00
Nick Treleaven 82650ee813
parser: fix parsing attribute after fn prototype with no return type (#8727) 2021-02-14 08:05:20 +01:00
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