Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions jaq-core/src/load/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::{ops, path};
#[cfg(feature = "std")]
use alloc::boxed::Box;
use alloc::{string::String, vec::Vec};
use core::borrow::Borrow;
pub use lex::Lexer;
use lex::Token;
pub use parse::Parser;
Expand Down Expand Up @@ -336,14 +337,14 @@ impl<'s, P: Clone + Eq, R: FnMut(Import<&'s str, P>) -> ReadResult<P>> Loader<&'
/// Load a set of modules, starting from a given file.
pub fn load(
mut self,
arena: &'s Arena,
arena: impl Borrow<&'s Arena>,
file: File<&'s str, P>,
) -> Result<Modules<&'s str, P>, Errors<&'s str, P>> {
let result = parse_main(file.code)
.and_then(|m| {
m.map(|path, meta| {
let (parent, meta) = (&file.path, &meta);
self.find(arena, Import { parent, path, meta })
self.find(arena.borrow(), Import { parent, path, meta })
})
})
.map(|m| m.map_body(|body| Vec::from([Def::new("main", Vec::new(), body)])));
Expand Down