summaryrefslogtreecommitdiff
path: root/syntaxes
diff options
context:
space:
mode:
authorbscan <10503608+bscan@users.noreply.github.com>2023-08-24 22:01:04 -0400
committerbscan <10503608+bscan@users.noreply.github.com>2023-08-24 22:01:04 -0400
commit09d325e30c8d9c7e278f78b4e5e0964d7ae9ea73 (patch)
tree33b4329015c399c3ace2ba6bf82093c1847450d5 /syntaxes
parent7e01557009abb8f15b40a1e97ada75cafd4d737e (diff)
downloadPerlNavigator-09d325e30c8d9c7e278f78b4e5e0964d7ae9ea73.zip
Dancer support for syntax highlighting and tags. #84
Diffstat (limited to 'syntaxes')
-rw-r--r--syntaxes/dancer.json47
-rw-r--r--syntaxes/perl-scopes.json9
2 files changed, 56 insertions, 0 deletions
diff --git a/syntaxes/dancer.json b/syntaxes/dancer.json
new file mode 100644
index 0000000..fb08ca2
--- /dev/null
+++ b/syntaxes/dancer.json
@@ -0,0 +1,47 @@
+{
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
+ "information_for_contributors": [
+ "This provides keywords for Dancer and Dancer2, with a focus on Dancer2"
+ ],
+ "name": "dancer",
+ "scopeName": "source.perl.package.dancer",
+ "injectionSelector": "L:meta.dancer.perl -comment -string -text",
+ "patterns": [
+ {
+ "include": "#dancer"
+ }
+ ],
+ "repository": {
+ "dancer": {
+ "patterns": [
+ {
+ "match": "^\\s*\\b(hook)\\s+(\\w+)\\s+(?==>\\s*sub\\b)",
+ "captures": {
+ "1": {
+ "name": "keyword.other.attribute.dancer.perl"
+ },
+ "2": {
+ "name": "entity.name.function.dancer.perl"
+ }
+ }
+ },
+ {
+ "match": "^\\s*\\b(get|any|post|put|delete|hook)(?=.*=>\\s*sub\\b)",
+ "captures": {
+ "1": {
+ "name": "keyword.other.attribute.dancer.perl"
+ }
+ }
+ },
+ {
+ "match": "^\\s*\\b(set)\\s+(?=['\"]\\w+['\"]\\s*=>)",
+ "captures": {
+ "1": {
+ "name": "keyword.other.attribute.dancer.perl"
+ }
+ }
+ }
+ ]
+ }
+ }
+} \ No newline at end of file
diff --git a/syntaxes/perl-scopes.json b/syntaxes/perl-scopes.json
index c10afb3..9a75ed4 100644
--- a/syntaxes/perl-scopes.json
+++ b/syntaxes/perl-scopes.json
@@ -181,6 +181,15 @@
"include": "#source"
}
]
+ },
+ {
+ "name": "meta.dancer.perl",
+ "begin": "(?<=use)\\s+(?:Dancer2?)(?=[\\s;])",
+ "patterns": [
+ {
+ "include": "#source"
+ }
+ ]
}
]
}