summaryrefslogtreecommitdiff
path: root/syntaxes
diff options
context:
space:
mode:
authorbscan <10503608+bscan@users.noreply.github.com>2022-11-12 11:50:21 -0500
committerbscan <10503608+bscan@users.noreply.github.com>2022-11-12 11:50:21 -0500
commit483e7f65b7b7147da709d27e1feabdc51c873df6 (patch)
tree1eefb03f75efc8952876c89b287e34455c7711fa /syntaxes
parent3bbf4d2687c72c1afede6e7e3c269ba1d5243234 (diff)
downloadPerlNavigator-483e7f65b7b7147da709d27e1feabdc51c873df6.zip
Syntax fixes
Diffstat (limited to 'syntaxes')
-rw-r--r--syntaxes/perl-scopes.json2
-rw-r--r--syntaxes/type-hints.json13
2 files changed, 8 insertions, 7 deletions
diff --git a/syntaxes/perl-scopes.json b/syntaxes/perl-scopes.json
index d4bc950..6c98ef3 100644
--- a/syntaxes/perl-scopes.json
+++ b/syntaxes/perl-scopes.json
@@ -46,7 +46,6 @@
{
"name": "meta.typehints.perl",
"begin": "(?<=use)\\s+(?:Type::Hints)(?=[\\s;])",
- "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])",
"patterns": [
{
"include": "#source"
@@ -66,7 +65,6 @@
{
"name": "meta.zydeco.perl",
"begin": "(?<=use)\\s+(?:Zydeco)(?=[\\s;])",
- "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])",
"patterns": [
{
"include": "#source"
diff --git a/syntaxes/type-hints.json b/syntaxes/type-hints.json
index 68b67c7..95ffb34 100644
--- a/syntaxes/type-hints.json
+++ b/syntaxes/type-hints.json
@@ -22,7 +22,7 @@
"typehints": {
"patterns": [
{
- "match": "\\b(has|private|public|readonly|lazy|protected)\\s+(\\w+)\\s*(?::([\\s\\|\\w:\\[\\]]+))?\\s*(?=[;=])",
+ "match": "\\b(has|private|public|readonly|lazy|protected|initvar)\\s+(\\w+)\\s*(?::(\\s*\\{[\\s\\|\\w:\\[\\],]+\\}|[\\s\\|\\w:\\[\\]]+))?\\s*(?=[;=])",
"captures": {
"1": {
"name": "keyword.other.attribute.typehints.perl"
@@ -53,7 +53,7 @@
}
},
{
- "match": "\\b(let)\\s+([\\$\\@\\%]\\w+)\\s*(?::([\\s\\|\\w:\\[\\]]+))?",
+ "match": "\\b(let)\\s+([\\$\\@\\%]\\w+)\\s*(?::(\\s*\\{[\\s\\|\\w:\\[\\],]+\\}|[\\s\\|\\w:\\[\\]]+))?",
"captures": {
"1": {
"name": "keyword.other.attribute.typehints.perl"
@@ -84,7 +84,7 @@
},
"patterns": [
{
- "match": "([\\$\\@\\%]\\w+)\\s*(?::([\\s\\|\\w:\\[\\]]+))?",
+ "match": "([\\$\\@\\%]\\w+)\\s*(?::(\\s*\\{[\\s\\|\\w:\\[\\],]+\\}|[\\s\\|\\w:\\[\\]]+))?",
"captures": {
"1": {
"name": "variable.other.readwrite.global.perl"
@@ -107,15 +107,18 @@
"name": "entity.name.function.perl"
}
},
- "end": "\\)",
+ "end": "\\)\\s*(?::(\\s*\\{[\\s\\|\\w:\\[\\],]+\\}|[\\s\\|\\w:\\[\\]]+))?",
"endCaptures": {
"0": {
"name": "punctuation.definition.block.ts"
+ },
+ "1": {
+ "name": "support.type.typehints.perl"
}
},
"patterns": [
{
- "match": "([\\$\\@\\%]\\w+)\\s*(?::([\\s\\|\\w:\\[\\]]+))?",
+ "match": "([\\$\\@\\%]\\w+)\\s*(?::(\\s*\\{[\\s\\|\\w:\\[\\],]+\\}|[\\s\\|\\w:\\[\\]]+))?",
"captures": {
"1": {
"name": "variable.other.readwrite.global.perl"