Commit Graph

8669 Commits

Author SHA1 Message Date
Ryan Barth
5a231763af
fix: change target directory output to match release tarball structure 2024-06-23 10:00:36 -07:00
shua
4d0112ef2a
resolve TODO: don't use vec 2024-06-23 16:20:05 +02:00
Anton-4
f8432f7510
fmt 2024-06-22 20:09:15 +02:00
Anton-4
ab217ede3f
Merge remote-tracking branch 'upstream/main' into unmacro_parsers 2024-06-22 20:02:30 +02:00
shua
e2eb9c9aaa
rm dead FIXME comment
this comment was added originally in 24e6cd80e7, but was a comment on a `if cfg(..) {...}` block. Later that `if` was removed but the comment was not, and eventually got copied to another location making it even harder to figure out why it's there.
2024-06-22 19:07:26 +02:00
JRI98
f4551978ce
Handle multi pattern unbound list rest variables 2024-06-21 17:01:49 +01:00
Luke Boswell
03eadc2e0f
Merge pull request #6822 from roc-lang/dependabot/npm_and_yarn/crates/compiler/checkmate/www/braces-3.0.3
Bump braces from 3.0.2 to 3.0.3 in /crates/compiler/checkmate/www
2024-06-21 18:17:19 +10:00
Evan Relf
2a71dccf5e Add tests 2024-06-19 15:19:25 -07:00
Evan Relf
d678f1c049 Format shebangs correctly
Fixes the regression I described in [#1135].

[#1135]: https://github.com/roc-lang/roc/issues/1135
2024-06-19 15:07:22 -07:00
dependabot[bot]
f43c6b2026
Bump braces from 3.0.2 to 3.0.3 in /crates/compiler/checkmate/www
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-19 21:13:36 +00:00
Anton-4
d921d77ab6
removed TODO
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-06-19 19:33:12 +02:00
Anton-4
c54c0e9741
skip advanced_recursive_union
see #5924
2024-06-19 15:37:14 +02:00
Anton-4
212c736806
macos clippy 2024-06-19 14:11:42 +02:00
Anton-4
05a61e2210
clippy + fmt 2024-06-19 12:34:10 +02:00
Anton-4
fb7fa99b2c
Merge branch 'main' of github.com:roc-lang/roc into rust-1-77-2-upgrade 2024-06-18 18:47:09 +02:00
Richard Feldman
b79ee68729
clippy 2024-06-17 22:25:15 -04:00
Richard Feldman
d2e1428003
Delete worker.rs for now 2024-06-17 22:25:15 -04:00
Richard Feldman
d1a002f49e
Have file.rs use the new roc_worker crate 2024-06-17 22:21:07 -04:00
Richard Feldman
4042fd8d52
Split out work.rs into its own crate 2024-06-16 22:26:58 -04:00
Agus Zubiaga
facae9d56c
Fix platform root module flag
When loading a platform module as the root, the `is_root_module`
flag in `HeaderInfo` would be set to `false`. This caused issues
with docs generation.
2024-06-12 19:00:15 -03:00
Luke Boswell
3976c39c6d
add SystemConfiguration framework 2024-06-12 15:46:45 +10:00
Anton-4
ba506d5257
merge fix 2024-06-11 18:24:22 +02:00
Anton-4
4d00e9ad51
Merge branch 'main' into main
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-06-11 18:18:47 +02:00
Anton-4
da95b6d28b
Merge pull request #6791 from shua/concatutf8
builtin: List.concatUtf8 : List U8, Str -> Str
2024-06-11 16:21:30 +02:00
shua
a2c800452e
add branch on ptr width back
apple arm tests are failing, maybe this will fix it?
2024-06-10 23:16:33 +02:00
Anton-4
18394da2a2
update mono tests 2024-06-10 16:32:53 +02:00
Agus Zubiaga
ec23c9a41b
Add missing argument in test_gen helpers/wasm 2024-06-10 10:18:51 -03:00
Agus Zubiaga
a1b84f01f5
Add missing argument in test_gen helpers/dev 2024-06-09 15:25:01 -03:00
John Konecny
a189e3ab20 Warnings are now yellow 2024-06-09 13:23:31 -04:00
Agus Zubiaga
aedb353088
Move main.roc to a constant 2024-06-08 20:23:45 -03:00
Agus Zubiaga
6640893410
Fix test_reporting UNRECOGNIZED_PACKAGE header 2024-06-08 20:23:28 -03:00
Agus Zubiaga
4e5fdfbf52
Handle root type when loading from str 2024-06-08 19:46:41 -03:00
Agus Zubiaga
0283bd1d24
UNKNOWN PACKAGE -> UNRECOGNIZED PACKAGE rename 2024-06-08 18:34:45 -03:00
Agus Zubiaga
ec55caa77a
Custom reporting for unknown package when checking a module directly 2024-06-08 18:29:30 -03:00
Agus Zubiaga
7faff12cbf
Report unrecognized shorthands when loading from the root module 2024-06-08 14:12:01 -03:00
shua
f7bec802c0
PR: rename to List.concatUtf8 2024-06-08 13:36:20 +02:00
Agus Zubiaga
5a1bf2b891
Shorter module_ids lock in load#parse 2024-06-07 18:10:32 -03:00
Agus Zubiaga
f5e08cb917
Use module's parent dir if main roc file is not found 2024-06-07 17:42:04 -03:00
Agus Zubiaga
2da7ea394b
Add --main flag to specify app/package to resolve deps from 2024-06-07 17:09:44 -03:00
shua
33e8a7a439
implement Str.concatUtf8 2024-06-07 19:05:52 +02:00
Agus Zubiaga
75fe98cbaf
Load packages from main package/platform when checking a module 2024-06-06 20:47:50 -03:00
Agus Zubiaga
cf8ab11d27
Load packages from main app when checking a module 2024-06-06 20:25:54 -03:00
Agus Zubiaga
3ff0c986e8
Extract shorthand registration into its own function 2024-06-05 22:16:32 -03:00
Agus Zubiaga
f92bf4852f
Find main.roc when loading a module 2024-06-05 20:24:49 -03:00
Folkert
2cabe6546c
use std::starts_with instead of iterator logic 2024-06-05 17:14:06 +02:00
Kiryl Dziamura
3e5cfb546d
check if when branch is suffixed 2024-06-03 23:45:54 +02:00
Kiryl Dziamura
967da48969
Fix typo 2024-06-03 16:58:40 +02:00
Kiryl Dziamura
8883ab9a91
Desugar expect continuation 2024-06-03 16:58:31 +02:00
Andy Ferris
664b1754d0
Print special float values as Num.nanF64, etc 2024-05-31 17:34:43 +10:00
Kiryl Dziamura
e86c6235c1
add multiple args test 2024-05-28 11:34:01 +02:00
Kiryl Dziamura
24f6e46c64
panic with unreachable error 2024-05-28 11:26:32 +02:00
Kiryl Dziamura
cc7b656703
add doc comment 2024-05-28 11:00:28 +02:00
Kiryl Dziamura
cbe5d127d7
fix typos 2024-05-28 09:48:54 +02:00
Kiryl Dziamura
ce6e21ff7a
ignore def pattern for function args 2024-05-27 18:21:00 +02:00
Anton-4
0fb807209b
undo hello world move 2024-05-26 18:58:52 +02:00
Anton-4
08799ea41c
Merge pull request #6769 from roc-lang/replace-site-gen-platform
Remove static-site-gen example and replace website with basic-ssg release
2024-05-22 16:18:04 +02:00
Anton-4
f10f18980d
Merge pull request #6770 from roc-lang/move-basic-cli-tests
Move basic cli tests from examples
2024-05-22 16:13:40 +02:00
Anton-4
544a538604
Merge pull request #6761 from roc-lang/fix-bundle-ingest-files
Fix importing ingested file when bundling packages
2024-05-22 15:11:40 +02:00
Anton-4
00316433d1
remove dbg
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-05-22 14:20:47 +02:00
Luke Boswell
7962ee1e63
remove linux only breakout tests 2024-05-22 14:06:17 +10:00
Luke Boswell
b775c0e509
move parser cli tests 2024-05-22 13:44:37 +10:00
Luke Boswell
28b6dc11be
move hello world 2024-05-22 13:37:06 +10:00
Luke Boswell
64dba6332d
move argsBROKEN.roc test 2024-05-22 13:35:43 +10:00
Luke Boswell
7cbee42c2c
move ingested-file-bytes.roc test 2024-05-22 13:34:41 +10:00
Luke Boswell
b3f8c4dfd9
move ingested-file-bytes-no-ann.roc test 2024-05-22 13:32:49 +10:00
Luke Boswell
e9c50de4b4
move http-get test 2024-05-22 13:30:47 +10:00
Luke Boswell
3d4bd68580
move file test 2024-05-22 13:29:46 +10:00
Luke Boswell
bb6fb26525
move form test 2024-05-22 13:28:44 +10:00
Luke Boswell
7cff0575b9
move env test 2024-05-22 13:25:54 +10:00
Luke Boswell
eb3ff714cd
move echo test 2024-05-22 13:24:09 +10:00
Luke Boswell
0b9c2b4f42
move countdown test 2024-05-22 13:22:58 +10:00
Luke Boswell
6d90a4c3c1
move ingested-file test 2024-05-22 13:21:15 +10:00
Luke Boswell
d826ac4a40
remove static-site-gen from cli_run tests 2024-05-22 13:15:42 +10:00
Luke Boswell
33075285b7
Merge pull request #6767 from wontem/comments-in-repl
Ignore comments in repl
2024-05-22 11:26:10 +10:00
Kiryl Dziamura
8d574a93a3
better message for bad ident name in repl 2024-05-22 01:00:31 +02:00
Kiryl Dziamura
fb108af73e
ignore comments in repl 2024-05-22 00:51:38 +02:00
Luke Boswell
3a2b27dcdb
default to host libhost for prebuilt platform binary if target specific not found 2024-05-20 19:41:02 +10:00
Luke Boswell
b8362b1c5e
fix importing ingested file 2024-05-20 13:28:18 +10:00
Richard Feldman
7e1a82f048
Merge pull request #6757 from roc-lang/ingested-files-bundle
Include ingested files in package tarballs
2024-05-17 21:14:20 -04:00
Agus Zubiaga
b3065079ae
cli/tarball read_header return parse_header result directly 2024-05-18 02:28:20 +02:00
Agus Zubiaga
8f0a4da04e
cli/tarball add_ingested_files unwrap_or_else 2024-05-18 02:27:00 +02:00
Agus Zubiaga
70d005fde5
cli/tarball read_header return tuple directly 2024-05-18 02:25:05 +02:00
Agus Zubiaga
46da864fea
Handle ingested file prefix error 2024-05-18 02:16:02 +02:00
Agus Zubiaga
504107f90e
Include ingested files in package tarballs
If a package has an ingested file import, we will now add the file
to the tarball.
2024-05-18 02:07:58 +02:00
Richard Feldman
78d77e2f59
Revise wildcard and type var error message 2024-05-13 09:55:35 -04:00
Richard Feldman
18230a7a18
Make some reporting tests more editor-friendly
Previously editors would trim the trailing whitespace on save,
breaking the tests.
2024-05-13 08:22:35 -04:00
Richard Feldman
8357bd8c91
Revise errors for undeclared type vars in aliases 2024-05-12 21:20:11 -04:00
Ayaz
e5ea6dc461
Merge pull request #6708 from roc-lang/module-params-syntax
Parse and format module params
2024-05-12 13:51:13 -05:00
Anton-4
975162b53b
improve error message 2024-05-10 17:18:23 +02:00
Anton-4
e735223c9a
Merge pull request #6728 from GovCraft/main
close #6723: Update format_files to list all files
2024-05-10 16:26:20 +02:00
Anton-4
b5a9dc3ec2
Merge branch 'main' into main 2024-05-10 14:29:09 +02:00
Anton-4
1bc5fd56af
Merge branch 'main' into ls-fmt-upgrade 2024-05-10 14:28:17 +02:00
Anton-4
3c189f4e36
Merge pull request #6734 from roc-lang/narrow-lsp-report
Narrower reports from language server
2024-05-10 14:17:56 +02:00
Agus Zubiaga
5ccd15faec
Upgrade header imports when formatting through lang server 2024-05-09 08:17:28 -03:00
Agus Zubiaga
058079e5cd
Update spaces in import_with_params result ast 2024-05-09 08:02:29 -03:00
Agus Zubiaga
2e4306279c
Handle record update found in module params 2024-05-09 08:01:46 -03:00
Agus Zubiaga
f3b71c46e7
Handle record apply found in module params 2024-05-09 07:55:39 -03:00
Agus Zubiaga
b8280bf69a
Handle import params indent error in reporting 2024-05-09 07:49:21 -03:00
Agus Zubiaga
9be3358355
Module params record parse problem test 2024-05-09 07:45:33 -03:00
Agus Zubiaga
25d3cae08f
Use Loc::at instead of map(|_| x) 2024-05-09 07:42:10 -03:00
Agus Zubiaga
c0bb46517c
Desugar params in imports 2024-05-09 07:42:10 -03:00
Agus Zubiaga
b36f88fd13
Format module params in imports 2024-05-09 07:42:10 -03:00
Agus Zubiaga
e5a09b5de6
Parse module params in import 2024-05-09 07:42:07 -03:00
Agus Zubiaga
08825a9e90
Add module with optional param syntax test 2024-05-09 07:27:58 -03:00
Agus Zubiaga
370013b960
Format module header with params 2024-05-09 07:27:58 -03:00
Agus Zubiaga
760ffaf68f
Report module params parse error 2024-05-09 07:27:58 -03:00
Agus Zubiaga
5b1a3c8f03
Parse params in module header
module {echo, read} -> [menu]

Formatter isn't implemented yet.
2024-05-09 07:27:43 -03:00
Joshua Warner
d667e3c2d8
Simplify task await bang parsing to no longer require suffixed_found 2024-05-08 20:48:33 -07:00
Agus Zubiaga
bb0ada0956
Add description to render_language_server doc 2024-05-08 09:32:06 -03:00
Agus Zubiaga
fb24111190
Narrow language server reports for load 2024-05-08 09:28:44 -03:00
Agus Zubiaga
accba0b75a
Narrow headers for language server reports 2024-05-08 09:24:56 -03:00
Anton-4
16f3969fc3
minor style improvements 2024-05-08 14:06:14 +02:00
Ayaz
010aed88f9
Merge pull request #6732 from roc-lang/import-parse-reporting
Friendly reporting of import syntax errors
2024-05-07 21:29:58 -05:00
Ayaz
cc1bc68eb4
Merge pull request #6717 from roc-lang/optional-ingested-ann
Optional annotation in ingested file imports
2024-05-07 21:18:12 -05:00
Agus Zubiaga
2a8ecbba28
Do not drop import parse errors 2024-05-07 22:39:43 -03:00
Agus Zubiaga
9a66abf95f
Report ingested file colon syntax error 2024-05-06 23:46:38 -03:00
Agus Zubiaga
27a9f6051e
Report ingested file name syntax error 2024-05-06 23:46:06 -03:00
Agus Zubiaga
755e16cb10
Report exposing list end error in imports 2024-05-06 23:38:12 -03:00
Agus Zubiaga
dc18597a0e
Report unfinished exposing in imports 2024-05-06 23:24:56 -03:00
Agus Zubiaga
f81985533c
Report import lowercase alias 2024-05-06 23:16:18 -03:00
Agus Zubiaga
97ed8fdbbd
Report unfinished import as 2024-05-06 23:03:40 -03:00
Agus Zubiaga
bfb77b78cb
Report import ending syntax error 2024-05-06 22:22:00 -03:00
Roland Rodriguez
fae1e4b51e
fix: ensure tests explicitly cleanup temp files 2024-05-06 19:20:43 -06:00
Agus Zubiaga
8418610dd9
Require newline after import 2024-05-06 22:15:52 -03:00
Agus Zubiaga
007e03891e
Report module name / path syntax error in imports 2024-05-06 21:00:17 -03:00
Agus Zubiaga
233310cabf
Report space problem in import 2024-05-06 20:26:07 -03:00
Roland Rodriguez
89f8798a37
close #6723: Update format_files to list all files
Changed the behavior of the format_files function in the Roc formatter to accumulate and list all files that require reformatting instead of stopping at the first file. This update improves the user experience by providing a comprehensive report of all files that need attention after a format check, allowing for more efficient batch updating of files to conform to formatting standards.
2024-05-06 09:54:39 -06:00
Agus Zubiaga
520dc389f3
Report ingested file annotation syntax error 2024-05-05 17:45:37 -03:00
Agus Zubiaga
56f12718f1
Only annotation spaces should be backtrackable 2024-05-05 17:39:49 -03:00
Agus Zubiaga
4b8b36529d
Remove unnecessary & ref 2024-05-05 17:08:34 -03:00
Agus Zubiaga
3c52edd0a0
Add ingested file no ann test 2024-05-05 17:00:05 -03:00
Agus Zubiaga
8a25e4aac4
Handle optional annotation in ingested files when canonicalizing 2024-05-05 16:57:56 -03:00
Agus Zubiaga
22716cea45
Format ingested file with optional annotation 2024-05-05 16:56:49 -03:00
Agus Zubiaga
fe2eb0f0a5
Parse optional ingested file annotation 2024-05-05 16:55:36 -03:00
Luke Boswell
ddccf8ff59
update glue platform files to new syntax 2024-05-05 16:46:34 +02:00
Luke Boswell
9a7b62ac22
handle dbg when unwrapping suffixed ! 2024-05-04 21:37:47 +02:00
Anton-4
7fbd7e2ad1
Merge pull request #6703 from roc-lang/dependabot/npm_and_yarn/crates/compiler/checkmate/www/ejs-3.1.10
Bump ejs from 3.1.9 to 3.1.10 in /crates/compiler/checkmate/www
2024-05-04 18:09:01 +02:00
Richard Feldman
600b0486de
Merge pull request #6711 from andyferris/floating-point-special-values
Floating point special values
2024-05-04 12:01:16 -04:00
Anton-4
388d43fc34
Merge branch 'main' into fix_6606 2024-05-04 16:26:40 +02:00
Folkert
241d2b565a
update mono tests 2024-05-04 15:59:59 +02:00
Andy Ferris
e636853bc8 Run cargo fmt 2024-05-04 12:39:34 +10:00
Andy Ferris
c74cc19220 Fix unit test with lambda 2024-05-04 11:42:04 +10:00
Andy Ferris
03e9344a83 Add new constants to symbol table, attempt to add tests 2024-05-03 19:50:12 +10:00
Andy Ferris
a0c4bb571f Add NaN and Infinity floating-point values to Num 2024-05-03 19:19:19 +10:00
Anton-4
f7011c8e33
Merge pull request #6644 from roc-lang/rust-1-76-0-upgrade
Rust 1.76.0 upgrade
2024-05-03 07:25:19 +02:00
dependabot[bot]
2d16d5c7d2
Bump ejs from 3.1.9 to 3.1.10 in /crates/compiler/checkmate/www
Bumps [ejs](https://github.com/mde/ejs) from 3.1.9 to 3.1.10.
- [Release notes](https://github.com/mde/ejs/releases)
- [Commits](https://github.com/mde/ejs/compare/v3.1.9...v3.1.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-02 12:07:30 +00:00
Richard Feldman
b53017a733
Merge pull request #6683 from roc-lang/new-module-headers
New `app`, `module`, and `package` headers
2024-05-01 16:06:26 -04:00
Brendan Hansknecht
dc539f759d
Improve OptSize implementation in Roc
1. Use the llvm `Oz` pipeline.
2. Avoid adding extra optimization passes.

This shrunk rocci-bird by ~16%.
2024-05-01 08:25:34 -07:00
Agus Zubiaga
e3b600c282
New package header syntax
Implements the new package header syntax as discussed in Zulip [1].

package [Csv] {
    parser: "../parser/main.roc"
}

Old headers still parse and are automatically upgraded to the new
syntax by the formatter.

[1] https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/Fewer.2Fdifferent.20keywords.20in.20the.20file.20header/near/418444862
2024-05-01 10:49:03 -03:00
Agus Zubiaga
8dedd9f03c
New app header syntax
Implements the new app header syntax as discussed in Zulip [1].

    app [main] {
	cli: platform "../platform/main.roc",
	json: "../json/main.roc"
    }

Old headers still parse and are automatically upgraded to the new
syntax by the formatter.

[1] https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/Fewer.2Fdifferent.20keywords.20in.20the.20file.20header/near/418444862
2024-05-01 10:49:01 -03:00
Agus Zubiaga
057a18573a
New module header
Implements the new `module` header syntax as described in "module and package changes" [1]:

```
module [Request, Response, req]
```

The old syntax should still work fine, and is automatically upgraded to the new one
when running `roc format`.

[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit
2024-05-01 10:39:12 -03:00
Agus Zubiaga
eb8ef6241e
Merge branch 'main' into inline-imports 2024-05-01 10:25:17 -03:00
Agus Zubiaga
d8d56f6e49
Rename {Parsed,Constrained}Module.imported_modules to available_modules 2024-05-01 09:58:23 -03:00
Richard Feldman
6c21bdf91f
cargo fmt
Signed-off-by: Richard Feldman <oss@rtfeldman.com>
2024-04-30 16:22:11 -04:00
Richard Feldman
e2b4af8af5
fix typos in comment
Signed-off-by: Richard Feldman <oss@rtfeldman.com>
2024-04-30 16:21:48 -04:00
Anton-4
c3cabf7840
Merge pull request #6685 from roc-lang/repl-import
Support imports in REPL
2024-04-30 19:49:26 +02:00
Anton-4
c303be7553
Merge branch 'main' into rust-1-76-0-upgrade 2024-04-30 19:36:01 +02:00
Anton-4
ec874655dd
apply Ayaz review suggestions 2024-04-30 19:34:21 +02:00
JRI98
eebd4b21c3
Support guards on lists with rest 2024-04-30 13:25:18 +01:00
faldor20
29864c2508
added timeout to analysis 2024-04-30 09:44:22 +10:00
faldor20
712d648cf0
reduce panics 2024-04-30 09:44:22 +10:00
Anton-4
9d28e70cdc
all fixed 2024-04-28 18:27:59 +02:00
Richard Feldman
7fcf13d14b
Update some tests to use ! 2024-04-28 11:26:37 -04:00
Anton-4
3742ef5f42
update basic-cli links to 0.10 2024-04-28 12:45:31 +02:00
Agus Zubiaga
b3cd71e460
match => if let value def 2024-04-28 00:13:01 -03:00
Agus Zubiaga
a8a829aadd
Merge branch 'main' into inline-imports 2024-04-28 00:11:29 -03:00
Agus Zubiaga
9df5fb7092
Refactor package_qualified_imported_modules in load 2024-04-27 23:01:22 -03:00
Agus Zubiaga
eea2196c30
Remove unnecessary ValueDef::IngestedFileImport branch in load/parse 2024-04-27 22:51:12 -03:00
Agus Zubiaga
2aa53eab32
Remove unncessary comment in load 2024-04-27 22:32:43 -03:00
Agus Zubiaga
a2b76fc8c3
Combine work in load update Header 2024-04-27 22:31:03 -03:00
Agus Zubiaga
87a279dc2c
Extract marking s builtin into header type method 2024-04-27 22:27:50 -03:00
Agus Zubiaga
8c62640b97
Remove pointless comment in load
Co-authored-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
Signed-off-by: Agus Zubiaga <hi@aguz.me>
2024-04-27 22:24:41 -03:00
Agus Zubiaga
afd9f79b90
Remove unnecessary platform shorthands assert 2024-04-27 22:16:59 -03:00
Luke Boswell
74e531b994
remove suffixed from Ident::Access and cleanup 2024-04-28 08:48:08 +10:00
Luke Boswell
20f277c132
update later tests 2024-04-28 08:47:08 +10:00
Luke Boswell
8d88e3ab7f
update snapshots 2024-04-28 08:47:08 +10:00
Luke Boswell
db4607125b
remove suffixed from Pattern 2024-04-28 08:47:08 +10:00
Luke Boswell
2fe03e6c91
remove suffixed from Expr::Var 2024-04-28 08:47:08 +10:00
Luke Boswell
1640ee1321
update logic for Expr::TaskAwaitBang 2024-04-28 08:47:08 +10:00
Joshua Warner
7c53cf0cd7
Fixup tests 2024-04-28 08:47:07 +10:00
Joshua Warner
6080c12ca8
Parse ! suffixes as an Expr::TaskAwaitBang instead of using suffix field in ident 2024-04-28 08:47:07 +10:00
Richard Feldman
f7716188a1
Merge pull request #6676 from roc-lang/ok-err
Allow the names `Ok` and `Err` as type aliases
2024-04-27 06:49:46 -04:00
Agus Zubiaga
46f640ca73
Support ingested files in the REPL 2024-04-26 23:43:36 -03:00
Agus Zubiaga
52f84910a7
Support importing local files in the REPL 2024-04-26 23:33:19 -03:00
Richard Feldman
052862e0c6
Fix some unused warnings 2024-04-26 22:20:23 -04:00
Richard Feldman
9b4cc9f25b
clippy 2024-04-26 20:34:58 -04:00
Richard Feldman
17d761252f
Improve reporting for doc links problems 2024-04-26 16:31:20 -04:00
Richard Feldman
00950d2a0e
Update insta snapshots 2024-04-26 06:59:01 -04:00
Richard Feldman
e895c71dbd
Ignore unused warnings if the module name is Task 2024-04-25 23:13:12 -04:00
Richard Feldman
ce4501c329
Update mono tests 2024-04-25 23:10:54 -04:00
Richard Feldman
6571c18a35
Update tests 2024-04-25 23:10:45 -04:00
Richard Feldman
f557a29090
Don't add Ok and Err as symbols to scope 2024-04-25 20:07:40 -04:00
Richard Feldman
e4bc7147c9
Add test to reproduce Ok and Err alias failure 2024-04-25 20:07:40 -04:00
Agus Zubiaga
e500d664fd
can: Replace AnnotationReferences with plain References
`AnnotationReferences` ignored the fact that within an annotation
the same symbol could be referenced both in a qualified and unqualified
manner.

By using `References` we will properly track all the possible combinations.
2024-04-23 21:16:32 -03:00
Agus Zubiaga
5ca1494df1
Add IdentIds::exposed_values 2024-04-23 20:12:54 -03:00
Agus Zubiaga
0f89d3558a
impl From<ImportedModuleName> for QualifiedModuleName 2024-04-23 20:03:07 -03:00
Luke Boswell
87feeb5135
add abilities for glue types 2024-04-24 08:45:29 +10:00
Agus Zubiaga
6fffaa6dda
Restore disabled roc_cli cli_file_check test 2024-04-23 19:00:10 -03:00
Agus Zubiaga
f69bc2e46f
Merge branch 'main' into inline-imports 2024-04-23 18:57:20 -03:00
Agus Zubiaga
7efc7a4a3e
Canonicalize ingested files directly instead of creating AST nodes 2024-04-23 18:55:41 -03:00
Anton-4
29e59dfec9
upgrade to basic-cli 0.9.1 2024-04-23 19:06:33 +02:00
Anton-4
8902f3e9e3
fix typo
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-04-23 12:57:04 +02:00
Jackson Wambolt
f44064e946
Fix failing parser doctests 2024-04-22 20:03:05 -05:00
Jackson Wambolt
f001cf98e6
Clarify doc for indented_seq
Previously said that `indented_seq` was similar to `and`, but it's more
like `skip_first`. `and` returns a tuple of both parsers' outputs, but
`indented_seq` only returns the output of the second parser, just like
`skip_first`.
2024-04-22 20:03:05 -05:00
Jackson Wambolt
dd2c786eb9
Un-macro collection_trailing_sep_e 2024-04-22 20:03:05 -05:00
Jackson Wambolt
1c916202e7
Un-macro collection_inner 2024-04-22 20:03:05 -05:00
Jackson Wambolt
02c98f7519
Un-macro either 2024-04-22 20:03:05 -05:00
Jackson Wambolt
2f776f366f
Un-macro one_or_more 2024-04-22 20:03:04 -05:00
Jackson Wambolt
f88e46fc32
Un-macro zero_or_more 2024-04-22 20:03:04 -05:00
Jackson Wambolt
a9724dda5e
Un-macro map_with_arena 2024-04-22 20:03:04 -05:00
Jackson Wambolt
f6c977fb96
Un-macro succeed
This implementation requires that the type of the value impls `Clone`,
which means the function version of `succeed` cannot be used to succeed
with values of non-`Clone` types.

If this becomes an issue, we could either bring back the macro version,
or create a new `succeed_with` function that takes a `Fn() -> T`
argument. `succeed_with` could then be used to succeed with values that
aren't `Clone` by creating the value on-demand each time the parser is
run.
2024-04-22 20:03:04 -05:00
Jackson Wambolt
5c0b2a0938
Un-macro loc 2024-04-22 20:03:04 -05:00
Jackson Wambolt
3394aab650
Un-macro map 2024-04-22 20:03:04 -05:00
Jackson Wambolt
41d7d02e2a
Un-macro add 2024-04-22 20:03:03 -05:00
Jackson Wambolt
64290a8cf6
Un-macro absolute_indented_seq 2024-04-22 20:03:03 -05:00
Jackson Wambolt
1b4b0a0aa1
Un-macro indented_seq 2024-04-22 20:03:03 -05:00
Jackson Wambolt
60fa7ebe9e
Un-macro between 2024-04-22 20:03:03 -05:00
Jackson Wambolt
8a144149e2
Un-macro skip_first 2024-04-22 20:03:03 -05:00
Jackson Wambolt
e8ae2e12f8
Un-macro skip_second 2024-04-22 20:03:00 -05:00
Agus Zubiaga
6006669702
Report unused imports after canonicalizing platform requires ann 2024-04-22 19:53:19 -03:00
Agus Zubiaga
d952d5576a
Handle explicit builtin imports with empty exposing lists
Also includes related style suggestions by Ayaz on #6658
2024-04-22 18:29:48 -03:00
Agus Zubiaga
66bf955a6e
can/def match => if..let 2024-04-22 17:51:51 -03:00
Agus Zubiaga
d17eb8d340
Remove #[inline] ann for can::Env::module_exists_but_not_imported 2024-04-22 17:47:02 -03:00
Agus Zubiaga
4476277a56
Merge branch 'main' into inline-imports 2024-04-22 17:45:25 -03:00
Luke Boswell
84cd4233be
clippy fix 2024-04-22 18:55:34 +10:00
Luke Boswell
aa5dc09900
support for more trailing ! 2024-04-22 18:38:51 +10:00
Luke Boswell
32c4083364
add new tests for trailing ! 2024-04-22 18:38:26 +10:00
Luke Boswell
e4713ce2c5
Merge pull request #6657 from roc-lang/issue-6074
Fix parsing lists in tag patterns
2024-04-22 12:11:31 +10:00
Ayaz Hafiz
2763bc57cb
Some minor cleanup in language_server 2024-04-21 18:19:59 -05:00
Ayaz Hafiz
88c4a3af4e
Rename lang_srv to language_server 2024-04-21 18:03:56 -05:00
Agus Zubiaga
5112e064e5
Add module_path to can env instead of threading it through 2024-04-21 10:30:34 -03:00
Agus Zubiaga
e5789158e5
Remove todo on ingested file handling 2024-04-21 10:13:26 -03:00
Agus Zubiaga
1b3c16e517
Handle import ValueDef in lang_srv tokens 2024-04-21 09:39:39 -03:00
Luke Boswell
d69d2ee940
replace removed comment 2024-04-21 13:45:04 +10:00
Luke Boswell
9ad6d9248c
converge loc_pattern_help_help and loc_parse_tag_pattern_arg 2024-04-21 13:32:38 +10:00
Luke Boswell
6844df6c37
fix parsing lists in tag patterns 2024-04-21 13:27:50 +10:00
Agus Zubiaga
7ebfc6d06d
Support both inline and header imports
Load will now convert header imports to inline import defs, so that
we can support both temporarily.
2024-04-20 19:04:09 -03:00
Luke Boswell
4cf256c6b7
Merge pull request #6654 from joshuawarner32/proposed_check_indent_fix
Remove unnecessary arg to check_indent
2024-04-21 07:49:17 +10:00
Joshua Warner
a24daeaa57
Fix syntax fuzzer cargo config 2024-04-20 11:21:36 -07:00
Anton-4
c1d0c24194
fix expected type
Rust's u128 and Roc's U128 have different alignment. They can not be used interchangebly, that leads to segmentation faults. See also https://roc.zulipchat.com/#narrow/stream/395097-compiler-development/topic/str_to_u128.20segfault/near/434410692
2024-04-20 19:57:47 +02:00
Agus Zubiaga
7a53484479
Report an error when import shadows a symbol in scope 2024-04-20 12:38:17 -03:00
Agus Zubiaga
979aff8bf7
Explicit builtin import warning
We will now show a warning if a builtin is imported explicitly,
since this is unncessary.

We will not show the warning if they expose functions from the builtin:

	import Dict exposing [isEmpty]

However, we will show a special warning if they expose types from it:

	import Dict exposing [Dict, isEmpty]
2024-04-20 12:35:46 -03:00
Agus Zubiaga
3217e5a3f0
Allow dots in import module names
We found some issues with the private submodules part of the proposal [1],
and we decided to keep module directories for now.

[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit#heading=h.x84bh32l37em
2024-04-20 12:33:02 -03:00
Agus Zubiaga
b56f029a09
Fix unqualified unused import false positive
If we exposed a symbol in an import and used it both unqualified
and qualified, we'd produce an unused warning false positive.

This happened because we were using a single bit flag to determine
whether a value was used qualified or unqualified.
2024-04-20 12:18:52 -03:00
Agus Zubiaga
1f347f6ca1
Fix package module resolution in inline imports
We were still passing `ModuleIds` from `load` to `can`, but now
that imports can appear in any scope, we don't know which package
an unqualified module name belongs to from the top level.

We now pass `PackageModuleIds` instead  and keep a Map of `ModuleName` to
`ModuleId` in `Scope`.

This also allow us to import multiple modules with the same name from different
packages as long as a unique alias is provided.
2024-04-20 12:16:37 -03:00
Agus Zubiaga
842a256907
Implement import aliases
Allows a module to be imported with an alias:

    import JsonDecode as JD

Import aliases must be unique and they cannot have the same name
as an imported module.
2024-04-20 12:07:01 -03:00
Agus Zubiaga
d5a38a26db
Merge branch 'main' into inline-imports 2024-04-20 12:01:11 -03:00
Joshua Warner
50d2111919
Remove unnecessary arg to check_indent
Quick refactoring / follow-up to #6634
2024-04-19 20:25:55 -07:00
Richard Feldman
6059f7afcb
Merge pull request #6651 from roc-lang/fix-nesting-suffix
Fix recursion for suffixed `!` in top-level def
2024-04-19 14:53:34 -04:00
Richard Feldman
da129c9a41
Merge pull request #6650 from nathanielknight/fix-shiftLeftBy-example
Minor fix to the docstring of `Num.shiftLeftBy`
2024-04-19 07:19:48 -04:00