Ayaz Hafiz
a3ac68a41f
Split up Defs into TypeDef and ValueDef
...
Just a refactoring PR. This is useful because during canonicalization
we always process type defs first, then value defs. With abilities this
distinction continues to grow; in that case, we have patterns associated
with types that we want to process before patterns from values.
2022-04-06 22:18:57 -04:00
Ayaz Hafiz
2dc0445f46
s/AbilityDemand/AbilityMember
...
This is a better name
2022-04-06 11:20:34 -04:00
ayazhafiz
d7abc3897b
Parse abilities
2022-03-12 21:29:06 -06:00
Brendan Hansknecht
f7c0e2ef19
Merge remote-tracking branch 'origin/trunk' into single-quote-literal
2022-02-24 10:13:39 -08:00
ayazhafiz
e420ebd023
Add TODOs for opaque type comments that will need to be changed later
2022-02-21 23:21:39 -05:00
ayazhafiz
6104a27b45
Parse opaque references
2022-02-19 21:30:42 -05:00
ayazhafiz
fa24e51593
Parse opaque types
2022-02-19 18:38:31 -05:00
ayazhafiz
8ce81e4607
AliasHeader -> TypeHeader
2022-02-19 17:51:56 -05:00
Anton-4
d6681f4e0a
Merge pull request #2160 from rtfeldman/editor-comments
...
support tld comments in docs and editor(reading only)
2022-02-10 11:49:10 +01:00
ayazhafiz
4e942b3e5d
Make nested datatypes into errors
...
I was hoping to add nested datatypes into the language, but it turns out
doing so is quite tricky and not all that useful with Roc's current
compilation model. Basically every implementation strategy I could think
of ended up requiring a uniform representation for the data layout
(or some ugly workaround). Furhermore it increased the complexity of the
checker/mono IR generator a little bit - basically, we must always pass
around the alias definitions of nested datatypes and instantiate them
at usage sites, rather than being able to unroll aliases as we currently
do during canonicalization.
So, especially because we don't support polymorphic recursion anyway, I
think it may be better to simply disallow any kind of nested datatypes
in the language. In any case, Stephanie Weirich [seems to think nested
datatypes are not needed](https://www.cis.upenn.edu/~plclub/blog/2020-12-04-nested-datatypes/ ).
Closes #2293
2022-01-31 22:58:01 -05:00
Richard Feldman
755f4c01f3
cargo fmt
2022-01-30 20:40:51 -05:00
Richard Feldman
484ce2fbc9
Parse hosted modules
2022-01-30 20:40:49 -05:00
Joshua Warner
8d6eb178b1
Fix multiline pattern heuristic
2022-01-01 18:20:05 -08:00
Anton-4
f941e30b86
Merge branch 'trunk' of github.com:rtfeldman/roc into editor-comments
2022-01-01 11:10:54 +01:00
ayazhafiz
0c81302d29
Admit tag destructuring in definitions
2021-12-30 19:50:50 -06:00
Folkert de Vries
bb935948aa
Merge pull request #2276 from rtfeldman/i/2265
...
Parse "as" aliases into tag/args rather than arbitrary annotations
2021-12-27 20:56:48 +01:00
ayazhafiz
b3ddfa7515
Parse destructured tag annotations as annotations rather than aliases
...
Closes #178
2021-12-26 16:11:29 -06:00
ayazhafiz
966198a6e7
Coalesce inline and normal alias headers
...
Unifies `As` annotations and `Alias` defs to use a common struct for
defining alias header information, i.e. the name and type variables of
the alias.
2021-12-26 09:37:56 -06:00
ayazhafiz
597a1cef3b
Attach location to alias header name
2021-12-26 09:17:27 -06:00
ayazhafiz
11da888c07
Pull out alias header as its own struct
2021-12-26 09:07:12 -06:00
ayazhafiz
2cd5bf8c03
Parse "as" aliases into tag/args rather than arbitrary annotations
2021-12-26 08:44:09 -06:00
Joshua Warner
f19220473a
Rename Located -> Loc
2021-12-22 19:18:22 -08:00
Joshua Warner
0786e554c6
Extract spacing from parse::header::* items into explicit Spaced enum
2021-12-14 19:53:20 -08:00
Anton-4
9a2187ecd2
fixed newline issues
2021-12-09 13:55:18 +01:00
Joshua Warner
49228c8100
Refactor format_sequence to be a function
2021-12-07 18:53:47 -08:00
Anton-4
5bd776f972
debugging inline comment bug
2021-12-01 16:57:28 +01:00
Chelsea Troy
6cf755ad8d
Resolve a bunnnch of merge conflicts
2021-11-29 23:14:29 -06:00
ayazhafiz
8a60162a1e
Rename roc_module::operator -> roc_module::called_via
...
A bit of a nit, but this file is now more general than just keeping
track of operator methods.
2021-11-18 20:20:33 -05:00
Joshua Warner
7f5b873357
Parse _ in type annotations as an 'Inferred' type
2021-11-17 17:59:40 -08:00
Joshua Warner
3ff3695758
Add a manual Debug formatter for Collection to make debugging nicer
2021-11-13 16:24:35 -08:00
Joshua Warner
9bf1674946
Shrink Collection to make parse_expr_size test pass
2021-11-13 16:17:44 -08:00
Joshua Warner
1fabc64fdf
Use Collection in Expr::TagUnion
2021-11-13 07:38:39 -08:00
Joshua Warner
d63405d824
Make Expr::List use a Collection
2021-11-13 07:38:11 -08:00
Joshua Warner
a4ca6a31a6
Use Collection in Expr::Record and related places
2021-11-13 07:36:05 -08:00
Joshua Warner
4df0880e7a
Commit local changes (whoops!)
2021-11-11 18:57:26 -08:00
Joshua Warner
04d4a8ca79
Introduce Collection as a general abstraction in the ast
2021-11-11 14:49:33 -08:00
Anton-4
c7c421b2f5
fixed scope lookup bug
2021-10-19 16:45:28 +02:00
Anton-4
a272765fc7
started using scope properly, improved error backtrace conversion
2021-10-16 19:37:20 +02:00
Eric Correia
8272ea876f
Get it all to compile!
2021-10-02 13:48:07 -04:00
Eric Correia
dc2016dc0d
Start single-quote literal parser work
2021-08-15 11:08:05 -04:00
Richard Feldman
53ccef0506
nightly clippy
...
I was on nightly for benchmarks, and these all seem reasonable.
2021-06-18 15:21:11 -04:00
Folkert
700e7d9686
parse expect
2021-04-22 23:00:44 +02:00
Folkert
28ba645121
parse underscores in expressions
2021-04-11 21:02:31 +02:00
Folkert
f3318fbc2f
more Copy
2021-03-21 21:38:11 +01:00
Folkert
ce98da9d04
remove Nested from Def
2021-03-21 21:14:32 +01:00
Folkert
52854a6f57
make Def and TypeAnnotation Copy
2021-03-21 21:08:16 +01:00
Folkert
f3fc9f450f
make ast::Expr Copy
2021-03-21 21:05:36 +01:00
Folkert
2827af7e59
remove Nested from pattern
2021-03-21 21:03:37 +01:00
Folkert
197835b6ed
remove nested in expr
2021-03-21 20:56:18 +01:00
Folkert
03fab9297c
shrink stack size usage for parse Expr
2021-03-20 23:37:36 +01:00