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:
Agus Zubiaga 2024-03-04 19:58:22 -03:00
parent 8dedd9f03c
commit e3b600c282
No known key found for this signature in database
16 changed files with 169 additions and 132 deletions

View file

@ -299,9 +299,9 @@ impl<'a> RemoveSpaces<'a> for Module<'a> {
.remove_spaces(arena),
}),
Header::Package(header) => Header::Package(PackageHeader {
before_name: &[],
name: header.name.remove_spaces(arena),
before_exposes: &[],
exposes: header.exposes.remove_spaces(arena),
before_packages: &[],
packages: header.packages.remove_spaces(arena),
}),
Header::Platform(header) => Header::Platform(PlatformHeader {