Commit graph

9048 commits

Author SHA1 Message Date
Richard Feldman
71d543f1f3
Merge branch 'trunk' into ct/list-formatting 2019-12-31 18:53:11 -05:00
Folkert
2c59b2df6e include rigid_vars in constraint 2019-12-31 23:46:58 +01:00
Folkert
8897d96e5e get uniq working (treat non-rec as rec with one def) 2019-12-31 23:11:22 +01:00
Folkert
01ec6726d7 make infer work again
This required a change to the `successors` function, used by the topological sort. It must return only the successors defined in the local scope, otherwise
a unwrap in the graph code will trigger a panic. This is safe because symbols outside of the local scope (either further up or lower down) cannot form a cycle
2019-12-31 23:05:27 +01:00
Folkert
09abd99bba make canonicalization tests pass 2019-12-31 21:44:02 +01:00
Folkert
d66317c687 use topological_sort_into_groups 2019-12-31 21:24:55 +01:00
Folkert
bae6296d7d introduce Declaration
A declaration is either a single def, or a vector of recursive defs.
2019-12-31 20:31:10 +01:00
Folkert de Vries
c109cfceca
Merge pull request #91 from rtfeldman/constrain
Separate canonicalization and constrain phases
2019-12-31 15:05:05 +01:00
Chad Stearns
b6086a0b0f List formatting basics 2019-12-31 02:44:51 -05:00
Chad Stearns
9ebf931577 multi-line if condition formatting and some new commented out tests 2019-12-31 01:25:51 -05:00
Richard Feldman
13d9142603 Minor refactor 2019-12-30 22:25:02 -05:00
Richard Feldman
20be8f8d08 Split Defs into LetRec and LetNonRec 2019-12-30 21:59:35 -05:00
Richard Feldman
b6ebfb8537 Merge remote-tracking branch 'origin/trunk' into constrain 2019-12-30 21:59:19 -05:00
Richard Feldman
db524062ed
Merge pull request #90 from rtfeldman/optional-fields
Optional fields
2019-12-30 21:43:46 -05:00
Richard Feldman
4f742a5f4e Update Pathfinding to 2.0.3 2019-12-30 21:34:18 -05:00
Richard Feldman
28b913686d Disable load_and_infer for now 2019-12-30 20:33:05 -05:00
Richard Feldman
4b16ebdc18 Follow clippy's suggestions 2019-12-30 20:33:05 -05:00
Richard Feldman
ffd3cc4211 Constrain canonical exprs and modules 2019-12-30 20:33:05 -05:00
Folkert
d47abfb3a6 preparations for unifying optional fields 2019-12-30 16:52:57 +01:00
Folkert
13b3748996 fix record annotations
For literals, the extension variable was free. That is incorrect. so

    foo : { x : Int } -> Int

Would actually have type

    foo : { x : Int }* -> Int

Now the extension variable is `{}`, fixing this issue
2019-12-30 13:59:54 +01:00
Folkert
1f1a509b1e in types, distinguish between required and optional fields 2019-12-30 13:34:15 +01:00
Folkert
d8d045d122 parse optional fields 2019-12-30 12:42:24 +01:00
Richard Feldman
be2d20162c Canonicalize without constraining. 2019-12-29 19:47:52 -08:00
Folkert
c4971675eb add OptionalField constructor 2019-12-30 00:50:28 +01:00
Richard Feldman
7a07c19275 Move src/constrain.rs to src/constrain/mod.rs 2019-12-29 08:26:11 -08:00
Richard Feldman
1b4f7ccfa5
Merge pull request #89 from rtfeldman/const
Replace some functions with consts
2019-12-29 08:14:41 -08:00
Richard Feldman
be7bc99f56 Update a comment 2019-12-29 08:00:44 -08:00
Richard Feldman
e70e72f520 Use iter.chain() instead of two loops 2019-12-29 08:00:44 -08:00
Richard Feldman
b715d3e2f8 Replace Mark:: functions with consts 2019-12-29 08:00:43 -08:00
Richard Feldman
f04d8f5b03 Replace Rank::none() with Rank::NONE 2019-12-29 08:00:24 -08:00
Richard Feldman
cc874f347f
Merge pull request #86 from rtfeldman/empty-record
Remove empty record value
2019-12-25 14:56:31 -08:00
Richard Feldman
eb7adf05cb
Merge branch 'trunk' into empty-record 2019-12-25 14:49:54 -08:00
Richard Feldman
221cb97dd6
Merge pull request #87 from rtfeldman/unconstrained-variables
Unconstrained variables
2019-12-25 14:49:40 -08:00
Folkert
2ad129e6ad re-introduce canonical EmptyRecord
So now canonicalization will emit an EmptyRecord node for a record with
not fields. This means a special case in the second typechecker could be
removed.
2019-12-25 12:28:17 +01:00
Folkert
2baedcb150 rename ext_var -> stored_var 2019-12-25 12:19:11 +01:00
Folkert
31723bfcad remove unused var_store
Because Tag patterns no longer have a variable in them, the var_store isn't needed here.
Because the function is recursive clippy did not notice it was unused (I think it should though...)
2019-12-25 00:34:01 +01:00
Folkert
9a616e3aa4 constrain Variable for records 2019-12-25 00:22:25 +01:00
Folkert
9aee825391 remove EmptyRecord value from can/expr 2019-12-24 23:37:50 +01:00
Folkert
9a20f01257 remove empty record from parser 2019-12-24 21:59:30 +01:00
Richard Feldman
a8febac445
Merge pull request #85 from rtfeldman/tag-var
Remove Variable from Tag patterns
2019-12-24 10:15:38 -08:00
Richard Feldman
aa4bbee3f7 Drop obsolete comment 2019-12-24 10:03:12 -08:00
Richard Feldman
5ff26476fd Rename some things 2019-12-24 10:03:12 -08:00
Richard Feldman
9012cad4c2 Simplify return value 2019-12-24 10:03:12 -08:00
Richard Feldman
bd75a6f1f7 Remove Variable from Tag 2019-12-24 10:03:12 -08:00
Richard Feldman
9c62356732
Merge pull request #84 from rtfeldman/reuse-variables
Uniqueness type updates
2019-12-24 10:02:31 -08:00
Richard Feldman
9ff3928c01
Merge branch 'trunk' into reuse-variables 2019-12-24 08:59:54 -08:00
Richard Feldman
bda1c3ebd0
Merge pull request #81 from rtfeldman/ct/multi-line-if-condition
Tests for multiline if condition and if statement comments
2019-12-24 08:59:32 -08:00
Folkert
09c1e45ad5 use List variable 2019-12-24 17:34:26 +01:00
Folkert
c14120207c implement record patterns 2019-12-24 16:20:34 +01:00
Folkert
42728038c0 implement Access logic 2019-12-24 15:59:07 +01:00