Commit graph

882 commits

Author SHA1 Message Date
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
Sam Mohr
0a82f313c3
Merge branch 'main' into allow-try-in-statements 2024-12-01 23:02:41 -05:00
Joshua Warner
912db1b76b
Fix round-trip parse->fmt->parse for dbg stmts with more than one arg 2024-12-01 12:40:13 -08:00
Sam Mohr
29c8759bc0
Merge branch 'main' into allow-try-in-statements 2024-12-01 00:35:18 -08:00
Anton-4
74d137cad4
Revert "Merge pull request #7267 from joshuawarner32/fuzzing-bugs-2"
This reverts commit 364249a29d, reversing
changes made to 0e550a7f68.
2024-11-30 18:43:16 +01:00
Joshua Warner
364249a29d
Merge pull request #7267 from joshuawarner32/fuzzing-bugs-2
Fix a bunch of parser/formatter bugs found in fuzzing
2024-11-29 17:33:57 -08:00
Joshua Warner
ed62bcc15a
Fix a bunch of parser/formatter bugs found in fuzzing
Notably:
* Unified how parens are formatted between (1) when we have a ParensAround, and (2) when we've decided an Apply needs to have parens
* Made unary minus require the be indented to the same level as any other expression continuation. (it used to accidentally have rules meant for binary operators applied)
* Don't apply extra indent to the backpassing continuation in the case that the call does itself require indentation
* Make `try@foo` correctly parse as `try @foo`, so that formatting doesn't change the tree when it adds that space
* Detect more cases where we need to outdent trailing e.g. {} blocks in applies
* Approximately a bagillion other things, 90% of which I added tests for, and none of which affected the formatting of examples or builtins
2024-11-29 16:25:59 -08:00
Richard Feldman
0e550a7f68
Merge pull request #7265 from roc-lang/workspace-deps
Update cargo dependencies to use workspace
2024-11-29 17:38:03 -05:00
Luke Boswell
6ce35c4337
replace cargo deps with workspace in alias_analysis, build, builtins, can 2024-11-29 11:12:25 +11:00
JRI98
771a34054c
Remove an unused enum and a struct 2024-11-28 20:17:17 +00:00
JRI98
dcb6c543c0
Remove unused TypedHole variant from roc_can::expr::Expr 2024-11-28 20:11:37 +00:00
Agus Zubiaga
6ffc8a507b
Allow suffixed pure functions that are exposed to the host 2024-11-27 14:06:37 -03:00
Agus Zubiaga
1dc9dd0a90
Merge branch 'main' into specialize-exprs 2024-11-27 11:35:14 -03:00
Joshua Warner
b4fdb0a4c2
Make dbg parse strictly as an Apply
This is important in order to fix some formatting bugs found in fuzzing
2024-11-24 14:15:29 -08:00
Agus Zubiaga
2e96aca0fd
Merge branch 'main' into specialize-exprs 2024-11-23 01:48:51 -03:00
Sam Mohr
d449d83a84
Allow pure statements that contain early returns 2024-11-21 12:22:01 -08:00
Anton-4
5ac7b193a9
Merge pull request #7229 from JRI98/remove_unused_ast_expr_expect
Remove unused ast::Expr::Expect
2024-11-19 13:32:45 +01:00
JRI98
de4179d5e1
Remove unused ast::Expr::Expect 2024-11-18 14:13:46 +00:00
JRI98
a18232bd8b
Cleanup after #7227 2024-11-18 11:04:07 +00:00