build: separate bin/lib targets
This commit is contained in:
parent
e79e44c0df
commit
5275bc33a8
@ -6,13 +6,17 @@ version = "0.1.0"
|
||||
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
name = "lispers"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "demo"
|
||||
path = "src/demo.rs"
|
||||
path = "src/bin/demo.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "repl"
|
||||
path = "src/repl.rs"
|
||||
path = "src/bin/repl.rs"
|
||||
|
||||
[dependencies]
|
||||
as-any = "0.3.1"
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
mod lisp;
|
||||
mod parser;
|
||||
use parser::ExpressionStream;
|
||||
|
||||
use crate::lisp::{eval, Environment};
|
||||
use lispers::lisp::{eval, Environment};
|
||||
use lispers::parser::ExpressionStream;
|
||||
|
||||
fn main() {
|
||||
let programs = [
|
||||
@ -1,9 +1,8 @@
|
||||
use lisp::Expression;
|
||||
use parser::ParserError;
|
||||
use lispers::lisp::Expression;
|
||||
use lispers::parser::ParserError;
|
||||
|
||||
use lispers::{lisp, parser};
|
||||
use std::io::Write;
|
||||
mod parser;
|
||||
mod lisp;
|
||||
|
||||
fn main() {
|
||||
let env = lisp::Environment::default();
|
||||
@ -18,7 +17,9 @@ fn main() {
|
||||
break;
|
||||
}
|
||||
|
||||
match parser::ExpressionStream::from_char_stream(input.chars()).collect::<Result<Vec<Expression>, ParserError>>() {
|
||||
match parser::ExpressionStream::from_char_stream(input.chars())
|
||||
.collect::<Result<Vec<Expression>, ParserError>>()
|
||||
{
|
||||
Err(e) => println!("Parser Error: {:?}", e),
|
||||
Ok(exprs) => {
|
||||
for expr in exprs {
|
||||
2
src/lib.rs
Normal file
2
src/lib.rs
Normal file
@ -0,0 +1,2 @@
|
||||
pub mod lisp;
|
||||
pub mod parser;
|
||||
Loading…
x
Reference in New Issue
Block a user