mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
First pass at def-likes
This commit is contained in:
parent
da360bfd04
commit
5b5b55f8ed
1 changed files with 17 additions and 9 deletions
|
|
@ -73,14 +73,22 @@
|
||||||
;; >> Functions
|
;; >> Functions
|
||||||
;; TODO: Enforce function-like things are the first thing in a list?
|
;; TODO: Enforce function-like things are the first thing in a list?
|
||||||
|
|
||||||
;; def-like things
|
;; def & fn
|
||||||
;; TODO
|
; TODO: fix it so that meta isn't marked as @function
|
||||||
;(list_lit
|
; e.g (fn ^:meta name [a] a) marks `^:meta` as @function
|
||||||
; .
|
(list_lit
|
||||||
; (sym_lit) @keyword.function
|
.
|
||||||
; (#match? @keyword.function "^(declare|def.*|ns)$")
|
(sym_lit) @keyword.function
|
||||||
; .
|
(#match? @keyword.function "^(fn|fn[*]|def.*)$")
|
||||||
; (sym_lit) @function)
|
.
|
||||||
|
(sym_lit)? @function
|
||||||
|
.
|
||||||
|
(str_lit)? @text
|
||||||
|
.
|
||||||
|
; TODO: Get this working?
|
||||||
|
(vec_lit
|
||||||
|
(sym_lit) @parameter)?)
|
||||||
|
|
||||||
|
|
||||||
;; def-like things
|
;; def-like things
|
||||||
;; TODO
|
;; TODO
|
||||||
|
|
@ -114,7 +122,7 @@
|
||||||
"." ".." "->" "->>" "amap" "and" "areduce" "as->" "assert"
|
"." ".." "->" "->>" "amap" "and" "areduce" "as->" "assert"
|
||||||
"binding" "bound-fn" "case" "catch" "comment" "cond" "cond->"
|
"binding" "bound-fn" "case" "catch" "comment" "cond" "cond->"
|
||||||
"cond->>" "condp" "delay" "do" "doseq" "dosync" "dotimes"
|
"cond->>" "condp" "delay" "do" "doseq" "dosync" "dotimes"
|
||||||
"doto" "extend-protocol" "extend-type" "finally" "fn" "fn*"
|
"doto" "extend-protocol" "extend-type" "finally"
|
||||||
"for" "future" "gen-class" "gen-interface" "if" "if-let"
|
"for" "future" "gen-class" "gen-interface" "if" "if-let"
|
||||||
"if-not" "if-some" "import" "io!" "lazy-cat" "lazy-seq" "let"
|
"if-not" "if-some" "import" "io!" "lazy-cat" "lazy-seq" "let"
|
||||||
"letfn" "locking" "loop" "memfn" "monitor-enter" "monitor-exit"
|
"letfn" "locking" "loop" "memfn" "monitor-enter" "monitor-exit"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue