proschi 0.2.0 → 0.3.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
  },
@@ -280,6 +292,104 @@
280
292
  "match": "[,:]"
281
293
  }
282
294
  ]
295
+ },
296
+ "node-id": {
297
+ "comment": "The id that starts a node declaration or connection.",
298
+ "match": "^\\s*([A-Za-z_][A-Za-z0-9_]*)\\b",
299
+ "captures": {
300
+ "1": {
301
+ "name": "variable.other.node.proschi"
302
+ }
303
+ }
304
+ },
305
+ "replicas": {
306
+ "comment": "`x3` after a node id: its replica count.",
307
+ "name": "constant.numeric.replicas.proschi",
308
+ "match": "(?<=\\s)x\\d+(?![A-Za-z0-9_])"
309
+ },
310
+ "section": {
311
+ "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 }.",
312
+ "name": "meta.block.section.proschi",
313
+ "begin": "^\\s*(?:(traffic|requirements|capacity)(?=\\s*\\{)|(entity)(?=\\s+[A-Za-z_])|(decision|test)(?=\\s+\"))(?=.*\\{\\s*(?:#.*)?$)",
314
+ "end": "^\\s*(\\})",
315
+ "beginCaptures": {
316
+ "1": {
317
+ "name": "keyword.control.proschi"
318
+ },
319
+ "2": {
320
+ "name": "keyword.control.proschi"
321
+ },
322
+ "3": {
323
+ "name": "keyword.control.proschi"
324
+ }
325
+ },
326
+ "endCaptures": {
327
+ "1": {
328
+ "name": "punctuation.section.block.end.proschi"
329
+ }
330
+ },
331
+ "patterns": [
332
+ {
333
+ "include": "#comment"
334
+ },
335
+ {
336
+ "include": "#string"
337
+ },
338
+ {
339
+ "include": "#tech"
340
+ },
341
+ {
342
+ "include": "#section-keyword"
343
+ },
344
+ {
345
+ "include": "#quantity"
346
+ },
347
+ {
348
+ "name": "keyword.operator.comparison.proschi",
349
+ "match": "[<>]=?"
350
+ },
351
+ {
352
+ "name": "punctuation.separator.comma.proschi",
353
+ "match": ","
354
+ },
355
+ {
356
+ "name": "punctuation.section.block.begin.proschi",
357
+ "match": "\\{"
358
+ },
359
+ {
360
+ "include": "#identifier"
361
+ }
362
+ ]
363
+ },
364
+ "decision-line": {
365
+ "comment": "The one-line decision \"Title\" because \"Reason\".",
366
+ "begin": "^\\s*(decision)(?=\\s+\"(?:[^\"\\\\]|\\\\.)*\"\\s+because\\b)",
367
+ "end": "$",
368
+ "beginCaptures": {
369
+ "1": {
370
+ "name": "keyword.control.proschi"
371
+ }
372
+ },
373
+ "patterns": [
374
+ {
375
+ "include": "#comment"
376
+ },
377
+ {
378
+ "include": "#string"
379
+ },
380
+ {
381
+ "include": "#section-keyword"
382
+ }
383
+ ]
384
+ },
385
+ "section-keyword": {
386
+ "name": "keyword.other.proschi",
387
+ "match": "\\b(?:traffic|requirements|capacity|entity|decision|test|mix|durable|volatile|survive|because|rejected|calls|before|never|every|responds|writes|responding|handles|failure|path|replicas|any|in|scenario|latency|availability|cost|no|from|to|has|of|node|key|index|unique|optional|p50|p90|p95|p99|p999)\\b"
388
+ },
389
+ "quantity": {
390
+ "comment": "A number with an optional fraction, magnitude and unit, attached or one space away: 120, 2.5, 50ms, 100k rps, 99.9%, 4xx.",
391
+ "name": "constant.numeric.proschi",
392
+ "match": "\\b\\d+(?:\\.\\d+)?(?:[A-Za-z]+(?:/[A-Za-z]+)?|%)?(?: (?:rps|rpm|rpd|ms|s|usd/month)\\b| %)?"
283
393
  }
284
394
  }
285
395
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proschi",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Command-line checker and language server for Proschi architecture diagrams",
5
5
  "license": "MIT",
6
6
  "repository": {