Skip to main content Crate harn_parser Copy item path Source pub use diagnostic_codes::Category as DiagnosticCodeCategory;pub use diagnostic_codes::Code as DiagnosticCode;pub use diagnostic_codes::ParseRepairSafetyError ;pub use diagnostic_codes::Repair ;pub use diagnostic_codes::RepairId ;pub use diagnostic_codes::RepairSafety ;pub use diagnostic_codes::RepairTemplate ;pub use diagnostic_codes::REPAIR_REGISTRY ;pub use namespace_signatures::NamespaceMemberSignature ;pub use runtime_stack::PARSE_STACK_SIZE ;pub use runtime_stack::RUNTIME_STACK_SIZE ;pub use stdlib_metadata::parse_for_span as parse_stdlib_metadata;pub use stdlib_metadata::synthesize_example ;pub use stdlib_metadata::StdlibMetadata ;pub use typechecker::block_definitely_exits ;pub use typechecker::canonical_predicate_type ;pub use typechecker::format_type ;pub use typechecker::stmt_definitely_exits ;pub use typechecker::substitute_type_expr ;pub use typechecker::BindingTypeInfo ;pub use typechecker::DiagnosticDetails ;pub use typechecker::DiagnosticSeverity ;pub use typechecker::InlayHintInfo ;pub use typechecker::NamespaceImportBinding ;pub use typechecker::PredicateModelRoute ;pub use typechecker::PredicateQuestionKind ;pub use typechecker::PredicateQuestionSpec ;pub use typechecker::PredicateSite ;pub use typechecker::PredicateSiteKind ;pub use typechecker::TypeCheckFacts ;pub use typechecker::TypeChecker ;pub use typechecker::TypeDiagnostic ;pub use crate::operators::BinaryOperator ;pub use crate::operators::UnaryOperator ;acp_ambient_globals Canonical registry of the ambient globals the ACP session executor binds
into every session/prompt VM before running a pipeline (see harn-serve’s
adapters/acp/execute.rs). analysis ast_json Stable JSON projections for parser-facing tooling. builtin_methods The single owner of builtin value methods. builtin_signatures Single source of truth for builtin function signatures used by the parser
and runtime VM: identifier resolution, typo suggestions, return-type
inference, static arity & per-arg type checks, runtime arity & type
enforcement, and lint awareness all consult the registry through the
lookup / is_builtin helpers. const_eval Bounded, sandboxed compile-time evaluator for const initializers. diagnostic diagnostic_codes Stable diagnostic code registry. interpolation Shared parsing for ${...} expression holes. lexical Lexical binding and capture analysis shared by compiler and typechecker. namespace_signatures Self-contained namespace call contracts shared by graph and package compilation. operator_migration Rewrite source written for the pre-0.11 operator grammar. operators Operator vocabulary: spelling, precedence, and associativity. param_annotations The one place that decides whether a parameter must carry a type. runtime_stack The native stack contract for every thread that can run Harn code. stdlib_metadata Structured metadata declared in stdlib HarnDoc blocks. typechecker visit Generic AST visitor used by the linter, formatter, and any other
crate that needs to walk every SNode in a parsed program. AssociatedType An associated-type entry in an interface body: type Item or
type Item = string. Attribute An attribute attached to a declaration: @deprecated(since: "0.8"). AttributeArg A single argument to an attribute. Positional args have name = None;
named args use name: Some("key"). Values are restricted to
compile-time metadata expressions by the parser (literal scalars,
identifiers, lists, dicts, and call-shaped sentinels). DictEntry DictPatternField A field in a dict destructuring pattern. EnumVariant An enum variant declaration. InterfaceMethod An interface method signature. ListPatternElement An element in a list destructuring pattern. MatchArm Parser Recursive descent parser for Harn. SelectCase ShapeField A field in a dict shape type. Spanned A node wrapped with source location information. StructField A struct field declaration. TypeParam A generic type parameter on a function or pipeline declaration. TypePredicate A function return contract that narrows one parameter at call sites. TypedParam A parameter with an optional type annotation and optional default value. WhereClause A where-clause constraint on a generic type parameter. BindingPattern A binding pattern for destructuring in let/var/for-in. NamespaceDemand The public exports an importer can observe through a namespace binding. Node AST nodes for the Harn language. ParallelMode Parallel execution mode. ParserError Parser errors. PipelineError Error from a source processing pipeline stage. Wraps the inner error
types so callers can dispatch on the failing stage. TypeExpr A type annotation (optional, for runtime checking). Variance Declared variance of a generic type parameter. HARN_LEGACY_AMBIENT_CAPABILITIES_ENV Explicit process-level bridge for downstream packages that have not yet
completed the typed Harness capability migration. MAX_NESTING_DEPTH Deepest syntax nesting the parser descends into before refusing the source
with a “nesting depth exceeded” error. REMOVED_RANGE_KEYWORD The retired range keyword, kept for diagnostics and the migration. check_source Lex, parse, and type-check source. Returns the AST and any type
diagnostics (which may include warnings even on success). check_source_strict Lex, parse, and type-check, bailing on the first type error. contextual_statement_at The contextual statement keyword introduced by the identifier at pos,
if any. flow_predicate_attribute Return the bare @invariant marker that opts a function into Flow
predicate discovery. Parameterized @invariant(...) attributes belong to
handler IR instead. install_builtin_manifest Install the process-global builtin manifest. install_declared_host_operations Install the resolved host-capability declaration for this process. is_declared_host_operation Did the embedding project declare capability.method as a host operation? is_discard_name _ is the discard binding name in let/const/destructuring positions.is_flow_ast_injection_request Whether a Flow predicate’s raw leading type opts into the AST capability
injected by the evaluator. is_flow_predicate_declaration Whether an attributed declaration is executable by the Flow evaluator.
Flow discovery currently compiles functions only, so tools and pipelines
must not inherit its injection or authority rules. is_known_builtin Returns true if name is a builtin recognized by the parser’s static analyzer. is_legacy_ambient_builtin Opt-in ambient bridge: treat a registered builtin as known without a typed
Harness capability import. is_registered_legacy_hostlib_name Whether an old hostlib wire name projects a method from the authoritative
typed host-capability registry. This keeps compatibility recognition exact:
arbitrary hostlib_* spellings remain undefined. known_builtin_metadata known_builtin_names Every builtin name known to the parser, alphabetically. Enables bidirectional
drift checks against the VM’s runtime registry. legacy_ambient_capabilities_enabled legacy_builtin_alias_target Exact behavior-preserving spellings removed during the typed-Harness
cutover. The compiler lowers these to the canonical manifest name only in
compatibility mode; strict source continues to reject them. namespace_import_demands Compute conservative member demand for every namespace import in program. node_produces_value Whether evaluating a node leaves a value for its surrounding block. parse_source Lex and parse source into an AST. peel_attributes If node is an AttributedDecl, returns (attrs, inner); otherwise
returns an empty attribute slice and the node itself. Use at the top
of any consumer that processes top-level statements so attributes
flow through transparently. refresh_legacy_ambient_capabilities Re-read the legacy-bridge flag from the process environment and update the
cached value, returning the fresh result. spanned Helper to wrap a node with a span. static_signature_names Names sourced only from the parser’s hand-written static fallback tables
(not the driver-installed #[harn_builtin] registry). Lets cross-crate
drift guards assert the static tables don’t overlap with macro-published
or runtime_only builtins. SNode A spanned AST node — the primary unit throughout the compiler.