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
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
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
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
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
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
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] 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] 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
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
db4607125b
remove suffixed from Pattern
2024-04-28 08:47:08 +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
Richard Feldman
17d761252f
Improve reporting for doc links problems
2024-04-26 16:31:20 -04:00
Richard Feldman
e895c71dbd
Ignore unused warnings if the module name is Task
2024-04-25 23:13:12 -04:00
Richard Feldman
6571c18a35
Update tests
2024-04-25 23:10:45 -04:00
Agus Zubiaga
0f89d3558a
impl From<ImportedModuleName> for QualifiedModuleName
2024-04-23 20:03:07 -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
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
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
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