Skip to content

Commit

Permalink
feat: some keywords
Browse files Browse the repository at this point in the history
Signed-off-by: Shuguang Sun <[email protected]>
  • Loading branch information
ShuguangSun committed Nov 20, 2024
1 parent 7568489 commit 8958469
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tree-sitter-ess-r.el
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@

;; Some additional patterns.
(tree-sitter-hl-add-patterns 'r
[(function_definition "function" @keyword.function)
[(function_definition name: "function" @keyword.function)
(binary_operator operator: ["=" "<-" "<<-" "->" "->>"] @assignment)
(extract_operator operator: "$" @dollar)
(extract_operator operator: "@" @slot)
Expand All @@ -217,6 +217,13 @@
(binary_operator operator: ["|>"] @operatorpipe)
(binary_operator operator: [":" "~"] @opspecial)
(binary_operator operator: "special" @opspecial)
([(return) (next) (break)
(true) (false)
(null) (inf) (nan) (na)
(dots) (dot_dot_i)
] @repeat)
;; (parameter name: (identifier) @parameter)
;; (argument name: (identifier) @parameter)
(call function: (identifier) @modifier
(.match? @modifier "^(library|attach|detach|source|require|setwd|options|par|load|rm|message|warning|.Deprecated|signalCondition|withCallingHandlers)$"))
;; ((identifier) @modifier
Expand Down

0 comments on commit 8958469

Please sign in to comment.