Don't export private things
This commit is contained in:
parent
6b18cf0e20
commit
10e06be15a
@ -9,7 +9,7 @@ mod tests;
|
|||||||
/// configuration values. This struct parses them all in one go and then they
|
/// configuration values. This struct parses them all in one go and then they
|
||||||
/// get processed by their respective use sites.
|
/// get processed by their respective use sites.
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
pub struct Comments {
|
pub(crate) struct Comments {
|
||||||
/// List of revision names to execute. Can only be speicified once
|
/// List of revision names to execute. Can only be speicified once
|
||||||
pub revisions: Option<Vec<String>>,
|
pub revisions: Option<Vec<String>>,
|
||||||
/// Don't run this test if any of these filters apply
|
/// Don't run this test if any of these filters apply
|
||||||
@ -30,21 +30,21 @@ pub struct Comments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ErrorMatch {
|
pub(crate) struct ErrorMatch {
|
||||||
pub matched: String,
|
pub matched: String,
|
||||||
pub revision: Option<String>,
|
pub revision: Option<String>,
|
||||||
pub definition_line: usize,
|
pub definition_line: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Comments {
|
impl Comments {
|
||||||
pub fn parse_file(path: &Path) -> Self {
|
pub(crate) fn parse_file(path: &Path) -> Self {
|
||||||
let content = std::fs::read_to_string(path).unwrap();
|
let content = std::fs::read_to_string(path).unwrap();
|
||||||
Self::parse(path, &content)
|
Self::parse(path, &content)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse comments in `content`.
|
/// Parse comments in `content`.
|
||||||
/// `path` is only used to emit diagnostics if parsing fails.
|
/// `path` is only used to emit diagnostics if parsing fails.
|
||||||
pub fn parse(path: &Path, content: &str) -> Self {
|
pub(crate) fn parse(path: &Path, content: &str) -> Self {
|
||||||
let mut this = Self::default();
|
let mut this = Self::default();
|
||||||
let error_pattern_regex =
|
let error_pattern_regex =
|
||||||
Regex::new(r"//(\[(?P<revision>[^\]]+)\])?~[|^]*\s*(ERROR|HELP|WARN)?:?(?P<text>.*)")
|
Regex::new(r"//(\[(?P<revision>[^\]]+)\])?~[|^]*\s*(ERROR|HELP|WARN)?:?(?P<text>.*)")
|
||||||
|
@ -9,7 +9,7 @@ use comments::ErrorMatch;
|
|||||||
use crossbeam::queue::SegQueue;
|
use crossbeam::queue::SegQueue;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
pub use crate::comments::Comments;
|
use crate::comments::Comments;
|
||||||
|
|
||||||
mod comments;
|
mod comments;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user