diff options
author | bscan <10503608+bscan@users.noreply.github.com> | 2022-11-09 20:37:26 -0500 |
---|---|---|
committer | bscan <10503608+bscan@users.noreply.github.com> | 2022-11-09 20:37:26 -0500 |
commit | ec768020b56f0d30797550d8cdf2e707ba892fbd (patch) | |
tree | 15e0105a6e31b4132db1351dabf363ada5743273 /syntaxes | |
parent | e40eb56c3121e198f5aa0efefadc2e4a4d0fb8ea (diff) | |
download | PerlNavigator-ec768020b56f0d30797550d8cdf2e707ba892fbd.zip |
Initial commit of syntax highlighting
Diffstat (limited to 'syntaxes')
-rw-r--r-- | syntaxes/async.json | 28 | ||||
-rw-r--r-- | syntaxes/mars.json | 61 | ||||
-rw-r--r-- | syntaxes/moops.json | 69 | ||||
-rw-r--r-- | syntaxes/moose.json | 75 | ||||
-rw-r--r-- | syntaxes/object-pad.json | 72 | ||||
-rw-r--r-- | syntaxes/perl-scopes.json | 99 | ||||
-rw-r--r-- | syntaxes/type-hints.json | 131 | ||||
-rw-r--r-- | syntaxes/zydeco.json | 110 |
8 files changed, 645 insertions, 0 deletions
diff --git a/syntaxes/async.json b/syntaxes/async.json new file mode 100644 index 0000000..4e0408c --- /dev/null +++ b/syntaxes/async.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "information_for_contributors": [ + "To modify the grammar, simply update the JSON run the extension. This file detects scope (e.g. is Moo active) and the individual files define the syntax of the scope" + ], + "name": "async", + "scopeName": "source.perl.package.async", + "injectionSelector": "L:meta.async.perl -comment -string -text", + "patterns": [ + { + "include": "#async" + } + ], + "repository": { + "async": { + "patterns": [ + { + "match": "\\b(await)\\b", + "name": "keyword.control.async" + }, + { + "match": "\\b(async)\\b", + "name": "storage.type.sub.async" + } + ] + } + } +}
\ No newline at end of file diff --git a/syntaxes/mars.json b/syntaxes/mars.json new file mode 100644 index 0000000..f868a0b --- /dev/null +++ b/syntaxes/mars.json @@ -0,0 +1,61 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "information_for_contributors": [ + "To modify the grammar, simply update the JSON run the extension. This file detects scope (e.g. is Moo active) and the individual files define the syntax of the scope" + ], + "name": "mars", + "scopeName": "source.perl.package.mars", + "injectionSelector": "L:meta.mars.perl -comment -string -text", + "patterns": [ + { + "include": "#mars" + } + ], + "repository": { + "mars": { + "patterns": [ + { + "match": "\\b(attr)\\s+['\"](\\w+)['\"]\\s*\\;", + "captures": { + "1": { + "name": "keyword.other.attribute.mars.perl" + }, + "2": { + "name": "variable.other.readwrite.global.perl" + } + } + }, + { + "match": "\\b(class|role|base|mixin|with|test|from)\\s+['\"]?(\\w+)['\"]?(?=[\\s;\\(\\{])", + "captures": { + "1": { + "name": "keyword.control.mars" + }, + "2": { + "name": "entity.name.type.class.mars" + } + } + }, + { + "match": "\\b(method)\\s+([\\w]+)\\b", + "captures": { + "1": { + "name": "storage.type.sub.perl" + }, + "2": { + "name": "entity.name.function.perl" + } + } + }, + { + "match": "\\b(accessor|builder|clearer|coerce|default|does|is|isa|predicate|required|trigger)\\s*(?==>)", + "name": "constant.language.has.key.mars.perl" + }, + { + "match": "\\b(true|false)\\b", + "name": "support.function.mars.perl" + } + ] + } + } +}
\ No newline at end of file diff --git a/syntaxes/moops.json b/syntaxes/moops.json new file mode 100644 index 0000000..cdb0bfc --- /dev/null +++ b/syntaxes/moops.json @@ -0,0 +1,69 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "information_for_contributors": [ + "To modify the grammar, simply update the JSON run the extension. This file detects scope (e.g. is Moo active) and the individual files define the syntax of the scope" + ], + "name": "moops", + "scopeName": "source.perl.package.moops", + "injectionSelector": "L:meta.moops.perl -comment -string -text", + "patterns": [ + { + "include": "#moops" + } + ], + "repository": { + "moops": { + "patterns": [ + { + "match": "\\b(has)(?:([\\w]+))?\\b", + "captures": { + "1": { + "name": "keyword.other.attribute.moops.perl" + }, + "2": { + "name": "variable.other.readwrite.global.perl" + } + } + }, + { + "match": "\\b(class|role)\\s+([\\w:]+)\\b", + "captures": { + "1": { + "name": "keyword.control.moops" + }, + "2": { + "name": "entity.name.type.class.moops" + } + } + }, + { + "match": "\\b(extends|with)\\b\\s+(?:([\\w::]+))?\\b", + "captures": { + "1": { + "name": "keyword.control.import.moops.perl" + }, + "2": { + "name": "entity.name.class.moops.perl" + } + }, + "name": "keyword.control.moops.perl" + }, + { + "match": "\\b(method)\\s+([\\w]+)\\b", + "captures": { + "1": { + "name": "storage.type.sub.perl" + }, + "2": { + "name": "entity.name.function.perl" + } + } + }, + { + "match": "\\b(accessor|builder|clearer|coerce|default|does|is|isa|predicate|required|trigger)\\s*(?==>)", + "name": "constant.language.has.key.moops.perl" + } + ] + } + } +}
\ No newline at end of file diff --git a/syntaxes/moose.json b/syntaxes/moose.json new file mode 100644 index 0000000..cbafb3b --- /dev/null +++ b/syntaxes/moose.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "information_for_contributors": [ + "To modify the grammar, simply update the JSON run the extension. This file detects scope (e.g. is Moo active) and the individual files define the syntax of the scope", + "Code used under MIT license from https://github.com/torrentalle/vscode-perl-moose" + ], + "name": "Moose", + "scopeName": "source.perl.package.moose", + "injectionSelector": "L:meta.moose.perl -comment -string -text", + "patterns": [ + { + "include": "#moose" + } + ], + "repository": { + "moose": { + "patterns": [ + { + "match": "\\s*(-meta_name)\\b", + "captures": { + "1": { + "name": "entity.other.attribute-name.moose.perl" + } + }, + "name": "constant.language.type.modifier.moose.perl" + }, + { + "match": "\\b(extends|with)\\b(?:([-a-zA-Z0-9_]+))?\\s*", + "captures": { + "1": { + "name": "keyword.control.import.moose.perl" + }, + "2": { + "name": "entity.name.class.moose.perl" + } + }, + "name": "keyword.control.moose.perl" + }, + { + "match": "\\b(has)(?:\\s+(\\+|)([-a-zA-Z0-9_]+))?\\s*", + "captures": { + "1": { + "name": "keyword.other.attribute.moose.perl" + }, + "2": { + "name": "storage.modifier.attribute.moose.perl" + }, + "3": { + "name": "entity.other.attribute-name.moose.perl" + } + } + }, + { + "match": "\\b(auto_deref|builder|clearer|coerce|default|documentation|does|handles|init_arg|is|isa|lazy|lazy_build|metaclass|predicate|reader|required|role_attribute|traits|trigger|weak_ref|writer)\\s*(?==>)", + "name": "constant.language.has.key.moose.perl" + }, + { + "match": "\\b(before|after|around|override|augment)(?:\\s+([-a-zA-Z0-9_]+))?", + "captures": { + "1": { + "name": "keyword.other.attribute.moose.perl" + }, + "2": { + "name": "entity.name.function.perl" + } + } + }, + { + "match": "\\b(blessed|confess|inner|meta|super)\\b", + "name": "support.function.moose.perl" + } + ] + } + } +}
\ No newline at end of file diff --git a/syntaxes/object-pad.json b/syntaxes/object-pad.json new file mode 100644 index 0000000..09221de --- /dev/null +++ b/syntaxes/object-pad.json @@ -0,0 +1,72 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "information_for_contributors": [ + "To modify the grammar, simply update the JSON run the extension. This file detects scope (e.g. is Moo active) and the individual files define the syntax of the scope" + ], + "name": "objectpad", + "scopeName": "source.perl.package.objectpad", + "injectionSelector": "L:meta.objectpad.perl -comment -string -text", + "patterns": [ + { + "include": "#objectpad" + } + ], + "repository": { + "objectpad": { + "patterns": [ + { + "match": "\\b(has|field)\\s+([\\$\\@\\%]\\w+)\\b", + "captures": { + "1": { + "name": "keyword.other.attribute.objectpad.perl" + }, + "2": { + "name": "variable.other.readwrite.global.perl" + } + } + }, + { + "match": "\\b(class|role)\\s+([\\w:]+)\\b", + "captures": { + "1": { + "name": "keyword.control.objectpad" + }, + "2": { + "name": "entity.name.type.class.objectpad" + } + } + }, + { + "match": "\\b(method)\\s+([\\w]+)\\b", + "captures": { + "1": { + "name": "storage.type.sub.perl" + }, + "2": { + "name": "entity.name.function.perl" + } + } + }, + { + "match": "\\b(method)\\s+(\\$[\\w]+)\\b", + "captures": { + "1": { + "name": "storage.type.sub.perl" + }, + "2": { + "name": "variable.other.method" + } + } + }, + { + "match": "\\b(BUILD|ADJUST|ADJUSTPARAMS|DESTRUCT)\\b", + "captures": { + "1": { + "name": "entity.name.function.perl" + } + } + } + ] + } + } +}
\ No newline at end of file diff --git a/syntaxes/perl-scopes.json b/syntaxes/perl-scopes.json new file mode 100644 index 0000000..d4bc950 --- /dev/null +++ b/syntaxes/perl-scopes.json @@ -0,0 +1,99 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "information_for_contributors": [ + "To modify the grammar, simply update the JSON run the extension. This file detects scope (e.g. is Moo active) and the individual files define the syntax of the scope" + ], + "scopeName": "source.perl.frameworks", + "injectionSelector": "L:source.perl -comment -string -text", + "patterns": [ + { + "include": "#scope_defs" + } + ], + "repository": { + "source": { + "patterns": [ + { + "include": "$self" + }, + { + "include": "source.perl" + } + ] + }, + "scope_defs": { + "patterns": [ + { + "name": "meta.moose.perl", + "begin": "(?<=use)\\s+(?:Moose|Mouse|Moo)(?=[\\s;])", + "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])", + "patterns": [ + { + "include": "#source" + } + ] + }, + { + "name": "meta.objectpad.perl", + "begin": "(?<=use)\\s+(?:Object::Pad)(?=[\\s;])", + "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])", + "patterns": [ + { + "include": "#source" + } + ] + }, + { + "name": "meta.typehints.perl", + "begin": "(?<=use)\\s+(?:Type::Hints)(?=[\\s;])", + "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])", + "patterns": [ + { + "include": "#source" + } + ] + }, + { + "name": "meta.moops.perl", + "begin": "(?<=use)\\s+(?:Moops)(?=[\\s;])", + "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])", + "patterns": [ + { + "include": "#source" + } + ] + }, + { + "name": "meta.zydeco.perl", + "begin": "(?<=use)\\s+(?:Zydeco)(?=[\\s;])", + "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])", + "patterns": [ + { + "include": "#source" + } + ] + }, + { + "name": "meta.mars.perl", + "begin": "(?<=use)\\s+(?:Mars|Venus)(?=[\\s;:])", + "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])", + "patterns": [ + { + "include": "#source" + } + ] + }, + { + "name": "meta.async.perl", + "begin": "(?<=use)\\s+(?:Future::AsyncAwait|Mojo::AsyncAwait|Mojo::Base.*-async_await.*)(?=[\\s;])", + "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])", + "patterns": [ + { + "include": "#source" + } + ] + } + ] + } + } +}
\ No newline at end of file diff --git a/syntaxes/type-hints.json b/syntaxes/type-hints.json new file mode 100644 index 0000000..68b67c7 --- /dev/null +++ b/syntaxes/type-hints.json @@ -0,0 +1,131 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "information_for_contributors": [ + "To modify the grammar, simply update the JSON run the extension. This file detects scope (e.g. is Moo active) and the individual files define the syntax of the scope", + "Code used under MIT license from https://github.com/torrentalle/vscode-perl-typehints" + ], + "name": "typehints", + "scopeName": "source.perl.package.typehints", + "injectionSelector": "L:meta.typehints.perl -comment -string -text", + "patterns": [ + { + "include": "#typehints" + }, + { + "include": "#letblocks" + }, + { + "include": "#defblocks" + } + ], + "repository": { + "typehints": { + "patterns": [ + { + "match": "\\b(has|private|public|readonly|lazy|protected)\\s+(\\w+)\\s*(?::([\\s\\|\\w:\\[\\]]+))?\\s*(?=[;=])", + "captures": { + "1": { + "name": "keyword.other.attribute.typehints.perl" + }, + "2": { + "name": "entity.other.attribute-name.typehints.perl" + }, + "3": { + "name": "support.type.typehints.perl" + } + } + }, + { + "match": "\\b(class)\\s+(\\w+)\\b(?:\\s+(extends)\\s+(\\w+)\\b)?", + "captures": { + "1": { + "name": "keyword.other.attribute.typehints.perl" + }, + "2": { + "name": "entity.name.type.class" + }, + "3": { + "name": "storage.modifier.typehints.perl" + }, + "4": { + "name": "entity.name.type.class" + } + } + }, + { + "match": "\\b(let)\\s+([\\$\\@\\%]\\w+)\\s*(?::([\\s\\|\\w:\\[\\]]+))?", + "captures": { + "1": { + "name": "keyword.other.attribute.typehints.perl" + }, + "2": { + "name": "variable.other.readwrite.global.perl" + }, + "3": { + "name": "support.type.typehints.perl" + } + } + } + ] + }, + "letblocks": { + "name": "let.block.typehint", + "begin": "\\b(let)\\s+\\(", + "beginCaptures": { + "0": { + "name": "keyword.other.attribute.typehints.perl" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "match": "([\\$\\@\\%]\\w+)\\s*(?::([\\s\\|\\w:\\[\\]]+))?", + "captures": { + "1": { + "name": "variable.other.readwrite.global.perl" + }, + "2": { + "name": "support.type.typehints.perl" + } + } + } + ] + }, + "defblocks": { + "name": "def.block.typehint", + "begin": "\\b(def)\\s+(\\w+)\\s*\\(", + "beginCaptures": { + "1": { + "name": "storage.type.sub.perl" + }, + "2": { + "name": "entity.name.function.perl" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.block.ts" + } + }, + "patterns": [ + { + "match": "([\\$\\@\\%]\\w+)\\s*(?::([\\s\\|\\w:\\[\\]]+))?", + "captures": { + "1": { + "name": "variable.other.readwrite.global.perl" + }, + "2": { + "name": "support.type.typehints.perl" + } + } + } + ] + } + } +}
\ No newline at end of file diff --git a/syntaxes/zydeco.json b/syntaxes/zydeco.json new file mode 100644 index 0000000..ad651e1 --- /dev/null +++ b/syntaxes/zydeco.json @@ -0,0 +1,110 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "information_for_contributors": [ + "To modify the grammar, simply update the JSON run the extension. This file detects scope (e.g. is Moo active) and the individual files define the syntax of the scope" + ], + "name": "zydeco", + "scopeName": "source.perl.package.zydeco", + "injectionSelector": "L:meta.zydeco.perl -comment -string -text", + "patterns": [ + { + "include": "#zydeco" + } + ], + "repository": { + "zydeco": { + "patterns": [ + { + "match": "\\b(has|field|param|requires|constant|include)\\s+(?:(\\+?\\$?[\\w]+!?)|\\{)\\s*", + "captures": { + "1": { + "name": "keyword.other.attribute.zydeco.perl" + }, + "2": { + "name": "variable.other.readwrite.global.perl" + } + } + }, + { + "match": "\\b((?:abstract\\s+)?class|role|interface)\\s+([\\w:]+)\\b", + "captures": { + "1": { + "name": "keyword.control.zydeco" + }, + "2": { + "name": "entity.name.type.class.zydeco" + } + } + }, + { + "match": "\\b(extends|with)\\b\\s+(?:([\\w::\\?]+))?(?:\\s*,\\s*([\\w::\\?]+))?(?=[\\s;\\b,\\(])", + "captures": { + "1": { + "name": "keyword.control.import.zydeco.perl" + }, + "2": { + "name": "entity.name.class.zydeco.perl" + }, + "3": { + "name": "entity.name.class.zydeco.perl" + } + }, + "name": "keyword.control.zydeco.perl" + }, + { + "match": "\\b(toolkit)\\b\\s+(?:([\\w::]+))?\\b", + "captures": { + "1": { + "name": "keyword.control.import.zydeco.perl" + }, + "2": { + "name": "entity.name.class.zydeco.perl" + } + }, + "name": "keyword.control.zydeco.perl" + }, + { + "match": "\\b((?:multi\\s+)?(?:method|symmethod|factory))\\s+([\\w]+)\\b", + "captures": { + "1": { + "name": "storage.type.sub.perl" + }, + "2": { + "name": "entity.name.function.perl" + } + } + }, + { + "match": "\\b((?:multi\\s+)?(?:method|symmethod))\\s+(\\$[\\w]+)\\b", + "captures": { + "1": { + "name": "storage.type.sub.perl" + }, + "2": { + "name": "variable.other.method" + } + } + }, + { + "match": "\\b(before|around|after)\\s+([\\w]+)\\b", + "captures": { + "1": { + "name": "storage.type.sub.perl" + }, + "2": { + "name": "entity.name.function.perl" + } + } + }, + { + "match": "\\b(accessor|builder|clearer|coerce|default|does|is|isa|predicate|required|trigger|type)\\s*(?==>)", + "name": "constant.language.has.key.zydeco.perl" + }, + { + "match": "\\b(coerce|begin|end|type_name|version|authority|overload|before_apply|after_apply)\\b", + "name": "support.function.moose.perl" + } + ] + } + } +}
\ No newline at end of file |