summaryrefslogtreecommitdiff
path: root/queries/phpdoc
diff options
context:
space:
mode:
authorMichael Härtl <haertl.mike@gmail.com>2022-01-17 12:20:47 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-01-20 15:37:44 +0100
commitd7c4ae886d90471b1839dd601887bdd6e882efd9 (patch)
tree37bf8b384531d0c0651dd70ebf0ba7f9ae4a0dc6 /queries/phpdoc
parentd0158c053d01de1bcb618d7899bd8e38ce154430 (diff)
parsers: add phpdoc parser (experimental)
Diffstat (limited to 'queries/phpdoc')
-rw-r--r--queries/phpdoc/highlights.scm42
1 files changed, 42 insertions, 0 deletions
diff --git a/queries/phpdoc/highlights.scm b/queries/phpdoc/highlights.scm
new file mode 100644
index 00000000..047ee3aa
--- /dev/null
+++ b/queries/phpdoc/highlights.scm
@@ -0,0 +1,42 @@
+(tag_name) @attribute
+(tag
+ (tag_name) @_tag (#eq? @_tag "@param")
+ (variable_name) @parameter
+)
+(tag
+ (tag_name) @_tag (#eq? @_tag "@property")
+ (variable_name) @property
+)
+(tag
+ (tag_name) @_tag (#eq? @_tag "@var")
+ (variable_name) @variable
+)
+(tag
+ (tag_name) @_tag (#eq? @_tag "@method")
+ (name) @method
+)
+(parameter
+ (variable_name) @parameter)
+(type_list
+ [
+ (array_type)
+ (primitive_type)
+ (named_type)
+ ] @type)
+(tag
+ (description (text) @text))
+(tag
+ [
+ (author_name)
+ (version)
+ ] @text)
+(tag
+ (email_address) @text.uri
+)
+
+[
+ "$"
+ ">"
+ "<"
+ "|"
+]@keyword