1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (c) 2026 Kirky.X. All rights reserved.
// SPDX-License-Identifier: MIT
//! Parse capability traits (T6/unified-architecture Phase 2, Task 2.3).
//!
//! Defines [`ParserRegistry`] and [`ExtractorRegistry`], the capability trait
//! objects stored in [`Kit`](crate::kit::Kit) under [`ParserKey`] and
//! [`ExtractorKey`] respectively.
//!
//! # Design note
//!
//! [`ParserPool`](super::ParserPool) is `!Sync` (it uses `RefCell` for
//! thread-local caching, ADR-010), so it cannot itself be the capability.
//! Instead, [`ParserRegistry`] exposes the stateless factory interface
//! ([`ParserFactory::create_parser`](super::ParserFactory::create_parser));
//! the thread-local pool stays as a per-thread cache layered on top.
//!
//! [`ParserKey`]: crate::kit::ParserKey
//! [`ExtractorKey`]: crate::kit::ExtractorKey
use Parser;
use crateLanguage;
use ParseError;
use Extractor;
/// Capability trait for the Parser subsystem (tree-sitter parser factory).
///
/// Stored in [`Kit`](crate::kit::Kit) as `Arc<dyn ParserRegistry>` under
/// [`ParserKey`](crate::kit::ParserKey). The concrete impl (Task 2.5) wraps
/// [`ParserFactory`](super::ParserFactory); the thread-local
/// [`ParserPool`](super::ParserPool) remains a per-thread cache on top.
/// Capability trait for the Extractor registry (per-language dispatch).
///
/// Stored in [`Kit`](crate::kit::Kit) as `Arc<dyn ExtractorRegistry>` under
/// [`ExtractorKey`](crate::kit::ExtractorKey). The concrete impl (Task 2.6)
/// wraps [`get_extractor`](super::get_extractor). Requires `ParserKey`.
/// Compile-time assertions: both traits are object-safe and `Send + Sync`.
const _: = ;