Commit graph

343 commits

Author SHA1 Message Date
Joshua Warner
02e07f95e7
Fix when indent in the presence of weird multiline patterns 2024-12-13 13:45:12 -08:00
Joshua Warner
1d51f5fbec
Don't eliminate empty record assignment for a return 2024-12-13 13:45:11 -08:00
Joshua Warner
f193c778d5
clippy 2024-12-13 13:45:11 -08:00
Joshua Warner
f233c5328d
lift to spaces in ann_lift_to_node default case 2024-12-13 13:45:11 -08:00
Joshua Warner
f1d9667ea0
Fix multiline str pattern newline multiplication 2024-12-13 13:45:11 -08:00
Joshua Warner
e9a8588c3e
Refactor pattern apply 2024-12-13 13:45:10 -08:00
Joshua Warner
16c3d4e512
Don't drop spaces before return 2024-12-13 13:45:10 -08:00
Joshua Warner
5a6e0f546b
Generalize RecordAccess special-cases to include TupleAccess 2024-12-13 13:45:10 -08:00
Joshua Warner
d66f51db7b
Don't mix spaces before/after the field separator 2024-12-13 13:45:10 -08:00
Joshua Warner
2857833c35
Normalize return's 'after' 2024-12-13 13:45:10 -08:00
Joshua Warner
17849ca556
Fully normalize in expr record-like things, during formatting 2024-12-13 13:45:10 -08:00
Joshua Warner
f5cd0568dd
Fix newlines after multiline apply func pattern (#7342) 2024-12-13 13:45:09 -08:00
Joshua Warner
8701b922b4
Fix missing indent call (#7346) 2024-12-13 13:45:09 -08:00
Joshua Warner
8b3abafa08
Force newlines after multi-line tuple pattern elements 2024-12-13 13:45:09 -08:00
Joshua Warner
3f2117403e
Fix bug found in the wild via fuzzing, move fuzzing job to the end 2024-12-11 18:39:15 -08:00
Joshua Warner
04612fb2cb
Fix as pattern formatting inside apply 2024-12-10 18:55:40 -08:00
Sam Mohr
01f4d4f3da
Merge branch 'main' into cleanup_unused 2024-12-08 10:14:47 -08:00
Joshua Warner
e2d839c050
Remove commented code 2024-12-05 18:56:18 -08:00
Joshua Warner
82bf4b19d8
Fix up LowLevelTry after rebase 2024-12-05 18:54:26 -08:00
Joshua Warner
6ac6a7c19a
Feedback: dry out term, make fmt_spaces_with_newline_mode more readable, explicitly implement all the variants in ann_lift_spaces 2024-12-05 18:54:25 -08:00
Joshua Warner
f833ac9a6b
Fix formatting of Apply nodes with zero args, which the repl generates 2024-12-05 18:54:23 -08:00
Joshua Warner
9a9b96dc69
Fix clippy 2024-12-05 18:54:22 -08:00
Joshua Warner
e620e1c462
Fix warnings 2024-12-05 18:54:22 -08:00
Joshua Warner
dfcb7a0c3b
Ensure formatted multiline patterns can be parsed 2024-12-05 18:54:21 -08:00
Joshua Warner
fc74b67d86
Flesh out expr_lift_spaces, in particular handling DbgStmt properly 2024-12-05 18:54:19 -08:00
Joshua Warner
2163b28390
Fix formatting of newlines in parens in a function type 2024-12-05 18:54:18 -08:00
Joshua Warner
cae47cf2a6
Fix expr_lift_spaces of Closure 2024-12-05 18:54:17 -08:00
Joshua Warner
89a64fed74
Don't do empty record destructure elision when the body is itself Defs 2024-12-05 18:54:15 -08:00
Joshua Warner
48c941d542
Add lifting for ext values in types 2024-12-05 18:54:14 -08:00
Joshua Warner
64164eb1f4
Make sure patterns continue to parse as such 2024-12-05 18:54:13 -08:00
Joshua Warner
ea1ecb9e68
Fix lifting of backpassing 2024-12-05 18:54:12 -08:00
Joshua Warner
2098ccd137
Fix multiline pattern in body, which may only apply to multiline strings 2024-12-05 18:54:12 -08:00
Joshua Warner
ab4c96bc81
Fix indent call in when fmt 2024-12-05 18:54:11 -08:00
Joshua Warner
fa4d3e79ec
Fix ability with no newline after it 2024-12-05 18:54:11 -08:00
Joshua Warner
b06afa7bb9
Fix purity removal 2024-12-05 18:54:10 -08:00
Joshua Warner
8c25c9aaf7
Fix newline after dbg formatting 2024-12-05 18:54:10 -08:00
Joshua Warner
4a0dce714b
Unify if/when condition formatting 2024-12-05 18:54:09 -08:00
Joshua Warner
cfec120b13
Fix indent calls in optional fields 2024-12-05 18:54:08 -08:00
Joshua Warner
84b3969648
Adjust parens around patterns in annotations 2024-12-05 18:54:08 -08:00
Joshua Warner
edcdd99f59
Record updates 2024-12-05 18:54:07 -08:00
Joshua Warner
b9862b47dc
Several fixes found in fuzzing 2024-12-05 18:54:03 -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
Joshua Warner
120e9be550
Move MigrationFlags from an argument on format* to a field on Buf
That has a few advantages:

* We avoid a bunch of extra parameter-passing "noise", since the vast majority of formatting code doesn't need to care about this setting beyond just passing it to nested format calls.
* It aligns really well with the "global" nature of this setting, and makes it impossible to have bugs where e.g. one callsite forgets to pass the correct value to it's children - which would lead to parts of the tree not being migrated. If this is truly a global setting on Buf, that simply can't happen.
2024-12-04 17:57:31 -08:00
Anton-4
7c1dffb777
minor improvements 2024-12-04 14:32:38 +01: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
Joshua Warner
f7a5f06e5b
Fix a bunch of bugs found in fuzzing 2024-12-01 12:40:19 -08: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