@sdeverywhere/cli 0.7.14 → 0.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdeverywhere/cli",
3
- "version": "0.7.14",
3
+ "version": "0.7.16",
4
4
  "description": "Contains the `sde` command line interface for the SDEverywhere tool suite.",
5
5
  "type": "module",
6
6
  "files": [
@@ -11,8 +11,8 @@
11
11
  "sde": "src/main.js"
12
12
  },
13
13
  "dependencies": {
14
- "@sdeverywhere/build": "^0.3.2",
15
- "@sdeverywhere/compile": "^0.7.9",
14
+ "@sdeverywhere/build": "^0.3.3",
15
+ "@sdeverywhere/compile": "^0.7.11",
16
16
  "bufx": "^1.0.5",
17
17
  "byline": "^5.0.0",
18
18
  "ramda": "^0.27.0",
package/src/sde-causes.js CHANGED
@@ -24,8 +24,8 @@ let causes = (model, varname, opts) => {
24
24
  let input = preprocessModel(modelPathname, spec)
25
25
  // Parse the model to get variable and subscript information.
26
26
  let parseTree = parseModel(input)
27
- let operation = 'printRefGraph'
28
- generateCode(parseTree, { spec, operation, extData, directData, modelDirname, varname })
27
+ let operations = ['printRefGraph']
28
+ generateCode(parseTree, { spec, operations, extData, directData, modelDirname, varname })
29
29
  }
30
30
  export default {
31
31
  command,
@@ -66,15 +66,17 @@ export let generate = async (model, opts) => {
66
66
  }
67
67
  // Parse the model and generate code. If no operation is specified, the code generator will
68
68
  // read the model and do nothing else. This is required for the list operation.
69
- let operation = ''
69
+ let operations = []
70
70
  if (opts.genc) {
71
- operation = 'generateC'
72
- } else if (opts.list) {
73
- operation = 'printVarList'
74
- } else if (opts.refidtest) {
75
- operation = 'printRefIdTest'
71
+ operations.push('generateC')
76
72
  }
77
- await parseAndGenerate(input, spec, operation, modelDirname, modelName, buildDirname)
73
+ if (opts.list) {
74
+ operations.push('printVarList')
75
+ }
76
+ if (opts.refidtest) {
77
+ operations.push('printRefIdTest')
78
+ }
79
+ await parseAndGenerate(input, spec, operations, modelDirname, modelName, buildDirname)
78
80
  }
79
81
 
80
82
  export default {
package/src/sde-names.js CHANGED
@@ -29,7 +29,7 @@ let names = async (model, namesPathname, opts) => {
29
29
  // Preprocess model text into parser input.
30
30
  let input = preprocessModel(modelPathname, spec)
31
31
  // Parse the model to get variable and subscript information.
32
- await parseAndGenerate(input, spec, 'convertNames', modelDirname, modelName, '')
32
+ await parseAndGenerate(input, spec, ['convertNames'], modelDirname, modelName, '')
33
33
  // Read each variable name from the names file and convert it.
34
34
  printNames(namesPathname, opts.toc ? 'to-c' : 'to-vensim')
35
35
  }