@mmmnt/feat-grammar 0.1.6 → 0.1.7

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 (2) hide show
  1. package/feat.tmLanguage.json +181 -58
  2. package/package.json +1 -1
@@ -3,18 +3,42 @@
3
3
  "name": "Feat",
4
4
  "scopeName": "source.feat",
5
5
  "patterns": [
6
- { "include": "#comment" },
7
- { "include": "#pragma" },
8
- { "include": "#identity" },
9
- { "include": "#sections" },
10
- { "include": "#scenario" },
11
- { "include": "#trigger" },
12
- { "include": "#prediction" },
13
- { "include": "#matchers" },
14
- { "include": "#refs" },
15
- { "include": "#placeholders" },
16
- { "include": "#strings" },
17
- { "include": "#numbers" }
6
+ {
7
+ "include": "#comment"
8
+ },
9
+ {
10
+ "include": "#pragma"
11
+ },
12
+ {
13
+ "include": "#identity"
14
+ },
15
+ {
16
+ "include": "#sections"
17
+ },
18
+ {
19
+ "include": "#scenario"
20
+ },
21
+ {
22
+ "include": "#trigger"
23
+ },
24
+ {
25
+ "include": "#prediction"
26
+ },
27
+ {
28
+ "include": "#matchers"
29
+ },
30
+ {
31
+ "include": "#refs"
32
+ },
33
+ {
34
+ "include": "#placeholders"
35
+ },
36
+ {
37
+ "include": "#strings"
38
+ },
39
+ {
40
+ "include": "#numbers"
41
+ }
18
42
  ],
19
43
  "repository": {
20
44
  "comment": {
@@ -24,8 +48,12 @@
24
48
  "pragma": {
25
49
  "match": "^(feat)\\s+(\\d+\\.\\d+)\\s*$",
26
50
  "captures": {
27
- "1": { "name": "keyword.control.pragma.feat" },
28
- "2": { "name": "constant.numeric.version.feat" }
51
+ "1": {
52
+ "name": "keyword.control.pragma.feat"
53
+ },
54
+ "2": {
55
+ "name": "constant.numeric.version.feat"
56
+ }
29
57
  }
30
58
  },
31
59
  "identity": {
@@ -33,30 +61,48 @@
33
61
  {
34
62
  "match": "^(spec)\\s+([A-Z0-9-]+)\\s+(\".*\")",
35
63
  "captures": {
36
- "1": { "name": "keyword.declaration.spec.feat" },
37
- "2": { "name": "entity.name.type.spec-id.feat" },
38
- "3": { "name": "string.quoted.double.feat" }
64
+ "1": {
65
+ "name": "keyword.declaration.spec.feat"
66
+ },
67
+ "2": {
68
+ "name": "entity.name.type.spec-id.feat"
69
+ },
70
+ "3": {
71
+ "name": "string.quoted.double.feat"
72
+ }
39
73
  }
40
74
  },
41
75
  {
42
76
  "match": "^(context|aggregate)\\s+(\\S+)",
43
77
  "captures": {
44
- "1": { "name": "keyword.declaration.feat" },
45
- "2": { "name": "entity.name.namespace.feat" }
78
+ "1": {
79
+ "name": "keyword.declaration.feat"
80
+ },
81
+ "2": {
82
+ "name": "entity.name.namespace.feat"
83
+ }
46
84
  }
47
85
  },
48
86
  {
49
87
  "match": "^(type)\\s+(command|query|infrastructure|integration|scaffold|projection|policy|saga)\\b",
50
88
  "captures": {
51
- "1": { "name": "keyword.declaration.feat" },
52
- "2": { "name": "constant.language.spec-type.feat" }
89
+ "1": {
90
+ "name": "keyword.declaration.feat"
91
+ },
92
+ "2": {
93
+ "name": "constant.language.spec-type.feat"
94
+ }
53
95
  }
54
96
  },
55
97
  {
56
98
  "match": "^(status)\\s+(draft|agreed|built|verified)\\b",
57
99
  "captures": {
58
- "1": { "name": "keyword.declaration.feat" },
59
- "2": { "name": "constant.language.status.feat" }
100
+ "1": {
101
+ "name": "keyword.declaration.feat"
102
+ },
103
+ "2": {
104
+ "name": "constant.language.status.feat"
105
+ }
60
106
  }
61
107
  }
62
108
  ]
@@ -65,11 +111,19 @@
65
111
  "patterns": [
66
112
  {
67
113
  "match": "^(construct|enforce|contract|given)\\s*:",
68
- "captures": { "1": { "name": "keyword.control.section.feat" } }
114
+ "captures": {
115
+ "1": {
116
+ "name": "keyword.control.section.feat"
117
+ }
118
+ }
69
119
  },
70
120
  {
71
121
  "match": "^\\s+(handler at|touches|imports|input|response|record|event|error|rejects|clock at|execute)\\b",
72
- "captures": { "1": { "name": "keyword.other.directive.feat" } }
122
+ "captures": {
123
+ "1": {
124
+ "name": "keyword.other.directive.feat"
125
+ }
126
+ }
73
127
  }
74
128
  ]
75
129
  },
@@ -78,14 +132,24 @@
78
132
  {
79
133
  "match": "^(scenario)(\\s+outline)?\\s+(\".*\")\\s*:",
80
134
  "captures": {
81
- "1": { "name": "keyword.control.scenario.feat" },
82
- "2": { "name": "keyword.control.scenario.feat" },
83
- "3": { "name": "string.quoted.double.scenario-name.feat" }
135
+ "1": {
136
+ "name": "keyword.control.scenario.feat"
137
+ },
138
+ "2": {
139
+ "name": "keyword.control.scenario.feat"
140
+ },
141
+ "3": {
142
+ "name": "string.quoted.double.scenario-name.feat"
143
+ }
84
144
  }
85
145
  },
86
146
  {
87
147
  "match": "^\\s+(examples)\\s*:",
88
- "captures": { "1": { "name": "keyword.control.section.feat" } }
148
+ "captures": {
149
+ "1": {
150
+ "name": "keyword.control.section.feat"
151
+ }
152
+ }
89
153
  }
90
154
  ]
