@abaplint/transpiler-cli 2.3.74 → 2.3.75

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 +2 -2
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -14052,7 +14052,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
14052
14052
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14053
14053
 
14054
14054
  "use strict";
14055
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Keywords = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\n// https://www.w3schools.com/js/js_reserved.asp\r\nconst defaultKeywords = [\r\n \"abstract\", \"arguments\", \"await\",\r\n \"break\", \"byte\", \"catch\",\r\n \"char\", \"class\", \"const\", \"continue\",\r\n \"debugger\", \"default\", \"do\",\r\n \"double\", \"else\", \"enum\", \"eval\",\r\n \"export\", \"extends\", \"false\", \"final\",\r\n \"finally\", \"for\", \"function\",\r\n \"goto\", \"if\", \"implements\", \"import\",\r\n \"in\", \"instanceof\", \"interface\",\r\n \"let\", \"long\", \"native\", \"new\",\r\n \"null\", \"package\", \"private\",\r\n \"public\", \"return\", \"short\", \"static\",\r\n \"switch\", \"synchronized\", \"this\",\r\n \"throw\", \"throws\", \"transient\", \"true\",\r\n \"try\", \"typeof\", \"var\", \"void\",\r\n \"volatile\", \"while\", \"yield\"\r\n];\r\n// \"with\"\r\n// \"delete\"\r\n/** Replaces javascript keywords in ABAP source code, in-memory only */\r\nclass Keywords {\r\n constructor(keywords) {\r\n this.keywords = [];\r\n if (keywords !== undefined) {\r\n this.keywords = keywords;\r\n }\r\n else {\r\n this.keywords = defaultKeywords;\r\n }\r\n }\r\n handle(reg) {\r\n reg.parse();\r\n for (const o of reg.getObjects()) {\r\n if (!(o instanceof abaplint.ABAPObject)) {\r\n continue;\r\n }\r\n for (const f of o.getABAPFiles()) {\r\n const tokens = [];\r\n for (const s of f.getStatements()) {\r\n tokens.push(...this.traverse(s, f));\r\n }\r\n if (tokens.length === 0) {\r\n continue;\r\n }\r\n const rows = f.getRawRows();\r\n for (const t of tokens.reverse()) {\r\n const original = rows[t.getRow() - 1];\r\n const index = t.getEnd().getCol() - 1;\r\n rows[t.getRow() - 1] = original.substring(0, index) + \"_\" + original.substring(index);\r\n }\r\n reg.updateFile(new abaplint.MemoryFile(f.getFilename(), rows.join(\"\\n\")));\r\n }\r\n }\r\n reg.parse();\r\n }\r\n traverse(node, file) {\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.TokenNodeRegex) {\r\n const token = c.getFirstToken();\r\n const start = token.getStart();\r\n if (start instanceof abaplint.VirtualPosition) {\r\n continue;\r\n }\r\n for (const k of this.keywords) {\r\n const lower = token.getStr().toLowerCase();\r\n if (k === lower\r\n || \"!\" + k === lower\r\n || lower.endsWith(\"~\" + k)) {\r\n ret.push(token);\r\n break;\r\n }\r\n }\r\n }\r\n else if (c instanceof abaplint.Nodes.TokenNode) {\r\n continue;\r\n }\r\n else {\r\n ret.push(...this.traverse(c, file));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.Keywords = Keywords;\r\n//# sourceMappingURL=keywords.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/keywords.js?");
14055
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Keywords = exports.defaultKeywords = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\n// https://www.w3schools.com/js/js_reserved.asp\r\nexports.defaultKeywords = [\r\n \"abstract\", \"arguments\", \"await\",\r\n \"break\", \"byte\", \"catch\",\r\n \"char\", \"class\", \"const\", \"continue\",\r\n \"debugger\", \"default\", \"do\",\r\n \"double\", \"else\", \"enum\", \"eval\",\r\n \"export\", \"extends\", \"false\", \"final\",\r\n \"finally\", \"for\", \"function\",\r\n \"goto\", \"if\", \"implements\", \"import\",\r\n \"in\", \"instanceof\", \"interface\",\r\n \"let\", \"long\", \"native\", \"new\",\r\n \"null\", \"package\", \"private\",\r\n \"public\", \"return\", \"short\", \"static\",\r\n \"switch\", \"synchronized\", \"this\",\r\n \"throw\", \"throws\", \"transient\", \"true\",\r\n \"try\", \"typeof\", \"var\", \"void\",\r\n \"volatile\", \"while\", \"yield\"\r\n];\r\n// \"with\"\r\n// \"delete\"\r\n/** Replaces javascript keywords in ABAP source code, in-memory only */\r\nclass Keywords {\r\n constructor(keywords) {\r\n this.keywords = [];\r\n if (keywords !== undefined) {\r\n this.keywords = keywords;\r\n }\r\n else {\r\n this.keywords = exports.defaultKeywords;\r\n }\r\n }\r\n handle(reg) {\r\n reg.parse();\r\n for (const o of reg.getObjects()) {\r\n if (!(o instanceof abaplint.ABAPObject)) {\r\n continue;\r\n }\r\n for (const f of o.getABAPFiles()) {\r\n const tokens = [];\r\n for (const s of f.getStatements()) {\r\n tokens.push(...this.traverse(s, f));\r\n }\r\n if (tokens.length === 0) {\r\n continue;\r\n }\r\n const rows = f.getRawRows();\r\n for (const t of tokens.reverse()) {\r\n const original = rows[t.getRow() - 1];\r\n const index = t.getEnd().getCol() - 1;\r\n rows[t.getRow() - 1] = original.substring(0, index) + \"_\" + original.substring(index);\r\n }\r\n reg.updateFile(new abaplint.MemoryFile(f.getFilename(), rows.join(\"\\n\")));\r\n }\r\n }\r\n reg.parse();\r\n }\r\n traverse(node, file) {\r\n const ret = [];\r\n for (const c of node.getChildren()) {\r\n if (c instanceof abaplint.Nodes.TokenNodeRegex) {\r\n const token = c.getFirstToken();\r\n const start = token.getStart();\r\n if (start instanceof abaplint.VirtualPosition) {\r\n continue;\r\n }\r\n for (const k of this.keywords) {\r\n const lower = token.getStr().toLowerCase();\r\n if (k === lower\r\n || \"!\" + k === lower\r\n || lower.endsWith(\"~\" + k)) {\r\n ret.push(token);\r\n break;\r\n }\r\n }\r\n }\r\n else if (c instanceof abaplint.Nodes.TokenNode) {\r\n continue;\r\n }\r\n else {\r\n ret.push(...this.traverse(c, file));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.Keywords = Keywords;\r\n//# sourceMappingURL=keywords.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/keywords.js?");
14056
14056
 
