Commit Graph

698 Commits

Author SHA1 Message Date
Richard Feldman
f47d96e1a4 Update a comment 2020-05-01 21:56:44 -04:00
Richard Feldman
5f33073703 fix tests 2020-05-01 19:30:55 -04:00
Richard Feldman
ee31eac0c5 Code gen toplevel module functions 2020-05-01 19:30:55 -04:00
Richard Feldman
5c31369072 Code gen thunks for top-level module decls 2020-05-01 19:30:55 -04:00
Richard Feldman
072cf4e844 Revert "wip canonical builtins in modules"
This reverts commit e1935a1e9f0c7ea1ffefe5f2f4f07f2c7666363b.
2020-05-01 19:30:55 -04:00
Richard Feldman
a1750567ff wip canonical builtins in modules 2020-05-01 19:30:55 -04:00
Richard Feldman
a70f6cfdb0
Merge branch 'trunk' into int-ne 2020-05-01 18:43:15 -04:00
Chad Stearns
d1b00633be INT NEQ for i1 and i8 integer types 2020-05-01 17:29:43 -04:00
Chad Stearns
4b5f7bfded Changed Int div implementation to use != 2020-05-01 17:29:12 -04:00
Chad Stearns
6b6e6f0eec Changed Int div implementation to use != 2020-05-01 17:17:41 -04:00
Chad Stearns
71258e0e59 Implemented INT_NE_i64 2020-05-01 16:31:19 -04:00
Chad Stearns
51d6530a7f Commented in DivByZero test 2020-05-01 01:52:15 -04:00
Chad Stearns
0518ccc991 Remove INT_DIV from std.rs 2020-04-29 18:22:25 -04:00
Chad Stearns
516f5736c2 Merging in remote trunk 2020-04-29 18:01:55 -04:00
Chad Stearns
9107880928 Implemented generated built in int division, with the return type as a result 2020-04-29 17:36:02 -04:00
Richard Feldman
cea7233b92 Fix some indentation 2020-04-29 07:11:20 -04:00
Richard Feldman
35f99680ba Use indoc! more 2020-04-29 07:10:59 -04:00
Richard Feldman
570f387f0d Drop some obsolete dead_code annotations 2020-04-29 07:05:43 -04:00
Richard Feldman
42a03303ca Add a quicksort test to gen_builtins 2020-04-29 07:05:26 -04:00
Folkert
c11ac52a4b fix num/int bug
we called the function with the wrong type variable. now there are two functions, handling both cases
2020-04-29 12:28:13 +02:00
Richard Feldman
dc49656c34 Add some List.get tests 2020-04-28 19:46:42 -04:00
Richard Feldman
353377c29e Re-enable List.get 2020-04-28 19:46:33 -04:00
Richard Feldman
c39b43a265 Code gen numeric comparisons 2020-04-28 18:33:51 -04:00
Richard Feldman
952e5fa012 clippity clip clippy 2020-04-27 20:35:19 -04:00
Richard Feldman
dfb1c2d8a3 Always store collections as (usize, usize) 2020-04-27 20:05:35 -04:00
Richard Feldman
32d6615108 Attempt to store i8 arrays for collection wrappers
This ultimately didn't work because the bitcasting we wanted wasn't allowed.
2020-04-27 20:04:38 -04:00
Richard Feldman
46bf6f4bee Reproduce List.first failing when given [] 2020-04-27 20:03:55 -04:00
Chad Stearns
10a99a6fc7 Merging in remote 2020-04-26 18:24:31 -04:00
Chad Stearns
0cfed05008 Implemented div unsafe 2020-04-26 18:11:46 -04:00
Chadtech
73da3c3f67
Merge branch 'trunk' into int-div 2020-04-26 14:39:03 -04:00
Chad Stearns
aa72619952 Implemenet code gen for int div 2020-04-26 14:38:09 -04:00
Richard Feldman
1bee16decd Temporarily disable List.get in favor of getUnsafe 2020-04-26 09:37:46 -04:00
Richard Feldman
52a3e0afb5 Don't fail gen tests for unused warnings 2020-04-26 09:33:12 -04:00
Richard Feldman
0c58eeea97 Use List.get instead of List.getUnsafe in tests 2020-04-26 09:33:12 -04:00
Richard Feldman
ac6e98361e Drop obsolete List.get hardcoded type 2020-04-26 09:33:08 -04:00
Richard Feldman
b7862f1dc1 Drop obsolete test 2020-04-26 09:10:40 -04:00
Richard Feldman
d4b1c7e68a Eagerly report more problems 2020-04-26 09:04:27 -04:00
Richard Feldman
a2e6c4ba12 Restore some things 2020-04-26 08:59:52 -04:00
Richard Feldman
511c7b7a21 Revise some builtins tests 2020-04-26 08:55:54 -04:00
Richard Feldman
9cc9789738 Merge remote-tracking branch 'origin/trunk' into list-get 2020-04-26 08:46:24 -04:00
Richard Feldman
310595c108 Revert "Only add builtins if they're referenced"
This reverts commit 8e9b02560e9b172def0e915631e1d116c64859f2.
2020-04-26 08:45:47 -04:00
Richard Feldman
d2a9d24626 Only add builtins if they're referenced 2020-04-26 08:45:47 -04:00
Richard Feldman
afbe871e6d wip 2020-04-26 08:45:41 -04:00
Folkert
cd4c28ca0c fix failing tests 2020-04-25 21:12:49 +02:00
Richard Feldman
d0c9c433a6 Have List.first return Err ListWasEmpty 2020-04-25 07:57:41 -04:00
Richard Feldman
75d46053ec Drop unused unique::result_type function 2020-04-25 07:53:30 -04:00
Richard Feldman
24ff91b45a Add a List.first test 2020-04-25 07:52:43 -04:00
Richard Feldman
e78b126207 Give List.first the right name 2020-04-25 07:51:56 -04:00
Richard Feldman
a399614824 Use helpers in can builtins 2020-04-25 07:51:45 -04:00
Richard Feldman
a0512a5f97 Add some List.len and List.isEmpty tests 2020-04-25 07:05:19 -04:00
Richard Feldman
d6a5cc14b6 Fix a comment 2020-04-25 07:05:19 -04:00
Richard Feldman
bac940e116 Fix hardcoded List.isEmpty type 2020-04-25 07:05:18 -04:00
Richard Feldman
d0da4bf926 Remove obsolete hardcoded List.get types 2020-04-25 07:03:33 -04:00
Richard Feldman
034f1c916a Load canonical builtins in gen tests 2020-04-25 07:01:30 -04:00
Richard Feldman
b77b3bda14 Add some List.len and List.isEmpty tests 2020-04-25 07:01:02 -04:00
Richard Feldman
d6d453d120 Add a TODO comment 2020-04-25 07:00:44 -04:00
Richard Feldman
5a22348f35 Fix a comment 2020-04-25 07:00:34 -04:00
Richard Feldman
9dd9b7951d Fix hardcoded List.isEmpty type 2020-04-25 07:00:24 -04:00
Richard Feldman
243bbf4790 Revert changes to mono/ from List.get attempts 2020-04-25 06:30:01 -04:00
Richard Feldman
bff89e7e2e Remove DEFAULT_CALLING_CONVENTION 2020-04-25 06:30:01 -04:00
Richard Feldman
b43e582c7a Add intrinsics for sqrt and round 2020-04-25 06:30:01 -04:00
Folkert
0191910715 fix clippy's newly-learned warnings 2020-04-25 06:30:01 -04:00
Folkert
0a1cf805f9 handle Unboxed 2020-04-25 06:30:01 -04:00
Folkert
3e36bea700 improve formatting of records in pattern exhaustiveness errors 2020-04-25 06:30:01 -04:00
Folkert
8284575a47 fix formatting of ctor patterns in errors 2020-04-25 06:30:01 -04:00
Folkert
dc320e9fd9 fix ordering bug in pattern exhaustiveness 2020-04-25 06:30:01 -04:00
Folkert
f8b540b6f4 use tag id instead of name in exhaustiveness checking 2020-04-25 06:30:01 -04:00
Richard Feldman
07001131b2 Add can::builtins 2020-04-25 06:30:01 -04:00
Richard Feldman
6b952e0c98 Revert "Attempt to add List.get to mono/"
This reverts commit 49d24e8202cf59d0b47ca397fe0c150d0620da20.
2020-04-25 06:19:13 -04:00
Richard Feldman
c28f00ecb2 Attempt to add List.get to mono/ 2020-04-25 06:19:13 -04:00
Richard Feldman
d97e16de7e Revert "Attempt a mono/ approach for List.get"
This reverts commit f0b76f41da.
2020-04-25 06:19:10 -04:00
Richard Feldman
f0b76f41da Attempt a mono/ approach for List.get 2020-04-25 06:19:06 -04:00
Richard Feldman
aac5077c8b Remove DEFAULT_CALLING_CONVENTION 2020-04-23 17:41:05 -04:00
Richard Feldman
5b7a16afad Add intrinsics for sqrt and round 2020-04-23 17:41:05 -04:00
Folkert
81769b4e65 fix clippy's newly-learned warnings 2020-04-23 22:12:24 +02:00
Folkert
b433988fde Merge remote-tracking branch 'origin/trunk' into pattern-exhaustiveness-records 2020-04-23 21:57:09 +02:00
Folkert
4530aa8c07 handle Unboxed 2020-04-23 21:55:21 +02:00
Folkert
848764cb25 improve formatting of records in pattern exhaustiveness errors 2020-04-23 21:49:24 +02:00
Folkert
c54d61c854 fix formatting of ctor patterns in errors 2020-04-23 20:30:42 +02:00
Folkert
b2a713915b fix ordering bug in pattern exhaustiveness 2020-04-23 20:12:40 +02:00
Richard Feldman
5992b42ebe Remove unnecessary conditionals 2020-04-22 23:35:57 -04:00
Richard Feldman
04ec592eeb Revert "Thread ret_layout through CallByName"
This reverts commit 632d4eca92.
2020-04-22 08:33:53 -04:00
Richard Feldman
a1b670d2a5 Revert "Extract build_tag"
This reverts commit e998a31cf9.
2020-04-22 08:33:26 -04:00
Richard Feldman
9d37f7ae73 s/IndexOutOfBounds/OutOfBounds/g 2020-04-22 08:32:31 -04:00
Richard Feldman
632d4eca92 Thread ret_layout through CallByName 2020-04-22 08:30:41 -04:00
Richard Feldman
c450a67421 Add some tag code gen tests 2020-04-22 08:30:41 -04:00
Richard Feldman
e998a31cf9 Extract build_tag 2020-04-22 08:30:41 -04:00
Chad Stearns
5ca1174f78 Another when condition test 2020-04-21 23:49:26 -04:00
Chad Stearns
73744b3b1d Merge branch 'trunk' of github.com:rtfeldman/roc into format-precedence-conflict 2020-04-21 23:40:13 -04:00
Chad Stearns
8e86146963 Lots of new tests. Lots of commented-in tests. Tests that had a lot of assertions broken out into separate tests 2020-04-21 23:40:08 -04:00
Chad Stearns
ffdce07d29 fixed formatting error for if statement formatting 2020-04-21 23:39:22 -04:00
Chad Stearns
c3d296a026 fixed formatting error for when formatting 2020-04-21 23:38:04 -04:00
Chad Stearns
ac85f86b9e Removed panics 2020-04-21 23:37:00 -04:00
Folkert
f0aa598ff9 use tag id instead of name in exhaustiveness checking 2020-04-21 16:24:43 +02:00
Folkert de Vries
e00356d0c4
Merge branch 'trunk' into refactor-specializations 2020-04-18 23:35:21 +02:00
Richard Feldman
53ecf6df3e Drop some unnecessary parens 2020-04-18 15:32:17 -04:00
Richard Feldman
f0d76825d2 Extract specializations from PartialProc 2020-04-18 11:24:25 -04:00
Richard Feldman
ea713023e8 Add explicit OptLevel to add_passes 2020-04-16 20:26:08 -04:00
Richard Feldman
2a03a74135 Use the equivalent of -O3 in Inkwell 2020-04-16 19:26:25 -04:00
Richard Feldman
1c1fee7e31 Trim trailing space off pretty_assertions dep 2020-04-16 19:24:24 -04:00
Folkert
aea48f703a working parser error 2020-04-16 01:30:28 +02:00
Folkert
719ef5b70e parse error infrastructure 2020-04-15 21:10:42 +02:00
Folkert
e21cdfc689 bring parse errors into the reporting tests 2020-04-15 19:49:05 +02:00
Richard Feldman
1517581ced Load main in the CLI and use it for gen 2020-04-15 07:06:11 -04:00
Richard Feldman
9ca754b8fd First pass at loading modules from cli 2020-04-15 07:06:11 -04:00
Richard Feldman
62186fdda4 Add load tests for apps 2020-04-15 07:06:11 -04:00
Richard Feldman
6c6e1d9ee3 Update some interface tests 2020-04-15 07:06:11 -04:00
Richard Feldman
d994d11760 Parse app module headers. 2020-04-15 07:06:11 -04:00
Richard Feldman
5980bc38da Merge remote-tracking branch 'origin/trunk' into order-of-ops 2020-04-15 05:03:42 -04:00
Folkert
c42b5a1e5b improved phantom type message 2020-04-14 21:27:29 +02:00
Folkert
7e4a1ef4bd better message for duplicate fields/tags 2020-04-14 21:18:37 +02:00
Chad Stearns
3f7d1cf33a Merge branch 'trunk' of github.com:rtfeldman/roc into format-precedence-conflict 2020-04-13 22:30:34 -04:00
Folkert
18c6c37c04 fix self-recursive alias case 2020-04-14 01:33:16 +02:00
Folkert
63bc923b37 remove panic 2020-04-13 22:54:24 +02:00
Folkert
f6af66f342 record, tag, alias errors
- duplicate fields and tags are reported
- circular aliases are reported
2020-04-13 20:53:16 +02:00
Folkert
0372b34e86 fix comments 2020-04-12 22:00:44 +02:00
Folkert
c69b0d69e5 fix enum and bool pattern match suggestions 2020-04-12 21:47:15 +02:00
Folkert
7632a4b484 highlight code snippets better 2020-04-12 20:59:16 +02:00
Folkert
c326b09964 errors for patterns 2020-04-12 16:39:54 +02:00
Folkert
97c10e1211 setup for mono reports 2020-04-12 01:56:57 +02:00
Folkert
d15bd07bf4 de-alias when diffing with a non-alias
When one of the types in a comparison is an alias, elm does not de-alias it.
That is really annoying if e.g. the alias is of a record and you used an invalid field: the field suggestion error does not kick in
2020-04-11 23:57:00 +02:00
Folkert
2811f978a4 make a Index data type 2020-04-11 20:40:25 +02:00
Folkert
ab19529077 record update hints 2020-04-11 14:55:12 +02:00
Folkert
06cd298126 add cycle helper 2020-04-10 23:26:30 +02:00
Folkert
931567ac4d a working state again 2020-04-10 22:07:02 +02:00
Folkert
3187138084 WIP convert all the type_error things 2020-04-10 18:07:16 +02:00
Folkert
1672b89e19 circular types with pretty 2020-04-10 14:48:34 +02:00
Folkert
fcb62cdf8e add titles to errors 2020-04-09 23:58:28 +02:00
Folkert
c2ad8dfe7e use pretty.rs more 2020-04-09 23:27:11 +02:00
Folkert
fd7ca5bcc9 don't add guarded record fields into scope 2020-04-09 01:08:09 +02:00
Folkert
85e2cf4465 add a bunch of hints 2020-04-09 01:08:09 +02:00
Folkert
5e226ee5f4 convert type problems into pretty doc 2020-04-09 01:08:09 +02:00
Folkert
a587e31897 complete pattern_to_doc 2020-04-09 01:08:09 +02:00
Richard Feldman
9288e20469 Upgrade to LLVM 10 2020-04-08 06:41:53 -04:00
Folkert
7e4e3c93d5 cleanup 2020-04-07 21:12:56 +02:00
Folkert
7f999a06f3 add When pattern errors 2020-04-07 18:06:00 +02:00
Folkert
2d1a1621c3 add NoExpectation type error 2020-04-07 13:35:38 +02:00
Folkert
ccd021a755 add FnCall error message 2020-04-07 13:31:48 +02:00
Folkert
02e42b0abc add from annotation cases 2020-04-06 22:59:21 +02:00
Folkert
67f8f2e943 improve tag union errors 2020-04-06 21:40:54 +02:00
Folkert
3f4346f573 stop unification when ext vars don't unify 2020-04-06 21:40:54 +02:00
Folkert
2d6e47b8a6 test for record diff 2020-04-06 21:40:54 +02:00
Folkert
fc8d9c2fd9 record diff 2020-04-06 21:40:54 +02:00
Folkert
7818e84316 convert ErrorType to ReportText 2020-04-06 21:40:54 +02:00
Folkert
854ffdae5e stylistic improvements 2020-04-06 21:40:54 +02:00
Richard Feldman
945ee879db s/List.length/List.len 2020-04-06 06:23:00 -04:00
Richard Feldman
002fda7b55 Expand stack size further 2020-04-06 06:22:24 -04:00
Richard Feldman
954ec9eb24 Drop obsolete test 2020-04-06 06:21:38 -04:00
Richard Feldman
fbeaafc91b Fix canoncalization errors in solve tests 2020-04-05 23:30:39 -04:00
Richard Feldman
7ad4fb0e68 Add List.concat 2020-04-05 23:30:39 -04:00