91
155
  },
@@ -94,24 +158,40 @@
94
158
  {
95
159
  "match": "^\\s+(when)\\s*:\\s*([A-Z][A-Za-z0-9]*)",
96
160
  "captures": {
97
- "1": { "name": "keyword.control.trigger.feat" },
98
- "2": { "name": "entity.name.function.command.feat" }
161
+ "1": {
162
+ "name": "keyword.control.trigger.feat"
163
+ },
164
+ "2": {
165
+ "name": "entity.name.function.command.feat"
166
+ }
99
167
  }
100
168
  },
101
169
  {
102
170
  "match": "^\\s+(deliver)\\s+([A-Z][A-Za-z0-9]*)\\s.*\\b(to)\\s+(\\w+)",
103
171
  "captures": {
104
- "1": { "name": "keyword.control.trigger.feat" },
105
- "2": { "name": "entity.name.function.event.feat" },
106
- "3": { "name": "keyword.control.trigger.feat" },
107
- "4": { "name": "variable.other.service.feat" }
172
+ "1": {
173
+ "name": "keyword.control.trigger.feat"
174
+ },
175
+ "2": {
176
+ "name": "entity.name.function.event.feat"
177
+ },
178
+ "3": {
179
+ "name": "keyword.control.trigger.feat"
180
+ },
181
+ "4": {
182
+ "name": "variable.other.service.feat"
183
+ }
108
184
  }
109
185
  },
110
186
  {
111
187
  "match": "\\b(as)\\s+(\\w+)",
112
188
  "captures": {
113
- "1": { "name": "keyword.other.actor.feat" },
114
- "2": { "name": "variable.other.actor.feat" }
189
+ "1": {
190
+ "name": "keyword.other.actor.feat"
191
+ },
192
+ "2": {
193
+ "name": "variable.other.actor.feat"
194
+ }
115
195
  }
116
196
  }
117
197
  ]
@@ -121,41 +201,71 @@
121
201
  {
122
202
  "match": "^\\s+(predict)\\s+(success|error)\\b(\\s+[A-Z0-9_]+)?",
123
203
  "captures": {
124
- "1": { "name": "keyword.control.predict.feat" },
125
- "2": { "name": "constant.language.prediction-type.feat" },
126
- "3": { "name": "constant.other.error-code.feat" }
204
+ "1": {
205
+ "name": "keyword.control.predict.feat"
206
+ },
207
+ "2": {
208
+ "name": "constant.language.prediction-type.feat"
209
+ },
210
+ "3": {
211
+ "name": "constant.other.error-code.feat"
212
+ }
127
213
  }
128
214
  },
129
215
  {
130
216
  "match": "^\\s+(predict)\\s+(rejection)\\s+(<?[A-Za-z0-9_-]+>?)",
131
217
  "captures": {
132
- "1": { "name": "keyword.control.predict.feat" },
133
- "2": { "name": "constant.language.prediction-type.feat" },
134
- "3": { "name": "constant.other.rejection-id.feat" }
218
+ "1": {
219
+ "name": "keyword.control.predict.feat"
220
+ },
221
+ "2": {
222
+ "name": "constant.language.prediction-type.feat"
223
+ },
224
+ "3": {
225
+ "name": "constant.other.rejection-id.feat"
226
+ }
135
227
  }
136
228
  },
