Merge branch 'main' of https://github.com/rtfeldman/roc into parser-docs

This commit is contained in:
Trevor Settles 2024-03-16 15:02:49 -06:00
commit 949b3f83bd
No known key found for this signature in database
GPG key ID: F46B83058222DBAA
24 changed files with 954 additions and 597 deletions

View file

@ -79,6 +79,32 @@ pub enum HeaderType<'a> {
},
}
impl<'a> HeaderType<'a> {
pub fn get_name(self) -> Option<&'a str> {
match self {
Self::Interface { name, .. }
| Self::Builtin { name, .. }
| Self::Hosted { name, .. } => Some(name.into()),
Self::App {
output_name: StrLiteral::PlainLine(name),
..
}
| Self::Platform {
config_shorthand: name,
..
}
| Self::Package {
config_shorthand: name,
..
} => Some(name),
Self::App { .. } => {
//TODO:Eli This can be removed once module params is implemented and app names are no longer strings
None
}
}
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub enum Version<'a> {
Exact(&'a str),