Commit graph

6193 commits

Author SHA1 Message Date
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
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
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 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
Luke Boswell
5e738a4ab5
fix recursion in top-level def 2024-04-19 10:34:33 +10:00
Nathaniel Knight
02689de797 Minor fix to the docstring of Num.shiftLeftBy 2024-04-17 20:50:17 -07:00
Luke Boswell
ae908f89a9
suffixed when branches 2024-04-18 12:47:11 +10:00
Luke Boswell
a889810dfd
unwrap suffixed when condition 2024-04-18 09:44:57 +10:00
Luke Boswell
0198a683c7
fix unwrapping of trailing expr 2024-04-17 09:54:29 +10:00
Anton-4
99ca3f545f
clippy 2024-04-16 20:02:08 +02:00
Anton-4
1a5e065055
Merge branch 'main' into rust-1-76-0-upgrade 2024-04-16 13:33:27 +02:00
Luke Boswell
7a84dcd39c
don't unwrap intermediate answer if not required 2024-04-16 16:25:20 +10:00
Luke Boswell
c5cba98381
Merge remote-tracking branch 'remote/main' into suffixed-bang 2024-04-16 06:42:31 +10:00
Anton-4
5c45cc9c3e
fmt 2024-04-15 19:38:04 +02:00
Anton-4
dc96e194bd
clippy 2024-04-15 19:36:52 +02:00
Anton-4
a7b843743d
upgrade to rust 1.76.0 2024-04-15 19:20:07 +02:00
Anton-4
8502a37b3c
fmt 2024-04-15 16:51:07 +02:00
Anton-4
e4b814ce1c
clippy 2024-04-15 16:50:44 +02:00
Anton-4
4d9202ec6e
upgrade to rust 1.75.0 2024-04-15 16:29:23 +02:00