rust: split stuff into more crates
This commit is contained in:
parent
ab931de08f
commit
1f2329ab5f
22
rust/Cargo.lock
generated
22
rust/Cargo.lock
generated
|
@ -493,15 +493,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||
|
||||
[[package]]
|
||||
name = "yanais-core"
|
||||
name = "yanais-literal"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"miette",
|
||||
"nohash-hasher",
|
||||
"thiserror",
|
||||
"yn-functor",
|
||||
"yz-string-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "yanais-syntax"
|
||||
|
@ -511,10 +504,21 @@ dependencies = [
|
|||
"thiserror",
|
||||
"unicode-ident",
|
||||
"unicode-normalization",
|
||||
"yanais-literal",
|
||||
"yn-functor",
|
||||
"yz-string-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "yanais-typeck"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"nohash-hasher",
|
||||
"thiserror",
|
||||
"yanais-literal",
|
||||
"yanais-syntax",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "yn-functor"
|
||||
version = "0.2.0"
|
||||
|
@ -537,7 +541,6 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"miette",
|
||||
"thiserror",
|
||||
"yanais-core",
|
||||
"yanais-syntax",
|
||||
]
|
||||
|
||||
|
@ -559,7 +562,6 @@ dependencies = [
|
|||
"thiserror",
|
||||
"unicode-ident",
|
||||
"unicode-normalization",
|
||||
"yanais-core",
|
||||
"yanais-syntax",
|
||||
"yn-functor",
|
||||
"yz-string-utils",
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
#![forbid(unsafe_code)]
|
||||
|
||||
pub mod egraph;
|
||||
pub mod literal;
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! none_up {
|
||||
($x:expr) => {
|
||||
match $x {
|
||||
None => return Ok(None),
|
||||
Some(x) => x,
|
||||
}
|
||||
};
|
||||
}
|
7
rust/crates/yanais-literal/Cargo.toml
Normal file
7
rust/crates/yanais-literal/Cargo.toml
Normal file
|
@ -0,0 +1,7 @@
|
|||
[package]
|
||||
name = "yanais-literal"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
|
||||
[dependencies]
|
|
@ -26,7 +26,6 @@ pub enum Literal {
|
|||
Ty(TyLit),
|
||||
IntSize(IntSize),
|
||||
Natural(usize),
|
||||
Layout(Layout),
|
||||
}
|
||||
|
||||
impl Layout {
|
|
@ -9,5 +9,6 @@ miette = "5.10"
|
|||
thiserror = "1.0"
|
||||
unicode-ident = "1.0"
|
||||
unicode-normalization = "0.1"
|
||||
yanais-literal.path = "../yanais-literal"
|
||||
yn-functor.path = "../yn-functor"
|
||||
yz-string-utils = "0.3.1"
|
||||
|
|
|
@ -9,6 +9,7 @@ use miette::{Diagnostic, SourceSpan};
|
|||
use std::sync::Arc;
|
||||
|
||||
pub mod lex;
|
||||
pub mod literal;
|
||||
pub mod pat;
|
||||
pub mod record;
|
||||
|
||||
|
|
2
rust/crates/yanais-syntax/src/literal.rs
Normal file
2
rust/crates/yanais-syntax/src/literal.rs
Normal file
|
@ -0,0 +1,2 @@
|
|||
pub use yanais_literal::{IntSize, TyLit, Literal};
|
||||
|
|
@ -3,14 +3,13 @@
|
|||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
[package]
|
||||
name = "yanais-core"
|
||||
name = "yanais-typeck"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
|
||||
[dependencies]
|
||||
miette = "5.10"
|
||||
nohash-hasher = "0.2"
|
||||
thiserror = "1.0"
|
||||
yn-functor.path = "../yn-functor"
|
||||
yz-string-utils = "0.3.1"
|
||||
yanais-literal.path = "../yanais-literal"
|
||||
yanais-syntax.path = "../yanais-syntax"
|
|
@ -14,7 +14,7 @@ use std::borrow::Cow;
|
|||
use std::collections::{hash_map::Entry, HashSet};
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::literal::Literal;
|
||||
use yanais_literal::Literal;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Var {}
|
1
rust/crates/yanais-typeck/src/lib.rs
Normal file
1
rust/crates/yanais-typeck/src/lib.rs
Normal file
|
@ -0,0 +1 @@
|
|||
pub mod egraph;
|
|
@ -6,5 +6,4 @@ edition = "2021"
|
|||
[dependencies]
|
||||
miette = "5.10"
|
||||
thiserror = "1.0"
|
||||
yanais-core.path = "../yanais-core"
|
||||
yanais-syntax.path = "../yanais-syntax"
|
||||
|
|
|
@ -11,7 +11,7 @@ use parser::{
|
|||
Env as ParseEnv, ErrorCtx as PeCtx, ErrorKind as Pek, MaybeParse, ParseDefaultCtx,
|
||||
Result as Pres,
|
||||
};
|
||||
use yanais_core::none_up;
|
||||
use yanais_syntax::none_up;
|
||||
|
||||
pub mod parser {
|
||||
use yanais_syntax::lex as upslex;
|
||||
|
|
|
@ -14,7 +14,6 @@ thiserror = "1.0"
|
|||
unicode-ident = "1.0"
|
||||
unicode-normalization = "0.1"
|
||||
yn-functor.path = "../yn-functor"
|
||||
yanais-core.path = "../yanais-core"
|
||||
yanais-syntax.path = "../yanais-syntax"
|
||||
yz-string-utils = "0.3.1"
|
||||
|
||||
|
|
Loading…
Reference in a new issue