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.
-
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_commonlisp());
- compilation run
-
Python (
pip install tree-sitter-commonlisp tree-sitter
)tree-sitter-commonlisp/bindings/python/tests/test_import.py
Lines 15 to 23 in 4d2a224
-
Rust
cargo add tree-sitter tree-sitter-grammars
tree-sitter-commonlisp/bindings/rust/lib.rs
Lines 47 to 50 in 4d2a224
-
Swift
-
Go
tree-sitter-commonlisp/bindings/go/binding_test.go
Lines 1 to 15 in 4d2a224