From e4b5bd4e192cfcee2ba1b9baceda67a1561d8491 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Sat, 4 Sep 2021 18:30:17 -0700 Subject: [PATCH] Remove Scheme support There's no tree-sitter parser available sadly, and I eventually plan to drop the regex parser. --- CHANGELOG.md | 2 ++ README.md | 1 - src/regex_parser.rs | 16 ---------------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d922c86b..c4a6fc3bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ Added Python parser. JSON (legacy parser): fixed parsing string literals (broken in 0.7). +Removed Scheme support, as there's no tree-sitter parser available. + ### Display Fixed crashes on files with non-ASCII characters on long lines. diff --git a/README.md b/README.md index 1f96d3305..e1ccc00db 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ Difftastic supports the following languages: * OCaml * Python * Rust -* Scheme If a file has an unrecognised extension, difftastic uses a line-oriented diff. diff --git a/src/regex_parser.rs b/src/regex_parser.rs index 0887c85b1..f4289159c 100644 --- a/src/regex_parser.rs +++ b/src/regex_parser.rs @@ -191,22 +191,6 @@ pub fn from_extension(extension: &OsStr) -> Option { open_delimiter_pattern: Regex::new(r"(\[|\{|\()").unwrap(), close_delimiter_pattern: Regex::new(r"(\]|\}|\))").unwrap(), }), - "scm" => Some(Language { - name: "Scheme".into(), - atom_patterns: vec![ - // Numbers - Regex::new(r"[0-9]+").unwrap(), - // Symbols (e.g. variable names) - Regex::new(r"#?[a-zA-Z0-9_?:/*=-]+").unwrap(), - // Operators - Regex::new(r"[`',#.]").unwrap(), - // Double-quoted strings - Regex::new(r#""((\\.)|[^"])*""#).unwrap(), - ], - comment_patterns: vec![Regex::new(r";.*").unwrap()], - open_delimiter_pattern: Regex::new(r"(\[|\{|\()").unwrap(), - close_delimiter_pattern: Regex::new(r"(\]|\}|\))").unwrap(), - }), _ => None, } }