Skip to content

Commit

Permalink
feat: add non-standard bracket form to parse common macros
Browse files Browse the repository at this point in the history
  • Loading branch information
theHamsta committed Apr 6, 2024
1 parent 83ae738 commit 0543982
Show file tree
Hide file tree
Showing 8 changed files with 149,473 additions and 143,122 deletions.
8 changes: 8 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ module.exports = grammar(clojure, {
$.unquoting_lit,
$.include_reader_macro,
$.complex_num_lit,
$.bracket_form,
".",
)),

Expand All @@ -382,6 +383,13 @@ module.exports = grammar(clojure, {
repeat($._gap),
field('target', $._form)),

bracket_form: $ =>
seq('[',
optional($._gap),
optional(seq($._form, repeat(seq($._gap, $._form)))),
optional($._gap),
']'),

complex_num_lit: $ =>
seq(repeat($._metadata_lit),
field('marker', choice("#C", "#c")),
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"url": "git://github.com/theHamsta/tree-sitter-commonlisp"
},
"devDependencies": {
"tree-sitter-cli": "^0.20.8",
"tree-sitter-cli": "^0.22.2",
"tree-sitter-clojure": "[email protected]:theHamsta/tree-sitter-clojure.git#commonlisp",
"prebuildify": "^6.0.0"
},
Expand Down
74 changes: 74 additions & 0 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0543982

Please sign in to comment.