From c97e58c2aa307c2b9745caf13d101bc77d8275f7 Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 31 Aug 2017 19:18:56 -0700 Subject: [PATCH] Cleared out all remaining linter warnings --- src/language.rs | 2 -- src/maaru_lang/compilation.rs | 2 +- src/maaru_lang/eval.rs | 2 +- src/main.rs | 31 ------------------------------- src/robo_lang/mod.rs | 2 +- src/schala_lang/mod.rs | 2 +- src/schala_lang/parsing.rs | 4 ++-- 7 files changed, 6 insertions(+), 39 deletions(-) diff --git a/src/language.rs b/src/language.rs index a8249b0..37494bc 100644 --- a/src/language.rs +++ b/src/language.rs @@ -1,5 +1,3 @@ -use std::fmt::Debug; - #[derive(Debug)] pub struct TokenError { pub msg: String, diff --git a/src/maaru_lang/compilation.rs b/src/maaru_lang/compilation.rs index 20ddd9f..b28fe5c 100644 --- a/src/maaru_lang/compilation.rs +++ b/src/maaru_lang/compilation.rs @@ -3,7 +3,7 @@ extern crate llvm_sys; use std::collections::HashMap; use self::llvm_sys::prelude::*; -use self::llvm_sys::{LLVMIntPredicate, LLVMRealPredicate}; +use self::llvm_sys::{LLVMIntPredicate}; use maaru_lang::parser::{AST, Statement, Function, Prototype, Expression, BinOp}; use language::LLVMCodeString; diff --git a/src/maaru_lang/eval.rs b/src/maaru_lang/eval.rs index 9da3836..db17e98 100644 --- a/src/maaru_lang/eval.rs +++ b/src/maaru_lang/eval.rs @@ -136,7 +136,7 @@ impl Expression { match *self { Null => false, StringLiteral(ref s) if **s == "" => false, - Number(0.0) => false, + Number(n) if n == 0.0 => false, _ => true, } } diff --git a/src/main.rs b/src/main.rs index ce4cf05..6f77541 100644 --- a/src/main.rs +++ b/src/main.rs @@ -136,37 +136,6 @@ fn run_noninteractive(filename: &str, language: println!("{}", line); } } - /* - let tokens = match T::tokenize(&buffer) { - Ok(t) => t, - Err(e) => { - println!("Tokenization error: {}", e.msg); - std::process::exit(1) - } - }; - - let ast = match T::parse(tokens) { - Ok(ast) => ast, - Err(err) => { - println!("Parse error: {:?}", err.msg); - /*println!("Remaining tokens: {:?}", err.remaining_tokens);*/ - std::process::exit(1) - } - }; - - if compile { - compilation_sequence(T::compile(ast), filename); - } else { - let mut evaluator = ::Evaluator::new(); - if trace_evaluation { - evaluator.set_option("trace_evaluation", true); - } - let results = T::evaluate(ast, &mut evaluator); - if let Some(r) = results.iter().last() { - println!("{}", r); - } - } - */ } type LineReader = linefeed::Reader; diff --git a/src/robo_lang/mod.rs b/src/robo_lang/mod.rs index 14a9c7a..70952cb 100644 --- a/src/robo_lang/mod.rs +++ b/src/robo_lang/mod.rs @@ -1,7 +1,7 @@ extern crate itertools; use self::itertools::Itertools; -use language::{ProgrammingLanguageInterface, EvalOptions, ParseError, TokenError, LLVMCodeString}; +use language::{ProgrammingLanguageInterface, EvalOptions, TokenError}; pub struct Robo { } diff --git a/src/schala_lang/mod.rs b/src/schala_lang/mod.rs index 4284bad..d8b3eb1 100644 --- a/src/schala_lang/mod.rs +++ b/src/schala_lang/mod.rs @@ -1,4 +1,4 @@ -use language::{ProgrammingLanguageInterface, EvalOptions, ParseError, TokenError, LLVMCodeString}; +use language::{ProgrammingLanguageInterface, EvalOptions}; mod parsing; diff --git a/src/schala_lang/parsing.rs b/src/schala_lang/parsing.rs index f89b4db..173bd9e 100644 --- a/src/schala_lang/parsing.rs +++ b/src/schala_lang/parsing.rs @@ -21,7 +21,7 @@ pub enum Token { Operator(Rc), } -pub fn tokenize(input: &str) -> Result, TokenError> { +pub fn tokenize(_input: &str) -> Result, TokenError> { Ok(vec!()) } @@ -88,6 +88,6 @@ op := '+', '-', etc. pub struct AST { } #[allow(dead_code)] -pub fn parse(input: Vec) -> Result { +pub fn parse(_input: Vec) -> Result { Ok(AST { }) }