Commit graph

6607 commits

Author SHA1 Message Date
Luke Boswell
cce33c03d6
desugar ValueDef::Expect suffixed nodes 2024-09-23 17:57:25 +10:00
Ayaz
5f3a956137
Merge pull request #6832 from roc-lang/ayaz/optimize-list-literal-alloc
Optimize literal list construction in LLVM backend
2024-09-23 02:50:24 -04:00
Ayaz
cef2c8ae87
Update build.rs
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2024-09-21 09:50:17 -04:00
Ayaz
9c656dd28e
Merge branch 'main' into ayaz/optimize-list-literal-alloc 2024-09-21 09:44:50 -04:00
Sam Mohr
2ea6a5d79c
Merge branch 'main' into remove-old-record-builder 2024-09-21 04:54:03 -07:00
Sam Mohr
2da08be8ef
Remove old record builder syntax 2024-09-21 04:44:44 -07:00
Agus Zubiaga
5054c9990e
Desugar module param patterns before canonicalizing 2024-09-20 16:35:18 -03:00
Agus Zubiaga
3f9e957c9c
Extract record destructure desugaring into its own fn 2024-09-20 16:30:59 -03:00
Agus Zubiaga
3eadc03e28
Add failing test for multiline params 2024-09-20 16:19:56 -03:00
Luke Boswell
306394b98b
Merge pull request #7101 from roc-lang/dependabot/npm_and_yarn/crates/compiler/checkmate/www/multi-9423f4c335
Bump body-parser and express in /crates/compiler/checkmate/www
2024-09-19 17:54:26 +10:00
dependabot[bot]
584a6c2bd2
Bump body-parser and express in /crates/compiler/checkmate/www
Bumps [body-parser](https://github.com/expressjs/body-parser) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `body-parser` from 1.20.2 to 1.20.3
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3)

Updates `express` from 4.19.2 to 4.21.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.0)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-19 04:16:05 +00:00
Aurélien Geron
c10b25cf6e
Fixes #7065 in List.dropAt, author: @bhansconnect 2024-09-19 10:43:05 +12:00
Aurélien Geron
033d87034c
Add a test case for List.dropAt at an index located in the middle of the list 2024-09-19 10:05:48 +12:00
Brendan Hansknecht
3215a8f3d7
Merge pull request #7084 from roc-lang/tag-padding
Avoid explicit tag padding
2024-09-17 03:00:29 -07:00
Luke Boswell
49dedf0b7b
Merge branch 'main' into ayaz/optimize-list-literal-alloc 2024-09-17 19:44:02 +10:00
Brendan Hansknecht
4e3ec97d7a
generate array of alignment type to enforce tag data alignment 2024-09-16 17:10:49 -07:00
Brendan Hansknecht
a7eae239f0
Avoid explicit tag padding
Explicit padding changes the c-abi when passed to/returned from functions.
This is leading to incorrect loading of types like `Task U64 {}`.
2024-09-16 16:47:20 -07:00
Anton-4
4662c82ea8
cleanup pf.Task 2024-09-16 18:12:20 +02:00
snobee
6edee521cb
add tests 2024-09-06 19:34:11 -07:00
snobee
e82dd43465
Merge remote-tracking branch 'upstream/MAIN' into early-return-if-else 2024-09-06 17:11:28 -07:00
snobee
139f6ae82c
update tests for new Expr::If struct 2024-09-06 16:28:14 -07:00
Sam Mohr
aadc74a37b
Merge branch 'main' into repl-no-color-no-header-flags 2024-09-06 15:52:18 -07:00
snobee
819db7fb44
fix formatting for indented else 2024-09-06 14:37:04 -07:00
snobee
35a0671c52
parse block without indentation after indented else 2024-09-06 14:35:47 -07:00
Elias Mulhall
85aad0d000
Move comment explaining use of line_info field into can::Env struct definition 2024-09-05 20:13:54 -04:00
Elias Mulhall
25af18daaa
Cleanup unused function param 2024-09-05 20:13:54 -04:00
Elias Mulhall
19931ecd43
Support passing values into dbg with the pipe operator
In order to desugar `dbg` in a pipeline we need to allow a bare `dbg`
node in desugaring and only report it as an error if the bare node
survives to the next step of canonicalization. This means we move the
error code out of `desugar_expr` and into `canonicalize_expr`. This is
much simpler to do now that these functions use the same `env` struct,
since previously we would have had to pass down extra args to
`canonicalize_expr`. Sharing the `env` struct means that we also don't
have to worry about calculating `line_info` more than once.
2024-09-05 20:13:54 -04:00
Elias Mulhall
b515bfa77e
Use a shared env for desugaring and the rest of canonicalization
This refactor simplifies the desugar pass by reducing the number of
arguments threaded through each recursive function call.

- Add the module src string to `Env`.
- Add `line_info` to `Env` as a lazy-evaled function.
- Refactor desugar functions to take the `can::Env` struct in place of a
  number of params. This is mostly a find-and-replace, but in a few
  places `Vec::from_iter_in` was changed to `Vec::with_capacity_in`
  followed by a `for` loop in order to avoid lifetime issues.
