diff --git a/v0.5/fastn-compiler/src/compiler.rs b/v0.5/fastn-compiler/src/compiler.rs index 5ccd35e86..d0388fdea 100644 --- a/v0.5/fastn-compiler/src/compiler.rs +++ b/v0.5/fastn-compiler/src/compiler.rs @@ -5,18 +5,11 @@ pub(crate) struct Compiler { pub(crate) definitions_used: std::collections::HashSet, pub(crate) interner: string_interner::DefaultStringInterner, pub(crate) definitions: - std::collections::HashMap, + std::collections::HashMap, /// checkout resolve_document for why this is an Option - content: Option< - Vec< - fastn_unresolved::UR< - fastn_unresolved::ComponentInvocation, - fastn_resolved::ComponentInvocation, - >, - >, - >, + content: Option>, pub(crate) document: fastn_unresolved::Document, - desugared_auto_import: Vec, + desugared_auto_import: Vec, } impl Compiler { diff --git a/v0.5/fastn-compiler/src/symbols.rs b/v0.5/fastn-compiler/src/symbols.rs index f560ff73f..e3c3c684b 100644 --- a/v0.5/fastn-compiler/src/symbols.rs +++ b/v0.5/fastn-compiler/src/symbols.rs @@ -13,6 +13,6 @@ pub trait SymbolStore { &mut self, interner: &mut string_interner::DefaultStringInterner, symbols: &std::collections::HashSet, - desugared_auto_imports: &[fastn_unresolved::UR], - ) -> Vec; + desugared_auto_imports: &[fastn_unresolved::URD], + ) -> Vec; } diff --git a/v0.5/fastn-unresolved/src/lib.rs b/v0.5/fastn-unresolved/src/lib.rs index 4370bc53c..76564a185 100644 --- a/v0.5/fastn-unresolved/src/lib.rs +++ b/v0.5/fastn-unresolved/src/lib.rs @@ -24,14 +24,17 @@ pub struct Symbol { module_len: u16, } -pub type LookupResult = - fastn_unresolved::UR; +pub type URD = fastn_unresolved::UR; +pub type URCI = fastn_unresolved::UR< + fastn_unresolved::ComponentInvocation, + fastn_resolved::ComponentInvocation, +>; #[derive(Debug, Clone, Default)] pub struct Document { pub module_doc: Option, - pub definitions: Vec, - pub content: Vec>, + pub definitions: Vec, + pub content: Vec, pub errors: Vec>, pub warnings: Vec>, pub comments: Vec, @@ -55,7 +58,7 @@ pub enum InnerDefinition { ModuleAlias(Symbol), Component { arguments: Vec>, - body: Vec>, + body: Vec, }, Variable { kind: UR, @@ -114,7 +117,7 @@ pub enum InnerDefinition { } #[derive(Debug, Clone, PartialEq)] -pub enum UR { +pub enum UR { Resolved(R), UnResolved(U), NotFound, diff --git a/v0.5/fastn-unresolved/src/parser/import.rs b/v0.5/fastn-unresolved/src/parser/import.rs index 7e9ca5360..d884570b9 100644 --- a/v0.5/fastn-unresolved/src/parser/import.rs +++ b/v0.5/fastn-unresolved/src/parser/import.rs @@ -78,6 +78,7 @@ fn parse_import( #[derive(Debug, Clone, PartialEq)] pub enum Export { + #[expect(unused)] All, Things(Vec), } @@ -131,7 +132,7 @@ fn aliasable(span: &fastn_section::Span, s: &str) -> AliasableIdentifier { #[cfg(test)] mod tests { #[track_caller] - fn tester(mut d: fastn_unresolved::Document, expected: serde_json::Value) { + fn tester(d: fastn_unresolved::Document, _expected: serde_json::Value) { assert!(d.content.is_empty()); assert!(d.definitions.is_empty()); diff --git a/v0.5/fastn-unresolved/src/parser/mod.rs b/v0.5/fastn-unresolved/src/parser/mod.rs index 71cd65b5b..4aafbf56e 100644 --- a/v0.5/fastn-unresolved/src/parser/mod.rs +++ b/v0.5/fastn-unresolved/src/parser/mod.rs @@ -1,7 +1,7 @@ mod component_invocation; mod import; -pub fn parse(source: &str, auto_imports: &[fastn_unresolved::UR]) -> fastn_unresolved::Document { +pub fn parse(source: &str, auto_imports: &[fastn_unresolved::URD]) -> fastn_unresolved::Document { let (mut document, sections) = fastn_unresolved::Document::new( fastn_section::Document::parse(&arcstr::ArcStr::from(source)), auto_imports, diff --git a/v0.5/fastn-unresolved/src/resolver/mod.rs b/v0.5/fastn-unresolved/src/resolver/mod.rs index 14a57a08e..d24516046 100644 --- a/v0.5/fastn-unresolved/src/resolver/mod.rs +++ b/v0.5/fastn-unresolved/src/resolver/mod.rs @@ -9,8 +9,7 @@ mod component_invocation; mod definition; pub struct Input<'a> { - pub definitions: - &'a std::collections::HashMap, + pub definitions: &'a std::collections::HashMap, pub builtins: &'a indexmap::IndexMap, pub interner: &'a string_interner::DefaultStringInterner, } diff --git a/v0.5/fastn-unresolved/src/utils.rs b/v0.5/fastn-unresolved/src/utils.rs index 0da2f0f37..9a99f6d5d 100644 --- a/v0.5/fastn-unresolved/src/utils.rs +++ b/v0.5/fastn-unresolved/src/utils.rs @@ -1,7 +1,7 @@ impl fastn_unresolved::Document { pub(crate) fn new( document: fastn_section::Document, - desugared_auto_imports: &[fastn_unresolved::UR], + desugared_auto_imports: &[fastn_unresolved::URD], ) -> (fastn_unresolved::Document, Vec) { ( fastn_unresolved::Document { @@ -195,6 +195,6 @@ impl fastn_unresolved::Symbol { pub fn desugar_auto_imports( _auto_imports: &[fastn_section::AutoImport], -) -> Vec { +) -> Vec { todo!() } diff --git a/v0.5/fastn/src/symbols.rs b/v0.5/fastn/src/symbols.rs index a1b418d12..dc8669113 100644 --- a/v0.5/fastn/src/symbols.rs +++ b/v0.5/fastn/src/symbols.rs @@ -6,8 +6,8 @@ impl Symbols { &mut self, interner: &mut string_interner::DefaultStringInterner, (file, symbol): (String, fastn_unresolved::Symbol), - desugared_auto_imports: &[fastn_unresolved::UR], - ) -> Vec { + desugared_auto_imports: &[fastn_unresolved::URD], + ) -> Vec { // we need to fetch the symbol from the store let source = match std::fs::File::open(file.as_str()).and_then(std::io::read_to_string) { Ok(v) => v, @@ -39,8 +39,8 @@ impl fastn_compiler::SymbolStore for Symbols { &mut self, interner: &mut string_interner::DefaultStringInterner, symbols: &std::collections::HashSet, - desugared_auto_imports: &[fastn_unresolved::UR], - ) -> Vec { + desugared_auto_imports: &[fastn_unresolved::URD], + ) -> Vec { let unique_modules = symbols .iter() .map(|s| file_for_symbol(s, interner))