summaryrefslogtreecommitdiff
path: root/syntaxes/zydeco.json
blob: beaaef7ed15bd3d1d3253d428cb5f9c27a079672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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.zydeco.perl"
                        }
                    }
                },
                {
                    "match": "\\b((?:abstract\\s+)?class|role|interface)\\s+([\\w:]+)\\b",
                    "captures": {
                        "1": {
                            "name": "storage.type.class.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"
                }
            ]
        }
    }
}