@mermanjs/tree-sitter-mermaid 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +44 -0
- package/LICENSE +22 -0
- package/Makefile +80 -0
- package/README.md +201 -0
- package/THIRD_PARTY_LICENSES/mermaid/LICENSE +21 -0
- package/THIRD_PARTY_LICENSES/monaqa-tree-sitter-mermaid/LICENSE +21 -0
- package/THIRD_PARTY_LICENSES/pappasam-tree-sitter-mermaid/LICENSE +21 -0
- package/THIRD_PARTY_LICENSES/singularity-tree-sitter-mermaid/LICENSE +22 -0
- package/THIRD_PARTY_LICENSES/tree-sitter/LICENSE +21 -0
- package/THIRD_PARTY_LICENSES/zenuml-core/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.md +47 -0
- package/binding.gyp +56 -0
- package/bindings/c/tree-sitter-mermaid.pc.in +10 -0
- package/bindings/c/tree_sitter/tree-sitter-mermaid.h +16 -0
- package/bindings/node/binding.cc +25 -0
- package/bindings/node/index.d.ts +5 -0
- package/bindings/node/index.js +10 -0
- package/grammar/families/architecture.js +361 -0
- package/grammar/families/block.js +370 -0
- package/grammar/families/c4.js +394 -0
- package/grammar/families/class.js +441 -0
- package/grammar/families/cynefin.js +127 -0
- package/grammar/families/entity-relationship.js +408 -0
- package/grammar/families/event-modeling.js +307 -0
- package/grammar/families/flowchart.js +690 -0
- package/grammar/families/gantt.js +445 -0
- package/grammar/families/git-graph.js +326 -0
- package/grammar/families/info.js +77 -0
- package/grammar/families/ishikawa.js +103 -0
- package/grammar/families/journey.js +221 -0
- package/grammar/families/kanban.js +264 -0
- package/grammar/families/mindmap.js +221 -0
- package/grammar/families/packet.js +108 -0
- package/grammar/families/pie.js +118 -0
- package/grammar/families/quadrant-chart.js +385 -0
- package/grammar/families/radar.js +286 -0
- package/grammar/families/railroad-abnf.js +124 -0
- package/grammar/families/railroad-ebnf.js +179 -0
- package/grammar/families/railroad-peg.js +128 -0
- package/grammar/families/railroad-shared.js +114 -0
- package/grammar/families/railroad.js +143 -0
- package/grammar/families/requirement.js +475 -0
- package/grammar/families/sankey.js +139 -0
- package/grammar/families/sequence.js +437 -0
- package/grammar/families/state.js +400 -0
- package/grammar/families/swimlane.js +25 -0
- package/grammar/families/timeline.js +251 -0
- package/grammar/families/tree-view.js +189 -0
- package/grammar/families/treemap.js +146 -0
- package/grammar/families/venn.js +256 -0
- package/grammar/families/wardley.js +530 -0
- package/grammar/families/xy-chart.js +460 -0
- package/grammar/families/zenuml.js +725 -0
- package/grammar/shared/common.js +78 -0
- package/grammar/shared/header.js +16 -0
- package/grammar/shared/indentation.js +22 -0
- package/grammar/shared/langium.js +166 -0
- package/grammar/shared/preamble.js +26 -0
- package/grammar.js +188 -0
- package/metadata/derivations.json +519 -0
- package/metadata/provenance.json +98 -0
- package/package.json +107 -0
- package/prebuilds/darwin-arm64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/prebuilds/darwin-x64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/prebuilds/linux-x64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/prebuilds/win32-x64/@mermanjs+tree-sitter-mermaid.node +0 -0
- package/queries/helix/highlights.scm +960 -0
- package/queries/helix/indents.scm +45 -0
- package/queries/helix/injections.scm +15 -0
- package/queries/helix/locals.scm +134 -0
- package/queries/helix/textobjects.scm +264 -0
- package/queries/neovim/README.md +28 -0
- package/queries/neovim/brackets.scm +65 -0
- package/queries/neovim/folds.scm +53 -0
- package/queries/neovim/highlights.scm +121 -0
- package/queries/neovim/indents.scm +110 -0
- package/queries/neovim/injections.scm +86 -0
- package/queries/neovim/locals.scm +277 -0
- package/queries/neovim/outline.scm +117 -0
- package/queries/neovim/tags.scm +149 -0
- package/queries/neovim/textobjects.scm +97 -0
- package/queries/portable/highlights.scm +961 -0
- package/queries/portable/injections.scm +45 -0
- package/queries/portable/locals.scm +290 -0
- package/queries/portable/tags.scm +182 -0
- package/queries/zed/README.md +48 -0
- package/queries/zed/brackets.scm +111 -0
- package/queries/zed/highlights.scm +961 -0
- package/queries/zed/indents.scm +111 -0
- package/queries/zed/injections.scm +11 -0
- package/queries/zed/outline.scm +167 -0
- package/queries/zed/textobjects.scm +68 -0
- package/src/grammar.json +71138 -0
- package/src/node-types.json +34871 -0
- package/src/parser.c +321353 -0
- package/src/scanner.c +462 -0
- package/src/tree_sitter/alloc.h +54 -0
- package/src/tree_sitter/array.h +336 -0
- package/src/tree_sitter/parser.h +286 -0
- package/tree-sitter-mermaid.wasm +0 -0
- package/tree-sitter.json +40 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
// Source translation: Mermaid 11.16.1
|
|
2
|
+
// packages/mermaid/src/diagrams/gantt/parser/gantt.jison
|
|
3
|
+
// commit 7ecca0cd7f1658ef74f4e7e91f925724ef403bbf.
|
|
4
|
+
|
|
5
|
+
const diagramKeyword = ($) => field(
|
|
6
|
+
'keyword',
|
|
7
|
+
alias(token(prec(20, /gantt/i)), $.diagram_keyword),
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
const statementKeyword = ($, keyword) => field(
|
|
11
|
+
'keyword',
|
|
12
|
+
alias(keyword, $.statement_keyword),
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const taskName = ($) => field('name', choice(
|
|
16
|
+
$.gantt_task_name,
|
|
17
|
+
alias($._gantt_task_compatible_keyword, $.gantt_task_name),
|
|
18
|
+
alias($._gantt_keyword_prefixed_task_name, $.gantt_task_name),
|
|
19
|
+
));
|
|
20
|
+
|
|
21
|
+
const trailingTrivia = ($) => optional(choice(
|
|
22
|
+
$.comment,
|
|
23
|
+
$.directive,
|
|
24
|
+
alias($._gantt_hash_comment, $.comment),
|
|
25
|
+
$.gantt_semicolon_suffix,
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
const ganttRules = {
|
|
29
|
+
gantt_diagram: ($) => choice(
|
|
30
|
+
seq(
|
|
31
|
+
field('header', $.gantt_header),
|
|
32
|
+
optional(field('body', $.gantt_body)),
|
|
33
|
+
),
|
|
34
|
+
seq(
|
|
35
|
+
field('header', alias($._gantt_inline_header, $.gantt_header)),
|
|
36
|
+
field('body', $.gantt_body),
|
|
37
|
+
),
|
|
38
|
+
field('header', alias($._gantt_header_eof, $.gantt_header)),
|
|
39
|
+
),
|
|
40
|
+
|
|
41
|
+
gantt_header: ($) => prec(30, seq(
|
|
42
|
+
diagramKeyword($),
|
|
43
|
+
optional(token.immediate(/[ \t]+/)),
|
|
44
|
+
optional(choice($.comment, $.directive)),
|
|
45
|
+
field('terminator', $._line_ending),
|
|
46
|
+
)),
|
|
47
|
+
|
|
48
|
+
_gantt_inline_header: ($) => seq(
|
|
49
|
+
diagramKeyword($),
|
|
50
|
+
token.immediate(/[ \t]+/),
|
|
51
|
+
),
|
|
52
|
+
|
|
53
|
+
_gantt_header_eof: ($) => diagramKeyword($),
|
|
54
|
+
|
|
55
|
+
gantt_body: ($) => choice(
|
|
56
|
+
repeat1($._gantt_line_item),
|
|
57
|
+
seq(
|
|
58
|
+
repeat($._gantt_line_item),
|
|
59
|
+
$._gantt_eof_item,
|
|
60
|
+
),
|
|
61
|
+
),
|
|
62
|
+
|
|
63
|
+
_gantt_line_item: ($) => choice(
|
|
64
|
+
seq(
|
|
65
|
+
$._gantt_statement,
|
|
66
|
+
trailingTrivia($),
|
|
67
|
+
$._line_ending,
|
|
68
|
+
),
|
|
69
|
+
seq(choice($.comment, $.directive), $._line_ending),
|
|
70
|
+
$._blank_line,
|
|
71
|
+
),
|
|
72
|
+
|
|
73
|
+
_gantt_eof_item: ($) => choice(
|
|
74
|
+
seq($._gantt_statement, trailingTrivia($)),
|
|
75
|
+
$.comment,
|
|
76
|
+
$.directive,
|
|
77
|
+
),
|
|
78
|
+
|
|
79
|
+
_gantt_statement: ($) => choice(
|
|
80
|
+
$.gantt_title_statement,
|
|
81
|
+
$.gantt_accessibility_title_statement,
|
|
82
|
+
$.gantt_accessibility_description_statement,
|
|
83
|
+
$.gantt_setting_statement,
|
|
84
|
+
$.gantt_flag_statement,
|
|
85
|
+
$.gantt_weekday_statement,
|
|
86
|
+
$.gantt_weekend_statement,
|
|
87
|
+
$.gantt_section_statement,
|
|
88
|
+
$.gantt_click_statement,
|
|
89
|
+
$.gantt_task_statement,
|
|
90
|
+
$.gantt_incomplete_task_statement,
|
|
91
|
+
$.gantt_malformed_statement,
|
|
92
|
+
),
|
|
93
|
+
|
|
94
|
+
gantt_title_statement: ($) => prec(30, seq(
|
|
95
|
+
statementKeyword($, $._gantt_title_keyword),
|
|
96
|
+
token.immediate(/[ \t]+/),
|
|
97
|
+
field('text', $.gantt_line_text),
|
|
98
|
+
)),
|
|
99
|
+
|
|
100
|
+
gantt_accessibility_title_statement: ($) => prec(30, seq(
|
|
101
|
+
statementKeyword($, $._gantt_acc_title_keyword),
|
|
102
|
+
optional(token.immediate(/[ \t]+/)),
|
|
103
|
+
field('delimiter', token.immediate(':')),
|
|
104
|
+
optional(token.immediate(/[ \t]+/)),
|
|
105
|
+
optional(field('text', $.gantt_line_text)),
|
|
106
|
+
)),
|
|
107
|
+
|
|
108
|
+
gantt_accessibility_description_statement: ($) => prec(30, seq(
|
|
109
|
+
statementKeyword($, $._gantt_acc_descr_keyword),
|
|
110
|
+
optional(token.immediate(/[ \t]+/)),
|
|
111
|
+
choice(
|
|
112
|
+
seq(
|
|
113
|
+
field('delimiter', token.immediate(':')),
|
|
114
|
+
optional(token.immediate(/[ \t]+/)),
|
|
115
|
+
optional(field('text', $.gantt_line_text)),
|
|
116
|
+
),
|
|
117
|
+
field('description', choice(
|
|
118
|
+
$.gantt_accessibility_description_block,
|
|
119
|
+
$.gantt_unclosed_accessibility_description_block,
|
|
120
|
+
)),
|
|
121
|
+
),
|
|
122
|
+
)),
|
|
123
|
+
|
|
124
|
+
gantt_accessibility_description_block: ($) => seq(
|
|
125
|
+
repeat($._line_ending),
|
|
126
|
+
field('text', $.gantt_accessibility_block_text),
|
|
127
|
+
),
|
|
128
|
+
|
|
129
|
+
gantt_unclosed_accessibility_description_block: ($) => seq(
|
|
130
|
+
repeat($._line_ending),
|
|
131
|
+
field('text', $.gantt_unclosed_accessibility_block_text),
|
|
132
|
+
),
|
|
133
|
+
|
|
134
|
+
gantt_setting_statement: ($) => prec(30, choice(
|
|
135
|
+
seq(
|
|
136
|
+
statementKeyword($, $._gantt_setting_keyword),
|
|
137
|
+
token.immediate(/[ \t]+/),
|
|
138
|
+
field('value', $.gantt_setting_value),
|
|
139
|
+
),
|
|
140
|
+
seq(
|
|
141
|
+
statementKeyword($, $._gantt_today_marker_keyword),
|
|
142
|
+
token.immediate(/[ \t]+/),
|
|
143
|
+
field('value', $.gantt_today_marker_value),
|
|
144
|
+
),
|
|
145
|
+
)),
|
|
146
|
+
|
|
147
|
+
gantt_flag_statement: ($) => prec(
|
|
148
|
+
30,
|
|
149
|
+
statementKeyword($, $._gantt_flag_keyword),
|
|
150
|
+
),
|
|
151
|
+
|
|
152
|
+
gantt_weekday_statement: ($) => prec(30, seq(
|
|
153
|
+
statementKeyword($, $._gantt_weekday_keyword),
|
|
154
|
+
token.immediate(/[ \t]+/),
|
|
155
|
+
field('value', $.gantt_weekday),
|
|
156
|
+
)),
|
|
157
|
+
|
|
158
|
+
gantt_weekend_statement: ($) => prec(30, seq(
|
|
159
|
+
statementKeyword($, $._gantt_weekend_keyword),
|
|
160
|
+
token.immediate(/[ \t]+/),
|
|
161
|
+
field('value', $.gantt_weekend_day),
|
|
162
|
+
)),
|
|
163
|
+
|
|
164
|
+
gantt_section_statement: ($) => prec(30, seq(
|
|
165
|
+
statementKeyword($, $._gantt_section_keyword),
|
|
166
|
+
token.immediate(/[ \t]+/),
|
|
167
|
+
field('name', $.gantt_line_text),
|
|
168
|
+
)),
|
|
169
|
+
|
|
170
|
+
gantt_task_statement: ($) => prec(20, seq(
|
|
171
|
+
taskName($),
|
|
172
|
+
field('delimiter', ':'),
|
|
173
|
+
field('metadata', $.gantt_task_metadata),
|
|
174
|
+
)),
|
|
175
|
+
|
|
176
|
+
gantt_task_metadata: ($) => seq(
|
|
177
|
+
optional($._gantt_task_spacing),
|
|
178
|
+
field('item', $.gantt_task_item),
|
|
179
|
+
repeat(seq(
|
|
180
|
+
',',
|
|
181
|
+
optional($._gantt_task_spacing),
|
|
182
|
+
field('item', $.gantt_task_item),
|
|
183
|
+
)),
|
|
184
|
+
optional(','),
|
|
185
|
+
),
|
|
186
|
+
|
|
187
|
+
_gantt_task_spacing: (_) => token.immediate(prec(30, /[ \t]+/)),
|
|
188
|
+
|
|
189
|
+
gantt_task_item: ($) => choice(
|
|
190
|
+
field('status', $.gantt_task_status),
|
|
191
|
+
field('constraint', $.gantt_dependency_clause),
|
|
192
|
+
field('constraint', $.gantt_until_clause),
|
|
193
|
+
field('date', alias($._gantt_datetime, $.gantt_date)),
|
|
194
|
+
field('date', $.gantt_date),
|
|
195
|
+
field('duration', $.gantt_duration),
|
|
196
|
+
field('value', $.gantt_task_atom),
|
|
197
|
+
),
|
|
198
|
+
|
|
199
|
+
gantt_dependency_clause: ($) => seq(
|
|
200
|
+
field(
|
|
201
|
+
'keyword',
|
|
202
|
+
alias(token(prec(1, /after/i)), $.gantt_constraint_keyword),
|
|
203
|
+
),
|
|
204
|
+
token.immediate(/[ \t]+/),
|
|
205
|
+
repeat1(field('reference', $.gantt_reference)),
|
|
206
|
+
),
|
|
207
|
+
|
|
208
|
+
gantt_until_clause: ($) => seq(
|
|
209
|
+
field(
|
|
210
|
+
'keyword',
|
|
211
|
+
alias(token(prec(1, /until/i)), $.gantt_constraint_keyword),
|
|
212
|
+
),
|
|
213
|
+
token.immediate(/[ \t]+/),
|
|
214
|
+
repeat1(field('reference', $.gantt_reference)),
|
|
215
|
+
),
|
|
216
|
+
|
|
217
|
+
gantt_click_statement: ($) => prec(40, seq(
|
|
218
|
+
statementKeyword($, $._gantt_click_keyword),
|
|
219
|
+
$._gantt_required_space,
|
|
220
|
+
field('task', $.gantt_reference),
|
|
221
|
+
repeat(seq(
|
|
222
|
+
field('delimiter', token.immediate(',')),
|
|
223
|
+
field(
|
|
224
|
+
'task',
|
|
225
|
+
alias($._gantt_immediate_reference, $.gantt_reference),
|
|
226
|
+
),
|
|
227
|
+
)),
|
|
228
|
+
$._gantt_required_space,
|
|
229
|
+
choice(
|
|
230
|
+
field('action', $.gantt_href_action),
|
|
231
|
+
field('action', $.gantt_call_action),
|
|
232
|
+
field('action', $.gantt_malformed_href_action),
|
|
233
|
+
seq(
|
|
234
|
+
field('action', $.gantt_href_action),
|
|
235
|
+
$._gantt_required_space,
|
|
236
|
+
field('action', $.gantt_call_action),
|
|
237
|
+
),
|
|
238
|
+
seq(
|
|
239
|
+
field('action', $.gantt_call_action),
|
|
240
|
+
$._gantt_required_space,
|
|
241
|
+
field('action', $.gantt_href_action),
|
|
242
|
+
),
|
|
243
|
+
),
|
|
244
|
+
repeat(seq(
|
|
245
|
+
$._gantt_required_space,
|
|
246
|
+
field('tooltip', $.gantt_url),
|
|
247
|
+
)),
|
|
248
|
+
)),
|
|
249
|
+
|
|
250
|
+
gantt_href_action: ($) => seq(
|
|
251
|
+
field(
|
|
252
|
+
'keyword',
|
|
253
|
+
alias(token(prec(30, /href/i)), $.gantt_action_keyword),
|
|
254
|
+
),
|
|
255
|
+
$._gantt_required_space,
|
|
256
|
+
field('url', choice($.gantt_url, $.gantt_unclosed_url)),
|
|
257
|
+
),
|
|
258
|
+
|
|
259
|
+
// The upstream lexer requires whitespace after `href`. Preserve the action
|
|
260
|
+
// boundary explicitly when an editor temporarily removes that whitespace.
|
|
261
|
+
gantt_malformed_href_action: ($) => seq(
|
|
262
|
+
field(
|
|
263
|
+
'keyword',
|
|
264
|
+
alias(token(prec(30, /href/i)), $.gantt_action_keyword),
|
|
265
|
+
),
|
|
266
|
+
field('url', choice(
|
|
267
|
+
alias($._gantt_immediate_url, $.gantt_url),
|
|
268
|
+
alias($._gantt_immediate_unclosed_url, $.gantt_unclosed_url),
|
|
269
|
+
)),
|
|
270
|
+
),
|
|
271
|
+
|
|
272
|
+
gantt_call_action: ($) => seq(
|
|
273
|
+
field(
|
|
274
|
+
'keyword',
|
|
275
|
+
alias(token(prec(30, /call/i)), $.gantt_action_keyword),
|
|
276
|
+
),
|
|
277
|
+
$._gantt_required_space,
|
|
278
|
+
field('name', $.gantt_callback_name),
|
|
279
|
+
field('open', '('),
|
|
280
|
+
optional(field('arguments', $.gantt_callback_arguments)),
|
|
281
|
+
field('close', ')'),
|
|
282
|
+
),
|
|
283
|
+
|
|
284
|
+
gantt_incomplete_task_statement: ($) => prec(-10, seq(
|
|
285
|
+
taskName($),
|
|
286
|
+
field('delimiter', ':'),
|
|
287
|
+
)),
|
|
288
|
+
|
|
289
|
+
gantt_malformed_statement: ($) => prec(-100, field(
|
|
290
|
+
'text',
|
|
291
|
+
alias($.gantt_task_name, $.gantt_malformed_text),
|
|
292
|
+
)),
|
|
293
|
+
|
|
294
|
+
gantt_weekday: (_) => token(prec(20, choice(
|
|
295
|
+
/monday/i,
|
|
296
|
+
/tuesday/i,
|
|
297
|
+
/wednesday/i,
|
|
298
|
+
/thursday/i,
|
|
299
|
+
/friday/i,
|
|
300
|
+
/saturday/i,
|
|
301
|
+
/sunday/i,
|
|
302
|
+
))),
|
|
303
|
+
|
|
304
|
+
gantt_weekend_day: (_) => token(prec(20, choice(/friday/i, /saturday/i))),
|
|
305
|
+
|
|
306
|
+
gantt_task_status: (_) => token(prec(1, choice(
|
|
307
|
+
/active/i,
|
|
308
|
+
/done/i,
|
|
309
|
+
/crit/i,
|
|
310
|
+
/milestone/i,
|
|
311
|
+
/vert/i,
|
|
312
|
+
))),
|
|
313
|
+
|
|
314
|
+
gantt_date: (_) => token(prec(1, /[0-9]{4}-[0-9]{2}-[0-9]{2}/)),
|
|
315
|
+
|
|
316
|
+
_gantt_datetime: (_) => token(prec(
|
|
317
|
+
20,
|
|
318
|
+
/[0-9]{4}-[0-9]{2}-[0-9]{2}[ \t]+[0-9]{1,2}:[0-9]{2}(?::[0-9]{2})?(?:[ \t]+[aApP][mM])?/,
|
|
319
|
+
)),
|
|
320
|
+
|
|
321
|
+
gantt_duration: (_) => token(prec(
|
|
322
|
+
1,
|
|
323
|
+
/[0-9]+(?:\.[0-9]+)?(?:ms|[Mdhmswy])/,
|
|
324
|
+
)),
|
|
325
|
+
|
|
326
|
+
gantt_reference: (_) => token(prec(10, /[^\s,#;()"\r\n]+/)),
|
|
327
|
+
|
|
328
|
+
_gantt_immediate_reference: (_) => token.immediate(prec(
|
|
329
|
+
10,
|
|
330
|
+
/[^\s,#;()"\r\n]+/,
|
|
331
|
+
)),
|
|
332
|
+
|
|
333
|
+
gantt_task_atom: ($) => repeat1($._gantt_task_atom_part),
|
|
334
|
+
|
|
335
|
+
_gantt_task_atom_part: (_) => token(prec(1, /[^\s,#;\r\n]+/)),
|
|
336
|
+
|
|
337
|
+
gantt_callback_name: (_) => token(prec(10, /[^\s(),\r\n]+/)),
|
|
338
|
+
|
|
339
|
+
gantt_callback_arguments: (_) => token.immediate(/[^)\r\n]+/),
|
|
340
|
+
|
|
341
|
+
gantt_url: (_) => token(seq('"', /[^"\r\n]*/, '"')),
|
|
342
|
+
|
|
343
|
+
gantt_unclosed_url: (_) => token(prec(-10, seq('"', /[^"\r\n]*/))),
|
|
344
|
+
|
|
345
|
+
gantt_line_text: (_) => token(prec(-5, /[^\r\n]+/)),
|
|
346
|
+
|
|
347
|
+
gantt_setting_value: (_) => token(prec(-5, /[^#;\r\n]+/)),
|
|
348
|
+
|
|
349
|
+
gantt_today_marker_value: (_) => token(prec(-5, /[^;\r\n]+/)),
|
|
350
|
+
|
|
351
|
+
_gantt_hash_comment: (_) => token(prec(20, /#[^\r\n]*/)),
|
|
352
|
+
|
|
353
|
+
gantt_semicolon_suffix: (_) => token(prec(1, /;[^\r\n]*/)),
|
|
354
|
+
|
|
355
|
+
gantt_accessibility_block_text: (_) => token(seq('{', /[^}]*/, '}')),
|
|
356
|
+
|
|
357
|
+
// Keep recovery line-local so an unfinished block cannot absorb later tasks.
|
|
358
|
+
gantt_unclosed_accessibility_block_text: (_) => token(prec(
|
|
359
|
+
-10,
|
|
360
|
+
seq('{', /[^}\r\n]*/),
|
|
361
|
+
)),
|
|
362
|
+
|
|
363
|
+
// `%%` starts a comment even after indentation; a single leading percent
|
|
364
|
+
// remains legal task text, matching the pinned lexer.
|
|
365
|
+
gantt_task_name: (_) => token(prec(
|
|
366
|
+
5,
|
|
367
|
+
/(?:%[^%:\s\r\n]|[^%\s:\r\n])(?:%[^%:\r\n]|[^%:\r\n])*/,
|
|
368
|
+
)),
|
|
369
|
+
|
|
370
|
+
_gantt_immediate_url: (_) => token.immediate(seq('"', /[^"\r\n]*/, '"')),
|
|
371
|
+
|
|
372
|
+
_gantt_immediate_unclosed_url: (_) => token.immediate(prec(
|
|
373
|
+
-10,
|
|
374
|
+
seq('"', /[^"\r\n]*/),
|
|
375
|
+
)),
|
|
376
|
+
|
|
377
|
+
_gantt_required_space: (_) => token.immediate(/[ \t]+/),
|
|
378
|
+
|
|
379
|
+
_gantt_title_keyword: (_) => token(prec(20, /title/i)),
|
|
380
|
+
|
|
381
|
+
_gantt_acc_title_keyword: (_) => token(prec(20, /accTitle/i)),
|
|
382
|
+
|
|
383
|
+
_gantt_acc_descr_keyword: (_) => token(prec(20, /accDescr/i)),
|
|
384
|
+
|
|
385
|
+
_gantt_setting_keyword: (_) => token(prec(20, choice(
|
|
386
|
+
/dateFormat/i,
|
|
387
|
+
/axisFormat/i,
|
|
388
|
+
/tickInterval/i,
|
|
389
|
+
/includes/i,
|
|
390
|
+
/excludes/i,
|
|
391
|
+
/accDescription/i,
|
|
392
|
+
))),
|
|
393
|
+
|
|
394
|
+
_gantt_today_marker_keyword: (_) => token(prec(20, /todayMarker/i)),
|
|
395
|
+
|
|
396
|
+
_gantt_flag_keyword: (_) => token(prec(20, choice(
|
|
397
|
+
/inclusiveEndDates/i,
|
|
398
|
+
/topAxis/i,
|
|
399
|
+
))),
|
|
400
|
+
|
|
401
|
+
_gantt_weekday_keyword: (_) => token(prec(20, /weekday/i)),
|
|
402
|
+
|
|
403
|
+
_gantt_weekend_keyword: (_) => token(prec(20, /weekend/i)),
|
|
404
|
+
|
|
405
|
+
_gantt_section_keyword: (_) => token(prec(20, /section/i)),
|
|
406
|
+
|
|
407
|
+
_gantt_click_keyword: (_) => token(prec(20, /click/i)),
|
|
408
|
+
|
|
409
|
+
// These upstream keywords require following whitespace, so the exact word
|
|
410
|
+
// remains a legal task name when it is followed by a task-data colon.
|
|
411
|
+
_gantt_task_compatible_keyword: ($) => choice(
|
|
412
|
+
$._gantt_title_keyword,
|
|
413
|
+
$._gantt_setting_keyword,
|
|
414
|
+
$._gantt_today_marker_keyword,
|
|
415
|
+
$._gantt_weekday_keyword,
|
|
416
|
+
$._gantt_weekend_keyword,
|
|
417
|
+
$._gantt_section_keyword,
|
|
418
|
+
$._gantt_click_keyword,
|
|
419
|
+
),
|
|
420
|
+
|
|
421
|
+
_gantt_keyword_prefixed_task_name: (_) => seq(
|
|
422
|
+
token(prec(30, choice(
|
|
423
|
+
seq(/title/i, /[^\s:\r\n]/),
|
|
424
|
+
seq(/accTitle/i, /[^\s:\r\n]/),
|
|
425
|
+
seq(/accDescr/i, /[^\s:\r\n]/),
|
|
426
|
+
seq(/dateFormat/i, /[^\s:\r\n]/),
|
|
427
|
+
seq(/axisFormat/i, /[^\s:\r\n]/),
|
|
428
|
+
seq(/tickInterval/i, /[^\s:\r\n]/),
|
|
429
|
+
seq(/includes/i, /[^\s:\r\n]/),
|
|
430
|
+
seq(/excludes/i, /[^\s:\r\n]/),
|
|
431
|
+
seq(/todayMarker/i, /[^\s:\r\n]/),
|
|
432
|
+
seq(/accDescription/i, /[^\s:\r\n]/),
|
|
433
|
+
seq(/inclusiveEndDates/i, /[^\s:\r\n]/),
|
|
434
|
+
seq(/topAxis/i, /[^\s:\r\n]/),
|
|
435
|
+
seq(/weekday/i, /[^\s:\r\n]/),
|
|
436
|
+
seq(/weekend/i, /[^\s:\r\n]/),
|
|
437
|
+
seq(/section/i, /[^\s:\r\n]/),
|
|
438
|
+
seq(/click/i, /[^\s:\r\n]/),
|
|
439
|
+
))),
|
|
440
|
+
optional(token.immediate(/[^:\r\n]+/)),
|
|
441
|
+
),
|
|
442
|
+
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
module.exports = { ganttRules };
|