-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
source.mermaid.pie-chart.js
54 lines (52 loc) · 1.69 KB
/
source.mermaid.pie-chart.js
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
// 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: {
main: {
patterns: [
{include: 'source.mermaid#a11y'},
{include: 'source.mermaid#directive'},
{include: 'source.mermaid#comment'},
{include: '#show-data'},
{include: '#title'},
{include: '#slice'}
]
},
'show-data': {
captures: {1: {name: 'keyword.operator.show-data.mermaid'}},
match: '(?i)(?:\\G|(?<=pie))\\s+(showData)(?=$|\\s)'
},
slice: {
captures: {
1: {name: 'string.quoted.double.data-key.mermaid'},
2: {patterns: [{include: 'source.mermaid#entity'}]},
4: {name: 'punctuation.definition.string.end.mermaid'},
5: {patterns: [{include: 'source.mermaid#colon'}]},
6: {name: 'constant.numeric.decimal.data-value.mermaid'}
},
match: '^\\s*((")([^"]*)("))\\s*(:)[ \\t]*(?:([-+]?\\d+(?:\\.\\d+)?))?',
name: 'meta.data-set.mermaid'
},
title: {
begin: '(?i)(?:^|\\G|(?<=\\s))\\s*(title)(?=$|\\s)[ \\t]*',
beginCaptures: {1: {name: 'storage.type.title.mermaid'}},
contentName: 'string.unquoted.diagram-title.mermaid',
end: '(?=\\s*$)',
name: 'meta.title.mermaid',
patterns: [{include: 'source.mermaid#entity'}]
}
},
scopeName: 'source.mermaid.pie-chart'
}
export default grammar