@abaplint/transpiler-cli 2.3.67 → 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.
Files changed (2) hide show
  1. package/build/bundle.js +3 -3
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -13414,7 +13414,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
13414
13414
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13415
13415
 
13416
13416
  "use strict";
13417
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SQLiteDatabaseSchema = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass SQLiteDatabaseSchema {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n run() {\r\n const statements = [];\r\n // CREATE TABLEs\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.Table\r\n && obj.getTableCategory() === abaplint.Objects.TableCategory.Transparent) {\r\n statements.push(this.buildTABL(obj).trim());\r\n }\r\n }\r\n // CREATE VIEWs after TABLEs\r\n // todo: what if the view is based on another view?\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.View) {\r\n statements.push(this.buildVIEW(obj).trim());\r\n }\r\n }\r\n return statements;\r\n }\r\n //////////////////\r\n // https://www.sqlite.org/lang_createview.html\r\n buildVIEW(view) {\r\n const fields = view.getFields();\r\n const columns = fields === null || fields === void 0 ? void 0 : fields.map((f) => f.TABNAME.toLowerCase() + \".\" + f.FIELDNAME.toLowerCase() + \" AS \" + f.VIEWFIELD.toLowerCase()).join(\", \");\r\n let from = \"\";\r\n let previous = \"\";\r\n for (const j of view.getJoin() || []) {\r\n if (previous === \"\") {\r\n from += j.LTAB.toLowerCase() + \" INNER JOIN \" + j.RTAB.toLowerCase() + \" ON \" + j.LTAB.toLowerCase() + \".\" + j.LFIELD.toLowerCase() + \" = \" + j.RTAB.toLowerCase() + \".\" + j.RFIELD.toLowerCase();\r\n }\r\n else if (previous === j.LTAB + \",\" + j.RTAB) {\r\n from += \" AND \" + j.LTAB.toLowerCase() + \".\" + j.LFIELD.toLowerCase() + \" = \" + j.RTAB.toLowerCase() + \".\" + j.RFIELD.toLowerCase();\r\n }\r\n else {\r\n from += \" INNER JOIN \" + j.RTAB.toLowerCase() + \" ON \" + j.LTAB.toLowerCase() + \".\" + j.LFIELD.toLowerCase() + \" = \" + j.RTAB.toLowerCase() + \".\" + j.RFIELD.toLowerCase();\r\n }\r\n previous = j.LTAB + \",\" + j.RTAB;\r\n }\r\n from = from.trim();\r\n return `CREATE VIEW '${view.getName().toLowerCase()}' AS SELECT ${columns} FROM ${from};\\n`;\r\n }\r\n buildTABL(tabl) {\r\n const type = tabl.parseType(this.reg);\r\n if (!(type instanceof abaplint.BasicTypes.StructureType)) {\r\n return \"\";\r\n }\r\n const fields = [];\r\n for (const field of type.getComponents()) {\r\n fields.push(\"'\" + field.name.toLowerCase() + \"' \" + this.toType(field.type, field.name, tabl.getName()));\r\n }\r\n // assumption: all transparent tables have primary keys\r\n // add single quotes to field names to allow for keywords as field names\r\n const key = \", PRIMARY KEY(\" + tabl.listKeys(this.reg).map(e => \"'\" + e.toLowerCase() + \"'\").join(\",\") + \")\";\r\n return `CREATE TABLE '${tabl.getName().toLowerCase()}' (${fields.join(\", \")}${key});\\n`;\r\n }\r\n toType(type, fieldname, errorInfo) {\r\n if (type instanceof abaplint.BasicTypes.CharacterType) {\r\n return `NCHAR(${type.getLength()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.TimeType) {\r\n return `NCHAR(6)`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.DateType) {\r\n return `NCHAR(8)`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.NumericType) {\r\n // it will be fine, the runtime representation of numc is also text\r\n return `NCHAR(${type.getLength()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.StringType) {\r\n return `TEXT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.XStringType) {\r\n // it will be fine, the runtime representation of xstring is also text\r\n return `TEXT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.HexType) {\r\n return `NCHAR(${type.getLength() * 2})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.IntegerType) {\r\n return `INT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.FloatType\r\n || type instanceof abaplint.BasicTypes.FloatingPointType) {\r\n return `REAL`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.PackedType) {\r\n return `DECIMAL(${type.getLength()},${type.getDecimals()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.VoidType) {\r\n throw `Type of ${errorInfo}-${fieldname} is VoidType(${type.getVoided()}), make sure the type is known, enable strict syntax checking`;\r\n }\r\n else {\r\n throw \"database_setup: \" + errorInfo + \"-\" + fieldname + \", todo toType handle: \" + type.constructor.name;\r\n }\r\n }\r\n}\r\nexports.SQLiteDatabaseSchema = SQLiteDatabaseSchema;\r\n//# sourceMappingURL=sqlite_database_schema.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/db/sqlite_database_schema.js?");
13417
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SQLiteDatabaseSchema = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass SQLiteDatabaseSchema {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n run() {\r\n const statements = [];\r\n // CREATE TABLEs\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.Table\r\n && obj.getTableCategory() === abaplint.Objects.TableCategory.Transparent) {\r\n statements.push(this.buildTABL(obj).trim());\r\n }\r\n }\r\n // CREATE VIEWs after TABLEs\r\n // todo: what if the view is based on another view?\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.View) {\r\n statements.push(this.buildVIEW(obj).trim());\r\n }\r\n }\r\n return statements;\r\n }\r\n //////////////////\r\n // https://www.sqlite.org/lang_createview.html\r\n buildVIEW(view) {\r\n const fields = view.getFields();\r\n const columns = fields === null || fields === void 0 ? void 0 : fields.map((f) => f.TABNAME.toLowerCase() + \".\" + f.FIELDNAME.toLowerCase() + \" AS \" + f.VIEWFIELD.toLowerCase()).join(\", \");\r\n let from = \"\";\r\n let previous = \"\";\r\n for (const j of view.getJoin() || []) {\r\n if (previous === \"\") {\r\n from += j.LTAB.toLowerCase() + \" INNER JOIN \" + j.RTAB.toLowerCase() + \" ON \" + j.LTAB.toLowerCase() + \".\" + j.LFIELD.toLowerCase() + \" = \" + j.RTAB.toLowerCase() + \".\" + j.RFIELD.toLowerCase();\r\n }\r\n else if (previous === j.LTAB + \",\" + j.RTAB) {\r\n from += \" AND \" + j.LTAB.toLowerCase() + \".\" + j.LFIELD.toLowerCase() + \" = \" + j.RTAB.toLowerCase() + \".\" + j.RFIELD.toLowerCase();\r\n }\r\n else {\r\n from += \" INNER JOIN \" + j.RTAB.toLowerCase() + \" ON \" + j.LTAB.toLowerCase() + \".\" + j.LFIELD.toLowerCase() + \" = \" + j.RTAB.toLowerCase() + \".\" + j.RFIELD.toLowerCase();\r\n }\r\n previous = j.LTAB + \",\" + j.RTAB;\r\n }\r\n from = from.trim();\r\n return `CREATE VIEW '${view.getName().toLowerCase()}' AS SELECT ${columns} FROM ${from};\\n`;\r\n }\r\n buildTABL(tabl) {\r\n const type = tabl.parseType(this.reg);\r\n if (!(type instanceof abaplint.BasicTypes.StructureType)) {\r\n return \"\";\r\n }\r\n const fields = [];\r\n for (const field of type.getComponents()) {\r\n if (field.type instanceof abaplint.BasicTypes.StructureType) {\r\n // is a GROUP NAME\r\n continue;\r\n }\r\n fields.push(\"'\" + field.name.toLowerCase() + \"' \" + this.toType(field.type, field.name, tabl.getName()));\r\n }\r\n // assumption: all transparent tables have primary keys\r\n // add single quotes to field names to allow for keywords as field names\r\n const key = \", PRIMARY KEY(\" + tabl.listKeys(this.reg).map(e => \"'\" + e.toLowerCase() + \"'\").join(\",\") + \")\";\r\n return `CREATE TABLE '${tabl.getName().toLowerCase()}' (${fields.join(\", \")}${key});\\n`;\r\n }\r\n toType(type, fieldname, errorInfo) {\r\n if (type instanceof abaplint.BasicTypes.CharacterType) {\r\n return `NCHAR(${type.getLength()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.TimeType) {\r\n return `NCHAR(6)`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.DateType) {\r\n return `NCHAR(8)`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.NumericType) {\r\n // it will be fine, the runtime representation of numc is also text\r\n return `NCHAR(${type.getLength()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.StringType) {\r\n return `TEXT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.XStringType) {\r\n // it will be fine, the runtime representation of xstring is also text\r\n return `TEXT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.HexType) {\r\n return `NCHAR(${type.getLength() * 2})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.IntegerType) {\r\n return `INT`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.FloatType\r\n || type instanceof abaplint.BasicTypes.FloatingPointType) {\r\n return `REAL`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.PackedType) {\r\n return `DECIMAL(${type.getLength()},${type.getDecimals()})`;\r\n }\r\n else if (type instanceof abaplint.BasicTypes.VoidType) {\r\n throw `Type of ${errorInfo}-${fieldname} is VoidType(${type.getVoided()}), make sure the type is known, enable strict syntax checking`;\r\n }\r\n else {\r\n throw \"database_setup: \" + errorInfo + \"-\" + fieldname + \", todo toType handle: \" + type.constructor.name;\r\n }\r\n }\r\n}\r\nexports.SQLiteDatabaseSchema = SQLiteDatabaseSchema;\r\n//# sourceMappingURL=sqlite_database_schema.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/db/sqlite_database_schema.js?");
13418
13418
 
13419
13419
  /***/ }),
13420
13420
 
@@ -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.67",
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.67",
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",