Commit graph

378 commits

Author SHA1 Message Date
Richard Feldman
8ac0d3b493
Fix unused var in release builds 2023-01-13 03:23:42 -05:00
Richard Feldman
eaf8ce6c08
Add a debug_assert! about tag union polarity 2023-01-12 16:22:35 -05:00
Richard Feldman
e291e0ee99
Combine some match branches 2023-01-12 16:21:33 -05:00
Richard Feldman
717350ef9e
FlexAbleVar sets should be equal if the vars are. 2023-01-12 16:20:36 -05:00
Richard Feldman
63161b5330
Remove a debug print 2023-01-12 16:16:50 -05:00
Richard Feldman
f959db588c
Show ellipses on single-field record diffs 2023-01-11 23:58:22 -05:00
Richard Feldman
863c39be54
Fix typo in variable name 2023-01-11 23:54:20 -05:00
Richard Feldman
f3a65e5799
Fix single-line record type formatting 2023-01-11 23:54:05 -05:00
Richard Feldman
d47a4e24d3
Initialize counter to 0, not 1 2023-01-11 23:53:27 -05:00
Richard Feldman
92f94a00b4
Render ellipses in a different color 2023-01-11 23:18:54 -05:00
Richard Feldman
d9a582e447
Render { … } types on the same line 2023-01-11 23:18:54 -05:00
Richard Feldman
dc8eb81bb2
Omit more unnecessary fields from record diffs 2023-01-11 23:18:53 -05:00
Richard Feldman
148119c6b4
Don't report how many fields were omitted. 2023-01-11 23:18:53 -05:00
Richard Feldman
1787d0c679
Report how many record fields were omitted 2023-01-11 23:18:53 -05:00
Richard Feldman
59208ffc40
Omit record fields from diff if they're identical 2023-01-11 23:18:53 -05:00
Richard Feldman
e7466c9485
Rename traverse to diff_args 2023-01-11 23:18:53 -05:00
Richard Feldman
bc14855c59
Report multi-field record types as multiline 2023-01-11 23:18:52 -05:00
Folkert de Vries
d8b2ff07f8
Merge pull request #4802 from roc-lang/valgrind-unit-tests
Valgrind unit tests
2023-01-11 19:45:28 +01:00
Joshua Warner
94070e8ba6
Improve parsing of scalar literals
* Unify parsing of string literals and scalar literals, to (e.g.) ensure escapes are handled uniformly. Notably, this makes unicode escapes valid in scalar literals.
* Add a variety of custom error messages about specific failure cases of parsing string/scalar literals. For example, if we're expecting a string (e.g. a package name in the header) and the user tried using single quotes, give a clear message about that.
* Fix formatting of unicode escapes (they previously used {}, now correctly use () to match roc strings)
2023-01-07 15:12:52 -08:00
Joshua Warner
0da50a612d
Be more lenient with required indentation in collections
... and also remove a bunch of now-dead errors that can't be triggered.
2023-01-01 17:49:51 -08:00
Folkert
32e3f01a28
refactor printing error counts 2022-12-30 14:30:08 +01:00
Folkert
439befcc38
run cargo fmt 2022-12-23 17:19:54 +01:00
Lunarmagpie
f932bb66a0
Add function binding to error message 2022-12-23 11:07:57 -05:00
Lunarmagpie
3265a786a5
make changes suggested by folkertdev 2022-12-23 11:01:50 -05:00
Richard Feldman
e84b3c2704
Merge pull request #4781 from roc-lang/dbg-final-expression
parse error for dbg/expect final expressions
2022-12-19 23:36:51 -05:00
Folkert
d97fd98a33
parse error for dbg/expect final expressions 2022-12-16 22:47:53 +01:00
Richard Feldman
da595a86b0
Parse package module header 2022-12-04 06:26:44 -05:00
Ayaz Hafiz
705ce10085
New problem dropped 2022-12-02 14:14:18 -06:00
Ayaz Hafiz
66419e8f29
The yeah yeah yeahs 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
39f89e3d65
Get severity from type problem variants 2022-12-02 14:11:58 -06:00
Ayaz Hafiz
e438fbf37c
Enumerate severity on problem variants 2022-12-02 14:11:57 -06:00
Ayaz Hafiz
0a807dc43e
Provide warning for defs that are used only in (mutual) recursion
This patch provides errors for defs that are used only in
possibly-mutual recursion, and are not reachable outside of their
recursive closures. For example:

```
test_report!(
    mutual_recursion_not_reached_nested,
    indoc!(
        r#"
        app "test" provides [main] to "./platform"

        main =
            f = \{} -> if Bool.true then "" else g {}
            g = \{} -> if Bool.true then "" else f {}
            ""
        "#
    ),
@r###"
── DEFINITIONs ONLY USED IN RECURSION ──────────────────── /code/proj/Main.roc ─

These 2 definitions are only used in mutual recursion with themselves:

4│>      f = \{} -> if Bool.true then "" else g {}
5│>      g = \{} -> if Bool.true then "" else f {}

If you don't intend to use or export any of them, they should all be
removed!
"###
);
```
2022-12-02 11:50:12 -06:00
Richard Feldman
c1a75a57f1
Merge pull request #4592 from roc-lang/collections_refactor
Refactor collection_trailing_sep_e
2022-11-28 11:14:30 -05:00
Joshua Warner
451b2c0ded
Refactor collections 2022-11-26 09:55:54 -08:00
Richard Feldman
b2beeb770e
Merge remote-tracking branch 'origin/main' into https-packages 2022-11-25 19:50:06 -05:00
Richard Feldman
58fad36f9d
Merge pull request #4460 from roc-lang/crash
Crash
2022-11-25 17:18:21 -05:00
Folkert
165db8c885
make line and column numbers the same as editor (i.e. 1-based) 2022-11-25 17:55:27 +01:00
Richard Feldman
bef59299a2
Merge remote-tracking branch 'origin/main' into https-packages 2022-11-25 04:07:37 -05:00
Richard Feldman
5d4fa4eff1
clippy 2022-11-24 21:34:02 -05:00
Richard Feldman
54da1b1e3b
Print a newline at the end of dbg output 2022-11-24 20:39:04 -05:00
Richard Feldman
c63baa2ede
Print dbg output in blue in terminal 2022-11-24 20:38:52 -05:00
Richard Feldman
99f55d6ed6
Merge remote-tracking branch 'origin/main' into https-packages 2022-11-24 19:14:31 -05:00
Ayaz Hafiz
e2b30e5301
Constrain + solve crash 2022-11-24 14:46:50 -06:00
Ayaz Hafiz
9dc489c2b0
First pass constraining crash 2022-11-24 14:46:49 -06:00
Ayaz
848c18f996
Merge pull request #4567 from joshuawarner32/tuple-type-annotation
Implement tuple type parsing
2022-11-24 14:42:11 -06:00
Richard Feldman
b9b03d432a
Merge remote-tracking branch 'origin/main' into https-packages 2022-11-24 13:14:36 -05:00
Richard Feldman
ed0c64ca7c
Fix reporting tests 2022-11-24 11:54:51 -05:00
Joshua Warner
c6b5273144
Implement tuple type parsing
Also change some tests with newly relaxed indentation requirements, and remove an irrelevant test (since unindented close parens are now perfectly valid, the test is no longer useful).
2022-11-24 07:36:59 -08:00
Ayaz Hafiz
f8d51473d8
Report builtins type errors during load building as appropriate 2022-11-24 10:05:25 -05:00
Folkert
1875176319
improve formatting 2022-11-23 23:16:37 +01:00