@accordproject/template-engine 1.0.19 → 1.0.23
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/dist/Common.js +9 -9
- package/dist/Common.js.map +1 -1
- package/dist/TemplateMarkInterpreter.js +113 -151
- package/dist/TemplateMarkInterpreter.js.map +1 -1
- package/dist/TemplateMarkToJavaScriptCompiler.js +31 -24
- package/dist/TemplateMarkToJavaScriptCompiler.js.map +1 -1
- package/dist/TemplateMarkToTypeScriptCompiler.js +90 -92
- package/dist/TemplateMarkToTypeScriptCompiler.js.map +1 -1
- package/dist/TypeScriptCompilationContext.js +29 -22
- package/dist/TypeScriptCompilationContext.js.map +1 -1
- package/dist/TypeScriptRuntime.d.ts +1 -0
- package/dist/TypeScriptRuntime.js +24 -12
- package/dist/TypeScriptRuntime.js.map +1 -1
- package/dist/TypeScriptToJavaScriptCompiler.js +18 -16
- package/dist/TypeScriptToJavaScriptCompiler.js.map +1 -1
- package/dist/compilers/Clause.d.ts +1 -1
- package/dist/compilers/Clause.js +18 -35
- package/dist/compilers/Clause.js.map +1 -1
- package/dist/compilers/Common.js +55 -80
- package/dist/compilers/Common.js.map +1 -1
- package/dist/compilers/Conditional.d.ts +1 -1
- package/dist/compilers/Conditional.js +12 -29
- package/dist/compilers/Conditional.js.map +1 -1
- package/dist/compilers/ContractDefinition.d.ts +1 -1
- package/dist/compilers/ContractDefinition.js +10 -27
- package/dist/compilers/ContractDefinition.js.map +1 -1
- package/dist/compilers/EnumVariable.d.ts +1 -1
- package/dist/compilers/EnumVariable.js +12 -29
- package/dist/compilers/EnumVariable.js.map +1 -1
- package/dist/compilers/FormattedVariable.d.ts +1 -1
- package/dist/compilers/FormattedVariable.js +14 -31
- package/dist/compilers/FormattedVariable.js.map +1 -1
- package/dist/compilers/Formula.d.ts +1 -1
- package/dist/compilers/Formula.js +14 -31
- package/dist/compilers/Formula.js.map +1 -1
- package/dist/compilers/Join.d.ts +1 -1
- package/dist/compilers/Join.js +12 -28
- package/dist/compilers/Join.js.map +1 -1
- package/dist/compilers/ListBlock.d.ts +1 -1
- package/dist/compilers/ListBlock.js +17 -35
- package/dist/compilers/ListBlock.js.map +1 -1
- package/dist/compilers/NodeCompilers.js +44 -44
- package/dist/compilers/NodeCompilers.js.map +1 -1
- package/dist/compilers/Optional.d.ts +1 -1
- package/dist/compilers/Optional.js +17 -34
- package/dist/compilers/Optional.js.map +1 -1
- package/dist/compilers/Variable.d.ts +1 -1
- package/dist/compilers/Variable.js +12 -29
- package/dist/compilers/Variable.js.map +1 -1
- package/dist/compilers/With.d.ts +1 -1
- package/dist/compilers/With.js +13 -30
- package/dist/compilers/With.js.map +1 -1
- package/dist/drafting/DateTime/index.js +3 -3
- package/dist/drafting/DateTime/index.js.map +1 -1
- package/dist/drafting/Double/format.js +5 -5
- package/dist/drafting/Double/format.js.map +1 -1
- package/dist/drafting/Double/index.js +2 -2
- package/dist/drafting/Double/index.js.map +1 -1
- package/dist/drafting/Integer/format.js +3 -3
- package/dist/drafting/Integer/format.js.map +1 -1
- package/dist/drafting/Integer/index.js +2 -2
- package/dist/drafting/Integer/index.js.map +1 -1
- package/dist/drafting/Long/index.js +2 -2
- package/dist/drafting/Long/index.js.map +1 -1
- package/dist/drafting/MonetaryAmount/index.js +4 -4
- package/dist/drafting/MonetaryAmount/index.js.map +1 -1
- package/dist/drafting/index.js +7 -7
- package/dist/drafting/index.js.map +1 -1
- package/dist/model-gen/concerto.d.ts +13 -0
- package/dist/model-gen/concerto.js +5 -0
- package/dist/model-gen/concerto.js.map +1 -0
- package/dist/model-gen/concerto.metamodel@1.0.0.d.ts +24 -1
- package/dist/model-gen/concerto@1.0.0.d.ts +3 -2
- package/dist/model-gen/org.accordproject.commonmark@0.5.0.d.ts +2 -2
- package/dist/model-gen/{org.accordproject.templatemark@0.4.0.d.ts → org.accordproject.templatemark@0.5.0.d.ts} +5 -1
- package/dist/model-gen/{org.accordproject.templatemark@0.4.0.js → org.accordproject.templatemark@0.5.0.js} +3 -2
- package/dist/model-gen/org.accordproject.templatemark@0.5.0.js.map +1 -0
- package/dist/runtime/runtime.d.ts +1 -1
- package/dist/runtime/runtime.js +1 -1
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime.tgz +0 -0
- package/package.json +8 -8
- package/dist/model-gen/org.accordproject.templatemark@0.4.0.js.map +0 -1
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.ContractDefinition = void 0;
|
|
19
4
|
/*
|
|
@@ -29,22 +14,20 @@ exports.ContractDefinition = void 0;
|
|
|
29
14
|
* See the License for the specific language governing permissions and
|
|
30
15
|
* limitations under the License.
|
|
31
16
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return _super.call(this, false) || this;
|
|
17
|
+
const markdown_common_1 = require("@accordproject/markdown-common");
|
|
18
|
+
const Common_1 = require("./Common");
|
|
19
|
+
class ContractDefinition extends Common_1.AbstractSimpleCompiler {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(false);
|
|
38
22
|
}
|
|
39
|
-
|
|
23
|
+
getNode(templateMarkNode) {
|
|
40
24
|
return {
|
|
41
|
-
$class:
|
|
25
|
+
$class: `${markdown_common_1.CiceroMarkModel.NAMESPACE}.Contract`,
|
|
42
26
|
name: templateMarkNode.name,
|
|
43
27
|
nodes: []
|
|
44
28
|
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return ContractDefinition;
|
|
48
|
-
}(Common_1.AbstractSimpleCompiler));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
49
31
|
exports.ContractDefinition = ContractDefinition;
|
|
32
|
+
ContractDefinition.TYPE = `${markdown_common_1.TemplateMarkModel.NAMESPACE}.ContractDefinition`;
|
|
50
33
|
//# sourceMappingURL=ContractDefinition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractDefinition.js","sourceRoot":"","sources":["../../src/compilers/ContractDefinition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContractDefinition.js","sourceRoot":"","sources":["../../src/compilers/ContractDefinition.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,oEAAmF;AAGnF,qCAAkD;AAElD,MAAa,kBAAmB,SAAQ,+BAAsB;IAE1D;QACI,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,CAAC,gBAAoC;QACxC,OAAO;YACH,MAAM,EAAE,GAAG,iCAAe,CAAC,SAAS,WAAW;YAC/C,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,KAAK,EAAE,EAAE;SACC,CAAC;IACnB,CAAC;;AAXL,gDAYC;AAXU,uBAAI,GAAG,GAAG,mCAAiB,CAAC,SAAS,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileWriter } from '@accordproject/concerto-util';
|
|
2
|
-
import { IEnumVariableDefinition } from '../model-gen/org.accordproject.templatemark@0.
|
|
2
|
+
import { IEnumVariableDefinition } from '../model-gen/org.accordproject.templatemark@0.5.0';
|
|
3
3
|
import { AbstractComplexCompiler } from './Common';
|
|
4
4
|
export declare class EnumVariable extends AbstractComplexCompiler {
|
|
5
5
|
static TYPE: string;
|
|
@@ -1,30 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.EnumVariable = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _super.call(this, true) || this;
|
|
4
|
+
const markdown_common_1 = require("@accordproject/markdown-common");
|
|
5
|
+
const Common_1 = require("./Common");
|
|
6
|
+
class EnumVariable extends Common_1.AbstractComplexCompiler {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(true);
|
|
25
9
|
}
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
generate(fw, level, templateMarkNode) {
|
|
11
|
+
const clone = (0, Common_1.makeCiceroMark)(templateMarkNode);
|
|
28
12
|
(0, Common_1.writeOpenGenerateScope)(fw, level);
|
|
29
13
|
if (templateMarkNode.name !== 'this') {
|
|
30
14
|
(0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name);
|
|
@@ -33,13 +17,12 @@ var EnumVariable = /** @class */ (function (_super) {
|
|
|
33
17
|
if (templateMarkNode.name !== 'this') {
|
|
34
18
|
(0, Common_1.writeCloseDataScope)(fw, level);
|
|
35
19
|
}
|
|
36
|
-
fw.writeLine(level,
|
|
20
|
+
fw.writeLine(level, `const variable:any = ${JSON.stringify(clone)};`);
|
|
37
21
|
fw.writeLine(level, 'variable.value = text;');
|
|
38
|
-
fw.writeLine(level,
|
|
22
|
+
fw.writeLine(level, `return variable as ${(0, Common_1.getTypeScriptType)(clone.$class)};`);
|
|
39
23
|
(0, Common_1.writeCloseGenerateScope)(fw, level);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return EnumVariable;
|
|
43
|
-
}(Common_1.AbstractComplexCompiler));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
44
26
|
exports.EnumVariable = EnumVariable;
|
|
27
|
+
EnumVariable.TYPE = `${markdown_common_1.TemplateMarkModel.NAMESPACE}.EnumVariableDefinition`;
|
|
45
28
|
//# sourceMappingURL=EnumVariable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnumVariable.js","sourceRoot":"","sources":["../../src/compilers/EnumVariable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnumVariable.js","sourceRoot":"","sources":["../../src/compilers/EnumVariable.ts"],"names":[],"mappings":";;;AAcA,oEAAmE;AAGnE,qCAAgL;AAEhL,MAAa,YAAa,SAAQ,gCAAuB;IAErD;QACI,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,QAAQ,CAAC,EAAa,EAAE,KAAY,EAAE,gBAAwC;QAC1E,MAAM,KAAK,GAAG,IAAA,uBAAc,EAAC,gBAAgB,CAAkB,CAAC;QAChE,IAAA,+BAAsB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QACjC,IAAG,gBAAgB,CAAC,IAAI,KAAK,MAAM,EAAE;YACjC,IAAA,2BAAkB,EAAC,EAAE,EAAC,KAAK,EAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;SACtD;QACD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,6DAA6D,CAAC,CAAC;QACnF,IAAG,gBAAgB,CAAC,IAAI,KAAK,MAAM,EAAE;YACjC,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;SACjC;QACD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,wBAAwB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;QAC9C,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,sBAAsB,IAAA,0BAAiB,EAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9E,IAAA,gCAAuB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;IACtC,CAAC;;AAnBL,oCAoBC;AAnBU,iBAAI,GAAG,GAAG,mCAAiB,CAAC,SAAS,yBAAyB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileWriter } from '@accordproject/concerto-util';
|
|
2
|
-
import { IFormattedVariableDefinition } from '../model-gen/org.accordproject.templatemark@0.
|
|
2
|
+
import { IFormattedVariableDefinition } from '../model-gen/org.accordproject.templatemark@0.5.0';
|
|
3
3
|
import { AbstractComplexCompiler } from './Common';
|
|
4
4
|
export declare class FormattedVariable extends AbstractComplexCompiler {
|
|
5
5
|
static TYPE: string;
|
|
@@ -1,46 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.FormattedVariable = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _super.call(this, true) || this;
|
|
4
|
+
const markdown_common_1 = require("@accordproject/markdown-common");
|
|
5
|
+
const Common_1 = require("./Common");
|
|
6
|
+
class FormattedVariable extends Common_1.AbstractComplexCompiler {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(true);
|
|
25
9
|
}
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
generate(fw, level, templateMarkNode) {
|
|
11
|
+
const clone = (0, Common_1.makeCiceroMark)(templateMarkNode);
|
|
28
12
|
(0, Common_1.writeOpenGenerateScope)(fw, level);
|
|
29
13
|
if (templateMarkNode.name !== 'this') {
|
|
30
14
|
(0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name);
|
|
31
15
|
}
|
|
32
|
-
fw.writeLine(level,
|
|
33
|
-
fw.writeLine(level,
|
|
16
|
+
fw.writeLine(level, `const drafter = $getDrafter('${templateMarkNode.elementType}');`);
|
|
17
|
+
fw.writeLine(level, `const text = drafter ? drafter(Runtime.peek($data), '${templateMarkNode.format}') : JSON.stringify(Runtime.peek($data)) as string;`);
|
|
34
18
|
if (templateMarkNode.name !== 'this') {
|
|
35
19
|
(0, Common_1.writeCloseDataScope)(fw, level);
|
|
36
20
|
}
|
|
37
|
-
fw.writeLine(level,
|
|
21
|
+
fw.writeLine(level, `const variable:any = ${JSON.stringify(clone)};`);
|
|
38
22
|
fw.writeLine(level, 'variable.value = text;');
|
|
39
|
-
fw.writeLine(level,
|
|
23
|
+
fw.writeLine(level, `return variable as ${(0, Common_1.getTypeScriptType)(clone.$class)};`);
|
|
40
24
|
(0, Common_1.writeCloseGenerateScope)(fw, level);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return FormattedVariable;
|
|
44
|
-
}(Common_1.AbstractComplexCompiler));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
45
27
|
exports.FormattedVariable = FormattedVariable;
|
|
28
|
+
FormattedVariable.TYPE = `${markdown_common_1.TemplateMarkModel.NAMESPACE}.FormattedVariableDefinition`;
|
|
46
29
|
//# sourceMappingURL=FormattedVariable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormattedVariable.js","sourceRoot":"","sources":["../../src/compilers/FormattedVariable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormattedVariable.js","sourceRoot":"","sources":["../../src/compilers/FormattedVariable.ts"],"names":[],"mappings":";;;AAcA,oEAAmE;AAGnE,qCAAgL;AAEhL,MAAa,iBAAkB,SAAQ,gCAAuB;IAE1D;QACI,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,QAAQ,CAAC,EAAa,EAAE,KAAY,EAAE,gBAA6C;QAC/E,MAAM,KAAK,GAAG,IAAA,uBAAc,EAAC,gBAAgB,CAAuB,CAAC;QACrE,IAAA,+BAAsB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QACjC,IAAG,gBAAgB,CAAC,IAAI,KAAK,MAAM,EAAE;YACjC,IAAA,2BAAkB,EAAC,EAAE,EAAC,KAAK,EAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;SACtD;QACD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,gCAAgC,gBAAgB,CAAC,WAAW,KAAK,CAAC,CAAC;QACvF,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,wDAAwD,gBAAgB,CAAC,MAAM,qDAAqD,CAAC,CAAC;QAC1J,IAAG,gBAAgB,CAAC,IAAI,KAAK,MAAM,EAAE;YACjC,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;SACjC;QACD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,wBAAwB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;QAC9C,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,sBAAsB,IAAA,0BAAiB,EAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9E,IAAA,gCAAuB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;IACtC,CAAC;;AApBL,8CAqBC;AApBU,sBAAI,GAAG,GAAG,mCAAiB,CAAC,SAAS,8BAA8B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileWriter } from '@accordproject/concerto-util';
|
|
2
|
-
import { IFormulaDefinition } from '../model-gen/org.accordproject.templatemark@0.
|
|
2
|
+
import { IFormulaDefinition } from '../model-gen/org.accordproject.templatemark@0.5.0';
|
|
3
3
|
import { AbstractComplexCompiler } from './Common';
|
|
4
4
|
export declare class Formula extends AbstractComplexCompiler {
|
|
5
5
|
static TYPE: string;
|
|
@@ -1,41 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.Formula = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _super.call(this, true) || this;
|
|
4
|
+
const markdown_common_1 = require("@accordproject/markdown-common");
|
|
5
|
+
const Common_1 = require("./Common");
|
|
6
|
+
class Formula extends Common_1.AbstractComplexCompiler {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(true);
|
|
25
9
|
}
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
generate(fw, level, templateMarkNode) {
|
|
11
|
+
const clone = (0, Common_1.makeCiceroMark)(templateMarkNode);
|
|
28
12
|
(0, Common_1.writeOpenGenerateScope)(fw, level);
|
|
29
|
-
fw.writeLine(level,
|
|
13
|
+
fw.writeLine(level, `const formulaResult = UserCode.${templateMarkNode.name}(data,library,now);`);
|
|
30
14
|
fw.writeLine(level, 'const text = JSON.stringify(formulaResult);');
|
|
31
|
-
fw.writeLine(level,
|
|
15
|
+
fw.writeLine(level, `const formula:any = ${JSON.stringify(clone)};`);
|
|
32
16
|
fw.writeLine(level, 'formula.value = text;');
|
|
33
|
-
fw.writeLine(level,
|
|
34
|
-
fw.writeLine(level,
|
|
17
|
+
fw.writeLine(level, `formula.code = ${JSON.stringify(templateMarkNode.code.contents)};`); // HACK - update model
|
|
18
|
+
fw.writeLine(level, `return formula as ${(0, Common_1.getTypeScriptType)(clone.$class)};`);
|
|
35
19
|
(0, Common_1.writeCloseGenerateScope)(fw, level);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return Formula;
|
|
39
|
-
}(Common_1.AbstractComplexCompiler));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
40
22
|
exports.Formula = Formula;
|
|
23
|
+
Formula.TYPE = `${markdown_common_1.TemplateMarkModel.NAMESPACE}.FormulaDefinition`;
|
|
41
24
|
//# sourceMappingURL=Formula.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Formula.js","sourceRoot":"","sources":["../../src/compilers/Formula.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Formula.js","sourceRoot":"","sources":["../../src/compilers/Formula.ts"],"names":[],"mappings":";;;AAcA,oEAAmE;AAGnE,qCAAuI;AAEvI,MAAa,OAAQ,SAAQ,gCAAuB;IAEhD;QACI,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,QAAQ,CAAC,EAAa,EAAE,KAAY,EAAE,gBAAmC;QACrE,MAAM,KAAK,GAAG,IAAA,uBAAc,EAAC,gBAAgB,CAAa,CAAC;QAC3D,IAAA,+BAAsB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QACjC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,kCAAkC,gBAAgB,CAAC,IAAI,qBAAqB,CAAC,CAAC;QAClG,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,6CAA6C,CAAC,CAAC;QACnE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,uBAAuB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;QAC7C,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,kBAAkB,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB;QAChH,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,qBAAqB,IAAA,0BAAiB,EAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7E,IAAA,gCAAuB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;IACtC,CAAC;;AAfL,0BAgBC;AAfU,YAAI,GAAG,GAAG,mCAAiB,CAAC,SAAS,oBAAoB,CAAC"}
|
package/dist/compilers/Join.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileWriter } from '@accordproject/concerto-util';
|
|
2
|
-
import { IJoinDefinition } from '../model-gen/org.accordproject.templatemark@0.
|
|
2
|
+
import { IJoinDefinition } from '../model-gen/org.accordproject.templatemark@0.5.0';
|
|
3
3
|
import { AbstractComplexCompiler } from './Common';
|
|
4
4
|
export declare class Join extends AbstractComplexCompiler {
|
|
5
5
|
static TYPE: string;
|
package/dist/compilers/Join.js
CHANGED
|
@@ -1,39 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.Join = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _super.call(this, true) || this;
|
|
4
|
+
const markdown_common_1 = require("@accordproject/markdown-common");
|
|
5
|
+
const Common_1 = require("./Common");
|
|
6
|
+
class Join extends Common_1.AbstractComplexCompiler {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(true);
|
|
25
9
|
}
|
|
26
|
-
|
|
10
|
+
generate(fw, level, templateMarkNode) {
|
|
27
11
|
(0, Common_1.writeOpenGenerateScope)(fw, level);
|
|
28
12
|
(0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name);
|
|
29
|
-
fw.writeLine(level,
|
|
13
|
+
fw.writeLine(level, `const joinDef = ${JSON.stringify(templateMarkNode)};`);
|
|
14
|
+
fw.writeLine(level, 'const text = Runtime.joinList(Runtime.peek($data), joinDef);');
|
|
30
15
|
(0, Common_1.writeCloseDataScope)(fw, level);
|
|
31
|
-
fw.writeLine(level,
|
|
16
|
+
fw.writeLine(level, `return { $class: '${markdown_common_1.CommonMarkModel.NAMESPACE}.Text', text: text } as ${(0, Common_1.getTypeScriptType)(markdown_common_1.CommonMarkModel.NAMESPACE + '.Text')};`);
|
|
32
17
|
(0, Common_1.writeCloseGenerateScope)(fw, level);
|
|
33
18
|
delete templateMarkNode.nodes; // ignore child nodes, like {{this}}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return Join;
|
|
37
|
-
}(Common_1.AbstractComplexCompiler));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
38
21
|
exports.Join = Join;
|
|
22
|
+
Join.TYPE = `${markdown_common_1.TemplateMarkModel.NAMESPACE}.JoinDefinition`;
|
|
39
23
|
//# sourceMappingURL=Join.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Join.js","sourceRoot":"","sources":["../../src/compilers/Join.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Join.js","sourceRoot":"","sources":["../../src/compilers/Join.ts"],"names":[],"mappings":";;;AAcA,oEAAmF;AAEnF,qCAAgK;AAEhK,MAAa,IAAK,SAAQ,gCAAuB;IAE7C;QACI,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,QAAQ,CAAC,EAAa,EAAE,KAAY,EAAE,gBAAgC;QAClE,IAAA,+BAAsB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QACjC,IAAA,2BAAkB,EAAC,EAAE,EAAC,KAAK,EAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACnD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,mBAAmB,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC5E,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,8DAA8D,CAAC,CAAC;QACpF,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QAC9B,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,qBAAqB,iCAAe,CAAC,SAAS,2BAA2B,IAAA,0BAAiB,EAAC,iCAAe,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QACxJ,IAAA,gCAAuB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QAClC,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,oCAAoC;IACvE,CAAC;;AAdL,oBAeC;AAdU,SAAI,GAAG,GAAG,mCAAiB,CAAC,SAAS,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileWriter } from '@accordproject/concerto-util';
|
|
2
2
|
import { ProcessingFunction } from '../TemplateMarkToTypeScriptCompiler';
|
|
3
|
-
import { IListBlockDefinition, IWithDefinition } from '../model-gen/org.accordproject.templatemark@0.
|
|
3
|
+
import { IListBlockDefinition, IWithDefinition } from '../model-gen/org.accordproject.templatemark@0.5.0';
|
|
4
4
|
import { AbstractComplexCompiler } from './Common';
|
|
5
5
|
export declare class ListBlock extends AbstractComplexCompiler {
|
|
6
6
|
static TYPE: string;
|
|
@@ -1,42 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.ListBlock = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _super.call(this, false) || this;
|
|
4
|
+
const markdown_common_1 = require("@accordproject/markdown-common");
|
|
5
|
+
const Common_1 = require("./Common");
|
|
6
|
+
class ListBlock extends Common_1.AbstractComplexCompiler {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(false);
|
|
25
9
|
}
|
|
26
|
-
|
|
10
|
+
enter(fw, level, templateMarkNode) {
|
|
27
11
|
(0, Common_1.writeDebug)(fw, level, templateMarkNode);
|
|
28
12
|
(0, Common_1.writeOpenNodeScope)(fw, level);
|
|
29
13
|
(0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var clone = (0, Common_1.makeCiceroMark)((_b = templateMarkNode === null || templateMarkNode === void 0 ? void 0 : templateMarkNode.nodes) === null || _b === void 0 ? void 0 : _b[0]);
|
|
14
|
+
}
|
|
15
|
+
generate(fw, level, templateMarkNode, doIt) {
|
|
16
|
+
if (templateMarkNode?.nodes?.[0]) {
|
|
17
|
+
const clone = (0, Common_1.makeCiceroMark)(templateMarkNode?.nodes?.[0]);
|
|
35
18
|
(0, Common_1.writeOpenGenerateScope)(fw, level);
|
|
36
|
-
fw.writeLine(level,
|
|
19
|
+
fw.writeLine(level, `const result = ${JSON.stringify(clone)} as ${(0, Common_1.getTypeScriptType)(templateMarkNode.$class)};`);
|
|
37
20
|
fw.writeLine(level, 'Runtime.peek($data).forEach( (item:any) => {');
|
|
38
21
|
fw.writeLine(level, 'Runtime.push($data,item);');
|
|
39
|
-
if (
|
|
22
|
+
if (templateMarkNode.nodes?.[0].nodes?.[0]) {
|
|
40
23
|
doIt(fw, level + 1, templateMarkNode.nodes[0].nodes[0]);
|
|
41
24
|
delete templateMarkNode.nodes; // already handled children ^^^
|
|
42
25
|
}
|
|
@@ -45,13 +28,12 @@ var ListBlock = /** @class */ (function (_super) {
|
|
|
45
28
|
fw.writeLine(level, 'return result;');
|
|
46
29
|
(0, Common_1.writeCloseGenerateScope)(fw, level);
|
|
47
30
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
31
|
+
}
|
|
32
|
+
exit(fw, level) {
|
|
50
33
|
(0, Common_1.writeCloseDataScope)(fw, level);
|
|
51
34
|
(0, Common_1.writeCloseNodeScope)(fw, level);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return ListBlock;
|
|
55
|
-
}(Common_1.AbstractComplexCompiler));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
56
37
|
exports.ListBlock = ListBlock;
|
|
38
|
+
ListBlock.TYPE = `${markdown_common_1.TemplateMarkModel.NAMESPACE}.ListBlockDefinition`;
|
|
57
39
|
//# sourceMappingURL=ListBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBlock.js","sourceRoot":"","sources":["../../src/compilers/ListBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListBlock.js","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AAC,CAAC;gBACtD,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,+BAA+B;aACjE;YACD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;YAC3C,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC3B,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;YACtC,IAAA,gCAAuB,EAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SACtC;IACL,CAAC;IAED,IAAI,CAAC,EAAa,EAAE,KAAY;QAC5B,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QAC9B,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;IAClC,CAAC;;AAjCL,8BAkCC;AAjCU,cAAI,GAAG,GAAG,mCAAiB,CAAC,SAAS,sBAAsB,CAAC"}
|
|
@@ -14,23 +14,23 @@
|
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.getCompiler = void 0;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
const markdown_common_1 = require("@accordproject/markdown-common");
|
|
18
|
+
const Clause_1 = require("./Clause");
|
|
19
|
+
const Common_1 = require("./Common");
|
|
20
|
+
const Conditional_1 = require("./Conditional");
|
|
21
|
+
const ContractDefinition_1 = require("./ContractDefinition");
|
|
22
|
+
const FormattedVariable_1 = require("./FormattedVariable");
|
|
23
|
+
const Formula_1 = require("./Formula");
|
|
24
|
+
const Join_1 = require("./Join");
|
|
25
|
+
const ListBlock_1 = require("./ListBlock");
|
|
26
|
+
const Optional_1 = require("./Optional");
|
|
27
|
+
const Variable_1 = require("./Variable");
|
|
28
|
+
const With_1 = require("./With");
|
|
29
|
+
const EnumVariable_1 = require("./EnumVariable");
|
|
30
30
|
/**
|
|
31
31
|
* Registry of node compilers
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
const NODE_COMPILERS = {};
|
|
34
34
|
// templatemark
|
|
35
35
|
NODE_COMPILERS[ContractDefinition_1.ContractDefinition.TYPE] = new ContractDefinition_1.ContractDefinition();
|
|
36
36
|
NODE_COMPILERS[Variable_1.Variable.TYPE] = new Variable_1.Variable();
|
|
@@ -44,44 +44,44 @@ NODE_COMPILERS[Clause_1.Clause.TYPE] = new Clause_1.Clause();
|
|
|
44
44
|
NODE_COMPILERS[Optional_1.Optional.TYPE] = new Optional_1.Optional();
|
|
45
45
|
NODE_COMPILERS[ListBlock_1.ListBlock.TYPE] = new ListBlock_1.ListBlock();
|
|
46
46
|
// ignored
|
|
47
|
-
NODE_COMPILERS[
|
|
48
|
-
NODE_COMPILERS[
|
|
47
|
+
NODE_COMPILERS[`${markdown_common_1.TemplateMarkModel.NAMESPACE}.Code`] = new Common_1.Ignore();
|
|
48
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Document`] = new Common_1.Ignore();
|
|
49
49
|
// commonmark
|
|
50
|
-
NODE_COMPILERS[
|
|
51
|
-
NODE_COMPILERS[
|
|
52
|
-
NODE_COMPILERS[
|
|
53
|
-
NODE_COMPILERS[
|
|
54
|
-
NODE_COMPILERS[
|
|
55
|
-
NODE_COMPILERS[
|
|
56
|
-
NODE_COMPILERS[
|
|
57
|
-
NODE_COMPILERS[
|
|
58
|
-
NODE_COMPILERS[
|
|
59
|
-
NODE_COMPILERS[
|
|
60
|
-
NODE_COMPILERS[
|
|
61
|
-
NODE_COMPILERS[
|
|
62
|
-
NODE_COMPILERS[
|
|
63
|
-
NODE_COMPILERS[
|
|
64
|
-
NODE_COMPILERS[
|
|
65
|
-
NODE_COMPILERS[
|
|
66
|
-
NODE_COMPILERS[
|
|
67
|
-
NODE_COMPILERS[
|
|
68
|
-
NODE_COMPILERS[
|
|
69
|
-
NODE_COMPILERS[
|
|
70
|
-
NODE_COMPILERS[
|
|
71
|
-
NODE_COMPILERS[
|
|
72
|
-
NODE_COMPILERS[
|
|
73
|
-
NODE_COMPILERS[
|
|
74
|
-
NODE_COMPILERS[
|
|
75
|
-
NODE_COMPILERS[
|
|
50
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Paragraph`] = new Common_1.PassThrough(false);
|
|
51
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Text`] = new Common_1.PassThrough(true);
|
|
52
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Attribute`] = new Common_1.PassThrough(false);
|
|
53
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TagInfo`] = new Common_1.PassThrough(false);
|
|
54
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.CodeBlock`] = new Common_1.PassThrough(false);
|
|
55
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Code`] = new Common_1.PassThrough(false);
|
|
56
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.HtmlInline`] = new Common_1.PassThrough(false);
|
|
57
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.HtmlBlock`] = new Common_1.PassThrough(false);
|
|
58
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Emph`] = new Common_1.PassThrough(false);
|
|
59
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Strong`] = new Common_1.PassThrough(false);
|
|
60
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.BlockQuote`] = new Common_1.PassThrough(false);
|
|
61
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Heading`] = new Common_1.PassThrough(false);
|
|
62
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.ThematicBreak`] = new Common_1.PassThrough(false);
|
|
63
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Softbreak`] = new Common_1.PassThrough(false);
|
|
64
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Linebreak`] = new Common_1.PassThrough(false);
|
|
65
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Link`] = new Common_1.PassThrough(false);
|
|
66
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Image`] = new Common_1.PassThrough(false);
|
|
67
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.List`] = new Common_1.PassThrough(false);
|
|
68
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Item`] = new Common_1.PassThrough(false);
|
|
69
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.Table`] = new Common_1.PassThrough(false);
|
|
70
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableHead`] = new Common_1.PassThrough(false);
|
|
71
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableBody`] = new Common_1.PassThrough(false);
|
|
72
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableRow`] = new Common_1.PassThrough(false);
|
|
73
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableRow`] = new Common_1.PassThrough(false);
|
|
74
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.HeaderCell`] = new Common_1.PassThrough(false);
|
|
75
|
+
NODE_COMPILERS[`${markdown_common_1.CommonMarkModel.NAMESPACE}.TableCell`] = new Common_1.PassThrough(false);
|
|
76
76
|
/**
|
|
77
77
|
* Lookup a node compiler
|
|
78
78
|
* @param {string} fqn the Concerto FQN of the node $class
|
|
79
79
|
* @returns {INodeCompiler} the compiler to use for this node
|
|
80
80
|
*/
|
|
81
81
|
function getCompiler(fqn) {
|
|
82
|
-
|
|
82
|
+
const compiler = NODE_COMPILERS[fqn];
|
|
83
83
|
if (!compiler) {
|
|
84
|
-
throw new Error(
|
|
84
|
+
throw new Error(`No compiler found for node ${fqn}`);
|
|
85
85
|
}
|
|
86
86
|
return compiler;
|
|
87
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeCompilers.js","sourceRoot":"","sources":["../../src/compilers/NodeCompilers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"NodeCompilers.js","sourceRoot":"","sources":["../../src/compilers/NodeCompilers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,oEAAmF;AAEnF,qCAAkC;AAClC,qCAA8D;AAC9D,+CAA4C;AAC5C,6DAA0D;AAC1D,2DAAwD;AACxD,uCAAoC;AACpC,iCAA8B;AAC9B,2CAAwC;AACxC,yCAAsC;AACtC,yCAAsC;AACtC,iCAA8B;AAC9B,iDAA8C;AAE9C;;GAEG;AACH,MAAM,cAAc,GAAgC,EACnD,CAAC;AAEF,eAAe;AACf,cAAc,CAAC,uCAAkB,CAAC,IAAI,CAAC,GAAG,IAAI,uCAAkB,EAAE,CAAC;AACnE,cAAc,CAAC,mBAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,mBAAQ,EAAE,CAAC;AAC/C,cAAc,CAAC,2BAAY,CAAC,IAAI,CAAC,GAAG,IAAI,2BAAY,EAAE,CAAC;AACvD,cAAc,CAAC,qCAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,qCAAiB,EAAE,CAAC;AACjE,cAAc,CAAC,iBAAO,CAAC,IAAI,CAAC,GAAG,IAAI,iBAAO,EAAE,CAAC;AAC7C,cAAc,CAAC,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C,GAAG,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAC;AAC7E,cAAc,CAAC,GAAG,iCAAe,CAAC,SAAS,QAAQ,CAAC,GAAG,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAC;AAC9E,cAAc,CAAC,GAAG,iCAAe,CAAC,SAAS,YAAY,CAAC,GAAG,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAC;AAClF,cAAc,CAAC,GAAG,iCAAe,CAAC,SAAS,YAAY,CAAC,GAAG,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAC;AAClF,cAAc,CAAC,GAAG,iCAAe,CAAC,SAAS,WAAW,CAAC,GAAG,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAC;AACjF,cAAc,CAAC,GAAG,iCAAe,CAAC,SAAS,WAAW,CAAC,GAAG,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAC;AACjF,cAAc,CAAC,GAAG,iCAAe,CAAC,SAAS,aAAa,CAAC,GAAG,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAC;AACnF,cAAc,CAAC,GAAG,iCAAe,CAAC,SAAS,YAAY,CAAC,GAAG,IAAI,oBAAW,CAAC,KAAK,CAAC,CAAC;AAElF;;;;GAIG;AACH,SAAgB,WAAW,CAAC,GAAU;IAClC,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACrC,IAAG,CAAC,QAAQ,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,EAAE,CAAC,CAAC;KACxD;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAND,kCAMC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileWriter } from '@accordproject/concerto-util';
|
|
2
2
|
import { ProcessingFunction } from '../TemplateMarkToTypeScriptCompiler';
|
|
3
|
-
import { IOptionalDefinition } from '../model-gen/org.accordproject.templatemark@0.
|
|
3
|
+
import { IOptionalDefinition } from '../model-gen/org.accordproject.templatemark@0.5.0';
|
|
4
4
|
import { AbstractComplexCompiler } from './Common';
|
|
5
5
|
export declare class Optional extends AbstractComplexCompiler {
|
|
6
6
|
static TYPE: string;
|