proschi 0.2.0 → 0.4.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.
@@ -9,6 +9,12 @@
9
9
  {
10
10
  "include": "#comment"
11
11
  },
12
+ {
13
+ "include": "#section"
14
+ },
15
+ {
16
+ "include": "#decision-line"
17
+ },
12
18
  {
13
19
  "include": "#label"
14
20
  },
@@ -21,6 +27,9 @@
21
27
  {
22
28
  "include": "#keyword"
23
29
  },
30
+ {
31
+ "include": "#node-id"
32
+ },
24
33
  {
25
34
  "include": "#string"
26
35
  },
@@ -36,6 +45,9 @@
36
45
  {
37
46
  "include": "#position"
38
47
  },
48
+ {
49
+ "include": "#replicas"
50
+ },
39
51
  {
40
52
  "include": "#brace"
41
53
  },
@@ -175,6 +187,18 @@
175
187
  {
176
188
  "include": "#comment"
177
189
  },
190
+ {
191
+ "comment": "`x200` (fan-out) and `~2MB` (payload size) at the start of a step label, in either order.",
192
+ "match": "\\G\\s*(x\\d+|~\\d+(?:\\.\\d+)?[KMGT]?B)(?=\\s|$)(?:\\s+(x\\d+|~\\d+(?:\\.\\d+)?[KMGT]?B)(?=\\s|$))?",
193
+ "captures": {
194
+ "1": {
195
+ "name": "constant.numeric.label-prefix.proschi"
196
+ },
197
+ "2": {
198
+ "name": "constant.numeric.label-prefix.proschi"
199
+ }
200
+ }
201
+ },
178
202
  {
179
203
  "include": "#payload"
180
204
  },
@@ -280,6 +304,104 @@
280
304
  "match": "[,:]"
281
305
  }
282
306
  ]
307
+ },
308
+ "node-id": {
309
+ "comment": "The id that starts a node declaration or connection.",
310
+ "match": "^\\s*([A-Za-z_][A-Za-z0-9_]*)\\b",
311
+ "captures": {
312
+ "1": {
313
+ "name": "variable.other.node.proschi"
314
+ }
315
+ }
316
+ },
317
+ "replicas": {
318
+ "comment": "`x3` after a node id: its replica count.",
319
+ "name": "constant.numeric.replicas.proschi",
320
+ "match": "(?<=\\s)x\\d+(?![A-Za-z0-9_])"
321
+ },
322
+ "section": {
323
+ "comment": "traffic, requirements, capacity, entity, decision and test blocks: top level, opened by a header line that ends with {, closed by a line starting with }.",
324
+ "name": "meta.block.section.proschi",
325
+ "begin": "^\\s*(?:(traffic|requirements|capacity)(?=\\s*\\{)|(entity)(?=\\s+[A-Za-z_])|(decision|test)(?=\\s+\"))(?=.*\\{\\s*(?:#.*)?$)",
326
+ "end": "^\\s*(\\})",
327
+ "beginCaptures": {
328
+ "1": {
329
+ "name": "keyword.control.proschi"
330
+ },
331
+ "2": {
332
+ "name": "keyword.control.proschi"
333
+ },
334
+ "3": {
335
+ "name": "keyword.control.proschi"
336
+ }
337
+ },
338
+ "endCaptures": {
339
+ "1": {
340
+ "name": "punctuation.section.block.end.proschi"
341
+ }
342
+ },
343
+ "patterns": [
344
+ {
345
+ "include": "#comment"
346
+ },
347
+ {
348
+ "include": "#string"
349
+ },
350
+ {
351
+ "include": "#tech"
352
+ },
353
+ {
354
+ "include": "#section-keyword"
355
+ },
356
+ {
357
+ "include": "#quantity"
358
+ },
359
+ {
360
+ "name": "keyword.operator.comparison.proschi",
361
+ "match": "[<>]=?"
362
+ },
363
+ {
364
+ "name": "punctuation.separator.comma.proschi",
365
+ "match": ","
366
+ },
367
+ {
368
+ "name": "punctuation.section.block.begin.proschi",
369
+ "match": "\\{"
370
+ },
371
+ {
372
+ "include": "#identifier"
373
+ }
374
+ ]
375
+ },
376
+ "decision-line": {
377
+ "comment": "The one-line decision \"Title\" because \"Reason\".",
378
+ "begin": "^\\s*(decision)(?=\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s+because\\b)",
379
+ "end": "$",
380
+ "beginCaptures": {
381
+ "1": {
382
+ "name": "keyword.control.proschi"
383
+ }
384
+ },
385
+ "patterns": [
386
+ {
387
+ "include": "#comment"
388
+ },
389
+ {
390
+ "include": "#string"
391
+ },
392
+ {
393
+ "include": "#section-keyword"
394
+ }
395
+ ]
396
+ },
397
+ "section-keyword": {
398
+ "name": "keyword.other.proschi",
399
+ "match": "\\b(?:traffic|requirements|capacity|entity|decision|test|mix|durable|volatile|survive|because|rejected|calls|before|after|never|every|waits|for|starts|at|or|responds|writes|reads|responding|handles|failure|path|replicas|any|strong|eventual|store|in|scenario|latency|availability|cost|shards|consistency|bandwidth|egress|no|from|to|has|of|node|key|index|unique|optional|p50|p90|p95|p99|p999)\\b"
400
+ },
401
+ "quantity": {
402
+ "comment": "A number with an optional fraction, magnitude and unit, attached or one space away: 120, 2.5, 50ms, 100k rps, 99.9%, 4xx, 500 MB/s, 0.05 usd/GB.",
403
+ "name": "constant.numeric.proschi",
404
+ "match": "\\b\\d+(?:\\.\\d+)?(?:[A-Za-z]+(?:/[A-Za-z]+)?|%)?(?: (?:rps|rpm|rpd|ms|s|usd/month|usd/GB|MB/s|GB/s)\\b| %)?"
283
405
  }
284
406
  }
285
407
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proschi",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Command-line checker and language server for Proschi architecture diagrams",
5
5
  "license": "MIT",
6
6
  "repository": {