Commit graph

14474 commits

Author SHA1 Message Date
Richard Feldman
c2d5c1f5f8 Merge vars and scope 2020-01-02 04:45:46 -05:00
Richard Feldman
bd44326863 Make get_chained_defs be out of order 2020-01-02 04:29:47 -05:00
Richard Feldman
f937ff5cf4 Introduce Scope to code gen chained defs 2020-01-02 04:28:24 -05:00
Richard Feldman
ac55ae8525 Add failing test for code gen of chained defs 2020-01-02 04:28:24 -05:00
Richard Feldman
e056a4c6a5 Improve some error messages 2020-01-02 04:28:24 -05:00
Richard Feldman
14db322754 Add more gen defs tests 2020-01-02 04:28:24 -05:00
Richard Feldman
4984e66735 Drop obsolete resolved_vars 2020-01-02 04:28:24 -05:00
Richard Feldman
2b9086e711 Store only basic types in code gen defs 2020-01-02 04:28:18 -05:00
Richard Feldman
45a4740c99 Adopt clippy's suggestions 2020-01-02 02:12:34 -05:00
Richard Feldman
cac741ec8b Infer generated variable types 2020-01-02 02:11:55 -05:00
Richard Feldman
03ffecd9bd Add OptVariable::unwrap_or_else 2020-01-02 02:07:53 -05:00
Richard Feldman
f28a1212c2 Add a Debug instance for OptVariable 2020-01-02 02:07:43 -05:00
Richard Feldman
a547e51498 use &Subs over &mut Subs in code gen 2020-01-02 02:06:55 -05:00
Richard Feldman
71d2021f63 Add failing test for gen def 2020-01-02 02:05:29 -05:00
Richard Feldman
db8c3dd7c4 Code gen LetNonRec 2020-01-02 00:58:50 -05:00
Richard Feldman
0c3e569b3d Add TypedVal::into_basic_value 2020-01-02 00:58:35 -05:00
Richard Feldman
12f9bc845f Add Symbol::as_str() 2020-01-02 00:57:28 -05:00
Richard Feldman
eed195e761 Drop obsolete comment 2020-01-01 21:43:18 -05:00
Richard Feldman
c54a8f7e1a Drop the Float.div from without builtins test 2020-01-01 21:38:46 -05:00
Richard Feldman
fc323fff32 Add load_and_infer_without_builtins 2020-01-01 21:37:49 -05:00
Richard Feldman
9ae3a792f3 Extract more test helpers 2020-01-01 21:37:41 -05:00
Richard Feldman
e56e18b0ca Extract expect_types helper 2020-01-01 21:11:12 -05:00
Folkert
4f3f85f064 fix principality 2020-01-02 00:48:02 +01:00
Richard Feldman
e23bff79ac fixup! Reproduce principality bug 2020-01-01 17:02:50 -05:00
Richard Feldman
452e59c7a3 Allow converting from Variable to OptVariable 2020-01-01 17:02:22 -05:00
Richard Feldman
8d4c095ccb Enable copying 2020-01-01 17:02:22 -05:00
Richard Feldman
a5a4141e7e Reproduce principality bug 2020-01-01 17:02:22 -05:00
Richard Feldman
fbe57db010
Merge pull request #96 from rtfeldman/let-rec
WIP: LetNonRec
2020-01-01 17:01:54 -05:00
Folkert
28f58bb768 sort cyclic definitions alphabetically 2020-01-01 22:54:01 +01:00
Folkert
7c8597eb03 remove format before into()
I think this didn't work before because something was wrong in the context, and it didn't know which instance to pick
2020-01-01 22:49:35 +01:00
Folkert
a2f462bc02 remove dbg and add comment 2020-01-01 22:28:37 +01:00
Richard Feldman
95e3b602f2
Merge branch 'trunk' into let-rec 2020-01-01 16:11:32 -05:00
Richard Feldman
78fe53e520
Merge pull request #99 from rtfeldman/inlinable-string
Use InlinableString
2020-01-01 16:11:25 -05:00
Richard Feldman
e69453de02
Merge branch 'trunk' into inlinable-string 2020-01-01 16:03:22 -05:00
Richard Feldman
54e26967a7
Merge pull request #100 from rtfeldman/null-vars
Null vars
2020-01-01 16:03:12 -05:00
Folkert
d0d121ad29 add tests for valid and invalid recursion 2020-01-01 21:58:08 +01:00
Richard Feldman
d68b54f763 Rename CI step from rustfmt to cargo fmt 2020-01-01 15:41:10 -05:00
Richard Feldman
3f9b146d01 cargo fmt 2020-01-01 15:40:59 -05:00
Folkert
dc4ac20fcd properly generate lets
The topological sort into groups only give groups whose elements are equivalent with regards to the topological sort. But there may still be internal cycles withing a group, or the group can contain no mutual recursive definitions at all! So we must look more carefully at the groups, using the strongly connected components.

So that is what happens now: The normal analysis uses a modified successor function that is syntactic: it gives all symbols in a definition's body, even (especially!) those behind a lambda.
With this, we can separate recursive functions from non-recursive ones.

Then a second analysis is needed to crudely spot invalid recursion, of the kind `x = x`. Here, we don't want to look behind a lambda.

I also had to change some test cases to actually use a symbol in the result: this analysis doesn't run for unused symbols.
2020-01-01 21:36:49 +01:00
Richard Feldman
7e414fb854 Follow clippy's advice 2020-01-01 15:34:12 -05:00
Richard Feldman
3605d5bba9 Refactor out new_for_testing_only 2020-01-01 15:33:01 -05:00
Richard Feldman
784b22a28e Make and use a newtype for OptVariable 2020-01-01 15:29:05 -05:00
Richard Feldman
5cb9a4ba2d Use Variable::NULL with copy 2020-01-01 15:14:45 -05:00
Richard Feldman
69d6a6c7b0 Introduce Variable::NULL with id 0 2020-01-01 15:14:45 -05:00
Richard Feldman
41eec797a2 Globally disable clippy:large_enum_variants 2020-01-01 14:26:16 -05:00
Richard Feldman
cebcdafe93 Use InlinableString over Box<str> 2020-01-01 06:02:14 -05:00
Richard Feldman
0d801d01ea Use as_str over into_str 2020-01-01 06:00:30 -05:00
Richard Feldman
6e4eae8100
Merge branch 'trunk' into let-rec 2020-01-01 04:36:42 -05:00
Richard Feldman
3b008b69a8
Merge pull request #92 from rtfeldman/ct/multi-line-if-condition-1
Multi line if conditions
2020-01-01 04:36:29 -05:00
Richard Feldman
6bb19246dc
Merge branch 'trunk' into ct/multi-line-if-condition-1 2020-01-01 04:29:15 -05:00