@abaplint/transpiler-cli 2.3.68 → 2.3.69
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/build/bundle.js +2 -2
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -13876,7 +13876,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13876
13876
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13877
13877
|
|
|
13878
13878
|
"use strict";
|
|
13879
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SQLCondTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst simple_source3_1 = __webpack_require__(/*! ./simple_source3 */ \"./node_modules/@abaplint/transpiler/build/src/expressions/simple_source3.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./field_chain */ \"./node_modules/@abaplint/transpiler/build/src/expressions/field_chain.js\");\r\nclass SQLCondTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let ret = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.ExpressionNode\r\n && c.get() instanceof abaplint.Expressions.SQLCompare) {\r\n if (ret !== \"\") {\r\n ret += \" \";\r\n }\r\n if (c.findDirectExpression(abaplint.Expressions.Dynamic)) {\r\n const chain = (_a = c.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(abaplint.Expressions.FieldChain);\r\n if (chain) {\r\n const code = new field_chain_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();\r\n ret += `\" + ${code} + \"`;\r\n }\r\n else {\r\n throw new Error(\"SQL Condition, transpiler todo, dyn cond, \" + c.concatTokens());\r\n }\r\n }\r\n else if (c.findDirectExpression(abaplint.Expressions.SQLIn)) {\r\n ret += this.sqlIn(c, traversal);\r\n }\r\n else {\r\n ret += this.basicCondition(c, traversal);\r\n }\r\n }\r\n else if (c instanceof abaplint.Nodes.ExpressionNode) {\r\n ret += \" \" + this.transpile(c, traversal).getCode();\r\n }\r\n else {\r\n ret += \" \" + c.concatTokens();\r\n }\r\n }\r\n const c = new chunk_1.Chunk();\r\n return c.appendString(ret.trim());\r\n }\r\n sqlIn(c, _traversal) {\r\n const fieldName = c.findDirectExpression(abaplint.Expressions.SQLFieldName);\r\n const slqin = c.findDirectExpression(abaplint.Expressions.SQLIn);\r\n const source = c.findFirstExpression(abaplint.Expressions.SimpleSource3);\r\n if (fieldName === undefined || slqin === undefined || source === undefined) {\r\n throw new Error(\"SQL Condition, transpiler todo, \" + c.concatTokens());\r\n }\r\n const ret = `\" + abap.expandIN(\"${fieldName.concatTokens()}\", ${source.concatTokens()}) + \"`;\r\n return ret;\r\n }\r\n basicCondition(c, traversal) {\r\n let ret = \"\";\r\n if (c.getChildren().length !== 3) {\r\n return this.basicConditionNew(c, traversal);\r\n // throw new Error(\"SQL Condition, transpiler todo1, \" + c.concatTokens() + \", \" + c.getChildren().length);\r\n }\r\n const fieldName = c.findDirectExpression(abaplint.Expressions.SQLFieldName);\r\n const operator = c.findDirectExpression(abaplint.Expressions.SQLCompareOperator);\r\n const source = c.findDirectExpression(abaplint.Expressions.SQLSource);\r\n if (fieldName === undefined || operator === undefined || source === undefined) {\r\n throw new Error(\"SQL Condition, transpiler todo2, \" + c.concatTokens());\r\n }\r\n ret += fieldName.concatTokens() + \" \" + operator.concatTokens() + \" \";\r\n ret += this.sqlSource(source, traversal);\r\n /*\r\n const simple = source.findDirectExpression(abaplint.Expressions.SimpleSource3);\r\n if (simple && simple.findDirectExpression(abaplint.Expressions.Constant) === undefined) {\r\n ret += \"'\\\" + \" + new SimpleSource3Transpiler(true).transpile(simple, traversal).getCode() + \" + \\\"'\";\r\n } else {\r\n ret += source.concatTokens();\r\n }\r\n */\r\n return ret;\r\n }\r\n sqlSource(source, traversal) {\r\n let ret = \"\";\r\n const simple = source.findDirectExpression(abaplint.Expressions.SimpleSource3);\r\n if (simple && simple.findDirectExpression(abaplint.Expressions.Constant) === undefined) {\r\n ret += \"'\\\" + \" + new simple_source3_1.SimpleSource3Transpiler(true).transpile(simple, traversal).getCode() + \" + \\\"'\";\r\n }\r\n else {\r\n ret += source.concatTokens();\r\n }\r\n return ret;\r\n }\r\n basicConditionNew(node, traversal) {\r\n let ret = \"\";\r\n for (const child of node.getChildren()) {\r\n if (ret !== \"\") {\r\n ret += \" \";\r\n }\r\n if (child.get() instanceof abaplint.Expressions.SQLFieldName) {\r\n ret += child.concatTokens();\r\n }\r\n else if (child.get() instanceof abaplint.Expressions.SQLSource\r\n && child instanceof abaplint.Nodes.ExpressionNode) {\r\n ret += this.sqlSource(child, traversal);\r\n }\r\n else {\r\n ret += child.concatTokens();\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.SQLCondTranspiler = SQLCondTranspiler;\r\n//# sourceMappingURL=sql_cond.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/sql_cond.js?");
|
|
13879
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SQLCondTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nconst simple_source3_1 = __webpack_require__(/*! ./simple_source3 */ \"./node_modules/@abaplint/transpiler/build/src/expressions/simple_source3.js\");\r\nconst field_chain_1 = __webpack_require__(/*! ./field_chain */ \"./node_modules/@abaplint/transpiler/build/src/expressions/field_chain.js\");\r\nclass SQLCondTranspiler {\r\n transpile(node, traversal) {\r\n var _a;\r\n let ret = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.ExpressionNode\r\n && c.get() instanceof abaplint.Expressions.SQLCompare) {\r\n if (ret !== \"\") {\r\n ret += \" \";\r\n }\r\n if (c.findDirectExpression(abaplint.Expressions.Dynamic)) {\r\n const chain = (_a = c.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(abaplint.Expressions.FieldChain);\r\n if (chain) {\r\n const code = new field_chain_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();\r\n ret += `\" + ${code} + \"`;\r\n }\r\n else {\r\n throw new Error(\"SQL Condition, transpiler todo, dyn cond, \" + c.concatTokens());\r\n }\r\n }\r\n else if (c.findDirectExpression(abaplint.Expressions.SQLIn)) {\r\n ret += this.sqlIn(c, traversal);\r\n }\r\n else {\r\n ret += this.basicCondition(c, traversal);\r\n }\r\n }\r\n else if (c instanceof abaplint.Nodes.ExpressionNode) {\r\n ret += \" \" + this.transpile(c, traversal).getCode();\r\n }\r\n else {\r\n ret += \" \" + c.concatTokens();\r\n }\r\n }\r\n const c = new chunk_1.Chunk();\r\n return c.appendString(ret.trim());\r\n }\r\n sqlIn(c, _traversal) {\r\n const fieldName = c.findDirectExpression(abaplint.Expressions.SQLFieldName);\r\n const slqin = c.findDirectExpression(abaplint.Expressions.SQLIn);\r\n const source = c.findFirstExpression(abaplint.Expressions.SimpleSource3);\r\n if (fieldName === undefined || slqin === undefined || source === undefined) {\r\n throw new Error(\"SQL Condition, transpiler todo, \" + c.concatTokens());\r\n }\r\n const ret = `\" + abap.expandIN(\"${fieldName.concatTokens()}\", ${source.concatTokens()}) + \"`;\r\n return ret;\r\n }\r\n basicCondition(c, traversal) {\r\n let ret = \"\";\r\n if (c.getChildren().length !== 3) {\r\n return this.basicConditionNew(c, traversal);\r\n // throw new Error(\"SQL Condition, transpiler todo1, \" + c.concatTokens() + \", \" + c.getChildren().length);\r\n }\r\n const fieldName = c.findDirectExpression(abaplint.Expressions.SQLFieldName);\r\n const operator = c.findDirectExpression(abaplint.Expressions.SQLCompareOperator);\r\n const source = c.findDirectExpression(abaplint.Expressions.SQLSource);\r\n if (fieldName && source && operator === undefined && c.findDirectTokenByText(\"LIKE\")) {\r\n ret += fieldName.concatTokens() + \" LIKE \";\r\n ret += this.sqlSource(source, traversal);\r\n return ret;\r\n }\r\n if (fieldName === undefined || operator === undefined || source === undefined) {\r\n throw new Error(\"SQL Condition, transpiler todo2, \" + c.concatTokens());\r\n }\r\n ret += fieldName.concatTokens() + \" \" + operator.concatTokens() + \" \";\r\n ret += this.sqlSource(source, traversal);\r\n /*\r\n const simple = source.findDirectExpression(abaplint.Expressions.SimpleSource3);\r\n if (simple && simple.findDirectExpression(abaplint.Expressions.Constant) === undefined) {\r\n ret += \"'\\\" + \" + new SimpleSource3Transpiler(true).transpile(simple, traversal).getCode() + \" + \\\"'\";\r\n } else {\r\n ret += source.concatTokens();\r\n }\r\n */\r\n return ret;\r\n }\r\n sqlSource(source, traversal) {\r\n let ret = \"\";\r\n const simple = source.findDirectExpression(abaplint.Expressions.SimpleSource3);\r\n if (simple && simple.findDirectExpression(abaplint.Expressions.Constant) === undefined) {\r\n ret += \"'\\\" + \" + new simple_source3_1.SimpleSource3Transpiler(true).transpile(simple, traversal).getCode() + \" + \\\"'\";\r\n }\r\n else {\r\n ret += source.concatTokens();\r\n }\r\n return ret;\r\n }\r\n basicConditionNew(node, traversal) {\r\n let ret = \"\";\r\n for (const child of node.getChildren()) {\r\n if (ret !== \"\") {\r\n ret += \" \";\r\n }\r\n if (child.get() instanceof abaplint.Expressions.SQLFieldName) {\r\n ret += child.concatTokens();\r\n }\r\n else if (child.get() instanceof abaplint.Expressions.SQLSource\r\n && child instanceof abaplint.Nodes.ExpressionNode) {\r\n ret += this.sqlSource(child, traversal);\r\n }\r\n else {\r\n ret += child.concatTokens();\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.SQLCondTranspiler = SQLCondTranspiler;\r\n//# sourceMappingURL=sql_cond.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/expressions/sql_cond.js?");
|
|
13880
13880
|
|
|
13881
13881
|
/***/ }),
|
|
13882
13882
|
|
|
@@ -15086,7 +15086,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
15086
15086
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
15087
15087
|
|
|
15088
15088
|
"use strict";
|
|
15089
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReadTableTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ReadTableTranspiler {\r\n transpile(node, traversal) {\r\n let prefix = \"\";\r\n const s = node.findDirectExpression(abaplint.Expressions.SimpleSource2);\r\n const ret = traversal.traverse(s).getCode();\r\n const extra = [];\r\n const index = node.findExpressionAfterToken(\"INDEX\");\r\n if (index) {\r\n const s = new expressions_1.SourceTranspiler().transpile(index, traversal).getCode();\r\n extra.push(\"index: \" + s);\r\n }\r\n const from = node.findExpressionAfterToken(\"FROM\");\r\n if (from) {\r\n const s = new expressions_1.SourceTranspiler().transpile(from, traversal).getCode();\r\n extra.push(\"from: \" + s);\r\n }\r\n const rt = node.findDirectExpression(abaplint.Expressions.ReadTableTarget);\r\n const target = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.Target);\r\n const fs = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.FSTarget);\r\n if (rt && fs) {\r\n const name = new expressions_1.FieldSymbolTranspiler().transpile(fs, traversal).getCode();\r\n extra.push(\"assigning: \" + name);\r\n }\r\n else if (target) {\r\n const name = traversal.traverse(target).getCode();\r\n if (rt === null || rt === void 0 ? void 0 : rt.findDirectTokenByText(\"REFERENCE\")) {\r\n extra.push(\"referenceInto: \" + name);\r\n }\r\n else {\r\n extra.push(\"into: \" + name);\r\n }\r\n }\r\n const compare = node.findDirectExpression(abaplint.Expressions.ComponentCompareSimple);\r\n if (compare) {\r\n const conds = [];\r\n const count = compare.getChildren().length / 3;\r\n for (let i = 0; i < count; i++) {\r\n const left = compare.getChildren()[i * 3];\r\n const source = compare.getChildren()[(i * 3) + 2];\r\n const s = traversal.traverse(source).getCode();\r\n let field = left.concatTokens().toLowerCase().replace(\"->\", \".get().\").replace(\"-\", \".get().\");\r\n if (left.get() instanceof abaplint.Expressions.Dynamic\r\n && left instanceof abaplint.Nodes.ExpressionNode) {\r\n const concat = left.concatTokens().toLowerCase();\r\n field = concat.substring(2, concat.length - 2);\r\n }\r\n if (s.includes(\"await\")) {\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n prefix += \"const \" + id + \" = \" + s + \";\\n\";\r\n conds.push(\"abap.compare.eq(i.\" + field + \", \" + id + \")\");\r\n }\r\n else {\r\n conds.push(\"abap.compare.eq(i.\" + field + \", \" + s + \")\");\r\n }\r\n }\r\n extra.push(\"withKey: (i) => {return \" + conds.join(\" && \") + \";}\");\r\n }\r\n let concat = \"\";\r\n if (extra.length > 0) {\r\n concat = \",{\" + extra.join(\",\") + \"}\";\r\n }\r\n return new chunk_1.Chunk()\r\n .append(prefix + \"abap.statements.readTable(\", node, traversal)\r\n .appendString(ret + concat)\r\n .append(\");\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.ReadTableTranspiler = ReadTableTranspiler;\r\n//# sourceMappingURL=read_table.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/read_table.js?");
|
|
15089
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ReadTableTranspiler = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/transpiler/build/src/expressions/index.js\");\r\nconst unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ \"./node_modules/@abaplint/transpiler/build/src/unique_identifier.js\");\r\nconst chunk_1 = __webpack_require__(/*! ../chunk */ \"./node_modules/@abaplint/transpiler/build/src/chunk.js\");\r\nclass ReadTableTranspiler {\r\n transpile(node, traversal) {\r\n let prefix = \"\";\r\n const s = node.findDirectExpression(abaplint.Expressions.SimpleSource2);\r\n const ret = traversal.traverse(s).getCode();\r\n const extra = [];\r\n const index = node.findExpressionAfterToken(\"INDEX\");\r\n if (index) {\r\n const s = new expressions_1.SourceTranspiler().transpile(index, traversal).getCode();\r\n extra.push(\"index: \" + s);\r\n }\r\n const from = node.findExpressionAfterToken(\"FROM\");\r\n if (from) {\r\n const s = new expressions_1.SourceTranspiler().transpile(from, traversal).getCode();\r\n extra.push(\"from: \" + s);\r\n }\r\n const rt = node.findDirectExpression(abaplint.Expressions.ReadTableTarget);\r\n const target = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.Target);\r\n const fs = rt === null || rt === void 0 ? void 0 : rt.findDirectExpression(abaplint.Expressions.FSTarget);\r\n if (rt && fs) {\r\n const name = new expressions_1.FieldSymbolTranspiler().transpile(fs, traversal).getCode();\r\n extra.push(\"assigning: \" + name);\r\n }\r\n else if (target) {\r\n const name = traversal.traverse(target).getCode();\r\n if (rt === null || rt === void 0 ? void 0 : rt.findDirectTokenByText(\"REFERENCE\")) {\r\n extra.push(\"referenceInto: \" + name);\r\n }\r\n else {\r\n extra.push(\"into: \" + name);\r\n }\r\n }\r\n const compare = node.findDirectExpression(abaplint.Expressions.ComponentCompareSimple);\r\n if (compare) {\r\n const conds = [];\r\n const count = compare.getChildren().length / 3;\r\n for (let i = 0; i < count; i++) {\r\n const left = compare.getChildren()[i * 3];\r\n const source = compare.getChildren()[(i * 3) + 2];\r\n const s = traversal.traverse(source).getCode();\r\n let field = left.concatTokens().toLowerCase();\r\n while (field.includes(\"->\")) {\r\n field = field.replace(\"->\", \".get().\");\r\n }\r\n while (field.includes(\"-\")) {\r\n field = field.replace(\"-\", \".get().\");\r\n }\r\n if (left.get() instanceof abaplint.Expressions.Dynamic\r\n && left instanceof abaplint.Nodes.ExpressionNode) {\r\n const concat = left.concatTokens().toLowerCase();\r\n field = concat.substring(2, concat.length - 2);\r\n }\r\n if (s.includes(\"await\")) {\r\n const id = unique_identifier_1.UniqueIdentifier.get();\r\n prefix += \"const \" + id + \" = \" + s + \";\\n\";\r\n conds.push(\"abap.compare.eq(i.\" + field + \", \" + id + \")\");\r\n }\r\n else {\r\n conds.push(\"abap.compare.eq(i.\" + field + \", \" + s + \")\");\r\n }\r\n }\r\n extra.push(\"withKey: (i) => {return \" + conds.join(\" && \") + \";}\");\r\n }\r\n let concat = \"\";\r\n if (extra.length > 0) {\r\n concat = \",{\" + extra.join(\",\") + \"}\";\r\n }\r\n return new chunk_1.Chunk()\r\n .append(prefix + \"abap.statements.readTable(\", node, traversal)\r\n .appendString(ret + concat)\r\n .append(\");\", node.getLastToken(), traversal);\r\n }\r\n}\r\nexports.ReadTableTranspiler = ReadTableTranspiler;\r\n//# sourceMappingURL=read_table.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/statements/read_table.js?");
|
|
15090
15090
|
|
|
15091
15091
|
/***/ }),
|
|
15092
15092
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.69",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.3.
|
|
28
|
+
"@abaplint/transpiler": "^2.3.69",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|