rust: split stuff into more crates

This commit is contained in:
Alain Zscheile 2023-11-03 15:37:04 +01:00
parent ab931de08f
commit 1f2329ab5f
13 changed files with 29 additions and 33 deletions

22
rust/Cargo.lock generated
View file

@ -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",

View file

@ -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,
}
};
}

View file

@ -0,0 +1,7 @@
[package]
name = "yanais-literal"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
[dependencies]

View file

@ -26,7 +26,6 @@ pub enum Literal {
Ty(TyLit),
IntSize(IntSize),
Natural(usize),
Layout(Layout),
}
impl Layout {

View file

@ -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"

View file

@ -9,6 +9,7 @@ use miette::{Diagnostic, SourceSpan};
use std::sync::Arc;
pub mod lex;
pub mod literal;
pub mod pat;
pub mod record;

View file

@ -0,0 +1,2 @@
pub use yanais_literal::{IntSize, TyLit, Literal};

View file

@ -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"

View file

@ -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 {}

View file

@ -0,0 +1 @@
pub mod egraph;

View file

@ -6,5 +6,4 @@ edition = "2021"
[dependencies]
miette = "5.10"
thiserror = "1.0"
yanais-core.path = "../yanais-core"
yanais-syntax.path = "../yanais-syntax"

View file

@ -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;

View file

@ -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"