Commit Graph

635 Commits (36ec47cd203a1f119da74b868ceb92f6da7ea930)

Author SHA1 Message Date
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
Enzo da53f818df
all: initial support for closures (x64 / linux-only) (#11114) 2021-08-10 21:27:15 +03:00
pancake e7b8cf17e5
v.gen.native: add support for assert statements for amd64 (#11117) 2021-08-10 10:29:44 +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
Leo Developer 6dcf72fe9b
cgen: dont generate function if its flag is false (#11021) 2021-08-03 03:17:22 +03:00
Uwe Krüger a7c2aaf35b
cgen: initialize globals directly for simple cases (#11002) 2021-07-30 19:20:45 +03:00
Uwe Krüger 08aa6c08f6
all: more improvements for global variables (#10986) 2021-07-29 10:57:31 +03:00
Uwe Krüger 45ad48d76a
cgen: properly handle initialization expression for globals (#10981) 2021-07-28 08:11:55 +03:00
Delyan Angelov 6313ed6a79
checker,cgen: fix `-os cross` support for `$if !solaris { #include <sys/ptrace.h> }` 2021-07-23 16:24:42 +03:00
Louis Schmieder 26db3b0995
orm: redesign orm (re-write it in V) (#10353) 2021-07-23 12:33:55 +03:00
Delyan Angelov 48546d0f45
all: do compile time const evaluation for `const x = "abc" + "xyz"` and `const x = 16 * 1024 + 5` (fix const prealloc_block_size) 2021-07-18 22:59:18 +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
spaceface 6e942bf4c2
v: initial support for generic interfaces and sumtypes (#10795) 2021-07-15 08:29:13 +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
Louis Schmieder eb96ad11d9
checker: add pkgconfig to comptime if (#10692) 2021-07-09 18:17:04 +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
shadowninja55 06a6a8e199
checker: check for empty branches in match expressions (#10593) 2021-06-28 19:32:28 +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
Uwe Krüger 8f2f377cb1
v.checker,v.gen.c: extend auto heap mechanism to objects used as interfaces (#10529) 2021-06-21 07:10:10 +03:00
yuyi 7ec55e4c51
v.ast: add comments for ast.AsCast (#10516) 2021-06-19 17:07:07 +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
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
Uwe Krüger 2ac39d9112
all: new function `isreftype(T)` to know if `T` contains pointers (#10438) 2021-06-13 06:26:13 +03:00
crthpl 9553c5a4e6
parser: fix multiple output modifiers in asm (#10347) 2021-06-04 23:18:11 +03:00
Louis Schmieder 38796521fa
all: allow defer use from other scope (#10284) 2021-05-31 14:43:44 +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
Uwe Krüger 7bfd89567b
shared: support `lock` on SelectorExpression (#10105) 2021-05-15 04:34:27 +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 dc034d9b16 vweb: make thread safe; checker: `$if T is Interface {` 2021-05-11 09:30:18 +03:00
yuyi 74defc4b82
checker: minor cleanup of FnDecl (#10000) 2021-05-09 15:27:45 +03:00
Delyan Angelov 8a380f4699
tools: make `v test-cleancode` test everything by default (#10050) 2021-05-08 13:32:29 +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 4b818fa2be
v: implement interface embedding (#9935) 2021-05-02 03:00:47 +03:00
yuyi fec947c7e1
ast: minor cleanup in ast.FnDecl (#9950) 2021-05-01 12:50:49 +03:00
Alexander Medvednikov c16bb7f3e4 ast: a minor format of ast.v 2021-04-30 15:36:34 +03:00
Alexander Medvednikov e949d4b26c tools/fast: add "V lines" and "V lines/s" 2021-04-30 15:31:50 +03:00
crthpl 6945f987cf
checker: fix sumtype comparison and sumtype in itself (#9917) 2021-04-29 09:04:02 +03:00
Lukas Neubert dee733aae4
fmt: reset const field align after multi line exprs (#9916) 2021-04-29 02:17:37 +03:00
Louis Schmieder faf2656335
orm: support multiline statements (#9888) 2021-04-27 15:28:57 +03:00
pancake 9a3869c521 v.ast: rename aarch64 to arm64 and aarch32 to arm32 2021-04-27 12:24:58 +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
Lukas Neubert aa40dfc1de
checker: check __global type (#9804) 2021-04-23 12:28:08 +03:00
yuyi 431d806dcf
ast, parser: cleanup of generic structs (#9839) 2021-04-22 18:21:01 +03:00
Lukas Neubert 70c651ff17
all: make __global behave consistent with const (#9711) 2021-04-19 17:07:47 +03:00
Delyan Angelov cfcecf898b
v.ast: add .free() methods, so vls can be more decoupled 2021-04-18 10:24:51 +03:00
yuyi 8cb44ed9db
checker: fix generics with nested generics fn (#9757) 2021-04-16 11:53:20 +03:00
crthpl 0099458c0a
all: small asm fixes and number labels (#9730) 2021-04-15 01:30:23 +02:00
Delyan Angelov 68c3eccec5
v: skip asserts in -prod mode inside non _test.v files 2021-04-13 13:07:57 +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
Uwe Krüger 78c6e35bde
checker/cgen: fix `v := rlock m { m[key] or { default_val } }` (#9666) 2021-04-10 16:57:18 +02:00
Ned Palacios 50f59674ce
ast, checker: make SelectorExpr.root_ident return ?Ident (#9647) 2021-04-09 18:06:40 +02: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
spaceface 4feb09fa5b
checker, cgen: add sumtype-like smartcasting capabilites to interfaces (#9256) 2021-04-09 11:00:05 +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
Lukas Neubert 3a07fbc653
fmt: improve match branch wrapping (#9619) 2021-04-07 15:26:10 +02:00
Lukas Neubert a0648a3ec2
all: fixes related to Node.pos (#9613) 2021-04-06 15:16:19 +02:00
Delyan Angelov fec89c7efb
ci: fix some of `v test-cleancode` 1 2021-04-05 20:47:32 +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 ed37512ea9 ci: run wkhtmltopdf only on linux again 2021-04-05 07:55:32 +03:00
Daniel Däschle 6a5f49afb1
all: support `?Type(none)` (#9567) 2021-04-02 16:34:48 +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
Delyan Angelov 23a6ce00e2
ci: fix for `-cflags -Werror` jobs 2021-03-31 12:28:42 +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
Ned Palacios b319068151
ast, parser: implement simple AST poisoning (#9525) 2021-03-30 09:33:29 +02:00
Ned Palacios aa4e22c287
scanner, token: add column information to tokens (#9407) 2021-03-23 06:23:46 +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
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
Alexander Medvednikov 2f1810634e checker: do not allow direct initialization of builtin types (s := string{}) 2021-03-13 18:20:46 +03:00
Nick Treleaven 9db8a61b92
checker: disallow array append in an expression (#9265) 2021-03-12 16:09:01 +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
spaceface f1469a8761
checker: allow accessing fields common to all sumtype members (#9201) 2021-03-09 19:16:18 +02:00
Delyan Angelov 64bc2fb40a
v: fix `[if debug] fn abc(){} ... abc()` 2021-03-07 12:05:07 +02:00
Delyan Angelov 849cde245c
v: support dump(expr) (#9160) 2021-03-06 18:09:28 +01: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
Uwe Krüger dd475f4e37
checker/cgen: enable `IfGuardExpr` for `a[k]` and `<-ch` (#9065) 2021-03-03 10:10:38 +02:00
Uwe Krüger e937d6249c
cgen: fix various issues concerning optionals (#9021) 2021-02-28 23:21:03 +01:00
Nick Treleaven 59d4d0ef1d
checker: detect unknown type to iterate with $for (#8971) 2021-02-26 08:28:19 +02:00
yuyi c762d150c6
cgen: fix anon_fn redefinition (#8961) 2021-02-25 12:16:35 +01:00
Lukas Neubert 7e27920cf7
fmt: fix inserted empty line before go stmt with anonymus function (#8951) 2021-02-25 01:30:04 +01: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 9dc770e29c
fmt: do not struggle with comments inside maps (#8897) 2021-02-22 13:04:48 +02:00
Lukas Neubert f18adf7759
parser,fmt: handle array pre-comments separately from exprs (#8884) 2021-02-21 20:18:19 +02:00