MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / createTarget

Method createTarget

examples/compile-plugin-architecture.js:81–97  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

79 }
80
81 createTarget(options = {}) {
82 const ops = this.getOperators();
83 const fns = this.getFunctions();
84
85 return {
86 language: 'python',
87 operators: (op) => ops[op],
88 functions: (id) => fns[id],
89 var: (id) => id,
90 string: (str) => JSON.stringify(str),
91 number: (n) => n.toString(),
92 indent: 0,
93 ws: (s) => s ?? '',
94 preamble: '',
95 ...options,
96 };
97 }
98
99 compileToExecutable(expr, options = {}) {
100 const target = this.createTarget();

Callers 1

compileToExecutableMethod · 0.95

Calls 3

getOperatorsMethod · 0.95
getFunctionsMethod · 0.95
toStringMethod · 0.65

Tested by

no test coverage detected