first commit

This commit is contained in:
2026-03-24 13:42:13 +00:00
commit ce951d2e10
101 changed files with 3146 additions and 0 deletions
@@ -0,0 +1,11 @@
[package]
name = "prometeu-languages-registry"
version = "0.1.0"
edition = "2021"
license = "MIT"
description = ""
[dependencies]
prometeu-language-api = { path = "../../prometeu-language-api" }
prometeu-language-pbs = { path = "../prometeu-language-pbs" }
@@ -0,0 +1,20 @@
use prometeu_language_api::LanguageSpec;
use std::collections::HashMap;
use std::sync::OnceLock;
use prometeu_language_pbs::LANGUAGE_SPEC as PBS_LANGUAGE_SPEC;
static REGISTRY: OnceLock<HashMap<&'static str, LanguageSpec>> = OnceLock::new();
fn registry() -> &'static HashMap<&'static str, LanguageSpec> {
let pbs = PBS_LANGUAGE_SPEC.get().unwrap();
REGISTRY.get_or_init(|| {
HashMap::from([
(pbs.id, pbs.clone()),
])
})
}
pub fn get_language_spec(id: &str) -> Option<&LanguageSpec> {
registry().get(id)
}
@@ -0,0 +1,3 @@
mod language_spec_registry;
pub use language_spec_registry::get_language_spec;