ekms 9.6.3-beta.14 → 9.6.3-beta.16

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.
@@ -4,12 +4,55 @@
4
4
  "name": "actions",
5
5
  "operators": [
6
6
  "([doAction|do] ([action]))",
7
- "((action) <again>)"
7
+ "((action) <again>)",
8
+ "((action) [thenAction|then] (action))"
8
9
  ],
9
10
  "bridges": [
10
11
  {
11
12
  "id": "action"
12
13
  },
14
+ {
15
+ "id": "thenAction",
16
+ "level": 0,
17
+ "isA": [
18
+ "action"
19
+ ],
20
+ "before": [
21
+ "doAction"
22
+ ],
23
+ "selector": {
24
+ "match": "same",
25
+ "left": [
26
+ {
27
+ "pattern": "(action))"
28
+ }
29
+ ],
30
+ "right": [
31
+ {
32
+ "pattern": "(action)"
33
+ }
34
+ ],
35
+ "passthrough": true
36
+ },
37
+ "bridge": "{ \n ...next(operator),\n operator: operator, \n listable: true, \n isList: true, \n before: before, \n after: after, \n value: append(before, after)\n }"
38
+ },
39
+ {
40
+ "id": "thenAction",
41
+ "level": 1,
42
+ "before": [
43
+ "doAction"
44
+ ],
45
+ "selector": {
46
+ "left": [
47
+ {
48
+ "pattern": "(action)"
49
+ }
50
+ ],
51
+ "passthrough": true
52
+ },
53
+ "bridge": "{ ...next(operator), value: append(before, operator.value) }",
54
+ "semantic": "async ({context, toArray, s}) => {\n for (const action of toArray(context)) {\n await s(action)\n }\n }"
55
+ },
13
56
  {
14
57
  "id": "again",
15
58
  "bridge": "{\n ...before[0],\n action: before[0],\n again: operator,\n interpolate: [{ property: 'action' }, { property: 'again' }]\n }"
@@ -38,6 +81,25 @@
38
81
  "bridge": "{\n ...next(operator),\n operator: operator,\n action: after[0],\n interpolate: [{ property: 'operator' }, { property: 'action' }]\n }"
39
82
  }
40
83
  ],
84
+ "words": {
85
+ "patterns": [
86
+ {
87
+ "pattern": [
88
+ "action",
89
+ {
90
+ "type": "digit"
91
+ }
92
+ ],
93
+ "allow_partial_matches": false,
94
+ "defs": [
95
+ {
96
+ "id": "action",
97
+ "initial": "{ value: text, instance: true, dead: true }"
98
+ }
99
+ ]
100
+ }
101
+ ]
102
+ },
41
103
  "semantics": [
42
104
  {
43
105
  "match": "({context, isA}) => isA(context.marker, 'action')",
@@ -52,12 +114,54 @@
52
114
  "name": "actions",
53
115
  "operators": [
54
116
  "([doAction|do] ([action]))",
55
- "((action) <again>)"
117
+ "((action) <again>)",
118
+ "((action) [thenAction|then] (action))"
56
119
  ],
57
120
  "bridges": [
58
121
  {
59
122
  "id": "action"
60
123
  },
124
+ {
125
+ "id": "thenAction",
126
+ "level": 0,
127
+ "isA": [
128
+ "action"
129
+ ],
130
+ "before": [
131
+ "doAction"
132
+ ],
133
+ "selector": {
134
+ "match": "same",
135
+ "left": [
136
+ {
137
+ "pattern": "(action))"
138
+ }
139
+ ],
140
+ "right": [
141
+ {
142
+ "pattern": "(action)"
143
+ }
144
+ ],
145
+ "passthrough": true
146
+ },
147
+ "bridge": "{ \n ...next(operator),\n operator: operator, \n listable: true, \n isList: true, \n before: before, \n after: after, \n value: append(before, after)\n }"
148
+ },
149
+ {
150
+ "id": "thenAction",
151
+ "level": 1,
152
+ "before": [
153
+ "doAction"
154
+ ],
155
+ "selector": {
156
+ "left": [
157
+ {
158
+ "pattern": "(action)"
159
+ }
160
+ ],
161
+ "passthrough": true
162
+ },
163
+ "bridge": "{ ...next(operator), value: append(before, operator.value) }"
164
+ },
61
165
  {
62
166
  "id": "again",
63
167
  "bridge": "{\n ...before[0],\n action: before[0],\n again: operator,\n interpolate: [{ property: 'action' }, { property: 'again' }]\n }"
@@ -86,6 +190,25 @@
86
190
  "bridge": "{\n ...next(operator),\n operator: operator,\n action: after[0],\n interpolate: [{ property: 'operator' }, { property: 'action' }]\n }"
87
191
  }
88
192
  ],
193
+ "words": {
194
+ "patterns": [
195
+ {
196
+ "pattern": [
197
+ "action",
198
+ {
199
+ "type": "digit"
200
+ }
201
+ ],
202
+ "allow_partial_matches": false,
203
+ "defs": [
204
+ {
205
+ "id": "action",
206
+ "initial": "{ value: text, instance: true, dead: true }"
207
+ }
208
+ ]
209
+ }
210
+ ]
211
+ },
89
212
  "semantics": [
90
213
  {
91
214
  "priority": -1
package/common/actions.js CHANGED
@@ -5,16 +5,60 @@ const time = require("./time")
5
5
  const tests = require('./actions.test.json')
6
6
  const instance = require('./actions.instance.json')
7
7
 
8
+ /*
9
+ do patrol 1 then patrol 2 then patrol 3
10
+ do patrol 1 patrol 2 and then patrol 3
11
+ */
12
+
8
13
  const config = {
9
14
  name: 'actions',
10
15
  operators: [
11
16
  "([doAction|do] ([action]))",
12
17
  "((action) <again>)",
18
+ "((action) [thenAction|then] (action))",
13
19
  ],
14
20
  bridges: [
15
21
  {
16
22
  id: 'action',
23
+ // isA: ['thisitthat'],
24
+ },
25
+ {
26
+ id: "thenAction",
27
+ level: 0,
28
+ isA: ['action'],
29
+ before: ['doAction'],
30
+ selector: {
31
+ match: "same",
32
+ left: [ { pattern: '(action))' } ],
33
+ right: [ { pattern: '(action)' } ],
34
+ passthrough: true
35
+ },
36
+ bridge: `{
37
+ ...next(operator),
38
+ operator: operator,
39
+ listable: true,
40
+ isList: true,
41
+ before: before,
42
+ after: after,
43
+ value: append(before, after)
44
+ }`
17
45
  },
46
+ {
47
+ id: "thenAction",
48
+ level: 1,
49
+ before: ['doAction'],
50
+ selector: {
51
+ left: [ { pattern: '(action)' } ],
52
+ passthrough: true
53
+ },
54
+ bridge: "{ ...next(operator), value: append(before, operator.value) }",
55
+ semantic: async ({context, toArray, s}) => {
56
+ for (const action of toArray(context)) {
57
+ await s(action)
58
+ }
59
+ },
60
+ },
61
+
18
62
  {
19
63
  id: 'again',
20
64
  bridge: `{
@@ -36,6 +80,11 @@ const config = {
36
80
  }`,
37
81
  },
38
82
  ],
83
+ words: {
84
+ patterns: [
85
+ { "pattern": ["action", { type: 'digit' }], allow_partial_matches: false, defs: [{id: "action", initial: "{ value: text, instance: true, dead: true }" }]},
86
+ ],
87
+ },
39
88
  semantics: [
40
89
  {
41
90
  priority: -1,