pub struct ScriptGrouping<'a> {
pub table: &'a LanguageTable,
pub engine: Option<&'a str>,
}Expand description
Which language each part of an app’s script belongs to.
engine is the app’s [script] engine key, which puts every script, inline
and external, on one language. Otherwise each external file belongs to its
extension’s language (an extension no language claims reads as the
default language), and the inline block joins the app’s one external
language when there is exactly one, and the default language otherwise.
Fields§
§table: &'a LanguageTableThe descriptors in reach.
engine: Option<&'a str>The [script] engine override.
Implementations§
Source§impl ScriptGrouping<'_>
impl ScriptGrouping<'_>
Sourcepub fn external_language(&self, rel: &str) -> String
pub fn external_language(&self, rel: &str) -> String
The language an external script file belongs to.
Sourcepub fn inline_language(&self, externals: &[&str]) -> String
pub fn inline_language(&self, externals: &[&str]) -> String
The language the inline block belongs to, given the app’s external script files.
Sourcepub fn languages(&self, has_inline: bool, externals: &[&str]) -> Vec<String>
pub fn languages(&self, has_inline: bool, externals: &[&str]) -> Vec<String>
The languages an app needs, from whether it has an inline block and the paths of its external script files: what a run loads hosts for before anything is parsed.
Sourcepub fn group(
&self,
inline: &str,
inline_map: &SourceMap,
externals: &[ScriptFile<'_>],
) -> GroupedScripts
pub fn group( &self, inline: &str, inline_map: &SourceMap, externals: &[ScriptFile<'_>], ) -> GroupedScripts
Split an app’s script by language. inline is the inline blocks and
inline_map where each of them was written; externals is each
external file, in source order.
Trait Implementations§
Source§impl<'a> Clone for ScriptGrouping<'a>
impl<'a> Clone for ScriptGrouping<'a>
Source§fn clone(&self) -> ScriptGrouping<'a>
fn clone(&self) -> ScriptGrouping<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more