Skip to content

Commit b39cd4e

Browse files
committed
add doc comment for get_syntax_test_assertions
1 parent 1d754cf commit b39cd4e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/syntax_tests.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ pub enum SyntaxTestFileResult {
2525

2626
#[derive(Debug)]
2727
pub struct SyntaxTestAssertionRange {
28-
test_line_offset: usize,
29-
line_number: usize,
30-
begin_char: usize,
31-
end_char: usize,
32-
scope_selector: ScopeSelectors,
33-
scope_selector_text: String,
28+
pub test_line_offset: usize,
29+
pub line_number: usize,
30+
pub begin_char: usize,
31+
pub end_char: usize,
32+
pub scope_selector: ScopeSelectors,
33+
pub scope_selector_text: String,
3434
}
3535

36+
/// Given a start token, option end token and text, parse the syntax tests in the text
37+
/// that follow the format described at http://www.sublimetext.com/docs/3/syntax.html#testing
38+
/// and return the scope selector assertions found, so that when the text is parsed,
39+
/// the assertions can be checked
3640
pub fn get_syntax_test_assertions(token_start: &str, token_end: Option<&str>, text: &str) -> Vec<SyntaxTestAssertionRange> {
3741
let mut assertions = Vec::new();
3842
let mut test_line_offset = 0;

0 commit comments

Comments
 (0)