Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
neunenak committed Jun 27, 2023
1 parent ae4ede5 commit dc3f1b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
4 changes: 3 additions & 1 deletion src/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ pub(crate) struct Import {
// Canonicalized version of the above path
canonical_path: Option<PathBuf>,

/// 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,
}

Expand Down
16 changes: 4 additions & 12 deletions src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@ use super::*;
pub(crate) struct Compiler;

impl Compiler {
pub(crate) fn compile(src: &str) -> CompileResult<Compilation> {
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<Ast> {
let tokens = Lexer::lex(src)?;
Parser::parse(&tokens)
Expand All @@ -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,
}

Expand All @@ -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<AstImport<'src>>,
root_justfile: Justfile<'src>,
}
Expand Down

0 comments on commit dc3f1b5

Please sign in to comment.