Commit Graph

764 Commits (1b1d17cfb54b13702fbf5e6480d195d786354511)

Author SHA1 Message Date
Nick Treleaven ca8d23acab
table: make Table.type_to_str generate proper function type, not fn name (#6716) 2020-11-05 06:34:56 +01:00
Daniel Däschle a2fc19880a
parser: fixes or block position (#6736) 2020-11-04 16:02:01 +02:00
Delyan Angelov 9eb655e65c all: add .pos fields to all AST nodes, to avoid wrong positions in error messages 2020-11-04 13:34:12 +02:00
Delyan Angelov 2c3f695469 checker,parser: treat C.Struct fields as public by default 2020-11-03 09:35:44 +02:00
Delyan Angelov 4e760c703e checker: disallow `opt_returning_string() or { ... 123 }` (closes #6711) 2020-11-02 05:29:37 +02:00
pancake d040af4939
checker: improve error message for: `a := foo() or { println(err) }` (#6710) 2020-11-02 04:52:35 +02:00
Daniel Däschle d5a421e3f5
checker: add alias cast type check (closes #6705) (#6709) 2020-11-02 01:17:35 +01:00
Delyan Angelov 3c0f4c46fa checker: add check preventing `if x:=non_optional() {}` 2020-11-02 01:58:07 +02:00
Alexander Medvednikov a0bf796926 autofree: handle SelectorExpr and fix json 2020-11-02 00:57:45 +01:00
Delyan Angelov 70cbf56655 cgen: show more informative errors, instead of a `invalid type (typ=0 idx=0)` verror panic 2020-10-30 20:26:08 +02:00
Alexander Medvednikov 2c75b1397c all: struct embedding 2020-10-30 07:09:26 +01:00
pancake 367067dfff
pkgconfig: improve and fix the parser; move to v.pkgconfig (#6695) 2020-10-29 11:57:23 +02:00
pancake 36c5eab799
all: add #pkgconfig directive using the new vlib modules (#6673) 2020-10-26 18:05:18 +01:00
Delyan Angelov 89daec4e93 ci: run vfmt over compile.v and checker.v 2020-10-24 20:41:52 +03:00
Delyan Angelov 8b01146b90 compiler: implement -W and -reuse-tmpc 2020-10-24 20:34:50 +03:00
Delyan Angelov ac6fad6a63 checker: fix comptime custom defines usages, add tests 2020-10-24 15:06:51 +03:00
Alexander Medvednikov 66b8462d7a autofree: handle method chains 2020-10-22 03:51:28 +02:00
Delyan Angelov ab137e4164
cgen: print results of failed callexprs in `assert fn() == fn2()` (#6665) 2020-10-21 21:58:40 +02:00
Swastik Baranwal 019e3b2f4a
checker: add error for ast.PrefixExpr on the left side of decl_assign (#6660) 2020-10-21 17:37:30 +02:00
Delyan Angelov 92d9569d5d checker: fix #include with @VROOT 2020-10-18 22:31:21 +03:00
Alexander Medvednikov 396dca7f48 checker: handle bad `$if` values 2020-10-18 21:22:37 +02:00
Swastik Baranwal acc85be5ae
checker: disallow type casting to `none` (#6635) 2020-10-17 20:02:30 +03:00
Delyan Angelov 3c2202572b
cgen: produce cleaner error on missing C headers (with optional explanation) (#6637)
Implements support for `#include <openssl/rand.h> # Please install OpenSSL`.
2020-10-17 18:27:06 +03:00
Enzo b083f4014b
fmt: fix multiple things and format most of the compiler (#6631)
Format expressions inside string interpolation like the rest (it used to be a+b instead of a + b, not too sure why)
Fix formatting some match branches when there were only one statement inside (it was inlined)
Fix parsing and formatting some comments edge case on struct field init. You should check out this test because the result is a bit different from before. I personally find it more logical but I would understand if the former format was to stay
Fix formatting of void-returning function signature
2020-10-15 22:12:59 +02:00
Nick Treleaven 3c336b566d
checker: add check_expected() which returns an optional error (#6623) 2020-10-15 17:30:36 +02:00
Alexander Medvednikov 982056894e fmt: use `f(x int, y int)` instead of `f(x, y int)` 2020-10-15 12:00:46 +02:00
Swastik Baranwal 314fae7446
checker: add more checks for hash_stmt (#6615) 2020-10-15 11:58:01 +03:00
Alexander Medvednikov ea09bd5e45 checker/fmt: `for mut val` fixes 2020-10-14 12:50:19 +02:00
Alexander Medvednikov a07f31feae all: `for mut val in vals {` (part 1) 2020-10-13 16:27:30 +02:00
Nick Treleaven b677ad9ca5
checker: fix panic on match expression without results (#6597) 2020-10-10 15:42:40 +02:00
Enzo 6038264a4c
gen: fix slicing mutable arguments (#6596) 2020-10-10 12:03:23 +02:00
Nick Treleaven 36706126fd
checker - improve error for `as` casting on non-sum type (#6587) 2020-10-09 16:12:12 +02:00
Nick Treleaven f734f8167b
checker: improve error message for match branch type mismatch (#6588) 2020-10-09 16:11:11 +02:00
Nick Treleaven 92630a2821
checker: error if assigning to a function (#6581) 2020-10-09 00:48:39 +02:00
Swastik Baranwal aea52af9ae
checker: add is_mut check for disallowing taking address of map's key and array's element outside unsafe (#6573) 2020-10-08 09:37:18 +03:00
Nick Treleaven f7decfe399
checker: infer generic type T from matching fn call argument (#6298) 2020-10-06 15:34:02 +02:00
Alexander Medvednikov d2d3289a2a all: mark pref.Preferences field as immutable 2020-10-06 06:24:50 +02:00
Swastik Baranwal d77669da80
test: add tests for disallowing map/array get element/key address (#6568) 2020-10-05 18:40:51 +03:00
Swastik Baranwal 5f07b255bd
checker: disallow address of array and map index outside unsafe (#6557) 2020-10-05 13:08:30 +02:00
Delyan Angelov 0c174104fc checker: allow &=,|=,^=,%= on an integer number type aliases 2020-10-04 15:29:09 +03:00
Delyan Angelov 628b136e85 checker: allow casting from floats/enums to byte 2020-10-04 14:46:24 +03:00
Henrixounez c9574ae7d7
syntax: new global variable declaration syntax (#6540) 2020-10-03 07:03:44 +02:00
Swastik Baranwal c8a884f57f
checker: fix typos in chan (#6539) 2020-10-03 06:59:30 +02:00
Nick Treleaven 7c86b03505
checker: don't error if last statement in match branch produces a value (#6523) 2020-10-02 09:33:04 +02:00
Henrixounez 8152b86652
checker: detect correct len expression for multidimensional array init (#6521) 2020-10-02 03:12:33 +02:00
Delyan Angelov 11b16a63cf checker: add a suggestion for misspelled struct field name errors 2020-10-01 15:36:47 +03:00
Enzo 324d547cdb
parser: allow multiple types in match branch (#6505) 2020-10-01 01:07:36 +02:00
Nick Treleaven 18be7b115a
checker: disallow most statements in if/match expression branches (#6509) 2020-09-30 16:06:22 +02:00
Delyan Angelov dc954bbb03 all: use `macos` consistently in os.user_os and the compiler 2020-09-29 22:32:20 +03:00
Daniel Däschle 06cade6c31
all: change .ReturnType and .Type to .return_type and .typ (#6494) 2020-09-28 06:13:38 +02:00