1mod extractors;
4mod manifest;
5test_support_visibility! {
6mod state;
7}
8
9pub use extractors::{extractor_language, extractor_name, extractor_version, parse_deadline};
10#[cfg(feature = "test-hooks")]
11pub use manifest::initialize_test_identity;
12#[cfg(feature = "test-support")]
13pub use manifest::production_manifest;
14pub use manifest::{manifest, manifest_for_path, manifests, GrammarManifest};
15pub use state::{FailureCause, GrammarState, GrammarUnavailable};
16
17use std::{collections::BTreeMap, sync::Arc};
18
19type RegistryMap<T> = BTreeMap<&'static str, Arc<T>>;
20
21fn registry_map<T>(
22 entries: &'static [GrammarManifest],
23 build: impl Fn(&'static GrammarManifest) -> Arc<T>,
24) -> RegistryMap<T> {
25 entries
26 .iter()
27 .map(|entry| (entry.language.as_str(), build(entry)))
28 .collect()
29}
30
31test_support_visibility! {
32#[cfg(feature = "wasm-grammars")]
33mod download;
34}
35test_support_visibility! {
36 #[cfg(feature = "wasm-grammars")]
37 mod runtime;
38}
39test_support_visibility! {
40#[cfg(feature = "wasm-grammars")]
41mod storage;
42}
43#[cfg(feature = "wasm-grammars")]
44pub use runtime::*;
45
46test_support_visibility! {
47 #[cfg(not(feature = "wasm-grammars"))]
48 mod disabled;
49}
50#[cfg(not(feature = "wasm-grammars"))]
51pub use disabled::*;