Move some logic into HeaderFor

This commit is contained in:
Richard Feldman 2022-12-06 14:25:43 -05:00
parent 24f2fcc28a
commit 12a7b51eb4
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
2 changed files with 10 additions and 1 deletions

View file

@ -4468,6 +4468,10 @@ fn send_header_two<'a>(
config_shorthand: opt_shorthand.unwrap_or_default(), config_shorthand: opt_shorthand.unwrap_or_default(),
platform_main_type: requires[0].value, platform_main_type: requires[0].value,
main_for_host, main_for_host,
opt_app_module_id,
provides,
requires,
requires_types,
}; };
let mut package_qualified_imported_modules = MutSet::default(); let mut package_qualified_imported_modules = MutSet::default();

View file

@ -5,7 +5,7 @@ use crate::parser::{optional, then};
use crate::parser::{specialize, word1, EPackageEntry, EPackageName, Parser}; use crate::parser::{specialize, word1, EPackageEntry, EPackageName, Parser};
use crate::string_literal; use crate::string_literal;
use bumpalo::collections::Vec; use bumpalo::collections::Vec;
use roc_module::symbol::Symbol; use roc_module::symbol::{ModuleId, Symbol};
use roc_region::all::Loc; use roc_region::all::Loc;
use std::fmt::Debug; use std::fmt::Debug;
@ -23,6 +23,11 @@ pub enum HeaderFor<'a> {
generates_with: &'a [Symbol], generates_with: &'a [Symbol],
}, },
Platform { Platform {
opt_app_module_id: Option<ModuleId>,
provides: &'a [Loc<ExposedName<'a>>],
requires: &'a [Loc<TypedIdent<'a>>],
requires_types: &'a [Loc<UppercaseIdent<'a>>],
/// usually `pf` /// usually `pf`
config_shorthand: &'a str, config_shorthand: &'a str,
/// the type scheme of the main function (required by the platform) /// the type scheme of the main function (required by the platform)