Refactor to allow use as library, in order to allow build.rs usage.

This commit is contained in:
Chris Fallin
2021-09-14 22:55:08 -07:00
parent 83672a88cc
commit e751f12ac5
3 changed files with 2 additions and 20 deletions

View File

@@ -1,15 +1,6 @@
#![allow(dead_code)]
use clap::{App, Arg}; use clap::{App, Arg};
mod ast; use isle::{error, lexer, parser, compile};
mod codegen;
mod compile;
mod error;
mod ir;
mod lexer;
mod parser;
mod sema;
fn main() -> Result<(), error::Error> { fn main() -> Result<(), error::Error> {
let _ = env_logger::try_init(); let _ = env_logger::try_init();
@@ -73,3 +64,4 @@ fn main() -> Result<(), error::Error> {
Ok(()) Ok(())
} }

View File

@@ -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 /// Creates a sequence of ExprInsts to generate the given
/// expression value. Returns the value ID as well as the root /// expression value. Returns the value ID as well as the root
/// term ID, if any. /// term ID, if any.

View File

@@ -12,12 +12,6 @@ pub struct Lexer<'a> {
lookahead: Option<(Pos, Token)>, 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)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Default, Hash, PartialOrd, Ord)]
pub struct Pos { pub struct Pos {
pub file: usize, pub file: usize,