Add support for Common Lisp

pull/70/head
Wilfred Hughes 2021-11-26 22:53:21 +07:00
parent b80023243f
commit 05873b546b
7 changed files with 18 additions and 1 deletions

@ -2,7 +2,7 @@
### Parsing
Added Bash and Ruby support.
Added Bash, Common Lisp and Ruby support.
Updated the C, CSS and JSON parsers to the latest upstream versions.

@ -60,6 +60,7 @@ Difftastic supports the following languages:
* C++
* C#
* Clojure
* Common Lisp
* CSS
* Elixir
* Emacs Lisp

@ -77,6 +77,11 @@ fn main() {
src_dir: "vendor/tree-sitter-clojure-src".into(),
extra_files: vec![],
},
TreeSitterParser {
name: "tree-sitter-commonlisp".into(),
src_dir: "vendor/tree-sitter-commonlisp-src".into(),
extra_files: vec![],
},
TreeSitterParser {
name: "tree-sitter-css".into(),
src_dir: "vendor/tree-sitter-css-src".into(),

@ -8,6 +8,7 @@ tool that understands syntax. It supports the following languages:
* C++
* C#
* Clojure
* Common Lisp
* CSS
* Elixir
* Emacs Lisp

@ -9,6 +9,7 @@ Difftastic uses the following tree-sitter parsers:
| C++ | [tree-sitter/tree-sitter-cpp](https://github.com/tree-sitter/tree-sitter-cpp) |
| C# | [tree-sitter/tree-sitter-c-sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) |
| Clojure | [sogaiu/tree-sitter-clojure](https://github.com/sogaiu/tree-sitter-clojure) |
| Common Lisp | [theHamsta/tree-sitter-commonlisp](https://github.com/theHamsta/tree-sitter-commonlisp) |
| CSS | [tree-sitter/tree-sitter-css](https://github.com/tree-sitter/tree-sitter-css) |
| Elixir | [ananthakumaran/tree-sitter-elixir](https://github.com/ananthakumaran/tree-sitter-elixir) |
| Emacs Lisp | [wilfred/tree-sitter-elisp](https://github.com/Wilfred/tree-sitter-elisp) |

@ -47,6 +47,7 @@ extern "C" {
fn tree_sitter_c_sharp() -> Language;
fn tree_sitter_clojure() -> Language;
fn tree_sitter_cpp() -> Language;
fn tree_sitter_commonlisp() -> Language;
fn tree_sitter_css() -> Language;
fn tree_sitter_elisp() -> Language;
fn tree_sitter_elixir() -> Language;
@ -204,6 +205,13 @@ pub fn from_extension(extension: &OsStr) -> Option<TreeSitterConfig> {
delimiter_tokens: (vec![("{", "}"), ("[", "]")]),
highlight_queries: include_str!("../vendor/highlights/json.scm"),
}),
"lisp" | "lsp" | "asd" => Some(TreeSitterConfig {
name: "Common Lisp",
language: unsafe { tree_sitter_commonlisp() },
atom_nodes: (vec!["str_lit"]).into_iter().collect(),
delimiter_tokens: (vec![("(", ")")]),
highlight_queries: "",
}),
"ml" => Some(TreeSitterConfig {
name: "OCaml",
language: unsafe { tree_sitter_ocaml() },

@ -0,0 +1 @@
tree-sitter-commonlisp/src