theprogrammablemind_4wp 7.5.8-beta.4 → 7.5.8-beta.40
Sign up to get free protection for your applications and to get access to all the features.
- package/client.js +125 -53
- package/index.js +1 -0
- package/package.json +1 -1
- package/src/config.js +428 -213
- package/src/flatten.js +9 -1
- package/src/helpers.js +1 -1
- package/src/semantics.js +6 -1
package/src/flatten.js
CHANGED
@@ -89,7 +89,15 @@ const flatten = (markers, value) => {
|
|
89
89
|
const split = markers.includes(marker)
|
90
90
|
if (split) {
|
91
91
|
if ('value' in properties) {
|
92
|
-
|
92
|
+
flattenedValues = []
|
93
|
+
for (let v of properties.value) {
|
94
|
+
if (v.flatten) {
|
95
|
+
flattenedValues = flattenedValues.concat(flatten(markers, v)[0])
|
96
|
+
} else {
|
97
|
+
flattenedValues.push(v)
|
98
|
+
}
|
99
|
+
}
|
100
|
+
return [flattenedValues, true]
|
93
101
|
} else {
|
94
102
|
return [[value], false]
|
95
103
|
}
|
package/src/helpers.js
CHANGED
package/src/semantics.js
CHANGED
@@ -6,7 +6,7 @@ class Semantic {
|
|
6
6
|
// constructor ({match, apply, uuid, index, km, notes}) {
|
7
7
|
constructor (semantic) {
|
8
8
|
semantic = normalizeSemantic(semantic)
|
9
|
-
const { match, apply, uuid, index, km, notes, priority, debug, where, applyWrapped, property } = semantic
|
9
|
+
const { match, apply, uuid, index, km, notes, priority, debug, where, applyWrapped, property, oneShot, id } = semantic
|
10
10
|
this.matcher = match
|
11
11
|
this._apply = apply
|
12
12
|
this._applyWrapped = applyWrapped
|
@@ -18,6 +18,8 @@ class Semantic {
|
|
18
18
|
this.notes = notes
|
19
19
|
this.callId = debug
|
20
20
|
this.where = where
|
21
|
+
this.oneShot = oneShot
|
22
|
+
this.id = id
|
21
23
|
}
|
22
24
|
|
23
25
|
toLabel () {
|
@@ -197,6 +199,9 @@ class Semantics {
|
|
197
199
|
const log = (message) => { this.logs.push(message) }
|
198
200
|
try {
|
199
201
|
contextPrime = semantic.apply(args, context, s, log, options)
|
202
|
+
if (!contextPrime.controlKeepMotivation && semantic.oneShot) {
|
203
|
+
args.config.removeSemantic(semantic)
|
204
|
+
}
|
200
205
|
} catch( e ) {
|
201
206
|
contextPrime = null
|
202
207
|
let errorMessage
|