-
Notifications
You must be signed in to change notification settings - Fork 2
/
perl-moose.tmLanguage.yaml
77 lines (75 loc) · 2.58 KB
/
perl-moose.tmLanguage.yaml
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
$schema: 'https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json'
information_for_contributors:
- >-
To modify Perl Moose Textmate grammar you mus edit the file
src/syntaxes/perl-moose.tmLanguage.yaml then, run following
command to generate extension source code.
- npm run generate:syntax
scopeName: source.perl.moose
injectionSelector: L:source.perl -comment -string -text
patterns:
- include: '#moose_packages'
repository:
source:
patterns:
- include: '$self'
- include: 'source.perl'
moose_packages:
patterns:
- name: meta.moose.perl
begin: (?<=use)\s+(Moose|Mouse|Moo)(?=[\s;])
beginCaptures:
'1':
name: entity.name.class.moose.perl
end: (\b)(?=^\s*package\s|no\s+\1[\s;])
patterns:
- include: '#source'
- name: meta.moose.deprecated.perl
match: (?<=use)\s+(Moose::Deprecated)[\s;]*(-api-version)?
captures:
'1':
name: entity.name.type.class.perl
'2':
name: constant.language.type.modifier.moose.perl
- name: meta.exporter.moose.perl
begin: (?<=use)\s+((?:Moose|Mouse)::Exporter)(?=[\s;])
beginCaptures:
'1':
name: entity.name.class.moose.perl
end: (\b)(?=^\s*package\s|no\s+\1[\s;])
patterns:
- include: '#source'
- name: support.function.moose.perl
match: (?<=->)(new|BUILDARGS|does|DOES|isa|dump|DESTROY)\b
- name: meta.role.moose.perl
begin: (?<=use)\s+((?:Moose|Mouse|Moo)::Role)(?=[\s;])
beginCaptures:
'1':
name: entity.name.class.moose.perl
end: (\b)(?=^\s*package\s|no\s+\1[\s;])
patterns:
- include: '#source'
- name: meta.util.moose.perl
begin: (?<=use)\s+((?:Moose|Mouse|Moo)::Util)(?=[\s;])
beginCaptures:
'1':
name: entity.name.class.moose.perl
end: (\b)(?=^\s*package\s|no\s+\1[\s;])
patterns:
- include: '#source'
- name: meta.type.constraint.moose.perl
begin: (?<=use)\s+((?:Moose|Mouse)::Util::TypeConstraints)(?=[\s;])
beginCaptures:
'1':
name: entity.name.class.moose.perl
end: (\b)(?=^\s*package\s|no\s+\1[\s;])
patterns:
- include: '#source'
- name: meta.test.moose.perl
begin: (?<=use)\s+(Test::(?:Moose|Mouse))(?=[\s;])
beginCaptures:
'1':
name: entity.name.class.moose.perl
end: (\b)(?=^\s*package\s|no\s+\1[\s;])
patterns:
- include: '#source'