Jesse Luehrs 1 year ago committed by GitHub
parent ad2061bab6
commit e7f60611ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -109,7 +109,7 @@
| pascal | ✓ | ✓ | | `pasls` | | pascal | ✓ | ✓ | | `pasls` |
| passwd | ✓ | | | | | passwd | ✓ | | | |
| pem | ✓ | | | | | pem | ✓ | | | |
| perl | ✓ | | | `perlnavigator` | | perl | ✓ | | | `perlnavigator` |
| php | ✓ | ✓ | ✓ | `intelephense` | | php | ✓ | ✓ | ✓ | `intelephense` |
| po | ✓ | ✓ | | | | po | ✓ | ✓ | | |
| ponylang | ✓ | ✓ | ✓ | | | ponylang | ✓ | ✓ | ✓ | |

@ -1112,7 +1112,7 @@ indent = { tab-width = 2, unit = " " }
[[grammar]] [[grammar]]
name = "perl" name = "perl"
source = { git = "https://github.com/ganezdragon/tree-sitter-perl", rev = "0ac2c6da562c7a2c26ed7e8691d4a590f7e8b90a" } source = { git = "https://github.com/tree-sitter-perl/tree-sitter-perl", rev = "ed21ecbcc128a6688770ebafd3ef68a1c9bc1ea9" }
[[language]] [[language]]
name = "racket" name = "racket"

@ -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

@ -1,181 +1,100 @@
; Variables
(variable_declaration
.
(scope) @keyword)
[ [
(single_var_declaration) "use" "no" "require" "package"
(scalar_variable) ] @keyword.control.import
(array_variable)
(hash_variable)
(hash_variable)
] @variable
[ [
(package_name) "sub"
(special_scalar_variable) ] @keyword.function
(special_array_variable)
(special_hash_variable)
(special_literal)
(super)
] @constant
(
[
(package_name)
(super)
]
.
("::" @operator)
)
(comments) @comment
(pod_statement) @comment.block.documentation
[ [
(use_no_statement) "if" "elsif" "else" "unless"
(use_no_feature_statement) ] @keyword.control.conditional
(use_no_if_statement)
(use_no_version)
(use_constant_statement)
(use_parent_statement)
] @keyword
(use_constant_statement
constant: (identifier) @constant)
[ [
"require" "while" "until"
] @keyword "for" "foreach"
"do"
(method_invocation ] @keyword.control.repeat
.
(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
[ [
"return" "my" "our" "local"
"sub" ] @keyword.storage.modifier
"package"
"BEGIN"
"END"
] @keyword.function
[ [
"(" "last" "next" "redo" "goto" "return"
")" ] @keyword.control.return
"["
"]"
"{"
"}"
] @punctuation.bracket
(standard_input_to_variable) @punctuation.bracket
[ [
"=~" "undef"
"or" ] @constant.builtin
"="
"=="
"+"
"-"
"."
"//"
"||"
(arrow_operator)
(hash_arrow_operator)
(array_dereference)
(hash_dereference)
(to_reference)
(type_glob)
(hash_access_variable)
(ternary_expression)
(ternary_expression_in_hash)
] @operator
[ (phaser_statement phase: _ @keyword.directive)
(regex_option)
(regex_option_for_substitution)
(regex_option_for_transliteration)
] @variable.parameter
(type_glob
(identifier) @variable)
(
(scalar_variable)
.
("->" @operator))
[ [
(word_list_qw) "or" "and"
(command_qx_quoted) "eq" "ne" "cmp" "lt" "le" "ge" "gt"
(string_single_quoted) "isa"
(string_double_quoted) ] @keyword.operator
(string_qq_quoted)
(bareword)
(transliteration_tr_or_y)
] @string
[ (comment) @comment
(regex_pattern_qr)
(patter_matcher_m)
(substitution_pattern_s)
] @string.regexp
(escape_sequence) @string.special (eof_marker) @keyword.directive
(data_section) @comment
[ (pod) @comment.block.documentation
","
(semi_colon)
(start_delimiter)
(end_delimiter)
(ellipsis_statement)
] @punctuation.delimiter
[ (number) @constant.numeric
(integer) (version) @constant
(floating_point)
(scientific_notation)
(hexadecimal)
] @constant.numeric
[ (string_literal) @string
; (if_statement) (interpolated_string_literal) @string
(unless_statement) (quoted_word_list) @string
(if_simple_statement) (command_string) @string
(unless_simple_statement) [(heredoc_token) (command_heredoc_token)] @string.special
] @keyword.control.conditional (heredoc_content) @string
(heredoc_end) @string.special
[(escape_sequence) (escaped_delimiter)] @constant.character.escape
[ [(quoted_regexp) (match_regexp)] @string.regexp
"if"
"elsif" (autoquoted_bareword _?) @string.special
"else"
] @keyword.control.conditional [(scalar) (arraylen)] @variable
(scalar_deref_expression ["->" "$" "*"] @variable)
(array) @variable
(array_deref_expression ["->" "@" "*"] @variable)
(hash) @variable
(hash_deref_expression ["->" "%" "*"] @variable)
(array_element_expression [array:(_) "->" "[" "]"] @variable)
(slice_expression [array:(_) "->" "[" "]"] @variable)
(keyval_expression [array:(_) "->" "[" "]"] @variable)
(hash_element_expression [hash:(_) "->" "{" "}"] @variable)
(slice_expression [hash:(_) "->" "[" "]"] @variable)
(keyval_expression [hash:(_) "->" "[" "]"] @variable)
(hash_element_expression key: (bareword) @string.special)
(use_statement (package) @type)
(package_statement (package) @type)
(require_expression (bareword) @type)
(subroutine_declaration_statement name: (_) @function)
(attrlist (attribute) @attribute)
(goto_expression (label) @label)
(loopex_expression (label) @label)
(statement_label label: _ @label)
(foreach_statement) @keyword.control.repeat (relational_expression operator: "isa" right: (bareword) @type)
(foreach_statement
.
(scope) @keyword)
(function_attribute) @label (function_call_expression (function) @function)
(method_call_expression (method) @function.method)
(method_call_expression invocant: (bareword) @type)
(function_signature) @type (func0op_call_expression function: _ @function.builtin)
(func1op_call_expression function: _ @function.builtin)
(function) @function

@ -1,15 +0,0 @@
[
(function)
(identifier)
(method_invocation)
(if_statement)
(unless_statement)
(if_simple_statement)
(unless_simple_statement)
(variable_declaration)
(block)
(list_item)
(word_list_qw)
] @indent
"}" @outdent

@ -1,2 +1,2 @@
((comments) @injection.content ((comment) @injection.content
(#set! injection.language "comment")) (#set! injection.language "comment"))

@ -1,17 +0,0 @@
(function_definition
(identifier) (_) @function.inside) @function.around
(anonymous_function
(_) @function.inside) @function.around
(argument
(_) @parameter.inside)
[
(comments)
(pod_statement)
] @comment.inside
(comments)+ @comment.around
(pod_statement) @comment.around
Loading…
Cancel
Save