137
229
  {
138
230
  "match": "^\\s+(response)\\s+(\\w+)\\s+([A-Z][A-Za-z0-9]*)",
139
231
  "captures": {
140
- "1": { "name": "keyword.other.response.feat" },
141
- "2": { "name": "constant.numeric.status.feat" },
142
- "3": { "name": "entity.name.type.schema.feat" }
232
+ "1": {
233
+ "name": "keyword.other.response.feat"
234
+ },
235
+ "2": {
236
+ "name": "constant.numeric.status.feat"
237
+ },
238
+ "3": {
239
+ "name": "entity.name.type.schema.feat"
240
+ }
143
241
  }
144
242
  },
145
243
  {
146
244
  "match": "^\\s+(\\w+)\\s+(has|contains)\\s+(ordered|unordered)?",
147
245
  "captures": {
148
- "1": { "name": "variable.other.service.feat" },
149
- "2": { "name": "keyword.other.assertion.feat" },
150
- "3": { "name": "keyword.other.ordering.feat" }
246
+ "1": {
247
+ "name": "variable.other.service.feat"
248
+ },
249
+ "2": {
250
+ "name": "keyword.other.assertion.feat"
251
+ },
252
+ "3": {
253
+ "name": "keyword.other.ordering.feat"
254
+ }
151
255
  }
152
256
  },
153
257
  {
154
258
  "match": "\\b([A-Z][A-Za-z0-9_]*)\\s+(with)\\s+([A-Z][A-Za-z0-9]*)",
155
259
  "captures": {
156
- "1": { "name": "entity.name.type.record.feat" },
157
- "2": { "name": "keyword.other.with.feat" },
158
- "3": { "name": "entity.name.type.schema.feat" }
260
+ "1": {
261
+ "name": "entity.name.type.record.feat"
262
+ },
263
+ "2": {
264
+ "name": "keyword.other.with.feat"
265
+ },
266
+ "3": {
267
+ "name": "entity.name.type.schema.feat"
268
+ }
159
269
  }
160
270
  }
161
271
  ]
@@ -165,11 +275,18 @@
165
275
  {
166
276
  "match": "\\b(any)\\s+(uuid|timestamp|string|number|boolean)\\b",
167
277
  "captures": {
168
- "1": { "name": "support.function.matcher.feat" },
169
- "2": { "name": "support.type.matcher.feat" }
278
+ "1": {
279
+ "name": "support.function.matcher.feat"
280
+ },
281
+ "2": {
282
+ "name": "support.type.matcher.feat"
283
+ }
170
284
  }
171
285
  },
172
- { "match": "\\b(matching|absent)\\b", "name": "support.function.matcher.feat" },
286
+ {
287
+ "match": "\\b(matching|absent)\\b",
288
+ "name": "support.function.matcher.feat"
289
+ },
173
290
  {
174
291
  "match": "\\b(equals fixture)\\b",
175
292
  "name": "support.function.matcher.feat"
@@ -179,15 +296,21 @@
179
296
  "refs": {
180
297
  "patterns": [
181
298
  {
182
- "match": "@(when|deliver)(\\[\\d+\\])?(\\.[A-Za-z0-9_.]+)?",
299
+ "match": "@(when|deliver|given|[A-Za-z][A-Za-z0-9_-]*)(\\[\\d+\\])?(\\.[A-Za-z0-9_.]+)?",
183
300
  "name": "variable.language.stimulus-ref.feat"
184
301
  }
185
302
  ]
186
303
  },
187
304
  "placeholders": {
188
305
  "patterns": [
189
- { "match": "\\{\\$[A-Za-z_][A-Za-z0-9_]*\\}", "name": "variable.parameter.placeholder.feat" },
190
- { "match": "<[A-Za-z_][A-Za-z0-9_-]*>", "name": "variable.parameter.placeholder.feat" }
306
+ {
307
+ "match": "\\{\\$[A-Za-z_][A-Za-z0-9_]*\\}",
308
+ "name": "variable.parameter.placeholder.feat"
309
+ },
310
+ {
311
+ "match": "<[A-Za-z_][A-Za-z0-9_-]*>",
312
+ "name": "variable.parameter.placeholder.feat"
313
+ }
191
314
  ]
192
315
  },
193
316
  "strings": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmmnt/feat-grammar",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "TextMate grammar for the .feat execution specification language — powers editor extensions, Shiki, and any TextMate-compatible highlighter",
5
5
  "type": "module",
6
6
  "main": "index.js",