Introduce query/assert and call it in query.rs.
This commit is contained in:
parent
6f13d6bbba
commit
91d5d59d85
3 changed files with 55 additions and 7 deletions
23
cli/src/query/assert.rs
Normal file
23
cli/src/query/assert.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use lazy_static::lazy_static;
|
||||
use regex::Regex;
|
||||
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<usize>,
|
||||
capture_type: String,
|
||||
}
|
||||
|
||||
pub fn assert_expected_captures(_captures: Vec<CaptureInfo>, _path: String) {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue