Agus Zubiaga
b451e69b20
Merge branch 'main' into typecheck-module-params
2024-08-12 22:27:16 -03:00
Joshua Warner
d25c048d48
Move Full from fmt to parse and reorganize confusingly-named Module ast type
2024-08-07 23:01:49 -07:00
Agus Zubiaga
7ac72159e9
Parse module params loc and rename to pattern
2024-07-02 04:10:45 -03:00
Agus Zubiaga
c6e42ecf0c
Canonicalize module param patterns
2024-07-02 04:10:45 -03: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
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
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
Anton-4
c3cabf7840
Merge pull request #6685 from roc-lang/repl-import
...
Support imports in REPL
2024-04-30 19:49:26 +02:00
Agus Zubiaga
87a279dc2c
Extract marking s builtin into header type method
2024-04-27 22:27:50 -03:00
Agus Zubiaga
52f84910a7
Support importing local files in the REPL
2024-04-26 23:33:19 -03:00
Agus Zubiaga
0f89d3558a
impl From<ImportedModuleName> for QualifiedModuleName
2024-04-23 20:03:07 -03:00
Jackson Wambolt
a9724dda5e
Un-macro map_with_arena
2024-04-22 20:03:04 -05:00
Jackson Wambolt
5c0b2a0938
Un-macro loc
2024-04-22 20:03:04 -05:00
Jackson Wambolt
41d7d02e2a
Un-macro add
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
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
d5a38a26db
Merge branch 'main' into inline-imports
2024-04-20 12:01:11 -03:00
Anton-4
59ab438c1e
misc improvements
2024-03-26 16:38:09 +01:00
Anton-4
ad4fa6a4d7
fix spelling
2024-03-16 14:44:36 +01:00
Anton-4
3fadcf7bcb
style changes
2024-03-16 14:41:08 +01:00
faldor20
3fe3a3439a
cleanup fetching module docs
2024-03-11 15:17:46 +10:00
Agus Zubiaga
eb68bf943a
Merge branch 'main' into module-params
2024-01-27 09:36:20 -03:00
Agus Zubiaga
710d62f754
Load and can new top-level imports
...
Previously, all imports were available in the header, so we could start
processing dependencies as soon as we parsed it. However, the new imports
are treated as defs, so we have to parse the whole module to find them.
This commit essentially moves the dependency resolution from the `LoadHeader`
phase to the `Parse` phase, and it updates canonicalization to introduce
module symbols into scope when a `ValueDef::ModuleImport` is encountered.
NOTE:
- The `imports` header still parses, but it's no longer wired up. I will remove
it in an upcoming commit.
- Ingested files and imports that appear in nested expressions are not
yet supported by load
2024-01-20 08:39:31 -03:00
Agus Zubiaga
42e755677c
Simply import parsing and formatting by using header::KeywordItem
2024-01-20 08:35:50 -03:00
Agus Zubiaga
65ce811587
Parse and format import package shorthand
...
The original proposal [1] suggested dropping the package shorthand,
but we later decided to keep it [2] to improve UX.
[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit?usp=sharing
[2] 385104011
2024-01-20 08:35:50 -03:00
Agus Zubiaga
933fde77a0
Parse and format top-level import defs with no alias or exposed members
2024-01-20 08:35:50 -03:00
faldor20
f36befdd4c
made nicer error
2024-01-07 11:28:05 +10:00
Joshua Warner
654248ad47
Allow spaces before and after the colon in the packages
header section
...
Fixes #4902
2023-07-03 15:46:50 -07:00
Brendan Hansknecht
99547086ee
add very rough framework of how the parse might need to change
2023-04-09 14:03:31 -07:00
Joshua Warner
a1cd114198
Add a Malformed trait, and assert that 'passing' tests don't produce a malformed result
2023-01-25 21:01:05 -08:00
Joshua Warner
94070e8ba6
Improve parsing of scalar literals
...
* Unify parsing of string literals and scalar literals, to (e.g.) ensure escapes are handled uniformly. Notably, this makes unicode escapes valid in scalar literals.
* Add a variety of custom error messages about specific failure cases of parsing string/scalar literals. For example, if we're expecting a string (e.g. a package name in the header) and the user tried using single quotes, give a clear message about that.
* Fix formatting of unicode escapes (they previously used {}, now correctly use () to match roc strings)
2023-01-07 15:12:52 -08:00
Richard Feldman
d8d517d6f9
Support generating docs for packages too
2022-12-24 22:32:14 -05:00
Richard Feldman
e549456668
Store exposed module IDs in file loading state
2022-12-24 22:32:13 -05:00
Richard Feldman
09764be7c3
Go back to PackageName
2022-12-18 10:11:19 -05:00
Richard Feldman
3e5b62db1a
Move exposes
into HeaderType
2022-12-13 06:59:25 -05:00
Richard Feldman
7512a964f7
Add HeaderType::Package
2022-12-13 06:44:02 -05:00
Richard Feldman
ec9cf4efe2
Merge branch 'to' into packages
2022-12-12 01:15:34 -05:00
Richard Feldman
8a9e152a5b
Rename PackageName to PackagePath
2022-12-12 00:41:55 -05:00
Richard Feldman
3227f95d45
Merge branch 'refactor-platform-info' into packages
2022-12-11 06:17:29 -05:00
Richard Feldman
222e0193a3
Don't give packages names
2022-12-10 01:43:53 -05:00
Richard Feldman
29182d8292
Move platform_main_type into provides
2022-12-09 14:19:07 -05:00
Richard Feldman
97332e4af1
Move ModuleNameEnum into HeaderType
2022-12-08 15:31:43 -05:00
Richard Feldman
8b463686bc
Propagate multiple entrypoints to alias analysis
2022-12-08 15:31:42 -05:00
Richard Feldman
87c8702c89
Rename HeaderFor to HeaderType
2022-12-08 15:31:42 -05:00
Richard Feldman
12a7b51eb4
Move some logic into HeaderFor
2022-12-08 15:31:42 -05:00
Richard Feldman
24f2fcc28a
Remove an unnecessary qualifier
2022-12-08 15:31:41 -05:00
Richard Feldman
2b1deff379
Revert "Merge PlatformHeaderInfo into revised HeaderInfo"
...
This reverts commit 6115781b9d
.
2022-12-06 14:06:05 -05:00