1use alloc::string::String;
2#[cfg(feature = "compiler")]
3use alloc::vec::Vec;
4#[cfg(feature = "compiler")]
5use ellie_core::defs::Version;
6#[cfg(feature = "compiler")]
7use ellie_core::warning::Warning;
8#[cfg(feature = "compiler")]
9use ellie_parser::parser::Module;
10#[cfg(feature = "compiler")]
11use ellie_tokenizer::tokenizer::ResolvedImport;
12
13#[cfg(feature = "compiler")]
14pub struct CompileOutput {
18 pub warnings: Vec<Warning>,
19 pub module: Module,
20}
21
22pub struct MainProgram {
24 pub file_content: String,
26 pub file_name: String,
28 pub file_hash: usize,
30 pub start_directory: String,
32}
33
34#[cfg(feature = "compiler")]
35#[derive(Clone)]
36pub struct CompilerSettings {
38 pub name: String,
40 pub file_name: String,
42 pub is_lib: bool,
44 pub description: String,
46 pub experimental_features: bool,
48 pub version: Version,
50 pub byte_code_architecture: ellie_core::defs::PlatformArchitecture,
52}
53
54#[cfg(feature = "compiler")]
56pub trait ProgramRepository {
57 fn read_main(&mut self) -> MainProgram;
61
62 fn read_module(
70 &mut self,
71 link_module: bool,
72 current_path: String,
73 requested_path: String,
74 ) -> ResolvedImport;
75}
76
77pub struct ModuleMap {
78 pub module_name: String,
79 pub module_path: Option<String>,
80}