-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathsource.mermaid.user-journey.js
73 lines (71 loc) · 2.27 KB
/
source.mermaid.user-journey.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// 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: '#title'},
{include: '#section'}
]
},
section: {
begin: '(?i)section(?=$|\\s)[ \\t]*',
beginCaptures: {0: {name: 'storage.type.section.mermaid'}},
end: '(?=\\s*section(?:$|\\s))|(?=^[ \\t]*(?:`{3,}|~{3,})\\s*$)',
name: 'meta.section.mermaid',
patterns: [
{
begin: '\\G(?=\\S)',
end: '(?=\\s*$)',
name: 'string.unquoted.section-description.mermaid',
patterns: [{include: 'source.mermaid#entity'}]
},
{include: 'source.mermaid#a11y'},
{include: 'source.mermaid#directive'},
{include: 'source.mermaid#comment'},
{include: '#task'}
]
},
task: {
begin:
'(?x)\n((?=\\S)(?:[^:%]|%(?!%))+?)\n\\s* (:) \\s* ([-+]?\\d+(?:\\.\\d+)?)?\n\\s* (:) [ \\t]*',
beginCaptures: {
1: {name: 'entity.name.task.mermaid'},
2: {patterns: [{include: 'source.mermaid#colon'}]},
3: {name: 'constant.numeric.decimal.score.mermaid'},
4: {patterns: [{include: 'source.mermaid#colon'}]}
},
contentName: 'meta.actors.mermaid',
end: '(?=\\s*$)',
name: 'meta.task.mermaid',
patterns: [
{match: '(?=\\S)[^,\\r\\n]+', name: 'variable.parameter.actor.mermaid'},
{include: 'source.mermaid#comma'}
]
},
title: {
begin: '(?i)title(?=$|\\s)[ \\t]*',
beginCaptures: {0: {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.user-journey'
}
export default grammar