jssm 5.35.4 → 5.42.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.
Files changed (93) hide show
  1. package/.codeclimate.yml +22 -22
  2. package/.editorconfig +12 -12
  3. package/.eslintrc +20 -20
  4. package/.nycrc +6 -6
  5. package/.travis.yml +8 -8
  6. package/LICENSE.md +21 -21
  7. package/README.md +997 -993
  8. package/dist/es6/jssm-dot.d.ts +6 -6
  9. package/dist/es6/jssm-dot.js +1 -1
  10. package/dist/es6/jssm.d.ts +100 -100
  11. package/dist/es6/jssm.js +792 -792
  12. package/dist/es6/jssm_types.d.ts +151 -151
  13. package/dist/es6/jssm_types.js +1 -1
  14. package/dist/es6/jssm_util.d.ts +8 -8
  15. package/dist/es6/jssm_util.js +34 -34
  16. package/dist/es6/version.d.ts +2 -2
  17. package/dist/es6/version.js +2 -2
  18. package/dist/jssm.es5.cjs.js +1 -1
  19. package/dist/jssm.es5.iife.js +1 -0
  20. package/jest-spec.config.js +27 -27
  21. package/jest-stoch.config.js +27 -27
  22. package/jssm-dot.d.ts +6 -6
  23. package/jssm.d.ts +100 -100
  24. package/jssm_types.d.ts +151 -151
  25. package/jssm_util.d.ts +8 -8
  26. package/package.json +125 -122
  27. package/rollup.config.iife.js +44 -44
  28. package/rollup.config.js +44 -44
  29. package/src/demo/index.html +38 -38
  30. package/src/demo/style.css +1 -1
  31. package/src/ts/jssm-dot.peg +928 -874
  32. package/src/ts/jssm.ts +1120 -1120
  33. package/src/ts/jssm_types.ts +346 -346
  34. package/src/ts/jssm_util.ts +100 -100
  35. package/src/ts/tests/actions.spec.ts +167 -167
  36. package/src/ts/tests/arrange.spec.ts +72 -72
  37. package/src/ts/tests/arrange.stoch.ts +4 -4
  38. package/src/ts/tests/array_box_if_string.spec.ts +30 -31
  39. package/src/ts/tests/array_transitions.spec.ts +129 -129
  40. package/src/ts/tests/arrow unicode.spec.ts +88 -88
  41. package/src/ts/tests/arrow.spec.ts +124 -124
  42. package/src/ts/tests/colors.spec.ts +58 -58
  43. package/src/ts/tests/comment.spec.ts +134 -134
  44. package/src/ts/tests/compile.spec.ts +79 -79
  45. package/src/ts/tests/constants.spec.ts +98 -98
  46. package/src/ts/tests/cycles.spec.ts +153 -153
  47. package/src/ts/tests/dot_preamble.spec.ts +16 -16
  48. package/src/ts/tests/embedded_sm.spec.ts +36 -36
  49. package/src/ts/tests/flow.spec.ts +22 -22
  50. package/src/ts/tests/forced transitions.spec.ts +26 -26
  51. package/src/ts/tests/general.spec.ts +933 -933
  52. package/src/ts/tests/graph node lists.spec.ts +21 -21
  53. package/src/ts/tests/histo.spec.ts +24 -24
  54. package/src/ts/tests/hooks.spec.ts +28 -0
  55. package/src/ts/tests/language.spec.ts +37 -37
  56. package/src/ts/tests/language_data/belarussian.json +13 -13
  57. package/src/ts/tests/language_data/bengali.json +15 -15
  58. package/src/ts/tests/language_data/emoji.json +21 -21
  59. package/src/ts/tests/language_data/english.json +16 -16
  60. package/src/ts/tests/language_data/french.json +16 -16
  61. package/src/ts/tests/language_data/german.json +16 -16
  62. package/src/ts/tests/language_data/hebrew.json +16 -16
  63. package/src/ts/tests/language_data/portuguese.json +12 -12
  64. package/src/ts/tests/language_data/russian.json +12 -12
  65. package/src/ts/tests/language_data/spanish.json +17 -17
  66. package/src/ts/tests/language_data/ukrainian.json +18 -18
  67. package/src/ts/tests/layout.spec.ts +29 -29
  68. package/src/ts/tests/machine_attributes.spec.ts +398 -398
  69. package/src/ts/tests/machine_name.spec.ts +14 -14
  70. package/src/ts/tests/named lists.spec.ts +24 -19
  71. package/src/ts/tests/nominated states.spec.ts +133 -133
  72. package/src/ts/tests/parse actions.spec.ts +32 -32
  73. package/src/ts/tests/parse.spec.ts +94 -94
  74. package/src/ts/tests/probability.spec.ts +146 -146
  75. package/src/ts/tests/r639.spec.ts +27 -27
  76. package/src/ts/tests/sample_select.spec.ts +173 -173
  77. package/src/ts/tests/seq.spec.ts +14 -16
  78. package/src/ts/tests/seq.stoch.ts +83 -0
  79. package/src/ts/tests/shapes.spec.ts +63 -63
  80. package/src/ts/tests/sm_tag.spec.ts +37 -37
  81. package/src/ts/tests/special characters.spec.ts +39 -39
  82. package/src/ts/tests/state_declaration.spec.ts +214 -200
  83. package/src/ts/tests/state_style.spec.ts +82 -39
  84. package/src/ts/tests/stop light.spec.ts +157 -157
  85. package/src/ts/tests/stripes.spec.ts +52 -52
  86. package/src/ts/tests/theme.spec.ts +45 -45
  87. package/src/ts/tests/weighted_histo_key.spec.ts +22 -22
  88. package/src/ts/tests/weighted_rand_select.spec.ts +27 -27
  89. package/src/ts/tests/weighted_sample_select.spec.ts +24 -26
  90. package/src/ts/version.ts +1 -1
  91. package/tree.txt +1794 -1794
  92. package/tsconfig.json +27 -27
  93. package/version.d.ts +2 -2
@@ -1,874 +1,928 @@
1
-
2
- Document
3
- = WS? e:TermList WS? { return e; }
4
-
5
-
6
-
7
- Theme
8
- = "none"
9
- / "default"
10
- / "modern"
11
- / "ocean"
12
-
13
-
14
-
15
- GvizShape
16
- = "box3d"
17
- / "polygon"
18
- / "ellipse"
19
- / "oval"
20
- / "circle"
21
- / "point"
22
- / "egg"
23
- / "triangle"
24
- / "plaintext"
25
- / "plain"
26
- / "diamond"
27
- / "trapezium"
28
- / "parallelogram"
29
- / "house"
30
- / "pentagon"
31
- / "hexagon"
32
- / "septagon"
33
- / "octagon"
34
- / "doublecircle"
35
- / "doubleoctagon"
36
- / "tripleoctagon"
37
- / "invtriangle"
38
- / "invtrapezium"
39
- / "invhouse"
40
- / "Mdiamond"
41
- / "Msquare"
42
- / "Mcircle"
43
- / "rectangle"
44
- / "rect"
45
- / "square"
46
- / "star"
47
- / "none"
48
- / "underline"
49
- / "cylinder"
50
- / "note"
51
- / "tab"
52
- / "folder"
53
- / "box"
54
- / "component"
55
- / "promoter"
56
- / "cds"
57
- / "terminator"
58
- / "utr"
59
- / "primersite"
60
- / "restrictionsite"
61
- / "fivepoverhang"
62
- / "threepoverhang"
63
- / "noverhang"
64
- / "assembly"
65
- / "signature"
66
- / "insulator"
67
- / "ribosite"
68
- / "rnastab"
69
- / "proteasesite"
70
- / "proteinstab"
71
- / "rpromoter"
72
- / "rarrow"
73
- / "larrow"
74
- / "lpromoter"
75
- / "record"
76
-
77
-
78
- ForwardLightArrow "forward light arrow ->"
79
- = "->"
80
- / "→" { return "->"; }
81
-
82
- TwoWayLightArrow "two way light arrow <->"
83
- = "<->"
84
- / "" { return "<->"; }
85
-
86
- BackLightArrow "back light arrow <-"
87
- = "<-"
88
- / "" { return "<-"; }
89
-
90
-
91
- ForwardFatArrow "forward fat arrow =>"
92
- = "=>"
93
- / "⇒" { return "=>"; }
94
-
95
- TwoWayFatArrow "two way fat arrow <=>"
96
- = "<=>"
97
- / "" { return "<=>"; }
98
-
99
- BackFatArrow "back fat arrow <="
100
- = "<="
101
- / "" { return "<="; }
102
-
103
-
104
- ForwardTildeArrow "forward tilde arrow ~>"
105
- = "~>"
106
- / "↛" { return "~>"; }
107
-
108
- TwoWayTildeArrow "two way tilde arrow <~>"
109
- = "<~>"
110
- / "" { return "<~>"; }
111
-
112
- BackTildeArrow "back tilde arrow <~"
113
- = "<~"
114
- / "" { return "<~"; }
115
-
116
-
117
- LightFatArrow "light fat arrow <-=>"
118
- = "<-=>"
119
- / "←⇒" { return "<-=>"; }
120
-
121
- LightTildeArrow "light tilde arrow <-~>"
122
- = "<-~>"
123
- / "←↛" { return "<-~>"; }
124
-
125
- FatLightArrow "fat light arrow <=->"
126
- = "<=->"
127
- / "⇐→" { return "<=->"; }
128
-
129
- FatTildeArrow "fat tilde arrow <=~>"
130
- = "<=~>"
131
- / "⇐↛" { return "<=~>"; }
132
-
133
- TildeLightArrow "tilde light arrow <~->"
134
- = "<~->"
135
- / "↚→" { return "<~->"; }
136
-
137
- TildeFatArrow "tilde fat arrow <~=>"
138
- = "<~=>"
139
- / "↚⇒" { return "<~=>"; }
140
-
141
-
142
- LightArrow "light arrow"
143
- = ForwardLightArrow / TwoWayLightArrow / BackLightArrow
144
-
145
- FatArrow "fat arrow"
146
- = ForwardFatArrow / TwoWayFatArrow / BackFatArrow
147
-
148
- TildeArrow "tilde arrow"
149
- = ForwardTildeArrow / TwoWayTildeArrow / BackTildeArrow
150
-
151
- MixedArrow "mixed arrow"
152
- = LightFatArrow / LightTildeArrow / FatLightArrow / FatTildeArrow / TildeLightArrow / TildeFatArrow
153
-
154
-
155
- Arrow "arrow"
156
- = MixedArrow / LightArrow / FatArrow / TildeArrow
157
-
158
-
159
-
160
- Boolean
161
- = "true" { return true; }
162
- / "false" { return false; }
163
-
164
- Corners
165
- = "regular"
166
- / "rounded"
167
- / "lined"
168
-
169
- LineStyle
170
- = "solid"
171
- / "dotted"
172
- / "dashed"
173
-
174
- HexDigit
175
- = [0-9a-fA-F]
176
-
177
- Char
178
- = Unescaped
179
- / Escape Sequence:(
180
- '"'
181
- / "\\"
182
- / "/"
183
- / "b" { return "\b"; }
184
- / "f" { return "\f"; }
185
- / "n" { return "\n"; }
186
- / "r" { return "\r"; }
187
- / "t" { return "\t"; }
188
- / "v" { return "\v"; }
189
- / "u" digits:$(HexDigit HexDigit HexDigit HexDigit) {
190
- return String.fromCharCode(parseInt(digits, 16));
191
- }
192
- )
193
- { return Sequence; }
194
-
195
- Escape = "\\"
196
- QuoteMark = '"'
197
- Unescaped = [\x20-\x21\x23-\x5B\x5D-\u10FFFF] // explicitly omits "
198
-
199
- ActionLabelChar
200
- = ActionLabelUnescaped
201
- / Escape Sequence:(
202
- "'"
203
- / "\\"
204
- / "/"
205
- / "b" { return "\b"; }
206
- / "f" { return "\f"; }
207
- / "n" { return "\n"; }
208
- / "r" { return "\r"; }
209
- / "t" { return "\t"; }
210
- / "v" { return "\v"; }
211
- / "u" digits:$(HexDigit HexDigit HexDigit HexDigit) {
212
- return String.fromCharCode(parseInt(digits, 16));
213
- }
214
- )
215
- { return Sequence; }
216
-
217
- ActionLabelQuoteMark = "'"
218
- ActionLabelUnescaped = [\x20-\x26\x28-\x5B\x5D-\u10FFFF] // explicitly omits ' which is hex 27
219
-
220
- ActionLabel "action label"
221
- = ActionLabelQuoteMark chars:ActionLabelChar* ActionLabelQuoteMark { return chars.join(""); }
222
-
223
- LineTerminator
224
- = [\n\r\u2028\u2029]
225
-
226
- Whitespace
227
- = [ \t\n\r\v]+
228
-
229
- BlockCommentTail
230
- = "*/"
231
- / . BlockCommentTail
232
-
233
- BlockComment "block comment"
234
- = "/*" BlockCommentTail
235
-
236
- EOF
237
- = !.
238
-
239
- LineCommentTail
240
- = LineTerminator
241
- / EOF
242
- / . LineCommentTail
243
-
244
- LineComment "line comment"
245
- = "//" LineCommentTail
246
-
247
- WS "whitespace"
248
- = BlockComment WS?
249
- / LineComment WS?
250
- / [ \t\r\n\v]+ WS?
251
-
252
- String "string"
253
- = QuoteMark chars:Char* QuoteMark { return chars.join(""); }
254
-
255
- AtomFirstLetter
256
- = [0-9a-zA-Z\.\_\!\$\^\*\!\?\,\x80-\uFFFF]
257
-
258
- AtomLetter
259
- = [0-9a-zA-Z\.\+\=\_\^\(\)\*\&\$\#\@\!\?\,\x80-\uFFFF]
260
-
261
- Atom "atom"
262
- = firstletter:AtomFirstLetter text:AtomLetter* {
263
- return firstletter + ((text || []).join(''));
264
- }
265
-
266
- Label "label"
267
- = atom:Atom
268
- / string:String
269
-
270
- IntegerLiteral
271
- = "0"
272
- / NonZeroDigit DecimalDigit*
273
-
274
- DecimalDigit
275
- = [0-9]
276
-
277
- NonZeroDigit
278
- = [1-9]
279
-
280
- NonNegNumber "nonneg number"
281
- = IntegerLiteral "." DecimalDigit* WS? { return parseFloat(text()); }
282
- / IntegerLiteral WS? { return parseFloat(text()); }
283
-
284
- SemVer
285
- = major:IntegerLiteral "." minor:IntegerLiteral "." patch:IntegerLiteral
286
- { return {
287
- major: parseInt(major,10),
288
- minor: parseInt(minor,10),
289
- patch: parseInt(patch,10),
290
- full: text()
291
- }; }
292
-
293
- SemVerOper
294
- = "^"
295
- / "~"
296
- / ">="
297
- / "<="
298
- / "<"
299
- / ">"
300
-
301
- SemVerRule
302
- = SemVerOper? SemVer
303
-
304
- SemVerRange
305
- = SemVerRule SemVerRule?
306
-
307
- UrlProtocol
308
- = 'http://'
309
- / 'https://'
310
-
311
- URL
312
- = protocol:UrlProtocol [a-zA-Z0-9\!\*\'\(\)\:\;\@\&\=\+\$\,\/\?\#\[\]\_\.\~\-]+ { return text(); }
313
-
314
-
315
-
316
- SvgColorLabel
317
- = 'aliceblue' { return '#f0f8ffff'; } / 'AliceBlue' { return '#f0f8ffff'; }
318
- / 'antiquewhite' { return '#faebd7ff'; } / 'AntiqueWhite' { return '#faebd7ff'; }
319
-
320
- /* out of order because otherwise aqua would pre-run aquamarine */
321
- / 'aquamarine' { return '#7fffd4ff'; } / 'Aquamarine' { return '#7fffd4ff'; }
322
- / 'aqua' { return '#00ffffff'; } / 'Aqua' { return '#00ffffff'; }
323
- / 'azure' { return '#f0ffffff'; } / 'Azure' { return '#f0ffffff'; }
324
- / 'beige' { return '#f5f5dcff'; } / 'Beige' { return '#f5f5dcff'; }
325
- / 'bisque' { return '#ffe4c4ff'; } / 'Bisque' { return '#ffe4c4ff'; }
326
- / 'black' { return '#000000ff'; } / 'Black' { return '#000000ff'; }
327
- / 'blanchedalmond' { return '#ffebcdff'; } / 'BlanchedAlmond' { return '#ffebcdff'; }
328
-
329
- /* out of order because otherwise blue would pre-run blueviolet */
330
- / 'blueviolet' { return '#8a2be2ff'; } / 'BlueViolet' { return '#8a2be2ff'; }
331
- / 'blue' { return '#0000ffff'; } / 'Blue' { return '#0000ffff'; }
332
- / 'brown' { return '#a52a2aff'; } / 'Brown' { return '#a52a2aff'; }
333
- / 'burlywood' { return '#deb887ff'; } / 'BurlyWood' { return '#deb887ff'; }
334
- / 'cadetblue' { return '#5f9ea0ff'; } / 'CadetBlue' { return '#5f9ea0ff'; }
335
- / 'chartreuse' { return '#7fff00ff'; } / 'Chartreuse' { return '#7fff00ff'; }
336
- / 'chocolate' { return '#d2691eff'; } / 'Chocolate' { return '#d2691eff'; }
337
- / 'coral' { return '#ff7f50ff'; } / 'Coral' { return '#ff7f50ff'; }
338
- / 'cornflowerblue' { return '#6495edff'; } / 'CornflowerBlue' { return '#6495edff'; }
339
- / 'cornsilk' { return '#fff8dcff'; } / 'Cornsilk' { return '#fff8dcff'; }
340
- / 'crimson' { return '#dc143cff'; } / 'Crimson' { return '#dc143cff'; }
341
- / 'cyan' { return '#00ffffff'; } / 'Cyan' { return '#00ffffff'; }
342
- / 'darkblue' { return '#00008bff'; } / 'DarkBlue' { return '#00008bff'; }
343
- / 'darkcyan' { return '#008b8bff'; } / 'DarkCyan' { return '#008b8bff'; }
344
- / 'darkgoldenrod' { return '#b8860bff'; } / 'DarkGoldenRod' { return '#b8860bff'; }
345
- / 'darkgray' { return '#a9a9a9ff'; } / 'DarkGray' { return '#a9a9a9ff'; }
346
- / 'darkgrey' { return '#a9a9a9ff'; } / 'DarkGrey' { return '#a9a9a9ff'; }
347
- / 'darkgreen' { return '#006400ff'; } / 'DarkGreen' { return '#006400ff'; }
348
- / 'darkkhaki' { return '#bdb76bff'; } / 'DarkKhaki' { return '#bdb76bff'; }
349
- / 'darkmagenta' { return '#8b008bff'; } / 'DarkMagenta' { return '#8b008bff'; }
350
- / 'darkolivegreen' { return '#556b2fff'; } / 'DarkOliveGreen' { return '#556b2fff'; }
351
- / 'darkorange' { return '#ff8c00ff'; } / 'Darkorange' { return '#ff8c00ff'; }
352
- / 'darkorchid' { return '#9932ccff'; } / 'DarkOrchid' { return '#9932ccff'; }
353
- / 'darkred' { return '#8b0000ff'; } / 'DarkRed' { return '#8b0000ff'; }
354
- / 'darksalmon' { return '#e9967aff'; } / 'DarkSalmon' { return '#e9967aff'; }
355
- / 'darkseagreen' { return '#8fbc8fff'; } / 'DarkSeaGreen' { return '#8fbc8fff'; }
356
- / 'darkslateblue' { return '#483d8bff'; } / 'DarkSlateBlue' { return '#483d8bff'; }
357
- / 'darkslategray' { return '#2f4f4fff'; } / 'DarkSlateGray' { return '#2f4f4fff'; }
358
- / 'darkslategrey' { return '#2f4f4fff'; } / 'DarkSlateGrey' { return '#2f4f4fff'; }
359
- / 'darkturquoise' { return '#00ced1ff'; } / 'DarkTurquoise' { return '#00ced1ff'; }
360
- / 'darkviolet' { return '#9400d3ff'; } / 'DarkViolet' { return '#9400d3ff'; }
361
- / 'deeppink' { return '#ff1493ff'; } / 'DeepPink' { return '#ff1493ff'; }
362
- / 'deepskyblue' { return '#00bfffff'; } / 'DeepSkyBlue' { return '#00bfffff'; }
363
- / 'dimgray' { return '#696969ff'; } / 'DimGray' { return '#696969ff'; }
364
- / 'dimgrey' { return '#696969ff'; } / 'DimGrey' { return '#696969ff'; }
365
- / 'dodgerblue' { return '#1e90ffff'; } / 'DodgerBlue' { return '#1e90ffff'; }
366
- / 'firebrick' { return '#b22222ff'; } / 'FireBrick' { return '#b22222ff'; }
367
- / 'floralwhite' { return '#fffaf0ff'; } / 'FloralWhite' { return '#fffaf0ff'; }
368
- / 'forestgreen' { return '#228b22ff'; } / 'ForestGreen' { return '#228b22ff'; }
369
- / 'fuchsia' { return '#ff00ffff'; } / 'Fuchsia' { return '#ff00ffff'; }
370
- / 'gainsboro' { return '#dcdcdcff'; } / 'Gainsboro' { return '#dcdcdcff'; }
371
- / 'ghostwhite' { return '#f8f8ffff'; } / 'GhostWhite' { return '#f8f8ffff'; }
372
-
373
- /* out of order because otherwise gold would pre-run goldenrod */
374
- / 'goldenrod' { return '#daa520ff'; } / 'GoldenRod' { return '#daa520ff'; }
375
- / 'gold' { return '#ffd700ff'; } / 'Gold' { return '#ffd700ff'; }
376
- / 'gray' { return '#808080ff'; } / 'Gray' { return '#808080ff'; }
377
- / 'grey' { return '#808080ff'; } / 'Grey' { return '#808080ff'; }
378
-
379
- /* out of order because otherwise green would pre-run greenyellow */
380
- / 'greenyellow' { return '#adff2fff'; } / 'GreenYellow' { return '#adff2fff'; }
381
- / 'green' { return '#008000ff'; } / 'Green' { return '#008000ff'; }
382
- / 'honeydew' { return '#f0fff0ff'; } / 'HoneyDew' { return '#f0fff0ff'; }
383
- / 'hotpink' { return '#ff69b4ff'; } / 'HotPink' { return '#ff69b4ff'; }
384
- / 'indianred' { return '#cd5c5cff'; } / 'IndianRed' { return '#cd5c5cff'; }
385
- / 'indigo' { return '#4b0082ff'; } / 'Indigo' { return '#4b0082ff'; }
386
- / 'ivory' { return '#fffff0ff'; } / 'Ivory' { return '#fffff0ff'; }
387
- / 'khaki' { return '#f0e68cff'; } / 'Khaki' { return '#f0e68cff'; }
388
-
389
- /* out of order because otherwise lavender would pre-run lavenderblush */
390
- / 'lavenderblush' { return '#fff0f5ff'; } / 'LavenderBlush' { return '#fff0f5ff'; }
391
- / 'lavender' { return '#e6e6faff'; } / 'Lavender' { return '#e6e6faff'; }
392
- / 'lawngreen' { return '#7cfc00ff'; } / 'LawnGreen' { return '#7cfc00ff'; }
393
- / 'lemonchiffon' { return '#fffacdff'; } / 'LemonChiffon' { return '#fffacdff'; }
394
- / 'lightblue' { return '#add8e6ff'; } / 'LightBlue' { return '#add8e6ff'; }
395
- / 'lightcoral' { return '#f08080ff'; } / 'LightCoral' { return '#f08080ff'; }
396
- / 'lightcyan' { return '#e0ffffff'; } / 'LightCyan' { return '#e0ffffff'; }
397
- / 'lightgoldenrodyellow' { return '#fafad2ff'; } / 'LightGoldenRodYellow' { return '#fafad2ff'; }
398
- / 'lightgray' { return '#d3d3d3ff'; } / 'LightGray' { return '#d3d3d3ff'; }
399
- / 'lightgrey' { return '#d3d3d3ff'; } / 'LightGrey' { return '#d3d3d3ff'; }
400
- / 'lightgreen' { return '#90ee90ff'; } / 'LightGreen' { return '#90ee90ff'; }
401
- / 'lightpink' { return '#ffb6c1ff'; } / 'LightPink' { return '#ffb6c1ff'; }
402
- / 'lightsalmon' { return '#ffa07aff'; } / 'LightSalmon' { return '#ffa07aff'; }
403
- / 'lightseagreen' { return '#20b2aaff'; } / 'LightSeaGreen' { return '#20b2aaff'; }
404
- / 'lightskyblue' { return '#87cefaff'; } / 'LightSkyBlue' { return '#87cefaff'; }
405
- / 'lightslategray' { return '#778899ff'; } / 'LightSlateGray' { return '#778899ff'; }
406
- / 'lightslategrey' { return '#778899ff'; } / 'LightSlateGrey' { return '#778899ff'; }
407
- / 'lightsteelblue' { return '#b0c4deff'; } / 'LightSteelBlue' { return '#b0c4deff'; }
408
- / 'lightyellow' { return '#ffffe0ff'; } / 'LightYellow' { return '#ffffe0ff'; }
409
-
410
- /* out of order because otherwise lime would pre-run limegreen */
411
- / 'limegreen' { return '#32cd32ff'; } / 'LimeGreen' { return '#32cd32ff'; }
412
- / 'lime' { return '#00ff00ff'; } / 'Lime' { return '#00ff00ff'; }
413
- / 'linen' { return '#faf0e6ff'; } / 'Linen' { return '#faf0e6ff'; }
414
- / 'magenta' { return '#ff00ffff'; } / 'Magenta' { return '#ff00ffff'; }
415
- / 'maroon' { return '#800000ff'; } / 'Maroon' { return '#800000ff'; }
416
- / 'mediumaquamarine' { return '#66cdaaff'; } / 'MediumAquaMarine' { return '#66cdaaff'; }
417
- / 'mediumblue' { return '#0000cdff'; } / 'MediumBlue' { return '#0000cdff'; }
418
- / 'mediumorchid' { return '#ba55d3ff'; } / 'MediumOrchid' { return '#ba55d3ff'; }
419
- / 'mediumpurple' { return '#9370d8ff'; } / 'MediumPurple' { return '#9370d8ff'; }
420
- / 'mediumseagreen' { return '#3cb371ff'; } / 'MediumSeaGreen' { return '#3cb371ff'; }
421
- / 'mediumslateblue' { return '#7b68eeff'; } / 'MediumSlateBlue' { return '#7b68eeff'; }
422
- / 'mediumspringgreen' { return '#00fa9aff'; } / 'MediumSpringGreen' { return '#00fa9aff'; }
423
- / 'mediumturquoise' { return '#48d1ccff'; } / 'MediumTurquoise' { return '#48d1ccff'; }
424
- / 'mediumvioletred' { return '#c71585ff'; } / 'MediumVioletRed' { return '#c71585ff'; }
425
- / 'midnightblue' { return '#191970ff'; } / 'MidnightBlue' { return '#191970ff'; }
426
- / 'mintcream' { return '#f5fffaff'; } / 'MintCream' { return '#f5fffaff'; }
427
- / 'mistyrose' { return '#ffe4e1ff'; } / 'MistyRose' { return '#ffe4e1ff'; }
428
- / 'moccasin' { return '#ffe4b5ff'; } / 'Moccasin' { return '#ffe4b5ff'; }
429
- / 'navajowhite' { return '#ffdeadff'; } / 'NavajoWhite' { return '#ffdeadff'; }
430
- / 'navy' { return '#000080ff'; } / 'Navy' { return '#000080ff'; }
431
- / 'oldlace' { return '#fdf5e6ff'; } / 'OldLace' { return '#fdf5e6ff'; }
432
-
433
- /* out of order because otherwise olive would pre-run olivedrab */
434
- / 'olivedrab' { return '#6b8e23ff'; } / 'OliveDrab' { return '#6b8e23ff'; }
435
- / 'olive' { return '#808000ff'; } / 'Olive' { return '#808000ff'; }
436
-
437
- /* out of order because otherwise orange would pre-run orangered */
438
- / 'orangered' { return '#ff4500ff'; } / 'OrangeRed' { return '#ff4500ff'; }
439
- / 'orange' { return '#ffa500ff'; } / 'Orange' { return '#ffa500ff'; }
440
- / 'orchid' { return '#da70d6ff'; } / 'Orchid' { return '#da70d6ff'; }
441
- / 'palegoldenrod' { return '#eee8aaff'; } / 'PaleGoldenRod' { return '#eee8aaff'; }
442
- / 'palegreen' { return '#98fb98ff'; } / 'PaleGreen' { return '#98fb98ff'; }
443
- / 'paleturquoise' { return '#afeeeeff'; } / 'PaleTurquoise' { return '#afeeeeff'; }
444
- / 'palevioletred' { return '#d87093ff'; } / 'PaleVioletRed' { return '#d87093ff'; }
445
- / 'papayawhip' { return '#ffefd5ff'; } / 'PapayaWhip' { return '#ffefd5ff'; }
446
- / 'peachpuff' { return '#ffdab9ff'; } / 'PeachPuff' { return '#ffdab9ff'; }
447
- / 'peru' { return '#cd853fff'; } / 'Peru' { return '#cd853fff'; }
448
- / 'pink' { return '#ffc0cbff'; } / 'Pink' { return '#ffc0cbff'; }
449
- / 'plum' { return '#dda0ddff'; } / 'Plum' { return '#dda0ddff'; }
450
- / 'powderblue' { return '#b0e0e6ff'; } / 'PowderBlue' { return '#b0e0e6ff'; }
451
- / 'purple' { return '#800080ff'; } / 'Purple' { return '#800080ff'; }
452
- / 'red' { return '#ff0000ff'; } / 'Red' { return '#ff0000ff'; }
453
- / 'rosybrown' { return '#bc8f8fff'; } / 'RosyBrown' { return '#bc8f8fff'; }
454
- / 'royalblue' { return '#4169e1ff'; } / 'RoyalBlue' { return '#4169e1ff'; }
455
- / 'saddlebrown' { return '#8b4513ff'; } / 'SaddleBrown' { return '#8b4513ff'; }
456
- / 'salmon' { return '#fa8072ff'; } / 'Salmon' { return '#fa8072ff'; }
457
- / 'sandybrown' { return '#f4a460ff'; } / 'SandyBrown' { return '#f4a460ff'; }
458
- / 'seagreen' { return '#2e8b57ff'; } / 'SeaGreen' { return '#2e8b57ff'; }
459
- / 'seashell' { return '#fff5eeff'; } / 'SeaShell' { return '#fff5eeff'; }
460
- / 'sienna' { return '#a0522dff'; } / 'Sienna' { return '#a0522dff'; }
461
- / 'silver' { return '#c0c0c0ff'; } / 'Silver' { return '#c0c0c0ff'; }
462
- / 'skyblue' { return '#87ceebff'; } / 'SkyBlue' { return '#87ceebff'; }
463
- / 'slateblue' { return '#6a5acdff'; } / 'SlateBlue' { return '#6a5acdff'; }
464
- / 'slategray' { return '#708090ff'; } / 'SlateGray' { return '#708090ff'; }
465
- / 'slategrey' { return '#708090ff'; } / 'SlateGrey' { return '#708090ff'; }
466
- / 'snow' { return '#fffafaff'; } / 'Snow' { return '#fffafaff'; }
467
- / 'springgreen' { return '#00ff7fff'; } / 'SpringGreen' { return '#00ff7fff'; }
468
- / 'steelblue' { return '#4682b4ff'; } / 'SteelBlue' { return '#4682b4ff'; }
469
- / 'tan' { return '#d2b48cff'; } / 'Tan' { return '#d2b48cff'; }
470
- / 'teal' { return '#008080ff'; } / 'Teal' { return '#008080ff'; }
471
- / 'thistle' { return '#d8bfd8ff'; } / 'Thistle' { return '#d8bfd8ff'; }
472
- / 'tomato' { return '#ff6347ff'; } / 'Tomato' { return '#ff6347ff'; }
473
- / 'turquoise' { return '#40e0d0ff'; } / 'Turquoise' { return '#40e0d0ff'; }
474
- / 'violet' { return '#ee82eeff'; } / 'Violet' { return '#ee82eeff'; }
475
- / 'wheat' { return '#f5deb3ff'; } / 'Wheat' { return '#f5deb3ff'; }
476
-
477
- /* out of order because otherwise white would pre-run whitesmoke */
478
- / 'whitesmoke' { return '#f5f5f5ff'; } / 'WhiteSmoke' { return '#f5f5f5ff'; }
479
- / 'white' { return '#ffffffff'; } / 'White' { return '#ffffffff'; }
480
-
481
- /* out of order because otherwise yellow would pre-run yellowgreen */
482
- / 'yellowgreen' { return '#9acd32ff'; } / 'YellowGreen' { return '#9acd32ff'; }
483
- / 'yellow' { return '#ffff00ff'; } / 'Yellow' { return '#ffff00ff'; }
484
-
485
- SvgColor
486
- = lab:SvgColorLabel WS? { return lab; }
487
-
488
- Rgb3
489
- = '#' r:HexDigit g:HexDigit b:HexDigit WS? {
490
- return `#${r}${r}${g}${g}${b}${b}ff`; }
491
-
492
- Rgb6
493
- = '#' r1:HexDigit r2:HexDigit g1:HexDigit g2:HexDigit b1:HexDigit b2:HexDigit WS? {
494
- return `#${r1}${r2}${g1}${g2}${b1}${b2}ff`; }
495
-
496
- Rgba4
497
- = '#' r:HexDigit g:HexDigit b:HexDigit a:HexDigit WS? {
498
- return `#${r}${r}${g}${g}${b}${b}${a}${a}`; }
499
-
500
- Rgba8
501
- = '#' r1:HexDigit r2:HexDigit g1:HexDigit g2:HexDigit b1:HexDigit b2:HexDigit a1:HexDigit a2:HexDigit WS? {
502
- return `#${r1}${r2}${g1}${g2}${b1}${b2}${a1}${a2}`; }
503
-
504
- Color "color" // hoboy
505
- = SvgColor
506
- / Rgba8
507
- / Rgb6
508
- / Rgba4
509
- / Rgb3
510
-
511
-
512
-
513
- ArrowItemKey
514
- = "arc_label"
515
- / "head_label"
516
- / "tail_label"
517
-
518
- ArrowItem
519
- = WS? key:ArrowItemKey WS? ":" WS? value:Label WS? ";" WS? { return {key:key, value:value}; }
520
-
521
- SingleEdgeColor "single edge color"
522
- = WS? "edge_color" WS? ":" WS? value:Color WS? ";" WS? { return {key:'single_edge_color', value:value}; }
523
-
524
- ArrowItems
525
- = SingleEdgeColor
526
- / ArrowItem+
527
-
528
- ArrowDesc
529
- = "{" WS? items:ArrowItems? WS? "}" { return items; }
530
-
531
- ArrowProbability
532
- = value:NonNegNumber "%" { return { key: 'arrow probability', value: value }; }
533
-
534
-
535
-
536
- LabelList
537
- = "[" WS? names:(Label WS?)* "]" { return names.map(i => i[0]); }
538
-
539
- LabelOrLabelList
540
- = LabelList
541
- / Label
542
-
543
- Stripe
544
- = '+|' nzd:NonZeroDigit dd:DecimalDigit* { return { key: 'stripe', value: parseInt(`${nzd}${dd}`, 10) }; }
545
- / '-|' nzd:NonZeroDigit dd:DecimalDigit* { return { key: 'stripe', value: -1 * parseInt(`${nzd}${dd}`, 10) }; }
546
-
547
- Cycle
548
- = '+' nzd:NonZeroDigit dd:DecimalDigit* { return { key: 'cycle', value: parseInt(`${nzd}${dd}`, 10) }; }
549
- / '-' nzd:NonZeroDigit dd:DecimalDigit* { return { key: 'cycle', value: -1 * parseInt(`${nzd}${dd}`, 10) }; }
550
- / '+0' { return { key: 'cycle', value: 0 }; }
551
-
552
- ArrowTarget
553
- = Stripe
554
- / Cycle
555
- / LabelList
556
- / Label
557
-
558
-
559
-
560
- // todo these shouldn't be ordered, this is dumb // whargarbl comeback major
561
-
562
- Subexp
563
- = WS? r_action : ActionLabel?
564
- WS? r_prob : ArrowProbability?
565
- WS? l_desc : ArrowDesc?
566
- WS? arrow : Arrow
567
- WS? r_desc : ArrowDesc?
568
- WS? l_prob : ArrowProbability?
569
- WS? l_action : ActionLabel?
570
- WS? label : ArrowTarget
571
- WS? tail : Subexp? {
572
-
573
- const base: any = {kind: arrow, to: label};
574
-
575
- if (tail && (tail !== [])) { base.se = tail; }
576
- if (l_desc) { base.l_desc = l_desc; }
577
- if (r_desc) { base.r_desc = r_desc; }
578
- if (l_action) { base.l_action = l_action; }
579
- if (r_action) { base.r_action = r_action; }
580
- if (l_prob) { base.l_probability = l_prob.value; }
581
- if (r_prob) { base.r_probability = r_prob.value; }
582
-
583
- return base;
584
-
585
- }
586
-
587
-
588
-
589
- Exp
590
- = label:ArrowTarget se:Subexp WS? ';' WS? {
591
- const base: any = { key: 'transition', from: label };
592
- if (se && (se !== [])) { base.se = se; }
593
- return base;
594
- }
595
-
596
-
597
-
598
- ValidationKey
599
- = "whargarbl"
600
- / "todo"
601
-
602
- ValidationItem
603
- = validationkey:ValidationKey ":" value:Label ";" { return {key:validationkey, value:value}; }
604
-
605
- ValidationItems
606
- = ValidationItem+
607
-
608
- ConfigValidation
609
- = WS? "validation" WS? ":" WS? "{" WS? validation_items:ValidationItems? WS? "};" WS? {
610
- return { config_kind: "validation", config_items: validation_items || [] };
611
- }
612
-
613
-
614
-
615
- GvizLayout
616
- = "dot"
617
- / "circo"
618
- / "fdp"
619
- / "neato"
620
-
621
- StateItemShapeKey
622
- = "shape"
623
-
624
- StateItemShape
625
- = WS? "shape" WS? ":" WS? value:GvizShape WS? ";" WS? { return {key:"shape", value:value}; }
626
-
627
- StateItem
628
- = StateItemShape
629
-
630
- StateItems
631
- = StateItem+
632
-
633
- ConfigState
634
- = WS? "state" WS? ":" WS? "{" WS? state_items:StateItems? WS? "};" WS? {
635
- return { key: "state_config", value: { config_kind: "state", config_items: state_items || [] } };
636
- }
637
-
638
- ConfigStartState
639
- = WS? "start_state" WS? ":" WS? "{" WS? state_items:StateItems? WS? "};" WS? {
640
- return { key: "state_config", value: { config_kind: "in_state", config_items: state_items || [] } };
641
- }
642
-
643
- ConfigEndState
644
- = WS? "end_state" WS? ":" WS? "{" WS? state_items:StateItems? WS? "};" WS? {
645
- return { key: "state_config", value: { config_kind: "out_state", config_items: state_items || [] } };
646
- }
647
-
648
- ConfigAnyState
649
- = ConfigState
650
- / ConfigStartState
651
- / ConfigEndState
652
-
653
-
654
-
655
- ActionKey
656
- = "whargarbl"
657
- / "todo"
658
-
659
- ActionItem
660
- = actionkey:ActionKey ":" value:Label ";" { return {key:actionkey, value:value}; }
661
-
662
- ActionItems
663
- = ActionItem+
664
-
665
- ConfigAction
666
- = WS? "action" WS? ":" WS? "{" WS? action_items:ActionItems? WS? "};" WS? {
667
- return { config_kind: "action", config_items: action_items || [] };
668
- }
669
-
670
-
671
-
672
- TransitionKey
673
- = "whargarbl"
674
- / "todo"
675
-
676
- TransitionItem
677
- = transitionkey:TransitionKey ":" value:Label ";" { return {key:transitionkey, value:value}; }
678
-
679
- TransitionItems
680
- = GraphDefaultEdgeColor
681
- / TransitionItem+
682
-
683
- GraphDefaultEdgeColor "graph default edge color"
684
- = WS? "edge_color" WS? ":" WS? value:Color WS? ";" WS? { return {key:'graph_default_edge_color', value:value}; }
685
-
686
- ConfigTransition
687
- = WS? "transition" WS? ":" WS? "{" WS? transition_items:TransitionItems? WS? "};" WS? {
688
- return { config_kind: "transition", config_items: transition_items || [] };
689
- }
690
-
691
-
692
-
693
- ConfigGraphLayout
694
- = WS? "graph_layout" WS? ":" WS? value:GvizLayout WS? ";" WS? { return {key:"graph_layout", value:value}; }
695
-
696
- ConfigStartNodes
697
- = WS? "start_states" WS? ":" WS? value:LabelList WS? ";" WS? { return {key:"start_states", value:value}; }
698
-
699
- ConfigEndNodes
700
- = WS? "end_states" WS? ":" WS? value:LabelList WS? ";" WS? { return {key:"end_states", value:value}; }
701
-
702
- ConfigGraphBgColor
703
- = WS? "graph_bg_color" WS? ":" WS? value:Color WS? ";" WS? { return {key:"graph_bg_color", value:value}; }
704
-
705
-
706
-
707
- Config "configuration"
708
- = ConfigGraphLayout
709
- / ConfigStartNodes
710
- / ConfigEndNodes
711
- / ConfigTransition
712
- / ConfigAction
713
- / ConfigAnyState
714
- / ConfigValidation
715
- / ConfigGraphBgColor
716
-
717
-
718
-
719
- LicenseOrLabelOrList
720
- = 'MIT'
721
- / 'BSD 2-clause'
722
- / 'BSD 3-clause'
723
- / 'Apache 2.0'
724
- / 'Mozilla 2.0'
725
- / 'Public domain'
726
- / 'GPL v2'
727
- / 'GPL v3'
728
- / 'LGPL v2.1'
729
- / 'LGPL v3.0'
730
- / 'Unknown'
731
- / Label
732
- / LabelList
733
-
734
-
735
-
736
- Direction "direction"
737
- = "up"
738
- / "right"
739
- / "down"
740
- / "left"
741
-
742
-
743
-
744
- MachineAuthor
745
- = WS? "machine_author" WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key: "machine_author", value }; }
746
-
747
- MachineContributor
748
- = WS? "machine_contributor" WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key: "machine_contributor", value }; }
749
-
750
- MachineComment
751
- = WS? "machine_comment" WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key: "machine_comment", value }; }
752
-
753
- MachineDefinition
754
- = WS? "machine_definition" WS? ":" WS? value:URL WS? ";" WS? { return { key: "machine_definition", value }; }
755
-
756
- MachineName
757
- = WS? "machine_name" WS? ":" WS? value:Label WS? ";" WS? { return { key: "machine_name", value }; }
758
-
759
- MachineReference
760
- = WS? "machine_reference" WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key: "machine_reference", value }; }
761
-
762
- MachineVersion
763
- = WS? "machine_version" WS? ":" WS? value:SemVer WS? ";" WS? { return { key: "machine_version", value }; }
764
-
765
- MachineLicense
766
- = WS? "machine_license" WS? ":" WS? value:LicenseOrLabelOrList WS? ";" WS? { return { key: "machine_license", value }; }
767
-
768
- MachineLanguage
769
- = WS? "machine_language" WS? ":" WS? value:Label WS? ";" WS? { return { key: "machine_language", value }; }
770
-
771
- FslVersion
772
- = WS? "fsl_version" WS? ":" WS? value:SemVer WS? ";" WS? { return { key: "fsl_version", value }; }
773
-
774
- MachineTheme
775
- = WS? "theme" WS? ":" WS? value:Theme WS? ";" WS? { return { key: "theme", value }; }
776
-
777
- MachineFlow
778
- = WS? "flow" WS? ":" WS? value:Direction WS? ";" WS? { return { key: "flow", value }; }
779
-
780
- DotPreamble
781
- = WS? "dot_preamble" WS? ":" WS? value:String WS? ";" WS? { return { key: "dot_preamble", value }; }
782
-
783
- MachineAttribute "machine attribute"
784
- = FslVersion
785
- / MachineName
786
- / MachineAuthor
787
- / MachineContributor
788
- / MachineComment
789
- / MachineDefinition
790
- / MachineVersion
791
- / MachineLicense
792
- / MachineLanguage
793
- / MachineTheme
794
- / DotPreamble
795
- / MachineFlow
796
-
797
-
798
-
799
-
800
- SdStateColor "color"
801
- = WS? "color" WS? ":" WS? value:Color WS? ";" WS? { return { key:'color', value }; }
802
-
803
- SdStateTextColor "text color"
804
- = WS? "text-color" WS? ":" WS? value:Color WS? ";" WS? { return { key:'text-color', value }; }
805
-
806
- SdStateBackgroundColor "background color"
807
- = WS? "background-color" WS? ":" WS? value:Color WS? ";" WS? { return { key:'background-color', value }; }
808
-
809
- SdStateBorderColor "border color"
810
- = WS? "border-color" WS? ":" WS? value:Color WS? ";" WS? { return { key:'border-color', value }; }
811
-
812
- SdStateShape "shape"
813
- = WS? "shape" WS? ":" WS? value:GvizShape WS? ";" WS? { return { key:'shape', value }; }
814
-
815
- SdStateCorners "corners"
816
- = WS? "corners" WS? ":" WS? value:Corners WS? ";" WS? { return { key:'corners', value }; }
817
-
818
- SdStateLineStyle "linestyle"
819
- = WS? "linestyle" WS? ":" WS? value:LineStyle WS? ";" WS? { return { key:'linestyle', value }; }
820
-
821
- StateDeclarationItems
822
- = SdStateColor
823
- / SdStateTextColor
824
- / SdStateBackgroundColor
825
- / SdStateBorderColor
826
- / SdStateShape
827
- / SdStateCorners
828
- / SdStateLineStyle
829
-
830
- StateDeclarationDesc
831
- = "{" WS? items:StateDeclarationItems* WS? "}" { return items; }
832
-
833
- StateDeclaration
834
- = WS? "state" WS name:Label WS? ":" WS? value:StateDeclarationDesc WS? ";" WS? { return { key:'state_declaration', name, value }; }
835
-
836
-
837
-
838
-
839
-
840
- NamedList
841
- = WS? "&" WS? name:Label WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key:'named_list', name, value }; }
842
-
843
-
844
-
845
-
846
-
847
- RegularArrangeDeclaration
848
- = "arrange" WS? value:LabelOrLabelList WS? ";" WS? { return { key: 'arrange_declaration', value }; }
849
-
850
- ArrangeStartDeclaration
851
- = "arrange-start" WS? value:LabelOrLabelList WS? ";" WS? { return { key: 'arrange_start_declaration', value }; }
852
-
853
- ArrangeEndDeclaration
854
- = "arrange-end" WS? value:LabelOrLabelList WS? ";" WS? { return { key: 'arrange_end_declaration', value }; }
855
-
856
- ArrangeDeclaration "arrange declaration"
857
- = ArrangeStartDeclaration
858
- / ArrangeEndDeclaration
859
- / RegularArrangeDeclaration
860
-
861
-
862
-
863
-
864
-
865
- Term
866
- = Exp
867
- / StateDeclaration
868
- / ArrangeDeclaration
869
- / NamedList
870
- / MachineAttribute
871
- / Config
872
-
873
- TermList
874
- = term:Term*
1
+
2
+ Document
3
+ = WS? e:TermList WS? { return e; }
4
+
5
+
6
+
7
+
8
+
9
+ Theme
10
+ = "none"
11
+ / "default"
12
+ / "modern"
13
+ / "ocean"
14
+
15
+
16
+
17
+
18
+
19
+ GvizShape
20
+ = "box3d"
21
+ / "polygon"
22
+ / "ellipse"
23
+ / "oval"
24
+ / "circle"
25
+ / "point"
26
+ / "egg"
27
+ / "triangle"
28
+ / "plaintext"
29
+ / "plain"
30
+ / "diamond"
31
+ / "trapezium"
32
+ / "parallelogram"
33
+ / "house"
34
+ / "pentagon"
35
+ / "hexagon"
36
+ / "septagon"
37
+ / "octagon"
38
+ / "doublecircle"
39
+ / "doubleoctagon"
40
+ / "tripleoctagon"
41
+ / "invtriangle"
42
+ / "invtrapezium"
43
+ / "invhouse"
44
+ / "Mdiamond"
45
+ / "Msquare"
46
+ / "Mcircle"
47
+ / "rectangle"
48
+ / "rect"
49
+ / "square"
50
+ / "star"
51
+ / "none"
52
+ / "underline"
53
+ / "cylinder"
54
+ / "note"
55
+ / "tab"
56
+ / "folder"
57
+ / "box"
58
+ / "component"
59
+ / "promoter"
60
+ / "cds"
61
+ / "terminator"
62
+ / "utr"
63
+ / "primersite"
64
+ / "restrictionsite"
65
+ / "fivepoverhang"
66
+ / "threepoverhang"
67
+ / "noverhang"
68
+ / "assembly"
69
+ / "signature"
70
+ / "insulator"
71
+ / "ribosite"
72
+ / "rnastab"
73
+ / "proteasesite"
74
+ / "proteinstab"
75
+ / "rpromoter"
76
+ / "rarrow"
77
+ / "larrow"
78
+ / "lpromoter"
79
+ / "record"
80
+
81
+
82
+ ForwardLightArrow "forward light arrow ->"
83
+ = "->"
84
+ / "" { return "->"; }
85
+
86
+ TwoWayLightArrow "two way light arrow <->"
87
+ = "<->"
88
+ / "" { return "<->"; }
89
+
90
+ BackLightArrow "back light arrow <-"
91
+ = "<-"
92
+ / "" { return "<-"; }
93
+
94
+
95
+ ForwardFatArrow "forward fat arrow =>"
96
+ = "=>"
97
+ / "" { return "=>"; }
98
+
99
+ TwoWayFatArrow "two way fat arrow <=>"
100
+ = "<=>"
101
+ / "" { return "<=>"; }
102
+
103
+ BackFatArrow "back fat arrow <="
104
+ = "<="
105
+ / "" { return "<="; }
106
+
107
+
108
+ ForwardTildeArrow "forward tilde arrow ~>"
109
+ = "~>"
110
+ / "" { return "~>"; }
111
+
112
+ TwoWayTildeArrow "two way tilde arrow <~>"
113
+ = "<~>"
114
+ / "" { return "<~>"; }
115
+
116
+ BackTildeArrow "back tilde arrow <~"
117
+ = "<~"
118
+ / "" { return "<~"; }
119
+
120
+
121
+ LightFatArrow "light fat arrow <-=>"
122
+ = "<-=>"
123
+ / "←⇒" { return "<-=>"; }
124
+
125
+ LightTildeArrow "light tilde arrow <-~>"
126
+ = "<-~>"
127
+ / "←↛" { return "<-~>"; }
128
+
129
+ FatLightArrow "fat light arrow <=->"
130
+ = "<=->"
131
+ / "⇐→" { return "<=->"; }
132
+
133
+ FatTildeArrow "fat tilde arrow <=~>"
134
+ = "<=~>"
135
+ / "⇐↛" { return "<=~>"; }
136
+
137
+ TildeLightArrow "tilde light arrow <~->"
138
+ = "<~->"
139
+ / "↚→" { return "<~->"; }
140
+
141
+ TildeFatArrow "tilde fat arrow <~=>"
142
+ = "<~=>"
143
+ / "↚⇒" { return "<~=>"; }
144
+
145
+
146
+ LightArrow "light arrow"
147
+ = ForwardLightArrow / TwoWayLightArrow / BackLightArrow
148
+
149
+ FatArrow "fat arrow"
150
+ = ForwardFatArrow / TwoWayFatArrow / BackFatArrow
151
+
152
+ TildeArrow "tilde arrow"
153
+ = ForwardTildeArrow / TwoWayTildeArrow / BackTildeArrow
154
+
155
+ MixedArrow "mixed arrow"
156
+ = LightFatArrow / LightTildeArrow / FatLightArrow / FatTildeArrow / TildeLightArrow / TildeFatArrow
157
+
158
+
159
+ Arrow "arrow"
160
+ = MixedArrow / LightArrow / FatArrow / TildeArrow
161
+
162
+
163
+
164
+ Boolean
165
+ = "true" { return true; }
166
+ / "false" { return false; }
167
+
168
+ Corners
169
+ = "regular"
170
+ / "rounded"
171
+ / "lined"
172
+
173
+ LineStyle
174
+ = "solid"
175
+ / "dotted"
176
+ / "dashed"
177
+
178
+ HexDigit
179
+ = [0-9a-fA-F]
180
+
181
+ Char
182
+ = Unescaped
183
+ / Escape Sequence:(
184
+ '"'
185
+ / "\\"
186
+ / "/"
187
+ / "b" { return "\b"; }
188
+ / "f" { return "\f"; }
189
+ / "n" { return "\n"; }
190
+ / "r" { return "\r"; }
191
+ / "t" { return "\t"; }
192
+ / "v" { return "\v"; }
193
+ / "u" digits:$(HexDigit HexDigit HexDigit HexDigit) {
194
+ return String.fromCharCode(parseInt(digits, 16));
195
+ }
196
+ )
197
+ { return Sequence; }
198
+
199
+ Escape = "\\"
200
+ QuoteMark = '"'
201
+ Unescaped = [\x20-\x21\x23-\x5B\x5D-\u10FFFF] // explicitly omits "
202
+
203
+ ActionLabelChar
204
+ = ActionLabelUnescaped
205
+ / Escape Sequence:(
206
+ "'"
207
+ / "\\"
208
+ / "/"
209
+ / "b" { return "\b"; }
210
+ / "f" { return "\f"; }
211
+ / "n" { return "\n"; }
212
+ / "r" { return "\r"; }
213
+ / "t" { return "\t"; }
214
+ / "v" { return "\v"; }
215
+ / "u" digits:$(HexDigit HexDigit HexDigit HexDigit) {
216
+ return String.fromCharCode(parseInt(digits, 16));
217
+ }
218
+ )
219
+ { return Sequence; }
220
+
221
+ ActionLabelQuoteMark = "'"
222
+ ActionLabelUnescaped = [\x20-\x26\x28-\x5B\x5D-\u10FFFF] // explicitly omits ' which is hex 27
223
+
224
+ ActionLabel "action label"
225
+ = ActionLabelQuoteMark chars:ActionLabelChar* ActionLabelQuoteMark { return chars.join(""); }
226
+
227
+ LineTerminator
228
+ = [\n\r\u2028\u2029]
229
+
230
+ Whitespace
231
+ = [ \t\n\r\v]+
232
+
233
+ BlockCommentTail
234
+ = "*/"
235
+ / . BlockCommentTail
236
+
237
+ BlockComment "block comment"
238
+ = "/*" BlockCommentTail
239
+
240
+ EOF
241
+ = !.
242
+
243
+ LineCommentTail
244
+ = LineTerminator
245
+ / EOF
246
+ / . LineCommentTail
247
+
248
+ LineComment "line comment"
249
+ = "//" LineCommentTail
250
+
251
+ WS "whitespace"
252
+ = BlockComment WS?
253
+ / LineComment WS?
254
+ / [ \t\r\n\v]+ WS?
255
+
256
+ String "string"
257
+ = QuoteMark chars:Char* QuoteMark { return chars.join(""); }
258
+
259
+ AtomFirstLetter
260
+ = [0-9a-zA-Z\.\_\!\$\^\*\!\?\,\x80-\uFFFF]
261
+
262
+ AtomLetter
263
+ = [0-9a-zA-Z\.\+\=\_\^\(\)\*\&\$\#\@\!\?\,\x80-\uFFFF]
264
+
265
+ Atom "atom"
266
+ = firstletter:AtomFirstLetter text:AtomLetter* {
267
+ return firstletter + ((text || []).join(''));
268
+ }
269
+
270
+ Label "label"
271
+ = atom:Atom
272
+ / string:String
273
+
274
+ IntegerLiteral
275
+ = "0"
276
+ / NonZeroDigit DecimalDigit*
277
+
278
+ DecimalDigit
279
+ = [0-9]
280
+
281
+ NonZeroDigit
282
+ = [1-9]
283
+
284
+ NonNegNumber "nonneg number"
285
+ = IntegerLiteral "." DecimalDigit* WS? { return parseFloat(text()); }
286
+ / IntegerLiteral WS? { return parseFloat(text()); }
287
+
288
+
289
+
290
+
291
+
292
+ SemVer
293
+ = major:IntegerLiteral "." minor:IntegerLiteral "." patch:IntegerLiteral
294
+ { return {
295
+ major: parseInt(major,10),
296
+ minor: parseInt(minor,10),
297
+ patch: parseInt(patch,10),
298
+ full: text()
299
+ }; }
300
+
301
+ SemVerOper
302
+ = "^"
303
+ / "~"
304
+ / ">="
305
+ / "<="
306
+ / "<"
307
+ / ">"
308
+
309
+ SemVerRule
310
+ = SemVerOper? SemVer
311
+
312
+ SemVerRange
313
+ = SemVerRule SemVerRule?
314
+
315
+
316
+
317
+
318
+
319
+ UrlProtocol
320
+ = 'http://'
321
+ / 'https://'
322
+
323
+ URL
324
+ = protocol:UrlProtocol [a-zA-Z0-9\!\*\'\(\)\:\;\@\&\=\+\$\,\/\?\#\[\]\_\.\~\-]+ { return text(); }
325
+
326
+
327
+
328
+ SvgColorLabel
329
+ = 'aliceblue' { return '#f0f8ffff'; } / 'AliceBlue' { return '#f0f8ffff'; }
330
+ / 'antiquewhite' { return '#faebd7ff'; } / 'AntiqueWhite' { return '#faebd7ff'; }
331
+
332
+ /* out of order because otherwise aqua would pre-run aquamarine */
333
+ / 'aquamarine' { return '#7fffd4ff'; } / 'Aquamarine' { return '#7fffd4ff'; }
334
+ / 'aqua' { return '#00ffffff'; } / 'Aqua' { return '#00ffffff'; }
335
+ / 'azure' { return '#f0ffffff'; } / 'Azure' { return '#f0ffffff'; }
336
+ / 'beige' { return '#f5f5dcff'; } / 'Beige' { return '#f5f5dcff'; }
337
+ / 'bisque' { return '#ffe4c4ff'; } / 'Bisque' { return '#ffe4c4ff'; }
338
+ / 'black' { return '#000000ff'; } / 'Black' { return '#000000ff'; }
339
+ / 'blanchedalmond' { return '#ffebcdff'; } / 'BlanchedAlmond' { return '#ffebcdff'; }
340
+
341
+ /* out of order because otherwise blue would pre-run blueviolet */
342
+ / 'blueviolet' { return '#8a2be2ff'; } / 'BlueViolet' { return '#8a2be2ff'; }
343
+ / 'blue' { return '#0000ffff'; } / 'Blue' { return '#0000ffff'; }
344
+ / 'brown' { return '#a52a2aff'; } / 'Brown' { return '#a52a2aff'; }
345
+ / 'burlywood' { return '#deb887ff'; } / 'BurlyWood' { return '#deb887ff'; }
346
+ / 'cadetblue' { return '#5f9ea0ff'; } / 'CadetBlue' { return '#5f9ea0ff'; }
347
+ / 'chartreuse' { return '#7fff00ff'; } / 'Chartreuse' { return '#7fff00ff'; }
348
+ / 'chocolate' { return '#d2691eff'; } / 'Chocolate' { return '#d2691eff'; }
349
+ / 'coral' { return '#ff7f50ff'; } / 'Coral' { return '#ff7f50ff'; }
350
+ / 'cornflowerblue' { return '#6495edff'; } / 'CornflowerBlue' { return '#6495edff'; }
351
+ / 'cornsilk' { return '#fff8dcff'; } / 'Cornsilk' { return '#fff8dcff'; }
352
+ / 'crimson' { return '#dc143cff'; } / 'Crimson' { return '#dc143cff'; }
353
+ / 'cyan' { return '#00ffffff'; } / 'Cyan' { return '#00ffffff'; }
354
+ / 'darkblue' { return '#00008bff'; } / 'DarkBlue' { return '#00008bff'; }
355
+ / 'darkcyan' { return '#008b8bff'; } / 'DarkCyan' { return '#008b8bff'; }
356
+ / 'darkgoldenrod' { return '#b8860bff'; } / 'DarkGoldenRod' { return '#b8860bff'; }
357
+ / 'darkgray' { return '#a9a9a9ff'; } / 'DarkGray' { return '#a9a9a9ff'; }
358
+ / 'darkgrey' { return '#a9a9a9ff'; } / 'DarkGrey' { return '#a9a9a9ff'; }
359
+ / 'darkgreen' { return '#006400ff'; } / 'DarkGreen' { return '#006400ff'; }
360
+ / 'darkkhaki' { return '#bdb76bff'; } / 'DarkKhaki' { return '#bdb76bff'; }
361
+ / 'darkmagenta' { return '#8b008bff'; } / 'DarkMagenta' { return '#8b008bff'; }
362
+ / 'darkolivegreen' { return '#556b2fff'; } / 'DarkOliveGreen' { return '#556b2fff'; }
363
+ / 'darkorange' { return '#ff8c00ff'; } / 'Darkorange' { return '#ff8c00ff'; }
364
+ / 'darkorchid' { return '#9932ccff'; } / 'DarkOrchid' { return '#9932ccff'; }
365
+ / 'darkred' { return '#8b0000ff'; } / 'DarkRed' { return '#8b0000ff'; }
366
+ / 'darksalmon' { return '#e9967aff'; } / 'DarkSalmon' { return '#e9967aff'; }
367
+ / 'darkseagreen' { return '#8fbc8fff'; } / 'DarkSeaGreen' { return '#8fbc8fff'; }
368
+ / 'darkslateblue' { return '#483d8bff'; } / 'DarkSlateBlue' { return '#483d8bff'; }
369
+ / 'darkslategray' { return '#2f4f4fff'; } / 'DarkSlateGray' { return '#2f4f4fff'; }
370
+ / 'darkslategrey' { return '#2f4f4fff'; } / 'DarkSlateGrey' { return '#2f4f4fff'; }
371
+ / 'darkturquoise' { return '#00ced1ff'; } / 'DarkTurquoise' { return '#00ced1ff'; }
372
+ / 'darkviolet' { return '#9400d3ff'; } / 'DarkViolet' { return '#9400d3ff'; }
373
+ / 'deeppink' { return '#ff1493ff'; } / 'DeepPink' { return '#ff1493ff'; }
374
+ / 'deepskyblue' { return '#00bfffff'; } / 'DeepSkyBlue' { return '#00bfffff'; }
375
+ / 'dimgray' { return '#696969ff'; } / 'DimGray' { return '#696969ff'; }
376
+ / 'dimgrey' { return '#696969ff'; } / 'DimGrey' { return '#696969ff'; }
377
+ / 'dodgerblue' { return '#1e90ffff'; } / 'DodgerBlue' { return '#1e90ffff'; }
378
+ / 'firebrick' { return '#b22222ff'; } / 'FireBrick' { return '#b22222ff'; }
379
+ / 'floralwhite' { return '#fffaf0ff'; } / 'FloralWhite' { return '#fffaf0ff'; }
380
+ / 'forestgreen' { return '#228b22ff'; } / 'ForestGreen' { return '#228b22ff'; }
381
+ / 'fuchsia' { return '#ff00ffff'; } / 'Fuchsia' { return '#ff00ffff'; }
382
+ / 'gainsboro' { return '#dcdcdcff'; } / 'Gainsboro' { return '#dcdcdcff'; }
383
+ / 'ghostwhite' { return '#f8f8ffff'; } / 'GhostWhite' { return '#f8f8ffff'; }
384
+
385
+ /* out of order because otherwise gold would pre-run goldenrod */
386
+ / 'goldenrod' { return '#daa520ff'; } / 'GoldenRod' { return '#daa520ff'; }
387
+ / 'gold' { return '#ffd700ff'; } / 'Gold' { return '#ffd700ff'; }
388
+ / 'gray' { return '#808080ff'; } / 'Gray' { return '#808080ff'; }
389
+ / 'grey' { return '#808080ff'; } / 'Grey' { return '#808080ff'; }
390
+
391
+ /* out of order because otherwise green would pre-run greenyellow */
392
+ / 'greenyellow' { return '#adff2fff'; } / 'GreenYellow' { return '#adff2fff'; }
393
+ / 'green' { return '#008000ff'; } / 'Green' { return '#008000ff'; }
394
+ / 'honeydew' { return '#f0fff0ff'; } / 'HoneyDew' { return '#f0fff0ff'; }
395
+ / 'hotpink' { return '#ff69b4ff'; } / 'HotPink' { return '#ff69b4ff'; }
396
+ / 'indianred' { return '#cd5c5cff'; } / 'IndianRed' { return '#cd5c5cff'; }
397
+ / 'indigo' { return '#4b0082ff'; } / 'Indigo' { return '#4b0082ff'; }
398
+ / 'ivory' { return '#fffff0ff'; } / 'Ivory' { return '#fffff0ff'; }
399
+ / 'khaki' { return '#f0e68cff'; } / 'Khaki' { return '#f0e68cff'; }
400
+
401
+ /* out of order because otherwise lavender would pre-run lavenderblush */
402
+ / 'lavenderblush' { return '#fff0f5ff'; } / 'LavenderBlush' { return '#fff0f5ff'; }
403
+ / 'lavender' { return '#e6e6faff'; } / 'Lavender' { return '#e6e6faff'; }
404
+ / 'lawngreen' { return '#7cfc00ff'; } / 'LawnGreen' { return '#7cfc00ff'; }
405
+ / 'lemonchiffon' { return '#fffacdff'; } / 'LemonChiffon' { return '#fffacdff'; }
406
+ / 'lightblue' { return '#add8e6ff'; } / 'LightBlue' { return '#add8e6ff'; }
407
+ / 'lightcoral' { return '#f08080ff'; } / 'LightCoral' { return '#f08080ff'; }
408
+ / 'lightcyan' { return '#e0ffffff'; } / 'LightCyan' { return '#e0ffffff'; }
409
+ / 'lightgoldenrodyellow' { return '#fafad2ff'; } / 'LightGoldenRodYellow' { return '#fafad2ff'; }
410
+ / 'lightgray' { return '#d3d3d3ff'; } / 'LightGray' { return '#d3d3d3ff'; }
411
+ / 'lightgrey' { return '#d3d3d3ff'; } / 'LightGrey' { return '#d3d3d3ff'; }
412
+ / 'lightgreen' { return '#90ee90ff'; } / 'LightGreen' { return '#90ee90ff'; }
413
+ / 'lightpink' { return '#ffb6c1ff'; } / 'LightPink' { return '#ffb6c1ff'; }
414
+ / 'lightsalmon' { return '#ffa07aff'; } / 'LightSalmon' { return '#ffa07aff'; }
415
+ / 'lightseagreen' { return '#20b2aaff'; } / 'LightSeaGreen' { return '#20b2aaff'; }
416
+ / 'lightskyblue' { return '#87cefaff'; } / 'LightSkyBlue' { return '#87cefaff'; }
417
+ / 'lightslategray' { return '#778899ff'; } / 'LightSlateGray' { return '#778899ff'; }
418
+ / 'lightslategrey' { return '#778899ff'; } / 'LightSlateGrey' { return '#778899ff'; }
419
+ / 'lightsteelblue' { return '#b0c4deff'; } / 'LightSteelBlue' { return '#b0c4deff'; }
420
+ / 'lightyellow' { return '#ffffe0ff'; } / 'LightYellow' { return '#ffffe0ff'; }
421
+
422
+ /* out of order because otherwise lime would pre-run limegreen */
423
+ / 'limegreen' { return '#32cd32ff'; } / 'LimeGreen' { return '#32cd32ff'; }
424
+ / 'lime' { return '#00ff00ff'; } / 'Lime' { return '#00ff00ff'; }
425
+ / 'linen' { return '#faf0e6ff'; } / 'Linen' { return '#faf0e6ff'; }
426
+ / 'magenta' { return '#ff00ffff'; } / 'Magenta' { return '#ff00ffff'; }
427
+ / 'maroon' { return '#800000ff'; } / 'Maroon' { return '#800000ff'; }
428
+ / 'mediumaquamarine' { return '#66cdaaff'; } / 'MediumAquaMarine' { return '#66cdaaff'; }
429
+ / 'mediumblue' { return '#0000cdff'; } / 'MediumBlue' { return '#0000cdff'; }
430
+ / 'mediumorchid' { return '#ba55d3ff'; } / 'MediumOrchid' { return '#ba55d3ff'; }
431
+ / 'mediumpurple' { return '#9370d8ff'; } / 'MediumPurple' { return '#9370d8ff'; }
432
+ / 'mediumseagreen' { return '#3cb371ff'; } / 'MediumSeaGreen' { return '#3cb371ff'; }
433
+ / 'mediumslateblue' { return '#7b68eeff'; } / 'MediumSlateBlue' { return '#7b68eeff'; }
434
+ / 'mediumspringgreen' { return '#00fa9aff'; } / 'MediumSpringGreen' { return '#00fa9aff'; }
435
+ / 'mediumturquoise' { return '#48d1ccff'; } / 'MediumTurquoise' { return '#48d1ccff'; }
436
+ / 'mediumvioletred' { return '#c71585ff'; } / 'MediumVioletRed' { return '#c71585ff'; }
437
+ / 'midnightblue' { return '#191970ff'; } / 'MidnightBlue' { return '#191970ff'; }
438
+ / 'mintcream' { return '#f5fffaff'; } / 'MintCream' { return '#f5fffaff'; }
439
+ / 'mistyrose' { return '#ffe4e1ff'; } / 'MistyRose' { return '#ffe4e1ff'; }
440
+ / 'moccasin' { return '#ffe4b5ff'; } / 'Moccasin' { return '#ffe4b5ff'; }
441
+ / 'navajowhite' { return '#ffdeadff'; } / 'NavajoWhite' { return '#ffdeadff'; }
442
+ / 'navy' { return '#000080ff'; } / 'Navy' { return '#000080ff'; }
443
+ / 'oldlace' { return '#fdf5e6ff'; } / 'OldLace' { return '#fdf5e6ff'; }
444
+
445
+ /* out of order because otherwise olive would pre-run olivedrab */
446
+ / 'olivedrab' { return '#6b8e23ff'; } / 'OliveDrab' { return '#6b8e23ff'; }
447
+ / 'olive' { return '#808000ff'; } / 'Olive' { return '#808000ff'; }
448
+
449
+ /* out of order because otherwise orange would pre-run orangered */
450
+ / 'orangered' { return '#ff4500ff'; } / 'OrangeRed' { return '#ff4500ff'; }
451
+ / 'orange' { return '#ffa500ff'; } / 'Orange' { return '#ffa500ff'; }
452
+ / 'orchid' { return '#da70d6ff'; } / 'Orchid' { return '#da70d6ff'; }
453
+ / 'palegoldenrod' { return '#eee8aaff'; } / 'PaleGoldenRod' { return '#eee8aaff'; }
454
+ / 'palegreen' { return '#98fb98ff'; } / 'PaleGreen' { return '#98fb98ff'; }
455
+ / 'paleturquoise' { return '#afeeeeff'; } / 'PaleTurquoise' { return '#afeeeeff'; }
456
+ / 'palevioletred' { return '#d87093ff'; } / 'PaleVioletRed' { return '#d87093ff'; }
457
+ / 'papayawhip' { return '#ffefd5ff'; } / 'PapayaWhip' { return '#ffefd5ff'; }
458
+ / 'peachpuff' { return '#ffdab9ff'; } / 'PeachPuff' { return '#ffdab9ff'; }
459
+ / 'peru' { return '#cd853fff'; } / 'Peru' { return '#cd853fff'; }
460
+ / 'pink' { return '#ffc0cbff'; } / 'Pink' { return '#ffc0cbff'; }
461
+ / 'plum' { return '#dda0ddff'; } / 'Plum' { return '#dda0ddff'; }
462
+ / 'powderblue' { return '#b0e0e6ff'; } / 'PowderBlue' { return '#b0e0e6ff'; }
463
+ / 'purple' { return '#800080ff'; } / 'Purple' { return '#800080ff'; }
464
+ / 'red' { return '#ff0000ff'; } / 'Red' { return '#ff0000ff'; }
465
+ / 'rosybrown' { return '#bc8f8fff'; } / 'RosyBrown' { return '#bc8f8fff'; }
466
+ / 'royalblue' { return '#4169e1ff'; } / 'RoyalBlue' { return '#4169e1ff'; }
467
+ / 'saddlebrown' { return '#8b4513ff'; } / 'SaddleBrown' { return '#8b4513ff'; }
468
+ / 'salmon' { return '#fa8072ff'; } / 'Salmon' { return '#fa8072ff'; }
469
+ / 'sandybrown' { return '#f4a460ff'; } / 'SandyBrown' { return '#f4a460ff'; }
470
+ / 'seagreen' { return '#2e8b57ff'; } / 'SeaGreen' { return '#2e8b57ff'; }
471
+ / 'seashell' { return '#fff5eeff'; } / 'SeaShell' { return '#fff5eeff'; }
472
+ / 'sienna' { return '#a0522dff'; } / 'Sienna' { return '#a0522dff'; }
473
+ / 'silver' { return '#c0c0c0ff'; } / 'Silver' { return '#c0c0c0ff'; }
474
+ / 'skyblue' { return '#87ceebff'; } / 'SkyBlue' { return '#87ceebff'; }
475
+ / 'slateblue' { return '#6a5acdff'; } / 'SlateBlue' { return '#6a5acdff'; }
476
+ / 'slategray' { return '#708090ff'; } / 'SlateGray' { return '#708090ff'; }
477
+ / 'slategrey' { return '#708090ff'; } / 'SlateGrey' { return '#708090ff'; }
478
+ / 'snow' { return '#fffafaff'; } / 'Snow' { return '#fffafaff'; }
479
+ / 'springgreen' { return '#00ff7fff'; } / 'SpringGreen' { return '#00ff7fff'; }
480
+ / 'steelblue' { return '#4682b4ff'; } / 'SteelBlue' { return '#4682b4ff'; }
481
+ / 'tan' { return '#d2b48cff'; } / 'Tan' { return '#d2b48cff'; }
482
+ / 'teal' { return '#008080ff'; } / 'Teal' { return '#008080ff'; }
483
+ / 'thistle' { return '#d8bfd8ff'; } / 'Thistle' { return '#d8bfd8ff'; }
484
+ / 'tomato' { return '#ff6347ff'; } / 'Tomato' { return '#ff6347ff'; }
485
+ / 'turquoise' { return '#40e0d0ff'; } / 'Turquoise' { return '#40e0d0ff'; }
486
+ / 'violet' { return '#ee82eeff'; } / 'Violet' { return '#ee82eeff'; }
487
+ / 'wheat' { return '#f5deb3ff'; } / 'Wheat' { return '#f5deb3ff'; }
488
+
489
+ /* out of order because otherwise white would pre-run whitesmoke */
490
+ / 'whitesmoke' { return '#f5f5f5ff'; } / 'WhiteSmoke' { return '#f5f5f5ff'; }
491
+ / 'white' { return '#ffffffff'; } / 'White' { return '#ffffffff'; }
492
+
493
+ /* out of order because otherwise yellow would pre-run yellowgreen */
494
+ / 'yellowgreen' { return '#9acd32ff'; } / 'YellowGreen' { return '#9acd32ff'; }
495
+ / 'yellow' { return '#ffff00ff'; } / 'Yellow' { return '#ffff00ff'; }
496
+
497
+ SvgColor
498
+ = lab:SvgColorLabel WS? { return lab; }
499
+
500
+ Rgb3
501
+ = '#' r:HexDigit g:HexDigit b:HexDigit WS? {
502
+ return `#${r}${r}${g}${g}${b}${b}ff`; }
503
+
504
+ Rgb6
505
+ = '#' r1:HexDigit r2:HexDigit g1:HexDigit g2:HexDigit b1:HexDigit b2:HexDigit WS? {
506
+ return `#${r1}${r2}${g1}${g2}${b1}${b2}ff`; }
507
+
508
+ Rgba4
509
+ = '#' r:HexDigit g:HexDigit b:HexDigit a:HexDigit WS? {
510
+ return `#${r}${r}${g}${g}${b}${b}${a}${a}`; }
511
+
512
+ Rgba8
513
+ = '#' r1:HexDigit r2:HexDigit g1:HexDigit g2:HexDigit b1:HexDigit b2:HexDigit a1:HexDigit a2:HexDigit WS? {
514
+ return `#${r1}${r2}${g1}${g2}${b1}${b2}${a1}${a2}`; }
515
+
516
+ Color "color" // hoboy
517
+ = SvgColor
518
+ / Rgba8
519
+ / Rgb6
520
+ / Rgba4
521
+ / Rgb3
522
+
523
+
524
+
525
+ ArrowItemKey
526
+ = "arc_label"
527
+ / "head_label"
528
+ / "tail_label"
529
+
530
+ ArrowItem
531
+ = WS? key:ArrowItemKey WS? ":" WS? value:Label WS? ";" WS? { return {key:key, value:value}; }
532
+
533
+ SingleEdgeColor "single edge color"
534
+ = WS? "edge_color" WS? ":" WS? value:Color WS? ";" WS? { return {key:'single_edge_color', value:value}; }
535
+
536
+ TransitionLineStyle "transition line style"
537
+ = WS? "linestyle" WS? ":" WS? value:LineStyle WS? ";" WS? { return {key:'transition_line_style', value:value}; }
538
+
539
+ ArrowItems
540
+ = SingleEdgeColor
541
+ / TransitionLineStyle
542
+ / ArrowItem+
543
+
544
+ ArrowDesc
545
+ = "{" WS? items:ArrowItems? WS? "}" { return items; }
546
+
547
+ ArrowProbability
548
+ = value:NonNegNumber "%" { return { key: 'arrow probability', value: value }; }
549
+
550
+
551
+
552
+
553
+
554
+ LabelList
555
+ = "[" WS? names:(Label WS?)* "]" { return names.map(i => i[0]); }
556
+
557
+ LabelOrLabelList
558
+ = LabelList
559
+ / Label
560
+
561
+ Stripe
562
+ = '+|' nzd:NonZeroDigit dd:DecimalDigit* { return { key: 'stripe', value: parseInt(`${nzd}${dd}`, 10) }; }
563
+ / '-|' nzd:NonZeroDigit dd:DecimalDigit* { return { key: 'stripe', value: -1 * parseInt(`${nzd}${dd}`, 10) }; }
564
+
565
+ Cycle
566
+ = '+' nzd:NonZeroDigit dd:DecimalDigit* { return { key: 'cycle', value: parseInt(`${nzd}${dd}`, 10) }; }
567
+ / '-' nzd:NonZeroDigit dd:DecimalDigit* { return { key: 'cycle', value: -1 * parseInt(`${nzd}${dd}`, 10) }; }
568
+ / '+0' { return { key: 'cycle', value: 0 }; }
569
+
570
+ ArrowTarget
571
+ = Stripe
572
+ / Cycle
573
+ / LabelList
574
+ / Label
575
+
576
+
577
+
578
+
579
+
580
+ // todo these shouldn't be ordered, this is dumb // whargarbl comeback major
581
+
582
+ Subexp
583
+ = WS? r_action : ActionLabel?
584
+ WS? r_prob : ArrowProbability?
585
+ WS? l_desc : ArrowDesc?
586
+ WS? arrow : Arrow
587
+ WS? r_desc : ArrowDesc?
588
+ WS? l_prob : ArrowProbability?
589
+ WS? l_action : ActionLabel?
590
+ WS? label : ArrowTarget
591
+ WS? tail : Subexp? {
592
+
593
+ const base: any = {kind: arrow, to: label};
594
+
595
+ if (tail && (tail !== [])) { base.se = tail; }
596
+ if (l_desc) { base.l_desc = l_desc; }
597
+ if (r_desc) { base.r_desc = r_desc; }
598
+ if (l_action) { base.l_action = l_action; }
599
+ if (r_action) { base.r_action = r_action; }
600
+ if (l_prob) { base.l_probability = l_prob.value; }
601
+ if (r_prob) { base.r_probability = r_prob.value; }
602
+
603
+ return base;
604
+
605
+ }
606
+
607
+
608
+
609
+
610
+
611
+ Exp
612
+ = label:ArrowTarget se:Subexp WS? ';' WS? {
613
+ const base: any = { key: 'transition', from: label };
614
+ if (se && (se !== [])) { base.se = se; }
615
+ return base;
616
+ }
617
+
618
+
619
+
620
+
621
+
622
+ ValidationKey
623
+ = "whargarbl"
624
+ / "todo"
625
+
626
+ ValidationItem
627
+ = validationkey:ValidationKey ":" value:Label ";" { return {key:validationkey, value:value}; }
628
+
629
+ ValidationItems
630
+ = ValidationItem+
631
+
632
+ ConfigValidation
633
+ = WS? "validation" WS? ":" WS? "{" WS? validation_items:ValidationItems? WS? "};" WS? {
634
+ return { config_kind: "validation", config_items: validation_items || [] };
635
+ }
636
+
637
+
638
+
639
+
640
+
641
+ GvizLayout
642
+ = "dot"
643
+ / "circo"
644
+ / "fdp"
645
+ / "neato"
646
+
647
+ StateItemShapeKey
648
+ = "shape"
649
+
650
+ StateItemShape
651
+ = WS? "shape" WS? ":" WS? value:GvizShape WS? ";" WS? { return {key:"shape", value:value}; }
652
+
653
+ StateItem
654
+ = StateItemShape
655
+
656
+ StateItems
657
+ = StateItem+
658
+
659
+ ConfigState
660
+ = WS? "state" WS? ":" WS? "{" WS? state_items:StateItems? WS? "};" WS? {
661
+ return { key: "state_config", value: { config_kind: "state", config_items: state_items || [] } };
662
+ }
663
+
664
+ ConfigStartState
665
+ = WS? "start_state" WS? ":" WS? "{" WS? state_items:StateItems? WS? "};" WS? {
666
+ return { key: "state_config", value: { config_kind: "in_state", config_items: state_items || [] } };
667
+ }
668
+
669
+ ConfigEndState
670
+ = WS? "end_state" WS? ":" WS? "{" WS? state_items:StateItems? WS? "};" WS? {
671
+ return { key: "state_config", value: { config_kind: "out_state", config_items: state_items || [] } };
672
+ }
673
+
674
+ ConfigAnyState
675
+ = ConfigState
676
+ / ConfigStartState
677
+ / ConfigEndState
678
+
679
+
680
+
681
+
682
+
683
+ ActionKey
684
+ = "whargarbl"
685
+ / "todo"
686
+
687
+ ActionItem
688
+ = actionkey:ActionKey ":" value:Label ";" { return {key:actionkey, value:value}; }
689
+
690
+ ActionItems
691
+ = ActionItem+
692
+
693
+ ConfigAction
694
+ = WS? "action" WS? ":" WS? "{" WS? action_items:ActionItems? WS? "};" WS? {
695
+ return { config_kind: "action", config_items: action_items || [] };
696
+ }
697
+
698
+
699
+
700
+
701
+
702
+ TransitionKey
703
+ = "whargarbl"
704
+ / "todo"
705
+
706
+ TransitionItem
707
+ = transitionkey:TransitionKey ":" value:Label ";" { return {key:transitionkey, value:value}; }
708
+
709
+ TransitionItems
710
+ = GraphDefaultEdgeColor
711
+ / TransitionItem+
712
+
713
+ GraphDefaultEdgeColor "graph default edge color"
714
+ = WS? "edge_color" WS? ":" WS? value:Color WS? ";" WS? { return {key:'graph_default_edge_color', value:value}; }
715
+
716
+ ConfigTransition
717
+ = WS? "transition" WS? ":" WS? "{" WS? transition_items:TransitionItems? WS? "};" WS? {
718
+ return { config_kind: "transition", config_items: transition_items || [] };
719
+ }
720
+
721
+
722
+
723
+
724
+
725
+ ConfigGraphLayout
726
+ = WS? "graph_layout" WS? ":" WS? value:GvizLayout WS? ";" WS? { return {key:"graph_layout", value:value}; }
727
+
728
+ ConfigStartNodes
729
+ = WS? "start_states" WS? ":" WS? value:LabelList WS? ";" WS? { return {key:"start_states", value:value}; }
730
+
731
+ ConfigEndNodes
732
+ = WS? "end_states" WS? ":" WS? value:LabelList WS? ";" WS? { return {key:"end_states", value:value}; }
733
+
734
+ ConfigGraphBgColor
735
+ = WS? "graph_bg_color" WS? ":" WS? value:Color WS? ";" WS? { return {key:"graph_bg_color", value:value}; }
736
+
737
+
738
+
739
+
740
+
741
+ Config "configuration"
742
+ = ConfigGraphLayout
743
+ / ConfigStartNodes
744
+ / ConfigEndNodes
745
+ / ConfigTransition
746
+ / ConfigAction
747
+ / ConfigAnyState
748
+ / ConfigValidation
749
+ / ConfigGraphBgColor
750
+
751
+
752
+
753
+
754
+
755
+ LicenseOrLabelOrList
756
+ = 'MIT'
757
+ / 'BSD 2-clause'
758
+ / 'BSD 3-clause'
759
+ / 'Apache 2.0'
760
+ / 'Mozilla 2.0'
761
+ / 'Public domain'
762
+ / 'GPL v2'
763
+ / 'GPL v3'
764
+ / 'LGPL v2.1'
765
+ / 'LGPL v3.0'
766
+ / 'Unknown'
767
+ / Label
768
+ / LabelList;
769
+
770
+
771
+
772
+
773
+
774
+ Direction "direction"
775
+ = "up"
776
+ / "right"
777
+ / "down"
778
+ / "left";
779
+
780
+
781
+
782
+
783
+
784
+ HookDefinition "hook definition (open/closed)"
785
+ = "open"
786
+ / "closed";
787
+
788
+
789
+
790
+
791
+
792
+ MachineAuthor
793
+ = WS? "machine_author" WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key: "machine_author", value }; }
794
+
795
+ MachineContributor
796
+ = WS? "machine_contributor" WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key: "machine_contributor", value }; }
797
+
798
+ MachineComment
799
+ = WS? "machine_comment" WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key: "machine_comment", value }; }
800
+
801
+ MachineDefinition
802
+ = WS? "machine_definition" WS? ":" WS? value:URL WS? ";" WS? { return { key: "machine_definition", value }; }
803
+
804
+ MachineName
805
+ = WS? "machine_name" WS? ":" WS? value:Label WS? ";" WS? { return { key: "machine_name", value }; }
806
+
807
+ MachineReference
808
+ = WS? "machine_reference" WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key: "machine_reference", value }; }
809
+
810
+ MachineVersion
811
+ = WS? "machine_version" WS? ":" WS? value:SemVer WS? ";" WS? { return { key: "machine_version", value }; }
812
+
813
+ MachineLicense
814
+ = WS? "machine_license" WS? ":" WS? value:LicenseOrLabelOrList WS? ";" WS? { return { key: "machine_license", value }; }
815
+
816
+ MachineLanguage
817
+ = WS? "machine_language" WS? ":" WS? value:Label WS? ";" WS? { return { key: "machine_language", value }; }
818
+
819
+ FslVersion
820
+ = WS? "fsl_version" WS? ":" WS? value:SemVer WS? ";" WS? { return { key: "fsl_version", value }; }
821
+
822
+ MachineTheme
823
+ = WS? "theme" WS? ":" WS? value:Theme WS? ";" WS? { return { key: "theme", value }; }
824
+
825
+ MachineFlow
826
+ = WS? "flow" WS? ":" WS? value:Direction WS? ";" WS? { return { key: "flow", value }; }
827
+
828
+ MachineHookDefinition
829
+ = WS? "hooks" WS? ":" WS? value:HookDefinition WS? ";" WS? { return { key: "hook_definition", value }; }
830
+
831
+ DotPreamble
832
+ = WS? "dot_preamble" WS? ":" WS? value:String WS? ";" WS? { return { key: "dot_preamble", value }; }
833
+
834
+
835
+ MachineAttribute "machine attribute"
836
+ = FslVersion
837
+ / MachineName
838
+ / MachineAuthor
839
+ / MachineContributor
840
+ / MachineComment
841
+ / MachineDefinition
842
+ / MachineVersion
843
+ / MachineLicense
844
+ / MachineLanguage
845
+ / MachineTheme
846
+ / DotPreamble
847
+ / MachineFlow
848
+ / MachineHookDefinition
849
+
850
+
851
+
852
+
853
+
854
+ SdStateColor "color"
855
+ = WS? "color" WS? ":" WS? value:Color WS? ";" WS? { return { key:'color', value }; }
856
+
857
+ SdStateTextColor "text color"
858
+ = WS? "text-color" WS? ":" WS? value:Color WS? ";" WS? { return { key:'text-color', value }; }
859
+
860
+ SdStateBackgroundColor "background color"
861
+ = WS? "background-color" WS? ":" WS? value:Color WS? ";" WS? { return { key:'background-color', value }; }
862
+
863
+ SdStateBorderColor "border color"
864
+ = WS? "border-color" WS? ":" WS? value:Color WS? ";" WS? { return { key:'border-color', value }; }
865
+
866
+ SdStateShape "shape"
867
+ = WS? "shape" WS? ":" WS? value:GvizShape WS? ";" WS? { return { key:'shape', value }; }
868
+
869
+ SdStateCorners "corners"
870
+ = WS? "corners" WS? ":" WS? value:Corners WS? ";" WS? { return { key:'corners', value }; }
871
+
872
+ SdStateLineStyle "linestyle"
873
+ = WS? "linestyle" WS? ":" WS? value:LineStyle WS? ";" WS? { return { key:'linestyle', value }; }
874
+
875
+ StateDeclarationItems
876
+ = SdStateColor
877
+ / SdStateTextColor
878
+ / SdStateBackgroundColor
879
+ / SdStateBorderColor
880
+ / SdStateShape
881
+ / SdStateCorners
882
+ / SdStateLineStyle
883
+
884
+ StateDeclarationDesc
885
+ = "{" WS? items:StateDeclarationItems* WS? "}" { return items; }
886
+
887
+ StateDeclaration
888
+ = WS? "state" WS name:Label WS? ":" WS? value:StateDeclarationDesc WS? ";" WS? { return { key:'state_declaration', name, value }; }
889
+
890
+
891
+
892
+
893
+
894
+ NamedList
895
+ = WS? "&" WS? name:Label WS? ":" WS? value:LabelOrLabelList WS? ";" WS? { return { key:'named_list', name, value }; }
896
+
897
+
898
+
899
+
900
+
901
+ RegularArrangeDeclaration
902
+ = "arrange" WS? value:LabelOrLabelList WS? ";" WS? { return { key: 'arrange_declaration', value }; }
903
+
904
+ ArrangeStartDeclaration
905
+ = "arrange-start" WS? value:LabelOrLabelList WS? ";" WS? { return { key: 'arrange_start_declaration', value }; }
906
+
907
+ ArrangeEndDeclaration
908
+ = "arrange-end" WS? value:LabelOrLabelList WS? ";" WS? { return { key: 'arrange_end_declaration', value }; }
909
+
910
+ ArrangeDeclaration "arrange declaration"
911
+ = ArrangeStartDeclaration
912
+ / ArrangeEndDeclaration
913
+ / RegularArrangeDeclaration
914
+
915
+
916
+
917
+
918
+
919
+ Term
920
+ = Exp
921
+ / StateDeclaration
922
+ / ArrangeDeclaration
923
+ / NamedList
924
+ / MachineAttribute
925
+ / Config
926
+
927
+ TermList
928
+ = term:Term*