Framework for compilation
This commit is contained in:
parent
cd69ebaa9d
commit
6c44d295db
@ -10,6 +10,12 @@ use self::iron_llvm::{LLVMRef, LLVMRefCtor};
|
||||
|
||||
use parser::{ParseResult, AST, ASTNode, Prototype, Function, Expression};
|
||||
|
||||
pub fn compile_ast(ast: AST) {
|
||||
println!("Compiling!");
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
pub struct Context {
|
||||
context: core::Context,
|
||||
builder: core::Builder,
|
||||
@ -117,5 +123,4 @@ impl IRBuilder for Expression {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
@ -17,6 +17,8 @@ mod parser;
|
||||
use eval::{Evaluator};
|
||||
mod eval;
|
||||
|
||||
use compilation::{compile_ast};
|
||||
mod compilation;
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
@ -42,11 +44,17 @@ fn run_noninteractive(filename: &String) {
|
||||
Err(err) => { println!("Parse error: {:?}", err); return; }
|
||||
};
|
||||
|
||||
let compile = true;
|
||||
|
||||
if compile {
|
||||
compile_ast(ast);
|
||||
} else {
|
||||
let mut evaluator = Evaluator::new();
|
||||
let results = evaluator.run(ast);
|
||||
for result in results.iter() {
|
||||
println!("{}", result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn run_repl() {
|
||||
|
Loading…
Reference in New Issue
Block a user