@accordproject/template-engine 1.0.4 → 1.0.5
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.d.ts +20 -0
- package/dist/Common.js +59 -0
- package/dist/Common.js.map +1 -0
- package/dist/TemplateMarkInterpreter.d.ts +34 -0
- package/dist/TemplateMarkInterpreter.js +432 -0
- package/dist/TemplateMarkInterpreter.js.map +1 -0
- package/dist/TemplateMarkToJavaScriptCompiler.d.ts +19 -0
- package/dist/TemplateMarkToJavaScriptCompiler.js +90 -0
- package/dist/TemplateMarkToJavaScriptCompiler.js.map +1 -0
- package/dist/TemplateMarkToTypeScriptCompiler.d.ts +69 -0
- package/dist/TemplateMarkToTypeScriptCompiler.js +239 -0
- package/dist/TemplateMarkToTypeScriptCompiler.js.map +1 -0
- package/dist/TypeScriptCompilationContext.d.ts +15 -0
- package/dist/TypeScriptCompilationContext.js +45 -0
- package/dist/TypeScriptCompilationContext.js.map +1 -0
- package/dist/TypeScriptRuntime.d.ts +5 -0
- package/dist/TypeScriptRuntime.js +67 -0
- package/dist/TypeScriptRuntime.js.map +1 -0
- package/dist/TypeScriptToJavaScriptCompiler.d.ts +14 -0
- package/dist/TypeScriptToJavaScriptCompiler.js +57 -0
- package/dist/TypeScriptToJavaScriptCompiler.js.map +1 -0
- package/dist/compilers/Clause.d.ts +14 -0
- package/dist/compilers/Clause.js +60 -0
- package/dist/compilers/Clause.js.map +1 -0
- package/dist/compilers/Common.d.ts +66 -0
- package/dist/compilers/Common.js +206 -0
- package/dist/compilers/Common.js.map +1 -0
- package/dist/compilers/Conditional.d.ts +12 -0
- package/dist/compilers/Conditional.js +53 -0
- package/dist/compilers/Conditional.js.map +1 -0
- package/dist/compilers/ContractDefinition.d.ts +8 -0
- package/dist/compilers/ContractDefinition.js +50 -0
- package/dist/compilers/ContractDefinition.js.map +1 -0
- package/dist/compilers/FormattedVariable.d.ts +8 -0
- package/dist/compilers/FormattedVariable.js +46 -0
- package/dist/compilers/FormattedVariable.js.map +1 -0
- package/dist/compilers/Formula.d.ts +8 -0
- package/dist/compilers/Formula.js +41 -0
- package/dist/compilers/Formula.js.map +1 -0
- package/dist/compilers/Join.d.ts +8 -0
- package/dist/compilers/Join.js +39 -0
- package/dist/compilers/Join.js.map +1 -0
- package/dist/compilers/ListBlock.d.ts +11 -0
- package/dist/compilers/ListBlock.js +57 -0
- package/dist/compilers/ListBlock.js.map +1 -0
- package/dist/compilers/NodeCompilers.d.ts +7 -0
- package/dist/compilers/NodeCompilers.js +87 -0
- package/dist/compilers/NodeCompilers.js.map +1 -0
- package/dist/compilers/Optional.d.ts +11 -0
- package/dist/compilers/Optional.js +65 -0
- package/dist/compilers/Optional.js.map +1 -0
- package/dist/compilers/Variable.d.ts +8 -0
- package/dist/compilers/Variable.js +45 -0
- package/dist/compilers/Variable.js.map +1 -0
- package/dist/compilers/With.d.ts +10 -0
- package/dist/compilers/With.js +40 -0
- package/dist/compilers/With.js.map +1 -0
- package/dist/drafting/Boolean/index.d.ts +6 -0
- package/dist/drafting/Boolean/index.js +30 -0
- package/dist/drafting/Boolean/index.js.map +1 -0
- package/dist/drafting/DateTime/index.d.ts +7 -0
- package/dist/drafting/DateTime/index.js +33 -0
- package/dist/drafting/DateTime/index.js.map +1 -0
- package/dist/drafting/Double/format.d.ts +13 -0
- package/dist/drafting/Double/format.js +55 -0
- package/dist/drafting/Double/format.js.map +1 -0
- package/dist/drafting/Double/index.d.ts +7 -0
- package/dist/drafting/Double/index.js +33 -0
- package/dist/drafting/Double/index.js.map +1 -0
- package/dist/drafting/Integer/format.d.ts +13 -0
- package/dist/drafting/Integer/format.js +45 -0
- package/dist/drafting/Integer/format.js.map +1 -0
- package/dist/drafting/Integer/index.d.ts +7 -0
- package/dist/drafting/Integer/index.js +33 -0
- package/dist/drafting/Integer/index.js.map +1 -0
- package/dist/drafting/Long/index.d.ts +7 -0
- package/dist/drafting/Long/index.js +33 -0
- package/dist/drafting/Long/index.js.map +1 -0
- package/dist/drafting/MonetaryAmount/currencycode.d.ts +35 -0
- package/dist/drafting/MonetaryAmount/currencycode.js +53 -0
- package/dist/drafting/MonetaryAmount/currencycode.js.map +1 -0
- package/dist/drafting/MonetaryAmount/index.d.ts +12 -0
- package/dist/drafting/MonetaryAmount/index.js +67 -0
- package/dist/drafting/MonetaryAmount/index.js.map +1 -0
- package/dist/drafting/String/index.d.ts +6 -0
- package/dist/drafting/String/index.js +25 -0
- package/dist/drafting/String/index.js.map +1 -0
- package/dist/drafting/index.d.ts +1 -0
- package/dist/drafting/index.js +36 -0
- package/dist/drafting/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/model-gen/concerto.metamodel@1.0.0.d.ts +173 -0
- package/dist/model-gen/concerto.metamodel@1.0.0.js +5 -0
- package/dist/model-gen/concerto.metamodel@1.0.0.js.map +1 -0
- package/dist/model-gen/concerto@1.0.0.d.ts +18 -0
- package/dist/model-gen/concerto@1.0.0.js +5 -0
- package/dist/model-gen/concerto@1.0.0.js.map +1 -0
- package/dist/model-gen/org.accordproject.ciceromark@0.6.0.d.ts +49 -0
- package/dist/model-gen/org.accordproject.ciceromark@0.6.0.js +5 -0
- package/dist/model-gen/org.accordproject.ciceromark@0.6.0.js.map +1 -0
- package/dist/model-gen/org.accordproject.commonmark@0.5.0.d.ts +89 -0
- package/dist/model-gen/org.accordproject.commonmark@0.5.0.js +5 -0
- package/dist/model-gen/org.accordproject.commonmark@0.5.0.js.map +1 -0
- package/dist/model-gen/org.accordproject.templatemark@0.4.0.d.ts +72 -0
- package/dist/model-gen/org.accordproject.templatemark@0.4.0.js +11 -0
- package/dist/model-gen/org.accordproject.templatemark@0.4.0.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FileWriter } from '@accordproject/concerto-util';
|
|
2
|
+
import { IClauseDefinition, IWithDefinition } from '../model-gen/org.accordproject.templatemark@0.4.0';
|
|
3
|
+
import { AbstractComplexCompiler } from './Common';
|
|
4
|
+
interface INamedClauseDefinition extends IClauseDefinition {
|
|
5
|
+
readonly functionName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class Clause extends AbstractComplexCompiler {
|
|
8
|
+
static TYPE: string;
|
|
9
|
+
constructor();
|
|
10
|
+
enter(fw: FileWriter, level: number, templateMarkNode: IWithDefinition): void;
|
|
11
|
+
generate(fw: FileWriter, level: number, templateMarkNode: INamedClauseDefinition): void;
|
|
12
|
+
exit(fw: FileWriter, level: number): void;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.Clause = void 0;
|
|
19
|
+
var markdown_common_1 = require("@accordproject/markdown-common");
|
|
20
|
+
var Common_1 = require("./Common");
|
|
21
|
+
var Clause = /** @class */ (function (_super) {
|
|
22
|
+
__extends(Clause, _super);
|
|
23
|
+
function Clause() {
|
|
24
|
+
return _super.call(this, false) || this;
|
|
25
|
+
}
|
|
26
|
+
Clause.prototype.enter = function (fw, level, templateMarkNode) {
|
|
27
|
+
(0, Common_1.writeDebug)(fw, level, templateMarkNode);
|
|
28
|
+
(0, Common_1.writeOpenNodeScope)(fw, level);
|
|
29
|
+
(0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name);
|
|
30
|
+
};
|
|
31
|
+
Clause.prototype.generate = function (fw, level, templateMarkNode) {
|
|
32
|
+
var clone = (0, Common_1.makeCiceroMark)(templateMarkNode);
|
|
33
|
+
delete clone.condition;
|
|
34
|
+
delete clone.functionName;
|
|
35
|
+
var para = { $class: "".concat(markdown_common_1.CommonMarkModel.NAMESPACE, ".Paragraph") };
|
|
36
|
+
(0, Common_1.writeOpenGenerateScope)(fw, level);
|
|
37
|
+
if (templateMarkNode.condition) {
|
|
38
|
+
fw.writeLine(level, "const isTrue:boolean = UserCode.".concat(templateMarkNode.functionName, "(data,library,now)"));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
fw.writeLine(level, 'const isTrue:boolean = true;');
|
|
42
|
+
}
|
|
43
|
+
fw.writeLine(level, 'if(isTrue) {');
|
|
44
|
+
fw.writeLine(level, "return ".concat(JSON.stringify(clone), " as ").concat((0, Common_1.getTypeScriptType)(clone.$class), ";"));
|
|
45
|
+
fw.writeLine(level, '}');
|
|
46
|
+
fw.writeLine(level, 'else {');
|
|
47
|
+
fw.writeLine(level, "return ".concat(JSON.stringify(para), " as ").concat((0, Common_1.getTypeScriptType)(para.$class), ";"));
|
|
48
|
+
fw.writeLine(level, '}');
|
|
49
|
+
(0, Common_1.writeCloseGenerateScope)(fw, level);
|
|
50
|
+
delete templateMarkNode.condition;
|
|
51
|
+
};
|
|
52
|
+
Clause.prototype.exit = function (fw, level) {
|
|
53
|
+
(0, Common_1.writeCloseDataScope)(fw, level);
|
|
54
|
+
(0, Common_1.writeCloseNodeScope)(fw, level);
|
|
55
|
+
};
|
|
56
|
+
Clause.TYPE = "".concat(markdown_common_1.TemplateMarkModel.NAMESPACE, ".ClauseDefinition");
|
|
57
|
+
return Clause;
|
|
58
|
+
}(Common_1.AbstractComplexCompiler));
|
|
59
|
+
exports.Clause = Clause;
|
|
60
|
+
//# sourceMappingURL=Clause.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Clause.js","sourceRoot":"","sources":["../../src/compilers/Clause.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAcA,kEAAmF;AAInF,mCAAqO;AAMrO;IAA4B,0BAAuB;IAE/C;eACI,kBAAM,KAAK,CAAC;IAChB,CAAC;IAED,sBAAK,GAAL,UAAM,EAAa,EAAE,KAAY,EAAC,gBAAgC;QAC9D,IAAA,mBAAU,EAAC,EAAE,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC;QACxC,IAAA,2BAAkB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QAC7B,IAAA,2BAAkB,EAAC,EAAE,EAAC,KAAK,EAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,yBAAQ,GAAR,UAAS,EAAa,EAAE,KAAY,EAAE,gBAAuC;QACzE,IAAM,KAAK,GAAG,IAAA,uBAAc,EAAC,gBAAgB,CAAY,CAAC;QAC1D,OAAQ,KAAa,CAAC,SAAS,CAAC;QAChC,OAAQ,KAAa,CAAC,YAAY,CAAC;QACnC,IAAM,IAAI,GAAG,EAAC,MAAM,EAAE,UAAG,iCAAe,CAAC,SAAS,eAAY,EAAe,CAAC;QAC9E,IAAA,+BAAsB,EAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAClC,IAAG,gBAAgB,CAAC,SAAS,EAAE;YAC3B,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,0CAAmC,gBAAgB,CAAC,YAAY,uBAAoB,CAAC,CAAC;SAC7G;aACI;YACD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC;SACvD;QACD,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QACpC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,iBAAU,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,iBAAO,IAAA,0BAAiB,EAAC,KAAK,CAAC,MAAM,CAAC,MAAG,CAAC,CAAC;QAC9F,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACzB,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC9B,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,iBAAU,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,iBAAO,IAAA,0BAAiB,EAAC,IAAI,CAAC,MAAM,CAAC,MAAG,CAAC,CAAC;QAC5F,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACzB,IAAA,gCAAuB,EAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACnC,OAAO,gBAAgB,CAAC,SAAS,CAAC;IACtC,CAAC;IAED,qBAAI,GAAJ,UAAK,EAAa,EAAE,KAAY;QAC5B,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QAC9B,IAAA,4BAAmB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IApCM,WAAI,GAAG,UAAG,mCAAiB,CAAC,SAAS,sBAAmB,CAAC;IAqCpE,aAAC;CAAA,AAtCD,CAA4B,gCAAuB,GAsClD;AAtCY,wBAAM"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { INode } from '../model-gen/org.accordproject.commonmark@0.5.0';
|
|
2
|
+
import { FileWriter } from '@accordproject/concerto-util';
|
|
3
|
+
import { ClassDeclaration } from '@accordproject/concerto-core';
|
|
4
|
+
import { ProcessingFunction } from '../TemplateMarkToTypeScriptCompiler';
|
|
5
|
+
export declare function writeDebug(fw: FileWriter, level: number, concept: any): void;
|
|
6
|
+
export declare const RUNTIME_DIR = "runtime";
|
|
7
|
+
export declare function writeImports(fw: FileWriter, level: number, templateClass: ClassDeclaration): void;
|
|
8
|
+
export declare function writeProlog(fw: FileWriter, level: number, templateClass: ClassDeclaration): void;
|
|
9
|
+
export declare function writeEpilog(fw: FileWriter, level: number): void;
|
|
10
|
+
export declare function writeOpenGenerateScope(fw: FileWriter, level: number): void;
|
|
11
|
+
export declare function writeCloseGenerateScope(fw: FileWriter, level: number): void;
|
|
12
|
+
export declare function writeOpenNodeScope(fw: FileWriter, level: number): void;
|
|
13
|
+
export declare function writeCloseNodeScope(fw: FileWriter, level: number): void;
|
|
14
|
+
export declare function writeOpenDataScope(fw: FileWriter, level: number, name: string, allowUndefined?: boolean): void;
|
|
15
|
+
export declare function writeCloseDataScope(fw: FileWriter, level: number): void;
|
|
16
|
+
export declare function getTypeScriptType(ctoFqn: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Map of a node from template mark to ciceromark
|
|
19
|
+
* @param {INode} templateMarkNode the template mark.
|
|
20
|
+
* @param {boolean} deep when deep is false (the default) child nodes are not copied
|
|
21
|
+
* @returns {INode} the mapped node
|
|
22
|
+
*/
|
|
23
|
+
export declare function makeCiceroMark(templateMarkNode: INode, deep?: boolean): INode;
|
|
24
|
+
export interface INodeCompiler {
|
|
25
|
+
enter(fw: FileWriter, level: number, templateMarkNode: INode): void;
|
|
26
|
+
generate(fw: FileWriter, level: number, templateMarkNode: INode, doIt: ProcessingFunction): void;
|
|
27
|
+
exit(fw: FileWriter, level: number, templateMarkNode: INode): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A node compiler that allows code to run on node enter, exit and
|
|
31
|
+
* with a generate method to generate code for the node.
|
|
32
|
+
*/
|
|
33
|
+
export declare abstract class AbstractComplexCompiler implements INodeCompiler {
|
|
34
|
+
leaf: boolean;
|
|
35
|
+
constructor(leaf: boolean);
|
|
36
|
+
isLeaf(): boolean;
|
|
37
|
+
enter(fw: FileWriter, level: number, templateMarkNode: INode): void;
|
|
38
|
+
abstract generate(fw: FileWriter, level: number, templateMarkNode: INode, doIt: ProcessingFunction): void;
|
|
39
|
+
exit(fw: FileWriter, level: number): void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A node compiler that allows a JSON node to be constructed from
|
|
43
|
+
* the data in a templatemark node.
|
|
44
|
+
*/
|
|
45
|
+
export declare abstract class AbstractSimpleCompiler extends AbstractComplexCompiler {
|
|
46
|
+
constructor(leaf: boolean);
|
|
47
|
+
abstract getNode(templateMarkNode: INode): INode;
|
|
48
|
+
generate(fw: FileWriter, level: number, templateMarkNode: INode): void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* PassThroughNode simply maps data from TemplateMark to
|
|
52
|
+
* CiceroMark, updating namespaces but otherwise leaving
|
|
53
|
+
* the data alone.
|
|
54
|
+
*/
|
|
55
|
+
export declare class PassThrough extends AbstractSimpleCompiler {
|
|
56
|
+
constructor(leaf: boolean);
|
|
57
|
+
getNode(templateMarkNode: INode): INode;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Ignore doesn't write any output for a node type
|
|
61
|
+
*/
|
|
62
|
+
export declare class Ignore implements INodeCompiler {
|
|
63
|
+
enter(fw: FileWriter, level: number, templateMarkNode: INode): void;
|
|
64
|
+
generate(fw: FileWriter, level: number, templateMarkNode: INode): void;
|
|
65
|
+
exit(fw: FileWriter, level: number, templateMarkNode: INode): void;
|
|
66
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.Ignore = exports.PassThrough = exports.AbstractSimpleCompiler = exports.AbstractComplexCompiler = exports.makeCiceroMark = exports.getTypeScriptType = exports.writeCloseDataScope = exports.writeOpenDataScope = exports.writeCloseNodeScope = exports.writeOpenNodeScope = exports.writeCloseGenerateScope = exports.writeOpenGenerateScope = exports.writeEpilog = exports.writeProlog = exports.writeImports = exports.RUNTIME_DIR = exports.writeDebug = void 0;
|
|
19
|
+
var markdown_common_1 = require("@accordproject/markdown-common");
|
|
20
|
+
var concerto_core_1 = require("@accordproject/concerto-core");
|
|
21
|
+
function writeDebug(fw, level, concept) {
|
|
22
|
+
fw.writeLine(level, "// ".concat(concerto_core_1.ModelUtil.getShortName(concept.$class), " ").concat(concept.name ? "(".concat(concept.name, ")") : ''));
|
|
23
|
+
}
|
|
24
|
+
exports.writeDebug = writeDebug;
|
|
25
|
+
exports.RUNTIME_DIR = 'runtime';
|
|
26
|
+
function writeImports(fw, level, templateClass) {
|
|
27
|
+
fw.writeLine(level, "import * as CommonMark from './".concat(markdown_common_1.CommonMarkModel.NAMESPACE, "';"));
|
|
28
|
+
fw.writeLine(level, "import * as CiceroMark from './".concat(markdown_common_1.CiceroMarkModel.NAMESPACE, "';"));
|
|
29
|
+
fw.writeLine(level, "import * as TemplateModel from './".concat(templateClass.getNamespace(), "';"));
|
|
30
|
+
fw.writeLine(level, 'import dayjs from \'dayjs\';');
|
|
31
|
+
fw.writeLine(level, 'import * as UserCode from \'./usercode\';');
|
|
32
|
+
fw.writeLine(level, "import { draftingMap as $draftingMap } from './".concat(exports.RUNTIME_DIR, "/drafting';"));
|
|
33
|
+
fw.writeLine(level, "import * as Runtime from './".concat(exports.RUNTIME_DIR, "/TypeScriptRuntime';"));
|
|
34
|
+
}
|
|
35
|
+
exports.writeImports = writeImports;
|
|
36
|
+
function writeProlog(fw, level, templateClass) {
|
|
37
|
+
fw.writeLine(level, "export function generator(data:TemplateModel.I".concat(templateClass.getName(), ", library:any, now:dayjs.Dayjs) : CommonMark.IDocument {"));
|
|
38
|
+
fw.writeLine(level, "const docNode = {$class: '".concat(markdown_common_1.CommonMarkModel.NAMESPACE, ".Document', xmlns: '").concat(markdown_common_1.CommonMarkModel.NAMESPACE, "', nodes: []} as CommonMark.INode;"));
|
|
39
|
+
fw.writeLine(level, 'const $nodes:CommonMark.INode[] = [];'); // the stack of output CiceroMark nodes
|
|
40
|
+
fw.writeLine(level, 'const $data:any[] = [];'); // the stack of 'this' used for data access
|
|
41
|
+
fw.writeLine(level, 'let $result:any = docNode;'); // document root, or the return value
|
|
42
|
+
fw.writeLine(level, 'Runtime.push($data, data);'); // push the 'data' to the stack so we have an initial 'this';
|
|
43
|
+
}
|
|
44
|
+
exports.writeProlog = writeProlog;
|
|
45
|
+
function writeEpilog(fw, level) {
|
|
46
|
+
fw.writeLine(level, 'return $result as CommonMark.IDocument;');
|
|
47
|
+
fw.writeLine(level, '}');
|
|
48
|
+
}
|
|
49
|
+
exports.writeEpilog = writeEpilog;
|
|
50
|
+
// allows us to declare local variables without fear of collision
|
|
51
|
+
function writeOpenGenerateScope(fw, level) {
|
|
52
|
+
fw.writeLine(level, '$result = (() => {');
|
|
53
|
+
}
|
|
54
|
+
exports.writeOpenGenerateScope = writeOpenGenerateScope;
|
|
55
|
+
// closes the scope, calling the anon-function
|
|
56
|
+
// and then pushes the result as a child of the last element of $nodes
|
|
57
|
+
function writeCloseGenerateScope(fw, level) {
|
|
58
|
+
fw.writeLine(level, '})();');
|
|
59
|
+
fw.writeLine(level, 'Runtime.addChild($nodes, $result);');
|
|
60
|
+
}
|
|
61
|
+
exports.writeCloseGenerateScope = writeCloseGenerateScope;
|
|
62
|
+
// save $curNode into $stack, so we can pop it when the scope closes
|
|
63
|
+
function writeOpenNodeScope(fw, level) {
|
|
64
|
+
fw.writeLine(level, 'Runtime.push($nodes, $result);');
|
|
65
|
+
}
|
|
66
|
+
exports.writeOpenNodeScope = writeOpenNodeScope;
|
|
67
|
+
// closes the scope, popping the stack and setting $curNode
|
|
68
|
+
function writeCloseNodeScope(fw, level) {
|
|
69
|
+
fw.writeLine(level, '$result = Runtime.pop($nodes);');
|
|
70
|
+
}
|
|
71
|
+
exports.writeCloseNodeScope = writeCloseNodeScope;
|
|
72
|
+
// save $curNode into $stack, so we can pop it when the scope closes
|
|
73
|
+
function writeOpenDataScope(fw, level, name, allowUndefined) {
|
|
74
|
+
if (allowUndefined === void 0) { allowUndefined = false; }
|
|
75
|
+
fw.writeLine(level, "Runtime.push($data, Runtime.peekProperty($data, '".concat(name, "', ").concat(allowUndefined, "));"));
|
|
76
|
+
}
|
|
77
|
+
exports.writeOpenDataScope = writeOpenDataScope;
|
|
78
|
+
// closes the scope, popping the stack and setting $curNode
|
|
79
|
+
function writeCloseDataScope(fw, level) {
|
|
80
|
+
fw.writeLine(level, 'Runtime.pop($data);');
|
|
81
|
+
}
|
|
82
|
+
exports.writeCloseDataScope = writeCloseDataScope;
|
|
83
|
+
function getTypeScriptType(ctoFqn) {
|
|
84
|
+
var ns = concerto_core_1.ModelUtil.getNamespace(ctoFqn);
|
|
85
|
+
var type = concerto_core_1.ModelUtil.getShortName(ctoFqn);
|
|
86
|
+
if (ns === markdown_common_1.CommonMarkModel.NAMESPACE) {
|
|
87
|
+
return "CommonMark.I".concat(type);
|
|
88
|
+
}
|
|
89
|
+
else if (ns === markdown_common_1.CiceroMarkModel.NAMESPACE) {
|
|
90
|
+
return "CiceroMark.I".concat(type);
|
|
91
|
+
}
|
|
92
|
+
else if (ns === markdown_common_1.TemplateMarkModel.NAMESPACE) {
|
|
93
|
+
return "CiceroMark.I".concat(type.substring(0, type.length - 'Definition'.length));
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
throw new Error("No type mapping for ".concat(ctoFqn));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.getTypeScriptType = getTypeScriptType;
|
|
100
|
+
/**
|
|
101
|
+
* Map of a node from template mark to ciceromark
|
|
102
|
+
* @param {INode} templateMarkNode the template mark.
|
|
103
|
+
* @param {boolean} deep when deep is false (the default) child nodes are not copied
|
|
104
|
+
* @returns {INode} the mapped node
|
|
105
|
+
*/
|
|
106
|
+
function makeCiceroMark(templateMarkNode, deep) {
|
|
107
|
+
if (deep === void 0) { deep = false; }
|
|
108
|
+
if (!templateMarkNode.$class) {
|
|
109
|
+
throw new Error('Not a concerto type.');
|
|
110
|
+
}
|
|
111
|
+
var json = JSON.parse(JSON.stringify(templateMarkNode));
|
|
112
|
+
delete json.elementType;
|
|
113
|
+
if (!deep) {
|
|
114
|
+
delete json.nodes;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
if (json.nodes) {
|
|
118
|
+
json.nodes = json.nodes.map(function (n) { return makeCiceroMark(n, deep); });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
var ns = concerto_core_1.ModelUtil.getNamespace(json.$class);
|
|
122
|
+
var type = concerto_core_1.ModelUtil.getShortName(json.$class);
|
|
123
|
+
if (ns === markdown_common_1.TemplateMarkModel.NAMESPACE) {
|
|
124
|
+
json.$class = "".concat(markdown_common_1.CiceroMarkModel.NAMESPACE, ".").concat(type.substring(0, type.length - 'Definition'.length));
|
|
125
|
+
}
|
|
126
|
+
return json;
|
|
127
|
+
}
|
|
128
|
+
exports.makeCiceroMark = makeCiceroMark;
|
|
129
|
+
/**
|
|
130
|
+
* A node compiler that allows code to run on node enter, exit and
|
|
131
|
+
* with a generate method to generate code for the node.
|
|
132
|
+
*/
|
|
133
|
+
var AbstractComplexCompiler = /** @class */ (function () {
|
|
134
|
+
function AbstractComplexCompiler(leaf) {
|
|
135
|
+
this.leaf = leaf;
|
|
136
|
+
}
|
|
137
|
+
AbstractComplexCompiler.prototype.isLeaf = function () {
|
|
138
|
+
return this.leaf;
|
|
139
|
+
};
|
|
140
|
+
AbstractComplexCompiler.prototype.enter = function (fw, level, templateMarkNode) {
|
|
141
|
+
writeDebug(fw, level, templateMarkNode);
|
|
142
|
+
writeOpenNodeScope(fw, level);
|
|
143
|
+
};
|
|
144
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
145
|
+
AbstractComplexCompiler.prototype.exit = function (fw, level) {
|
|
146
|
+
writeCloseNodeScope(fw, level);
|
|
147
|
+
};
|
|
148
|
+
return AbstractComplexCompiler;
|
|
149
|
+
}());
|
|
150
|
+
exports.AbstractComplexCompiler = AbstractComplexCompiler;
|
|
151
|
+
/**
|
|
152
|
+
* A node compiler that allows a JSON node to be constructed from
|
|
153
|
+
* the data in a templatemark node.
|
|
154
|
+
*/
|
|
155
|
+
var AbstractSimpleCompiler = /** @class */ (function (_super) {
|
|
156
|
+
__extends(AbstractSimpleCompiler, _super);
|
|
157
|
+
function AbstractSimpleCompiler(leaf) {
|
|
158
|
+
return _super.call(this, leaf) || this;
|
|
159
|
+
}
|
|
160
|
+
AbstractSimpleCompiler.prototype.generate = function (fw, level, templateMarkNode) {
|
|
161
|
+
var node = this.getNode(templateMarkNode);
|
|
162
|
+
if (this.isLeaf()) {
|
|
163
|
+
node.nodes = []; // we are a leaf node, null out child nodes
|
|
164
|
+
}
|
|
165
|
+
writeOpenGenerateScope(fw, level);
|
|
166
|
+
fw.writeLine(level, "return ".concat(JSON.stringify(node), " as ").concat(getTypeScriptType(node.$class), ";"));
|
|
167
|
+
writeCloseGenerateScope(fw, level);
|
|
168
|
+
};
|
|
169
|
+
return AbstractSimpleCompiler;
|
|
170
|
+
}(AbstractComplexCompiler));
|
|
171
|
+
exports.AbstractSimpleCompiler = AbstractSimpleCompiler;
|
|
172
|
+
/**
|
|
173
|
+
* PassThroughNode simply maps data from TemplateMark to
|
|
174
|
+
* CiceroMark, updating namespaces but otherwise leaving
|
|
175
|
+
* the data alone.
|
|
176
|
+
*/
|
|
177
|
+
var PassThrough = /** @class */ (function (_super) {
|
|
178
|
+
__extends(PassThrough, _super);
|
|
179
|
+
function PassThrough(leaf) {
|
|
180
|
+
return _super.call(this, leaf) || this;
|
|
181
|
+
}
|
|
182
|
+
PassThrough.prototype.getNode = function (templateMarkNode) {
|
|
183
|
+
return makeCiceroMark(templateMarkNode);
|
|
184
|
+
};
|
|
185
|
+
return PassThrough;
|
|
186
|
+
}(AbstractSimpleCompiler));
|
|
187
|
+
exports.PassThrough = PassThrough;
|
|
188
|
+
/**
|
|
189
|
+
* Ignore doesn't write any output for a node type
|
|
190
|
+
*/
|
|
191
|
+
var Ignore = /** @class */ (function () {
|
|
192
|
+
function Ignore() {
|
|
193
|
+
}
|
|
194
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
195
|
+
Ignore.prototype.enter = function (fw, level, templateMarkNode) {
|
|
196
|
+
};
|
|
197
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
198
|
+
Ignore.prototype.generate = function (fw, level, templateMarkNode) {
|
|
199
|
+
};
|
|
200
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
201
|
+
Ignore.prototype.exit = function (fw, level, templateMarkNode) {
|
|
202
|
+
};
|
|
203
|
+
return Ignore;
|
|
204
|
+
}());
|
|
205
|
+
exports.Ignore = Ignore;
|
|
206
|
+
//# sourceMappingURL=Common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Common.js","sourceRoot":"","sources":["../../src/compilers/Common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAcA,kEAAmG;AAEnG,8DAA2E;AAG3E,SAAgB,UAAU,CAAC,EAAa,EAAE,KAAY,EAAE,OAAW;IAC/D,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,aAAM,yBAAS,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAA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Definition } from '../model-gen/org.accordproject.templatemark@0.4.0';
|
|
3
|
+
import { AbstractComplexCompiler } from './Common';
|
|
4
|
+
interface INamedConditionalDefinition extends IConditionalDefinition {
|
|
5
|
+
readonly functionName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class Conditional extends AbstractComplexCompiler {
|
|
8
|
+
static TYPE: string;
|
|
9
|
+
constructor();
|
|
10
|
+
generate(fw: FileWriter, level: number, templateMarkNode: INamedConditionalDefinition): void;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.Conditional = void 0;
|
|
19
|
+
var markdown_common_1 = require("@accordproject/markdown-common");
|
|
20
|
+
var Common_1 = require("./Common");
|
|
21
|
+
var Conditional = /** @class */ (function (_super) {
|
|
22
|
+
__extends(Conditional, _super);
|
|
23
|
+
function Conditional() {
|
|
24
|
+
return _super.call(this, false) || this;
|
|
25
|
+
}
|
|
26
|
+
Conditional.prototype.generate = function (fw, level, templateMarkNode) {
|
|
27
|
+
var clone = (0, Common_1.makeCiceroMark)(templateMarkNode, true);
|
|
28
|
+
delete clone.condition;
|
|
29
|
+
delete clone.dependencies;
|
|
30
|
+
delete clone.functionName;
|
|
31
|
+
clone.isTrue = true;
|
|
32
|
+
(0, Common_1.writeOpenGenerateScope)(fw, level);
|
|
33
|
+
if (templateMarkNode.condition) {
|
|
34
|
+
fw.writeLine(level, "const isTrue:boolean = UserCode.".concat(templateMarkNode.functionName, "(data,library,now)"));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
(0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name);
|
|
38
|
+
fw.writeLine(level, 'const isTrue:boolean = Runtime.peek($data);');
|
|
39
|
+
(0, Common_1.writeCloseDataScope)(fw, level);
|
|
40
|
+
}
|
|
41
|
+
fw.writeLine(level, "const curNode = ".concat(JSON.stringify(clone), " as ").concat((0, Common_1.getTypeScriptType)(templateMarkNode.$class), ";"));
|
|
42
|
+
fw.writeLine(level, '(curNode as CiceroMark.IConditional).isTrue = isTrue;');
|
|
43
|
+
fw.writeLine(level, 'return curNode;');
|
|
44
|
+
(0, Common_1.writeCloseGenerateScope)(fw, level);
|
|
45
|
+
delete templateMarkNode.condition;
|
|
46
|
+
delete templateMarkNode.whenTrue;
|
|
47
|
+
delete templateMarkNode.whenFalse;
|
|
48
|
+
};
|
|
49
|
+
Conditional.TYPE = "".concat(markdown_common_1.TemplateMarkModel.NAMESPACE, ".ConditionalDefinition");
|
|
50
|
+
return Conditional;
|
|
51
|
+
}(Common_1.AbstractComplexCompiler));
|
|
52
|
+
exports.Conditional = Conditional;
|
|
53
|
+
//# sourceMappingURL=Conditional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Conditional.js","sourceRoot":"","sources":["../../src/compilers/Conditional.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAcA,kEAAmE;AAGnE,mCAAgL;AAMhL;IAAiC,+BAAuB;IAEpD;eACI,kBAAM,KAAK,CAAC;IAChB,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CAAC;IA4BzE,kBAAC;CAAA,AA7BD,CAAiC,gCAAuB,GA6BvD;AA7BY,kCAAW"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IContract } from '../model-gen/org.accordproject.ciceromark@0.6.0';
|
|
2
|
+
import { IContractDefinition } from '../model-gen/org.accordproject.templatemark@0.4.0';
|
|
3
|
+
import { AbstractSimpleCompiler } from './Common';
|
|
4
|
+
export declare class ContractDefinition extends AbstractSimpleCompiler {
|
|
5
|
+
static TYPE: string;
|
|
6
|
+
constructor();
|
|
7
|
+
getNode(templateMarkNode: IContractDefinition): IContract;
|
|
8
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ContractDefinition = void 0;
|
|
19
|
+
/*
|
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License.
|
|
22
|
+
* You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
var markdown_common_1 = require("@accordproject/markdown-common");
|
|
33
|
+
var Common_1 = require("./Common");
|
|
34
|
+
var ContractDefinition = /** @class */ (function (_super) {
|
|
35
|
+
__extends(ContractDefinition, _super);
|
|
36
|
+
function ContractDefinition() {
|
|
37
|
+
return _super.call(this, false) || this;
|
|
38
|
+
}
|
|
39
|
+
ContractDefinition.prototype.getNode = function (templateMarkNode) {
|
|
40
|
+
return {
|
|
41
|
+
$class: "".concat(markdown_common_1.CiceroMarkModel.NAMESPACE, ".Contract"),
|
|
42
|
+
name: templateMarkNode.name,
|
|
43
|
+
nodes: []
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
ContractDefinition.TYPE = "".concat(markdown_common_1.TemplateMarkModel.NAMESPACE, ".ContractDefinition");
|
|
47
|
+
return ContractDefinition;
|
|
48
|
+
}(Common_1.AbstractSimpleCompiler));
|
|
49
|
+
exports.ContractDefinition = ContractDefinition;
|
|
50
|
+
//# sourceMappingURL=ContractDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContractDefinition.js","sourceRoot":"","sources":["../../src/compilers/ContractDefinition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;GAYG;AACH,kEAAmF;AAGnF,mCAAkD;AAElD;IAAwC,sCAAsB;IAE1D;eACI,kBAAM,KAAK,CAAC;IAChB,CAAC;IACD,oCAAO,GAAP,UAAQ,gBAAoC;QACxC,OAAO;YACH,MAAM,EAAE,UAAG,iCAAe,CAAC,SAAS,cAAW;YAC/C,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,KAAK,EAAE,EAAE;SACC,CAAC;IACnB,CAAC;IAVM,uBAAI,GAAG,UAAG,mCAAiB,CAAC,SAAS,wBAAqB,CAAC;IAWtE,yBAAC;CAAA,AAZD,CAAwC,+BAAsB,GAY7D;AAZY,gDAAkB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FileWriter } from '@accordproject/concerto-util';
|
|
2
|
+
import { IFormattedVariableDefinition } from '../model-gen/org.accordproject.templatemark@0.4.0';
|
|
3
|
+
import { AbstractComplexCompiler } from './Common';
|
|
4
|
+
export declare class FormattedVariable extends AbstractComplexCompiler {
|
|
5
|
+
static TYPE: string;
|
|
6
|
+
constructor();
|
|
7
|
+
generate(fw: FileWriter, level: number, templateMarkNode: IFormattedVariableDefinition): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.FormattedVariable = void 0;
|
|
19
|
+
var markdown_common_1 = require("@accordproject/markdown-common");
|
|
20
|
+
var Common_1 = require("./Common");
|
|
21
|
+
var FormattedVariable = /** @class */ (function (_super) {
|
|
22
|
+
__extends(FormattedVariable, _super);
|
|
23
|
+
function FormattedVariable() {
|
|
24
|
+
return _super.call(this, true) || this;
|
|
25
|
+
}
|
|
26
|
+
FormattedVariable.prototype.generate = function (fw, level, templateMarkNode) {
|
|
27
|
+
var clone = (0, Common_1.makeCiceroMark)(templateMarkNode);
|
|
28
|
+
(0, Common_1.writeOpenGenerateScope)(fw, level);
|
|
29
|
+
if (templateMarkNode.name !== 'this') {
|
|
30
|
+
(0, Common_1.writeOpenDataScope)(fw, level, templateMarkNode.name);
|
|
31
|
+
}
|
|
32
|
+
fw.writeLine(level, "const drafter = $draftingMap.get('".concat(templateMarkNode.elementType, "');"));
|
|
33
|
+
fw.writeLine(level, "const text = drafter ? drafter(Runtime.peek($data), '".concat(templateMarkNode.format, "') : JSON.stringify(Runtime.peek($data)) as string;"));
|
|
34
|
+
if (templateMarkNode.name !== 'this') {
|
|
35
|
+
(0, Common_1.writeCloseDataScope)(fw, level);
|
|
36
|
+
}
|
|
37
|
+
fw.writeLine(level, "const variable:any = ".concat(JSON.stringify(clone), ";"));
|
|
38
|
+
fw.writeLine(level, 'variable.value = text;');
|
|
39
|
+
fw.writeLine(level, "return variable as ".concat((0, Common_1.getTypeScriptType)(clone.$class), ";"));
|
|
40
|
+
(0, Common_1.writeCloseGenerateScope)(fw, level);
|
|
41
|
+
};
|
|
42
|
+
FormattedVariable.TYPE = "".concat(markdown_common_1.TemplateMarkModel.NAMESPACE, ".FormattedVariableDefinition");
|
|
43
|
+
return FormattedVariable;
|
|
44
|
+
}(Common_1.AbstractComplexCompiler));
|
|
45
|
+
exports.FormattedVariable = FormattedVariable;
|
|
46
|
+
//# sourceMappingURL=FormattedVariable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormattedVariable.js","sourceRoot":"","sources":["../../src/compilers/FormattedVariable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAcA,kEAAmE;AAGnE,mCAAgL;AAEhL;IAAuC,qCAAuB;IA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-gen/org.accordproject.templatemark@0.4.0';
|
|
3
|
+
import { AbstractComplexCompiler } from './Common';
|
|
4
|
+
export declare class Formula extends AbstractComplexCompiler {
|
|
5
|
+
static TYPE: string;
|
|
6
|
+
constructor();
|
|
7
|
+
generate(fw: FileWriter, level: number, templateMarkNode: IFormulaDefinition): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.Formula = void 0;
|
|
19
|
+
var markdown_common_1 = require("@accordproject/markdown-common");
|
|
20
|
+
var Common_1 = require("./Common");
|
|
21
|
+
var Formula = /** @class */ (function (_super) {
|
|
22
|
+
__extends(Formula, _super);
|
|
23
|
+
function Formula() {
|
|
24
|
+
return _super.call(this, true) || this;
|
|
25
|
+
}
|
|
26
|
+
Formula.prototype.generate = function (fw, level, templateMarkNode) {
|
|
27
|
+
var clone = (0, Common_1.makeCiceroMark)(templateMarkNode);
|
|
28
|
+
(0, Common_1.writeOpenGenerateScope)(fw, level);
|
|
29
|
+
fw.writeLine(level, "const formulaResult = UserCode.".concat(templateMarkNode.name, "(data,library,now);"));
|
|
30
|
+
fw.writeLine(level, 'const text = JSON.stringify(formulaResult);');
|
|
31
|
+
fw.writeLine(level, "const formula:any = ".concat(JSON.stringify(clone), ";"));
|
|
32
|
+
fw.writeLine(level, 'formula.value = text;');
|
|
33
|
+
fw.writeLine(level, "formula.code = ".concat(JSON.stringify(templateMarkNode.code.contents), ";")); // HACK - update model
|
|
34
|
+
fw.writeLine(level, "return formula as ".concat((0, Common_1.getTypeScriptType)(clone.$class), ";"));
|
|
35
|
+
(0, Common_1.writeCloseGenerateScope)(fw, level);
|
|
36
|
+
};
|
|
37
|
+
Formula.TYPE = "".concat(markdown_common_1.TemplateMarkModel.NAMESPACE, ".FormulaDefinition");
|
|
38
|
+
return Formula;
|
|
39
|
+
}(Common_1.AbstractComplexCompiler));
|
|
40
|
+
exports.Formula = Formula;
|
|
41
|
+
//# sourceMappingURL=Formula.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Formula.js","sourceRoot":"","sources":["../../src/compilers/Formula.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAcA,kEAAmE;AAGnE,mCAAuI;AAEvI;IAA6B,2BAAuB;IAEhD;eACI,kBAAM,IAAI,CAAC;IACf,CAAC;IACD,0BAAQ,GAAR,UAAS,EAAa,EAAE,KAAY,EAAE,gBAAmC;QACrE,IAAM,KAAK,GAAG,IAAA,uBAAc,EAAC,gBAAgB,CAAa,CAAC;QAC3D,IAAA,+BAAsB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;QACjC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,yCAAkC,gBAAgB,CAAC,IAAI,wBAAqB,CAAC,CAAC;QAClG,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,6CAA6C,CAAC,CAAC;QACnE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,8BAAuB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAG,CAAC,CAAC;QACrE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC;QAC7C,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,yBAAkB,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAG,CAAC,CAAC,CAAC,sBAAsB;QAChH,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,4BAAqB,IAAA,0BAAiB,EAAC,KAAK,CAAC,MAAM,CAAC,MAAG,CAAC,CAAC;QAC7E,IAAA,gCAAuB,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAdM,YAAI,GAAG,UAAG,mCAAiB,CAAC,SAAS,uBAAoB,CAAC;IAerE,cAAC;CAAA,AAhBD,CAA6B,gCAAuB,GAgBnD;AAhBY,0BAAO"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FileWriter } from '@accordproject/concerto-util';
|
|
2
|
+
import { IJoinDefinition } from '../model-gen/org.accordproject.templatemark@0.4.0';
|
|
3
|
+
import { AbstractComplexCompiler } from './Common';
|
|
4
|
+
export declare class Join extends AbstractComplexCompiler {
|
|
5
|
+
static TYPE: string;
|
|
6
|
+
constructor();
|
|
7
|
+
generate(fw: FileWriter, level: number, templateMarkNode: IJoinDefinition): void;
|
|
8
|
+
}
|