corba.js 0.1.1 → 0.1.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/README.md +24 -13
- package/package.json +16 -12
- package/lib/idl/idl.cjs +0 -2732
- package/lib/idl/idl.cjs.map +0 -1
- package/lib/idl/src/idl/idl-lexer.d.ts +0 -19
- package/lib/idl/src/idl/idl-node.d.ts +0 -101
- package/lib/idl/src/idl/idl-parser.d.ts +0 -3
- package/lib/idl/src/idl/idl.d.ts +0 -1
- package/lib/idl/src/idl/util.d.ts +0 -25
- package/lib/idl/src/idl/write-interface.d.ts +0 -2
- package/lib/idl/src/idl/write-skeleton.d.ts +0 -2
- package/lib/idl/src/idl/write-stub.d.ts +0 -2
- package/lib/idl/src/idl/write-value.d.ts +0 -2
- package/lib/idl/src/idl/write-valueimpl.d.ts +0 -2
- package/lib/idl/src/idl/write-valuetype.d.ts +0 -2
- package/lib/idl/src/index.d.ts +0 -5
- package/lib/idl/src/net/browser.d.ts +0 -7
- package/lib/idl/src/net/index.d.ts +0 -3
- package/lib/idl/src/net/tcp.d.ts +0 -11
- package/lib/idl/src/net/tls.d.ts +0 -24
- package/lib/idl/src/net/ws.d.ts +0 -42
- package/lib/idl/src/orb/asn1.d.ts +0 -48
- package/lib/idl/src/orb/connection.d.ts +0 -24
- package/lib/idl/src/orb/giop.d.ts +0 -273
- package/lib/idl/src/orb/index.d.ts +0 -3
- package/lib/idl/src/orb/ior.d.ts +0 -89
- package/lib/idl/src/orb/orb.d.ts +0 -143
- package/lib/idl/src/orb/protocol.d.ts +0 -6
- package/lib/idl/src/orb/uint8map.d.ts +0 -14
- package/lib/idl/src/orb/url.d.ts +0 -55
- package/lib/idl/test/access.spec.d.ts +0 -1
- package/lib/idl/test/attribute.spec.d.ts +0 -1
- package/lib/idl/test/basics.spec.d.ts +0 -1
- package/lib/idl/test/disconnect.spec.d.ts +0 -1
- package/lib/idl/test/eventtarget.spec.d.ts +0 -1
- package/lib/idl/test/fake.d.ts +0 -31
- package/lib/idl/test/giop.spec.d.ts +0 -1
- package/lib/idl/test/idl/idl.spec.d.ts +0 -1
- package/lib/idl/test/idl_module.spec.d.ts +0 -1
- package/lib/idl/test/initialreferences.spec.d.ts +0 -1
- package/lib/idl/test/net/tls.spec.d.ts +0 -1
- package/lib/idl/test/net/ws.spec.d.ts +0 -1
- package/lib/idl/test/net/wss.spec.d.ts +0 -1
- package/lib/idl/test/object_by_reference.spec.d.ts +0 -1
- package/lib/idl/test/orb/asn1.spec.d.ts +0 -1
- package/lib/idl/test/orb/url.spec.d.ts +0 -1
- package/lib/idl/test/stub.spec.d.ts +0 -1
- package/lib/idl/test/util.d.ts +0 -5
- package/lib/idl/test/valuetype.spec.d.ts +0 -1
- package/lib/src/idl/idl-lexer.d.ts +0 -19
- package/lib/src/idl/idl-lexer.js +0 -234
- package/lib/src/idl/idl-lexer.js.map +0 -1
- package/lib/src/idl/idl-node.d.ts +0 -101
- package/lib/src/idl/idl-node.js +0 -212
- package/lib/src/idl/idl-node.js.map +0 -1
- package/lib/src/idl/idl-parser.d.ts +0 -3
- package/lib/src/idl/idl-parser.js +0 -1084
- package/lib/src/idl/idl-parser.js.map +0 -1
- package/lib/src/idl/idl.d.ts +0 -1
- package/lib/src/idl/idl.js +0 -180
- package/lib/src/idl/idl.js.map +0 -1
- package/lib/src/idl/util.d.ts +0 -25
- package/lib/src/idl/util.js +0 -239
- package/lib/src/idl/util.js.map +0 -1
- package/lib/src/idl/write-interface.d.ts +0 -2
- package/lib/src/idl/write-interface.js +0 -111
- package/lib/src/idl/write-interface.js.map +0 -1
- package/lib/src/idl/write-skeleton.d.ts +0 -2
- package/lib/src/idl/write-skeleton.js +0 -116
- package/lib/src/idl/write-skeleton.js.map +0 -1
- package/lib/src/idl/write-stub.d.ts +0 -2
- package/lib/src/idl/write-stub.js +0 -116
- package/lib/src/idl/write-stub.js.map +0 -1
- package/lib/src/idl/write-value.d.ts +0 -2
- package/lib/src/idl/write-value.js +0 -205
- package/lib/src/idl/write-value.js.map +0 -1
- package/lib/src/idl/write-valueimpl.d.ts +0 -2
- package/lib/src/idl/write-valueimpl.js +0 -158
- package/lib/src/idl/write-valueimpl.js.map +0 -1
- package/lib/src/idl/write-valuetype.d.ts +0 -2
- package/lib/src/idl/write-valuetype.js +0 -98
- package/lib/src/idl/write-valuetype.js.map +0 -1
- package/lib/src/index.d.ts +0 -5
- package/lib/src/index.js +0 -6
- package/lib/src/index.js.map +0 -1
- package/lib/src/net/browser.d.ts +0 -7
- package/lib/src/net/browser.js +0 -54
- package/lib/src/net/browser.js.map +0 -1
- package/lib/src/net/index.d.ts +0 -3
- package/lib/src/net/index.js +0 -4
- package/lib/src/net/index.js.map +0 -1
- package/lib/src/net/tcp.d.ts +0 -11
- package/lib/src/net/tcp.js +0 -66
- package/lib/src/net/tcp.js.map +0 -1
- package/lib/src/net/tls.d.ts +0 -24
- package/lib/src/net/tls.js +0 -69
- package/lib/src/net/tls.js.map +0 -1
- package/lib/src/net/ws.d.ts +0 -42
- package/lib/src/net/ws.js +0 -158
- package/lib/src/net/ws.js.map +0 -1
- package/lib/src/orb/asn1.d.ts +0 -48
- package/lib/src/orb/asn1.js +0 -60
- package/lib/src/orb/asn1.js.map +0 -1
- package/lib/src/orb/connection.d.ts +0 -24
- package/lib/src/orb/connection.js +0 -19
- package/lib/src/orb/connection.js.map +0 -1
- package/lib/src/orb/giop.d.ts +0 -273
- package/lib/src/orb/giop.js +0 -1160
- package/lib/src/orb/giop.js.map +0 -1
- package/lib/src/orb/index.d.ts +0 -3
- package/lib/src/orb/index.js +0 -4
- package/lib/src/orb/index.js.map +0 -1
- package/lib/src/orb/ior.d.ts +0 -89
- package/lib/src/orb/ior.js +0 -110
- package/lib/src/orb/ior.js.map +0 -1
- package/lib/src/orb/orb.d.ts +0 -143
- package/lib/src/orb/orb.js +0 -693
- package/lib/src/orb/orb.js.map +0 -1
- package/lib/src/orb/protocol.d.ts +0 -6
- package/lib/src/orb/protocol.js +0 -2
- package/lib/src/orb/protocol.js.map +0 -1
- package/lib/src/orb/uint8map.d.ts +0 -14
- package/lib/src/orb/uint8map.js +0 -48
- package/lib/src/orb/uint8map.js.map +0 -1
- package/lib/src/orb/url.d.ts +0 -55
- package/lib/src/orb/url.js +0 -252
- package/lib/src/orb/url.js.map +0 -1
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import { Type } from "./idl-node.js";
|
|
3
|
-
import { filenamePrefix, filename, filenameLocal, hasValueType, typeIDLtoTS, FileType, writeIndent } from "./util.js";
|
|
4
|
-
export function writeTSInterface(specification) {
|
|
5
|
-
let out = fs.createWriteStream(filenamePrefix + ".ts");
|
|
6
|
-
out.write("// This file is generated by the corba.js IDL compiler from '" + filename + "'.\n\n");
|
|
7
|
-
if (hasValueType(specification)) {
|
|
8
|
-
out.write("import * as valuetype from \"./" + filenameLocal + "_valuetype\"\n\n");
|
|
9
|
-
}
|
|
10
|
-
writeTSInterfaceDefinitions(out, specification);
|
|
11
|
-
}
|
|
12
|
-
function writeTSInterfaceDefinitions(out, specification, prefix = "", indent = 0) {
|
|
13
|
-
for (let definition of specification.child) {
|
|
14
|
-
switch (definition.type) {
|
|
15
|
-
case Type.TKN_MODULE:
|
|
16
|
-
out.write("export namespace " + definition.text + " {\n\n");
|
|
17
|
-
writeTSInterfaceDefinitions(out, definition, prefix + definition.text + ".", indent + 1);
|
|
18
|
-
out.write("} // namespace " + definition.text + "\n\n");
|
|
19
|
-
break;
|
|
20
|
-
case Type.SYN_INTERFACE:
|
|
21
|
-
{
|
|
22
|
-
let interface_dcl = definition;
|
|
23
|
-
let identifier = interface_dcl.child[0].child[1].text;
|
|
24
|
-
let interface_body = interface_dcl.child[1];
|
|
25
|
-
out.write(`export interface ${identifier} {\n`);
|
|
26
|
-
for (let _export of interface_body.child) {
|
|
27
|
-
switch (_export.type) {
|
|
28
|
-
case Type.SYN_OPERATION_DECLARATION:
|
|
29
|
-
{
|
|
30
|
-
let op_dcl = _export;
|
|
31
|
-
let attribute = op_dcl.child[0];
|
|
32
|
-
let type = op_dcl.child[1];
|
|
33
|
-
let oneway = false;
|
|
34
|
-
if (attribute !== undefined && attribute.type === Type.TKN_ONEWAY)
|
|
35
|
-
oneway = true;
|
|
36
|
-
if (oneway && type.type !== Type.TKN_VOID)
|
|
37
|
-
throw Error("oneway methods must return void");
|
|
38
|
-
let identifier = op_dcl.child[2].text;
|
|
39
|
-
let parameter_decls = op_dcl.child[3].child;
|
|
40
|
-
out.write(" ");
|
|
41
|
-
out.write(identifier + "(");
|
|
42
|
-
let comma = false;
|
|
43
|
-
for (let parameter_dcl of parameter_decls) {
|
|
44
|
-
let attribute = parameter_dcl.child[0].type;
|
|
45
|
-
let type = parameter_dcl.child[1];
|
|
46
|
-
let identifier = parameter_dcl.child[2].text;
|
|
47
|
-
if (attribute !== Type.TKN_IN) {
|
|
48
|
-
throw Error("corba.js currently only supports 'in' parameters");
|
|
49
|
-
}
|
|
50
|
-
if (!comma) {
|
|
51
|
-
comma = true;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
out.write(", ");
|
|
55
|
-
}
|
|
56
|
-
out.write(identifier + ": " + typeIDLtoTS(type, FileType.INTERFACE));
|
|
57
|
-
}
|
|
58
|
-
if (oneway) {
|
|
59
|
-
out.write(`): ${typeIDLtoTS(type, FileType.INTERFACE)}\n`);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
out.write(`): Promise<${typeIDLtoTS(type, FileType.INTERFACE)}>\n`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
break;
|
|
66
|
-
case Type.TKN_ATTRIBUTE:
|
|
67
|
-
{
|
|
68
|
-
}
|
|
69
|
-
break;
|
|
70
|
-
default:
|
|
71
|
-
throw Error("fuck");
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
out.write("}\n\n");
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
case Type.TKN_STRUCT:
|
|
78
|
-
{
|
|
79
|
-
const identifier = definition.text;
|
|
80
|
-
writeIndent(out, indent);
|
|
81
|
-
out.write(`export interface ${identifier} {\n`);
|
|
82
|
-
const member_list = definition.child;
|
|
83
|
-
for (const member of member_list) {
|
|
84
|
-
const type_spec = member.child[0];
|
|
85
|
-
const declarators = member.child[1];
|
|
86
|
-
for (const declarator of declarators.child) {
|
|
87
|
-
writeIndent(out, indent + 1);
|
|
88
|
-
out.write(`${declarator.text}: ${typeIDLtoTS(type_spec, FileType.INTERFACE)}\n`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
writeIndent(out, indent);
|
|
92
|
-
out.write("}\n\n");
|
|
93
|
-
}
|
|
94
|
-
break;
|
|
95
|
-
case Type.TKN_ENUM:
|
|
96
|
-
{
|
|
97
|
-
const identifier = definition.text;
|
|
98
|
-
writeIndent(out, indent);
|
|
99
|
-
out.write(`export enum ${identifier} {\n`);
|
|
100
|
-
for (const enumerator of definition.child) {
|
|
101
|
-
writeIndent(out, indent + 1);
|
|
102
|
-
out.write(`${enumerator.text},\n`);
|
|
103
|
-
}
|
|
104
|
-
writeIndent(out, indent);
|
|
105
|
-
out.write("}\n\n");
|
|
106
|
-
}
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=write-interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-interface.js","sourceRoot":"","sources":["../../../src/idl/write-interface.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,IAAI,EAAQ,sBAAkB;AACvC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAc;AAElH,MAAM,UAAU,gBAAgB,CAAC,aAAmB;IAChD,IAAI,GAAG,GAAG,EAAE,CAAC,iBAAiB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AAK,CAAC,GAAG,UAAW,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;yBACpF;qBAEJ;oBACD,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;oBACxB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;iBACrB;gBAAC,MAAK;YAEP,KAAK,IAAI,CAAC,QAAQ;gBAAE;oBAChB,MAAM,UAAU,GAAG,UAAW,CAAC,IAAK,CAAA;oBACpC,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;oBACxB,GAAG,CAAC,KAAK,CAAC,eAAe,UAAU,MAAM,CAAC,CAAA;oBAC1C,KAAK,MAAM,UAAU,IAAI,UAAW,CAAC,KAAK,EAAE;wBACxC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,CAAA;wBAC5B,GAAG,CAAC,KAAK,CAAC,GAAG,UAAW,CAAC,IAAI,KAAK,CAAC,CAAA;qBACtC;oBACD,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;oBACxB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;iBACrB;gBAAC,MAAK;SACV;KACJ;AACL,CAAC"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import { Type } from "./idl-node.js";
|
|
3
|
-
import { filenamePrefix, filename, filenameLocal, hasValueType, typeIDLtoTS, typeIDLtoGIOP, FileType } from "./util.js";
|
|
4
|
-
export function writeTSSkeleton(specification) {
|
|
5
|
-
let out = fs.createWriteStream(filenamePrefix + "_skel.ts");
|
|
6
|
-
out.write("// This file is generated by the corba.js IDL compiler from '" + filename + "'.\n\n");
|
|
7
|
-
out.write("import { ORB, Skeleton, GIOPEncoder, GIOPDecoder } from 'corba.js'\n");
|
|
8
|
-
if (hasValueType(specification)) {
|
|
9
|
-
out.write(`import * as valuetype from \"./${filenameLocal}_valuetype\"\n`);
|
|
10
|
-
}
|
|
11
|
-
out.write(`import * as _interface from \"./${filenameLocal}\"\n\n`);
|
|
12
|
-
writeTSSkeletonDefinitions(out, specification);
|
|
13
|
-
}
|
|
14
|
-
function writeTSSkeletonDefinitions(out, specification, prefix = "", indent = 0) {
|
|
15
|
-
for (let definition of specification.child) {
|
|
16
|
-
switch (definition.type) {
|
|
17
|
-
case Type.TKN_MODULE:
|
|
18
|
-
out.write(`export namespace ${definition.text}{\n\n`);
|
|
19
|
-
writeTSSkeletonDefinitions(out, definition, prefix + definition.text + ".", indent + 1);
|
|
20
|
-
out.write(`} // namespace ${definition.text}\n\n`);
|
|
21
|
-
break;
|
|
22
|
-
case Type.SYN_INTERFACE:
|
|
23
|
-
{
|
|
24
|
-
let interface_dcl = definition;
|
|
25
|
-
let identifier = interface_dcl.child[0].child[1].text;
|
|
26
|
-
let interface_body = interface_dcl.child[1];
|
|
27
|
-
out.write(`export abstract class ${identifier} extends Skeleton implements _interface.${prefix}${identifier} {\n`);
|
|
28
|
-
out.write(` constructor(orb: ORB) { super(orb) }\n`);
|
|
29
|
-
out.write(" static _idlClassName(): string {\n");
|
|
30
|
-
out.write(` return "${prefix}${identifier}"\n`);
|
|
31
|
-
out.write(" }\n\n");
|
|
32
|
-
for (let _export of interface_body.child) {
|
|
33
|
-
switch (_export.type) {
|
|
34
|
-
case Type.SYN_OPERATION_DECLARATION:
|
|
35
|
-
{
|
|
36
|
-
let op_dcl = _export;
|
|
37
|
-
let attribute = op_dcl.child[0];
|
|
38
|
-
let type = op_dcl.child[1];
|
|
39
|
-
let oneway = false;
|
|
40
|
-
if (attribute !== undefined && attribute.type === Type.TKN_ONEWAY)
|
|
41
|
-
oneway = true;
|
|
42
|
-
if (oneway && type.type !== Type.TKN_VOID)
|
|
43
|
-
throw Error("oneway methods must return void");
|
|
44
|
-
let identifier = op_dcl.child[2].text;
|
|
45
|
-
let parameter_decls = op_dcl.child[3].child;
|
|
46
|
-
out.write(` abstract ${identifier}(`);
|
|
47
|
-
let comma = false;
|
|
48
|
-
for (let parameter_dcl of parameter_decls) {
|
|
49
|
-
let attribute = parameter_dcl.child[0].type;
|
|
50
|
-
let type = parameter_dcl.child[1];
|
|
51
|
-
let identifier = parameter_dcl.child[2].text;
|
|
52
|
-
if (attribute !== Type.TKN_IN) {
|
|
53
|
-
throw Error("corba.js currently only supports 'in' parameters");
|
|
54
|
-
}
|
|
55
|
-
if (!comma) {
|
|
56
|
-
comma = true;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
out.write(", ");
|
|
60
|
-
}
|
|
61
|
-
out.write(`${identifier}: ${typeIDLtoTS(type, FileType.SKELETON)}`);
|
|
62
|
-
}
|
|
63
|
-
if (oneway)
|
|
64
|
-
out.write(`): void\n`);
|
|
65
|
-
else
|
|
66
|
-
out.write(`): Promise<${typeIDLtoTS(type, FileType.SKELETON)}>\n`);
|
|
67
|
-
out.write(` private async _orb_${identifier}(decoder: GIOPDecoder, encoder: GIOPEncoder) {\n`);
|
|
68
|
-
switch (type.type) {
|
|
69
|
-
case Type.TKN_VOID:
|
|
70
|
-
if (oneway) {
|
|
71
|
-
out.write(` this.${identifier}(`);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
out.write(` await this.${identifier}(`);
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
out.write(` const result = await this.${identifier}(`);
|
|
79
|
-
}
|
|
80
|
-
comma = false;
|
|
81
|
-
for (let parameter_dcl of parameter_decls) {
|
|
82
|
-
let attribute = parameter_dcl.child[0].type;
|
|
83
|
-
let type = parameter_dcl.child[1];
|
|
84
|
-
if (attribute !== Type.TKN_IN) {
|
|
85
|
-
throw Error("corba.js currently only supports 'in' parameters");
|
|
86
|
-
}
|
|
87
|
-
if (!comma) {
|
|
88
|
-
comma = true;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
out.write(", ");
|
|
92
|
-
}
|
|
93
|
-
out.write(`${typeIDLtoGIOP(type)}`);
|
|
94
|
-
}
|
|
95
|
-
out.write(`)\n`);
|
|
96
|
-
if (type.type !== Type.TKN_VOID) {
|
|
97
|
-
out.write(` ${typeIDLtoGIOP(type, "result")}\n`);
|
|
98
|
-
}
|
|
99
|
-
out.write(` }\n`);
|
|
100
|
-
}
|
|
101
|
-
break;
|
|
102
|
-
case Type.TKN_ATTRIBUTE:
|
|
103
|
-
{
|
|
104
|
-
}
|
|
105
|
-
break;
|
|
106
|
-
default:
|
|
107
|
-
throw Error("yikes");
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
out.write("}\n\n");
|
|
111
|
-
}
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=write-skeleton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-skeleton.js","sourceRoot":"","sources":["../../../src/idl/write-skeleton.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,IAAI,EAAQ,sBAAkB;AACvC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,kBAAc;AAEpH,MAAM,UAAU,eAAe,CAAC,aAAmB;IAC/C,IAAI,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,cAAc,GAAG,UAAU,CAAC,CAAA;IAC3D,GAAG,CAAC,KAAK,CAAC,+DAA+D,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAA;IAChG,GAAG,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAA;IACjF,IAAI,YAAY,CAAC,aAAa,CAAC,EAAE;QAC7B,GAAG,CAAC,KAAK,CAAC,kCAAkC,aAAa,gBAAgB,CAAC,CAAA;KAC7E;IACD,GAAG,CAAC,KAAK,CAAC,mCAAmC,aAAa,QAAQ,CAAC,CAAA;IACnE,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A;qCACtC;oCAED,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;oCAChB,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,EAAE;wCAC7B,GAAG,CAAC,KAAK,CAAC,WAAW,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;qCAC1D;oCACD,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;iCAEvB;gCAAC,MAAK;4BACP,KAAK,IAAI,CAAC,aAAa;gCAAE;iCACxB;gCAAC,MAAK;4BACP;gCACI,MAAM,KAAK,CAAC,OAAO,CAAC,CAAA;yBAC3B;qBACJ;oBACD,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;iBACrB;gBAAC,MAAK;SACV;KACJ;AACL,CAAC"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import { Type } from "./idl-node.js";
|
|
3
|
-
import { filenamePrefix, filename, filenameLocal, hasValueType, typeIDLtoTS, typeIDLtoGIOP, FileType } from "./util.js";
|
|
4
|
-
export function writeTSStub(specification) {
|
|
5
|
-
let out = fs.createWriteStream(filenamePrefix + "_stub.ts");
|
|
6
|
-
out.write("// This file is generated by the corba.js IDL compiler from '" + filename + "'.\n\n");
|
|
7
|
-
out.write("import { ORB, Stub } from 'corba.js'\n");
|
|
8
|
-
if (hasValueType(specification)) {
|
|
9
|
-
out.write("import * as valuetype from \"./" + filenameLocal + "_valuetype\"\n");
|
|
10
|
-
}
|
|
11
|
-
out.write("import * as _interface from \"./" + filenameLocal + "\"\n\n");
|
|
12
|
-
writeTSStubDefinitions(out, specification);
|
|
13
|
-
}
|
|
14
|
-
function writeTSStubDefinitions(out, specification, prefix = "", indent = 0) {
|
|
15
|
-
for (let definition of specification.child) {
|
|
16
|
-
switch (definition.type) {
|
|
17
|
-
case Type.TKN_MODULE:
|
|
18
|
-
out.write("export namespace " + definition.text + " {\n\n");
|
|
19
|
-
writeTSStubDefinitions(out, definition, prefix + definition.text + ".", indent + 1);
|
|
20
|
-
out.write("} // namespace " + definition.text + "\n\n");
|
|
21
|
-
break;
|
|
22
|
-
case Type.SYN_INTERFACE:
|
|
23
|
-
{
|
|
24
|
-
let interface_dcl = definition;
|
|
25
|
-
let identifier = interface_dcl.child[0].child[1].text;
|
|
26
|
-
let interface_body = interface_dcl.child[1];
|
|
27
|
-
out.write(`export class ${identifier} extends Stub implements _interface.${prefix}${identifier} {\n`);
|
|
28
|
-
out.write(` static _idlClassName(): string {\n`);
|
|
29
|
-
out.write(` return "${prefix}${identifier}"\n`);
|
|
30
|
-
out.write(` }\n\n`);
|
|
31
|
-
out.write(` static narrow(object: any): ${prefix}${identifier} {\n`);
|
|
32
|
-
out.write(` if (object instanceof ${prefix}${identifier})\n`);
|
|
33
|
-
out.write(` return object as ${prefix}${identifier}\n`);
|
|
34
|
-
out.write(` throw Error("${prefix}${identifier}.narrow() failed")\n`);
|
|
35
|
-
out.write(` }\n\n`);
|
|
36
|
-
for (let _export of interface_body.child) {
|
|
37
|
-
switch (_export.type) {
|
|
38
|
-
case Type.SYN_OPERATION_DECLARATION:
|
|
39
|
-
{
|
|
40
|
-
let op_dcl = _export;
|
|
41
|
-
let attribute = op_dcl.child[0];
|
|
42
|
-
let returnType = op_dcl.child[1];
|
|
43
|
-
let oneway = false;
|
|
44
|
-
if (attribute !== undefined && attribute.type === Type.TKN_ONEWAY)
|
|
45
|
-
oneway = true;
|
|
46
|
-
if (oneway && returnType.type !== Type.TKN_VOID)
|
|
47
|
-
console.log("WARNING: corba.js currently requires every oneway function to return void");
|
|
48
|
-
let identifier = op_dcl.child[2].text;
|
|
49
|
-
let parameter_decls = op_dcl.child[3].child;
|
|
50
|
-
out.write(" async ");
|
|
51
|
-
out.write(identifier + "(");
|
|
52
|
-
let comma = false;
|
|
53
|
-
for (let parameter_dcl of parameter_decls) {
|
|
54
|
-
let attribute = parameter_dcl.child[0].type;
|
|
55
|
-
let type = parameter_dcl.child[1];
|
|
56
|
-
let identifier = parameter_dcl.child[2].text;
|
|
57
|
-
if (attribute !== Type.TKN_IN) {
|
|
58
|
-
throw Error("corba.js currently only supports 'in' parameters");
|
|
59
|
-
}
|
|
60
|
-
if (!comma) {
|
|
61
|
-
comma = true;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
out.write(", ");
|
|
65
|
-
}
|
|
66
|
-
out.write(`${identifier}: ${typeIDLtoTS(type, FileType.STUB)}`);
|
|
67
|
-
}
|
|
68
|
-
out.write(`): Promise<${typeIDLtoTS(returnType, FileType.STUB)}> {\n`);
|
|
69
|
-
out.write(" ");
|
|
70
|
-
if (returnType.type !== Type.TKN_VOID)
|
|
71
|
-
out.write("return ");
|
|
72
|
-
if (!oneway)
|
|
73
|
-
out.write("await ");
|
|
74
|
-
if (oneway) {
|
|
75
|
-
out.write(`this.orb.onewayCall(this, "${identifier}", `);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
out.write(`this.orb.twowayCall(this, "${identifier}", `);
|
|
79
|
-
}
|
|
80
|
-
out.write(`(encoder) => {\n`);
|
|
81
|
-
for (let parameter_dcl of parameter_decls) {
|
|
82
|
-
let type = parameter_dcl.child[1];
|
|
83
|
-
let identifier = parameter_dcl.child[2].text;
|
|
84
|
-
out.write(` ${typeIDLtoGIOP(type, identifier)}\n`);
|
|
85
|
-
}
|
|
86
|
-
if (oneway) {
|
|
87
|
-
out.write(` })\n`);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
out.write(` },\n`);
|
|
91
|
-
out.write(` `);
|
|
92
|
-
if (returnType.type !== Type.TKN_VOID) {
|
|
93
|
-
out.write(`(decoder) => ${typeIDLtoGIOP(returnType)})\n`);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
out.write(`(decoder) => {})\n`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
out.write(" }\n");
|
|
100
|
-
}
|
|
101
|
-
break;
|
|
102
|
-
case Type.TKN_ATTRIBUTE:
|
|
103
|
-
{
|
|
104
|
-
}
|
|
105
|
-
break;
|
|
106
|
-
default:
|
|
107
|
-
throw Error("yikes");
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
out.write("}\n\n");
|
|
111
|
-
}
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=write-stub.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-stub.js","sourceRoot":"","sources":["../../../src/idl/write-stub.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,IAAI,EAAQ,sBAAkB;AACvC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,kBAAc;AAEpH,MAAM,UAAU,WAAW,CAAC,aAAmB;IAC3C,IAAI,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,cAAc,GAAG,UAAU,CAAC,CAAA;IAC3D,GAAG,CAAC,KAAK,CAAC,+DAA+D,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAA;IAChG,GAAG,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAA;IACnD,IAAI,YAAY,CAAC,aAAa,CAAC,EAAE;QAC7B,GAAG,CAAC,KAAK,CAAC,iCAAiC,GAAG,aAAa,GAAG,gBAAgB,CAAC,CAAA;KAClF;IACD,GAAG,CAAC,KAAK,CAAC,kCAAkC,GAAG,aAAa,GAAG,QAAQ,CAAC,CAAA;IAExE,sBAAsB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;AAC9C,CAAC;AACD,SAAS,sBAAsB,CAAC,GAAmB,EAAE,aAAmB,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,CAAC;IAC7F,KAAK,IAAI,UAAU,IAAI,aAAa,CAAC,KAAK,EAA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c,CAAC,CAAA;qCAC5B;yCAAM;wCACH,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;wCACzB,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;wCACrB,IAAI,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,EAAE;4CACnC,GAAG,CAAC,KAAK,CAAC,gBAAgB,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;yCAC5D;6CAAM;4CACH,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;yCAClC;qCACJ;oCAGD,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;iCACvB;gCAAC,MAAK;4BACP,KAAK,IAAI,CAAC,aAAa;gCAAE;iCACxB;gCAAC,MAAK;4BACP;gCACI,MAAM,KAAK,CAAC,OAAO,CAAC,CAAA;yBAC3B;qBACJ;oBACD,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;iBACrB;gBAAC,MAAK;SACV;KACJ;AACL,CAAC"}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import { Type } from "./idl-node.js";
|
|
3
|
-
import { filenamePrefix, filename, hasNative, hasValueType, writeIndent, classAttributes, typeIDLtoTS, typeIDLtoGIOP, FileType, defaultValueIDLtoTS } from "./util.js";
|
|
4
|
-
let initCalls = "";
|
|
5
|
-
export function writeTSValue(specification) {
|
|
6
|
-
initCalls = "";
|
|
7
|
-
let out = fs.createWriteStream(filenamePrefix + "_value.ts");
|
|
8
|
-
out.write(`// This file is generated by the corba.js IDL compiler from '${filename}'.\n\n`);
|
|
9
|
-
out.write(`import { ORB, GIOPDecoder, GIOPEncoder } from 'corba.js'\n`);
|
|
10
|
-
if (!hasValueType(specification)) {
|
|
11
|
-
out.write("// no valuetype's defined in IDL");
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
if (hasNative(specification)) {
|
|
15
|
-
out.write("declare global {\n");
|
|
16
|
-
for (let definition of specification.child) {
|
|
17
|
-
if (definition.type === Type.TKN_NATIVE) {
|
|
18
|
-
let native = definition;
|
|
19
|
-
let nativeName = native.text;
|
|
20
|
-
if (nativeName.length <= 4 ||
|
|
21
|
-
nativeName.substring(nativeName.length - 4) !== "_ptr") {
|
|
22
|
-
out.write(` interface ${nativeName} {}\n`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
out.write("}\n\n");
|
|
27
|
-
}
|
|
28
|
-
writeTSValueDefinitions(out, specification);
|
|
29
|
-
out.write("let initialized = false\n");
|
|
30
|
-
out.write("export function _init() {\n");
|
|
31
|
-
out.write(" if (initialized)\n");
|
|
32
|
-
out.write(" return\n");
|
|
33
|
-
out.write(" initialized = true\n");
|
|
34
|
-
out.write(initCalls);
|
|
35
|
-
out.write("}\n");
|
|
36
|
-
out.write("_init()\n");
|
|
37
|
-
}
|
|
38
|
-
function writeTSValueDefinitions(out, specification, prefix = "", indent = 0) {
|
|
39
|
-
for (let definition of specification.child) {
|
|
40
|
-
switch (definition.type) {
|
|
41
|
-
case Type.TKN_MODULE:
|
|
42
|
-
{
|
|
43
|
-
writeIndent(out, indent);
|
|
44
|
-
out.write(`export namespace ${definition.text} {\n\n`);
|
|
45
|
-
writeTSValueDefinitions(out, definition, prefix + definition.text + ".", indent + 1);
|
|
46
|
-
writeIndent(out, indent);
|
|
47
|
-
out.write(`} // namespace ${definition.text}\n\n`);
|
|
48
|
-
}
|
|
49
|
-
break;
|
|
50
|
-
case Type.TKN_NATIVE:
|
|
51
|
-
{
|
|
52
|
-
}
|
|
53
|
-
break;
|
|
54
|
-
case Type.TKN_VALUETYPE:
|
|
55
|
-
{
|
|
56
|
-
let value_dcl = definition;
|
|
57
|
-
let value_header = value_dcl.child[0];
|
|
58
|
-
let custom = value_header.child[0];
|
|
59
|
-
let identifier = value_header.child[1].text;
|
|
60
|
-
let inheritance_spec = value_header.child[2];
|
|
61
|
-
writeIndent(out, indent);
|
|
62
|
-
out.write(`export interface ${identifier}`);
|
|
63
|
-
let attributes = new Array();
|
|
64
|
-
classAttributes.set(prefix + identifier, attributes);
|
|
65
|
-
if (inheritance_spec !== undefined) {
|
|
66
|
-
if (inheritance_spec.child.length > 2)
|
|
67
|
-
throw Error("multiple inheritance is not supported for TypeScript");
|
|
68
|
-
out.write(` extends ${inheritance_spec.child[1].text}`);
|
|
69
|
-
let superAttributes = classAttributes.get(prefix + inheritance_spec.child[1].text);
|
|
70
|
-
if (superAttributes === undefined) {
|
|
71
|
-
superAttributes = classAttributes.get(inheritance_spec.child[1].text);
|
|
72
|
-
}
|
|
73
|
-
if (superAttributes === undefined) {
|
|
74
|
-
throw Error("failed to find attributes for super class");
|
|
75
|
-
}
|
|
76
|
-
for (let attribute of superAttributes) {
|
|
77
|
-
attributes.push(attribute);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
out.write(" {\n");
|
|
81
|
-
for (let i = 1; i < value_dcl.child.length; ++i) {
|
|
82
|
-
let value_element = value_dcl.child[i];
|
|
83
|
-
if (value_element.type === Type.SYN_STATE_MEMBER) {
|
|
84
|
-
let state_member = value_element;
|
|
85
|
-
let attribute = state_member.child[0];
|
|
86
|
-
let type = state_member.child[1];
|
|
87
|
-
let declarators = state_member.child[2];
|
|
88
|
-
for (let declarator of declarators.child) {
|
|
89
|
-
writeIndent(out, indent + 1);
|
|
90
|
-
out.write(declarator.text + ": " + typeIDLtoTS(type, FileType.VALUE) + "\n");
|
|
91
|
-
attributes.push(declarator.text);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
writeIndent(out, indent);
|
|
96
|
-
out.write("}\n");
|
|
97
|
-
writeIndent(out, indent);
|
|
98
|
-
out.write(`export function init${identifier}(object: ${identifier}, init?: Partial<${identifier}> | GIOPDecoder) {\n`);
|
|
99
|
-
++indent;
|
|
100
|
-
writeIndent(out, indent);
|
|
101
|
-
out.write(`if (init instanceof GIOPDecoder) {\n`);
|
|
102
|
-
writeIndent(out, indent + 1);
|
|
103
|
-
out.write(`const decoder = init\n`);
|
|
104
|
-
writeTSInitValueFromGIOP(value_dcl, out, indent + 1);
|
|
105
|
-
writeIndent(out, indent);
|
|
106
|
-
out.write(`} else {\n`);
|
|
107
|
-
writeTSInitValueFromPOJO(value_dcl, out, indent + 1);
|
|
108
|
-
writeIndent(out, indent);
|
|
109
|
-
out.write("}\n");
|
|
110
|
-
--indent;
|
|
111
|
-
writeIndent(out, indent);
|
|
112
|
-
out.write("}\n");
|
|
113
|
-
writeIndent(out, indent);
|
|
114
|
-
out.write(`export function encode${identifier}(encoder: GIOPEncoder, obj: ${identifier}) {\n`);
|
|
115
|
-
++indent;
|
|
116
|
-
if (inheritance_spec !== undefined) {
|
|
117
|
-
writeIndent(out, indent);
|
|
118
|
-
out.write(`encode${inheritance_spec.child[1].text}(encoder, obj)\n`);
|
|
119
|
-
}
|
|
120
|
-
for (let i = 1; i < value_dcl.child.length; ++i) {
|
|
121
|
-
let value_element = value_dcl.child[i];
|
|
122
|
-
if (value_element.type === Type.SYN_STATE_MEMBER) {
|
|
123
|
-
let state_member = value_element;
|
|
124
|
-
let attribute = state_member.child[0];
|
|
125
|
-
let type = state_member.child[1];
|
|
126
|
-
let declarators = state_member.child[2];
|
|
127
|
-
for (let declarator of declarators.child) {
|
|
128
|
-
writeIndent(out, indent);
|
|
129
|
-
out.write(`${typeIDLtoGIOP(type, "obj." + declarator.text)}\n`);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
--indent;
|
|
134
|
-
writeIndent(out, indent);
|
|
135
|
-
out.write("}\n\n");
|
|
136
|
-
initCalls += ` ORB.valueTypeByName.set("${prefix}${identifier}", {attributes:[`;
|
|
137
|
-
let comma = false;
|
|
138
|
-
for (let attribute of attributes) {
|
|
139
|
-
if (comma) {
|
|
140
|
-
initCalls += ", ";
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
comma = true;
|
|
144
|
-
}
|
|
145
|
-
initCalls += `"${attribute}"`;
|
|
146
|
-
}
|
|
147
|
-
initCalls += `],encode:${prefix}encode${identifier}})\n`;
|
|
148
|
-
}
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
function writeTSInitValueFromGIOP(value_dcl, out, indent) {
|
|
154
|
-
for (let i = 1; i < value_dcl.child.length; ++i) {
|
|
155
|
-
let value_element = value_dcl.child[i];
|
|
156
|
-
if (value_element.type === Type.SYN_STATE_MEMBER) {
|
|
157
|
-
let state_member = value_element;
|
|
158
|
-
let type = state_member.child[1];
|
|
159
|
-
let declarators = state_member.child[2];
|
|
160
|
-
for (let declarator of declarators.child) {
|
|
161
|
-
let decl_identifier = declarator.text;
|
|
162
|
-
writeIndent(out, indent);
|
|
163
|
-
out.write(`object.${decl_identifier} = ${typeIDLtoGIOP(type)}\n`);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
function writeTSInitValueFromPOJO(value_dcl, out, indent) {
|
|
169
|
-
for (let i = 1; i < value_dcl.child.length; ++i) {
|
|
170
|
-
let value_element = value_dcl.child[i];
|
|
171
|
-
if (value_element.type === Type.SYN_STATE_MEMBER) {
|
|
172
|
-
let state_member = value_element;
|
|
173
|
-
let attribute = state_member.child[0];
|
|
174
|
-
let type = state_member.child[1];
|
|
175
|
-
let declarators = state_member.child[2];
|
|
176
|
-
for (let declarator of declarators.child) {
|
|
177
|
-
let decl_identifier = declarator.text;
|
|
178
|
-
writeIndent(out, indent);
|
|
179
|
-
if (type.type === Type.TKN_IDENTIFIER) {
|
|
180
|
-
if (type.child[0]?.type == Type.TKN_NATIVE &&
|
|
181
|
-
type.text.length > 4 &&
|
|
182
|
-
type.text.substring(type.text.length - 4) === "_ptr") {
|
|
183
|
-
let name = typeIDLtoTS(type, FileType.VALUE);
|
|
184
|
-
out.write(`if (init !== undefined && init.${decl_identifier} !== undefined) object.${decl_identifier} = new (ORB.lookupValueType("${name}"))(init.${decl_identifier})\n`);
|
|
185
|
-
}
|
|
186
|
-
else if (type.child[0]?.type == Type.TKN_SEQUENCE) {
|
|
187
|
-
out.write(`object.${decl_identifier} = init?.${decl_identifier} instanceof Array ? init!.${decl_identifier} : []\n`);
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
let name = typeIDLtoTS(type, FileType.VALUE);
|
|
191
|
-
out.write(`const vt${decl_identifier} = ORB.lookupValueType("${name}")\n`);
|
|
192
|
-
writeIndent(out, indent);
|
|
193
|
-
out.write(`object.${decl_identifier} = vt${decl_identifier}.prototype.isPrototypeOf(init?.${decl_identifier}) ? init!.${decl_identifier} : new (vt${decl_identifier})(init?.${decl_identifier})\n`);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
out.write(`object.${decl_identifier} = (init === undefined || init.${decl_identifier} === undefined) ? `);
|
|
198
|
-
out.write(defaultValueIDLtoTS(type, FileType.VALUETYPE));
|
|
199
|
-
out.write(` : init.${decl_identifier}\n`);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
//# sourceMappingURL=write-value.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-value.js","sourceRoot":"","sources":["../../../src/idl/write-value.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAAE,IAAI,EAAQ,sBAAkB;AACvC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,mBAAmB,EAAE,kBAAc;AAEnK,IAAI,SAAS,GAAG,EAAE,CAAA;AAClB,MAAM,UAAU,YAAY,CAAC,aAAmB;IAC5C,SAAS,GAAG,EAAE,CAAA;IAEd,IAAI,GAAG,GAAG,EAAE,CA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