use super::super::error::Result; use lazy_static::lazy_static; use regex::Regex; use std::fs; use tree_sitter::Point; // TODO: It would be cooler to do this with a comments query rather than with a regex // directly. lazy_static! { static ref METADATA_PAIR_REGEX: Regex = Regex::new(r#"(\w+): ([^\s,]+)"#).unwrap(); static ref NUMBER_REGEX: Regex = Regex::new(r#"\d+"#).unwrap(); } pub struct CaptureInfo { pub name: String, } #[derive(Debug, Eq, PartialEq)] struct Assertion { position: Point, line_numbers: Vec, capture_type: String, } pub fn assert_expected_captures(_captures: Vec, path: String) -> Result<()> { let contents = fs::read_to_string(path)?; for m in METADATA_PAIR_REGEX.captures_iter(&contents) { println!("pair: {:?}", m); } Ok(()) }