Skip to content

Commit 47578d7

Browse files
committed
separate library for sanguinello
1 parent 89ff5cb commit 47578d7

File tree

9 files changed

+13
-10
lines changed

9 files changed

+13
-10
lines changed

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ authors = ["aaron weiss <aweiss@hey.com>"]
55
license = "BSD-2-Clause"
66
edition = "2021"
77

8+
[lib]
9+
name = "sanguinello"
10+
path = "lib/sanguinello.rs"
11+
812
[dependencies]
913
nom = "7.1.3"
1014
thiserror = "1.0.40"

lib/sanguinello.rs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod sgir;
2+
pub mod syntax;

src/sgir/mod.rs lib/sgir/mod.rs

File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/syntax/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod lexer;
2+
pub mod tokens;
File renamed without changes.

src/main.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
use crate::sgir::{Binding, TypeBinding};
2-
3-
mod sgir;
4-
mod syntax;
1+
use sanguinello::sgir::{Binding, TypeBinding};
52

63
fn main() {
7-
use sgir::Expression::*;
8-
use sgir::{Kind, Type};
4+
use sanguinello::sgir::Expression::*;
5+
use sanguinello::sgir::{Kind, Type};
96

107
let identity = Quantify {
118
parameters: vec![TypeBinding { id: "X".to_owned(), kind: Kind::Star }],
@@ -49,7 +46,7 @@ fn main() {
4946
]
5047
};
5148

52-
let typ = match sgir::check(prog.clone()) {
49+
let typ = match sanguinello::sgir::check(prog.clone()) {
5350
Ok(typ) => typ,
5451
Err(type_error) => {
5552
eprintln!("[ERROR] {:?}", type_error);
@@ -58,6 +55,6 @@ fn main() {
5855
};
5956
println!("TYPE: {:?}", typ);
6057

61-
let result = sgir::run(prog);
58+
let result = sanguinello::sgir::run(prog);
6259
println!("{:?}", result);
6360
}

src/syntax/mod.rs

-2
This file was deleted.

0 commit comments

Comments
 (0)