Commit Graph

1576 Commits (d24dce8eb33d60395e8dd8326bbfd0e81a0bcf7b)

Author SHA1 Message Date
Leo Developer 8a8a0932f7
all: add limit to accumulated errors / warnings (#11183) 2021-08-14 19:49:21 +03:00
Delyan Angelov deb26b92b9
cgen: support `typeof(x).idx`, as well as `iface.type_idx()` (#11178) 2021-08-14 17:22:25 +03:00
Delyan Angelov 900c37aa65
v.gen.c: support `T.typ` - an int for the type index of the generic type `T` (#11175) 2021-08-14 08:48:25 +03:00
Daniel Däschle 6dbc6f233b
v.parser: add checks for interoperability (C. or JS.) function declarations (#11140) 2021-08-12 10:47:24 +03:00
yuyi 89a8854e57
v.parser: fix generics type name in if_expr (#11156) 2021-08-12 10:19:06 +03:00
Enzo da53f818df
all: initial support for closures (x64 / linux-only) (#11114) 2021-08-10 21:27:15 +03:00
yuyi 1d3786ff1e
v.parser: fix `if a == Abc{} {` (#11092) 2021-08-07 18:05:22 +03:00
Daniel Däschle 8d2567740b
parser: make [..] work (#11064) 2021-08-06 03:54:24 +03:00
Daniel Däschle f59119485a
v.parser: add check for existing type on sum type declaration (#11054) 2021-08-04 18:14:16 +03:00
yuyi 5162c257a2
v.parser: minor cleanup in parse_type.v (#11047) 2021-08-04 12:49:36 +03:00
Daniel Däschle 800c0e5092
vlib: remove deprecated map{} usages as well as deprecated functions (#11035) 2021-08-04 12:44:41 +03:00
Daniel Däschle 815c4b7420
all: rename generic_struct_inst to generic_inst (#11044) 2021-08-04 03:37:27 +03:00
Florian Blasius 69f31d8d5c
checker: check int literal to enum cast (fix #10125) (#10348) 2021-08-02 07:12:29 +03:00
Uwe Krüger 6068777e03
parser/checker: deduce type of global from initialization expression (#11005) 2021-07-31 16:35:19 +03:00
Uwe Krüger 08aa6c08f6
all: more improvements for global variables (#10986) 2021-07-29 10:57:31 +03:00
yuyi cb7be87d4e
parser: fix struct init and assign using `sql` variable (#10968) 2021-07-26 21:14:31 +03:00
zakuro 3979e5c5ff
v.parser: show better position for sort struct init warning (#10939) 2021-07-24 20:41:59 +03:00
Uwe Krüger 1e5627e777
parser: don't require unary `>` prefix for `select` timeout (#10928) 2021-07-23 23:24:27 +03:00
shadow fe5e3c452f
parser: disable generic type aliases (#10917) 2021-07-23 01:17:16 +03:00
Lukas Neubert 38100faecf
fmt, parser: fix pos.last_line for assembly blocks (#10877) 2021-07-21 11:48:12 +03:00
Daniel Däschle ad3835b598
parser: deprecate short struct init (#10842) 2021-07-20 11:17:08 +03:00
Daniel Däschle 9127e202d5
v.parser: fix error on empty name expr (#10860) 2021-07-19 17:09:51 +03:00
playX 425ca5e3c3
v.gen.js: add three backend options for JS, and comptime if support (#10859) 2021-07-19 15:55:03 +03:00
yuyi a5c784830b
all: simplify global_scope processing (#10848) 2021-07-18 15:29:34 +03:00
Delyan Angelov 6edfb2c7fe
v.parser: eliminate PrefixExpr from `&Type(x).name` and `&Type(x)[idx]` too (fix vinix build) 2021-07-17 20:20:20 +03:00
Delyan Angelov fc8a8e3b6f
ci: fix failure for function_stored_in_global.vv 2021-07-17 18:19:20 +03:00
Delyan Angelov 568aa742b2
v.parser: improve conditions for debugging ast.CastExpr parsing 2021-07-17 17:49:29 +03:00
yuyi 3a0fa550b6
checker: fix generics fn inferring map type (fix #10835) (#10839) 2021-07-17 17:49:21 +03:00
yuyi fe64346ae2
parser: minor optimization of array filtering judgement (#10821) 2021-07-16 12:00:37 +03:00
yuyi aca66d503d
parser: minor optimization in call_expr() (#10809) 2021-07-15 17:47:59 +03:00
spaceface 6e942bf4c2
v: initial support for generic interfaces and sumtypes (#10795) 2021-07-15 08:29:13 +03:00
Delyan Angelov bd0653abab
parser: cleanup `&Type(x)` more, add fmt regression test 2021-07-13 13:12:37 +03:00
crthpl 5089eb4a84
parser: fix pointer cast expressions hack (#10777) 2021-07-13 12:01:24 +03:00
shadowninja55 d1f1c5ae51
v doc: add attribute tags to `v doc -f html` (#10778) 2021-07-13 08:27:20 +03:00
yuyi 581280e6fc
parser: cleanup check_cross_variables() (#10754) 2021-07-12 12:10:42 +03:00
yuyi 938e9b61b5
parser: check undefined variables in assign_stmt (#10755) 2021-07-11 19:09:35 +03:00
yuyi 71e8237483
parser: check undefined variables in array inits (#10746) 2021-07-11 03:49:07 +03:00
Louis Schmieder eb96ad11d9
checker: add pkgconfig to comptime if (#10692) 2021-07-09 18:17:04 +03:00
crthpl d14de5fdaf
all: fix generic functions with pointer args (#10686) 2021-07-07 11:51:05 +03:00
Alexander Medvednikov 0f72bc9819 parser: temporary [c2v_variadic] fn attr for c2v'ed code 2021-07-05 11:32:15 +03:00
Delyan Angelov 972542d6ee
checker: `[noreturn]` part 2 (cleanup) (#10667) 2021-07-05 05:05:37 +03:00
Delyan Angelov 6aecda3be8
all: support `[noreturn] fn abc() { for{} }`, mark panic/1 and exit/1with it too. (#10654) 2021-07-04 20:24:19 +03:00
yuyi 2bcc733ff6
v.parser: rename pratt.v to expr.v (#10566) 2021-06-28 19:35:06 +03:00
shadowninja55 06a6a8e199
checker: check for empty branches in match expressions (#10593) 2021-06-28 19:32:28 +03:00
shadowninja55 2e5ed08558
v.parser: allow anonymous function to return a function (#10592) 2021-06-28 11:51:24 +03:00
shadowninja55 830cf4645c
v.parser: prohibit registering selectively imported (structs / enums / aliases / interfaces) (#10579) 2021-06-28 10:26:09 +03:00
shadowninja55 9b84faad6f
v.parser: prohibit redeclaration of imported functions (#10564) 2021-06-25 14:27:58 +03:00
shadowninja55 be8be3d319
v.parser: prohibit redeclaration of builtin types (#10563) 2021-06-25 13:08:56 +03:00
crthpl 500b48788e
parser, cgen: fix basic asm registers, fix numbered labels in addressing, support indirect branching (#10545) 2021-06-23 14:20:07 +03:00
Yuriy Zymlex 6736817bba
parser: fix `rewind_scanner_to_current_token_in_new_mode` (#10495) 2021-06-22 20:17:36 +03:00
Delyan Angelov 79df7f51c3
v: deprecate `[if ident]` in favour of `[if ident ?]` 2021-06-22 10:30:14 +03:00
Uwe Krüger f32a76b268
all: promote value type function arguments to heap if necessary (#10528) 2021-06-20 18:40:24 +03:00
Delyan Angelov d56ae2d508
v.fmt: keep comments after struct embeds 2021-06-18 18:42:05 +03:00
Delyan Angelov 9f6ddb4c21
v.fmt: add an independent Comment.is_inline flag. Use it for fixing `[ .. //x ]` => `[ .. //x, ]` 2021-06-18 15:52:31 +03:00
crthpl 4abb1a8b7b
cgen: fix unknown labels in addressing (#10503) 2021-06-18 13:03:38 +03:00
crthpl 4688c75389
cgen, parser: fix several assembly bugs (#10498) 2021-06-18 01:20:46 +03:00
Delyan Angelov 39e7290416
v: support for `[if expr]`, part 2 (old `[if ident]` is not yet deprecated) 2021-06-17 18:55:20 +03:00
yuyi c58b04bcbf
checker: implement if smartcast multi conds (part 2) (#10487) 2021-06-17 12:27:31 +03:00
Delyan Angelov c2a7a84c72
v.parser: support for [if expr], part 1
Enables bootstrapping.
Supports the new [if x?] syntax, without using it.
2021-06-17 10:31:44 +03:00
Emily Hudson 535dcac8fa
net: ipv6 support, merge unix+ip;[pack:x] attribute (#9904) 2021-06-13 23:53:38 +03:00
Uwe Krüger 2ac39d9112
all: new function `isreftype(T)` to know if `T` contains pointers (#10438) 2021-06-13 06:26:13 +03:00
Uwe Krüger 6acf32b869
v.parser: prepare for splitting of `map.v` (#10432) 2021-06-12 17:01:37 +03:00
Uwe Krüger daeeaef030
vfmt: hot fix to allow separate `array_d_gcboehm_opt.v` (#10413) 2021-06-11 12:00:18 +03:00
crthpl 6576d876fc
cgen: support a `[_naked]` fn attribute (#10418) 2021-06-11 11:03:39 +03:00
Delyan Angelov 3dc4d13160
v.parser: do not treat test_ functions specially outside of _test.v files 2021-06-08 23:01:49 +03:00
yuyi 114c382c46
parser: fix generic fn typeof name (#10363) 2021-06-06 17:40:13 +03:00
Lukas Neubert 3f00ff465b
checker: check or block inside println calls (#10354) 2021-06-05 23:01:58 +03:00
crthpl 9553c5a4e6
parser: fix multiple output modifiers in asm (#10347) 2021-06-04 23:18:11 +03:00
Ehsan Afzali 672bb6ca7f
parser: fix required function members in struct (#10299) 2021-06-03 02:55:58 +03:00
yuyi 1747e546bf
parser, checker: check assert optional (#10319) 2021-06-02 20:38:26 +03:00
Wertzui123 148bb31f6e
v.parser: allow for `if x { $if y {} } else {}`, fix #10243 (#10294) 2021-06-01 12:19:39 +03:00
Uwe Krüger d39a55ac11
checker: forbid leaving function from inside `defer` block (#10285) 2021-05-31 17:09:57 +03:00
Louis Schmieder 38796521fa
all: allow defer use from other scope (#10284) 2021-05-31 14:43:44 +03:00
Lukas Neubert 6b683d31ac
v.parser: support imported enums as map keys (#10234) 2021-05-28 20:09:03 +03:00
Alexander Medvednikov ca8158ac41 parser: handle casts in match expressions; c2v: minor fixes 2021-05-28 17:59:43 +03:00
Delyan Angelov 2b62dca000
v: support for `$if threads {}, depending on whether `go ` was used at all (#10227) 2021-05-27 18:36:07 +03:00
zakuro 607dbd36d7
parser: set is_public of TypeSymbol for fn type decl (#10212) 2021-05-27 10:17:08 +03:00
R cqls 5b8402bccb
parser: fix mod_path_to_full_name to be compliant with --path option (#10149) 2021-05-25 07:46:40 +03:00
Delyan Angelov 13d1d28db1
v.parser: fix -autofree for script mode programs that do not have explicit `fn main(){}` 2021-05-24 14:42:09 +03:00
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
Delyan Angelov bc01de2181
ast: mark ast.File{} with `[heap]`, and use []&ast.File consistently 2021-05-22 19:06:55 +03:00
Delyan Angelov e512caf8f5
vfmt: do not error on `field [fsize]Type`, where `fsize` is from another .v file 2021-05-22 16:42:38 +03:00
Lukas Neubert be189e0059
fmt: keep generics for selective import as fn param (#10138) 2021-05-19 21:25:02 +03:00
crthpl 0d44c8857e
checker: fix position of unknown type errors (#10110) 2021-05-16 04:51:23 +03:00
Uwe Krüger 7bfd89567b
shared: support `lock` on SelectorExpression (#10105) 2021-05-15 04:34:27 +03:00
Delyan Angelov 20a22453cf
v.builder: remove default link flags -lm, -ldl, -lpthread (use module specific link flags instead) (#10099) 2021-05-14 14:28:53 +03:00
crthpl 4273a9697e
parser: add support for flags in asm output constraints (#10103) 2021-05-14 12:01:15 +03:00
crthpl 8361f714dd
cgen: fix deadlock when returning/breaking in `lock` (#10079) 2021-05-12 11:44:47 +03:00
Alexander Medvednikov 72a135c7c5 vweb: update vweb_test_server.v 2021-05-11 09:52:08 +03:00
Louis Schmieder 23513ae35c
v.parser: fix vfmt eating the file name in `$tmpl('non_existant_file')` (#10056) 2021-05-08 21:11:13 +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 13ea92a77d
ci: use hash.fnv1a.sum64_string instead of hash.sum64_string in Parser.set_path (fix sanitize jobs) 2021-05-07 11:20:13 +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
zakuro 8c44873674
fmt,parser: prevent unknown module error (#10004) 2021-05-05 14:09:30 +03:00
Lukas Neubert 9e717e02c9
parser, fmt: prevent error with comment after expr inside match (#9995) 2021-05-04 18:26:10 +03:00
zakuro 1e856c0f94
parser: improve error message for `mod.unknownsubmod.Type` (#9976) 2021-05-04 11:31:31 +03:00
Enzo 106cd384da
parser: remove obsolete exceptions (#9987) 2021-05-03 17:35:09 +03:00
yuyi ae22967d1d
parser: ensure generic function declaration specifies type names (fix #9959) (#9967) 2021-05-02 19:30:39 +03:00
Delyan Angelov 4b818fa2be
v: implement interface embedding (#9935) 2021-05-02 03:00:47 +03:00
Alexander Medvednikov e949d4b26c tools/fast: add "V lines" and "V lines/s" 2021-04-30 15:31:50 +03:00
yuyi d236d6a473
parser, cgen: fix generics fn typeof name (fix #7357) (#9939) 2021-04-30 13:40:36 +03:00
Lukas Neubert b406de20df
parser, vfmt: multi line comments are not treated as follow-up comments anymore (#9892) 2021-04-29 09:48:08 +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
crthpl 6945f987cf
checker: fix sumtype comparison and sumtype in itself (#9917) 2021-04-29 09:04:02 +03:00
Lukas Neubert a065d014a2
fmt: keep constant sizes in struct field fixed array types (#9910) 2021-04-28 22:11:15 +03:00
ka-weihe 3edbf71770
parser: fix maps with aliases as key (#9900) 2021-04-28 07:45:21 +03:00
Enzo 4f246222b0
v: replace `--enable-globals` with `-enable-globals` (#9898) 2021-04-28 07:44:28 +03:00
Louis Schmieder faf2656335
orm: support multiline statements (#9888) 2021-04-27 15:28:57 +03:00
Uwe Krüger 787a63dab6
cgen: execute `defer` block *after* return expression is evaluated (#9893) 2021-04-27 01:42:16 +03:00
Enzo 4eb8072882
parser: remove ++/-- exception for some modules (#9895) 2021-04-27 01:41:42 +03:00
Lukas Neubert 181b0f1035
parser: improve error message for missing db expr in ORM (#9890) 2021-04-26 19:51:51 +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
spaceface 7acb48df83
parser: parse `JS.` interfaces properly (#9876) 2021-04-26 09:58:05 +03:00
Uwe Krüger 3c0a368af3
all: automatically move (some) referenced objects to heap (#9873) 2021-04-25 21:40:38 +03:00
Louis Schmieder fc3b628440
v: support `$for attr in Test.attributes` (#9836) 2021-04-25 18:29:26 +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 dd2002cc57
cgen: fix generics with multi generics struct receiver (#9853) 2021-04-23 15:17:57 +03:00
Alexander Medvednikov c7a6d28e13 all: improve unused variable warning (fix `x = 1`, `x += 1` etc) 2021-04-23 13:33:48 +03:00
Lukas Neubert aa40dfc1de
checker: check __global type (#9804) 2021-04-23 12:28:08 +03:00
Louis Schmieder c026d8b6f3
parser: number attributes (#9835) 2021-04-22 18:21:55 +03:00
yuyi 431d806dcf
ast, parser: cleanup of generic structs (#9839) 2021-04-22 18:21:01 +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
Lukas Neubert 2df260acbb
parser: fix last_line of no body C struct (#9809) 2021-04-20 21:37:00 +03:00
Delyan Angelov d4f31412b7
v: deprecate `@VROOT` in favour of `@VMODROOT` (#9795) 2021-04-19 19:01:47 +03:00
Lukas Neubert 70c651ff17
all: make __global behave consistent with const (#9711) 2021-04-19 17:07:47 +03:00
spaceface 73352583e7
ci: fix all `-cstrict` warnings with gcc and clang (#9792) 2021-04-19 15:38:48 +03:00
yuyi 3158617ce2
parser: simplify parse_generic_struct_inst_type() (#9801) 2021-04-19 14:47:39 +03:00
涂紳騰(Shen-Teng Tu) 3c72c6abc2
parser: disable template variables in `<style>` (#9777) 2021-04-17 15:47:36 +03:00
Uwe Krüger 1b0f099552
parser: fix handling of `-` inside array literals (#9771) 2021-04-17 02:37:17 +03:00
涂紳騰(Shen-Teng Tu) d9fdae1de9
parser: escape js template literal syntax inside <script> tags (#9738) 2021-04-15 12:39:39 +03:00
yuyi 466dc4540b
all: minor cleanup of generics (#9744) 2021-04-15 11:00:23 +03:00
yuyi 1250ce4353
cgen: fix generics with embed generics (fix #8694) (#9724) 2021-04-15 01:44:11 +02:00
Lukas Neubert f4c8f897fe
parser: proper unexpected eof errors in const declarations (#9712) 2021-04-15 01:31:49 +02:00
crthpl 0099458c0a
all: small asm fixes and number labels (#9730) 2021-04-15 01:30:23 +02:00
crthpl 14434cc86a
all: bare metal support (fix `-freestanding`) (#9624) 2021-04-14 07:50:50 +02:00
Delyan Angelov 68c3eccec5
v: skip asserts in -prod mode inside non _test.v files 2021-04-13 13:07:57 +03:00
Lukas Neubert b2c16ced57
parser: filter out vet space indent errors inside StringInterLiterals (#9695) 2021-04-12 16:03:22 +03:00
Louis Schmieder 67d8639917
orm: add unique fields & add drop table stmt (#9684) 2021-04-11 23:57:25 +02:00
Enzo 5a1a1b7c12
all: merge GoExpr and GoStmt (#9685) 2021-04-11 23:56:25 +02:00
yuyi a2a18ef92c
v: simplify handling of function generic parameters (#9673) 2021-04-11 09:02:57 +03:00
Ned Palacios 6948419595
parser: fix InterfaceDecl's position (#9649) 2021-04-09 17:18:22 +02:00
Ned Palacios a706215e52
ast, parser: add type_pos to TypeDecl nodes (#9571) 2021-04-09 14:51:25 +03:00
Lukas Neubert 46e7e27ba3
v vet: give an error for trailing whitespace (#9574) 2021-04-09 13:22:14 +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
zakuro e6a67e7172
parser: fix error of `-foo.bar()` (#9646) 2021-04-09 10:54:03 +03:00
Delyan Angelov de5cf4ac5e
v: show the number of processed bytes and lines for V source code with -stats 2021-04-07 18:12:27 +03:00
Louis Schmieder ab03357a6e
orm: add table creation (#9621) 2021-04-07 15:27:02 +02:00
crthpl 018a88c3ce
parser: asm: add support for memory clobbers (#9618) 2021-04-06 21:25:24 +02:00
涂紳騰(Shen-Teng Tu) 7d5c1c2ddb
tmpl: inline styles with attributes (#9605) 2021-04-06 15:17:40 +02:00
Lukas Neubert a0648a3ec2
all: fixes related to Node.pos (#9613) 2021-04-06 15:16:19 +02: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 ed37512ea9 ci: run wkhtmltopdf only on linux again 2021-04-05 07:55:32 +03:00
Lukas Neubert 094441c863
vet: remove false positive space indent errors inside strings (#9568) 2021-04-03 12:16:49 +02:00
Daniel Däschle 6a5f49afb1
all: support `?Type(none)` (#9567) 2021-04-02 16:34:48 +02:00
Lukas Neubert e438b158a6
vet: remove false positive space indentation error inside block comments (#9565) 2021-04-02 16:26:53 +02:00
Ned Palacios 1bb48c3577
ast, parser: patches for VLS (#9562) 2021-04-02 16:26:37 +02:00
Alexander Medvednikov 7385f8e56b all: a massive merge of ast and table modules 2021-04-02 01:57:09 +03:00
crthpl 8d5e310189
asm: make fixed labels possible as displacement (#9549) 2021-04-01 09:58:33 +03:00
Ned Palacios 0b39de2fd3
ast, parser: add syms_pos to import ast (#9541) 2021-03-31 12:17:06 +02: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
Ned Palacios b319068151
ast, parser: implement simple AST poisoning (#9525) 2021-03-30 09:33:29 +02:00
yuyi 36cc4880a6
parser: fix generic fn with upper name type (#9460) (#9478) 2021-03-26 16:50:35 +02:00
Delyan Angelov 87494fad1d
parser: allow passing `mut a AliasOfPointerType` 2021-03-26 13:38:16 +02:00
yuyi 478bb9ce8e
parser, checker: fix generic fn that returns a generic struct (#9469) 2021-03-26 08:32:11 +02:00
Ned Palacios b9cbb4f177
scanner: fix eof token position (#9432) 2021-03-23 08:51:09 +01:00
Ned Palacios aa4e22c287
scanner, token: add column information to tokens (#9407) 2021-03-23 06:23:46 +01:00
ka-weihe 3753a58ce0
parser: fix if-guard redefinition (#9425) 2021-03-23 04:38:36 +01:00
Lukas Neubert 1b572f75e8
fmt: minor array wrap improvement (#9420) 2021-03-22 23:06:12 +01:00
Delyan Angelov a00c80b98f
v: support compiler notices. Use them for `[deprecated_after: '2021-05-01']` tags
Compiler notices are like warnings, with these differences:
   a) notices use a different color.
   b) notices use a different label.
   c) notices do not prevent compilation with -prod.
   (warnings are converted to errors with -prod)
2021-03-22 19:59:00 +02:00
yuyi cf6faaf215
parser: fix anon_fn with array arguments (#9414) 2021-03-22 03:22:29 +01:00
zakuro dfd58293ef
parser: fix parse error when using `f<Foo<int> >` (#9401) 2021-03-21 13:09:43 +02:00
Delyan Angelov a386be6505
v.table: correct `table.types` to `table.type_symbols` 2021-03-19 22:51:52 +02:00
Miccah 7222ee476b
all: implement array .any and .all (#9347) 2021-03-18 15:24:16 +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
Lukas Neubert 49eeddcd1c
parser: set correct last line for struct inits (#9349) 2021-03-17 20:46:08 +02:00
crthpl fafb035fb5
all: reimplement inline assembly (#8645) 2021-03-17 01:43:17 +01:00
Enzo 4b6244c9c1
gen: fix generic variadic (#9333) 2021-03-17 00:18:43 +02:00
Lukas Neubert 05b51c5b01
parser: correctly set pos of sql blocks (#9334) 2021-03-16 23:00:50 +02:00
Anton Zavodchikov 1ad4623fb8
tmpl: move to v/parser (#9052) 2021-03-15 13:35:55 +02:00
yuyi e235022e10
cgen: fix error of for_in map_literal (#9310) 2021-03-15 12:22:32 +02:00
yuyi 945769a4f6
all: implement reference receiver optimization for big structs (#9268) 2021-03-14 18:11:21 +01:00
Delyan Angelov 69f1e7c9c3
v: fixes for `v -autofree -o v2 cmd/v` 2021-03-14 09:37:38 +02:00
Nick Treleaven 9db8a61b92
checker: disallow array append in an expression (#9265) 2021-03-12 16:09:01 +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
Lukas Neubert c40ab0db72
fmt: fix removal of attrs with comments afterwards (#9255) 2021-03-11 21:44:33 +01:00
Miccah f26d2f02b7
ast, cgen, checker, parser: support method arguments in comptime $for (#9208) 2021-03-11 15:04:34 +02:00
spaceface 7d0cba5e96
v.ast: remove the `stmt.position()` method (#9233) 2021-03-11 14:50:02 +02:00
Delyan Angelov 5a231326d7
parser: improve syntax errors in module declarations 2021-03-11 10:42:36 +02:00
spaceface f1469a8761
checker: allow accessing fields common to all sumtype members (#9201) 2021-03-09 19:16:18 +02:00
zakuro 4c3ce97763
parser: fix Enum.value when Enum is an imported symbol (#9046) 2021-03-07 16:44:38 +01:00
Delyan Angelov 64bc2fb40a
v: fix `[if debug] fn abc(){} ... abc()` 2021-03-07 12:05:07 +02:00
Lukas Neubert 7f7f9dca6b
parser,fmt: fix regression with non-void arrays in if conditions (#9161) 2021-03-06 20:39:38 +02:00
Delyan Angelov 849cde245c
v: support dump(expr) (#9160) 2021-03-06 18:09:28 +01:00
Joe Conigliaro 818be80581
parser: fix [] in if expr. closes #9131 2021-03-06 01:43:34 +11:00
Delyan Angelov 0f042124cb
tests: support `fn test_fn() ? { opt()? }` 2021-03-05 14:18:21 +02:00
Delyan Angelov 6da66226e5
vfmt: keep `mut:` in interface declarations (#9053) 2021-03-04 15:30:30 +02:00
Lukas Neubert 460e06b9ff
fmt: do not insert a newline before returned $vweb.html() (#9063) 2021-03-03 10:14:05 +02:00
Lukas Neubert 8a0b5bad94
fmt: keep empty lines in const blocks (#9071) 2021-03-03 09:23:11 +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
Anton Zavodchikov 506041a15b
tmpl: fix doubling templates folder path and enhancements (#9029) 2021-03-01 11:15:59 +02:00
spaceface b712af56fd
all: bring back `panic(err.msg)` -> `panic(err)` (#9022) 2021-03-01 00:18:14 +01:00
spaceface d63b7bc35a
all: update repo to use the new error handling syntax (#8950) 2021-02-28 23:20:21 +03:00
spaceface b9a381f101
all: migrate to the new Option (p. 1) (#8924) 2021-02-28 22:24:29 +03:00
Delyan Angelov e354dcefc2
fmt: fix support for `mut static x := 42` 2021-02-28 19:40:21 +02:00
Delyan Angelov bdce35fd9c
parser: support `static x := 42` in [unsafe] functions too 2021-02-28 14:32:46 +02:00
Delyan Angelov 276c08e7f7
fmt: support static too 2021-02-28 13:08:16 +02:00
Alexander Medvednikov 3a2d696fac time: time.wait() => time.sleep() 2021-02-27 20:41:06 +03:00
Uwe Krüger f67bff1696
all: support `thread` handles and `wait()` for functions returning optionals (#8990) 2021-02-27 10:16:55 +02:00
zakuro 1fd0aceb42
parser: imporve generics detection (#8992) 2021-02-27 10:07:18 +02:00
Nick Treleaven 4ad95cfeaf
checker: check types with $for/$if introspection (#8984) 2021-02-26 15:26:50 +01:00
yuyi 524372d49c
parser: fix incorrect comments of expr() (#8979) 2021-02-26 09:21:58 +02:00
zakuro 89c82ff8e2
parser: treat f<mod.Type> as generic call not `<` operator (#8938) 2021-02-26 09:05:00 +02:00
Nick Treleaven 59d4d0ef1d
checker: detect unknown type to iterate with $for (#8971) 2021-02-26 08:28:19 +02:00
Delyan Angelov 639061be6c
examples: fix left/right arrows in examples/term.ui/text_editor.v 2021-02-25 21:01:27 +02:00
Lukas Neubert 7e27920cf7
fmt: fix inserted empty line before go stmt with anonymus function (#8951) 2021-02-25 01:30:04 +01:00
Nick Treleaven 57d1b5b74d
checker: show position for variadic/shared/method argument errors (#8939) 2021-02-24 19:35:32 +01:00
Lukas Neubert 8e69d3629f
parser,fmt: refactor array comment handling to fully rely on the ecmnts field (#8929) 2021-02-24 19:33:59 +01: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 05a08530ff
cgen: implement for_stmt of multi_init_vars or multi_assign_vars (#8917) 2021-02-24 14:58:45 +02:00
Lukas Neubert 51125541c7
parser: fix weird minus after comment parse error in arrays (#8912) 2021-02-23 09:51:00 +02:00
Uwe Krüger 5306b2788c
all: extend `wait()` method to array of `thread` handles (#8840) 2021-02-22 15:08:52 +02:00
Lukas Neubert 9dc770e29c
fmt: do not struggle with comments inside maps (#8897) 2021-02-22 13:04:48 +02:00
Delyan Angelov c37daba41d
ci: fix the remaining obsolete reference to time.sleep and time.usleep 2021-02-22 09:12:23 +02:00
Lukas Neubert f18adf7759
parser,fmt: handle array pre-comments separately from exprs (#8884) 2021-02-21 20:18:19 +02:00
zakuro ac4791045f
time: consolidate the different sleep functions into time.wait(Duration) (#8853) 2021-02-21 17:05:03 +02:00
spaceface 260f677469
term.ui: use the new `[flag]` enums (#8881) 2021-02-21 16:07:49 +02:00
zakuro 7928689ee2
parser: set is_public when registering enum type symbols (#8875) 2021-02-21 12:13:52 +02:00
Delyan Angelov 5a333b0fdc
gen,parser: allow enums as map keys 2021-02-20 19:39:25 +02: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
yuyi 5e1159e4c3
checker: change non-const size of fixed array error message (#8850) 2021-02-20 12:14:44 +01:00
kristof de spiegeleer 3f3bec45fa
examples: add a template example, update the regex examples (#8829) 2021-02-19 12:39:15 +02:00
yuyi a119affeba
cgen: check unknown sizeof type (#8815) 2021-02-18 09:38:57 +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
Delyan Angelov 843de10442
parser,gen: fix `arr << map[key] using map_get_and_set_1, leading to double free 2021-02-16 16:39:31 +02:00
zakuro 6813866141
fmt: fix bug of disappearing `pub` in struct decl (#8777) 2021-02-16 12:39:50 +01:00
zakuro 70a30374b9
parser: cleanup fn_decl (#8700) 2021-02-15 17:55:08 +02:00
zakuro d08a0b5a7c
parser: check not used expression for all exprs in multi-expr (#8733) 2021-02-15 17:41:04 +02:00
Nick Treleaven 629d43caf5
checker: warn when using `goto` outside of `unsafe` (#8741) 2021-02-15 15:48:24 +02:00
spaceface e3649ec4d3
all: implement `type_name()` for interfaces too (#8767) 2021-02-15 15:29:44 +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
Uwe Krüger 374739b804
all: rename `[ref_only]` -> `[heap]` (#8718) 2021-02-13 16:52:01 +02:00