Cleared out all remaining linter warnings
This commit is contained in:
parent
cb9b56f000
commit
c97e58c2aa
@ -1,5 +1,3 @@
|
|||||||
use std::fmt::Debug;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TokenError {
|
pub struct TokenError {
|
||||||
pub msg: String,
|
pub msg: String,
|
||||||
|
@ -3,7 +3,7 @@ extern crate llvm_sys;
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use self::llvm_sys::prelude::*;
|
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 maaru_lang::parser::{AST, Statement, Function, Prototype, Expression, BinOp};
|
||||||
use language::LLVMCodeString;
|
use language::LLVMCodeString;
|
||||||
|
@ -136,7 +136,7 @@ impl Expression {
|
|||||||
match *self {
|
match *self {
|
||||||
Null => false,
|
Null => false,
|
||||||
StringLiteral(ref s) if **s == "" => false,
|
StringLiteral(ref s) if **s == "" => false,
|
||||||
Number(0.0) => false,
|
Number(n) if n == 0.0 => false,
|
||||||
_ => true,
|
_ => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
31
src/main.rs
31
src/main.rs
@ -136,37 +136,6 @@ fn run_noninteractive<T: ProgrammingLanguageInterface>(filename: &str, language:
|
|||||||
println!("{}", line);
|
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 = <T as ProgrammingLanguage>::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<linefeed::terminal::DefaultTerminal>;
|
type LineReader = linefeed::Reader<linefeed::terminal::DefaultTerminal>;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
extern crate itertools;
|
extern crate itertools;
|
||||||
use self::itertools::Itertools;
|
use self::itertools::Itertools;
|
||||||
|
|
||||||
use language::{ProgrammingLanguageInterface, EvalOptions, ParseError, TokenError, LLVMCodeString};
|
use language::{ProgrammingLanguageInterface, EvalOptions, TokenError};
|
||||||
|
|
||||||
pub struct Robo {
|
pub struct Robo {
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use language::{ProgrammingLanguageInterface, EvalOptions, ParseError, TokenError, LLVMCodeString};
|
use language::{ProgrammingLanguageInterface, EvalOptions};
|
||||||
|
|
||||||
mod parsing;
|
mod parsing;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ pub enum Token {
|
|||||||
Operator(Rc<String>),
|
Operator(Rc<String>),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn tokenize(input: &str) -> Result<Vec<Token>, TokenError> {
|
pub fn tokenize(_input: &str) -> Result<Vec<Token>, TokenError> {
|
||||||
Ok(vec!())
|
Ok(vec!())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,6 +88,6 @@ op := '+', '-', etc.
|
|||||||
pub struct AST { }
|
pub struct AST { }
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn parse(input: Vec<Token>) -> Result<AST, ParseError> {
|
pub fn parse(_input: Vec<Token>) -> Result<AST, ParseError> {
|
||||||
Ok(AST { })
|
Ok(AST { })
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user