Commit graph

666 commits

Author SHA1 Message Date
Anton-4
fac7041d11
Update tip to parens syntax (#7771)
* Update to parens syntax

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>

* update snapshots

---------

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-05-02 15:18:35 +02:00
Anton-4
875a4cc623
improve abilities error msg (#7761)
improve error msg
2025-04-25 17:46:24 +02:00
Olof Blomqvist
dc8ee0e5ce
remove arrows 2025-03-19 07:26:14 +01:00
Olof
28418a36bf
stop recommending old lambda syntax 2025-03-17 13:23:34 +01:00
Luke Boswell
c8467b1fe0
Merge pull request #7454 from roc-lang/ayaz/error-on-invalid-generalized-types
Restrict usages of type variables in non-generalized contexts
2025-01-20 11:30:52 +11:00
Sam Mohr
a292e070d4
Prefer and and or for boolean operators 2025-01-17 16:15:31 -08:00
Anthony Bullard
8e1e1520e3
New Lambda Syntax with |...|
This adds parser support for the new lambda syntax.  It does not remove
the existing syntax, nor will the new syntax be retained in formatting.
That will be done in a separate PR to keep the two respective PRs
relatively small and easy to review.
2025-01-15 05:58:16 -06:00
Joshua Warner
61bc0b3464
Resolve TODO around handling non-plain strings 2025-01-11 20:24:34 -08:00
Joshua Warner
e0ef01fa82
Fix two canonicalization crashes: try() and overflowed tuple indexes 2025-01-11 20:24:34 -08:00
Joshua Warner
7d464a2989
add failing test for ignored fields canonicalization 2025-01-11 20:24:33 -08:00
Ayaz
ee3c71dfe6
Merge branch 'main' into ayaz/error-on-invalid-generalized-types
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2025-01-10 14:36:48 -05:00
Sam Mohr
eb1b5ffa26
Move to new interpolation syntax 2025-01-10 10:29:20 -08:00
Sam Mohr
2150ee2219
Remove Task from Roc 2025-01-08 17:00:40 -08:00
Sam Mohr
cd0e2a4474
Merge branch 'main' into auto-snake-case 2025-01-05 16:50:24 -08:00
Sam Mohr
0edbf16d55
More progress 2025-01-05 05:16:47 -08:00
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
Ayaz Hafiz
a0461679dd Restrict usages of type variables in non-generalized contexts
Type variables can only be used on functions (and in number literals as
a carve-out for now). In all other cases, a type variable takes on a
single, concrete type based on later usages. This check emits errors
when this is violated.

The implementation is to check the rank of a variable after it could be
generalized. If the variable is not generalized but annotated as a type
variable, emit an error.
2025-01-02 14:26:37 -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