14057
14057
  /***/ }),
14058
14058
 
@@ -15735,7 +15735,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
15735
15735
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15736
15736
 
15737
15737
  "use strict";
15738
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Validation = exports.config = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nexports.config = {\r\n \"global\": {\r\n \"files\": \"/**/*.*\",\r\n \"skipGeneratedGatewayClasses\": true,\r\n \"skipGeneratedPersistentClasses\": true,\r\n \"skipGeneratedFunctionGroups\": true,\r\n },\r\n \"syntax\": {\r\n \"version\": core_1.Version.OpenABAP,\r\n \"errorNamespace\": \".\",\r\n },\r\n \"rules\": {\r\n \"when_others_last\": true,\r\n \"avoid_use\": {\r\n \"execSQL\": true,\r\n \"kernelCall\": true,\r\n \"communication\": true,\r\n \"systemCall\": true,\r\n \"break\": false,\r\n \"statics\": true,\r\n \"endselect\": false,\r\n \"defaultKey\": false,\r\n },\r\n \"parser_error\": true,\r\n \"allowed_object_types\": {\r\n \"allowed\": [\r\n \"AUTH\",\r\n \"CLAS\",\r\n \"DEVC\",\r\n \"DOMA\",\r\n \"DTEL\",\r\n \"ENQU\",\r\n \"FUGR\",\r\n \"INTF\",\r\n \"MSAG\",\r\n \"NROB\",\r\n \"PARA\",\r\n \"PROG\",\r\n \"SHLP\",\r\n \"SHMA\",\r\n \"SICF\",\r\n \"SMIM\",\r\n \"SRFC\",\r\n \"SUSO\",\r\n \"TABL\",\r\n \"TOBJ\",\r\n \"TRAN\",\r\n \"TTYP\",\r\n \"TYPE\",\r\n \"VIEW\",\r\n \"XSLT\",\r\n ],\r\n },\r\n \"unknown_types\": true,\r\n \"ambiguous_statement\": true,\r\n \"implement_methods\": true,\r\n \"begin_end_names\": true,\r\n \"check_syntax\": true,\r\n \"form_no_dash\": true,\r\n \"omit_preceding_zeros\": true,\r\n \"obsolete_statement\": {\r\n \"compute\": true,\r\n \"setExtended\": true,\r\n },\r\n \"forbidden_identifier\": {\r\n \"check\": [\r\n \"^abstract$\", \"^arguments$\", \"^await$\",\r\n \"^break$\", \"^byte$\", \"^catch$\",\r\n \"^char$\", \"^class$\", \"^const$\", \"^continue$\",\r\n \"^debugger$\", \"^default$\", \"^do$\",\r\n \"^double$\", \"^else$\", \"^enum$\", \"^eval$\",\r\n \"^export$\", \"^extends$\", \"^false$\", \"^final$\",\r\n \"^finally$\", \"^for$\", \"^function$\",\r\n \"^goto$\", \"^if$\", \"^implements$\", \"^import$\",\r\n \"^in$\", \"^instanceof$\", \"^interface$\",\r\n \"^let$\", \"^long$\", \"^native$\", \"^new$\",\r\n \"^null$\", \"^package$\", \"^private$\",\r\n // \"^protected$\",\r\n \"^public$\", \"^return$\", \"^short$\", \"^static$\",\r\n \"^switch$\", \"^synchronized$\", \"^this$\",\r\n \"^throw$\", \"^throws$\", \"^transient$\", \"^true$\",\r\n \"^try$\", \"^typeof$\", \"^var$\", \"^void$\",\r\n \"^volatile$\", \"^while$\", \"^yield$\",\r\n \"^unique\\\\d+$\"\r\n ],\r\n },\r\n },\r\n};\r\n// todo, make sure nothing is overloaded, eg \"lines()\", there is a rule for this in abaplint now\r\nclass Validation {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n run(reg) {\r\n var _a, _b;\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.ignoreSyntaxCheck) === true) {\r\n exports.config.rules.check_syntax = false;\r\n }\r\n else {\r\n exports.config.rules.check_syntax = true;\r\n }\r\n if (((_b = this.options) === null || _b === void 0 ? void 0 : _b.unknownTypes) === \"runtimeError\") {\r\n exports.config.syntax.errorNamespace = \"VOID_EVERYTHING\"; // this is not a constant, just a regex that happens to not match anything\r\n // config.rules[\"unknown_types\"] = false;\r\n }\r\n const conf = new core_1.Config(JSON.stringify(exports.config));\r\n reg.setConfig(conf);\r\n const issues = reg.findIssues();\r\n return issues;\r\n }\r\n}\r\nexports.Validation = Validation;\r\n//# sourceMappingURL=validation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/validation.js?");
15738
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Validation = exports.config = void 0;\r\nconst core_1 = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst keywords_1 = __webpack_require__(/*! ./keywords */ \"./node_modules/@abaplint/transpiler/build/src/keywords.js\");\r\nexports.config = {\r\n \"global\": {\r\n \"files\": \"/**/*.*\",\r\n \"skipGeneratedGatewayClasses\": true,\r\n \"skipGeneratedPersistentClasses\": true,\r\n \"skipGeneratedFunctionGroups\": true,\r\n },\r\n \"syntax\": {\r\n \"version\": core_1.Version.OpenABAP,\r\n \"errorNamespace\": \".\",\r\n },\r\n \"rules\": {\r\n \"when_others_last\": true,\r\n \"avoid_use\": {\r\n \"execSQL\": true,\r\n \"kernelCall\": true,\r\n \"communication\": true,\r\n \"systemCall\": true,\r\n \"break\": false,\r\n \"statics\": true,\r\n \"endselect\": false,\r\n \"defaultKey\": false,\r\n },\r\n \"parser_error\": true,\r\n \"allowed_object_types\": {\r\n \"allowed\": [\r\n \"AUTH\",\r\n \"CLAS\",\r\n \"DEVC\",\r\n \"DOMA\",\r\n \"DTEL\",\r\n \"ENQU\",\r\n \"FUGR\",\r\n \"INTF\",\r\n \"MSAG\",\r\n \"NROB\",\r\n \"PARA\",\r\n \"PROG\",\r\n \"SHLP\",\r\n \"SHMA\",\r\n \"SICF\",\r\n \"SMIM\",\r\n \"SRFC\",\r\n \"SUSO\",\r\n \"TABL\",\r\n \"TOBJ\",\r\n \"TRAN\",\r\n \"TTYP\",\r\n \"TYPE\",\r\n \"VIEW\",\r\n \"XSLT\",\r\n ],\r\n },\r\n \"unknown_types\": true,\r\n \"ambiguous_statement\": true,\r\n \"implement_methods\": true,\r\n \"begin_end_names\": true,\r\n \"check_syntax\": true,\r\n \"form_no_dash\": true,\r\n \"omit_preceding_zeros\": true,\r\n \"obsolete_statement\": {\r\n \"compute\": true,\r\n \"setExtended\": true,\r\n },\r\n \"forbidden_identifier\": {\r\n \"check\": [],\r\n },\r\n },\r\n};\r\n// todo, make sure nothing is overloaded, eg \"lines()\", there is a rule for this in abaplint now\r\n// hmm this ^ is okay? since lines will be prefixed with \"abap.builtin\"?\r\nclass Validation {\r\n constructor(options) {\r\n this.options = options;\r\n }\r\n run(reg) {\r\n var _a, _b, _c;\r\n if (((_a = this.options) === null || _a === void 0 ? void 0 : _a.ignoreSyntaxCheck) === true) {\r\n exports.config.rules.check_syntax = false;\r\n }\r\n else {\r\n exports.config.rules.check_syntax = true;\r\n }\r\n exports.config.rules.forbidden_identifier.check = [\"^unique\\\\d+$\"];\r\n if (((_b = this.options) === null || _b === void 0 ? void 0 : _b.keywords) === undefined) {\r\n for (const d of keywords_1.defaultKeywords) {\r\n const add = \"^\" + d + \"$\";\r\n exports.config.rules[\"forbidden_identifier\"][\"check\"].push(add);\r\n }\r\n }\r\n else {\r\n for (const d of this.options.keywords) {\r\n const add = \"^\" + d + \"$\";\r\n exports.config.rules[\"forbidden_identifier\"][\"check\"].push(add);\r\n }\r\n }\r\n if (((_c = this.options) === null || _c === void 0 ? void 0 : _c.unknownTypes) === \"runtimeError\") {\r\n // this is not a constant, just a regex that happens to not match anything\r\n exports.config.syntax.errorNamespace = \"VOID_EVERYTHING\";\r\n }\r\n const conf = new core_1.Config(JSON.stringify(exports.config));\r\n reg.setConfig(conf);\r\n const issues = reg.findIssues();\r\n return issues;\r\n }\r\n}\r\nexports.Validation = Validation;\r\n//# sourceMappingURL=validation.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/validation.js?");
15739
15739
 
15740
15740
  /***/ }),
15741
15741
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.3.74",
3
+ "version": "2.3.75",
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.74",
28
+ "@abaplint/transpiler": "^2.3.75",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",