Adjust module organization to facilitate resurrection of the playground.
The playground doesn't / cannot depend on aiken-project because that becomes a gigantic pain. So instead, we try to keep essential stuff inside aiken-lang when possible.
This commit is contained in:
@@ -15,6 +15,7 @@ rust-version = "1.66.1"
|
||||
|
||||
[dependencies]
|
||||
blst = "0.3.11"
|
||||
cryptoxide = "0.4.4"
|
||||
hex = "0.4.3"
|
||||
indexmap = "1.9.2"
|
||||
indoc = "2.0.1"
|
||||
@@ -24,6 +25,7 @@ num-bigint = "0.4.3"
|
||||
ordinal = "0.3.2"
|
||||
owo-colors = { version = "3.5.0", features = ["supports-colors"] }
|
||||
pallas-primitives.workspace = true
|
||||
patricia_tree = "0.8.0"
|
||||
petgraph = "0.6.3"
|
||||
serde = { version = "1.0.197", features = ["derive", "rc"] }
|
||||
strum = "0.24.1"
|
||||
@@ -43,3 +45,6 @@ chumsky = { version = "0.9.2", features = [
|
||||
indoc = "2.0.1"
|
||||
insta.workspace = true
|
||||
pretty_assertions = "1.3.0"
|
||||
|
||||
[build-dependencies]
|
||||
built = { version = "0.7.1", features = ["git2"] }
|
||||
|
||||
3
crates/aiken-lang/build.rs
Normal file
3
crates/aiken-lang/build.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
built::write_built_file().expect("Failed to acquire build-time information");
|
||||
}
|
||||
@@ -14,7 +14,10 @@ pub mod line_numbers;
|
||||
pub mod parser;
|
||||
pub mod plutus_version;
|
||||
pub mod pretty;
|
||||
pub mod test_framework;
|
||||
pub mod tipo;
|
||||
pub mod utils;
|
||||
pub mod version;
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct IdGenerator {
|
||||
|
||||
1289
crates/aiken-lang/src/test_framework.rs
Normal file
1289
crates/aiken-lang/src/test_framework.rs
Normal file
File diff suppressed because it is too large
Load Diff
21
crates/aiken-lang/src/utils/indexmap.rs
Normal file
21
crates/aiken-lang/src/utils/indexmap.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use indexmap::IndexMap;
|
||||
use std::{collections::HashMap, hash::Hash};
|
||||
|
||||
pub fn as_ref_values<'a, K, V>(iter: &'a IndexMap<K, V>) -> IndexMap<&'a K, &'a V>
|
||||
where
|
||||
K: Eq + Hash + Clone + 'a,
|
||||
{
|
||||
let mut refs = IndexMap::new();
|
||||
for (k, v) in iter {
|
||||
refs.insert(k, v);
|
||||
}
|
||||
refs
|
||||
}
|
||||
|
||||
pub fn as_str_ref_values<V>(iter: &'_ HashMap<String, V>) -> IndexMap<&'_ str, &'_ V> {
|
||||
let mut refs = IndexMap::new();
|
||||
for (k, v) in iter {
|
||||
refs.insert(k.as_str(), v);
|
||||
}
|
||||
refs
|
||||
}
|
||||
1
crates/aiken-lang/src/utils/mod.rs
Normal file
1
crates/aiken-lang/src/utils/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod indexmap;
|
||||
0
crates/aiken-lang/src/utils/version.rs
Normal file
0
crates/aiken-lang/src/utils/version.rs
Normal file
15
crates/aiken-lang/src/version.rs
Normal file
15
crates/aiken-lang/src/version.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
pub fn compiler_version(include_commit_hash: bool) -> String {
|
||||
if include_commit_hash {
|
||||
format!(
|
||||
"v{}+{}",
|
||||
built_info::PKG_VERSION,
|
||||
built_info::GIT_COMMIT_HASH_SHORT.unwrap_or("unknown")
|
||||
)
|
||||
} else {
|
||||
format!("v{}", built_info::PKG_VERSION,)
|
||||
}
|
||||
}
|
||||
|
||||
mod built_info {
|
||||
include!(concat!(env!("OUT_DIR"), "/built.rs"));
|
||||
}
|
||||
Reference in New Issue
Block a user