harn_parser/lib.rs
1mod ast;
2pub(crate) mod builtin_signatures;
3pub mod diagnostic;
4mod parser;
5pub mod typechecker;
6
7pub use ast::*;
8pub use parser::*;
9pub use typechecker::{format_type, DiagnosticSeverity, TypeChecker, TypeDiagnostic};
10
11/// Returns `true` if `name` is a builtin recognized by the parser's static
12/// analyzer. Exposed for cross-crate drift tests (see
13/// `crates/harn-vm/tests/builtin_registry_alignment.rs`) and any future
14/// tooling that needs to validate builtin references without running the
15/// VM.
16pub fn is_known_builtin(name: &str) -> bool {
17 builtin_signatures::is_builtin(name)
18}
19
20/// Iterator over every builtin name known to the parser, in alphabetical
21/// order. Enables bidirectional drift checks against the VM's runtime
22/// registry — a parser entry with no runtime counterpart means a stale
23/// signature that should be removed.
24pub fn known_builtin_names() -> impl Iterator<Item = &'static str> {
25 builtin_signatures::iter_builtin_names()
26}