From 64c78bfbfb72b857c396fcafe0c7d371818e7d4b Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Mon, 10 Nov 2025 21:32:52 -0800 Subject: [PATCH] updated allocator --- src/matcher.rs | 7 +++---- src/validation/utils.rs | 17 ----------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/matcher.rs b/src/matcher.rs index 6dd5048..79007fb 100644 --- a/src/matcher.rs +++ b/src/matcher.rs @@ -374,9 +374,9 @@ impl<'a> Matcher<'a> { } else { None }; - ///////////////////////////// + // // Process matches - ///////////////////////////// + // let mut matches = Vec::new(); let owned_ts_results = tree_sitter_result.map(|ts_results| { ts_results @@ -567,7 +567,6 @@ fn record_match( ) -> bool { insert_span(map.entry(rule_id).or_default(), span) } -// in src/matcher.rs #[allow(clippy::too_many_arguments)] fn filter_match<'b>( @@ -1025,7 +1024,7 @@ pub struct DecodedData { } #[inline] fn is_base64_byte(b: u8) -> bool { - // Include URL-safe characters '-' and '_' + // Accepts both standard base64 ('+', '/') and URL-safe base64 ('-', '_') characters. matches!(b, b'A'..=b'Z' | b'a'..=b'z' | b'0'..=b'9' | b'+' | b'/' | b'-' | b'_') } diff --git a/src/validation/utils.rs b/src/validation/utils.rs index 225e186..0080fd5 100644 --- a/src/validation/utils.rs +++ b/src/validation/utils.rs @@ -27,22 +27,6 @@ pub fn process_captures(captures: &SerializableCaptures) -> Vec<(String, String, .collect() } -// /// Return (NAME, value, start, end) for every capture we care about. -// /// -// /// * If a capture has a name, use that (upper-cased) -// /// * If it’s unnamed, fall back to `"TOKEN"` -// pub fn process_captures(captures: &SerializableCaptures) -> Vec<(String, String, usize, usize)> { -// captures -// .captures -// .iter() -// .map(|cap| { -// let name = -// cap.name.as_ref().map(|n| n.to_uppercase()).unwrap_or_else(|| "TOKEN".to_string()); -// (name, cap.value.to_string(), cap.start, cap.end) -// }) -// .collect() -// } - pub fn find_closest_variable( captures: &[(String, String, usize, usize)], target_value: &String, @@ -195,7 +179,6 @@ mod tests { // --- END FIX --- } - #[test] #[test] fn includes_whole_match_and_unnamed_groups() { let captures = SerializableCaptures {