mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-29 17:33:45 +00:00
Move ModuleNameEnum into HeaderType
This commit is contained in:
parent
e2137cc310
commit
97332e4af1
3 changed files with 48 additions and 68 deletions
|
@ -12,17 +12,21 @@ use std::fmt::Debug;
|
|||
#[derive(Debug)]
|
||||
pub enum HeaderType<'a> {
|
||||
App {
|
||||
output_name: StrLiteral<'a>,
|
||||
to_platform: To<'a>,
|
||||
},
|
||||
Hosted {
|
||||
name: ModuleName<'a>,
|
||||
generates: UppercaseIdent<'a>,
|
||||
generates_with: &'a [Loc<ExposedName<'a>>],
|
||||
},
|
||||
/// Only created during canonicalization, never actually parsed from source
|
||||
Builtin {
|
||||
name: ModuleName<'a>,
|
||||
generates_with: &'a [Symbol],
|
||||
},
|
||||
Platform {
|
||||
name: PackageName<'a>,
|
||||
opt_app_module_id: Option<ModuleId>,
|
||||
provides: &'a [Loc<ExposedName<'a>>],
|
||||
requires: &'a [Loc<TypedIdent<'a>>],
|
||||
|
@ -35,7 +39,9 @@ pub enum HeaderType<'a> {
|
|||
#[allow(dead_code)]
|
||||
platform_main_type: TypedIdent<'a>,
|
||||
},
|
||||
Interface,
|
||||
Interface {
|
||||
name: ModuleName<'a>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
||||
|
@ -99,15 +105,6 @@ impl<'a> ModuleName<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ModuleNameEnum<'a> {
|
||||
/// A filename
|
||||
App(StrLiteral<'a>),
|
||||
Interface(ModuleName<'a>),
|
||||
Hosted(ModuleName<'a>),
|
||||
Platform(PackageName<'a>),
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
||||
pub struct ExposedName<'a>(&'a str);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue