7 releases
Uses new Rust 2024
0.4.1 | Mar 16, 2025 |
---|---|
0.4.0 | Mar 16, 2025 |
0.3.3 | Apr 6, 2024 |
0.3.1 | Aug 25, 2023 |
0.2.0 | Jun 16, 2021 |
#88 in Text editors
253 downloads per month
Used in tree-painter
6MB
219K
SLoC
tree-sitter-commonlisp
WIP. Goal is to have a better syntax highlighting for Neovim and some semantic refactoring https://github.com/nvim-treesitter/nvim-treesitter-refactor/.
All praise goes to https://github.com/sogaiu/tree-sitter-clojure which is extended by this grammar.
TODOs:
- support number literals that are different from clojure (e.g.
.9
)
Macros with special respresentation in syntax tree (when written with lowercase letters):
- defun and friends (e.g. defmethod)
- loop macro
This grammar is used in https://github.com/Wilfred/difftastic to generate syntax-ware diffs for Common Lisp.
Usage
-
C/C++
- compilation run
make
(optionalmake install
) - Follow the Guide on using tree-sitter parsers
- set
tree_sitter_commonlisp()
as language on your Tree-Sitter parser fromtree_sitter_commonlisp.h
ts_parser_set_language(parser, tree_sitter_json());
- compilation run
-
Python (
pip install tree-sitter-commonlisp tree-sitter
) https://github.com/tree-sitter-grammars/tree-sitter-commonlisp/blob/4d2a2247bb0ec117193ef33e3ce546a6781c5bf5/bindings/python/tests/test_import.py#L15-L23 -
Rust
cargo add tree-sitter tree-sitter-grammars
https://github.com/tree-sitter-grammars/tree-sitter-commonlisp/blob/4d2a2247bb0ec117193ef33e3ce546a6781c5bf5/bindings/rust/lib.rs#L47-L50