summaryrefslogtreecommitdiff
path: root/syntaxes
diff options
context:
space:
mode:
authorbscan <10503608+bscan@users.noreply.github.com>2022-11-13 21:07:32 -0500
committerbscan <10503608+bscan@users.noreply.github.com>2022-11-13 21:07:32 -0500
commit10938c6d50eb342e1989d51a09b4fba8d023df57 (patch)
tree78f13045f719c6a7246b08d81ffdc84826b74e58 /syntaxes
parent7a2398129830b0f6826244f83bd3769514767b9d (diff)
downloadPerlNavigator-10938c6d50eb342e1989d51a09b4fba8d023df57.zip
Adding support for Function::Parameters
Diffstat (limited to 'syntaxes')
-rw-r--r--syntaxes/funcparams.json31
-rw-r--r--syntaxes/perl-scopes.json9
2 files changed, 40 insertions, 0 deletions
diff --git a/syntaxes/funcparams.json b/syntaxes/funcparams.json
new file mode 100644
index 0000000..c7d01d1
--- /dev/null
+++ b/syntaxes/funcparams.json
@@ -0,0 +1,31 @@
+{
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
+ "information_for_contributors": [
+ "To modify the grammar, simply update the JSON run the extension."
+ ],
+ "name": "funcparams",
+ "scopeName": "source.perl.package.funcparams",
+ "injectionSelector": "L:meta.funcparams.perl -comment -string -text",
+ "patterns": [
+ {
+ "include": "#funcparams"
+ }
+ ],
+ "repository": {
+ "funcparams": {
+ "patterns": [
+ {
+ "match": "\\b(method|fun)\\s+([\\w]+)\\b",
+ "captures": {
+ "1": {
+ "name": "storage.type.sub.perl"
+ },
+ "2": {
+ "name": "entity.name.function.perl"
+ }
+ }
+ }
+ ]
+ }
+ }
+} \ No newline at end of file
diff --git a/syntaxes/perl-scopes.json b/syntaxes/perl-scopes.json
index 6c98ef3..a22250a 100644
--- a/syntaxes/perl-scopes.json
+++ b/syntaxes/perl-scopes.json
@@ -90,6 +90,15 @@
"include": "#source"
}
]
+ },
+ {
+ "name": "meta.funcparams.perl",
+ "begin": "(?<=use)\\s+(?:Function::Parameters)(?=[\\s;])",
+ "patterns": [
+ {
+ "include": "#source"
+ }
+ ]
}
]
}