mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
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
This commit is contained in:
parent
8dedd9f03c
commit
e3b600c282
16 changed files with 169 additions and 132 deletions
|
@ -244,15 +244,14 @@ impl IterTokens for AppHeader<'_> {
|
|||
impl IterTokens for PackageHeader<'_> {
|
||||
fn iter_tokens<'a>(&self, arena: &'a Bump) -> BumpVec<'a, Loc<Token>> {
|
||||
let Self {
|
||||
before_name: _,
|
||||
name,
|
||||
before_exposes: _,
|
||||
exposes,
|
||||
before_packages: _,
|
||||
packages,
|
||||
} = self;
|
||||
|
||||
(name.iter_tokens(arena).into_iter())
|
||||
.chain(exposes.item.iter_tokens(arena))
|
||||
.chain(packages.item.iter_tokens(arena))
|
||||
(exposes.iter_tokens(arena).into_iter())
|
||||
.chain(packages.value.iter_tokens(arena))
|
||||
.collect_in(arena)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue