Commit graph

650 commits

Author SHA1 Message Date
Anthony Bullard
3295f80c30
Address feedback 2025-01-04 17:01:12 -06:00
Anthony Bullard
a24fe430b4
Support '??' syntax for optional record fields 2025-01-04 14:26:20 -06:00
Anton-4
2263d8821a
Merge pull request #7421 from gamebox/issue-7415-parens-and-commas
Parens and Commas application syntax
2025-01-03 14:15:40 +01:00
Sam Mohr
786488fc34
Merge pull request #7408 from jaredramirez/jared/improve-module-error
Handle parse error for bad head exposes list
2025-01-03 05:10:07 -05:00
Anthony Bullard
3b0db07fa1
PNC for Patterns, stabilize formatting 2025-01-02 17:57:15 -06:00
Anthony Bullard
389cc940e0
Git rid of MigrationFlags constructor 2025-01-02 16:49:08 -06:00
Anthony Bullard
af39ce57fb
Parens and Commas application syntax 2025-01-02 16:49:08 -06:00
Sam Mohr
cbcbfd3265
Remove backpassing 2025-01-01 17:44:56 -08:00
Jared Ramirez
246d7a355e
Remove extra line 2024-12-30 16:08:21 -08:00
Jared Ramirez
2b419221cf
Merge branch 'main' into jared/improve-module-error 2024-12-30 16:03:22 -08:00
Jared Ramirez
c28d6b9411
Make ListStart branch less brittle; Add ListEnd branch 2024-12-30 16:02:15 -08:00
Joshua Warner
f4698e1517
Fix can panic with unbound type variables 2024-12-28 10:39:05 -05:00
Jared Ramirez
99377b0276
Improve module parse error 2024-12-24 10:47:45 -05:00
Joshua Warner
c6d5983ff2
clippy fixes 2024-12-15 18:33:55 -08:00
Joshua Warner
6ef87b3b9d
Graccefully handle overflowing unicode literals 2024-12-15 18:33:54 -08:00
Joshua Warner
93c2ba3b22
Feedback: tuple types -> tuples 2024-12-09 21:24:10 -08: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
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
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
912db1b76b
Fix round-trip parse->fmt->parse for dbg stmts with more than one arg 2024-12-01 12:40:13 -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
Luke Boswell
4d427168a4
replace cargo deps with workspace in repl_*, reporting, roc_std 2024-11-29 11:01:42 +11: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
JRI98
a332acd7bf
Remove unused malformed related variants 2024-11-14 10:23:06 +00:00
Luke Boswell
4b4ab7bc0c
Merge remote-tracking branch 'remote/main' into record-suffix-warn-tweaks 2024-11-13 07:29:31 +11:00
Luke Boswell
04ab86fa8e
clippy fix 2024-11-11 22:12:07 +11:00
Luke Boswell
24a90007c5
use only unix style slashes in problem reports 2024-11-11 21:42:11 +11:00
Luke Boswell
8a566dc339
WIP 2024-11-11 10:22:58 +11: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
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
a4296ca19d
Improve wording in pattern suffix errors 2024-11-07 18:54:25 -03:00
Agus Zubiaga
1e835bbb17
Fix 'right-hand side' typo in errors 2024-11-07 18:54:25 -03:00
Agus Zubiaga
935d460236
Use plural 'effects' in FxInTopLevel error 2024-11-07 18:54:25 -03:00
Agus Zubiaga
c9f001b041
Allow ignored defs with an effectful RHS 2024-11-07 18:54:22 -03:00
Agus Zubiaga
175a2b5683
Add hint about forgetting to call a function 2024-11-07 18:54:21 -03:00
Agus Zubiaga
cfc4be5254
Treat untyped suffixed functions as effectful 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
a31a35100b
Report suffixed pure function in literal record field 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
89a918cebe
Fix unifying pure with flex vars 2024-11-07 18:54:19 -03:00