Better naming for this regex.

This commit is contained in:
Patrick Thomson 2020-10-27 13:11:57 -04:00
parent 938eae8536
commit 0bd223f032

View file

@ -7,7 +7,7 @@ use std::fs;
use tree_sitter::{Language, Parser, Point};
lazy_static! {
static ref HIGHLIGHT_NAME_REGEX: Regex = Regex::new("[\\w_\\-.]+").unwrap();
static ref PROPERTY_NAME_REGEX: Regex = Regex::new("[\\w_\\-.]+").unwrap();
}
#[derive(Debug, Eq, PartialEq)]
@ -76,7 +76,7 @@ pub fn parse_position_comments(
// If the comment node contains an arrow and a highlight name, record the
// highlight name and the position.
if let (true, Some(mat)) =
(has_arrow, HIGHLIGHT_NAME_REGEX.find(&text[arrow_end..]))
(has_arrow, PROPERTY_NAME_REGEX.find(&text[arrow_end..]))
{
assertion_ranges.push((node.start_position(), node.end_position()));
result.push(Assertion {