Commit graph

900 commits

Author SHA1 Message Date
Sam Mohr
7914f0c7d8
Fix clippy issue 2025-01-17 20:01:54 -08:00
Sam Mohr
1a9668e83a
Add tests for desugaring and formatting 2025-01-17 18:55:58 -08:00
Sam Mohr
a292e070d4
Prefer and and or for boolean operators 2025-01-17 16:15:31 -08:00
Sam Mohr
5859415e73
Prefix hidden vars with # 2025-01-16 10:49:51 -08:00
Sam Mohr
474fd15dd4
Fix formatting 2025-01-16 03:21:34 -08:00
Sam Mohr
b73e4387ae
Implement ? binop operator 2025-01-16 02:44:32 -08:00
Anthony Bullard
8e1e1520e3
New Lambda Syntax with |...|
This adds parser support for the new lambda syntax.  It does not remove
the existing syntax, nor will the new syntax be retained in formatting.
That will be done in a separate PR to keep the two respective PRs
relatively small and easy to review.
2025-01-15 05:58:16 -06:00
Joshua Warner
d43ad92789
Introduce proper type for TypeVar's, mark anything not a lowercase ident as malformed 2025-01-14 19:30:33 -08:00
Joshua Warner
853dd5725b
Also handle large tuple indices in a.123 form 2025-01-11 20:24:35 -08:00
Joshua Warner
61bc0b3464
Resolve TODO around handling non-plain strings 2025-01-11 20:24:34 -08:00
Joshua Warner
e0ef01fa82
Fix two canonicalization crashes: try() and overflowed tuple indexes 2025-01-11 20:24:34 -08:00
Joshua Warner
7d464a2989
add failing test for ignored fields canonicalization 2025-01-11 20:24:33 -08:00
Joshua Warner
408379f8d3
Canonicalize the pattern in annotations 2025-01-11 20:24:30 -08:00
Joshua Warner
13a70c060d
Preserve info about whether a given dbg stmt was pnc or not, at least for now 2025-01-10 21:10:55 -08:00
Sam Mohr
eb1b5ffa26
Move to new interpolation syntax 2025-01-10 10:29:20 -08:00
Sam Mohr
279301faa3
Remove unused insta dependency from can 2025-01-08 18:02:44 -08:00
Sam Mohr
82b7279485
Fix formatting 2025-01-08 17:04:28 -08:00
Sam Mohr
2150ee2219
Remove Task from Roc 2025-01-08 17:00:40 -08:00
Anthony Bullard
9b9b6d39f3
Fix clippy 2025-01-08 15:37:03 -06:00
Anthony Bullard
739dda6f5e
Cover hidden pattern match cases for Pizza 2025-01-08 15:05:55 -06:00
Anthony Bullard
898b3f55e5
Move PNC apply to separate Expr/Pattern variant 2025-01-08 14:47:49 -06:00
Sam Mohr
8e5d875604
Merge branch 'main' into auto-snake-case 2025-01-08 01:51:12 -08:00
Luke Boswell
99dfc5529d
Merge pull request #7450 from roc-lang/ayaz/bugfix-ts
Minor simplifications to typechecker
2025-01-08 16:28:25 +11:00
Sam Mohr
7a2f8bfa71
Merge branch 'main' into auto-snake-case 2025-01-07 13:18:41 -08:00
Ayaz Hafiz
54cc5e4c29
Unify let-introduction in a single path
Remove branches on determining how let-bindings are introduced to the
scope. This is maybe a little more inefficient, but I think it is a huge
simplification.

One additional change this required was changing how fx suffixes are
checked. The current implementation would add additional constraints for
patterns in let bindings conditionally. However, this is unnecessary. I
believe it is sufficient to check the fx suffix by running the checks on
all introduced symbols after the type is well known (i.e. the body is
checked).
2025-01-05 23:54:37 -05:00
Ayaz Hafiz
bd2dd66c96
Store rigid vars with location during constraining 2025-01-05 23:54:36 -05:00
Joshua Warner
6edfc0aa90
Fix double-wrapping of spaces before implements opaque keyword by making them distinct 2025-01-05 15:10:13 -08:00
Sam Mohr
b56fbd38e1
Progress on updating entire compiler for snake_case 2025-01-05 03:48:03 -08:00
Sam Mohr
db1e0a02b4
Update tests 2025-01-04 05:54:44 -08:00
Sam Mohr
30b8a1407d
Fix broken ability implementation 2025-01-04 05:37:17 -08:00
Anthony Bullard
210695ec29
Update can tests with PatternApplyStyle after rebase 2025-01-02 18:11:15 -06:00
Anthony Bullard
3b0db07fa1
PNC for Patterns, stabilize formatting 2025-01-02 17:57:15 -06:00
Sam Mohr
cbcbfd3265
Remove backpassing 2025-01-01 17:44:56 -08:00
Joshua Warner
f4698e1517
Fix can panic with unbound type variables 2024-12-28 10:39:05 -05:00
Anthony Bullard
03641c16f8
Fix unit tests 2024-12-26 10:53:47 -06:00
Anthony Bullard
c70ceb4f98
Issue 7089: ?? operator 2024-12-26 10:53:47 -06:00
Joshua Warner
cbd6d50584
Give an error instead of panicking on an empty tuple type 2024-12-09 21:24:09 -08:00
Sam Mohr
01f4d4f3da
Merge branch 'main' into cleanup_unused 2024-12-08 10:14:47 -08:00
Sam Mohr
4abe199747
Fix question statements 2024-12-06 11:01:29 -08:00
Sam Mohr
9392742d17
Update tests 2024-12-05 02:33:20 -08:00
Sam Mohr
8c81742abe
Simplify category formatting for try concepts 2024-12-05 02:30:33 -08:00
Sam Mohr
de626102c8
Use new try impl for ? operator 2024-12-05 02:13:13 -08:00
Sam Mohr
193c23bac8
Merge pull request #7296 from smores56/proper-try-keyword
Proper `try` keyword
2024-12-05 01:38:22 -08:00
JRI98
90f517712a
Remove unused code 2024-12-05 09:18:52 +00:00
Sam Mohr
eedade8e81
Initial working version of proper try keyword 2024-12-04 02:31:59 -08:00
Anthony Bullard
a2083cec30
Parsing support for snake_case identifiers
In this initial commit, I have done the following:

- Added unit tests to roc_parse's ident.rs file to cover at least the
  simplest Ident enum cases (Tag, OpaqueRef, and simple Access)
- Added '_' as a valid "rest" character in both uppercase and lowercase
  identifier parts
- Updated the test_syntax snapshots appropriately

There is still a lot left to do here. Such as:

- Do we want to allow multiple '_'s to parse successfully?
- Handle qualified access
- Handle accessor functions
- Handle record update functions
- Remove the UnderscoreInMiddle case from BadIdent
- Write unit tests for Malformed Idents

I am not a "Rustacean" by any means, but have been through the Book in
years past.  Any feedback on the way I wrote the tests or any other part
of the implementation would be very appreciated.
2024-12-03 20:50:47 -06:00
Sam Mohr
a7168a4ad6
Merge pull request #7238 from smores56/allow-try-in-statements
Allow pure statements that contain early returns
2024-12-02 01:15:24 -05:00
Richard Feldman
12dc39a892
Merge pull request #7293 from roc-lang/drop-dbgs
Convert unused dbg!()s to eprintln!()s
2024-12-02 00:34:01 -05:00
Sam Mohr
444becdb01
Remove removed TypedHole usage 2024-12-01 20:11:13 -08:00
Richard Feldman
bc0c9250f9
Convert unused dbg!()s to eprintln!()s
This makes it nicer to work with dbg! normally,
because grepping the code base for dbg!() reveals
only the usages of it that are currently active.
2024-12-01 23:10:35 -05:00