- Remove unnecessary linter annotations for `clippy::too_many_arguments`
2024-09-05 20:13:48 -04:00
snobee
a7afac7ac7
Add boolean flag to Expr::If for indented else statement 2024-09-05 16:28:44 -07:00
Elias Mulhall
49a3f2d68e
Extract helper function to get the IdentIds related to a symbol's module 2024-09-03 14:09:16 -04:00
Elias Mulhall
f356f6f7a0
Do not display generated symbol names in error messages
When an error message reports on a symbol that was generated during
canonicalization, use text like "This value" instead of "This `123`
value". Generated symbols use the identifier index as the symbol name,
since valid Roc variables cannot begin with a number so there's no
chance of collision. We don't want to display generated symbols to the
user, so when building the error message we check if the symbol's name
starts with a digit.
2024-09-03 14:00:46 -04:00
Elias Mulhall
82d0566041
Use module scope instead of var store to generate idents in dbg desugar
Fix a bug in `dbg` expression desugaring by using the module scope to
generate unique identifiers instead of the variable store.

In the initial implementation of `dbg` expressions we used the
`VarStore` to generate unique identifiers for new variables created
during desugaring. We should have instead used the current module's
`Scope`, which handles identifiers within the module. Each scope has its
own incrementing variable count which is independent of the shared
variable store. The scope is used to generate new identifiers at other
points in canonicalization, such as when assigning a global identifier
to closures and `expect`s. It's possible that the identifier generated
for `dbg` could conflict with an identifier generated by the scope,
resulting in a confusing error.
2024-09-03 14:00:39 -04:00
Agus Zubiaga
2469a3aa2d
Merge pull request #7050 from roc-lang/arg-patterns-as 2024-09-02 14:02:17 -03:00
Agus Zubiaga
458878dbea
Fix record as pattern mono test 2024-09-02 12:29:14 -03:00
Agus Zubiaga
e2bd31a549
Add mono tests for opaque pattern with as 2024-09-02 12:23:25 -03:00
Agus Zubiaga
ada24e4fd9
Add mono tests for record pattern with as 2024-09-02 12:17:53 -03:00
Agus Zubiaga
4e19753189
fmt: Use format_with_options Parens for as pattern arguments 2024-09-02 12:02:01 -03:00
Agus Zubiaga
2486ce0e48
fmt: Add parens around as patterns in arguments 2024-09-02 11:54:34 -03:00
Anton-4
02cf61f985
Merge pull request #7038 from mulias/expr-dbg
Support `dbg` in expressions
2024-09-02 13:30:32 +02:00
Agus Zubiaga
9ce5b8b50b
Fix zero-arity home value def var 2024-09-01 19:11:56 -03:00
Agus Zubiaga
ed931a458e
Use fresh vars for home params destructures 2024-09-01 19:11:09 -03:00
Sam Mohr
a1c9273721
Merge pull request #7041 from roc-lang/dependabot/npm_and_yarn/crates/compiler/checkmate/www/webpack-5.94.0
Bump webpack from 5.88.1 to 5.94.0 in /crates/compiler/checkmate/www
2024-08-31 17:00:42 -07:00
Anton-4
e7a44430fd
update to basic cli 15 2024-08-31 14:30:07 +02:00
dependabot[bot]
8c5f01b405
Bump webpack from 5.88.1 to 5.94.0 in /crates/compiler/checkmate/www
Bumps [webpack](https://github.com/webpack/webpack) from 5.88.1 to 5.94.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.88.1...v5.94.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-30 16:13:58 +00:00
Anton-4
3c679f6338
Merge branch 'main' into lower-module-params 2024-08-30 16:29:46 +02:00
Sam Mohr
e310ba8494
Merge branch 'main' into builtin-task 2024-08-29 18:58:04 -07:00
Elias Mulhall
56c5b790a7 Refactor dbg expression parsing to work more like function application
Instead of parsing dbg with an expression block, parse the dbg keyword
with no additional arguments. This way the parser treats dbg just like a
variable in function application. We desugar by pattern matching on
`Apply(Dbg, args, called_via)` nodes. This changes the output of syntax
tests since the initial AST is different, but does not change the output
of can or mono.

Add two new errors for dbg in expression position with either no args or
too many args. This is similar to the error behavior of `crash`.

Continue to parse dbg statements with an expression block, as before.
2024-08-29 15:36:48 -04:00
Elias Mulhall
14fabdff07 Double the amount of indentation allowed in parser trace debugging
Increase from 36 levels of indentation to 80. This is excessive, but
it's confusing to have a parser test crash just because
parse_debug_trace is enabled.
2024-08-29 07:25:42 -04:00
Anton-4
b491a5c3e6
add roc check tip
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-08-28 18:15:24 -04:00
jamin-eisenberg
7429f8a970
Initial attempt (failing tests?) 2024-08-28 18:15:23 -04:00