Commit Graph

362 Commits (6ad5ecf569db8f93557f032be68d431cd96295b4)

Author SHA1 Message Date
Alexander Medvednikov 25947a7b23 autofree: handle args in optional returns 2020-10-14 13:23:58 +02:00
Alexander Medvednikov a07f31feae all: `for mut val in vals {` (part 1) 2020-10-13 16:27:30 +02:00
JalonSolov 57d705e265
ast: minor code cleanup (#6608) 2020-10-12 23:11:51 +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
Enzo c84848c417
fmt: fix formatting enum with attributes (#6551) 2020-10-03 21:33:02 +03:00
Henrixounez c9574ae7d7
syntax: new global variable declaration syntax (#6540) 2020-10-03 07:03:44 +02:00
Nick Treleaven 18be7b115a
checker: disallow most statements in if/match expression branches (#6509) 2020-09-30 16:06:22 +02:00
Nick Treleaven 9f33b33803
parser: warn about ambiguous infix/prefix op token (#6491) 2020-09-29 03:13:10 +02:00
Alexander Medvednikov fca344d1fb all: fn args => params 2020-09-27 03:32:56 +02:00
Alexander Medvednikov e2c7126d11 checker: verify mutability of method args 2020-09-27 03:14:24 +02:00
Alexander Medvednikov 624f22e27e all: mutability check (part 1); enable mutable sumtype args 2020-09-22 05:28:29 +02:00
Nick Treleaven 9958881cbe
parser: support parsing unsafe (as first token) as UnsafeExpr (#6032) 2020-09-19 19:18:36 +03:00
Uwe Krüger 31a52cdf21
cgen: implement channel `select` block code generation (#6424) 2020-09-19 02:14:35 +02:00
Nick Treleaven 14743458e5
checker: tweak error messages for `or` block; use proper type names (#6377) 2020-09-18 01:09:00 +02:00
Enzo a1e127ae46
checker: check type in `is` InfixExpr (#6407) 2020-09-18 01:01:05 +02:00
spaceface777 ff92c3409d
ast: merge `IfExpr` and `CompIf` (#6011) 2020-09-18 00:58:54 +02:00
Uwe Krüger 1bc9063573
parser: implement parsing of `select` block (#6379) 2020-09-16 15:34:57 +02:00
Alexander Medvednikov db51ee08ea autofree: more fixes in optionals 2020-09-13 03:00:45 +02:00
Alexander Medvednikov b74c1805d7 cgen/autofree: fix and simplify optionals 2020-09-12 16:40:52 +02:00
Daniel Däschle ce62f997f3
all: better type error positions (#6345) 2020-09-11 14:37:14 +02:00
Nick Treleaven eb95a4333a
table: rename Arg to Param (#6337) 2020-09-09 13:21:11 +02:00
Nick Treleaven 49c322f120
checker: simplify argument qualifier errors (#6321) 2020-09-08 19:34:17 +02:00
Alexander Medvednikov 9fbea31f47 autofree: fix exprs N levels deep 2020-09-06 13:02:32 +02:00
Alexander Medvednikov 3410705974 autofree: lots of fixes 2020-09-05 12:00:35 +02:00
spaceface777 d663f57d43
parser: move flag logic to checker (#6239) 2020-08-28 09:24:04 +03:00
Delyan Angelov 7476428def vfmt: handle comments after last const field 2020-08-27 15:07:49 +03:00
Nick Treleaven 479bfa28de
cgen: implement fixed array `.len` property (#6212) 2020-08-25 08:48:28 +02:00
Maciej Obarski e8e0d9fa42
all: [direct_array_access] tag (#6203) 2020-08-24 09:04:50 +02:00
Uwe Krüger 61df70fdf5
all: enable `x = <-ch or {...}` (#6195) 2020-08-23 02:12:05 +02:00
Nick Treleaven 1b914d217e
fmt: don't remove `mut` from `if mut` smart cast (#6188) 2020-08-22 00:00:02 +02:00
Uwe Krüger 0d7cc8829a
cgen: implement channel `push()`/`pop()` using `<-` operator (#6154) 2020-08-17 23:35:36 +02:00
Nick Treleaven 36c98b3e5d
cgen: implement fixed array 'for in' for lvalue condition (#6151) 2020-08-17 21:10:47 +02:00
Nick Treleaven 0f0a91fc9e
parser: support custom fixed size ArrayInit: `[3]int{init: -1}` (#6114) 2020-08-15 11:01:54 +02:00
Uwe Krüger 9602a25a0b
all: add builtin channel type `chan elem_type` (#6126) 2020-08-14 21:18:42 +02:00
Nick Treleaven 6016f28171
cgen: fix assigning ArrayInit to fixed array: `a = [3]int` (#6115) 2020-08-14 13:57:00 +02:00
Alexander Medvednikov 4bc0dde413 all: new `.sort(a < b)` syntax 2020-08-12 05:54:51 +02:00
Delyan Angelov 36eae1c175
builtin: x.vstring() instead of string(x) (#6102) 2020-08-10 18:05:26 +02:00
Enzo f238890fe9
compiler: move attributes to declarations (#6026) 2020-08-04 20:10:22 +02:00
Delyan Angelov e291c38119 ast: add use case comment for MatchExpr.var_name 2020-08-03 22:10:59 +03:00
Nick Treleaven 7f447bb82f
ast: use Block instead of UnsafeStmt (#5981) 2020-08-02 14:06:44 +03:00
Swastik Baranwal d56d622a43
checker: add checks for byte casting (#5917) 2020-08-01 23:17:00 +02:00
Alexander Medvednikov f269cbdc94 Revert "parser: Support `unsafe(expr)` (#5973)"
This reverts commit 19c226fcf8.
2020-07-29 21:41:47 +02:00
Delyan Angelov 9c9533dad9
checker: add error for `fn f() Struct { return &Struct{} }` (#6019) 2020-07-29 21:40:43 +02:00
Nick Treleaven 19c226fcf8
parser: Support `unsafe(expr)` (#5973) 2020-07-28 11:20:52 +03:00
Louis Schmieder b58b15993c
gen: compile time for (methods and fields) (#5957) 2020-07-25 00:02:44 +02:00
joe-conigliaro d46a89b90d
parser/checker/fmt: optimize scope lookups by storing object with ident & add if expr smartcast support to vfmt (#5935) 2020-07-23 02:10:31 +10:00
Nick Treleaven a74cbf55c7
checker: warn if C.m* or C.s* functions are called outside unsafe blocks (#5869) 2020-07-20 20:06:41 +03:00
Nick Treleaven e6fc8eb015
checker: check that array slicing indexes are valid (#5892) 2020-07-20 19:52:03 +03:00
Enzo 8653605b0a
fmt: allow for comments in call args and if expressions branches (#5871) 2020-07-20 17:48:33 +03:00
Ryan Willis 1114fd28d0
all: import individual symbols feature (#5872) 2020-07-18 21:34:38 +02:00