1#![no_std]
2
3extern crate alloc;
4
5#[cfg(any(test, feature = "std"))]
6extern crate std;
7
8#[cfg(feature = "serde")]
9pub mod ast;
10mod dependencies;
11mod linkage;
12mod package;
13mod profile;
14mod target;
15mod target_type;
16#[cfg(all(test, feature = "std", feature = "serde"))]
17mod tests;
18mod workspace;
19
20use alloc::{sync::Arc, vec::Vec};
21
22#[cfg(feature = "serde")]
23use miden_assembly_syntax::{
24 Report,
25 debuginfo::{SourceFile, SourceId},
26 diagnostics::{Label, RelatedError, RelatedLabel},
27};
28pub use miden_assembly_syntax::{Word, debuginfo::Uri, semver};
30use miden_assembly_syntax::{
31 debuginfo::{SourceSpan, Span},
32 diagnostics::{Diagnostic, miette},
33};
34pub use miden_core::LexicographicWord;
35#[cfg(feature = "serde")]
36use serde::{Deserialize, Serialize};
37pub use toml::Value;
38
39pub use self::{
40 dependencies::*, linkage::Linkage, package::Package, profile::Profile, target::Target,
41 target_type::TargetType, workspace::Workspace,
42};
43
44pub type Map<K, V> = alloc::collections::BTreeMap<K, V>;
46
47pub type Metadata = Map<Span<Arc<str>>, Span<Value>>;
51
52pub type MetadataSet = Map<Span<Arc<str>>, Metadata>;
56
57#[cfg(all(feature = "std", feature = "serde"))]
61pub(crate) fn absolutize_path(
62 path: &std::path::Path,
63 workspace_root: &std::path::Path,
64) -> Result<std::path::PathBuf, std::io::Error> {
65 if path.is_absolute() {
66 path.canonicalize()
67 } else {
68 workspace_root.join(path).canonicalize()
69 }
70}