Skip to main content

meta_ast/
lib.rs

1//! Polyglot static analysis: symbol extraction and cross-language dependency
2//! graphs from nine source languages, with optional MetaCall deployment
3//! manifests and dataflow extraction.
4pub mod cache;
5pub mod error;
6pub mod extractor;
7pub mod graph;
8pub mod input;
9pub mod interface;
10pub mod language;
11pub mod model;
12pub mod output;
13pub mod parser;
14pub mod pipeline;
15pub mod reanalyze;
16
17#[cfg(feature = "watch")]
18pub mod watch;
19
20#[cfg(feature = "metacall-deploy")]
21pub mod deploy;
22
23#[cfg(feature = "dataflow")]
24pub mod sink;
25
26pub use cache::{ExtractionCache, Fingerprint, fingerprint};
27pub use error::{Diagnostic, Error, Severity};
28pub use extractor::{
29    ExtractOptions, ExtractionIdGenerators, ExtractionResult, InMemorySource, VersionedExtraction,
30    extract_text_with_id_gen, extract_with_id_gen,
31};
32pub use input::detect_language;
33pub use language::{LangId, LanguageSpec};
34pub use model::{
35    DataNode, DataNodeId, DataScope, FileExtraction, FlowEdge, FlowKind, Symbol, SymbolId,
36    SymbolKind, UnresolvedImport, UnresolvedReference, Visibility,
37};
38pub use reanalyze::{ChangeSet, Overlay, WatchState, incremental_reanalyze, reanalyze_extractions};
39
40// Graph module re-exports
41pub use graph::{
42    CodeGraph,
43    builder::{AnalysisParts, GraphBuilder},
44    edge::{ConfidenceTier, EdgeData, EdgeKind, confidence_tier},
45    node::{ExternalNode, FileNode, NodeData, SymbolNode},
46    resolver::{
47        FlattenedScopeCache, ResolvedReference, ScopeMap, reference_edges,
48        resolve_references_detailed,
49    },
50    scc::{DeployabilityHint, Scc, SccAnalysis},
51};
52
53// Shard and index re-exports
54pub use output::shard::{
55    INDEX_DIR_NAME, IndexLoadOptions, IndexLoadStats, LoadedIndex, LoadedShard,
56    SHARD_SCHEMA_VERSION, ShardEdge, ShardEdgeKind, ShardError, ShardFile, ShardFlowKind,
57    ShardHeader, ShardManifestRecord, ShardNamePlan, ShardSymbol, collision_key,
58    is_safe_shard_name, is_writable_name, load_index, plan_shard_file_names, read_header,
59    read_manifest, read_shard, restore_shard_edges, write_header, write_manifest, write_shard,
60};
61pub use pipeline::{GraphAnalysis, SnapshotMeta, snapshot_meta};
62
63// Watch-mode re-exports
64#[cfg(feature = "watch")]
65pub use watch::{WatchConfig, run_watch};