aboutsummaryrefslogtreecommitdiffstats
path: root/queries/php/injections.scm
diff options
context:
space:
mode:
authortk-shirasaka <tk.shirasaka@gmail.com>2024-01-20 21:34:49 +0900
committerGitHub <noreply@github.com>2024-01-20 12:34:49 +0000
commit64b3d5e5698d485a4f197ffbe85a4b6c29e16325 (patch)
treedf6723ec690b4b4dad98cdcbffaa99c3a66b4587 /queries/php/injections.scm
parentfix(highlights): use `markup.raw.delimiter` for fences (diff)
downloadnvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.gz
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.bz2
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.lz
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.xz
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.tar.zst
nvim-treesitter-64b3d5e5698d485a4f197ffbe85a4b6c29e16325.zip
feat: add the php_only parser included in tree-sitter-php (#5876)
Add parser `php_only` for PHP files without HTML embedded. Make queries for combined parser `php` inherit from `php_only` (no extensions needed). --------- Co-authored-by: shirasaka <tk.shirasaka@gmail>
Diffstat (limited to 'queries/php/injections.scm')
-rw-r--r--queries/php/injections.scm45
1 files changed, 1 insertions, 44 deletions
diff --git a/queries/php/injections.scm b/queries/php/injections.scm
index 0c9d25ce6..141f65eaa 100644
--- a/queries/php/injections.scm
+++ b/queries/php/injections.scm
@@ -1,47 +1,4 @@
+; inherits: php_only
((text) @injection.content
(#set! injection.language "html")
(#set! injection.combined))
-
-((comment) @injection.content
- (#set! injection.language "phpdoc"))
-
-((heredoc
- (heredoc_body) @injection.content
- (heredoc_end) @injection.language
- (#set! injection.include-children)
- (#downcase! @injection.language)))
-
-((nowdoc
- (nowdoc_body) @injection.content
- (heredoc_end) @injection.language
- (#set! injection.include-children)
- (#downcase! @injection.language)))
-
-; regex
-((function_call_expression
- function: (_) @_preg_func_identifier
- arguments:
- (arguments
- .
- (argument
- (_
- (string_value) @injection.content))))
- (#set! injection.language "regex")
- (#lua-match? @_preg_func_identifier "^preg_"))
-
-; bash
-((function_call_expression
- function: (_) @_shell_func_identifier
- arguments:
- (arguments
- .
- (argument
- (_
- (string_value) @injection.content))))
- (#set! injection.language "bash")
- (#any-of? @_shell_func_identifier "shell_exec" "escapeshellarg" "escapeshellcmd" "exec" "passthru" "proc_open" "shell_exec" "system"))
-
-(expression_statement
- (shell_command_expression
- (string_value) @injection.content)
- (#set! injection.language "bash"))