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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// SPDX-FileCopyrightText: 2025 Knitli Inc. <knitli@knit.li>
// SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
//! # Pattern Matching Module Organization
//!
//! Conditional module imports for pattern matching functionality with feature flag support.
//!
//! ## Module Structure
//!
//! This module organizes pattern matching components with conditional compilation:
//! - **Core types** (always available) - Pattern definitions and interfaces
//! - **Implementations** (feature-gated) - Actual matching logic and algorithms
//!
//! ## Feature Flag Design
//!
//! The `matching` feature flag controls access to pattern matching implementations:
//! - **With `matching`** - Full pattern matching capabilities available
//! - **Without `matching`** - Only type definitions for API compatibility
//!
//! ## Available Components
//!
//! ### Always Available
//! - [`types`] - Core pattern matching types and traits
//! - exported here if `matching` feature is not enabled
//! - exported in `matcher.rs` if `matching` feature is enabled
//! - Types **always** available from lib.rs:
//! ```rust,ignore
//! use thread_ast_engine::{
//! Matcher, MatcherExt, Pattern, MatchStrictness,
//! NodeMatch, PatternNode, PatternBuilder, PatternError,
//! };
//! ```
//! - [`Matcher`] trait - Interface for all pattern matchers
//!
//! ### Feature-Gated (`matching` feature)
//! - [`pattern`] - Structural pattern matching from source code strings
//! - [`kind`] - AST node type matching
//! - [`text`] - Regex-based text content matching
//!
//! ## Architecture Benefits
//!
//! - **Reduced compilation** - Skip complex matching logic when not needed
//! - **API stability** - Type definitions remain available for library interfaces
//! - **Modular usage** - Enable only required pattern matching features
//!
//! ## Usage
//!
//! ```toml
//! # In Cargo.toml - enable full pattern matching
//! thread-ast-engine = { version = "...", features = ["matching"] }
//! ```
//!
//! ```rust,ignore
//! // Types always available
//! use thread_ast_engine::matchers::types::{Matcher, Pattern};
//!
//! // Implementations require 'matching' feature
//! #[cfg(feature = "matching")]
//! use thread_ast_engine::matchers::pattern::Pattern;
//! ```
pub
pub
pub
pub
pub use ;
pub