Commit Graph

1091 Commits

Author SHA1 Message Date
Richard Feldman
bd8480284f Report the first runtime error among multiple 2020-07-15 20:57:46 -04:00
Chad Stearns
c9869e67c1 Regress to functional first loop, and no second loop 2020-07-14 22:05:55 -04:00
Chad Stearns
a5462b1043 Second loop in List append (non-functional) 2020-07-14 21:50:35 -04:00
Folkert
331a8ed5eb error message for record update and missing module 2020-07-14 23:37:19 +02:00
Folkert
27317110f2 add comment describing solving process 2020-07-14 23:13:37 +02:00
Richard Feldman
764eda0780 Fix anonymous function specialization 2020-07-12 23:53:58 -04:00
Richard Feldman
2318384740 Revert "Drop unnecessary specialization"
This reverts commit ff7429cab4.
2020-07-12 23:44:05 -04:00
Richard Feldman
c6a0970b73 Defer specialization by one level only 2020-07-12 23:43:55 -04:00
Richard Feldman
ff7429cab4 Drop unnecessary specialization 2020-07-12 23:39:55 -04:00
Richard Feldman
0ab655fda4 Fix another test 2020-07-12 23:02:31 -04:00
Richard Feldman
5e687cc71c Fix a test 2020-07-12 22:58:52 -04:00
Richard Feldman
5f86ac1d10 Never use the specialization queue, for now 2020-07-12 22:53:03 -04:00
Richard Feldman
c2bc98ea4b Only use pending specializations for other modules 2020-07-12 22:53:03 -04:00
Richard Feldman
0b6053e2f6 Reproduce some more type checking bugs 2020-07-12 22:53:03 -04:00
Richard Feldman
5fe30be9f5 s/negate/neg 2020-07-12 22:53:03 -04:00
Richard Feldman
b8a9a3ef42 Account for return types being different in the uniqueness case 2020-07-12 22:53:03 -04:00
Richard Feldman
814ca7c7cc Format some comments 2020-07-12 22:53:03 -04:00
Richard Feldman
a356e8a0f7 Add uniqueness types for List.first 2020-07-12 22:53:03 -04:00
Richard Feldman
e4915985f7 Re-disable first_empty_list 2020-07-12 22:53:03 -04:00
Richard Feldman
71d87e5772 Revert "Add build_trap"
This reverts commit a43903ab1b088ba82f475f12460a05c706a1bf4e.
2020-07-12 22:53:03 -04:00
Richard Feldman
dd1cc5d24e Revert "Try having build_expr return Either"
This reverts commit 2f065f05892fdc188cfdd8f42e878bebe79879cf.
2020-07-12 22:53:03 -04:00
Richard Feldman
70ceaac9ff Try having build_expr return Either 2020-07-12 22:53:03 -04:00
Richard Feldman
7aaf37f4d1 Add build_trap 2020-07-12 22:53:03 -04:00
Richard Feldman
7c0359c6bf Revert "(REVERT THIS!) Temporarily disable some tests"
This reverts commit 0ed1892329.
2020-07-12 22:53:03 -04:00
Chad Stearns
1221ef3c76 Switched order of checking layout and list length for list reverse implementation 2020-07-12 17:11:26 -04:00
Chad Stearns
f807947ce4 Merging in remote, implemented basics of List append in many modules 2020-07-12 14:35:22 -04:00
Folkert
6bc657616d clean up comments 2020-07-12 00:37:05 +02:00
Folkert
362ff74b82 clean up annotation canonicalization 2020-07-12 00:36:11 +02:00
Folkert
d7b2dc7a3b fix test failures caused by def reordering 2020-07-11 02:01:23 +02:00
Folkert
46639c5081 cleanup and comments 2020-07-11 01:51:38 +02:00
Folkert
ba38d4ec14 cleanup 2020-07-10 23:54:00 +02:00
Folkert
d6bdb45c82 Back in working order 2020-07-10 23:54:00 +02:00
Folkert
9aa05fdc4c WIP 2020-07-10 23:54:00 +02:00
Folkert
36ccafd8ab cleanup 2020-07-10 23:54:00 +02:00
Folkert
d61b8c88a1 implement Formattable for Pattern 2020-07-10 23:54:00 +02:00
Folkert
e18d3bbfe4 use Parens type in pattern formatting 2020-07-10 23:54:00 +02:00
Richard Feldman
6046d8ee8e Share more variables between builtins 2020-07-10 23:54:00 +02:00
Richard Feldman
f847693b7f Use debug_assert_eq! more 2020-07-10 23:54:00 +02:00
Folkert de Vries
3a6edd6594
Merge branch 'trunk' into format-annotations 2020-07-09 18:10:20 +02:00
Folkert
1ac1dd1f8f it does help when you add the new file 2020-07-09 18:05:17 +02:00
Folkert
672b67d527 initial version of annotation formatting 2020-07-09 17:41:21 +02:00
Folkert
732496231c expand some comments 2020-07-08 14:30:48 +02:00
Folkert
b7c35665aa report empty non-base-10 integers 2020-07-08 14:18:02 +02:00
Richard Feldman
2ea527a293 Fix missing function in --release builds 2020-07-07 22:55:07 -04:00
Richard Feldman
6eef203e99 Ignore zero-sized fields when unwrapping tag structs 2020-07-07 22:54:58 -04:00
Richard Feldman
ceefdc73b1 clippy stuff 2020-07-07 22:36:27 -04:00
Richard Feldman
4f007dd535 Drop unnecessary .into() 2020-07-07 22:36:24 -04:00
Richard Feldman
0ed1892329 (REVERT THIS!) Temporarily disable some tests
I want to merge this to prevent further merge
conflicts, and these seem fine to debug post-merge.
2020-07-07 22:34:09 -04:00
Richard Feldman
7938a31ce3 Re-add List.reverse (missed in merge) 2020-07-07 22:29:18 -04:00
Richard Feldman
cdce98d14f Unwrap the struct inside a single-tag union 2020-07-07 22:07:34 -04:00
Richard Feldman
2337d6638e Temporarily disable can_inline 2020-07-07 21:11:56 -04:00
Richard Feldman
1cd49689c2 Merge remote-tracking branch 'origin/trunk' into low-level-ops 2020-07-07 21:09:50 -04:00
Richard Feldman
e78064c037
Merge branch 'trunk' into number-error-reporting 2020-07-07 18:48:39 -04:00
Richard Feldman
6e290c4a82
Merge branch 'trunk' into uniqueness-pretty-printing 2020-07-07 18:42:52 -04:00
Folkert de Vries
593fe5ac56
Merge branch 'trunk' into number-error-reporting 2020-07-07 23:16:39 +02:00
Folkert
4aa66b2585 update comment 2020-07-07 22:56:46 +02:00
Folkert
edb79b8fce pretty error messages for floats 2020-07-07 22:53:54 +02:00
Folkert
9d67b11c0d pretty error messages for integers 2020-07-07 22:10:23 +02:00
Folkert
308a24b080 Revert "accept a newline and body when patterns are different"
This reverts commit a0d39ff10f.
2020-07-07 20:17:59 +02:00
Folkert
28ba5e6a99 fix other num functions 2020-07-07 19:02:05 +02:00
Folkert
1af180da48 fix div_f64 2020-07-07 18:54:43 +02:00
Folkert
a7971c738a fix f64_sqrt 2020-07-07 18:52:28 +02:00
Folkert
58dfeba043 accept a newline and body when patterns are different 2020-07-07 17:26:45 +02:00
Folkert
1b4c5cac25 fix failing tests 2020-07-07 17:17:55 +02:00
Richard Feldman
6bde717df8 Add some more i64_abs tests 2020-07-06 22:28:02 -04:00
Richard Feldman
35b653636b Fix Num.abs for ints 2020-07-06 22:27:53 -04:00
Richard Feldman
8d2961c81e Narrow down the problem with f64_sqrt and div_f64 2020-07-06 21:48:39 -04:00
Richard Feldman
9305ecc9bd Specify which test passed or failed 2020-07-06 21:25:54 -04:00
Richard Feldman
b5ad6e17b4 Don't print subs on error
It's way too verbose and unhelpful!
2020-07-06 21:23:59 -04:00
Folkert
ea314be5a2 sort in pretty printing for stable results 2020-07-06 21:46:15 +02:00
Folkert
e595c14fae wip 2020-07-06 20:38:10 +02:00
Richard Feldman
c28dd8fd19 Fix set_unique_int_list test 2020-07-05 22:58:07 -04:00
Richard Feldman
f584f4a226 Temporarily disable a test
It's not urgently important, and this branch needs to get merged!
2020-07-05 22:57:40 -04:00
Richard Feldman
57d84bdcc4 Fix polymorphic identity test 2020-07-05 22:51:46 -04:00
Richard Feldman
092df6ddb2 Account for unwrapped structs in AccessAtIndex 2020-07-05 22:41:07 -04:00
Richard Feldman
853462833c Unwrap around zero-sized record fields in code gen 2020-07-05 22:24:19 -04:00
Richard Feldman
e559deecbf Improve LLVM verification error messages 2020-07-05 22:24:04 -04:00
Richard Feldman
290d68c99e Drop obsolete test_opt
We no longer check for in-place mutations as a transformation on
mono::Expr. Instead, in-place optimizations are done during code gen.
2020-07-05 22:11:32 -04:00
Chad Stearns
09af8a3b8d Add tests to list push to handle cases like we recently solved regarding List.reverse and List.repeat 2020-07-05 15:55:55 -04:00
Chad Stearns
b76033525f Fix memory with with List.repeat creating large lists, and fix problem with List.repeat operating on empty lists with real layout 2020-07-05 15:45:28 -04:00
Folkert
a0d39ff10f accept a newline and body when patterns are different 2020-07-05 18:34:28 +02:00
Richard Feldman
250fcd1fb0 Start at the last element in the list 2020-07-05 09:06:02 -04:00
Richard Feldman
261f252f06 Reproduce List.reverse code gen crash 2020-07-05 08:57:16 -04:00
Richard Feldman
e0a8d12428 Drop unused elem_bytes declaration 2020-07-04 22:56:23 -04:00
Richard Feldman
563436e6be Try using list_len over len 2020-07-04 22:56:23 -04:00
Richard Feldman
4cd9b72859
Merge branch 'trunk' into list-reverse 2020-07-04 22:56:07 -04:00
Richard Feldman
f442cec2da Fix test_load 2020-07-04 22:20:43 -04:00
Richard Feldman
4edd40887a Fix solve_uniq_expr tests 2020-07-04 22:18:35 -04:00
Richard Feldman
73d920e96f Restore uniq::sharing 2020-07-04 22:13:04 -04:00
Chad Stearns
4e7f40ab0f Evaluate if the list to be reversed has a length greater than 0, and match on the layout type EmptyList. We need to do both 2020-07-04 19:45:46 -04:00
Chad Stearns
5fda2de4f2 Merge branch 'trunk' of github.com:rtfeldman/roc into list-reverse 2020-07-04 18:12:06 -04:00
Chad Stearns
78fc5d2fec List append symbol and partial implementation 2020-07-04 18:11:57 -04:00
Folkert
b7d689226c cover all parsed patterns with an error message
but, some invalid patterns are not parsed as expected. See https://github.com/rtfeldman/roc/issues/399
2020-07-04 20:39:49 +02:00
Folkert
0c7a4179aa report malformed int and float patterns 2020-07-04 20:29:37 +02:00
Richard Feldman
06c05e5e9b Try using inlining in test_usage_analysis 2020-07-04 14:26:05 -04:00
Richard Feldman
8665f23a29 Inline LetRec and LetNonRec 2020-07-04 10:57:20 -04:00
Richard Feldman
319da4141e Fix some inlining logic 2020-07-04 10:35:37 -04:00
Richard Feldman
426531cf59 Add a TODO to can_inline 2020-07-04 10:23:14 -04:00
Richard Feldman
1926adb543 Fix inlining and test 2020-07-04 10:23:01 -04:00
Richard Feldman
3e5627689f Add basic inline function and a failing test 2020-07-04 10:22:55 -04:00
Richard Feldman
6a38e8b2de Merge remote-tracking branch 'origin/trunk' into inline-builtins 2020-07-03 23:38:15 -04:00
Richard Feldman
fe63ad394e Add a TODO to can_inline 2020-07-03 23:22:39 -04:00
Richard Feldman
99676b6e57
Merge branch 'trunk' into fix-constrain-todos 2020-07-03 23:18:09 -04:00
Richard Feldman
053db8449a Fix inlining and test 2020-07-03 23:16:32 -04:00
Richard Feldman
a1870457bf Add basic inline function and a failing test 2020-07-03 21:36:51 -04:00
Chad Stearns
185617b822 Builtins readme with instructions on how to add a new builtin 2020-07-03 16:54:17 -04:00
Chad Stearns
4b663a93c0 Switched many tests 2020-07-03 15:14:30 -04:00
Chad Stearns
9147661e02 More comments for List.reverse 2020-07-03 15:14:21 -04:00
Chad Stearns
d66cf913a9 Refactored the phi2 away 2020-07-03 14:20:34 -04:00
Folkert
98ac988e99 use symbols instead of identifiers; prevents cloning 2020-07-03 19:23:58 +02:00
Folkert
667233a00d report error for invalid alias argument patterns 2020-07-03 16:54:28 +02:00
Folkert
474d164a8c fix some comments 2020-07-03 16:21:09 +02:00
Folkert
744b8ce32b fix todos regarding InvalidCycle 2020-07-03 15:42:24 +02:00
Chad Stearns
fb7cbfdce4 LIST_REVERSE works, so long as the list is made up of ints equal to 1 2020-07-02 22:49:12 -04:00
Chad Stearns
7bd7e697b0 LIST_REVERSE works, so long as the list is made up of ints equal to 1 2020-07-02 22:39:58 -04:00
Chad Stearns
d8a8741aed Merge branch 'trunk' of github.com:rtfeldman/roc into list-reverse 2020-07-02 21:33:24 -04:00
Chad Stearns
f409e1827b Added LIST_REVERSE symbol and an untested implementation in build.rs 2020-07-02 21:33:15 -04:00
Richard Feldman
909b273083
Merge branch 'trunk' into annotation-def-match 2020-07-02 19:10:50 -04:00
Folkert
53c5297aac cleanup comment 2020-07-02 23:26:24 +02:00
Folkert
0cfb16c7d5 implement canonicalization error when signature pattern does not match definition pattern. 2020-07-02 23:24:10 +02:00
Folkert
5c81b46d1c remove clone 2020-07-02 23:22:55 +02:00
Folkert
a3c1788d48 Allelujah! Don't Trust! Assert! 2020-06-30 15:15:58 +02:00
Folkert
b89dc60d7e cleanup comment 2020-06-30 15:09:15 +02:00
Folkert
36e6950daa ensure VarId always encodes root var
otherwise variables with the same root, but different values would be different once imported in another module
2020-06-30 15:03:30 +02:00
Folkert
c589be43c6 fix triple (or more) mutualy recursive type aliases 2020-06-30 14:25:47 +02:00
Richard Feldman
1c16d0e776 Combine some imports 2020-06-30 07:55:25 -04:00
Folkert
5483ec819f fix infinite unfolding of recursive tag union 2020-06-30 13:54:16 +02:00
Richard Feldman
f5bcfd4dc4 use std::collections::HashMap 2020-06-30 07:54:13 -04:00
Richard Feldman
d744567f76 Add can builtins for List.push and List.repeat 2020-06-29 22:25:58 -04:00
Richard Feldman
d7203be7ad Use with_larger_debug_stack on gen_quicksort 2020-06-29 22:21:21 -04:00
Richard Feldman
38ab29ca3e Fix test module names 2020-06-29 22:18:28 -04:00
Richard Feldman
010a03926e Drop some duplicate type defs 2020-06-29 22:13:05 -04:00
Richard Feldman
dc4807bfcb Add low-level ops for ListPush, ListRepeat 2020-06-29 22:10:46 -04:00
Richard Feldman
8c96d12661 Merge trunk 2020-06-29 22:10:46 -04:00
Folkert
b4480e212a fix uniqueness attribute on nested recursive aliases 2020-06-29 17:08:39 +02:00
Folkert
e5ec7cbdcf clippy 2020-06-29 00:18:50 +02:00
Folkert
3fc2323891 fix recursion bug
previously, `Cons 1 (Cons {} Nil)` would get inferred as ConsList Int, because only the outer layer of a tag union was checked with the recursive tag union. Now this is done continually.
2020-06-29 00:18:50 +02:00
Folkert
bd086e5c9b fix rank issue for uniqueness 2020-06-29 00:18:50 +02:00
Folkert
e4384753fb add comments about alias uvar instantiation 2020-06-29 00:18:50 +02:00
Richard Feldman
81db9de8b5
Merge branch 'trunk' into container-rule-patterns 2020-06-28 16:21:34 -04:00
Richard Feldman
17dabdc8b7 Clippy 2020-06-28 15:39:13 -04:00
Richard Feldman
85f69b5927 Allow self-qualified lookups in modules 2020-06-28 15:37:44 -04:00
Richard Feldman
95fa81b414 Add failing test for self-qualified modules 2020-06-28 15:37:44 -04:00
Richard Feldman
83c3f7fc68 Update Num docs to use Len 2020-06-28 15:37:44 -04:00
Folkert
55e1e86dc2 cleanup 2020-06-27 23:56:53 +02:00
Folkert
229d98483c add docs 2020-06-27 23:27:00 +02:00
Richard Feldman
baa3debae2 Update cyclic alias test 2020-06-27 16:49:48 -04:00
Chad Stearns
2f440ecb6a Removed incorrect comment 2020-06-27 16:12:59 -04:00
Chad Stearns
20b0e986ad Merge branch 'list-push' of github.com:rtfeldman/roc into list-push 2020-06-27 15:12:01 -04:00
Chad Stearns
4e039125bf Make test for List.pushing bools just to make sure it works with different types 2020-06-27 15:11:18 -04:00
Chad Stearns
f72cf65f35 Use old size when copying memory in list_push 2020-06-27 15:10:55 -04:00
Folkert
41621bc509 fix test outputs
in some cases for aliases the outputs are not entirely correct yet. That's future work
2020-06-27 21:01:51 +02:00
Folkert
79f01e0604 loads of things 2020-06-27 16:20:30 +02:00
Folkert
ac18da302c add more tests 2020-06-26 13:59:32 +02:00
Richard Feldman
55045e1cea Fix some tests and docs 2020-06-25 22:11:46 -04:00
Richard Feldman
22cc618436 Split gen_builtins into gen_num and gen_list 2020-06-25 22:02:25 -04:00
Richard Feldman
714a81f40a Check denominator, not numerator 2020-06-25 22:02:11 -04:00
Richard Feldman
44477f98e9 Fix Num.sqrt, div, mod, and rem 2020-06-25 21:47:02 -04:00
Richard Feldman
ee52d52047 Fix List.get types 2020-06-25 21:22:32 -04:00
Folkert
3901cedf62 switch some variables around in test output 2020-06-26 01:14:17 +02:00
Folkert
e5997c4047 fix mutual recursive types
I'll write a bit more about this in the PR message
2020-06-26 01:03:55 +02:00
Richard Feldman
ae58ef914d Sort fields in one pass, and drop 0-sized fields 2020-06-25 01:49:59 -04:00
Richard Feldman
487c1e3b75 Derive more things for UnionVariant 2020-06-25 01:26:07 -04:00
Richard Feldman
ec953e9a15 Drop zero-sized record fields 2020-06-25 01:25:52 -04:00
Richard Feldman
46c43da1de Improve debug output 2020-06-25 01:25:33 -04:00
Richard Feldman
9faf47e5cd Fix an incomplete comment 2020-06-25 01:25:11 -04:00
Richard Feldman
72bdeb6e3c Avoid a clone 2020-06-25 00:41:33 -04:00
Richard Feldman
e0fc71526e Clean up some debugging info 2020-06-25 00:28:01 -04:00
Richard Feldman
72d865b753 Add a derive(Debug) 2020-06-25 00:15:02 -04:00
Richard Feldman
64482f8bfe Fix some indentation 2020-06-25 00:14:53 -04:00
Richard Feldman
0550af17d2 Fix some empty list edge cases 2020-06-25 00:02:52 -04:00
Richard Feldman
5cec577427 Fix return type of List.first 2020-06-24 23:52:54 -04:00
Richard Feldman
2332650785 Add cfg(debug_assertions) where appropriate 2020-06-24 23:15:12 -04:00
Richard Feldman
c5fbb05ce9 Fix an error message 2020-06-24 23:15:03 -04:00
Richard Feldman
27c19ad868 Reproduce List.first bug on wildcard empty list 2020-06-24 23:14:54 -04:00
Richard Feldman
0f36255f83 Fix List.first types 2020-06-24 23:08:25 -04:00
Richard Feldman
b3dfbeeec8 Fix some missing unary Num operation types 2020-06-24 21:56:56 -04:00
Folkert
055b01c463 rewrite uniqueness logic 2020-06-24 23:06:34 +02:00
Richard Feldman
35446348a3 Fix some vars 2020-06-23 23:50:20 -04:00
Richard Feldman
faa5f281fb Fix a memory access issue 2020-06-23 23:44:20 -04:00
Richard Feldman
14c31d55ee Fix List.set monomorphization 2020-06-23 23:42:12 -04:00
Richard Feldman
08be131eef Stop using List.getUnsafe in gen_builtins 2020-06-23 22:20:32 -04:00
Richard Feldman
93a2cd994d
Merge branch 'trunk' into list-push 2020-06-23 21:19:08 -04:00
Richard Feldman
4fdb39ee71 Delete some unused helpers 2020-06-23 21:17:51 -04:00
Richard Feldman
f350c0ed52 Fix List.len monomorphization 2020-06-23 21:14:23 -04:00
Richard Feldman
750523ba5c Fix List.single 2020-06-23 19:34:09 -04:00
Richard Feldman
30a95e90d1 Fix Num.toFloat 2020-06-23 19:31:50 -04:00
Richard Feldman
dd8dff0f9e Fix some unary ops 2020-06-23 19:17:39 -04:00
Richard Feldman
3309270747 Fix trig ops 2020-06-23 18:21:07 -04:00
Richard Feldman
1c98248b91 Ops for sqrt and round 2020-06-23 18:05:30 -04:00
Folkert
41ad8f2952 revise Map and cleanup 2020-06-23 21:16:29 +02:00
Folkert
b88dfcb537 revise Set 2020-06-23 15:36:02 +02:00
Folkert
6f1639959a use let_tvars for the Num, Int, Float, Bool 2020-06-23 15:08:23 +02:00
Folkert
c0c4f4c74b polish list signatures 2020-06-23 14:36:48 +02:00
Folkert
0696c5aa09 polish list signatures 2020-06-23 14:34:47 +02:00
Richard Feldman
9f8c48118f wip List.get 2020-06-22 23:30:11 -04:00
Richard Feldman
88990c8711 Move Int and Float modules into Num 2020-06-22 23:25:38 -04:00
Richard Feldman
3691152d20 Introduce the let_tvars! macro 2020-06-22 21:40:00 -04:00
Richard Feldman
0b106614f9 wip 2020-06-22 21:29:18 -04:00
Folkert
af33e26811 fix repeat 2020-06-23 00:02:36 +02:00