Commit Graph

904 Commits (ac27a3ccee931aba28db3a5b734bc4cc7267dace)

Author SHA1 Message Date
Delyan Angelov ac27a3ccee parser,cgen: improve `[flag]enum Abc{ a b }`, allow `x := Abc.a | Abc.b` 2020-11-27 23:09:14 +02:00
Alexander Medvednikov fcd127ed87 autofree: make -experimental the default 2020-11-27 20:49:48 +01:00
Swastik Baranwal 2473f65278
cgen: minor cleanup (use replace_each) (#6978) 2020-11-27 16:13:30 +01:00
Daniel Däschle ee2a5727fb
gen: fix assigning an anon fn to a struct field (#6965) 2020-11-27 11:15:48 +02:00
Alexander Medvednikov c27818e247 all: remove remaining broken escape sequences 2020-11-27 03:17:19 +01:00
Daniel Däschle d71d9ad7c0
сgen: print generic structs (#6967) 2020-11-26 23:57:03 +01:00
Nick Treleaven ea8adfdbf9
gen: more efficient `for in` with a map (#6961) 2020-11-26 23:22:14 +01:00
Ruofan XU c6a8c3cad5
cgen: remove unneeded sumtype logic and add more tests (#6959) 2020-11-26 15:29:23 +01:00
Delyan Angelov 35a0fe79f9 cgen: generate an unique sort comparator function for each .sort() call 2020-11-25 13:48:42 +02:00
Daniel Däschle 7d6f97259f
all: refactor UnionSumType to SumType (#6944) 2020-11-25 13:09:40 +02:00
Daniel Däschle a042966082
all: remove old sumtype code (#6937) 2020-11-24 17:55:24 +01:00
Daniel Däschle aa6303f0b2
all: use the new types with old syntax (#6922) 2020-11-24 13:58:29 +01:00
Daniel Däschle 789912238f
gen: generate typedef first on sum types (#6930) 2020-11-24 12:53:39 +01:00
Nick Treleaven 380e3640e3
gen: add panic message when using '?' with `none` (#6919) 2020-11-23 16:16:38 +01:00
Daniel Däschle 96539e43b5
all: nested sum types (#6913) 2020-11-23 16:16:13 +01:00
Alexander Medvednikov a1827d7f98 autofree: handle array set/get 2020-11-22 20:48:23 +01:00
Alexander Medvednikov 311b5e8188 autofree: string.clone() fix 2020-11-22 13:45:12 +01:00
Alexander Medvednikov 65005fdae8 builtin: same fix for array.insert 2020-11-22 13:30:48 +01:00
Alexander Medvednikov f8827c3fe5 builtin: clone the strings correctly in array.push 2020-11-22 13:22:42 +01:00
Daniel Däschle 22fdf76db5
gen: unwrap optional on if guard expr (#6903) 2020-11-21 22:40:05 +01:00
Alexander Medvednikov 9a51f4e3c2 autofree: builtin fixes 2020-11-21 22:33:31 +01:00
Alexander Medvednikov 2afb9b30e9 autofree: minor fixes; skip in consts 2020-11-21 19:07:47 +01:00
Alexander Medvednikov ad940ff40e autofree: free parent scope vars only before fn returns 2020-11-21 18:23:50 +01:00
Daniel Däschle 838ad16296
all: refactor ast.Expr to use the new sum type implementation (#6792) 2020-11-21 00:05:57 +01:00
Alexander Medvednikov ff1752dfff gg: vfmt gg.v 2020-11-21 00:04:29 +01:00
Alexander Medvednikov c1486925d5 autofree: enable free_before_return test 2020-11-21 00:00:27 +01:00
Nick Treleaven d5242e0bf5
gen: implement labelled break and continue (retry) (#6887) 2020-11-20 12:23:48 +01:00
Alexander Medvednikov 4328233504 Revert "gen: implement labelled break and continue (#6880)"
This reverts commit e798326a1a.
2020-11-20 02:51:35 +01:00
Nick Treleaven e798326a1a
gen: implement labelled break and continue (#6880) 2020-11-19 21:13:15 +01:00
Daniel Däschle e06756ef58
all: match multi aggregate for union sum types (#6868) 2020-11-18 20:52:00 +01:00
Alexander Medvednikov 68077b7dbf autofree: handle early returns (part 1) 2020-11-16 17:26:54 +01:00
Alexander Medvednikov 26785668c0 autofree: more tests; gg: fix draw_circle with hidpi 2020-11-15 15:09:44 +01:00
Daniel Däschle 9c569246ef
cgen: fix typeof union sum type (#6794) 2020-11-12 12:27:54 +01:00
Daniel Däschle 43ce098043
cgen: fix default value init for union sum types (#6795) 2020-11-11 19:56:13 +02:00
Daniel Däschle 6271798ce3
cgen: union sum types implementation (#6745) 2020-11-11 09:18:15 +01:00
Alexander Medvednikov 2254f41722 autofree: free all vars in parent scopes recursively 2020-11-09 15:56:28 +01:00
Nick Treleaven c76e486765
parser: implement `T.name` for generic types (#6783) 2020-11-09 14:35:26 +01:00
Alexander Medvednikov 1c257abc23 autofree: simplify: merge tmp arg logic with scope vars 2020-11-09 14:24:46 +01:00
Alexander Medvednikov 507d724ee6 autofree: free before return tests 2020-11-09 11:54:45 +01:00
Nick Treleaven 125650c986
cgen: fix using brackets for match expression (#6768) 2020-11-07 14:47:27 +01:00
Alexander Medvednikov 0e8c7ca2e3 autofree: fix string reassignment 2020-11-07 04:00:45 +01:00
Ned Palacios 6d8a7ced24
cgen: fix setting nested map elements fields (#6744) 2020-11-06 16:32:44 +02:00
spaceface777 a9e9554b11
all: fix most C warnings (#6758) 2020-11-06 16:26:59 +02:00
Alexander Medvednikov 212e6fe52c autofree: do not run in `builtin` 2020-11-06 10:13:05 +01:00
Larpon 785bf40f67
all: remove comp time '@' expansion from scanner (#6746) 2020-11-05 10:12:32 +02:00
Alexander Medvednikov 1b1d17cfb5 os: basic proof of concept stdout capture; autofree: small fixes 2020-11-05 08:44:37 +01:00
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
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
Daniel Däschle 9d5be12517
gen: add prefix when printing type aliases (#6701) 2020-11-03 14:13:35 +01:00
Nick Treleaven 788de9938a
cgen: fix typeof(expr).name for generic type, pointers, etc (#6712) 2020-11-02 22:59:48 +01:00