Commit graph

277 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
1630b1fceb
fix failing test i forgot in last commit 2025-03-18 13:48:44 +01:00
Sam Mohr
809fe23afd
Merge pull request #7533 from smores56/simple-can-solo
Move desugaring to new `roc_can_solo` crate
2025-01-19 19:06:10 -08: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
Luke Boswell
5981e4354c
Merge pull request #7510 from joshuawarner32/pnc-fuzzing-fixes-4
Fix yet more fuzzing bugs
2025-01-20 09:26:52 +11:00
Sam Mohr
fce14d31b0
Move desugaring to new roc_can_solo crate 2025-01-19 07:16:43 -08:00
Sam Mohr
a292e070d4
Prefer and and or for boolean operators 2025-01-17 16:15:31 -08:00
Joshua Warner
51f2cdccf7
Relax argument indentation requirements in closures 2025-01-16 21:27:40 -08:00
Ayaz Hafiz
ec23cc56ea
Fix more 2025-01-10 21:31:43 -05: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
8e5d875604
Merge branch 'main' into auto-snake-case 2025-01-08 01:51:12 -08:00
Luke Boswell
99dfc5529d
Merge pull request #7450 from roc-lang/ayaz/bugfix-ts
Minor simplifications to typechecker
2025-01-08 16:28:25 +11:00
Ayaz Hafiz
54cc5e4c29
Unify let-introduction in a single path
Remove branches on determining how let-bindings are introduced to the
scope. This is maybe a little more inefficient, but I think it is a huge
simplification.

One additional change this required was changing how fx suffixes are
checked. The current implementation would add additional constraints for
patterns in let bindings conditionally. However, this is unnecessary. I
believe it is sufficient to check the fx suffix by running the checks on
all introduced symbols after the type is well known (i.e. the body is
checked).
2025-01-05 23:54:37 -05: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
Sam Mohr
b56fbd38e1
Progress on updating entire compiler for snake_case 2025-01-05 03:48:03 -08:00
Anthony Bullard
a24fe430b4
Support '??' syntax for optional record fields 2025-01-04 14:26:20 -06:00
Sam Mohr
30b8a1407d
Fix broken ability implementation 2025-01-04 05:37:17 -08:00
Sam Mohr
2aac2e01f8
Move builtins to snake_case with auto-case conversion 2025-01-04 03:29:01 -08: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
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
Ayaz Hafiz
c3d77b8841 Unify let-introduction in a single path
Remove branches on determining how let-bindings are introduced to the
scope. This is maybe a little more inefficient, but I think it is a huge
simplification.

One additional change this required was changing how fx suffixes are
checked. The current implementation would add additional constraints for
patterns in let bindings conditionally. However, this is unnecessary. I
believe it is sufficient to check the fx suffix by running the checks on
all introduced symbols after the type is well known (i.e. the body is
checked).
2025-01-01 23:39:37 -06:00
Sam Mohr
cbcbfd3265
Remove backpassing 2025-01-01 17:44:56 -08:00
Jared Ramirez
c28d6b9411
Make ListStart branch less brittle; Add ListEnd branch 2024-12-30 16:02:15 -08:00
Jared Ramirez
99377b0276
Improve module parse error 2024-12-24 10:47:45 -05:00
faldor20
c731c5daae
resolve comments 2024-12-12 20:54:25 +10:00
faldor20
a7308130cf
clippy on everything 2024-12-12 20:54:25 +10:00
faldor20
81f2095e61
basic working
compiling, but still missing positions from expression errors
2024-12-12 20:54:25 +10: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
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
Sam Mohr
0a82f313c3
Merge branch 'main' into allow-try-in-statements 2024-12-01 23:02:41 -05:00
Sam Mohr
febe95c228
Generalize return vars 2024-12-01 02:24:51 -08:00
Sam Mohr
29c8759bc0
Merge branch 'main' into allow-try-in-statements 2024-12-01 00:35:18 -08:00
Luke Boswell
39ca41c243
replace cargo deps with workspace in gen_wasm, late_solve, load, load_internal 2024-11-29 11:21:57 +11:00
Agus Zubiaga
6ffc8a507b
Allow suffixed pure functions that are exposed to the host 2024-11-27 14:06:37 -03:00
Agus Zubiaga
0a98580277
Use "opaques" instead of "opaque types" in reporting 2024-11-25 19:32:08 -03:00
Agus Zubiaga
2e96aca0fd
Merge branch 'main' into specialize-exprs 2024-11-23 01:48:51 -03:00
Sam Mohr
d8b73f25e6
Merge branch 'main' into allow-try-in-statements
Signed-off-by: Sam Mohr <sam@sammohr.dev>
2024-11-21 21:03:27 -08:00
Sam Mohr
d449d83a84
Allow pure statements that contain early returns 2024-11-21 12:22:01 -08:00
Sam Mohr
899a7d3308
Add reporting tests for annotated functions with early returns 2024-11-21 04:38:58 -08: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
9465b29376
fix test reporting 2024-11-11 19:47:55 +11:00
Luke Boswell
fc0f938e5c
fix test_reporting 2024-11-11 14:07:52 +11:00