-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathsource.mermaid.sankey.js
More file actions
119 lines (117 loc) · 3.42 KB
/
source.mermaid.sankey.js
File metadata and controls
119 lines (117 loc) · 3.42 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
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
111
112
113
114
115
116
117
118
119
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/Alhadis/language-mermaid>
// and licensed `isc`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
dependencies: ['source.mermaid'],
extensions: [],
names: [],
patterns: [{include: '#main'}],
repository: {
line: {
begin: '^\\s*(?=[^\\s,])',
end: '(?=\\s*$)',
name: 'meta.record.mermaid',
patterns: [
{
begin: '\\G[ \\t]*',
end: '[ \\t]*((,))',
endCaptures: {
1: {name: 'punctuation.delimiter.comma.mermaid'},
2: {name: 'sublimelinter.gutter-mark'}
},
name: 'meta.column.1.mermaid',
patterns: [
{
applyEndPatternLast: true,
begin: '\\G(?=")',
end: '(?!\\G)',
name: 'entity.name.tag.source.quoted.mermaid',
patterns: [{include: '#string'}]
},
{
begin: '\\G(?=[^,\\s])',
end: '(?=\\s*(?:,|$))',
name: 'entity.name.tag.source.unquoted.mermaid'
}
]
},
{
applyEndPatternLast: true,
begin: '(?<=,)',
end: '(?!\\G)',
patterns: [
{
begin: '\\G[ \\t]*',
end: '[ \\t]*((,))',
endCaptures: {
1: {name: 'punctuation.delimiter.comma.mermaid'},
2: {name: 'sublimelinter.gutter-mark'}
},
name: 'meta.column.2.mermaid',
patterns: [
{
begin: '\\G(?=")',
end: '(?!\\G)',
name: 'entity.name.target.quoted.mermaid',
patterns: [{include: '#string'}]
},
{
begin: '\\G(?=[^,\\s])',
end: '(?=\\s*(?:,|$))',
name: 'entity.name.target.unquoted.mermaid'
}
]
},
{
begin: '(?<=,)[ \\t]*',
end: '[ \\t]*(?=$|,)',
name: 'meta.column.3.mermaid',
patterns: [
{
begin: '\\G(?=")',
end: '(?!\\G)',
name: 'constant.numeric.data.quoted.mermaid',
patterns: [{include: '#string'}]
},
{
begin: '\\G(?=[^,\\s])',
end: '(?=\\s*(?:,|$))',
name: 'constant.numeric.data.unquoted.mermaid'
}
]
}
]
}
]
},
main: {
patterns: [
{include: 'source.mermaid#a11y'},
{include: 'source.mermaid#directive'},
{include: 'source.mermaid#comment'},
{include: '#line'}
]
},
string: {
begin: '\\G(")',
beginCaptures: {
0: {name: 'punctuation.definition.string.begin.mermaid'},
1: {name: 'brackethighlighter.quote'}
},
end: '(")(?!")',
endCaptures: {
0: {name: 'punctuation.definition.string.end.mermaid'},
1: {name: 'brackethighlighter.quote'}
},
patterns: [{match: '""', name: 'constant.character.escape.quote.mermaid'}]
}
},
scopeName: 'source.mermaid.sankey'
}
export default grammar