-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrhelppages.sublime-syntax
More file actions
80 lines (78 loc) · 2.27 KB
/
rhelppages.sublime-syntax
File metadata and controls
80 lines (78 loc) · 2.27 KB
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
%YAML 1.2
---
# https://www.sublimetext.com/docs/syntax.html
# https://raw.githubusercontent.com/kkos/oniguruma/v6.9.1/doc/RE
# https://www.sublimetext.com/docs/scope_naming.html#alphabetical-reference
name: RhelpPages
file_extensions:
- rhelp
first_line_match: '.*R Documentation$'
scope: source.rhelp
contexts:
main:
- match: ^\s*\b(.*)\b\s+\b(?:package[:])?(.*)\b\s+(R Documentation)$
captures:
1: markup.bold.rhelp
2: markup.bold.rhelp
3: markup.bold.rhelp
push:
- meta_content_scope: entity.name.tag.rhelp
- match: (?=^[_].D[_].e[_].s.*)
pop: true
- match: ^([_].U[_].s[_].a[_].g[_].e)(:)
captures:
1: markup.bold.rhelp
2: keyword.operator.rhelp
push:
- meta_content_scope: source.r
- match: (?=^[_].\S[_].\S[_].\S.*)
pop: true
- include: scope:source.r
- match: ^([_].A[_].r[_].g[_].u[_].m[_].e[_].n[_].t[_].s)(:)
captures:
1: markup.bold.help
2: keyword.operator.rhelp
push:
- match: ^(?=^[_].\S[_].\S[_].\S.*)
pop: true
- match: ^\s*((?:(?:,\s)?[\w.]+)+)(:)(?=\s+\S+)
captures:
1: storage.type.rhelp
2: keyword.operator.rhelp
push:
- match: ^(?=^[_].\S[_].\S[_].\S.*)
pop: true
- match: ^\s*$
pop: true
- include: ticks
- include: ticks
- match: ^([_].V[_].a[_].l[_].u[_].e)(:)
captures:
1: markup.bold.help
2: keyword.operator.rhelp
push:
- match: ^(?=^[_].\S[_].\S[_].\S.*)
pop: true
- match: ^\s*(\b(?:(?:,[\s])?\w[\w.]*)*\b|[.][.][.])(:)(?=\s+\S+)
captures:
1: storage.type.rhelp
2: keyword.operator.rhelp
- include: ticks
- match: ^([_].E[_].x[_].a[_].m[_].p[_].l[_].e[_].s)(:)
captures:
1: markup.bold.rhelp
2: keyword.operator.rhelp
push:
- meta_content_scope: source.r
- include: scope:source.r
- match: ^([_].*)(:)
captures:
1: markup.bold.rhelp
2: keyword.operator.rhelp
- include: ticks
ticks:
- match: '\u2018'
push:
- meta_content_scope: entity.name.tag.rhelp
- match: '\u2019'
pop: true