entodicton 9.5.1-beta.27 → 9.5.1-beta.29

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.
package/package.json CHANGED
@@ -72,6 +72,6 @@
72
72
  "scriptjs": "^2.5.9",
73
73
  "uuid": "^8.3.2"
74
74
  },
75
- "version": "9.5.1-beta.27",
75
+ "version": "9.5.1-beta.29",
76
76
  "license": "UNLICENSED"
77
77
  }
package/src/config.js CHANGED
@@ -21,8 +21,6 @@ const bags = [
21
21
  'semantics'
22
22
  ]
23
23
 
24
- global.GORDO = true
25
-
26
24
  const indent = (string, indent) => {
27
25
  return string.replace(/^/gm, ' '.repeat(indent))
28
26
  }
@@ -980,6 +978,7 @@ class Config {
980
978
 
981
979
  getPseudoConfig (uuid, config) {
982
980
  return {
981
+ pseudo: true,
983
982
  description: 'this is a pseudo config that has limited functionality due to being available in the initializer and fixtures function context',
984
983
  addAssociation: (...args) => this.addAssociation(...args),
985
984
  addAssociations: (...args) => this.addAssociations(...args),
@@ -993,6 +992,14 @@ class Config {
993
992
  removeSemantic: (...args) => this.removeSemantic(...args, uuid, config.name),
994
993
  addWord: (...args) => this.addWord(...args, uuid),
995
994
  addPattern: (...args) => this.addPattern(...args, uuid),
995
+ updateBridge: (...args) => this.updateBridge(...args),
996
+ processContext: (...args) => this.processContext(...args),
997
+
998
+ semantics: () => this.config.semantics,
999
+ getConfigs: () => this.configs,
1000
+ getTests: () => this.getTests(),
1001
+ getName: () => this.getName(),
1002
+ getDescription: () => this.getDescription(),
996
1003
 
997
1004
  getHierarchy: (...args) => this.config.hierarchy,
998
1005
  getBridges: (...args) => this.config.bridges,
@@ -1002,10 +1009,33 @@ class Config {
1002
1009
  fragment: (...args) => this.fragment(...args),
1003
1010
  server: (...args) => this.server(...args),
1004
1011
  exists: (...args) => this.exists(...args),
1005
- addAPI: (...args) => this.addAPI(...args)
1012
+ addAPI: (...args) => this.addAPI(...args),
1013
+
1014
+ getParenthesized: () => this.getParenthesized(),
1015
+ setParenthesized: (...args) => this.setParenthesized(...args),
1006
1016
  }
1007
1017
  }
1008
1018
 
1019
+ getName() {
1020
+ return this.name
1021
+ }
1022
+
1023
+ getDescription() {
1024
+ return this.description
1025
+ }
1026
+
1027
+ getTests() {
1028
+ return this.tests
1029
+ }
1030
+
1031
+ getParenthesized(value) {
1032
+ return this.parenthesized
1033
+ }
1034
+
1035
+ setParenthesized(value) {
1036
+ this.parenthesized = value
1037
+ }
1038
+
1009
1039
  inDevelopmentMode (call) {
1010
1040
  config.developmentModeOn += 1
1011
1041
  try {
@@ -1964,14 +1994,6 @@ class Config {
1964
1994
  } else if (this.scope == 'development') {
1965
1995
  new_result = !(element.scope === 'testing')
1966
1996
  }
1967
- /*
1968
- if (global.GORDO && old_result !== new_result) {
1969
- global.GORDO = false
1970
- console.log("THERE WAS A DIFFERENCE ------------------------------------------------")
1971
- debugger // greg23old
1972
- }
1973
- */
1974
- // return old_result
1975
1997
  return new_result
1976
1998
  }
1977
1999
 
@@ -112,7 +112,7 @@ const setupArgs = (args, config, logs, hierarchy, uuidForScoping) => {
112
112
  throw new ErrorReason(context)
113
113
  }
114
114
  args.kms = config.getConfigs()
115
- args.config = config
115
+ args.config = config.getPseudoConfig(uuidForScoping, config)
116
116
  args.hierarchy = hierarchy
117
117
  args.isA = isA(hierarchy)
118
118
  // args.listable = listable(hierarchy)
@@ -406,21 +406,21 @@ const processContextsB = async ({ config, hierarchy, semantics, generators, json
406
406
  const generated = contextPrime.isResponse ? await config.getGenerators(json.logs).apply({ ...args, assumed }, contextPrime, assumed) : ''
407
407
  let generatedParenthesized = []
408
408
  if (generateParenthesized) {
409
- config.parenthesized = true
409
+ config.setParenthesized(true)
410
410
  generatedParenthesized = contextPrime.isResponse ? await config.getGenerators(json.logs).apply({ ...args, assumed }, contextPrime, assumed) : ''
411
- config.parenthesized = false
411
+ config.setParenthesized(false)
412
412
  }
413
413
  // assumed = { paraphrase: true, response: false };
414
414
  assumed = { paraphrase: true, isResponse: false, response: false }
415
415
  if (generateParenthesized) {
416
- config.parenthesized = false
416
+ config.setParenthesized(false)
417
417
  }
418
418
  const paraphrases = await config.getGenerators(json.logs).apply({ ...args, assumed }, contextPrime, assumed)
419
419
  let paraphrasesParenthesized = []
420
420
  if (generateParenthesized) {
421
- config.parenthesized = true
421
+ config.setParenthesized(true)
422
422
  paraphrasesParenthesized = await config.getGenerators(json.logs).apply({ ...args, assumed }, contextPrime, assumed)
423
- config.parenthesized = false
423
+ config.setParenthesized(false)
424
424
  }
425
425
  contextsPrime.push(contextPrime)
426
426
  generatedPrime.push(generated)
package/src/generators.js CHANGED
@@ -275,7 +275,11 @@ class Generators {
275
275
  lines.setElement(0, 2, JSON.stringify(context, null, 2))
276
276
  this.logs.push(lines.toString())
277
277
  }
278
- return ((config || {}).parenthesized ? '(' + generated + ')' : generated)
278
+ let parenthesized = false
279
+ if (config && config.getParenthesized()) {
280
+ parenthesized = true
281
+ }
282
+ return parenthesized ? '(' + generated + ')' : generated
279
283
  }
280
284
  }
281
285
 
package/src/semantics.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const { args: contextArgs, normalizeGenerator, normalizeSemantic } = require('./helpers')
2
2
  const Lines = require('../lines')
3
3
  const helpers = require('./helpers')
4
+ const debug = require('./debug')
4
5
 
5
6
  class Semantic {
6
7
  // constructor ({match, apply, uuid, index, km, notes}) {