mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 05:20:00 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
c13e28f894
commit
2c8f2f2fad
829 changed files with 4905 additions and 8010 deletions
11
runtime/queries/perl/folds.scm
Normal file
11
runtime/queries/perl/folds.scm
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[
|
||||
(function_definition)
|
||||
(if_statement)
|
||||
(unless_statement)
|
||||
(while_statement)
|
||||
(until_statement)
|
||||
(for_statement_1)
|
||||
(for_statement_2)
|
||||
(standalone_block)
|
||||
(pod_statement)
|
||||
] @fold
|
||||
198
runtime/queries/perl/highlights.scm
Normal file
198
runtime/queries/perl/highlights.scm
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
; Misc keywords
|
||||
[
|
||||
"my" "our" "local"
|
||||
"next" "last" "redo"
|
||||
"goto"
|
||||
"package"
|
||||
; "do"
|
||||
; "eval"
|
||||
] @keyword
|
||||
|
||||
; Keywords for including
|
||||
[ "use" "no" "require" ] @include
|
||||
|
||||
; Keywords that mark conditional statements
|
||||
[ "if" "elsif" "unless" "else" ] @conditional
|
||||
(ternary_expression
|
||||
["?" ":"] @conditional.ternary)
|
||||
|
||||
; Keywords that mark repeating loops
|
||||
[ "while" "until" "for" "foreach" ] @repeat
|
||||
|
||||
; Keyword for return expressions
|
||||
[ "return" ] @keyword.return
|
||||
|
||||
; Keywords for phaser blocks
|
||||
; TODO: Ideally these would be @keyword.phaser but vim-treesitter doesn't
|
||||
; have such a thing yet
|
||||
[ "BEGIN" "CHECK" "UNITCHECK" "INIT" "END" ] @keyword.function
|
||||
|
||||
; Keywords to define a function
|
||||
[ "sub" ] @keyword.function
|
||||
|
||||
; Keywords that are regular infix operators
|
||||
[
|
||||
"and" "or" "not" "xor"
|
||||
"eq" "ne" "lt" "le" "ge" "gt" "cmp"
|
||||
] @keyword.operator
|
||||
|
||||
; Variables
|
||||
[
|
||||
(scalar_variable)
|
||||
(array_variable)
|
||||
(hash_variable)
|
||||
] @variable
|
||||
|
||||
; Special builtin variables
|
||||
[
|
||||
(special_scalar_variable)
|
||||
(special_array_variable)
|
||||
(special_hash_variable)
|
||||
(special_literal)
|
||||
(super)
|
||||
] @variable.builtin
|
||||
|
||||
((scalar_variable) @variable.builtin
|
||||
(#eq? @variable.builtin "$#ARGV"))
|
||||
|
||||
; Integer numbers
|
||||
[
|
||||
(integer)
|
||||
(hexadecimal)
|
||||
] @number
|
||||
|
||||
; Float numbers
|
||||
[
|
||||
(floating_point)
|
||||
(scientific_notation)
|
||||
] @float
|
||||
|
||||
; version sortof counts as a kind of multipart integer
|
||||
(version) @constant
|
||||
|
||||
; Package names are types
|
||||
(package_name) @type
|
||||
|
||||
; The special SUPER:: could be called a namespace. It isn't really but it
|
||||
; should highlight differently and we might as well do it this way
|
||||
(super) @namespace
|
||||
|
||||
; Comments are comments
|
||||
(comments) @comment @spell
|
||||
|
||||
((source_file . (comments) @preproc)
|
||||
(#lua-match? @preproc "^#!/"))
|
||||
|
||||
; POD should be handled specially with its own embedded subtype but for now
|
||||
; we'll just have to do this.
|
||||
(pod_statement) @text
|
||||
|
||||
(method_invocation
|
||||
function_name: (identifier) @method.call)
|
||||
(call_expression
|
||||
function_name: (identifier) @function.call)
|
||||
|
||||
; Built-in functions
|
||||
((call_expression
|
||||
function_name: (identifier) @function.builtin)
|
||||
(#any-of? @function.builtin
|
||||
"print" "printf" "sprintf" "say"
|
||||
"push" "pop" "shift" "unshift" "splice"
|
||||
"exists" "delete" "keys" "values"
|
||||
"each"))
|
||||
|
||||
[
|
||||
(map)
|
||||
(grep)
|
||||
(bless)
|
||||
] @function.builtin
|
||||
|
||||
;; ----------
|
||||
|
||||
(use_constant_statement
|
||||
constant: (identifier) @constant)
|
||||
|
||||
(named_block_statement
|
||||
function_name: (identifier) @function)
|
||||
|
||||
(function_definition
|
||||
name: (identifier) @function)
|
||||
|
||||
(function) @function
|
||||
|
||||
[
|
||||
"(" ")"
|
||||
"[" "]"
|
||||
"{" "}"
|
||||
(standard_input_to_variable)
|
||||
] @punctuation.bracket
|
||||
|
||||
[ "`" "\"" ] @punctuation.special
|
||||
|
||||
[
|
||||
"=~"
|
||||
"!~"
|
||||
"="
|
||||
"=="
|
||||
"+"
|
||||
"-"
|
||||
"."
|
||||
"//"
|
||||
"||"
|
||||
"&&"
|
||||
"<<"
|
||||
(arrow_operator)
|
||||
(hash_arrow_operator)
|
||||
(array_dereference)
|
||||
(hash_dereference)
|
||||
(to_reference)
|
||||
(type_glob)
|
||||
(hash_access_variable)
|
||||
] @operator
|
||||
|
||||
[
|
||||
(regex_option)
|
||||
(regex_option_for_substitution)
|
||||
(regex_option_for_transliteration)
|
||||
] @parameter
|
||||
|
||||
(type_glob
|
||||
(identifier) @variable)
|
||||
|
||||
[
|
||||
(word_list_qw)
|
||||
(command_qx_quoted)
|
||||
(string_single_quoted)
|
||||
(string_double_quoted)
|
||||
(string_qq_quoted)
|
||||
(bareword)
|
||||
(transliteration_tr_or_y)
|
||||
] @string
|
||||
|
||||
[
|
||||
(heredoc_start_identifier)
|
||||
(heredoc_end_identifier)
|
||||
] @label
|
||||
|
||||
(heredoc_body_statement) @text.literal
|
||||
|
||||
[
|
||||
(pattern_matcher)
|
||||
(regex_pattern_qr)
|
||||
(patter_matcher_m)
|
||||
(substitution_pattern_s)
|
||||
] @string.regex
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
[
|
||||
","
|
||||
(semi_colon)
|
||||
(start_delimiter)
|
||||
(end_delimiter)
|
||||
(ellipsis_statement)
|
||||
] @punctuation.delimiter
|
||||
|
||||
(function_attribute) @field
|
||||
|
||||
(function_signature) @type
|
||||
2
runtime/queries/perl/injections.scm
Normal file
2
runtime/queries/perl/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((comments) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue