-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
it is not perfect, but it is much more accurate and up to date than the previously used one.
- Loading branch information
Showing
6 changed files
with
86 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(comment) @fold | ||
(pod) @fold | ||
|
||
; fold the block-typed package statements only | ||
(package_statement (block)) @fold | ||
|
||
[(subroutine_declaration_statement) | ||
(conditional_statement) | ||
(loop_statement) | ||
(for_statement) | ||
(cstyle_for_statement) | ||
(block_statement) | ||
(phaser_statement)] @fold | ||
|
||
(anonymous_subroutine_expression) @fold | ||
|
||
; perhaps folks want to fold these too? | ||
[(anonymous_array_expression) | ||
(anonymous_hash_expression)] @fold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,181 +1,87 @@ | ||
; Variables | ||
(variable_declaration | ||
. | ||
(scope) @keyword) | ||
[ | ||
(single_var_declaration) | ||
(scalar_variable) | ||
(array_variable) | ||
(hash_variable) | ||
(hash_variable) | ||
] @variable | ||
"use" "no" | ||
"package" | ||
"sub" | ||
"if" "elsif" "else" "unless" | ||
"while" "until" | ||
"for" "foreach" | ||
"do" | ||
"my" "our" "local" | ||
"require" | ||
"last" "next" "redo" "goto" | ||
"undef" | ||
"return" | ||
] @keyword | ||
|
||
(phaser_statement phase: _ @keyword.phaser) | ||
|
||
[ | ||
(package_name) | ||
(special_scalar_variable) | ||
(special_array_variable) | ||
(special_hash_variable) | ||
(special_literal) | ||
(super) | ||
] @constant | ||
|
||
( | ||
[ | ||
(package_name) | ||
(super) | ||
] | ||
. | ||
("::" @operator) | ||
) | ||
|
||
(comments) @comment | ||
(pod_statement) @comment.block.documentation | ||
"or" "and" | ||
"eq" "ne" "cmp" "lt" "le" "ge" "gt" | ||
"isa" | ||
] @operator | ||
|
||
[ | ||
(use_no_statement) | ||
(use_no_feature_statement) | ||
(use_no_if_statement) | ||
(use_no_version) | ||
(use_constant_statement) | ||
(use_parent_statement) | ||
] @keyword | ||
(comment) @comment | ||
|
||
(use_constant_statement | ||
constant: (identifier) @constant) | ||
(eof_marker) @preproc | ||
(data_section) @comment | ||
|
||
[ | ||
"require" | ||
] @keyword | ||
(pod) @text | ||
|
||
(method_invocation | ||
. | ||
(identifier) @variable) | ||
|
||
(method_invocation | ||
(arrow_operator) | ||
. | ||
(identifier) @function) | ||
(method_invocation | ||
function_name: (identifier) @function) | ||
(named_block_statement | ||
function_name: (identifier) @function) | ||
|
||
(call_expression | ||
function_name: (identifier) @function) | ||
(function_definition | ||
name: (identifier) @function) | ||
[ | ||
(function) | ||
(map) | ||
(grep) | ||
(bless) | ||
] @function | ||
(number) @number | ||
(version) @number | ||
|
||
[ | ||
"return" | ||
"sub" | ||
"package" | ||
"BEGIN" | ||
"END" | ||
] @keyword.function | ||
(string_literal) @string | ||
(interpolated_string_literal) @string | ||
(quoted_word_list) @string | ||
(command_string) @string | ||
[(heredoc_token) (command_heredoc_token)] @string.special | ||
(heredoc_content) @string | ||
(heredoc_end) @string.special | ||
[(escape_sequence) (escaped_delimiter)] @string.special | ||
|
||
[ | ||
"(" | ||
")" | ||
"[" | ||
"]" | ||
"{" | ||
"}" | ||
] @punctuation.bracket | ||
(standard_input_to_variable) @punctuation.bracket | ||
[(quoted_regexp) (match_regexp)] @string.regexp | ||
|
||
[ | ||
"=~" | ||
"or" | ||
"=" | ||
"==" | ||
"+" | ||
"-" | ||
"." | ||
"//" | ||
"||" | ||
(arrow_operator) | ||
(hash_arrow_operator) | ||
(array_dereference) | ||
(hash_dereference) | ||
(to_reference) | ||
(type_glob) | ||
(hash_access_variable) | ||
(ternary_expression) | ||
(ternary_expression_in_hash) | ||
] @operator | ||
(autoquoted_bareword _?) @string.special | ||
|
||
[ | ||
(regex_option) | ||
(regex_option_for_substitution) | ||
(regex_option_for_transliteration) | ||
] @variable.parameter | ||
|
||
(type_glob | ||
(identifier) @variable) | ||
( | ||
(scalar_variable) | ||
. | ||
("->" @operator)) | ||
[(scalar) (arraylen)] @variable.scalar | ||
(scalar_deref_expression ["->" "$" "*"] @variable.scalar) | ||
(array) @variable.array | ||
(array_deref_expression ["->" "@" "*"] @variable.array) | ||
(hash) @variable.hash | ||
(hash_deref_expression ["->" "%" "*"] @variable.hash) | ||
|
||
[ | ||
(word_list_qw) | ||
(command_qx_quoted) | ||
(string_single_quoted) | ||
(string_double_quoted) | ||
(string_qq_quoted) | ||
(bareword) | ||
(transliteration_tr_or_y) | ||
] @string | ||
(array_element_expression [array:(_) "->" "[" "]"] @variable.array) | ||
(slice_expression [array:(_) "->" "[" "]"] @variable.array) | ||
(keyval_expression [array:(_) "->" "[" "]"] @variable.array) | ||
|
||
[ | ||
(regex_pattern_qr) | ||
(patter_matcher_m) | ||
(substitution_pattern_s) | ||
] @string.regexp | ||
(hash_element_expression [hash:(_) "->" "{" "}"] @variable.hash) | ||
(slice_expression [hash:(_) "->" "[" "]"] @variable.hash) | ||
(keyval_expression [hash:(_) "->" "[" "]"] @variable.hash) | ||
|
||
(escape_sequence) @string.special | ||
(hash_element_expression key: (bareword) @string.special) | ||
|
||
[ | ||
"," | ||
(semi_colon) | ||
(start_delimiter) | ||
(end_delimiter) | ||
(ellipsis_statement) | ||
] @punctuation.delimiter | ||
(use_statement (package) @type) | ||
(package_statement (package) @type) | ||
(require_expression (bareword) @type) | ||
|
||
[ | ||
(integer) | ||
(floating_point) | ||
(scientific_notation) | ||
(hexadecimal) | ||
] @constant.numeric | ||
(subroutine_declaration_statement name: (_) @function) | ||
(attrlist (attribute) @decorator) | ||
|
||
[ | ||
; (if_statement) | ||
(unless_statement) | ||
(if_simple_statement) | ||
(unless_simple_statement) | ||
] @keyword.control.conditional | ||
(goto_expression (label) @label) | ||
(loopex_expression (label) @label) | ||
|
||
[ | ||
"if" | ||
"elsif" | ||
"else" | ||
] @keyword.control.conditional | ||
(statement_label label: _ @label) | ||
|
||
(relational_expression operator: "isa" right: (bareword) @type) | ||
|
||
(foreach_statement) @keyword.control.repeat | ||
(foreach_statement | ||
. | ||
(scope) @keyword) | ||
(function_call_expression (function) @function) | ||
(method_call_expression (method) @function.method) | ||
(method_call_expression invocant: (bareword) @type) | ||
|
||
(function_attribute) @label | ||
(func0op_call_expression function: _ @function.builtin) | ||
(func1op_call_expression function: _ @function.builtin) | ||
|
||
(function_signature) @type | ||
(function) @function | ||
|
||
(ERROR) @error |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
((comments) @injection.content | ||
(#set! injection.language "comment")) | ||
; an injections.scm file for nvim-treesitter | ||
(pod) @pod |
This file was deleted.
Oops, something went wrong.