MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / run_full

Method run_full

src/compilation_pipeline.rs:771–914  ·  view source on GitHub ↗
(
        &self,
        source: &str,
        stdlib_objects: &[(&str, &AssembledOutput)],
    )

Source from the content-addressed store, hash-verified

769 );
770 return Ok(CompilationResult {
771 tokens_display: out.tokens_display,
772 ast_display: out.ast_display,
773 ir_program: out.ir,
774 diagnostics: warnings,
775 });
776 }
777 }
778
779 let stem = self
780 .artifact_stem
781 .borrow()
782 .clone()
783 .unwrap_or_else(|| self.default_artifact_stem(Location::caller(), "ir", source));
784 *self.last_artifact_stem.borrow_mut() = Some(sanitize_artifact_component(&stem));
785 self.write_text_artifact("ir", &stem, ".ir", &out.ir.to_string());
786
787 log::info!("Compilation complete");
788 Ok(CompilationResult {
789 tokens_display: out.tokens_display,
790 ast_display: out.ast_display,
791 ir_program: out.ir,
792 diagnostics: out.diagnostics,
793 })
794 }
795
796 /// Run all pipeline stages, returning typed per-stage outputs. `stdlib_objects`
797 /// is empty when compiling stdlib or kernel sources standalone.
798 #[track_caller]
799 pub fn run_full(
800 &self,
801 source: &str,
802 stdlib_objects: &[(&str, &AssembledOutput)],
803 ) -> PipelineResult {
804 let resolved = match self.resolve_modules(source) {
805 Ok(resolved) => resolved,
806 Err(diagnostics) => {
807 return PipelineResult {
808 diagnostics,
809 lex: None,
810 parse: None,
811 ir: None,
812 asm: None,
813 binary: None,
814 assembler_error: None,
815 exec: None,
816 };
817 }
818 };
819 let compiler = HllCompiler::new(CompileConfig {
820 target: self.target_mode,
821 strict: self.run_semantic_analysis,
822 string_prefix: self.string_prefix.clone(),
823 type_prelude: self.type_prelude.clone(),
824 source_prelude: resolved.prelude,
825 module_aliases: resolved.aliases,
826 module_mangle_prefix: self
827 .mangle_modules
828 .then(|| self.current_module_prefix.clone())

Callers 1

compileMethod · 0.80

Calls 14

resolve_modulesMethod · 0.80
effective_entry_pointMethod · 0.80
anyMethod · 0.80
pushMethod · 0.80
with_noteMethod · 0.80
default_artifact_stemMethod · 0.80
write_text_artifactMethod · 0.80
current_artifact_stemMethod · 0.80
assemble_namedMethod · 0.80

Tested by

no test coverage detected