From 3d2ce9a7ed0da648708ca6c479a5f328e8522c62 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Tue, 27 Jun 2023 00:25:59 -0700 Subject: [PATCH] Fix lints --- src/analyzer.rs | 4 +++- src/compiler.rs | 16 ++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/analyzer.rs b/src/analyzer.rs index efe1141d70..7e6c59fc1b 100644 --- a/src/analyzer.rs +++ b/src/analyzer.rs @@ -10,7 +10,9 @@ pub(crate) struct Import { // Canonicalized version of the above path canonical_path: Option, - /// The line on which the `!include` directive appears in the original file + //line on which this import occurs in the importing file. Not currently being used, but could + //allow for better error messages + #[allow(dead_code)] line: usize, } diff --git a/src/compiler.rs b/src/compiler.rs index 9c78e1fb6c..9bdd66acfd 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -3,18 +3,6 @@ use super::*; pub(crate) struct Compiler; impl Compiler { - pub(crate) fn compile(src: &str) -> CompileResult { - let root_ast = Self::parse(src)?; - let root_justfile = Analyzer::analyze(&root_ast, &[])?; - - Ok(Compilation { - root_ast, - root_justfile, - root_source: src, - imported_asts: vec![], - }) - } - pub(crate) fn parse(src: &str) -> CompileResult { let tokens = Lexer::lex(src)?; Parser::parse(&tokens) @@ -25,6 +13,8 @@ impl Compiler { #[derive(Debug)] pub(crate) struct AstImport<'src> { pub(crate) ast: Ast<'src>, + //Not currently being used, but could allow for better error messages later + #[allow(dead_code)] import: Import, } @@ -40,6 +30,8 @@ impl<'src> AstImport<'src> { pub(crate) struct Compilation<'src> { root_ast: Ast<'src>, root_source: &'src str, + //Not currently being used, but could allow for better error messages later + #[allow(dead_code)] pub(crate) imported_asts: Vec>, root_justfile: Justfile<'src>, }