diff --git a/Cargo.toml b/Cargo.toml index 192174be..310f51da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "syntect-no-panic" -description = "temporary fork of Syntect" -documentation = "https://docs.rs/syntect-no-panic" -repository = "https://github.com/Canop/syntect" +name = "syntect" +description = "library for high quality syntax highlighting and code intelligence using Sublime Text's grammars" +documentation = "https://docs.rs/syntect" +repository = "https://github.com/trishume/syntect" keywords = ["syntax", "highlighting", "highlighter", "colouring", "parsing"] categories = ["parser-implementations", "parsing", "text-processing"] readme = "Readme.md" license = "MIT" -version = "6.0.0" # based on https://github.com/trishume/syntect version 5.2.0 -authors = ["Tristan Hume "] # Tristan isn't responsible of the things I added in the fork +version = "6.0.0-dev" # remember to update html_root_url +authors = ["Tristan Hume "] edition = "2021" exclude = [ "testdata/*", diff --git a/src/easy.rs b/src/easy.rs index e4e35057..34025f5c 100644 --- a/src/easy.rs +++ b/src/easy.rs @@ -46,7 +46,6 @@ pub struct HighlightLines<'a> { highlight_state: HighlightState, } - /// Options for highlighting operations #[derive(Debug, Clone, Copy, Default)] pub struct HighlightOptions { diff --git a/src/parsing/regex.rs b/src/parsing/regex.rs index dbb51b42..99e7b3e8 100644 --- a/src/parsing/regex.rs +++ b/src/parsing/regex.rs @@ -49,7 +49,7 @@ impl Regex { text: &'t str, ignore_errors: bool, ) -> Result { - match self.is_match_failible(text) { + match self.is_match_fallible(text) { Ok(result) => Ok(result), Err(e) => { if ignore_errors { @@ -70,6 +70,8 @@ impl Regex { /// the [`Region`] to be reused between searches, which makes a significant performance /// difference. /// + /// Return an error if the regex pattern is invalid. + /// /// [`Region`]: struct.Region.html pub fn search( &self, @@ -79,7 +81,7 @@ impl Regex { region: Option<&mut Region>, ignore_errors: bool, ) -> Result { - match self.search_failible(text, begin, end, region) { + match self.search_fallible(text, begin, end, region) { Ok(result) => Ok(result), Err(e) => { if ignore_errors { @@ -97,8 +99,10 @@ impl Regex { /// Check if the regex matches the given text. /// /// In order to be called repetitively when in error, the error message is returned as a &str - /// without allocation - pub fn is_match_failible<'t>(&self, text: &'t str) -> Result { + /// without allocation. + /// + /// Return an error if the regex pattern is invalid. + pub fn is_match_fallible<'t>(&self, text: &'t str) -> Result { match self.regex() { Ok(r) => Ok(r.is_match(text)), Err(e) => Err(e.as_str()), @@ -111,7 +115,7 @@ impl Regex { /// difference. /// /// [`Region`]: struct.Region.html - pub fn search_failible( + pub fn search_fallible( &self, text: &str, begin: usize,