Commit graph

860 commits

Author SHA1 Message Date
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
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
Joshua Warner
9ead801536
Remove expect-fx syntax and handling
This was never fully hooked up in platforms, and the plan is to replace the need for this with doing purity-inference on normal `expect` statements.

On the other hand, fuzzing is finding some bugs caused by having a hyphenated keyword, so this is a great time to go ahead and remove it!
2024-11-17 20:25:37 -08:00
Isaac Van Doren
35f221d9de
Merge branch 'main' of https://github.com/roc-lang/roc into list-splitting 2024-11-15 21:12:51 -06:00
Isaac Van Doren
d99c347998
rename Str.split 2024-11-15 21:12:23 -06:00
JRI98
a332acd7bf
Remove unused malformed related variants 2024-11-14 10:23:06 +00:00
Agus Zubiaga
ecc5fa57dd
Check record field suffixes in annotations 2024-11-09 02:06:05 -03:00
Agus Zubiaga
12c735644f
Do not warn about pure functions in suffixed record literal fields
Records fields that allow effectful functions, should also accept
pure functions.
2024-11-09 01:05:06 -03:00
Richard Feldman
ed6ad1bc82
Get a failing specialize_expr test 2024-11-08 00:55:04 -05:00
Agus Zubiaga
5641884669
Update regions in suffixed tests 2024-11-07 18:54:25 -03:00
Agus Zubiaga
bc0cfef128
Restore UNNCESSARY DEFINITION errors for top-level defs
Non-top-level defs are already covered
2024-11-07 18:54:25 -03:00
Agus Zubiaga
a0f4b38ee9
Update region when desugaring ! in Task mode 2024-11-07 18:54:24 -03:00
Agus Zubiaga
46e808dc3a
Refactor if-let to let-else-continue 2024-11-07 18:54:24 -03:00
Agus Zubiaga
dae10d10fb
Do not alias ClosureData.fx_type in pattern matches 2024-11-07 18:54:23 -03:00
Agus Zubiaga
b31b30c468
Print fx_suffix_constraints in Debug impl for Constraints 2024-11-07 18:54:23 -03:00
Agus Zubiaga
2e5c143a0b
Explicit message for StmtAfterExpr in desugar 2024-11-07 18:54:23 -03:00
Agus Zubiaga
5f5e123bfd
Expect only one problem in test_can::shadow_annotation
This is because the NoIdentifiersIntroduced error was moved
to the type checker.
2024-11-07 18:54:22 -03:00
Agus Zubiaga
a2f940be4e
Use byte literal instead of cast and ignore too_many_args 2024-11-07 18:54:22 -03:00
Agus Zubiaga
c9f001b041
Allow ignored defs with an effectful RHS 2024-11-07 18:54:22 -03:00
Agus Zubiaga
cfc4be5254
Treat untyped suffixed functions as effectful 2024-11-07 18:54:21 -03:00
Agus Zubiaga
af6fc6306f
Treat untyped unsuffixed functions as pure 2024-11-07 18:54:21 -03:00
Agus Zubiaga
e75b1cf7a0
Check suffixes of all pattern identifiers 2024-11-07 18:54:20 -03:00
Agus Zubiaga
215de707fa
Report unsuffixed record literal field with effectful function 2024-11-07 18:54:20 -03:00
Agus Zubiaga
2859829ea8
Mark flex fx vars as pure after solving body 2024-11-07 18:54:19 -03:00