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
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
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
2e96aca0fd
Merge branch 'main' into specialize-exprs
2024-11-23 01:48:51 -03: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
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
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
Agus Zubiaga
89a918cebe
Fix unifying pure with flex vars
2024-11-07 18:54:19 -03:00
Agus Zubiaga
69e026f8bb
Leftover statement warning for pure statements
2024-11-07 18:54:16 -03:00
Agus Zubiaga
6e6382ab23
Canonicalize and constrain statement expr in purity inference mode
2024-11-07 18:54:15 -03:00
Agus Zubiaga
460fa693fd
Desugar stmt expr before checking whether it's suffixed
2024-11-07 18:54:15 -03:00
Agus Zubiaga
01c94050c8
Detect fx mode based on hosted module
2024-11-07 18:54:15 -03:00
Agus Zubiaga
fd3fb16f7a
Add TODO to remove TryTarget::Task
2024-11-07 18:54:15 -03:00
Agus Zubiaga
aeeaab4b99
Desugar idents ending in !
to TrySuffix
2024-11-07 18:54:14 -03:00
Agus Zubiaga
7a7650c11d
Parse lowercase idents ending in !
2024-11-07 18:54:14 -03:00
Agus Zubiaga
2cce5ad023
Allow unsuffixed statements in parser
...
Moves the "STATEMENT AFTER EXPRESSION" error from the parser to canonicalization.
We'll later use this to allow this case in effectful functions.
2024-11-07 18:54:14 -03:00
Agus Zubiaga
bc3ab0186a
Generate effectful hosted functions
2024-11-07 18:54:13 -03:00
Agus Zubiaga
7af05cc6c9
Constrain function annotation fx to body
2024-11-07 18:54:13 -03:00
Agus Zubiaga
b9b85a222f
Do not use const fx vars when canonicalizing annotations
2024-11-07 18:54:13 -03:00
Agus Zubiaga
7776883262
Unify functions fx vars
2024-11-07 18:54:13 -03:00
Agus Zubiaga
5a5abe3bc5
Unify call's fx var with that of the enclosing function
2024-11-07 18:54:12 -03:00
Agus Zubiaga
e8d7820f34
Add fx var to can's Call
2024-11-07 18:54:12 -03:00
Agus Zubiaga
3cef756559
Add fx var to Type::Function et al
2024-11-07 18:54:12 -03:00
Agus Zubiaga
75177c9c98
Rename effect_type to fx_type and add to FunctionDef
2024-11-07 18:54:12 -03:00
Agus Zubiaga
386a5055ee
Add effect_type to can ClosureData
2024-11-07 18:54:11 -03:00
Agus Zubiaga
ef4eeb5c1a
Parse effectful arrow in function annotations
2024-11-07 18:54:11 -03:00
Sam Mohr
b43a9e3edb
Remove out-of-date comment
2024-11-02 09:51:55 -07:00
Sam Mohr
308defac46
Implement the try
keyword with desugaring
2024-11-01 17:34:11 -07:00