Refactor to allow use as library, in order to allow build.rs usage.
This commit is contained in:
@@ -1,15 +1,6 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use clap::{App, Arg};
|
||||
|
||||
mod ast;
|
||||
mod codegen;
|
||||
mod compile;
|
||||
mod error;
|
||||
mod ir;
|
||||
mod lexer;
|
||||
mod parser;
|
||||
mod sema;
|
||||
use isle::{error, lexer, parser, compile};
|
||||
|
||||
fn main() -> Result<(), error::Error> {
|
||||
let _ = env_logger::try_init();
|
||||
@@ -73,3 +64,4 @@ fn main() -> Result<(), error::Error> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -477,10 +477,6 @@ impl ExprSequence {
|
||||
});
|
||||
}
|
||||
|
||||
fn add_multi_return(&mut self, index: usize, ty: TypeId, value: Value) {
|
||||
self.add_inst(ExprInst::Return { index, ty, value });
|
||||
}
|
||||
|
||||
/// Creates a sequence of ExprInsts to generate the given
|
||||
/// expression value. Returns the value ID as well as the root
|
||||
/// term ID, if any.
|
||||
|
||||
@@ -12,12 +12,6 @@ pub struct Lexer<'a> {
|
||||
lookahead: Option<(Pos, Token)>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
enum LexerInput<'a> {
|
||||
String { s: &'a str, filename: &'a str },
|
||||
File { content: String, filename: String },
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default, Hash, PartialOrd, Ord)]
|
||||
pub struct Pos {
|
||||
pub file: usize,
|
||||
|
||||
Reference in New Issue
Block a user