@@ -23,7 +23,7 @@ use super::compiler::CompileCtx;
2323#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord ) ]
2424pub enum SemanticOp {
2525 /// Navigation (non-epsilon only, full detail preserved).
26- Nav ( NavKind ) ,
26+ Nav ( Nav ) ,
2727
2828 /// Named node match with optional type name.
2929 MatchNamed ( Option < String > ) ,
@@ -58,44 +58,6 @@ pub enum SemanticOp {
5858 CycleMarker ( usize ) ,
5959}
6060
61- /// Navigation kind for fingerprinting.
62- ///
63- /// Preserves full detail including Skip/Exact variants since these are semantically
64- /// significant (determined by anchors).
65- #[ derive( Debug , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
66- pub enum NavKind {
67- Stay ,
68- StayExact ,
69- Next ,
70- NextSkip ,
71- NextExact ,
72- Down ,
73- DownSkip ,
74- DownExact ,
75- Up ( u8 ) ,
76- UpSkipTrivia ( u8 ) ,
77- UpExact ( u8 ) ,
78- }
79-
80- impl From < Nav > for NavKind {
81- fn from ( nav : Nav ) -> Self {
82- match nav {
83- Nav :: Epsilon => unreachable ! ( "Epsilon should be filtered" ) ,
84- Nav :: Stay => Self :: Stay ,
85- Nav :: StayExact => Self :: StayExact ,
86- Nav :: Next => Self :: Next ,
87- Nav :: NextSkip => Self :: NextSkip ,
88- Nav :: NextExact => Self :: NextExact ,
89- Nav :: Down => Self :: Down ,
90- Nav :: DownSkip => Self :: DownSkip ,
91- Nav :: DownExact => Self :: DownExact ,
92- Nav :: Up ( n) => Self :: Up ( n) ,
93- Nav :: UpSkipTrivia ( n) => Self :: UpSkipTrivia ( n) ,
94- Nav :: UpExact ( n) => Self :: UpExact ( n) ,
95- }
96- }
97- }
98-
9961/// A semantic path: sequence of operations along one execution path.
10062pub type Path = Vec < SemanticOp > ;
10163
@@ -115,7 +77,7 @@ fn collect_ops_from_match(instr: &MatchIR, ctx: &CompileCtx) -> Vec<SemanticOp>
11577
11678 // Epsilons are pure control flow - they don't navigate or check node types
11779 if instr. nav != Nav :: Epsilon {
118- ops. push ( SemanticOp :: Nav ( instr. nav . into ( ) ) ) ;
80+ ops. push ( SemanticOp :: Nav ( instr. nav ) ) ;
11981
12082 // Only non-epsilons perform actual node type checks
12183 match & instr. node_type {
0 commit comments