Skip to content

Commit

Permalink
clean for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Canop committed Jan 3, 2025
1 parent 0a57ae5 commit 9bdac66
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"] # 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 <[email protected]>"]
edition = "2021"
exclude = [
"testdata/*",
Expand Down
1 change: 0 additions & 1 deletion src/easy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ pub struct HighlightLines<'a> {
highlight_state: HighlightState,
}


/// Options for highlighting operations
#[derive(Debug, Clone, Copy, Default)]
pub struct HighlightOptions {
Expand Down
14 changes: 9 additions & 5 deletions src/parsing/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Regex {
text: &'t str,
ignore_errors: bool,
) -> Result<bool, ParseSyntaxError> {
match self.is_match_failible(text) {
match self.is_match_fallible(text) {
Ok(result) => Ok(result),
Err(e) => {
if ignore_errors {
Expand All @@ -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,
Expand All @@ -79,7 +81,7 @@ impl Regex {
region: Option<&mut Region>,
ignore_errors: bool,
) -> Result<bool, ParseSyntaxError> {
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 {
Expand All @@ -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<bool, &str> {
/// without allocation.
///
/// Return an error if the regex pattern is invalid.
pub fn is_match_fallible<'t>(&self, text: &'t str) -> Result<bool, &str> {
match self.regex() {
Ok(r) => Ok(r.is_match(text)),
Err(e) => Err(e.as_str()),
Expand All @@ -111,7 +115,7 @@ impl Regex {
/// difference.
///
/// [`Region`]: struct.Region.html
pub fn search_failible(
pub fn search_fallible(
&self,
text: &str,
begin: usize,
Expand Down

0 comments on commit 9bdac66

Please sign in to comment.